vue-element-ui-x 1.0.51 → 1.1.0

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.
@@ -0,0 +1,1508 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 2351:
6
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
7
+
8
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
10
+ /* harmony export */ });
11
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
12
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
13
+ // Imports
14
+
15
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
16
+ // Module
17
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-353808b6]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.el-x-send-button[data-v-353808b6]{height:32px}.el-x-send-button .el-button[data-v-353808b6]{padding:0;width:32px;height:32px}.el-x-send-button .loading-svg[data-v-353808b6]{color:#409eff;width:100%}", ""]);
18
+ // Exports
19
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
20
+
21
+
22
+ /***/ }),
23
+
24
+ /***/ 2736:
25
+ /***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
26
+
27
+ /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
28
+ /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
29
+ // Imports
30
+
31
+ var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
32
+ // Module
33
+ ___CSS_LOADER_EXPORT___.push([module.id, ":root{--chat-primary: #1890ff;--chat-disabled: #e8e8e8;--chat-highlight: #40A9FF;--chat-text: #333;--chat-text-assistant: #666;--chat-text-secondary: #ccc;--chat-text-placeholder: #bfbfbf;--chat-box: #fff;--chat-box-shadow: 1px 3px 10px 2px rgba(6, 21, 50, .2);--chat-box-mark: rgba(0, 0, 0, .5);--chat-input: #F9F9F9;--chat-card: #F2F6FC;--chat-highlight-card: #E6F7FF;--chat-border: #f1f1f2;--chat-popover: #000;--chat-popover-text: #fff}@-webkit-keyframes antSpinMove{to{opacity:1}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antRotate{to{transform:rotate(405deg)}}@keyframes antRotate{to{transform:rotate(405deg)}}.ant-spin{font-size:14px;line-height:1.5;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";position:absolute;display:none;text-align:center;vertical-align:middle;opacity:0;transition:transform .3s cubic-bezier(.78,.14,.15,.86)}.ant-spin .ant-spin-dot{position:relative;display:inline-block;font-size:20px;width:1em;height:1em}.ant-spin .ant-spin-dot-spin{transform:rotate(45deg);animation-name:antRotate;animation-duration:1.2s;animation-iteration-count:infinite;animation-timing-function:linear}.ant-spin .ant-spin-dot-item{position:absolute;display:block;width:9px;height:9px;background-color:var(--chat-primary);border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation-name:antSpinMove;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear;animation-direction:alternate}.ant-spin .ant-spin-dot-item:nth-child(1){top:0;inset-inline-start:0}.ant-spin .ant-spin-dot-item:nth-child(2){top:0;inset-inline-end:0;animation-delay:.4s}.ant-spin .ant-spin-dot-item:nth-child(3){inset-inline-end:0;bottom:0;animation-delay:.8s}.ant-spin .ant-spin-dot-item:nth-child(4){bottom:0;inset-inline-start:0;animation-delay:1.2s}.ant-spin-spinning{position:static;display:inline-block;opacity:1}.chat-area-pc{position:relative;z-index:10}.chat-area-pc *{margin:0;padding:0;box-sizing:border-box;outline:none;text-indent:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:16px}@keyframes a-chat-dialog{0%{transform:scale(.6);opacity:.4}to{opacity:1;transform:scale(1)}}@keyframes a-chat-check-pc{0%{transform:scale(.4) translate(-50%,-50%);opacity:.4}to{opacity:1;transform:scale(1) translate(-50%,-50%)}}.chat-area-h5{position:relative;z-index:10}.chat-area-h5 *{margin:0;padding:0;box-sizing:border-box;outline:none;text-indent:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:16px}@keyframes a-popup-mark{0%{background:#0000}to{background:var(--chat-box-mark)}}@keyframes a-popup-mark-leave{0%{background:var(--chat-box-mark)}to{background:#0000}}@keyframes a-popup-main{0%{bottom:-100%}to{bottom:0}}@keyframes a-popup-main-leave{0%{bottom:0}to{bottom:-100%}}.chat-rich-text{width:100%;padding:10px;margin:0;background:transparent;border-radius:4px;outline:none;box-sizing:border-box;overflow-y:auto;font-size:16px;color:var(--chat-text);vertical-align:text-bottom;transition:all .4s ease;word-break:break-all}.chat-rich-text-disabled{cursor:not-allowed}.chat-dialog{position:relative;z-index:20;width:100%;height:0}.chat-tip-dialog{position:relative;z-index:21;width:100%;height:0}.call-user-dialog{position:absolute;z-index:2024;border-radius:4px;padding:4px;box-sizing:border-box;width:180px;overflow:hidden;background:var(--chat-box);box-shadow:var(--chat-box-shadow)}.call-user-dialog *{margin:0;padding:0;box-sizing:border-box}.call-user-dialog.chat-view-show{animation:a-chat-dialog .2s ease}.call-user-dialog .call-user-dialog-header{display:flex;align-items:center;justify-content:space-between;background:var(--chat-box);padding:6px 4px}.call-user-dialog .call-user-dialog-header .call-user-dialog-header-title{color:var(--chat-text);font-weight:700;font-size:14px}.call-user-dialog .call-user-dialog-header .call-user-dialog-header-check{color:var(--chat-primary);font-size:12px;cursor:pointer}.call-user-dialog .call-user-dialog-main{max-height:240px;overflow-y:auto}.call-user-dialog .call-user-dialog-item{display:flex;align-items:center;color:var(--chat-text-secondary);background:transparent;cursor:pointer;padding:4px;transition:all .3s ease;font-weight:700;font-size:14px;border-radius:4px}.call-user-dialog .call-user-dialog-item .call-user-dialog-item-name{transition:all .3s ease;color:var(--chat-text-secondary)}.call-user-dialog .call-user-dialog-item:hover{background:var(--chat-card);opacity:.7}.call-user-dialog .call-user-dialog-item:hover .call-user-dialog-item-name{color:var(--chat-primary)}.call-user-dialog .call-user-dialog-item.call-user-dialog-item-active{background:var(--chat-card);opacity:1}.call-user-dialog .call-user-dialog-item.call-user-dialog-item-active .call-user-dialog-item-name{color:var(--chat-primary)}.call-user-dialog .call-user-dialog-item.user-no-match{display:none}.call-user-dialog .call-user-dialog-loading{display:flex;align-items:center;justify-content:center;height:36px}.call-user-dialog .call-user-dialog-empty{display:flex;align-items:center;flex-direction:column;justify-content:center;padding:10px 0}.call-user-dialog .call-user-dialog-empty .match-empty-svg{width:auto;height:40px;margin-bottom:2px}.call-user-dialog .call-user-dialog-empty .empty-label{font-size:12px;color:var(--chat-text-secondary)}.call-user-popup{position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;background:var(--chat-box-mark)}.call-user-popup div,.call-user-popup p,.call-user-popup span,.call-user-popup label,.call-user-popup a,.call-user-popup ul,.call-user-popup li{margin:0;padding:0;box-sizing:border-box}.call-user-popup .call-user-popup-main{position:absolute;left:0;bottom:0;width:100%;height:86%;display:flex;flex-direction:column;background:var(--chat-box);border-radius:16px 16px 0 0;overflow:hidden;padding:14px}.call-user-popup .call-user-popup-header{display:flex;align-items:center}.call-user-popup .call-user-popup-header .popup-show{font-size:16px;color:var(--chat-text-assistant)}.call-user-popup .call-user-popup-header .popup-check{font-size:18px;color:var(--chat-primary);transition:color .3s ease}.call-user-popup .call-user-popup-header .popup-check.disabled{color:var(--chat-disabled)}.call-user-popup .call-user-popup-header .popup-title{flex:1;font-weight:700;font-size:21px;text-align:center;color:var(--chat-text)}.call-user-popup .call-user-popup-search{display:flex;align-items:center;margin-top:20px;background:var(--chat-input);height:44px;border-radius:4px;padding:0 15px}.call-user-popup .call-user-popup-search .call-user-popup-search-input{width:100%;height:100%;background:transparent;padding-left:8px;outline:none;border:none;font-size:16px;color:var(--chat-text)}.call-user-popup .call-user-popup-search .call-user-popup-search-input::-moz-placeholder{color:var(--chat-text-placeholder);opacity:1}.call-user-popup .call-user-popup-search .call-user-popup-search-input:-ms-input-placeholder{color:var(--chat-text-placeholder)}.call-user-popup .call-user-popup-search .call-user-popup-search-input::-webkit-input-placeholder{color:var(--chat-text-placeholder)}.call-user-popup .call-user-popup-search .call-user-popup-search-input:placeholder-shown{text-overflow:ellipsis}.call-user-popup .call-user-popup-search .icon-search{width:auto;height:30px}.call-user-popup .call-user-popup-body{flex:1;padding-top:25px;overflow-y:auto}.call-user-popup .call-user-popup-body .call-user-popup-item{position:relative;padding:15px 10px;display:flex;align-items:center;border-bottom:1px solid var(--chat-border)}.call-user-popup .call-user-popup-body .call-user-popup-item input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;opacity:0;box-sizing:border-box}.call-user-popup .call-user-popup-body .call-user-popup-item .user-popup-check-item-inner{position:relative;top:0;left:0;display:block;width:25px;height:25px;border-radius:50%;background-color:var(--chat-box);border:1px solid var(--chat-border);border-collapse:separate;transition:all .3s;box-sizing:border-box}.call-user-popup .call-user-popup-body .call-user-popup-item .user-popup-check-item-inner:after{position:absolute;top:50%;left:30%;display:table;width:5px;height:9px;border:3px solid var(--chat-box);border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-60%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:\" \"}.call-user-popup .call-user-popup-body .call-user-popup-item.user-popup-check-item-check .user-popup-check-item-inner{background-color:var(--chat-primary);border-color:var(--chat-primary)}.call-user-popup .call-user-popup-body .call-user-popup-item.user-popup-check-item-check .user-popup-check-item-inner:after{position:absolute;display:table;border:3px solid var(--chat-box);border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-60%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:\" \"}.call-user-popup .call-user-popup-body .call-user-dialog-item-sculpture{width:35px;height:35px;border-radius:4px}.call-user-popup .call-user-popup-body .call-user-dialog-item-sculpture span{font-size:16px}.call-user-popup .call-user-popup-body .call-user-dialog-item-name{padding-left:8px;font-size:16px;line-height:35px;color:var(--chat-text)}.call-user-popup .call-user-popup-empty{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center}.call-user-popup .call-user-popup-empty .empty-svg{width:auto;height:60px}.call-user-popup .call-user-popup-empty .empty-label{margin-top:10px;font-size:12px;color:var(--chat-text-secondary)}.call-user-popup .call-user-popup-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;height:36px}.call-user-popup .call-user-popup-loading .ant-spin{transform:scale(1.5)}.call-user-popup.chat-view-show{animation:a-popup-mark .3s ease}.call-user-popup.chat-view-show .call-user-popup-main{animation:a-popup-main .3s ease}.call-user-popup.chat-view-hidden{animation:a-popup-mark-leave .3s ease-in}.call-user-popup.chat-view-hidden .call-user-popup-main{animation:a-popup-main-leave .3s ease-in}.checkbox-dialog{position:fixed;top:0;left:0;margin:0;padding:0;width:100vw;height:100vh;box-sizing:border-box;background:var(--chat-box-mark);z-index:10000}.checkbox-dialog.chat-view-show .checkbox-dialog-container{transform-origin:0 0 0;animation:a-chat-check-pc .3s ease}.checkbox-dialog *{margin:0;padding:0;box-sizing:border-box}.checkbox-dialog .checkbox-dialog-container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:684px;height:540px;padding:14px 14px 0;border-radius:4px;background:var(--chat-box);box-shadow:var(--chat-box-shadow);overflow:hidden}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-header{display:flex;align-items:center;justify-content:space-between;height:22px;color:var(--chat-text-secondary);font-size:16px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-header .checkbox-dialog-container-header-close{cursor:pointer;transition:all .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-header .checkbox-dialog-container-header-close:hover{color:var(--chat-text-assistant)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body{display:flex;flex-direction:row;width:100%;height:calc(100% - 22px);padding-top:16px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box{position:relative;width:50%;height:100%;padding-top:20px;padding-bottom:20px;padding-left:20px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search{position:relative;padding-right:20px;margin-bottom:20px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input{position:relative;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:\"tnum\";display:inline-block;width:100%;height:32px;padding:4px 11px;color:var(--chat-text);font-size:14px;line-height:1.5;background-color:var(--chat-box);background-image:none;border:1px solid var(--chat-border);border-radius:4px;transition:all .3s}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input::-moz-placeholder{color:var(--chat-text-placeholder);opacity:1}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:-ms-input-placeholder{color:var(--chat-text-placeholder)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input::-webkit-input-placeholder{color:var(--chat-text-placeholder)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:placeholder-shown{text-overflow:ellipsis}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:focus,.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:hover{border-color:var(--chat-primary);border-right-width:1px!important}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:focus{outline:0}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags{width:100%;height:calc(100% - 98px);overflow-y:auto;overflow-x:hidden}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags:after{display:block;content:\"\";clear:both}@keyframes tag-scale{0%{transform:scale(0)}to{transform:scale(1)}}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .checkbox-dialog-tag-item{float:left;display:flex;align-items:center;justify-content:center;margin-right:8px;margin-bottom:6px;background:var(--chat-card);border-radius:4px;font-size:12px;color:var(--chat-text-assistant);padding:4px 8px;cursor:default;animation:tag-scale .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .checkbox-dialog-tag-item .checkbox-dialog-tag-item-close{cursor:pointer;margin-left:6px;color:var(--chat-text-secondary);transform:scale(.7);transition:color .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .checkbox-dialog-tag-item .checkbox-dialog-tag-item-close:hover{color:var(--chat-primary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .check-empty{height:40%;display:flex;flex-direction:column;align-items:center;justify-content:center}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .check-empty .check-empty-svg{width:auto;height:60px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .check-empty .check-empty-label{margin-top:10px;font-size:12px;color:var(--chat-text-secondary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option{position:absolute;left:20px;bottom:20px;display:flex;align-items:center}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn{position:relative;width:76px;height:36px;text-align:center;color:var(--chat-text-assistant);border:1px solid var(--chat-border);background:transparent;cursor:pointer;outline:none;text-indent:8px;letter-spacing:8px;border-radius:4px;font-size:14px;transition:all .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn.btn-submit{border:none;margin-right:16px;background:var(--chat-primary);color:var(--chat-box)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn.btn-submit.disabled{background:var(--chat-primary);opacity:.4;cursor:not-allowed}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn.btn-close:hover{border-color:var(--chat-primary);color:var(--chat-primary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search-group{color:var(--chat-text-assistant);line-height:1.5;list-style:none;font-feature-settings:\"tnum\";position:absolute;width:calc(100% - 20px);max-height:250px;top:calc(100% + 2px);left:0;z-index:1050;box-sizing:border-box;font-size:14px;font-variant:normal;background-color:var(--chat-box);border-radius:4px;outline:none;box-shadow:var(--chat-box-shadow);overflow-y:auto}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search-group .checkbox-dialog-search-empty{padding:34px 0;text-align:center;color:var(--chat-text-secondary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-right-box{width:50%;height:100%;padding-top:20px;border-left:1px solid var(--chat-border)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-right-box .checkbox-dialog-right-box-title{padding-left:20px;font-size:16px;height:22px;color:var(--chat-text-assistant);font-weight:700}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-right-box .checkbox-dialog-check-group{width:calc(100% + 14px);height:calc(100% - 22px);padding-top:8px;overflow-x:hidden;overflow-y:auto}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item{position:relative;display:flex;align-items:center;padding-left:20px;height:44px;font-size:14px;transition:all .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item:hover{background:var(--chat-card);cursor:pointer}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0;box-sizing:border-box;touch-action:manipulation}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item .checkbox-dialog-check-item-inner{position:relative;top:0;left:0;display:block;width:18px;height:18px;margin-right:12px;border-radius:50%;background-color:var(--chat-box);border:1px solid var(--chat-border);border-collapse:separate;transition:all .3s;box-sizing:border-box}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item .checkbox-dialog-check-item-inner:after{position:absolute;top:50%;left:22%;display:table;width:4px;height:8px;border:2px solid var(--chat-border);border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:\" \"}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item.checkbox-dialog-check-item-check .checkbox-dialog-check-item-inner{background-color:var(--chat-primary);border-color:var(--chat-primary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item.checkbox-dialog-check-item-check .checkbox-dialog-check-item-inner:after{position:absolute;display:table;border:2px solid var(--chat-box);border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:\" \"}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item .checkbox-dialog-check-item-label{display:flex;align-items:center;font-size:14px}.call-tag-dialog{position:absolute;z-index:2024;border-radius:4px;padding:4px;box-sizing:border-box;width:180px;overflow:hidden;background:var(--chat-box);box-shadow:var(--chat-box-shadow)}.call-tag-dialog.chat-view-show{animation:a-chat-dialog .2s ease}.call-tag-dialog .call-tag-dialog-header{display:flex;align-items:center;justify-content:space-between;background:var(--chat-box);padding:6px 4px}.call-tag-dialog .call-tag-dialog-header .call-tag-dialog-header-title{color:var(--chat-text);font-weight:700;font-size:14px}.call-tag-dialog .call-tag-dialog-main{max-height:240px;overflow-y:auto}.call-tag-dialog .call-tag-dialog-item{display:flex;align-items:center;color:var(--chat-text-secondary);background:transparent;cursor:pointer;padding:4px 8px;transition:all .3s ease;font-weight:700;font-size:14px;border-radius:4px}.call-tag-dialog .call-tag-dialog-item .call-tag-dialog-item-name{transition:all .3s ease;color:var(--chat-text-secondary)}.call-tag-dialog .call-tag-dialog-item:hover{background:var(--chat-card);opacity:.7}.call-tag-dialog .call-tag-dialog-item:hover .call-tag-dialog-item-name{color:var(--chat-primary)}.call-tag-dialog .call-tag-dialog-item.call-tag-dialog-item-active{background:var(--chat-card);opacity:1}.call-tag-dialog .call-tag-dialog-item.call-tag-dialog-item-active .call-tag-dialog-item-name{color:var(--chat-primary)}.call-tag-dialog .call-tag-dialog-item.tag-no-match{display:none}.chat-select-dialog{position:fixed;min-width:180px;z-index:2024;border-radius:4px;padding:4px;box-sizing:border-box;width:auto;background:var(--chat-box);box-shadow:var(--chat-box-shadow)}.chat-select-dialog .chat-select-dialog-header{display:flex;align-items:center;justify-content:space-between;background:var(--chat-box);padding:6px}.chat-select-dialog .chat-select-dialog-header .chat-select-dialog-header-title{color:var(--chat-text);font-weight:700;font-size:14px}.chat-select-dialog .chat-select-dialog-main{position:relative;z-index:3;max-height:280px;overflow-y:auto}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item{display:flex;align-items:center;color:var(--chat-text-secondary);background:transparent;cursor:pointer;padding:8px;transition:all .3s ease;font-weight:700;font-size:14px;border-radius:6px;min-height:42px}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item .chat-select-dialog-preview{width:42px;height:42px;border-radius:6px;flex-shrink:0;margin-right:12px}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item .chat-select-dialog-name{flex:1;transition:all .3s ease;color:var(--chat-text-secondary)}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item .chat-select-dialog-check{display:inline-block;margin-left:6px;font-size:12px;color:var(--chat-primary)}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item:hover{background:var(--chat-card);opacity:.8}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item:hover .chat-select-dialog-name{color:var(--chat-primary)}.chat-select-dialog .chat-select-arrow{position:absolute;z-index:2;pointer-events:none;width:16px;height:16px;overflow:hidden}.chat-select-dialog .chat-select-arrow:before{box-sizing:border-box;background:var(--chat-box);position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;clip-path:path(\"M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z\");content:\"\"}.chat-select-dialog .chat-select-arrow:after{box-sizing:border-box;content:\"\";position:absolute;width:9px;height:9px;bottom:0;inset-inline:0;margin:auto;border-radius:0 0 2px;transform:translateY(50%) rotate(-135deg);box-shadow:var(--chat-box-shadow);z-index:0;background:transparent;opacity:.25}.call-user-dialog-item-sculpture{display:flex;align-items:center;justify-content:center;width:24px;height:24px;margin-right:8px;border-radius:4px;overflow:hidden;background:var(--chat-primary);color:var(--chat-box);white-space:nowrap;font-size:12px}.call-user-dialog-item-sculpture *{margin:0;padding:0;box-sizing:border-box}.call-user-dialog-item-sculpture.is-avatar{background:var(--chat-box)}.call-user-dialog-item-sculpture.is-avatar img{width:100%;height:100%}.call-user-dialog-item-sculpture span{font-size:12px;color:var(--chat-box)}.call-user-dialog-item-name{flex:1;white-space:nowrap;line-height:24px;overflow:hidden;text-overflow:ellipsis;padding-right:10px;color:var(--chat-text-assistant);font-size:14px}.chat-select-dialog-main::-webkit-scrollbar,.call-user-dialog-main::-webkit-scrollbar,.call-tag-dialog-main::-webkit-scrollbar,.checkbox-dialog-check-group::-webkit-scrollbar,.checkbox-dialog-tags::-webkit-scrollbar{width:6px;height:6px}.chat-select-dialog-main::-webkit-scrollbar-thumb,.call-user-dialog-main::-webkit-scrollbar-thumb,.call-tag-dialog-main::-webkit-scrollbar-thumb,.checkbox-dialog-check-group::-webkit-scrollbar-thumb,.checkbox-dialog-tags::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #61b8b31a;background-color:#0003}.chat-select-dialog-main::-webkit-scrollbar-track,.call-user-dialog-main::-webkit-scrollbar-track,.call-tag-dialog-main::-webkit-scrollbar-track,.checkbox-dialog-check-group::-webkit-scrollbar-track,.checkbox-dialog-tags::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #57afbb1a;border-radius:10px;background:#ededed}.disable-scroll{overflow-y:hidden!important}.chat-placeholder-wrap{position:absolute;top:0;left:0;width:100%;margin:0;padding:10px;box-sizing:border-box;color:var(--chat-text-placeholder);pointer-events:none;font-style:oblique;word-break:break-all;z-index:11}.chat-tip-wrap{position:absolute;top:0;left:0;width:auto;height:100%;margin:0;padding:10px 6px 10px 10px;box-sizing:border-box;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:21}.chat-tip-wrap .chat-tip-tag{position:relative;padding:2px 6px;color:var(--chat-primary);border-radius:8px;pointer-events:visible;cursor:pointer;transition:background .3s ease}.chat-tip-wrap .chat-tip-tag .chat-tip-tag-txt{font-size:18px;font-weight:600;font-family:宋体}.chat-tip-wrap .chat-tip-tag .chat-tip-tag-close{top:-4px;right:-4px;position:absolute;font-size:12px;opacity:0;transition:all .3s ease;color:var(--chat-text)}.chat-tip-wrap .chat-tip-tag .chat-tip-tag-close svg{font-size:inherit}.chat-tip-wrap .chat-tip-tag:hover{background:var(--chat-card)}.chat-tip-wrap .chat-tip-tag:hover .chat-tip-tag-close{opacity:1}.chat-tip-popover{position:absolute}.chat-tip-popover .chat-tip-popover-main{display:flex;align-items:center;padding:8px 10px;background:var(--chat-popover);color:var(--chat-popover-text);font-size:13px;border-radius:8px}.chat-tip-popover .chat-tip-popover-main .chat-tip-popover-code{margin-left:4px;opacity:.7;font-size:12px}.chat-tip-popover .chat-tip-popover-main .chat-tip-popover-code.chat-view-show{display:none}.chat-tip-popover .chat-tip-popover-arrow{position:absolute;z-index:2;pointer-events:none;width:16px;height:16px;overflow:hidden;left:50%;transform:translate(-50%) rotate(-180deg)}.chat-tip-popover .chat-tip-popover-arrow:before{box-sizing:border-box;background:var(--chat-popover);position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;clip-path:path(\"M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z\");content:\"\"}.chat-img{min-width:20px;min-height:20px;max-width:100px;max-height:100px;vertical-align:bottom}.chat-tag{margin:0 1px}.chat-grid-input{word-break:break-all}.at-user,.at-tag{color:var(--chat-primary)}.at-select{display:inline-block;cursor:pointer;background:var(--chat-card);color:var(--chat-primary);padding:2px 6px;border-radius:10px;margin:2px;transition:all .3s ease}.at-select svg{margin-left:4px;font-size:12px;transition:all .3s ease}.at-select:hover{color:var(--chat-highlight);background:var(--chat-highlight-card)}.at-select.aim svg{transform:rotate(-180deg)}.at-input{padding:2px 6px;border-radius:10px;margin:0 2px;color:var(--chat-primary);cursor:text;background:var(--chat-card);line-height:1.8}.at-input .input-write{white-space:pre-wrap;word-break:break-all;word-wrap:break-word;padding-left:.1px}.at-input .input-tip{pointer-events:none;-webkit-user-select:none;user-select:none;opacity:.35;word-break:break-all}\n", ""]);
34
+ // Exports
35
+ /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (___CSS_LOADER_EXPORT___)));
36
+
37
+
38
+ /***/ }),
39
+
40
+ /***/ 4486:
41
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
42
+
43
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44
+ /* harmony export */ A: () => (/* binding */ normalizeComponent)
45
+ /* harmony export */ });
46
+ /* globals __VUE_SSR_CONTEXT__ */
47
+
48
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
49
+ // This module is a runtime utility for cleaner component module output and will
50
+ // be included in the final webpack user bundle.
51
+
52
+ function normalizeComponent(
53
+ scriptExports,
54
+ render,
55
+ staticRenderFns,
56
+ functionalTemplate,
57
+ injectStyles,
58
+ scopeId,
59
+ moduleIdentifier /* server only */,
60
+ shadowMode /* vue-cli only */
61
+ ) {
62
+ // Vue.extend constructor export interop
63
+ var options =
64
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
65
+
66
+ // render functions
67
+ if (render) {
68
+ options.render = render
69
+ options.staticRenderFns = staticRenderFns
70
+ options._compiled = true
71
+ }
72
+
73
+ // functional template
74
+ if (functionalTemplate) {
75
+ options.functional = true
76
+ }
77
+
78
+ // scopedId
79
+ if (scopeId) {
80
+ options._scopeId = 'data-v-' + scopeId
81
+ }
82
+
83
+ var hook
84
+ if (moduleIdentifier) {
85
+ // server build
86
+ hook = function (context) {
87
+ // 2.3 injection
88
+ context =
89
+ context || // cached call
90
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
91
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
92
+ // 2.2 with runInNewContext: true
93
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
94
+ context = __VUE_SSR_CONTEXT__
95
+ }
96
+ // inject component styles
97
+ if (injectStyles) {
98
+ injectStyles.call(this, context)
99
+ }
100
+ // register component module identifier for async chunk inferrence
101
+ if (context && context._registeredComponents) {
102
+ context._registeredComponents.add(moduleIdentifier)
103
+ }
104
+ }
105
+ // used by ssr in case component is cached and beforeCreate
106
+ // never gets called
107
+ options._ssrRegister = hook
108
+ } else if (injectStyles) {
109
+ hook = shadowMode
110
+ ? function () {
111
+ injectStyles.call(
112
+ this,
113
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
114
+ )
115
+ }
116
+ : injectStyles
117
+ }
118
+
119
+ if (hook) {
120
+ if (options.functional) {
121
+ // for template-only hot-reload because in that case the render fn doesn't
122
+ // go through the normalizer
123
+ options._injectStyles = hook
124
+ // register for functional component in vue file
125
+ var originalRender = options.render
126
+ options.render = function renderWithStyleInjection(h, context) {
127
+ hook.call(context)
128
+ return originalRender(h, context)
129
+ }
130
+ } else {
131
+ // inject component registration as beforeCreate hook
132
+ var existing = options.beforeCreate
133
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
134
+ }
135
+ }
136
+
137
+ return {
138
+ exports: scriptExports,
139
+ options: options
140
+ }
141
+ }
142
+
143
+
144
+ /***/ }),
145
+
146
+ /***/ 5072:
147
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148
+
149
+
150
+
151
+ var isOldIE = function isOldIE() {
152
+ var memo;
153
+ return function memorize() {
154
+ if (typeof memo === 'undefined') {
155
+ // Test for IE <= 9 as proposed by Browserhacks
156
+ // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
157
+ // Tests for existence of standard globals is to allow style-loader
158
+ // to operate correctly into non-standard environments
159
+ // @see https://github.com/webpack-contrib/style-loader/issues/177
160
+ memo = Boolean(window && document && document.all && !window.atob);
161
+ }
162
+
163
+ return memo;
164
+ };
165
+ }();
166
+
167
+ var getTarget = function getTarget() {
168
+ var memo = {};
169
+ return function memorize(target) {
170
+ if (typeof memo[target] === 'undefined') {
171
+ var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
172
+
173
+ if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
174
+ try {
175
+ // This will throw an exception if access to iframe is blocked
176
+ // due to cross-origin restrictions
177
+ styleTarget = styleTarget.contentDocument.head;
178
+ } catch (e) {
179
+ // istanbul ignore next
180
+ styleTarget = null;
181
+ }
182
+ }
183
+
184
+ memo[target] = styleTarget;
185
+ }
186
+
187
+ return memo[target];
188
+ };
189
+ }();
190
+
191
+ var stylesInDom = [];
192
+
193
+ function getIndexByIdentifier(identifier) {
194
+ var result = -1;
195
+
196
+ for (var i = 0; i < stylesInDom.length; i++) {
197
+ if (stylesInDom[i].identifier === identifier) {
198
+ result = i;
199
+ break;
200
+ }
201
+ }
202
+
203
+ return result;
204
+ }
205
+
206
+ function modulesToDom(list, options) {
207
+ var idCountMap = {};
208
+ var identifiers = [];
209
+
210
+ for (var i = 0; i < list.length; i++) {
211
+ var item = list[i];
212
+ var id = options.base ? item[0] + options.base : item[0];
213
+ var count = idCountMap[id] || 0;
214
+ var identifier = "".concat(id, " ").concat(count);
215
+ idCountMap[id] = count + 1;
216
+ var index = getIndexByIdentifier(identifier);
217
+ var obj = {
218
+ css: item[1],
219
+ media: item[2],
220
+ sourceMap: item[3]
221
+ };
222
+
223
+ if (index !== -1) {
224
+ stylesInDom[index].references++;
225
+ stylesInDom[index].updater(obj);
226
+ } else {
227
+ stylesInDom.push({
228
+ identifier: identifier,
229
+ updater: addStyle(obj, options),
230
+ references: 1
231
+ });
232
+ }
233
+
234
+ identifiers.push(identifier);
235
+ }
236
+
237
+ return identifiers;
238
+ }
239
+
240
+ function insertStyleElement(options) {
241
+ var style = document.createElement('style');
242
+ var attributes = options.attributes || {};
243
+
244
+ if (typeof attributes.nonce === 'undefined') {
245
+ var nonce = true ? __webpack_require__.nc : 0;
246
+
247
+ if (nonce) {
248
+ attributes.nonce = nonce;
249
+ }
250
+ }
251
+
252
+ Object.keys(attributes).forEach(function (key) {
253
+ style.setAttribute(key, attributes[key]);
254
+ });
255
+
256
+ if (typeof options.insert === 'function') {
257
+ options.insert(style);
258
+ } else {
259
+ var target = getTarget(options.insert || 'head');
260
+
261
+ if (!target) {
262
+ throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
263
+ }
264
+
265
+ target.appendChild(style);
266
+ }
267
+
268
+ return style;
269
+ }
270
+
271
+ function removeStyleElement(style) {
272
+ // istanbul ignore if
273
+ if (style.parentNode === null) {
274
+ return false;
275
+ }
276
+
277
+ style.parentNode.removeChild(style);
278
+ }
279
+ /* istanbul ignore next */
280
+
281
+
282
+ var replaceText = function replaceText() {
283
+ var textStore = [];
284
+ return function replace(index, replacement) {
285
+ textStore[index] = replacement;
286
+ return textStore.filter(Boolean).join('\n');
287
+ };
288
+ }();
289
+
290
+ function applyToSingletonTag(style, index, remove, obj) {
291
+ var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
292
+
293
+ /* istanbul ignore if */
294
+
295
+ if (style.styleSheet) {
296
+ style.styleSheet.cssText = replaceText(index, css);
297
+ } else {
298
+ var cssNode = document.createTextNode(css);
299
+ var childNodes = style.childNodes;
300
+
301
+ if (childNodes[index]) {
302
+ style.removeChild(childNodes[index]);
303
+ }
304
+
305
+ if (childNodes.length) {
306
+ style.insertBefore(cssNode, childNodes[index]);
307
+ } else {
308
+ style.appendChild(cssNode);
309
+ }
310
+ }
311
+ }
312
+
313
+ function applyToTag(style, options, obj) {
314
+ var css = obj.css;
315
+ var media = obj.media;
316
+ var sourceMap = obj.sourceMap;
317
+
318
+ if (media) {
319
+ style.setAttribute('media', media);
320
+ } else {
321
+ style.removeAttribute('media');
322
+ }
323
+
324
+ if (sourceMap && typeof btoa !== 'undefined') {
325
+ css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
326
+ } // For old IE
327
+
328
+ /* istanbul ignore if */
329
+
330
+
331
+ if (style.styleSheet) {
332
+ style.styleSheet.cssText = css;
333
+ } else {
334
+ while (style.firstChild) {
335
+ style.removeChild(style.firstChild);
336
+ }
337
+
338
+ style.appendChild(document.createTextNode(css));
339
+ }
340
+ }
341
+
342
+ var singleton = null;
343
+ var singletonCounter = 0;
344
+
345
+ function addStyle(obj, options) {
346
+ var style;
347
+ var update;
348
+ var remove;
349
+
350
+ if (options.singleton) {
351
+ var styleIndex = singletonCounter++;
352
+ style = singleton || (singleton = insertStyleElement(options));
353
+ update = applyToSingletonTag.bind(null, style, styleIndex, false);
354
+ remove = applyToSingletonTag.bind(null, style, styleIndex, true);
355
+ } else {
356
+ style = insertStyleElement(options);
357
+ update = applyToTag.bind(null, style, options);
358
+
359
+ remove = function remove() {
360
+ removeStyleElement(style);
361
+ };
362
+ }
363
+
364
+ update(obj);
365
+ return function updateStyle(newObj) {
366
+ if (newObj) {
367
+ if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
368
+ return;
369
+ }
370
+
371
+ update(obj = newObj);
372
+ } else {
373
+ remove();
374
+ }
375
+ };
376
+ }
377
+
378
+ module.exports = function (list, options) {
379
+ options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
380
+ // tags it will allow on a page
381
+
382
+ if (!options.singleton && typeof options.singleton !== 'boolean') {
383
+ options.singleton = isOldIE();
384
+ }
385
+
386
+ list = list || [];
387
+ var lastIdentifiers = modulesToDom(list, options);
388
+ return function update(newList) {
389
+ newList = newList || [];
390
+
391
+ if (Object.prototype.toString.call(newList) !== '[object Array]') {
392
+ return;
393
+ }
394
+
395
+ for (var i = 0; i < lastIdentifiers.length; i++) {
396
+ var identifier = lastIdentifiers[i];
397
+ var index = getIndexByIdentifier(identifier);
398
+ stylesInDom[index].references--;
399
+ }
400
+
401
+ var newLastIdentifiers = modulesToDom(newList, options);
402
+
403
+ for (var _i = 0; _i < lastIdentifiers.length; _i++) {
404
+ var _identifier = lastIdentifiers[_i];
405
+
406
+ var _index = getIndexByIdentifier(_identifier);
407
+
408
+ if (stylesInDom[_index].references === 0) {
409
+ stylesInDom[_index].updater();
410
+
411
+ stylesInDom.splice(_index, 1);
412
+ }
413
+ }
414
+
415
+ lastIdentifiers = newLastIdentifiers;
416
+ };
417
+ };
418
+
419
+ /***/ }),
420
+
421
+ /***/ 6021:
422
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
423
+
424
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
425
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
426
+ /* harmony export */ });
427
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
428
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
429
+ // Imports
430
+
431
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
432
+ // Module
433
+ ___CSS_LOADER_EXPORT___.push([module.id, ".el-x-send-button .el-button .el-icon-brush[data-v-3e37542a]{transform:rotate(180deg)}", ""]);
434
+ // Exports
435
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
436
+
437
+
438
+ /***/ }),
439
+
440
+ /***/ 6314:
441
+ /***/ ((module) => {
442
+
443
+
444
+
445
+ /*
446
+ MIT License http://www.opensource.org/licenses/mit-license.php
447
+ Author Tobias Koppers @sokra
448
+ */
449
+ // css base code, injected by the css-loader
450
+ // eslint-disable-next-line func-names
451
+ module.exports = function (cssWithMappingToString) {
452
+ var list = []; // return the list of modules as css string
453
+
454
+ list.toString = function toString() {
455
+ return this.map(function (item) {
456
+ var content = cssWithMappingToString(item);
457
+
458
+ if (item[2]) {
459
+ return "@media ".concat(item[2], " {").concat(content, "}");
460
+ }
461
+
462
+ return content;
463
+ }).join("");
464
+ }; // import a list of modules into the list
465
+ // eslint-disable-next-line func-names
466
+
467
+
468
+ list.i = function (modules, mediaQuery, dedupe) {
469
+ if (typeof modules === "string") {
470
+ // eslint-disable-next-line no-param-reassign
471
+ modules = [[null, modules, ""]];
472
+ }
473
+
474
+ var alreadyImportedModules = {};
475
+
476
+ if (dedupe) {
477
+ for (var i = 0; i < this.length; i++) {
478
+ // eslint-disable-next-line prefer-destructuring
479
+ var id = this[i][0];
480
+
481
+ if (id != null) {
482
+ alreadyImportedModules[id] = true;
483
+ }
484
+ }
485
+ }
486
+
487
+ for (var _i = 0; _i < modules.length; _i++) {
488
+ var item = [].concat(modules[_i]);
489
+
490
+ if (dedupe && alreadyImportedModules[item[0]]) {
491
+ // eslint-disable-next-line no-continue
492
+ continue;
493
+ }
494
+
495
+ if (mediaQuery) {
496
+ if (!item[2]) {
497
+ item[2] = mediaQuery;
498
+ } else {
499
+ item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
500
+ }
501
+ }
502
+
503
+ list.push(item);
504
+ }
505
+ };
506
+
507
+ return list;
508
+ };
509
+
510
+ /***/ }),
511
+
512
+ /***/ 9125:
513
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
514
+
515
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
516
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
517
+ /* harmony export */ });
518
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
519
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
520
+ // Imports
521
+
522
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
523
+ // Module
524
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-8ce301dc]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.el-editor-sender-wrap[data-v-8ce301dc]{position:relative;width:100%;box-sizing:border-box;transition:background .3s;border-radius:calc(4px*2);border-color:#dcdfe6;box-shadow:0 1px 2px 0 rgba(0,0,0,.03),0 1px 6px -1px rgba(0,0,0,.02),0 2px 4px 0 rgba(0,0,0,.02);border-width:0;border-style:solid}.el-editor-sender-wrap[data-v-8ce301dc]:after{content:\"\";position:absolute;inset:0;pointer-events:none;transition:border-color .3s;border-radius:inherit;border-style:inherit;border-color:inherit;border-width:1px}.el-editor-sender-wrap[data-v-8ce301dc]:focus-within{box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border-color:#409eff}.el-editor-sender-wrap[data-v-8ce301dc]:focus-within::after{border-width:2px}.el-editor-sender-wrap .el-editor-sender-header[data-v-8ce301dc]{display:flex;flex-direction:column;gap:8px;width:100%;margin:0;padding:0}.el-editor-sender-wrap .el-editor-sender-header .el-editor-sender-header-container[data-v-8ce301dc]{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#dcdfe6}.el-editor-sender-wrap .el-editor-sender-content[data-v-8ce301dc]{display:flex;width:100%;gap:8px;padding-block:12px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;align-items:flex-end}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-prefix[data-v-8ce301dc]{flex:none}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room[data-v-8ce301dc]{position:relative;width:100%;height:100%;display:flex;align-items:center;flex-direction:column;align-self:center;box-sizing:border-box}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc]{flex-shrink:0;width:100%;font-size:14px;min-height:26px;line-height:24px;box-sizing:border-box;overflow-y:auto;overflow-x:hidden}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-rich-text{font-family:inherit;padding:0;font-size:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-rich-text .chat-grid-wrap{font-size:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-rich-text .chat-grid-wrap span{font-size:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-placeholder-wrap{font-family:inherit;font-style:normal;color:#c0c4cc;padding:0;font-weight:bold;font-size:inherit;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-tip-wrap{transform:translateY(-2px);padding:0 6px 0 0}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-tip-wrap .chat-tip-tag-txt{font-size:16px;font-family:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room[data-v-8ce301dc] .chat-tip-popover{padding-bottom:10px}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-action-list .el-editor-sender-action-list-presets[data-v-8ce301dc]{display:flex;gap:8px;flex-direction:row-reverse}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown[data-v-8ce301dc]{display:flex;flex-direction:column;align-items:initial}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown .el-editor-sender-updown-action-list[data-v-8ce301dc]{display:flex;justify-content:space-between;gap:8px}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown .el-editor-sender-updown-action-list .el-editor-sender-prefix[data-v-8ce301dc]{flex:initial}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown .el-editor-sender-updown-action-list .el-editor-sender-action-list[data-v-8ce301dc]{margin-left:auto}.el-editor-sender-wrap .el-editor-sender-footer[data-v-8ce301dc]{border-top-width:1px;border-top-style:solid;border-top-color:#dcdfe6}.el-editor-sender-wrap .slide-enter-active[data-v-8ce301dc],.el-editor-sender-wrap .slide-leave-active[data-v-8ce301dc]{height:calc-size(max-content,size);opacity:1;transition:height var(--el-editor-sender-header-duration),opacity var(--el-editor-sender-header-duration),border var(--el-editor-sender-header-duration);overflow:hidden}.el-editor-sender-wrap .slide-enter[data-v-8ce301dc],.el-editor-sender-wrap .slide-leave-to[data-v-8ce301dc]{height:0;opacity:0 !important}", ""]);
525
+ // Exports
526
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
527
+
528
+
529
+ /***/ })
530
+
531
+ /******/ });
532
+ /************************************************************************/
533
+ /******/ // The module cache
534
+ /******/ var __webpack_module_cache__ = {};
535
+ /******/
536
+ /******/ // The require function
537
+ /******/ function __webpack_require__(moduleId) {
538
+ /******/ // Check if module is in cache
539
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
540
+ /******/ if (cachedModule !== undefined) {
541
+ /******/ return cachedModule.exports;
542
+ /******/ }
543
+ /******/ // Create a new module (and put it into the cache)
544
+ /******/ var module = __webpack_module_cache__[moduleId] = {
545
+ /******/ id: moduleId,
546
+ /******/ // no module.loaded needed
547
+ /******/ exports: {}
548
+ /******/ };
549
+ /******/
550
+ /******/ // Execute the module function
551
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
552
+ /******/
553
+ /******/ // Return the exports of the module
554
+ /******/ return module.exports;
555
+ /******/ }
556
+ /******/
557
+ /************************************************************************/
558
+ /******/ /* webpack/runtime/compat get default export */
559
+ /******/ (() => {
560
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
561
+ /******/ __webpack_require__.n = (module) => {
562
+ /******/ var getter = module && module.__esModule ?
563
+ /******/ () => (module['default']) :
564
+ /******/ () => (module);
565
+ /******/ __webpack_require__.d(getter, { a: getter });
566
+ /******/ return getter;
567
+ /******/ };
568
+ /******/ })();
569
+ /******/
570
+ /******/ /* webpack/runtime/define property getters */
571
+ /******/ (() => {
572
+ /******/ // define getter functions for harmony exports
573
+ /******/ __webpack_require__.d = (exports, definition) => {
574
+ /******/ for(var key in definition) {
575
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
576
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
577
+ /******/ }
578
+ /******/ }
579
+ /******/ };
580
+ /******/ })();
581
+ /******/
582
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
583
+ /******/ (() => {
584
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
585
+ /******/ })();
586
+ /******/
587
+ /******/ /* webpack/runtime/make namespace object */
588
+ /******/ (() => {
589
+ /******/ // define __esModule on exports
590
+ /******/ __webpack_require__.r = (exports) => {
591
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
592
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
593
+ /******/ }
594
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
595
+ /******/ };
596
+ /******/ })();
597
+ /******/
598
+ /******/ /* webpack/runtime/nonce */
599
+ /******/ (() => {
600
+ /******/ __webpack_require__.nc = undefined;
601
+ /******/ })();
602
+ /******/
603
+ /************************************************************************/
604
+ var __webpack_exports__ = {};
605
+ // ESM COMPAT FLAG
606
+ __webpack_require__.r(__webpack_exports__);
607
+
608
+ // EXPORTS
609
+ __webpack_require__.d(__webpack_exports__, {
610
+ "default": () => (/* binding */ EditorSender)
611
+ });
612
+
613
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=template&id=8ce301dc&scoped=true
614
+ var render = function render() {
615
+ var _vm = this,
616
+ _c = _vm._self._c;
617
+ return _c("div", {
618
+ staticClass: "el-editor-sender-wrap",
619
+ style: {
620
+ "--el-editor-sender-header-duration": `${_vm.headerAnimationTimer}ms`
621
+ }
622
+ }, [_c("transition", {
623
+ attrs: {
624
+ name: "slide"
625
+ }
626
+ }, [_vm.$slots.header ? _c("div", {
627
+ staticClass: "el-editor-sender-header"
628
+ }, [_c("div", {
629
+ staticClass: "el-editor-sender-header-container"
630
+ }, [_vm._t("header")], 2)]) : _vm._e()]), _vm._v(" "), _c("div", {
631
+ staticClass: "el-editor-sender-content",
632
+ class: {
633
+ "content-variant-updown": _vm.variant === "updown"
634
+ },
635
+ on: {
636
+ mousedown: _vm.onContentMouseDown
637
+ }
638
+ }, [_vm.$slots.prefix && _vm.variant === "default" ? _c("div", {
639
+ staticClass: "el-editor-sender-prefix"
640
+ }, [_vm._t("prefix")], 2) : _vm._e(), _vm._v(" "), _c("div", {
641
+ staticClass: "el-editor-sender-chat-room",
642
+ on: {
643
+ mousedown: function ($event) {
644
+ $event.stopPropagation();
645
+ return (() => {}).apply(null, arguments);
646
+ }
647
+ }
648
+ }, [_c("div", {
649
+ ref: "container",
650
+ staticClass: "el-editor-sender-chat",
651
+ style: {
652
+ ..._vm.customStyle
653
+ }
654
+ })]), _vm._v(" "), _vm.variant === "default" ? _c("div", {
655
+ staticClass: "el-editor-sender-action-list"
656
+ }, [_vm._t("action-list", function () {
657
+ return [_c("div", {
658
+ staticClass: "el-editor-sender-action-list-presets"
659
+ }, [!_vm.loading ? _c("SendButton", {
660
+ attrs: {
661
+ disabled: _vm.chatState.isEmpty || _vm.disabled
662
+ },
663
+ on: {
664
+ submit: _vm.onSubmit
665
+ }
666
+ }) : _vm._e(), _vm._v(" "), _vm.loading ? _c("LoadingButton", {
667
+ on: {
668
+ cancel: _vm.onCancel
669
+ }
670
+ }) : _vm._e(), _vm._v(" "), _vm.clearable ? _c("ClearButton", {
671
+ attrs: {
672
+ disabled: _vm.chatState.isEmpty || _vm.disabled
673
+ },
674
+ on: {
675
+ clear: _vm.onClear
676
+ }
677
+ }) : _vm._e()], 1)];
678
+ })], 2) : _vm.variant === "updown" ? _c("div", {
679
+ staticClass: "el-editor-sender-updown-action-list"
680
+ }, [_vm.$slots.prefix ? _c("div", {
681
+ staticClass: "el-editor-sender-prefix"
682
+ }, [_vm._t("prefix")], 2) : _vm._e(), _vm._v(" "), _c("div", {
683
+ staticClass: "el-editor-sender-action-list"
684
+ }, [_vm._t("action-list", function () {
685
+ return [_c("div", {
686
+ staticClass: "el-editor-sender-action-list-presets"
687
+ }, [!_vm.loading ? _c("SendButton", {
688
+ attrs: {
689
+ disabled: _vm.chatState.isEmpty || _vm.disabled
690
+ },
691
+ on: {
692
+ submit: _vm.onSubmit
693
+ }
694
+ }) : _vm._e(), _vm._v(" "), _vm.loading ? _c("LoadingButton", {
695
+ on: {
696
+ cancel: _vm.onCancel
697
+ }
698
+ }) : _vm._e(), _vm._v(" "), _vm.clearable ? _c("ClearButton", {
699
+ attrs: {
700
+ disabled: _vm.chatState.isEmpty || _vm.disabled
701
+ },
702
+ on: {
703
+ clear: _vm.onClear
704
+ }
705
+ }) : _vm._e()], 1)];
706
+ })], 2)]) : _vm._e()]), _vm._v(" "), _c("transition", {
707
+ attrs: {
708
+ name: "slide"
709
+ }
710
+ }, [_vm.$slots.footer ? _c("div", {
711
+ staticClass: "el-editor-sender-footer"
712
+ }, [_vm._t("footer")], 2) : _vm._e()])], 1);
713
+ };
714
+ var staticRenderFns = [];
715
+ render._withStripped = true;
716
+
717
+ ;// ./src/components/EditorSender/src/main.vue?vue&type=template&id=8ce301dc&scoped=true
718
+
719
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=template&id=3e37542a&scoped=true
720
+ var ClearButtonvue_type_template_id_3e37542a_scoped_true_render = function render() {
721
+ var _vm = this,
722
+ _c = _vm._self._c;
723
+ return _c("div", {
724
+ staticClass: "el-x-send-button"
725
+ }, [_c("el-button", {
726
+ attrs: {
727
+ circle: "",
728
+ disabled: _vm.disabled,
729
+ size: "small"
730
+ },
731
+ on: {
732
+ click: function ($event) {
733
+ return _vm.$emit("clear");
734
+ }
735
+ }
736
+ }, [_c("i", {
737
+ staticClass: "el-icon-brush"
738
+ })])], 1);
739
+ };
740
+ var ClearButtonvue_type_template_id_3e37542a_scoped_true_staticRenderFns = [];
741
+ ClearButtonvue_type_template_id_3e37542a_scoped_true_render._withStripped = true;
742
+
743
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue?vue&type=template&id=3e37542a&scoped=true
744
+
745
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=script&lang=js
746
+ /* harmony default export */ const ClearButtonvue_type_script_lang_js = ({
747
+ name: 'ClearButton',
748
+ props: {
749
+ disabled: {
750
+ type: Boolean,
751
+ default: false
752
+ }
753
+ }
754
+ });
755
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue?vue&type=script&lang=js
756
+ /* harmony default export */ const components_ClearButtonvue_type_script_lang_js = (ClearButtonvue_type_script_lang_js);
757
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
758
+ var injectStylesIntoStyleTag = __webpack_require__(5072);
759
+ var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
760
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=style&index=0&id=3e37542a&prod&scoped=true&lang=scss
761
+ var ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss = __webpack_require__(6021);
762
+ ;// ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=style&index=0&id=3e37542a&prod&scoped=true&lang=scss
763
+
764
+
765
+
766
+ var options = {};
767
+
768
+ options.insert = "head";
769
+ options.singleton = false;
770
+
771
+ var update = injectStylesIntoStyleTag_default()(ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss/* default */.A, options);
772
+
773
+
774
+
775
+ /* harmony default export */ const components_ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss = (ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss/* default */.A.locals || {});
776
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue?vue&type=style&index=0&id=3e37542a&prod&scoped=true&lang=scss
777
+
778
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
779
+ var componentNormalizer = __webpack_require__(4486);
780
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue
781
+
782
+
783
+
784
+ ;
785
+
786
+
787
+ /* normalize component */
788
+
789
+ var component = (0,componentNormalizer/* default */.A)(
790
+ components_ClearButtonvue_type_script_lang_js,
791
+ ClearButtonvue_type_template_id_3e37542a_scoped_true_render,
792
+ ClearButtonvue_type_template_id_3e37542a_scoped_true_staticRenderFns,
793
+ false,
794
+ null,
795
+ "3e37542a",
796
+ null
797
+
798
+ )
799
+
800
+ /* harmony default export */ const ClearButton = (component.exports);
801
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=template&id=353808b6&scoped=true
802
+ var LoadingButtonvue_type_template_id_353808b6_scoped_true_render = function render() {
803
+ var _vm = this,
804
+ _c = _vm._self._c;
805
+ return _c("div", {
806
+ staticClass: "el-x-send-button"
807
+ }, [_c("el-button", {
808
+ attrs: {
809
+ circle: "",
810
+ size: "small"
811
+ },
812
+ on: {
813
+ click: function ($event) {
814
+ return _vm.$emit("cancel");
815
+ }
816
+ }
817
+ }, [_c("loading", {
818
+ staticClass: "loading-svg"
819
+ })], 1)], 1);
820
+ };
821
+ var LoadingButtonvue_type_template_id_353808b6_scoped_true_staticRenderFns = [];
822
+ LoadingButtonvue_type_template_id_353808b6_scoped_true_render._withStripped = true;
823
+
824
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=template&id=353808b6&scoped=true
825
+
826
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/Loading.vue?vue&type=template&id=0c9c176e&scoped=true
827
+ var Loadingvue_type_template_id_0c9c176e_scoped_true_render = function render() {
828
+ var _vm = this,
829
+ _c = _vm._self._c;
830
+ return _c("svg", {
831
+ attrs: {
832
+ viewBox: "0 0 1000 1000",
833
+ xmlns: "http://www.w3.org/2000/svg",
834
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
835
+ }
836
+ }, [_c("title", [_vm._v("Loading")]), _vm._v(" "), _c("rect", {
837
+ attrs: {
838
+ fill: "currentColor",
839
+ height: "250",
840
+ rx: "24",
841
+ ry: "24",
842
+ width: "250",
843
+ x: "375",
844
+ y: "375"
845
+ }
846
+ }), _vm._v(" "), _c("circle", {
847
+ attrs: {
848
+ cx: "500",
849
+ cy: "500",
850
+ fill: "none",
851
+ r: "450",
852
+ stroke: "currentColor",
853
+ "stroke-width": "100",
854
+ opacity: "0.45"
855
+ }
856
+ }), _vm._v(" "), _c("circle", {
857
+ attrs: {
858
+ cx: "500",
859
+ cy: "500",
860
+ fill: "none",
861
+ r: "450",
862
+ stroke: "currentColor",
863
+ "stroke-width": "100",
864
+ "stroke-dasharray": "600 9999999"
865
+ }
866
+ }, [_c("animateTransform", {
867
+ attrs: {
868
+ attributeName: "transform",
869
+ dur: "1s",
870
+ from: "0 500 500",
871
+ repeatCount: "indefinite",
872
+ to: "360 500 500",
873
+ type: "rotate"
874
+ }
875
+ })], 1)]);
876
+ };
877
+ var Loadingvue_type_template_id_0c9c176e_scoped_true_staticRenderFns = [];
878
+ Loadingvue_type_template_id_0c9c176e_scoped_true_render._withStripped = true;
879
+
880
+ ;// ./src/components/EditorSender/src/components/Loading.vue?vue&type=template&id=0c9c176e&scoped=true
881
+
882
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/Loading.vue?vue&type=script&lang=js
883
+ /* harmony default export */ const Loadingvue_type_script_lang_js = ({
884
+ name: 'Loading'
885
+ });
886
+ ;// ./src/components/EditorSender/src/components/Loading.vue?vue&type=script&lang=js
887
+ /* harmony default export */ const components_Loadingvue_type_script_lang_js = (Loadingvue_type_script_lang_js);
888
+ ;// ./src/components/EditorSender/src/components/Loading.vue
889
+
890
+
891
+
892
+
893
+
894
+ /* normalize component */
895
+ ;
896
+ var Loading_component = (0,componentNormalizer/* default */.A)(
897
+ components_Loadingvue_type_script_lang_js,
898
+ Loadingvue_type_template_id_0c9c176e_scoped_true_render,
899
+ Loadingvue_type_template_id_0c9c176e_scoped_true_staticRenderFns,
900
+ false,
901
+ null,
902
+ "0c9c176e",
903
+ null
904
+
905
+ )
906
+
907
+ /* harmony default export */ const Loading = (Loading_component.exports);
908
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=script&lang=js
909
+
910
+ /* harmony default export */ const LoadingButtonvue_type_script_lang_js = ({
911
+ name: 'LoadingButton',
912
+ components: {
913
+ Loading: Loading
914
+ }
915
+ });
916
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=script&lang=js
917
+ /* harmony default export */ const components_LoadingButtonvue_type_script_lang_js = (LoadingButtonvue_type_script_lang_js);
918
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=style&index=0&id=353808b6&prod&scoped=true&lang=scss
919
+ var LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss = __webpack_require__(2351);
920
+ ;// ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=style&index=0&id=353808b6&prod&scoped=true&lang=scss
921
+
922
+
923
+
924
+ var LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options = {};
925
+
926
+ LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options.insert = "head";
927
+ LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options.singleton = false;
928
+
929
+ var LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_update = injectStylesIntoStyleTag_default()(LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss/* default */.A, LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options);
930
+
931
+
932
+
933
+ /* harmony default export */ const components_LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss = (LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss/* default */.A.locals || {});
934
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=style&index=0&id=353808b6&prod&scoped=true&lang=scss
935
+
936
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue
937
+
938
+
939
+
940
+ ;
941
+
942
+
943
+ /* normalize component */
944
+
945
+ var LoadingButton_component = (0,componentNormalizer/* default */.A)(
946
+ components_LoadingButtonvue_type_script_lang_js,
947
+ LoadingButtonvue_type_template_id_353808b6_scoped_true_render,
948
+ LoadingButtonvue_type_template_id_353808b6_scoped_true_staticRenderFns,
949
+ false,
950
+ null,
951
+ "353808b6",
952
+ null
953
+
954
+ )
955
+
956
+ /* harmony default export */ const LoadingButton = (LoadingButton_component.exports);
957
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/SendButton.vue?vue&type=template&id=2e5f663d&scoped=true
958
+ var SendButtonvue_type_template_id_2e5f663d_scoped_true_render = function render() {
959
+ var _vm = this,
960
+ _c = _vm._self._c;
961
+ return _c("div", {
962
+ staticClass: "el-x-send-button"
963
+ }, [_c("el-button", {
964
+ attrs: {
965
+ circle: "",
966
+ disabled: _vm.disabled,
967
+ size: "small"
968
+ },
969
+ on: {
970
+ click: function ($event) {
971
+ return _vm.$emit("submit");
972
+ }
973
+ }
974
+ }, [_c("i", {
975
+ staticClass: "el-icon-top"
976
+ })])], 1);
977
+ };
978
+ var SendButtonvue_type_template_id_2e5f663d_scoped_true_staticRenderFns = [];
979
+ SendButtonvue_type_template_id_2e5f663d_scoped_true_render._withStripped = true;
980
+
981
+ ;// ./src/components/EditorSender/src/components/SendButton.vue?vue&type=template&id=2e5f663d&scoped=true
982
+
983
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/SendButton.vue?vue&type=script&lang=js
984
+ /* harmony default export */ const SendButtonvue_type_script_lang_js = ({
985
+ name: 'SendButton',
986
+ props: {
987
+ disabled: {
988
+ type: Boolean,
989
+ default: false
990
+ }
991
+ }
992
+ });
993
+ ;// ./src/components/EditorSender/src/components/SendButton.vue?vue&type=script&lang=js
994
+ /* harmony default export */ const components_SendButtonvue_type_script_lang_js = (SendButtonvue_type_script_lang_js);
995
+ ;// ./src/components/EditorSender/src/components/SendButton.vue
996
+
997
+
998
+
999
+
1000
+
1001
+ /* normalize component */
1002
+ ;
1003
+ var SendButton_component = (0,componentNormalizer/* default */.A)(
1004
+ components_SendButtonvue_type_script_lang_js,
1005
+ SendButtonvue_type_template_id_2e5f663d_scoped_true_render,
1006
+ SendButtonvue_type_template_id_2e5f663d_scoped_true_staticRenderFns,
1007
+ false,
1008
+ null,
1009
+ "2e5f663d",
1010
+ null
1011
+
1012
+ )
1013
+
1014
+ /* harmony default export */ const SendButton = (SendButton_component.exports);
1015
+ ;// ./node_modules/chatarea/lib/ChatArea.mjs
1016
+ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,__publicField=(t,e,i)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,i);function os(){const t=navigator.userAgent,e=/(?:Windows Phone)/.test(t),i=/(?:SymbianOS)/.test(t)||e,n=/(?:Android)/.test(t),s=/(?:Firefox)/.test(t),a=/(?:iPad|PlayBook)/.test(t)||n&&!/(?:Mobile)/.test(t)||s&&/(?:Tablet)/.test(t),l=/(?:iPhone)/.test(t)&&!a;return{isTablet:a,isPhone:l,isAndroid:n,isPc:!l&&!n&&!i}}function domItVisible(t,e=!1,i="block"){t&&(t.className=t.className.replace(/ chat-view-show| chat-view-hidden/g,""),e?(t.style.display=i,t.className+=" chat-view-show"):(t.className+=" chat-view-hidden",t.style.display="none"))}function hasElmShow(t){return t&&t.classList.contains("chat-view-show")}function updateElmClass(t,e,i){t.classList[i?"add":"remove"](e)}const ELEMENT_EMPTY_KEY="data-set-empty",ELEMENT_RICH_TYPE_KEY="data-set-richType",RICH_WRAP="richWrap",RICH_GRID="richGrid",RICH_MARK="richMark",RICH_INPUT="richInput",RICH_TAG="richTag",ELEMENT_COMPONENT_KEY="data-set-component",sleep=(t=50)=>new Promise(e=>{setTimeout(e,t)}),getBoolean=t=>"false"!==String(t)&&"null"!==String(t)&&"0"!==String(t),debounce=(t,e,i=!1)=>{let n;return function(...s){const a=this,l=i&&!n;clearTimeout(n),n=setTimeout(()=>{n=null,i||t.apply(a,s)},e),l&&t.apply(a,s)}},throttle=(t,e)=>{let i;return function(...n){const s=this;i||(t.apply(s,n),i=!0,setTimeout(function(){i=!1},e))}},upFindElm=(t,e)=>{const i=t.getAttribute("data-set-richType");return i===RICH_GRID?null:i===RICH_MARK||i===RICH_TAG?t:t.parentElement&&e>0?upFindElm(t.parentElement,e-1):null},getObjValue=(t,e,i)=>t&&t[e]?t[e]:i,strictMinifyHtml=t=>t.replace(/\n+/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><").trim(),convertBlocksToSpans=(t,e)=>{const i=document.createElement("div");i.innerHTML=t;i.querySelectorAll("div, p, h1, h2, h3, h4, h5, h6, section, article, header, footer, aside, nav").forEach(t=>{const e=document.createElement("span");for(e.style.display="block",Array.from(t.attributes).forEach(t=>{e.setAttribute(t.name,t.value)});t.firstChild;)e.appendChild(t.firstChild);t.parentNode.replaceChild(e,t)});const n=i.children[0];if(n&&"block"===n.style.display&&(n.style.display="inline-block"),n){for(const t in e)n.dataset[t]="{{"+t+"}}";n.setAttribute("data-set-component","{{data-set-component}}")}return i.innerHTML};function replaceTemplateVariables(t,e){let i=t;for(const[t,n]of Object.entries(e)){const e=`{{${t}}}`;i=i.replace(new RegExp(e,"g"),String(n))}return i}function escapeHtml(t){return t.replace(/[&<>"']/g,t=>{switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#039;";default:return t}}).replace(/\s/g,"&nbsp;")}function pinyinMatch(t,e,i){const n=e.split(/\s+/),s=t.split("").map((t,i)=>{let s=n[i]||"";return""===e&&""===s&&(s=t),{char:t,pinyin:s.toLowerCase(),initial:s?s[0].toLowerCase():""}}),a=(t=>{const e=[];let i="";for(const n of t)/[a-zA-Z]/.test(n)?i+=n.toLowerCase():(i&&(e.push({type:"pinyin",value:i}),i=""),e.push({type:"char",value:n}));return i&&e.push({type:"pinyin",value:i}),e})(i),l=s.length,o=a.length,r=Array.from({length:l+1},()=>Array(o+1).fill(!1));r[0][0]=!0;for(let t=0;t<=l;t++)for(let e=0;e<=o;e++)if(r[t][e]&&e<o){const i=a[e];for(let n=t;n<l;n++){const t=s[n];if("char"===i.type)t.char===i.value&&(r[n+1][e+1]=!0);else{const a=t.pinyin.toLowerCase(),o=t.initial,c=i.value;if(c===o)r[n+1][e+1]=!0;else if(c===a)r[n+1][e+1]=!0;else if(isSubsequence(c,a))r[n+1][e+1]=!0;else for(let t=2;t<=l-n;t++){const i=s.slice(n,n+t),a=i.map(t=>t.pinyin.toLowerCase()).join(""),l=i.map(t=>t.initial).join("");if(c===a||c===l||isSubsequence(c,a)){r[n+t][e+1]=!0;break}}}}}for(let t=0;t<=l;t++)if(r[t][o])return!0;return!1}function isSubsequence(t,e){let i=0,n=0;for(;i<t.length&&n<e.length;)t[i]===e[n]&&i++,n++;return i===t.length}const checkEmptySvg='<svg class="check-empty-svg" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',searchEmptySvg='<svg class="empty-svg" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',searchSvg='<svg class="icon-search" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M684.8 223.530667a326.272 326.272 0 0 1 24.96 433.621333c2.645333 2.133333 5.290667 4.48 7.850667 7.04L870.4 817.066667c24.789333 24.746667 32.896 56.832 18.133333 71.594666-14.762667 14.805333-46.848 6.656-71.637333-18.090666l-152.789333-152.832a106.282667 106.282667 0 0 1-7.210667-7.936 326.101333 326.101333 0 0 1-433.109333-25.173334c-127.445333-127.445333-127.573333-333.952-0.256-461.269333 127.36-127.36 333.866667-127.232 461.269333 0.213333zM275.328 275.114667a252.885333 252.885333 0 0 0 0.256 357.632 252.885333 252.885333 0 0 0 357.632 0.256 252.885333 252.885333 0 0 0-0.256-357.632 252.885333 252.885333 0 0 0-357.632-0.256z" fill="#9B9B9B"></path></svg>',antdLoading='<div class="ant-spin ant-spin-spinning" aria-live="polite" aria-busy="true"><span class="ant-spin-dot ant-spin-dot-spin"><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i></span></div>',matchEmptySvg='<svg class="match-empty-svg" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',checkSvg='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M9.218 17.41 19.83 6.796a.99.99 0 1 1 1.389 1.415c-3.545 3.425-4.251 4.105-11.419 11.074a.997.997 0 0 1-1.375.018c-1.924-1.801-3.709-3.568-5.573-5.43a.999.999 0 0 1 1.414-1.413z"></path></svg>',arrowSvg='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="m20.23 8.653-7.795 9.685a1.2 1.2 0 0 1-1.87 0L2.771 8.652C2.14 7.867 2.698 6.7 3.706 6.7h15.588c1.008 0 1.567 1.167.935 1.952"></path></svg>',closeSvg='<svg focusable="false" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" fill-rule="evenodd" viewBox="64 64 896 896"><path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"></path></svg>';class ChatElement{constructor(t){__publicField(this,"target"),__publicField(this,"richText",document.createElement("div")),__publicField(this,"placeholderElm",document.createElement("div")),__publicField(this,"tipElm",null),__publicField(this,"isExternalCallPopup",!1),__publicField(this,"isPointSearchMode",!1),__publicField(this,"checkboxRows",[]),__publicField(this,"customTags",{}),__publicField(this,"selectTags",{}),__publicField(this,"rects",{}),__publicField(this,"pcElms",{containerDialogElm:null,pointDialogElm:null,pointDialogCheckElm:null,pointDialogMainElm:null,pointDialogUsersElm:[],pointDialogActiveElm:null,pointDialogLoadingElm:null,pointDialogEmptyElm:null,checkDialogElm:null,checkDialogSearchResultElm:null,checkDialogUsersElm:null,checkDialogSearchInputElm:null,checkDialogTagsElm:null,customTagDialogElms:{},customTagDialogTagKey:"",customTagDialogActiveElm:null,selectDialogElms:{},selectDialogKey:"",selectDialogAim:null,tipContainerPopoverElm:null,tipPopoverElm:null}),__publicField(this,"h5Elms",{dialogElm:null,dialogMainElm:null,dialogCheckElm:null,dialogShowElm:null,dialogSearchElm:null,dialogEmptyElm:null,dialogLoadingElm:null}),this.target=t,this.createRichText(),this.createPlaceholder(),t.deviceInfo.isPc?this.createPCDialog():this.createH5Dialog()}createRichText(){const{options:t,deviceInfo:e}=this.target,{elm:i}=t;updateElmClass(i,"chat-area-"+(e.isPc?"pc":"h5"),!0),updateElmClass(this.richText,"chat-rich-text",!0),this.richText.setAttribute("data-set-richType",RICH_WRAP),this.richText.setAttribute("contenteditable","true"),i.appendChild(this.richText)}createPlaceholder(){const{options:t}=this.target,{elm:e}=t;updateElmClass(this.placeholderElm,"chat-placeholder-wrap",!0),domItVisible(this.placeholderElm,!0),e.appendChild(this.placeholderElm),this.rects.plaRect=this.placeholderElm.getBoundingClientRect()}createPCDialog(){const{options:t}=this.target,{needDialog:e,elm:i,asyncMatch:n}=t;if(!e)return;const{pcElms:s}=this;s.containerDialogElm=document.createElement("div"),updateElmClass(this.pcElms.containerDialogElm,"chat-dialog",!0),i.nextElementSibling?i.parentElement.insertBefore(s.containerDialogElm,i.nextElementSibling):i.parentElement.appendChild(s.containerDialogElm),n||this.createPCCheckDialog(),this.createPCPointDialog()}createPCCheckDialog(){const{options:t}=this.target,e=this.target.options.dialogLabels.pcPCheckDialog,{pcElms:i}=this;i.checkDialogElm=document.createElement("div"),updateElmClass(i.checkDialogElm,"checkbox-dialog",!0),domItVisible(i.checkDialogElm),i.checkDialogElm.innerHTML=`\n <div class="checkbox-dialog-container">\n <div class="checkbox-dialog-container-header">\n <span>${e.title}</span>\n <span class="checkbox-dialog-container-header-close">⛌</span>\n </div>\n <div class="checkbox-dialog-container-body">\n <div class="checkbox-dialog-left-box">\n <div class="checkbox-dialog-search">\n <input class="checkbox-dialog-search-input" placeholder="${e.searchPlaceholder}" type="text">\n <div class="checkbox-dialog-search-group"></div>\n </div>\n <div class="checkbox-dialog-tags"></div>\n <div class="checkbox-dialog-option">\n <button class="checkbox-dialog-option-btn btn-submit disabled">${e.confirmLabel}</button>\n <button class="checkbox-dialog-option-btn btn-close">${e.cancelLabel}</button>\n </div>\n </div>\n <div class="checkbox-dialog-right-box">\n <div class="checkbox-dialog-right-box-title">${e.userTagTitle}</div>\n <div class="checkbox-dialog-check-group"></div>\n </div>\n </div>\n </div>\n `,i.containerDialogElm.appendChild(i.checkDialogElm),i.checkDialogUsersElm=i.checkDialogElm.querySelector(".checkbox-dialog-check-group"),i.checkDialogSearchResultElm=i.checkDialogElm.querySelector(".checkbox-dialog-search-group"),i.checkDialogSearchInputElm=i.checkDialogElm.querySelector(".checkbox-dialog-search-input"),i.checkDialogTagsElm=i.checkDialogElm.querySelector(".checkbox-dialog-tags");const n=()=>{domItVisible(i.checkDialogElm),updateElmClass(document.body,"disable-scroll")};i.checkDialogElm.querySelector(".checkbox-dialog-container-header-close").onclick=n,i.checkDialogElm.querySelector(".btn-close").onclick=n;const s=i.checkDialogElm.querySelector(".btn-submit");s.onclick=async()=>{if(s.classList.contains("disabled"))return;const e=this.checkboxRows.map(e=>{const i=Object.create(null);return i[t.userProps.id]=e.id,i[t.userProps.name]=e.name,i});await this.target.batchSetTag(e),n()},domItVisible(i.checkDialogSearchResultElm),i.checkDialogSearchResultElm.onclick=t=>{t.stopPropagation()},i.checkDialogSearchInputElm.onclick=t=>{t.stopPropagation()};const a=debounce(t=>{const e=String(t.target.value||"").replace(/'/g,"").trim();if(!e)return void domItVisible(i.checkDialogSearchResultElm);const n=this.target.searchUserList(e).map(t=>t.id);Array.from(i.checkDialogSearchResultElm.children,(t,e)=>{if(e===i.checkDialogSearchResultElm.children.length-1)domItVisible(t,0===n.length);else{const e=t.getAttribute("data-set-id");domItVisible(t,-1!==n.indexOf(e),"flex")}}),domItVisible(i.checkDialogSearchResultElm,!0)},200);i.checkDialogSearchInputElm.oninput=a,i.checkDialogSearchInputElm.onfocus=a}createPCPointDialog(){const{pcElms:t,target:e}=this;t.pointDialogElm=document.createElement("div"),updateElmClass(t.pointDialogElm,"call-user-dialog",!0),domItVisible(t.pointDialogElm);const i=document.createElement("div");updateElmClass(i,"call-user-dialog-header",!0),i.innerHTML=`<span class="call-user-dialog-header-title">${e.options.dialogLabels.pcPointDialog.title}</span>`,t.pointDialogCheckElm=document.createElement("span"),updateElmClass(t.pointDialogCheckElm,"call-user-dialog-header-check",!0),t.pointDialogCheckElm.innerText=e.options.dialogLabels.pcPointDialog.checkLabel,t.pointDialogCheckElm.onclick=()=>{this.target.showPCCheckDialog(),this.isExternalCallPopup=!1},i.appendChild(t.pointDialogCheckElm),t.pointDialogElm.appendChild(i),t.pointDialogMainElm=document.createElement("div"),updateElmClass(t.pointDialogMainElm,"call-user-dialog-main",!0),t.pointDialogElm.appendChild(t.pointDialogMainElm),e.options.asyncMatch&&(t.pointDialogLoadingElm=document.createElement("div"),updateElmClass(t.pointDialogLoadingElm,"call-user-dialog-loading",!0),t.pointDialogLoadingElm.innerHTML=antdLoading,t.pointDialogElm.appendChild(t.pointDialogLoadingElm),domItVisible(t.pointDialogLoadingElm),t.pointDialogEmptyElm=document.createElement("div"),updateElmClass(t.pointDialogEmptyElm,"call-user-dialog-empty",!0),t.pointDialogEmptyElm.innerHTML=`\n ${matchEmptySvg}\n <span class="empty-label">${e.options.dialogLabels.pcPointDialog.emptyLabel}</span>\n `,t.pointDialogElm.appendChild(t.pointDialogEmptyElm),domItVisible(t.pointDialogEmptyElm)),t.containerDialogElm.appendChild(t.pointDialogElm)}createH5Dialog(){const{options:t,chatEvent:e}=this.target,{needDialog:i,dialogLabels:n}=t;if(!i)return;const{h5Elms:s}=this;s.dialogElm=document.createElement("div"),updateElmClass(s.dialogElm,"call-user-popup",!0),s.dialogElm.innerHTML=`\n <div class="call-user-popup-main">\n <div class="call-user-popup-header">\n <span class="popup-show">${n.h5Dialog.cancelLabel}</span>\n <span class="popup-title">${n.h5Dialog.title}</span>\n <span class="popup-check">${n.h5Dialog.confirmLabel}</span>\n </div>\n <div class="call-user-popup-search">\n ${searchSvg}\n <input class="call-user-popup-search-input"\n placeholder="${n.h5Dialog.searchPlaceholder}"\n type="text">\n </div>\n <div class="call-user-popup-body"></div>\n </div>\n `;const a=async()=>{s.dialogElm.className=s.dialogElm.className.replace(/ chat-view-show/g," chat-view-hidden"),s.dialogSearchElm.value="",await sleep(260),domItVisible(s.dialogElm),updateElmClass(document.body,"disable-scroll"),t.asyncMatch&&this.target.updateUserList([]),this.target.chatInput.restCursorPos(this.target.chatInput.vnode,this.target.chatInput.cursorIndex),this.target.chatInput.viewIntoPoint()};s.dialogElm.onclick=a;const l=s.dialogElm.querySelector(".call-user-popup-main");l.onclick=t=>{t.stopPropagation()},s.dialogShowElm=s.dialogElm.querySelector(".popup-show"),s.dialogShowElm.onclick=a,s.dialogCheckElm=s.dialogElm.querySelector(".popup-check"),s.dialogCheckElm.onclick=async()=>{if(s.dialogCheckElm.classList.contains("disabled"))return;const e=s.dialogElm.querySelectorAll(".user-popup-check-item-check")||[];if(0===e.length)return void await a();if(Array.prototype.some.call(e,t=>"isALL"===t.getAttribute("data-set-id")))return await this.target.onceSetTag({[t.userProps.id]:"isALL",[t.userProps.name]:t.dialogLabels.h5Dialog.callEveryLabel}),void await a();const i=Array.from(e,t=>t.getAttribute("data-set-id")),n=t.userList.filter(e=>-1!==i.indexOf(String(e[t.userProps.id])));await this.target.batchSetTag(n),await a()},s.dialogMainElm=s.dialogElm.querySelector(".call-user-popup-body"),s.dialogEmptyElm=document.createElement("div"),updateElmClass(s.dialogEmptyElm,"call-user-popup-empty",!0),this.h5Elms.dialogEmptyElm.innerHTML=`\n ${searchEmptySvg}\n <span class="empty-label">${t.dialogLabels.h5Dialog.searchEmptyLabel}</span>\n `,domItVisible(s.dialogEmptyElm),l.appendChild(s.dialogEmptyElm),t.asyncMatch&&(s.dialogLoadingElm=document.createElement("div"),updateElmClass(s.dialogLoadingElm,"call-user-popup-loading",!0),s.dialogLoadingElm.innerHTML=antdLoading,domItVisible(s.dialogLoadingElm),l.appendChild(s.dialogLoadingElm)),s.dialogSearchElm=s.dialogElm.querySelector(".call-user-popup-search-input"),s.dialogSearchElm.oninput=debounce(i=>{const n=String(i.target.value||"").replace(/'/g,"").trim();if(t.asyncMatch){e.matchKey++;const t=e.matchKey;this.target.updateUserList([]),domItVisible(s.dialogLoadingElm,!0),domItVisible(s.dialogEmptyElm);const i=e.triggerChatEvent("atMatch",n).find(t=>t&&t instanceof Promise);return void(i&&i.then(i=>{t===e.matchKey&&(domItVisible(s.dialogLoadingElm),!i||i.length<=0?domItVisible(s.dialogEmptyElm,!0,"flex"):this.target.updateUserList(i))}))}const a=[];Array.from(this.h5Elms.dialogMainElm.children,t=>{if(!n)return domItVisible(t,!0,"flex"),void a.push(t);pinyinMatch(t.getAttribute("data-set-name")||"",t.getAttribute("data-set-pinyin")||"",n)?(domItVisible(t,!0,"flex"),a.push(t)):domItVisible(t)}),domItVisible(this.h5Elms.dialogEmptyElm,!a.length,"flex")},200),domItVisible(s.dialogElm),document.body.appendChild(s.dialogElm)}updatePCUser(){const{pcElms:t,target:e}=this;t.pointDialogMainElm.innerHTML="",t.pointDialogActiveElm=void 0;const i=document.createDocumentFragment();if(this.target.options.needCallEvery){const t=document.createElement("div");updateElmClass(t,"call-user-dialog-item",!0),t.setAttribute("data-set-id","isALL"),this.userSelectStyleAndEvent(t,{id:"isALL",name:e.options.dialogLabels.pcPointDialog.callEveryLabel}),t.innerHTML=`\n <span class="call-user-dialog-item-sculpture">\n <span style="transform: scale(0.75)">@</span>\n </span>\n <span class="call-user-dialog-item-name">${e.options.dialogLabels.pcPointDialog.callEveryLabel}(${e.options.reformList.length})</span>\n `,i.appendChild(t)}if(e.options.reformList.forEach(t=>{const e=document.createElement("div");updateElmClass(e,"call-user-dialog-item",!0),e.setAttribute("data-set-id",t.id),this.userSelectStyleAndEvent(e,t),this.getUserHtmlTemplate(e,t),i.appendChild(e)}),t.pointDialogMainElm.appendChild(i),t.pointDialogUsersElm=[],Array.from(t.pointDialogMainElm.children||[],(e,i)=>{t.pointDialogUsersElm.push({index:i,elm:e})}),e.options.asyncMatch)return;t.checkDialogUsersElm.innerHTML=`\n <div class="checkbox-dialog-check-item" data-set-value="ALL">\n <input type="checkbox" value>\n <span class="checkbox-dialog-check-item-inner"></span>\n <div class="checkbox-dialog-check-item-label">${e.options.dialogLabels.pcPCheckDialog.checkAllLabel}</div>\n </div>\n `;const n=document.createDocumentFragment();e.options.reformList.forEach(t=>{const e=document.createElement("div");updateElmClass(e,"checkbox-dialog-check-item",!0),e.setAttribute("data-set-value",t.id),e.innerHTML='\n <input type="checkbox" value>\n <span class="checkbox-dialog-check-item-inner"></span>\n ',this.getUserHtmlTemplate(e,t),n.appendChild(e)}),t.checkDialogUsersElm.appendChild(n),t.checkDialogUsersElm&&t.checkDialogUsersElm.children.length&&Array.from(t.checkDialogUsersElm.children,t=>{t.onclick=()=>{const i=t.getAttribute("data-set-value")||"",n=e.options.reformList.find(t=>t.id===i),s=-1===t.className.indexOf("checkbox-dialog-check-item-check");"ALL"===i?this.checkboxRows=s?e.options.reformList.map(t=>t):[]:s?this.checkboxRows.push(n):this.checkboxRows=this.checkboxRows.filter(t=>t.id!==i),this.updateCheckDialogTags()}}),t.checkDialogSearchResultElm.innerHTML="";const s=document.createDocumentFragment();e.options.reformList.forEach(t=>{const i=document.createElement("div");updateElmClass(i,"checkbox-dialog-check-item",!0),i.setAttribute("data-set-id",t.id);const n=document.createElement("div");updateElmClass(n,"checkbox-dialog-check-item-label",!0),this.getUserHtmlTemplate(n,t),i.appendChild(n),i.onclick=()=>{domItVisible(this.pcElms.checkDialogSearchResultElm);const t=i.getAttribute("data-set-id")||"";if(this.pcElms.checkDialogSearchInputElm.value="",this.pcElms.checkDialogSearchInputElm.focus(),this.checkboxRows.some(e=>e.id===t))return;const n=e.options.reformList.find(e=>e.id===t);n&&this.checkboxRows.push(n),this.updateCheckDialogTags()},s.appendChild(i)});const a=document.createElement("div");updateElmClass(a,"checkbox-dialog-search-empty",!0),a.innerText=e.options.dialogLabels.pcPCheckDialog.searchEmptyLabel,s.appendChild(a),t.checkDialogSearchResultElm.appendChild(s)}updateH5User(){const{h5Elms:t,target:e}=this;t.dialogMainElm.innerHTML="";const i=e.options.reformList&&e.options.reformList.length>0,n=document.createDocumentFragment(),s=document.createElement("span");if(s.innerHTML='\n <input type="checkbox" value>\n <span class="user-popup-check-item-inner"></span>\n ',i){const t=document.createElement("div");e.options.needCallEvery&&(updateElmClass(t,"call-user-popup-item",!0),t.setAttribute("data-set-id","isALL"),t.innerHTML=`\n <span class="call-user-dialog-item-sculpture">\n <span style="transform: scale(0.75)">@</span>\n </span>\n <span class="call-user-dialog-item-name">${e.options.dialogLabels.h5Dialog.callEveryLabel}(${e.options.reformList.length})</span>\n `,t.appendChild(s.cloneNode(!0)),t.onclick=()=>{const e=!t.classList.contains("user-popup-check-item-check");Array.from(this.h5Elms.dialogMainElm.children,t=>{updateElmClass(t,"user-popup-check-item-check",e)}),updateElmClass(this.h5Elms.dialogCheckElm,"disabled",!e)},n.appendChild(t)),e.options.reformList.forEach((e,i)=>{const a=document.createElement("div");updateElmClass(a,"call-user-popup-item",!0),a.setAttribute("data-set-id",e.id),a.setAttribute("data-set-name",e.name),a.setAttribute("data-set-pinyin",e.pinyin||""),this.getUserHtmlTemplate(a,e),a.appendChild(s.cloneNode(!0)),n.appendChild(a),a.onclick=e=>{const i=!a.classList.contains("user-popup-check-item-check");updateElmClass(a,"user-popup-check-item-check",i);const n=Array.prototype.every.call(this.h5Elms.dialogMainElm.children,t=>t.classList.contains("user-popup-check-item-check")||"isALL"===t.getAttribute("data-set-id"));updateElmClass(t,"user-popup-check-item-check",n);const s=Array.prototype.some.call(this.h5Elms.dialogMainElm.children,t=>t.classList.contains("user-popup-check-item-check"));updateElmClass(this.h5Elms.dialogCheckElm,"disabled",!s)}})}t.dialogMainElm.appendChild(n)}updateCheckDialogTags(){const t=this.checkboxRows.map(t=>t.id),e=[],i=[],n=document.createElement("div");n.className="check-empty",n.innerHTML=`\n ${checkEmptySvg}\n <span class="check-empty-label">${this.target.options.dialogLabels.pcPCheckDialog.checkEmptyLabel}</span>\n `,Array.from(this.pcElms.checkDialogTagsElm.children,n=>{const s=n.getAttribute("data-set-value");-1===t.indexOf(s)?i.push(n):e.push(s)}),Array.from(this.pcElms.checkDialogUsersElm.children,(e,i)=>{if(0===i)return void updateElmClass(e,"checkbox-dialog-check-item-check",t.length===this.target.options.reformList.length);const n=e.getAttribute("data-set-value");updateElmClass(e,"checkbox-dialog-check-item-check",-1!==t.indexOf(n))}),i.forEach(t=>{this.pcElms.checkDialogTagsElm.removeChild(t)});updateElmClass(this.pcElms.checkDialogElm.querySelector(".btn-submit"),"disabled",t.length<=0),t.length||this.pcElms.checkDialogTagsElm.appendChild(n);const s=this.checkboxRows.filter(t=>-1===e.indexOf(t.id));if(!s.length)return;const a=document.createDocumentFragment();s.forEach(t=>{const e=document.createElement("div");e.setAttribute("class","checkbox-dialog-tag-item"),e.setAttribute("data-set-value",t.id),e.innerHTML=`\n <span>${t.name}</span>\n `;const i=document.createElement("span");i.setAttribute("class","checkbox-dialog-tag-item-close"),i.innerHTML="⛌",i.onclick=()=>{const t=e.getAttribute("data-set-value");this.checkboxRows=this.checkboxRows.filter(e=>e.id!==t),this.updateCheckDialogTags()},e.appendChild(i),a.appendChild(e)}),this.pcElms.checkDialogTagsElm.appendChild(a)}userSelectStyleAndEvent(t,e){t.addEventListener("click",async i=>{const{options:n}=this.target;if(i.stopPropagation(),this.updatePointActiveUserElm(t),this.isPointSearchMode||n.asyncMatch)await this.target.matchSetTag(e);else{const t=n.userList.find(t=>String(t[n.userProps.id])===e.id);await this.target.onceSetTag(t)}this.exitPointDialog()})}bindCustomTrigger(){Object.values(this.pcElms.customTagDialogElms).forEach(t=>{this.pcElms.containerDialogElm.removeChild(t)}),this.pcElms.customTagDialogElms={},this.customTags={},this.target.options.customTrigger.forEach(t=>{t.tagList&&t.tagList.length>0&&(this.customTags[t.prefix]=t.tagList.map(t=>({id:String(t.id),name:String(t.name),pinyin:String(t.pinyin||"")})),this.createCustomTagDialog(t))})}createCustomTagDialog(t){const e=document.createElement("div");e.setAttribute("class","call-tag-dialog"),domItVisible(e);const i=document.createElement("div");i.setAttribute("class","call-tag-dialog-header"),i.innerHTML=`<span class="call-tag-dialog-header-title">${t.dialogTitle||t.prefix}</span>`,e.appendChild(i);const n=document.createElement("div");n.setAttribute("class","call-tag-dialog-main"),t.tagList.forEach(t=>{const e=document.createElement("div");e.setAttribute("class","call-tag-dialog-item"),e.setAttribute("data-set-id",t.id);const i=document.createElement("span");i.setAttribute("class","call-tag-dialog-item-name"),i.innerHTML=t.name,e.appendChild(i),e.addEventListener("click",async i=>{i.stopPropagation(),this.updateActiveCustomTagElm(e),this.isPointSearchMode?await this.target.matchSetCustomTag(t):await this.target.onceSetCustomTag(t),this.exitCustomTagDialog()}),n.appendChild(e)}),e.appendChild(n),this.pcElms.containerDialogElm.appendChild(e),this.pcElms.customTagDialogElms[t.prefix]=e}getUserHtmlTemplate(t,e){const i=document.createElement("span");if(i.setAttribute("class","call-user-dialog-item-sculpture "+(e.avatar?"is-avatar":"")),e.avatar){const t=new Image;t.alt="",t.src=String(e.avatar),i.appendChild(t)}else i.innerHTML=`<span style="transform: scale(0.75)">${e.name.slice(-2)}</span>`;t.appendChild(i);const n=document.createElement("span");n.setAttribute("class","call-user-dialog-item-name"),n.innerHTML=e.name,t.appendChild(n)}updatePointActiveUserElm(t,e=!1){if(this.pcElms.pointDialogActiveElm&&updateElmClass(this.pcElms.pointDialogActiveElm,"call-user-dialog-item-active"),this.pcElms.pointDialogActiveElm=t,t&&(updateElmClass(t,"call-user-dialog-item-active",!0),e)){const e=Array.prototype.filter.call(this.pcElms.pointDialogMainElm.children,t=>-1===t.className.indexOf("user-no-match")),i=t.clientHeight,n=Array.prototype.indexOf.call(e,t)+1-Math.ceil(Math.floor(this.pcElms.pointDialogMainElm.clientHeight/i)/2);this.pcElms.pointDialogMainElm.scrollTop=n>0?n*i:0}}updateActiveCustomTagElm(t,e=!1){if(this.pcElms.customTagDialogActiveElm&&updateElmClass(this.pcElms.customTagDialogActiveElm,"call-tag-dialog-item-active"),this.pcElms.customTagDialogActiveElm=t,t&&(updateElmClass(t,"call-tag-dialog-item-active",!0),e)){const e=this.pcElms.customTagDialogElms[this.pcElms.customTagDialogTagKey].children[1],i=Array.prototype.filter.call(e.children,t=>-1===t.className.indexOf("tag-no-match")),n=t.clientHeight,s=Array.prototype.indexOf.call(i,t)+1-Math.ceil(Math.floor(e.clientHeight/n)/2);e.scrollTop=s>0?s*n:0}}showPointDialog(t){this.exitSelectDialog(),this.exitCustomTagDialog(),this.exitPointDialog(),this.isPointSearchMode=!!t;let e=null;this.pcElms.pointDialogUsersElm.forEach(i=>{const n=i.elm,s=n.getAttribute("data-set-id"),a=t&&t.every(t=>t.id!==s);e||a||(e=n),updateElmClass(n,"user-no-match",a)}),null!==e&&this.updatePointActiveUserElm(e),domItVisible(this.pcElms.pointDialogCheckElm,!this.target.options.asyncMatch&&!this.isPointSearchMode),domItVisible(this.pcElms.pointDialogElm,!0),this.target.chatEvent.debounceEvents.dialogMoveToRange(this.pcElms.pointDialogElm),this.pcElms.pointDialogMainElm.scrollTop=0}showCustomTagDialog(t,e){this.exitSelectDialog(),this.exitCustomTagDialog(),this.exitPointDialog(),this.isPointSearchMode=!!e,this.pcElms.customTagDialogTagKey=t;const i=this.pcElms.customTagDialogElms[t],n=i.children[1];let s=null;Array.from(n.children,t=>{const i=t.getAttribute("data-set-id"),n=e&&e.every(t=>t.id!==i);s||n||(s=t),updateElmClass(t,"tag-no-match",n)}),null!==s&&this.updateActiveCustomTagElm(s),domItVisible(i,!0),this.target.chatEvent.debounceEvents.dialogMoveToRange(i),i.children[1].scrollTop=0}exitPointDialog(){this.updatePointActiveUserElm(),this.target.options.asyncMatch&&this.target.updateUserList([]),domItVisible(this.pcElms.pointDialogElm)}exitCustomTagDialog(){this.updateActiveCustomTagElm();for(const t in this.pcElms.customTagDialogElms)domItVisible(this.pcElms.customTagDialogElms[t])}ruleShowPointDialog(){const{options:t}=this.target;t.needDialog&&t.reformList.length>0&&(this.isExternalCallPopup=!1,this.showPointDialog())}showPlaceholder(){domItVisible(this.placeholderElm,this.target.isEmpty()),this.offsetTipElm()}bindSelectList(){Object.values(this.pcElms.selectDialogElms).forEach(t=>{this.pcElms.containerDialogElm.removeChild(t)}),this.pcElms.selectDialogElms={},this.selectTags={},this.target.options.selectList.forEach(t=>{t.options&&t.options.length>0&&(this.selectTags[t.key]=t.options.map(t=>({id:String(t.id),name:String(t.name),preview:String(t.preview||"")})),this.createSelectDialog(t))})}createSelectDialog(t){const e=document.createElement("div");e.setAttribute("class","chat-select-dialog"),domItVisible(e);const i=document.createElement("div");i.setAttribute("class","chat-select-dialog-header"),i.innerHTML=`<span class="chat-select-dialog-header-title">${t.dialogTitle||t.key}</span>`,e.appendChild(i);const n=document.createElement("div");n.setAttribute("class","chat-select-dialog-main"),t.options.forEach(t=>{const e=document.createElement("div");if(e.setAttribute("class","chat-select-dialog-item"),e.setAttribute("data-set-id",t.id),t.preview){const i=document.createElement("img");i.setAttribute("class","chat-select-dialog-preview"),i.src=String(t.preview),e.appendChild(i)}const i=document.createElement("span");i.setAttribute("class","chat-select-dialog-name"),i.textContent=t.name;const s=document.createElement("span");s.setAttribute("class","chat-select-dialog-check"),s.innerHTML=checkSvg,domItVisible(s),i.appendChild(s),e.appendChild(i),e.onclick=async()=>{await this.target.setSelectTag(t)},n.appendChild(e)}),e.appendChild(n);const s=document.createElement("div");s.setAttribute("class","chat-select-arrow"),e.appendChild(s),this.pcElms.containerDialogElm.appendChild(e),this.pcElms.selectDialogElms[t.key]=e}exitSelectDialog(){for(const t in this.pcElms.selectDialogElms)domItVisible(this.pcElms.selectDialogElms[t]);this.pcElms.selectDialogKey="",this.pcElms.selectDialogAim&&(updateElmClass(this.pcElms.selectDialogAim,"aim"),this.pcElms.selectDialogAim=null)}createTipElm(t){this.tipElm||(this.tipElm=document.createElement("div")),updateElmClass(this.tipElm,"chat-tip-wrap",!0),this.tipElm.innerHTML=`\n <div class="chat-tip-tag">\n <span class="chat-tip-tag-txt">${t.tagLabel||"--"}</span>\n <span class="chat-tip-tag-close">\n ${this.target.deviceInfo.isPc?closeSvg:""}\n </span>\n </div>\n `,this.target.options.elm.appendChild(this.tipElm);const e=this.tipElm.children[0],i=(e.clientHeight-this.target.chatInput.NODE_HEIGHT)/2;this.tipElm.style.top=`-${i}px`,e.onclick=()=>{this.target.deviceInfo.isPc&&this.target.closeTipTag()},e.onmouseenter=()=>{if(this.pcElms.tipContainerPopoverElm&&this.pcElms.tipPopoverElm){domItVisible(this.pcElms.tipPopoverElm,!0);const t=this.pcElms.tipContainerPopoverElm.getBoundingClientRect();this.rects.tipRect=this.tipElm.getBoundingClientRect();const i=(this.pcElms.tipPopoverElm.clientWidth-(this.tipElm.clientWidth+(this.tipElm.clientWidth-e.clientWidth)))/2;this.pcElms.tipPopoverElm.style.left=-i+"px",this.pcElms.tipPopoverElm.style.bottom=t.y-this.rects.tipRect.y+"px",this.pcElms.tipPopoverElm.style.transform=e.style.transform}},e.onmouseleave=()=>{this.pcElms.tipPopoverElm&&domItVisible(this.pcElms.tipPopoverElm)};const n=this.richText.children[0].children[0];this.rects.tipRect=this.tipElm.getBoundingClientRect();const s=this.rects.tipRect;if(this.placeholderElm.style.paddingLeft=s.width+"px",n.style.paddingLeft=s.width-n.offsetLeft+"px",this.offsetTipElm(),this.target.deviceInfo.isPc){this.pcElms.tipContainerPopoverElm||(this.pcElms.tipContainerPopoverElm=document.createElement("div"),updateElmClass(this.pcElms.tipContainerPopoverElm,"chat-tip-dialog",!0)),this.pcElms.tipPopoverElm||(this.pcElms.tipPopoverElm=document.createElement("div")),updateElmClass(this.pcElms.tipPopoverElm,"chat-tip-popover",!0),this.pcElms.tipPopoverElm.innerHTML=`\n <div class="chat-tip-popover-main">\n <span class="chat-tip-popover-txt">${t.popoverLabel||"--"}</span>\n <span class="chat-tip-popover-code ${t.codeLabel?"":"chat-view-show"}">${t.codeLabel||"--"}</span>\n </div>\n <div class="chat-tip-popover-arrow"></div>\n `,this.pcElms.tipContainerPopoverElm.appendChild(this.pcElms.tipPopoverElm),domItVisible(this.pcElms.tipPopoverElm);const{elm:e}=this.target.options;e.parentElement&&(e.nextElementSibling?e.parentElement.insertBefore(this.pcElms.tipContainerPopoverElm,e.nextElementSibling):e.parentElement.appendChild(this.pcElms.tipContainerPopoverElm))}this.target.chatEvent.triggerChatEvent("tipTagState",!0)}offsetTipElm(){if(this.tipElm){const t=this.richText.children[0].children[0];t.style.paddingLeft=this.rects.tipRect.width-t.offsetLeft+"px",this.target.nextTick(()=>{if(this.tipElm){const t=this.tipElm.children[0],e=this.richText.children[0].children[0];t.style.transform=`translateY(${e.offsetTop-this.target.chatInput.NODE_PADDING_DIFF}px)`}})}}removeTipElm(){this.tipElm&&(this.target.options.elm.removeChild(this.tipElm),this.tipElm=null),this.pcElms.tipContainerPopoverElm&&(this.pcElms.tipContainerPopoverElm.removeChild(this.pcElms.tipPopoverElm),this.target.options.elm.parentElement.removeChild(this.pcElms.tipContainerPopoverElm),this.pcElms.tipContainerPopoverElm=null,this.pcElms.tipPopoverElm=null);const t=this.richText.children[0].children[0];this.placeholderElm.style.removeProperty("padding-left"),t.style.removeProperty("padding-left"),this.target.chatInput.setRangeLastText(),this.target.chatEvent.triggerChatEvent("tipTagState",!1)}}class ChatInput{constructor(t){__publicField(this,"target"),__publicField(this,"richText"),__publicField(this,"vnode"),__publicField(this,"cursorIndex"),__publicField(this,"cursorLeft"),__publicField(this,"needCallSpace",!1),__publicField(this,"VOID_KEY","\ufeff"),__publicField(this,"ZERO_WIDTH_KEY","​"),__publicField(this,"INPUT_TAG_WRAP_KEY","​\n​"),__publicField(this,"NODE_HEIGHT",24),__publicField(this,"NODE_PADDING_DIFF",10),__publicField(this,"IME_RECORD",{MARK:void 0,GRID:void 0,TAG:void 0,NODE:void 0,INDEX:void 0}),this.target=t,this.richText=t.chatElement.richText,this.initEditor()}initEditor(t=!1,e){if(t||this.getNodeEmpty(this.richText)){this.richText.innerHTML="";const i=this.getGridElm();this.richText.appendChild(i);const n=i.children[0].children[0];e&&(n.textContent=e,n.setAttribute("data-set-empty","false"));const s=n.childNodes[0];t||this.target.options.autoFocus?this.restCursorPos(s,s.textContent===this.VOID_KEY?1:s.textContent.length):(this.vnode=s,this.cursorIndex=s.textContent===this.VOID_KEY?1:s.textContent.length),this.target.nextTick(()=>{const t=i.getBoundingClientRect();this.NODE_HEIGHT=t.height,this.NODE_PADDING_DIFF=t.top-this.target.options.elm.getBoundingClientRect().top})}}onceCall(t){return new Promise(e=>{const i=this.createChatTagElm(t,"@","at-user","user-id");this.replaceRegContent(i),e()})}onceSearchCall(t,e){return new Promise(i=>{const n=this.createChatTagElm(t,"@","at-user","user-id");this.replaceRegContent(n,e),i()})}onceCustomCall(t,e,i){return new Promise(n=>{const s=this.createChatTagElm(t,i,"at-tag","tag-id");s.children[0].setAttribute("data-set-prefix",i),this.replaceRegContent(s,e),n()})}upDataNodeOrIndex(){var t,e,i;const{focusNode:n,focusOffset:s,anchorOffset:a}=window.getSelection(),l=(null==n?void 0:n.parentNode)||void 0;if(!l||!l.getAttribute||l.getAttribute("data-set-richType")!==RICH_INPUT)return;(null==(i=null==(e=null==(t=null==n?void 0:n.parentNode)?void 0:t.parentNode)?void 0:e.parentNode)?void 0:i.parentNode)===this.richText&&(this.vnode=n,this.cursorIndex=s,this.cursorLeft=a<s?a:s)}keyUpAsKey(t){if(this.upDataNodeOrIndex(),!this.vnode||this.vnode.nodeType!==Node.TEXT_NODE)return!1;const e=this.vnode.textContent||"",i=new RegExp(`${t}([^${t}\\s]*)$`),n=e.slice(0,this.cursorIndex),s=i.exec(n);return s&&2===s.length&&n[n.length-1]===t}getRangeRect(){let t=0,e=0;const i=window.getSelection();if(i.focusNode.nodeType!==Node.TEXT_NODE)return null;const n=i.getRangeAt(0).getClientRects()[0];return n&&(t=n.x,e=n.y),{x:t,y:e}}createChatTagElm(t,e,i,n){const s=document.createElement("span");return s.className=i,s.setAttribute(`data-${n}`,String(t.id)),s.textContent=`${e}${t.name}${this.needCallSpace?" ":""}`,this.createNewDom(s)}createNewDom(t){const e=document.createElement("span");return e.className="chat-tag",e.setAttribute("contenteditable","false"),e.setAttribute("data-set-richType",RICH_TAG),e.appendChild(t),e}restCursorPos(t,e){null==e?e=t.textContent===this.VOID_KEY?1:0:e>t.textContent.length&&(e=t.textContent.length);const i=new Range;i.setStart(t,e),i.setEnd(t,e);const n=window.getSelection();n&&(this.vnode=t,this.cursorIndex=e,this.cursorLeft=e,n.removeAllRanges(),n.addRange(i))}replaceRegContent(t,e=!0){const i=this.vnode.textContent;let n;n="boolean"==typeof e?i.slice(0,e?this.cursorIndex-1:this.cursorIndex):i.slice(0,e-1),0===n.length?(this.vnode.parentElement.setAttribute("data-set-empty","true"),this.vnode.textContent=this.VOID_KEY):this.vnode.textContent=n;let s=i.slice(this.cursorIndex);const a=this.vnode.parentNode.parentNode,l=a.nextSibling;l?a.parentNode.insertBefore(t,l):a.parentNode.appendChild(t);const o=t.previousSibling.childNodes[0],r=o.childNodes[1];r&&o.removeChild(r);const c=this.getGridElm(!0),h=c.childNodes[0];s&&s!==this.VOID_KEY&&(h.setAttribute("data-set-empty","false"),h.innerHTML=s);const d=h.childNodes[1];t.nextSibling?(d&&h.removeChild(d),a.parentNode.insertBefore(c,t.nextSibling)):a.parentNode.appendChild(c),this.restCursorPos(h.childNodes[0])}batchReplaceRegContent(t=[],e=!0){return new Promise(i=>{let n=`<span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="true">${this.VOID_KEY}</span></span>`;t.forEach(t=>{n+=`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-user" data-user-id="${t.id}" contentEditable="false">@${t.name}${this.needCallSpace?" ":""}</span></span><span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="true">${this.VOID_KEY}</span></span>`});const s=document.createElement("div");s.innerHTML=n,this.insetRangeGrid(s,e?1:0),i()})}switchRange(t){var e,i;let{focusNode:n,focusOffset:s}=window.getSelection();n.getAttribute&&n.getAttribute("data-set-richType")===RICH_INPUT&&(n=n.childNodes[0]);let a,l,o=!1;if(n.nodeType===Node.TEXT_NODE){const r=n.textContent.length,c=n.parentNode.parentNode;switch(t){case"ArrowLeft":if(s>0&&n.textContent!==this.VOID_KEY){l=s-1,a=n;break}const t=c.previousSibling;if(t&&t.children[0].classList.contains("at-input")){a=t.children[0].children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:a.textContent.length,o=!0;break}const h=null==(e=null==c?void 0:c.previousSibling)?void 0:e.previousSibling;if(h)a=h.childNodes[0].childNodes[0],l=a.textContent.length;else{const t=c.parentNode.previousSibling;if(t){a=t.lastChild.childNodes[0].childNodes[0],l=a.textContent.length}}break;case"ArrowRight":if(s<r&&n.textContent!==this.VOID_KEY){l=s+1,a=n;break}const d=c.nextSibling;if(d&&d.children[0].classList.contains("at-input")){a=d.children[0].children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0,o=!0;break}const p=null==(i=null==c?void 0:c.nextSibling)?void 0:i.nextSibling;if(p)a=p.childNodes[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0;else{const t=c.parentNode.nextSibling;t&&(a=t.childNodes[0].childNodes[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0)}}}(l||0===l)&&(o?this.setInputTagRange(a,l):this.restCursorPos(a,l))}getGridElm(t=!1){const e=document.createElement("span");if(e.setAttribute("data-set-richType",RICH_MARK),e.innerHTML=`<span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="true">${this.VOID_KEY}<br></span>`,t)return e;const i=document.createElement("p");return i.className="chat-grid-wrap",i.setAttribute("data-set-richType",RICH_GRID),i.appendChild(e),i}updateGrid(){const t=window.getSelection(),e=t.focusNode;if(!e)return;const i=e.parentNode;let n,s,a,l;switch(i.getAttribute("data-set-richType")){case RICH_WRAP:if(n=e.childNodes[t.focusOffset],!n||n.getAttribute("data-set-richType")===RICH_TAG){const t=this.getGridElm(!0),i=t.children[0];n?(i.removeChild(i.childNodes[1]),e.insertBefore(t,n)):e.appendChild(t),this.restCursorPos(i.childNodes[0]);break}if(n.tagName&&"BR"===n.tagName.toLocaleUpperCase()){const t=this.getGridElm(!0),i=t.children[0];e.insertBefore(t,n),e.removeChild(n),t.nextElementSibling&&t.children[0].removeChild(t.children[0].childNodes[1]),this.restCursorPos(i.childNodes[0],i.childNodes[0].textContent.length)}break;case RICH_MARK:const o=i.parentNode,r=Array.prototype.indexOf.call(o.childNodes,i);if(-1===r)break;if(0===r){const e=t.focusNode;e.setAttribute("data-set-empty","true"),e.innerHTML=`${this.VOID_KEY}<br>`,n=e.childNodes[0],this.restCursorPos(n,n.textContent.length);break}let c,h=i.previousSibling;h.getAttribute("data-set-richType")===RICH_TAG?(c=h.previousSibling,o.removeChild(h),o.removeChild(i)):(c=i.previousSibling,o.removeChild(i));n=c.childNodes[0].childNodes[0],n.textContent===this.VOID_KEY&&n.parentNode.appendChild(document.createElement("br")),this.restCursorPos(n,n.textContent.length);break;case RICH_INPUT:if(l=i.parentNode,a=l.parentNode,this.getNodeEmpty(i)){i.setAttribute("data-set-empty","true"),a.childNodes[a.childNodes.length-1]===l&&(i.innerHTML=`${this.VOID_KEY}<br>`),n=i.childNodes[0],this.restCursorPos(n,n.textContent.length);break}if("true"===String(i.getAttribute("data-set-empty"))){i.setAttribute("data-set-empty","false"),n=i.childNodes[0],this.target.chatEvent.isIMEModel?(i.childNodes[1]&&i.removeChild(i.childNodes[1]),n.textContent===this.VOID_KEY&&i.setAttribute("data-set-empty","true")):i.textContent=n.textContent.replace(new RegExp(this.VOID_KEY,"g"),"");const t=i.childNodes[0];this.restCursorPos(t,t.textContent.length)}if(s=i.parentNode.nextSibling,s&&s.nodeType===Node.TEXT_NODE){let t=s.textContent,e=this.getGridElm(!0);e.childNodes[0].textContent=t,e.childNodes[0].setAttribute("data-set-empty","false"),s.parentNode.insertBefore(e,s),s.parentNode.removeChild(s),s=e}s&&s.getAttribute("data-set-richType")===RICH_MARK&&this.markMerge(i.parentNode,s)}}getNodeEmpty(t){const e=new RegExp(`^(${this.ZERO_WIDTH_KEY}|<br>|${this.VOID_KEY})+$`);return!t.innerHTML||e.test(t.innerHTML)}setWrap(t=!0){const e=window.getSelection();let{focusNode:i,focusOffset:n}=e;if(i.nodeType!==Node.TEXT_NODE){if(!i.getAttribute||i.getAttribute("data-set-richType")!==RICH_INPUT)return;i=i.childNodes[0]}const s=i.textContent.slice(n),a=i.parentNode.parentNode,l=a.parentNode,o=Array.prototype.indexOf.call(l.childNodes,a),r=Array.prototype.slice.call(l.childNodes,o+1),c=this.getGridElm();let h=c.children[0].children[0].childNodes[0];(s||r.length>0)&&h.parentNode.removeChild(h.parentNode.childNodes[1]),s&&s!==this.VOID_KEY&&(i.textContent=i.textContent.slice(0,n),h.textContent=s,h.parentElement.setAttribute("data-set-empty","false")),r.forEach(t=>{l.removeChild(t),c.appendChild(t)});const d=l.lastChild.childNodes[0],p=c.lastChild.childNodes[0];if(d.childNodes.length<=1){const t=d.childNodes[0];t.textContent&&t.textContent!==this.VOID_KEY||(d.innerHTML=`${this.VOID_KEY}<br>`,d.setAttribute("data-set-empty","true"))}if(p.parentElement.getAttribute("data-set-richType")!==RICH_MARK)c.appendChild(this.getGridElm(!0));else if(p.childNodes.length<=1){const t=p.childNodes[0];t.textContent&&t.textContent!==this.VOID_KEY||(p.innerHTML=`${this.VOID_KEY}<br>`,p.setAttribute("data-set-empty","true"),h=c.children[0].children[0].childNodes[0])}l.nextSibling?this.richText.insertBefore(c,l.nextSibling):this.richText.appendChild(c),t&&this.restCursorPos(h,h.textContent===this.VOID_KEY?1:0)}selectAll(){const t=document.createRange(),e=this.richText.children[0].children[0].childNodes[0].childNodes[0],i=this.richText.lastElementChild.lastElementChild.childNodes[0].childNodes[0];t.setStart(e,0),t.setEnd(i,i.textContent.length);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}selectRegionMerge(){const t=window.getSelection();if(t.isCollapsed||t.rangeCount<=0)return;const e=t.getRangeAt(0);if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startContainer===e.endContainer){const t=e.startContainer;if(t.length===e.endOffset-e.startOffset){const e=t.parentNode,i=e.parentNode===e.parentNode.parentNode.lastChild;e.setAttribute("data-set-empty","true"),e.innerHTML="\ufeff"+(i?"<br>":""),this.restCursorPos(e.childNodes[0])}else e.deleteContents()}else if(e.commonAncestorContainer&&e.commonAncestorContainer.getAttribute("data-set-richType")===RICH_GRID){const t=e.startContainer.nodeType===Node.TEXT_NODE?e.startContainer.parentNode.parentNode:e.startContainer,i=e.endContainer.nodeType===Node.TEXT_NODE?e.endContainer.parentNode.parentNode:e.endContainer;e.deleteContents(),t.getAttribute("data-set-richType")===i.getAttribute("data-set-richType")&&this.markMerge(t,i)}else if(e.commonAncestorContainer===e.startContainer&&e.startContainer===e.endContainer)this.initEditor(!0);else{const t=t=>{if(t.nodeType===Node.TEXT_NODE)return t.parentNode.parentNode.parentNode;switch(t.getAttribute("data-set-richType")){case RICH_INPUT:return t.parentNode.parentNode;case RICH_MARK:return t.parentNode;case RICH_GRID:return t;default:return null}},i=t(e.startContainer),n=t(e.endContainer);if(!i||!n)return;e.deleteContents(),this.gridMerge(i,n)}return!0}gridElmMerge(){const t=window.getSelection(),{focusNode:e,focusOffset:i,isCollapsed:n}=t;if(!e)return this.restCursorPos(this.vnode,this.cursorIndex),!1;if(i>1)return!1;if(!n)return!1;const s=(t,e)=>(t.parentNode===this.richText||t===t.parentNode.childNodes[0])&&(-1!==Array.prototype.indexOf.call(this.richText.childNodes,t)?t:!(e>=6)&&s(t.parentNode,e+1)),a=s(e,0);if(!a||a===this.richText.childNodes[0]||1===i&&"false"===a.children[0].children[0].getAttribute("data-set-empty"))return!1;const l=a.previousSibling;return this.gridMerge(l,a),!0}delMarkRule(){const t=window.getSelection(),e=t.focusNode;if(!e)return this.restCursorPos(this.vnode,this.cursorIndex),!1;const i=e.textContent,n=e.parentNode,s=n.parentNode,a=s.parentNode;if(!t.isCollapsed||n.getAttribute("data-set-richType")!==RICH_INPUT)return!1;if(i&&1===i.length&&s!==a.childNodes[0]&&(0!==t.focusOffset||i===this.VOID_KEY)){if(i===this.VOID_KEY){const t=s.previousSibling;if(t.children[0].classList.contains("at-input")&&t.children[0].children[0].textContent!==this.VOID_KEY)return this.rangeToInputTag(t.children[0]),!0;const e=t.previousSibling;a.removeChild(t),a.removeChild(s);const i=e.childNodes[0],n=i.childNodes[0];n.textContent===this.VOID_KEY&&e===a.lastChild&&i.appendChild(document.createElement("br")),this.restCursorPos(n,n.textContent.length)}else{n.innerHTML=s===a.lastChild?`${this.VOID_KEY}<br>`:this.VOID_KEY,n.setAttribute("data-set-empty","true");const t=n.childNodes[0];this.restCursorPos(t,1)}return!0}if(0===t.focusOffset){const t=n.parentNode,e=null==t?void 0:t.previousSibling;return!(!e||e.getAttribute("data-set-richType")!==RICH_TAG)&&(e.children[0].classList.contains("at-input")&&e.children[0].children[0].textContent!==this.VOID_KEY?(this.rangeToInputTag(e.children[0]),!0):(this.delTag(e),!0))}}delTag(t){const e=t.previousSibling,i=t.nextSibling;t.parentNode.removeChild(t),this.markMerge(e,i)}gridMerge(t,e,i=!0){t.lastChild.getAttribute("data-set-richType")!==RICH_MARK&&t.appendChild(this.getGridElm(!0)),e.childNodes[0].getAttribute("data-set-richType")!==RICH_MARK&&e.insertBefore(this.getGridElm(!0),e.childNodes[0]);const n=t.lastChild.childNodes[0],s=n.childNodes[0];let a=s.textContent.length;Array.from(e.childNodes,e=>{t.appendChild(e.cloneNode(!0))}),e.childNodes.length>1&&n.childNodes[1]&&n.removeChild(n.childNodes[1]);const l=n.parentNode.nextSibling;if(l){const e=l.children[0].childNodes[0];e&&e.textContent!==this.VOID_KEY&&(n.childNodes[1]&&n.removeChild(n.childNodes[1]),s.textContent=(s.textContent+e.textContent).replace(new RegExp(this.VOID_KEY,"g"),()=>(a--,"")),s.parentElement.setAttribute("data-set-empty","false")),t.removeChild(l)}""===s.textContent&&(s.textContent=this.VOID_KEY,s.parentNode.setAttribute("data-set-empty","true"),a=1),this.richText.removeChild(e),i&&this.restCursorPos(s,a)}markMerge(t,e){const i=t.children[0].childNodes[0];let n=i.textContent.length;if(e){const t=e.children[0].childNodes[0];t&&t.textContent!==this.VOID_KEY&&(i.textContent=(i.textContent+t.textContent).replace(new RegExp(this.VOID_KEY,"g"),()=>(n--,"")),i.parentElement.setAttribute("data-set-empty","false")),e.parentNode.removeChild(e)}""===i.textContent&&(i.textContent=this.VOID_KEY,i.parentNode.setAttribute("data-set-empty","true"),n=1);const s=t.parentNode;i.textContent===this.VOID_KEY&&t===s.lastChild&&(i.parentNode.appendChild(document.createElement("br")),i.parentNode.setAttribute("data-set-empty","true"),n=1),this.restCursorPos(i,n)}setCallSpace(t){this.needCallSpace=t}getWrapNode(t,e=!1){if(t.nodeType===Node.TEXT_NODE)return t.parentNode.parentNode.parentNode;const i=t.getAttribute("data-set-richType");if(e&&i===RICH_TAG)return t.parentNode;switch(i){case RICH_INPUT:return t.parentNode.parentNode;case RICH_MARK:return t.parentNode;case RICH_GRID:return t}}getMarkNode(t,e=!1){if(t.nodeType===Node.TEXT_NODE)return t.parentNode?t.parentNode.parentNode:null;const i=t.getAttribute("data-set-richType");if(e&&i===RICH_TAG)return t;switch(i){case RICH_INPUT:return t.parentNode;case RICH_MARK:return t}}getRichTextNodeIndex(t){const e=this.getMarkNode(t),i=e?e.parentNode:null;return e&&i?{gridIndex:Array.prototype.indexOf.call(this.richText.childNodes,i),markIndex:Array.prototype.indexOf.call(i.childNodes,e)}:{gridIndex:null,markIndex:null}}setWrapNodeByMark(t){const e=document.createElement("p");return e.className="chat-grid-wrap",e.setAttribute("data-set-richType",RICH_GRID),Array.from(t,t=>{e.appendChild(t)}),e}setRangeLastText(){const t=this.richText.childNodes[this.richText.childNodes.length-1],e=t.childNodes[t.childNodes.length-1].children[0].childNodes[0];this.restCursorPos(e,e.textContent===this.VOID_KEY?1:e.textContent.length),this.viewIntoPoint()}viewIntoPoint(){let t,e;const i=window.getSelection(),{focusNode:n,focusOffset:s}=i;if(n&&n.parentElement&&n.parentElement.classList.contains("input-write"))t=n.parentElement.parentElement,e=s;else{if(!this.vnode)return;t=this.getMarkNode(this.vnode),e=this.cursorIndex}if(!t)return;const a=t.getBoundingClientRect(),l=Math.ceil(a.height/this.NODE_HEIGHT),o=Math.floor(t.textContent.length/l)||1,r=(Math.floor(e/o)||1)*this.NODE_HEIGHT,c=a.top+(r-this.NODE_HEIGHT),h=this.richText.parentElement,d=h.getBoundingClientRect(),p=d.top,g=d.top+d.height;if(c<p+this.NODE_PADDING_DIFF){const t=p-c;h.scrollTo(0,h.scrollTop-t)}else if(c>g-this.NODE_HEIGHT){const t=c-g+this.NODE_HEIGHT;h.scrollTo(0,h.scrollTop+t)}}insetRangeGrid(t,e=0){const i=this.vnode.textContent,n=i.slice(0,this.cursorIndex-e);0===n.length?(this.vnode.parentElement.setAttribute("data-set-empty","true"),this.vnode.textContent=this.VOID_KEY):this.vnode.textContent=n;let s=i.slice(this.cursorIndex);const a=[],l=document.createDocumentFragment();Array.from(t.children).forEach((t,e)=>{a.push(t),0!==e&&l.appendChild(t)});const o=a[a.length-1].children[0];s&&s.length>0&&s!==this.VOID_KEY?(o.setAttribute("data-set-empty","false"),o.textContent=o.textContent+s):o.setAttribute("data-set-empty","true");const r=this.getMarkNode(this.vnode),c=r.parentElement,h=r.children[0],d=a[0].textContent;d&&d.length>0&&d!==this.VOID_KEY&&(h.setAttribute("data-set-empty","false"),h.textContent=(h.textContent+d).replace(new RegExp(this.VOID_KEY,"g"),"")),h.childNodes[1]&&h.removeChild(h.childNodes[1]),r.nextElementSibling?(o.childNodes[1]&&o.removeChild(o.childNodes[1]),c.insertBefore(l,r.nextElementSibling)):c.appendChild(l);const p=s&&s!==this.VOID_KEY?s.length:0;if(a.length>1){const t=o.childNodes[0];this.restCursorPos(t,t.textContent===this.VOID_KEY?1:t.textContent.length-p)}else{const t=h.childNodes[0];this.restCursorPos(t,t.textContent===this.VOID_KEY?1:t.textContent.length-p)}}insetRangeGrids(t){const e=document.createDocumentFragment();Array.from(t).forEach(t=>{e.appendChild(t)});const i=this.getWrapNode(this.vnode);this.restCursorPos(this.vnode,this.cursorIndex),this.setWrap(!1);const n=i.nextElementSibling;n&&this.richText.insertBefore(e,n);n&&n.previousElementSibling?(this.gridMerge(i,i.nextElementSibling,!1),this.gridMerge(n.previousElementSibling,n,!0)):this.gridMerge(i,i.nextElementSibling,!0)}getOffsetRange(t,e,i=!1){const n=e.children[0].childNodes[0],s=n.textContent;if(0===t)return{rangeNode:n,rangeIndex:i?s.length:s===this.VOID_KEY?1:0};if(s!==this.VOID_KEY&&s.length>=t)return{rangeNode:n,rangeIndex:i?s.length-t:t};let a,l;if(i?(a=Boolean(e.previousElementSibling&&e.previousElementSibling.previousElementSibling),l=Boolean(e.parentElement.previousElementSibling)):(a=Boolean(e.nextElementSibling&&e.nextElementSibling.nextElementSibling),l=Boolean(e.parentElement.nextElementSibling)),!a&&!l)return{rangeNode:n,rangeIndex:i?s.length===this.VOID_KEY?1:0:s.length===this.VOID_KEY?1:s.length};const o=t-s.length,r=i?a?e.previousElementSibling.previousElementSibling:e.parentElement.previousElementSibling.lastElementChild:a?e.nextElementSibling.nextElementSibling:e.parentElement.nextElementSibling.children[0];return this.getOffsetRange(o,r,i)}rangeToInputTag(t){const e=t.children[0].childNodes[0];this.setInputTagRange(e,e.textContent===this.VOID_KEY?1:e.textContent.length)}watchInputTag(t){if(0===t.childNodes.length||0===t.textContent.length)t.textContent=this.VOID_KEY,this.rangeToInputTag(t.parentElement);else{const e=t.childNodes[0];this.target.nextTick(()=>{if(!this.target.chatEvent.isComposition){const i=window.getSelection().focusOffset,n=t.textContent===this.VOID_KEY||-1===t.textContent.indexOf(this.VOID_KEY)?0:1;let s=!1;1===n&&(e.textContent=e.textContent.replace(this.VOID_KEY,""),s=!0),-1!==t.textContent.indexOf(this.INPUT_TAG_WRAP_KEY[1])&&(t.textContent=t.textContent.replace(new RegExp(this.INPUT_TAG_WRAP_KEY[0],"g"),"").replace(new RegExp(this.INPUT_TAG_WRAP_KEY[1],"g"),this.INPUT_TAG_WRAP_KEY),s=!0),s&&this.setInputTagRange(t.childNodes[0],i-n)}})}domItVisible(t.nextElementSibling,t.textContent===this.VOID_KEY,"inline")}backRuleInputTag(t){if(t.textContent===this.VOID_KEY)return this.delTag(t.parentElement.parentElement),!0;const e=window.getSelection();if(0===e.focusOffset&&e.isCollapsed){const e=t.parentElement.parentElement.previousElementSibling.children[0].childNodes[0];return this.restCursorPos(e,e.textContent===this.VOID_KEY?1:e.textContent.length),!0}if(-1!==e.focusNode.textContent.indexOf(this.INPUT_TAG_WRAP_KEY[1])){const t=this.getDiffInputTagOffset(e.focusNode,e.focusOffset,"left");if(t>0){const i=e.focusNode.textContent.slice(0,e.focusOffset-1-t),n=e.focusNode.textContent.slice(e.focusOffset);return e.focusNode.textContent=i+n,e.focusNode.textContent?this.setInputTagRange(e.focusNode,i.length):(e.focusNode.textContent=this.VOID_KEY,this.watchInputTag(e.focusNode.parentElement),this.setInputTagRange(e.focusNode,1)),!0}}return!1}mergeRuleInputTag(t){this.target.nextTick(()=>{t.childNodes.length>1&&(t.removeChild(t.childNodes[1]),this.watchInputTag(t))})}inputTagSwitchRange(t){const{focusNode:e,focusOffset:i}=window.getSelection(),n=e.textContent.length,s=e.parentElement.parentElement.parentElement;let a,l,o,r=!1;switch(t){case"ArrowLeft":i>0&&e.textContent!==this.VOID_KEY?(o=this.getDiffInputTagOffset(e,i,"left"),l=i-1-o,a=e):(a=s.previousElementSibling.children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:a.textContent.length,r=!0);break;case"ArrowRight":i<n&&e.textContent!==this.VOID_KEY?(o=this.getDiffInputTagOffset(e,i,"right"),l=i+1+o,a=e):(a=s.nextElementSibling.children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0,r=!0)}r?this.restCursorPos(a,l):this.setInputTagRange(a,l)}setInputTagRange(t,e){const i=new Range;i.setStart(t,e),i.setEnd(t,e);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(i))}pasteInputTag(t){t=t.replace(new RegExp(this.INPUT_TAG_WRAP_KEY[0],"g"),"").replace(new RegExp(this.INPUT_TAG_WRAP_KEY[1],"g"),this.INPUT_TAG_WRAP_KEY);const e=window.getSelection(),{focusNode:i,focusOffset:n,anchorOffset:s}=e;let a="",l="";e.isCollapsed?(a=i.textContent.slice(0,n)||"",l=i.textContent.slice(n)||""):(a=i.textContent.slice(0,s<n?s:n)||"",l=i.textContent.slice(n>s?n:s)||""),i.textContent=a+t+l,this.setInputTagRange(i,(s<n?s:n)+t.length);const o=i.parentElement;this.watchInputTag(o)}setInputTagWrap(t){const e=window.getSelection(),{focusOffset:i}=e,n=t.textContent,s=n.slice(0,i),a=n.slice(i);t.textContent=s+this.INPUT_TAG_WRAP_KEY+a,this.setInputTagRange(t.childNodes[0],i+this.INPUT_TAG_WRAP_KEY.length),this.watchInputTag(t)}getDiffInputTagOffset(t,e,i){const n="left"===i?t.textContent[e-1]:t.textContent[e];if(-1===this.INPUT_TAG_WRAP_KEY.indexOf(n))return 0;switch(i){case"left":return t.textContent[e-2]===this.INPUT_TAG_WRAP_KEY[1]?2:t.textContent[e-2]===this.INPUT_TAG_WRAP_KEY[0]?3:1;case"right":return t.textContent[e+1]===this.INPUT_TAG_WRAP_KEY[1]?2:t.textContent[e+1]===this.INPUT_TAG_WRAP_KEY[0]?3:1}}}const DEFAULT_OPTIONS={device:"auto",autoFocus:!0,needDialog:!0,needDebounce:!0,asyncMatch:!1,userList:[],reformList:[],placeholder:"",maxLength:-1,copyType:["text"],uploadImage:void 0,needCallEvery:!0,needCallSpace:!1,userProps:{},customTrigger:[],dialogLabels:{pcPointDialog:{},pcPCheckDialog:{},h5Dialog:{}},wrapKeyFun:t=>t.ctrlKey&&["Enter"].includes(t.key),sendKeyFun:t=>!t.ctrlKey&&["Enter"].includes(t.key)},DEFAULT_USER_PROPS={id:"id",name:"name",avatar:"avatar",pinyin:"pinyin"},DEFAULT_PC_POINT_DIALOG={title:"群成员",callEveryLabel:"所有人",checkLabel:"多选",emptyLabel:"暂无数据"},DEFAULT_PC_CHECK_DIALOG={title:"选择要@的人",searchPlaceholder:"搜素人员名称",searchEmptyLabel:"没有匹配到任何结果",userTagTitle:"研讨成员列表",checkAllLabel:"全选",checkEmptyLabel:"请选择需要@的成员",confirmLabel:"确定",cancelLabel:"取消"},DEFAULT_H5_DIALOG={title:"选择提醒的人",callEveryLabel:"所有人",searchPlaceholder:"搜素人员名称",searchEmptyLabel:"没有匹配到任何结果",confirmLabel:"确定",cancelLabel:"收起"},DEFAULT_REDUCE_CONFIG={saveTagData:!1,needUserId:!1,needTagId:!1,needSelectId:!1,wrapClassName:void 0,rowClassName:void 0,imgToText:!1,identifyLink:!1},NotMergeKey=["Backspace","Shift","Tab","CapsLock","Control","Meta","Alt","ContextMenu","Enter","NumpadEnter","Escape","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End","PageUp","PageDown","Insert","Delete","NumLock"],KEY_CODE_MAP={"`":192,"~":192,1:49,"!":49,3:51,"#":51,4:52,$:52,5:53,"%":53,6:54,"^":54,7:55,"&":55,8:56,"*":56,";":186,":":186,"/":191,"?":191,"\\":200,"|":200};class ChatEvent{constructor(t){__publicField(this,"target"),__publicField(this,"outerApply",!1),__publicField(this,"isComposition",!1),__publicField(this,"matchKey",0),__publicField(this,"startOpenIndex",0),__publicField(this,"textLength",0),__publicField(this,"isIMEModel",!1),__publicField(this,"takeIMEModel",!1),__publicField(this,"undoHistory",[]),__publicField(this,"redoHistory",[]),__publicField(this,"doOverHistory",!0),__publicField(this,"notMergeKey",NotMergeKey),__publicField(this,"chatEventModule",{enterSend:[],operate:[],defaultAction:[],atMatch:[],atCheck:[],tagCheck:[],selectCheck:[],tipTagState:[],afterAtCheck:[],afterTagCheck:[],afterSelectCheck:[],showAtDialog:[],showTagDialog:[],showSelectDialog:[],elementClicked:[]}),__publicField(this,"debounceEvents",{recordHistory:()=>{},dialogMoveToRange:t=>{},selectDialogToAim:()=>{},matchPointDialog:()=>{},movePointActiveUserElm:t=>{},moveCustomActiveTagElm:t=>{}}),this.target=t,this.registerEvent(),this.otherEvent()}registerEvent(){const{chatElement:t,options:e,deviceInfo:i,chatInput:n}=this.target;t.richText.addEventListener("keyup",s=>{if(!s.target.classList.contains("input-write"))if(s.stopPropagation(),i.isPc)if(50===+s.keyCode&&n.keyUpAsKey("@"))this.triggerChatEvent("showAtDialog"),e.needDialog&&t.ruleShowPointDialog();else{e.customTrigger.filter(t=>t.keyCode===s.keyCode).map(t=>t.prefix).forEach(i=>{n.keyUpAsKey(i)&&(this.triggerChatEvent("showTagDialog",i),e.needDialog&&t.showCustomTagDialog(i))})}else if((e.reformList.length>0||e.asyncMatch)&&n.keyUpAsKey("@"))this.triggerChatEvent("showAtDialog"),e.needDialog&&this.target.showH5Dialog(),t.isExternalCallPopup=!1;else{const t=e.customTrigger.map(t=>t.prefix),i=t.indexOf(s.key);-1!==i&&n.keyUpAsKey(t[i])&&this.triggerChatEvent("showTagDialog",s.key)}}),t.richText.addEventListener("keydown",s=>{const a=s.target.classList.contains("input-write");if(!i.isPc&&"Unidentified"===s.key&&229===s.keyCode)return a&&n.mergeRuleInputTag(s.target),void(this.isIMEModel=!0);if(!this.isIMEModel)if(hasElmShow(t.pcElms.pointDialogElm))["ArrowUp","ArrowDown","Enter","NumpadEnter"].includes(s.code)?s.preventDefault():["ArrowLeft","ArrowRight"].includes(s.code)&&t.exitPointDialog();else if(t.pcElms.customTagDialogTagKey&&hasElmShow(t.pcElms.customTagDialogElms[t.pcElms.customTagDialogTagKey]))["ArrowUp","ArrowDown","Enter","NumpadEnter"].includes(s.code)?s.preventDefault():["ArrowLeft","ArrowRight"].includes(s.code)&&t.exitCustomTagDialog();else if(this.isComposition||"Backspace"!==s.code&&"Backspace"!==s.key?e.wrapKeyFun(s)||!i.isPc&&"Enter"===s.key?(s.preventDefault(),this.isComposition||(a?n.setInputTagWrap(s.target):n.setWrap(),this.richTextInput())):e.sendKeyFun(s)?(s.preventDefault(),this.isComposition||this.triggerChatEvent("enterSend")):["ArrowLeft","ArrowRight"].includes(s.code)?(s.preventDefault(),this.isComposition||(a?n.inputTagSwitchRange(s.code):n.switchRange(s.code))):(s.ctrlKey||s.metaKey)&&"KeyA"===s.code?(s.preventDefault(),this.isComposition||this.target.isEmpty()||n.selectAll()):(s.ctrlKey||s.metaKey)&&"KeyZ"===s.code?(s.preventDefault(),this.isComposition||this.ruleChatEvent(()=>{this.target.undo()},"defaultAction","UNDO")):(s.ctrlKey||s.metaKey)&&"KeyY"===s.code&&(s.preventDefault(),this.isComposition||this.ruleChatEvent(()=>{this.target.redo()},"defaultAction","REDO")):a&&n.backRuleInputTag(s.target)||n.selectRegionMerge()||n.gridElmMerge()||n.delMarkRule()?(s.preventDefault(),this.richTextInput()):t.tipElm&&this.target.isEmpty()&&t.removeTipElm(),!s.ctrlKey&&!s.altKey&&!s.metaKey){const t=-1===this.notMergeKey.indexOf(s.key);a?(t||"Backspace"===s.code||"Backspace"===s.key)&&n.mergeRuleInputTag(s.target):t&&n.selectRegionMerge()}}),t.richText.addEventListener("beforeinput",e=>{const i=e.target.classList.contains("input-write");if(this.isIMEModel){if("insertParagraph"===e.inputType)return e.preventDefault(),i?n.setInputTagWrap(e.target):n.setWrap(),void this.richTextInput();if("deleteContentBackward"===e.inputType){this.takeIMEModel=!0,e.preventDefault();const s=t.richText.innerHTML,a=window.getSelection(),l=a.focusNode,o=a.focusOffset,r=i?l.parentElement.parentElement.parentElement:l.parentElement.parentElement,c=r.parentElement,h=Array.prototype.indexOf.call(t.richText.children,c),d=Array.prototype.indexOf.call(c.children,r);this.target.nextTick(()=>{t.richText.innerHTML=s;const e=t.richText.children[h].children[d],a=i?e.children[0].children[0].childNodes[0]:e.children[0].childNodes[0];i?(n.setInputTagRange(a,o),n.backRuleInputTag(a.parentElement)||(a.textContent=a.textContent.slice(0,o-1)+a.textContent.slice(o),n.setInputTagRange(a,o-1)),n.watchInputTag(a.parentElement)):(n.restCursorPos(a,o),n.selectRegionMerge()||n.gridElmMerge()||n.delMarkRule()||(a.textContent=a.textContent.slice(0,o-1)+a.textContent.slice(o),n.restCursorPos(a,o-1))),this.target.nextTick(async()=>{await this.richTextInput(),this.takeIMEModel=!1,this.isIMEModel=!1})})}}}),t.richText.addEventListener("input",async s=>{const a=s.target.classList.contains("input-write");if(this.isIMEModel){if(this.takeIMEModel)return;await this.target.nextTick(()=>{a&&n.watchInputTag(s.target),-1!==e.maxLength&&this.ruleMaxLength(),t.showPlaceholder(),this.triggerChatEvent("operate"),this.isIMEModel=!1})}else{if(a)return n.watchInputTag(s.target),void await this.richTextInput();await this.richTextInput(),i.isPc&&!this.isComposition&&this.debounceEvents.matchPointDialog()}}),t.richText.addEventListener("copy",t=>{t.preventDefault(),this.ruleChatEvent(()=>{this.copyRange(t)},"defaultAction","COPY")}),t.richText.addEventListener("cut",t=>{t.preventDefault(),this.ruleChatEvent(()=>{this.copyRange(t),this.removeRange(),t.target.classList.contains("input-write")&&this.target.chatInput.watchInputTag(t.target)},"defaultAction","CUT")}),t.richText.addEventListener("paste",t=>{t.preventDefault();const{options:e,chatInput:i}=this.target;this.ruleChatEvent(()=>{const n=t.clipboardData.getData("text/plain");if("string"==typeof n&&""!==n){if(-1===e.copyType.indexOf("text"))return;if(t.target.classList.contains("input-write"))return i.pasteInputTag(n),void this.richTextInput();let s=document.createElement("div");s.innerHTML=t.clipboardData.getData("application/my-custom-format")||"",i.selectRegionMerge(),s.children[0]&&s.children[0].getAttribute("data-set-richType")===RICH_GRID?this.insertInsideHtml(s.innerHTML):(s.innerHTML=n,this.target.insertText(s.innerText)),s=null}else{if(-1===e.copyType.indexOf("image"))return;const i=(t.clipboardData||t.originalEvent.clipboardData).items||[];Array.from(i,async t=>{if(-1===t.type.indexOf("image"))return;const i=t.getAsFile();if(e.uploadImage){const t=await e.uploadImage(i);this.target.insertHtml(`<img class="chat-img" src="${t}" alt="" />`)}else{const t=new FileReader;t.onload=t=>{this.target.insertHtml(`<img class="chat-img" src="${t.target.result}" alt="" />`)},t.readAsDataURL(i)}})}},"defaultAction","PASTE")}),t.richText.addEventListener("blur",()=>{n.upDataNodeOrIndex()}),t.richText.addEventListener("focus",()=>{n.upDataNodeOrIndex()}),t.richText.addEventListener("click",t=>{n.upDataNodeOrIndex();const i=upFindElm(t.target,5);if(i){const t=i.children[0];if(t.classList.contains("chat-grid-input"))return void this.triggerChatEvent("elementClicked","gridInput",t);if(t.classList.contains("at-input"))return t.children[0].textContent===n.VOID_KEY&&n.rangeToInputTag(t),void this.triggerChatEvent("elementClicked","inputTag",t);if(t.classList.contains("at-select")){const i=t.getAttribute("data-select-key");return this.triggerChatEvent("showSelectDialog",i,t),e.needDialog&&this.target.showPCSelectDialog(i,t),void this.triggerChatEvent("elementClicked","selectTag",t)}if(t.classList.contains("at-user"))return void this.triggerChatEvent("elementClicked","userTag",t);if(t.classList.contains("at-tag"))return void this.triggerChatEvent("elementClicked","customTag",t);if(t.classList.contains("chat-set-html"))return void this.triggerChatEvent("elementClicked","htmlTag",t.children[0])}}),t.richText.addEventListener("dragstart",t=>{t.stopPropagation(),t.preventDefault()}),t.richText.addEventListener("dragover",t=>{t.stopPropagation(),t.preventDefault()}),t.richText.addEventListener("drop",t=>{t.stopPropagation(),t.preventDefault()}),t.richText.addEventListener("compositionstart",()=>{this.isComposition=!0}),t.richText.addEventListener("compositionend",()=>{this.isComposition=!1}),window.addEventListener("click",this.winClick.bind(this)),window.addEventListener("keydown",this.winKeydown.bind(this))}otherEvent(){const{options:t,chatInput:e,chatElement:i}=this.target,{needDebounce:n}=t,s=()=>{const{gridIndex:t,markIndex:n}=e.getRichTextNodeIndex(e.vnode);if(null===t||null==n)return;const s={html:i.richText.innerHTML,gridIndex:t,markIndex:n,cursorIndex:e.cursorIndex};this.undoHistory.push(s),this.undoHistory.length>50&&this.undoHistory.shift()};this.debounceEvents.recordHistory=n?debounce(s,200):s;const a=t=>{let n="0",s="100%";const a=e.getRangeRect();if(!a)return;const l=i.pcElms.containerDialogElm.getBoundingClientRect();let o=a.x-l.x,r=l.y-a.y;const{clientWidth:c,clientHeight:h}=t;a.x>window.innerWidth-c-30&&(o=a.x-c-l.x-16,n="100%"),a.y<h&&(r-=h,s="0"),t.style.transform="translate(0, 0)",t.style.transformOrigin=`${n} ${s}`,t.style.left=o+6+"px",t.style.bottom=`${r}px`,t.style.opacity="1"};this.debounceEvents.dialogMoveToRange=n?debounce(a,120,!0):a;const l=()=>{if(!t.needDialog)return;const n=e.vnode.textContent||"",s=e.cursorIndex,a=n.slice(0,s);let l=-1,o=-1,r="userTag";if(-1!==a.lastIndexOf("@")&&(l=a.lastIndexOf("@")),i.pcElms.customTagDialogTagKey&&-1!==a.lastIndexOf(i.pcElms.customTagDialogTagKey)&&(o=a.lastIndexOf(i.pcElms.customTagDialogTagKey)),o>l&&(r="customTag"),"userTag"===r&&t.asyncMatch){if(l<0)return void i.exitPointDialog();this.matchKey++;const t=this.matchKey;this.startOpenIndex=l+1;const e=a.slice(this.startOpenIndex)||"";if(/\s/gi.test(e))return void i.exitPointDialog();this.target.updateUserList([]),domItVisible(i.pcElms.pointDialogLoadingElm,!0,"flex"),domItVisible(i.pcElms.pointDialogEmptyElm),i.showPointDialog();const n=this.triggerChatEvent("atMatch",e).find(t=>t&&t instanceof Promise);return void(n&&n.then(e=>{t===this.matchKey&&(domItVisible(i.pcElms.pointDialogLoadingElm),!e||e.length<=0?domItVisible(i.pcElms.pointDialogEmptyElm,!0,"flex"):(this.target.updateUserList(e),i.pcElms.pointDialogUsersElm&&i.pcElms.pointDialogUsersElm.length>0&&i.updatePointActiveUserElm(i.pcElms.pointDialogUsersElm[0].elm)))}))}if("userTag"===r&&t.reformList.length<=0)return void i.exitCustomTagDialog();if("customTag"===r&&i.customTags[i.pcElms.customTagDialogTagKey].length<=0)return;const c=()=>{"userTag"===r?i.exitPointDialog():i.exitCustomTagDialog()};if(l<0&&o<0)return i.exitPointDialog(),void i.exitCustomTagDialog();this.startOpenIndex="userTag"===r?l+1:o+1;const h=new RegExp(`^([${e.ZERO_WIDTH_KEY}${e.VOID_KEY}])+$`);if(!a||h.test(a)||s<this.startOpenIndex)return void c();const d=a.slice(this.startOpenIndex)||"";if(/\s/gi.test(d))c();else if(d)if("userTag"===r){const t=this.target.searchUserList(d);t.length>0?i.showPointDialog(t):c()}else{const t=i.customTags[i.pcElms.customTagDialogTagKey].filter(t=>pinyinMatch(t.name,t.pinyin||"",d));t.length>0?i.showCustomTagDialog(i.pcElms.customTagDialogTagKey,t):c()}else"userTag"===r?i.showPointDialog():i.showCustomTagDialog(i.pcElms.customTagDialogTagKey)};this.debounceEvents.matchPointDialog=n?debounce(l,200):l;this.debounceEvents.movePointActiveUserElm=throttle(t=>{if(!i.pcElms.pointDialogActiveElm)return;let e=0;const n=i.pcElms.pointDialogActiveElm.getAttribute("data-set-id");i.pcElms.pointDialogUsersElm.some(t=>{const i=t.elm.getAttribute("data-set-id");return e=t.index,n===i});const s=i.pcElms.pointDialogUsersElm.filter(t=>!t.elm.classList.contains("user-no-match")),a=s.map(t=>t.index);let l;"down"===t?l=e===s[s.length-1].index?s[0]:s[a.indexOf(e)+1]:"up"===t&&(l=e===s[0].index?s[s.length-1]:s[a.indexOf(e)-1]),l&&i.updatePointActiveUserElm(l.elm,!0)},80);this.debounceEvents.moveCustomActiveTagElm=throttle(t=>{if(!i.pcElms.customTagDialogActiveElm)return;const e=i.customTags[i.pcElms.customTagDialogTagKey].map(t=>t.id),n=i.pcElms.customTagDialogActiveElm.getAttribute("data-set-id"),s=e.indexOf(n),a=Array.from(i.pcElms.customTagDialogElms[i.pcElms.customTagDialogTagKey].children[1].children,(t,e)=>({elm:t,index:e})).filter(t=>!t.elm.classList.contains("tag-no-match")),l=a.map(t=>t.index);let o;"down"===t?o=s===a[a.length-1].index?a[0]:a[l.indexOf(s)+1]:"up"===t&&(o=s===a[0].index?a[a.length-1]:a[l.indexOf(s)-1]),o&&i.updateActiveCustomTagElm(o.elm,!0)},80);const o=()=>{const t=i.pcElms.selectDialogAim.getClientRects()[0],e=i.pcElms.selectDialogElms[i.pcElms.selectDialogKey];domItVisible(e,!0);const n=e.querySelector(".chat-select-arrow");let s=e.clientHeight+16;if(s>t.y?(s=-(t.height+16),n.style.top="-16px",n.style.bottom="auto",n.style.transform="rotate(0deg)"):(n.style.transform="rotate(180deg)",n.style.bottom="-16px",n.style.top="auto"),window.innerWidth-t.x<e.clientWidth){const i=e.clientWidth-(window.innerWidth-t.x)-10;e.style.left="auto",e.style.right="10px",n.style.left="auto",n.style.right=i-n.clientWidth/2+t.width/2+"px"}else e.style.left=t.x+"px",e.style.right="auto",n.style.left=t.width/2-n.clientWidth/2+"px",n.style.right="auto";e.style.top=t.y+"px",e.style.transform=`translateY(${-s}px)`;const a=e.querySelector(".chat-select-dialog-main"),l=e.querySelectorAll(".chat-select-dialog-item");let o=0,r=!1,c=0;if(i.pcElms.selectDialogAim.classList.contains("at-select")){const t=i.pcElms.selectDialogAim.getAttribute("data-select-id");updateElmClass(i.pcElms.selectDialogAim,"aim",!0),Array.from(l,e=>{const i=e.lastChild.lastChild,n=t===e.getAttribute("data-set-id");n&&(c=e.clientHeight,r=!0),n||r||(o+=e.clientHeight),domItVisible(i,n,"inline-block")});const e=o-a.clientHeight/2+c/2;a.scrollTop=e>0?e:0}else Array.from(l,t=>{domItVisible(t.lastChild.lastChild,!1,"inline-block")})};this.debounceEvents.selectDialogToAim=n?debounce(o,120):o;const r={html:i.richText.innerHTML,gridIndex:0,markIndex:0,cursorIndex:e.cursorIndex};this.undoHistory=[r]}winClick(){if(!this.target||this.outerApply)return;const{chatElement:t}=this.target;hasElmShow(t.pcElms.pointDialogElm)&&t.exitPointDialog(),t.pcElms.checkDialogSearchResultElm&&domItVisible(t.pcElms.checkDialogSearchResultElm),t.pcElms.customTagDialogTagKey&&hasElmShow(t.pcElms.customTagDialogElms[t.pcElms.customTagDialogTagKey])&&t.exitCustomTagDialog(),t.pcElms.selectDialogKey&&hasElmShow(t.pcElms.selectDialogElms[t.pcElms.selectDialogKey])&&t.exitSelectDialog()}async winKeydown(t){if(!this.target)return;const{chatElement:e,options:i}=this.target;if((t.ctrlKey||t.metaKey)&&"KeyZ"===t.code&&t.preventDefault(),!this.isComposition)if(hasElmShow(e.pcElms.pointDialogElm)){if("ArrowDown"===t.code)return t.preventDefault(),void this.debounceEvents.movePointActiveUserElm("down");if("ArrowUp"===t.code)return t.preventDefault(),void this.debounceEvents.movePointActiveUserElm("up");if(("Enter"===t.code||"NumpadEnter"===t.code)&&e.pcElms.pointDialogActiveElm){t.preventDefault();const n=e.pcElms.pointDialogActiveElm.getAttribute("data-set-id");if(await sleep(100),e.isPointSearchMode||i.asyncMatch)await this.target.matchSetTag(i.reformList.find(t=>t.id===n));else{const t=i.userList.find(t=>String(t[i.userProps.id])===n);await this.target.onceSetTag(t)}e.exitPointDialog()}}else if(e.pcElms.customTagDialogTagKey&&hasElmShow(e.pcElms.customTagDialogElms[e.pcElms.customTagDialogTagKey])){if("ArrowDown"===t.code)return t.preventDefault(),void this.debounceEvents.moveCustomActiveTagElm("down");if("ArrowUp"===t.code)return t.preventDefault(),void this.debounceEvents.moveCustomActiveTagElm("up");if(("Enter"===t.code||"NumpadEnter"===t.code)&&e.pcElms.customTagDialogActiveElm){t.preventDefault();const i=e.pcElms.customTagDialogActiveElm.getAttribute("data-set-id");await sleep(100);const n=e.customTags[e.pcElms.customTagDialogTagKey].find(t=>t.id===i);e.isPointSearchMode?await this.target.matchSetCustomTag(n):await this.target.onceSetCustomTag(n),e.exitCustomTagDialog()}}}async richTextInput(t=!0){const{chatInput:e,deviceInfo:i,chatElement:n,options:s}=this.target;return e.upDataNodeOrIndex(),i.isPc&&e.selectRegionMerge(),await this.target.nextTick(()=>{this.isComposition||e.updateGrid(),this.fixEditor()||(-1!==s.maxLength&&this.ruleMaxLength(),n.showPlaceholder(),this.triggerChatEvent("operate"),t&&this.doOverHistory&&!this.isComposition&&this.debounceEvents.recordHistory(),e.viewIntoPoint())}),!0}ruleMaxLength(){const{options:t,chatElement:e}=this.target;if(this.target.isEmpty()||-1===t.maxLength)return void(this.textLength=0);let i=0,n=0;const s=[];Array.prototype.some.call(e.richText.children,(e,a)=>{const{nodeInfos:l,nodeTextLength:o}=this.getGirdNodeTextInfo(e);if(i+=o,s.push(l),n=a,i>=t.maxLength)return!0});const a=[];Array.from(e.richText.children,(t,e)=>{e>n&&a.push(t)}),a.forEach(t=>e.richText.removeChild(t)),this.deepDelGirdText(s,i)}getGirdNodeTextInfo(t){const{chatInput:e}=this.target,i=[];let n=0;if(1===t.children.length&&t!==t.parentElement.children[0]){const s=t.children[0],a=(s.textContent||"").replace(new RegExp(e.VOID_KEY,"g"),"");n+=a.length||1,i[0]={node:s,textLength:a.length||1,type:RICH_MARK}}else Array.from(t.children,(t,s)=>{if(t.getAttribute("data-set-richType")===RICH_MARK){const a=(t.textContent||"").replace(new RegExp(e.VOID_KEY,"g"),"");n+=a.length,i[s]={node:t,textLength:a.length,type:RICH_MARK}}else{const a=(t.textContent||"").replace(new RegExp(e.VOID_KEY,"g"),"");n+=a.length||1,i[s]={node:t,textLength:a.length||1,type:RICH_TAG}}});return{nodeInfos:i,nodeTextLength:n}}deepDelGirdText(t,e){if(e>this.target.options.maxLength){const i=t[t.length-1];t.pop(),this.deepDelNode(i,t,e)}else this.textLength=e}deepDelNode(t,e,i){const n=t[0].node.parentElement;if(i>this.target.options.maxLength){let s=i-this.target.options.maxLength,a=t[t.length-1];if(a.type===RICH_MARK)if(0===a.textLength||s>=a.textLength)n.removeChild(a.node),t.pop(),s-=a.textLength,a=t[t.length-1],n.removeChild(a.node),t.pop(),s-=a.textLength;else{const t=a.node.childNodes[0];t.textContent=t.textContent.slice(0,a.textLength-s),0===t.textContent&&(t.setAttribute("data-set-empty","true"),t.innerHTML=`${this.target.chatInput.VOID_KEY}<br>`),s=0}else n.removeChild(a.node),t.pop(),s-=a.textLength;s>0?t.length>0?this.deepDelNode(t,e,s+this.target.options.maxLength):(this.target.chatElement.richText.appendChild(n),this.deepDelGirdText(e,s+this.target.options.maxLength)):(this.textLength=this.target.options.maxLength+s,this.target.chatInput.setRangeLastText())}}copyRange(t){const e=window.getSelection();if(e.isCollapsed||e.rangeCount<=0)return t.clipboardData.setData("application/my-custom-format",""),void t.clipboardData.setData("text/plain","");const{chatElement:i,chatInput:n}=this.target,s=e.toString()||"";let a=document.createElement("div");a.innerHTML=s;const l=a.innerText.replace(/\n\n/g,"\n");a=null,t.clipboardData.setData("text/plain",l);const o=e.anchorNode,r=e.focusNode;if(o===r&&o.nodeType===Node.TEXT_NODE)return void t.clipboardData.setData("application/my-custom-format",l);if(o===i.richText&&r===i.richText)return void t.clipboardData.setData("application/my-custom-format",i.richText.innerHTML);const c=n.getWrapNode(o,!0),h=n.getWrapNode(r,!0),d=n.getMarkNode(o,!0),p=n.getMarkNode(r,!0),g=d.getAttribute("data-set-richType")===RICH_MARK,m=p.getAttribute("data-set-richType")===RICH_MARK,u=Array.prototype.indexOf.call(c.childNodes,d),E=Array.prototype.indexOf.call(h.childNodes,p);if(c===h&&c.parentNode===i.richText){const i=u>E,s=Array.prototype.filter.call(c.childNodes,(t,e)=>i?e<u&&e>E:e>u&&e<E).map(t=>t.cloneNode(!0)),a=g?i?o.textContent.slice(0,e.anchorOffset):o.textContent.slice(e.anchorOffset):"",l=m?i?r.textContent.slice(e.focusOffset):r.textContent.slice(0,e.focusOffset):"",h=n.getGridElm(!0),d=n.getGridElm(!0);a&&(h.childNodes[0].innerHTML=a,h.childNodes[0].setAttribute("data-set-empty","false")),l&&(d.childNodes[0].innerHTML=l,d.childNodes[0].setAttribute("data-set-empty","false")),i?(s[0].getAttribute("data-set-richType")!==RICH_MARK&&s.unshift(d),s[s.length-1].getAttribute("data-set-richType")!==RICH_MARK&&s.push(h)):(s[0].getAttribute("data-set-richType")!==RICH_MARK&&s.unshift(h),s[s.length-1].getAttribute("data-set-richType")!==RICH_MARK&&s.push(d));let p=document.createElement("div");const C=n.setWrapNodeByMark(s);return p.appendChild(C),t.clipboardData.setData("application/my-custom-format",p.innerHTML),void(p=null)}if(c.parentNode===i.richText&&h.parentNode===i.richText){const s=Array.prototype.indexOf.call(i.richText.childNodes,c),a=Array.prototype.indexOf.call(i.richText.childNodes,h),l=s>a,d=Array.prototype.filter.call(i.richText.childNodes,(t,e)=>l?e<s&&e>a:e>s&&e<a).map(t=>t.cloneNode(!0)),p=g?l?o.textContent.slice(0,e.anchorOffset):o.textContent.slice(e.anchorOffset):"",C=m?l?r.textContent.slice(e.focusOffset):r.textContent.slice(0,e.focusOffset):"",f=n.getGridElm(!0),x=n.getGridElm(!0);p&&(f.childNodes[0].innerHTML=p,f.childNodes[0].setAttribute("data-set-empty","false")),C&&(x.childNodes[0].innerHTML=C,x.childNodes[0].setAttribute("data-set-empty","false"));const T=Array.prototype.filter.call(c.childNodes,(t,e)=>l?e<u:e>u).map(t=>t.cloneNode(!0)),y=Array.prototype.filter.call(h.childNodes,(t,e)=>l?e>E:e<E).map(t=>t.cloneNode(!0));if(l){T.push(f),y.unshift(x);const t=n.setWrapNodeByMark(T),e=n.setWrapNodeByMark(y);d.push(t),d.unshift(e)}else{T.unshift(f),y.push(x);const t=n.setWrapNodeByMark(T),e=n.setWrapNodeByMark(y);d.unshift(t),d.push(e)}let v=document.createElement("div");return Array.from(d,t=>{v.appendChild(t)}),t.clipboardData.setData("application/my-custom-format",v.innerHTML),void(v=null)}}removeRange(){const{chatInput:t,chatElement:e}=this.target;window.getSelection().getRangeAt(0).deleteContents(),this.target.nextTick(()=>{t.updateGrid(),e.showPlaceholder()})}async setChatHistory(t){const{chatElement:e,chatInput:i}=this.target;this.doOverHistory=!1;const{html:n,gridIndex:s,markIndex:a,cursorIndex:l}=t;e.richText.innerHTML=n;const o=e.richText.childNodes[s].childNodes[a].childNodes[0].childNodes[0];i.restCursorPos(o,l),await this.richTextInput(),this.doOverHistory=!0}async insertInsideHtml(t){const{chatInput:e}=this.target;let i=document.createElement("div");i.innerHTML=t,i.children.length&&(1===i.children.length?e.insetRangeGrid(i.children[0]):e.insetRangeGrids(i.children),i=null,await this.richTextInput())}triggerChatEvent(t,...e){const i=[];return this.chatEventModule[t].forEach(t=>{t&&i.push(t(...e))}),i}ruleChatEvent(t,e,...i){this.triggerChatEvent(e,...i).some(t=>t&&"PREVENT"===t)||(t&&t.bind(this)(),t=null)}fixEditor(){const t=(this.target.chatElement.richText.children[0]||{children:[]}).children[0];if(!t||!t.getAttribute||t.getAttribute("data-set-richType")!==RICH_MARK)return this.target.chatInput.initEditor(!0),this.target.chatElement.showPlaceholder(),this.triggerChatEvent("operate"),!0}}class ChatOperateNode{constructor(t){__publicField(this,"target"),__publicField(this,"rankLen",4),this.target=t}getCurrentNodes(){const t=[];return Array.from(this.target.chatElement.richText.children,(e,i)=>{t.push(this.analyzeGrid(e,i))}),t}getRank(t){let e=t+1+"";const i=this.rankLen-e.length;for(let t=0;t<i;t++)e="0"+e;return e}analyzeGrid(t,e){const i={type:"gridBox",rank:this.getRank(e),children:[]};return Array.from(t.children,(t,e)=>{switch(t.getAttribute("data-set-richType")){case RICH_MARK:i.children.push(this.analyzeMark(t,e,i.rank));break;case RICH_TAG:i.children.push(this.analyzeTag(t,e,i.rank))}}),i}analyzeMark(t,e,i){return{type:"gridInput",rank:i+this.getRank(e),text:t.textContent.replace(new RegExp(this.target.chatInput.VOID_KEY,"g"),"")}}analyzeTag(t,e,i){const n=t.children[0],s={type:"htmlTag",rank:i+this.getRank(e)};return n.classList.contains("at-user")?(s.type="userTag",s.dataset={[this.target.options.userProps.id]:n.getAttribute("data-user-id"),[this.target.options.userProps.name]:n.textContent.slice(1)}):n.classList.contains("at-tag")?(s.type="customTag",s.dataset={id:n.getAttribute("data-tag-id"),name:n.textContent.slice(1),prefix:n.getAttribute("data-set-prefix")}):n.classList.contains("at-select")?(s.type="selectTag",s.dataset={id:n.getAttribute("data-select-id"),name:n.textContent,key:n.getAttribute("data-select-key")}):n.classList.contains("at-input")?(s.type="inputTag",s.dataset={key:n.getAttribute("data-input-key"),placeholder:n.children[1].textContent,value:n.children[0].textContent===this.target.chatInput.VOID_KEY?"":n.children[0].textContent.replace(new RegExp(this.target.chatInput.INPUT_TAG_WRAP_KEY[0],"g"),"")}):(s.type="htmlTag",s.html=t.children[0].innerHTML),s}analyzeGridNodes(t){t.children=t.children||[];const e=t.children;if(0===e.length)return void e.push({type:"gridInput",rank:t.rank+this.getRank(0),text:""});const i=[];e.forEach((t,n)=>{if(n===e.length-1)return;const s=n+1;if("gridInput"===t.type&&"gridInput"===e[s].type){let t=s-i.length;i.push(t)}}),i.forEach(t=>{const i=e[t];e[t-1].text+=i.text,e.splice(t,1)});const n=[];e.forEach((t,i)=>{if(i===e.length-1)return;const s=i+1;if("gridInput"!==t.type&&"gridInput"!==e[s].type){let t=s+n.length;n.push(t)}}),n.forEach(t=>{e.splice(t,0,{type:"gridInput",rank:"",text:""})}),"gridInput"!==e[0].type&&e.unshift({type:"gridInput",rank:"",text:""}),"gridInput"!==e[e.length-1].type&&e.push({type:"gridInput",rank:"",text:""}),e.forEach((e,i)=>{e.rank=t.rank+this.getRank(i)})}analyzeNode(t,e=!1){switch(t.type){case"gridInput":return`<span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="${String(""===t.text)}">${""===t.text?this.target.chatInput.VOID_KEY:escapeHtml(t.text)}${e&&""===t.text?"<br>":""}</span></span>`;case"userTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-user" data-user-id="${t.dataset[this.target.options.userProps.id]}">@${t.dataset[this.target.options.userProps.name]}</span></span>`;case"customTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-tag" data-tag-id="${t.dataset.id}" data-set-prefix="${t.dataset.prefix}">${t.dataset.prefix}${t.dataset.name}</span></span>`;case"selectTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-select" data-select-id="${t.dataset.id}" data-select-key="${t.dataset.key}">${t.dataset.name}${arrowSvg}</span></span>`;case"htmlTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="chat-set-html">${t.html}</span></span>`;case"inputTag":const i=!Boolean(t.dataset.value),n=i?`<span class="input-tip">${t.dataset.placeholder}</span>`:`<span class="input-tip chat-view-show" style="display: none">${t.dataset.placeholder}</span>`;return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-input" contenteditable="false" data-input-key="${t.dataset.key}"><span class="input-write" contenteditable="true">${i?this.target.chatInput.VOID_KEY:t.dataset.value.replace(new RegExp(this.target.chatInput.INPUT_TAG_WRAP_KEY[1],"g"),this.target.chatInput.INPUT_TAG_WRAP_KEY)}</span>${n}</span></span>`;case"gridBox":let s="";return this.analyzeGridNodes(t),t.children.forEach((e,i)=>{s+=this.analyzeNode(e,i===t.children.length-1)}),`<p class="chat-grid-wrap" data-set-richType="${RICH_GRID}">${s}</p>`;default:return""}}async insertNode(t){if("gridBox"===t.type){const e=this.analyzeNode(t);let i=document.createElement("div");i.innerHTML=e;const n=i.children[0],s=parseFloat(t.rank)-1;if(-1===s||s>this.target.chatElement.richText.children.length-1)this.target.chatElement.richText.appendChild(n);else{const t=this.target.chatElement.richText.children[s];if(!t)return;this.target.chatElement.richText.insertBefore(n,t)}const a=n.lastElementChild.children[0].childNodes[0];this.target.chatInput.restCursorPos(a,a.textContent===this.target.chatInput.VOID_KEY?1:a.textContent.length),i=null,await this.target.chatEvent.richTextInput()}else{const e=(t.text||"").length,i=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=this.getNodeByRank(i[0]);if(!n)return;const s=parseFloat(i[1])-1;-1==s?n.children.push(t):n.children.splice(s,0,t),await this.updateNode(n,()=>{if("gridInput"===t.type){const t=-1===s||s>n.children.length-1,i=!t&&s%2==0,a=t?n.children[n.children.length-1]:n.children[i?s:s-1];this.setCursorNode(a,i?e:-1)}else{const e=n.children.indexOf(t);this.setCursorNode(n.children[e+1],0)}})}}async updateNode(t,e){const i=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=parseFloat(i[0])-1,s=this.target.chatElement.richText.children[n];if("gridBox"===t.type){if(!s)return;this.analyzeGridNodes(t);let i="";if(t.children.forEach((e,n)=>{i+=this.analyzeNode(e,n===t.children.length-1)}),s.innerHTML=i,e)e();else{const t=s.lastElementChild.children[0].childNodes[0];this.target.chatInput.restCursorPos(t,t.textContent===this.target.chatInput.VOID_KEY?1:t.textContent.length)}return void await this.target.chatEvent.richTextInput()}const a=parseFloat(i[1])-1,l=s.children[a],o=this.getNodeByRank(t.rank);if(!o||t.type!==o.type)return;let r,c;if("gridInput"===t.type){const e=l.children[0];e.innerHTML=escapeHtml(t.text);const i=""!==e.textContent;e.setAttribute("data-set-empty",String(!i)),i||(e.innerHTML=l.nextElementSibling?this.target.chatInput.VOID_KEY:`${this.target.chatInput.VOID_KEY}<br>`),r=e.childNodes[0],c=r.textContent.length}else if("userTag"===t.type){const e=l.children[0];e.setAttribute("data-user-id",t.dataset[this.target.options.userProps.id]),e.textContent=`@${t.dataset[this.target.options.userProps.name]}`;r=l.nextElementSibling.children[0].childNodes[0]}else if("customTag"===t.type){const e=l.children[0];e.setAttribute("data-tag-id",t.dataset.id),e.setAttribute("data-set-prefix",t.dataset.prefix),e.textContent=`${t.dataset.prefix}${t.dataset.name}`;r=l.nextElementSibling.children[0].childNodes[0]}else if("selectTag"===t.type){const e=l.children[0];e.setAttribute("data-select-id",t.dataset.id),e.setAttribute("data-select-key",t.dataset.key),e.childNodes[0].textContent=t.dataset.name;r=l.nextElementSibling.children[0].childNodes[0]}else if("htmlTag"===t.type){l.children[0].innerHTML=t.html;r=l.nextElementSibling.children[0].childNodes[0]}e?e():this.target.chatInput.restCursorPos(r,c),await this.target.chatEvent.richTextInput()}getNodeByRank(t){if(!t)return null;const e=t.match(new RegExp(`.{1,${this.rankLen}}`,"g"));if(0===e.length)return null;const i=parseFloat(e[0])-1,n=-1===i?this.target.chatElement.richText.lastElementChild:this.target.chatElement.richText.children[i];if(!n)return null;if(1===e.length)return this.analyzeGrid(n,-1===i?this.target.chatElement.richText.children.length-1:i);-1===i&&(e[0]=this.getRank(this.target.chatElement.richText.children.length-1));const s=parseFloat(e[1])-1,a=-1===s?n.lastElementChild:n.children[s];if(!a)return null;return a.getAttribute("data-set-richType")===RICH_MARK?this.analyzeMark(a,-1===s?n.children.length-1:s,e[0]):this.analyzeTag(a,-1===s?n.children.length-1:s,e[0])}async delNodeByRank(t){const e=this.getNodeByRank(t);if(e)if("gridBox"===e.type){const e=parseFloat(t)-1,i=this.target.chatElement.richText.children[e],n=i.nextElementSibling||i.previousElementSibling;if(n){const t=n.lastElementChild.children[0].childNodes[0];this.target.chatInput.restCursorPos(t,t.textContent===this.target.chatInput.VOID_KEY?1:t.textContent.length)}this.target.chatElement.richText.removeChild(i),0===this.target.chatElement.richText.children.length&&this.target.chatInput.initEditor(!0),await this.target.chatEvent.richTextInput()}else if("gridInput"===e.type)e.text="",await this.updateNode(e);else{const i=e.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=this.getNodeByRank(i[0]),s=n.children[parseFloat(i[1])-1-1],a=s.text.length;n.children=n.children.filter(e=>e.rank!==t),await this.updateNode(n,()=>{this.setCursorNode(s,a)})}}async coverNodes(t){if(t.length<0)return;let e="";t.forEach(t=>{e+=this.analyzeNode(t)}),this.target.chatElement.richText.innerHTML=e,this.target.chatInput.setRangeLastText(),await this.target.chatEvent.richTextInput()}setCursorNode(t,e=-1){const i=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=parseFloat(i[0])-1,s=-1===n?this.target.chatElement.richText.lastElementChild:this.target.chatElement.richText.children[n];let a=null;if("gridInput"===t.type){const t=parseFloat(i[1])-1;a=-1===t?s.lastElementChild:s.children[t]}else if("gridBox"===t.type)a=-1===e?s.lastElementChild:s.children[0];else if("inputTag"===t.type){const t=parseFloat(i[1])-1,n=s.children[t].children[0].children[0].childNodes[0],a=n.textContent===this.target.chatInput.VOID_KEY?1:-1===e?n.textContent.length:e;this.target.chatInput.setInputTagRange(n,a)}else{const t=parseFloat(i[1])-1,n=s.children[t];a=-1===e?n.nextElementSibling:n.previousElementSibling,e=-1===e?0:-1}if(a){const t=a.children[0].childNodes[0];-1===e&&(e=t.textContent.length),this.target.chatInput.restCursorPos(t,t.textContent===this.target.chatInput.VOID_KEY?1:e)}}getCursorNode(){const t=window.getSelection(),e=t.focusNode;if(e&&e.parentElement&&e.parentElement.classList.contains("input-write")){const i=e.parentElement.parentElement.parentElement;return{node:this.analyzeTag(i,Array.prototype.indexOf.call(i.parentElement.children,i),this.getRank(Array.prototype.indexOf.call(this.target.chatElement.richText.children,i.parentElement))),offset:e.textContent===this.target.chatInput.VOID_KEY?0:t.focusOffset}}const i=this.target.chatInput.vnode.parentElement.parentElement;return{node:this.analyzeMark(i,Array.prototype.indexOf.call(i.parentElement.children,i),this.getRank(Array.prototype.indexOf.call(this.target.chatElement.richText.children,i.parentElement))),offset:this.target.chatInput.vnode.textContent===this.target.chatInput.VOID_KEY?0:this.target.chatInput.cursorIndex}}setSelectNodes(t,e,i=0,n=-1){let s,a;const l=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),o=e.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),r=this.target.chatElement.richText.children[parseFloat(l[0])-1],c=this.target.chatElement.richText.children[parseFloat(o[0])-1];if("gridInput"===t.type)s=r.children[parseFloat(l[1])-1];else if("gridBox"===t.type)s=-1===i?r.lastElementChild:r.children[0];else{const t=parseFloat(l[1])-1,e=r.children[t];s=-1===i?e.nextElementSibling:e.previousElementSibling,i=-1===i?0:-1}if("gridInput"===e.type)a=c.children[parseFloat(o[1])-1];else if("gridBox"===t.type)a=-1===n?c.lastElementChild:c.children[0];else{const t=parseFloat(o[1])-1,e=c.children[t];a=-1===n?e.nextElementSibling:e.previousElementSibling,n=-1===n?0:-1}const h=s.children[0].childNodes[0],d=a.children[0].childNodes[0],p=document.createRange(),g=parseFloat(t.rank)>parseFloat(e.rank);p[g?"setEnd":"setStart"](h,h.textContent===this.target.chatInput.VOID_KEY?1:-1===i?h.textContent.length:i),p[g?"setStart":"setEnd"](d,d.textContent===this.target.chatInput.VOID_KEY?1:-1===n?d.textContent.length:n);const m=window.getSelection();m.removeAllRanges(),m.addRange(p)}getElmByRank(t){const e=t.match(new RegExp(`.{1,${this.rankLen}}`,"g")),i=parseFloat(e[0])-1,n=-1===i?this.target.chatElement.richText.lastElementChild:this.target.chatElement.richText.children[i];if(1===e.length)return n;const s=parseFloat(e[1])-1;return-1===s?n.lastElementChild:n.children[s]}getRankByElm(t){const e=this.target.chatElement.richText.children;let i=null,n=null;return Array.prototype.find.call(e,(e,s)=>t===e?(i=s,!0):Array.prototype.find.call(e.children,(e,a)=>e===t&&(i=s,n=a,!0))),(null!==i?this.getRank(i):"")+(null!==n?this.getRank(n):"")}}class ChatComponent{constructor(t){__publicField(this,"target"),__publicField(this,"components",{}),__publicField(this,"eventTypes",[]),this.target=t}useComponent(t){t.props=t.props||{},t.template=strictMinifyHtml(t.template||""),t.template=convertBlocksToSpans(t.template||"",t.props),this.components[t.name]=t;const e=/bind-([a-zA-Z]+)="([^"]*)"/g,i=[];let n;for(;null!==(n=e.exec(t.template));)i.push({eventType:n[1],handlerName:n[2]});i.forEach(t=>{this.useComponentEvent(t.eventType)})}useComponentEvent(t){if(this.eventTypes.includes(t))return;this.eventTypes.push(t);this.target.chatElement.richText.addEventListener(t,e=>{this.componentEventRecognizer(e,t)})}componentEventRecognizer(t,e){const i=t.target,n=upFindElm(i,20);if(!n||!n.classList.contains("chat-tag")||!n.children[0].classList.contains("chat-set-html"))return;const s=n.children[0].children[0],a=s.getAttribute("data-set-component");if(!a)return;const l=this.components[a];if(!l)return;const o=l.methods,r=this.deppComponentEvent(s,e).reverse();let c=!1,h=0;const d=()=>{if(c)return;const n=r[h];if(i===n||n.contains(i)){const i=n.getAttribute("bind-"+e),a=Object.create(null);for(const t in s.dataset)t in l.props&&(a[t]=s.dataset[t]);const r={componentElm:s,targetElm:n,data:a,eventType:e,eventName:i,stopPropagation:()=>{c=!0}};o[i]&&o[i](r,t)}h<r.length-1&&(h++,d())};d()}deppComponentEvent(t,e){const i=[];return t.getAttribute("bind-"+e)&&i.push(t),t.children&&t.children.length>0&&Array.from(t.children).forEach(t=>{i.push(...this.deppComponentEvent(t,e))}),i}async insertComponent(t,e){const i=this.components[t];if(!i)return;const n=Object.assign({},i.props,e),s=replaceTemplateVariables(i.template,{...n,[ELEMENT_COMPONENT_KEY]:i.name}),a=await this.target.insertHtml(s);return await this.target.chatEvent.richTextInput(),a}async removeComponentElm(t){const e=upFindElm(t,20);e&&(this.target.chatInput.delTag(e),await this.target.chatEvent.richTextInput())}async updateComponentElm(t,e){var i,n;const s=upFindElm(t,20);if(!s)return;const a=null==(n=null==(i=null==s?void 0:s.children[0])?void 0:i.children[0])?void 0:n.getAttribute("data-set-component");if(!a)return;const l=this.components[a];if(!l)return;const o=Object.assign({},l.props,e);s.children[0].innerHTML=replaceTemplateVariables(l.template,{...o,[ELEMENT_COMPONENT_KEY]:l.name}),await this.target.chatEvent.richTextInput()}getComponentElms(t){const e=[],i=this.target.chatElement.richText.querySelectorAll(".chat-tag");return Array.from(i,i=>{this.isComponentElm(i,t)&&e.push(i)}),e}isComponentElm(t,e){return!!(t&&t.children[0]&&t.children[0].children[0])&&t.children[0].children[0].getAttribute("data-set-component")===e}}const arrObSort=function(t,e,i){return t.forEach(t=>{if(i in t){const n=e.indexOf(String(t[i]));-1!==n&&(e[n]=t)}}),e.filter(t=>t[i])};class ChatArea{constructor(t){switch(__publicField(this,"options"),__publicField(this,"deviceInfo",os()),__publicField(this,"chatElement"),__publicField(this,"chatInput"),__publicField(this,"chatEvent"),this.options=Object.assign({},DEFAULT_OPTIONS,t),this.options.device=this.options.device.toLocaleLowerCase(),this.deviceInfo.isTablet&&(this.deviceInfo.isPc=!1),this.options.device){case"pc":this.deviceInfo.isPc=!0;break;case"h5":this.deviceInfo.isPc=!1}this.options.userProps=Object.assign({},DEFAULT_USER_PROPS,t.userProps||{}),this.options.dialogLabels.pcPointDialog=Object.assign({},DEFAULT_PC_POINT_DIALOG,getObjValue(t.dialogLabels,"pcPointDialog",{})),this.options.dialogLabels.pcPCheckDialog=Object.assign({},DEFAULT_PC_CHECK_DIALOG,getObjValue(t.dialogLabels,"pcPCheckDialog",{})),this.options.dialogLabels.h5Dialog=Object.assign({},DEFAULT_H5_DIALOG,getObjValue(t.dialogLabels,"h5Dialog",{})),this.chatElement=new ChatElement(this),this.chatInput=new ChatInput(this),this.chatEvent=new ChatEvent(this),this.updateConfig(t);const e=this;Object.defineProperty(this,"richText",{get:()=>e.chatElement.richText}),Object.defineProperty(this,"textLength",{get:()=>e.chatEvent.textLength}),this.options.autoFocus&&this.nextTick(()=>{this.chatElement.richText.focus()})}updateConfig(t){void 0!==t.copyType&&(this.options.copyType=t.copyType),t.userProps&&(this.options.userProps=Object.assign({},DEFAULT_USER_PROPS,t.userProps)),void 0!==t.uploadImage&&(this.options.uploadImage=t.uploadImage),void 0!==t.placeholder&&(this.chatElement.placeholderElm.textContent=t.placeholder),void 0!==t.maxLength&&(this.options.maxLength=t.maxLength<=0?-1:t.maxLength,this.chatEvent.ruleMaxLength()),this.options.asyncMatch?(this.options.needCallEvery=!1,this.updateUserList([])):(void 0!==t.needCallEvery||t.userList)&&(this.options.needCallEvery=getBoolean(void 0===t.needCallEvery?this.options.needCallEvery:t.needCallEvery),this.updateUserList(t.userList)),void 0!==t.needCallSpace&&this.chatInput.setCallSpace(getBoolean(t.needCallSpace)),void 0!==t.wrapKeyFun&&(this.options.wrapKeyFun=t.wrapKeyFun),void 0!==t.sendKeyFun&&(this.options.sendKeyFun=t.sendKeyFun),t.customTrigger&&(this.options.customTrigger=t.customTrigger.map(t=>(t.keyCode=KEY_CODE_MAP[t.prefix]||null,t)),this.options.needDialog&&this.deviceInfo.isPc&&this.chatElement.bindCustomTrigger()),t.selectList&&(this.options.selectList=t.selectList,this.options.needDialog&&this.deviceInfo.isPc&&this.chatElement.bindSelectList())}updateUserList(t=void 0){const{options:e,chatElement:i}=this;if(t){e.userList=JSON.parse(JSON.stringify(t));const i={[e.userProps.id]:"isALL",[e.userProps.name]:""};e.userList.unshift(i),e.reformList=t.map(t=>({id:String(t[e.userProps.id]),name:String(t[e.userProps.name]||""),avatar:String(t[e.userProps.avatar]||""),pinyin:String(t[e.userProps.pinyin]||"")}))}const n=e.userList[0];n&&"isALL"===n[e.userProps.id]&&(n[e.userProps.name]=this.deviceInfo.isPc?e.dialogLabels.pcPointDialog.callEveryLabel:e.dialogLabels.h5Dialog.callEveryLabel),e.needDialog&&(this.deviceInfo.isPc?i.updatePCUser():i.updateH5User())}searchUserList(t){return this.options.reformList.filter(e=>pinyinMatch(e.name,e.pinyin||"",t))}getReduceNode(t){const e=Object.assign({},DEFAULT_REDUCE_CONFIG,t||{});e.saveTagData&&(e.needUserId=!0,e.needTagId=!0,e.needSelectId=!0);const i=/(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g,n=this.chatElement.richText.cloneNode(!0).children||[],s=document.createElement("div");return e.wrapClassName&&(s.className=e.wrapClassName),Array.from(n,(t,n)=>{const a=document.createElement("p");Array.from(t.children,t=>{const n=t.children[0];this.chatInput.getNodeEmpty(n)||(n.removeAttribute("data-set-richType"),n.removeAttribute("contenteditable"),n.removeAttribute("data-set-empty"),e.needUserId||n.removeAttribute("data-user-id"),e.needTagId||(n.removeAttribute("data-set-prefix"),n.removeAttribute("data-tag-id")),e.needSelectId||(n.removeAttribute("data-select-id"),n.removeAttribute("data-select-key")),e.imgToText&&n.firstChild&&"IMG"===n.firstChild.tagName&&(n.classList.add("img-to-text"),n.innerHTML=`[${n.firstChild.getAttribute("data-img-text")||"you need set data-img-text"}]`),e.identifyLink&&n.classList.contains("chat-grid-input")&&(n.innerHTML=n.innerHTML.replace(i,t=>`<a class="chat-grid-link" href="${t}" target="_blank">${t}</a>`)),n.classList.contains("at-select")&&(n.classList.remove("aim"),n.removeChild(n.lastChild)),n.classList.contains("at-input")&&(e.saveTagData?n.setAttribute("data-input-tip",n.children[1].textContent):n.removeAttribute("data-input-key"),n.textContent=n.children[0].textContent!==this.chatInput.VOID_KEY?n.children[0].textContent:n.children[1].textContent,n.textContent=n.textContent.replace(new RegExp(this.chatInput.INPUT_TAG_WRAP_KEY[0],"g"),"")),a.appendChild(n))}),e.rowClassName&&(a.className=e.rowClassName),a.innerHTML||(a.innerHTML="<br>"),s.appendChild(a)}),s}getText(t){let e="";const i=this.getReduceNode(t);return Array.from(i.children,(t,i)=>{e=e+(i>0?"\n":"")+t.textContent}),e}getHtml(t){return this.getReduceNode(t).innerHTML}async reverseAnalysis(t,e){if(!t)return;const i=document.createElement("div");i.innerHTML=t;const n=i.children;Array.from(n,t=>{t.className="chat-grid-wrap",t.setAttribute("data-set-richType",RICH_GRID);const e=t.children,i={},n=[];Array.from(e,(s,a)=>{if(-1!==s.className.indexOf("chat-grid-input")){const t=s.textContent||"";return s.className="",s.setAttribute("data-set-richType",RICH_MARK),void(s.innerHTML=`<span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="false">${escapeHtml(t)}</span>`)}if(s.tagName&&"BR"===s.tagName.toLocaleUpperCase()){const e=this.chatInput.getGridElm(!0);return t.removeChild(s),void t.appendChild(e)}const l=s.cloneNode(!0);l.setAttribute("contenteditable","false");const o=document.createElement("span");if(o.className="chat-tag",o.setAttribute("contenteditable","false"),o.setAttribute("data-set-richType",RICH_TAG),o.appendChild(l),i[a]=o,a!==e.length-1){-1===e[a+1].className.indexOf("chat-grid-input")&&n.push(a)}else n.push(a);0===a&&n.push(-1)});for(const n in i){const s=Number(n),a=i[n].lastChild;if(a.classList.contains("at-select"))a.innerHTML=`${a.textContent}${arrowSvg}`;else if(a.classList.contains("at-input")){const t=""===a.textContent,e=t?`<span class="input-tip">${a.getAttribute("data-input-tip")}</span>`:`<span class="input-tip chat-view-hidden" style="display: none">${a.getAttribute("data-input-tip")}</span>`;a.innerHTML=`<span class="input-write" contenteditable="true">${t?this.chatInput.VOID_KEY:a.textContent.replace(new RegExp(this.chatInput.INPUT_TAG_WRAP_KEY[1],"g"),this.chatInput.INPUT_TAG_WRAP_KEY)}</span>${e}`,a.removeAttribute("data-input-tip")}s===e.length-1?(t.removeChild(e[s]),t.appendChild(i[n])):(t.insertBefore(i[n],e[s+1]),t.removeChild(e[s]))}const s=[],a=t.children;n.forEach(t=>{t===a.length-1?s.push("isEnd"):s.push(a[t+1])}),s.forEach(e=>{const i=this.chatInput.getGridElm(!0);if("isEnd"===e)t.appendChild(i);else{const n=i.children[0];n.childNodes.length>1&&n.removeChild(n.childNodes[1]),t.insertBefore(i,e)}})}),e?(this.chatInput.setRangeLastText(),await this.chatEvent.insertInsideHtml(i.innerHTML)):(this.chatElement.richText.innerHTML=i.innerHTML,this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput())}async insertHtml(t){if(!t)return;const e=document.createElement("span");e.innerHTML=t,e.className="chat-set-html";const i=this.chatInput.createNewDom(e);return this.chatInput.replaceRegContent(i,!1),await this.chatEvent.richTextInput(),i}async insertText(t){if(!t)return;t=escapeHtml(t);const e=new RegExp(`[${this.chatInput.ZERO_WIDTH_KEY}|${this.chatInput.VOID_KEY}]`,"ig"),i=t.replace(e,"");if(!i)return;const n=i.split("\n");let s="";n.forEach(t=>{const e=""!==t;s+=`<p class="chat-grid-wrap" data-set-richType="${RICH_GRID}"><span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="${e?"false":"true"}">${e?t:this.chatInput.VOID_KEY+"<br>"}</span></span></p>`}),await this.chatEvent.insertInsideHtml(s)}getCallUserList(){const t=this.chatElement.richText.querySelectorAll(".at-user");if(t&&t.length>0){const e=Array.from(t,t=>t.dataset.userId);return arrObSort(this.options.userList,e,this.options.userProps.id)}return[]}getCallUserTagList(){const t=this.chatElement.richText.querySelectorAll(".at-user");if(t&&t.length>0){const e=[];return Array.from(t,t=>{e.some(e=>e[this.options.userProps.id]===t.dataset.userId)||e.push({[this.options.userProps.id]:t.dataset.userId,[this.options.userProps.name]:t.textContent.slice(1)})}),e}return[]}getCustomTagList(){const t=Object.keys(this.chatElement.customTags),e={},i=this.chatElement.richText.querySelectorAll(".at-tag");return t.forEach(t=>{let n=Array.prototype.filter.call(i,e=>e.getAttribute("data-set-prefix")===String(t)).map(t=>t.getAttribute("data-tag-id"));n=n.filter((t,e)=>n.indexOf(t)===e),e[t]=arrObSort(this.chatElement.customTags[t],n,"id")}),e}getSelectTagList(){const t=Object.keys(this.chatElement.selectTags),e={},i=this.chatElement.richText.querySelectorAll(".at-select");return t.forEach(t=>{let n=Array.prototype.filter.call(i,e=>e.getAttribute("data-select-key")===String(t)).map(t=>t.getAttribute("data-select-id"));n=n.filter((t,e)=>n.indexOf(t)===e),e[t]=arrObSort(this.chatElement.selectTags[t],n,"id")}),e}getInputTagList(){const t={},e=this.chatElement.richText.querySelectorAll(".at-input");return Array.from(e,e=>{const i=e.getAttribute("data-input-key"),n=e.children[0].textContent===this.chatInput.VOID_KEY?null:e.children[0].textContent;t[i]||(t[i]=[]),t[i].push(n)}),t}async clear(t){this.chatInput.initEditor(!0,t),this.clearHistory(),await this.chatEvent.richTextInput(!1)}isEmpty(t=!1){if((this.chatElement.richText.querySelectorAll(".chat-tag")||[]).length>0)return!1;const e=new RegExp(`^(${this.chatInput.ZERO_WIDTH_KEY}|<br>|${this.chatInput.VOID_KEY})+$`),i=this.chatElement.richText.querySelectorAll(".chat-grid-input")||[];return t?Array.prototype.every.call(i,t=>!t.innerHTML||!t.textContent||!t.textContent.trim()||e.test(t.innerHTML)):Array.prototype.every.call(i,t=>!t.innerHTML||!t.textContent||e.test(t.innerHTML))}dispose(){if(this.options.elm.removeChild(this.chatElement.richText),this.options.elm.removeChild(this.chatElement.placeholderElm),this.options.needDialog)if(this.deviceInfo.isPc){const t=this.chatElement.pcElms.containerDialogElm.parentElement;t&&t.removeChild(this.chatElement.pcElms.containerDialogElm)}else document.body.removeChild(this.chatElement.h5Elms.dialogElm)}showPCPointDialog(){this.options.needDialog&&(this.insertText("@"),this.options.asyncMatch&&domItVisible(this.chatElement.pcElms.pointDialogEmptyElm,!0,"flex"),this.chatEvent.outerApply=!0,this.chatElement.showPointDialog(),sleep(50).then(()=>{this.chatEvent.outerApply=!1}))}showPCCheckDialog(){this.options.needDialog&&!this.options.asyncMatch&&(this.chatEvent.winClick(),this.chatElement.checkboxRows=[],domItVisible(this.chatElement.pcElms.checkDialogElm,!0),updateElmClass(document.body,"disable-scroll",!0),this.chatElement.pcElms.checkDialogTagsElm.scrollTop=0,this.chatElement.pcElms.checkDialogUsersElm.scrollTop=0,this.chatElement.pcElms.checkDialogSearchInputElm.value="",this.chatElement.updateCheckDialogTags(),this.chatElement.isExternalCallPopup=!0)}showPCCustomTagDialog(t){this.options.needDialog&&!this.options.asyncMatch&&(this.insertText(t),this.chatEvent.outerApply=!0,this.chatElement.showCustomTagDialog(t),sleep(50).then(()=>{this.chatEvent.outerApply=!1}))}showPCSelectDialog(t,e){this.chatElement.exitCustomTagDialog(),this.chatElement.exitPointDialog(),this.chatEvent.outerApply=!0,e&&(this.chatElement.exitSelectDialog(),this.chatElement.pcElms.selectDialogAim=e),this.chatElement.pcElms.selectDialogKey=t,this.chatEvent.debounceEvents.selectDialogToAim(),sleep(50).then(()=>{this.chatEvent.outerApply=!1})}showH5Dialog(){this.chatElement.richText&&this.chatElement.richText.blur(),Array.from(this.chatElement.h5Elms.dialogMainElm.children,t=>{t.style.display="",updateElmClass(t,"user-popup-check-item-check")}),updateElmClass(this.chatElement.h5Elms.dialogCheckElm,"disabled",!0),domItVisible(this.chatElement.h5Elms.dialogElm,!0),updateElmClass(document.body,"disable-scroll",!0),this.options.asyncMatch&&domItVisible(this.chatElement.h5Elms.dialogEmptyElm,!0,"flex"),this.chatElement.h5Elms.dialogMainElm.scrollTop=0,this.chatElement.isExternalCallPopup=!0}disabled(){this.chatElement.richText.setAttribute("contenteditable","false"),updateElmClass(this.chatElement.richText,"chat-rich-text-disabled",!0)}enable(){this.chatElement.richText.setAttribute("contenteditable","true"),updateElmClass(this.chatElement.richText,"chat-rich-text-disabled"),this.chatInput.setRangeLastText()}async setUserTag(t){this.chatEvent.triggerChatEvent("atCheck",[t]);const e=this.chatInput.createChatTagElm({id:t[this.options.userProps.id],name:t[this.options.userProps.name]},"@","at-user","user-id");this.chatInput.replaceRegContent(e,!1),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",[t])}async setCustomTag(t,e){this.chatEvent.triggerChatEvent("tagCheck",t,e),await this.chatInput.onceCustomCall(t,!1,e),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterTagCheck",t,e)}async setSelectTag(t,e){if(e||(e=this.chatElement.pcElms.selectDialogKey),this.chatEvent.triggerChatEvent("selectCheck",t,e),this.chatElement.pcElms.selectDialogAim&&this.chatElement.pcElms.selectDialogAim.classList.contains("at-select")){const e=this.chatElement.pcElms.selectDialogAim.getAttribute("data-select-id"),i=this.chatElement.pcElms.selectDialogAim.parentElement.nextElementSibling.childNodes[0].childNodes[0];if(this.chatInput.restCursorPos(i),e===t.id)return;this.chatElement.pcElms.selectDialogAim.setAttribute("data-select-id",t.id),this.chatElement.pcElms.selectDialogAim.childNodes[0].textContent=t.name}else{const i=document.createElement("span");i.setAttribute("class","at-select"),i.setAttribute("data-select-key",e),i.setAttribute("data-select-id",t.id),i.innerHTML=`${t.name}${arrowSvg}`;const n=this.chatInput.createNewDom(i);this.chatInput.replaceRegContent(n,!1)}await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterSelectCheck",t,e)}async setInputTag(t,e,i=""){const n=document.createElement("span");n.setAttribute("class","at-input"),n.setAttribute("contenteditable","false"),n.setAttribute("data-input-key",t);const s=document.createElement("span");s.setAttribute("class","input-write"),s.setAttribute("contenteditable","true"),s.textContent=i||this.chatInput.VOID_KEY;const a=document.createElement("span");a.setAttribute("class","input-tip"),a.textContent="["+(e||"Please input")+"]",n.appendChild(s),n.appendChild(a);const l=this.chatInput.createNewDom(n);this.chatInput.replaceRegContent(l,!1),i&&this.chatInput.watchInputTag(s),this.chatInput.rangeToInputTag(n),await this.chatEvent.richTextInput()}async matchSetTag(t){this.chatEvent.triggerChatEvent("atCheck",[t]),await this.chatInput.onceSearchCall(t,this.chatEvent.startOpenIndex),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",[t])}async onceSetTag(t){this.chatEvent.triggerChatEvent("atCheck",[t]),await this.chatInput.onceCall({id:t[this.options.userProps.id],name:t[this.options.userProps.name]}),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",[t])}async batchSetTag(t){this.chatEvent.triggerChatEvent("atCheck",t);const e=[];for(let i=0;i<=t.length-1;)e.push({id:t[i][this.options.userProps.id],name:t[i][this.options.userProps.name]}),i++;await this.chatInput.batchReplaceRegContent(e,!this.chatElement.isExternalCallPopup),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",t)}async onceSetCustomTag(t,e){e||(e=this.chatElement.pcElms.customTagDialogTagKey),this.chatEvent.triggerChatEvent("tagCheck",t,e),await this.chatInput.onceCustomCall(t,!0,e),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterTagCheck",t,e)}async matchSetCustomTag(t,e){e||(e=this.chatElement.pcElms.customTagDialogTagKey),this.chatEvent.triggerChatEvent("tagCheck",t,e),await this.chatInput.onceCustomCall(t,this.chatEvent.startOpenIndex,e),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterTagCheck",e)}async undo(){const{chatEvent:t}=this;if(!t.doOverHistory||!t.undoHistory||t.undoHistory.length<=1)return;const e=t.undoHistory[t.undoHistory.length-2],i=t.undoHistory[t.undoHistory.length-1];t.redoHistory.push(i),t.undoHistory.pop(),await t.setChatHistory(e)}async redo(){const{chatEvent:t}=this;if(!t.doOverHistory||!t.redoHistory||t.redoHistory.length<1)return;const e=t.redoHistory[t.redoHistory.length-1];t.redoHistory.pop(),t.undoHistory.push(e),await t.setChatHistory(e)}clearHistory(){const{gridIndex:t,markIndex:e}=this.chatInput.getRichTextNodeIndex(this.chatInput.vnode);this.chatEvent.undoHistory=null===t||null==e?[{html:this.chatElement.richText.innerHTML,gridIndex:0,markIndex:0,cursorIndex:this.chatInput.cursorIndex}]:[{html:this.chatElement.richText.innerHTML,gridIndex:t,markIndex:e,cursorIndex:this.chatInput.cursorIndex}],this.chatEvent.redoHistory=[]}cursorMove(t){if(0===t)return void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const e=new RegExp(`[${this.chatInput.ZERO_WIDTH_KEY}|${this.chatInput.VOID_KEY}]`,"ig");if(t>0){const i=this.chatInput.vnode.textContent.replace(e,"").slice(this.chatInput.cursorIndex);if(i.length>=t)return this.chatInput.cursorIndex+=t,void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const n=this.chatInput.vnode.parentElement.parentElement,s=n.parentElement;let a=Boolean(n.nextElementSibling&&n.nextElementSibling.nextElementSibling);const l=Boolean(s.nextElementSibling);if(!a&&!l)return this.chatInput.cursorIndex+=i.length,0===this.chatInput.cursorIndex&&(this.chatInput.cursorIndex=1),void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const o=t-i.length-1,r=a?n.nextElementSibling.nextElementSibling:s.nextElementSibling.children[0],{rangeNode:c,rangeIndex:h}=this.chatInput.getOffsetRange(o,r);this.chatInput.restCursorPos(c,h)}else if(t<0){let i=Math.abs(t);const n=this.chatInput.vnode.textContent.replace(e,"").slice(0,this.chatInput.cursorIndex);if(n.length>=i)return this.chatInput.cursorIndex-=i,void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const s=this.chatInput.vnode.parentElement.parentElement,a=s.parentElement,l=Boolean(s.previousElementSibling&&s.previousElementSibling.previousElementSibling),o=Boolean(a.previousElementSibling);if(!l&&!o)return void this.chatInput.restCursorPos(this.chatInput.vnode);i=i-n.length-1;const r=l?s.previousElementSibling.previousElementSibling:a.previousElementSibling.lastElementChild,{rangeNode:c,rangeIndex:h}=this.chatInput.getOffsetRange(i,r,!0);this.chatInput.restCursorPos(c,h)}}async cursorDel(t){if(0===t)return void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const e=this.chatInput.vnode,i=this.chatInput.cursorIndex;this.cursorMove(t);const n=this.chatInput.vnode,s=this.chatInput.cursorIndex,a=document.createRange();t<0?(a.setStart(n,s),a.setEnd(e,i)):(a.setStart(e,i),a.setEnd(n,s));const l=window.getSelection();l.removeAllRanges(),l.addRange(a),(this.chatInput.selectRegionMerge()||this.chatInput.gridElmMerge()||this.chatInput.delMarkRule())&&await this.chatEvent.richTextInput()}async delUserTags(t){const e=t||this.options.userList.map(t=>t[this.options.userProps.id]),i=this.chatElement.richText.querySelectorAll(".at-user"),n=[];Array.from(i,t=>{const i=t.getAttribute("data-user-id");e.some(t=>String(t)===i)&&n.push(t.parentElement)});for(let t=0;t<n.length;){const e=n[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}async delCustomTags(t,e){const i=this.options.customTrigger.find(e=>e.prefix===t);if(!i||0===i.tagList.length)return;const n=e||i.tagList.map(t=>t.id),s=this.chatElement.richText.querySelectorAll(".at-tag"),a=[];Array.from(s,e=>{const i=e.getAttribute("data-set-prefix"),s=e.getAttribute("data-tag-id");i===t&&n.some(t=>String(t)===s)&&a.push(e.parentElement)});for(let t=0;t<a.length;){const e=a[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}async delSelectTags(t,e){const i=this.options.selectList.find(e=>e.key===t);if(!i||0===i.options.length)return;const n=e||i.options.map(t=>t.id),s=this.chatElement.richText.querySelectorAll(".at-select"),a=[];Array.from(s,e=>{const i=e.getAttribute("data-select-key"),s=e.getAttribute("data-select-id");i===t&&n.some(t=>String(t)===s)&&a.push(e.parentElement)});for(let t=0;t<a.length;){const e=a[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}async delInputTags(t){const e=this.chatElement.richText.querySelectorAll(".at-input"),i=[];Array.from(e,e=>{if(t){const n=e.getAttribute("data-input-key");t.some(t=>String(t)===n)&&i.push(e.parentElement)}else i.push(e.parentElement)});for(let t=0;t<i.length;){const e=i[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}openTipTag(t){this.chatElement.createTipElm(t),this.chatInput.setRangeLastText()}closeTipTag(){this.chatElement.tipElm&&this.chatElement.removeTipElm()}addEventListener(t,e){this.chatEvent.chatEventModule[t].push(e)}removeEventListener(t,e){const i=this.chatEvent.chatEventModule[t],n=i.indexOf(e);-1!==n&&i.splice(n,1)}revisePCPointDialogLabel(t){this.options.needDialog&&(this.options.dialogLabels.pcPointDialog=Object.assign({},DEFAULT_PC_POINT_DIALOG,t||{}),this.chatElement.pcElms.pointDialogElm.querySelector(".call-user-dialog-header-title").textContent=this.options.dialogLabels.pcPointDialog.title,this.chatElement.pcElms.pointDialogCheckElm.textContent=this.options.dialogLabels.pcPointDialog.checkLabel,this.chatElement.pcElms.pointDialogEmptyElm&&(this.chatElement.pcElms.pointDialogEmptyElm.children[1].textContent=this.options.dialogLabels.pcPointDialog.emptyLabel),this.options.asyncMatch||this.updateUserList())}revisePCCheckDialogLabel(t){this.options.needDialog&&!this.options.asyncMatch&&(this.options.dialogLabels.pcPCheckDialog=Object.assign({},DEFAULT_PC_CHECK_DIALOG,t||{}),this.chatElement.pcElms.checkDialogElm.querySelector(".checkbox-dialog-container-header").children[0].textContent=this.options.dialogLabels.pcPCheckDialog.title,this.chatElement.pcElms.checkDialogSearchInputElm.setAttribute("placeholder",this.options.dialogLabels.pcPCheckDialog.searchPlaceholder),this.chatElement.pcElms.checkDialogElm.querySelector(".checkbox-dialog-search-empty").textContent=this.options.dialogLabels.pcPCheckDialog.searchEmptyLabel,this.chatElement.pcElms.checkDialogElm.querySelector(".checkbox-dialog-right-box-title").textContent=this.options.dialogLabels.pcPCheckDialog.userTagTitle,this.chatElement.pcElms.checkDialogUsersElm.children[0].children[2].textContent=this.options.dialogLabels.pcPCheckDialog.checkAllLabel,this.chatElement.pcElms.checkDialogElm.querySelector(".btn-submit").textContent=this.options.dialogLabels.pcPCheckDialog.confirmLabel,this.chatElement.pcElms.checkDialogElm.querySelector(".btn-close").textContent=this.options.dialogLabels.pcPCheckDialog.cancelLabel)}reviseH5DialogLabel(t){this.options.needDialog&&(this.options.dialogLabels.h5Dialog=Object.assign({},DEFAULT_H5_DIALOG,t||{}),this.chatElement.h5Elms.dialogElm.querySelector(".popup-title").textContent=this.options.dialogLabels.h5Dialog.title,this.chatElement.h5Elms.dialogSearchElm.setAttribute("placeholder",this.options.dialogLabels.h5Dialog.searchPlaceholder),this.chatElement.h5Elms.dialogEmptyElm.children[1].textContent=this.options.dialogLabels.h5Dialog.searchEmptyLabel,this.chatElement.h5Elms.dialogCheckElm.textContent=this.options.dialogLabels.h5Dialog.confirmLabel,this.chatElement.h5Elms.dialogShowElm.textContent=this.options.dialogLabels.h5Dialog.cancelLabel,this.options.asyncMatch||this.updateUserList())}async nextTick(t){return new Promise(e=>{requestAnimationFrame(()=>{const i=t();i instanceof Promise?i.then(()=>{e()}):e()})})}createOperateNode(){return new ChatOperateNode(this)}createChatComponent(){return new ChatComponent(this)}}__publicField(ChatArea,"version","5.8.5");
1017
+ // EXTERNAL MODULE: ./node_modules/chatarea/lib/ChatArea.css
1018
+ var lib_ChatArea = __webpack_require__(2736);
1019
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=script&lang=js
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+ /* harmony default export */ const mainvue_type_script_lang_js = ({
1026
+ name: 'ElXEditorSender',
1027
+ components: {
1028
+ ClearButton: ClearButton,
1029
+ LoadingButton: LoadingButton,
1030
+ SendButton: SendButton
1031
+ },
1032
+ props: {
1033
+ // 输入框提示占位语
1034
+ placeholder: {
1035
+ type: String,
1036
+ default: '请输入内容'
1037
+ },
1038
+ // 使用编辑器设备类型 pc内置了很多丰富的弹出选择功能,如果用户传入了h5,弹出交互需要参考自定义弹出去支持
1039
+ device: {
1040
+ type: String,
1041
+ default: 'pc' // pc|h5
1042
+ },
1043
+ // 是否在聊天框生成后自动聚焦
1044
+ autoFocus: {
1045
+ type: Boolean,
1046
+ default: false
1047
+ },
1048
+ // 输入框的变体类型
1049
+ variant: {
1050
+ type: String,
1051
+ default: 'default' // default|updown
1052
+ },
1053
+ // 配置标签下拉选择的选项
1054
+ selectList: {
1055
+ type: Array,
1056
+ default: () => []
1057
+ },
1058
+ // @研讨群成员列表
1059
+ userList: {
1060
+ type: Array,
1061
+ default: () => []
1062
+ },
1063
+ // 扩展自定义弹窗列表
1064
+ customTrigger: {
1065
+ type: Array,
1066
+ default: () => []
1067
+ },
1068
+ // 限制输入框最大字数 *注 该配置项性能开销较大 非必要情况请别设置(像豆包和文心一言都不对这块做限制,不应因小失大)
1069
+ maxLength: {
1070
+ type: Number,
1071
+ default: undefined
1072
+ },
1073
+ // 控制换行与提交模式
1074
+ submitType: {
1075
+ type: String,
1076
+ default: 'enter' // enter|shiftEnter
1077
+ },
1078
+ // 修改输入样式
1079
+ customStyle: {
1080
+ type: Object,
1081
+ default: () => ({})
1082
+ },
1083
+ // 发送按钮加载状态
1084
+ loading: {
1085
+ type: Boolean,
1086
+ default: false
1087
+ },
1088
+ // 是否禁用输入框
1089
+ disabled: {
1090
+ type: Boolean,
1091
+ default: false
1092
+ },
1093
+ // 是否显示清空按钮
1094
+ clearable: {
1095
+ type: Boolean,
1096
+ default: false
1097
+ },
1098
+ // 展开动画事件/ms
1099
+ headerAnimationTimer: {
1100
+ type: Number,
1101
+ default: 300
1102
+ },
1103
+ // 异步加载群成员方法
1104
+ asyncMatchFun: {
1105
+ type: Function,
1106
+ default: undefined
1107
+ },
1108
+ // 是否需要自定义弹窗 开启后内部弹窗将不会再创建了
1109
+ customDialog: {
1110
+ type: Boolean,
1111
+ default: false
1112
+ }
1113
+ },
1114
+ emits: ['submit', 'change', 'cancel', 'show-at-dialog', 'show-select-dialog', 'show-tag-dialog'],
1115
+ data() {
1116
+ return {
1117
+ chat: null,
1118
+ opNode: null,
1119
+ chatState: {
1120
+ isEmpty: true,
1121
+ textLength: 0,
1122
+ // 该属性值只会在配置了maxLength情况下才拥有赋值
1123
+ lastFocusNode: null,
1124
+ lastOffset: 0,
1125
+ wrapCallSelectDialog: false,
1126
+ // 记录是否是外部调用了选择弹窗进行插值行为操作
1127
+ beforeText: '',
1128
+ afterText: ''
1129
+ }
1130
+ };
1131
+ },
1132
+ watch: {
1133
+ disabled(val) {
1134
+ val ? this.chat?.disabled() : this.chat?.enable();
1135
+ },
1136
+ placeholder(val) {
1137
+ this.chat?.updateConfig({
1138
+ placeholder: val
1139
+ });
1140
+ },
1141
+ maxLength(val) {
1142
+ this.chat?.updateConfig({
1143
+ maxLength: val
1144
+ });
1145
+ },
1146
+ submitType(val) {
1147
+ this.chat?.updateConfig({
1148
+ sendKeyFun: val === 'enter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter',
1149
+ wrapKeyFun: val === 'shiftEnter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter'
1150
+ });
1151
+ },
1152
+ userList: {
1153
+ handler(val) {
1154
+ this.chat?.updateConfig({
1155
+ userList: JSON.parse(JSON.stringify(val))
1156
+ });
1157
+ },
1158
+ deep: true
1159
+ },
1160
+ selectList: {
1161
+ handler(val) {
1162
+ this.chat?.updateConfig({
1163
+ selectList: val
1164
+ });
1165
+ },
1166
+ deep: true
1167
+ },
1168
+ customTrigger: {
1169
+ handler(val) {
1170
+ this.chat?.updateConfig({
1171
+ customTrigger: val
1172
+ });
1173
+ },
1174
+ deep: true
1175
+ }
1176
+ },
1177
+ mounted() {
1178
+ this.createChat();
1179
+ },
1180
+ beforeDestroy() {
1181
+ if (this.chat) {
1182
+ this.chat.dispose();
1183
+ this.chat = null;
1184
+ this.opNode = null;
1185
+ window.removeEventListener('keydown', this.keydownESC);
1186
+ }
1187
+ },
1188
+ methods: {
1189
+ // 创建输入框
1190
+ createChat() {
1191
+ this.chat = new ChatArea({
1192
+ elm: this.$refs.container,
1193
+ ...this.$props,
1194
+ userList: JSON.parse(JSON.stringify(this.userList)),
1195
+ needDialog: !this.customDialog && this.device === 'pc',
1196
+ copyType: ['text'],
1197
+ asyncMatch: Boolean(this.asyncMatchFun),
1198
+ needDebounce: true,
1199
+ needCallSpace: false,
1200
+ sendKeyFun: this.submitType === 'enter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter',
1201
+ wrapKeyFun: this.submitType === 'shiftEnter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter'
1202
+ });
1203
+ this.opNode = this.chat.createOperateNode();
1204
+ // 订阅发送事件
1205
+ this.chat.addEventListener('enterSend', this.onSubmit);
1206
+ // 对输入框进行操作事件
1207
+ this.chat.addEventListener('operate', () => {
1208
+ this.chatState.isEmpty = this.chat.isEmpty(true);
1209
+ this.chatState.textLength = this.chat.textLength;
1210
+ this.$emit('change');
1211
+ });
1212
+ // 失去焦点记录最后一次光标Node节点
1213
+ this.chat.richText.addEventListener('blur', () => {
1214
+ const sel = getSelection();
1215
+ this.chatState.lastFocusNode = sel.focusNode;
1216
+ this.chatState.lastOffset = sel.focusOffset;
1217
+ }, true);
1218
+ // 订阅标签选择事件
1219
+ this.chat.addEventListener('selectCheck', () => {
1220
+ if (this.chatState.wrapCallSelectDialog && this.chatState.beforeText) {
1221
+ this.chat.insertText(this.chatState.beforeText);
1222
+ this.chatState.beforeText = '';
1223
+ }
1224
+ });
1225
+ this.chat.addEventListener('afterSelectCheck', () => {
1226
+ if (this.chatState.wrapCallSelectDialog && this.chatState.afterText) {
1227
+ this.chat.insertText(this.chatState.afterText);
1228
+ this.chatState.afterText = '';
1229
+ this.chatState.wrapCallSelectDialog = false;
1230
+ }
1231
+ });
1232
+ // 接管异步匹配
1233
+ if (this.asyncMatchFun) {
1234
+ this.chat.addEventListener('atMatch', this.asyncMatchFun);
1235
+ }
1236
+ // 检测多种弹窗唤起事件
1237
+ this.chat.addEventListener('showAtDialog', () => {
1238
+ this.$emit('show-at-dialog');
1239
+ });
1240
+ this.chat.addEventListener('showSelectDialog', (key, elm) => {
1241
+ this.$emit('show-select-dialog', key, elm);
1242
+ });
1243
+ this.chat.addEventListener('showTagDialog', prefix => {
1244
+ this.$emit('show-tag-dialog', prefix);
1245
+ });
1246
+ // 禁用编辑器
1247
+ if (this.disabled) {
1248
+ this.chat.disabled();
1249
+ }
1250
+ // 绑定ESC按键关闭提示标签
1251
+ window.addEventListener('keydown', this.keydownESC);
1252
+ },
1253
+ // 获取输入框当前内容
1254
+ getCurrentValue() {
1255
+ const text = this.chat.getText();
1256
+ const html = this.chat.getHtml();
1257
+ const inputTags = this.chat.getInputTagList();
1258
+ const userTags = this.userList.length > 0 ? this.chat.getCallUserTagList() : undefined;
1259
+ const selectTags = this.selectList.length > 0 ? this.chat.getSelectTagList() : undefined;
1260
+ const customTags = this.customTrigger.length > 0 ? this.chat.getCustomTagList() : undefined;
1261
+ return {
1262
+ text,
1263
+ html,
1264
+ inputTags,
1265
+ userTags,
1266
+ selectTags,
1267
+ customTags
1268
+ };
1269
+ },
1270
+ // 提交发送方法
1271
+ onSubmit() {
1272
+ // 内容纯空 拦截发送
1273
+ if (this.chatState.isEmpty) {
1274
+ return;
1275
+ }
1276
+ this.$emit('submit', this.getCurrentValue());
1277
+ },
1278
+ // 取消发送方法
1279
+ onCancel() {
1280
+ this.$emit('cancel');
1281
+ },
1282
+ // 清空输入框方法
1283
+ onClear(txt) {
1284
+ this.chat.clear(txt);
1285
+ // 将光标移动到末尾
1286
+ this.focusToEnd();
1287
+ },
1288
+ // 点击内容区域聚焦输入框
1289
+ onContentMouseDown() {
1290
+ requestAnimationFrame(() => {
1291
+ const focusElm = this.chatState.lastFocusNode?.parentElement;
1292
+ const chatInput = this.chat.chatInput;
1293
+ if (focusElm && focusElm.classList.contains('input-write')) {
1294
+ chatInput.setInputTagRange(this.chatState.lastFocusNode, this.chatState.lastOffset);
1295
+ } else {
1296
+ chatInput.restCursorPos(chatInput.vnode, chatInput.cursorIndex);
1297
+ }
1298
+ });
1299
+ },
1300
+ // 聚焦到文本最前方
1301
+ focusToStart() {
1302
+ if (this.chat && this.opNode) {
1303
+ this.opNode.setCursorNode(this.opNode.getNodeByRank(this.opNode.getRank(0) + this.opNode.getRank(0)), 0);
1304
+ }
1305
+ },
1306
+ // 聚焦到文本最后方
1307
+ focusToEnd() {
1308
+ if (this.chat && this.opNode) {
1309
+ this.opNode.setCursorNode(this.opNode.getNodeByRank(this.opNode.getRank(-1) + this.opNode.getRank(-1)));
1310
+ }
1311
+ },
1312
+ // 失去焦点
1313
+ onBlur() {
1314
+ if (this.chat) {
1315
+ const selection = getSelection();
1316
+ selection.removeAllRanges();
1317
+ this.chat.richText.blur();
1318
+ }
1319
+ },
1320
+ // 内容全选
1321
+ selectAll() {
1322
+ if (this.chat && this.opNode) {
1323
+ const firstNode = this.opNode.getNodeByRank(this.opNode.getRank(0) + this.opNode.getRank(0));
1324
+ const lastNode = this.opNode.getNodeByRank(this.opNode.getRank(-1) + this.opNode.getRank(-1));
1325
+ this.opNode.setSelectNodes(firstNode, lastNode);
1326
+ }
1327
+ },
1328
+ // 插入一个选择标签
1329
+ setSelectTag(key, tagId) {
1330
+ this.chatState.wrapCallSelectDialog = false;
1331
+ const tag = this.selectList?.find(option => option.key === key)?.options.find(tag => tag.id === tagId);
1332
+ if (tag) {
1333
+ this.chat.setSelectTag(tag, key);
1334
+ }
1335
+ },
1336
+ // 插入一个输入标签
1337
+ setInputTag(key, placeholder, defaultValue) {
1338
+ this.chat.setInputTag(key, placeholder, defaultValue);
1339
+ },
1340
+ // 插入一个@提及标签
1341
+ setUserTag(userId) {
1342
+ const user = this.userList?.find(user => user.id === userId);
1343
+ if (user) {
1344
+ this.chat.setUserTag(user);
1345
+ }
1346
+ },
1347
+ // 插入一个自定义触发符标签
1348
+ setCustomTag(prefix, id) {
1349
+ const custom = this.customTrigger?.find(option => option.prefix === prefix)?.tagList.find(tag => tag.id === id);
1350
+ if (custom) {
1351
+ this.chat.setCustomTag(custom, prefix);
1352
+ }
1353
+ },
1354
+ // 混合式插入
1355
+ setMixTags(tags) {
1356
+ // 整合ChatNode
1357
+ const chatNodes = tags.map((row, index) => {
1358
+ return {
1359
+ type: 'gridBox',
1360
+ rank: this.opNode.getRank(index),
1361
+ children: row.map(cRow => {
1362
+ return {
1363
+ type: cRow.type,
1364
+ text: cRow.value,
1365
+ html: cRow.value,
1366
+ dataset: {
1367
+ id: cRow.value,
1368
+ name: this.getNameByTypeId(cRow),
1369
+ prefix: cRow.key,
1370
+ key: cRow.key,
1371
+ placeholder: cRow.placeholder,
1372
+ value: cRow.value
1373
+ }
1374
+ };
1375
+ })
1376
+ };
1377
+ });
1378
+ this.opNode.coverNodes(chatNodes);
1379
+ },
1380
+ // 根据id和类型捕获目标name
1381
+ getNameByTypeId(mixTag) {
1382
+ const {
1383
+ type,
1384
+ value,
1385
+ key
1386
+ } = mixTag;
1387
+ switch (type) {
1388
+ case 'userTag':
1389
+ return this.userList?.find(user => user.id === value)?.name || '';
1390
+ case 'selectTag':
1391
+ return this.selectList?.find(row => row.key === key)?.options.find(select => select.id === value)?.name || '';
1392
+ case 'customTag':
1393
+ return this.customTrigger?.find(row => row.prefix === key)?.tagList.find(custom => custom.id === value)?.name || '';
1394
+ default:
1395
+ return '';
1396
+ }
1397
+ },
1398
+ // 在当前光标处插入html片段
1399
+ setHtml(html) {
1400
+ // 注* 插入的html标签必须是 行内 或 行内块元素,如果需要块级元素标签 请自行插入行内元素然后修改其css属性为块级元素
1401
+ this.chat.insertHtml(html);
1402
+ },
1403
+ // 在当前光标处插入text内容
1404
+ setText(txt) {
1405
+ this.chat.insertText(txt);
1406
+ },
1407
+ // 外部调用唤起标签选择弹窗
1408
+ openSelectDialog(option) {
1409
+ this.chatState.beforeText = option.beforeText || '';
1410
+ this.chatState.afterText = option.afterText || '';
1411
+ this.chatState.wrapCallSelectDialog = true;
1412
+ this.chat.showPCSelectDialog(option.key, option.elm);
1413
+ },
1414
+ // 打开前置提示标签
1415
+ openTipTag(options) {
1416
+ this.chat.openTipTag({
1417
+ ...options,
1418
+ codeLabel: 'ESC'
1419
+ });
1420
+ },
1421
+ // 关闭前置提示标签
1422
+ closeTipTag() {
1423
+ this.chat.closeTipTag();
1424
+ },
1425
+ // 绑定ESC按键关闭提示标签
1426
+ keydownESC(event) {
1427
+ if (event.key === 'Escape') {
1428
+ this.closeTipTag();
1429
+ }
1430
+ },
1431
+ // 用户自定义弹窗写入@提及标签
1432
+ customSetUser(user) {
1433
+ // 该方法并未写入ts 因为是一个私有api没暴露给用户 其区别 setUserTag 相比会去向前截取掉触发符
1434
+ this.chat.onceSetTag(user);
1435
+ },
1436
+ // 用户自定义弹窗写入自定义触发符号标签
1437
+ customSetTag(prefix, tag) {
1438
+ this.chat.onceSetCustomTag(tag, prefix);
1439
+ },
1440
+ // 用户自定义弹窗更新选择标签
1441
+ updateSelectTag(elm, tag) {
1442
+ const rank = this.opNode.getRankByElm(elm.parentElement);
1443
+ if (!rank) {
1444
+ return;
1445
+ }
1446
+ const chatNode = this.opNode.getNodeByRank(rank);
1447
+ if (!chatNode) {
1448
+ return;
1449
+ }
1450
+ const dataset = chatNode.dataset;
1451
+ dataset.id = tag.id;
1452
+ dataset.name = tag.name;
1453
+ this.opNode.updateNode(chatNode);
1454
+ }
1455
+ }
1456
+ });
1457
+ ;// ./src/components/EditorSender/src/main.vue?vue&type=script&lang=js
1458
+ /* harmony default export */ const src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
1459
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=style&index=0&id=8ce301dc&prod&lang=scss&scoped=true
1460
+ var mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true = __webpack_require__(9125);
1461
+ ;// ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=style&index=0&id=8ce301dc&prod&lang=scss&scoped=true
1462
+
1463
+
1464
+
1465
+ var mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options = {};
1466
+
1467
+ mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options.insert = "head";
1468
+ mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options.singleton = false;
1469
+
1470
+ var mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true/* default */.A, mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options);
1471
+
1472
+
1473
+
1474
+ /* harmony default export */ const src_mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true = (mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true/* default */.A.locals || {});
1475
+ ;// ./src/components/EditorSender/src/main.vue?vue&type=style&index=0&id=8ce301dc&prod&lang=scss&scoped=true
1476
+
1477
+ ;// ./src/components/EditorSender/src/main.vue
1478
+
1479
+
1480
+
1481
+ ;
1482
+
1483
+
1484
+ /* normalize component */
1485
+
1486
+ var main_component = (0,componentNormalizer/* default */.A)(
1487
+ src_mainvue_type_script_lang_js,
1488
+ render,
1489
+ staticRenderFns,
1490
+ false,
1491
+ null,
1492
+ "8ce301dc",
1493
+ null
1494
+
1495
+ )
1496
+
1497
+ /* harmony default export */ const main = (main_component.exports);
1498
+ ;// ./src/components/EditorSender/index.js
1499
+
1500
+
1501
+ /* istanbul ignore next */
1502
+ main.install = function (Vue) {
1503
+ Vue.component(main.name, main);
1504
+ };
1505
+ /* harmony default export */ const EditorSender = (main);
1506
+ module.exports = __webpack_exports__;
1507
+ /******/ })()
1508
+ ;