// ==UserScript== // @name 爱问答助手 // @namespace aiask/askHelper // @version 2.4.10 // @author aiask // @description 全平台问答助手,一键获取整个页面的试题答案,目前支持【超星学习通、知到智慧树、国家开放大学、广东开放大学、江苏开放大学、上海开放大学、云南开放大学、芯位教育、云慕学苑、职教云、川农在线、安徽继续教育平台、青书学堂、睿学在线、成教云、京人平台、绎通继教云、学起Plus、云上河开、河南继续教育、四川开放大学、良师在线、继教云、日照专业技术人员继续教育、麦能网、21tb、168网校、云班课、电大中专、learnin、西财在线、春风雨】,更多平台开发中... // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAHVQTFRFR3BMgICBQD8/QUVHQ0ZIRUhKX2FiQD8/Tk1NP0VJPzs7Pz8/QD4+UE9QQD8/PVlnQD8/M6vj////n5+fN5C60NDQSl9qOXWSZL/qTFNXzOr4QWl8yMjItLS02traOIOnNZzN6OfnlJeZ9/f3PYGgpdrzmdXxgSBJqQAAABB0Uk5TAP5E6vys+7/Q0RhsfPFV/OwFarYAAAEESURBVHjapdHrboMgGIBhUHBaD/sAlTE8VOt2/5c4GlBMRZOl7w8j+kQQ0FaVwbG48IDq+piMPcgkO1bD/8DXvhD4/fb9ePDuGiqa2krV7pO1AxSLYIl2ABoeTLSvYMBi4N0sphOAlVaqg1aTPggmZYYaFvNMBYGQz6G6m2vbhEBvF81MxALFTDpbQQd3ZhvBgxqiFfBEO/CJ7ZxkNPcUbWBwn5DJw4KSsJHcHPCTLLDuQxpLkiMLbAIWJs1wBRVkyAFXT7Sa+AYQjTywNfOD74DNA18I9Ifjpg7Es/3Jj5eKyIEcBgNwhk5L8XMPonMQQcfNhBfRpIfbFbiRskCX5enFyz/07TSN9vGxKwAAAABJRU5ErkJggg== // @match *://*.chaoxing.com/* // @match *://*.hlju.edu.cn/* // @match *://*.ecust.edu.cn/* // @match *://lms.ouchn.cn/* // @match *://*.ouchn.cn/* // @match *://xczxzdbf.moodle.qwbx.ouchn.cn/* // @match *://study.ouchn.cn/* // @match *://moodle.syxy.ouchn.cn/* // @match *://moodle.qwbx.ouchn.cn/* // @match *://*.tongyi.com/* // @match *://chatglm.cn/* // @match *://xinghuo.xfyun.cn/* // @match *://chat.deepseek.com/* // @match *://*.zhihuishu.com/* // @match *://course.ougd.cn/* // @match *://elearning.bjou.edu.cn/* // @match *://whkpc.hnqtyq.cn:5678/* // @match *://www.51xinwei.com/* // @match *://*.w-ling.cn/* // @match *://*.edu-edu.com/* // @match *://xuexi.jsou.cn/* // @match *://*.icve.com.cn/* // @match *://zice.cnzx.info/* // @match *://any.cnzx.info:81/* // @match *://www.icourse163.org/* // @match *://*.shou.org.cn/* // @match *://*.ahjxjy.cn/* // @match *://*.chinaedu.net/* // @match *://*.qingshuxuetang.com/* // @match *://cce.org.uooconline.com/* // @match *://*.courshare.cn/* // @match *://*.cep.webtrn.cn/* // @match *://*.webtrn.cn/* // @match *://*.cj-edu.com/* // @match *://*.ytccr.com/* // @match *://*.exam-cloud.cn/* // @match *://gdrtvu.exam-cloud.cn/* // @match *://*.open.ha.cn/* // @match *://lhycjy.cloudwis.tech/* // @match *://*.sclecb.cn/* // @match *://*.web2.superchutou.com/* // @match *://*.ls365.net/* // @match *://*.jijiaox.com/* // @match *://*.wencaischool.net/* // @match *://sdrz.gxk.yxlearning.com/* // @match *://*.crjxjy.net/* // @match *://*.cjnep.net/* // @match *://*.91huayi.com/* // @match *://teach.ynou.edu.cn/* // @match *://*.edu-edu.com.cn/* // @match *://*.21tb.com/* // @match *://*.168wangxiao.com/* // @match *://*.mynep.com/* // @match *://www.mosoteach.cn/* // @match *://*.aufe.edu.cn/* // @match *://*.learnin.com.cn/* // @match *://*.ouchn.edu.cn/* // @match *://*.swufe-online.com/* // @match *://ks.cqsdx.cn/* // @match *://*.qau.edu.cn/* // @match *://*.gdufemooc.cn/* // @match *://*.telfri-edu.com/* // @match *://www.beeline-ai.com/* // @match *://*.wxic.edu.cn/* // @match *://*.yxbyun.com/* // @match *://*.wdjycj.com/* // @match *://*.hbcjpt.com/* // @match *://*.csmu.edu.cn/* // @match *://*.ketangx.net/* // @match *://*.cnzx.info/* // @match *://www.asklib.com/* // @match *://*.xust.edu.cn/* // @match *://*.whut.edu.cn/* // @match *://*.lut.edu.cn/* // @match *://*.wwwwsoft.com/* // @match *://*.dufe.edu.cn/* // @match *://*.lygtc.edu.cn/* // @match *://*.iwdjy.com/* // @match *://*.jijiaool.com/* // @match *://lms.cjzx.hblll.com/* // @match *://*.ouc-online.com.cn/* // @match *://*.lsedu.vip/* // @match *://*.jxjypt.cn/* // @require https://lib.baomitu.com/vue/3.4.27/vue.global.min.js // @require https://lib.baomitu.com/vue-demi/0.14.6/index.iife.js // @require data:application/javascript,%3Bwindow.Vue%3DVue%3B // @require https://cdn.jsdelivr.net/npm/@iconify/vue@5.0.0/dist/iconify.js // @require https://lib.baomitu.com/jquery/3.6.0/jquery.min.js // @require https://lib.baomitu.com/dompurify/3.1.6/purify.min.js // @require https://lib.baomitu.com/crypto-js/4.2.0/crypto-js.min.js // @connect 127.0.0.1 // @connect icodef.com // @connect muketool.com // @connect wk66.top // @connect 82.157.105.20 // @connect zhihuishu.com // @connect greasyfork.org // @connect chaoxing.com // @connect shou.org.cn // @connect jsdelivr.net // @connect jsdmirror.cn // @connect gitee.com // @connect vxo.im // @connect zeroai.chat // @connect forestpolice.org // @connect scriptcat.org // @connect aiask.site // @connect * // @grant GM.xmlHttpRequest // @grant GM_addStyle // @grant GM_deleteValue // @grant GM_getValue // @grant GM_info // @grant GM_listValues // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant unsafeWindow // @run-at document-start // ==/UserScript== // hello (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const a=document.createElement("style");a.textContent=e,document.head.append(a)})(" .modal-panel-large[data-v-9e0b5f5c]{width:90vw;max-width:1000px;max-height:90vh;overflow-y:auto}.form-section[data-v-9e0b5f5c]{margin-bottom:32px;padding:20px;background:#f8fafc;border-radius:8px;border:1px solid #e2e8f0}.section-header[data-v-9e0b5f5c]{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #e2e8f0}.section-icon[data-v-9e0b5f5c]{font-size:20px}.section-header h4[data-v-9e0b5f5c]{margin:0;color:#374151;font-weight:600}.sub-questions-editor[data-v-9e0b5f5c]{display:flex;flex-direction:column;gap:24px}.sub-question-editor[data-v-9e0b5f5c]{background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:20px}.sub-question-header[data-v-9e0b5f5c]{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #f1f5f9}.sub-question-number[data-v-9e0b5f5c]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:#3b82f6;color:#fff;border-radius:50%;font-size:14px;font-weight:600}.base-select-small[data-v-9e0b5f5c]{padding:6px 12px;font-size:14px}.btn-small[data-v-9e0b5f5c]{padding:6px 12px;font-size:12px}.form-row[data-v-9e0b5f5c]{margin-bottom:16px}.form-row label[data-v-9e0b5f5c]{display:block;margin-bottom:6px;font-weight:500;color:#374151}.base-input[data-v-9e0b5f5c]{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;transition:border-color .2s}.base-input[data-v-9e0b5f5c]:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.base-select[data-v-9e0b5f5c]{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;background:#fff}.option-list[data-v-9e0b5f5c],.answer-list[data-v-9e0b5f5c]{display:flex;flex-direction:column;gap:8px}.option-row[data-v-9e0b5f5c],.answer-row[data-v-9e0b5f5c]{display:flex;align-items:center;gap:8px}.option-selector[data-v-9e0b5f5c]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:2px solid #d1d5db;border-radius:50%;background:#fff;color:#6b7280;font-weight:600;cursor:pointer;transition:all .2s}.option-selector[data-v-9e0b5f5c]:hover{border-color:#3b82f6;color:#3b82f6}.option-selector.active[data-v-9e0b5f5c]{background:#3b82f6;border-color:#3b82f6;color:#fff}.flex-grow[data-v-9e0b5f5c]{flex:1}.btn[data-v-9e0b5f5c]{padding:8px 16px;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;border:1px solid transparent}.btn-primary[data-v-9e0b5f5c]{background:#3b82f6;color:#fff}.btn-primary[data-v-9e0b5f5c]:hover{background:#2563eb}.btn-outline[data-v-9e0b5f5c]{background:#fff;border-color:#d1d5db;color:#374151}.btn-outline[data-v-9e0b5f5c]:hover{background:#f9fafb;border-color:#9ca3af}.btn-danger[data-v-9e0b5f5c]{background:#ef4444;color:#fff}.btn-danger[data-v-9e0b5f5c]:hover{background:#dc2626}.btn[data-v-9e0b5f5c]:disabled{opacity:.5;cursor:not-allowed}.modal-mask[data-v-9e0b5f5c]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-panel[data-v-9e0b5f5c]{background:#fff;border-radius:12px;box-shadow:0 20px 25px -5px #0000001a;width:90vw;max-width:600px;max-height:80vh;overflow-y:auto}.modal-header[data-v-9e0b5f5c]{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #e5e7eb}.modal-header h3[data-v-9e0b5f5c]{margin:0;color:#111827;font-weight:600}.modal-close[data-v-9e0b5f5c]{width:32px;height:32px;border:none;background:#f3f4f6;border-radius:50%;color:#6b7280;font-size:18px;cursor:pointer;transition:all .2s}.modal-close[data-v-9e0b5f5c]:hover{background:#e5e7eb;color:#374151}.modal-body[data-v-9e0b5f5c]{padding:24px}.modal-footer[data-v-9e0b5f5c]{display:flex;justify-content:flex-end;gap:12px;padding:20px 24px;border-top:1px solid #e5e7eb;background:#f9fafb}.preview-container[data-v-71cc29f1]{padding:16px;background:#f8f9fa;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;line-height:1.5}.toolbar[data-v-71cc29f1]{display:flex;justify-content:space-between;align-items:center;background:#fff;padding:12px 16px;border-radius:8px;box-shadow:0 2px 4px #0000001a;margin-bottom:16px;gap:16px}.toolbar-left .page-title[data-v-71cc29f1]{margin:0;font-size:16px;font-weight:600;color:#333}.toolbar-right[data-v-71cc29f1]{display:flex;align-items:center;gap:12px}.search-box[data-v-71cc29f1]{position:relative;display:flex;align-items:center}.search-input[data-v-71cc29f1]{width:200px;padding:6px 12px;border:1px solid #ddd;border-radius:4px;font-size:13px;outline:none}.search-input[data-v-71cc29f1]:focus{border-color:#007bff}.clear-btn[data-v-71cc29f1]{position:absolute;right:4px;width:20px;height:20px;border:none;background:#dc3545;color:#fff;border-radius:50%;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center}.page-size[data-v-71cc29f1]{padding:4px 8px;border:1px solid #ddd;border-radius:4px;font-size:12px;background:#fff}.search-info[data-v-71cc29f1]{background:#e3f2fd;color:#1976d2;padding:8px 12px;border-radius:4px;margin-bottom:12px;font-size:13px}.questions-container[data-v-71cc29f1]{background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;overflow:hidden}.loading[data-v-71cc29f1]{display:flex;align-items:center;justify-content:center;padding:40px;gap:12px;color:#666}.spinner[data-v-71cc29f1]{width:20px;height:20px;border:2px solid #f3f3f3;border-top:2px solid #007bff;border-radius:50%;animation:spin-71cc29f1 1s linear infinite}@keyframes spin-71cc29f1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.empty[data-v-71cc29f1]{text-align:center;padding:40px 20px;color:#666}.empty-icon[data-v-71cc29f1]{font-size:48px;margin-bottom:12px}.empty p[data-v-71cc29f1]{margin:0 0 16px}.btn-clear[data-v-71cc29f1]{background:#007bff;color:#fff;border:none;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px}.btn-clear[data-v-71cc29f1]:hover{background:#0056b3}.questions-list[data-v-71cc29f1]{display:flex;flex-direction:column}.question-item[data-v-71cc29f1]{border-bottom:1px solid #eee;padding:16px}.question-item[data-v-71cc29f1]:last-child{border-bottom:none}.question-header[data-v-71cc29f1]{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.question-info[data-v-71cc29f1]{display:flex;align-items:center;gap:8px}.question-num[data-v-71cc29f1]{background:#007bff;color:#fff;padding:2px 8px;border-radius:12px;font-size:12px;font-weight:500;min-width:24px;text-align:center}.question-type[data-v-71cc29f1]{background:#f8f9fa;color:#495057;padding:2px 8px;border-radius:12px;font-size:11px;border:1px solid #dee2e6}.question-actions[data-v-71cc29f1]{display:flex;gap:4px}.btn-edit[data-v-71cc29f1],.btn-delete[data-v-71cc29f1]{width:28px;height:28px;border:none;border-radius:4px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center}.btn-edit[data-v-71cc29f1]{background:#e3f2fd;color:#1976d2}.btn-edit[data-v-71cc29f1]:hover{background:#bbdefb}.btn-delete[data-v-71cc29f1]{background:#ffebee;color:#d32f2f}.btn-delete[data-v-71cc29f1]:hover{background:#ffcdd2}.question-content[data-v-71cc29f1]{line-height:1.6}.question-text[data-v-71cc29f1]{margin-bottom:12px;color:#333}.question-text img[data-v-71cc29f1]{max-width:100%;height:auto;border-radius:4px;margin:8px 0}.options[data-v-71cc29f1]{margin-bottom:12px}.reading-type[data-v-71cc29f1]{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;padding:12px}.reading-title[data-v-71cc29f1]{font-weight:600;color:#495057;margin-bottom:8px;font-size:13px}.sub-questions[data-v-71cc29f1]{display:flex;flex-direction:column;gap:8px}.sub-question[data-v-71cc29f1]{background:#fff;padding:8px;border-radius:4px;border:1px solid #e9ecef;font-size:13px}.sub-num[data-v-71cc29f1]{color:#007bff;font-weight:600;margin-right:4px}.sub-type[data-v-71cc29f1]{color:#6c757d;font-size:11px;margin-right:8px}.sub-text[data-v-71cc29f1]{color:#495057;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.more-subs[data-v-71cc29f1]{text-align:center;color:#6c757d;font-size:12px;font-style:italic;padding:4px}.complex-type[data-v-71cc29f1]{background:#fff3cd;color:#856404;padding:8px 12px;border-radius:4px;font-size:13px;border:1px solid #ffeaa7}.normal-options[data-v-71cc29f1]{display:flex;flex-direction:column;gap:6px}.option[data-v-71cc29f1]{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:4px;background:#f8f9fa;position:relative}.option.correct[data-v-71cc29f1]{background:#d4edda;border:1px solid #c3e6cb}.option-label[data-v-71cc29f1]{color:#495057;font-weight:500;min-width:20px}.option-text[data-v-71cc29f1]{flex:1;color:#333}.correct-mark[data-v-71cc29f1]{color:#28a745;font-weight:700;font-size:16px}.answer[data-v-71cc29f1]{background:#d4edda;border:1px solid #c3e6cb;border-radius:4px;padding:8px 12px;margin-top:8px}.answer-label[data-v-71cc29f1]{color:#155724;font-weight:600;margin-right:8px}.answer-list[data-v-71cc29f1]{display:inline-flex;flex-wrap:wrap;gap:4px}.answer-item[data-v-71cc29f1]{background:#28a745;color:#fff;padding:2px 8px;border-radius:12px;font-size:12px}.answer-text[data-v-71cc29f1]{color:#155724;display:inline}.no-answer[data-v-71cc29f1]{color:#6c757d;font-style:italic}.pagination[data-v-71cc29f1]{display:flex;justify-content:center;align-items:center;gap:12px;padding:16px;background:#fff;border-top:1px solid #eee;margin-top:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.page-btn[data-v-71cc29f1]{background:#f8f9fa;border:1px solid #dee2e6;color:#495057;padding:6px 12px;border-radius:4px;cursor:pointer;font-size:13px}.page-btn[data-v-71cc29f1]:hover:not(:disabled){background:#e9ecef}.page-btn[data-v-71cc29f1]:disabled{opacity:.5;cursor:not-allowed}.page-info[data-v-71cc29f1]{display:flex;align-items:center;gap:4px;color:#495057;font-size:13px}.page-input[data-v-71cc29f1]{width:40px;text-align:center;border:1px solid #dee2e6;border-radius:4px;padding:2px 4px;font-size:13px}.total-info[data-v-71cc29f1]{color:#6c757d;font-size:12px}.highlight[data-v-71cc29f1]{background:#fff3cd;color:#856404;padding:1px 2px;border-radius:2px}@media (max-width: 600px){.toolbar[data-v-71cc29f1]{flex-direction:column;align-items:stretch;gap:12px}.toolbar-right[data-v-71cc29f1]{justify-content:space-between}.search-input[data-v-71cc29f1]{width:150px}.question-header[data-v-71cc29f1]{flex-direction:column;align-items:flex-start;gap:8px}.pagination[data-v-71cc29f1]{flex-wrap:wrap;gap:8px}} "); (function (vue, vue$1, V, J, K) { 'use strict'; var e = Object.defineProperty, __publicField = (t, n, a) => ((t, n, a) => n in t ? e(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a)(t, "symbol" != typeof n ? n + "" : n, a); let W; const setActivePinia = e => W = e, Q = Symbol(); function isPlainObject(e) { return e && "object" == typeof e && "[object Object]" === Object.prototype.toString.call(e) && "function" != typeof e.toJSON; } var Y, X; (X = Y || (Y = {})).direct = "direct", X.patchObject = "patch object", X.patchFunction = "patch function"; const noop = () => {}; function addSubscription(e, t, n, a = noop) { e.push(t); const removeSubscription = () => { const n = e.indexOf(t); n > -1 && (e.splice(n, 1), a()); }; return !n && vue.getCurrentScope() && vue.onScopeDispose(removeSubscription), removeSubscription; } function triggerSubscriptions(e, ...t) { e.slice().forEach((e => { e(...t); })); } const fallbackRunWithContext = e => e(), Z = Symbol(), ee = Symbol(); function mergeReactiveObjects(e, t) { e instanceof Map && t instanceof Map ? t.forEach(((t, n) => e.set(n, t))) : e instanceof Set && t instanceof Set && t.forEach(e.add, e); for (const n in t) { if (!t.hasOwnProperty(n)) continue; const a = t[n], i = e[n]; isPlainObject(i) && isPlainObject(a) && e.hasOwnProperty(n) && !vue.isRef(a) && !vue.isReactive(a) ? e[n] = mergeReactiveObjects(i, a) : e[n] = a; } return e; } const te = Symbol(); const {assign: ne} = Object; function createSetupStore(e, a, i = {}, o, d, u) { let m; const f = ne({ actions: {} }, i), g = { deep: !0 }; let y, v, b, x = [], w = []; const k = o.state.value[e]; let _; function $patch(t) { let n; y = v = !1, "function" == typeof t ? (t(o.state.value[e]), n = { type: Y.patchFunction, storeId: e, events: b }) : (mergeReactiveObjects(o.state.value[e], t), n = { type: Y.patchObject, payload: t, storeId: e, events: b }); const a = _ = Symbol(); vue.nextTick().then((() => { _ === a && (y = !0); })), v = !0, triggerSubscriptions(x, n, o.state.value[e]); } u || k || (o.state.value[e] = {}), vue.ref({}); const q = u ? function() { const {state: e} = i, t = e ? e() : {}; this.$patch((e => { ne(e, t); })); } : noop; const action = (t, n = "") => { if (Z in t) return t[ee] = n, t; const wrappedAction = function() { setActivePinia(o); const n = Array.from(arguments), a = [], i = []; let s; triggerSubscriptions(w, { args: n, name: wrappedAction[ee], store: T, after: function(e) { a.push(e); }, onError: function(e) { i.push(e); } }); try { s = t.apply(this && this.$id === e ? this : T, n); } catch (r) { throw triggerSubscriptions(i, r), r; } return s instanceof Promise ? s.then((e => (triggerSubscriptions(a, e), e))).catch((e => (triggerSubscriptions(i, e), Promise.reject(e)))) : (triggerSubscriptions(a, s), s); }; return wrappedAction[Z] = !0, wrappedAction[ee] = n, wrappedAction; }, A = { _p: o, $id: e, $onAction: addSubscription.bind(null, w), $patch: $patch, $reset: q, $subscribe(t, n = {}) { const a = addSubscription(x, t, n.detached, (() => i())), i = m.run((() => vue.watch((() => o.state.value[e]), (a => { ("sync" === n.flush ? v : y) && t({ storeId: e, type: Y.direct, events: b }, a); }), ne({}, g, n)))); return a; }, $dispose: function() { m.stop(), x = [], w = [], o._s.delete(e); } }, T = vue.reactive(A); o._s.set(e, T); const C = (o._a && o._a.runWithContext || fallbackRunWithContext)((() => o._e.run((() => (m = vue.effectScope()).run((() => a({ action: action }))))))); for (const t in C) { const n = C[t]; if (vue.isRef(n) && (!vue.isRef(E = n) || !E.effect) || vue.isReactive(n)) u || (!k || isPlainObject(S = n) && S.hasOwnProperty(te) || (vue.isRef(n) ? n.value = k[t] : mergeReactiveObjects(n, k[t])), o.state.value[e][t] = n); else if ("function" == typeof n) { const e = action(n, t); C[t] = e, f.actions[t] = n; } } var S, E; return ne(T, C), ne(vue.toRaw(T), C), Object.defineProperty(T, "$state", { get: () => o.state.value[e], set: e => { $patch((t => { ne(t, e); })); } }), o._p.forEach((e => { ne(T, m.run((() => e({ store: T, app: o._a, pinia: o, options: f })))); })), k && u && i.hydrate && i.hydrate(T.$state, k), y = !0, v = !0, T; } function defineStore(e, t, n) { let s, r; const l = "function" == typeof t; function useStore(e, n) { const c = vue.hasInjectionContext(); (e = e || (c ? vue.inject(Q, null) : null)) && setActivePinia(e), (e = W)._s.has(s) || (l ? createSetupStore(s, t, r, e) : function(e, t, n) { const {state: i, actions: o, getters: s} = t, r = n.state.value[e]; createSetupStore(e, (function() { r || (n.state.value[e] = i ? i() : {}); const t = vue.toRefs(n.state.value[e]); return ne(t, o, Object.keys(s || {}).reduce(((t, i) => (t[i] = vue.markRaw(vue.computed((() => { setActivePinia(n); const t = n._s.get(e); return s[i].call(t, t); }))), t)), {})); }), t, n, 0, !0); }(s, r, e)); return e._s.get(s); } return "string" == typeof e ? (s = e, r = l ? n : t) : (r = e, s = e.id), useStore.$id = s, useStore; } var ae = (() => "undefined" != typeof GM_deleteValue ? GM_deleteValue : void 0)(), ie = (() => "undefined" != typeof GM_getValue ? GM_getValue : void 0)(), oe = (() => "undefined" != typeof GM_info ? GM_info : void 0)(), se = (() => "undefined" != typeof GM_listValues ? GM_listValues : void 0)(), re = (() => "undefined" != typeof GM_setValue ? GM_setValue : void 0)(), le = (() => "undefined" != typeof GM_xmlhttpRequest ? GM_xmlhttpRequest : void 0)(), ce = (() => "undefined" != typeof unsafeWindow ? unsafeWindow : void 0)(); const pe = "AiAsk_"; class Cache { static set(e, t, n = 0) { e = pe + e; const a = { value: t, expire: n > 0 ? Date.now() + 1e3 * n : 0 }; return re(e, a), ie(e); } static get(e, t = null) { const n = ie(e = pe + e); return n && n.expire && n.expire < Date.now() ? (ae(e), t) : n ? n.value : t; } static match(e) { return e = pe + e, se().filter((t => t.startsWith(e))); } static matchGet(e) { const t = pe + e; let n = se().filter((e => e.startsWith(t))).map((e => { const t = ie(e, { value: null, expire: 0 }).value; return t && (t.key = e.replace(pe, "")), t; })).filter((e => null !== e)); return n.sort(((e, t) => (t.createTime || 0) - (e.createTime || 0))), n; } static remove(e) { ae(pe + e); } static clear() { se().filter((e => e.startsWith(pe))).forEach(ae); } static matchRemove(e) { e = pe + e, se().filter((t => t.startsWith(e))).forEach(ae); } } function getDefaultExportFromCjs(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var de, ue, he = { exports: {} }, me = { exports: {} }; de = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ue = { rotl: function(e, t) { return e << t | e >>> 32 - t; }, rotr: function(e, t) { return e << 32 - t | e >>> t; }, endian: function(e) { if (e.constructor == Number) return 16711935 & ue.rotl(e, 8) | 4278255360 & ue.rotl(e, 24); for (var t = 0; t < e.length; t++) e[t] = ue.endian(e[t]); return e; }, randomBytes: function(e) { for (var t = []; e > 0; e--) t.push(Math.floor(256 * Math.random())); return t; }, bytesToWords: function(e) { for (var t = [], n = 0, a = 0; n < e.length; n++, a += 8) t[a >>> 5] |= e[n] << 24 - a % 32; return t; }, wordsToBytes: function(e) { for (var t = [], n = 0; n < 32 * e.length; n += 8) t.push(e[n >>> 5] >>> 24 - n % 32 & 255); return t; }, bytesToHex: function(e) { for (var t = [], n = 0; n < e.length; n++) t.push((e[n] >>> 4).toString(16)), t.push((15 & e[n]).toString(16)); return t.join(""); }, hexToBytes: function(e) { for (var t = [], n = 0; n < e.length; n += 2) t.push(parseInt(e.substr(n, 2), 16)); return t; }, bytesToBase64: function(e) { for (var t = [], n = 0; n < e.length; n += 3) for (var a = e[n] << 16 | e[n + 1] << 8 | e[n + 2], i = 0; i < 4; i++) 8 * n + 6 * i <= 8 * e.length ? t.push(de.charAt(a >>> 6 * (3 - i) & 63)) : t.push("="); return t.join(""); }, base64ToBytes: function(e) { e = e.replace(/[^A-Z0-9+\/]/gi, ""); for (var t = [], n = 0, a = 0; n < e.length; a = ++n % 4) 0 != a && t.push((de.indexOf(e.charAt(n - 1)) & Math.pow(2, -2 * a + 8) - 1) << 2 * a | de.indexOf(e.charAt(n)) >>> 6 - 2 * a); return t; } }, me.exports = ue; var fe, ge, ye, ve, be, xe = me.exports, we = { utf8: { stringToBytes: function(e) { return we.bin.stringToBytes(unescape(encodeURIComponent(e))); }, bytesToString: function(e) { return decodeURIComponent(escape(we.bin.bytesToString(e))); } }, bin: { stringToBytes: function(e) { for (var t = [], n = 0; n < e.length; n++) t.push(255 & e.charCodeAt(n)); return t; }, bytesToString: function(e) { for (var t = [], n = 0; n < e.length; n++) t.push(String.fromCharCode(e[n])); return t.join(""); } } }, ke = we, isBuffer_1 = function(e) { return null != e && (isBuffer(e) || function(e) { return "function" == typeof e.readFloatLE && "function" == typeof e.slice && isBuffer(e.slice(0, 0)); }(e) || !!e._isBuffer); }; function isBuffer(e) { return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e); } fe = xe, ge = ke.utf8, ye = isBuffer_1, ve = ke.bin, (be = function(e, t) { e.constructor == String ? e = t && "binary" === t.encoding ? ve.stringToBytes(e) : ge.stringToBytes(e) : ye(e) ? e = Array.prototype.slice.call(e, 0) : Array.isArray(e) || e.constructor === Uint8Array || (e = e.toString()); for (var n = fe.bytesToWords(e), a = 8 * e.length, i = 1732584193, o = -271733879, s = -1732584194, r = 271733878, l = 0; l < n.length; l++) n[l] = 16711935 & (n[l] << 8 | n[l] >>> 24) | 4278255360 & (n[l] << 24 | n[l] >>> 8); n[a >>> 5] |= 128 << a % 32, n[14 + (a + 64 >>> 9 << 4)] = a; var c = be._ff, p = be._gg, d = be._hh, u = be._ii; for (l = 0; l < n.length; l += 16) { var h = i, m = o, f = s, g = r; i = c(i, o, s, r, n[l + 0], 7, -680876936), r = c(r, i, o, s, n[l + 1], 12, -389564586), s = c(s, r, i, o, n[l + 2], 17, 606105819), o = c(o, s, r, i, n[l + 3], 22, -1044525330), i = c(i, o, s, r, n[l + 4], 7, -176418897), r = c(r, i, o, s, n[l + 5], 12, 1200080426), s = c(s, r, i, o, n[l + 6], 17, -1473231341), o = c(o, s, r, i, n[l + 7], 22, -45705983), i = c(i, o, s, r, n[l + 8], 7, 1770035416), r = c(r, i, o, s, n[l + 9], 12, -1958414417), s = c(s, r, i, o, n[l + 10], 17, -42063), o = c(o, s, r, i, n[l + 11], 22, -1990404162), i = c(i, o, s, r, n[l + 12], 7, 1804603682), r = c(r, i, o, s, n[l + 13], 12, -40341101), s = c(s, r, i, o, n[l + 14], 17, -1502002290), i = p(i, o = c(o, s, r, i, n[l + 15], 22, 1236535329), s, r, n[l + 1], 5, -165796510), r = p(r, i, o, s, n[l + 6], 9, -1069501632), s = p(s, r, i, o, n[l + 11], 14, 643717713), o = p(o, s, r, i, n[l + 0], 20, -373897302), i = p(i, o, s, r, n[l + 5], 5, -701558691), r = p(r, i, o, s, n[l + 10], 9, 38016083), s = p(s, r, i, o, n[l + 15], 14, -660478335), o = p(o, s, r, i, n[l + 4], 20, -405537848), i = p(i, o, s, r, n[l + 9], 5, 568446438), r = p(r, i, o, s, n[l + 14], 9, -1019803690), s = p(s, r, i, o, n[l + 3], 14, -187363961), o = p(o, s, r, i, n[l + 8], 20, 1163531501), i = p(i, o, s, r, n[l + 13], 5, -1444681467), r = p(r, i, o, s, n[l + 2], 9, -51403784), s = p(s, r, i, o, n[l + 7], 14, 1735328473), i = d(i, o = p(o, s, r, i, n[l + 12], 20, -1926607734), s, r, n[l + 5], 4, -378558), r = d(r, i, o, s, n[l + 8], 11, -2022574463), s = d(s, r, i, o, n[l + 11], 16, 1839030562), o = d(o, s, r, i, n[l + 14], 23, -35309556), i = d(i, o, s, r, n[l + 1], 4, -1530992060), r = d(r, i, o, s, n[l + 4], 11, 1272893353), s = d(s, r, i, o, n[l + 7], 16, -155497632), o = d(o, s, r, i, n[l + 10], 23, -1094730640), i = d(i, o, s, r, n[l + 13], 4, 681279174), r = d(r, i, o, s, n[l + 0], 11, -358537222), s = d(s, r, i, o, n[l + 3], 16, -722521979), o = d(o, s, r, i, n[l + 6], 23, 76029189), i = d(i, o, s, r, n[l + 9], 4, -640364487), r = d(r, i, o, s, n[l + 12], 11, -421815835), s = d(s, r, i, o, n[l + 15], 16, 530742520), i = u(i, o = d(o, s, r, i, n[l + 2], 23, -995338651), s, r, n[l + 0], 6, -198630844), r = u(r, i, o, s, n[l + 7], 10, 1126891415), s = u(s, r, i, o, n[l + 14], 15, -1416354905), o = u(o, s, r, i, n[l + 5], 21, -57434055), i = u(i, o, s, r, n[l + 12], 6, 1700485571), r = u(r, i, o, s, n[l + 3], 10, -1894986606), s = u(s, r, i, o, n[l + 10], 15, -1051523), o = u(o, s, r, i, n[l + 1], 21, -2054922799), i = u(i, o, s, r, n[l + 8], 6, 1873313359), r = u(r, i, o, s, n[l + 15], 10, -30611744), s = u(s, r, i, o, n[l + 6], 15, -1560198380), o = u(o, s, r, i, n[l + 13], 21, 1309151649), i = u(i, o, s, r, n[l + 4], 6, -145523070), r = u(r, i, o, s, n[l + 11], 10, -1120210379), s = u(s, r, i, o, n[l + 2], 15, 718787259), o = u(o, s, r, i, n[l + 9], 21, -343485551), i = i + h >>> 0, o = o + m >>> 0, s = s + f >>> 0, r = r + g >>> 0; } return fe.endian([ i, o, s, r ]); })._ff = function(e, t, n, a, i, o, s) { var r = e + (t & n | ~t & a) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._gg = function(e, t, n, a, i, o, s) { var r = e + (t & a | n & ~a) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._hh = function(e, t, n, a, i, o, s) { var r = e + (t ^ n ^ a) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._ii = function(e, t, n, a, i, o, s) { var r = e + (n ^ (t | ~a)) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._blocksize = 16, be._digestsize = 16, he.exports = function(e, t) { if (null == e) throw new Error("Illegal argument " + e); var n = fe.wordsToBytes(be(e, t)); return t && t.asBytes ? n : t && t.asString ? ve.bytesToString(n) : fe.bytesToHex(n); }; const _e = getDefaultExportFromCjs(he.exports), qe = [ { type: "hook", name: "\u4e91\u5e55\u5b66\u82d1hook", match: location.host.includes("w-ling.cn"), main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 !== J(".selectDan").length; })); } }); } }, { type: "save", name: "\u4e91\u5e55\u5b66\u82d1\u6536\u5f55", match: () => location.host.includes("w-ling.cn") && location.href.includes("practiceRecord"), question: { html: ".selectDan >div >div", question: ".title", options: ".selectItem label .tagbq", type: ".question-box .tag", workType: "yunmuxueyuan", pageType: "yunmuxueyuan" }, init: async () => { await waitUntil((function() { return isExist(".selectDan >div >div"); })); }, answerHook: e => { const t = J(e.html).parent().find("h3").text().split("\u3001")[1]; e.question = e.question.replace(/^\d+\u3001/, ""), e.question = e.question.replace(/\(\d+\u5206\)$/, ""); let n = J(e.html).find(".anaylize > span:eq(0)").text().replace("\u4f5c\u7b54\u6b63\u786e\uff1a", ""); switch ("" === n && (n = J(e.html).find(".falsanaly > span:eq(1)").text().replace("\u6b63\u786e\u7b54\u6848\uff1a", "")), t) { case "\u5355\u9009\u9898": case "\u591a\u9009\u9898": let t = n.split(""); if (e.answer = t.map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return; e.answer.length > 1 ? e.type = "1" : e.type = "0"; break; case "\u5224\u65ad\u9898": e.type = "3", "T" == n && (e.answer = [ "\u6b63\u786e" ]), "F" == n && (e.answer = [ "\u9519\u8bef" ]); break; case "\u586b\u7a7a\u9898": e.answer = J(e.html).find(".riganswer > span").first().nextAll("span").map(((e, t) => removeHtml(J(t).text()))).get(), e.type = "2"; } return e; } }, { type: "ask", name: "\u4e91\u5e55\u5b66\u82d1", tips: "", match: () => location.host.includes("w-ling.cn") && (location.href.includes("practicePaper") || location.href.includes("examIndex")), types: [ "0", "1", "3" ], question: { html: ".selectDan >div >div", question: ".title", options: ".selectItem label .tagbq", type: ".question-box .tag", workType: "yunmuxueyuan", pageType: "yunmuxueyuan" }, init: async () => { await waitUntil((function() { return 0 !== J(".selectDan >div >div").length; })); }, ischecked: isParentChecked, questionHook: e => { e.question = e.question.replace(/^\d+\u3001/, ""), e.question = e.question.replace(/\(\d+\u5206\)$/, ""); switch (J(e.html).parent().find("h4").text().split("\u3001")[1]) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.type = "3", e.$options = J(e.html).find(".selectItem label"), e.options = e.$options.map(((e, t) => removeHtml(J(t).text()))).get(), e.$options; break; case "\u586b\u7a7a\u9898": e.type = "2"; } return e; }, setAnswer: e => { switch (e.type) { case "3": break; case "2": return J(e.html).find(".tiankong input").each(((t, n) => { let a = J(n).parent()[0].__vue__; J(n).val(e.answer[t]); const i = new Event("input"); n.dispatchEvent(i), a.$emit("change", e.answer[t]); })), !1; } return !0; } } ]; class Answer { constructor() {} static score(e, t) { let n = Cache.get("api_" + e, { score: 0 }); n.score += t, Cache.set("api_" + e, n, 600); } static async getAllAnswers(e) { const t = [ this.getAnswer1(e) ]; return Promise.all(t); } static async getAnswersFree(e) { const t = [ this.getMainAnswer(e), this.getAnswer1(e) ]; return Promise.all(t); } static async getAnswer1(e) { let t = function() { let e = Array.from({ length: 4 }, (() => Math.floor(255 * Math.random()))).join("."); return { "X-Forwarded-For": e, "X-Real-IP": e }; }(); return new Promise((n => { request("http://cx.icodef.com/wyn-nb?v=4", "POST", { question: e.question }, t).then((e => { let t = e[1]; try { e = JSON.parse(e[0].responseText); } catch (i) { n({ form: "\u4e00\u4e4b\u9898\u5e93", answer: null, error: i, duration: t }); } let a = ""; if (1 === e.code) { let t = e.data.replace(/javascript:void\(0\);/g, "").trim().replace(/\n/g, ""); [ "\u53db\u9006", "\u516c\u4f17\u53f7", "\u674e\u6052\u96c5", "\u4e00\u4e4b" ].every((e => !t.includes(e))) && (a = t.split("#")); } n({ form: "\u4e00\u4e4b\u9898\u5e93", answer: a, duration: t }); })).catch((e => { "timeout" === e && this.score("icodef", -1), n({ form: "\u4e00\u4e4b\u9898\u5e93", answer: "", msg: e, duration: 5e3 }); })); })); } static async getAnswer2(e) { return new Promise((t => { [ 0, 1, 2 ].includes(parseInt(e.type)) ? request("https://api.muketool.com/cx/v2/query", "POST", { question: e.question, type: parseInt(e.type) }, {}).then((e => { let n = e[1]; e = JSON.parse(e[0].responseText), t({ form: "muketool", answer: 1 === e.code ? e.data.split("#") : "", duration: n }); })).catch((e => { "timeout" === e && this.score("muketool", -1), t({ form: "muketool", answer: "" }); })) : t({ form: "muketool", answer: "", duration: "\u4e0d\u652f\u6301\u7684\u9898\u578b" }); })); } static getTimestamp() { return Math.floor((new Date).getTime() / 1e3); } static cacheAnswer(e) { const t = { type: e.type, question: e.question, options: e.options, answer: e.answer }, n = questionHash(t.type, t.question, t.options); t.createTime = this.getTimestamp(), Cache.set("ques1_" + n, t); } static async getCacheAnswer(e) { const t = questionHash(e.type, e.question, e.options); e.type, e.question, e.options; let n = Cache.get("ques1_" + t); return n ? { form: "\u672c\u5730\u7f13\u5b58", answer: n.answer, duration: 10 } : { form: "\u672c\u5730\u7f13\u5b58", answer: "", duration: 10, msg: "\u672a\u627e\u5230\u7f13\u5b58" }; } static getMainAnswer(e) { const t = { type: e.type, question: e.question, options: e.options.map((e => e)), workType: e.workType, pageType: e.pageType }; return new Promise((e => { requestApi("https://www.aiask.site/v1/question/search", "POST", t, {}).then((t => { let n = t[1]; 200 === (t = JSON.parse(t[0].responseText)).code && t.data.answer ? e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: t.data.answer, duration: n, msg: t.message }) : 401 === t.code ? e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: "", duration: n, msg: t.message, needLogin: !0 }) : e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: "", duration: n, msg: t.message }); })).catch((t => { e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: "", error: t, duration: 10, msg: "\u8bf7\u6c42\u5931\u8d25" }); })); })); } static async syncQuestionList(e) { return new Promise((t => { requestApi("https://www.aiask.site/v1/question/sync", "POST", e, {}).then((e => { e[0].responseText, t(e[0].responseText); })).catch((e => { t(e); })); })); } static async syncPaper(e) { return new Promise(((t, n) => { requestApi("https://www.aiask.site/v1/question/courseSync", "POST", e, {}).then((e => { try { const n = e[0].responseText, a = JSON.parse(n); a && (200 === a.code || 0 === a.code || a.success), t(a); } catch (n) { t({ code: -1, error: n, msg: "\u54cd\u5e94\u89e3\u6790\u5931\u8d25" }); } })).catch((e => { t({ code: -1, error: e, msg: "\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25" }); })); })); } } const defaultSetAnswer = async (e, t, n, a) => { var i; switch (e) { case "xx": for (let i = 0; i < n.$options.length; i++) if (t.includes(i)) { if (a.ischecked && a.ischecked(n.$options.eq(i))) continue; n.$options.eq(i).click(), await sleep(Math.floor(300 * Math.random() + 200)); } else a.ischecked && a.ischecked(n.$options.eq(i)) && (n.$options.eq(i).click(), await sleep(Math.floor(300 * Math.random() + 200))); break; case "pd": let e = t; 0 == n.options.length ? n.$options.each(((t, n) => { isTrue(e) && isTrue(removeHtml(J(n).html())) && J(n).click(), isFalse(e) && isFalse(removeHtml(J(n).html())) && J(n).click(); })) : n.$options.each(((t, a) => { isTrue(e) && isTrue(n.options[t]) && J(a).click(), isFalse(e) && isFalse(n.options[t]) && J(a).click(); })); break; case "jd": J(n.html).find("textarea").each((function(e) { ce.UE.getEditor(J(this).attr("name")).ready((function() { this.setContent(t[e].replace(/\u7b2c.\u7a7a:/g, "")); })); })), null == (i = J(n.html).find(".savebtndiv>a")) || i.click(); break; case "ydlj": if (Array.isArray(t) && n.options) for (let i = 0; i < t.length && i < n.options.length; i++) { let e = t[i], o = n.options[i]; if (Array.isArray(e) && e.length > 0 && o.$options) for (let t = 0; t < o.$options.length; t++) if (e.includes(t)) { if (a.ischecked && a.ischecked(o.$options.eq(t))) continue; o.$options.eq(t).click(), await sleep(Math.floor(300 * Math.random() + 200)); } else a.ischecked && a.ischecked(o.$options.eq(t)) && (o.$options.eq(t).click(), await sleep(Math.floor(300 * Math.random() + 200))); } } }, applyAnswerResult = async (e, t, n, a) => { let i = !0; a.setAnswerHook && "function" == typeof a.setAnswerHook && await a.setAnswerHook({ type: n.type, answer: t, html: n.html, ques: n }), a.setAnswer && "function" == typeof a.setAnswer && (i = await a.setAnswer({ type: n.type, answer: t, html: n.html, ques: n, rule: a })), i && await defaultSetAnswer(e, t, n, a); }, ApiAnswerMatch = async (e, t, n = !1) => { const a = getAskStore(); let i, o = 0, s = t.type, r = t.html, l = [], c = [ "", l, t, a.rule ]; switch (t.$options && "function" == typeof t.$options && (t.$options = t.$options()), s) { case "0": case "1": for (let i = 0; i < e.length; i++) { let a = e[i].answer; "" == a && (a = []), n && (Array.isArray(a) ? a = a.map((e => { let n = e.charCodeAt() - 65; return t.options[n]; })) : (a = a.replace(/[^a-zA-Z]/g, ""), a = a.split("").map((e => { let n = e.charCodeAt() - 65; return t.options[n]; })))); let o = matchAnswer(a, t.options); e[i].match = o; } if (l = e.filter((e => e.match.length > 0)), 0 === l.length) return { res: e, haveAnswer: !1 }; if (l.length > 1) { if (!l.every((e => e.match.length === l[0].match.length))) { let e = l[0]; for (let t = 1; t < l.length; t++) l[t].match.length > e.match.length && (e = l[t]); l = [ e ]; } } let a = l[0].match; c[0] = "xx", c[1] = a; break; case "3": if (l = e.map((e => { let t = e.answer; return "object" == typeof t && (t = t[0]), isTrue(t) ? e.answer = "\u6b63\u786e" : isFalse(t) ? e.answer = "\u9519\u8bef" : e.answer = "", e; })), l = e.filter((e => "" !== e.answer)), 0 === l.length) return { res: e, haveAnswer: !1 }; c[0] = "pd", c[1] = l[0].answer; break; case "2": case "9": case "4": case "5": case "6": case "7": if (o = J(r).find("textarea").length, 0 === o && (o = t.$options.length), l = e.filter((e => e.answer.length > 0)), 0 === l.length) return { res: e, haveAnswer: !1 }; if (i = l[0].answer, "string" == typeof i && (i = [ i ]), 0 !== o && (l = l.filter((e => ("string" == typeof e.answer ? 1 : e.answer.length) === o)), 0 === l.length)) return { res: e, haveAnswer: !1 }; c[0] = "jd", c[1] = i; break; case "14": if (o = t.$options.length, l = e.filter((e => e.answer.length > 0 && e.answer.length === o)), 0 === l.length) return { res: e, haveAnswer: !1 }; if (i = l[0].answer, l = l.filter((e => ("string" == typeof e.answer ? 1 : e.answer.length) === o)), 0 === l.length) return { res: e, haveAnswer: !1 }; c[0] = "wxtk", c[1] = i; break; case "11": if (l = e.filter((e => "object" == typeof e.answer)), 0 === l.length) return { res: e, haveAnswer: !1 }; i = l[0].answer, c[0] = "lx", c[1] = i; break; case "15": if (l = e.filter((e => Array.isArray(e.answer) && e.answer.length > 0)), 0 === l.length) return { res: e, haveAnswer: !1 }; i = l[0].answer; let s = []; if (t.options && Array.isArray(t.options)) for (let e = 0; e < t.options.length && e < i.length; e++) { let n = t.options[e], a = i[e]; if (n.options && Array.isArray(a)) { let e = matchAnswer(a, n.options); s.push(e); } else s.push([]); } c[0] = "ydlj", c[1] = s, l && l[0] && (l[0].match = s); break; default: return { res: e, haveAnswer: !1 }; } return await applyAnswerResult(c[0], c[1], t, a.rule), { res: e, form: l ? l[0] : [], haveAnswer: !0 }; }, Ae = class _Paper { static getPaper(e) { return Cache.get(`${_Paper.prefix}_${e}`); } static getLastSyncedHashes(e) { const t = Cache.get(`${_Paper.lastSyncedPrefix}_${e}`, { questions: [], chapters: [] }); return { questions: new Set(t.questions || []), chapters: new Set(t.chapters || []) }; } static setLastSyncedHashes(e, t, n) { Cache.set(`${_Paper.lastSyncedPrefix}_${e}`, { questions: t, chapters: n }); } static compareAndGetNewData(e, t) { const n = _Paper.getLastSyncedHashes(t), a = new Set, i = new Set, o = new Map, s = new Map; e.chapter && Array.isArray(e.chapter) && e.chapter.forEach((e => { const t = e.hash; i.add(t); const n = new Map; e.question && Array.isArray(e.question) && e.question.forEach((e => { const t = e.hash; a.add(t), o.set(t, e), n.set(t, e); })), s.set(t, { chapter: e, questions: n }); })); const r = [], l = []; a.forEach((e => { n.questions.has(e) || r.push(e); })), i.forEach((e => { n.chapters.has(e) || l.push(e); })); const c = { hash: e.hash, name: e.name, platform: e.platform, info: e.info, chapter: [] }; return s.forEach(((e, t) => { if (l.includes(t)) c.chapter.push({ hash: e.chapter.hash, name: e.chapter.name, question: Array.from(e.questions.values()) }); else { const t = []; e.questions.forEach(((e, n) => { r.includes(n) && t.push(e); })), t.length > 0 && c.chapter.push({ hash: e.chapter.hash, name: e.chapter.name, question: t }); } })), { newData: c, newQuestionHashes: r, newChapterHashes: l }; } static async setPaper(e, t) { if (!e || !t) return; const n = _Paper.getPaper(e) || { chapter: [] }; t.chapter && t.chapter.forEach((e => { const t = n.chapter.find((t => t.hash === e.hash)); t ? (e.question.forEach((e => { const n = t.question.findIndex((t => t.hash === e.hash)); -1 !== n ? t.question[n] = e : t.question.push(e); })), Object.keys(e).forEach((n => { "question" !== n && (t[n] = e[n]); }))) : n.chapter.push(e); })), Object.keys(t).forEach((e => { "chapter" !== e && (n[e] = t[e]); })), Cache.set(`${_Paper.prefix}_${e}`, n); const {newData: a, newQuestionHashes: i, newChapterHashes: o} = _Paper.compareAndGetNewData(n, e); if (i.length > 0 || o.length > 0) { if (0 === a.chapter.length) return; i.length, o.length; try { const t = await Answer.syncPaper(a); let n; if ("string" == typeof t) try { n = JSON.parse(t); } catch (s) { return; } else n = t; if (!n || 200 !== n.code && 0 !== n.code && !0 !== n.success) JSON.stringify(n); else { const t = _Paper.getLastSyncedHashes(e), n = Array.from(new Set([ ...t.questions, ...i ])), a = Array.from(new Set([ ...t.chapters, ...o ])); _Paper.setLastSyncedHashes(e, n, a), i.length, o.length; } } catch (r) {} } } static hasChapter(e, t) { const n = _Paper.getPaper(e); return !(!n || !n.chapter) && n.chapter.some((e => e.hash === t)); } static getAllPapers() { return Cache.matchGet(`${_Paper.prefix}_`); } }; __publicField(Ae, "prefix", "paper_"), __publicField(Ae, "lastSyncedPrefix", "paper_last_synced_"); let Te = Ae; var Ce = { parse: function(e) { var t = Ce._bin, n = new Uint8Array(e), a = 0; t.readFixed(n, a), a += 4; var i = t.readUshort(n, a); a += 2, t.readUshort(n, a), a += 2, t.readUshort(n, a), a += 2, t.readUshort(n, a), a += 2; for (var o = [ "cmap", "head", "hhea", "maxp", "hmtx", "name", "OS/2", "post", "loca", "glyf", "kern", "CFF ", "GPOS", "GSUB", "SVG " ], s = { _data: n }, r = {}, l = 0; l < i; l++) { var c = t.readASCII(n, a, 4); a += 4, t.readUint(n, a), a += 4; var p = t.readUint(n, a); a += 4; var d = t.readUint(n, a); a += 4, r[c] = { offset: p, length: d }; } for (l = 0; l < o.length; l++) { var u = o[l]; r[u] && (s[u.trim()] = Ce[u.trim()].parse(n, r[u].offset, r[u].length, s)); } return s; }, _tabOffset: function(e, t) { for (var n = Ce._bin, a = n.readUshort(e, 4), i = 12, o = 0; o < a; o++) { var s = n.readASCII(e, i, 4); i += 4, n.readUint(e, i), i += 4; var r = n.readUint(e, i); if (i += 4, n.readUint(e, i), i += 4, s == t) return r; } return 0; } }; Ce._bin = { readFixed: function(e, t) { return (e[t] << 8 | e[t + 1]) + (e[t + 2] << 8 | e[t + 3]) / 65540; }, readF2dot14: function(e, t) { return Ce._bin.readShort(e, t) / 16384; }, readInt: function(e, t) { var n = Ce._bin.t.uint8; return n[0] = e[t + 3], n[1] = e[t + 2], n[2] = e[t + 1], n[3] = e[t], Ce._bin.t.int32[0]; }, readInt8: function(e, t) { return Ce._bin.t.uint8[0] = e[t], Ce._bin.t.int8[0]; }, readShort: function(e, t) { var n = Ce._bin.t.uint8; return n[1] = e[t], n[0] = e[t + 1], Ce._bin.t.int16[0]; }, readUshort: function(e, t) { return e[t] << 8 | e[t + 1]; }, readUshorts: function(e, t, n) { for (var a = [], i = 0; i < n; i++) a.push(Ce._bin.readUshort(e, t + 2 * i)); return a; }, readUint: function(e, t) { var n = Ce._bin.t.uint8; return n[3] = e[t], n[2] = e[t + 1], n[1] = e[t + 2], n[0] = e[t + 3], Ce._bin.t.uint32[0]; }, readUint64: function(e, t) { return 4294967296 * Ce._bin.readUint(e, t) + Ce._bin.readUint(e, t + 4); }, readASCII: function(e, t, n) { for (var a = "", i = 0; i < n; i++) a += String.fromCharCode(e[t + i]); return a; }, readUnicode: function(e, t, n) { for (var a = "", i = 0; i < n; i++) { var o = e[t++] << 8 | e[t++]; a += String.fromCharCode(o); } return a; }, _tdec: window.TextDecoder ? new window.TextDecoder : null, readUTF8: function(e, t, n) { var a = Ce._bin._tdec; return a && 0 == t && n == e.length ? a.decode(e) : Ce._bin.readASCII(e, t, n); }, readBytes: function(e, t, n) { for (var a = [], i = 0; i < n; i++) a.push(e[t + i]); return a; }, readASCIIArray: function(e, t, n) { for (var a = [], i = 0; i < n; i++) a.push(String.fromCharCode(e[t + i])); return a; } }, Ce._bin.t = { buff: new ArrayBuffer(8) }, Ce._bin.t.int8 = new Int8Array(Ce._bin.t.buff), Ce._bin.t.uint8 = new Uint8Array(Ce._bin.t.buff), Ce._bin.t.int16 = new Int16Array(Ce._bin.t.buff), Ce._bin.t.uint16 = new Uint16Array(Ce._bin.t.buff), Ce._bin.t.int32 = new Int32Array(Ce._bin.t.buff), Ce._bin.t.uint32 = new Uint32Array(Ce._bin.t.buff), Ce._lctf = {}, Ce._lctf.parse = function(e, t, n, a, i) { var o = Ce._bin, s = {}, r = t; o.readFixed(e, t), t += 4; var l = o.readUshort(e, t); t += 2; var c = o.readUshort(e, t); t += 2; var p = o.readUshort(e, t); return t += 2, s.scriptList = Ce._lctf.readScriptList(e, r + l), s.featureList = Ce._lctf.readFeatureList(e, r + c), s.lookupList = Ce._lctf.readLookupList(e, r + p, i), s; }, Ce._lctf.readLookupList = function(e, t, n) { var a = Ce._bin, i = t, o = [], s = a.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) { var l = a.readUshort(e, t); t += 2; var c = Ce._lctf.readLookupTable(e, i + l, n); o.push(c); } return o; }, Ce._lctf.readLookupTable = function(e, t, n) { var a = Ce._bin, i = t, o = { tabs: [] }; o.ltype = a.readUshort(e, t), t += 2, o.flag = a.readUshort(e, t), t += 2; var s = a.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) { var l = a.readUshort(e, t); t += 2; var c = n(e, o.ltype, i + l); o.tabs.push(c); } return o; }, Ce._lctf.numOfOnes = function(e) { for (var t = 0, n = 0; n < 32; n++) e >>> n & 1 && t++; return t; }, Ce._lctf.readClassDef = function(e, t) { var n = Ce._bin, a = [], i = n.readUshort(e, t); if (t += 2, 1 == i) { var o = n.readUshort(e, t); t += 2; var s = n.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) a.push(o + r), a.push(o + r), a.push(n.readUshort(e, t)), t += 2; } if (2 == i) { var l = n.readUshort(e, t); t += 2; for (r = 0; r < l; r++) a.push(n.readUshort(e, t)), t += 2, a.push(n.readUshort(e, t)), t += 2, a.push(n.readUshort(e, t)), t += 2; } return a; }, Ce._lctf.getInterval = function(e, t) { for (var n = 0; n < e.length; n += 3) { var a = e[n], i = e[n + 1]; if (e[n + 2], a <= t && t <= i) return n; } return -1; }, Ce._lctf.readValueRecord = function(e, t, n) { var a = Ce._bin, i = []; return i.push(1 & n ? a.readShort(e, t) : 0), t += 1 & n ? 2 : 0, i.push(2 & n ? a.readShort(e, t) : 0), t += 2 & n ? 2 : 0, i.push(4 & n ? a.readShort(e, t) : 0), t += 4 & n ? 2 : 0, i.push(8 & n ? a.readShort(e, t) : 0), t += 8 & n ? 2 : 0, i; }, Ce._lctf.readCoverage = function(e, t) { var n = Ce._bin, a = {}; a.fmt = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); return t += 2, 1 == a.fmt && (a.tab = n.readUshorts(e, t, i)), 2 == a.fmt && (a.tab = n.readUshorts(e, t, 3 * i)), a; }, Ce._lctf.coverageIndex = function(e, t) { var n = e.tab; if (1 == e.fmt) return n.indexOf(t); if (2 == e.fmt) { var a = Ce._lctf.getInterval(n, t); if (-1 != a) return n[a + 2] + (t - n[a]); } return -1; }, Ce._lctf.readFeatureList = function(e, t) { var n = Ce._bin, a = t, i = [], o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readASCII(e, t, 4); t += 4; var l = n.readUshort(e, t); t += 2, i.push({ tag: r.trim(), tab: Ce._lctf.readFeatureTable(e, a + l) }); } return i; }, Ce._lctf.readFeatureTable = function(e, t) { var n = Ce._bin; n.readUshort(e, t), t += 2; var a = n.readUshort(e, t); t += 2; for (var i = [], o = 0; o < a; o++) i.push(n.readUshort(e, t + 2 * o)); return i; }, Ce._lctf.readScriptList = function(e, t) { var n = Ce._bin, a = t, i = {}, o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readASCII(e, t, 4); t += 4; var l = n.readUshort(e, t); t += 2, i[r.trim()] = Ce._lctf.readScriptTable(e, a + l); } return i; }, Ce._lctf.readScriptTable = function(e, t) { var n = Ce._bin, a = t, i = {}, o = n.readUshort(e, t); t += 2, i.default = Ce._lctf.readLangSysTable(e, a + o); var s = n.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) { var l = n.readASCII(e, t, 4); t += 4; var c = n.readUshort(e, t); t += 2, i[l.trim()] = Ce._lctf.readLangSysTable(e, a + c); } return i; }, Ce._lctf.readLangSysTable = function(e, t) { var n = Ce._bin, a = {}; n.readUshort(e, t), t += 2, a.reqFeature = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); return t += 2, a.features = n.readUshorts(e, t, i), a; }, Ce.CFF = {}, Ce.CFF.parse = function(e, t, n) { var a = Ce._bin; (e = new Uint8Array(e.buffer, t, n))[t = 0], e[++t], e[++t], e[++t], t++; var i = []; t = Ce.CFF.readIndex(e, t, i); for (var o = [], s = 0; s < i.length - 1; s++) o.push(a.readASCII(e, t + i[s], i[s + 1] - i[s])); t += i[i.length - 1]; var r = []; t = Ce.CFF.readIndex(e, t, r); var l = []; for (s = 0; s < r.length - 1; s++) l.push(Ce.CFF.readDict(e, t + r[s], t + r[s + 1])); t += r[r.length - 1]; var c = l[0], p = []; t = Ce.CFF.readIndex(e, t, p); var d = []; for (s = 0; s < p.length - 1; s++) d.push(a.readASCII(e, t + p[s], p[s + 1] - p[s])); if (t += p[p.length - 1], Ce.CFF.readSubrs(e, t, c), c.CharStrings) { t = c.CharStrings; p = []; t = Ce.CFF.readIndex(e, t, p); var u = []; for (s = 0; s < p.length - 1; s++) u.push(a.readBytes(e, t + p[s], p[s + 1] - p[s])); c.CharStrings = u; } c.Encoding && (c.Encoding = Ce.CFF.readEncoding(e, c.Encoding, c.CharStrings.length)), c.charset && (c.charset = Ce.CFF.readCharset(e, c.charset, c.CharStrings.length)), c.Private && (t = c.Private[1], c.Private = Ce.CFF.readDict(e, t, t + c.Private[0]), c.Private.Subrs && Ce.CFF.readSubrs(e, t + c.Private.Subrs, c.Private)); var h = {}; for (var m in c) -1 != [ "FamilyName", "FullName", "Notice", "version", "Copyright" ].indexOf(m) ? h[m] = d[c[m] - 426 + 35] : h[m] = c[m]; return h; }, Ce.CFF.readSubrs = function(e, t, n) { var a = Ce._bin, i = []; t = Ce.CFF.readIndex(e, t, i); var o, s = i.length; o = s < 1240 ? 107 : s < 33900 ? 1131 : 32768, n.Bias = o, n.Subrs = []; for (var r = 0; r < i.length - 1; r++) n.Subrs.push(a.readBytes(e, t + i[r], i[r + 1] - i[r])); }, Ce.CFF.tableSE = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, 113, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 139, 0, 0, 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0 ], Ce.CFF.glyphByUnicode = function(e, t) { for (var n = 0; n < e.charset.length; n++) if (e.charset[n] == t) return n; return -1; }, Ce.CFF.glyphBySE = function(e, t) { return t < 0 || t > 255 ? -1 : Ce.CFF.glyphByUnicode(e, Ce.CFF.tableSE[t]); }, Ce.CFF.readEncoding = function(e, t, n) { Ce._bin; var a = [ ".notdef" ], i = e[t]; if (t++, 0 != i) throw "error: unknown encoding format: " + i; var o = e[t]; t++; for (var s = 0; s < o; s++) a.push(e[t + s]); return a; }, Ce.CFF.readCharset = function(e, t, n) { var a = Ce._bin, i = [ ".notdef" ], o = e[t]; if (t++, 0 == o) for (var s = 0; s < n; s++) { var r = a.readUshort(e, t); t += 2, i.push(r); } else { if (1 != o && 2 != o) throw "error: format: " + o; for (;i.length < n; ) { r = a.readUshort(e, t); t += 2; var l = 0; 1 == o ? (l = e[t], t++) : (l = a.readUshort(e, t), t += 2); for (s = 0; s <= l; s++) i.push(r), r++; } } return i; }, Ce.CFF.readIndex = function(e, t, n) { var a = Ce._bin, i = a.readUshort(e, t), o = e[t += 2]; if (t++, 1 == o) for (var s = 0; s < i + 1; s++) n.push(e[t + s]); else if (2 == o) for (s = 0; s < i + 1; s++) n.push(a.readUshort(e, t + 2 * s)); else if (3 == o) for (s = 0; s < i + 1; s++) n.push(16777215 & a.readUint(e, t + 3 * s - 1)); else if (0 != i) throw "unsupported offset size: " + o + ", count: " + i; return (t += (i + 1) * o) - 1; }, Ce.CFF.getCharString = function(e, t, n) { var a = Ce._bin, i = e[t], o = e[t + 1]; e[t + 2], e[t + 3], e[t + 4]; var s = 1, r = null, l = null; i <= 20 && (r = i, s = 1), 12 == i && (r = 100 * i + o, s = 2), 21 <= i && i <= 27 && (r = i, s = 1), 28 == i && (l = a.readShort(e, t + 1), s = 3), 29 <= i && i <= 31 && (r = i, s = 1), 32 <= i && i <= 246 && (l = i - 139, s = 1), 247 <= i && i <= 250 && (l = 256 * (i - 247) + o + 108, s = 2), 251 <= i && i <= 254 && (l = 256 * -(i - 251) - o - 108, s = 2), 255 == i && (l = a.readInt(e, t + 1) / 65535, s = 5), n.val = null != l ? l : "o" + r, n.size = s; }, Ce.CFF.readCharString = function(e, t, n) { for (var a = t + n, i = Ce._bin, o = []; t < a; ) { var s = e[t], r = e[t + 1]; e[t + 2], e[t + 3], e[t + 4]; var l = 1, c = null, p = null; s <= 20 && (c = s, l = 1), 12 == s && (c = 100 * s + r, l = 2), 19 != s && 20 != s || (c = s, l = 2), 21 <= s && s <= 27 && (c = s, l = 1), 28 == s && (p = i.readShort(e, t + 1), l = 3), 29 <= s && s <= 31 && (c = s, l = 1), 32 <= s && s <= 246 && (p = s - 139, l = 1), 247 <= s && s <= 250 && (p = 256 * (s - 247) + r + 108, l = 2), 251 <= s && s <= 254 && (p = 256 * -(s - 251) - r - 108, l = 2), 255 == s && (p = i.readInt(e, t + 1) / 65535, l = 5), o.push(null != p ? p : "o" + c), t += l; } return o; }, Ce.CFF.readDict = function(e, t, n) { for (var a = Ce._bin, i = {}, o = []; t < n; ) { var s = e[t], r = e[t + 1]; e[t + 2], e[t + 3], e[t + 4]; var l = 1, c = null, p = null; if (28 == s && (p = a.readShort(e, t + 1), l = 3), 29 == s && (p = a.readInt(e, t + 1), l = 5), 32 <= s && s <= 246 && (p = s - 139, l = 1), 247 <= s && s <= 250 && (p = 256 * (s - 247) + r + 108, l = 2), 251 <= s && s <= 254 && (p = 256 * -(s - 251) - r - 108, l = 2), 255 == s) throw p = a.readInt(e, t + 1) / 65535, l = 5, "unknown number"; if (30 == s) { var d = []; for (l = 1; ;) { var u = e[t + l]; l++; var h = u >> 4, m = 15 & u; if (15 != h && d.push(h), 15 != m && d.push(m), 15 == m) break; } for (var f = "", g = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ".", "e", "e-", "reserved", "-", "endOfNumber" ], y = 0; y < d.length; y++) f += g[d[y]]; p = parseFloat(f); } if (s <= 21) if (c = [ "version", "Notice", "FullName", "FamilyName", "Weight", "FontBBox", "BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StdHW", "StdVW", "escape", "UniqueID", "XUID", "charset", "Encoding", "CharStrings", "Private", "Subrs", "defaultWidthX", "nominalWidthX" ][s], l = 1, 12 == s) c = [ "Copyright", "isFixedPitch", "ItalicAngle", "UnderlinePosition", "UnderlineThickness", "PaintType", "CharstringType", "FontMatrix", "StrokeWidth", "BlueScale", "BlueShift", "BlueFuzz", "StemSnapH", "StemSnapV", "ForceBold", 0, 0, "LanguageGroup", "ExpansionFactor", "initialRandomSeed", "SyntheticBase", "PostScript", "BaseFontName", "BaseFontBlend", 0, 0, 0, 0, 0, 0, "ROS", "CIDFontVersion", "CIDFontRevision", "CIDFontType", "CIDCount", "UIDBase", "FDArray", "FDSelect", "FontName" ][r], l = 2; null != c ? (i[c] = 1 == o.length ? o[0] : o, o = []) : o.push(p), t += l; } return i; }, Ce.cmap = {}, Ce.cmap.parse = function(e, t, n) { e = new Uint8Array(e.buffer, t, n), t = 0; var a = Ce._bin, i = {}; a.readUshort(e, t), t += 2; var o = a.readUshort(e, t); t += 2; var s = []; i.tables = []; for (var r = 0; r < o; r++) { var l = a.readUshort(e, t); t += 2; var c = a.readUshort(e, t); t += 2; var p = a.readUint(e, t); t += 4; var d = "p" + l + "e" + c, u = s.indexOf(p); if (-1 == u) { var h; u = i.tables.length, s.push(p); var m = a.readUshort(e, p); 0 == m ? h = Ce.cmap.parse0(e, p) : 4 == m ? h = Ce.cmap.parse4(e, p) : 6 == m ? h = Ce.cmap.parse6(e, p) : 12 == m ? h = Ce.cmap.parse12(e, p) : console.log("unknown format: " + m, l, c, p), i.tables.push(h); } if (null != i[d]) throw "multiple tables for one platform+encoding"; i[d] = u; } return i; }, Ce.cmap.parse0 = function(e, t) { var n = Ce._bin, a = {}; a.format = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); t += 2, n.readUshort(e, t), t += 2, a.map = []; for (var o = 0; o < i - 6; o++) a.map.push(e[t + o]); return a; }, Ce.cmap.parse4 = function(e, t) { var n = Ce._bin, a = t, i = {}; i.format = n.readUshort(e, t), t += 2; var o = n.readUshort(e, t); t += 2, n.readUshort(e, t), t += 2; var s = n.readUshort(e, t); t += 2; var r = s / 2; i.searchRange = n.readUshort(e, t), t += 2, i.entrySelector = n.readUshort(e, t), t += 2, i.rangeShift = n.readUshort(e, t), t += 2, i.endCount = n.readUshorts(e, t, r), t += 2 * r, t += 2, i.startCount = n.readUshorts(e, t, r), t += 2 * r, i.idDelta = []; for (var l = 0; l < r; l++) i.idDelta.push(n.readShort(e, t)), t += 2; for (i.idRangeOffset = n.readUshorts(e, t, r), t += 2 * r, i.glyphIdArray = []; t < a + o; ) i.glyphIdArray.push(n.readUshort(e, t)), t += 2; return i; }, Ce.cmap.parse6 = function(e, t) { var n = Ce._bin, a = {}; a.format = n.readUshort(e, t), t += 2, n.readUshort(e, t), t += 2, n.readUshort(e, t), t += 2, a.firstCode = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); t += 2, a.glyphIdArray = []; for (var o = 0; o < i; o++) a.glyphIdArray.push(n.readUshort(e, t)), t += 2; return a; }, Ce.cmap.parse12 = function(e, t) { var n = Ce._bin, a = {}; a.format = n.readUshort(e, t), t += 2, t += 2, n.readUint(e, t), t += 4, n.readUint(e, t), t += 4; var i = n.readUint(e, t); t += 4, a.groups = []; for (var o = 0; o < i; o++) { var s = t + 12 * o, r = n.readUint(e, s + 0), l = n.readUint(e, s + 4), c = n.readUint(e, s + 8); a.groups.push([ r, l, c ]); } return a; }, Ce.glyf = {}, Ce.glyf.parse = function(e, t, n, a) { for (var i = [], o = 0; o < a.maxp.numGlyphs; o++) i.push(null); return i; }, Ce.glyf._parseGlyf = function(e, t) { var n = Ce._bin, a = e._data, i = Ce._tabOffset(a, "glyf") + e.loca[t]; if (e.loca[t] == e.loca[t + 1]) return null; var o = {}; if (o.noc = n.readShort(a, i), i += 2, o.xMin = n.readShort(a, i), i += 2, o.yMin = n.readShort(a, i), i += 2, o.xMax = n.readShort(a, i), i += 2, o.yMax = n.readShort(a, i), i += 2, o.xMin >= o.xMax || o.yMin >= o.yMax) return null; if (o.noc > 0) { o.endPts = []; for (var s = 0; s < o.noc; s++) o.endPts.push(n.readUshort(a, i)), i += 2; var r = n.readUshort(a, i); if (i += 2, a.length - i < r) return null; o.instructions = n.readBytes(a, i, r), i += r; var l = o.endPts[o.noc - 1] + 1; o.flags = []; for (s = 0; s < l; s++) { var c = a[i]; if (i++, o.flags.push(c), 8 & c) { var p = a[i]; i++; for (var d = 0; d < p; d++) o.flags.push(c), s++; } } o.xs = []; for (s = 0; s < l; s++) { var u = !!(2 & o.flags[s]), h = !!(16 & o.flags[s]); u ? (o.xs.push(h ? a[i] : -a[i]), i++) : h ? o.xs.push(0) : (o.xs.push(n.readShort(a, i)), i += 2); } o.ys = []; for (s = 0; s < l; s++) { u = !!(4 & o.flags[s]), h = !!(32 & o.flags[s]); u ? (o.ys.push(h ? a[i] : -a[i]), i++) : h ? o.ys.push(0) : (o.ys.push(n.readShort(a, i)), i += 2); } var m = 0, f = 0; for (s = 0; s < l; s++) m += o.xs[s], f += o.ys[s], o.xs[s] = m, o.ys[s] = f; } else { var g; o.parts = []; do { g = n.readUshort(a, i), i += 2; var y = { m: { a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0 }, p1: -1, p2: -1 }; if (o.parts.push(y), y.glyphIndex = n.readUshort(a, i), i += 2, 1 & g) { var v = n.readShort(a, i); i += 2; var b = n.readShort(a, i); i += 2; } else { v = n.readInt8(a, i); i++; b = n.readInt8(a, i); i++; } 2 & g ? (y.m.tx = v, y.m.ty = b) : (y.p1 = v, y.p2 = b), 8 & g ? (y.m.a = y.m.d = n.readF2dot14(a, i), i += 2) : 64 & g ? (y.m.a = n.readF2dot14(a, i), i += 2, y.m.d = n.readF2dot14(a, i), i += 2) : 128 & g && (y.m.a = n.readF2dot14(a, i), i += 2, y.m.b = n.readF2dot14(a, i), i += 2, y.m.c = n.readF2dot14(a, i), i += 2, y.m.d = n.readF2dot14(a, i), i += 2); } while (32 & g); if (256 & g) { var x = n.readUshort(a, i); i += 2, o.instr = []; for (s = 0; s < x; s++) o.instr.push(a[i]), i++; } } return o; }, Ce.GPOS = {}, Ce.GPOS.parse = function(e, t, n, a) { return Ce._lctf.parse(e, t, n, a, Ce.GPOS.subt); }, Ce.GPOS.subt = function(e, t, n) { if (2 != t) return null; var a = Ce._bin, i = n, o = {}; o.format = a.readUshort(e, n), n += 2; var s = a.readUshort(e, n); n += 2, o.coverage = Ce._lctf.readCoverage(e, s + i), o.valFmt1 = a.readUshort(e, n), n += 2, o.valFmt2 = a.readUshort(e, n), n += 2; var r = Ce._lctf.numOfOnes(o.valFmt1), l = Ce._lctf.numOfOnes(o.valFmt2); if (1 == o.format) { o.pairsets = []; var c = a.readUshort(e, n); n += 2; for (var p = 0; p < c; p++) { var d = a.readUshort(e, n); n += 2, d += i; var u = a.readUshort(e, d); d += 2; for (var h = [], m = 0; m < u; m++) { var f = a.readUshort(e, d); d += 2, 0 != o.valFmt1 && (w = Ce._lctf.readValueRecord(e, d, o.valFmt1), d += 2 * r), 0 != o.valFmt2 && (k = Ce._lctf.readValueRecord(e, d, o.valFmt2), d += 2 * l), h.push({ gid2: f, val1: w, val2: k }); } o.pairsets.push(h); } } if (2 == o.format) { var g = a.readUshort(e, n); n += 2; var y = a.readUshort(e, n); n += 2; var v = a.readUshort(e, n); n += 2; var b = a.readUshort(e, n); n += 2, o.classDef1 = Ce._lctf.readClassDef(e, i + g), o.classDef2 = Ce._lctf.readClassDef(e, i + y), o.matrix = []; for (p = 0; p < v; p++) { var x = []; for (m = 0; m < b; m++) { var w = null, k = null; 0 != o.valFmt1 && (w = Ce._lctf.readValueRecord(e, n, o.valFmt1), n += 2 * r), 0 != o.valFmt2 && (k = Ce._lctf.readValueRecord(e, n, o.valFmt2), n += 2 * l), x.push({ val1: w, val2: k }); } o.matrix.push(x); } } return o; }, Ce.GSUB = {}, Ce.GSUB.parse = function(e, t, n, a) { return Ce._lctf.parse(e, t, n, a, Ce.GSUB.subt); }, Ce.GSUB.subt = function(e, t, n) { var a = Ce._bin, i = n, o = {}; if (1 != t && 4 != t && 5 != t) return null; o.fmt = a.readUshort(e, n), n += 2; var s = a.readUshort(e, n); if (n += 2, o.coverage = Ce._lctf.readCoverage(e, s + i), 1 == t) { if (1 == o.fmt) o.delta = a.readShort(e, n), n += 2; else if (2 == o.fmt) { var r = a.readUshort(e, n); n += 2, o.newg = a.readUshorts(e, n, r), n += 2 * o.newg.length; } } else if (4 == t) { o.vals = []; r = a.readUshort(e, n); n += 2; for (var l = 0; l < r; l++) { var c = a.readUshort(e, n); n += 2, o.vals.push(Ce.GSUB.readLigatureSet(e, i + c)); } } else if (5 == t) if (2 == o.fmt) { var p = a.readUshort(e, n); n += 2, o.cDef = Ce._lctf.readClassDef(e, i + p), o.scset = []; var d = a.readUshort(e, n); n += 2; for (l = 0; l < d; l++) { var u = a.readUshort(e, n); n += 2, o.scset.push(0 == u ? null : Ce.GSUB.readSubClassSet(e, i + u)); } } else console.log("unknown table format", o.fmt); return o; }, Ce.GSUB.readSubClassSet = function(e, t) { var n = Ce._bin.readUshort, a = t, i = [], o = n(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n(e, t); t += 2, i.push(Ce.GSUB.readSubClassRule(e, a + r)); } return i; }, Ce.GSUB.readSubClassRule = function(e, t) { var n = Ce._bin.readUshort, a = {}, i = n(e, t), o = n(e, t += 2); t += 2, a.input = []; for (var s = 0; s < i - 1; s++) a.input.push(n(e, t)), t += 2; return a.substLookupRecords = Ce.GSUB.readSubstLookupRecords(e, t, o), a; }, Ce.GSUB.readSubstLookupRecords = function(e, t, n) { for (var a = Ce._bin.readUshort, i = [], o = 0; o < n; o++) i.push(a(e, t), a(e, t + 2)), t += 4; return i; }, Ce.GSUB.readChainSubClassSet = function(e, t) { var n = Ce._bin, a = t, i = [], o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readUshort(e, t); t += 2, i.push(Ce.GSUB.readChainSubClassRule(e, a + r)); } return i; }, Ce.GSUB.readChainSubClassRule = function(e, t) { for (var n = Ce._bin, a = {}, i = [ "backtrack", "input", "lookahead" ], o = 0; o < i.length; o++) { var s = n.readUshort(e, t); t += 2, 1 == o && s--, a[i[o]] = n.readUshorts(e, t, s), t += 2 * a[i[o]].length; } s = n.readUshort(e, t); return t += 2, a.subst = n.readUshorts(e, t, 2 * s), t += 2 * a.subst.length, a; }, Ce.GSUB.readLigatureSet = function(e, t) { var n = Ce._bin, a = t, i = [], o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readUshort(e, t); t += 2, i.push(Ce.GSUB.readLigature(e, a + r)); } return i; }, Ce.GSUB.readLigature = function(e, t) { var n = Ce._bin, a = { chain: [] }; a.nglyph = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); t += 2; for (var o = 0; o < i - 1; o++) a.chain.push(n.readUshort(e, t)), t += 2; return a; }, Ce.head = {}, Ce.head.parse = function(e, t, n) { var a = Ce._bin, i = {}; return a.readFixed(e, t), t += 4, i.fontRevision = a.readFixed(e, t), t += 4, a.readUint(e, t), t += 4, a.readUint(e, t), t += 4, i.flags = a.readUshort(e, t), t += 2, i.unitsPerEm = a.readUshort(e, t), t += 2, i.created = a.readUint64(e, t), t += 8, i.modified = a.readUint64(e, t), t += 8, i.xMin = a.readShort(e, t), t += 2, i.yMin = a.readShort(e, t), t += 2, i.xMax = a.readShort(e, t), t += 2, i.yMax = a.readShort(e, t), t += 2, i.macStyle = a.readUshort(e, t), t += 2, i.lowestRecPPEM = a.readUshort(e, t), t += 2, i.fontDirectionHint = a.readShort(e, t), t += 2, i.indexToLocFormat = a.readShort(e, t), t += 2, i.glyphDataFormat = a.readShort(e, t), t += 2, i; }, Ce.hhea = {}, Ce.hhea.parse = function(e, t, n) { var a = Ce._bin, i = {}; return a.readFixed(e, t), t += 4, i.ascender = a.readShort(e, t), t += 2, i.descender = a.readShort(e, t), t += 2, i.lineGap = a.readShort(e, t), t += 2, i.advanceWidthMax = a.readUshort(e, t), t += 2, i.minLeftSideBearing = a.readShort(e, t), t += 2, i.minRightSideBearing = a.readShort(e, t), t += 2, i.xMaxExtent = a.readShort(e, t), t += 2, i.caretSlopeRise = a.readShort(e, t), t += 2, i.caretSlopeRun = a.readShort(e, t), t += 2, i.caretOffset = a.readShort(e, t), t += 2, t += 8, i.metricDataFormat = a.readShort(e, t), t += 2, i.numberOfHMetrics = a.readUshort(e, t), t += 2, i; }, Ce.hmtx = {}, Ce.hmtx.parse = function(e, t, n, a) { for (var i = Ce._bin, o = { aWidth: [], lsBearing: [] }, s = 0, r = 0, l = 0; l < a.maxp.numGlyphs; l++) l < a.hhea.numberOfHMetrics && (s = i.readUshort(e, t), t += 2, r = i.readShort(e, t), t += 2), o.aWidth.push(s), o.lsBearing.push(r); return o; }, Ce.kern = {}, Ce.kern.parse = function(e, t, n, a) { var i = Ce._bin, o = i.readUshort(e, t); if (t += 2, 1 == o) return Ce.kern.parseV1(e, t - 2, n, a); var s = i.readUshort(e, t); t += 2; for (var r = { glyph1: [], rval: [] }, l = 0; l < s; l++) { t += 2; n = i.readUshort(e, t); t += 2; var c = i.readUshort(e, t); t += 2; var p = c >>> 8; if (0 != (p &= 15)) throw "unknown kern table format: " + p; t = Ce.kern.readFormat0(e, t, r); } return r; }, Ce.kern.parseV1 = function(e, t, n, a) { var i = Ce._bin; i.readFixed(e, t), t += 4; var o = i.readUint(e, t); t += 4; for (var s = { glyph1: [], rval: [] }, r = 0; r < o; r++) { i.readUint(e, t), t += 4; var l = i.readUshort(e, t); t += 2, i.readUshort(e, t), t += 2; var c = l >>> 8; if (0 != (c &= 15)) throw "unknown kern table format: " + c; t = Ce.kern.readFormat0(e, t, s); } return s; }, Ce.kern.readFormat0 = function(e, t, n) { var a = Ce._bin, i = -1, o = a.readUshort(e, t); t += 2, a.readUshort(e, t), t += 2, a.readUshort(e, t), t += 2, a.readUshort(e, t), t += 2; for (var s = 0; s < o; s++) { var r = a.readUshort(e, t); t += 2; var l = a.readUshort(e, t); t += 2; var c = a.readShort(e, t); t += 2, r != i && (n.glyph1.push(r), n.rval.push({ glyph2: [], vals: [] })); var p = n.rval[n.rval.length - 1]; p.glyph2.push(l), p.vals.push(c), i = r; } return t; }, Ce.loca = {}, Ce.loca.parse = function(e, t, n, a) { var i = Ce._bin, o = [], s = a.head.indexToLocFormat, r = a.maxp.numGlyphs + 1; if (0 == s) for (var l = 0; l < r; l++) o.push(i.readUshort(e, t + (l << 1)) << 1); if (1 == s) for (l = 0; l < r; l++) o.push(i.readUint(e, t + (l << 2))); return o; }, Ce.maxp = {}, Ce.maxp.parse = function(e, t, n) { var a = Ce._bin, i = {}, o = a.readUint(e, t); return t += 4, i.numGlyphs = a.readUshort(e, t), t += 2, 65536 == o && (i.maxPoints = a.readUshort(e, t), t += 2, i.maxContours = a.readUshort(e, t), t += 2, i.maxCompositePoints = a.readUshort(e, t), t += 2, i.maxCompositeContours = a.readUshort(e, t), t += 2, i.maxZones = a.readUshort(e, t), t += 2, i.maxTwilightPoints = a.readUshort(e, t), t += 2, i.maxStorage = a.readUshort(e, t), t += 2, i.maxFunctionDefs = a.readUshort(e, t), t += 2, i.maxInstructionDefs = a.readUshort(e, t), t += 2, i.maxStackElements = a.readUshort(e, t), t += 2, i.maxSizeOfInstructions = a.readUshort(e, t), t += 2, i.maxComponentElements = a.readUshort(e, t), t += 2, i.maxComponentDepth = a.readUshort(e, t), t += 2), i; }, Ce.name = {}, Ce.name.parse = function(e, t, n) { var a = Ce._bin, i = {}; a.readUshort(e, t), t += 2; var o = a.readUshort(e, t); t += 2, a.readUshort(e, t); for (var s, r = t += 2, l = 0; l < o; l++) { var c = a.readUshort(e, t); t += 2; var p = a.readUshort(e, t); t += 2; var d = a.readUshort(e, t); t += 2; var u = a.readUshort(e, t); t += 2; n = a.readUshort(e, t); t += 2; var h = a.readUshort(e, t); t += 2; var m = "p" + c; null == i[m] && (i[m] = {}); var f, g = [ "copyright", "fontFamily", "fontSubfamily", "ID", "fullName", "version", "postScriptName", "trademark", "manufacturer", "designer", "description", "urlVendor", "urlDesigner", "licence", "licenceURL", "---", "typoFamilyName", "typoSubfamilyName", "compatibleFull", "sampleText", "postScriptCID", "wwsFamilyName", "wwsSubfamilyName", "lightPalette", "darkPalette" ][u], y = r + 12 * o + h; if (0 == c) f = a.readUnicode(e, y, n / 2); else if (3 == c && 0 == p) f = a.readUnicode(e, y, n / 2); else if (0 == p) f = a.readASCII(e, y, n); else if (1 == p) f = a.readUnicode(e, y, n / 2); else if (3 == p) f = a.readUnicode(e, y, n / 2); else { if (1 != c) throw "unknown encoding " + p + ", platformID: " + c; f = a.readASCII(e, y, n), console.log("reading unknown MAC encoding " + p + " as ASCII"); } i[m][g] = f, i[m]._lang = d; } for (var v in i) if (null != i[v].postScriptName && 1033 == i[v]._lang) return i[v]; for (var v in i) if (null != i[v].postScriptName && 3084 == i[v]._lang) return i[v]; for (var v in i) if (null != i[v].postScriptName) return i[v]; for (var v in i) { s = v; break; } return console.log("returning name table with languageID " + i[s]._lang), i[s]; }, Ce["OS/2"] = {}, Ce["OS/2"].parse = function(e, t, n) { var a = Ce._bin.readUshort(e, t); t += 2; var i = {}; if (0 == a) Ce["OS/2"].version0(e, t, i); else if (1 == a) Ce["OS/2"].version1(e, t, i); else if (2 == a || 3 == a || 4 == a) Ce["OS/2"].version2(e, t, i); else { if (5 != a) throw "unknown OS/2 table version: " + a; Ce["OS/2"].version5(e, t, i); } return i; }, Ce["OS/2"].version0 = function(e, t, n) { var a = Ce._bin; return n.xAvgCharWidth = a.readShort(e, t), t += 2, n.usWeightClass = a.readUshort(e, t), t += 2, n.usWidthClass = a.readUshort(e, t), t += 2, n.fsType = a.readUshort(e, t), t += 2, n.ySubscriptXSize = a.readShort(e, t), t += 2, n.ySubscriptYSize = a.readShort(e, t), t += 2, n.ySubscriptXOffset = a.readShort(e, t), t += 2, n.ySubscriptYOffset = a.readShort(e, t), t += 2, n.ySuperscriptXSize = a.readShort(e, t), t += 2, n.ySuperscriptYSize = a.readShort(e, t), t += 2, n.ySuperscriptXOffset = a.readShort(e, t), t += 2, n.ySuperscriptYOffset = a.readShort(e, t), t += 2, n.yStrikeoutSize = a.readShort(e, t), t += 2, n.yStrikeoutPosition = a.readShort(e, t), t += 2, n.sFamilyClass = a.readShort(e, t), t += 2, n.panose = a.readBytes(e, t, 10), t += 10, n.ulUnicodeRange1 = a.readUint(e, t), t += 4, n.ulUnicodeRange2 = a.readUint(e, t), t += 4, n.ulUnicodeRange3 = a.readUint(e, t), t += 4, n.ulUnicodeRange4 = a.readUint(e, t), t += 4, n.achVendID = [ a.readInt8(e, t), a.readInt8(e, t + 1), a.readInt8(e, t + 2), a.readInt8(e, t + 3) ], t += 4, n.fsSelection = a.readUshort(e, t), t += 2, n.usFirstCharIndex = a.readUshort(e, t), t += 2, n.usLastCharIndex = a.readUshort(e, t), t += 2, n.sTypoAscender = a.readShort(e, t), t += 2, n.sTypoDescender = a.readShort(e, t), t += 2, n.sTypoLineGap = a.readShort(e, t), t += 2, n.usWinAscent = a.readUshort(e, t), t += 2, n.usWinDescent = a.readUshort(e, t), t += 2; }, Ce["OS/2"].version1 = function(e, t, n) { var a = Ce._bin; return t = Ce["OS/2"].version0(e, t, n), n.ulCodePageRange1 = a.readUint(e, t), t += 4, n.ulCodePageRange2 = a.readUint(e, t), t += 4; }, Ce["OS/2"].version2 = function(e, t, n) { var a = Ce._bin; return t = Ce["OS/2"].version1(e, t, n), n.sxHeight = a.readShort(e, t), t += 2, n.sCapHeight = a.readShort(e, t), t += 2, n.usDefault = a.readUshort(e, t), t += 2, n.usBreak = a.readUshort(e, t), t += 2, n.usMaxContext = a.readUshort(e, t), t += 2; }, Ce["OS/2"].version5 = function(e, t, n) { var a = Ce._bin; return t = Ce["OS/2"].version2(e, t, n), n.usLowerOpticalPointSize = a.readUshort(e, t), t += 2, n.usUpperOpticalPointSize = a.readUshort(e, t), t += 2; }, Ce.post = {}, Ce.post.parse = function(e, t, n) { var a = Ce._bin, i = {}; return i.version = a.readFixed(e, t), t += 4, i.italicAngle = a.readFixed(e, t), t += 4, i.underlinePosition = a.readShort(e, t), t += 2, i.underlineThickness = a.readShort(e, t), t += 2, i; }, Ce.SVG = {}, Ce.SVG.parse = function(e, t, n) { var a = Ce._bin, i = { entries: [] }, o = t; a.readUshort(e, t), t += 2; var s = a.readUint(e, t); t += 4, a.readUint(e, t), t += 4, t = s + o; var r = a.readUshort(e, t); t += 2; for (var l = 0; l < r; l++) { var c = a.readUshort(e, t); t += 2; var p = a.readUshort(e, t); t += 2; var d = a.readUint(e, t); t += 4; var u = a.readUint(e, t); t += 4; for (var h = new Uint8Array(e.buffer, o + d + s, u), m = a.readUTF8(h, 0, h.length), f = c; f <= p; f++) i.entries[f] = m; } return i; }, Ce.SVG.toPath = function(e) { var t = { cmds: [], crds: [] }; if (null == e) return t; for (var n = (new DOMParser).parseFromString(e, "image/svg+xml").firstChild; "svg" != n.tagName; ) n = n.nextSibling; var a = n.getAttribute("viewBox"); a = a ? a.trim().split(" ").map(parseFloat) : [ 0, 0, 1e3, 1e3 ], Ce.SVG._toPath(n.children, t); for (var i = 0; i < t.crds.length; i += 2) { var o = t.crds[i], s = t.crds[i + 1]; o -= a[0], s = -(s -= a[1]), t.crds[i] = o, t.crds[i + 1] = s; } return t; }, Ce.SVG._toPath = function(e, t, n) { for (var a = 0; a < e.length; a++) { var i = e[a], o = i.tagName, s = i.getAttribute("fill"); if (null == s && (s = n), "g" == o) Ce.SVG._toPath(i.children, t, s); else if ("path" == o) { t.cmds.push(s || "#000000"); var r = i.getAttribute("d"), l = Ce.SVG._tokens(r); Ce.SVG._toksToPath(l, t), t.cmds.push("X"); } else "defs" == o || console.log(o, i); } }, Ce.SVG._tokens = function(e) { for (var t = [], n = 0, a = !1, i = ""; n < e.length; ) { var o = e.charCodeAt(n), s = e.charAt(n); n++; var r = 48 <= o && o <= 57 || "." == s || "-" == s; a ? "-" == s ? (t.push(parseFloat(i)), i = s) : r ? i += s : (t.push(parseFloat(i)), "," != s && " " != s && t.push(s), a = !1) : r ? (i = s, a = !0) : "," != s && " " != s && t.push(s); } return a && t.push(parseFloat(i)), t; }, Ce.SVG._toksToPath = function(e, t) { for (var n = 0, a = 0, i = 0, o = 0, s = 0, r = { M: 2, L: 2, H: 1, V: 1, S: 4, C: 6 }, l = t.cmds, c = t.crds; n < e.length; ) { var p = e[n]; if (n++, "z" == p) l.push("Z"), a = o, i = s; else for (var d = p.toUpperCase(), u = r[d], h = Ce.SVG._reps(e, n, u), m = 0; m < h; m++) { var f = 0, g = 0; if (p != d && (f = a, g = i), "M" == d) a = f + e[n++], i = g + e[n++], l.push("M"), c.push(a, i), o = a, s = i; else if ("L" == d) a = f + e[n++], i = g + e[n++], l.push("L"), c.push(a, i); else if ("H" == d) a = f + e[n++], l.push("L"), c.push(a, i); else if ("V" == d) i = g + e[n++], l.push("L"), c.push(a, i); else if ("C" == d) { var y = f + e[n++], v = g + e[n++], b = f + e[n++], x = g + e[n++], w = f + e[n++], k = g + e[n++]; l.push("C"), c.push(y, v, b, x, w, k), a = w, i = k; } else if ("S" == d) { var _ = Math.max(c.length - 4, 0); y = a + a - c[_], v = i + i - c[_ + 1], b = f + e[n++], x = g + e[n++], w = f + e[n++], k = g + e[n++]; l.push("C"), c.push(y, v, b, x, w, k), a = w, i = k; } else console.log("Unknown SVG command " + p); } } }, Ce.SVG._reps = function(e, t, n) { for (var a = t; a < e.length && "string" != typeof e[a]; ) a += n; return (a - t) / n; }, null == Ce && (Ce = {}), null == Ce.U && (Ce.U = {}), Ce.U.codeToGlyph = function(e, t) { var n = e.cmap, a = -1; if (null != n.p0e4 ? a = n.p0e4 : null != n.p3e1 ? a = n.p3e1 : null != n.p1e0 && (a = n.p1e0), -1 == a) throw "no familiar platform and encoding!"; var i = n.tables[a]; if (0 == i.format) return t >= i.map.length ? 0 : i.map[t]; if (4 == i.format) { for (var o = -1, s = 0; s < i.endCount.length; s++) if (t <= i.endCount[s]) { o = s; break; } if (-1 == o) return 0; if (i.startCount[o] > t) return 0; return 65535 & (0 != i.idRangeOffset[o] ? i.glyphIdArray[t - i.startCount[o] + (i.idRangeOffset[o] >> 1) - (i.idRangeOffset.length - o)] : t + i.idDelta[o]); } if (12 == i.format) { if (t > i.groups[i.groups.length - 1][1]) return 0; for (s = 0; s < i.groups.length; s++) { var r = i.groups[s]; if (r[0] <= t && t <= r[1]) return r[2] + (t - r[0]); } return 0; } throw "unknown cmap table format " + i.format; }, Ce.U.glyphToPath = function(e, t) { var n = { cmds: [], crds: [] }; if (e.SVG && e.SVG.entries[t]) { var a = e.SVG.entries[t]; return null == a ? n : ("string" == typeof a && (a = Ce.SVG.toPath(a), e.SVG.entries[t] = a), a); } if (e.CFF) { var i = { x: 0, y: 0, stack: [], nStems: 0, haveWidth: !1, width: e.CFF.Private ? e.CFF.Private.defaultWidthX : 0, open: !1 }; Ce.U._drawCFF(e.CFF.CharStrings[t], i, e.CFF, n); } else e.glyf && Ce.U._drawGlyf(t, e, n); return n; }, Ce.U._drawGlyf = function(e, t, n) { var a = t.glyf[e]; null == a && (a = t.glyf[e] = Ce.glyf._parseGlyf(t, e)), null != a && (a.noc > -1 ? Ce.U._simpleGlyph(a, n) : Ce.U._compoGlyph(a, t, n)); }, Ce.U._simpleGlyph = function(e, t) { for (var n = 0; n < e.noc; n++) { for (var a = 0 == n ? 0 : e.endPts[n - 1] + 1, i = e.endPts[n], o = a; o <= i; o++) { var s = o == a ? i : o - 1, r = o == i ? a : o + 1, l = 1 & e.flags[o], c = 1 & e.flags[s], p = 1 & e.flags[r], d = e.xs[o], u = e.ys[o]; if (o == a) if (l) { if (!c) { Ce.U.P.moveTo(t, d, u); continue; } Ce.U.P.moveTo(t, e.xs[s], e.ys[s]); } else c ? Ce.U.P.moveTo(t, e.xs[s], e.ys[s]) : Ce.U.P.moveTo(t, (e.xs[s] + d) / 2, (e.ys[s] + u) / 2); l ? c && Ce.U.P.lineTo(t, d, u) : p ? Ce.U.P.qcurveTo(t, d, u, e.xs[r], e.ys[r]) : Ce.U.P.qcurveTo(t, d, u, (d + e.xs[r]) / 2, (u + e.ys[r]) / 2); } Ce.U.P.closePath(t); } }, Ce.U._compoGlyph = function(e, t, n) { for (var a = 0; a < e.parts.length; a++) { var i = { cmds: [], crds: [] }, o = e.parts[a]; Ce.U._drawGlyf(o.glyphIndex, t, i); for (var s = o.m, r = 0; r < i.crds.length; r += 2) { var l = i.crds[r], c = i.crds[r + 1]; n.crds.push(l * s.a + c * s.b + s.tx), n.crds.push(l * s.c + c * s.d + s.ty); } for (r = 0; r < i.cmds.length; r++) n.cmds.push(i.cmds[r]); } }, Ce.U._getGlyphClass = function(e, t) { var n = Ce._lctf.getInterval(t, e); return -1 == n ? 0 : t[n + 2]; }, Ce.U.getPairAdjustment = function(e, t, n) { if (e.GPOS) { for (var a = null, i = 0; i < e.GPOS.featureList.length; i++) { var o = e.GPOS.featureList[i]; if ("kern" == o.tag) for (var s = 0; s < o.tab.length; s++) 2 == e.GPOS.lookupList[o.tab[s]].ltype && (a = e.GPOS.lookupList[o.tab[s]]); } if (a) for (i = 0; i < a.tabs.length; i++) { var r = a.tabs[i], l = Ce._lctf.coverageIndex(r.coverage, t); if (-1 != l) { if (1 == r.format) { var c = r.pairsets[l]; for (s = 0; s < c.length; s++) c[s].gid2 == n && (u = c[s]); if (null == u) continue; } else if (2 == r.format) var p = Ce.U._getGlyphClass(t, r.classDef1), d = Ce.U._getGlyphClass(n, r.classDef2), u = r.matrix[p][d]; return u.val1[2]; } } } if (e.kern) { var h = e.kern.glyph1.indexOf(t); if (-1 != h) { var m = e.kern.rval[h].glyph2.indexOf(n); if (-1 != m) return e.kern.rval[h].vals[m]; } } return 0; }, Ce.U.stringToGlyphs = function(e, t) { for (var n = [], a = 0; a < t.length; a++) { var i = t.codePointAt(a); i > 65535 && a++, n.push(Ce.U.codeToGlyph(e, i)); } var o = e.GSUB; if (null == o) return n; for (var s = o.lookupList, r = o.featureList, l = '\n\t" ,.:;!?() \u060c', c = "\u0622\u0623\u0624\u0625\u0627\u0629\u062f\u0630\u0631\u0632\u0648\u0671\u0672\u0673\u0675\u0676\u0677\u0688\u0689\u068a\u068b\u068c\u068d\u068e\u068f\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u06c0\u06c3\u06c4\u06c5\u06c6\u06c7\u06c8\u06c9\u06ca\u06cb\u06cd\u06cf\u06d2\u06d3\u06d5\u06ee\u06ef\u0710\u0715\u0716\u0717\u0718\u0719\u071e\u0728\u072a\u072c\u072f\u074d\u0759\u075a\u075b\u076b\u076c\u0771\u0773\u0774\u0778\u0779\u0840\u0846\u0847\u0849\u0854\u0867\u0869\u086a\u08aa\u08ab\u08ac\u08ae\u08b1\u08b2\u08b9\u0ac5\u0ac7\u0ac9\u0aca\u0ace\u0acf\u0ad0\u0ad1\u0ad2\u0add\u0ae1\u0ae4\u0aef\u0b81\u0b83\u0b84\u0b85\u0b89\u0b8c\u0b8e\u0b8f\u0b91\u0ba9\u0baa\u0bab\u0bac", p = 0; p < n.length; p++) { var d = n[p], u = 0 == p || -1 != l.indexOf(t[p - 1]), h = p == n.length - 1 || -1 != l.indexOf(t[p + 1]); u || -1 == c.indexOf(t[p - 1]) || (u = !0), h || -1 == c.indexOf(t[p]) || (h = !0), h || -1 == "\ua872\u0acd\u0ad7".indexOf(t[p + 1]) || (h = !0), u || -1 == "\ua872\u0acd\u0ad7".indexOf(t[p]) || (u = !0); var m = null; m = u ? h ? "isol" : "init" : h ? "fina" : "medi"; for (var f = 0; f < r.length; f++) if (r[f].tag == m) for (var g = 0; g < r[f].tab.length; g++) { 1 == (x = s[r[f].tab[g]]).ltype && Ce.U._applyType1(n, p, x); } } var y = [ "rlig", "liga", "mset" ]; for (p = 0; p < n.length; p++) { d = n[p]; var v = Math.min(3, n.length - p - 1); for (f = 0; f < r.length; f++) { var b = r[f]; if (-1 != y.indexOf(b.tag)) for (g = 0; g < b.tab.length; g++) for (var x = s[b.tab[g]], w = 0; w < x.tabs.length; w++) if (null != x.tabs[w]) { var k = Ce._lctf.coverageIndex(x.tabs[w].coverage, d); if (-1 != k) if (4 == x.ltype) for (var _ = x.tabs[w].vals[k], q = 0; q < _.length; q++) { var A = _[q], T = A.chain.length; if (!(T > v)) { for (var C = !0, S = 0; S < T; S++) A.chain[S] != n[p + (1 + S)] && (C = !1); if (C) { n[p] = A.nglyph; for (S = 0; S < T; S++) n[p + S + 1] = -1; } } } else if (5 == x.ltype) { var E = x.tabs[w]; if (2 != E.fmt) continue; var I = Ce._lctf.getInterval(E.cDef, d), U = E.cDef[I + 2], H = E.scset[U]; for (a = 0; a < H.length; a++) { var O = H[a], j = O.input; if (!(j.length > v)) { for (C = !0, S = 0; S < j.length; S++) { var z = Ce._lctf.getInterval(E.cDef, n[p + 1 + S]); if (-1 == I && E.cDef[z + 2] != j[S]) { C = !1; break; } } if (C) { var P = O.substLookupRecords; for (q = 0; q < P.length; q += 2) P[q], P[q + 1]; } } } } } } } return n; }, Ce.U._applyType1 = function(e, t, n) { for (var a = e[t], i = 0; i < n.tabs.length; i++) { var o = n.tabs[i], s = Ce._lctf.coverageIndex(o.coverage, a); -1 != s && (1 == o.fmt ? e[t] = e[t] + o.delta : e[t] = o.newg[s]); } }, Ce.U.glyphsToPath = function(e, t, n) { for (var a = { cmds: [], crds: [] }, i = 0, o = 0; o < t.length; o++) { var s = t[o]; if (-1 != s) { for (var r = o < t.length - 1 && -1 != t[o + 1] ? t[o + 1] : 0, l = Ce.U.glyphToPath(e, s), c = 0; c < l.crds.length; c += 2) a.crds.push(l.crds[c] + i), a.crds.push(l.crds[c + 1]); n && a.cmds.push(n); for (c = 0; c < l.cmds.length; c++) a.cmds.push(l.cmds[c]); n && a.cmds.push("X"), i += e.hmtx.aWidth[s], o < t.length - 1 && (i += Ce.U.getPairAdjustment(e, s, r)); } } return a; }, Ce.U.pathToSVG = function(e, t) { null == t && (t = 5); for (var n = [], a = 0, i = { M: 2, L: 2, Q: 4, C: 6 }, o = 0; o < e.cmds.length; o++) { var s = e.cmds[o], r = a + (i[s] ? i[s] : 0); for (n.push(s); a < r; ) { var l = e.crds[a++]; n.push(parseFloat(l.toFixed(t)) + (a == r ? "" : " ")); } } return n.join(""); }, Ce.U.pathToContext = function(e, t) { for (var n = 0, a = e.crds, i = 0; i < e.cmds.length; i++) { var o = e.cmds[i]; "M" == o ? (t.moveTo(a[n], a[n + 1]), n += 2) : "L" == o ? (t.lineTo(a[n], a[n + 1]), n += 2) : "C" == o ? (t.bezierCurveTo(a[n], a[n + 1], a[n + 2], a[n + 3], a[n + 4], a[n + 5]), n += 6) : "Q" == o ? (t.quadraticCurveTo(a[n], a[n + 1], a[n + 2], a[n + 3]), n += 4) : "#" == o.charAt(0) ? (t.beginPath(), t.fillStyle = o) : "Z" == o ? t.closePath() : "X" == o && t.fill(); } }, Ce.U.P = {}, Ce.U.P.moveTo = function(e, t, n) { e.cmds.push("M"), e.crds.push(t, n); }, Ce.U.P.lineTo = function(e, t, n) { e.cmds.push("L"), e.crds.push(t, n); }, Ce.U.P.curveTo = function(e, t, n, a, i, o, s) { e.cmds.push("C"), e.crds.push(t, n, a, i, o, s); }, Ce.U.P.qcurveTo = function(e, t, n, a, i) { e.cmds.push("Q"), e.crds.push(t, n, a, i); }, Ce.U.P.closePath = function(e) { e.cmds.push("Z"); }, Ce.U._drawCFF = function(e, t, n, a) { for (var i = t.stack, o = t.nStems, s = t.haveWidth, r = t.width, l = t.open, c = 0, p = t.x, d = t.y, u = 0, h = 0, m = 0, f = 0, g = 0, y = 0, v = 0, b = 0, x = 0, w = 0, k = { val: 0, size: 0 }; c < e.length; ) { Ce.CFF.getCharString(e, c, k); var _ = k.val; if (c += k.size, "o1" == _ || "o18" == _) i.length % 2 != 0 && !s && (r = i.shift() + n.Private.nominalWidthX), o += i.length >> 1, i.length = 0, s = !0; else if ("o3" == _ || "o23" == _) { i.length % 2 != 0 && !s && (r = i.shift() + n.Private.nominalWidthX), o += i.length >> 1, i.length = 0, s = !0; } else if ("o4" == _) i.length > 1 && !s && (r = i.shift() + n.Private.nominalWidthX, s = !0), l && Ce.U.P.closePath(a), d += i.pop(), Ce.U.P.moveTo(a, p, d), l = !0; else if ("o5" == _) for (;i.length > 0; ) p += i.shift(), d += i.shift(), Ce.U.P.lineTo(a, p, d); else if ("o6" == _ || "o7" == _) for (var q = i.length, A = "o6" == _, T = 0; T < q; T++) { var C = i.shift(); A ? p += C : d += C, A = !A, Ce.U.P.lineTo(a, p, d); } else if ("o8" == _ || "o24" == _) { q = i.length; for (var S = 0; S + 6 <= q; ) u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), p = m + i.shift(), d = f + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, p, d), S += 6; "o24" == _ && (p += i.shift(), d += i.shift(), Ce.U.P.lineTo(a, p, d)); } else { if ("o11" == _) break; if ("o1234" == _ || "o1235" == _ || "o1236" == _ || "o1237" == _) "o1234" == _ && (h = d, m = (u = p + i.shift()) + i.shift(), w = f = h + i.shift(), y = f, b = d, p = (v = (g = (x = m + i.shift()) + i.shift()) + i.shift()) + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)), "o1235" == _ && (u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), x = m + i.shift(), w = f + i.shift(), g = x + i.shift(), y = w + i.shift(), v = g + i.shift(), b = y + i.shift(), p = v + i.shift(), d = b + i.shift(), i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)), "o1236" == _ && (u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), w = f = h + i.shift(), y = f, v = (g = (x = m + i.shift()) + i.shift()) + i.shift(), b = y + i.shift(), p = v + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)), "o1237" == _ && (u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), x = m + i.shift(), w = f + i.shift(), g = x + i.shift(), y = w + i.shift(), v = g + i.shift(), b = y + i.shift(), Math.abs(v - p) > Math.abs(b - d) ? p = v + i.shift() : d = b + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)); else if ("o14" == _) { if (i.length > 0 && !s && (r = i.shift() + n.nominalWidthX, s = !0), 4 == i.length) { var E = i.shift(), I = i.shift(), U = i.shift(), H = i.shift(), O = Ce.CFF.glyphBySE(n, U), j = Ce.CFF.glyphBySE(n, H); Ce.U._drawCFF(n.CharStrings[O], t, n, a), t.x = E, t.y = I, Ce.U._drawCFF(n.CharStrings[j], t, n, a); } l && (Ce.U.P.closePath(a), l = !1); } else if ("o19" == _ || "o20" == _) { i.length % 2 != 0 && !s && (r = i.shift() + n.Private.nominalWidthX), o += i.length >> 1, i.length = 0, s = !0, c += o + 7 >> 3; } else if ("o21" == _) i.length > 2 && !s && (r = i.shift() + n.Private.nominalWidthX, s = !0), d += i.pop(), p += i.pop(), l && Ce.U.P.closePath(a), Ce.U.P.moveTo(a, p, d), l = !0; else if ("o22" == _) i.length > 1 && !s && (r = i.shift() + n.Private.nominalWidthX, s = !0), p += i.pop(), l && Ce.U.P.closePath(a), Ce.U.P.moveTo(a, p, d), l = !0; else if ("o25" == _) { for (;i.length > 6; ) p += i.shift(), d += i.shift(), Ce.U.P.lineTo(a, p, d); u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), p = m + i.shift(), d = f + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, p, d); } else if ("o26" == _) for (i.length % 2 && (p += i.shift()); i.length > 0; ) u = p, h = d + i.shift(), p = m = u + i.shift(), d = (f = h + i.shift()) + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, p, d); else if ("o27" == _) for (i.length % 2 && (d += i.shift()); i.length > 0; ) h = d, m = (u = p + i.shift()) + i.shift(), f = h + i.shift(), p = m + i.shift(), d = f, Ce.U.P.curveTo(a, u, h, m, f, p, d); else if ("o10" == _ || "o29" == _) { var z = "o10" == _ ? n.Private : n; if (0 == i.length) console.log("error: empty stack"); else { var P = i.pop(), L = z.Subrs[P + z.Bias]; t.x = p, t.y = d, t.nStems = o, t.haveWidth = s, t.width = r, t.open = l, Ce.U._drawCFF(L, t, n, a), p = t.x, d = t.y, o = t.nStems, s = t.haveWidth, r = t.width, l = t.open; } } else if ("o30" == _ || "o31" == _) { var M = i.length, $ = (S = 0, "o31" == _); for (S += M - (q = -3 & M); S < q; ) $ ? (h = d, m = (u = p + i.shift()) + i.shift(), d = (f = h + i.shift()) + i.shift(), q - S == 5 ? (p = m + i.shift(), S++) : p = m, $ = !1) : (u = p, h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), p = m + i.shift(), q - S == 5 ? (d = f + i.shift(), S++) : d = f, $ = !0), Ce.U.P.curveTo(a, u, h, m, f, p, d), S += 4; } else { if ("o" == (_ + "").charAt(0)) throw console.log("Unknown operation: " + _, e), _; i.push(_); } } } t.x = p, t.y = d, t.nStems = o, t.haveWidth = s, t.width = r, t.open = l; }; const Se = getDefaultExportFromCjs(Ce), decode = async () => { var e; const t = ce.document.querySelectorAll("style"); let n = null; if (t.forEach((e => { var t; -1 !== (null == (t = e.textContent) ? void 0 : t.indexOf("font-cxsecret")) && (n = e); })), !n) return !0; const a = null == (e = n.textContent) ? void 0 : e.match(/base64,([\w\W]+?)'/); if (!a) return; const i = base64ToUint8Array(a[1]), o = Se.parse(i); let s = await ttfDownload1("https://www.forestpolice.org/ttf/2.0/table.json") || await ttfDownload1("https://jsd.vxo.im/gh/chengbianruan/staticfile/c.json") || await ttfDownload1("https://cdn.jsdelivr.net/gh/chengbianruan/staticfile/c.json"); if (!s) return !1; let r = {}; for (let l = 19968; l < 40870; l++) { let e = Se.U.codeToGlyph(o, l); e && (e = Se.U.glyphToPath(o, e), e = somd5(JSON.stringify(e)).slice(24), r[l] = s[e]); } return ce.document.querySelectorAll(".font-cxsecret").forEach((e => { let t = e.innerHTML; Object.keys(r).forEach((e => { const n = new RegExp(String.fromCharCode(e), "g"); t = t.replace(n, String.fromCharCode(r[e])); })), e.innerHTML = t, e.classList.remove("font-cxsecret"); })), !0; }, base64ToUint8Array = e => { const t = atob(e), n = new Uint8Array(t.length); for (let a = 0; a < t.length; a++) n[a] = t.charCodeAt(a); return n; }, Ee = [ { type: "ask", name: "\u5b66\u4e60\u901a\u968f\u5802\u7ec3\u4e60", match: () => location.href.includes("/page/quiz/stu/answerQuestion2"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], minDelay: 100, answerDelay: 1e3, question: { html: ".left-question-list>.question-item", question: ".html-content-box", options: "ul.option-list>li", type: ".grey-text", workType: "stlx", pageType: "cx" }, init: async () => {}, ischecked: isParentChecked, questionHook: e => (e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".grey-text").text()), e) }, { type: "save", name: "\u5b66\u4e60\u901a\u8003\u8bd5\u65b0\u7248\u6536\u5f55", match: () => location.href.includes("work/view") || location.href.includes("test/reVersionPaperMarkContentNew"), question: { html: ".questionLi", question: "h3.mark_name", options: "ul.mark_letter.colorDeep > li", type: ".colorShallow", workType: "zj", pageType: "cx" }, answerHook: e => { let t = removeHtml(J(e.html).find('span[class="colorShallow"]').html()); if ("" === t) return null; let n = t.match(/^\((.+?)\)/); if (null === n) return null; e.type = n[1].split(",")[0], e.question = titleClean(e.question.split(t)[1].trim()).trim(), e.options = removeStartChar(e.options); const a = J(e.html).find(".mark_score>.totalScore>i").text(), i = t.match(/(\d+(\.\d+)?)/); let o, s = J(e.html).find(".marking_dui").length > 0 || Number(a) == ((null == i ? void 0 : i[0]) || 0) && 0 != Number(a), r = typeMatch(t); if (!s) switch (r) { case "0": case "1": case "3": 0 != Number(a) && (s = !0); } switch (r) { case "0": case "1": e.type = r, e.answer = J(e.html).find(".mark_answer>div>span.colorGreen:eq(0)").text().replace("\u6b63\u786e\u7b54\u6848:", "").trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = e.answer.filter((e => "" !== e)), 0 === e.answer.length && s && (e.answer = J(e.html).find(".mark_answer>div>span.colorDeep:eq(0)").text().replace("\u6211\u7684\u7b54\u6848:", "").trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = e.answer.filter((e => "" !== e))); break; case "3": if (e.type = "3", e.options = [], e.answer = judgeAnswer(J(e.html).find(".mark_answer>div>span.colorGreen:eq(0)").text().replace("\u6b63\u786e\u7b54\u6848", "")), e.answer, 0 === e.answer.length) { if (o = removeHtml(J(e.html).find(".mark_answer>div>span.colorDeep:eq(0)").html()), e.answer = judgeAnswer(o), 0 === e.answer.length) return null; if (0 == Number(a) && !s && "3" == r) return null; s || (e.answer = "\u6b63\u786e" === e.answer[0] ? [ "\u9519\u8bef" ] : [ "\u6b63\u786e" ]); } break; case "4": if (e.type = "4", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "5": if (e.type = "5", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "7": if (e.type = "7", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "6": if (e.type = "6", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "2": if (e.type = "2", e.answer = J(e.html).find(".mark_answer>div>.colorGreen:eq(0)>dd").map(((e, t) => removeHtml(J(t).html()).replace(`(${e + 1})`, "").trim())).get(), 0 == e.answer.length) { const t = J(e.html).find(".mark_answer>div>.colorDeep:eq(0)>dd").map(((e, t) => removeHtml(J(t).html()).replace(`(${e + 1})`, "").trim())).get(); J(e.html).find(".mark_answer>div>.colorDeep:eq(0)>dd>.marking_dui").length == t.length && (e.answer = t); } break; default: return null; } return e; }, paper: async e => { const t = { platform: "cx" }, n = J("#courseId").val(), a = (ce.document.body.innerHTML.match(/(?:examId|relationId)=(\d+)/) || [])[1] || "", i = `https://mobilelearn.chaoxing.com/v2/apis/class/getClassDetail?courseId=${n}&classId=${J("#classId").val()}`; await request(i, "GET").then((e => { const n = JSON.parse(e[0].responseText).data.course.data[0]; t.name = n.name, t.info = {}, t.info.imageurl = n.imageurl; })), t.hash = n, t.info = {}, t.chapter = [ { hash: `${a}`, name: J(".mark_title").text().trim(), question: e } ], Te.setPaper(t.hash, t); } }, { type: "hook", name: "hook", match: location.href.includes("work/selectWorkQuestionYiPiYue") && location.href.includes("mooc2=0"), main: e => { location.href.includes("mooc2=0") ? ce.location.href = location.href.replace("mooc2=0", "mooc2=1") : ce.location.href = location.href + "&mooc2=1"; } }, { type: "save", name: "\u5b66\u4e60\u901a\u4f5c\u4e1a\u6536\u5f55\u65b0", match: () => location.href.includes("work/selectWorkQuestionYiPiYue") && location.href.includes("mooc2=1"), question: { html: ".TiMu", question: ".Zy_TItle .clearfix", options: "ul.Zy_ulTop li", type: ".newZy_TItle", workType: "zj", pageType: "cx" }, answerHook: e => { e.type = J(e.html).find(".newZy_TItle").text().replace(/\u3010|\u3011/g, "").trim(); let t, n = J(e.html).find(".marking_dui").length > 0; switch (removeHtml(J(e.html).find(".Py_addpy:eq(0)").html()), e.question = titleClean(e.question).trim(), e.type) { case "\u5355\u9009\u9898": case "\u591a\u9009\u9898": e.type = "\u5355\u9009\u9898" === e.type ? "0" : "1", e.options = J(e.html).find("ul.Zy_ulTop li").map(((e, t) => { let n = J(t).find("i.fl").text().trim(), a = removeHtml(J(t).html()); return "" === n ? a.trim() : a.split(n)[1].trim(); })).get(), e.answer = J(e.html).find(".correctAnswer >.fl.answerCon").text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length && n && (e.answer = J(e.html).find(".myAnswer > .fl.answerCon").text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65]))); break; case "\u5224\u65ad\u9898": if (e.type = "3", e.answer = J(e.html).find(".correctAnswer > .fl.answerCon").text().trim().split("").map((e => e.includes("\u6b63\u786e") || e.includes("\u5bf9") || e.includes("\u221a") ? "\u6b63\u786e" : e.includes("\u9519\u8bef") || e.includes("\u9519") || e.includes("\xd7") ? "\u9519\u8bef" : null)).filter((e => null !== e)), 0 === e.answer.length) { t = removeHtml(J(e.html).find(".fl.answerCon").html()); let [n, a] = [ ".marking_dui", ".marking_cuo" ].map((t => J(e.html).find(t).length)); if (n + a === 0) return null; if (t.includes("\u6b63\u786e") || t.includes("\u5bf9") || t.includes("\u221a")) e.answer = [ "\u6b63\u786e" ]; else { if (!(t.includes("\u9519\u8bef") || t.includes("\u9519") || t.includes("\xd7"))) return null; e.answer = [ "\u9519\u8bef" ]; } 0 === n && 0 !== a && (e.answer = "\u6b63\u786e" === e.answer[0] ? "\u9519\u8bef" : "\u6b63\u786e"); } break; case "\u586b\u7a7a\u9898": e.type = "2", e.answer = J(e.html).find(".correctAnswerBx>.correctAnswer>p:not(.clear)").map(((e, t) => removeHtml(J(t).html()).replace(`(${e + 1})`, "").trim())).get().filter((e => "" !== e)), 0 == e.answer.length && (e.answer = J(e.html).find(".myAllAnswerBx>.myAnswerBx>.myAnswer").map(((e, t) => removeHtml(J(t).html()).replace(/\u7b2c[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\u7a7a\uff1a/, "").trim())).get(), e.answer.length !== J(e.html).find(".marking_dui").length && (e.answer = [])); break; case "\u5206\u5f55\u9898": if (e.type = "9", e.answer = J(e.html).find(".correctAnswerBx>.correctAnswer>p:not(.clear)").map(((e, t) => removeHtml(J(t).html()))).get().filter((e => "" !== e)), e.answer.length != J(e.html).find(".CorrectOrNot").length) { if (J(e.html).find(".marking_cuo").length > 0) return null; if (e.answer = J(e.html).find(".myAnswerBx>.myAnswer>p:not(.clear)").map(((e, t) => removeHtml(J(t).html()))).get().filter((e => "" !== e)), e.answer.length != J(e.html).find(".CorrectOrNot").length) return null; } e.answer; break; case "\u8fde\u7ebf\u9898": e.type = "11"; let a = J(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(), i = J(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(); t = J(e.html).find(".correctAnswer >.fl.answerCon >.collectAnswer").map(((e, t) => removeHtml(J(t).text()))).get(), e.options = [ a, i ]; let o = {}; t.forEach((e => { let [t, n] = e.split("-"); t.charCodeAt(0) >= 65 ? t = (t.charCodeAt(0) - 65).toString() : /^\d+$/.test(t) && (t = (parseInt(t) - 1).toString()), n.charCodeAt(0) >= 65 ? n = (n.charCodeAt(0) - 65).toString() : /^\d+$/.test(n) && (n = (parseInt(n) - 1).toString()), o[a[t]] = i[n]; })), e.answer = o, e.answer; break; case "\u9605\u8bfb\u7406\u89e3": const s = J(e.html).find(".readCompreHensionItem").map(((e, t) => { let n = typeMatch(J(t).find("i.index").text()), a = removeHtml(J(t).find(".clearfix").html()), i = J(t).find("ul.Zy_ulTop>li").map(((e, t) => removeHtml(J(t).html()))).get(); i = removeOptionsStartChar(i); let o = removeHtml(J(t).find(".correctAnswerBx>.correctAnswer>.answerCon").text()), s = []; switch (n) { case "0": case "1": s = o.split("").map((e => i[e.charCodeAt(0) - 65])); break; default: return null; } return 0 === s.length ? null : { type: n, question: a, options: i, answer: s }; })).get(); if (null == s || 0 == s.length) return null; e.answer = s.map((e => e.answer)), e.options = s.map((e => (delete e.answer, e))), e.type = "15"; break; default: return e.type, null; } return e; }, paper: async e => { const t = { platform: "cx" }, n = ce.courseId, a = ce.jobid, i = `https://mobilelearn.chaoxing.com/v2/apis/class/getClassDetail?courseId=${n}&classId=${ce.classId}`; await request(i, "GET").then((e => { const n = JSON.parse(e[0].responseText).data.course.data[0]; t.name = n.name, t.info = {}, t.info.imageurl = n.imageurl; })), t.hash = n, t.info = {}, t.chapter = [ { hash: `${a}`, name: J(".ceyan_name>h3").text().trim(), question: e } ], Te.setPaper(t.hash, t); } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65b0\u7248\u4f5c\u4e1a", match: () => /\/mooc2\/work\/dowork/i.test(location.pathname), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], question: { html: ".questionLi", question: "h3", options: "ul:eq(0) li .after, .answer_p", type: "input[name^=answertype]:eq(0)", workType: "zy", pageType: "cx" }, questionHook: e => { const t = removeHtml(J(e.html).find(".colorShallow").html()); return e.question = titleClean(e.question.split(t)[1].trim()).trim(), e.$options = J(e.html).find(".answerBg"), e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65b0\u7248\u8003\u8bd5", match: () => /exam\/preview/i.test(location.pathname) || /exam\/test\/reVersionTestStartNew/i.test(location.pathname), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], question: { html: ".questionLi", question: "h3", options: "ul:eq(0) li .after, .answer_p", type: "input[name^=type]:not([name=type])", workType: "ks", pageType: "cx" }, questionHook: e => { const t = removeHtml(J(e.html).find(".colorShallow").html()); if (e.question = titleClean(e.question.split(t)[1].trim()).trim(), e.$options = J(e.html).find(".answerBg"), "3" === e.type) e.options = []; return e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); }, next: () => { J('.nextDiv .jb_btn:contains("\u4e0b\u4e00\u9898")').click(); } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65e7\u7248\u4f5c\u4e1a", match: () => /work\/doHomeWorkNew/i.test(location.pathname) && 0 == location.href.includes("mooc2=1"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], init: async () => { if (!(await decode())) return msg("\u9875\u9762\u89e3\u5bc6\u5931\u8d25\uff0c\u65e0\u6cd5\u7b54\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u53cd\u9988\u7ed9\u4f5c\u8005\u5427", "error"), !1; }, question: { html: ".TiMu", question: ".clearfix.fontLabel", options: "ul:eq(0) li .after", type: "input[name^=answertype]:eq(0), .answer_p", workType: "zy", pageType: "cx" }, questionHook: e => { switch (e.question = titleClean(e.question).trim(), e.$options = J(e.html).find(".fl.before"), e.type) { case "3": e.options = J(e.html).find("ul:eq(0) li").map(((e, t) => J(t).find(".ri").length > 0 ? "\u6b63\u786e" : J(t).find(".wr").length > 0 ? "\u9519\u8bef" : isTrue(J(t).attr("aria-label") || "") ? "\u6b63\u786e" : isFalse(J(t).attr("aria-label") || "") ? "\u9519\u8bef" : void 0)).get(), e.$options = J(e.html).find("ul>li"); break; case "11": let t = J(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(), n = J(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(); e.options = [ t, n ], e.$options = J(e.html).find("ul.thirdUlList>li:not(.groupTitile)"); } return e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); }, setAnswer: e => { switch (e.type) { case "11": return e.ques.$options.each(((t, n) => { let a = e.ques.options[0], i = e.ques.options[1], o = e.answer[a[t]], s = i.indexOf(o); o = String.fromCharCode(s + 65), J(n).find("select>option").each(((e, t) => { J(t).val(), J(t).val() == o && J(t).prop("selected", !0); })); })), e.answer, !1; case "3": let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && (isTrue(removeHtml(J(n).html())) || J(n).find(".ri").length > 0) && J(n).find("input").click(), isFalse(t) && (isFalse(removeHtml(J(n).html())) || J(n).find(".wr").length > 0) && J(n).find("input").click(); })), !1; default: return !0; } } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65b0\u7248\u7ae0\u8282", match: () => /work\/doHomeWorkNew/i.test(location.pathname) && location.href.includes("mooc2=1"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], init: async () => { if (!(await decode())) return msg("\u9875\u9762\u89e3\u5bc6\u5931\u8d25\uff0c\u65e0\u6cd5\u7b54\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u53cd\u9988\u7ed9\u4f5c\u8005\u5427", "error"), !1; }, question: { html: ".TiMu", question: ".clearfix.fontLabel", options: "ul:eq(0) li .after, .answer_p", type: "input[name^=answertype]:eq(0)", workType: "zj", pageType: "cx" }, questionHook: e => { switch (e.question = titleClean(e.question).trim(), e.type) { case "3": e.options = J(e.html).find("ul:eq(0) li").map(((e, t) => "true" === J(t).find(".num_option").attr("data") ? "\u6b63\u786e" : "false" === J(t).find(".num_option").attr("data") ? "\u9519\u8bef" : void 0)).get(), e.options = []; break; case "11": let t = J(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(), n = J(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(); e.options = [ t, n ], e.$options = J(e.html).find("ul.thirdUlList>li:not(.groupTitile)"); break; case "15": const a = J(e.html).find(".readCompreHensionItem").map(((e, t) => { let n = typeMatch(J(t).find("i.index").text()), a = removeHtml(J(t).find(".clearfix").html()), i = J(t).find("ul.Zy_ulTop>li").map(((e, t) => removeHtml(J(t).html()))).get(); return i = removeOptionsStartChar(i), { type: n, question: a, options: i, $options: J(t).find("ul.Zy_ulTop>li") }; })).get(); if (null == a || 0 == a.length) return null; e.options = a, e.$options = null; break; default: e.type; } return e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); }, setAnswer: e => (e.ques.options, "11" !== e.type || (e.ques.$options.each(((t, n) => { let a = e.ques.options[0], i = e.ques.options[1], o = e.answer[a[t]], s = i.indexOf(o); o = String.fromCharCode(s + 65), ce.$(n).find(".dept_select").chosen().val(o).trigger("chosen:updated"); })), e.answer, !1)) } ], Ie = [ { type: "ask", name: "\u667a\u6167\u6811\u7ae0\u8282", tips: "\u667a\u6167\u6811\u5fc5\u987b\u5f00\u81ea\u52a8\u8df3\u8f6c\uff0c\u5426\u5219\u7b54\u6848\u53ef\u80fd\u65e0\u6cd5\u4fdd\u5b58\u5bfc\u81f4\u4f4e\u5206\uff01", match: () => location.href.includes("zhihuishu.com") && !location.href.includes("checkHomework") && location.host.includes("zhihuishu") && ("/stuExamWeb.html" === location.pathname || location.href.includes("/webExamList/dohomework/") || location.href.includes("/webExamList/doexamination/")), types: [ "0", "1", "2", "3" ], question: { html: ".examPaper_box > div:eq(1) >div:not(.examPaper_partTit)", question: ".subject_describe.dynamic-fonts:eq(0) div:eq(0)", options: ".subject_node .nodeLab .label.clearfix .node_detail", type: ".subject_type span:first-child", workType: "zhs", pageType: "zhs" }, init: async () => { await waitUntil((function() { return !J(".yidun_popup").hasClass("yidun_popup--light") && ce.zhsques; })); }, next: () => { J(".switch-btn-box button:eq(1)").click(); }, questionHook: (e, t) => { const n = ce.zhsques.examBase.workExamParts.map((e => e.questionDtos)).flat()[t]; return e.type = typeConvert(n.questionType.name), e.question = removeHtml(n.name), e.options = n.questionOptions ? n.questionOptions.map((e => removeHtml(e.content))) : [], "3" == e.type && (e.options = []), e; } }, { type: "save", name: "\u667a\u6167\u6811\u4f5c\u4e1a\u6536\u5f55", match: () => location.href.includes("zhihuishu.com") && location.href.includes("checkHomework") && location.host.includes("zhihuishu") && ("/stuExamWeb.html" === location.pathname || location.href.includes("/webExamList/checkHomework/")), question: { html: ".questionType", question: ".subject_describe", options: ".examquestions-answer", type: ".newZy_TItle", workType: "zhs", pageType: "zhs" }, init: async () => { await waitUntil((function() { return J(".questionType").length > 0 && J(".questionType:eq(0)")[0].__vue__.answerImgMap; })); }, answerHook: e => { const t = J(e.html)[0].__vue__, n = t.answerData[t.data.id], a = "1" === n.isCurrent ? n.answer.split(",") : [], i = t.data, o = t.answerImgMap[t.data.id] || ""; t.answerImgMap, t.data.id, somd5(o), e.type = typeMatch(i.questionType.name); const s = []; if (e.options = i.questionOptions.map((e => (a.includes(String(e.id)) && s.push(removeHtml(e.content)), removeHtml(e.content)))), e.answer = s, "3" === e.type) { e.options = []; const t = e.answer[0]; e.answer = isTrue(t) ? [ "\u6b63\u786e" ] : isFalse(t) ? [ "\u9519\u8bef" ] : []; } return e; } }, { type: "save", name: "\u667a\u6167\u6811\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("zhihuishu.com") && location.href.includes("/atHomeworkExam/stu/examQ/doExamnew"), question: { html: ".subjecttype-div.clearfloat", question: ".subjectTitle-p", options: ".TitleOptions-div label", type: ".subjecttopic-div", workType: "zhs", pageType: "zhs" }, init: async () => { await waitUntil((function() { return J(".subjecttype-div.clearfloat").length > 0; })); }, answerHook: e => { const t = J(e.html).find(".Referenceanswer-div.clearFloat>.Referenceanswer-r.fl").text(); return e.question = removeHtml(e.question), e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".subjecttopic-div").text()), e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), "3" == e.type && (e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []), e; } } ], Ue = [ { type: "hook", name: "\u82af\u4f4d\u6559\u80b2hook", match: "www.beeline-ai.com" === location.host, main: async e => { const getPageIdentifier = () => J(".el-main > div:eq(0)").attr("class"); ce.mainClass = getPageIdentifier(); const t = new MutationObserver((async e => { const n = getPageIdentifier(); ce.mainClass !== n && (ce.mainClass = n, "homework-detail-container" === n && await waitUntil((() => 0 === J(".el-loading-mask").length)), vuePageChange(), t.disconnect()); for (const a of e) if ("attributes" === a.type && "class" === a.attributeName) { const e = a.target.textContent; if (e && (e.includes("\u4e0b\u4e00\u9898") || e.includes("\u4e0a\u4e00\u9898"))) { vuePageChange(), t.disconnect(); break; } } })); J("body").length >= 1 && t.observe(J("body")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u82af\u4f4d\u6559\u80b2\u4f5c\u4e1a", tips: "\u82af\u4f4d\u6559\u80b2\u4ec5\u652f\u6301\u9009\u62e9\u5224\u65ad\uff0c\u5176\u4ed6\u9898\u578b\u5f85\u9002\u914d", match: () => "www.beeline-ai.com" === location.host && (/student\/#\/courseInfo\/[A-Za-z0-9]+\/homework/i.test(location.href) || /student\/#\/courseInfo\/[A-Za-z0-9]+\/exam/i.test(location.href)), types: [ "0", "1", "3" ], question: { html: ".content-area > div.content", question: ".content", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "xinwei", pageType: "xinwei" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-box").length; })); }, next: () => { J('.toggle-box > button:contains("\u4e0b\u4e00\u9898")').click(); }, ischecked: isParentChecked, questionHook: e => (e.type = typeMatch(J(e.html).find(".question-box>.tag").text()), e) }, { type: "save", name: "\u82af\u4f4d\u6559\u80b2\u6536\u5f55", match: () => "www.beeline-ai.com" === location.host && location.href.includes("/homeworkDetailPage"), question: { html: ".question-content-body", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "xinwei", pageType: "xinwei" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-content-body").length; })); }, answerHook: e => { e.type = typeMatch(J(e.html).find(".question-box>.tag").text()); let t = J(e.html).find(".answer-area > span:eq(1)").text(); switch (e.type) { case "0": case "1": let n = t.split(","); if (e.answer = n.map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return; break; case "3": "T" == t && (e.answer = [ "\u6b63\u786e" ]), "F" == t && (e.answer = [ "\u9519\u8bef" ]); } return e; } } ], updateAiCookieCredential = (e, t, n, a) => { var i; (null == (i = e.ai) ? void 0 : i.updateCredential) && e.ai.updateCredential(t, { type: "cookie-token", value: n }), ((e, t, n) => { const a = "legacy-glm" === t ? "GLM" : "spark"; e.app.gpt.forEach((e => { e.name === a && (e.key = n); })), e.setConfig(e.app); })(e.app, t, n), msg(a); }, He = [ { type: "hook", name: "\u667a\u666e\u6e05\u8a00token\u83b7\u53d6", match: /chatglm.cn\/main\//i.test(location.href), main: e => { const t = document.cookie.split(";"); let n = ""; t.forEach((e => { /chatglm_refresh_token/i.test(e) && (n = e.split("=")[1]); })), n && updateAiCookieCredential(e, "legacy-glm", n, "\u667a\u666e\u6e05\u8a00token\u83b7\u53d6\u6210\u529f"); } }, { type: "hook", name: "\u8baf\u98de\u661f\u706btoken\u83b7\u53d6", match: /xinghuo.xfyun.cn\/desk/i.test(location.href), main: e => { const t = document.cookie.split(";"); let n = ""; t.forEach((e => { /ssoSessionId/i.test(e) && (n = e.split("=")[1]); })), n && updateAiCookieCredential(e, "legacy-spark", n, "\u8baf\u98de\u661f\u706btoken\u83b7\u53d6\u6210\u529f"); } } ], Oe = { single_selection: "\u5355\u9009\u9898", multiple_selection: "\u591a\u9009\u9898", true_or_false: "\u5224\u65ad\u9898", fill_in_blank: "\u586b\u7a7a\u9898", short_answer: "\u7b80\u7b54\u9898", text: "\u6587\u672c", analysis: "\u7efc\u5408\u9898", matching: "\u5339\u914d\u9898", random: "\u968f\u673a\u9898", cloze: "\u5b8c\u5f62\u586b\u7a7a\u9898" }, je = [ { type: "hook", name: "\u56fd\u5f00hook", match: location.host.includes("ouchn.cn"), main: e => { observeVuePageChange(J("body")[0], getUrl, { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 !== J(".selectDan").length; })); } }); } }, { type: "save", name: "\u56fd\u5f00\u7b54\u6848\u6536\u5f55\u65e7", match: () => /\/exam\/([0-9]+)\/subjects#\/submission\/([0-9]+)/i.test(location.href), question: { html: "li.subject", question: ".summary-title .subject-description", options: ".subject-options li .option-content", type: ".subject-point > span:eq(0)", workType: "guokai", pageType: "guokai" }, init: async () => { await waitUntil((function() { return J(".loading-gif").hasClass("ng-hide"); })); }, answerHook: e => { const t = ce.angular.element(e.html).scope().subject; if ("text" === t.type) return; let n = !1; const a = parseFloat(t.point), i = parseFloat(t.score), o = 0 !== a && a === i; let s = J(`
${t.description}
`).clone(); if (s.find("span.__blank__").remove(), e.question = removeHtml(s.html()), e.options = t.options.map((e => removeHtml(e.content))), e.type = typeConvert(Oe[t.type]), t.correctOptions && t.correctOptions.length > 0 && (e.answer = t.correctOptions.map((e => removeHtml(e.content))), n = !0), t.correct_answers && t.correct_answers.length > 0 && (e.answer = t.correct_answers.map((e => e.content)), n = !0), n || o) { switch (t.type) { case "single_selection": case "multiple_selection": case "true_or_false": if (n) "true_or_false" === t.type && (e.answer = judgeAnswer(e.answer[0]), e.options = []); else { if (t.options, e.answer = t.options.filter((e => e.isChosen)).map((e => removeHtml(e.content))), 0 === e.answer.length) return; "true_or_false" === t.type && (e.answer = judgeAnswer(e.answer[0]), e.options = []); } break; case "analysis": break; case "cloze": t.sub_subjects, e.options = t.sub_subjects.map((e => e.options.map((e => removeHtml(e.content))))); break; case "fill_in_blank": n || (e.answer = t.answers.map((e => e.content))); } return e; } }, paper: e => { const t = ce.globalData.course, n = ce.angular.element(J("body")).scope(), a = ce.angular.element(J(".hd")).scope().exam, i = n.submissionData.id; if (!n.examSubmissions.find((e => (e.id, String(e.id) === String(i))))) return; const o = { platform: "guokai" }; o.hash = t.id, o.name = t.name, o.info = {}, o.info.school = t.orgName, o.chapter = [ { hash: `${a.id}`, name: a.title, question: e } ], Te.setPaper(o.hash, o); } }, { type: "save", name: "\u5e7f\u5f00\u7b54\u6848\u6536\u5f55", match: () => /mod\/quiz\/review\.php/i.test(location.pathname), question: { html: ".que", question: ".qtext", options: ".answer > div", type: "", answer: ".rightanswer", workType: "ougd", pageType: "ougd" }, init: async () => { J(".specificfeedback").remove(); }, next: async () => { !J(".qn_buttons > a").last().hasClass("thispage") && J(".arrow_text").click(); }, answerHook: e => { const t = J(e.html).find(".info .state").text(); if (e.type = (J(e.html).attr("class") || "").split(" ")[1], J(e.html).find(".qtext .accesshide").remove(), e.question = removeHtml(J(e.html).find(".qtext").html()), e.question.includes("egg")) { let t = J(e.html).clone(); t.find("img").each((function() { var e; (null == (e = J(this).attr("src")) ? void 0 : e.includes("egg")) && J(this).remove(); })), e.question = removeHtml(t.find(".qtext").html()); } switch (e.type, e.type) { case "truefalse": e.type = "3", e.$options = J(e.html).find("input[type=radio]"), e.options = J(e.html).find(".answer > div").map(((e, t) => removeHtml(J(t).html()).trim())).get(), e.answer = [], e.answer = J(e.html).find(".answer > div").map(((t, n) => e.$options.eq(t).prop("checked") ? e.options[t] : "")).get(), e.answer = e.answer.filter((e => "" !== e)), 0 === e.answer.length ? (e.temp = removeHtml(J(e.html).find(".rightanswer").html()).replace("\u6b63\u786e\u7b54\u6848\u662f", "").trim(), e.answer = [ e.temp ]) : t.includes("\u6b63\u786e") || (e.answer = e.options.filter((t => !t.includes(e.answer[0])))), isTrue(e.answer[0]) ? e.answer = [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? e.answer = [ "\u9519\u8bef" ] : e.answer = [], e.options = []; break; case "multichoice": case "multichoiceset": if (e.type = "1", e.$options = J(e.html).find("input[type=checkbox]"), 0 === e.$options.length && (e.type = "0", e.$options = J(e.html).find("input[type=radio]")), e.options = J(e.html).find(".answer > div").map(((e, t) => { let n = J(t).find(".answernumber").text().trim(), a = removeHtml(J(t).html()); return "" === n ? a.trim() : a.split(n)[1].trim(); })).get(), t.includes("\u6b63\u786e") && !t.includes("\u90e8\u5206\u6b63\u786e")) e.answer = [], e.answer = J(e.html).find(".answer > div").map(((t, n) => { let a = J(n).find(".answernumber").text().trim(), i = removeHtml(J(n).html()); return e.$options.eq(t).prop("checked") && J(n).find(".text-success").length > 0 ? "" === a ? i.trim() : i.split(a)[1].trim() : ""; })).get(), e.answer = e.answer.filter((e => "" !== e)); else { e.temp = removeHtml(J(e.html).find(".rightanswer").html(), !1).replace("\u6b63\u786e\u7b54\u6848\u662f\uff1a", "").trim(); const t = e.options.slice(0); t.sort(((e, t) => t.length - e.length)), e.answer = t.map((t => e.temp.includes(t) ? (e.temp = e.temp.replace(t, ""), t) : "")), e.answer = e.answer.filter((e => "" !== e)), e.answer.length; } break; case "shortanswer": e.type = "4", e.$options = J(e.html).find("input[type=text]"), e.answer = removeHtml(J(e.html).find(".rightanswer").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(); break; case "match": e.type = "24", e.match = J(".answer tr td.text").map(((e, t) => removeHtml(J(t).html()))).get(), e.$options = J(".answer tr td.control select"), e.selects = J(".answer tr td.control select").map(((e, t) => [ J(t).find("option").map(((e, t) => ({ value: J(t).val(), text: J(t).text() }))).get() ])).get(); break; case "multianswer": e.type = "14"; let n = J(e.html).find(".formulation").clone(); n.find(".subquestion").remove(), n.find(".accesshide").remove(), e.question = removeHtml(n.html()); let a = [], i = []; J(e.html).find(".subquestion").map(((e, t) => { let n = J(t).find("select>option").map(((e, t) => removeHtml(J(t).html()))).get(); n = n.filter((e => "" !== e)), a.push(n); let o = J(t).find("select>option:selected").map(((e, t) => removeHtml(J(t).html()))).get(); i.push(o[0]); })), e.options = a; J(e.html).find(".text-success").length == e.options.length && (e.answer = i); break; case "description": return; } return e; }, paper: async e => { const t = { platform: "ougd" }; t.hash = (ce.document.body.innerHTML.match(/(?:courseid)=(\d+)/) || [])[1] || ""; const n = (ce.document.body.innerHTML.match(/(?:cmid)=(\d+)/) || [])[1] || ""; "" !== t.hash && "" !== n && (t.info = {}, t.name = J("h1").text().trim(), t.chapter = [ { hash: `${n}`, name: ce.document.title.trim(), question: e } ], Te.setPaper(t.hash, t)); } }, { type: "ask", name: "\u5e7f\u5f00\u5f62\u8003", tips: "\u5e7f\u5f00\u4ec5\u652f\u6301\u57fa\u7840\u9898\u578b\uff0c\u7279\u6b8a\u9898\u578b\u8bf7\u624b\u52a8\u5b8c\u6210", match: () => /mod\/quiz\/attempt\.php/i.test(location.pathname), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9", "14", "24" ], question: { html: ".que", question: ".qtext", options: ".answer > div", type: "", workType: "ougd", pageType: "ougd" }, ischecked: e => Boolean(e.prop("checked")), questionHook: e => { if (e.type = (J(e.html).attr("class") || "").split(" ")[1], J(e.html).find(".qtext .accesshide").remove(), e.question = removeHtml(J(e.html).find(".qtext").html()), e.question.includes("egg")) { let t = J(e.html).clone(); t.find("img").each((function() { var e; (null == (e = J(this).attr("src")) ? void 0 : e.includes("egg")) && J(this).remove(); })), e.question = removeHtml(t.find(".qtext").html()); } switch (e.type) { case "truefalse": e.type = "3", e.$options = J(e.html).find("input[type=radio]"), e.options = []; break; case "multichoice": case "multichoiceset": e.type = "1", e.$options = J(e.html).find("input[type=checkbox]"), 0 === e.$options.length && (e.type = "0", e.$options = J(e.html).find("input[type=radio]")), e.options = J(e.html).find(".answer > div").map(((e, t) => { let n = J(t).find(".answernumber").text().trim(), a = removeHtml(J(t).html()); return "" === n ? a.trim() : a.split(n)[1].trim(); })).get(); break; case "shortanswer": e.type = "4", e.$options = J(e.html).find("input[type=text]"); break; case "match": e.type = "24", e.match = J(".answer tr td.text").map(((e, t) => removeHtml(J(t).html()))).get(), e.$options = J(".answer tr td.control select"), e.selects = J(".answer tr td.control select").map(((e, t) => [ J(t).find("option").map(((e, t) => ({ value: J(t).val(), text: J(t).text() }))).get() ])).get(); case "essay": e.type = "4", e.$options = J(e.html).find("iframe"); break; case "multianswer": e.type = "14"; let t = J(e.html).find(".formulation").clone(); t.find(".subquestion").remove(), t.find(".accesshide").remove(), e.question = removeHtml(t.html()); let n = []; J(e.html).find(".subquestion").map(((e, t) => { let a = J(t).find("select>option").map(((e, t) => removeHtml(J(t).html()))).get(); a = a.filter((e => "" !== e)), n.push(a), J(t).find("select>option:selected").map(((e, t) => removeHtml(J(t).html()))).get(); })), e.$options = J(e.html).find("select"), e.options = n; break; case "description": return; } return e; }, setAnswer: e => { switch (e.type) { case "4": return J(e.html).find("input.form-control").each((function(t, n) { J(n).val(e.answer[t]); })), J(e.html).find("iframe:eq(0)").contents().find("body").html(e.answer[0]), !1; case "3": e.ques.$options.each(((t, n) => { const a = J(n).parent().find("label").text(); return "object" == typeof e.answer && (e.answer = e.answer[0]), isTrue(e.answer) && isTrue(a) ? (J(n).click(), !1) : !isFalse(e.answer) || !isFalse(a) || (J(n).click(), !1); })); case "14": return J(e.html).find("select").each(((t, n) => { const a = e.answer[t]; J(n).find(`option:contains("${a}")`).prop("selected", !0); })), !1; default: return !0; } }, finish: e => { J(".submitbtns .btn-primary").click(); } }, { type: "ask", name: "\u56fd\u5f00\u4e13\u9898\u6d4b\u9a8c", match: () => /\/exam\/([0-9]+)\/subjects/i.test(location.pathname) && !/\/exam\/([0-9]+)\/subjects#\/submission\/([0-9]+)/i.test(location.href), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9", "14", "24" ], question: { html: "li.subject", question: ".summary-title .subject-description", options: ".subject-options li .option-content", type: ".summary-sub-title span:eq(0)", workType: "guokai", pageType: "guokai" }, init: async () => { await waitUntil((function() { return J(".loading-gif").hasClass("ng-hide") && "" === J(".hd .examinee .submit-label").eq(0).text(); })), await waitUntil((function() { return 0 !== J("li.subject").length; })); }, ischecked: e => Boolean(e.parent().find("input").eq(-1).prop("checked")), questionHook: e => { const t = ce.angular.element(e.html).scope(), n = t.subject; if ("text" === n.type) return; e.type = typeConvert(Oe[n.type]); let a = J(`
${n.description}
`).clone(); switch (a.find("span.__blank__").remove(), e.question = removeHtml(a.html()), n.options = n.options.sort(((e, t) => e.sort - t.sort)), e.options = n.options.map((e => removeHtml(e.content))), e.type, n.type, n.type) { case "cloze": e.options = n.sub_subjects.map((e => e.options.map((e => removeHtml(e.content))))), e.$options = J(e.html).find("select"); case "true_or_false": e.options = []; } return e.subject = n, e.scope = t, e; }, setAnswer: e => { switch (e.ques, e.type) { case "2": return J(e.html).find(".___answer"), J(e.html).find(".___answer").each(((t, n) => { J(n).html(e.answer[t]), e.ques.scope.subject.answers[t].content = e.answer[t], e.ques.scope.onChangeSubmission(e.ques.subject); })), !1; case "4": return J(e.html).find(".simditor-body.needsclick>p").each((function(t, n) { J(n).html(e.answer[t]), e.ques.subject.answered_content = e.answer[t]; })), e.ques.scope.onChangeSubmission(e.ques.subject), !1; case "14": return e.ques.subject.sub_subjects.forEach(((t, n) => { let a = e.answer[n]; t.options.forEach(((i, o) => { i.content === a && (t.answeredOption = String(i.id), e.ques.scope.onChangeSubmission(t), J(e.html).find(`input[value="${i.id}"]`).click(), J(e.html).find(`button:eq(${n})>span:eq(1)`).text(a)); })); })), !1; } return !0; } }, { type: "save", name: "\u4e0a\u6d77\u5f00\u653e\u6536\u5f55", match: () => "l.shou.org.cn" === location.host && location.href.includes("assignment/history.aspx?homeWorkId"), question: { html: ".e-q-body", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "shou", pageType: "shou" }, init: async () => {}, answerHook: e => { e.$options = J(e.html).find("ul>li"); let t = J(e.html).find("ul>li.checked").map(((e, t) => removeHtml(J(t).find(".ErichText").html() || J(t).html()))).get(); const n = J(e.html).find(".e-q-right").length > 0; e.answer = t.filter((e => "" !== e)); let a = J(e.html).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(J(t).html()))).get().map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })).filter((e => "" !== e && void 0 !== e)); switch (e.options = removeStartChar(e.options), J(e.html).attr("data-questiontype")) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.answer = J(e.html).find("ul>li.checked").map(((e, t) => removeHtml(J(t).html()))).get(), e.options = [], isTrue(e.answer[0]) ? e.answer = [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? e.answer = [ "\u9519\u8bef" ] : e.answer = []; break; case "8": e.type = "15"; const t = J(e.html).find(".e-q-quest form").map(((e, t) => { let n = removeHtml(J(t).find(".e-q-q .ErichText").html()), a = J(t).find("ul>li").map(((e, t) => removeHtml(J(t).find(".ErichText").html() || J(t).html()))).get(), i = "0"; a = removeStartChar(a); const o = J(t).find(".e-a-right").length > 0, s = J(t).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(J(t).html()))).get(); let r = s.map((e => { let t = e.charCodeAt() - 65; return a[t]; })).filter((e => "" !== e && void 0 !== e)); if (2 === a.length && 1 === s.length) { let e = judgeAnswer(s[0]); e.length > 0 && (r = e, a = [], i = "3"); } return r.length > 1 && (i = "1"), { question: n, options: a, answer: r, isT: o, type: i }; })).get(); if (t.some((e => !e.isT))) return; a = t.map((e => e.answer)).flat(), e.options = t.map((e => ({ question: e.question, options: e.options, type: e.type }))); break; case "11": e.type = "19"; const n = J(e.html).find("form").map(((e, t) => ({ type: "0", question: removeHtml(J(t).find(".e-q-q .ErichText").html()), options: J(t).find("ul li .ErichText").map(((e, t) => removeHtml(J(t).html()))).get() }))).get(); a = a.length > 0 ? judgeAnswer(a[0]) : [], e.options = n; break; default: return void J(e.html).attr("data-questiontype"); } return a.length > 0 ? (e.answer = a, e) : !n && "3" === e.type && e.answer.length > 0 || !n ? void 0 : e; }, paper: async e => { const t = { platform: "shou" }, n = J("input[name=CourseOpenId]").val(), a = J("input[name=WorkId]").val(); await request("https://l.shou.org.cn/student/CourseScoreNew-inside.aspx", "GET").then((e => { const a = J(e[0].responseText); t.name = a.find(`#courseSelect>option[data-xid="${n}"]`).text().trim(), t.info = {}; })), t.hash = n, t.info = {}, t.chapter = [ { hash: `${a}`, name: J(".mark_title").text().trim(), question: e } ], Te.setPaper(t.hash, t); } }, { type: "ask", name: "\u4e0a\u6d77\u5f00\u653e\u4f5c\u4e1a", tips: "", match: () => "l.shou.org.cn" === location.host && (location.href.includes("assignment/preview.aspx?homeWorkId") || location.href.includes("study/assignment/continuation.aspx")), types: [ "0", "1", "3" ], question: { html: ".e-q-body", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "shou", pageType: "shou" }, init: async () => { await waitUntil((function() { return 0 !== J(".e-q-body").length; })); }, ischecked: isParentChecked, questionHook: e => { switch (J(e.html).attr("data-questiontype")) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.$options = J(e.html).find("ul>li"); break; case "8": e.type = "15", e.quesList = J(e.html).find("form").map(((e, t) => ({ type: "0", question: removeHtml(J(t).find(".e-q-q .ErichText").html()), options: J(t).find("ul li .ErichText").map(((e, t) => removeHtml(J(t).html()))).get() }))).get(); break; default: return void J(e.html).attr("data-questiontype"); } return e; } } ], ze = [ { type: "ask", name: "\u6210\u6559\u4e91\u8003\u8bd5", tips: "", match: () => location.href.includes("student/exam/resource/paper_card"), types: [ "0", "1", "3" ], question: { html: ".ui-question", question: ".ui-question-content-wrapper", options: ".ui-question-options li .ui-question-content-wrapper", type: ".ui-question-group-title", workType: "chengjiaoyun", pageType: "chengjiaoyun" }, init: async () => { if (await waitUntil((function() { return isExist(".ui-question"); })), !ce.top.location.href.includes("student/exam2/doexam")) return !1; }, toquestion: async e => { J(ce.top.document).find(".ui-card-questions ul li:eq(" + e + ")").click(); }, next: async () => { J("#next-btn").click(); }, ischecked: e => e.hasClass("ui-option-selected"), questionHook: e => { if (e.type = typeMatch(J(e.html).parent().find(".ui-question-group-title").text()), e.$options = J(e.html).find(".ui-question-options li>span"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).parent().html())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).parent().html())) && J(n).click(); })), !1; } return !0; } }, { type: "save", name: "\u6210\u6559\u4e91\u6536\u5f55", match: () => location.href.includes("student/exam/resource/paper_card"), question: { html: ".ui-question", question: ".ui-question-content-wrapper", options: ".ui-question-options li .ui-question-content-wrapper", type: ".ui-question-group-title", workType: "chengjiaoyun", pageType: "chengjiaoyun" }, init: async () => { if (await waitUntil((function() { return isExist(".ui-question"); })), ce.top.location.href.includes("student/exam2/doexam")) return !1; }, answerHook: e => { if (e.type = typeMatch(J(e.html).parent().find(".ui-question-group-title").text()), e.$options = J(e.html).find(".ui-question-options li>span"), e.answer = J(e.html).find(".ui-question-options li.ui-correct-answer .ui-question-content-wrapper").map(((e, t) => removeHtml(J(t).html()))).get(), "3" === e.type) e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []; return e; } } ], Pe = [ { type: "hook", name: "hook", match: () => "xuexi.jsou.cn" === location.host && location.href.includes("newHomework/showHomeworkByStatus") && location.href.includes("checked=true"), main: e => { ce.mainClass = J("#homeworkHistory").find(".active").attr("id"); let t = new MutationObserver((async e => { ce.mainClass !== J("#homeworkHistory").find(".active").attr("id") && (ce.mainClass = J("#homeworkHistory").find(".active").attr("id"), await waitUntil((function() { return 0 === J(".layui-layer-shade").length; })), vuePageChange(), t.disconnect()); for (let n of e) "attributes" === n.type && "class" === n.attributeName && n.target.textContent && (n.target.textContent.includes("\u4e0b\u4e00\u9898") || n.target.textContent.includes("\u4e0a\u4e00\u9898")) && (t.disconnect(), vuePageChange()); })); J("body").length >= 1 && t.observe(J("body")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u6c5f\u82cf\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => "xuexi.jsou.cn" === location.host && location.href.includes("/showHomeworkByStatus") && location.href.includes("checked=false"), types: [ "0", "1", "2", "3" ], question: { html: ".insert", question: ".window-title", options: ".questionId-option li > div:not(.numberCover)", type: ".questionDiv >div:eq(0)", workType: "jsou", pageType: "jsou" }, init: async () => { document.addEventListener("copy", (function(e) { e.stopImmediatePropagation(), layer.msg("\u590d\u5236\u6210\u529f", { icon: 4 }), e.clipboardData.setData("text/plain", window.getSelection().toString()); })), document.addEventListener("paste", (() => { event.stopImmediatePropagation(); let e = (event.clipboardData || window.clipboardData).getData("text"); layer.msg("\u7c98\u8d34\u6210\u529f", { icon: 4 }), document.execCommand("insertText", !1, e); })); }, ischecked: isParentChecked, questionHook: e => (e.type = J(e.html).find(".questionDiv >div:eq(1)").text().trim(), e.type = typeConvert(e.type), e.$options = J(e.html).find(".questionId-option li .numberCover"), "3" == e.type && (e.options = []), e), setAnswer: e => { switch (e.type) { case "2": if (e.$options = J(e.html).find(".questionTitle input"), e.$options.length == e.answer.length) return e.$options.each(((t, n) => { J(n).val(e.answer[t]); })), !1; break; case "3": let t = e.answer; return J(e.html).find(".questionId-option>.default-option").each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).find(".option-title>div:eq(1)").html())) && J(n).find("div.numberCover").click(), isFalse(t) && isFalse(removeHtml(J(n).find(".option-title>div:eq(1)").html())) && J(n).find("div.numberCover").click(); })), !1; case "4": const n = J(e.html).find(".jianda-answer>div").attr("id"); return ce.UE.getEditor(`${n}`).setContent(e.answer), !1; } return !0; } }, { type: "save", name: "\u6c5f\u82cf\u5f00\u653e\u5927\u5b66\u6536\u5f55", match: () => "xuexi.jsou.cn" === location.host && location.href.includes("newHomework/showHomeworkByStatus") && location.href.includes("checked=true"), question: { html: ".insert", question: ".window-title", options: "#questionId-option li > div:not(.numberCover)", type: ".questionDiv >div:eq(0)", workType: "jsou", pageType: "jsou" }, init: async () => {}, answerHook: e => { const t = J(e.html).find(".questionDiv >div").text(), n = t.match(/\u5206\u503c(\d+)\u5206/), a = t.match(/\u5f97\u5206\uff1a(\d+)/); if (!n || !a) return null; e.type = typeConvert(J(e.html).find(".questionDiv >div:eq(1)").text()); if (!(n[1] === a[1] && "0" !== a[1]) && "3" !== e.type) return null; switch (e.type) { case "0": case "1": case "3": if (e.answer = J(e.html).find(".answer .correctAnswer").text().trim().split("\uff1b").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = e.answer.filter((e => e)), 0 == e.answer.length && (e.answer = J(e.html).find(".answer .studentAnswer").text().trim().split("\uff1b").map((t => e.options[t.charCodeAt(0) - 65]))), e.answer = e.answer.filter((e => e)), 3 == e.type) { e.options = []; let t = e.answer[0]; if (isFalse(t)) e.answer = "\u9519\u8bef"; else { if (!isTrue(t)) return; e.answer = "\u6b63\u786e"; } } break; case "2": e.options = [], e.answer = J(e.html).find(".answer .correctAnswer").text().trim().split("\uff1b"), e.answer = e.answer.filter((e => e)), 0 == e.answer.length && (e.answer = J(e.html).find(".answer .studentAnswer").text().trim().split("\uff1b")), e.answer = e.answer.filter((e => e)); break; default: return; } return e; }, paper: e => { const t = ce.homework, n = { platform: "jsou" }; n.hash = t.courseId, n.name = t.courseName, n.info = {}, n.chapter = [ { hash: `${t.homeworkId}`, name: t.title, question: e } ], Te.setPaper(n.hash, n); } } ], Le = [ { type: "hook", name: "hook", match: "spoc-exam.icve.com.cn" === location.host || location.host.includes("exam.courshare.cn") || location.host.includes("webtrn.cn"), main: e => { ce.mainClass = J(".q_content").first().attr("id"); let t = new MutationObserver((async e => { ce.mainClass !== J(".q_content").first().attr("id") && (ce.mainClass = J(".q_content").first().attr("id"), "homework-detail-container" === ce.mainClass && await waitUntil((function() { return 0 !== J(".q_content").length; })), vuePageChange(), t.disconnect()); for (let n of e) "attributes" === n.type && "class" === n.attributeName && n.target.textContent && (n.target.textContent.includes("\u4e0b\u4e00\u9898") || n.target.textContent.includes("\u4e0a\u4e00\u9898")) && (t.disconnect(), vuePageChange()); })); J("#examPage").length >= 1 && t.observe(J("#examPage")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "hook", name: "hook", match: "zjy2.icve.com.cn" === location.host || "zyk.icve.com.cn" === location.host || "ai.icve.com.cn" === location.host, main: e => { J(".minimized-dialog img").css({ "z-index": "999999" }); observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.name), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 !== J(".q_content").length; })); } }); } }, { type: "ask", name: "\u804c\u6559\u4e91\u4f5c\u4e1a", tips: "", match: () => location.href.includes("examflow_index.action"), types: [ "0", "2", "1", "3", "4" ], question: { html: ".q_content", question: ".divQuestionTitle", options: ".questionOptions > div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".q_content").length; })); }, finish: e => { J('.paging_next:contains("\u4e0b\u4e00\u9875")').click(); }, ischecked: e => 0 !== e.parent().find(".checkbox_on").length, questionHook: e => { var t, n; e.question = removeHtml(J(e.html).find(".divQuestionTitle").html()); let a = J(e.html).find("[name='quesId']").attr("id"), i = null == (n = null == (t = document.getElementById(`questionId[${a}]`)) ? void 0 : t.getAttribute("answertype")) ? void 0 : n.trim(), o = J(e.html).find("span[name^='questionIndex']").text().trim() + "\u3001", s = J(e.html).find(".q_score").text().trim(); switch (e.question = e.question.replace(o, "").replace(s, "").trim(), e.options = J(e.html).find(".questionOptions>div").map(((e, t) => { let n = J(t).find(".option_index").text().trim(); return removeHtml(J(t).html()).replace(n, "").trim(); })).get(), e.$options = J(e.html).find(".questionOptions>div input"), i) { case "\u5355\u9879\u9009\u62e9\u9898": case "\u5355\u9009\u9898": case "singlechoice": e.type = "0"; break; case "\u591a\u9879\u9009\u62e9\u9898": case "\u591a\u9009\u9898": case "multichoice": e.type = "1"; break; case "\u5224\u65ad\u9898": case "bijudgement": e.type = "3", e.options = []; break; case "fillblank": e.type = "2", e.question = removeHtml(J(e.html).find("[name='fillblankTitle']").html()); break; case "cloze": e.type = "14", e.options = J(e.html).find(".questionOptions>.exam_cloze_choice").map(((e, t) => [ J(t).find(".optionContent").map(((e, t) => removeHtml(J(t).html()))).get() ])).get(); break; case "textarea": e.type = "4", e.options = []; } return e; }, setAnswer: e => { switch (e.type) { case "2": return J(e.html).find(".fillblank_input > input").each(((t, n) => { J(n).val(e.answer[t]); })), !1; case "3": let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).parent().html())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).parent().html())) && J(n).click(); })), !1; case "4": let n = J(e.html).find("[name='quesId']").attr("id"); return ce.UE.getEditor(`_baidu_editor_${n}`).setContent(`

${e.answer}

`), !1; } return !0; } }, { type: "save", name: "\u804c\u6559\u4e91\u6536\u5f55", match: () => location.href.includes("examrecord_recordDetail.action"), question: { html: ".q_content", question: ".divQuestionTitle", options: ".questionOptions>div.q_option_readonly", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".q_content").length; })); }, answerHook: e => { const t = J(e.html).find(".exam.icon_examright").length, n = J(e.html).find("input[name='quesId']:not([id='']").attr("id"), a = J(`input#qId${n}`).attr("qtype"), i = J(e.html).find("span[name^='questionIndex']").text().trim() + "\u3001", o = J(e.html).find(".q_score").text().trim(); switch (e.question = e.question.replace(i, "").replace(o, "").trim(), e.options = J(e.html).find(".questionOptions>div.q_option_readonly").map(((e, t) => { let n = J(t).find("span[name='optionIndexName']").text().trim(); return removeHtml(J(t).html()).replace(n, "").trim(); })).get(), a) { case "\u5355\u9879\u9009\u62e9\u9898": case "\u5355\u9009\u9898": case "singlechoice": e.type = "0"; break; case "\u591a\u9879\u9009\u62e9\u9898": case "\u591a\u9009\u9898": case "multichoice": e.type = "1"; break; case "\u5224\u65ad\u9898": case "bijudgement": e.type = "3"; break; case "fillblank": case "\u586b\u7a7a\u9898": e.type = "2"; const t = J(e.html).find(".answerOption>span:eq(0)").clone(); t.find(".exam_answers").remove(), e.question = titleClean(removeHtml(t.html())).replace(/\uff08.*?\u5206\uff09/g, "").trim(); break; case "cloze": case "\u5b8c\u5f62\u586b\u7a7a": e.type = "14", e.options = J(e.html).find(".questionOptions>.exam_cloze_choice").map(((e, t) => [ J(t).find(".optionContent").map(((e, t) => removeHtml(J(t).html()))).get() ])).get(), e.answer = J(e.html).find(".exam_rightAnswer .answer_table .one_answer>span").map(((t, n) => { const a = J(n).text().trim(); return e.options[t][a.charCodeAt(0) - 65]; })).get(); break; case "textarea": e.type = "4", e.options = [], e.answer = removeHtml(J(e.html).find(".exam_rightAnswer .has_standard_answer").html()); } switch (e.type) { case "0": case "1": if (e.answer = J(e.html).find('.exam_rightAnswer .exam_answers_tit>span[name="rightAnswer"]').text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer, 0 == e.answer.length) { if (0 == t) return; e.answer = J(e.html).find('.exam_stu_answer span[name="stuAnswer"]').text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])); } break; case "2": e.answer = 0 == t ? J(e.html).find(".exam_rightAnswer span.fillblank_answer").map(((e, t) => removeHtml(J(t).html()))).get() : J(e.html).find(".exam_stu_answer span.fillblank_answer").map(((e, t) => removeHtml(J(t).html()))).get(), e.answer; break; case "3": e.options = []; let n = J(e.html).find('.exam_stu_answer span[name="stuAnswer"]').text().trim(); [ "\u6b63\u786e", "\u9519\u8bef" ].includes(n) && t && (e.answer = [ n ]); } return e; } }, { type: "save", name: "\u667a\u6167\u804c\u6559\u6536\u5f55", match: () => "zjy2.icve.com.cn" === location.host && (location.href.includes("/spocviewsJob") || location.href.includes("/viewExam")), question: { html: ".subjectDet", question: ".seeTitle .htmlP.ql-editor", options: ".optionList .htmlP.ql-editor", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".subjectDet").length; })); }, answerHook: e => { const t = J(e.html).find(".xvhao").text().trim(); e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")); let n = J(e.html).find(".answer").text().trim(); switch (e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "2": e.options = [], e.answer = J(e.html).find(".answer>span").map(((e, t) => removeHtml(J(t).html()))).get(); break; case "3": e.options = J(e.html).find(".optionList>div").map(((e, t) => removeHtml(J(t).html()))).get(), e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = judgeAnswer(e.answer[0]), e.options = []; break; case "11": const t = J(e.html).find(".optionList .matching>.htmlP.ql-editor").map(((e, t) => removeHtml(J(t).html()))).get(), a = J(e.html).find(".optionList>.text .htmlP.ql-editor").map(((e, t) => removeHtml(J(t).html()))).get(); e.options = [ t, a ]; let i = {}; n = J(e.html).find(".answer>span").map(((e, n) => { let [o, s] = J(n).text().trim().split("."); o.charCodeAt(0) >= 65 ? o = (o.charCodeAt(0) - 65).toString() : /^\d+$/.test(o) && (o = (parseInt(o) - 1).toString()), s.charCodeAt(0) >= 65 ? s = (s.charCodeAt(0) - 65).toString() : /^\d+$/.test(s) && (s = (parseInt(s) - 1).toString()), i[t[o]] = a[s]; })), e.answer = i; } return e; } }, { type: "ask", name: "\u667a\u6167\u804c\u6559+\u7b54\u9898", tips: "\u8be5\u5e73\u53f0\u95ee\u9898\u8f83\u591a\uff0c\u9047\u5230\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.href.includes("coursePreview/jobTest") || location.href.includes("spockeepTest") || location.href.includes("spocjobTest"), types: [ "0", "1", "3" ], question: { html: ".subjectDet", question: ".ql-editor", options: ".optionList .ql-editor", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".subjectDet").length; })); }, ischecked: e => e.parent().parent().parent().hasClass("is-checked"), questionHook: e => { const t = J(e.html).find(".title.titleTwo").text().trim(); if (e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")), "3" === e.type) e.options = [], e.$options = J(e.html).find(".optionList>div label"); return e; } }, { type: "save", name: "\u667a\u6167\u804c\u6559+\u6536\u5f55", match: () => "zyk.icve.com.cn" === location.host && (location.href.includes("/coursePreview/viewJob1") || location.href.includes("/viewExam")), question: { html: ".subjectDet", question: ".seeTitle>span:eq(1)", options: ".optionList>div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".subjectDet").length; })); }, answerHook: e => { e.options = removeStartChar(e.options); const t = J(e.html).find(".xvhao").text().trim(); e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")); let n = J(e.html).find(".answer").text().trim(); switch (e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "2": e.options = [], e.answer = J(e.html).find(".answer>span").map(((e, t) => removeHtml(J(t).html()))).get(); break; case "3": e.options = J(e.html).find(".optionList>div").map(((e, t) => removeHtml(J(t).html()))).get(), e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = judgeAnswer(e.answer[0]), e.options = []; } return e; } }, { type: "save", name: "ai\u4f18\u8bfe\u6536\u5f55\u65b0", match: () => "ai.icve.com.cn" === location.host && location.href.includes("/review-exam/"), question: { html: () => { let e = J(".examination-paper")[0].__vue__.sjAllInfo.questions, t = []; return e.sort(((e, t) => e.txdm - t.txdm)), e.forEach((e => { t.push(e); })), t; }, question: ".seeTitle>span:eq(1)", options: ".optionList>div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".examination-paper")[0].__vue__.sjAllInfo.questions.length; })); let e = J(".examination-paper")[0].__vue__.sjAllInfo.questions, t = []; e.sort(((e, t) => e.txdm - t.txdm)), e.forEach((e => { t.push(e); })), ce.quesList = t; }, answerHook: (e, t) => { const n = e.html; e.type = typeMatch(n.type), e.question = titleClean(n.tmmc); let a = []; switch (e.type) { case "3": "1" == n.answer && (e.answer = [ "\u6b63\u786e" ]), "0" == n.answer && (e.answer = [ "\u9519\u8bef" ]); break; case "2": e.answer = n.answer.split(","); break; case "4": e.answer = n.answer; break; case "0": case "1": e.options = n.sjtmxxlist.map((e => ("1" == e.sfzqda && a.push(removeHtml(e.xxnr)), removeHtml(e.xxnr)))), e.answer = a; } return e; }, paper: async e => {} }, { type: "ask", name: "ai\u4f18\u8bfe\u7b54\u9898", tips: "", match: () => "ai.icve.com.cn" === location.host && location.href.includes("/preview-exam/"), types: [ "0", "1" ], question: { html: () => { let e = J(".examination-paper")[0].__vue__.tmActivelist, t = []; return e.sort(((e, t) => e.px - t.px)), e.forEach((e => { t.push(e); })), t; }, question: ".seeTitle>span:eq(1)", options: "label", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".examination-paper")[0].__vue__.tmActivelist.length; })); }, toquestion: e => { J(".topic-zpx-list .topic-zpx-main span:eq(" + e + ")").click(); }, ischecked: e => e.hasClass("wrongXz"), questionHook: e => { var t; const n = e.html, a = J(".examination-paper")[0].__vue__.topList, i = []; Object.keys(a).forEach((e => { a[e].forEach((t => { i.push({ id: t.id, type: t.txdmmc || e }); })); })); const o = (null == (t = i.find((e => e.id === n.id))) ? void 0 : t.type) || "\u5176\u4ed6"; e.type = typeMatch(o), e.question = titleClean(n.title); const s = n.dataArr.map((e => removeHtml(e.Content))); return e.options = s, e.answer = [], e.html = J(".content-center"), e.$options = () => J("label"), e; } } ], Me = [ { type: "ask", name: "\u5ddd\u519c\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.host.includes("cnzx.info") && location.href.includes("KaoShi/ShiTiYe.aspx"), types: [ "0", "1", "3" ], question: { html: "li.question", question: ".wenti >p.stem", options: ".wenti > ol > li", type: ".question_head > span:eq(0)", workType: "cnzx", pageType: "cnzx" }, init: async () => {}, ischecked: e => e.find("input").prop("checked"), questionHook: e => (e.$options = J(e.html).find(".wenti > ol > li input"), 0 !== e.options.length && (e.type = "radio" === e.$options.eq(0).attr("type") ? "0" : "1", 2 === e.options.length && e.options.includes("\u6b63\u786e") && e.options.includes("\u9519\u8bef") && (e.type = "3", e.options = [])), e), setAnswer: e => "3" !== e.type || (J(e.html).find(".wenti > ol > li").each(((t, n) => { isTrue(e.answer) && isTrue(removeHtml(J(n).html())) && e.ques.$options.eq(t).click(), isFalse(e.answer) && isFalse(removeHtml(J(n).html())) && e.ques.$options.eq(t).click(); })), !1), finish: e => { J("li.paginationjs-next.J-paginationjs-next").click(); } }, { type: "save", name: "\u5ddd\u519c\u5728\u7ebf\u6536\u5f55", match: () => location.host.includes("cnzx.info") && location.href.includes("ZaiXianLianXi.aspx"), question: { html: ".ShiTi>.ShiTiMiaoShu", question: ".ShiTiMiaoShu", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "cnzx", pageType: "cnzx" }, init: async () => {}, answerHook: e => { J(e.html).text(), e.question = removeHtml(titleClean(removeHtml(J(e.html).html()))); let t = J("ul.TiXing>li.DangQianTiXing:eq(0)>a").text(), n = [], a = J(e.html).next(); switch (e.options = removeStartChar(a.find("ul li").map(((e, t) => (J(t).hasClass("DaAn1") && n.push(e), titleClean(removeHtml(J(t).html()))))).get()), e.answer = n.map((t => e.options[t])), t) { case "\u5355\u9009\u9898": case "\u8bcd\u6c47\u4e0e\u7ed3\u6784": case "\u4ea4\u9645\u7528\u8bed": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.type = "3", e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []; } return e; } } ], $e = [ { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u65e7\u7248)", tips: "", match: () => location.href.includes("study/html/content/studying/?courseOpenId=") || location.href.includes("study/html/content/sxsk/?courseOpenId=") || location.href.includes("study/html/content/tkOnline/?courseOpenId=") || location.href.includes("study/html/content/bkExam/?courseOpenId="), types: [ "0", "1", "3" ], question: { html: ".e-q-body>.e-q", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".e-q-body>.e-q") && isExist(".e-item"); })), !isExist(".photo-time") && !isExist(".btn_save")) return !1; }, ischecked: e => e.parent().hasClass("checked"), questionHook: e => { var t; const n = J(e.html).parent().parent(); switch (e.type = n ? null == (t = n.attr("id")) ? void 0 : t.trim() : "", e.type) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.$options = J(e.html).find("ul>li"); break; case "4": e.type = "2"; break; case "5": e.type = "4"; break; default: e.type, e.type = "8"; } return e; }, setAnswer: e => { switch (e.type) { case "4": case "2": return J(e.html).find("textarea.answer-input").focus(), J(e.html).find(" textarea.answer-input"), J(e.html).find(".answer-input.edui-default").each(((t, n) => { let a = J(n).attr("id"), i = ce.UE.getEditor(a); i.ready((function() { i.setContent(`

${e.answer[t]}

`); })); })), J(e.html).find(".answer-input").blur(), !1; } return !0; } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u65e7\u7248)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("study/html/content/studying/?courseOpenId=") || location.href.includes("study/html/content/sxsk/?courseOpenId=") || location.href.includes("study/html/content/tkOnline/?courseOpenId=") || location.href.includes("study/html/content/bkExam/?courseOpenId="), question: { html: ".e-q-body>.e-q", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".e-save"), isExist(".e-q-body>.e-q") && isExist(".w_e-q-panel"); })), !isExist(".e-quest-review")) return !1; }, answerHook: e => { var t; const n = J(e.html).parent().parent(); e.type = n ? null == (t = n.attr("id")) ? void 0 : t.trim() : "", e.$options = J(e.html).find("ul>li"); let a = J(e.html).find("ul>li.checked").map(((e, t) => removeHtml(J(t).find(".ErichText").html()))).get(); const i = J(e.html).find(".e-q-right").length > 0; e.answer = a.filter((e => "" !== e)); let o = J(e.html).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(J(t).html()))).get(); 1 === o.length && o[0].length > 1 && (o = o[0].split("\u3001")); let s = o.map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })).filter((e => "" !== e && void 0 !== e)); switch (e.type) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.answer = J(e.html).find("ul>li.checked").map(((e, t) => removeHtml(J(t).html()))).get(), e.options = [], isTrue(e.answer[0]) ? e.answer = [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? e.answer = [ "\u9519\u8bef" ] : e.answer = []; break; case "4": e.type = "2", e.options = []; break; case "5": e.type = "4", s = [ removeHtml(J(e.html).find(".e-ans-ref>.e-ans-r").html()) ], e.options = []; break; case "11": e.type = "19"; const t = J(e.html).find("form").map(((e, t) => ({ type: "0", question: removeHtml(J(t).find(".e-q-q .ErichText").html()), options: J(t).find("ul li .ErichText").map(((e, t) => removeHtml(J(t).html()))).get() }))).get(); s = s.length > 0 ? judgeAnswer(s[0]) : [], e.options = t; default: return void e.type; } if (s.length > 0) return e.answer = s, e; if (!i && "3" === e.type && e.answer.length > 0) { if (e.answer = function(e) { if (!isTrue(e[0]) && !isFalse(e[0])) return e[0], []; return isTrue(e[0]) ? [ "\u9519\u8bef" ] : isFalse(e[0]) ? [ "\u6b63\u786e" ] : []; }(e.answer), 0 === e.answer.length) return; } else if (!i) return; return e; }, paper: e => { const t = ce.online, n = { platform: "ahjxjy" }; n.hash = t.courseOpenId, n.name = ce.localStorage.courseNmae, n.info = {}, n.chapter = [ { hash: `${t.cell.id}`, name: t.cell.title, question: e } ], Te.setPaper(n.hash, n); } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u65b0\u7248)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("/myHomework/answerRecord") || location.href.includes("/myHomework/assignment") || location.href.includes("/myExam/examDetails") || location.href.includes("/myExam/examHistory"), question: { html: ".option>div[id='answer-card-area']", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { await waitUntil((function() { return isExist(".option>div[id='answer-card-area']"); })); }, answerHook: (e, t) => { const n = J("micro-app-body>#app>div")[0].__vue__.hierarchyList[t]; e.type = typeMatch(n.name), e.question = titleClean(removeHtml(n.Content)); const {options: a, answer: i} = n.CourseQuestionOptionList.reduce(((e, t) => { const n = removeHtml(t.Content); return t.IsAnswer && e.answer.push(n), e.options.push(n), e; }), { options: [], answer: [] }); return e.options = a, e.answer = "3" === e.type ? [ judgeAnswer(i[0]) ] : i, "3" === e.type && (e.options = []), e; } }, { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u65b0\u7248)", tips: "\u5355\u9898\u95f4\u9694\u5fc5\u987b\u5927\u4e8e 3 \u79d2\uff01\uff01\u5426\u5219\u5bb9\u6613\u5f02\u5e38\uff01\uff01", match: () => location.href.includes("/myHomework/assignment") || location.href.includes("/myExam/examDetails"), types: [ "0", "1", "3" ], minDelay: 3e3, answerDelay: 1e3, question: { html: ".option>div[id='answer-card-area']", question: ".ErichText", options: "ul.answer-list>li", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".option>div[id='answer-card-area']"); })), !J(".submit-area").text().includes("\u63d0\u4ea4")) return !1; const e = J("micro-app-body>#app>div")[0].__vue__, t = e.hierarchyList[0]; e.goAnchor(t.Id); }, toquestion: e => { const t = J("micro-app-body>#app>div")[0].__vue__, n = t.hierarchyList[e]; (null == n ? void 0 : n.Id) && t.goAnchor(n.Id); }, ischecked: e => e.hasClass("on"), questionHook: (e, t) => { const n = J("micro-app-body>#app>div")[0].__vue__.hierarchyList[t]; e.type = typeMatch(n.name), e.question = titleClean(removeHtml(n.Content)); let a = []; return n.CourseQuestionOptionList.forEach((e => { const t = removeHtml(e.Content); e.IsAnswer, a.push(t); })), e.options = a, e.html = "body", e.$options = () => J("ul.answer-list>li"), e; } }, { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u81ea\u8003)", tips: "", match: () => location.href.includes("/userinfo/testPaper"), types: [ "0", "1", "3" ], question: { html: ".item-card-area", question: ".desc", options: "ul>li", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".exam-paper-wrap"); })), isExist(".exam-process-area")) return !1; const e = J(".exam-paper-wrap")[0].__vue__.topicList.map((e => e.getPaperList)).flat(); window.Zques = e; }, ischecked: e => e.parent().hasClass("checked"), questionHook: (e, t) => { const n = Zques[t]; e.type = typeMatch(n.questionTypeName), e.question = titleClean(removeHtml(n.content)); const {options: a, answer: i} = n.courseQuestionOptionList.reduce(((e, t) => { const n = removeHtml(t.content); return t.isAnswer && e.answer.push(n), e.options.push(n), e; }), { options: [], answer: [] }); return e.options = a, e.answer = "3" === e.type ? [ judgeAnswer(i[0]) ] : i, "3" === e.type && (e.options = []), e; }, setAnswer: e => { switch (e.type) { case "4": case "2": return J(e.html).find("textarea.answer-input").focus(), J(e.html).find(" textarea.answer-input"), J(e.html).find(".answer-input.edui-default").each(((t, n) => { let a = J(n).attr("id"), i = ce.UE.getEditor(a); i.ready((function() { i.setContent(`

${e.answer[t]}

`); })); })), J(e.html).find(".answer-input").blur(), !1; } return !0; } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u81ea\u8003)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("/userinfo/testPaper"), question: { html: ".item-card-area", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".exam-paper-wrap"); })), !isExist(".score-describe")) return !1; const e = J(".exam-paper-wrap")[0].__vue__.topicList.map((e => e.getPaperList)).flat(); window.Zques = e; }, answerHook: (e, t) => { const n = Zques[t]; e.type = typeMatch(n.questionTypeName), e.question = titleClean(removeHtml(n.content)); const {options: a, answer: i} = n.courseQuestionOptionList.reduce(((e, t) => { const n = removeHtml(t.content); return t.isAnswer && e.answer.push(n), e.options.push(n), e; }), { options: [], answer: [] }); return e.options = a, e.answer = "3" === e.type ? [ judgeAnswer(i[0]) ] : i, "3" === e.type && (e.options = []), e; } } ], Fe = [ { type: "save", name: "\u9752\u4e66\u4f5c\u4e1a\u7b54\u9898\u6536\u5f55", match: () => location.host.includes("qingshuxuetang.com") && (location.href.includes("Student/ExercisePaper?courseId=") || location.href.includes("Student/ViewQuiz?quizId=") || location.href.includes("Student/SimulationExercise/Detail?id=") || location.href.includes("Student/Quiz/Detail?id=")), question: { html: ".paper-container > .question-detail-container", question: ".question-detail-description", options: ".question-detail-options .question-detail-option .option-description-preview", type: ".question-detail-type-desc", workType: "qingshu", pageType: "qingshu" }, init: async () => { await waitUntil((function() { return isExist(".question-detail-container") && ce.qsques; })); }, answerHook: (e, t) => { const n = ce.qsques[t]; switch (e.question = removeHtml(n.description), e.options = n.options ? n.options.map((e => removeHtml(e.description))) : [], e.type = typeConvert(n.typeDesc), e.answer = n.solution.split("").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "3": e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : [ "" ]; break; case "15": e.options = [], e.answer = [], n.subQuestions.forEach((t => { let n = t.options ? t.options.map((e => removeHtml(e.description))) : [], a = t.solution.split("").map((e => n[e.charCodeAt(0) - 65])); e.answer.push(a), e.options.push(n); })); } return e; } }, { type: "ask", name: "\u9752\u4e66\u5b66\u5802\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.host.includes("qingshuxuetang.com") && (location.href.includes("/Student/ExercisePaper") || location.href.includes("Student/ExamPaper") || location.href.includes("Student/ViewQuiz") || location.href.includes("Student/SimulationExercise/Detail") || location.href.includes("Student/Quiz/Detail")), types: [ "0", "1", "3" ], question: { html: ".paper-container > .question-detail-container", question: ".question-detail-description", options: ".question-detail-options .question-detail-option .option-description", type: ".question-detail-type-desc", workType: "qingshu", pageType: "qingshu" }, init: async () => { await waitUntil((function() { return isExist(".question-detail-container") && ce.qsques; })); }, ischecked: e => e.parent().find("input").prop("checked"), toquestion: e => { J(`.group_item:eq(${e})`), J(`.group_item:eq(${e})`).click(); }, questionHook: (e, t) => { const n = ce.qsques[t]; if (e.question = removeHtml(n.description), e.options = n.options ? n.options.map((e => removeHtml(e.description))) : [], e.type = typeConvert(n.typeDesc), "3" === e.type) e.options = []; return e; } } ], Ne = [ { type: "save", name: "\u4f18\u8bfe\u5728\u7ebf\u6536\u5f55", match: () => "cce.org.uooconline.com" === location.host && (location.href.includes("/exam/paper") || location.href.includes("/exam/")), question: { html: ".queContainer", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "uooc", pageType: "uooc" }, init: async () => { await waitUntil((function() { return 0 !== J(".queContainer").length; })); }, answerHook: e => { const t = ce.angular.element(e.html).scope().question; if (e.type = typeConvert(t.type_text), e.question = t.question, e.options = t.options_app.map((e => e.value)), e.answer = t.answer.map((e => t.options[e])), "3" === e.type) e.options = [], e.answer = judgeAnswer(e.answer[0]); return e; } } ], De = [ { type: "ask", name: "\u4eac\u4eba\u5e73\u53f0\u7b54\u9898", tips: "", match: () => location.host.includes("cj-edu.com") && (location.href.includes("/Examination") || location.href.includes("/ExamInfo")), types: [ "0", "1", "3" ], question: { html: ".el-main>.all_subject>div.el-row", question: "div.stem", options: "ul li > label > span.el-radio__label > div:nth-child(2),ul li > label > span.el-checkbox__label > div:nth-child(2)", type: ".question-box .tag", workType: "cjedu", pageType: "cjedu" }, init: async () => { await waitUntil((function() { return 0 !== J(".el-main>.all_subject>div.el-row").length; })); }, ischecked: isParentChecked, questionHook: e => { switch (J(e.html).prevAll("h1").first().text().trim()) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.$options = J(e.html).find("ul li>label"), e.options = [], e.type = "3"; } return e; } }, { type: "save", name: "\u4eac\u4eba\u5e73\u53f0\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("cj-edu.com") && location.href.includes("/ViewAnswerSheet"), question: { html: ".el-main>.all_subject>div.el-row", question: "p.stem", options: "ul li > label > span.el-radio__label > div:nth-child(2),ul li > label > span.el-checkbox__label > div:nth-child(2)", type: ".question-box .tag", workType: "cjedu", pageType: "cjedu" }, init: async () => { await waitUntil((function() { return 0 !== J(".el-main>.all_subject>div.el-row").length; })); }, answerHook: e => { let t = J(e.html).find(".seeStudentAnswer>p.answer").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(), n = J(e.html).prevAll("h1").first().text().trim(); switch (e.options.length > 0 && (e.answer = t.split(",").map((t => e.options[t.charCodeAt(0) - 65]))), n) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.options = [], e.answer = judgeAnswer(t), e.type = "3"; } return e; } } ], Re = [ { type: "hook", name: "hook", match: location.host.includes("ytccr.com"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u7ece\u901a\u7ee7\u6559\u4e91\u7b54\u9898", tips: "", match: () => location.host.includes("ytccr.com") && location.href.includes("learning-work") && location.href.includes("type=3"), types: [ "0", "1", "3" ], question: { html: ".border-item", question: ".title.qa-title", options: ".opts-list .opt-title-cnt", type: ".question-box .tag", workType: "ytccr", pageType: "ytccr" }, init: async () => { await waitUntil((function() { return 0 !== J(".border-item").length; })); }, ischecked: isParentChecked, questionHook: e => { if (e.type = typeConvert(J(e.html).find(".qtype").text().trim()), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u7ece\u901a\u7ee7\u6559\u4e91\u6536\u5f55", match: () => location.host.includes("ytccr.com") && location.href.includes("learning-work") && location.href.includes("type=5"), question: { html: ".border-item", question: ".title.qa-title", options: ".opts-list .opt-title-cnt", type: ".question-box .tag", workType: "ytccr", pageType: "ytccr" }, init: async () => { await waitUntil((function() { return 0 !== J(".border-item").length; })); }, answerHook: e => { e.type = typeConvert(J(e.html).find(".qtype").text().trim()); let t = J(e.html).find(".u-text-success,.u-text-danger").text().split("\uff0c")[0].trim(); if (t = t.match(/[A-Z]+$/)[0].trim(), e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return e; if ("3" === e.type) e.options = [], e.answer = judgeAnswer(e.answer[0]); return e; } } ], Be = [ { type: "ask", name: "\u5b66\u8d77\u8003\u8bd5", tips: "", match: () => location.href.includes("oxer/page/ots/examIndex.html"), types: [ "0", "1", "3" ], question: { html: ".queItemClass", question: "dt > div.din:eq(1)", options: "dd > div", type: ".question-box .tag", workType: "xueqi", pageType: "xueqi" }, init: async () => { await waitUntil((function() { return isExist(".queItemClass"); })), ce.document.onkeydown = null, ce.oncontextmenu = null; }, ischecked: e => e.parent().hasClass("cur"), questionHook: e => { let t = J(e.html).parent().find("div .fb:eq(0)").text().split("\u3001")[1]; if (t.includes("\u5224\u65ad") && (t = "\u5224\u65ad\u9898"), e.type = typeMatch(t), "3" === e.type) e.options = [], e.$options = J(e.html).find("input"); return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).val())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).val())) && J(n).click(); })), !1; } return !0; } }, { type: "save", name: "\u5b66\u671f\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("OTS-UniverDetail.html"), question: { html: ".dl_list", question: "dt > div.fl:eq(1)", options: "dd > var", type: ".question-box .tag", workType: "xueqi", pageType: "xueqi" }, init: async () => { await waitUntil((function() { return isExist(".dl_list"); })); }, answerHook: e => { var t, n, a, i, o; const s = J(e.html).attr("queid"), r = e.html._ms_context_.el.questions.find((e => e.id === s)); r.questionTypeName.includes("\u5224\u65ad") && (r.questionTypeName = "\u5224\u65ad\u9898"), e.type = typeMatch(r.questionTypeName), e.question = removeHtml(r.stem), console.log(r), e.options = (null == (n = null == (t = r.answerArea) ? void 0 : t.optionList) ? void 0 : n.sort(((e, t) => e.sequence - t.sequence)).map((e => removeHtml(e.content)))) || []; let l = r.answer.ans || (null == (a = r.answer.ansL) ? void 0 : a.join("")) || null; if (l) e.answer = l.split("").map((t => e.options[t.charCodeAt(0) - 65])); else { const t = (null == (o = null == (i = r.answerArea) ? void 0 : i.optionList) ? void 0 : o.filter((e => e.isTrue)).map((e => removeHtml(e.content)))) || []; if (0 === r.answerScore) return; e.answer = t; } return "3" === e.type && (e.options = [], e.answer = judgeAnswer(l)), e; }, paper: e => { const t = J(".dl_list:eq(0)")[0]._ms_context_.loop.category, n = J(".dl_list:eq(0)")[0]._ms_context_.oAnswerDetailInfo, a = { platform: "xueqi" }; a.hash = t.code, a.name = t.value, a.info = {}, a.chapter = [ { hash: `${n.arrangementid}`, name: n.arrangementname, question: e } ], Te.setPaper(a.hash, a); } } ], Ge = [ { type: "hook", name: "hook", match: "gdrtvu.exam-cloud.cn" === location.host, main: e => { observeVuePageChange(J("#app")[0], getUrl); } }, { type: "ask", name: "\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("exam-cloud.cn") && location.href.includes("oe-web/online-exam/exam"), types: [ "0", "1", "3" ], question: { html: ".question-container", question: ".question-body:first", options: ".option .question-options", type: ".question-header .container", workType: "guangkai", pageType: "guangkai" }, init: async () => { await waitUntil((function() { return isExist(".question-container"); })); }, ischecked: isParentChecked, questionHook: e => { let t = J(".list .current-question").parent().parent().find(".title").text(); if (console.log(t), t = t.split("\u3001")[1], t = t.replace(/\(.*\)/, "").trim(), console.log(t), e.type = typeConvert(t), "8" == e.type ? e.type = typeMatch(t) : e.type, "3" === e.type) e.options = []; return e; }, finish: e => { J(".next .qm-primary-button").length && J(".next .qm-primary-button")[0].click(); } } ], Ve = [ { type: "hook", name: "hook", match: location.host.includes("open.ha.cn"), main: e => { const getHash = () => J(".stuHomeworkVersionId.active").attr("id"); ce.mainClass = getHash(); let t = new MutationObserver((async e => { getHash(), ce.mainClass !== getHash() && (ce.mainClass = getHash(), vuePageChange(), t.disconnect()); })); J(".homeworkBody").length >= 1 && t.observe(J(".homeworkBody")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u4e91\u4e0a\u6cb3\u5f00\u7b54\u9898", tips: "", match: () => location.host.includes("open.ha.cn") && location.href.includes("/homework/showHomeworkByStatus") && location.href.includes("checked=false"), types: [ "0", "1" ], question: { html: ".layui-colla-content > .insert", question: ".window-title", options: ".option-title", type: ".question-box .tag", workType: "openha", pageType: "openha" }, init: async () => { await waitUntil((function() { return isExist(".layui-colla-content > .insert"); })); }, ischecked: isParentChecked, questionHook: e => (e.options = e.$options.map(((t, n) => { let a = J(n).find(".numberCover").text().trim(); return removeHtml(e.$options.eq(t).html()).replace(a, "").trim(); })).get(), e.type = typeConvert(J(e.html).find(".questionDiv>.float-l:eq(1)").text().trim()), e.$options = J(e.html).find(".option-title .numberCover"), e) }, { type: "save", name: "\u4e91\u4e0a\u6cb3\u5f00\u6536\u5f55", match: () => location.host.includes("open.ha.cn") && location.href.includes("/homework/showHomeworkByStatus") && location.href.includes("checked=true"), question: { html: ".layui-colla-content > .insert", question: ".window-title", options: ".option-title", type: ".question-box .tag", workType: "openha", pageType: "openha" }, init: async () => { await waitUntil((function() { return isExist(".layui-colla-content > .insert"); })); }, answerHook: e => { let t = []; const n = 0 == J(e.html).find(".option-title.error2").length; if (e.options = e.$options.map(((n, a) => { let i = J(a).find(".numberCover").text().trim(), o = removeHtml(e.$options.eq(n).html()).replace(i, "").trim(); return J(a).hasClass("answer-title") && t.push(o), o; })).get(), e.type = typeConvert(J(e.html).find(".questionDiv>.float-l:eq(1)").text().trim()), n) return e.answer = t, J(e.html).find(".option-title.error2"), e; }, paper: e => { const t = ce.homework, n = { platform: "openha" }; n.hash = t.courseId, n.name = t.courseName, n.info = {}, n.chapter = [ { hash: `${t.homeworkId}`, name: t.title, question: e } ], Te.setPaper(n.hash, n); } } ], Je = [ { type: "ask", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u7b54\u9898", tips: "", match: () => location.href.includes("uc/task/startTask"), types: [ "0", "1" ], answerDelay: 1e3, minDelay: 1e3, question: { html: ".carousel-inner>.item.changeless-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".carousel-inner>.item.changeless-box"); })), !isExist("#finish")) return !1; await waitUntil((function() { let e = J(".carousel-inner>article").filter(((e, t) => J(t).hasClass("temporary-box"))).eq(0).index(); return e > 0 ? (J(".slide-tihao:eq(" + e + ")")[0].click(), !1) : (J(".slide-tihao:eq(0)")[0].click(), !0); })); }, toquestion: e => { J(".slide-tihao:eq(" + e + ")")[0].click(); }, ischecked: e => e.find(".checked").length > 0, questionHook: e => (e.type = typeConvert(J(e.html).attr("data-name") || ""), e.$options = J(e.html).find(".ic-options__wrap label"), e.question = e.question.replace(/^\(\d+\)/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e) }, { type: "ask", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.href.includes("uc/exam/record/startExamination"), types: [ "0", "1" ], question: { html: ".trunk-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".trunk-box") && isExist(".ic-ac-checkbox-ol"); })), await waitUntil((function() { return window.scrollTo(0, document.body.scrollHeight), J(".ic-ac-checkbox-ol li").length == J(".trunk-box").length; })), !isExist("#submit-btn")) return !1; }, next: () => { J("#carousel-professional").carousel("next"); }, ischecked: e => e.find(".checked").length > 0, questionHook: e => { const t = J(e.html).attr("data-type"); switch (console.log(t), t) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; case "3": e.type = "3", e.options = []; } return e.question = e.question.replace(/^\d+\u3001/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e.question = e.question.replace(/\[\S+\]$/, "").trim(), e.$options = J(e.html).find(".ic-options__wrap label"), e; } }, { type: "save", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u6536\u5f55", match: () => location.href.includes("uc/task/startTask"), question: { html: ".carousel-inner>.item.changeless-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".carousel-inner>.item.changeless-box") && isExist(".slide-tihao"); })), isExist("#finish")) return !1; await waitUntil((function() { let e = J(".carousel-inner>article").filter(((e, t) => J(t).hasClass("temporary-box"))).eq(0).index(); return e > 0 ? (J(".slide-tihao:eq(" + e + ")")[0].click(), !1) : (J(".slide-tihao:eq(0)")[0].click(), !0); })); }, answerHook: e => { const t = J(e.html).find(".analysis-box .fs20.c-primary.vam").text().trim().split(""); return e.type = typeConvert(J(e.html).attr("data-name") || ""), e.answer = t.map((t => e.options[t.charCodeAt(0) - 65])), e.question = e.question.replace(/^\(\d+\)/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e; } }, { type: "save", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("uc/exam/record/startExamination"), question: { html: ".trunk-box.answer-question", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".trunk-box") && isExist(".ic-ac-correct"); })), await waitUntil((function() { return window.scrollTo(0, document.body.scrollHeight), J(".ic-ac-correct,.ic-ac-error").length == J(".trunk-box").length; })), isExist("#submit-btn")) return !1; }, next: () => { J(".next-slide").click(); }, answerHook: e => { const t = J(e.html).attr("data-type"); console.log(t); const n = J(e.html).find(".ic-options__wrap label").filter(((e, t) => J(t).find(".checked").length > 0)).map(((e, t) => removeHtml(J(t).html()))).get(); switch (e.answer = n.map((t => e.options[t.charCodeAt(0) - 65])), e.question = e.question.replace(/^\d+\u3001/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e.question = e.question.replace(/\[\S+\]$/, "").trim(), t) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; case "3": e.type = "3", e.options = [], e.answer = judgeAnswer(e.answer[0]); } return e; } } ], Ke = [ { type: "hook", name: "hook", match: location.host.includes("sclecb.cn"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => "study.sclecb.cn" === location.host && /\/[0-9]+\/show/i.test(location.href), types: [ "0", "1", "3" ], question: { html: ".testpaper-question.js-testpaper-question", question: ".testpaper-question-stem", options: ".testpaper-question-choices li", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".testpaper-question.js-testpaper-question"); })); }, ischecked: e => e.hasClass("checked"), questionHook: e => { switch (e.options = removeStartChar(e.options), e.$options = J(e.html).find(".testpaper-question-choice-inputs > label > input"), e.type = typeConvert(J(e.html).parent().parent().find(".panel-heading>strong").text().trim()), e.type, e.type) { case "0": case "1": break; case "3": e.$options = J(e.html).find(".radio-inline"); } return e; } }, { type: "ask", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u7b54\u9898\u65e7", tips: "", match: () => location.host.includes("sclecb.cn") && /student\/course\/study\/[0-9a-zA-Z]+\/test\/redo/i.test(location.href), types: [ "0", "1" ], question: { html: ".questiono-item", question: ".clearfix.questiono-header h6", options: ".common_test_option .processing_img", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".questiono-item"); })); }, ischecked: e => e.hasClass("checked"), questionHook: e => { const t = J(e.html).parent().parent().find("div:eq(0)").text().trim(); switch (!0) { case t.includes("\u5355\u9009\u9898"): e.type = "0"; break; case t.includes("\u591a\u9009\u9898"): e.type = "1"; break; case t.includes("\u5224\u65ad\u9898"): e.type = "3", e.options = [], e.$options = J(e.html).find(".common_test_option > label"); break; default: return; } return e; } }, { type: "save", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u6536\u5f55", match: () => "study.sclecb.cn" === location.host && (/task\/[0-9]+\/activity_show/i.test(location.href) || /result\/[0-9]+\/show/i.test(location.href)), question: { html: ".testpaper-question.js-testpaper-question", question: ".testpaper-question-stem", options: ".testpaper-question-choices li", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".testpaper-question.js-testpaper-question"); })); }, answerHook: (e, t) => { let n = []; e.options = e.$options.map(((e, t) => { const a = removeHtml(J(t).clone().find(".testpaper-question-choice-index").remove().end().html()); return J(t).hasClass("testpaper-question-choice-right") && n.push(a), a; })).get(), e.answer = n, e.type = typeConvert(J(".js-panel-card>span").eq(t).prevAll("p").first().text().trim()); const a = J(".js-panel-card>span").eq(t).hasClass("bg-success"); switch (e.type) { case "0": case "1": break; case "3": let t = ""; t = J(e.html).find(".testpaper-question-result").text().replace("\u4f60\u7684\u7b54\u6848\u662f", "").trim(), e.answer = judgeAnswer(t); } if ((a || !(e.answer.length > 0) || "3" != e.type) && a) return e; } } ], We = [ { type: "hook", name: "hook", match: location.host.includes("superchutou.com"), main: e => { observeVuePageChange(J("#root")[0], (() => getUrl())); } }, { type: "ask", name: "\u51fa\u5934\u7cfb\u7edf\u7b54\u9898", tips: "", match: () => location.host.includes("superchutou.com") && location.href.includes("onlineclass/exam/"), types: [ "0", "1" ], question: { html: "[class^='single_excer_item']", question: "[class^='title_content'] > [class^='title_content_text']:eq(1)", options: "[class^='options_content'] label", type: ".question-box .tag", workType: "chutou", pageType: "chutou" }, init: async () => { await waitUntil((function() { return isExist("[class^='single_excer_item']"); })); }, ischecked: isParentChecked, questionHook: e => { let t = J(e.html).find("[class^='title_content'] > span:eq(1)").text(); if (t = t.replace(/\u3010|\u3011/g, "").trim(), e.type = typeConvert(t), e.options = removeStartChar(e.options), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u51fa\u5934\u6536\u5f55", match: () => location.host.includes("superchutou.com") && location.href.includes("/onlineclass/analysis/"), question: { html: "[class^='single_excer_item']", question: "[class^='title_content'] > [class^='title_content_text']:eq(1)", options: "[class^='options_content'] label", type: ".question-box .tag", workType: "chutou", pageType: "chutou" }, init: async () => { await waitUntil((function() { return isExist("dl>dd>span"); })); }, answerHook: e => { let t = J(e.html).find("[class^='title_content'] > span:eq(1)").text(); t = t.replace(/\u3010|\u3011/g, "").trim(), e.type = typeConvert(t), e.options = removeStartChar(e.options); const n = J(e.html).find(".ant-collapse-header>div.ant-row>div.ant-col.ant-col-18>div:eq(1)").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(); switch (e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.options = [], e.answer = judgeAnswer(n); } return e; } } ], Qe = [ { type: "ask", name: "\u826f\u5e08\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.host.includes("ls365.net") && (location.href.includes("student/examing.aspx") || location.href.includes("Student/myhomework.aspx")), types: [ "0", "1" ], question: { html: ".exam_question", question: ".exam_question_title", options: ".question_select .select_detail", type: ".exam_question_title strong", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist(".exam_question"); })); }, ischecked: isParentChecked, questionHook: e => { let t = J(e.html).find(".exam_question_title").clone(); t.find(".question_number").remove(), t.find("strong").remove(), t.find(".exam_feed_back").remove(), e.question = removeHtml(t.html()); let n = J(e.html).find(".exam_question_title strong").text(); return n = n.replace(/\[|\]/g, "").trim(), e.type = typeConvert(n), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("ls365.net") && location.href.includes("User/Student/ViewPaper.aspx"), question: { html: "[name^='anchor_']", question: ".title-img-ctr", options: ".pold .phtml", type: ".QuestionsType", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[name^='anchor_']"); })); }, answerHook: e => { let t = J(e.html).find(".QuestionsType").text(); t = t.replace(/\[|\]/g, "").trim(), e.type = typeConvert(t); let n = J(e.html).find(".my-work-answer>p").filter(((e, t) => t.innerText.includes("\u53c2\u8003\u7b54\u6848"))).map(((e, t) => J(t).find(".two").text())).get(); if (0 !== n.length) return e.answer = n[0].split("").map((t => e.options[t.charCodeAt(0) - 65])), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("ls365.net") && location.href.includes("Student/myhomework_after.aspx"), question: { html: "[name^='anchor_']", question: ".my-work-nav>.col-md-10", options: ".pold .phtml", type: ".QuestionsType", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[name^='anchor_']"); })); }, answerHook: e => { let t = J(e.html).find(".my-work-nav>div:eq(0)>span:eq(0)").text(); t = t.replace(/\[|\]/g, "").trim(), e.type = typeConvert(t); let n = J(e.html).find(".my-work-answer>p").filter(((e, t) => t.innerText.includes("\u53c2\u8003\u7b54\u6848"))).map(((e, t) => J(t).find(".two").text())).get(); if (0 !== n.length) return e.answer = n[0].split("").map((t => e.options[t.charCodeAt(0) - 65])), e; } }, { type: "hook", name: "hook", match: "hbnun.lsedu.vip" === location.host, main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.href.includes("/#/homework/") && !location.href.includes("scene=history"), types: [ "0", "1" ], question: { html: "[id^='question-']", question: ".question-content", options: "button .flex-1.text-left", type: ".self-start.text-3.self-end", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[id^='question-']"); })); }, ischecked: e => J(e).closest("button").hasClass("is-checked") || J(e).closest("button").hasClass("el-button--primary"), questionHook: e => { let t = J(e.html).find(".self-start.text-3.self-end").text(); return t && (t = t.replace(/\[|\]/g, "").trim(), e.type = typeMatch(t)), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u6536\u5f55", match: () => location.href.includes("/#/homework/") && location.href.includes("scene=history"), question: { html: "[id^='question-']", question: ".question-content", options: ".flex.flex-col.space-y-2 .f-c-c.space-x-3 .flex-1", type: ".self-start.text-3.self-end", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[id^='question-']"); })); }, answerHook: e => { let t = J(e.html).find(".self-start.text-3.self-end").text(); t && (t = t.replace(/\[|\]/g, "").trim(), e.type = typeMatch(t)); let n = ""; if (J(e.html).find("div").each(((e, t) => { const a = J(t); if ((a.find("span").filter(((e, t) => J(t).text().trim().includes("\u6807\u51c6\u7b54\u6848\uff1a"))).length > 0 || a.text().trim().includes("\u6807\u51c6\u7b54\u6848\uff1a")) && (n = a.find(".question-content").text().trim(), n)) return !1; })), n) return e.answer = n.split("").map((t => { const n = t.charCodeAt(0) - 65; return e.options && e.options[n] ? e.options[n] : null; })).filter((e => null !== e)), e; } } ], Ye = [ { type: "hook", name: "hook", match: location.host.includes("jijiaox.com"), main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); } }, { type: "ask", name: "\u7ee7\u6559\u4e91\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.host.includes("jijiaox.com") && (location.href.includes("/mg/studentindexexam/") || !location.href.includes("examrec")), types: [ "0", "1", "3", "4" ], question: { html: ".question>div", question: ".topic-title", options: ".ml_2 label", type: ".question-box .tag", workType: "jijiaox", pageType: "jijiaox" }, init: async () => { await waitUntil((function() { return isExist(".question>div"); })); }, ischecked: e => e.hasClass("is-checked"), questionHook: (e, t) => { const n = J(".page")[0].__vue__.$data.testInfo.studentPraxisList[t]; switch (e.options = n.options ? n.options : [], "string" == typeof e.options && (e.options = []), e.question = removeHtml(n.title), n.type) { case "single": e.type = "0"; break; case "muti": e.type = "1"; break; case "charge": e.type = "3"; break; case "text": e.type = "4"; break; default: console.log(n.type, "\u672a\u77e5\u7c7b\u578b"); } return e; }, setAnswer: e => "4" !== e.type || (J(e.html).find(".editor")[0].__vue__.editor.txt.html(e.answer[0]), !1) }, { type: "save", name: "\u7ee7\u6559\u4e91\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("jijiaox.com") && location.href.includes("/mg/studentindexexam/examrec/"), question: { html: ".question>div", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "jijiaox", pageType: "jijiaox" }, init: async () => { await waitUntil((function() { return isExist(".question>div"); })); }, answerHook: (e, t) => { const n = J(".page")[0].__vue__.$data.testInfo.studentPraxisList[t], a = n.answer; switch (e.options = n.options ? n.options : [], "string" == typeof e.options && (e.options = []), e.question = removeHtml(n.title), n.type) { case "single": e.type = "0"; break; case "muti": e.type = "1"; break; case "charge": e.type = "3", e.answer = "1" == a ? [ "\u6b63\u786e" ] : "-1" == a ? [ "\u9519\u8bef" ] : []; break; case "text": e.type = "4", e.answer = [ removeHtml(a) ]; break; default: console.log(n.type, "\u672a\u77e5\u7c7b\u578b"); } switch (e.type) { case "0": case "1": console.log("________", a), e.answer = "string" == typeof a ? a.split("").map((t => e.options[t.charCodeAt(0) - 65])) : a.map((t => (console.log(t), e.options[t.charCodeAt(0) - 65]))); } return console.log(e), e; } } ], Xe = [ { type: "hook", name: "hook", match: location.host.includes("wencaischool.net") && J("#app").length, main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); const t = document.createElement("style"); t.type = "text/css", t.innerHTML = "* {\n font-size: 13px !important;\n }", document.head.appendChild(t); } }, { type: "save", name: "\u67e0\u6aac\u6587\u624d\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("wencaischool.net") && location.href.includes("/separation/exam/index.html"), question: { html: ".tmList", question: ".tmTitleTxt", options: ".perRad .opCont", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist(".tmList") && J("#onlineExamArea")[0].__vue__._data.itemsList.length > 0; })); }, answerHook: (e, t) => { const n = J("#onlineExamArea")[0].__vue__._data.itemsList[t]; e.question = removeHtml(n.itemName), e.options = n.optionNodes.map((e => removeHtml(e.optionContent))); e.type = typeConvert({ 1: "\u586b\u7a7a\u9898", 2: "\u7b80\u7b54\u9898", 3: "\u5355\u9009\u9898", 4: "\u591a\u9009\u9898", 5: "\u9605\u8bfb\u7406\u89e3", 12: "\u5b8c\u5f62\u586b\u7a7a" }[n.itemType]); let a = n.itemAnswer[0].optionContent; switch (e.type) { case "0": case "1": e.answer = a.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "4": e.answer = removeHtml(a); break; case "2": e.answer = n.itemAnswer.map((e => removeHtml(e.optionContent))); } return e; } }, { type: "ask", name: "\u67e0\u6aac\u6587\u624d\u8003\u8bd5\u7b54\u9898", tips: "\u6b64\u5e73\u53f0\u7b54\u9898\u95f4\u9694\u5c3d\u91cf3s\u5de6\u53f3\uff0c\u5426\u5219\u53ef\u80fd\u9009\u4e0d\u4e0a\u7b54\u6848", match: () => location.host.includes("wencaischool.net") && location.href.includes("/separation/exam/index.html"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "14" ], minDelay: 4e3, answerDelay: 1e3, question: { html: ".tmList", question: ".tmTitleTxt", options: ".perRad .opCont", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist(".tmList") && J("#onlineExamArea")[0].__vue__._data.itemsList.length > 0; })); }, ischecked: e => e[0].checked, questionHook: e => { let t = J(e.html).find(".tmc.tm").attr("ttype"); return e.type = typeConvert({ 1: "\u586b\u7a7a\u9898", 2: "\u7b80\u7b54\u9898", 3: "\u5355\u9009\u9898", 4: "\u591a\u9009\u9898", 5: "\u9605\u8bfb\u7406\u89e3", 12: "\u5b8c\u5f62\u586b\u7a7a" }[t]), e.$options = J(e.html).find(".perRad input"), e; }, setAnswer: e => { switch (e.type) { case "4": return J(e.html).find("textarea").focus(), document.execCommand("selectAll"), document.execCommand("insertText", !1, e.answer[0]), !1; case "2": J(e.html).find(".ansbox.inputAnswer input").each((async (t, n) => { n.focus(), document.execCommand("selectAll"); let a = e.answer[t]; document.execCommand("insertText", !1, a), await sleep(1e3); })); } return !0; } }, { type: "ask", name: "\u67e0\u6aac\u6587\u624d\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.host.includes("wencaischool.net") && location.href.includes("/exam/portal/exam.jsp"), types: [ "0", "1", "2", "3" ], question: { html: "table[id^='tblItem_'][islabel='0']", question: "table>tbody>tr:eq(0)>td:eq(0)", options: "table>tbody>tr:eq(1)>td:eq(0) table>tbody>tr>td>label", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist("table[id^='tblItem_'][islabel=0]"); })), J(".aah_wrapper>div").css("z-index", 9999); }, ischecked: e => e[0].checked, questionHook: e => { let t = removeHtml(J(e.html).parent().parent().prevAll("tr").filter((function() { return J(this).find("table[islabel='1']").length > 0; })).first().html()); if (e.type = typeMatch(t), "8" == e.type && t.includes("\u9009\u62e9\u9898") && (e.type = "0"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("2" === e.type) { const t = J(e.html).find("table>tbody>tr:eq(0)>td:eq(0)>input"); t.length == e.answer.length && t.each((async (t, n) => { n.value = "", n.focus(), document.execCommand("selectAll"); let a = e.answer[t]; document.execCommand("insertText", !1, a), await sleep(1e3); })); } return !0; } }, { type: "save", name: "\u67e0\u6aac\u6587\u624d\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("wencaischool.net") && location.href.includes("/exam/portal/view_answer.jsp"), question: { html: "tr[id^='trScore_']", question: "table>tbody>tr:eq(0)>td:eq(0)", options: "table>tbody>tr:eq(1)>td:eq(0) table>tbody>tr>td>label", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => {}, answerHook: (e, t) => { const n = removeHtml(J(e.html).prevAll("tr:not([id])").first().html()); switch (e.type = typeMatch(n), "8" == e.type && n.includes("\u9009\u62e9\u9898") && (e.type = "0"), e.type) { case "0": case "1": case "3": const t = J(e.html).find("table>tbody>tr:eq(1)>td:eq(0)>div[style='color:darkred;font-size:10pt']").text().split("\u7b54\u6848\uff1a")[1].split("]")[0]; e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), "3" == e.type && (e.options = [], e.answer = judgeAnswer(e.answer[0])); break; case "2": const n = J(e.html).find("table>tbody>tr:eq(0)>td:eq(0)").clone(); n.find("input").remove(), e.answer = n.find("nobr").map(((e, t) => { const n = removeHtml(J(t).html()); return /\[\u53c2\u8003\u7b54\u6848\uff1a(.+?)\]/.exec(n)[1]; })).get(), n.find("nobr").remove(), n.find("font").remove(), e.question = removeHtml(n.html()); } return e; } } ], Ze = [ { type: "save", name: "yxlearning\u6536\u5f55", match: () => location.host.includes("yxlearning.com") && location.href.includes("exam/start?myExamRecordId"), question: { html: ".subject>.mb20.sub", question: ".ls1.lh30.text-f666", options: "ul.options>li.cursor-p", type: ".question-box .tag", workType: "yxlearning", pageType: "yxlearning" }, init: async () => { if (await waitUntil((function() { return isExist(".mb20.sub"); })), !ce.yxques) return !1; }, answerHook: (e, t) => { const n = []; ce.yxques.questionStemRPS.forEach(((e, t) => { e.listPaperQuestionRP.forEach(((e, t) => { n.push(e); })); })); const a = n[t]; e.question = titleClean(removeHtml(a.questionName)); const i = a.type, o = []; switch (e.options = removeStartChar(a.paperOptionRPS.map((e => removeHtml(e.context)))), a.paperOptionRPS.forEach(((t, n) => { 1 == t.standardAnswer && o.push(e.options[n]); })), e.answer = o, i) { case 1: e.type = "3", e.options = [], e.answer = judgeAnswer(e.answer[0]); break; case 2: e.type = "0"; break; case 3: e.type = "1"; } return e; } }, { type: "ask", name: "\u65e5\u7167\u4e13\u4e1a\u6280\u672f\u4eba\u5458\u7b54\u9898", tips: "", match: () => location.host.includes("yxlearning.com") && location.href.includes("exam/start?myExamRecordId"), types: [ "0", "1", "3" ], question: { html: ".mb20.sub", question: ".ls1.lh30.text-f666", options: ".cursor-p", type: ".question-box .tag", workType: "yxlearning", pageType: "yxlearning" }, init: async () => { await waitUntil((function() { return isExist(".mb20.sub"); })); }, ischecked: e => e.hasClass("active"), questionHook: e => { if (e.options = removeStartChar(J(e.html).find("ul>li").map(((e, t) => removeHtml(J(t).html()))).get()), e.$options = J(e.html).find("ul>li"), e.type = typeConvert(J(e.html).parent().prevAll(".title").first().find("[du-html='questionStemName']").text().trim()), "3" === e.type) e.options = [], e.$options = J(e.html).find("ul>li"); return e; } } ], et = [ { type: "ask", name: "\u9ea6\u80fd\u7f51\u7b54\u9898", tips: "", match: () => location.href.includes("lms/web/onlineexam/exambegin"), types: [ "0", "1", "3" ], question: { html: "#exam_form>.sdiv", question: ".eptimu_name", options: ".ansdiv > .optiondiv", type: ".eptimu_title", workType: "cjnep", pageType: "cjnep" }, init: async () => { await waitUntil((function() { return isExist(".sdiv"); })); }, toquestion: e => { J(`.controldiv > a:eq(${e})`), J(`.epcl_circle:eq(${e})`)[0].click(); }, ischecked: isParentChecked, questionHook: e => { if (e.question = e.question.replace(/^[0-9]+\u3001/, "").trim(), e.question = titleClean(e.question), e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".eptimu_title").text().trim()), e.$options = J(e.html).find(".ansdiv input"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { switch (e.type) { case "3": let t = e.answer; return J(e.html).find(".ansdiv input").each(((e, n) => { isTrue(t) && "1" == J(n).val() && J(n).click(), isFalse(t) && "0" == J(n).val() && J(n).click(); })), !1; case "2": case "4": case "5": case "6": const n = J(e.html).find(".ansdiv textarea"), a = e.answer.join(";"); n.val(a), n.trigger("input"), n.trigger("keydown"), n.trigger("change"), n.trigger("blur"), n.trigger("focus"); const i = n[0]; if (i) { [ "input", "change", "blur", "focus" ].forEach((e => { const t = new Event(e, { bubbles: !0 }); i.dispatchEvent(t); })); } return !1; } return !0; } }, { type: "save", name: "\u9ea6\u80fd\u7f51\u7b54\u9898\u6536\u5f55", match: () => location.href.includes("lms/web/exam/examshow"), question: { html: "#exam_form>.sdiv", question: ".eptimu_name", options: ".ansdiv > .optiondiv", type: ".eptimu_title", workType: "cjnep", pageType: "cjnep" }, init: async () => { await waitUntil((function() { return isExist(".sdiv"); })); }, answerHook: e => { switch (e.type = typeMatch(J(e.html).find(".eptimu_title").text().trim()), e.question = e.question.replace(/^[0-9]+\u3001/, "").trim(), e.question = titleClean(e.question), e.options = removeStartChar(e.$options.map(((e, t) => { let n = J(t).clone(); return J(n).find("img").remove(), removeHtml(J(n).html()).trim(); })).get()), e.type) { case "0": case "1": e.answer = e.$options.map(((t, n) => { var a; return (null == (a = J(n).find("img").attr("src")) ? void 0 : a.includes("exam-yes")) && e.options[t]; })).get().filter((e => void 0 !== e)); break; case "3": e.answer = e.$options.map(((t, n) => { var a; return (null == (a = J(n).find("img").attr("src")) ? void 0 : a.includes("exam-yes")) && e.options[t]; })).get().filter((e => void 0 !== e)), e.answer = judgeAnswer(e.answer), e.options = []; break; case "4": e.options = []; let t = removeHtml(J(e.html).find(".eptimu_answer.ansdiv").html()).trim(); t.includes("\u6b63\u786e\u7b54\u6848\uff1a") ? e.answer = t.split("\u6b63\u786e\u7b54\u6848\uff1a")[1].trim() : e.answer = []; } return e; } } ], tt = [ { type: "ask", name: "\u9ea6\u80fd\u7f51\u7b54\u9898", tips: "", match: () => location.host.includes("mynep.com") && location.href.includes("my-exam/exambegin"), types: [ "0", "1" ], question: { html: ".et_test", question: ".et_title", options: "ul>.et_answer>label", type: ".question-box .tag", workType: "mynep", pageType: "mynep" }, init: async () => {}, toquestion: e => { ce.select_num(e + 1); }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { e.question = e.question.replace(/\u7b2c\d+\u9898\uff1a/, ""), e.options = removeStartChar(e.options); switch (J(e.html).find('input[id^="question-num-isdone"]').attr("question_num_type_id")) { case "1": e.type = "0"; break; case "2": e.type = "1"; } return e; } }, { type: "save", name: "\u9ea6\u80fd\u7f51\u6536\u5f55", match: () => location.host.includes("mynep.com") && location.href.includes("web/my-exam/examshow"), question: { html: ".et_test", question: ".et_title", options: "ul>.et_answer>label", type: ".question-box .tag", workType: "mynep", pageType: "mynep" }, init: async () => {}, answerHook: e => { const t = J(e.html).find(".et_title").clone(); t.find(".exam-btn").remove(), t.find("div").remove(), e.question = removeHtml(t.html()).replace(/\u7b2c\d+\u9898\uff1a/, "").trim(), e.options = []; const n = []; J(e.html).find(".et_answer>.et_answer>.et_answer>label").map(((t, a) => { e.options.push(removeHtml(J(a).html()).trim()), J(a).parent().find("input").prop("checked") && n.push(t); })).get(), e.options = removeStartChar(e.options), e.answer = n.map((t => e.options[t])); switch (J(e.html).find('input[id^="question-num-isdone"]').attr("question_num_type_id")) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; default: return !1; } return e; } } ], nt = [ { type: "hook", name: "hook", match: location.host.includes("91huayi.com"), main: e => { observeVuePageChange(J(".box")[0], (() => J(".dd_01").attr("questionid")), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === J(".el-loading-mask").length; })); } }); } }, { type: "ask", name: "\u534e\u533b\u7f51\u7b54\u9898", tips: "", match: () => location.host.includes("91huayi.com") && location.href.includes("/ExamInterface/ComputerExamIndex"), types: [ "0", "1" ], question: { html: "#exampage", question: ".dd_01", options: ".dd_02", type: ".big_type", workType: "huayi", pageType: "huayi" }, init: async () => {}, next: () => { var e; null == (e = J("#btnNext")) || e.click(); }, ischecked: e => e.prop("checked"), questionHook: e => { const t = J(e.html).find(".dd_01").clone(); return t.find(".dd_01_red").remove(), e.question = removeHtml(t.html()), e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".big_type").text()), e.$options = J(e.html).find("dd.q-content input"), e; }, setAnswer: e => { switch (console.log(e), e.type) { case "0": case "1": return e.ques.$options.each(((t, n) => { if (e.answer.includes(t)) { if (e.rule.ischecked && e.rule.ischecked(J(n))) return; n.click(); } else e.rule.ischecked && e.rule.ischecked(J(n)) && n.click(); })), !1; } return !0; } }, { type: "ask", name: "\u534e\u533b\u7f51\u8003\u8bd5", tips: "", match: () => location.host.includes("91huayi.com") && location.href.includes("/pages/exam.aspx?cwid="), types: [ "0" ], question: { html: ".test>table", question: "thead", options: "tbody>tr>td>label", type: ".big_type", workType: "huayi", pageType: "huayi" }, init: async () => {}, next: () => { var e; null == (e = J("#btnNext")) || e.click(); }, ischecked: e => e.prop("checked"), questionHook: e => (e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\u3001/, ""), e.options = removeStartChar(e.options), 0 !== e.options.length && (e.type = "0"), e) } ], at = [ { type: "ask", name: "\u4e91\u5357\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => location.href.includes("hw/student/studentStartHomework.action") && location.host.includes("teach.ynou.edu.cn"), types: [ "0", "1", "3" ], question: { html: ".e_juan02biaoti", question: ".qcontent > p:first", options: ".signDefault>.label", type: ".question-box .tag", workType: "ynou", pageType: "ynou" }, init: async () => { await waitUntil((function() { return 0 !== J(".e_juan02biaoti").length; })), J("body").css("text-align", "left"); }, ischecked: e => (e.find("input").is(":checked"), e.find("input").is(":checked")), questionHook: e => { e.options = []; const t = J(e.html).find(".e_juan02daan").clone(); t.find(".clear").nextAll().remove(); const n = removeHtml(t.html()), a = n.split(/[A][\u3001\.\uff0e]/)[0].trim(); null !== a && (e.question = a), e.question = a, e.question = a; const i = n.match(/(?:[A-G](?:[\u3001.]|\s)?\s?.*?)(?=\s*[A-G](?:[\u3001.]|\s)?|\s*$)/gs); if (null !== i) { const t = removeOptionsStartChar(i.map((e => e.trim()))); !1 !== t && (e.options = t); } const o = J(e.html).find(".signDefault").attr("answer_control"); return "radio" === o && e.options.length > 1 && (e.type = "0"), "checkbox" === o && e.options.length > 1 && (e.type = "1"), "radio" === o && 0 === e.options.length && (e.type = "3"), e; }, setAnswer: e => { if (console.log(e), "3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).html())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).html())) && J(n).click(); })), !1; } return !0; } }, { type: "save", name: "\u6536\u5f55", match: () => location.href.includes("/hw/student/studentViewHomework.action") && location.host.includes("teach.ynou.edu.cn"), question: { html: ".e_juan02biaoti", question: ".qcontent > p:first", options: ".signDefault>.label", type: ".question-box .tag", workType: "ynou", pageType: "ynou" }, init: async () => { await waitUntil((function() { return 0 !== J(".e_juan02biaoti").length; })), J("body").css("text-align", "left"); }, answerHook: e => { e.options = []; const t = J(e.html).find(".e_juan02daan").clone(); t.find(".clear").nextAll().remove(); const n = removeHtml(t.html()), a = n.split(/[A][\u3001\.\uff0e]/)[0].trim(); if (null === a) return null; e.question = a; const i = n.match(/(?:[A-G](?:[\u3001.]|\s)?\s?.*?)(?=\s*[A-G](?:[\u3001.]|\s)?|\s*$)/gs); if (null !== i) { const t = removeOptionsStartChar(i.map((e => e.trim()))); if (0 == t) return null; e.options = t; } const o = J(e.html).find(".signDefault").attr("answer_control"); "radio" === o && e.options.length > 1 && (e.type = "0"), "checkbox" === o && e.options.length > 1 && (e.type = "1"), "radio" === o && 0 === e.options.length && (e.type = "3"); const s = J(e.html).find(".right_answer>font").text(); switch (e.type) { case "0": case "1": e.answer = s.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.answer = isTrue(s) ? "\u6b63\u786e" : isFalse(s) ? "\u9519\u8bef" : ""; } return e; } } ], it = [ { type: "hook", name: "hook", match: location.host.includes("21tb.com"), main: e => { observeVuePageChange(J("#examIngEmsRightPanel")[0], (() => J("#examIngEmsRightPanel").attr("class"))); } }, { type: "ask", name: "21tb\u7b54\u9898", tips: "", match: () => location.host.includes("21tb.com") && location.href.includes("exercise/newExercise.fullExerciseTemp.do"), types: [ "0", "1", "3" ], question: { html: ".paper-content > .question-panel-middle", question: ".question-stem>.name", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (J(".view-paper-content").length > 0) return !1; }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const t = J(e.html).attr("class") || ""; switch (console.log(t), !0) { case t.includes("SINGLE"): e.type = "0"; break; case t.includes("MULTIPLE"): e.type = "1"; break; case t.includes("JUDGMENT"): e.type = "3", e.options = []; } return e; } }, { type: "save", name: "21tb\u6536\u5f55", match: () => location.host.includes("21tb.com") && location.href.includes("exercise/newExercise.fullExerciseTemp.do"), question: { html: "form > .question-panel-middle", question: ".question-stem>.name", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (console.log(J(".view-paper-content").length), 0 == J(".view-paper-content").length) return !1; }, answerHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const t = J(e.html).attr("questtype") || "", n = J(e.html).find(".true-answer").text().split("\uff1a")[1].trim(); switch (!0) { case t.includes("SINGLE"): e.type = "0", e.answer = n.split(", ").map((t => e.options[t.charCodeAt(0) - 65])); break; case t.includes("MULTIPLE"): e.type = "1", e.answer = n.split(", ").map((t => e.options[t.charCodeAt(0) - 65])); break; case t.includes("JUDGMENT"): e.type = "3", e.options = [], e.answer = judgeAnswer(n); } return console.log(e), e; } }, { type: "ask", name: "21tb\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.host.includes("21tb.com") && location.href.includes("ems/html/examCenter/fullExamTemp.do"), types: [ "0", "1", "3" ], question: { html: ".paper-content > .question-panel-middle", question: ".question-stem", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (J(".view-paper-content").length > 0) return !1; }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = J(e.html).find(".question-stem").clone(); t.find(".num").remove(), e.question = titleClean(removeHtml(t.html())).replace(/^\./, ""), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const n = J(e.html).attr("class") || ""; switch (console.log(n), !0) { case n.includes("SINGLE"): e.type = "0"; break; case n.includes("MULTIPLE"): e.type = "1"; break; case n.includes("JUDGMENT"): e.type = "3", e.options = []; } return e; } } ], ot = [ { type: "hook", name: "hook", match: location.host.includes("168wangxiao.com"), main: e => { observeVuePageChange(J("#app")[0], (() => (J(".question-submit-btn").text(), J(".question-submit-btn").text() || J(".listTit>span").text())), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === J(".el-loading-mask").length; })); } }), J("#app").length >= 1 && J("#app")[0]; } }, { type: "ask", name: "168\u7f51\u6821\u7b54\u9898", tips: "168\u7f51\u6821\u76ee\u524d\u652f\u6301\u9009\u62e9\u3001\u5224\u65ad\u3001\u586b\u7a7a\u3001\u7b80\u7b54\uff0c\u5176\u4ed6\u9898\u578b\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/learningCenter/details/"), types: [ "0", "1", "2", "3", "4" ], question: { html: ".question-item-container", question: ".title-content", options: ".options .opt-content", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => (await waitUntil((function() { return 0 !== J(".question-item-container").length; })), !J(".question-submit-btn").text().includes("\u91cd\u65b0\u7b54\u9898")), ischecked: isParentChecked, questionHook: e => { const t = J(e.html).find(".type").text(); return e.type = typeMatch(t), e; }, setAnswer: e => "4" !== e.type || (J(e.html).find(".ql-editor"), J(e.html).find(".ql-editor")[0].innerHTML = e.answer[0], !1) }, { type: "save", name: "168\u7f51\u6821\u7b54\u9898", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/learningCenter/details/"), question: { html: ".question-item-container", question: ".title-content", options: ".options .opt-content", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => (await waitUntil((function() { return 0 !== J(".question-item-container").length; })), J(".question-submit-btn").text().includes("\u91cd\u65b0\u7b54\u9898")), answerHook: e => { const t = J(e.html).find(".type").text(); switch (e.type = typeMatch(t), e.answer = J(e.html).find(".options .opt-content.is-correct-answer").map(((e, t) => removeHtml(J(t).html()))).get(), e.type) { case "2": e.options = [], e.answer = J(e.html).find(".analyze-container>.answer>.text-container>p").map(((e, t) => removeHtml(J(t).html()))).get(); break; case "3": e.options = [], e.answer = [ judgeAnswer(e.answer[0]) ]; break; case "4": e.options = [], e.answer = J(e.html).find(".analyze-container>.answer>.text-container").map(((e, t) => removeHtml(J(t).html()))).get(); } return e; } }, { type: "ask", name: "168\u7f51\u6821\u8003\u8bd5", tips: "", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/examination/answer"), types: [ "0", "1", "2", "3", "4" ], question: { html: ".Answer-area", question: ".listTit>span", options: ".el-checkbox-group>label", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => { await waitUntil((function() { return 0 !== J(".Answer-area").length; })); }, next: () => { J('button:contains("\u4e0b\u4e00\u9898")').click(); }, ischecked: isParentChecked, questionHook: e => (e.options = removeOptionsStartChar(e.options), e.type = typeMatch(J(".tit-type").text()), e), setAnswer: e => "4" !== e.type || (J(e.html).find(".ql-editor"), J(e.html).find(".ql-editor")[0].innerHTML = e.answer[0], !1) } ], st = /^\/web\/cc-detail\/([^/]+)\/act\/quiz-answer\/([^/?#]+)/, rt = /^\/web(?:-old)?\/index\.php$/, lt = { SINGLE: "0", MULTI: "1", TF: "3" }, getMosoteachQuizIds = (e = location.href) => { try { const t = new URL(e); if ("www.mosoteach.cn" !== t.hostname) return null; const n = t.pathname.match(st); return n ? { ccId: n[1], quizId: n[2] } : null; } catch { return null; } }, isMosoteachQuizAnswerUrl = (e = location.href) => null !== getMosoteachQuizIds(e), isMosoteachLegacyQuizReplyUrl = (e = location.href) => { try { const t = new URL(e); return "www.mosoteach.cn" === t.hostname && (!!rt.test(t.pathname) && ("interaction_quiz" === t.searchParams.get("c") && "reply" === t.searchParams.get("m"))); } catch { return !1; } }, isMosoteachAskUrl = (e = location.href) => isMosoteachQuizAnswerUrl(e) || isMosoteachLegacyQuizReplyUrl(e), getOptionNo = e => e.itemNo ?? e.item_no ?? 0, getSortedOptions = e => [ ...e.options || [] ].sort(((e, t) => getOptionNo(e) - getOptionNo(t))), getMosoteachTopicOptions = (e, t) => t(getSortedOptions(e).map((e => e.content || ""))), ct = ".topic-answer-align,.t-option.t-item label,.t-judge.t-item label", pt = ".v-chip__content,.t-type", dt = "__aiAskMosoteachRouteHook", ut = "__aiAskMosoteachHref", ht = "__aiAskMosoteachRouteTimer"; let mt = []; const ft = { cleanText: (e = "") => titleClean(removeHtml(e)), cleanOptions: e => removeStartChar(e.map((e => removeHtml(e)))), judgeAnswer: judgeAnswer }, getMosoteachQuestionType = (e = "", t = []) => ((e = "", t = []) => { const n = lt[e.trim()]; return "0" === n && (e => 2 === e.length && e.every((e => /^(\u6b63\u786e|\u9519\u8bef|\u5bf9|\u9519|\u662f|\u5426|T|F|true|false)$/i.test(e.trim()))))(t) ? "3" : n || ""; })(e, t) || typeMatch(e), getMosoteachQuestionElements = () => isMosoteachLegacyQuizReplyUrl() ? J(".topic-item") : J(".pt-10.d-flex.list-item:has(.topic-subject):has(.topic-answer-align)"), getMosoteachLegacyTopics = () => { var e, t; const n = J("#app")[0], a = null == (t = null == (e = null == n ? void 0 : n.__vue__) ? void 0 : e.$data) ? void 0 : t.topics; return Array.isArray(a) ? a : []; }, cacheMosoteachAnswer = e => { const t = ((e, t, n, a) => { const i = a.cleanText(e), o = ((e, t) => t(e).sort().join("\n"))(t, a.cleanOptions); return n.find((e => { const t = getMosoteachTopicOptions(e, a.cleanOptions).sort().join("\n"); return a.cleanText(e.subject || "") === i && t === o; })); })(e.question, e.options, mt, ft); if (!t) return; const n = ((e, t) => { const n = t.cleanOptions(getSortedOptions(e).map((e => e.content || ""))); return Array.isArray(e.answers) && e.answers.length > 0 ? e.answers.map((e => n[e] || "")).filter(Boolean) : "TF" === e.type ? t.judgeAnswer(e.tfAnswer || "") : []; })(t, ft); if (!n.length) return; const a = { type: e.type, question: e.question, options: "3" === e.type ? [] : e.options, answer: n }; Answer.cacheAnswer(a); }, parseMosoteachDomQuestion = e => { const t = J(e.html), n = t.find(".topic-subject").first().text(), a = t.find(".topic-answer-align"); if (!n || !a.length) return e; e.question = ft.cleanText(n); const i = a.map(((e, t) => J(t).find(".topic-answer").first().text() || J(t).text())).get(); return e.options = ft.cleanOptions(i), e.$options = (e => J(e.map(((e, t) => J(t).closest("label,.d-flex.align-start")[0] || t)).get()))(a), e.type = getMosoteachQuestionType(t.find(".v-chip__content").first().text(), e.options), cacheMosoteachAnswer(e), e; }, parseMosoteachLegacyQuestion = (e, t) => { const n = J(e.html), a = getMosoteachLegacyTopics()[t], i = n.find(ct), o = i.map(((e, t) => J(t).text())).get(); if (a) e.question = ft.cleanText(a.subject || ""), e.options = ((e, t, n) => { const a = n(t); return a.length ? a : getMosoteachTopicOptions(e || {}, n); })(a, o, ft.cleanOptions), e.type = getMosoteachQuestionType(a.type, e.options); else { const t = n.find(".t-subject").first().text(); e.question = ft.cleanText(t || e.question), e.options = ft.cleanOptions(o.length ? o : e.options), e.type = getMosoteachQuestionType(n.find(pt).first().text() || e.type, e.options); } return i.length && (e.$options = i), cacheMosoteachAnswer(e), e; }, watchMosoteachRouteChange = () => { const e = ce; if (e[dt]) return; e[dt] = !0, e[ut] = location.href; const checkRouteChange = () => { e[ut] !== location.href && (e[ut] = location.href, clearTimeout(e[ht]), e[ht] = setTimeout((() => vuePageChange()), 100)); }, bindHistoryChange = e => { const t = history[e]; history[e] = function(...e) { const n = t.apply(this, e); return setTimeout(checkRouteChange, 0), n; }; }; bindHistoryChange("pushState"), bindHistoryChange("replaceState"), window.addEventListener("popstate", (() => setTimeout(checkRouteChange, 0))); }, gt = [ { type: "hook", name: "\u4e91\u73ed\u8bfe\u8def\u7531\u76d1\u542c", match: () => "www.mosoteach.cn" === location.host, main: () => { watchMosoteachRouteChange(); } }, { type: "ask", name: "\u4e91\u73ed\u8bfe\u7b54\u9898", tips: "", match: () => "www.mosoteach.cn" === location.host && isMosoteachAskUrl(), types: [ "0", "1", "3" ], question: { html: getMosoteachQuestionElements, question: ".topic-subject,.t-subject", options: ct, type: pt, workType: "mosoteach", pageType: "mosoteach" }, init: async () => { if (await sleep(500), !isMosoteachAskUrl()) return mt = [], !1; return !!(await (async () => { for (let e = 0; e < 30; e++) { if (getMosoteachQuestionElements().length > 0) return !0; await sleep(200); } return !1; })()) && (mt = isMosoteachQuizAnswerUrl() ? await (async () => { const e = getMosoteachQuizIds(), t = localStorage.getItem("teach_token") || ""; if (!e || !t) return []; try { const n = await fetch(`https://coreapi.mosoteach.cn/ccs/${e.ccId}/quizzes/${e.quizId}/topics?_ts=${Date.now()}`, { headers: { accept: "application/json, text/plain, */*", "x-client-app-id": "MTWEB", "x-client-version": "6.0.0", "x-security-type": "SECURITY_TYPE_TOKEN", "x-token": t }, credentials: "omit" }); if (!n.ok) return []; const a = await n.json(); return Array.isArray(null == a ? void 0 : a.topics) ? a.topics : []; } catch (n) { return []; } })() : getMosoteachLegacyTopics(), !0); }, ischecked: e => { const t = e.find("input").add(e.closest("label,.d-flex.align-start").find("input")).first(); return e.hasClass("is-checked") || e.hasClass("v-item--active") || t.prop("checked") || "true" === t.attr("aria-checked"); }, questionHook: (e, t) => isMosoteachLegacyQuizReplyUrl() ? parseMosoteachLegacyQuestion(e, t) : parseMosoteachDomQuestion(e) } ], yt = [ { type: "hook", name: "hook", match: "www.learnin.com.cn" === location.host, main: e => { observeVuePageChange(J("#app")[0], (() => { try { return J(".page-student-course-topic-do-container")[0].__vue__.$data.topic.studentTopic.id; } catch (e) { return ""; } })); } }, { type: "save", name: "learnin\u6536\u5f55", match: () => "www.learnin.com.cn" === location.host && location.href.includes("/user/#/user/student/course/") && 0 == J("button:contains('\u63d0\u4ea4\u4f5c\u4e1a')").length, question: { html: ".store-question-item-container", question: ".question-title", options: ".question-info>.question-option-list>.option-item", type: ".item-question-header>.header-left", workType: "learnin", pageType: "learnin" }, init: async () => { await waitUntil((function() { return isExist(".store-question-item-container"); })); }, answerHook: (e, t) => { const n = J(".store-question-item-container").eq(t)[0].__vue__.question; switch (n.questionTypeCode) { case "judgment": e.type = "3"; break; case "single": e.type = "0"; break; case "multiple": e.type = "1"; break; default: return e; } e.question = titleClean(removeHtml(n.questionTitle)); let a = [], i = []; return n.optionList.forEach((e => { const t = removeHtml(e.content); e.isAnswer && i.push(t), a.push(t); })), e.options = a, e.answer = i, "3" == e.type && (e.options = [], e.answer = judgeAnswer(i[0])), e; } }, { type: "ask", name: "learnin\u7b54\u9898", tips: "", match: () => "www.learnin.com.cn" === location.host && location.href.includes("/user/#/user/student/course/") && 1 == J("button:contains('\u63d0\u4ea4\u4f5c\u4e1a')").length, types: [ "0", "1", "3" ], question: { html: ".store-question-item-container", question: ".question-title", options: ".question-info>.question-option-list>.option-item>.option-index", type: ".item-question-header>.header-left", workType: "learnin", pageType: "learnin" }, init: async () => { await waitUntil((function() { return isExist(".store-question-item-container"); })); }, ischecked: e => e.hasClass("active"), questionHook: (e, t) => { const n = J(e.html)[0].__vue__.question; switch (n.questionTypeCode) { case "judgment": e.type = "3"; break; case "single": e.type = "0"; break; case "multiple": e.type = "1"; break; default: return e; } e.question = titleClean(removeHtml(n.questionTitle)); let a = []; return n.optionList.forEach((e => { const t = removeHtml(e.content); a.push(t); })), e.options = a, "3" == e.type && (e.options = []), e; } } ], vt = [ { type: "hook", name: "hook", match: location.host.includes("ouchn.edu.cn"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u7535\u5927\u7b54\u9898", tips: "", match: () => location.host.includes("ouchn.edu.cn") && location.href.includes("learningPlatform/#/myExamDetails/examQuestion"), types: [ "0" ], question: { html: ".everyQuest", question: ".topicTitle", options: ".optionList .topicTitle", type: ".question-box .tag", workType: "ouchn", pageType: "ouchn" }, init: async () => { await waitUntil((function() { return isExist(".everyQuest"); })); }, ischecked: isParentChecked, questionHook: e => (e.type = "0", e) }, { type: "save", name: "\u7535\u5927\u6536\u5f55", match: () => location.host.includes("ouchn.edu.cn") && location.href.includes("learningPlatform/#/myExamDetails/testPaper"), question: { html: ".everyQuest", question: ".topicTitle", options: ".optionList .topicTitle", type: ".question-box .tag", workType: "ouchn", pageType: "ouchn" }, init: async () => { await waitUntil((function() { return isExist(".everyQuest"); })); }, answerHook: e => { const t = J(e.html).find('.rightAndWrong>span:contains("\u6b63\u786e\u7b54\u6848")').text().replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), n = e.options; let a = []; return t.split("").forEach((e => { a.push(n[e.charCodeAt(0) - 65]); })), 1 == a.length ? e.type = "0" : e.type = "1", e.answer = a, e; } } ], bt = [ { type: "hook", name: "mooc", match: "www.icourse163.org" === location.host, main: e => { observeVuePageChange(J("#courseLearn-inner-box")[0], (() => J("#courseLearn-inner-box > div:eq(0)").attr("class")), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === J(".el-loading-mask").length; })); } }); } }, { type: "ask", name: "mooc\u7b54\u9898", tips: "\u4e2d\u56fd\u5927\u5b66MOOC\u9650\u5236\u7b54\u9898\u901f\u5ea6\uff0c\u8bf7\u4e0d\u8981\u8fc7\u5feb", match: () => "www.icourse163.org" === location.host && location.href.includes("#/learn/quiz?id="), types: [ "0", "1", "2", "3" ], question: { html: ".u-questionItem", question: ".f-richEditorText", options: "ul.choices>li>input", type: ".qaCate.j-qacate.f-fl", workType: "mooc", pageType: "mooc" }, init: async () => { await waitUntil((function() { return J(".u-questionItem").length, 0 !== J(".u-questionItem").length; })); }, ischecked: isParentChecked, questionHook: (e, t) => { J(e.html).find(".qaCate.j-qacate.f-fl > span:eq(0)").attr("class"); const n = ce.learnUtilQuestionList[t]; switch (e.question = removeHtml(n.title), e.options = n.options.map((e => removeHtml(e.content))), n.type) { case 1: e.type = "0"; break; case 2: e.type = "1"; break; case 3: e.type = "2"; break; case 4: e.type = "3", e.options = []; break; default: n.type, e.type = "8"; } return e; }, setAnswer: e => { switch (e.type) { case "2": return J(e.html).find(".u-baseinputui>textarea").each(((t, n) => { J(n).val(e.answer[t]), J(n).focus(), J(n).blur(); })), !1; case "3": let t = e.answer; J(e.html).find("ul.choices>li").each(((e, n) => { isTrue(t) && J(n).find(".u-icon-correct").length > 0 && J(n).find("input").click(), isFalse(t) && J(n).find(".u-icon-wrong").length > 0 && J(n).find("input").click(); })); } return !0; } }, { type: "save", name: "\u4e2d\u56fd\u5927\u5b66mooc\u6536\u5f55", match: () => "www.icourse163.org" === location.host && location.href.includes("#/learn/quizscore?id="), question: { html: ".u-questionItem", question: ".f-richEditorText", options: "ul.choices li>input", type: ".qaCate.j-qacate.f-fl", workType: "mooc", pageType: "mooc" }, init: async () => { await waitUntil((function() { return J(".u-questionItem").length, 0 !== J(".u-questionItem").length; })); }, answerHook: (e, t) => { const n = ce.learnUtilQuestionList[t]; e.question = removeHtml(n.title); let a = [], i = []; switch (n.options.forEach((e => { a.push(removeHtml(e.content)), e.answer && i.push(removeHtml(e.content)); })), e.options = a, e.answer = i, n.type) { case 1: e.type = "0"; break; case 2: e.type = "1"; break; case 3: e.type = "2", e.answer = [ n.stdAnswer ]; break; case 4: e.type = "3", e.options = []; break; default: n.type; } return e; } } ], xt = [ { type: "ask", name: "\u897f\u8d22\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.href.includes("learnspace/course/test/coursewareTest_intoRedoTestPage.action") || location.href.includes("learnspace/learn/learn/templateeight/index.action") || location.href.includes("learnspace/course/test/coursewareTest_intoTestPage.action"), types: [ "0", "1", "3" ], question: { html: ".bank_test > .test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label, .test_item_theme>label", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { await waitUntil((function() { return isExist(".bank_test > .test_item"); })); }, ischecked: isParentChecked, questionHook: e => { const t = J(e.html).find(".test_item_tit").clone(); if (t.find(".tipNodo").remove(), e.question = removeHtml(t.html()), e.question = titleClean(e.question), e.type = typeMatch(J(e.html).prevAll(".test_item_type").first().text()), e.question = e.question.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim().replace(/^\d+ ./, "").trim(), e.options = removeStartChar(e.options), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u897f\u8d22\u5728\u7ebf\u9636\u6bb5\u6d4b\u9a8c\u6536\u5f55", match: () => location.href.includes("learnspace/course/test/coursewareTest_intoTestAnswerPage.action") || location.href.includes("learnspace/learn/learn/templateeight/index.action"), question: { html: ".bank_test > .test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>.zdh_op_con", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => {}, answerHook: e => { e.type = typeMatch(J(e.html).prevAll(".test_item_type").first().text()), e.question = e.question.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim().replace(/^\d+ ./, "").trim(), e.options = removeStartChar(e.options); const t = J(e.html).find(".test_item_key_tit").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(); switch (e.type) { case "0": case "1": e.answer = t.split("").map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })); break; case "3": e.answer = judgeAnswer(t), e.options = []; } return e; } }, { type: "ask", name: "\u897f\u8d22\u5728\u7ebf\u7efc\u5408\u7ec3\u4e60\u7b54\u9898", tips: "\u897f\u8d22\u5728\u7ebf\u6536\u5f55\u8bf7\u91cd\u65b0\u70b9\u51fb\u9898\u578b\u5207\u6362\u89e6\u53d1", match: () => location.host.includes("swufe-online.com") && location.href.includes("/learnspace/userDefine/t_test.jsp?courseId="), types: [ "0", "1", "3" ], question: { html: ".timu_title", question: ".timu_title", options: ".test_item_theme>ul>li", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { if (await waitUntil((function() { return isExist(".timu_title"); })), !document.body.innerHTML.includes("\u63d0\u4ea4\u7b54\u9898\u540e\u663e\u793a")) return !1; J(".layui-tab-title>li").on("click", (function() { vuePageChange(); })); }, ischecked: isParentChecked, questionHook: (e, t) => { const n = J(e.html).attr("id"); return e.type = typeMatch(J(".layui-this").text()), e.question = removeHtml(J(e.html).html()), e.options = J(`#${n}`).map((function() { let t = [], n = J(this).next(), a = []; for (;n.length && n.hasClass("question-item-opt"); ) a.push(removeHtml(n[0].outerHTML)), t.push(n), n = n.next(); return e.$options = J(t.map((e => e[0]))).find("label"), a; })).get(), e.options = removeStartChar(e.options), e; } }, { type: "save", name: "\u897f\u8d22\u5728\u7ebf\u7efc\u5408\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("swufe-online.com") && location.href.includes("/learnspace/userDefine/t_test.jsp?courseId="), question: { html: ".timu_title", question: ".timu_title", options: ".test_item_theme>ul>li", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { if (await waitUntil((function() { return isExist(".timu_title"); })), document.body.innerHTML.includes("\u63d0\u4ea4\u7b54\u9898\u540e\u663e\u793a")) return !1; J(".layui-tab-title>li").on("click", (function() { vuePageChange(); })); }, answerHook: e => { const t = J(e.html).attr("id"); switch (e.type = typeMatch(J(".layui-this").text()), e.question = removeHtml(J(e.html).html()), e.options = J(`#${t}`).map((function() { let t = [], n = J(this).next(), a = []; for (;n.length && n.hasClass("question-item-opt"); ) a.push(removeHtml(n[0].outerHTML)), t.push(n), n = n.next(); return e.$options = J(t.map((e => e[0]))).find("label"), a; })).get(), e.options = removeStartChar(e.options), e.type) { case "0": case "1": const n = J(`#${t}`).nextAll(".ans").first().find("span:eq(0)").text(); e.answer = n.trim().split("").map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })); break; case "3": e.answer = judgeAnswer(J(`#${t}`).nextAll(".ans").first().find("span:eq(0)").text().trim()), e.options = []; break; case "7": case "4": e.answer = removeHtml(J(`#${t}`).nextAll(".ans").first().html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.options = []; break; default: e.type; } return e; } } ], wt = [ { type: "ask", name: "\u91cd\u5e86\u6cd5\u6cbb\u8003\u8bd5\u7b54\u9898", tips: "\u672c\u5e73\u53f0\u65e0\u7b54\u6848\u6536\u5f55\uff0c\u9700\u8981\u81ea\u884c\u8865\u5145\u9898\u5e93\uff0c\u5efa\u8bae\u4f7f\u7528\u9898\u5e93\u5bfc\u5165\u529f\u80fd", match: () => "ks.cqsdx.cn" === location.host && location.pathname.includes("/exam/user/bind"), types: [ "0", "1", "3" ], question: { html: ".qlist", question: "span:eq(1)", options: "label", type: ".badge.badge-danger", workType: "cqsdx", pageType: "cqsdx" }, init: async () => { await waitUntil((function() { return isExist(".qlist"); })); }, toquestion: e => { J(`#question_card button:eq(${e})`).click(); }, ischecked: e => e.find("div").hasClass("checked"), questionHook: e => { const t = J(e.html).find(".badge.badge-danger").text(); if (e.type = typeMatch(t), e.question = e.question.replace(/\u206B/g, "").trim(), e.options = e.options.map((e => e.replace(/\u206B/g, "").trim())), "3" === e.type) e.options = []; return e; } } ], kt = [ { type: "hook", name: "hook", match: location.host.includes("telfri-edu.com"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "olearn\u7b54\u9898", tips: "", match: () => location.host.includes("telfri-edu.com") && location.href.includes("/learn/homework/do/"), types: [ "0", "1", "3" ], question: { html: ".topic-group>.topic-container", question: ".topic-title", options: ".topic-answer .radio-wrap .radio-text", type: ".question-box .tag", workType: "olearn", pageType: "olearn" }, init: async () => { await waitUntil((function() { return isExist(".topic-group>.topic-container"); })); }, ischecked: e => e.hasClass("is-active"), questionHook: e => { let t = J(e.html).prevAll(".topic-title").first().find(".title-bold").text().trim(); return e.$options = J(e.html).find(".topic-answer .radio-wrap>label"), e.type = typeMatch(t), e; } }, { type: "save", name: "olearn\u6536\u5f55", match: () => location.host.includes("telfri-edu.com") && location.href.includes("/learn/homework/show/"), question: { html: ".topic-group>.topic-container", question: ".topic-title", options: ".topic-answer .radio-wrap .radio-text", type: ".question-box .tag", workType: "olearn", pageType: "olearn" }, init: async () => { await waitUntil((function() { return isExist(".topic-group>.topic-container"); })); }, answerHook: e => { let t = J(e.html).prevAll(".topic-title").first().find(".title-bold").text().trim(); e.type = typeMatch(t); const n = J(e.html).find(".standard-answer>.analysis-text").text().trim(); switch (e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.options = [], e.answer = judgeAnswer(n); } return e; } } ], _t = [ { type: "hook", name: "hook", match: location.host.includes("yxbyun.com"), main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); } }, { type: "save", name: "\u4ebf\u5b66\u5b9d\u6536\u5f55", match: () => location.host.includes("yxbyun.com") && (location.href.includes("yxbstudent/#/testPaper") || location.href.includes("yxbstudent/#/finalExam")), question: { html: ".test_wrap", question: ".content", options: ".el-radio-group input", type: ".question-box .tag", workType: "yxbyun", pageType: "yxbyun" }, init: async () => { await waitUntil((function() { return isExist(".test_wrap"); })); }, answerHook: e => { var t; const n = J(e.html).find("div:eq(0)")[0].__vue__, a = (null == (t = n.pagerData) ? void 0 : t.question) || n.smallPaper.questionTopic; return e.type = typeMatch(n.queTypeName), e.question = titleClean(removeHtml(a.questionTitle)), e.options = (a.optionList || a.questionOptionList).map((e => removeHtml(e.questionContent))), [ "0", "1", "3" ].includes(e.type) && (e.answer = a.questionAnswer.split(",").map((t => e.options[t.charCodeAt(0) - 65]))), "3" === e.type && (e.options = [], e.answer = judgeAnswer(e.answer)), e; } }, { type: "ask", name: "\u4ebf\u5b66\u5b9d\u7b54\u9898", match: () => location.host.includes("yxbyun.com") && (location.href.includes("yxbstudent/#/testPaper") || location.href.includes("yxbstudent/#/finalExam")), types: [ "0", "1", "3" ], question: { html: ".test_wrap", question: ".content", options: ".answer>.daan,.el-radio-group>label", type: ".question-box .tag", workType: "yxbyun", pageType: "yxbyun" }, init: async () => { await waitUntil((function() { return isExist(".test_wrap"); })); }, ischecked: e => e.hasClass("active"), questionHook: e => { var t; const n = J(e.html).find("div:eq(0)")[0].__vue__, a = (null == (t = n.pagerData) ? void 0 : t.question) || n.smallPaper.questionTopic; if (e.type = typeMatch(n.queTypeName), e.question = titleClean(removeHtml(a.questionTitle)), e.options = (a.optionList || a.questionOptionList).map((e => removeHtml(e.questionContent))), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).parent().html())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).parent().html())) && J(n).click(), removeHtml(J(n).parent().html()); })), !1; } return !0; } } ], qt = [ { type: "hook", name: "hook", match: location.host.includes("wdjycj.com") || location.host.includes("iwdjy.com"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "save", name: "\u6587\u9876\u5728\u7ebf\u6536\u5f55", match: () => location.href.includes("/testpaper-test-result?resultId=") || location.href.includes("/testpaper-test?id"), question: { html: ".st-item", question: ".st-title", options: ".st-main>p", type: ".question-box .tag", workType: "wdzx", pageType: "wdzx" }, init: async () => { await waitUntil((function() { return isExist(".st-item"); })); let e = []; try { J(".exam-html")[0].__vue__.test.lists.forEach(((t, n) => { t.question_lists.forEach(((t, n) => { e.push(t); })); })); } catch (t) {} unsafeWindow.ques = e; }, answerHook: (e, t) => { var n; const a = unsafeWindow.ques[t], i = []; switch (e.question = titleClean(removeHtml(a.content)), e.options = (null == (n = a.appanswer) ? void 0 : n.map((e => { const t = removeHtml(e.text); return e.right && i.push(t), removeHtml(t); }))) || [], a.tm_type) { case 4: e.type = "3", e.answer = judgeAnswer("1" == a.answer ? "\u6b63\u786e" : "0" == a.answer ? "\u9519\u8bef" : ""); break; case 5: e.type = "2", e.question = e.question.replace(/{#answer}/g, "_____"), e.answer = a.answer.split("|").map((e => e.includes("\u203b") ? e.split("\u203b")[0] : e)); break; case 2: e.type = "0", e.answer = i; break; case 3: e.type = "1", e.answer = i; break; case 1: e.type = "4", e.answer = removeHtml(a.answer); break; default: a.tm_type; } return e; } }, { type: "ask", name: "\u6587\u9876\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.href.includes("/testpaper-test?id=") || location.href.includes("/final-exam"), types: [ "0", "1", "2", "3" ], question: { html: ".st-item", question: ".st-title", options: ".st-main>p", type: ".question-box .tag", workType: "wdzx", pageType: "wdzx" }, init: async () => { await waitUntil((function() { return isExist(".st-item"); })); }, toquestion: e => { J(`.card-box .bj:eq(${e})`).click(); }, ischecked: e => J(e).find("input").prop("checked"), questionHook: (e, t) => { e.options = removeOptionsStartChar(e.options); const n = J(e.html).find(".st-title").clone(); J(n).find("strong").remove(), e.question = removeHtml(J(n).html()); let a = J(e.html).prevAll(".title").first().text().trim(); return e.type = typeMatch(a), e.$options = J(e.html).find(".answer-box>.answer>label"), e; }, setAnswer: e => { switch (e.type) { case "4": case "5": case "6": case "7": return J(e.html).find(".answer-text>div")[0].__vue__.msg.yourAnswer = e.answer[0], J(e.html).find(".quill-editor").map(((t, n) => { n.__vue__.value = e.answer[t]; })), !1; case "2": let setYourAnswerById = function(e, t, n) { for (let a of e) if (Array.isArray(a.itemlists)) for (let e of a.itemlists) if (e.id === t) return e.yourAnswer = n, !0; return !1; }; const t = J(e.html).find("span.bj input").attr("name"); return setYourAnswerById(J(".exam-html")[0].__vue__.answerCard, Number(t), e.answer), e.answer, !1; } return !0; } } ], cleanOptionText = e => e.replace(/ /g, " ").replace(/\uff08\u60a8\u7684\u9009\u62e9\uff09/g, "").replace(/\uff08\u6b63\u786e\u7b54\u6848\uff09/g, "").replace(/^\s*[A-Z]\s*[\.\u3001\uff0e]\s*/, "").replace(/\s+/g, " ").trim(), getSectionType = e => { const t = J(e)[0]; if (!t) return typeMatch(""); const n = (t.closest(".exam-section") || document).querySelectorAll(".section-title, .exam-title"); let a = ""; for (let i = 0; i < n.length; i++) { const e = n[i]; if (!(e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING)) break; a = e.textContent || ""; } return typeMatch(a); }, At = [ { type: "ask", name: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u7b54\u9898", tips: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u4ec5\u652f\u6301\u9009\u62e9\u3001\u5224\u65ad\u9898\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301\uff0c\u82e5\u6709\u9700\u8981\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.href.includes("/student/study/examPage") && !location.href.includes("/student/study/examPageShow"), question: { html: ".question-item", question: ".question-content", options: ".answer-option", type: "", workType: "whut", pageType: "whut" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-item").length; })); }, ischecked: e => e.find("input").is(":checked"), questionHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\s*[\u3001.\uff09)]/, "").trim(); const t = []; return e.$options.each(((e, n) => { const a = J(n).clone(); a.find(".el-radio__input, .el-checkbox__input, input").remove(), t.push(cleanOptionText(a.text())); })), e.options = t, e.type = getSectionType(e.html), e.type, e; } }, { type: "save", name: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u6536\u5f55", match: () => location.href.includes("/student/study/examPageShow"), question: { html: ".question-item", question: ".question-content", options: ".option-item", type: "", workType: "whut", pageType: "whut" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-item").length && 0 !== J(".question-item .correct-answer, .question-item .option-item.correct").length; })); }, answerHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\s*[\u3001.\uff09)]/, "").trim(); const t = []; e.$options.each(((e, n) => { const a = J(n).clone(); a.find(".option-label, .user-choice, .correct-answer").remove(), t.push(cleanOptionText(a.text())); })), e.options = t, e.type = getSectionType(e.html); const n = []; return e.$options.each(((t, a) => { (J(a).hasClass("correct") || J(a).find(".correct-answer").length > 0) && n.push(e.options[t]); })), "3" === e.type ? (e.answer = n.length ? n[0] : "", e.options = []) : e.answer = n, e; } } ], Tt = [ { type: "save", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u6536\u5f55", match: () => location.host.includes("dufe.edu.cn") && (location.href.includes("/HomeWorkPaper") || location.href.includes("/HomeWorkHistoryPaper") || location.href.includes("/ExercisesPaper")), question: { html: ".QuestTrunk,.HistoryQuestTrunk", question: ".CBTPaperMain-divInline", options: ".CBTPaperMain-options li", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => { await waitUntil((function() { return isExist(".QuestTrunk,.HistoryQuestTrunk"); })); }, answerHook: e => { const t = e.html.vtree[0].vmodel._trunks[0], n = e.html.vtree[0].vmodel._type; let a = [], i = []; const getOption = () => { t.QUESTION_OPTIONS.forEach((e => { const t = removeHtml(e.OPTION_CONTENT); "1" === e.ISTRUE && a.push(t), i.push(t); })); }; switch (n) { case "001": e.type = "0", getOption(); break; case "002": e.type = "1", getOption(); break; case "004": e.type = "3", e.options = [], a = "1" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u6b63\u786e" ] : "0" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u9519\u8bef" ] : []; break; case "005": e.type = "4", a = [ removeHtml(t.QUESTION_OPTIONS[0].OPTION_CONTENT) ]; } return e.question = titleClean(t.QUESTION_TITLE), e.options = i, e.answer = a, e; } }, { type: "ask", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u7b54\u9898", match: () => location.host.includes("dufe.edu.cn") && (location.href.includes("/HomeWorkPaper") || location.href.includes("/ExercisesPaper")), types: [ "0", "1", "3", "4" ], question: { html: ".QuestTrunk", question: ".CBTPaperMain-divInline", options: ".CBTPaperMain-options li>label", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => {}, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = e.html.vtree[0].vmodel._trunks[0], n = e.html.vtree[0].vmodel._type; let a = [], i = []; const getOption = () => { t.QUESTION_OPTIONS.forEach((e => { const t = removeHtml(e.OPTION_CONTENT); "1" === e.ISTRUE && a.push(t), i.push(t); })); }; switch (n) { case "001": e.type = "0", getOption(); break; case "002": e.type = "1", getOption(); break; case "004": e.type = "3", e.options = [], a = "1" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u6b63\u786e" ] : "0" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u9519\u8bef" ] : []; break; case "005": e.type = "4", a = [ removeHtml(t.QUESTION_OPTIONS[0].OPTION_CONTENT) ]; } return e.question = titleClean(t.QUESTION_TITLE), e.options = i, e.answer = a, e; }, setAnswer: e => { if ("4" === e.type) { const t = J(e.html).find("textarea")[0]; return t._ms_context_._answer = e.answer[0], t._ms_context_._save(), !1; } return !0; } }, { type: "ask", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u7b54\u9898(\u7efc\u5408)", match: () => location.host.includes("dufe.edu.cn") && location.href.includes("/CompHomeworkPaper"), types: [ "0", "1", "3", "4" ], question: { html: ".Question", question: ".CBTPaperMain-trunkTitle", options: "ul.Question-options>li", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => {}, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = (e => { var t; if (e) { const n = Object.keys(e).find((e => e.startsWith("__reactEventHandlers"))); if (n) { const t = e[n]; return console.log("React \u4e8b\u4ef6\u5904\u7406\u5bf9\u8c61:", t), t; } if (!n) { const n = Object.keys(e).find((e => e.startsWith("__reactInternalInstance$") || e.startsWith("__reactFiber$"))); if (n && (null == (t = e[n]) ? void 0 : t.memoizedProps)) return console.log("React \u5185\u90e8\u6570\u636e:", e[n].memoizedProps), e[n].memoizedProps; } } else console.error("\u672a\u627e\u5230 .Question \u5143\u7d20"); })(e.html).children[0]._owner.memoizedProps; return e.type = { SingleChoice: "0", MultipleChoice: "1" }[t.type], e.options = removeStartChar(e.options), e; }, setAnswer: e => { if ("4" === e.type) { const t = J(e.html).find("textarea")[0]; return t._ms_context_._answer = e.answer[0], t._ms_context_._save(), !1; } return !0; } } ], Ct = { single: "0", multiple: "1", judge: "3" }, St = [ { type: "hook", name: "hook", match: location.host.includes("lygtc.edu.cn"), main: () => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); } }, { type: "save", name: "\u6625\u98ce\u96e8\u6536\u5f55", match: () => location.host.includes("lygtc.edu.cn") && (location.href.includes("/student/#/my-study/homework/records/detail") || location.href.includes("/student/#/my-study/homework")), question: { html: ".questions>div>div[id],.question>div>div[id]", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "cfy", pageType: "cfy" }, init: async () => { await waitUntil((() => 0 !== J(".questions>div>div[id],.question>div>div[id]").length)); }, answerHook: e => { const t = J(e.html).find(">div")[0].__vue__.question; return e.question = titleClean(removeHtml(t.title)), e.options = JSON.parse(t.options).map((e => e.content)), e.answer = t.answer.split("").map((t => e.options[t.charCodeAt(0) - 65])).filter(Boolean), e.type = Ct[t.type] || "", "judge" === t.type && (e.options = [], e.answer = [ judgeAnswer(t.answer) ]), t.type, e; } }, { type: "ask", name: "\u6625\u98ce\u96e8\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("lygtc.edu.cn") && location.href.includes("/student/#/my-study/homework"), types: Object.values(Ct), question: { html: ".question>div>div[id]", question: ".question-title>.title", options: ".radio-option", type: ".question-box .tag", workType: "cfy", pageType: "cfy" }, init: async () => { await waitUntil((() => 0 !== J(".question>div>div[id]").length)); }, ischecked: e => e.find(".el-radio__input.is-checked").length > 0, questionHook: e => { e.options = removeStartChar(e.options); const t = J(e.html).find(">div")[0].__vue__.question; return e.question = titleClean(removeHtml(t.title)), e.options = JSON.parse(t.options).map((e => e.content)), e.type = Ct[t.type] || "", "judge" === t.type && (e.options = [], e.answer = [ judgeAnswer(t.answer) ]), e; } } ], Et = [ { type: "hook", name: "hook", match: location.host.includes("jijiaool.com"), main: e => { observeVuePageChange(J(".contentIframe")[0], (() => J(".contentIframe").attr("src"))); } }, { type: "ask", name: "\u7ee7\u6559\u5728\u7ebf\u7b54\u9898", match: () => location.href.includes("jijiaool.com") && location.href.includes("/Learning/CourseOnlineExamination"), types: [ "0", "1" ], question: { html: ".bank_test>.test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label", type: ".question-box .tag", workType: "jijiaool", pageType: "jijiaool" }, init: async () => { await waitUntil((function() { return isExist(".bank_test>.test_item"); })); }, ischecked: isParentChecked, questionHook: e => { e.options = removeOptionsStartChar(e.options); const t = J(e.html).prevAll(".test_item_type").first().text().trim(); return e.type = typeMatch(t), e; } }, { type: "save", name: "\u7ee7\u6559\u5728\u7ebf\u6536\u5f55", match: () => location.href.includes("jijiaool.com") && location.href.includes("/Learning/CourseExamWorkPageDetail"), question: { html: ".bank_test>.test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label", type: ".question-box .tag", workType: "jijiaool", pageType: "jijiaool" }, init: async () => { await waitUntil((function() { return isExist(".bank_test>.test_item"); })); }, answerHook: e => { const t = J(e.html).find(".test_item_tit").clone(); t.find(".tipNodo").remove(), e.question = titleClean(removeHtml(t.html())), e.options = removeOptionsStartChar(e.options); const n = removeHtml(J(e.html).find(".test_item_tit:eq(1)").html().replace(/ \u6b63\u786e\u7b54\u6848\uff1a/g, "").trim()), a = J(e.html).prevAll(".test_item_type").first().text().trim(); switch (e.type = typeMatch(a), e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.answer = judgeAnswer(n), e.options = []; } return e; } } ], It = [ { type: "save", name: "\u5317\u4eac\u8054\u5927\u5b66\u5802\u6536\u5f55", match: () => location.host.includes("jxjypt.cn") && location.href.includes("/paper/start?pid="), question: { html: "#questionModule>ul>li", question: ".sub-dotitle>pre", options: "dl.sub-answer>dd", type: ".sub-dotitle>i", workType: "jhjypt", pageType: "jhjypt" }, init: async () => {}, answerHook: e => { let t = removeHtml(J(e.html).find(".refer-answer>span>em.right ,.solution .so-timu .wenzi:eq(0)").html()); if (void 0 === t || "undefined" == t) return null; switch (e.options = removeStartChar(e.options), e.type = typeMatch(removeHtml(J(e.html).find(".sub-dotitle>i").text().replace("\n", "").replace(" ", ""))), e.type) { case "0": case "1": e.answer = [], t.split("").forEach((t => { e.answer.push(e.options[t.charCodeAt() - 65]); })); break; case "2": case "4": case "5": case "6": case "7": e.answer = t; } return e; } }, { type: "ask", name: "\u5317\u4eac\u8054\u5927\u5b66\u5802\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("jxjypt.cn") && location.href.includes("/paper/start?pid="), types: [ "0", "1", "2", "3", "4", "5", "6", "7" ], minDelay: 1e3, answerDelay: 1e3, question: { html: "#questionModule>ul>li", question: ".sub-dotitle>pre", options: "dl.sub-answer>dd", type: ".sub-dotitle>i", workType: "jhjypt", pageType: "jhjypt" }, init: async () => { if (await waitUntil((function() { return 0 !== J("#questionModule>ul>li").length; })), !isExist("#btn_submit")) return !1; try { const e = ce.addEventListener; ce.addEventListener = function(t, n, a) { if ("visibilitychange" !== t) return e.call(this, t, n, a); }, ce.paper && void 0 !== ce.paper.isCut && (ce.paper.isCut = 0), Object.defineProperty(ce.document, "visibilityState", { get: function() { return "visible"; }, configurable: !0 }), Object.defineProperty(ce.document, "hidden", { get: function() { return !1; }, configurable: !0 }); } catch (e) {} }, ischecked: e => e.hasClass("cho-this"), questionHook: e => (e.options = removeStartChar(e.options), e.type = typeMatch(removeHtml(J(e.html).find(".sub-dotitle>i").text().replace("\n", "").replace(" ", ""))), e), setAnswer: e => { switch (e.type) { case "2": case "4": case "5": case "6": case "7": const t = J(e.html).find(".e__textarea"); if (t.length > 0) { const n = t[0]; n.value = e.answer, t.focus(); [ "input", "change", "keyup", "keydown", "blur", "paste" ].forEach((e => { const t = new Event(e, { bubbles: !0, cancelable: !0 }); n.dispatchEvent(t); })), t.trigger("input").trigger("change").trigger("keyup").trigger("blur"), setTimeout((() => { t.trigger("change"); }), 100), e.answer; } return !1; } return !0; } } ], Ut = Object.freeze(Object.defineProperty({ __proto__: null, a21tb: it, ahjxjy: $e, cfy: St, chaoxing: Ee, chatglm: He, chengjiaoyun: ze, chutou: We, cjedu: De, cjnep: et, cloudwis: Je, cnzx: Me, cqsdx: wt, dufe: Tt, gkks: Ge, guokai: je, huayi: nt, jhjypt: It, jijiaool: Et, jijiaox: Ye, jsou: Pe, learnin: yt, ls365: Qe, mooc: bt, mosoteach: gt, mynep: tt, olearn: kt, openha: Ve, ouchn: vt, qingshu: Fe, sclecb: Ke, swufe: xt, uooc: Ne, wdjycj: qt, wencai: Xe, whut: At, wx168: ot, xinwei: Ue, xueqi: Be, ynou: at, ytccr: Re, yunmuxueyuan: qe, yxbyun: _t, yxlearning: Ze, zhihuishu: Ie, zhijiaoyun: Le }, Symbol.toStringTag, { value: "Module" })), resolveRuleHtml = e => "function" == typeof e ? e() : e; const createQuestionData = (e, t) => { const n = J(t), a = removeHtml(n.find(e.question).html()), i = n.find(e.options).map(((e, t) => removeHtml(J(t).html()))).get(); return { question: titleClean(a ?? ""), options: i, $options: n.find(e.options), type: n.find(e.type).val(), html: n[0], workType: e.workType, pageType: e.pageType }; }, Ht = []; for (const Fd in Ut) Ht.push(...Ut[Fd]); const isRuleMatched = e => "function" == typeof e.match ? e.match() : Boolean(e.match), parseRule = async e => { await waitUntil((() => void 0 !== ce[Mt + "app"])); const t = e.filter(isRuleMatched), n = getAppStore(), a = { app: n, ask: getAskStore(), ai: ce[Mt + "ai"] }; if (!t.length) return n.app.alert = "\u5f53\u524d\u6ca1\u6709\u4efb\u52a1", console.log("\u6ca1\u6709\u5339\u914d\u5230\u89c4\u5219", "error"), void addLog("\u6ca1\u6709\u5339\u914d\u5230\u89c4\u5219", "error"); for (const i of t) { if (console.log(`\u5339\u914d\u5230\u89c4\u5219\uff1a${i.name}`, "success"), addLog(`\u5339\u914d\u5230\u89c4\u5219\uff1a${i.name}`, "success"), i.init) { let e = await i.init(); if ("boolean" == typeof e && !1 === e) continue; } n.alert = `\u5f53\u524d\u4efb\u52a1:${i.name}`, "hook" === i.type && i.main(a), "ask" === i.type && askParser(i, a), "save" === i.type && await saveParser(i, a); } }, saveParser = async (e, t) => { const n = t.app, a = t.ask; a.rule = e, e.tips && (a.tips = e.tips); const i = questionSaveParser(e.question, e.answerHook || null).filter((e => null != e && 0 !== e.answer.length && "" !== e.answer && "8" != e.type)).map((e => (e.question = titleClean(e.question), e))); a.saveQuestionData = i, i.forEach((e => { 0 !== e.answer.length && Answer.cacheAnswer(e); })), await async function({questionList: e, pageType: t, paper: n, onPaperError: a, beforeSync: i, syncQuestionList: o}) { if (n) try { await n(e); } catch (r) { null == a || a(r); } const s = { questionList: e, pageType: t }; return null == i || i(s), e.length && await o(s), s; }({ questionList: i, pageType: e.question.pageType, paper: e.paper && "function" == typeof e.paper ? e.paper : void 0, onPaperError: () => addLog("\u6574\u5377\u7f13\u5b58\u5f02\u5e38", "error"), beforeSync: () => n.setPage("question"), syncQuestionList: e => Answer.syncQuestionList(e) }), n.app.alert = `\u9898\u5e93\u6536\u5f55\u5b8c\u6210\uff0c\u5171\u7f13\u5b58${i.length}\u9053\u9898\u76ee`, msg(`\u9898\u5e93\u6536\u5f55\u5b8c\u6210\uff0c\u5171\u7f13\u5b58${i.length}\u9053\u9898\u76ee`, "success"), e.next && e.next(); }, askParser = (e, t) => { const n = t.app, a = t.ask; a.rule = e, e.minDelay && (a.minDelay = e.minDelay, a.delay < a.minDelay && (a.delay = a.minDelay)), e.tips && (a.tips = e.tips), n.app.showFloat = !n.app.hideFloat, n.setPage("ask"), a.clearQuestion(); questionParser(e.question, e.questionHook || null).map((e => (e.question = titleClean(e.question), "3" == e.type && (e.options = []), e))).forEach((e => { a.addQuestion(e); })), a.autoAnswer && a.toggleStart(); }, questionSaveParser = (e, t) => { const n = resolveRuleHtml(e.html); return J(n).map(((n, a) => { let i = { ...createQuestionData(e, a), $answer: J(a).find(e.answer), answer: [] }; try { t && (i = t(i, n)); } catch (o) { console.log("\u6536\u5f55hook\u62a5\u9519", o); } return null == i || null == i ? null : (i.question && "" != i.question && (i.question = titleClean(i.question)), i.options && i.options.length > 0 && "object" != typeof i.options[0] && (i.options = removeStartChar(i.options)), { question: i.question, options: i.options, answer: i.answer, type: i.type, hash: questionHash(i.type, i.question, i.options) }); })).get(); }, questionParser = (e, t) => { const n = resolveRuleHtml(e.html); return J(n).map(((n, a) => { let i = createQuestionData(e, a); return t && (i = t(i, n)), i; })).get(); }; class AnonymousIdentityOptimized { static generateShortId() { return Date.now().toString(36).padStart(8, "0").slice(-8) + Array.from({ length: 8 }, (() => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Math.floor(62 * Math.random())])).join(""); } static validateId(e) { return /^[0-9A-Za-z]{16}$/.test(e); } static getAnonymousId() { if (this.cachedAnonymousId) return this.cachedAnonymousId; let e = ie(this.STORAGE_KEY); return e && this.validateId(e) || (e = this.generateShortId(), re(this.STORAGE_KEY, e)), this.cachedAnonymousId = e, e; } static getStableCanvasFingerprint() { try { const e = document.createElement("canvas"); e.width = 220, e.height = 30; const t = e.getContext("2d", { willReadFrequently: !0 }); if (!t) return ""; t.textBaseline = "alphabetic", t.fillStyle = "#000", t.font = "16px Arial", t.fillText("AiAsk,\ud83c\udf10.\ud83d\ude00", 2, 20); const n = t.getImageData(0, 0, 220, 30).data; let a = 0; for (let i = 0; i < n.length; i += 40) a = (a << 5) - a + n[i], a |= 0; return a.toString(36); } catch (e) { return ""; } } static getWebGLFingerprint() { try { const e = document.createElement("canvas"), t = e.getContext("webgl") || e.getContext("experimental-webgl"); if (!t) return ""; const n = t.getExtension("WEBGL_debug_renderer_info"); if (!n) return t.getParameter(t.VERSION) + "|" + t.getParameter(t.VENDOR); const a = t.getParameter(n.UNMASKED_VENDOR_WEBGL); return a + "|" + t.getParameter(n.UNMASKED_RENDERER_WEBGL); } catch (e) { return ""; } } static getDeviceFingerprint() { if (this.cachedFingerprint) return this.cachedFingerprint; const e = ie(this.FINGERPRINT_KEY); if (e && e.version === this.FP_VERSION && e.value) return this.cachedFingerprint = e.value, e.value, e.value; const t = [ this.normalizeUserAgent(navigator.userAgent), navigator.language, navigator.platform, screen.colorDepth, screen.pixelDepth || screen.colorDepth, (new Date).getTimezoneOffset(), navigator.hardwareConcurrency || 0, navigator.maxTouchPoints || 0, navigator.deviceMemory || 0, this.getWebGLFingerprint(), this.getStableCanvasFingerprint() ].filter(Boolean).join("|"), n = _e(t).substring(0, 12); return re(this.FINGERPRINT_KEY, { value: n, version: this.FP_VERSION, createdAt: Date.now() }), this.cachedFingerprint = n, n; } static normalizeUserAgent(e) { return e.includes("Chrome") ? "Chrome" : e.includes("Firefox") ? "Firefox" : e.includes("Safari") ? "Safari" : e.includes("Edge") ? "Edge" : e.includes("Opera") ? "Opera" : "Unknown"; } static getIdentity() { return { anonymous_id: this.getAnonymousId(), device_fingerprint: this.getDeviceFingerprint() }; } static clear() { re(this.STORAGE_KEY, null), re(this.FINGERPRINT_KEY, null), this.cachedAnonymousId = null, this.cachedFingerprint = null; } static regenerateFingerprint() { return re(this.FINGERPRINT_KEY, null), this.cachedFingerprint = null, this.getDeviceFingerprint(); } static getDebugInfo() { return { anonymous_id: this.getAnonymousId(), device_fingerprint: this.getDeviceFingerprint(), fingerprint_components: { browser: this.normalizeUserAgent(navigator.userAgent), language: navigator.language, platform: navigator.platform, screen_color: screen.colorDepth, timezone: (new Date).getTimezoneOffset(), hardware: navigator.hardwareConcurrency, webgl: this.getWebGLFingerprint() }, storage: { fp_stored: ie(this.FINGERPRINT_KEY), id_stored: ie(this.STORAGE_KEY) } }; } static async testStability(e = 10) { const t = []; for (let a = 0; a < e; a++) { this.cachedFingerprint = null; const e = this.getDeviceFingerprint(); t.push(e), await new Promise((e => setTimeout(e, 100))); } const n = new Set(t); n.size, n.size, Array.from(n), n.size, 1 === n.size || n.size; } } __publicField(AnonymousIdentityOptimized, "STORAGE_KEY", "anonymous_id"), __publicField(AnonymousIdentityOptimized, "FINGERPRINT_KEY", "device_fingerprint"), __publicField(AnonymousIdentityOptimized, "FP_VERSION", "v2"), __publicField(AnonymousIdentityOptimized, "cachedAnonymousId", null), __publicField(AnonymousIdentityOptimized, "cachedFingerprint", null); const normalizeRequestApiResponse = async (e, t) => { let n; try { n = JSON.parse(e.responseText); } catch { throw new Error("\u63a5\u53e3\u54cd\u5e94\u4e0d\u662f\u6709\u6548 JSON"); } if (!(null == n ? void 0 : n.encrypted)) return e; const a = await t(String(n.data ?? "")); if (!a) throw new Error("\u63a5\u53e3\u54cd\u5e94\u89e3\u5bc6\u5931\u8d25"); return { ...e, responseText: a }; }, Ot = 864e5, jt = [ { id: "492563", name: "GreasyFork", home: "https://greasyfork.org/zh-CN/scripts/492563-%E7%88%B1%E9%97%AE%E7%AD%94%E5%8A%A9%E6%89%8B", updateurl: "https://greasyfork.org/zh-CN/scripts/492563.json", getdata: e => { const t = JSON.parse(e[0].responseText); return { version: t.version, code_updated_at: formatDate(t.code_updated_at) }; } }, { id: "2384", name: "\u811a\u672c\u732b", home: "https://scriptcat.org/zh-CN/script-show-page/2384", updateurl: "https://scriptcat.org/api/v2/scripts/2384", getdata: e => { const t = JSON.parse(e[0].responseText); return { version: t.data.script.version, code_updated_at: formatDate(new Date(1e3 * t.data.updatetime).toISOString()) }; } } ]; function getAppStore() { return ce[Mt + "app"]; } function getAskStore() { return ce[Mt + "ask"]; } function request(e, t, n = void 0, a = void 0, i = 5e3) { "GET" === t && n && (e += `?${new URLSearchParams(n).toString()}`), "POST" === t && (a = { ...a }); const o = { "User-Agent": ce.navigator.userAgent, "Content-Type": "application/json", referer: location.href, ...a }; return new Promise(((a, s) => { const r = Date.now(); le({ method: t, url: e, headers: o, data: "GET" !== t ? JSON.stringify(n) : void 0, timeout: i, onload: function(e) { const t = Date.now(); a([ e, t - r ]); }, ontimeout: () => s(new Error("\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6")), onerror: e => { s(e); } }); })); } function requestApi(e, t, n = void 0, a = void 0, i = 5e3) { return "GET" === t && n && (e += `?${new URLSearchParams(n).toString()}`), new Promise((async (o, s) => { const r = Cache.get("user", {}), l = r && r.user && r.api_key; let c; if ("POST" === t) { if (!l) { const e = AnonymousIdentityOptimized.getIdentity(); n = { ...n, anonymous_id: e.anonymous_id, device_fingerprint: e.device_fingerprint }; } const e = get_t(n); a = { ...a, aka: e }, c = await encrypt(JSON.stringify(n), e); } else a = { ...a, aka: get_t({}) }; const p = { "User-Agent": ce.navigator.userAgent, "Content-Type": "application/json", referer: location.href, v: $t.script.version, ...a }; if (l) p.Authorization = `Bearer ${r.api_key}`; else { const e = AnonymousIdentityOptimized.getIdentity(); p["X-Anonymous-ID"] = e.anonymous_id, p["X-Device-FP"] = e.device_fingerprint; } const d = Date.now(); JSON.stringify(n), le({ method: t, url: e, headers: p, data: "GET" !== t ? JSON.stringify({ data: c }) : void 0, timeout: i, onload: async function(e) { const t = Date.now() - d; try { const n = await normalizeRequestApiResponse(e, decrypt); JSON.parse(n.responseText), o([ n, t ]); } catch (n) { s(n); } }, ontimeout: () => s(new Error("\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6")), onerror: e => { s(e); } }); })); } const vuePageChange = async () => { if (ce.vuePageChangeLock) return; ce.vuePageChangeLock = !0; const e = getAppStore(), t = getAskStore(); t.questionInx = 0, e.app.showFloat = !1, e.setPage("home"), t.clearQuestion(), await parseRule(Ht), ce.vuePageChangeLock = !1; }, observeVuePageChange = (e, t, n = {}) => { if (ce.mainClass = t(), !e) return; const a = new MutationObserver((async () => { const e = t(); ce.mainClass !== e && (ce.mainClass = e, n.beforeChange && await n.beforeChange(e), await vuePageChange(), a.disconnect()); })); a.observe(e, { subtree: !0, attributes: !0, childList: !0 }); }, addLog = (e, t = "info") => { const n = getAppStore(), a = (new Date).toLocaleString(); try { n.addLog({ time: a, type: t, content: e }); } catch (i) { console.log(e); } }, compareVersions = (e, t) => { const normalize = e => e.split(".").map(Number), n = normalize(e), a = normalize(t); for (let i = 0; i < Math.max(n.length, a.length); i++) { const e = n[i] || 0, t = a[i] || 0; if (t > e) return !0; if (t < e) return !1; } return !1; }, updateFn = async (e = !0) => { if (!getAppStore().app.checkUpdate) return; const t = Cache.get("lastCheckTime"); if (e && t && Date.now() - t < Ot) { new Date(t + Ot).toLocaleString(); } else try { const e = await Promise.allSettled(jt.map((async e => { try { e.name, e.updateurl, addLog(`[${e.name}] \u5f00\u59cb\u68c0\u6d4b\u66f4\u65b0`, "info"); const t = await request(e.updateurl, "GET", {}, {}), n = e.getdata(t); return e.name, { script: e, updateInfo: n }; } catch (t) { throw e.name, String(t), addLog(`[${e.name}] \u66f4\u65b0\u68c0\u6d4b\u5931\u8d25: ${String(t)}`, "error"), t; } }))); Cache.set("lastCheckTime", Date.now()); const t = e.filter((e => "fulfilled" === e.status)); e.filter((e => "rejected" === e.status)); if (0 === t.length) return void msg("\u6240\u6709\u66f4\u65b0\u6e90\u68c0\u6d4b\u5931\u8d25\uff0c\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005\u3002", "error"); let n = !1, a = !0; for (const {value: i} of t) { const {script: e, updateInfo: t} = i; if (compareVersions($t.script.version, t.version)) { msg(`\n
\n

\u68c0\u6d4b\u5230\u65b0\u7248\u672c\uff1a${t.version}

\n

\u811a\u672c\u6e90\uff1a${e.name}

\n

\u66f4\u65b0\u65f6\u95f4\uff1a${t.code_updated_at}

\n

>> \u70b9\u6211\u5feb\u6377\u8df3\u8f6c\u66f4\u65b0 <<

\n
`, "warning"), addLog(`[${e.name}] \u68c0\u6d4b\u5230\u65b0\u7248\u672c\uff1a${t.version}`, "warning"), n = !0, a = !1; } else e.name, t.version, addLog(`[${e.name}] \u5df2\u662f\u6700\u65b0\u7248\uff1a${t.version}`, "info"); } !n && a && (msg("\u5f53\u524d\u5df2\u662f\u6700\u65b0\u7248", "success"), addLog("\u5f53\u524d\u5df2\u662f\u6700\u65b0\u7248", "success")); } catch (n) { console.error("\u66f4\u65b0\u68c0\u6d4b\u6d41\u7a0b\u5f02\u5e38", n), addLog(`\u66f4\u65b0\u68c0\u6d4b\u5931\u8d25: ${String(n)}`, "error"), msg("\u6240\u6709\u66f4\u65b0\u6e90\u5747\u68c0\u6d4b\u5931\u8d25\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u8005\u53cd\u9988\u7ed9\u4f5c\u8005", "error"); } }, ttfDownload1 = async e => new Promise((t => { le({ method: "GET", url: e, onload: function(e) { try { const n = e.responseText, a = JSON.parse(n); t(a); } catch (n) { msg("\u5b57\u4f53\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25", "error"), t(null); } }, onerror: function(e) { msg("\u5b57\u4f53\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25", "error"), t(null); } }); })), zt = "aah-notice-global-style", Pt = `\n#${zt} {}\n#aah-notice-container {\n position: fixed;\n top: 20px;\n right: 20px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n z-index: 2147483647;\n pointer-events: none;\n}\n.aah-notice {\n min-width: 220px;\n padding: 12px 16px;\n border-radius: 10px;\n background: #ffffff;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);\n color: #1f2937;\n font-size: 13px;\n transition: opacity 0.3s ease, transform 0.3s ease;\n}\n.aah-notice-success { border-left: 4px solid #10b981; }\n.aah-notice-error { border-left: 4px solid #ef4444; }\n.aah-notice-warning { border-left: 4px solid #f59e0b; }\n.aah-notice-info { border-left: 4px solid #3b82f6; }\n.aah-notice.hide {\n opacity: 0;\n transform: translateY(-6px);\n}`; function somd5(e) { return _e(e); } function removeHtml(e, t = !0) { const n = document.createElement("textarea"); n.innerHTML = e, e = (e = (e = (e = n.value).replace(/[\t\r\xa0]/g, " ")).replace(/[\u2000-\u200a]/g, " ")).replace(//g, "\n"), t && (e = e.replace(/<(\/)?(p|div).*?>/g, "\n")), e = (e = (e = (e = e.replace(/ {2,}/g, " ")).replace(/\n{2,}/g, "\n")).replace(//g, "
")).replace(/<\/xmp>/g, "
"); let a = (e = V.sanitize(e, { ALLOWED_TAGS: [ "img", "br", "sub", "sup" ], ALLOWED_ATTR: [ "src", "href" ], ALLOW_DATA_ATTR: !1, KEEP_CONTENT: !0 })).match(//g); return a && a.forEach((t => { let n = t.match(/src="(.*?)"/); if (n && -1 == n[1].indexOf("http") && !n[1].includes("data:image")) if (n[1].startsWith("/")) e = e.replace(n[1], location.origin + n[1]); else { const t = new URL(n[1], document.baseURI).href; e = e.replace(n[1], t); } })), e.trim(); } function titleClean(e) { return e.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim(); } function sleep(e) { return new Promise((t => setTimeout(t, e))); } function typeConvert(e, t = !0) { return t ? Lt[e] || "8" : Object.keys(Lt).find((t => Lt[t] === e)) || "\u5176\u5b83"; } function typeMatch(e) { const t = { 0: [ "\u5355\u9009", "\u5355\u9879\u9009\u62e9", "A2", "A1" ], 1: [ "\u591a\u9009", "\u591a\u9879\u9009\u62e9" ], 2: [ "\u586b\u7a7a" ], 3: [ "\u5224\u65ad" ], 4: [ "\u7b80\u7b54", "\u95ee\u7b54", "\u7efc\u5408\u9898" ], 5: [ "\u540d\u8bcd\u89e3\u91ca" ], 6: [ "\u8bba\u8ff0", "\u4e3b\u89c2" ], 7: [ "\u8ba1\u7b97" ], 9: [ "\u5206\u5f55" ], 14: [ "\u5b8c\u5f62\u586b\u7a7a" ], 15: [ "\u9605\u8bfb\u7406\u89e3" ], 24: [ "\u9009\u8bcd\u586b\u7a7a" ] }; return Object.keys(t).find((n => t[n].some((t => e.includes(t))))) || "8"; } function matchAnswer(e, t) { const preprocess = e => e.map((e => function(e) { if (/^[+-]?\d+(\.\d+)?$/.test(e)) return e; const t = e.replace(/\s+/g, ""); return t.replace(new RegExp("\\p{P}", "gu"), "") || t; }(removeHtml(e)))); e = preprocess(e), t = preprocess(t); const n = e.map((e => { const n = t.findIndex((t => t === e)); return -1 !== n ? n : t.findIndex((t => t.includes(e))); })); return n.includes(-1) ? [] : n; } function isParentChecked(e) { return e.parent().parent().hasClass("is-checked"); } function msg(e, t = "info") { try { if (!document.getElementById(zt)) { const e = document.createElement("style"); e.id = zt, e.textContent = Pt, document.head.appendChild(e); } const n = "aah-notice-container"; let a = document.getElementById(n); a || (a = document.createElement("div"), a.id = n, document.body.appendChild(a)); const i = document.createElement("div"); i.className = `aah-notice aah-notice-${t}`, i.innerHTML = V.sanitize(e), a.appendChild(i), setTimeout((() => { i.classList.add("hide"), setTimeout((() => i.remove()), 300); }), 2800), addLog(e, t); } catch (n) { addLog(`\u6d88\u606f\u901a\u77e5\u5931\u8d25\u3010${e}\u3011`, "error"); } } function isTrue(e) { return !isFalse(e) && /(\u6b63\u786e|\u662f|\u5bf9|\u221a|T|ri|true)/i.test(e); } function isFalse(e) { return /(\u4e0d\u6b63\u786e|\u9519\u8bef|\u5426|\u9519|\xd7|F|wr|false)/i.test(e); } const questionHash = (e, t, n, a = !0) => { if (("15" === e || 15 === e) && Array.isArray(n) && n.length > 0 && "object" == typeof n[0]) { let i = `${e}${t}${n.map((e => { if (e.question && e.options) { let t = Array.from(e.options); a && t.sort(); const n = t.join(""); return `${e.type || "0"}${e.question}${n}`; } return ""; })).filter(Boolean).join("")}`; i = i.replace(/\s/g, ""); return _e(i); } let i = Array.from(n); a && i.sort(); let o = `${e}${t}${i.join("")}`; o = o.replace(/\s/g, ""); return _e(o); }; function get_t(e = {}) { const {html: t, ...n} = e || {}, flatten = (e, t = "") => { const n = []; return Object.keys(e).sort().forEach((a => { const i = t ? `${t}.${a}` : a, o = e[a]; null != o && (Array.isArray(o) && 0 === o.length || ("object" != typeof o || Array.isArray(o) || 0 !== Object.keys(o).length) && (Array.isArray(o) ? o.every((e => "object" != typeof e)) ? n.push(`${i}=${o.sort().join(",")}`) : n.push(`${i}=${JSON.stringify(o)}`) : "object" == typeof o ? n.push(...flatten(o, i)) : n.push(`${i}=${o}`))); })), n; }, a = flatten(n).join("&"); return _e(a); } async function encrypt(e = "", t = "asdgdfghfghfghfg", n = "1234567890123456") { try { if (!e) return ""; if (t = t.substring(0, 16), n = n.substring(0, 16), !window.crypto || !window.crypto.subtle) { const a = K.enc.Utf8.parse(t), i = K.enc.Utf8.parse(n); return K.AES.encrypt(e, a, { iv: i, mode: K.mode.CBC, padding: K.pad.Pkcs7 }).toString(); } const i = new TextEncoder, o = i.encode(e), s = i.encode(t), r = i.encode(n), l = await crypto.subtle.importKey("raw", s, { name: "AES-CBC" }, !1, [ "encrypt" ]), c = await crypto.subtle.encrypt({ name: "AES-CBC", iv: r }, l, o), p = new Uint8Array(c), d = 1024; let u, h = ""; for (let e = 0; e < p.length; e += d) { const t = p.slice(e, Math.min(e + d, p.length)); h += String.fromCharCode.apply(null, Array.from(t)); } try { u = btoa(h); } catch (a) { u = h.split("").map((e => ("0" + e.charCodeAt(0).toString(16)).slice(-2))).join(""); } return u; } catch (i) { return addLog(`\u52a0\u5bc6\u5f02\u5e38: ${i instanceof Error ? i.message : "\u672a\u77e5\u9519\u8bef"}`, "error"), ""; } } async function decrypt(e = "", t = "asdgdfghfghfghfg", n = "1234567890123456") { try { if (!e) return ""; if (t = t.substring(0, 16), n = n.substring(0, 16), !window.crypto || !window.crypto.subtle) { const a = K.enc.Utf8.parse(t), i = K.enc.Utf8.parse(n); return K.AES.decrypt(e, a, { iv: i, mode: K.mode.CBC, padding: K.pad.Pkcs7 }).toString(K.enc.Utf8); } /^[A-Za-z0-9+/]*={0,2}$/.test(e); const i = new TextEncoder, o = i.encode(t), s = i.encode(n); let r; try { r = atob(e); } catch (a) { throw new Error("Base64 \u89e3\u7801\u5931\u8d25\uff0c\u6570\u636e\u683c\u5f0f\u4e0d\u6b63\u786e"); } const l = new Uint8Array(r.length); for (let e = 0; e < r.length; e++) l[e] = r.charCodeAt(e); if (l.length % 16 != 0) throw new Error("\u52a0\u5bc6\u6570\u636e\u957f\u5ea6\u4e0d\u6b63\u786e\uff0c\u4e0d\u662f16\u7684\u500d\u6570"); const c = await crypto.subtle.importKey("raw", o, { name: "AES-CBC" }, !1, [ "decrypt" ]), p = await crypto.subtle.decrypt({ name: "AES-CBC", iv: s }, c, l); return new TextDecoder("utf-8", { fatal: !0 }).decode(p); } catch (i) { return addLog(`\u89e3\u5bc6\u5f02\u5e38: ${i instanceof Error ? i.message : "\u672a\u77e5\u9519\u8bef"}`, "error"), ""; } } function simpleMarkdownToHtml(e) { if (!e) return ""; let t = e; const n = [], protect = e => { const t = `{{{{PLACEHOLDER${n.length}}}}}`; return n.push(e), t; }, escapeHtml = e => e.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, ((e, t, n) => protect(`
${escapeHtml(n.trim())}
`))), t = t.replace(/`([^`]+)`/g, ((e, t) => protect(`${escapeHtml(t)}`))), t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, ((e, t, n) => protect(`${t}`))), t = t.replace(/\*\*(.+?)\*\*/g, "$1"), t = t.replace(/__(.+?)__/g, "$1"), t = t.replace(/\*(.+?)\*/g, "$1"), t = t.replace(/_(.+?)_/g, "$1"), t = t.replace(/^### (.+)$/gm, "

$1

"), t = t.replace(/^## (.+)$/gm, "

$1

"), t = t.replace(/^# (.+)$/gm, "

$1

"), t = t.replace(/^\- (.+)$/gm, "
  • $1
  • "), t = t.replace(/(
  • .*<\/li>\n?)+/g, "
      $&
    "), t = t.replace(/^\d+\. (.+)$/gm, "
  • $1
  • "), t = t.replace(/\n/g, "
    "), t = t.replace(/
    <(pre|h1|h2|h3|ul|ol)/g, "<$1"), t = t.replace(/<\/(pre|h1|h2|h3|ul|ol)>
    /g, ""), t = t.replace(/\{\{\{\{PLACEHOLDER(\d+)\}\}\}\}/g, ((e, t) => n[parseInt(t)])), t; } function judgeAnswer(e) { return isTrue(e) ? [ "\u6b63\u786e" ] : isFalse(e) ? [ "\u9519\u8bef" ] : []; } function removeStartChar(e) { return e.map(((e, t) => { let n = String.fromCharCode(65 + t) + " .", a = String.fromCharCode(65 + t) + ".", i = String.fromCharCode(65 + t) + "\u3001", o = String.fromCharCode(65 + t) + "\uff0e", s = String.fromCharCode(65 + t); return e.replace(new RegExp(`^${n}|^${a}|^${i}|^${o}|^${s}`), "").trim(); })); } function qc(e) { J(e).find(".answerBg, .textDIV, .eidtDiv").each((function() { (J(this).find(".check_answer").length || J(this).find(".check_answer_dx").length) && J(this).click(); })), J(e).find(".answerBg, .textDIV, .eidtDiv").find("textarea").each((function() { ce.UE.getEditor(J(this).attr("name")).ready((function() { this.setContent(""); })); })), J(e).find(":radio, :checkbox").prop("checked", !1), J(e).find("textarea").each((function() { ce.UE.getEditor(J(this).attr("name")).ready((function() { this.setContent(""); })); })); } function qc1(e) { J(e).find(".before-after,.before-after-checkbox, .textDIV, .eidtDiv").each((function() { (J(this).find(".check_answer").length || J(this).find(".check_answer_dx").length) && J(this).click(); })), J(e).find(".before-after, .textDIV, .eidtDiv").find("textarea").each((function() { ce.UE.getEditor(J(this).attr("name")).ready((function() { this.setContent(""); })); })), J(e).find(":radio, :checkbox").prop("checked", !1), J(e).find("textarea").each((function() { ce.UE.getEditor(J(this).attr("name")).ready((function() { this.setContent(""); })); })); } const waitUntil = (e, t = 100) => new Promise((n => { const a = setInterval((() => { e() && (clearInterval(a), n()); }), t); })); function isExist(e) { return J(e).length > 0; } function getUrl() { return location.href; } function removeOptionsStartChar(e) { for (let t = 0; t < e.length; t++) { let n = String.fromCharCode(65 + t) + ".", a = String.fromCharCode(65 + t) + "\u3001", i = String.fromCharCode(65 + t) + "\uff0e", o = String.fromCharCode(65 + t); const s = new RegExp(`^${n}|^${a}|^${i}|^${o}`); if (!e[t].match(s)) return !1; e[t] = e[t].replace(s, "").trim(); } return e; } const formatDate = e => new Date(e).toISOString().replace("T", " ").substring(0, 19); const Lt = { "\u5355\u9009\u9898": "0", "\u591a\u9009\u9898": "1", "\u586b\u7a7a\u9898": "2", "\u5224\u65ad\u9898": "3", "\u7b80\u7b54\u9898": "4", "\u95ee\u7b54\u9898": "4", "\u540d\u8bcd\u89e3\u91ca": "5", "\u8bba\u8ff0\u9898": "6", "\u8ba1\u7b97\u9898": "7", "\u5206\u5f55\u9898": "9", "\u8d44\u6599\u9898": "10", "\u8fde\u7ebf\u9898": "11", "\u5339\u914d\u9898": "11", "\u6392\u5e8f\u9898": "13", "\u5b8c\u578b\u586b\u7a7a": "14", "\u5b8c\u5f62\u586b\u7a7a\u9898": "14", "\u9605\u8bfb\u7406\u89e3": "15", "\u7a0b\u5e8f\u9898": "17", "\u53e3\u8bed\u9898": "18", "\u542c\u529b\u9898": "19", "\u5171\u7528\u9009\u9879\u9898": "20", "\u6d4b\u8bc4\u9898": "21", "\u949f\u8868\u9898": "23", "\u9009\u8bcd\u586b\u7a7a": "24", "\u9009\u505a\u9898": "25", "\u5176\u5b83": "8" }, Mt = function(e) { let t = ""; for (;t.length < e; t += Math.random().toString(36).substr(2)) ; return t.substr(0, e); }(9) + "_", $t = oe; ce.ksv = _e($t.script.author + $t.script.name.replace(/server:/, "").trim()); const Ft = { debug: !0, searchApi: [], defaultShowFloat: !1, showFloat: !1, showBoard: !0, checkUpdate: !0, hideFloat: !1, alert: "\u70b9\u6211\u6709\u60ca\u559c", alertBubble: !0, iframe: !1, key: "", gpt: [ { name: "GLM", desc: "\u667a\u666e\u6e05\u8a004.0", api: "http://82.157.105.20:8002/v1/chat/completions", key: "", msg: "AI\u54cd\u5e94\u5f02\u5e38\uff0c\u53ef\u80fd\u662f\u6ca1\u6709\u83b7\u53d6cookie,\u8bf7\u6309\u4e0b\u65b9\u6b65\u9aa4\u64cd\u4f5c\n1. \u6253\u5f00[\u667a\u666e\u6e05\u8a00](https://chatglm.cn/main/alltoolsdetail)\n2. \u767b\u5f55\u540e\u968f\u4fbf\u53d1\u4e00\u6761\u6d88\u606f\u5373\u53ef\n3. \u8fd4\u56de\u7b54\u9898\u9875\u5237\u65b0\u9875\u9762", home: "https://chatglm.cn/main/alltoolsdetail", recommend: 3, model: "gpt-4o" }, { name: "spark", desc: "\u8baf\u98de\u661f\u706b", api: "http://82.157.105.20:8000/v1/chat/completions", key: "", msg: "AI\u54cd\u5e94\u5f02\u5e38\uff0c\u53ef\u80fd\u662f\u6ca1\u6709\u83b7\u53d6cookie,\u8bf7\u6309\u4e0b\u65b9\u6b65\u9aa4\u64cd\u4f5c\n1. \u6253\u5f00[\u8baf\u98de\u661f\u706b](https://xinghuo.xfyun.cn/desk)\n2. \u767b\u5f55\u540e\u968f\u4fbf\u53d1\u4e00\u6761\u6d88\u606f\u5373\u53ef\n3. \u8fd4\u56de\u7b54\u9898\u9875\u5237\u65b0\u9875\u9762", home: "https://xinghuo.xfyun.cn/desk", recommend: 5, model: "gpt-4o" } ], gptIndex: 1, askGpt: !1, hotkey: "Ctrl+Shift+H", hotkeyEnabled: !0 }; const Nt = function() { const e = Cache.get("app") || {}, t = { ...Ft }; for (const [n, a] of Object.entries(e)) "gpt" !== n && "alert" !== n && void 0 !== a && (t[n] = a); if (e.gpt) { const n = new Map; e.gpt.forEach((e => { n.set(e.name, e.key); })), t.gpt = Ft.gpt.map((e => ({ ...e, key: n.get(e.name) || "" }))); } return t.alert = Ft.alert, t.gptIndex >= t.gpt.length && (t.gptIndex = 0), t; }(); function getApp() { return Cache.get("app") || Ft; } !function(e) { const t = { ...Cache.get("app"), ...e }; Cache.set("app", t); }(Nt); const Dt = { display: [ { type: "switch", label: "\u9ed8\u8ba4\u663e\u793a\u60ac\u6d6e", name: "defaultShowFloat", value: Nt.defaultShowFloat, desc: "\u6253\u5f00\u9875\u9762\u65f6\u662f\u5426\u663e\u793a\u60ac\u6d6e\u7a97", options: [] }, { type: "switch", label: "\u5f3a\u5236\u9690\u85cf", name: "hideFloat", value: Nt.hideFloat, desc: "\u4ec5\u70ed\u952e\u6216\u70b9\u51fb\u53f3\u4e0b\u89d2\u56fe\u7247\u624d\u663e\u793a\u60ac\u6d6e\u7a97", options: [] }, { type: "switch", label: "\u6c14\u6ce1\u63d0\u793a", name: "alertBubble", value: Nt.alertBubble, desc: "\u53f3\u4e0b\u89d2\u6c14\u6ce1\u63d0\u793a\u662f\u5426\u5f00\u542f", options: [] } ], system: [ { type: "switch", label: "\u68c0\u6d4b\u66f4\u65b0", name: "checkUpdate", value: Nt.checkUpdate, desc: "\u6253\u5f00\u9875\u9762\u65f6\u662f\u5426\u68c0\u6d4b\u66f4\u65b0", options: [] }, { type: "switch", label: "iframe\u4f18\u5316(\u6d4b\u8bd5)", name: "iframe", value: Nt.iframe, desc: "\u9488\u5bf9\u6df1\u5ea6\u5d4c\u5957\u7f51\u9875\u7684\u4f18\u5316\uff0c\u9002\u5408\u5355\u4efb\u52a1\u9875\u4f7f\u7528\uff0c\u591a\u4efb\u52a1\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5f39\u7a97\u8fc7\u591a\u3002\n \u6ce8\u610f\uff1a\u8be5\u529f\u80fd\u4e3a\u6d4b\u8bd5\u529f\u80fd\uff0c\u53ef\u80fd\u5b58\u5728\u672a\u77e5\u95ee\u9898\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528", options: [] } ], ai: [], hotkey: [ { type: "switch", label: "\u542f\u7528\u5feb\u6377\u952e", name: "hotkeyEnabled", value: Nt.hotkeyEnabled, desc: "\u662f\u5426\u542f\u7528\u5feb\u6377\u952e\u663e\u9690\u60ac\u6d6e\u7a97", options: [] }, { type: "hotkey", label: "\u5feb\u6377\u952e\u8bbe\u7f6e", name: "hotkey", value: Nt.hotkey, desc: "\u70b9\u51fb\u8f93\u5165\u6846\u540e\u6309\u4e0b\u60f3\u8981\u8bbe\u7f6e\u7684\u5feb\u6377\u952e\u7ec4\u5408\uff08\u652f\u6301Ctrl\u3001Shift\u3001Alt\u7ec4\u5408\u952e\uff09", options: [] } ] }, Rt = defineStore("app", { state: () => ({ app: Nt, script: $t.script, page: "home", pageWidth: "standard", ConfigInput: Dt, activeSettingSection: "", logs: [ { time: (new Date).toLocaleString(), type: "success", content: "\u521d\u59cb\u5316\u65e5\u5fd7\u6210\u529f" } ] }), actions: { setConfig(e) { this.app = { ...this.app, ...e }, Cache.set("app", this.app); }, setPage(e) { this.page = e; }, setActiveSettingSection(e) { this.activeSettingSection = e; }, setPageWidth(e) { this.pageWidth = e; }, addLog(e) { this.logs.length > 100 && this.logs.shift(), this.logs.push(e); } } }), Bt = Cache.get("apiList", []), Gt = [ { name: "\u4e00\u4e4b\u9898\u5e93", url: "http://cx.icodef.com/wyn-nb?v=4", method: "POST", type: "json", headers: {}, params: [], data: { question: "$question", options: "$options", type: "$type" }, response: { type: "field", value: "data" }, weight: 0 } ], Vt = defineStore("api", { state: () => ({ apiList: Bt, defApiList: Gt }), actions: {}, getters: { getApiList() { return this.apiList.forEach(((e, t) => { e.name === this.defApiList[t].name && (this.defApiList[t] = e); })), this.apiList.concat(this.defApiList); } } }), Jt = [ "AI_CONFIG_MISSING", "AI_PROVIDER_DISABLED", "AI_CREDENTIAL_MISSING", "AI_AUTH_FAILED", "AI_REQUEST_TIMEOUT", "AI_NETWORK_FAILED", "AI_RESPONSE_PARSE_FAILED", "AI_SSE_PARSE_FAILED", "AI_OUTPUT_SCHEMA_INVALID", "AI_ANSWER_NOT_MATCHED", "AI_QUESTION_TYPE_UNSUPPORTED", "AI_IMAGE_UNSUPPORTED" ], Kt = { AI_CONFIG_MISSING: "AI \u914d\u7f6e\u4e0d\u5b58\u5728\uff0c\u8bf7\u5148\u5b8c\u6210\u914d\u7f6e", AI_PROVIDER_DISABLED: "AI \u5e73\u53f0\u5df2\u505c\u7528\uff0c\u8bf7\u542f\u7528\u540e\u91cd\u8bd5", AI_CREDENTIAL_MISSING: "AI \u51ed\u8bc1\u7f3a\u5931\uff0c\u8bf7\u586b\u5199 API Key \u6216\u6388\u6743\u4fe1\u606f", AI_AUTH_FAILED: "AI \u9274\u6743\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u51ed\u8bc1\u662f\u5426\u6709\u6548", AI_REQUEST_TIMEOUT: "AI \u8bf7\u6c42\u8d85\u65f6\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", AI_NETWORK_FAILED: "AI \u8bf7\u6c42\u7f51\u7edc\u5f02\u5e38\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u540e\u91cd\u8bd5", AI_RESPONSE_PARSE_FAILED: "AI \u54cd\u5e94\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", AI_SSE_PARSE_FAILED: "AI \u6d41\u5f0f\u54cd\u5e94\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", AI_OUTPUT_SCHEMA_INVALID: "AI \u8f93\u51fa\u683c\u5f0f\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u8bf7\u91cd\u8bd5", AI_ANSWER_NOT_MATCHED: "AI \u7b54\u6848\u672a\u80fd\u5339\u914d\u5f53\u524d\u9898\u76ee", AI_QUESTION_TYPE_UNSUPPORTED: "AI \u6682\u4e0d\u652f\u6301\u5f53\u524d\u9898\u578b", AI_IMAGE_UNSUPPORTED: "AI \u6682\u4e0d\u652f\u6301\u56fe\u7247\u9898\u76ee" }; function createAiError(e, t = {}) { const n = t.userMessage || Kt[e], a = new Error(`[${e}] ${n}`, void 0 === t.cause ? void 0 : { cause: t.cause }); return a.name = "AiError", a.code = e, a.userMessage = n, void 0 !== t.detail && (a.detail = t.detail), a; } const isAiError = e => "object" == typeof e && null !== e && "AiError" === e.name && "string" == typeof e.code && Jt.includes(e.code) && "string" == typeof e.message && "string" == typeof e.userMessage, getAiErrorMessage = e => isAiError(e) ? e.userMessage : e instanceof Error && e.message ? e.message : "AI \u8bf7\u6c42\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", parseSsePackets = e => { const t = []; for (const a of e.split(/\r?\n/)) { const e = a.trim(); if (!e.startsWith("data:")) continue; const i = e.slice(5).trim(); if (i && "[DONE]" !== i) try { t.push(JSON.parse(i)); } catch (n) { throw createAiError("AI_SSE_PARSE_FAILED", { detail: { payload: i }, cause: n }); } } return t; }, createSsePacketParser = () => { let e = ""; return { push: t => (e += t, (() => { const t = [], n = e.split(/\r?\n\r?\n/); e = n.pop() || ""; for (const e of n) t.push(...parseSsePackets(e)); return t; })()), flush: () => { if (!e.trim()) return e = "", []; const t = e; return e = "", parseSsePackets(t); } }; }, getRuntime = () => globalThis, getRuntimeGmXmlhttpRequest = () => { var e; const t = "function" == typeof GM_xmlhttpRequest ? GM_xmlhttpRequest : "undefined" != typeof GM && "function" == typeof GM.xmlHttpRequest ? GM.xmlHttpRequest : void 0; if (t) return t; const n = getRuntime(); return n.GM_xmlhttpRequest || (null == (e = n.GM) ? void 0 : e.xmlHttpRequest); }, readStream = async (e, t) => { if (!e || "function" != typeof e.getReader) return; const n = e.getReader(), a = new TextDecoder; for (;;) { const {done: e, value: i} = await n.read(); if (e) break; i && t(a.decode(i, { stream: !0 })); } const i = a.decode(); i && t(i); }, createHttpStatusError = e => { const t = { status: e.status, statusText: e.statusText }; return 401 === e.status || 403 === e.status ? createAiError("AI_AUTH_FAILED", { detail: t }) : e.status < 200 || e.status >= 300 ? createAiError("AI_NETWORK_FAILED", { detail: t }) : void 0; }, stringifyHeaders = e => { const t = []; return e.forEach(((e, n) => t.push(`${n}: ${e}`))), t.join("\r\n"); }, createAiTransportRequest = e => { var t; const n = (null == (t = e.resolveGmXmlhttpRequest) ? void 0 : t.call(e)) || getRuntimeGmXmlhttpRequest(); if (!n) { const t = (() => { const e = getRuntime(); if ("function" == typeof e.fetch) return e.fetch.bind(e); })(); return t ? ((e, t) => { const n = "function" == typeof AbortController ? new AbortController : void 0; let i, o, rejectTransport = () => {}; const createBaseResponse = (t, n, a = "") => ({ finalUrl: t.url || e.url, response: n, responseHeaders: stringifyHeaders(t.headers), responseText: a, status: t.status, statusText: t.statusText }); return { promise: new Promise(((s, r) => { rejectTransport = r, e.timeout && n && (o = setTimeout((() => { i = "timeout", n.abort(); }), e.timeout)), (async () => { try { const i = await t(e.url, { method: e.method, headers: e.headers, body: e.data ?? void 0, signal: null == n ? void 0 : n.signal }), o = createBaseResponse(i, void 0), l = createHttpStatusError(o); if (l) return void r(l); if ("stream" === e.responseType && e.onStreamChunk) { try { await readStream(i.body, e.onStreamChunk); } catch (a) { return void r(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u6d41\u5f0f\u54cd\u5e94\u8bfb\u53d6\u5931\u8d25", cause: a })); } return void s(createBaseResponse(i, i.body)); } const c = await i.text(); s(createBaseResponse(i, c, c)); } catch (a) { if ("timeout" === i) return void r(createAiError("AI_REQUEST_TIMEOUT")); if ("manual" === i) return void r(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })); r(createAiError("AI_NETWORK_FAILED", { cause: a })); } finally { o && clearTimeout(o); } })(); })), abort: () => { i = "manual", null == n || n.abort(), rejectTransport(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })); } }; })(e, t) : (a = createAiError("AI_NETWORK_FAILED", { userMessage: "\u5f53\u524d\u8fd0\u884c\u73af\u5883\u4e0d\u652f\u6301 GM_xmlhttpRequest" }), { promise: Promise.reject(a), abort: () => {} }); } var a; let i, o, s, rejectTransport = () => {}, r = !1, l = !1, c = !1; const p = new Promise(((t, a) => { const rejectOnce = e => { r || (r = !0, a(e)); }; rejectTransport = rejectOnce; const resolveOnce = e => { if (r) return; const n = createHttpStatusError(e); n ? rejectOnce(n) : (r = !0, t(e)); }; i = n({ method: e.method, url: e.url, headers: e.headers, data: e.data, timeout: e.timeout, responseType: e.responseType, onloadstart: t => { e.onStreamChunk && "stream" === e.responseType && (o = readStream(t.response, e.onStreamChunk).then((() => { l = !0; })).catch((e => { l = !0, c = !0, s = e; }))); }, onload: t => { const n = createHttpStatusError(t); if (n) return void rejectOnce(n); if ("stream" !== e.responseType || !e.onStreamChunk) return void resolveOnce(t); const a = o || readStream(t.response, e.onStreamChunk).then((() => { l = !0; })).catch((e => { l = !0, c = !0, s = e; })); if (o = a, l) return c ? void rejectOnce(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u6d41\u5f0f\u54cd\u5e94\u8bfb\u53d6\u5931\u8d25", cause: s })) : void resolveOnce(t); a.then((() => { c ? rejectOnce(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u6d41\u5f0f\u54cd\u5e94\u8bfb\u53d6\u5931\u8d25", cause: s })) : resolveOnce(t); })); }, onabort: () => rejectOnce(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })), ontimeout: () => rejectOnce(createAiError("AI_REQUEST_TIMEOUT")), onerror: e => rejectOnce(createAiError("AI_NETWORK_FAILED", { cause: e })) }); })); return { promise: p, abort: () => { null == i || i.abort(), rejectTransport(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })); } }; }, createAnthropicBody = e => { const t = e.messages.filter((e => "system" === e.role)).map((e => e.content)).join("\n"), n = { model: e.config.model, messages: e.messages.filter((e => "system" !== e.role)).map((e => ({ role: e.role, content: e.content }))), stream: !1 }; return t && (n.system = t), void 0 !== e.config.temperature && (n.temperature = e.config.temperature), n.max_tokens = e.config.maxTokens ?? 1024, n; }, createOpenAiBody = e => { const t = { model: e.config.model, messages: e.messages, stream: e.stream }; return void 0 !== e.config.temperature && (t.temperature = e.config.temperature), void 0 !== e.config.maxTokens && (t.max_tokens = e.config.maxTokens), t; }, normalizeOpenAiChunk = e => { const t = null == e ? void 0 : e.choices; return Array.isArray(t) ? t.map((e => { var t; return null == (t = e.delta) ? void 0 : t.content; })).filter((e => "string" == typeof e)).join("") : ""; }, createOpenAiCompatibleProvider = (e = {}) => { const t = e.transport || createAiTransportRequest; return { id: e.id || "openai-compatible", chat: async e => { var n, a; (e => { var t; if (!e.enabled) throw createAiError("AI_PROVIDER_DISABLED"); if (!(null == (t = e.credential) ? void 0 : t.value.trim())) throw createAiError("AI_CREDENTIAL_MISSING"); })(e.config); const i = Date.now(), o = `${(e => e.replace(/\/+$/, ""))(e.config.baseUrl)}/chat/completions`, s = { Authorization: `Bearer ${(null == (n = e.config.credential) ? void 0 : n.value) || ""}`, "Content-Type": "application/json", Accept: "application/json" }; let r = ""; const l = createSsePacketParser(), c = t({ method: "POST", url: o, headers: s, data: JSON.stringify(createOpenAiBody(e)), timeout: e.config.timeout, responseType: e.stream ? "stream" : "json", onStreamChunk: e.stream ? t => { var n; const a = l; for (const i of a.push(t)) { const t = normalizeOpenAiChunk(i); t && (r += t, null == (n = e.onToken) || n.call(e, t)); } } : void 0 }), p = ((e, t) => { if (!e) return; const abortRequest = () => t(); if (!e.aborted) return e.addEventListener("abort", abortRequest, { once: !0 }), () => e.removeEventListener("abort", abortRequest); abortRequest(); })(e.signal, c.abort); try { const t = await c.promise; if (e.stream) { for (const t of l.flush()) { const n = normalizeOpenAiChunk(t); n && (r += n, null == (a = e.onToken) || a.call(e, n)); } if (!r) throw createAiError("AI_RESPONSE_PARSE_FAILED"); } else r = (e => { var t, n, a; const i = null == (a = null == (n = null == (t = null == e ? void 0 : e.choices) ? void 0 : t[0]) ? void 0 : n.message) ? void 0 : a.content; if ("string" != typeof i || !i) throw createAiError("AI_RESPONSE_PARSE_FAILED"); return i; })((e => { try { if ("string" == typeof e.response) { if (!e.response) return; return JSON.parse(e.response); } return void 0 !== e.response && null !== e.response ? e.response : e.responseText ? JSON.parse(e.responseText) : void 0; } catch (t) { throw createAiError("AI_RESPONSE_PARSE_FAILED", { cause: t }); } })(t)); return { text: r, raw: t.response, duration: Date.now() - i }; } finally { null == p || p(); } } }; }, Wt = createOpenAiCompatibleProvider(), Qt = ((e = {}) => { const t = e.transport || createAiTransportRequest; return { id: "anthropic-messages", chat: async e => { var n; (e => { var t; if (!e.enabled) throw createAiError("AI_PROVIDER_DISABLED"); if (!(null == (t = e.credential) ? void 0 : t.value.trim())) throw createAiError("AI_CREDENTIAL_MISSING"); })(e.config); const a = Date.now(), i = t({ method: "POST", url: `${o = e.config.baseUrl, o.replace(/\/+$/, "")}/messages`, headers: { "x-api-key": (null == (n = e.config.credential) ? void 0 : n.value) || "", "anthropic-version": "2023-06-01", "Content-Type": "application/json" }, data: JSON.stringify(createAnthropicBody(e)), timeout: e.config.timeout, responseType: "json" }); var o; const s = ((e, t) => { if (!e) return; const abortRequest = () => t(); if (!e.aborted) return e.addEventListener("abort", abortRequest, { once: !0 }), () => e.removeEventListener("abort", abortRequest); abortRequest(); })(e.signal, i.abort); try { const e = await i.promise, t = (e => { const t = null == e ? void 0 : e.content; if (!Array.isArray(t)) throw createAiError("AI_RESPONSE_PARSE_FAILED"); const n = t.map((e => e.text)).filter((e => "string" == typeof e)).join(""); if (!n) throw createAiError("AI_RESPONSE_PARSE_FAILED"); return n; })((e => { try { if ("string" == typeof e.response) { if (!e.response) return; return JSON.parse(e.response); } return void 0 !== e.response && null !== e.response ? e.response : e.responseText ? JSON.parse(e.responseText) : void 0; } catch (t) { throw createAiError("AI_RESPONSE_PARSE_FAILED", { cause: t }); } })(e)); return { text: t, raw: e.response, duration: Date.now() - a }; } finally { null == s || s(); } } }; })(), Yt = ((e = {}) => createOpenAiCompatibleProvider({ ...e, id: "cookie-glm" }))(), Xt = ((e = {}) => createOpenAiCompatibleProvider({ ...e, id: "cookie-spark" }))(), getAiProvider = e => { switch (e) { case "openai-compatible": return Wt; case "anthropic-messages": return Qt; case "cookie-glm": return Yt; case "cookie-spark": return Xt; } }, Zt = { 0: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u5355\u9009\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u9009\u9879\u5b57\u6bcd"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u9009\u9879\u5b57\u6bcd\u5fc5\u987b\u5927\u5199\uff0c\u6570\u7ec4\u4e2d\u53ea\u80fd\u6709 1 \u4e2a\u5143\u7d20\u3002\n2. \u4e0d\u591f\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 1: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u591a\u9009\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u9009\u9879\u5b57\u6bcd"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u9009\u9879\u5b57\u6bcd\u5fc5\u987b\u5927\u5199\uff0c\u5e76\u6309\u5b57\u6bcd\u5347\u5e8f\u6392\u5e8f\u3002\n2. \u81f3\u5c11\u4e24\u4e2a\u9009\u9879\u624d\u7b97\u6709\u6548\uff0c\u4e0d\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 2: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u586b\u7a7a\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u7b54\u68481","\u7b54\u68482"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u7b54\u6848\u6570\u91cf\u5fc5\u987b\u5339\u914d\u9898\u76ee\u7a7a\u683c\u6570\uff0c\u4e0d\u5f97\u7f3a\u5931\u6216\u591a\u586b\u3002\n2. \u4e0d\u591f\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 3: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u5224\u65ad\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u6b63\u786e"}\n\u6216\n{"answer":"\u9519\u8bef"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. answer \u53ea\u80fd\u662f\u201c\u6b63\u786e\u201d\u6216\u201c\u9519\u8bef\u201d\uff0c\u4e0d\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n2. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 4: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u7b80\u7b54\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u7cbe\u7b80\u7684\u7b54\u6848"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u76f4\u63a5\u7ed9\u51fa\u7cbe\u7b80\u7b54\u6848\uff0c\u4e0d\u8981\u8d58\u8ff0\u3002\n2. \u4e0d\u591f\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002' }, buildAiMessages = (e, t, n = "4") => [ { role: "system", content: "ask" === e ? Zt[n] || Zt[4] : "repair" === e ? "\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u7b54\u9898\u52a9\u624b\uff0c\u8bf7\u4fee\u590d\u7b54\u6848\u4e2d\u7f3a\u5931\u3001\u683c\u5f0f\u9519\u8bef\u6216\u8868\u8ff0\u4e0d\u6e05\u7684\u5185\u5bb9\u3002\u8f93\u51fa\u5e94\u4ee5\u4fee\u590d\u7b54\u6848\u4e3a\u4e3b\uff0c\u4fdd\u6301\u51c6\u786e\u3001\u7b80\u6d01\uff0c\u5e76\u907f\u514d\u65e0\u5173\u89e3\u91ca\u3002" : "\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u7b54\u9898\u52a9\u624b\uff0c\u8bf7\u6839\u636e\u7528\u6237\u63d0\u4f9b\u7684\u9898\u76ee\u8fdb\u884c\u89e3\u7b54\u3002\u56de\u7b54\u5e94\u51c6\u786e\u3001\u7b80\u6d01\uff0c\u5fc5\u8981\u65f6\u7ed9\u51fa\u7b80\u8981\u7406\u7531\u3002" }, { role: "user", content: t } ], runAiScene = async (e, t, n, a = {}) => { var i; if (!t) return (() => { const e = createAiError("AI_CONFIG_MISSING", { userMessage: "AI \u914d\u7f6e\u7f3a\u5931\uff0c\u8bf7\u5148\u5b8c\u6210\u914d\u7f6e" }); return { success: !1, text: "", duration: 0, error: e, displayMessage: getAiErrorMessage(e) }; })(); try { const o = a.provider || (null == (i = a.resolveProvider) ? void 0 : i.call(a, t)) || getAiProvider(t.providerKind), s = await o.chat({ config: t, messages: buildAiMessages(e, n, a.questionType), stream: a.stream ?? t.stream, onToken: a.onToken, signal: a.signal }); return { success: !0, text: s.text, duration: s.duration }; } catch (o) { const e = isAiError(o) ? o : createAiError("AI_NETWORK_FAILED", { cause: o }); return { success: !1, text: "", duration: 0, error: e, displayMessage: getAiErrorMessage(e) }; } }, en = new Set([ "4", "5", "6", "7" ]), invalid = (e, t, n) => ({ valid: !1, answer: [], raw: t, error: createAiError(e, { detail: n }) }), extractCodeBlockJson = e => { var t; const n = e.match(/```(?:json)?\s*([\s\S]*?)```/i); return null == (t = null == n ? void 0 : n[1]) ? void 0 : t.trim(); }, findJsonObjectText = e => { const t = e.indexOf("{"); if (t < 0) return; let n = 0, a = !1, i = !1; for (let o = t; o < e.length; o++) { const s = e[o]; if (i) i = !1; else if ("\\" !== s) if ('"' !== s) { if (!a && ("{" === s && n++, "}" === s && n--, 0 === n)) return e.slice(t, o + 1); } else a = !a; else i = !0; } return e.slice(t); }, normalizeTextAnswer = e => { if ("string" != typeof e) return; return e.trim() || void 0; }, normalizeTextArray = e => { if (!Array.isArray(e)) return; const t = e.map((e => "string" == typeof e ? e.trim() : "")).filter(Boolean); return t.length === e.length ? t : void 0; }, mapChoiceLetter = (e, t) => { const n = e.trim().toUpperCase(); if (!/^[A-Z]$/.test(n)) return; const a = t[n.charCodeAt(0) - 65]; return (null == a ? void 0 : a.trim()) || void 0; }, parseAiAnswer = (e, t) => { const n = (e => { const t = [ e.trim(), extractCodeBlockJson(e), findJsonObjectText(e) ].filter((e => Boolean(e))); for (const a of t) try { return { ok: !0, value: JSON.parse(a) }; } catch (n) { if (a === t[t.length - 1]) return { ok: !1, cause: n }; } return { ok: !1 }; })(e); if (!n.ok) return { valid: !1, answer: [], error: createAiError("AI_RESPONSE_PARSE_FAILED", { cause: n.cause }) }; const a = n.value, i = (e => { if ("object" == typeof e && null !== e && "answer" in e) return e.answer; })(a); return void 0 === i ? invalid("AI_OUTPUT_SCHEMA_INVALID", a) : "0" === t.type ? ((e, t, n) => { const a = Array.isArray(e) ? normalizeTextArray(e) : [ normalizeTextAnswer(e) ].filter((e => Boolean(e))); if (!a || 1 !== a.length) return invalid("AI_OUTPUT_SCHEMA_INVALID", t); const i = mapChoiceLetter(a[0], n.options); return i ? { valid: !0, answer: [ i ], raw: t } : invalid("AI_ANSWER_NOT_MATCHED", t, { answer: a[0] }); })(i, a, t) : "1" === t.type ? ((e, t, n) => { const a = normalizeTextArray(e); if (!a || a.length < 2) return invalid("AI_OUTPUT_SCHEMA_INVALID", t); if (new Set(a.map((e => e.toUpperCase()))).size !== a.length) return invalid("AI_ANSWER_NOT_MATCHED", t, { answer: a }); const i = a.map((e => mapChoiceLetter(e, n.options))); return i.some((e => !e)) ? invalid("AI_ANSWER_NOT_MATCHED", t, { answer: a }) : { valid: !0, answer: i, raw: t }; })(i, a, t) : "2" === t.type ? ((e, t, n) => { const a = normalizeTextArray(e); return a ? n.blankCount > 0 && a.length !== n.blankCount || 0 === n.blankCount && 0 === a.length ? invalid("AI_OUTPUT_SCHEMA_INVALID", t) : { valid: !0, answer: a, raw: t } : invalid("AI_OUTPUT_SCHEMA_INVALID", t); })(i, a, t) : "3" === t.type ? ((e, t) => { const n = normalizeTextAnswer(e); return "\u6b63\u786e" !== n && "\u9519\u8bef" !== n ? invalid("AI_OUTPUT_SCHEMA_INVALID", t) : { valid: !0, answer: [ n ], raw: t }; })(i, a) : en.has(t.type) ? ((e, t) => { const n = normalizeTextAnswer(e); return n ? { valid: !0, answer: [ n ], raw: t } : invalid("AI_OUTPUT_SCHEMA_INVALID", t); })(i, a) : invalid("AI_QUESTION_TYPE_UNSUPPORTED", a, { type: t.type }); }, hasUnsupportedMedia = e => /<\s*img\b/i.test(e) || /<\s*(?:svg|image)\b/i.test(e) || /<\s*math\b/i.test(e) || /<\s*script\b[^>]*type\s*=\s*["']?math\/tex/i.test(e) || /class\s*=\s*["'][^"']*\b(?:MathJax|katex)\b/i.test(e) || /!\[[^\]]*]\([^)]*\)/.test(e) || /\$\$/.test(e) || /(^|[^\w\d])\$[^\s$][^$\n]*\$(?!\d)/.test(e) || /\\\(/.test(e) || /\\\[/.test(e), tn = /^([A-Ha-h\uff21-\uff28\uff41-\uff48])(?:\s*[.\uff0e\u3002\u3001)\uff09]\s*|\s+)(.+)$/, nn = /^(\u7b54\u6848|\u89e3\u6790|\u63d0\u793a)\s*[:\uff1a]/, an = /^((\d+|[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07]+)[\s.\uff0e\u3002\u3001)\uff09]+)+/, cleanQuestionPrefix = e => e.replace(an, "").trim(), normalizeOption = e => e.replace(/\s+/g, ""), detectAiQuestionType = (e, t) => { const n = e.replace(/\s/g, ""); return (e => { if (2 !== e.length) return !1; const t = e.map(normalizeOption), n = new Set(t); return 2 === n.size && (n.has("\u6b63\u786e") && n.has("\u9519\u8bef") || n.has("\u5bf9") && n.has("\u9519")); })(t) ? "3" : /\u591a\u9009|\u591a\u9879|\u4e0d\u5b9a\u9879|\u9009\u62e9[\u4e24\u4e8c2]\u9879|\u9009\u62e9[\u4e24\u4e8c2]\u4e2a/.test(n) ? "1" : t.length > 0 ? "0" : (e => /(^|[\uff0c\u3002\uff1b;\uff01\uff1f?])\u5224\u65ad($|[\s\u3000\uff1a:\u9898]|\u4e0b\u5217|\u4ee5\u4e0b)/.test(e) || /\u8bf7\u5224\u65ad|\u6b63\u8bef|\u5bf9\u9519|\u662f\u975e/.test(e.replace(/\s/g, "")))(e) ? "3" : /\u586b\u7a7a|\u7a7a\u683c|\u586b\u8865|\u62ec\u53f7\u7a7a/.test(n) || /\uff08\s*\uff09|\(\s*\)/.test(e) ? "2" : /\u7b80\u7b54|\u7b80\u8ff0|\u8bba\u8ff0|\u8bf4\u660e|\u5206\u6790|\u4e3a\u4f55|\u4e3a\u4ec0\u4e48/.test(n) ? "4" : "8"; }, on = [ { id: "deepseek", name: "DeepSeek", providerKind: "openai-compatible", baseUrl: "https://api.deepseek.com", defaultModel: "deepseek-chat", models: [ "deepseek-chat", "deepseek-reasoner" ], stream: !0, credentialType: "api-key", docUrl: "https://api-docs.deepseek.com/api/create-chat-completion", region: "domestic" }, { id: "qwen-dashscope", name: "\u901a\u4e49\u5343\u95ee / \u767e\u70bc", providerKind: "openai-compatible", baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1", defaultModel: "qwen-plus", models: [ "qwen-plus", "qwen-turbo" ], stream: !0, credentialType: "api-key", docUrl: "https://help.aliyun.com/zh/model-studio/use-qwen-by-calling-api", region: "domestic" }, { id: "zhipu-glm", name: "\u667a\u8c31 GLM", providerKind: "openai-compatible", baseUrl: "https://open.bigmodel.cn/api/paas/v4", defaultModel: "glm-4.7", models: [ "glm-4.7", "glm-4-flash" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.bigmodel.cn/api-reference", region: "domestic" }, { id: "spark-cookie", name: "\u8baf\u98de\u661f\u706b Cookie", providerKind: "cookie-spark", baseUrl: "http://82.157.105.20:8000/v1", defaultModel: "gpt-4o", models: [ "gpt-4o" ], stream: !0, credentialType: "cookie-token", docUrl: "https://xinghuo.xfyun.cn/desk", region: "legacy" }, { id: "glm-cookie", name: "\u667a\u8c31\u6e05\u8a00 Cookie", providerKind: "cookie-glm", baseUrl: "http://82.157.105.20:8002/v1", defaultModel: "gpt-4o", models: [ "gpt-4o" ], stream: !0, credentialType: "cookie-token", docUrl: "https://chatglm.cn/main/alltoolsdetail", region: "legacy" }, { id: "baidu-qianfan", name: "\u767e\u5ea6\u5343\u5e06", providerKind: "openai-compatible", baseUrl: "https://qianfan.baidubce.com/v2", defaultModel: "ernie-4.0-turbo-8k", models: [ "ernie-4.0-turbo-8k" ], stream: !0, credentialType: "api-key", docUrl: "https://ai.baidu.com/ai-doc/WENXINWORKSHOP/0m2vwrjws", region: "domestic" }, { id: "volc-ark", name: "\u706b\u5c71\u65b9\u821f / \u8c46\u5305", providerKind: "openai-compatible", baseUrl: "https://ark.cn-beijing.volces.com/api/v3", defaultModel: "doubao-seed-1-6", models: [ "doubao-seed-1-6" ], stream: !0, credentialType: "api-key", docUrl: "https://www.volcengine.com/docs/6559/2310290", region: "domestic" }, { id: "tencent-hunyuan", name: "\u817e\u8baf\u6df7\u5143", providerKind: "openai-compatible", baseUrl: "https://api.hunyuan.cloud.tencent.com/v1", defaultModel: "hunyuan-turbos-latest", models: [ "hunyuan-turbos-latest" ], stream: !0, credentialType: "api-key", docUrl: "https://cloud.tencent.com/document/product/1729/111007", region: "domestic" }, { id: "kimi", name: "Kimi / Moonshot", providerKind: "openai-compatible", baseUrl: "https://api.moonshot.ai/v1", defaultModel: "kimi-k2.6", models: [ "kimi-k2.6" ], stream: !0, credentialType: "api-key", docUrl: "https://platform.kimi.ai/docs/api/overview", region: "domestic" }, { id: "siliconflow", name: "SiliconFlow", providerKind: "openai-compatible", baseUrl: "https://api.siliconflow.com/v1", defaultModel: "Qwen/QwQ-32B", models: [ "Qwen/QwQ-32B" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.siliconflow.com/en/api-reference/chat-completions/chat-completions", region: "domestic" }, { id: "openai", name: "OpenAI", providerKind: "openai-compatible", baseUrl: "https://api.openai.com/v1", defaultModel: "gpt-5.2", models: [ "gpt-5.2" ], stream: !0, credentialType: "api-key", docUrl: "https://platform.openai.com/docs/api-reference/chat/create-chat-completion", region: "global" }, { id: "anthropic", name: "Anthropic Claude", providerKind: "anthropic-messages", baseUrl: "https://api.anthropic.com/v1", defaultModel: "claude-sonnet-4-20250514", models: [ "claude-sonnet-4-20250514" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.anthropic.com/en/api/messages", region: "global" }, { id: "gemini", name: "Google Gemini", providerKind: "openai-compatible", baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai", defaultModel: "gemini-2.5-flash", models: [ "gemini-2.5-flash" ], stream: !0, credentialType: "api-key", docUrl: "https://ai.google.dev/gemini-api/docs/openai", region: "global" }, { id: "openrouter", name: "OpenRouter", providerKind: "openai-compatible", baseUrl: "https://openrouter.ai/api/v1", defaultModel: "openai/gpt-5.2", models: [ "openai/gpt-5.2" ], stream: !0, credentialType: "api-key", docUrl: "https://openrouter.ai/docs/api-reference/chat-completion", region: "global" }, { id: "groq", name: "Groq", providerKind: "openai-compatible", baseUrl: "https://api.groq.com/openai/v1", defaultModel: "llama-3.3-70b-versatile", models: [ "llama-3.3-70b-versatile" ], stream: !0, credentialType: "api-key", docUrl: "https://console.groq.com/docs/", region: "global" }, { id: "together", name: "Together AI", providerKind: "openai-compatible", baseUrl: "https://api.together.ai/v1", defaultModel: "meta-llama/Llama-3.3-70B-Instruct-Turbo", models: [ "meta-llama/Llama-3.3-70B-Instruct-Turbo" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.together.ai/docs/chat-overview", region: "global" }, { id: "mistral", name: "Mistral AI", providerKind: "openai-compatible", baseUrl: "https://api.mistral.ai/v1", defaultModel: "mistral-large-latest", models: [ "mistral-large-latest" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.mistral.ai/api/", region: "global" } ], getAiProviderPreset = e => on.find((t => t.id === e)), createConfigFromPreset = (e, t = {}) => { const n = getAiProviderPreset(e); if (!n) throw new Error(`\u672a\u77e5 AI \u5e73\u53f0\u9884\u8bbe: ${e}`); return { id: t.id || n.id, name: t.name || n.name, providerId: n.id, providerKind: n.providerKind, baseUrl: t.baseUrl || n.baseUrl, model: t.model || n.defaultModel, enabled: t.enabled ?? !0, stream: t.stream ?? n.stream, credential: t.credential, timeout: t.timeout || 3e4, temperature: t.temperature, maxTokens: t.maxTokens }; }, createDefaultAiSettings = () => ({ configs: [ createConfigFromPreset("deepseek"), createConfigFromPreset("qwen-dashscope"), createConfigFromPreset("glm-cookie", { id: "legacy-glm", enabled: !1 }), createConfigFromPreset("spark-cookie", { id: "legacy-spark", enabled: !1 }) ], defaultConfigId: "deepseek", enabledForAsk: !1, adoptionStrategy: "conservative", sceneOverrides: { enabled: !1 } }), sn = [ "openai-compatible", "anthropic-messages", "cookie-glm", "cookie-spark" ], rn = [ "direct", "conservative", "preview" ], isRecord = e => "object" == typeof e && null !== e, isAdoptionStrategy = e => "string" == typeof e && rn.includes(e), normalizeCredential = e => { if (!isRecord(e) || "string" != typeof e.value) return; return { type: "cookie-token" === e.type ? "cookie-token" : "api-key", value: e.value, updatedAt: "number" == typeof e.updatedAt ? e.updatedAt : void 0 }; }, normalizeAiConfig = e => { if (!isRecord(e) || "string" != typeof e.id || !e.id) return null; const t = "string" == typeof e.providerId ? getAiProviderPreset(e.providerId) : getAiProviderPreset(e.id), n = (e => "string" == typeof e && sn.includes(e))(e.providerKind) ? e.providerKind : (null == t ? void 0 : t.providerKind) || "openai-compatible", a = (null == t ? void 0 : t.id) || "string" == typeof e.providerId && e.providerId || e.id, i = "number" == typeof e.timeout && Number.isFinite(e.timeout) && e.timeout > 0 ? e.timeout : 3e4; return { id: e.id, name: "string" == typeof e.name && e.name ? e.name : (null == t ? void 0 : t.name) || e.id, providerId: a, providerKind: n, baseUrl: "string" == typeof e.baseUrl && e.baseUrl ? e.baseUrl : (null == t ? void 0 : t.baseUrl) || "", model: "string" == typeof e.model && e.model ? e.model : (null == t ? void 0 : t.defaultModel) || "", enabled: "boolean" != typeof e.enabled || e.enabled, stream: "boolean" == typeof e.stream ? e.stream : (null == t ? void 0 : t.stream) ?? !0, credential: normalizeCredential(e.credential), timeout: i, temperature: "number" == typeof e.temperature ? e.temperature : void 0, maxTokens: "number" == typeof e.maxTokens ? e.maxTokens : void 0 }; }, normalizeAiSettings = e => { var t; if (!isRecord(e) || !Array.isArray(e.configs)) return null; const n = e.configs.map(normalizeAiConfig).filter((e => null !== e)); if (!n.length) return null; const a = "string" == typeof e.defaultConfigId && n.some((t => t.id === e.defaultConfigId)) ? e.defaultConfigId : (null == (t = n.find((e => e.enabled))) ? void 0 : t.id) || n[0].id, i = isRecord(e.sceneOverrides) ? e.sceneOverrides : {}; return { configs: n, defaultConfigId: a, enabledForAsk: "boolean" == typeof e.enabledForAsk && e.enabledForAsk, adoptionStrategy: isAdoptionStrategy(e.adoptionStrategy) ? e.adoptionStrategy : "conservative", sceneOverrides: { enabled: "boolean" == typeof i.enabled && i.enabled, search: "string" == typeof i.search ? i.search : void 0, ask: "string" == typeof i.ask ? i.ask : void 0, repair: "string" == typeof i.repair ? i.repair : void 0 } }; }, getLegacyAiProviderName = e => "cookie-glm" === e.providerKind ? "GLM" : "cookie-spark" === e.providerKind ? "spark" : e.id, mergeLegacyAiCredentials = (e, t) => { const n = t.gpt; if (!(null == n ? void 0 : n.length)) return e; let a = !1; const i = e.configs.map((e => { var t, i; const o = ((e, t) => { const n = e.find((e => e.desc === t.name)); return n || ("legacy-glm" === t.id || "legacy-spark" === t.id ? e.find((e => e.name === getLegacyAiProviderName(t))) : void 0); })(n, e); if (!(null == o ? void 0 : o.key)) return e; return !e.providerKind.includes("cookie") && (null == (t = e.credential) ? void 0 : t.value) || (null == (i = e.credential) ? void 0 : i.value) === o.key ? e : (a = !0, { ...e, credential: { type: e.providerKind.includes("cookie") ? "cookie-token" : "api-key", value: o.key, updatedAt: Date.now() } }); })); return a ? { ...e, configs: i } : e; }, selectAiConfigForScene = (e, t) => { var n; const a = (null == (n = e.sceneOverrides) ? void 0 : n.enabled) ? e.sceneOverrides[t] : void 0; return e.configs.find((e => e.id === a && e.enabled)) || e.configs.find((t => t.id === e.defaultConfigId && t.enabled)) || e.configs.find((e => e.enabled)); }, markToHtml = e => simpleMarkdownToHtml(e), ln = { 0: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u5355\u9009\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u9009\u9879\u5b57\u6bcd"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u4ec5\u5141\u8bb8\u4e0a\u8ff0 JSON \u7ed3\u6784\uff0c\u4e0d\u80fd\u6dfb\u52a0\u952e\u3001\u6ce8\u91ca\u6216\u4efb\u4f55\u989d\u5916\u5b57\u6bb5\u3002\n2. \u9009\u9879\u5b57\u6bcd\u5fc5\u987b\u5927\u5199\uff08A\u3001B\u3001C\u3001D\u2026\uff09\uff0c\u6570\u7ec4\u4e2d\u53ea\u80fd\u6709 1 \u4e2a\u5143\u7d20\u3002\n3. \u4e0d\u591f\u786e\u5b9a\uff08\u7f6e\u4fe1\u5ea6 <60%\uff09\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n4. \u7981\u6b62\u51fa\u73b0\u53cd\u5f15\u53f7\u3001\u4ee3\u7801\u5757\u3001\u8bf4\u660e\u6587\u5b57\u3001\u7a7a\u683c\u6216\u6362\u884c\u3002\n\n\u3010\u8f93\u51fa\u793a\u4f8b\u3011\n\u6b63\u786e\u793a\u4f8b1\uff1a{"answer":["B"]}\n\u6b63\u786e\u793a\u4f8b2\uff1a{"answer":[]}\n\u9519\u8bef\u793a\u4f8b\uff1a```json{"answer":["B"]}```\uff08\u542b\u4ee3\u7801\u5757\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a\u7b54\u6848\u662fB\u6240\u4ee5{"answer":["B"]}\uff08\u542b\u89e3\u91ca\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":["b"]}\uff08\u5c0f\u5199\u5b57\u6bcd\uff09\n\n\u3010\u6700\u540e\u8b66\u544a\u3011\u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 1: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u591a\u9009\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u9009\u9879\u5b57\u6bcd"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u4ec5\u5141\u8bb8\u4e0a\u8ff0 JSON \u7ed3\u6784\uff0c\u4e0d\u80fd\u6dfb\u52a0\u5176\u4ed6\u952e\u6216\u8bf4\u660e\u3002\n2. \u9009\u9879\u5b57\u6bcd\u5fc5\u987b\u5927\u5199\uff0c\u5e76\u6309\u5b57\u6bcd\u5347\u5e8f\u6392\u5e8f\u3002\n3. \u81f3\u5c11\u4e24\u4e2a\u9009\u9879\u624d\u7b97\u6709\u6548\uff0c\u5426\u5219\u8f93\u51fa\u7a7a\u6570\u7ec4\u3002\n4. \u4e0d\u591f\u786e\u5b9a\uff08\u7f6e\u4fe1\u5ea6 <60%\uff09\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n5. \u7981\u6b62\u53cd\u5f15\u53f7\u3001\u4ee3\u7801\u5757\u3001\u524d\u540e\u6ce8\u91ca\u6216\u89e3\u91ca\u3002\n\n\u3010\u8f93\u51fa\u793a\u4f8b\u3011\n\u6b63\u786e\u793a\u4f8b1\uff1a{"answer":["A","C","D"]}\n\u6b63\u786e\u793a\u4f8b2\uff1a{"answer":["B","D"]}\n\u6b63\u786e\u793a\u4f8b3\uff1a{"answer":[]}\n\u9519\u8bef\u793a\u4f8b\uff1a```json{"answer":["A","C"]}```\uff08\u542b\u4ee3\u7801\u5757\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a\u7b54\u6848\u662fACD\uff0c{"answer":["A","C","D"]}\uff08\u542b\u89e3\u91ca\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":["C","A"]}\uff08\u672a\u6392\u5e8f\uff09\n\n\u3010\u6700\u540e\u8b66\u544a\u3011\u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 2: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u586b\u7a7a\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u7b54\u68481","\u7b54\u68482"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u6570\u7ec4\u957f\u5ea6\u5fc5\u987b\u7b49\u4e8e\u9898\u76ee\u7a7a\u683c\u6570\uff0c\u4e0d\u5f97\u7f3a\u5931\u6216\u591a\u586b\u3002\n2. \u6bcf\u4e2a\u7b54\u6848\u4e0d\u8d85\u8fc7 15 \u5b57\uff0c\u4fdd\u6301\u6570\u5b57/\u5355\u4f4d/\u4e13\u4e1a\u8bcd\u7684\u539f\u6837\u3002\n3. \u4e0d\u591f\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n4. \u7981\u6b62\u53cd\u5f15\u53f7\u3001\u4ee3\u7801\u5757\u3001\u89e3\u91ca\u3001\u7a7a\u767d\u884c\u6216\u989d\u5916\u5b57\u6bb5\u3002\n\n\u3010\u8f93\u51fa\u793a\u4f8b\u3011\n\u9898\u76ee\u67092\u4e2a\u7a7a\uff0c\u6b63\u786e\u793a\u4f8b1\uff1a{"answer":["\u5149\u5408\u4f5c\u7528","\u53f6\u7eff\u4f53"]}\n\u9898\u76ee\u67091\u4e2a\u7a7a\uff0c\u6b63\u786e\u793a\u4f8b2\uff1a{"answer":["DNA"]}\n\u4e0d\u786e\u5b9a\u65f6\uff0c\u6b63\u786e\u793a\u4f8b3\uff1a{"answer":[]}\n\u9519\u8bef\u793a\u4f8b\uff1a```json{"answer":["\u5149\u5408\u4f5c\u7528"]}```\uff08\u542b\u4ee3\u7801\u5757\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a\u7b2c\u4e00\u4e2a\u7a7a\u662f"\u5149\u5408\u4f5c\u7528"\uff0c\u7b2c\u4e8c\u4e2a\u7a7a\u662f"\u53f6\u7eff\u4f53"\uff08\u542b\u89e3\u91ca\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":["\u5149\u5408\u4f5c\u7528"]}\uff08\u7a7a\u683c\u6570\u4e0d\u5339\u914d\uff09\n\n\u3010\u6700\u540e\u8b66\u544a\u3011\u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 3: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u5224\u65ad\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u6b63\u786e"}\n\u6216\n{"answer":"\u9519\u8bef"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. answer \u53ea\u80fd\u662f\u201c\u6b63\u786e\u201d\u6216\u201c\u9519\u8bef\u201d\uff0c\u4e0d\u5f97\u4f7f\u7528\u201c\u5bf9/\u9519/\u221a/true\u201d\u7b49\u5176\u4ed6\u8868\u8ff0\u3002\n2. \u4e0d\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n3. \u7981\u6b62\u53cd\u5f15\u53f7\u3001\u4ee3\u7801\u5757\u3001\u4f9d\u636e\u8bf4\u660e\u6216\u7a7a\u767d\u884c\u3002\n\n\u3010\u8f93\u51fa\u793a\u4f8b\u3011\n\u6b63\u786e\u793a\u4f8b1\uff1a{"answer":"\u6b63\u786e"}\n\u6b63\u786e\u793a\u4f8b2\uff1a{"answer":"\u9519\u8bef"}\n\u6b63\u786e\u793a\u4f8b3\uff1a{"answer":""}\n\u9519\u8bef\u793a\u4f8b\uff1a```json{"answer":"\u6b63\u786e"}```\uff08\u542b\u4ee3\u7801\u5757\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a\u8fd9\u9053\u9898\u662f\u6b63\u786e\u7684\uff0c{"answer":"\u6b63\u786e"}\uff08\u542b\u89e3\u91ca\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":"\u5bf9"}\uff08\u8868\u8ff0\u9519\u8bef\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":"true"}\uff08\u8868\u8ff0\u9519\u8bef\uff09\n\n\u3010\u6700\u540e\u8b66\u544a\u3011\u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 4: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u7b80\u7b54\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u7cbe\u7b80\u7684\u7b54\u6848"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u7b54\u6848\u957f\u5ea6\u4e0d\u8d85\u8fc7 30 \u4e2a\u5b57\u7b26\uff0c\u76f4\u63a5\u7ed9\u51fa\u7ed3\u8bba\uff0c\u4e0d\u8981\u8d58\u8ff0\u3002\n2. \u4f18\u5148\u6cbf\u7528\u9898\u5e72\u4e2d\u7684\u4e13\u4e1a\u672f\u8bed\uff0c\u907f\u514d\u6bd4\u55bb\u6216\u4fee\u8f9e\u3002\n3. \u4e0d\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n4. \u7981\u6b62\u6807\u70b9\uff08\u53e5\u53f7\u3001\u9017\u53f7\u7b49\uff09\uff0c\u7981\u6b62\u53cd\u5f15\u53f7\u3001\u4ee3\u7801\u5757\u6216\u89e3\u91ca\u6027\u6587\u5b57\u3002\n\n\u3010\u8f93\u51fa\u793a\u4f8b\u3011\n\u6b63\u786e\u793a\u4f8b1\uff1a{"answer":"\u5149\u5408\u4f5c\u7528\u5c06\u5149\u80fd\u8f6c\u5316\u4e3a\u5316\u5b66\u80fd"}\n\u6b63\u786e\u793a\u4f8b2\uff1a{"answer":"\u91cf\u5b50\u7ea0\u7f20"}\n\u6b63\u786e\u793a\u4f8b3\uff1a{"answer":""}\n\u9519\u8bef\u793a\u4f8b\uff1a```json{"answer":"\u5149\u5408\u4f5c\u7528"}```\uff08\u542b\u4ee3\u7801\u5757\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a\u7b54\u6848\u662f\u5149\u5408\u4f5c\u7528\uff0c\u89e3\u6790\uff1a...\uff08\u542b\u89e3\u91ca\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":"\u5149\u5408\u4f5c\u7528\u3002"}\uff08\u5e26\u6807\u70b9\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":"\u8fd9\u4e2a\u95ee\u9898\u6d89\u53ca\u7684\u662f\u5149\u5408\u4f5c\u7528\u7684\u76f8\u5173\u77e5\u8bc6\u70b9"}\uff08\u8fc7\u957f\uff09\n\n\u3010\u6700\u540e\u8b66\u544a\u3011\u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002' }, getMessageContent = e => "string" == typeof e ? e : e.content, aiAskByProvider = async (e, t, n, a) => { var i, o; const s = (() => { try { return null == ce ? void 0 : ce[Mt + "ai"]; } catch { return; } })(); if (!(null == s ? void 0 : s.selectConfig)) return; null == (i = s.mergeLegacyCredentials) || i.call(s, getApp()); const r = s.selectConfig((e => Object.values(ln).includes(e) ? "ask" : "search")(a)); if (!r) return t("\u6ca1\u6709\u53ef\u7528\u7684 AI \u914d\u7f6e\uff0c\u8bf7\u5148\u5728 AI \u8bbe\u7f6e\u4e2d\u542f\u7528\u81f3\u5c11\u4e00\u4e2a\u914d\u7f6e"), n(), ""; if (!(null == (o = r.credential) ? void 0 : o.value.trim())) return t(`AI \u914d\u7f6e\u300c${r.name}\u300d\u7f3a\u5c11\u51ed\u8bc1\uff0c\u8bf7\u5148\u5728 AI \u8bbe\u7f6e\u4e2d\u586b\u5199 API Key \u6216 Cookie`), n(), ""; try { let i = !1; const o = await getAiProvider(r.providerKind).chat({ config: r, messages: [ { role: "system", content: a }, { role: "user", content: getMessageContent(e) } ], stream: r.stream, onToken: e => { i = !0, t(e); } }); return i || t(o.text), n(), o.text; } catch (l) { throw t(getAiErrorMessage(l)), n(), l; } }; function getPreviewResumeAction(e, t) { const n = Math.max(t - 1, 0); return e >= n ? { shouldFinish: !0, nextIndex: n } : { shouldFinish: !1, nextIndex: e + 1 }; } const noAnswerMatch = e => ({ res: [ e ], haveAnswer: !1 }), createFallbackResult = (e, t, n = 0, a = "") => { const i = { action: "mark-no-answer", answer: [] }, o = { form: e, answer: [], msg: t, duration: n, aiStatus: i.action, rawText: a }; return { res: o, matchResult: noAnswerMatch(o), action: i }; }, getBlankCount = e => { var t, n; const a = e.$options, i = "function" == typeof a ? a() : a; return Array.isArray(i) ? i.length : (null == (t = e.html) ? void 0 : t.querySelectorAll) ? e.html.querySelectorAll("textarea").length : "string" == typeof e.html && (null == (n = e.html.match(/ { const t = e.baseUrl.trim().replace(/\/+$/, ""); return /\/chat\/completions$/i.test(t) ? t : `${t}/chat/completions`; }, legacyProviderName = e => getLegacyAiProviderName(e), createLegacyAppAiConfig = e => { const t = normalizeAiSettings(e) || createDefaultAiSettings(), n = selectAiConfigForScene(t, "ask") || t.configs.find((e => e.id === t.defaultConfigId)) || t.configs[0]; return { gpt: t.configs.map((e => { var t, n; return { name: legacyProviderName(e), desc: e.name, api: legacyApiUrl(e), key: (null == (t = e.credential) ? void 0 : t.value) || "", msg: `AI\u54cd\u5e94\u5f02\u5e38\uff0c\u8bf7\u68c0\u67e5 AI \u8bbe\u7f6e\u4e2d\u7684\u300c${e.name}\u300d\u51ed\u8bc1\u6216\u6a21\u578b\u914d\u7f6e`, home: (null == (n = getAiProviderPreset(e.providerId)) ? void 0 : n.docUrl) || "", recommend: 0, model: e.model }; })), gptIndex: Math.max(t.configs.findIndex((e => e.id === (null == n ? void 0 : n.id))), 0), askGpt: t.enabledForAsk }; }; function loadAiSettings() { const e = Cache.get("ai_settings"), t = normalizeAiSettings(e); if (t) { const n = mergeLegacyAiCredentials(t, getApp()); return n !== e && Cache.set("ai_settings", n), n; } try { const e = mergeLegacyAiCredentials((e => { var t, n; const a = createDefaultAiSettings(); if (!(null == (t = e.gpt) ? void 0 : t.length)) return { ...a, enabledForAsk: !!e.askGpt }; const i = {}, o = e.gpt.map(((e, t) => { var n; const a = (e => /glm/i.test(e.name) ? "glm-cookie" : /spark|\u661f\u706b/i.test(e.name) ? "spark-cookie" : "deepseek")(e), o = ((e, t) => { const n = t[e] || 0; return t[e] = n + 1, 0 === n ? e : `${e}-${n}`; })(((e, t) => /glm/i.test(e.name) ? "legacy-glm" : /spark|\u661f\u706b/i.test(e.name) ? "legacy-spark" : `legacy-ai-${t}`)(e, t), i); return createConfigFromPreset(a, { id: o, name: e.desc || e.name, baseUrl: (s = e.api, s.trim().split(/[?#]/)[0].replace(/\/+$/, "").replace(/\/chat\/completions$/, "").replace(/\/+$/, "") || (null == (n = getAiProviderPreset(a)) ? void 0 : n.baseUrl)), model: e.model, enabled: !0, credential: e.key ? { type: a.includes("cookie") ? "cookie-token" : "api-key", value: e.key } : void 0 }); var s; })); return { configs: o, defaultConfigId: (null == (n = o[Math.min(Math.max(e.gptIndex || 0, 0), o.length - 1)]) ? void 0 : n.id) || a.defaultConfigId, enabledForAsk: !!e.askGpt, adoptionStrategy: "conservative", sceneOverrides: { enabled: !1 } }; })(getApp()), getApp()); return Cache.set("ai_settings", e), e; } catch (n) { const e = createDefaultAiSettings(); return Cache.set("ai_settings", e), e; } } const cn = defineStore("ai", { state: () => ({ aiMsg: "", aiLoading: !1, settings: loadAiSettings(), connectionTestingId: "", connectionMessage: "", connectionTestingIds: {}, connectionMessages: {}, connectionRequestTokens: {}, latestConnectionRequestToken: "" }), actions: { currentAiMd() { return simpleMarkdownToHtml(this.aiMsg); }, resetAi() { this.aiMsg = "", this.aiLoading = !1; }, saveSettings() { this.settings = normalizeAiSettings(this.settings) || createDefaultAiSettings(), Cache.set("ai_settings", this.settings); }, mergeLegacyCredentials(e = getApp()) { const t = mergeLegacyAiCredentials(this.settings, e); t !== this.settings && (this.settings = t, this.saveSettings()); }, selectConfig(e) { return selectAiConfigForScene(this.settings, e); }, updateCredential(e, t) { this.settings = ((e, t, n) => ({ ...e, configs: e.configs.map((e => e.id === t ? { ...e, credential: { ...n, updatedAt: Date.now() } } : e)) }))(this.settings, e, t), this.saveSettings(); }, async testConfig(e) { const t = this.settings.configs.find((t => t.id === e)), n = `${Date.now()}-${Math.random()}`; this.connectionTestingId = e, this.connectionMessage = "", this.connectionTestingIds[e] = !0, this.connectionMessages[e] = "", this.connectionRequestTokens[e] = n, this.latestConnectionRequestToken = n; const updateConnectionMessage = t => { const a = t.success ? `\u8fde\u63a5\u6210\u529f\uff0c\u8017\u65f6 ${t.duration}ms` : t.displayMessage || "\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u914d\u7f6e"; this.connectionRequestTokens[e] === n && (this.connectionMessages[e] = a), this.latestConnectionRequestToken === n && (this.connectionMessage = a); }; try { const e = await (async e => runAiScene("search", e, "\u8bf7\u53ea\u56de\u590d\u201c\u8fde\u63a5\u6210\u529f\u201d", { stream: !1 }))(t); return updateConnectionMessage(e), e; } catch (a) { const e = { success: !1, text: "", duration: 0, displayMessage: "\u8fde\u63a5\u6d4b\u8bd5\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5" }; return updateConnectionMessage(e), e; } finally { this.connectionRequestTokens[e] === n && (delete this.connectionTestingIds[e], delete this.connectionRequestTokens[e]), this.latestConnectionRequestToken === n && (this.connectionTestingId = "", this.latestConnectionRequestToken = ""); } } } }), pn = defineStore("ask", { state: () => ({ questionList: [], questionInx: 0, inx: 0, Interval: 0, start: !1, skipFinish: Cache.get("skipFinish", !1), autoNext: Cache.get("autoNext", !1), autoAnswer: Cache.get("autoAnswer", !0), freeFirst: !0, randomAnswer: Cache.get("randomAnswer", !1), lock: !1, formMap: {}, type: "cx", loading: !1, loadingText: "\u52a0\u8f7d\u4e2d....", aiLoadingIndex: -1, aiPreview: null, aiFailureMap: {}, tips: "\u672c\u811a\u672c\u4ec5\u4f9b\u5b66\u4e60\u7814\u7a76\uff0c\u8bf7\u52ff\u7528\u4e8e\u975e\u6cd5\u7528\u9014", delay: Cache.get("delay", 1e3), minDelay: Cache.get("minDelay", 0), saveQuestionData: [] }), actions: { addQuestion(e) { this.questionList.push({ ...e, answer: [], status: 0, aiMsg: "" }); }, clearQuestion() { this.questionList = []; }, getQuestion() { return this.questionList[this.questionInx]; }, nextQuestion() { if (this.questionInx === this.questionList.length - 1) return clearInterval(this.Interval), void (this.start = !1); this.questionInx++; }, prevQuestion() { 0 !== this.questionInx && this.questionInx--; }, toQuestion(e) { this.questionInx = e; let t = this.questionList[e]; this.rule.toquestion && this.rule.toquestion(e); try { if (t.html.scrollIntoView({ block: "center" }), ce.self !== ce.top) { let n = document.querySelector(".el-dialog"); if (n) { n.style.transform = "none"; let a = t.html.getBoundingClientRect(); n.style.top = a.top - 700 + "px", 0 === e && (n.style.top = "0px"), e === this.questionList.length - 1 && document.documentElement.scrollHeight > 2e3 && (n.style.top = a.top - 900 + "px"); } } t.html.style.boxShadow = "0 0 10px rgba(0, 0, 0, 0.15)", setTimeout((() => { t.html.style.boxShadow = ""; }), 500); } catch (n) {} }, setQuestionStatus(e, t) { this.questionList[e] && null != this.questionList[e].status && (this.questionList[e].status = t); }, async toggleStart() { const e = getAppStore(); try { if ("start" !== await async function(e, t) { const n = function(e) { return e.lock ? "noop" : e.start ? "stop" : "start"; }(e); if ("noop" === n) return n; if ("stop" === n) return e.start = !1, n; e.start = !0, e.lock = !0; try { return await t(), e.start ? n : "stop"; } finally { e.start = !1, e.lock = !1; } }(this, (async () => { var t; for (let n = this.questionInx; n < this.questionList.length && this.start; n++) { if (this.skipFinish && 1 === this.questionList[n].status) continue; if (this.questionInx = n, "8" !== this.questionList[n].type) { if ((null == (t = this.rule) ? void 0 : t.answerDelay) && await sleep(this.rule.answerDelay), await this.reAnswer(n), !this.start) break; e.app.alert = `\u5f53\u524d\u8fdb\u5ea6:${n + 1}/${this.questionList.length}`, await sleep(this.delay + 1e3 * Math.random()), this.rule.toquestion && this.rule.toquestion(this.questionInx + 1), this.autoNext && this.rule.next && this.rule.next(); } else this.setQuestionStatus(n, 2); } }))) return; this.finishRun(e); } catch (t) { e.app.alert = "\u7b54\u9898\u4e2d\u65ad\uff0c\u8bf7\u91cd\u8bd5"; } }, finishRun(e = getAppStore()) { this.autoNext && this.rule.finish && this.rule.finish({ question: this.questionList }), this.formMap = {}, this.questionList.forEach((t => { var n; if (null == (n = t.form) ? void 0 : n.form) { let e = t.form.form; e && (this.formMap[e] = this.formMap[e] ? this.formMap[e] + 1 : 1); } else this.formMap["\u65e0\u7b54\u6848"] = this.formMap["\u65e0\u7b54\u6848"] ? this.formMap["\u65e0\u7b54\u6848"] + 1 : 1; e.app.alert = "\u7b54\u9898\u5b8c\u6210~"; })); }, async reAnswer(e) { var t; const n = getAppStore(); let a = this.questionList[e]; delete this.aiFailureMap[e], (null == (t = this.aiPreview) ? void 0 : t.index) === e && (this.aiPreview = null), await async function(e, t) { e.loading = !0; try { return await t(); } finally { e.loading = !1; } }(this, (async () => { let t = []; this.loadingText = "\u52a0\u8f7d\u4e2d...."; let i = await Answer.getCacheAnswer(a), o = await ApiAnswerMatch([ i ], a); var s, r, l; if (s = i, r = o.haveAnswer, l = t, t = r ? [ s ] : l, !o.haveAnswer && (this.loadingText = "\u6b63\u5728\u4ece\u63a5\u53e3\u4e2d\u83b7\u53d6\u7b54\u6848", i = await Answer.getAnswersFree(a), o = await ApiAnswerMatch(i, a), t = i, !o.haveAnswer && n.app.askGpt)) { this.loadingText = "\u6b63\u5728\u4eceAI\u4e2d\u83b7\u53d6\u7b54\u6848"; let n = this.buildAIQuestionText(a); const s = await this.fetchAIAnswer(n, a); if ("preview" === s.action.action) return this.aiPreview = { index: e, answer: s.res.answer, rawText: s.res.rawText, reason: "\u7b49\u5f85\u7528\u6237\u786e\u8ba4 AI \u5efa\u8bae" }, this.start = !1, a.answer = t, void (a.form = o.form); i = s.res, o = s.matchResult, t.push(i), "mark-no-answer" === s.action.action && (this.aiFailureMap[e] = i.msg || "AI \u672a\u91c7\u7eb3\u8be5\u7b54\u6848"); } a.answer = t, a.form = o.form, o.haveAnswer ? this.setQuestionStatus(e, 1) : (this.randomAnswer && await (async (e, t) => { const n = getAskStore(); let a = t.type, i = [ "", [], t, n.rule ]; switch (a) { case "0": case "1": let e = [ Math.floor(Math.random() * t.options.length) ]; i[0] = "xx", i[1] = e; break; case "3": let n = Math.random() > .5 ? "\u6b63\u786e" : "\u9519\u8bef"; i[0] = "pd", i[1] = n; break; case "15": let a = []; if (t.options && Array.isArray(t.options)) for (let i = 0; i < t.options.length; i++) { let e = t.options[i]; if (e.options && e.options.length > 0) { let t = Math.floor(Math.random() * e.options.length); a.push([ t ]); } else a.push([]); } i[0] = "ydlj", i[1] = a; break; default: return; } await applyAnswerResult(i[0], i[1], t, n.rule); })(0, a), this.setQuestionStatus(e, 2)); })); }, buildAIQuestionText(e) { var t; let n = `[${typeConvert(e.type, !1)}]${e.question}\n`; return e.options && e.options.forEach(((e, t) => { n += `${String.fromCharCode(65 + t)}\u3001${e}\n`; })), "24" === e.type && (e.match.forEach((e => { n += `\u7b2c\u4e00\u5217${e}\n`; })), null == (t = e.selects[0]) || t.forEach((e => { n += `\u7b2c\u4e8c\u5217${e.text}\n`; }))), n; }, async fetchAIAnswer(e, t) { const n = cn(), a = await (async ({text: e, type: t, question: n, config: a, adoptionStrategy: i, runScene: o = runAiScene, matchAnswer: s}) => { const r = (null == a ? void 0 : a.name) || "AI"; if (hasUnsupportedMedia(e) || hasUnsupportedMedia((e => e.html ? "string" == typeof e.html ? e.html : "string" == typeof e.html.outerHTML ? e.html.outerHTML : "string" == typeof e.html.innerHTML ? e.html.innerHTML : "" : "")(n))) return createFallbackResult(r, getAiErrorMessage(createAiError("AI_IMAGE_UNSUPPORTED"))); const l = await o("ask", a, e, { questionType: t, stream: !1 }); if (!l.success) return createFallbackResult(r, l.displayMessage || "AI \u672a\u8fd4\u56de\u53ef\u7528\u7b54\u6848", l.duration, l.text); const c = parseAiAnswer(l.text, { type: t, options: n.options || [], blankCount: getBlankCount(n) }), p = ((e, t) => "preview" === e ? t.valid ? { action: "preview", answer: t.answer } : { action: "mark-no-answer", answer: [] } : "conservative" === e ? t.valid ? { action: "fill", answer: t.answer } : { action: "mark-no-answer", answer: [] } : t.answer.length > 0 ? { action: "fill", answer: t.answer } : { action: "mark-no-answer", answer: [] })(i, c), d = { form: r, answer: c.answer, msg: c.error ? getAiErrorMessage(c.error) : "", duration: l.duration, aiStatus: p.action, rawText: l.text }; if ("fill" !== p.action) return { res: d, matchResult: noAnswerMatch(d), action: p }; try { return { res: d, matchResult: await s([ d ], n, !1), action: p }; } catch (u) { return createFallbackResult(r, "AI \u7b54\u6848\u586b\u5145\u5931\u8d25\uff0c\u8bf7\u624b\u52a8\u6838\u5bf9\u540e\u91cd\u8bd5", l.duration, l.text); } })({ text: e, type: t.type, question: t, config: n.selectConfig("ask"), adoptionStrategy: n.settings.adoptionStrategy, matchAnswer: ApiAnswerMatch }); return a; }, async confirmAiPreview() { if (!this.aiPreview) return; const e = this.aiPreview, t = this.questionList[e.index]; if (!t) return void (this.aiPreview = null); const n = { form: "AI \u9884\u89c8", answer: e.answer, duration: 0, msg: "", aiStatus: "confirmed", rawText: e.rawText }; t.answer.push(n); const a = await ApiAnswerMatch([ n ], t, !1); t.form = a.form, a.haveAnswer ? (delete this.aiFailureMap[e.index], this.setQuestionStatus(e.index, 1)) : (this.aiFailureMap[e.index] = "AI \u5efa\u8bae\u65e0\u6cd5\u5339\u914d\u5f53\u524d\u9898\u76ee", this.setQuestionStatus(e.index, 2)), this.aiPreview = null; const i = getPreviewResumeAction(e.index, this.questionList.length); this.questionInx = i.nextIndex, i.shouldFinish ? this.finishRun() : this.toggleStart(); }, skipAiPreview() { if (!this.aiPreview) return; const e = this.aiPreview; this.aiFailureMap[e.index] = "\u7528\u6237\u8df3\u8fc7 AI \u5efa\u8bae", this.setQuestionStatus(e.index, 2), this.aiPreview = null; const t = getPreviewResumeAction(e.index, this.questionList.length); this.questionInx = t.nextIndex, t.shouldFinish ? this.finishRun() : this.toggleStart(); }, aiAnswer(e) { let t = this.questionList[e]; this.loadingText = "AI\u601d\u8003\u4e2d.....", this.loading = !0, this.aiLoadingIndex = e; let n = `[${typeConvert(t.type, !1)}]${t.question}\n`; t.aiMsg = "", t.options.forEach((e => { n += `${e}\n`; })), "24" === t.type && (t.match.forEach(((e, t) => { n += `\u7b2c\u4e00\u5217${e}\n`; })), t.selects[0].forEach(((e, t) => { n += `\u7b2c\u4e8c\u5217${e.text}\n`; }))), (async (e, t, n, a = '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u7cbe\u7b80\u7684\u7b54\u6848"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u4ec5\u5141\u8bb8\u4e0a\u8ff0 JSON \u7ed3\u6784\uff0c\u4e0d\u5f97\u6dfb\u52a0\u952e\u6216\u4efb\u4f55\u9644\u52a0\u4fe1\u606f\u3002\n2. \u7b54\u6848\u957f\u5ea6\u4e0d\u8d85\u8fc7 50 \u4e2a\u5b57\u7b26\uff0c\u76f4\u63a5\u7ed9\u6838\u5fc3\u7ed3\u8bba\uff0c\u4e0d\u8981\u94fa\u57ab\u3002\n3. \u4f18\u5148\u4f7f\u7528\u9898\u5e72\u4e2d\u7684\u4e13\u4e1a\u672f\u8bed\uff0c\u7981\u6b62\u6bd4\u55bb\u3001\u4fee\u8f9e\u6216\u53e3\u8bed\u5316\u8868\u8fbe\u3002\n4. \u4e0d\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n5. \u7981\u6b62\u53cd\u5f15\u53f7\u3001\u4ee3\u7801\u5757\u3001\u8bf4\u660e\u6587\u5b57\u3001\u7a7a\u767d\u884c\u6216\u5176\u4ed6\u7b26\u53f7\u3002\n\n\u3010\u8f93\u51fa\u793a\u4f8b\u3011\n\u6b63\u786e\u793a\u4f8b1\uff1a{"answer":"\u901a\u8fc7\u589e\u52a0\u9176\u6d53\u5ea6\u548c\u63d0\u9ad8\u53cd\u5e94\u6e29\u5ea6\u6765\u52a0\u901f\u5316\u5b66\u53cd\u5e94"}\n\u6b63\u786e\u793a\u4f8b2\uff1a{"answer":"\u91cf\u5b50\u7ea0\u7f20\u73b0\u8c61\u7684\u975e\u5c40\u57df\u6027\u7279\u5f81"}\n\u6b63\u786e\u793a\u4f8b3\uff1a{"answer":""}\n\u9519\u8bef\u793a\u4f8b\uff1a```json{"answer":"\u7b54\u6848\u5185\u5bb9"}```\uff08\u542b\u4ee3\u7801\u5757\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a\u8fd9\u4e2a\u95ee\u9898\u7684\u7b54\u6848\u662f...\u6240\u4ee5{"answer":"..."}\uff08\u542b\u89e3\u91ca\uff09\n\u9519\u8bef\u793a\u4f8b\uff1a{"answer":"\u8fd9\u5c31\u50cf...\uff08\u4f7f\u7528\u6bd4\u55bb\uff09"}\uff08\u542b\u6bd4\u55bb\uff09\n\n\u3010\u6700\u540e\u8b66\u544a\u3011\u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002') => { const i = await aiAskByProvider(e, t, n, a); if (void 0 !== i) return i; const o = getApp(), s = o.gpt[o.gptIndex]; if (!s.key) return t(`${s.msg}`), Promise.resolve("\u6682\u65e0KEY"); const r = JSON.stringify({ model: s.model, messages: [ { role: "system", content: a }, { role: "user", content: e } ], stream: !0 }); new Promise(((e, a) => { le({ method: "POST", url: s.api, data: r, headers: { Accept: "application/json", Authorization: `Bearer ${s.key}`, "Content-Type": "application/json" }, responseType: "stream", onloadstart: async i => { try { const a = i.response.getReader(), o = new TextDecoder; let s = ""; const processStream = async () => { for (;;) { const {done: i, value: r} = await a.read(), l = [ ...o.decode(r).matchAll(/data:\s*({.*?})\s*\n/g) ].map((e => { try { return JSON.parse(e[1]); } catch { return null; } })).filter(Boolean) || []; if (l.some((e => { var t; return null == (t = e.choices) ? void 0 : t.some((e => "stop" === e.finish_reason)); })) || i) return n(), e(s); l.flatMap((e => { var t; return (null == (t = e.choices) ? void 0 : t.map((e => e.delta.content)).filter(Boolean)) || []; })).forEach((e => { s += e, t(e); })); } }; await processStream(); } catch (o) { console.error("Error reading stream:", o), n(), a(o); } } }); })); })(n, (e => { t.aiMsg += e, this.loading = !1; }), (() => { this.loading = !1, this.aiLoadingIndex = -1, t.aiMsg.length <= 0 && (t.aiMsg = "AI\u54cd\u5e94\u5f02\u5e38\uff0c\u53ef\u80fd\u662f\u6ca1\u6709\u83b7\u53d6KEY,\u8bf7\u6309\u4e0b\u65b9\u6b65\u9aa4\u64cd\u4f5c \n 1. \u6253\u5f00[\u667a\u666e\u6e05\u8a00](https://chatglm.cn/main/alltoolsdetail) \n 2. \u767b\u5f55\u540e\u968f\u4fbf\u53d1\u4e00\u6761\u6d88\u606f\u5373\u53ef \n 3. \u8fd4\u56de\u7b54\u9898\u9875\u5237\u65b0\u9875\u9762 "); })); }, pause() { this.start = !1; }, restart() { const e = { questionInx: 0, start: !1 }; this.questionInx = e.questionInx, this.start = e.start, this.aiPreview = null, this.toggleStart(); } }, getters: { current() { return this.questionList[this.questionInx]; }, currentAiMd() { return markToHtml(this.questionList[this.questionInx].aiMsg); }, tipsMd() { const e = this.rule; if (!e) return '\u8be5\u9875\u9762\u6682\u65e0\u89c4\u5219'; const t = []; return t.push(`${e.name}${e.tips || "\u6709\u95ee\u9898\u53ef\u4ee5\u53cd\u9988\u7ed9\u4f5c\u8005"}`), t.join("
    "); }, typesMd() { const e = this.rule; if (!e || !e.types) return '\u8be5\u9875\u9762\u6682\u65e0\u89c4\u5219'; const t = e.types, n = []; for (const a in t) { const e = t[a]; n.push(`${typeConvert(e, !1)} \u2705`); } return n.push('\u4e0d\u652f\u6301\u7684\u9898\u578b\u53ef\u4ee5\u53cd\u9988\u7ed9\u4f5c\u8005\u517c\u5bb9'), n.join("
    "); } } }), dn = Cache.get("user", {}), un = defineStore("user", { state: () => ({ user: dn.user || null, notice: "", apiKey: dn.api_key || "", stats: { course_count: 0, chapter_count: 0, question_count: 0 }, afdianUrl: dn.afdian_url || "", isLoggedIn: !!dn.user, loginTime: dn.login_time || 0 }), getters: { username: e => { var t; return (null == (t = e.user) ? void 0 : t.username) || "\u672a\u767b\u5f55"; }, nickname: e => { var t; return (null == (t = e.user) ? void 0 : t.nickname) || "\u6e38\u5ba2"; }, avatar: () => "", score: e => { var t; return (null == (t = e.user) ? void 0 : t.score) || 0; }, level: e => { var t; return (null == (t = e.user) ? void 0 : t.level) || 0; }, isVip: e => { var t; return ((null == (t = e.user) ? void 0 : t.level) || 0) > 0; } }, actions: { async loginByPassword(e, t) { try { const n = "https://www.aiask.site/v1/user/login", [a] = await requestApi(n, "POST", { username: e, password: t, login_type: "password" }), i = JSON.parse(a.responseText); return 200 === i.code ? (this.user = i.data.user, this.apiKey = i.data.api_key, this.afdianUrl = i.data.afdian_url || "", this.isLoggedIn = !0, this.loginTime = Date.now(), this.saveToCache(), await this.fetchUserInfo(), i.data, { success: !0, message: "\u767b\u5f55\u6210\u529f" }) : { success: !1, message: i.message || "\u767b\u5f55\u5931\u8d25" }; } catch (n) { return { success: !1, message: n.message || "\u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5" }; } }, async loginByApiKey(e) { try { const t = "https://www.aiask.site/v1/user/login", [n] = await requestApi(t, "POST", { api_key: e, login_type: "apikey" }), a = JSON.parse(n.responseText); return 200 === a.code ? (this.user = a.data.user, this.apiKey = a.data.api_key, this.afdianUrl = a.data.afdian_url || "", this.isLoggedIn = !0, this.loginTime = Date.now(), this.saveToCache(), await this.fetchUserInfo(), a.data, { success: !0, message: "\u767b\u5f55\u6210\u529f" }) : { success: !1, message: a.message || "API Key \u767b\u5f55\u5931\u8d25" }; } catch (t) { return { success: !1, message: t.message || "API Key \u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5" }; } }, async register(e) { try { const t = "https://www.aiask.site/v1/user/register", [n] = await requestApi(t, "POST", e), a = JSON.parse(n.responseText); return 200 === a.code ? (this.user = a.data.user, this.apiKey = a.data.api_key, this.afdianUrl = a.data.afdian_url || "", this.isLoggedIn = !0, this.loginTime = Date.now(), this.saveToCache(), a.data, { success: !0, message: "\u6ce8\u518c\u6210\u529f" }) : { success: !1, message: a.message || "\u6ce8\u518c\u5931\u8d25" }; } catch (t) { return { success: !1, message: t.message || "\u6ce8\u518c\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5" }; } }, async fetchUserInfo() { if (this.isLoggedIn) try { const e = "https://www.aiask.site/v1/user/info", [t] = await requestApi(e, "GET", void 0, { Authorization: `Bearer ${this.apiKey}` }), n = JSON.parse(t.responseText); 200 === n.code && (this.user = n.data.user, this.stats = n.data.stats, this.afdianUrl = n.data.afdian_url || "", this.saveToCache(), n.data); } catch (e) {} }, async logout() { try { if (this.apiKey) { const e = "https://www.aiask.site/v1/user/logout"; await requestApi(e, "POST", void 0, { Authorization: `Bearer ${this.apiKey}` }); } } catch (e) {} finally { this.user = null, this.apiKey = "", this.stats = { course_count: 0, chapter_count: 0, question_count: 0 }, this.afdianUrl = "", this.isLoggedIn = !1, this.loginTime = 0, Cache.remove("user"); } }, async refreshApiKey() { try { const e = "https://www.aiask.site/v1/user/refresh-apikey", [t] = await requestApi(e, "POST", void 0, { Authorization: `Bearer ${this.apiKey}` }), n = JSON.parse(t.responseText); return 200 === n.code ? (this.apiKey = n.data.api_key, this.saveToCache(), n.data.api_key, { success: !0, message: "API Key \u5237\u65b0\u6210\u529f", api_key: n.data.api_key }) : { success: !1, message: n.message || "API Key \u5237\u65b0\u5931\u8d25" }; } catch (e) { return { success: !1, message: e.message || "API Key \u5237\u65b0\u5931\u8d25" }; } }, async updateUserInfo(e) { try { const t = "https://www.aiask.site/v1/user/update", [n] = await requestApi(t, "POST", e, { Authorization: `Bearer ${this.apiKey}` }), a = JSON.parse(n.responseText); return 200 === a.code ? (this.user && (this.user = { ...this.user, ...a.data.user }), this.saveToCache(), a.data, { success: !0, message: "\u66f4\u65b0\u6210\u529f" }) : { success: !1, message: a.message || "\u66f4\u65b0\u5931\u8d25" }; } catch (t) { return { success: !1, message: t.message || "\u66f4\u65b0\u5931\u8d25" }; } }, async changePassword(e, t) { try { const n = "https://www.aiask.site/v1/user/change-password", [a] = await requestApi(n, "POST", { old_password: e, new_password: t }, { Authorization: `Bearer ${this.apiKey}` }), i = JSON.parse(a.responseText); return 200 === i.code ? { success: !0, message: "\u5bc6\u7801\u4fee\u6539\u6210\u529f" } : { success: !1, message: i.message || "\u5bc6\u7801\u4fee\u6539\u5931\u8d25" }; } catch (n) { return { success: !1, message: n.message || "\u5bc6\u7801\u4fee\u6539\u5931\u8d25" }; } }, async fuzzySearchQuestion(e) { var t; try { const t = "https://www.aiask.site/v1/question/fuzzy", n = { question: e.question, type: e.type ?? 8, options: e.options ?? [] }, [a] = await requestApi(t, "POST", n), i = JSON.parse(a.responseText), o = 401 === i.code || 401 === a.status; return 200 === i.code ? { success: !0, message: i.message || "success", data: i.data || [] } : o ? { success: !1, message: i.message || "\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u4f7f\u7528\u5b98\u65b9\u9898\u5e93\uff0c\u8bf7\u5148\u767b\u5f55", data: [], needLogin: !0 } : { success: !1, message: i.message || "\u5b98\u65b9\u9898\u5e93\u641c\u7d22\u5931\u8d25", data: [] }; } catch (n) { const e = 401 === (null == n ? void 0 : n.status) || 401 === (null == (t = null == n ? void 0 : n.response) ? void 0 : t.status); return { success: !1, message: e ? "\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u4f7f\u7528\u5b98\u65b9\u9898\u5e93\uff0c\u8bf7\u5148\u767b\u5f55" : (null == n ? void 0 : n.message) || "\u5b98\u65b9\u9898\u5e93\u641c\u7d22\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", data: [], needLogin: e }; } }, async fetchNotice() { var e; try { const t = "https://www.aiask.site", [n] = await requestApi(`${t}/v1/aiAskNotice`, "GET"), a = JSON.parse(n.responseText), i = (null == (e = null == a ? void 0 : a.data) ? void 0 : e.notice) ?? (null == a ? void 0 : a.data); return 200 === a.code && i ? (this.notice = i, { success: !0, notice: i, message: a.message }) : { success: !1, message: a.message || "\u516c\u544a\u83b7\u53d6\u5931\u8d25" }; } catch (t) { return { success: !1, message: (null == t ? void 0 : t.message) || "\u516c\u544a\u83b7\u53d6\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5" }; } }, saveToCache() { const e = { user: this.user || void 0, api_key: this.apiKey || void 0, login_time: this.loginTime || void 0, afdian_url: this.afdianUrl || void 0 }; Cache.set("user", e); }, loadFromCache() { const e = Cache.get("user", {}); e.user && (this.user = e.user, this.apiKey = e.api_key || "", this.loginTime = e.login_time || 0, this.afdianUrl = e.afdian_url || "", this.isLoggedIn = !0); } } }), hn = { key: 0, class: "aah-page-header" }, mn = { class: "page-title" }, fn = { class: "header-actions" }, gn = { key: 0, class: "page-loader" }, yn = vue.createElementVNode("div", { class: "spinner" }, null, -1), vn = [ yn ], bn = { key: 1, class: "aah-page-footer" }, xn = vue.defineComponent({ __name: "PageContainer", props: { title: {}, width: { default: "standard" }, loading: { type: Boolean, default: !1 }, noPadding: { type: Boolean, default: !1 } }, setup(e) { const t = e, n = Rt(); return vue.onMounted((() => { n.setPageWidth(t.width); })), vue.onUnmounted((() => { n.setPageWidth("standard"); })), (e, t) => (vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass([ "aah-page", { "is-loading": e.loading } ]) }, [ e.title || e.$slots["header-actions"] ? (vue.openBlock(), vue.createElementBlock("header", hn, [ vue.createElementVNode("h2", mn, vue.toDisplayString(e.title), 1), vue.createElementVNode("div", fn, [ vue.renderSlot(e.$slots, "header-actions") ]) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("main", { class: vue.normalizeClass([ "aah-page-content", { "no-padding": e.noPadding } ]) }, [ vue.renderSlot(e.$slots, "default"), e.loading ? (vue.openBlock(), vue.createElementBlock("div", gn, vn)) : vue.createCommentVNode("", !0) ], 2), e.$slots.footer ? (vue.openBlock(), vue.createElementBlock("footer", bn, [ vue.renderSlot(e.$slots, "footer") ])) : vue.createCommentVNode("", !0) ], 2)); } }), wn = { class: "home-container" }, kn = { class: "aah-card user-status-card" }, _n = { class: "user-status" }, qn = { class: "user-info" }, An = { class: "home-avatar" }, Tn = [ "src" ], Cn = { class: "user-details" }, Sn = { key: 0 }, En = { class: "aah-tag aah-tag-success" }, In = { key: 0, class: "aah-tag aah-tag-warning tag-gap" }, Un = { key: 1, class: "home-muted small" }, Hn = { class: "user-actions" }, On = { key: 0, class: "aah-card notice-card" }, jn = [ "innerHTML" ], zn = { key: 1, class: "home-divider" }, Pn = vue.createElementVNode("span", null, "\u529f\u80fd\u5217\u8868", -1), Ln = [ Pn ], Mn = { key: 2, class: "home-pages-grid" }, $n = [ "onClick" ], Fn = vue.createElementVNode("div", { class: "home-divider" }, [ vue.createElementVNode("span", null, "\u7248\u672c\u4fe1\u606f") ], -1), Nn = { class: "version-section" }, Dn = { class: "version-row" }, Rn = vue.createElementVNode("span", { class: "home-muted" }, "\u5f53\u524d\u7248\u672c:", -1), Bn = { class: "aah-tag aah-tag-primary" }, Gn = { class: "home-muted small tip-text" }, Vn = vue.defineComponent({ __name: "Home", setup(e) { const t = vue.ref("\u672c\u811a\u672c\u4ec5\u4f9b\u5b66\u4e60\u4ea4\u6d41\uff0c\u8bf7\u52ff\u7528\u4f5c\u4efb\u4f55\u975e\u6cd5\u7528\u9014\u3002\u5982\u9700\u6dfb\u52a0\u5176\u4ed6\u5e73\u53f0\u7b54\u9898\u529f\u80fd\uff0c\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005\u3002"), a = Rt(), i = un(), o = vue.ref(!0); vue.onMounted((async () => { const e = await i.fetchNotice(); e.success && e.notice ? t.value = V.sanitize(e.notice) : e.message && msg(e.message, "warning"); })); const s = [ { name: "\u57fa\u7840\u914d\u7f6e", page: "Base", icon: "mdi:cog", desc: "\u7cfb\u7edf\u57fa\u7840\u8bbe\u7f6e\u4e0e\u53c2\u6570\u914d\u7f6e", color: "#667eea" }, { name: "\u7b54\u9898\u754c\u9762", page: "ask", icon: "mdi:pencil", desc: "\u5f00\u59cb\u7b54\u9898\uff0c\u652f\u6301\u81ea\u52a8\u7b54\u9898", color: "#f093fb" }, { name: "\u672c\u5730\u9898\u5e93", page: "preview", icon: "mdi:file-document", desc: "\u9884\u89c8\u548c\u7ba1\u7406\u672c\u5730\u9898\u5e93", color: "#4facfe" }, { name: "\u9898\u5e93\u7f13\u5b58", page: "question", icon: "mdi:folder-open", desc: "\u67e5\u770b\u548c\u6e05\u7406\u9898\u5e93\u7f13\u5b58", color: "#fa709a" }, { name: "\u9898\u5e93\u5bfc\u5165", page: "questionTool", icon: "mdi:upload", desc: "\u5bfc\u5165\u5916\u90e8\u9898\u5e93\u6570\u636e", color: "#fee140" }, { name: "\u65e5\u5fd7\u8bb0\u5f55", page: "log", icon: "mdi:notebook", desc: "\u67e5\u770b\u7cfb\u7edf\u8fd0\u884c\u65e5\u5fd7", color: "#30cfd0" }, { name: "AI\u641c\u9898", page: "ai", icon: "mdi:chat", desc: "AI\u667a\u80fd\u641c\u9898\u4e0e\u89e3\u7b54", color: "#a8edea" } ]; return (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "standard", "no-padding": !0 }, { default: vue.withCtx((() => [ vue.createElementVNode("div", wn, [ vue.createElementVNode("div", kn, [ vue.createElementVNode("div", _n, [ vue.createElementVNode("div", qn, [ vue.createElementVNode("div", An, [ vue.unref(i).avatar ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, src: vue.unref(i).avatar, alt: "avatar" }, null, 8, Tn)) : (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), { key: 1, icon: "mdi:account", class: "home-avatar-icon" })) ]), vue.createElementVNode("div", Cn, [ vue.createElementVNode("h3", null, vue.toDisplayString(vue.unref(i).nickname || "\u6e38\u5ba2"), 1), vue.unref(i).isLoggedIn ? (vue.openBlock(), vue.createElementBlock("p", Sn, [ vue.createElementVNode("span", En, "\u79ef\u5206: " + vue.toDisplayString(vue.unref(i).score), 1), vue.unref(i).isVip ? (vue.openBlock(), vue.createElementBlock("span", In, " VIP Lv." + vue.toDisplayString(vue.unref(i).level), 1)) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("p", Un, "\u672a\u767b\u5f55\uff0c\u767b\u5f55\u540e\u53ef\u4eab\u53d7\u66f4\u591a\u529f\u80fd")) ]) ]), vue.createElementVNode("div", Hn, [ vue.unref(i).isLoggedIn ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, class: "aah-btn aah-btn-plain", onClick: n[1] || (n[1] = e => vue.unref(a).setPage("user")) }, " \u4e2a\u4eba\u4e2d\u5fc3 ")) : (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "aah-btn aah-btn-primary", onClick: n[0] || (n[0] = e => vue.unref(a).setPage("user")) }, " \u767b\u5f55 / \u6ce8\u518c ")) ]) ]) ]), t.value ? (vue.openBlock(), vue.createElementBlock("div", On, [ vue.createElementVNode("div", { class: "notice-content", innerHTML: t.value }, null, 8, jn) ])) : vue.createCommentVNode("", !0), o.value ? (vue.openBlock(), vue.createElementBlock("div", zn, Ln)) : vue.createCommentVNode("", !0), o.value ? (vue.openBlock(), vue.createElementBlock("div", Mn, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(s, ((e, t) => vue.createElementVNode("button", { key: t, class: "aah-btn home-page-btn", onClick: t => vue.unref(a).setPage(e.page), style: vue.normalizeStyle({ "--page-color": e.color }) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: e.icon, class: "home-page-icon" }, null, 8, [ "icon" ]), vue.createElementVNode("span", null, vue.toDisplayString(e.name), 1) ], 12, $n))), 64)) ])) : vue.createCommentVNode("", !0), Fn, vue.createElementVNode("div", Nn, [ vue.createElementVNode("p", Dn, [ Rn, vue.createElementVNode("span", Bn, vue.toDisplayString(vue.unref($t).script.version), 1), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary aah-btn-small", onClick: n[2] || (n[2] = e => vue.unref(updateFn)(!1)) }, " \u68c0\u6d4b\u66f4\u65b0 ") ]), vue.createElementVNode("p", Gn, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:lightbulb-on", class: "icon-inline" }), vue.createTextVNode(" \u4fdd\u6301\u6700\u65b0\u7248\u672c\u53ef\u4ee5\u51cf\u5c11BUG\u7684\u51fa\u73b0\u54e6~ ") ]) ]) ]) ])), _: 1 })); } }), Jn = { class: "config-item" }, Kn = { class: "config-item-content" }, Wn = { class: "config-label" }, Qn = { class: "label-wrapper" }, Yn = { class: "label-text" }, Xn = { key: 0, class: "label-desc" }, Zn = { class: "config-control" }, ea = { key: 0, class: "toggle" }, ta = vue.createElementVNode("span", { class: "toggle-slider" }, null, -1), na = [ "value" ], aa = { key: 4, class: "hotkey-input-wrapper" }, ia = [ "value", "placeholder" ], oa = { key: 0, class: "hotkey-hint danger" }, sa = { key: 1, class: "hotkey-hint" }, ra = { key: 5, class: "checkbox-group" }, la = [ "value" ], ca = vue.defineComponent({ __name: "ConfigItem", props: { item: {}, recordingHotkey: {} }, emits: [ "start-recording", "hotkey-keydown" ], setup(e, {emit: t}) { const n = e, a = t, handleStartRecording = () => { "hotkey" === n.item.type && a("start-recording", n.item.name); }, handleHotkeyKeydown = e => { a("hotkey-keydown", e, n.item); }; return (e, t) => (vue.openBlock(), vue.createElementBlock("div", Jn, [ vue.createElementVNode("div", Kn, [ vue.createElementVNode("div", Wn, [ vue.createElementVNode("div", Qn, [ vue.createElementVNode("span", Yn, vue.toDisplayString(e.item.label), 1), e.item.desc ? (vue.openBlock(), vue.createElementBlock("span", Xn, vue.toDisplayString(e.item.desc), 1)) : vue.createCommentVNode("", !0) ]) ]), vue.createElementVNode("div", Zn, [ "switch" === e.item.type ? (vue.openBlock(), vue.createElementBlock("label", ea, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[0] || (t[0] = t => e.item.value = t) }, null, 512), [ [ vue.vModelCheckbox, e.item.value ] ]), ta ])) : "input" === e.item.type ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 1, "onUpdate:modelValue": t[1] || (t[1] = t => e.item.value = t), class: "aah-input", type: "text" }, null, 512)), [ [ vue.vModelText, e.item.value ] ]) : "number" === e.item.type ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 2, "onUpdate:modelValue": t[2] || (t[2] = t => e.item.value = t), class: "aah-input", type: "number" }, null, 512)), [ [ vue.vModelText, e.item.value, void 0, { number: !0 } ] ]) : "select" === e.item.type ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", { key: 3, "onUpdate:modelValue": t[3] || (t[3] = t => e.item.value = t), class: "aah-select" }, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.item.options, (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.value, value: e.value }, vue.toDisplayString(e.label), 9, na)))), 128)) ], 512)), [ [ vue.vModelSelect, e.item.value ] ]) : "hotkey" === e.item.type ? (vue.openBlock(), vue.createElementBlock("div", aa, [ vue.createElementVNode("input", { class: vue.normalizeClass([ "aah-input", { recording: e.recordingHotkey === e.item.name } ]), value: e.item.value, placeholder: e.recordingHotkey === e.item.name ? "\u8bf7\u6309\u4e0b\u5feb\u6377\u952e..." : "\u70b9\u51fb\u540e\u6309\u4e0b\u5feb\u6377\u952e\u7ec4\u5408", readonly: "", onFocus: handleStartRecording, onKeydown: handleHotkeyKeydown }, null, 42, ia), e.recordingHotkey === e.item.name ? (vue.openBlock(), vue.createElementBlock("span", oa, "\u5f55\u5236\u4e2d...")) : (vue.openBlock(), vue.createElementBlock("span", sa, "\u70b9\u51fb\u5f55\u5236")) ])) : "checkbox" === e.item.type ? (vue.openBlock(), vue.createElementBlock("div", ra, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.item.options, (n => (vue.openBlock(), vue.createElementBlock("label", { key: n.value, class: "checkbox-item" }, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", value: n.value, "onUpdate:modelValue": t[4] || (t[4] = t => e.item.value = t) }, null, 8, la), [ [ vue.vModelCheckbox, e.item.value ] ]), vue.createElementVNode("span", null, vue.toDisplayString(n.label), 1) ])))), 128)) ])) : vue.createCommentVNode("", !0) ]) ]) ])); } }), pa = { class: "ai-config-panel" }, da = { class: "ai-config-toolbar" }, ua = { class: "ai-config-field ai-preset-select" }, ha = vue.createElementVNode("span", null, "\u6dfb\u52a0\u5e73\u53f0\u9884\u8bbe", -1), ma = vue.createElementVNode("option", { value: "" }, "\u9009\u62e9\u5e73\u53f0", -1), fa = [ "value" ], ga = { class: "native-checkbox ai-config-checkbox" }, ya = vue.createElementVNode("span", null, "\u542f\u7528 AI \u8f85\u52a9\u7b54\u9898", -1), va = { class: "ai-config-layout" }, ba = { class: "ai-config-list" }, xa = [ "onClick" ], wa = { key: 0, class: "ai-config-default" }, ka = { key: 0, class: "ai-config-form" }, _a = { class: "ai-config-form-grid" }, qa = { class: "ai-config-field" }, Aa = vue.createElementVNode("span", null, "\u540d\u79f0", -1), Ta = { class: "ai-config-field" }, Ca = vue.createElementVNode("span", null, "Base URL", -1), Sa = { class: "ai-config-field" }, Ea = vue.createElementVNode("span", null, "\u6a21\u578b", -1), Ia = { class: "ai-config-field" }, Ua = vue.createElementVNode("span", null, "API Key / Cookie", -1), Ha = [ "value" ], Oa = { class: "ai-config-options" }, ja = { class: "native-checkbox" }, za = vue.createElementVNode("span", null, "\u542f\u7528\u8be5\u914d\u7f6e", -1), Pa = { class: "native-checkbox" }, La = vue.createElementVNode("span", null, "\u542f\u7528\u6d41\u5f0f\u54cd\u5e94", -1), Ma = { class: "ai-config-form-grid" }, $a = { class: "ai-config-field" }, Fa = vue.createElementVNode("span", null, "\u8bf7\u6c42\u8d85\u65f6\uff08\u6beb\u79d2\uff09", -1), Na = { class: "ai-config-field" }, Da = vue.createElementVNode("span", null, "AI \u91c7\u7eb3\u7b56\u7565", -1), Ra = vue.createElementVNode("option", { value: "conservative" }, "\u4fdd\u5b88\u586b", -1), Ba = vue.createElementVNode("option", { value: "direct" }, "\u76f4\u63a5\u586b", -1), Ga = vue.createElementVNode("option", { value: "preview" }, "\u9884\u89c8\u786e\u8ba4", -1), Va = [ Ra, Ba, Ga ], Ja = { class: "ai-config-actions" }, Ka = [ "disabled" ], Wa = { key: 0, class: "aah-alert aah-alert-info" }, Qa = vue.defineComponent({ __name: "AiConfigPanel", setup(e) { var t; const a = Rt(), i = cn(), o = vue.ref(i.settings.defaultConfigId || (null == (t = i.settings.configs[0]) ? void 0 : t.id) || ""), s = vue.computed((() => i.settings.configs.find((e => e.id === o.value)) || i.settings.configs[0])), credentialType = e => e.providerKind.includes("cookie") ? "cookie-token" : "api-key", syncLegacyAppConfig = (e = !1) => { e && i.mergeLegacyCredentials(a.app), a.setConfig(createLegacyAppAiConfig(i.settings)); }, save = () => { (() => { const e = i.settings.configs.find((e => e.id === i.settings.defaultConfigId)); if (null == e ? void 0 : e.enabled) return; const t = i.settings.configs.find((e => e.enabled)); t && (i.settings.defaultConfigId = t.id); })(), i.saveSettings(), syncLegacyAppConfig(); }, saveEnabledForAsk = () => { save(); }, handlePresetChange = e => { const t = e.target; (e => { const t = on.find((t => t.id === e)); if (!t) return; const n = `${t.id}-${Date.now()}`; i.settings.configs.push({ id: n, name: t.name, providerId: t.id, providerKind: t.providerKind, baseUrl: t.baseUrl, model: t.defaultModel, enabled: !0, stream: t.stream, timeout: 3e4 }), o.value = n, i.settings.defaultConfigId || (i.settings.defaultConfigId = n), save(); })(t.value), t.value = ""; }; return vue.onMounted((() => { syncLegacyAppConfig(!0); })), (e, t) => { var n; return vue.openBlock(), vue.createElementBlock("div", pa, [ vue.createElementVNode("div", da, [ vue.createElementVNode("label", ua, [ ha, vue.createElementVNode("select", { class: "aah-select", onChange: handlePresetChange }, [ ma, (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(on), (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.id, value: e.id }, vue.toDisplayString(e.name), 9, fa)))), 128)) ], 32) ]), vue.createElementVNode("label", ga, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[0] || (t[0] = e => vue.unref(i).settings.enabledForAsk = e), onChange: saveEnabledForAsk }, null, 544), [ [ vue.vModelCheckbox, vue.unref(i).settings.enabledForAsk ] ]), ya ]) ]), vue.createElementVNode("div", va, [ vue.createElementVNode("div", ba, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(i).settings.configs, (e => (vue.openBlock(), vue.createElementBlock("button", { key: e.id, type: "button", class: vue.normalizeClass([ "ai-config-list-item", { active: e.id === o.value } ]), onClick: t => o.value = e.id }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:robot", class: "icon-inline" }), vue.createElementVNode("span", null, vue.toDisplayString(e.name), 1), e.id === vue.unref(i).settings.defaultConfigId ? (vue.openBlock(), vue.createElementBlock("span", wa, "\u9ed8\u8ba4")) : vue.createCommentVNode("", !0) ], 10, xa)))), 128)) ]), s.value ? (vue.openBlock(), vue.createElementBlock("div", ka, [ vue.createElementVNode("div", _a, [ vue.createElementVNode("label", qa, [ Aa, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[1] || (t[1] = e => s.value.name = e), class: "aah-input", onChange: save }, null, 544), [ [ vue.vModelText, s.value.name ] ]) ]), vue.createElementVNode("label", Ta, [ Ca, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[2] || (t[2] = e => s.value.baseUrl = e), class: "aah-input", onChange: save }, null, 544), [ [ vue.vModelText, s.value.baseUrl ] ]) ]), vue.createElementVNode("label", Sa, [ Ea, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[3] || (t[3] = e => s.value.model = e), class: "aah-input", onChange: save }, null, 544), [ [ vue.vModelText, s.value.model ] ]) ]), vue.createElementVNode("label", Ia, [ Ua, vue.createElementVNode("input", { value: (null == (n = s.value.credential) ? void 0 : n.value) || "", class: "aah-input", type: "password", autocomplete: "off", onChange: t[4] || (t[4] = e => { return t = s.value, n = e.target.value, i.updateCredential(t.id, { type: credentialType(t), value: n }), void syncLegacyAppConfig(); var t, n; }) }, null, 40, Ha) ]) ]), vue.createElementVNode("div", Oa, [ vue.createElementVNode("label", ja, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[5] || (t[5] = e => s.value.enabled = e), onChange: save }, null, 544), [ [ vue.vModelCheckbox, s.value.enabled ] ]), za ]), vue.createElementVNode("label", Pa, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[6] || (t[6] = e => s.value.stream = e), onChange: save }, null, 544), [ [ vue.vModelCheckbox, s.value.stream ] ]), La ]) ]), vue.createElementVNode("div", Ma, [ vue.createElementVNode("label", $a, [ Fa, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[7] || (t[7] = e => s.value.timeout = e), class: "aah-input", type: "number", min: "1000", step: "1000", onChange: save }, null, 544), [ [ vue.vModelText, s.value.timeout, void 0, { number: !0 } ] ]) ]), vue.createElementVNode("label", Na, [ Da, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": t[8] || (t[8] = e => vue.unref(i).settings.adoptionStrategy = e), class: "aah-select", onChange: save }, Va, 544), [ [ vue.vModelSelect, vue.unref(i).settings.adoptionStrategy ] ]) ]) ]), vue.createElementVNode("div", Ja, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: t[9] || (t[9] = e => (e => { const t = i.settings.configs.find((t => t.id === e)); t && (t.enabled = !0), i.settings.defaultConfigId = e, save(); })(s.value.id)) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:star-outline", class: "icon-inline" }), vue.createTextVNode(" \u8bbe\u4e3a\u9ed8\u8ba4 ") ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", disabled: vue.unref(i).connectionTestingIds[s.value.id], onClick: t[10] || (t[10] = e => vue.unref(i).testConfig(s.value.id)) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:connection", class: "icon-inline" }), vue.createTextVNode(" " + vue.toDisplayString(vue.unref(i).connectionTestingIds[s.value.id] ? "\u6d4b\u8bd5\u4e2d..." : "\u6d4b\u8bd5\u8fde\u63a5"), 1) ], 8, Ka) ]), vue.unref(i).connectionMessages[s.value.id] ? (vue.openBlock(), vue.createElementBlock("div", Wa, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information-outline", class: "alert-icon" }), vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(i).connectionMessages[s.value.id]), 1) ])) : vue.createCommentVNode("", !0) ])) : vue.createCommentVNode("", !0) ]) ]); }; } }), Ya = { class: "settings-layout" }, Xa = { class: "settings-sidebar" }, Za = { class: "sidebar-header" }, ei = { class: "search-input-wrapper" }, ti = { class: "sidebar-nav custom-scroll", role: "tablist", "aria-orientation": "vertical" }, ni = [ "onClick", "aria-selected" ], ai = { class: "sidebar-footer" }, ii = { class: "aah-alert aah-alert-info" }, oi = vue.createElementVNode("span", null, "\u914d\u7f6e\u81ea\u52a8\u4fdd\u5b58", -1), si = { class: "settings-content custom-scroll", role: "tabpanel" }, ri = { class: "group-header" }, li = { class: "group-title" }, ci = { key: 0, class: "aah-tag aah-tag-success" }, pi = { key: 1, class: "group-items" }, di = { key: 0, class: "empty-search" }, ui = { class: "empty-text" }, hi = "ai ai\u8bbe\u7f6e \u6a21\u578b \u5e73\u53f0 api key base url cookie \u51ed\u8bc1 \u8f85\u52a9\u7b54\u9898 \u91c7\u7eb3\u7b56\u7565 \u6d4b\u8bd5\u8fde\u63a5", mi = vue.defineComponent({ __name: "Base", setup(e) { const t = Rt(), a = [ { id: "display", label: "\u663e\u793a\u8bbe\u7f6e", icon: "mdi:palette" }, { id: "system", label: "\u7cfb\u7edf\u8bbe\u7f6e", icon: "mdi:cog" }, { id: "ai", label: "AI\u8bbe\u7f6e", icon: "mdi:robot" }, { id: "hotkey", label: "\u5feb\u6377\u952e", icon: "mdi:keyboard" } ], i = vue.ref("display"), o = vue.ref(""), normalizeSearchText = e => e.toLowerCase().replace(/\s+/g, ""), r = vue.ref(null), handleHotkeyKeydown = (e, t) => { if (e.preventDefault(), e.stopPropagation(), [ "Control", "Shift", "Alt", "Meta" ].includes(e.key)) return; const n = []; e.ctrlKey && n.push("Ctrl"), e.shiftKey && n.push("Shift"), e.altKey && n.push("Alt"); let a = e.key; a = " " === a ? "Space" : e.code.startsWith("Key") ? e.code.replace("Key", "") : e.code.startsWith("Digit") ? e.code.replace("Digit", "") : e.code.startsWith("Arrow") ? e.code : e.key.toUpperCase(), n.push(a); const i = n.join("+"); t.value = i, r.value = null, msg(`\u5feb\u6377\u952e\u5df2\u8bbe\u7f6e\u4e3a: ${i}`, "success"); }, startRecording = e => { r.value = e; }, l = vue.computed((() => { const e = o.value.trim().toLowerCase(), n = t.ConfigInput; if (e) return a.map((t => { if ("ai" === t.id) { const n = normalizeSearchText(e), a = normalizeSearchText(hi), i = hi.toLowerCase().includes(e) || a.includes(n) ? [ { type: "switch", label: "AI\u8bbe\u7f6e", name: "aiSettingsSearch", value: !1, desc: hi, options: [] } ] : []; return { ...t, items: i }; } const a = (n[t.id] || []).filter((t => t.label.toLowerCase().includes(e) || t.desc && t.desc.toLowerCase().includes(e))); return { ...t, items: a }; })).filter((e => e.items.length > 0)); const s = a.find((e => e.id === i.value)); return s ? [ { ...s, items: n[s.id] || [] } ] : []; })); return vue.watch(t.app, (e => { t.setConfig(e); })), vue.watch(t.ConfigInput, (e => { for (let n in e) for (let a in e[n]) { let i = e[n][a]; t.app[i.name] = i.value; } msg("\u914d\u7f6e\u4fee\u6539\u6210\u529f", "success"), t.app, t.setConfig(t.app); })), vue.onMounted((() => { t.activeSettingSection && (i.value = t.activeSettingSection, t.setActiveSettingSection("")); })), (e, t) => (vue.openBlock(), vue.createBlock(xn, { width: "wide", title: "\u57fa\u7840\u914d\u7f6e", class: "settings-page" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", Ya, [ vue.createElementVNode("aside", Xa, [ vue.createElementVNode("div", Za, [ vue.createElementVNode("div", ei, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify", class: "search-icon" }), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[0] || (t[0] = e => o.value = e), placeholder: "\u641c\u7d22\u8bbe\u7f6e...", class: "aah-input search-input", "aria-label": "\u641c\u7d22\u8bbe\u7f6e" }, null, 512), [ [ vue.vModelText, o.value ] ]) ]) ]), vue.withDirectives(vue.createElementVNode("nav", ti, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(a, (e => vue.createElementVNode("button", { key: e.id, type: "button", class: vue.normalizeClass([ "nav-item", { active: i.value === e.id } ]), onClick: t => i.value = e.id, role: "tab", "aria-selected": i.value === e.id }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: e.icon, class: "nav-icon" }, null, 8, [ "icon" ]), vue.createElementVNode("span", null, vue.toDisplayString(e.label), 1) ], 10, ni))), 64)) ], 512), [ [ vue.vShow, !o.value ] ]), vue.createElementVNode("div", ai, [ vue.createElementVNode("div", ii, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information", class: "alert-icon" }), oi ]) ]) ]), vue.createElementVNode("main", si, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(l.value, (e => (vue.openBlock(), vue.createElementBlock("div", { key: e.id, class: "setting-group" }, [ vue.createElementVNode("div", ri, [ vue.createElementVNode("h3", li, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: e.icon, class: "icon-inline" }, null, 8, [ "icon" ]), vue.createTextVNode(" " + vue.toDisplayString(e.label), 1) ]), o.value ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("span", ci, "\u81ea\u52a8\u4fdd\u5b58")) ]), "ai" === e.id ? (vue.openBlock(), vue.createBlock(Qa, { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", pi, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.items, ((e, t) => (vue.openBlock(), vue.createBlock(ca, { key: t, item: e, "recording-hotkey": r.value, onStartRecording: startRecording, onHotkeyKeydown: handleHotkeyKeydown }, null, 8, [ "item", "recording-hotkey" ])))), 128)) ])) ])))), 128)), o.value && 0 === l.value.length ? (vue.openBlock(), vue.createElementBlock("div", di, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify-close", class: "empty-icon" }), vue.createElementVNode("p", ui, '\u672a\u627e\u5230\u4e0e "' + vue.toDisplayString(o.value) + '" \u76f8\u5173\u7684\u8bbe\u7f6e', 1) ])) : vue.createCommentVNode("", !0) ]) ]) ])), _: 1 })); } }), fi = { class: "ask-container" }, gi = { class: "ask-shell" }, yi = { class: "ask-toolbar" }, vi = { key: 0, class: "ask-toolbar__main" }, bi = { class: "ask-toolbar__actions" }, xi = { class: "ask-shell__body" }, wi = { class: "ask-grid" }, ki = { key: 0, class: "ask-col ask-col--left sticky-sidebar" }, _i = { class: "ask-section ask-section--nav" }, qi = vue.createElementVNode("div", { class: "ask-section__header" }, [ vue.createElementVNode("h3", { class: "ask-section__title" }, "\u9898\u76ee\u5bfc\u822a") ], -1), Ai = vue.createElementVNode("div", { class: "ask-legend" }, [ vue.createElementVNode("span", { class: "dq" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u5f53\u524d\u9898") ]), vue.createElementVNode("span", { class: "yp" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u5df2\u4f5c\u7b54") ]), vue.createElementVNode("span", { class: "wp" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u65e0\u7b54\u6848") ]), vue.createElementVNode("span", { class: "zp" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u672a\u4f5c\u7b54") ]) ], -1), Ti = { class: "ask-question-grid" }, Ci = [ "onClick" ], Si = { class: "ask-col ask-col--right" }, Ei = { key: 0, class: "ask-section" }, Ii = { class: "ask-section__header" }, Ui = vue.createElementVNode("h3", { class: "ask-section__title" }, "\u5f53\u524d\u9898\u76ee", -1), Hi = { class: "ask-section__actions ask-section__actions--links" }, Oi = vue.createElementVNode("span", { class: "divider" }, null, -1), ji = { class: "ask-question-content" }, zi = [ "innerHTML" ], Pi = [ "innerHTML" ], Li = { class: "reading-questions" }, Mi = [ "innerHTML" ], $i = [ "innerHTML" ], Fi = [ "innerHTML" ], Ni = [ "innerHTML" ], Di = { key: 0 }, Ri = { class: "ask-match-table" }, Bi = [ "innerHTML" ], Gi = [ "value" ], Vi = { key: 2, class: "green" }, Ji = { key: 3, class: "red" }, Ki = { key: 1, class: "ask-section" }, Wi = { class: "ask-loading" }, Qi = { class: "loading-box" }, Yi = { key: 2, class: "ask-section" }, Xi = vue.createElementVNode("div", { class: "ask-section__header" }, [ vue.createElementVNode("h3", { class: "ask-section__title" }, "\u7b54\u6848 / AI") ], -1), Zi = { class: "ask-answer-content" }, eo = { class: "answer-header" }, to = { class: "source-badge" }, no = { key: 0, class: "meta-info" }, ao = { key: 0 }, io = [ "innerHTML" ], oo = { key: 1 }, so = { key: 0 }, ro = [ "innerHTML" ], lo = [ "innerHTML" ], co = { key: 1, class: "answer-block ai-preview-block" }, po = { class: "answer-header" }, uo = vue.createElementVNode("span", { class: "source-badge" }, "AI \u5efa\u8bae", -1), ho = { class: "meta-info" }, mo = { class: "ask-preview-actions" }, fo = { key: 2, class: "soft-alert warning" }, go = { key: 3, class: "answer-block ai-answer-block" }, yo = { class: "answer-divider ai-divider" }, vo = { class: "ai-title" }, bo = { key: 0, class: "ai-streaming-tag" }, xo = vue.createElementVNode("span", { class: "ai-dot" }, null, -1), wo = vue.createElementVNode("span", { class: "ai-dot" }, null, -1), ko = vue.createElementVNode("span", { class: "ai-dot" }, null, -1), _o = [ "innerHTML" ], qo = { key: 1, class: "ai-stream-placeholder" }, Ao = { key: 0, class: "empty-block" }, To = vue.createElementVNode("p", { class: "empty-text" }, "\u6682\u65e0\u9898\u76ee\u6570\u636e", -1), Co = { class: "modal-panel" }, So = { class: "modal-header" }, Eo = vue.createElementVNode("h3", { id: "settings-title", class: "modal-title" }, "\u7b54\u9898\u8bbe\u7f6e", -1), Io = { class: "modal-body" }, Uo = { class: "ask-settings" }, Ho = { class: "native-checkbox" }, Oo = vue.createElementVNode("span", null, "\u8df3\u8fc7\u5df2\u4f5c\u7b54", -1), jo = { class: "native-checkbox" }, zo = vue.createElementVNode("span", null, "\u81ea\u52a8\u7b54\u9898", -1), Po = { class: "native-checkbox" }, Lo = vue.createElementVNode("span", null, "\u81ea\u52a8\u8df3\u8f6c", -1), Mo = { class: "native-checkbox" }, $o = vue.createElementVNode("span", null, "\u65e0\u7b54\u6848\u968f\u673a\u7b54\u9898", -1), Fo = { class: "native-checkbox" }, No = vue.createElementVNode("span", null, [ vue.createTextVNode("\u4f7f\u7528AI\u8f85\u52a9\u7b54\u9898 "), vue.createElementVNode("small", null, "(AI\u6b63\u786e\u7387\u4e0d\u4fdd\u8bc1)") ], -1), Do = { key: 0, class: "soft-alert warning" }, Ro = { class: "range-row" }, Bo = [ "min" ], Go = { key: 0, class: "ask-tags" }, Vo = { class: "modal-panel" }, Jo = { class: "modal-header" }, Ko = vue.createElementVNode("h3", { id: "tips-title", class: "modal-title" }, "\u4f7f\u7528\u63d0\u793a", -1), Wo = { class: "modal-body" }, Qo = { class: "info-banner ask-info" }, Yo = [ "innerHTML" ], Xo = { class: "ask-types" }, Zo = vue.createElementVNode("summary", null, "\u67e5\u770b\u652f\u6301\u9898\u578b", -1), es = [ "innerHTML" ], ts = vue.defineComponent({ __name: "Ask", setup(e) { const t = pn(), a = Rt(), i = cn(), o = vue.ref(!1), r = vue.ref(!1), handleKeydown = e => { "Escape" === e.key && (o.value && (o.value = !1), r.value && (r.value = !1)); }; vue.watch([ o, r ], (([e, t]) => { e || t ? document.addEventListener("keydown", handleKeydown) : document.removeEventListener("keydown", handleKeydown); })); const l = vue.computed((() => t.aiLoadingIndex === t.questionInx)), c = vue.computed((() => Boolean(t.current && (t.current.aiMsg || l.value)))), getOptionIndex = e => String.fromCharCode(65 + e); vue.watch(a.app, (e => { a.setConfig(e); })); const watchAutoNext = () => { Cache.set("autoNext", t.autoNext); }, watchSkipFinish = () => { Cache.set("skipFinish", t.skipFinish); }, watchAutoAnswer = () => { Cache.set("autoAnswer", t.autoAnswer); }, watchRandomAnswer = () => { Cache.set("randomAnswer", t.randomAnswer); }, watchAskGpt = () => { msg("\u8bf7\u5148\u53bbAI\u641c\u9898\u9875\u9762\u6d4b\u8bd5AI\u662f\u5426\u53ef\u7528\uff0c\u518d\u542f\u7528\u7b54\u9898\uff0c\u7b54\u9898\u6b63\u786e\u7387\u65e0\u6cd5\u4fdd\u8bc1"), i.settings.enabledForAsk = a.app.askGpt, i.saveSettings(), Cache.set("askGpt", a.app.askGpt); }, watchDelay = () => { Cache.set("delay", t.delay); }; return (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "wide", title: "\u7b54\u9898\u52a9\u624b" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", fi, [ vue.createElementVNode("div", gi, [ vue.createElementVNode("div", yi, [ vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("div", vi, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: n[0] || (n[0] = e => vue.unref(t).start ? vue.unref(t).pause() : vue.unref(t).toggleStart()) }, vue.toDisplayString(vue.unref(t).start ? "\u6682\u505c\u7b54\u9898" : "\u5f00\u59cb\u7b54\u9898"), 1), vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: n[1] || (n[1] = e => vue.unref(t).restart()) }, "\u91cd\u65b0\u7b54\u9898") ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", bi, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: n[2] || (n[2] = e => r.value = !0) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information-outline", style: { "font-size": "16px" } }), vue.createTextVNode(" \u4f7f\u7528\u63d0\u793a ") ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: n[3] || (n[3] = e => o.value = !0) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:cog-outline", style: { "font-size": "16px" } }), vue.createTextVNode(" \u7b54\u9898\u8bbe\u7f6e ") ]) ]) ]), vue.createElementVNode("div", xi, [ vue.createElementVNode("div", wi, [ vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("div", ki, [ vue.createElementVNode("div", _i, [ qi, vue.createElementVNode("div", null, [ Ai, vue.createElementVNode("div", Ti, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).questionList, ((e, n) => (vue.openBlock(), vue.createElementBlock("button", { key: n, class: vue.normalizeClass([ "ask-question-btn", [ n === vue.unref(t).questionInx ? "aah_active" : "", 1 === e.status ? "status-success" : 2 === e.status ? "status-danger" : "" ] ]), type: "button", onClick: e => vue.unref(t).toQuestion(n) }, vue.toDisplayString(n + 1), 11, Ci)))), 128)) ]) ]) ]) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Si, [ vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("div", Ei, [ vue.createElementVNode("div", Ii, [ Ui, vue.createElementVNode("div", Hi, [ vue.createElementVNode("button", { class: "link-btn", type: "button", onClick: n[4] || (n[4] = e => vue.unref(t).reAnswer(vue.unref(t).questionInx)) }, "\u91cd\u7b54"), Oi, vue.createElementVNode("button", { class: "link-btn", type: "button", onClick: n[5] || (n[5] = e => vue.unref(t).aiAnswer(vue.unref(t).questionInx)) }, "AI\u7b54\u9898") ]) ]), vue.createElementVNode("div", ji, [ "15" == vue.unref(t).current.type ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createElementVNode("div", { class: "aah_title", innerHTML: "[" + vue.unref(typeConvert)(vue.unref(t).current.type ?? "", !1) + "]\u9605\u8bfb\u7406\u89e3" }, null, 8, zi), vue.createElementVNode("div", { class: "reading-passage", innerHTML: vue.unref(t).current.question }, null, 8, Pi), vue.createElementVNode("div", Li, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.options, ((e, n) => (vue.openBlock(), vue.createElementBlock("div", { key: n, class: "reading-sub-question" }, [ vue.createElementVNode("div", { class: "sub-question-title", innerHTML: n + 1 + ". " + e.question }, null, 8, Mi), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((e, a) => (vue.openBlock(), vue.createElementBlock("p", { class: vue.normalizeClass([ "aah_options", { active: vue.unref(t).current.form && vue.unref(t).current.form.match && vue.unref(t).current.form.match[n] && vue.unref(t).current.form.match[n].includes(a) } ]), key: a, innerHTML: getOptionIndex(a) + ". " + e }, null, 10, $i)))), 128)) ])))), 128)) ]) ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createElementVNode("div", { class: "aah_title", innerHTML: "[" + vue.unref(typeConvert)(vue.unref(t).current.type ?? "", !1) + "]" + vue.unref(t).current.question }, null, 8, Fi), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.options, ((e, n) => (vue.openBlock(), vue.createElementBlock("p", { class: vue.normalizeClass([ "aah_options", { active: vue.unref(t).current.form && vue.unref(t).current.form.match && vue.unref(t).current.form.match.includes(n) } ]), key: n, innerHTML: getOptionIndex(n) + ". " + e }, null, 10, Ni)))), 128)), "24" == vue.unref(t).current.type ? (vue.openBlock(), vue.createElementBlock("div", Di, [ vue.createElementVNode("table", Ri, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.match, ((e, n) => (vue.openBlock(), vue.createElementBlock("tr", { key: n }, [ vue.createElementVNode("td", { innerHTML: e }, null, 8, Bi), vue.createElementVNode("td", null, [ vue.createElementVNode("select", null, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.selects[n], (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.value, value: e.value }, vue.toDisplayString(e.text), 9, Gi)))), 128)) ]) ]) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0) ], 64)), vue.unref(t).current.form ? (vue.openBlock(), vue.createElementBlock("p", Vi, " \u91c7\u7528\u3010" + vue.toDisplayString(vue.unref(t).current.form.form) + "\u3011\u7684\u7b54\u6848 ", 1)) : vue.createCommentVNode("", !0), "8" != vue.unref(t).current.type && vue.unref(t).current.type ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("p", Ji, " \u5f53\u524d\u9898\u578b\u6682\u4e0d\u652f\u6301\uff0c\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005\u5427 ")) ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).loading ? (vue.openBlock(), vue.createElementBlock("div", Ki, [ vue.createElementVNode("div", Wi, [ vue.createElementVNode("div", Qi, vue.toDisplayString(vue.unref(t).loadingText), 1) ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("div", Yi, [ Xi, vue.createElementVNode("div", Zi, [ vue.unref(t).current.answer ? (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(t).current.answer, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "answer-block" }, [ vue.createElementVNode("div", eo, [ vue.createElementVNode("span", to, vue.toDisplayString(e.form), 1), e.duration ? (vue.openBlock(), vue.createElementBlock("span", no, vue.toDisplayString(e.duration) + "ms", 1)) : vue.createCommentVNode("", !0) ]), "object" == typeof e.answer && e.answer ? (vue.openBlock(), vue.createElementBlock("div", ao, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.answer, ((e, t) => { return vue.openBlock(), vue.createElementBlock("div", { key: t, class: "answer-field-html", innerHTML: (n = "string" == typeof e ? e : String(e), markToHtml(n ?? "")) }, null, 8, io); var n; })), 128)) ])) : (vue.openBlock(), vue.createElementBlock("div", oo, [ e.needLogin ? (vue.openBlock(), vue.createElementBlock("div", so, [ vue.createElementVNode("span", { innerHTML: e.msg }, null, 8, ro), vue.createElementVNode("button", { class: "link-btn", type: "button", onClick: n[6] || (n[6] = e => vue.unref(a).setPage("user")) }, "\u70b9\u51fb\u767b\u5f55") ])) : (vue.openBlock(), vue.createElementBlock("div", { key: 1, innerHTML: e.answer ? e.answer : e.msg ?? "\u6682\u65e0\u7b54\u6848" }, null, 8, lo)) ])) ])))), 128)) : vue.createCommentVNode("", !0), vue.unref(t).aiPreview && vue.unref(t).aiPreview.index === vue.unref(t).questionInx ? (vue.openBlock(), vue.createElementBlock("div", co, [ vue.createElementVNode("div", po, [ uo, vue.createElementVNode("span", ho, vue.toDisplayString(vue.unref(t).aiPreview.reason), 1) ]), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).aiPreview.answer, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { class: "answer-field-html", key: t }, vue.toDisplayString(e), 1)))), 128)), vue.createElementVNode("div", mo, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: n[7] || (n[7] = e => vue.unref(t).confirmAiPreview()) }, "\u786e\u8ba4\u586b\u5165"), vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: n[8] || (n[8] = e => vue.unref(t).skipAiPreview()) }, "\u8df3\u8fc7") ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).aiFailureMap[vue.unref(t).questionInx] ? (vue.openBlock(), vue.createElementBlock("div", fo, vue.toDisplayString(vue.unref(t).aiFailureMap[vue.unref(t).questionInx]), 1)) : vue.createCommentVNode("", !0), c.value ? (vue.openBlock(), vue.createElementBlock("div", go, [ vue.createElementVNode("div", yo, [ vue.createElementVNode("span", vo, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:sparkles", class: "ai-icon" }), vue.createTextVNode(" AI \u6df1\u5ea6\u89e3\u6790 ") ]), l.value ? (vue.openBlock(), vue.createElementBlock("span", bo, [ xo, wo, ko, vue.createTextVNode(" \u6b63\u5728\u751f\u6210... ") ])) : vue.createCommentVNode("", !0) ]), vue.unref(t).current.aiMsg ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, innerHTML: vue.unref(t).currentAiMd, class: "ai-answer-markdown" }, null, 8, _o)) : (vue.openBlock(), vue.createElementBlock("div", qo, " AI \u6b63\u5728\u601d\u8003\uff0c\u6d41\u5f0f\u5185\u5bb9\u4f1a\u5b9e\u65f6\u586b\u5145\uff0c\u8bf7\u7a0d\u5019... ")) ])) : vue.createCommentVNode("", !0) ]) ])) : vue.createCommentVNode("", !0) ]) ]), vue.unref(t).current ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("div", Ao, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit", class: "empty-icon" }), To ])) ]) ]) ]), o.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", onClick: n[16] || (n[16] = vue.withModifiers((e => o.value = !1), [ "self" ])), role: "dialog", "aria-modal": "true", "aria-labelledby": "settings-title" }, [ vue.createElementVNode("div", Co, [ vue.createElementVNode("div", So, [ Eo, vue.createElementVNode("button", { class: "modal-close", onClick: n[9] || (n[9] = e => o.value = !1), "aria-label": "\u5173\u95ed\u8bbe\u7f6e" }, "\xd7") ]), vue.createElementVNode("div", Io, [ vue.createElementVNode("div", Uo, [ vue.createElementVNode("label", Ho, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": n[10] || (n[10] = e => vue.unref(t).skipFinish = e), onChange: watchSkipFinish }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).skipFinish ] ]), Oo ]), vue.createElementVNode("label", jo, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": n[11] || (n[11] = e => vue.unref(t).autoAnswer = e), onChange: watchAutoAnswer }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).autoAnswer ] ]), zo ]), vue.createElementVNode("label", Po, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": n[12] || (n[12] = e => vue.unref(t).autoNext = e), onChange: watchAutoNext }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).autoNext ] ]), Lo ]), vue.createElementVNode("label", Mo, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": n[13] || (n[13] = e => vue.unref(t).randomAnswer = e), onChange: watchRandomAnswer }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).randomAnswer ] ]), $o ]), vue.createElementVNode("label", Fo, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": n[14] || (n[14] = e => vue.unref(a).app.askGpt = e), onChange: watchAskGpt }, null, 544), [ [ vue.vModelCheckbox, vue.unref(a).app.askGpt ] ]), No ]), vue.unref(t).minDelay > 0 ? (vue.openBlock(), vue.createElementBlock("div", Do, " \u7531\u4e8e\u89c4\u5219\u9650\u5236\uff0c\u5f53\u524d\u5e73\u53f0\u7b54\u9898\u95f4\u9694\u6700\u5c0f\u4e3a " + vue.toDisplayString(vue.unref(t).minDelay) + "ms ", 1)) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Ro, [ vue.createElementVNode("label", null, "\u95f4\u9694\uff08" + vue.toDisplayString(vue.unref(t).delay) + "ms\uff09", 1), vue.withDirectives(vue.createElementVNode("input", { type: "range", min: vue.unref(t).minDelay, max: 5e3, step: "100", "onUpdate:modelValue": n[15] || (n[15] = e => vue.unref(t).delay = e), onInput: watchDelay }, null, 40, Bo), [ [ vue.vModelText, vue.unref(t).delay, void 0, { number: !0 } ] ]) ]) ]), vue.unref(t).formMap ? (vue.openBlock(), vue.createElementBlock("div", Go, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).formMap, ((e, t) => (vue.openBlock(), vue.createElementBlock("span", { class: "pill", key: t }, vue.toDisplayString(t) + ":" + vue.toDisplayString(e) + " \u6b21", 1)))), 128)) ])) : vue.createCommentVNode("", !0) ]) ]) ])) : vue.createCommentVNode("", !0), r.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "modal-mask", onClick: n[18] || (n[18] = vue.withModifiers((e => r.value = !1), [ "self" ])), role: "dialog", "aria-modal": "true", "aria-labelledby": "tips-title" }, [ vue.createElementVNode("div", Vo, [ vue.createElementVNode("div", Jo, [ Ko, vue.createElementVNode("button", { class: "modal-close", onClick: n[17] || (n[17] = e => r.value = !1), "aria-label": "\u5173\u95ed\u63d0\u793a" }, "\xd7") ]), vue.createElementVNode("div", Wo, [ vue.createElementVNode("div", Qo, [ vue.createElementVNode("div", { class: "info-body", innerHTML: vue.unref(t).tipsMd }, null, 8, Yo), vue.createElementVNode("details", Xo, [ Zo, vue.createElementVNode("div", { innerHTML: vue.unref(t).typesMd }, null, 8, es) ]) ]) ]) ]) ])) : vue.createCommentVNode("", !0) ])), _: 1 })); } }), ns = { class: "question-page" }, as = vue.createElementVNode("div", { class: "watermark-bg" }, [ vue.createElementVNode("span", null, "AiAskHelper"), vue.createElementVNode("span", null, "\u7231\u95ee\u7b54\u52a9\u624b") ], -1), is = vue.createElementVNode("div", { class: "info-banner" }, [ vue.createElementVNode("div", { class: "info-title" }, "\u9898\u5e93\u7f13\u5b58\u8bf4\u660e"), vue.createElementVNode("div", { class: "info-body" }, [ vue.createTextVNode(" \u672c\u811a\u672c\u652f\u6301\u5c06\u5b58\u5728\u7b54\u6848\u7684\u9898\u76ee\u6536\u5f55\u5230\u672c\u5730\uff0c\u4ee5\u4f9b\u540e\u7eed\u7b54\u9898\u68c0\u7d22\uff0c\u53ef\u51cf\u5c11\u63a5\u53e3\u8bf7\u6c42\u6b21\u6570\uff0c\u63d0\u9ad8\u7b54\u6848\u6b63\u786e\u7387\u3002"), vue.createElementVNode("br"), vue.createTextVNode(" \u5728\u652f\u6301\u91cd\u590d\u7b54\u9898\u4e14\u7b54\u5b8c\u9898\u663e\u793a\u7b54\u6848\u7684\u60c5\u51b5\u4e0b\u53ef\u4ee5\u65e0\u9700\u4f7f\u7528\u63a5\u53e3\u641c\u7d22\u7b54\u6848\u3002"), vue.createElementVNode("br"), vue.createElementVNode("span", { class: "warn-text" }, "\u5e76\u975e\u6240\u6709\u7f51\u7ad9\u90fd\u652f\u6301\uff0c\u9700\u8981\u4f5c\u8005\u9002\u914d\uff0c\u5982\u9047\u4e0d\u652f\u6301\u7684\u5e73\u53f0\u8bf7\u53cd\u9988\u3002") ]) ], -1), os = { class: "stats-row" }, ss = { class: "stat-card" }, rs = vue.createElementVNode("div", { class: "stat-label" }, "\u7f13\u5b58\u9898\u76ee\u6570\u91cf", -1), ls = { class: "stat-value" }, cs = { class: "upload-text" }, ps = vue.createElementVNode("span", { class: "upload-icon" }, "\u2601\ufe0f", -1), ds = vue.createElementVNode("div", { class: "upload-desc" }, [ vue.createElementVNode("strong", null, "\u62d6\u62fd\u5907\u4efd\u6587\u4ef6"), vue.createTextVNode(" \u6216 "), vue.createElementVNode("em", null, "\u70b9\u51fb\u4e0a\u4f20"), vue.createTextVNode(" \u6062\u590d\u5907\u4efd ") ], -1), us = { key: 0, class: "upload-hint" }, hs = { class: "search-filter-row" }, ms = { class: "search-box" }, fs = vue.createElementVNode("option", { value: "" }, "\u5168\u90e8\u9898\u578b", -1), gs = [ "value" ], ys = { class: "actions-row" }, vs = { class: "data-stats" }, bs = { class: "stats-text" }, xs = { class: "question-table-wrapper" }, ws = { key: 0, class: "table-empty" }, ks = { class: "empty-text" }, _s = { key: 1, class: "question-cards" }, qs = { class: "card-header" }, As = { class: "question-number" }, Ts = { class: "question-type-badge" }, Cs = { class: "card-body" }, Ss = { class: "question-content" }, Es = vue.createElementVNode("div", { class: "question-label" }, "\u9898\u76ee", -1), Is = [ "innerHTML" ], Us = { key: 0, class: "options-content" }, Hs = vue.createElementVNode("div", { class: "options-label" }, "\u9009\u9879", -1), Os = [ "innerHTML" ], js = { class: "answer-content" }, zs = vue.createElementVNode("div", { class: "answer-label" }, "\u7b54\u6848", -1), Ps = [ "innerHTML" ], Ls = { key: 0, class: "pagination-wrapper" }, Ms = { class: "pagination" }, $s = [ "disabled" ], Fs = { class: "page-numbers" }, Ns = [ "onClick" ], Ds = { key: 0, class: "page-ellipsis" }, Rs = [ "disabled" ], Bs = { class: "page-size-selector" }, Gs = vue.createElementVNode("label", null, "\u6bcf\u9875\u663e\u793a\uff1a", -1), Vs = vue.createElementVNode("option", { value: 10 }, "10 \u6761", -1), Js = vue.createElementVNode("option", { value: 20 }, "20 \u6761", -1), Ks = vue.createElementVNode("option", { value: 50 }, "50 \u6761", -1), Ws = vue.createElementVNode("option", { value: 100 }, "100 \u6761", -1), Qs = [ Vs, Js, Ks, Ws ], Ys = vue.defineComponent({ __name: "Question", setup(e) { const t = vue.ref(0), a = vue.ref(null), i = vue.ref(!1), o = vue.ref(1), s = vue.ref(20), r = vue.ref(""), l = vue.ref(""); let c; window.addEventListener("keydown", (e => { "`" === e.key && t.value++; })); try { c = $t.script.updateURL.match(/scripts\/(\d+)/)[1]; } catch (v) { c = "492563"; } const p = `https://greasyfork.org/zh-CN/scripts/${c}`, d = pn(), u = Cache.match("ques1_"), exportHtml = async e => { const t = e.map(((e, t) => `\n

    \u7231\u95ee\u7b54\u52a9\u624b

    \n

    ${t + 1}\u3001[${typeConvert(e.type, !1)}]${e.question}

    \n

    ${formatOptionsForExport(e.options)}

    \n

    \u7b54\u6848\uff1a${formatAnswerForExport(e.answer)}

    \n \n `)).join("
    "), n = new Blob([ ` \u7231\u95ee\u7b54\u52a9\u624b\u7b54\u6848\u5bfc\u51fa ${t} ` ], { type: "text/html" }), a = document.createElement("a"); a.href = URL.createObjectURL(n), a.download = "\u7231\u95ee\u7b54\u52a9\u624b.html", a.click(); }, exportData = async () => { try { const e = Cache.matchGet("ques1_") || []; if (0 === e.length) return void msg("\u6682\u65e0\u9898\u76ee\u53ef\u5bfc\u51fa", "warning"); msg(`\u6b63\u5728\u6253\u5305${e.length}\u9898\uff0c\u8bf7\u7a0d\u540e...`, "info"); const t = await encrypt(JSON.stringify(e)); if (!t) return void msg("\u52a0\u5bc6\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u6216\u8054\u7cfb\u5f00\u53d1\u8005", "error"); const n = new Blob([ t ], { type: "application/text" }); msg(`\u6253\u5305\u5b8c\u6210\uff0c\u5171\u8ba1${e.length}\u9898\uff0c\u51c6\u5907\u4e0b\u8f7d`, "success"); const a = document.createElement("a"); a.href = URL.createObjectURL(n); const i = (new Date).toLocaleDateString().replace(/\//g, "-"); a.download = `\u7231\u95ee\u7b54\u52a9\u624b\u5907\u4efd-${i}.bak`, a.click(), setTimeout((() => URL.revokeObjectURL(a.href)), 100); } catch (e) { msg(`\u5bfc\u51fa\u5931\u8d25\uff1a${e}`, "error"); } }, exportDocx = async () => { exportHtml(d.saveQuestionData); }, exportDocx1 = async () => { const e = Cache.matchGet("ques1_") || []; exportHtml(e); }, answerFormat = (e, t) => e ? Array.isArray(e) && e.length > 0 && Array.isArray(e[0]) ? e.map(((e, t) => `
    \n ${t + 1}.\n ${Array.isArray(e) ? e.join(", ") : String(e)}\n
    `)).join("") : Array.isArray(e) ? e.join("
    ") : "string" == typeof e ? e : "object" == typeof e ? JSON.stringify(e) : String(e) : "", formatOptionsForExport = e => e ? Array.isArray(e) && e.length > 0 && "string" == typeof e[0] ? function(e) { return "object" != typeof e ? "" : e.map(((e, t) => String.fromCharCode(65 + t) + "." + e)).join("
    "); }(e) : Array.isArray(e) && e.length > 0 && "object" == typeof e[0] ? e.map(((e, t) => { let n = `

    ${t + 1}. ${e.question || ""}

    `; return e.options && Array.isArray(e.options) && e.options.forEach(((e, t) => { const a = String.fromCharCode(65 + t); n += `

    ${a}. ${e}

    `; })), e.answer && Array.isArray(e.answer) && (n += `

    \u7b54\u6848: ${e.answer.join(", ")}

    `), n; })).join("
    ") : Array.isArray(e) ? e.join("
    ") : String(e) : "", formatAnswerForExport = e => e ? Array.isArray(e) && e.length > 0 && Array.isArray(e[0]) ? e.map(((e, t) => `${t + 1}. ${Array.isArray(e) ? e.join(", ") : String(e)}`)).join("
    ") : Array.isArray(e) ? e.join("
    ") : String(e) : "", beforeUpload = e => { if (!e) return !1; i.value = !0; const t = new FileReader; return t.onload = async e => { var t; const n = null == (t = e.target) ? void 0 : t.result; try { const e = JSON.parse(await decrypt(n)); e.forEach((e => { Answer.cacheAnswer(e); })), msg(`\u9898\u5e93\u5bfc\u5165\u6210\u529f\uff0c\u5171\u8ba1${e.length}\u9898\n \u8fc7\u591a\u9898\u76ee\u5bfc\u5165\u540e\u9875\u9762\u4f1a\u5361\u4e3b\u8bf7\u76f4\u63a5\u5173\u95ed\u9875\u9762\u91cd\u65b0\u6253\u5f00`, "success"); } catch (a) { msg("\u6587\u4ef6\u683c\u5f0f\u9519\u8bef", "error"); } i.value = !1; }, t.onerror = () => { msg("\u8bfb\u53d6\u6587\u4ef6\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5", "error"), i.value = !1; }, t.readAsText(e), !1; }, handleFileChange = e => { var t; const n = null == (t = e.target.files) ? void 0 : t[0]; n && beforeUpload(n), a.value && (a.value.value = ""); }, handleDrop = e => { var t, n; e.preventDefault(); const a = null == (n = null == (t = e.dataTransfer) ? void 0 : t.files) ? void 0 : n[0]; a && beforeUpload(a); }, handleDragOver = e => { e.preventDefault(); }, h = vue.computed((() => { let e = d.saveQuestionData; if (r.value) { const t = r.value.toLowerCase(); e = e.filter((e => { var n; return (null == (n = e.question) ? void 0 : n.toLowerCase().includes(t)) || !!Array.isArray(e.options) && e.options.some((e => "string" == typeof e ? e.toLowerCase().includes(t) : JSON.stringify(e).toLowerCase().includes(t))) || !!Array.isArray(e.answer) && e.answer.some((e => "string" == typeof e ? e.toLowerCase().includes(t) : JSON.stringify(e).toLowerCase().includes(t))); })); } return l.value && (e = e.filter((e => e.type === l.value))), e; })), m = vue.computed((() => { const e = (o.value - 1) * s.value, t = e + s.value; return h.value.slice(e, t); })), g = vue.computed((() => Math.ceil(h.value.length / s.value))), y = vue.computed((() => [ ...new Set(d.saveQuestionData.map((e => e.type))) ].map((e => ({ value: e, label: typeConvert(e, !1) }))))), resetSearch = () => { r.value = "", l.value = "", o.value = 1; }, handlePageChange = e => { o.value = e; }; return (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "wide", title: "\u9898\u5e93\u7ba1\u7406" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", ns, [ as, is, vue.createElementVNode("div", os, [ vue.createElementVNode("div", ss, [ rs, vue.createElementVNode("div", ls, vue.toDisplayString(vue.unref(u).length), 1) ]) ]), vue.createElementVNode("div", { class: "upload-box", onDrop: handleDrop, onDragover: handleDragOver, onClick: n[0] || (n[0] = e => { var t; return null == (t = a.value) ? void 0 : t.click(); }) }, [ vue.createElementVNode("input", { ref_key: "uploadInput", ref: a, type: "file", accept: ".bak", class: "upload-input", onChange: handleFileChange }, null, 544), vue.createElementVNode("div", cs, [ ps, ds, i.value ? (vue.openBlock(), vue.createElementBlock("div", us, "\u6b63\u5728\u5bfc\u5165\uff0c\u8bf7\u7a0d\u5019\u2026")) : vue.createCommentVNode("", !0) ]) ], 32), vue.createElementVNode("div", hs, [ vue.createElementVNode("div", ms, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": n[1] || (n[1] = e => r.value = e), type: "text", placeholder: "\u641c\u7d22\u9898\u76ee\u3001\u9009\u9879\u6216\u7b54\u6848...", class: "search-input" }, null, 512), [ [ vue.vModelText, r.value ] ]), r.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, onClick: n[2] || (n[2] = e => r.value = ""), class: "search-clear" }, "\xd7")) : vue.createCommentVNode("", !0) ]), vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": n[3] || (n[3] = e => l.value = e), class: "filter-select" }, [ fs, (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(y.value, (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.value, value: e.value }, vue.toDisplayString(e.label), 9, gs)))), 128)) ], 512), [ [ vue.vModelSelect, l.value ] ]), vue.createElementVNode("button", { onClick: resetSearch, class: "aah-btn aah-btn-plain aah-btn-small" }, "\u91cd\u7f6e") ]), vue.createElementVNode("div", ys, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-danger", type: "button", onClick: n[4] || (n[4] = e => window.confirm("\u786e\u5b9a\u8981\u6e05\u7a7a\u672c\u5730\u7f13\u5b58\u5417\uff1f") && (Cache.matchRemove("ques1_"), void msg("\u6e05\u9664\u6210\u529f", "success"))) }, "\u6e05\u9664\u7f13\u5b58"), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: exportData }, "\u5bfc\u51fa\u5907\u4efd"), t.value > 10 ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "aah-btn aah-btn-primary", type: "button", onClick: exportDocx }, "\u5bfc\u51fa\u5f53\u524d")) : vue.createCommentVNode("", !0), t.value > 10 ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, class: "aah-btn aah-btn-primary", type: "button", onClick: exportDocx1 }, "\u5bfc\u51fa\u6240\u6709")) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("div", vs, [ vue.createElementVNode("span", bs, " \u5171 " + vue.toDisplayString(vue.unref(d).saveQuestionData.length) + " \u9898\uff0c \u7b5b\u9009\u540e " + vue.toDisplayString(h.value.length) + " \u9898\uff0c \u5f53\u524d\u663e\u793a\u7b2c " + vue.toDisplayString(o.value) + " \u9875 ", 1) ]), vue.createElementVNode("div", xs, [ 0 === m.value.length ? (vue.openBlock(), vue.createElementBlock("div", ws, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit", class: "empty-icon" }), vue.createElementVNode("div", ks, vue.toDisplayString(r.value || l.value ? "\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u9898\u76ee" : "\u5f53\u524d\u9875\u6682\u65e0\u6570\u636e"), 1), r.value || l.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, onClick: resetSearch, class: "aah-btn aah-btn-primary aah-btn-small" }, "\u6e05\u9664\u7b5b\u9009")) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("div", _s, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(m.value, ((e, t) => { return vue.openBlock(), vue.createElementBlock("div", { key: t, class: "question-card" }, [ vue.createElementVNode("div", qs, [ vue.createElementVNode("div", As, "# " + vue.toDisplayString((o.value - 1) * s.value + t + 1), 1), vue.createElementVNode("div", Ts, vue.toDisplayString((a = e, typeConvert(a.type, !1))), 1) ]), vue.createElementVNode("div", Cs, [ vue.createElementVNode("div", Ss, [ Es, vue.createElementVNode("div", { class: "question-text", innerHTML: e.question }, null, 8, Is) ]), e.options && e.options.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", Us, [ Hs, vue.createElementVNode("div", { class: "options-text", innerHTML: (n = e.options, n ? Array.isArray(n) && n.length > 0 && "string" == typeof n[0] ? n.map(((e, t) => String.fromCharCode(65 + t) + "." + e)).join("
    ") : Array.isArray(n) && n.length > 0 && "object" == typeof n[0] ? n.map(((e, t) => { let n = '
    '; return n += `
    ${t + 1}. ${e.question || ""}
    `, e.options && Array.isArray(e.options) && (n += '
    ', e.options.forEach(((e, t) => { const a = String.fromCharCode(65 + t); n += `
    ${a}. ${e}
    `; })), n += "
    "), e.answer && Array.isArray(e.answer) && (n += `
    \u7b54\u6848: ${e.answer.join(", ")}
    `), n += "
    ", n; })).join("") : Array.isArray(n) ? n.join("
    ") : String(n) : "") }, null, 8, Os) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", js, [ zs, vue.createElementVNode("div", { class: "answer-text", innerHTML: answerFormat(e.answer) }, null, 8, Ps) ]) ]) ]); var n, a; })), 128)) ])) ]), g.value > 1 ? (vue.openBlock(), vue.createElementBlock("div", Ls, [ vue.createElementVNode("div", Ms, [ vue.createElementVNode("button", { onClick: n[5] || (n[5] = e => handlePageChange(o.value - 1)), disabled: o.value <= 1, class: "page-btn page-prev" }, " \u2039 \u4e0a\u4e00\u9875 ", 8, $s), vue.createElementVNode("div", Fs, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(Math.min(g.value, 7), (e => (vue.openBlock(), vue.createElementBlock("button", { key: e, onClick: t => handlePageChange(e), class: vue.normalizeClass([ "page-number", { active: e === o.value } ]) }, vue.toDisplayString(e), 11, Ns)))), 128)), g.value > 7 ? (vue.openBlock(), vue.createElementBlock("span", Ds, "...")) : vue.createCommentVNode("", !0), g.value > 7 ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, onClick: n[6] || (n[6] = e => handlePageChange(g.value)), class: vue.normalizeClass([ "page-number", { active: g.value === o.value } ]) }, vue.toDisplayString(g.value), 3)) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("button", { onClick: n[7] || (n[7] = e => handlePageChange(o.value + 1)), disabled: o.value >= g.value, class: "page-btn page-next" }, " \u4e0b\u4e00\u9875 \u203a ", 8, Rs) ]), vue.createElementVNode("div", Bs, [ Gs, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": n[8] || (n[8] = e => s.value = e), onChange: n[9] || (n[9] = e => o.value = 1) }, Qs, 544), [ [ vue.vModelSelect, s.value ] ]) ]) ])) : vue.createCommentVNode("", !0) ]) ])), _: 1 })); } }), Xs = { class: "modal-panel" }, Zs = { class: "modal-header" }, er = { class: "modal-body" }, tr = { class: "form-row" }, nr = vue.createElementVNode("label", null, "\u9898\u578b", -1), ar = [ "value" ], ir = { class: "form-row" }, or = vue.createElementVNode("label", null, "\u9898\u5e72", -1), sr = { key: 0, class: "form-row" }, rr = vue.createElementVNode("label", null, "\u9009\u9879", -1), lr = { class: "option-list" }, cr = [ "onClick" ], pr = [ "onUpdate:modelValue" ], dr = [ "onClick" ], ur = { key: 1, class: "form-row" }, hr = vue.createElementVNode("label", null, "\u7b54\u6848", -1), mr = { class: "option-list" }, fr = [ "onUpdate:modelValue" ], gr = [ "onClick" ], yr = vue.defineComponent({ __name: "QuestionEdit", props: { ques: {}, visible: { type: Boolean } }, emits: [ "handleClose" ], setup(e, {emit: t}) { const a = e, i = vue.ref(a.visible); vue.watch((() => a.visible), (e => { i.value = e; })); const o = t, closeDialog = () => { i.value = !1, o("handleClose"); }, handleCancel = () => { closeDialog(); }, handleSave = () => { Answer.cacheAnswer(a.ques), Cache.matchRemove(a.ques.key), msg("\u9898\u76ee\u4fee\u6539\u6210\u529f", "success"), closeDialog(); }, handleDelete = e => { a.ques.options.splice(e, 1), a.ques.answer.includes(a.ques.options[e]) && (a.ques.answer = a.ques.answer.filter((t => t !== a.ques.options[e]))); }, handleAdd = () => { a.ques.options.push(""); }; return (e, t) => { var n; return i.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", onClick: vue.withModifiers(handleCancel, [ "self" ]) }, [ vue.createElementVNode("div", Xs, [ vue.createElementVNode("div", Zs, [ vue.createElementVNode("h3", null, "\u9898\u76ee\u7f16\u8f91 [" + vue.toDisplayString(null == (n = e.ques) ? void 0 : n.type) + "]", 1), vue.createElementVNode("button", { class: "modal-close", type: "button", onClick: handleCancel }, "\xd7") ]), vue.createElementVNode("div", er, [ vue.createElementVNode("div", tr, [ nr, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": t[0] || (t[0] = t => e.ques.type = t), class: "base-select" }, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(Lt), ((e, t) => (vue.openBlock(), vue.createElementBlock("option", { key: e, value: e }, vue.toDisplayString(t), 9, ar)))), 128)) ], 512), [ [ vue.vModelSelect, e.ques.type ] ]) ]), vue.createElementVNode("div", ir, [ or, vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": t[1] || (t[1] = t => e.ques.question = t), class: "base-input", rows: "5" }, null, 512), [ [ vue.vModelText, e.ques.question ] ]) ]), e.ques.options && Array.isArray(e.ques.options) && e.ques.options.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", sr, [ rr, vue.createElementVNode("div", lr, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.ques.options, ((t, n) => (vue.openBlock(), vue.createElementBlock("div", { key: n, class: "option-row" }, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "option-selector", { active: e.ques.answer.includes(t) } ]), onClick: e => (e => { a.ques.answer = a.ques.answer.includes(e) ? a.ques.answer.filter((t => t !== e)) : [ ...a.ques.answer, e ], a.ques.answer.sort(((e, t) => a.ques.options.indexOf(e) - a.ques.options.indexOf(t))); })(t) }, vue.toDisplayString(String.fromCharCode(65 + n)), 11, cr), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.ques.options[n] = t, class: "base-input flex-grow" }, null, 8, pr), [ [ vue.vModelText, e.ques.options[n] ] ]), vue.createElementVNode("button", { class: "btn btn-outline btn-small", type: "button", onClick: e => 0 !== n ? handleDelete(n) : handleAdd() }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 !== n ? "mdi:minus" : "mdi:plus" }, null, 8, [ "icon" ]) ], 8, dr) ])))), 128)) ]) ])) : Array.isArray(e.ques.answer) && 0 === e.ques.options.length ? (vue.openBlock(), vue.createElementBlock("div", ur, [ hr, vue.createElementVNode("div", mr, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.ques.answer, ((t, n) => (vue.openBlock(), vue.createElementBlock("div", { key: n, class: "option-row" }, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.ques.answer[n] = t, class: "base-input flex-grow" }, null, 8, fr), [ [ vue.vModelText, e.ques.answer[n] ] ]), vue.createElementVNode("button", { class: "btn btn-outline btn-small", type: "button", onClick: e => 0 !== n ? handleDelete(n) : handleAdd() }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 !== n ? "mdi:minus" : "mdi:plus" }, null, 8, [ "icon" ]) ], 8, gr) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("div", { class: "modal-footer" }, [ vue.createElementVNode("button", { class: "btn btn-outline", type: "button", onClick: handleCancel }, "\u53d6\u6d88"), vue.createElementVNode("button", { class: "btn btn-primary", type: "button", onClick: handleSave }, "\u4fdd\u5b58") ]) ]) ])) : vue.createCommentVNode("", !0); }; } }), _withScopeId$1 = e => (vue.pushScopeId("data-v-9e0b5f5c"), e = e(), vue.popScopeId(), e), vr = { class: "modal-panel modal-panel-large" }, br = _withScopeId$1((() => vue.createElementVNode("h3", null, "\u9605\u8bfb\u7406\u89e3\u9898\u76ee\u7f16\u8f91", -1))), xr = { class: "modal-body" }, wr = { class: "form-section" }, kr = { class: "section-header" }, _r = _withScopeId$1((() => vue.createElementVNode("h4", null, "\u9605\u8bfb\u6750\u6599", -1))), qr = { class: "form-row" }, Ar = _withScopeId$1((() => vue.createElementVNode("label", null, "\u9898\u5e72\u5185\u5bb9", -1))), Tr = { class: "form-section" }, Cr = { class: "section-header" }, Sr = _withScopeId$1((() => vue.createElementVNode("h4", null, "\u5b50\u9898\u76ee\u5217\u8868", -1))), Er = { class: "sub-questions-editor" }, Ir = { class: "sub-question-header" }, Ur = { class: "sub-question-number" }, Hr = [ "onUpdate:modelValue" ], Or = [ "value" ], jr = [ "onClick", "disabled" ], zr = { class: "form-row" }, Pr = _withScopeId$1((() => vue.createElementVNode("label", null, "\u9898\u76ee\u5185\u5bb9", -1))), Lr = [ "onUpdate:modelValue", "placeholder" ], Mr = { key: 0, class: "form-row" }, $r = _withScopeId$1((() => vue.createElementVNode("label", null, "\u9009\u9879\u8bbe\u7f6e", -1))), Fr = { class: "option-list" }, Nr = [ "onClick" ], Dr = [ "onUpdate:modelValue", "placeholder" ], Rr = [ "onClick" ], Br = { key: 1, class: "form-row" }, Gr = _withScopeId$1((() => vue.createElementVNode("label", null, "\u53c2\u8003\u7b54\u6848", -1))), Vr = { class: "answer-list" }, Jr = [ "onUpdate:modelValue", "placeholder" ], Kr = [ "onClick" ], Wr = vue.defineComponent({ __name: "ReadingComprehensionEdit", props: { ques: {}, visible: { type: Boolean } }, emits: [ "handleClose" ], setup(e, {emit: t}) { const a = e, i = t, o = vue.ref(a.visible), r = vue.ref(JSON.parse(JSON.stringify(a.ques || {}))); vue.watch((() => a.visible), (e => { o.value = e, e && a.ques && (r.value = JSON.parse(JSON.stringify(a.ques)), r.value.options || (r.value.options = []), r.value.options.forEach((e => { e.answer || (e.answer = []), e.options || (e.options = []), e.type || (e.type = "0"); }))); })); const closeDialog = () => { o.value = !1, i("handleClose"); }, handleCancel = () => { closeDialog(); }, handleSave = () => { if (r.value.question.trim()) if (0 !== r.value.options.length) { for (let e = 0; e < r.value.options.length; e++) { const t = r.value.options[e]; if (!t.question.trim()) return void msg(`\u7b2c ${e + 1} \u9898\u7684\u9898\u76ee\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a`, "error"); if ([ "0", "1" ].includes(t.type) && t.options.length < 2) return void msg(`\u7b2c ${e + 1} \u9898\u81f3\u5c11\u9700\u89812\u4e2a\u9009\u9879`, "error"); if (0 === t.answer.length) return void msg(`\u7b2c ${e + 1} \u9898\u5fc5\u987b\u8bbe\u7f6e\u7b54\u6848`, "error"); } Object.assign(a.ques, r.value), Answer.cacheAnswer(a.ques), Cache.matchRemove(a.ques.key), msg("\u9605\u8bfb\u7406\u89e3\u9898\u76ee\u4fee\u6539\u6210\u529f", "success"), closeDialog(); } else msg("\u81f3\u5c11\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a\u5b50\u9898\u76ee", "error"); else msg("\u8bf7\u586b\u5199\u9605\u8bfb\u6750\u6599\u5185\u5bb9", "error"); }, addSubQuestion = () => { r.value.options.push({ type: "0", question: "", options: [ "", "" ], answer: [] }); }; return (e, t) => o.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", onClick: vue.withModifiers(handleCancel, [ "self" ]) }, [ vue.createElementVNode("div", vr, [ vue.createElementVNode("div", { class: "modal-header" }, [ br, vue.createElementVNode("button", { class: "modal-close", type: "button", onClick: handleCancel }, "\xd7") ]), vue.createElementVNode("div", xr, [ vue.createElementVNode("div", wr, [ vue.createElementVNode("div", kr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-variant", class: "section-icon" }), _r ]), vue.createElementVNode("div", qr, [ Ar, vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": t[0] || (t[0] = e => r.value.question = e), class: "base-input", rows: "8", placeholder: "\u8bf7\u8f93\u5165\u9605\u8bfb\u7406\u89e3\u7684\u4e3b\u8981\u6750\u6599\u5185\u5bb9..." }, "\n ", 512), [ [ vue.vModelText, r.value.question ] ]) ]) ]), vue.createElementVNode("div", Tr, [ vue.createElementVNode("div", Cr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:help-circle", class: "section-icon" }), Sr, vue.createElementVNode("button", { class: "btn btn-primary btn-small", type: "button", onClick: addSubQuestion }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:plus" }), vue.createTextVNode(" \u6dfb\u52a0\u9898\u76ee ") ]) ]), vue.createElementVNode("div", Er, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(r.value.options, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "sub-question-editor" }, [ vue.createElementVNode("div", Ir, [ vue.createElementVNode("span", Ur, vue.toDisplayString(t + 1), 1), vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": t => e.type = t, class: "base-select base-select-small" }, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(Lt), ((e, t) => (vue.openBlock(), vue.createElementBlock("option", { key: e, value: e }, vue.toDisplayString(t), 9, Or)))), 128)) ], 8, Hr), [ [ vue.vModelSelect, e.type ] ]), vue.createElementVNode("button", { class: "btn btn-danger btn-small", type: "button", onClick: e => (e => { r.value.options.length > 1 && r.value.options.splice(e, 1); })(t), disabled: r.value.options.length <= 1 }, " \u5220\u9664 ", 8, jr) ]), vue.createElementVNode("div", zr, [ Pr, vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": t => e.question = t, class: "base-input", rows: "3", placeholder: `\u8bf7\u8f93\u5165\u7b2c ${t + 1} \u9898\u7684\u9898\u76ee\u5185\u5bb9...` }, "\n ", 8, Lr), [ [ vue.vModelText, e.question ] ]) ]), [ "0", "1" ].includes(e.type) ? (vue.openBlock(), vue.createElementBlock("div", Mr, [ $r, vue.createElementVNode("div", Fr, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((n, a) => (vue.openBlock(), vue.createElementBlock("div", { key: a, class: "option-row" }, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "option-selector", { active: e.answer.includes(n) } ]), onClick: e => ((e, t) => { const n = r.value.options[e], a = n.answer.indexOf(t); a > -1 ? n.answer.splice(a, 1) : "0" === n.type ? n.answer = [ t ] : (n.answer.push(t), n.answer.sort(((e, t) => n.options.indexOf(e) - n.options.indexOf(t)))); })(t, n) }, vue.toDisplayString(String.fromCharCode(65 + a)), 11, Nr), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.options[a] = t, class: "base-input flex-grow", placeholder: `\u9009\u9879 ${String.fromCharCode(65 + a)}` }, null, 8, Dr), [ [ vue.vModelText, e.options[a] ] ]), vue.createElementVNode("button", { class: "btn btn-outline btn-small", type: "button", onClick: e => { return 0 === a ? (n = t, void r.value.options[n].options.push("")) : ((e, t) => { const n = r.value.options[e], a = n.options[t]; n.options.splice(t, 1); const i = n.answer.indexOf(a); i > -1 && n.answer.splice(i, 1); })(t, a); var n; } }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 === a ? "mdi:plus" : "mdi:minus" }, null, 8, [ "icon" ]) ], 8, Rr) ])))), 128)) ]) ])) : (vue.openBlock(), vue.createElementBlock("div", Br, [ Gr, vue.createElementVNode("div", Vr, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.answer, ((n, a) => (vue.openBlock(), vue.createElementBlock("div", { key: a, class: "answer-row" }, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.answer[a] = t, class: "base-input flex-grow", placeholder: `\u7b54\u6848 ${a + 1}` }, null, 8, Jr), [ [ vue.vModelText, e.answer[a] ] ]), vue.createElementVNode("button", { class: "btn btn-outline btn-small", type: "button", onClick: e => { return 0 === a ? (n = t, void r.value.options[n].answer.push("")) : ((e, t) => { r.value.options[e].answer.length > 1 && r.value.options[e].answer.splice(t, 1); })(t, a); var n; } }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 === a ? "mdi:plus" : "mdi:minus" }, null, 8, [ "icon" ]) ], 8, Kr) ])))), 128)) ]) ])) ])))), 128)) ]) ]) ]), vue.createElementVNode("div", { class: "modal-footer" }, [ vue.createElementVNode("button", { class: "btn btn-outline", type: "button", onClick: handleCancel }, "\u53d6\u6d88"), vue.createElementVNode("button", { class: "btn btn-primary", type: "button", onClick: handleSave }, "\u4fdd\u5b58\u4fee\u6539") ]) ]) ])) : vue.createCommentVNode("", !0); } }), _export_sfc = (e, t) => { const n = e.__vccOpts || e; for (const [a, i] of t) n[a] = i; return n; }, Qr = _export_sfc(Wr, [ [ "__scopeId", "data-v-9e0b5f5c" ] ]), _withScopeId = e => (vue.pushScopeId("data-v-71cc29f1"), e = e(), vue.popScopeId(), e), Yr = { class: "preview-container" }, Xr = { class: "toolbar" }, Zr = { class: "toolbar-left" }, el = { class: "page-title" }, tl = { class: "toolbar-right" }, nl = { class: "search-box" }, al = _withScopeId((() => vue.createElementVNode("option", { value: 5 }, "5\u9898/\u9875", -1))), il = _withScopeId((() => vue.createElementVNode("option", { value: 10 }, "10\u9898/\u9875", -1))), ol = _withScopeId((() => vue.createElementVNode("option", { value: 20 }, "20\u9898/\u9875", -1))), sl = [ al, il, ol ], rl = { key: 0, class: "search-info" }, ll = { class: "questions-container" }, cl = { key: 0, class: "loading" }, pl = _withScopeId((() => vue.createElementVNode("div", { class: "spinner" }, null, -1))), dl = _withScopeId((() => vue.createElementVNode("span", null, "\u641c\u7d22\u4e2d...", -1))), ul = [ pl, dl ], hl = { key: 1, class: "empty" }, ml = { key: 2, class: "questions-list" }, fl = { class: "question-header" }, gl = { class: "question-info" }, yl = { class: "question-num" }, vl = { class: "question-type" }, bl = { class: "question-actions" }, xl = [ "onClick" ], wl = [ "onClick" ], kl = { class: "question-content" }, _l = [ "innerHTML" ], ql = { key: 0, class: "options" }, Al = { key: 0, class: "reading-type" }, Tl = { class: "reading-title" }, Cl = { class: "sub-questions" }, Sl = { class: "sub-num" }, El = { class: "sub-type" }, Il = [ "innerHTML" ], Ul = { key: 0, class: "more-subs" }, Hl = { key: 1, class: "complex-type" }, Ol = { key: 2, class: "normal-options" }, jl = { class: "option-label" }, zl = [ "innerHTML" ], Pl = { key: 0, class: "correct-mark" }, Ll = { class: "answer" }, Ml = _withScopeId((() => vue.createElementVNode("span", { class: "answer-label" }, "\u7b54\u6848\uff1a", -1))), $l = { key: 0, class: "answer-list" }, Fl = [ "innerHTML" ], Nl = { key: 2, class: "no-answer" }, Dl = { key: 1, class: "pagination" }, Rl = [ "disabled" ], Bl = { class: "page-info" }, Gl = [ "max" ], Vl = [ "disabled" ], Jl = { class: "total-info" }, Kl = _export_sfc(vue.defineComponent({ __name: "Preview", setup(e) { const t = vue.ref(Cache.matchGet("ques1_") || []), a = vue.ref(!1), i = vue.ref(""), o = vue.ref(1), s = vue.ref(10), r = function(e) { const t = new Blob([ `(${e.toString()})()` ], { type: "application/javascript" }), n = URL.createObjectURL(t); return new Worker(n); }((() => { self.importScripts("https://cdn.bootcdn.net/ajax/libs/fuse.js/7.1.0/fuse.min.js"), self.onmessage = function(e) { const {data: t, options: n} = e.data, a = new Fuse(t, n).search(e.data.keyword).map((e => e.item)); a.forEach((t => { t.question1 = t.question, e.data.keyword.split("").forEach((e => { /[\u4e00-\u9fa5a-zA-Z0-9]/.test(e) && (t.question1 = t.question1.replace(new RegExp(e, "g"), `${e}`)); })); })), self.postMessage(a); }; })), l = vue.computed((() => t.value.length)), c = vue.computed((() => 0 === l.value ? 0 : Math.ceil(l.value / s.value))), p = vue.computed((() => { const e = (o.value - 1) * s.value, n = e + s.value; return t.value.slice(e, n); })), cl_img_format = e => { if (!e.trim()) return e; return e.replace(/]*>/gi, (e => e.replace(/\/?>$/, ' referrerPolicy="no-referrer">'))); }, getOptionIndex = e => String.fromCharCode(65 + e), handlePageChange = e => { if (0 === c.value) return; const t = Math.min(Math.max(1, e), c.value); o.value = t; }, goPrev = () => handlePageChange(o.value - 1), goNext = () => handlePageChange(o.value + 1), search = () => { const e = { keys: [ "question" ], threshold: .3 }, n = i.value.trim(); a.value = !0, n ? (r.onmessage = e => { const n = e.data; t.value = n, a.value = !1, o.value = 1; }, r.postMessage({ data: Cache.matchGet("ques1_"), options: e, keyword: n })) : (t.value = Cache.matchGet("ques1_") || [], a.value = !1, o.value = 1); }, d = vue.ref(null), u = vue.ref(!1), h = vue.ref(!1), handleClose = () => { u.value = !1; }, handleReadingClose = () => { h.value = !1; }; return (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "wide", title: "\u9898\u5e93\u9884\u89c8" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", Yr, [ vue.createVNode(yr, { visible: u.value, ques: d.value, onHandleClose: handleClose }, null, 8, [ "visible", "ques" ]), vue.createVNode(Qr, { visible: h.value, ques: d.value, onHandleClose: handleReadingClose }, null, 8, [ "visible", "ques" ]), vue.createElementVNode("div", Xr, [ vue.createElementVNode("div", Zr, [ vue.createElementVNode("h3", el, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-page-variant", class: "icon-inline" }), vue.createTextVNode(" \u9898\u5e93\u9884\u89c8 (" + vue.toDisplayString(l.value) + " \u9898)", 1) ]) ]), vue.createElementVNode("div", tl, [ vue.createElementVNode("div", nl, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": n[0] || (n[0] = e => i.value = e), class: "search-input", type: "text", placeholder: "\u641c\u7d22\u9898\u76ee...", onInput: search }, null, 544), [ [ vue.vModelText, i.value ] ]), i.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "clear-btn", onClick: n[1] || (n[1] = e => { i.value = "", search(); }) }, "\xd7")) : vue.createCommentVNode("", !0) ]), vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": n[2] || (n[2] = e => s.value = e), onChange: n[3] || (n[3] = e => o.value = 1), class: "page-size" }, sl, 544), [ [ vue.vModelSelect, s.value ] ]) ]) ]), i.value ? (vue.openBlock(), vue.createElementBlock("div", rl, [ vue.createTextVNode(" \u627e\u5230 "), vue.createElementVNode("strong", null, vue.toDisplayString(t.value.length), 1), vue.createTextVNode(" \u9053\u76f8\u5173\u9898\u76ee ") ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", ll, [ a.value ? (vue.openBlock(), vue.createElementBlock("div", cl, ul)) : 0 === p.value.length ? (vue.openBlock(), vue.createElementBlock("div", hl, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit", class: "empty-icon" }), vue.createElementVNode("p", null, vue.toDisplayString(i.value ? "\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u9898\u76ee" : "\u6682\u65e0\u9898\u76ee\u6570\u636e"), 1), i.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "btn-clear", onClick: n[4] || (n[4] = e => { i.value = "", search(); }) }, "\u6e05\u9664\u641c\u7d22")) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("div", ml, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(p.value, ((e, n) => (vue.openBlock(), vue.createElementBlock("div", { key: e.key || n, class: "question-item" }, [ vue.createElementVNode("div", fl, [ vue.createElementVNode("div", gl, [ vue.createElementVNode("span", yl, vue.toDisplayString((o.value - 1) * s.value + n + 1), 1), vue.createElementVNode("span", vl, vue.toDisplayString(vue.unref(typeConvert)(e.type ?? "", !1)), 1) ]), vue.createElementVNode("div", bl, [ vue.createElementVNode("button", { class: "btn-edit", onClick: t => (e => { d.value = e, "15" === e.type ? h.value = !0 : u.value = !0; })(e), title: "\u7f16\u8f91" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:pencil" }) ], 8, xl), vue.createElementVNode("button", { class: "btn-delete", onClick: n => (e => { t.value = t.value.filter((t => t.key !== e.key)), Cache.matchRemove(e.key); })(e), title: "\u5220\u9664" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:delete" }) ], 8, wl) ]) ]), vue.createElementVNode("div", kl, [ vue.createElementVNode("div", { class: "question-text", innerHTML: cl_img_format(e.question1 || e.question) }, null, 8, _l), e.options && e.options.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", ql, [ "15" === e.type && "object" == typeof e.options[0] ? (vue.openBlock(), vue.createElementBlock("div", Al, [ vue.createElementVNode("div", Tl, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-variant", class: "icon-inline" }), vue.createTextVNode(" \u9605\u8bfb\u7406\u89e3 (" + vue.toDisplayString(e.options.length) + " \u9898)", 1) ]), vue.createElementVNode("div", Cl, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options.slice(0, 3), ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "sub-question" }, [ vue.createElementVNode("span", Sl, vue.toDisplayString(t + 1) + ".", 1), vue.createElementVNode("span", El, "[" + vue.toDisplayString(vue.unref(typeConvert)(e.type ?? "", !1)) + "]", 1), vue.createElementVNode("div", { class: "sub-text", innerHTML: cl_img_format(e.question) }, null, 8, Il) ])))), 128)), e.options.length > 3 ? (vue.openBlock(), vue.createElementBlock("div", Ul, " \u8fd8\u6709 " + vue.toDisplayString(e.options.length - 3) + " \u4e2a\u5b50\u9898\u76ee... ", 1)) : vue.createCommentVNode("", !0) ]) ])) : "object" == typeof e.options[0] ? (vue.openBlock(), vue.createElementBlock("div", Hl, " \u26a0\ufe0f \u590d\u5408\u9898\u578b\uff0c\u70b9\u51fb\u7f16\u8f91\u67e5\u770b\u8be6\u60c5 ")) : (vue.openBlock(), vue.createElementBlock("div", Ol, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((t, n) => (vue.openBlock(), vue.createElementBlock("div", { key: n, class: vue.normalizeClass([ "option", { correct: e.answer && e.answer.includes(t) } ]) }, [ vue.createElementVNode("span", jl, vue.toDisplayString(getOptionIndex(n)) + ".", 1), vue.createElementVNode("span", { class: "option-text", innerHTML: cl_img_format(t) }, null, 8, zl), e.answer && e.answer.includes(t) ? (vue.openBlock(), vue.createElementBlock("span", Pl, "\u2713")) : vue.createCommentVNode("", !0) ], 2)))), 128)) ])) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Ll, [ Ml, Array.isArray(e.answer) ? (vue.openBlock(), vue.createElementBlock("div", $l, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.answer, ((e, t) => (vue.openBlock(), vue.createElementBlock("span", { key: t, class: "answer-item" }, vue.toDisplayString(e), 1)))), 128)) ])) : e.answer ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "answer-text", innerHTML: cl_img_format(e.answer) }, null, 8, Fl)) : (vue.openBlock(), vue.createElementBlock("span", Nl, "\u6682\u65e0\u7b54\u6848")) ]) ]) ])))), 128)) ])) ]), l.value > 0 ? (vue.openBlock(), vue.createElementBlock("div", Dl, [ vue.createElementVNode("button", { class: "page-btn", disabled: o.value <= 1, onClick: goPrev }, "\u4e0a\u4e00\u9875", 8, Rl), vue.createElementVNode("span", Bl, [ vue.createTextVNode(" \u7b2c "), vue.withDirectives(vue.createElementVNode("input", { type: "number", class: "page-input", min: 1, max: c.value || 1, "onUpdate:modelValue": n[5] || (n[5] = e => o.value = e), onChange: n[6] || (n[6] = e => handlePageChange(o.value)) }, null, 40, Gl), [ [ vue.vModelText, o.value, void 0, { number: !0 } ] ]), vue.createTextVNode(" / " + vue.toDisplayString(c.value || 1) + " \u9875 ", 1) ]), vue.createElementVNode("button", { class: "page-btn", disabled: o.value >= (c.value || 1), onClick: goNext }, "\u4e0b\u4e00\u9875", 8, Vl), vue.createElementVNode("span", Jl, "\u5171 " + vue.toDisplayString(l.value) + " \u9898", 1) ])) : vue.createCommentVNode("", !0) ]) ])), _: 1 })); } }), [ [ "__scopeId", "data-v-71cc29f1" ] ]), Wl = { class: "log-container" }, Ql = vue.createElementVNode("div", { class: "log-head" }, [ vue.createElementVNode("div", { class: "log-cell cell-time" }, "\u65f6\u95f4"), vue.createElementVNode("div", { class: "log-cell cell-content" }, "\u5185\u5bb9") ], -1), Yl = { key: 0, class: "log-empty" }, Xl = { class: "log-cell cell-time" }, Zl = vue.defineComponent({ __name: "Log", setup(e) { const t = Rt(), getColor = e => { switch (e) { case "warn": return "orange"; case "error": return "red"; case "success": return "green"; default: return "blue"; } }; return (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "wide", title: "\u8fd0\u884c\u65e5\u5fd7" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", Wl, [ Ql, vue.unref(t).logs.length ? (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(t).logs, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "log-row" }, [ vue.createElementVNode("div", Xl, vue.toDisplayString(e.time), 1), vue.createElementVNode("div", { class: "log-cell cell-content", style: vue.normalizeStyle({ color: getColor(e.type) }) }, vue.toDisplayString(e.content), 5) ])))), 128)) : (vue.openBlock(), vue.createElementBlock("div", Yl, "\u6682\u65e0\u65e5\u5fd7")) ]) ])), _: 1 })); } }), ec = { class: "ai-container" }, tc = { class: "basic-card search-card" }, nc = { class: "card-header" }, ac = { class: "card-title" }, ic = { class: "mode-switch" }, oc = [ "onClick" ], sc = { key: 0, class: "question-type-select native-select" }, rc = vue.createElementVNode("label", null, "\u9898\u578b\u9009\u62e9", -1), lc = [ "value" ], cc = vue.createElementVNode("p", { class: "helper-text" }, "\u7c98\u8d34\u9898\u5e72\u53ca\u9009\u9879\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u89e3\u6790\u5e76\u641c\u7d22\u5b98\u65b9\u9898\u5e93", -1), pc = [ "disabled" ], dc = { key: 1, class: "ai-action-row" }, uc = { key: 0, class: "basic-card result-card" }, hc = { class: "card-header" }, mc = { class: "card-title" }, fc = { class: "ai-result-actions" }, gc = { key: 1, class: "pill pill-success" }, yc = { class: "result-content" }, vc = { key: 0, class: "soft-loading" }, bc = [ "innerHTML" ], xc = { key: 2, class: "empty-block" }, wc = vue.createElementVNode("p", { class: "empty-text" }, "AI\u7b54\u9898\u4ec5\u4f9b\u53c2\u8003\uff0c\u4e0d\u4fdd\u8bc1\u51c6\u786e\u6027", -1), kc = { key: 1, class: "basic-card result-card" }, _c = { class: "card-header" }, Ac = { class: "card-title" }, Tc = { class: "result-content" }, Cc = { key: 0, class: "soft-loading" }, Sc = { key: 1, class: "soft-alert warning" }, Ec = [ "innerHTML" ], Ic = { key: 2, class: "official-meta" }, Uc = { class: "meta-row" }, Hc = vue.createElementVNode("div", { class: "meta-label" }, "\u89e3\u6790\u9898\u5e72", -1), Oc = [ "innerHTML" ], jc = { key: 0, class: "meta-row" }, zc = vue.createElementVNode("div", { class: "meta-label" }, "\u89e3\u6790\u9009\u9879", -1), Pc = { class: "meta-options" }, Lc = { class: "option-label" }, Mc = [ "innerHTML" ], $c = { key: 3, class: "official-result-list" }, Fc = { class: "official-result-header" }, Nc = { class: "official-result-title" }, Dc = vue.createElementVNode("span", { class: "official-result-subtitle" }, "\u6839\u636e\u9898\u5e72\u76f8\u4f3c\u5ea6\u6392\u5e8f", -1), Rc = { class: "pill pill-primary" }, Bc = { class: "official-section" }, Gc = vue.createElementVNode("div", { class: "section-label" }, "\u9898\u5e72", -1), Vc = [ "innerHTML" ], Jc = { key: 0, class: "official-section" }, Kc = vue.createElementVNode("div", { class: "section-label" }, "\u9009\u9879", -1), Wc = { class: "official-options" }, Qc = { class: "option-label" }, Yc = [ "innerHTML" ], Xc = { class: "official-section" }, Zc = vue.createElementVNode("div", { class: "section-label" }, "\u53c2\u8003\u7b54\u6848", -1), ep = { class: "answer-chips" }, tp = { key: 0, class: "answer-empty" }, np = { key: 4, class: "empty-block" }, ap = vue.createElementVNode("p", { class: "empty-text" }, "\u672a\u5339\u914d\u5230\u7ed3\u679c\uff0c\u8bd5\u8bd5\u4f18\u5316\u9898\u5e72\u6216\u8c03\u6574\u9898\u578b", -1), ip = { key: 5, class: "empty-block" }, op = vue.createElementVNode("p", { class: "empty-text" }, "\u8f93\u5165\u9898\u5e72\u5e76\u70b9\u51fb\u641c\u7d22\uff0c\u5373\u53ef\u5339\u914d\u5b98\u65b9\u9898\u5e93", -1), sp = { key: 2, class: "basic-card copyright-card" }, rp = { class: "card-header" }, lp = { class: "card-title" }, cp = [ "innerHTML" ], pp = vue.defineComponent({ __name: "Ai", setup(e) { const t = cn(), a = Rt(), i = un(), o = vue.ref(""), r = vue.ref("1"), l = vue.ref(""), c = [ { label: "\u5355\u9009\u9898", value: "0" }, { label: "\u591a\u9009\u9898", value: "1" }, { label: "\u586b\u7a7a\u9898", value: "2" }, { label: "\u5224\u65ad\u9898", value: "3" }, { label: "\u7b80\u7b54\u9898", value: "4" }, { label: "\u5176\u5b83/\u81ea\u52a8", value: "8" } ], p = vue.ref(c[0].value), d = vue.ref(!1), u = vue.ref([]), h = vue.ref(!1), m = vue.ref(""), g = vue.ref(!1), y = vue.ref({ question: "", options: [] }), v = vue.ref(!1), q = vue.computed((() => "1" === r.value)), U = vue.computed((() => q.value ? t.aiLoading : h.value)), z = vue.computed((() => U.value ? "\u641c\u7d22\u4e2d..." : "\u5f00\u59cb\u641c\u7d22")), M = vue.computed((() => t.selectConfig("search"))), $ = vue.computed((() => M.value ? getAiProviderPreset(M.value.providerId) : void 0)), F = vue.computed((() => { var e; const t = M.value; if (!t) return "\u5f53\u524d\u6ca1\u6709\u542f\u7528\u7684 AI \u641c\u9898\u914d\u7f6e\uff0c\u8bf7\u5148\u8fdb\u5165 AI \u8bbe\u7f6e\u542f\u7528\u4e00\u4e2a\u5e73\u53f0\u3002"; const n = (null == (e = $.value) ? void 0 : e.docUrl) || t.baseUrl; return `\u5f53\u524d\u91c7\u7528\u7684\u662f **${t.name}**\uff08${t.model}\uff09\u670d\u52a1\uff0c\u4ec5\u4f9b\u6d4b\u8bd5\u4f7f\u7528\uff0c\u4e0d\u4fdd\u8bc1\u51c6\u786e\u6027\u3002\n\n\u5982\u6709\u4fb5\u6743\uff0c\u8bf7\u8054\u7cfb\u6211\u4eec\u5220\u9664\u3002\n\n\u5e73\u53f0\u6587\u6863\uff1a[${n}](${n})`; })), N = c.reduce(((e, t) => (e[t.value] = t.label.replace("/\u81ea\u52a8", ""), e)), {}), formatAnswer = e => { if (Array.isArray(e)) return e.map((e => "string" == typeof e ? e.trim() : String(e).trim())).filter(Boolean); if ("object" == typeof e && null !== e) return Object.values(e).map((e => "string" == typeof e ? e.trim() : String(e).trim())).filter(Boolean); if ("string" == typeof e) { const t = e.replace(/[\r\n]+/g, " ").trim(); return t ? /[,\uff0c\u3001/;\uff1b\s]/.test(t) ? t.split(/[,\uff0c\u3001/;\uff1b\s]+/).map((e => e.trim())).filter(Boolean) : [ t ] : []; } return []; }; vue.watch(r, (e => { "1" === e ? (u.value = [], m.value = "", g.value = !1, y.value = { question: "", options: [] }, h.value = !1, d.value = !1, p.value = c[0].value, v.value = !1) : (l.value = `${Date.now()}-${Math.random()}`, t.resetAi()); })); const clearAiResult = () => { l.value = `${Date.now()}-${Math.random()}`, t.resetAi(); }, openAiSettings = () => { a.setActiveSettingSection("ai"), a.setPage("Base"); }, handleAiSearch = async e => { const n = `${Date.now()}-${Math.random()}`; l.value = n, t.resetAi(), t.aiLoading = !0; try { const a = await (async ({query: e, config: t, onToken: n, runScene: a = runAiScene}) => { let i = ""; const o = await a("search", t, e, { stream: (null == t ? void 0 : t.stream) ?? !0, onToken: e => { i += e, null == n || n(e); } }); return o.success ? (!i && o.text && (i = o.text, null == n || n(o.text)), { ...o, text: i || o.text }) : { ...o, displayMessage: o.displayMessage || "AI \u641c\u9898\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5" }; })({ query: e, config: M.value, onToken: e => { l.value === n && (t.aiLoading = !1, t.aiMsg += e); } }); if (l.value !== n) return; a.success ? t.aiMsg || (t.aiMsg = a.text) : t.aiMsg = a.displayMessage || "AI \u641c\u9898\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"; } catch (a) { if (l.value !== n) return; t.aiMsg = "AI \u641c\u9898\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"; } finally { l.value === n && (t.aiLoading = !1); } }, handleOfficialSearch = async e => { const t = (e => { const t = e.replace(/\r\n?/g, "\n").split("\n").map((e => e.trim())).filter(Boolean), n = [], a = []; let i = !1, o = !1; return t.forEach((e => { if (o) return; if (i && nn.test(e)) return void (o = !0); const t = e.match(tn); if (t) return i = !0, void a.push(t[2].trim()); i && a.length ? a[a.length - 1] = `${a[a.length - 1]} ${e}`.trim() : n.push(e); })), { question: cleanQuestionPrefix(n.join(" ")), options: a.filter(Boolean) }; })(e); if (t.question) { var n, a; n = t.question, a = t.options, d.value || (p.value = detectAiQuestionType(n, a)), y.value = t, g.value = !0, h.value = !0, m.value = "", v.value = !1, u.value = []; try { const {success: e, message: n, data: a, needLogin: o} = await i.fuzzySearchQuestion({ question: t.question, type: Number(p.value), options: t.options }); e ? (u.value = a, a.length || (m.value = "\u5b98\u65b9\u9898\u5e93\u6682\u672a\u6536\u5f55\u8be5\u9898\uff0c\u53ef\u5c1d\u8bd5\u8865\u5145\u9898\u5e72\u6216\u8c03\u6574\u9898\u578b"), v.value = !1) : (m.value = n, v.value = !!o || /\u767b\u5f55/.test(n), msg(n, "warning")); } catch (o) { const e = (null == o ? void 0 : o.message) || "\u5b98\u65b9\u9898\u5e93\u641c\u7d22\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"; m.value = e, v.value = /\u767b\u5f55/.test(e), msg(e, "error"); } finally { h.value = !1; } } else msg("\u8bf7\u5148\u8f93\u5165\u5b8c\u6574\u7684\u9898\u5e72\u5185\u5bb9", "warning"); }, search = async () => { const e = o.value.trim(); e ? q.value ? await handleAiSearch(e) : await handleOfficialSearch(e) : msg("\u8bf7\u8f93\u5165\u9898\u76ee\u6216\u95ee\u9898\u5185\u5bb9", "warning"); }, onQuestionTypeChange = () => { d.value = !0; }, copyAiResult = () => { t.aiMsg && (!function(e) { const t = document.createElement("input"); t.value = e, document.body.appendChild(t), t.select(), document.execCommand("Copy"), document.body.removeChild(t); }(t.aiMsg), msg("AI \u7ed3\u679c\u5df2\u590d\u5236", "success")); }, D = [ { label: "AI\u68c0\u7d22", value: "1", key: "ai" }, { label: "\u7231\u95ee\u7b54\u9898\u5e93", value: "2", key: "ask" } ]; return (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "wide", title: "AI \u641c\u9898" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", ec, [ vue.createElementVNode("div", tc, [ vue.createElementVNode("div", nc, [ vue.createElementVNode("span", ac, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:robot", class: "icon-inline" }), vue.createTextVNode(" AI\u667a\u80fd\u641c\u9898") ]) ]), vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": n[0] || (n[0] = e => o.value = e), class: "ai-textarea", placeholder: "\u8bf7\u8f93\u5165\u9898\u76ee\u6216\u95ee\u9898\uff0cAI\u5c06\u4e3a\u60a8\u63d0\u4f9b\u8be6\u7ec6\u89e3\u7b54...", rows: "6" }, null, 512), [ [ vue.vModelText, o.value ] ]), vue.createElementVNode("div", ic, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(D, (e => vue.createElementVNode("button", { key: e.value, type: "button", class: vue.normalizeClass([ "pill-btn", { active: r.value === e.value } ]), onClick: t => r.value = e.value }, vue.toDisplayString(e.label), 11, oc))), 64)) ]), "2" === r.value ? (vue.openBlock(), vue.createElementBlock("div", sc, [ rc, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": n[1] || (n[1] = e => p.value = e), onChange: onQuestionTypeChange }, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(c, (e => vue.createElementVNode("option", { key: e.value, value: e.value }, vue.toDisplayString(e.label), 9, lc))), 64)) ], 544), [ [ vue.vModelSelect, p.value ] ]), cc ])) : vue.createCommentVNode("", !0), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary full", type: "button", onClick: search, disabled: U.value }, [ vue.createElementVNode("span", null, vue.toDisplayString(z.value), 1) ], 8, pc), "1" === r.value ? (vue.openBlock(), vue.createElementBlock("div", dc, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: clearAiResult }, "\u6e05\u7a7a\u7ed3\u679c"), vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: openAiSettings }, "AI \u8bbe\u7f6e") ])) : vue.createCommentVNode("", !0) ]), "1" === r.value && (vue.unref(t).aiMsg || vue.unref(t).aiLoading) ? (vue.openBlock(), vue.createElementBlock("div", uc, [ vue.createElementVNode("div", hc, [ vue.createElementVNode("span", mc, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:lightbulb-on", class: "icon-inline" }), vue.createTextVNode(" AI\u89e3\u7b54") ]), vue.createElementVNode("div", fc, [ vue.unref(t).aiMsg ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "aah-btn aah-btn-plain", type: "button", onClick: copyAiResult }, "\u590d\u5236\u7ed3\u679c")) : vue.createCommentVNode("", !0), vue.unref(t).aiLoading ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("span", gc, "\u89e3\u7b54\u5b8c\u6210")) ]) ]), vue.createElementVNode("div", yc, [ vue.unref(t).aiLoading ? (vue.openBlock(), vue.createElementBlock("div", vc, "AI \u6b63\u5728\u751f\u6210...")) : vue.unref(t).aiMsg ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, innerHTML: vue.unref(t).currentAiMd(), class: "markdown-body" }, null, 8, bc)) : (vue.openBlock(), vue.createElementBlock("div", xc, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:robot", class: "empty-icon" }), wc ])) ]) ])) : vue.createCommentVNode("", !0), "2" === r.value ? (vue.openBlock(), vue.createElementBlock("div", kc, [ vue.createElementVNode("div", _c, [ vue.createElementVNode("span", Ac, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-page-variant", class: "icon-inline" }), vue.createTextVNode(" \u7231\u95ee\u7b54\u9898\u5e93") ]), vue.createElementVNode("span", { class: vue.normalizeClass([ "pill", u.value.length ? "pill-success" : "pill-primary" ]) }, vue.toDisplayString(u.value.length ? "\u5339\u914d\u5b8c\u6210" : "\u7b49\u5f85\u641c\u7d22"), 3) ]), vue.createElementVNode("div", Tc, [ h.value ? (vue.openBlock(), vue.createElementBlock("div", Cc, "\u641c\u7d22\u4e2d...")) : vue.createCommentVNode("", !0), m.value ? (vue.openBlock(), vue.createElementBlock("div", Sc, [ vue.createElementVNode("span", { innerHTML: m.value }, null, 8, Ec), v.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "link-btn", type: "button", onClick: n[2] || (n[2] = e => vue.unref(a).setPage("user")) }, " \u70b9\u51fb\u767b\u5f55 ")) : vue.createCommentVNode("", !0) ])) : vue.createCommentVNode("", !0), y.value.question ? (vue.openBlock(), vue.createElementBlock("div", Ic, [ vue.createElementVNode("div", Uc, [ Hc, vue.createElementVNode("div", { class: "meta-value", innerHTML: y.value.question }, null, 8, Oc) ]), y.value.options.length ? (vue.openBlock(), vue.createElementBlock("div", jc, [ zc, vue.createElementVNode("div", Pc, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(y.value.options, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: `parsed-${t}`, class: "meta-option" }, [ vue.createElementVNode("span", Lc, vue.toDisplayString(String.fromCharCode(65 + t)) + ".", 1), vue.createElementVNode("span", { class: "option-text", innerHTML: e }, null, 8, Mc) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0) ])) : vue.createCommentVNode("", !0), u.value.length ? (vue.openBlock(), vue.createElementBlock("div", $c, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(u.value, ((e, t) => { return vue.openBlock(), vue.createElementBlock("div", { key: `official-${t}`, class: "official-result-item" }, [ vue.createElementVNode("div", Fc, [ vue.createElementVNode("div", null, [ vue.createElementVNode("span", Nc, "\u5339\u914d\u9898\u76ee " + vue.toDisplayString(t + 1), 1), Dc ]), vue.createElementVNode("span", Rc, vue.toDisplayString((n = e.type, N[String(n)] || "\u5176\u5b83\u9898\u578b")), 1) ]), vue.createElementVNode("div", Bc, [ Gc, vue.createElementVNode("div", { class: "official-question", innerHTML: e.question }, null, 8, Vc) ]), e.options && e.options.length ? (vue.openBlock(), vue.createElementBlock("div", Jc, [ Kc, vue.createElementVNode("ul", Wc, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((e, n) => (vue.openBlock(), vue.createElementBlock("li", { key: `opt-${t}-${n}` }, [ vue.createElementVNode("span", Qc, vue.toDisplayString(String.fromCharCode(65 + n)) + ".", 1), vue.createElementVNode("span", { class: "option-text", innerHTML: e }, null, 8, Yc) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Xc, [ Zc, vue.createElementVNode("div", ep, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(formatAnswer(e.answer), ((e, n) => (vue.openBlock(), vue.createElementBlock("span", { key: `answer-${t}-${n}`, class: "pill pill-success" }, vue.toDisplayString(e), 1)))), 128)), formatAnswer(e.answer).length ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("span", tp, "\u6682\u65e0\u7b54\u6848\u4fe1\u606f")) ]) ]) ]); var n; })), 128)) ])) : !g.value || m.value || h.value ? m.value || h.value ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("div", ip, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-document-outline", class: "empty-icon" }), op ])) : (vue.openBlock(), vue.createElementBlock("div", np, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify", class: "empty-icon" }), ap ])) ]) ])) : vue.createCommentVNode("", !0), "1" === r.value ? (vue.openBlock(), vue.createElementBlock("div", sp, [ vue.createElementVNode("div", rp, [ vue.createElementVNode("span", lp, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information", class: "icon-inline" }), vue.createTextVNode(" \u670d\u52a1\u8bf4\u660e") ]) ]), vue.createElementVNode("div", { class: "copyright-content", innerHTML: vue.unref(markToHtml)(F.value) }, null, 8, cp) ])) : vue.createCommentVNode("", !0) ]) ])), _: 1 })); } }), dp = { class: "user-page" }, up = { key: 0, class: "user-page__login-section" }, hp = { class: "user-page__login-box" }, mp = { class: "user-page__login-header" }, fp = vue.createElementVNode("h2", null, "\u7528\u6237\u767b\u5f55", -1), gp = vue.createElementVNode("p", null, "\u767b\u5f55\u540e\u5373\u53ef\u4eab\u53d7\u4e91\u540c\u6b65\u4e0e\u4f1a\u5458\u7279\u6743", -1), yp = { class: "user-page__login-switch" }, vp = { key: 0 }, bp = { class: "form-item" }, xp = { class: "form-item" }, wp = { key: 1 }, kp = { class: "form-item" }, _p = vue.createElementVNode("p", { class: "user-page__helper" }, "\u53ef\u5728\u5b98\u7f51\u300c\u4e2a\u4eba\u4e2d\u5fc3\u300d\u5237\u65b0 API Key \u540e\u7c98\u8d34\u4f7f\u7528", -1), qp = [ "disabled" ], Ap = vue.createElementVNode("p", { class: "user-page__helper" }, "\u82e5\u5fd8\u8bb0\u5bc6\u7801\uff0c\u53ef\u5728\u5b98\u7f51\u627e\u56de\uff1b\u4e5f\u53ef\u4f7f\u7528 API Key \u5feb\u901f\u767b\u5f55", -1), Tp = { key: 1, class: "user-page__dashboard" }, Cp = { class: "user-page__header-card" }, Sp = { class: "user-page__avatar" }, Ep = [ "src" ], Ip = { class: "user-page__info-text" }, Up = { class: "user-page__username" }, Hp = { key: 0, class: "pill pill-warn" }, Op = { key: 1, class: "pill" }, jp = { class: "user-page__stats-grid" }, zp = { class: "user-page__stat-card" }, Pp = { class: "user-page__stat-icon user-page__stat-icon--coin" }, Lp = { class: "user-page__stat-content" }, Mp = vue.createElementVNode("p", { class: "user-page__stat-label" }, "\u79ef\u5206", -1), $p = { class: "user-page__stat-value" }, Fp = { class: "user-page__stat-card" }, Np = { class: "user-page__stat-icon user-page__stat-icon--course" }, Dp = { class: "user-page__stat-content" }, Rp = vue.createElementVNode("p", { class: "user-page__stat-label" }, "\u8d21\u732e\u8bfe\u7a0b", -1), Bp = { class: "user-page__stat-value" }, Gp = { class: "user-page__stat-card" }, Vp = { class: "user-page__stat-icon user-page__stat-icon--question" }, Jp = { class: "user-page__stat-content" }, Kp = vue.createElementVNode("p", { class: "user-page__stat-label" }, "\u8d21\u732e\u9898\u76ee", -1), Wp = { class: "user-page__stat-value" }, Qp = { key: 0, class: "user-page__support-card" }, Yp = vue.createElementVNode("div", { class: "user-page__support-icon" }, "\ud83c\udf81", -1), Xp = vue.createElementVNode("div", { class: "user-page__support-content" }, [ vue.createElementVNode("p", { class: "user-page__support-title" }, "\u7231\u53d1\u7535\u8ba2\u9605"), vue.createElementVNode("p", { class: "user-page__support-desc" }, "\u652f\u6301\u9879\u76ee\u6301\u7eed\u8fed\u4ee3\uff0c\u89e3\u9501\u66f4\u591a\u4f1a\u5458\u6743\u76ca") ], -1), Zp = [ "href" ], ed = vue.createElementVNode("div", { class: "user-page__tips" }, [ vue.createElementVNode("p", null, "\u5f53\u524d\u7528\u6237\u4f53\u7cfb\u4ec5\u7528\u4e8e\u9898\u5e93\u7f13\u5b58\u4e91\u540c\u6b65\uff0c\u66f4\u591a\u529f\u80fd\u5f00\u53d1\u4e2d") ], -1), td = vue.defineComponent({ __name: "User", setup(e) { const t = un(), a = vue.ref("password"), i = vue.ref({ username: "", password: "" }), o = vue.ref(""), s = vue.ref(!1), r = vue.computed((() => t.isLoggedIn)), handleLogin = async () => { s.value = !0; try { if ("password" === a.value) { if (!i.value.username || !i.value.password) return void msg("\u8bf7\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801", "warning"); const e = await t.loginByPassword(i.value.username, i.value.password); e.success ? (msg(e.message, "success"), i.value = { username: "", password: "" }) : msg(e.message, "error"); } else { if (!o.value) return void msg("\u8bf7\u8f93\u5165 API Key", "warning"); const e = await t.loginByApiKey(o.value.trim()); e.success ? (msg(e.message, "success"), o.value = "") : msg(e.message, "error"); } } finally { s.value = !1; } }, handleLogout = async () => { window.confirm("\u786e\u5b9a\u8981\u9000\u51fa\u767b\u5f55\u5417\uff1f") && (await t.logout(), msg("\u5df2\u9000\u51fa\u767b\u5f55", "success")); }, goToRegister = () => { window.open("https://www.aiask.site/user/register", "_blank"); }, goToScoreLog = () => { window.open("https://www.aiask.site/user/score-log", "_blank"); }, switchMethod = e => { a.value = e; }; return vue.onMounted((() => { r.value && t.fetchUserInfo(); })), (e, n) => (vue.openBlock(), vue.createBlock(xn, { width: "standard", title: "\u7528\u6237\u4e2d\u5fc3" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", dp, [ r.value ? (vue.openBlock(), vue.createElementBlock("div", Tp, [ vue.createElementVNode("div", Cp, [ vue.createElementVNode("div", Sp, [ vue.unref(t).avatar ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, src: vue.unref(t).avatar, alt: "avatar" }, null, 8, Ep)) : (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), { key: 1, icon: "mdi:account", class: "user-page__avatar-icon" })) ]), vue.createElementVNode("div", Ip, [ vue.createElementVNode("h2", null, vue.toDisplayString(vue.unref(t).nickname), 1), vue.createElementVNode("p", Up, "@" + vue.toDisplayString(vue.unref(t).username), 1), vue.unref(t).isVip ? (vue.openBlock(), vue.createElementBlock("span", Hp, " VIP Lv." + vue.toDisplayString(vue.unref(t).level), 1)) : (vue.openBlock(), vue.createElementBlock("span", Op, "\u666e\u901a\u7528\u6237")) ]) ]), vue.createElementVNode("div", jp, [ vue.createElementVNode("div", zp, [ vue.createElementVNode("div", Pp, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:star" }) ]), vue.createElementVNode("div", Lp, [ Mp, vue.createElementVNode("p", $p, vue.toDisplayString(vue.unref(t).score), 1) ]) ]), vue.createElementVNode("div", Fp, [ vue.createElementVNode("div", Np, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-page-variant" }) ]), vue.createElementVNode("div", Dp, [ Rp, vue.createElementVNode("p", Bp, vue.toDisplayString(vue.unref(t).stats.course_count), 1) ]) ]), vue.createElementVNode("div", Gp, [ vue.createElementVNode("div", Vp, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit" }) ]), vue.createElementVNode("div", Jp, [ Kp, vue.createElementVNode("p", Wp, vue.toDisplayString(vue.unref(t).stats.question_count), 1) ]) ]) ]), vue.unref(t).afdianUrl ? (vue.openBlock(), vue.createElementBlock("div", Qp, [ Yp, Xp, vue.createElementVNode("a", { class: "aah-btn aah-btn-primary aah-btn-small user-page__support-btn", href: vue.unref(t).afdianUrl, target: "_blank", rel: "noopener noreferrer" }, " \u524d\u5f80\u67e5\u770b ", 8, Zp) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", { class: "user-page__actions" }, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-plain aah-btn-small", type: "button", onClick: goToScoreLog }, "\u67e5\u770b\u79ef\u5206\u660e\u7ec6"), vue.createElementVNode("button", { class: "aah-btn aah-btn-danger aah-btn-small", type: "button", onClick: handleLogout }, "\u9000\u51fa\u767b\u5f55") ]) ])) : (vue.openBlock(), vue.createElementBlock("div", up, [ vue.createElementVNode("div", hp, [ vue.createElementVNode("div", mp, [ fp, gp, vue.createElementVNode("div", yp, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "aah-btn aah-btn-plain aah-btn-small", { "is-active": "password" === a.value } ]), onClick: n[0] || (n[0] = e => switchMethod("password")) }, " \u8d26\u53f7\u767b\u5f55 ", 2), vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "aah-btn aah-btn-plain aah-btn-small", { "is-active": "apikey" === a.value } ]), onClick: n[1] || (n[1] = e => switchMethod("apikey")) }, " API Key \u767b\u5f55 ", 2) ]) ]), vue.createElementVNode("form", { class: "user-page__login-form", onSubmit: vue.withModifiers(handleLogin, [ "prevent" ]) }, [ "password" === a.value ? (vue.openBlock(), vue.createElementBlock("div", vp, [ vue.createElementVNode("div", bp, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": n[2] || (n[2] = e => i.value.username = e), class: "aah-input", type: "text", placeholder: "\u8bf7\u8f93\u5165\u7528\u6237\u540d" }, null, 512), [ [ vue.vModelText, i.value.username ] ]) ]), vue.createElementVNode("div", xp, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": n[3] || (n[3] = e => i.value.password = e), class: "aah-input", type: "password", placeholder: "\u8bf7\u8f93\u5165\u5bc6\u7801", onKeyup: vue.withKeys(handleLogin, [ "enter" ]) }, null, 544), [ [ vue.vModelText, i.value.password ] ]) ]) ])) : (vue.openBlock(), vue.createElementBlock("div", wp, [ vue.createElementVNode("div", kp, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": n[4] || (n[4] = e => o.value = e), class: "aah-input", type: "text", placeholder: "\u8bf7\u8f93\u5165 API Key" }, null, 512), [ [ vue.vModelText, o.value ] ]), _p ]) ])), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary user-page__login-btn", type: "submit", disabled: s.value }, vue.toDisplayString(s.value ? "\u767b\u5f55\u4e2d..." : "\u7acb\u5373\u767b\u5f55"), 9, qp) ], 32), vue.createElementVNode("div", { class: "user-page__register-tip" }, [ vue.createTextVNode(" \u8fd8\u6ca1\u6709\u8d26\u53f7\uff1f "), vue.createElementVNode("button", { class: "link-btn", type: "button", onClick: goToRegister }, "\u524d\u5f80\u5b98\u7f51\u6ce8\u518c"), Ap ]) ]) ])), ed ]) ])), _: 1 })); } }), mk_block = (e, t = "\n\n", n) => { var a = new String(e); return a.trailing = t, a.lineNumber = n, (a = a.substr(0, 1).toUpperCase() + a.substr(1)).replace(/^([A-H]|\d+|\s+\d)[\u3001|\uff0e|\s\.|\s\uff0e|:|\uff1a]/, "$1."); }, getlineDetail = e => { for (var t = [], n = [ { key: "default", reg: /\*/ }, { key: "title", reg: /^\s*(([0-9]+\.))\s*(.*?)\s*(?:\n|$)/ }, { key: "answer", reg: /^\s*((\[|\u3010?)(\u6b63\u786e|\u53c2\u8003|\u6807\u51c6|)\u7b54\u6848(\]|\u3011|\s+|)[:\uff1a\s])\s*(.*?)\s*(?:\n|$)/ }, { key: "analysis", reg: /^\s*(((\[|\u3010?)(\u8bd5\u9898|\u7b54\u6848?|)\u89e3\u6790(\]|\u3011|\s+|))[:\uff1a\s])\s*(.*?)\s*(?:\n|$)/ }, { key: "options_A", reg: /^\s*([A])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_B", reg: /^\s*([B])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_C", reg: /^\s*([C])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_D", reg: /^\s*([D])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_E", reg: /^\s*([E])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_F", reg: /^\s*([F])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_G", reg: /^\s*([G])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "options_H", reg: /^\s*([H])(\.)\s*(.*?)\s*(?:\n|$)/ }, { key: "parent_question", reg: /\[\u6848\u4f8b\u5206\u6790\]/ }, { key: "parent_question_wanxing", reg: /\[\u5b8c\u578b\u586b\u7a7a\]/ }, { key: "parent_question_wanxing_end", reg: /\[\u5b8c\u578b\u586b\u7a7a\u7ed3\u675f\]/ }, { key: "parent_question_end", reg: /\[\u6848\u4f8b\u5206\u6790\u7ed3\u675f\]/ }, { key: "parent_question_b1", reg: /\[B1\]/ }, { key: "parent_question_b1_end", reg: /\[B1\u7ed3\u675f\]/ }, { key: "child_answer", reg: /\[\u7b54\u6848\]/ } ], a = {}, i = "default", o = 0; o < e.length; o++) { var s = e[o], r = !1; (s.match(n[1].reg) || s.match(/\[\u6848\u4f8b\u5206\u6790\]/) || s.match(/\[\u5b8c\u578b\u586b\u7a7a\]/) || s.match(/\[B1\]/)) && a.title && (t.push(a), a = {}); for (var l = 0; l < n.length; l++) { var c = n[l]; if (s.match(c.reg)) { a[i = c.key] && (a.data_err = s), a[i] = s, r = !0; break; } r = !1; } r || (a[i] = (a[i] || "") + "\n" + s); } return a.title && t.push(a), (e => { var t = !1, n = "", a = !1, i = "", o = [], s = "", r = !1; return e.forEach((function(e) { if (e.parent_question && (s = e.parent_question, r = !0, e.is_first_child = "1"), r && (a = !1, t = !1, e.is_anli = "1", e.is_anli_child = "1", e.is_wanxing_child = "", e.is_b1_child = "", e.parent_question = s), e.parent_question_end && (r = !1, s = ""), e.parent_question_wanxing && (n = e.parent_question_wanxing, t = !0, e.is_first_child = "1"), t && (r = !1, a = !1, e.is_anli_child = "", e.is_b1_child = "", e.is_wanxing_child = "1", e.title += "\u586b\u7a7a\uff08" + e.title.substr(0, e.title.length - 1) + "\uff09", e.parent_question_wanxing = n), e.parent_question_wanxing_end && (t = !1, n = ""), e.parent_question_b1) { for (var l in o = [], e) if (Object.hasOwnProperty.call(e, l)) { var c = e[l]; if (l.indexOf("options_") > -1) { var p = {}; p[l] = c, o.push(p); } } a = !0, t = !1, r = !1, e.is_first_child = "1"; } a && (r = !1, t = !1, e.is_b1_child = "1", e.is_wanxing_child = "", e.is_anli_child = "", e.parent_question_b1 = i, o.forEach((function(t) { Object.assign(e, t); }))), e.parent_question_b1_end && (a = !1, i = ""); })), e; })(t); }, nd = { title: /^\s*([0-9]+\.)/, answer: /( )*\s*(\[|\u3010?)(\u7b54\u6848|\u6b63\u786e\u7b54\u6848|\u53c2\u8003\u7b54\u6848|\u6807\u51c6\u7b54\u6848)(\]|\u3011|\s+|)[:\uff1a\s]/, analysis: /( )*\s*(\[|\u3010?)(\u8bd5\u9898|\u7b54\u6848?|)\u89e3\u6790(\]|\u3011|\s+|)[:\uff1a\s]/, options_A: /A./, options_B: /B./, options_C: /C./, options_D: /D./, options_E: /E./, options_F: /F./, options_G: /G./, options_H: /H./ }, ad = /^\s*(\u6b63\u786e|\u9519\u8bef|\u5bf9|\u9519|\u221a|\xd7|\u2713|X|x|T|F|true|TRUE|FALSE|false|YES|yes|NO|no|N|Y|n|y)\s*(?:\n|$)/i, id = [ "A", "B", "C", "D", "E", "F", "G", "H" ], calcStatus = e => { if (e.title_value && (e.title_value = e.title_value.trim()), !e.title || e.title_value || e.parent_question) if (e.data_err) e.err_text = "\u8bf7\u68c0\u67e5\u8bd5\u9898\u5185\u5bb9"; else { var t = e.title_value, n = [ "A", "B", "C", "D", "E", "F", "G", "H" ]; if (t) { if (e.qtype = "5", !e.answer_value && e.options_A && (e.title, e.title_value = e.title_value.replace(/[\(\uff08](\s*.*?)[\uff09\)]/gm, (function(t, n, a, i, o, s, r, l) { return (n = n.replace(/\s/g, "")) ? /[\u4e00-\u9fa5]|\d/.test(n.trim()) ? t : (e.answer = "\u7b54\u6848\uff1a" + n.trim().replace(/(\s|\u3001|\uff0c|,)/g, ""), e.answer_value = n.trim().replace(/(\s|\u3001|\uff0c|,)/g, ""), "( )") : t; }))), e.answer_value || (e.title, e.title_value = e.title_value.replace(e.options_A ? /^(\s*.*?)([A-Ha-h\u5bf9\u9519\u2713\u221a\xd7XxvVTFtrueTRUEFALSEfalseYESyesNOnoNYny\u6b63\u786e\u9519\u8bef,\uff0c\u3001]{1,8})$/gm : /^(\s*.*?)(\s[A-Ha-h\u5bf9\u9519\u2713\u221a\xd7XxvVTFtrueTRUEFALSEfalseYESyesNOnoNYny\u6b63\u786e\u9519\u8bef,\uff0c\u3001]{1,8})$/gm, (function(t, n, a, i, o, s, r, l) { return e.answer = "\u7b54\u6848\uff1a" + a.trim().replace(/(\u3001|\uff0c|,)/g, ""), e.answer_value = a.trim().replace(/(\u3001|\uff0c|,)/g, ""), n; }))), !e.answer_value) { for (var a = [], i = 0; i < n.length; i++) { var o = n[i]; e["options_" + o] && e["options_" + o].match(/[\(\uff08](\s*[\(\u5bf9\)\(\u6b63\u786e\)\(\u7b54\u6848\)\(\u6b63\u786e\u7b54\u6848\)]+\s*)[\uff09\)]/) && (a.push(o), e["options_" + o + "_value"] = e["options_" + o + "_value"].replace(/[\(\uff08](\s*[\(\u5bf9\)\(\u6b63\u786e\)\(\u7b54\u6848\)\(\u6b63\u786e\u7b54\u6848\)]+\s*)[\uff09\)]/, (function(e, t, n, a, i) { return ""; }))); } a.length > 0 && (e.answer_value = a.join("")); } if (!e.answer_value && !e.options_A && t.match(/[\(\uff08](.+?)[\uff09\)]/gm)) { var s = "", r = e.title_value.match(/[\(\uff08](.+?)[\uff09\)]/gm); r && r.forEach((function(e, t) { var n = e.match(/[\(\uff08](.+?)[\uff09\)]/); "" != n[1].trim() && (n[1] = n[1].trim(), s += n[1] + (t == r.length - 1 ? "" : "|")); })), e.answer_value = s, e.answer = "\u7b54\u6848\uff1a" + s, e.qtype = "4", e.title_value = e.title_value.replace(/[\(\uff08](.+?)[\uff09\)]/gm, (function() { return "\uff08\u3000\u3000\u3000\uff09"; })); } e.answer_value && (e.answer_value = e.answer_value.trim()), e.title_no = e.title.match(nd.title)[1], t.match(/([\(|\uff08]\s*[\)|\uff09])/g) && (e.qtype = "4"), t.match(/(___)/g) && (e.qtype = "4"); for (var l = !1, c = [], p = 0; p < n.length; p++) { var d = n[p]; e["options_" + d] && (l = !0, c.push(e["options_" + d])); } if (l && e.answer_value && (e.answer_value = e.answer_value.replace(/\uff0c|\.|,|\u3002|\uff1b|\s+|\u3001|\//g, "")), !l && ad.test(e.answer_value) && (e.qtype = "3"), l || ad.test(e.answer_value) || e.qtype || (e.qtype = "5"), l && e.answer_value && "1" == e.answer_value.length && (e.qtype = "1"), l && e.answer_value && e.answer_value.length > 1 && (e.qtype = "2"), l && !e.answer_value && (e.qtype = "1"), l && e.answer_value) { if (e.answer_value = e.answer_value.replace(/\uff0c|\.|,|\u3002|\uff1b|\s+|\u3001|\//g, ""), !/^[A-Ha-h]{1,8}$/g.test(e.answer_value)) return void (e.err_text = "\u7b54\u6848\u4e0d\u6b63\u786e"); if (new Set(e.answer_value).size != e.answer_value.length) return void (e.err_text = "\u7b54\u6848\u5305\u542b\u91cd\u590d\u9879"); var u = e.answer_value.split("").sort(), h = id.indexOf(u[u.length - 1].toUpperCase()); if (-1 == h) return void (e.err_text = "\u7b54\u6848\u4e0d\u6b63\u786e"); for (var m = 0; m < h + 1; m++) if (!e["options_" + n[m]]) return void (e.err_text = "\u7b54\u6848\u4e0d\u5728\u9009\u9879\u4e2d"); } if (e.title_value) if (e.title_value.length < 2) e.err_text = "\u9898\u5e72\u81f3\u5c11\u4e24\u4e2a\u5b57"; else if (e.answer_value) { if ([ "1", "2", "14", "15" ].indexOf(e.qtype) > -1) { var f = []; if (id.forEach((function(t) { e["options_" + t + "_value"] && f.push(t); })), f.length < 2) return void (e.err_text = "\u9009\u9879\u81f3\u5c11\u6709\u4e24\u4e2a"); f.sort(); var g = id[f.length - 1], y = f.indexOf(g); if (f.length != y + 1) return void (e.err_text = "\u8bf7\u68c0\u67e5\u9009\u9879\u5185\u5bb9"); } if ("4" == e.qtype && e.answer_value) { var v = e.title_value.match(/([\(|\uff08]\s*[\)|\uff09])/g), b = e.answer_value.replace(/\s/g, "").split("|").length; if (v && v.length != b) return void (e.err_text = "\u7b54\u6848\u548c\u7a7a\u6570\u91cf\u4e0d\u5339\u914d"); } "3" == e.qtype && e.answer_value && /\n/.test(e.answer_value) ? e.err_text = "\u5224\u65ad\u9898\u7b54\u6848\u4e0d\u6b63\u786e" : (e.title_value.indexOf("[\u8ba1\u7b97\u9898]") > -1 && (e.qtype = 12), e.title_value.indexOf("[\u8bba\u8ff0\u9898]") > -1 && (e.qtype = 11), e.title_value.indexOf("[\u4e0d\u5b9a\u9879\u9009\u62e9\u9898]") > -1 && (e.qtype = 14), e.title_value.indexOf("[\u5224\u65ad\u9898]") > -1 && (e.qtype = 3), e.title_value.indexOf("[\u586b\u7a7a\u9898]") > -1 && (e.qtype = 4)); } else e.err_text = "\u8bd5\u9898\u6ca1\u6709\u7b54\u6848"; else e.err_text = "\u8bd5\u9898\u6ca1\u6709\u9898\u5e72"; } } else e.err_text = e.title + "\u9898\u5e72\u4e0d\u6b63\u786e"; }, od = { 1: "\u5355\u9009\u9898", 2: "\u591a\u9009\u9898", 3: "\u5224\u65ad\u9898", 4: "\u586b\u7a7a\u9898", 5: "\u7b80\u7b54\u9898", 9: "\u6848\u4f8b\u9898", 11: "\u8bba\u8ff0\u9898", 12: "\u8ba1\u7b97\u9898", 14: "\u4e0d\u5b9a\u9879\u9009\u62e9\u9898", 15: "\u6392\u5e8f\u9898" }, questionParse = e => { const t = (e => { e = (e = e.replace(/(\r\n|\n|\r)/g, "\n").replace(/\*/g, "∗").replace(//g, "").replace(/<\/span>/g, "").replace(/(\u0020)|(\u0009)|(\u200B)|(\u00A0)|(\u200E)|(\u200F)|(\u2029)/g, " ")).replace(/(\s)+([A-H])([\u3001\uff0c,\uff0e]|\.)/gi, "\n$2$3"); var t, n = /([\s\S]+?)($|\n#|\n(?:\s*\n|$)*)/g, a = []; for (null != (t = /^(\s*\n)/.exec(e)) && (n.lastIndex = t[0].length); null !== (t = n.exec(e)); ) "\n#" == t[2] && (t[2] = "\n", n.lastIndex--), a.push(mk_block(t[1], t[2], 1)); return a; })(e), n = (e => { e.length; for (var t = {}, n = 0; n < e.length; n++) { var a = e[n]; for (var i in a) if (Object.hasOwnProperty.call(a, i)) { var o = a[i]; o = o.replace(nd[i], ""), a[i + "_value"] = o.replace("[\u6848\u4f8b\u5206\u6790]", ""); } calcStatus(a), t["".concat(a.qtype)] ? t["".concat(a.qtype)]++ : t["".concat(a.qtype)] = 1, a.err_text; } return e; })(getlineDetail(t)); return n.forEach((e => { e.qtype = od[e.qtype] || "\u5176\u4ed6"; })), JSON.parse(JSON.stringify(n)); }, sd = { class: "question-tool" }, rd = vue.createElementVNode("div", { class: "info-banner" }, [ vue.createElementVNode("div", { class: "info-title" }, "\u9898\u5e93\u5bfc\u5165\u8bf4\u660e"), vue.createElementVNode("div", { class: "info-body" }, " \u9898\u5e93\u5bfc\u5165\u540e\u53ef\u5728\u672c\u5730\u7f13\u5b58\u4e2d\u5339\u914d\u641c\u7d22\uff0c\u8bf7\u786e\u4fdd\u9898\u5e93\u4e0e\u7b54\u9898\u4e00\u81f4\uff0c\u5426\u5219\u65e0\u6cd5\u5339\u914d\u3002 ") ], -1), ld = { class: "qt-grid" }, cd = { class: "qt-editor" }, pd = { class: "qt-preview" }, dd = { class: "import_question" }, ud = { key: 0, class: "qt-empty" }, hd = { class: "qt-card-head" }, md = { class: "qt-title-no" }, fd = { class: "qt-tag danger" }, gd = { class: "qt-question" }, yd = vue.createElementVNode("span", { class: "label" }, "\u9898\u76ee:", -1), vd = { class: "qt-options" }, bd = { key: 0, class: "qt-answer" }, xd = vue.createElementVNode("span", { class: "label" }, "\u7b54\u6848:", -1), wd = { key: 1, class: "qt-error" }, kd = vue.defineComponent({ __name: "QuestionTool", setup(e) { vue.ref(Cache.matchGet("ques1_") || []); const t = vue.ref([]), a = vue.ref(""), handleKeydown = () => { t.value = questionParse(a.value); }, extractOptions = e => { const t = []; for (let n = 0; n < 10; n++) { const a = `options_${String.fromCharCode(65 + n)}_value`; e[a] && t.push({ label: e[a], value: String.fromCharCode(65 + n), isTrue: e.answer_value && e.answer_value.includes(String.fromCharCode(65 + n)) }); } return t; }, importQuestion = () => { const e = t.value.filter((e => !e.err_text)).map((e => { const t = typeConvert(e.qtype), n = extractOptions(e), a = { type: t, question: titleClean(removeHtml(e.title_value)), options: n.map((e => removeHtml(e.label))), answer: e.answer_value }; switch (t) { case "0": case "1": a.answer = n.filter((e => e.isTrue)).map((e => removeHtml(e.label))), 2 === a.options.length && 0 !== judgeAnswer(a.answer).length && (a.type = "3", a.answer = judgeAnswer(a.answer), a.options = []); break; case "3": a.answer = judgeAnswer(e.answer_value); break; case "2": a.answer = e.answer_value.split("|").map((e => removeHtml(e))); } return a; })).filter((e => e.answer)); e.forEach((e => { Answer.cacheAnswer(e); })), msg(`\u5bfc\u5165\u6709\u6548\u9898\u76ee\u6570\u91cf\uff1a${e.length}\u9898`, "success"); }; return (e, n) => (vue.openBlock(), vue.createElementBlock("div", sd, [ rd, vue.createElementVNode("div", { class: "qt-actions" }, [ vue.createElementVNode("button", { class: "btn btn-primary", type: "button", onClick: importQuestion }, "\u5bfc\u5165\u7f13\u5b58") ]), vue.createElementVNode("div", ld, [ vue.createElementVNode("div", cd, [ vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": n[0] || (n[0] = e => a.value = e), class: "qt-textarea", placeholder: "1. \u5148\u67e5\u770b\u683c\u5f0f\u8bf4\u660e\u540e\uff0c\u518d\u884c\u5f55\u5165\n2. \u652f\u6301\u9898\u578b\uff1a\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u3001\u586b\u7a7a\u3001\u7b80\u7b54\n3. \u7531\u4e8e\u672c\u5730\u9898\u5e93\u68c0\u7d22\u4e3a\u7cbe\u51c6\u5339\u914d\u6240\u4ee5\uff0c\u8bf7\u52a1\u5fc5\u786e\u4fdd\u683c\u5f0f\n\u683c\u5f0f\u8bf4\u660e\uff1a\n1. \u8bd5\u9898\u9700\u8981\u6709\u5e8f\u53f7\uff0c\u652f\u6301\uff1a1. \u62161\u3001\n2. \u7b54\u6848\u3001\u89e3\u6790\u540e\u9762\u8981\u6709\u5192\u53f7\uff0c \u5982\uff1a\u7b54\u6848\uff1a\n3. \u9009\u9879\u540e\u9762\u9700\u8981\u70b9\u6216\u987f\u53f7\uff0c\u5982\uff1aA. \u6216A\u3001\n4. \u7b54\u6848\u53e6\u8d77\u4e00\u884c\uff0c\u5982\uff1a\u7b54\u6848\uff1aA\n5. \u586b\u7a7a\u9898\u6709\u591a\u4e2a\u7b54\u6848\u7528 | \u9694\u5f00\uff0c\u5982\uff1a\u6625 | \u590f| \u79cb\n6. \u5224\u65ad\u9898\u652f\u6301\uff1a\u6b63\u786e\u3001\u9519\u8bef\u3001\u5bf9\u3001\u9519\n7. \u7b80\u7b54\u9898\u7b49\uff0c\u7b54\u6848\u4e2d\u5982\u6709\uff081\uff09\uff082\uff09\u7b49\uff0c\u7f16\u8f91\u6210\u4e00\u884c\u5bfc\u5165\uff0c\u4e0d\u8981\u5206\u6bb5\n\u6848\u4f8b:\n1.\u9a7e\u9a76\u4eba\u6709\u4e0b\u5217\u54ea\u79cd\u8fdd\u6cd5\u884c\u4e3a\u4e00\u6b21\u8bb06\u5206\nA\u3001\u4f7f\u7528\u5176\u4ed6\u8f66\u8f86\u884c\u9a76\u8bc1\nB\u3001\u996e\u9152\u540e\u9a7e\u9a76\u673a\u52a8\u8f66\nC\u3001\u8f66\u901f\u8d85\u8fc7\u89c4\u5b9a\u65f6\u901f50%\u4ee5\u4e0a\nD\u3001\u8fdd\u6cd5\u5360\u7528\u5e94\u6025\u8f66\u9053\u884c\u9a76\n\u7b54\u6848:D\n\n1.\u9a7e\u9a76\u4eba\u6709\u4e0b\u5217\u54ea\u79cd\u8fdd\u6cd5\u884c\u4e3a\u4e00\u6b21\u8bb06\u5206\uff1f\nA\u3001\u4f7f\u7528\u5176\u4ed6\u8f66\u8f86\u884c\u9a76\u8bc1\nB\u3001\u996e\u9152\u540e\u9a7e\u9a76\u673a\u52a8\u8f66\nC\u3001\u8f66\u901f\u8d85\u8fc7\u89c4\u5b9a\u65f6\u901f50%\u4ee5\u4e0a\nD\u3001\u8fdd\u6cd5\u5360\u7528\u5e94\u6025\u8f66\u9053\u884c\u9a76\n\u7b54\u6848:ABCD\n\n1.\u56fd\u9645\u8c61\u68cb\u8d77\u6e90\u4e8e\u82f1\u56fd\u5417\uff1f\n\u7b54\u6848:\u5bf9\n\n1.\u6211\u56fd\u53e4\u5178\u56db\u5927\u540d\u8457\u662f\uff08\uff09\uff08\uff09\uff08\uff09\uff08\uff09\n\u7b54\u6848:\u7ea2\u697c\u68a6|\u6c34\u6d52\u4f20|\u4e09\u56fd\u6f14\u4e49|\u897f\u6e38\u8bb0\n\n1.\u5982\u4f55\u4fdd\u6301\u8eab\u4f53\u5065\u5eb7\uff1f\n\u7b54\u6848:\u89c4\u5f8b\u996e\u98df\u3001\u575a\u6301\u953b\u70bc\uff0c\u65e9\u7761\u65e9\u8d77\uff0c\u5b9a\u671f\u4f53\u68c0\u3002", onInput: handleKeydown, rows: "24" }, null, 544), [ [ vue.vModelText, a.value ] ]) ]), vue.createElementVNode("div", pd, [ vue.createElementVNode("div", dd, [ 0 === t.value.length ? (vue.openBlock(), vue.createElementBlock("div", ud, "\u8f93\u5165\u9898\u76ee\u540e\u5c06\u81ea\u52a8\u89e3\u6790\u5e76\u9884\u89c8")) : vue.createCommentVNode("", !0), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(t.value, (e => (vue.openBlock(), vue.createElementBlock("div", { key: e.title_no, class: vue.normalizeClass([ "qt-card", { "qt-card-error": e.err_text } ]) }, [ vue.createElementVNode("div", hd, [ vue.createElementVNode("span", md, vue.toDisplayString(e.title_no), 1), vue.createElementVNode("span", fd, vue.toDisplayString(e.qtype), 1) ]), vue.createElementVNode("p", gd, [ yd, vue.createTextVNode(vue.toDisplayString(e.title_value), 1) ]), vue.createElementVNode("div", vd, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(extractOptions(e), (e => (vue.openBlock(), vue.createElementBlock("span", { key: e.label, class: vue.normalizeClass([ "qt-tag", { success: e.isTrue } ]) }, vue.toDisplayString(e.label), 3)))), 128)) ]), e.answer_value ? (vue.openBlock(), vue.createElementBlock("p", bd, [ xd, vue.createTextVNode(vue.toDisplayString(e.answer_value), 1) ])) : vue.createCommentVNode("", !0), e.err_text ? (vue.openBlock(), vue.createElementBlock("div", wd, [ vue.createElementVNode("p", null, vue.toDisplayString(e.err_text), 1) ])) : vue.createCommentVNode("", !0) ], 2)))), 128)) ]) ]) ]) ])); } }), _d = { class: "el_wrapper", style: { "z-index": "9999999 !important" } }, qd = { class: "floating-wrapper" }, Ad = { class: "floating-title" }, Td = [ "src" ], Cd = { class: "floating-version" }, Sd = { class: "floating-actions" }, Ed = { class: "floating-body" }, Id = { class: "floating-scroll custom-scroll" }, Ud = { key: 0, class: "aah_breadcrumb" }, Hd = { class: "breadcrumb" }, Od = vue.createElementVNode("span", { class: "breadcrumb-sep" }, "/", -1), jd = { class: "breadcrumb-text" }, zd = { class: "mini-tooltip-wrapper" }, Pd = [ "src" ], Ld = { key: 0, class: "mini-tooltip" }, Md = vue.defineComponent({ __name: "App", setup(e) { const t = Rt(), a = pn(), i = Vt(), o = un(), l = cn(); l.mergeLegacyCredentials(t.app), t.setConfig(createLegacyAppAiConfig(l.settings)), t.app.showFloat = t.app.defaultShowFloat; const c = vue.ref(null), p = vue.reactive({ dragging: !1, offsetX: 0, offsetY: 0 }), d = vue.reactive({ top: "15vh", left: "50%", useTransform: !0 }); ce[Mt + "app"] = t, ce[Mt + "ask"] = a, ce[Mt + "api"] = i, ce[Mt + "user"] = o, ce[Mt + "ai"] = l; const showOrHide = () => { t.app.showFloat = !t.app.showFloat; }; document.onkeydown = function(e) { if (!t.app.hotkeyEnabled) return; const n = (e => { const t = e.split("+"); return { ctrl: t.includes("Ctrl"), shift: t.includes("Shift"), alt: t.includes("Alt"), key: t[t.length - 1] }; })(t.app.hotkey), a = "ArrowUp" === (i = n.key) ? "ArrowUp" : 1 === i.length ? "Key" + i.toUpperCase() : i; var i; e.ctrlKey === n.ctrl && e.shiftKey === n.shift && e.altKey === n.alt && e.code === a && (e.preventDefault(), t.app.showFloat = !t.app.showFloat); }, "c0400763e1c557daa3e02d0bcb13ae6a" !== ksv && (() => { const e = document.createElement("a"); e.href = location.href, e.style.display = "none", document.body.appendChild(e), e.click(); })(); const u = vue.computed((() => { return { width: (e = t.pageWidth, { standard: "clamp(320px, 90vw, 400px)", wide: "clamp(320px, 90vw, 820px)", full: "clamp(320px, 95vw, 1200px)" }[e]), top: d.top, left: d.left, transform: d.useTransform ? "translateX(-50%)" : "none", transition: "width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1)" }; var e; })), handleDragMove = e => { if (!p.dragging || !c.value) return; const t = c.value, {clientX: n, clientY: a} = e, i = t.offsetWidth, o = t.offsetHeight, s = window.innerWidth - i, r = window.innerHeight - o; let l = n - p.offsetX, u = a - p.offsetY; l = Math.min(Math.max(0, l), Math.max(0, s)), u = Math.min(Math.max(0, u), Math.max(0, r)), d.left = `${l}px`, d.top = `${u}px`, d.useTransform = !1; }, stopDrag = () => { p.dragging && (p.dragging = !1, window.removeEventListener("pointermove", handleDragMove), window.removeEventListener("pointerup", stopDrag)); }, startDrag = e => { if ((e => { if (!(e instanceof HTMLElement)) return !1; const t = e.tagName; return [ "BUTTON", "A", "INPUT", "TEXTAREA", "SELECT", "OPTION" ].includes(t) || !!e.closest(".floating-btn"); })(e.target)) return; if (!c.value) return; e.preventDefault(); const t = c.value.getBoundingClientRect(); d.useTransform && (d.left = `${t.left}px`, d.top = `${t.top}px`), p.dragging = !0, p.offsetX = e.clientX - t.left, p.offsetY = e.clientY - t.top, d.useTransform = !1, window.addEventListener("pointermove", handleDragMove), window.addEventListener("pointerup", stopDrag); }; return vue.watch((() => t.app.showFloat), (e => { e ? (d.top = "15vh", d.left = "50%", d.useTransform = !0) : stopDrag(); })), vue.onBeforeUnmount((() => { window.removeEventListener("pointermove", handleDragMove), window.removeEventListener("pointerup", stopDrag); })), updateFn(), (e, n) => (vue.openBlock(), vue.createElementBlock("div", _d, [ vue.withDirectives(vue.createElementVNode("div", qd, [ vue.createElementVNode("div", { class: "floating-dialog", style: vue.normalizeStyle(u.value), ref_key: "floatRef", ref: c }, [ vue.createElementVNode("div", { class: "floating-header", onPointerdown: startDrag }, [ vue.createElementVNode("div", Ad, [ vue.createElementVNode("img", { src: vue.unref($t).script.icon, alt: "icon" }, null, 8, Td), vue.createElementVNode("span", null, vue.toDisplayString(vue.unref($t).script.name), 1), vue.createElementVNode("span", Cd, "v" + vue.toDisplayString(vue.unref($t).script.version), 1) ]), vue.createElementVNode("div", Sd, [ "home" != vue.unref(t).page ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "floating-btn floating-btn-plain floating-btn-small", onClick: n[0] || (n[0] = e => vue.unref(t).setPage("home")), type: "button" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:arrow-left", class: "icon-inline" }), vue.createTextVNode(" \u8fd4\u56de\u9996\u9875 ") ])) : vue.createCommentVNode("", !0), vue.createElementVNode("button", { class: "floating-close", "aria-label": "\u5173\u95ed", onClick: n[1] || (n[1] = e => vue.unref(t).app.showFloat = !1), type: "button" }, "\xd7") ]) ], 32), vue.createElementVNode("div", Ed, [ vue.createElementVNode("div", Id, [ "home" != vue.unref(t).page ? (vue.openBlock(), vue.createElementBlock("div", Ud, [ vue.createElementVNode("div", Hd, [ vue.createElementVNode("a", { onClick: n[2] || (n[2] = e => vue.unref(t).setPage("home")), class: "breadcrumb-link" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:home", class: "icon-inline" }), vue.createTextVNode(" \u9996\u9875 ") ]), Od, vue.createElementVNode("span", jd, vue.toDisplayString(vue.unref(t).page), 1) ]) ])) : vue.createCommentVNode("", !0), "home" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(Vn, { key: 1 })) : "user" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(td, { key: 2 })) : "Base" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(mi, { key: 3 })) : "ask" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(ts, { key: 4 })) : "question" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(Ys, { key: 5 })) : "preview" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(Kl, { key: 6 })) : "questionTool" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(kd, { key: 7 })) : "log" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(Zl, { key: 8 })) : "ai" == vue.unref(t).page ? (vue.openBlock(), vue.createBlock(pp, { key: 9 })) : vue.createCommentVNode("", !0) ]) ]) ], 4) ], 512), [ [ vue.vShow, vue.unref(t).app.showFloat ] ]), vue.withDirectives(vue.createElementVNode("div", { class: "minimized-dialog", onClick: showOrHide }, [ vue.createElementVNode("div", { onClick: showOrHide }, [ vue.createElementVNode("div", zd, [ vue.createElementVNode("img", { src: vue.unref("data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20xmlns='http://www.w3.org/2000/svg'%20width='200'%20height='200'%3e%3cpath%20d='m253.36%201024-115.278-58.836v-53.206c-64.889-68.266-62.918-94.729%2014.075-153.424-23.506-17.594-63.762%202.675-77.275-36.315%2047.435-42.93%2070.378-101.063%2087.973-162.01a326.695%20326.695%200%200%201%20208.037-226.617c4.645-89.38%2086.847-143.43%20178.479-112.605l-35.612%2090.365c105.145%207.32%20192.414%2045.042%20256.317%20123.303%2040.538%2015.483%2038.849-34.767%2069.252-40.82l11.964%2058.273%2050.391-27.306c28.151%2018.72-5.208%2031.951-10.416%2052.22%2014.78%2020.128%2028.996%2040.538%2044.479%2060.244a142.867%20142.867%200%200%201%2028.996%20114.153c-12.528%2077.838-30.263%20154.831-41.101%20233.092A1276.939%201276.939%200%200%200%20918.433%201024H897.32l-89.24-70.378%209.994-10.416-17.735%2036.878-68.408-20.128-39.411%2023.788-42.227-21.114c-28.151%2014.076-52.502%2036.034-86.565%2027.307l-9.009-37.863H332.747L306.144%201024zm-9.993-380.041-.844.985%20126.68%2019.706%2010.838%2010.979c-29.277%2032.374-19.846%2074.178-29.7%20110.493l34.064%2030.263-35.19%2094.87a412.274%20412.274%200%200%200%20233.515%202.11l9.712-26.602%2012.809%2015.905-11.824%2050.672%205.35%204.645c16.749-11.682%2033.218-24.21%2050.812-34.626a84.454%2084.454%200%200%201%2026.04-5.348l7.46%2033.922%2048.842-23.788%2052.925%2014.076c-1.83-43.212-2.956-80.935-5.912-118.517%200-4.926-9.853-9.29-15.061-14.075l-5.63-23.225%2014.075-100.922h18.72l3.238-1.267c-11.964%20106.412%208.023%20202.266%2087.128%20281.512%208.727-48.842%2016.61-93.321%2024.632-137.66%207.46-40.96%2015.061-81.92%2022.521-122.88%2010.557-48.42%2025.477-97.262-10.979-140.755l-30.825%2038.004c0-16.469%201.126-33.078%201.126-49.546%200-70.378-53.206-104.723-115.983-76.29a232.951%20232.951%200%200%201-32.937%209.43c16.046-32.373-3.519-52.924-25.477-70.377a292.21%20292.21%200%200%200-209.304-70.378c-11.401.703-22.802%200-40.256%200l45.183-104.582c-40.397%2010.979-74.038%2014.78-94.73%2045.464s14.92%2045.886%2020.833%2069.674c-110.212%204.364-202.69%2080.513-236.611%20193.117l-70.378%20172.708%2049.124%203.519%205.63%2054.191c32.514-26.04%2026.04-61.088%2030.262-92.899h17.876v58.414l30.967%206.334c1.407-6.616%202.393-11.683%203.66-16.469%209.148-34.626-19.706-59.117-22.38-91.491zm-37.863%20178.9-6.475%2020.833-25.336%2084.453c1.548%208.868%200%2023.225%205.067%2025.477%2032.374%2016.046%2065.733%2029.277%20104.16%2045.746%2021.113-65.452%2063.621-114.435%2069.533-180.872-37.3-16.187-70.941-31.53-104.722-44.338-17.032-6.756-36.315-10.979-35.049%2019.002zm121.754-38.848%2010.556-90.225-48.138-6.193v78.964zm-168.907%2096.98%2023.084-73.474c-28.152-10.416-47.576-9.29-56.303%2015.483s2.674%2042.79%2032.937%2057.992z'%20fill='%23353947'/%3e%3cpath%20d='M198.607%20548.948c33.922-112.604%20126.68-188.472%20235.907-192.272-5.912-23.788-41.1-39.553-20.832-69.674s54.332-34.486%2094.729-45.465L463.228%20346.12h40.256a292.21%20292.21%200%200%201%20209.304%2070.378c21.958%2017.735%2042.227%2038.286%2025.477%2070.378l.986-.985c-30.967%2026.743-32.797%2059.399-19.847%2095.15L744.599%20622l-40.819-6.192-103.174-14.076-62.214-93.04-31.67%2050.672c-19.425-5.63-26.603.845-20.691%2020.692l-21.536-.845a165.67%20165.67%200%200%200-100.078-17.172l-10.416-86.565-37.44%2031.248-44.339%2042.226zm255.19-62.917-10.556-10.557c-17.173-17.032-35.049-15.061-47.294%203.378s-4.786%2036.737%2012.105%2050.25c20.128%2016.046%2034.907%209.712%2045.745-11.542%2014.217-10.838%2015.202-21.395%200-31.811z'%20fill='%23F5F5F6'%20data-spm-anchor-id='a313x.search_index.0.i5.dc0f3a810XA6r8'%20class='selected'/%3e%3cpath%20d='m592.442%20886.763-9.712%2026.603a412.274%20412.274%200%200%201-233.514-2.112l35.189-94.87-34.063-30.543c9.853-36.315%200-78.12%2029.7-110.494a198.184%20198.184%200%200%200%20105.425-94.87c16.328%202.394%2026.04-1.688%2020.692-20.69l31.67-4.927%2063.058%2078.542c0%207.882-1.97%2018.017%201.971%2023.084%2030.966%2038.708%2023.788%2080.935%2014.076%20123.865-8.587%2036.034-16.469%2071.364-24.492%20106.412zm-149.624-223.24c0%2014.076-2.815%2023.648%200%2026.885%2020.27%2020.691%2020.832%2045.605%2019.566%2071.927a96.84%2096.84%200%200%200%203.237%2031.107c5.912%2020.41%2012.668%2041.382%2038.426%2044.056a48.56%2048.56%200%200%200%2053.347-35.189%20696.602%20696.602%200%200%200%2018.58-80.371c6.052-6.475%2035.47-2.534%2018.157-36.597z'%20fill='%23F5F5F6'/%3e%3cpath%20d='M600.606%20602.013%20703.78%20616.09l40.82%205.349c37.863%209.993%2022.943%2041.241%2026.461%2065.17L756.986%20787.53l-49.828%2078.12-21.395%2031.529-10.134%2021.395a84.454%2084.454%200%200%200-26.04%205.348c-17.594%2010.416-34.063%2022.944-50.813%2034.626v-5.208h-5.067l11.823-50.672c16.047-61.932%2032.937-123.724%2047.717-185.938%205.348-22.662-25.477-68.267-51.94-82.624zM927.3%20706.736c-7.46%2040.96-15.061%2081.92-22.521%20122.88-8.023%2044.338-15.906%2088.817-24.633%20137.66-79.105-79.387-98.529-175.242-87.128-281.513z'%20fill='%23B3DCF8'/%3e%3cpath%20d='m199.029%20843.692%206.475-20.832h45.605c2.111-39.271-20.973-30.263-38.427-30.122-1.548-29.981%2018.017-25.758%2035.049-18.58%2034.063%2013.231%2067.422%2028.151%20104.722%2044.479-5.912%2066.437-48.42%20115.42-69.533%20180.871-38.427-16.186-71.927-29.418-104.16-45.182-4.786-2.252-3.519-16.61-5.067-25.477h33.5l26.321-70.378z'%20fill='%2387BC85'/%3e%3cpath%20d='M738.265%20486.03a232.951%20232.951%200%200%200%2032.937-9.43c62.777-28.151%20116.405%206.615%20115.983%2076.29%200%2016.468-.704%2033.077-1.126%2049.546l1.126-.986-12.105-2.674-21.536%2016.75-29.98%208.305a86.565%2086.565%200%200%201-91.633-59.259c2.393-26.462%204.645-52.924%207.038-79.527zm113.731%2061.792-61.37-52.502c-3.94%2035.752-6.615%2059.822-10.275%2093.18z'%20fill='%23F5F5F6'%20data-spm-anchor-id='a313x.search_index.0.i3.dc0f3a810XA6r8'/%3e%3cpath%20d='M198.607%20548.948h73.615c-28.151%2042.227-74.178%2076.853-59.117%20137.66-4.223%2031.81%202.252%2066.859-30.263%2092.899l-6.052-54.473-49.124-3.519z'%20fill='%23AED4EF'/%3e%3cpath%20d='m927.3%20706.736-134.28-21.113-3.238%201.266%206.897-37.863%2027.025-7.742%2031.248-8.867%2029.84-20.691%202.393-10.276-.422.986%2030.262-36.738c35.752%2043.776%2020.832%2092.618%2010.276%20141.038zm-557.675-42.79-126.68-19.706a171.3%20171.3%200%200%201%2016.75-41.1c21.817-29.278%2046.168-56.303%2069.533-84.454%203.238%209.15%206.757%2018.157%209.572%2027.307q15.624%2049.123%2030.966%2098.529z'%20fill='%23F5F5F6'/%3e%3cpath%20d='M763.18%20810.473c5.207%204.645%2014.075%209.009%2015.06%2014.076%202.956%2037.582%204.082%2075.304%205.912%20118.516l-52.925-14.075-47.997%2023.787-7.601-34.766c14.075-1.97%2020.55-7.883%2010.979-21.817%2021.395%2011.682%2023.788-9.994%2033.359-19.003z'%20fill='%23AED4EF'/%3e%3cpath%20d='M601.169%20634.106c26.462%2014.075%2057.288%2059.962%2051.939%2082.624-14.076%2062.214-31.67%20124.006-47.716%20185.938l-12.95-15.905c8.023-35.33%2015.905-70.378%2024.35-105.99%2010.135-42.93%2017.314-85.157-14.075-123.865-3.519-4.785-.985-14.92-1.548-22.802zM328.806%20518.404c-23.365%2028.152-47.716%2055.458-69.533%2084.454a171.3%20171.3%200%200%200-16.75%2041.1l.844-.985-12.386%2043.072h-17.876c-15.061-60.385%2030.403-94.87%2059.117-137.097l44.338-42.226z'%20fill='%23484F5E'/%3e%3cpath%20d='m327.258%20784.011-37.582-17.454v-78.964l48.138%206.193z'%20fill='%23D55375'/%3e%3cpath%20d='m823.704%20641.284-27.025%207.742-6.897%2037.863h-18.72c-3.52-23.928%2011.4-55.176-26.463-65.17l-25.195-40.96%2012.527-16.187a86.565%2086.565%200%200%200%2091.35%2059.259zm-454.079%2022.662V644.1l12.246-12.95c8.445%201.267%2020.41%206.897%2024.773%203.237%2020.55-17.031%2038.99-36.455%2058.132-55.176l20.973%201.548a198.184%20198.184%200%200%201-105.708%2094.87z'%20fill='%23484F5E'/%3e%3cpath%20d='m199.029%20843.692%2034.485%2014.075-26.321%2070.378h-33.5z'%20fill='%23CAE7AF'/%3e%3cpath%20d='m230.98%20686.326%2012.387-43.071c2.675%2031.67%2031.53%2056.302%2022.24%2091.35-1.267%204.786-2.252%209.854-3.66%2016.47l-30.966-6.335z'%20fill='%23F5F5F6'/%3e%3cpath%20d='m763.18%20810.473-44.058%2067.704-11.964-12.528%2050.39-78.4z'%20fill='%23484F5E'/%3e%3cpath%20d='M212.682%20792.738c17.454%200%2040.538-9.15%2038.427%2030.122h-45.605z'%20fill='%23CDEAB1'/%3e%3cpath%20d='m598.917%20957.985-5.349-4.645h5.067z'%20fill='%23484F5E'/%3e%3cpath%20d='M464.495%20579.211c-19.143%2018.72-37.582%2038.145-58.132%2055.176-4.364%203.66-16.328-1.97-24.773-3.237l-17.173-69.111a165.67%20165.67%200%200%201%20100.078%2017.172z'%20fill='%23AED4EF'/%3e%3cpath%20d='m364.417%20562.039%2017.173%2069.111-12.246%2012.95Q354%20594.976%20338.377%20545.57c-2.815-9.149-6.334-18.157-9.571-27.306l-12.246-11.542%2037.441-30.967z'%20fill='%23353947'/%3e%3cpath%20d='M600.606%20602.013v31.67l-62.214-79.245-31.67%204.926%2031.388-50.39z'%20fill='%23484F5E'/%3e%3cpath%20d='M453.797%20517.278c-10.838%2021.255-25.617%2028.152-45.745%2011.542-16.891-14.075-24.633-31.529-12.105-50.25s30.121-20.41%2047.294-3.378c-23.507.986-34.767%2011.542-29.137%2039.412l39.693%203.097z'%20fill='%23AED4EF'/%3e%3cpath%20d='m731.931%20564.572-12.809%2015.624c-12.95-35.752-11.12-68.407%2019.847-95.15-2.111%2026.602-4.363%2053.064-7.038%2079.526z'%20fill='%23353947'/%3e%3cpath%20d='M506.722%20559.787c5.348%2019.002-4.364%2023.084-20.691%2020.69-6.194-19.846.985-26.32%2020.69-20.69z'%20fill='%23484F5E'/%3e%3cpath%20d='M453.797%20485.749c15.202%2010.416%2014.076%2020.973%200%2031.53v-31.812zm-10.556-10.557%2010.556%2010.557-10.556-10.557z'%20fill='%23AED4EF'/%3e%3cpath%20d='m442.818%20663.524%20151.313%2022.099c17.313%2034.062-12.105%2030.121-18.157%2036.596a696.602%20696.602%200%200%201-18.58%2080.09%2048.56%2048.56%200%200%201-52.784%2034.908c-25.758-2.675-32.514-23.647-38.426-44.057a96.84%2096.84%200%200%201-3.237-31.107c1.266-26.321%200-51.235-19.566-71.926-3.378-2.956-.563-12.387-.563-26.603zm66.297%20153.987c41.523-26.462%2042.226-60.384%2034.766-98.53l-55.317-10.274c-.422%2038.707-15.202%2075.163%2020.55%20108.804zm198.043%2048.138%2011.964%2012.528c-9.57%209.008-11.964%2030.685-33.359%2019.002z'%20fill='%23353947'/%3e%3cpath%20d='M686.186%20896.757c9.571%2014.075%202.955%2019.846-10.98%2021.817zm165.81-348.935-71.645%2040.679c3.66-33.36%206.334-57.429%2010.276-93.18z'%20fill='%23353947'/%3e%3cpath%20d='m884.792%20611.726-29.84%2020.69-1.408-16.89%2021.536-16.75z'%20fill='%23484F5E'%20data-spm-anchor-id='a313x.search_index.0.i4.dc0f3a810XA6r8'%20class='selected'/%3e%3cpath%20d='m853.544%20615.526%201.408%2016.89-31.248%208.868v-17.453zm31.248-3.8-9.712-12.95%2012.105%202.674z'%20fill='%23353947'/%3e%3cpath%20d='m443.522%20474.91%2010.557%2010.557v31.952l-39.693-3.097c-6.194-27.87%205.63-38.426%2029.136-39.411z'%20fill='%23F5F5F6'/%3e%3cpath%20d='M509.115%20817.51c-35.753-33.64-20.973-70.377-20.55-108.803l55.316%2010.275c7.883%2038.145%206.757%2072.067-34.766%2098.529z'%20fill='%23E25679'/%3e%3c/svg%3e"), onClick: showOrHide }, null, 8, Pd), !vue.unref(t).app.showFloat && vue.unref(t).app.alertBubble ? (vue.openBlock(), vue.createElementBlock("div", Ld, vue.toDisplayString(vue.unref(t).app.alert), 1)) : vue.createCommentVNode("", !0) ]) ]) ], 512), [ [ vue.vShow, !vue.unref(t).app.showFloat ] ]) ])); } }), $d = [ '.floating-wrapper{--c-primary: #0071e3;--c-primary-hover: #0077ed;--c-success: #34c759;--c-warning: #ff9f0a;--c-danger: #cc3333;--c-bg-app: #f5f5f7;--c-bg-card: #ffffff;--c-bg-hover: #fbfbfd;--c-bg-input: #ffffff;--c-text-main: #1d1d1f;--c-text-muted: #86868b;--c-text-light: #6b7280;--c-border-light: rgba(0, 0, 0, .06);--c-border-medium: rgba(0, 0, 0, .12);--c-border-dark: rgba(0, 0, 0, .2);--breakpoint-sm: 480px;--breakpoint-md: 768px;--breakpoint-lg: 1024px;--s-base: 4px;--s-xs: 8px;--s-sm: 12px;--s-md: 16px;--s-lg: 20px;--s-xl: 24px;--s-2xl: 32px;--r-sm: 8px;--r-md: 10px;--r-lg: 12px;--r-full: 9999px;--shadow-sm: 0 1px 3px rgba(0, 0, 0, .04);--shadow-md: 0 2px 8px rgba(0, 0, 0, .06);--shadow-lg: 0 4px 12px rgba(0, 0, 0, .08);--shadow-xl: 0 6px 16px rgba(0, 0, 0, .12);--font-size-xs: 12px;--font-size-sm: 13px;--font-size-base: 14px;--font-size-md: 15px;--font-size-lg: 17px;--font-size-xl: 20px;--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--transition-fast: .15s ease;--transition-base: .2s ease;--transition-slow: .3s ease}.floating-wrapper[data-theme=dark]{--c-primary: #0a84ff;--c-primary-hover: #409cff;--c-success: #30d158;--c-warning: #ffd60a;--c-danger: #ff453a;--c-bg-app: #1c1c1e;--c-bg-card: #2c2c2e;--c-bg-hover: #3a3a3c;--c-bg-input: #2c2c2e;--c-text-main: #f5f5f7;--c-text-muted: #98989d;--c-text-light: #aeaeb2;--c-border-light: rgba(255, 255, 255, .08);--c-border-medium: rgba(255, 255, 255, .16);--c-border-dark: rgba(255, 255, 255, .24);--shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);--shadow-md: 0 2px 8px rgba(0, 0, 0, .4);--shadow-lg: 0 4px 12px rgba(0, 0, 0, .5);--shadow-xl: 0 6px 16px rgba(0, 0, 0, .6)}*{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#AiAskApp .el_wrapper>div{pointer-events:none;z-index:999999!important}#AiAskApp .el_wrapper>div>div{pointer-events:none;z-index:999999!important}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.fade-in{animation:fadeIn .3s cubic-bezier(.25,.1,.25,1)}.fade-slide-enter-active,.fade-slide-leave-active{transition:all .25s ease}.fade-slide-enter-from,.fade-slide-leave-to{opacity:0;transform:translateY(6px)}@keyframes pulse{0%,to{box-shadow:0 0 #cc33334d}50%{box-shadow:0 0 0 6px #c330}}@keyframes ai-bounce{0%,80%,to{transform:scale(.8);opacity:.6}40%{transform:scale(1.15);opacity:1}}.mb-10{margin-bottom:10px!important}.mt-10{margin-top:10px!important}.mt-20{margin-top:20px!important}.small{font-size:13px}.muted-text{color:#6b7280;font-size:13px}.green{color:#059669}.red{color:#dc2626}.flex-grow{flex:1}.ghost{box-shadow:none}.custom-scroll::-webkit-scrollbar{width:8px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:#0000001f;border-radius:8px}.custom-scroll::-webkit-scrollbar-thumb:hover{background:#0003}.aah_breadcrumb{margin-bottom:24px;padding:0;background:transparent;border:none;border-radius:0}.breadcrumb{display:inline-flex;align-items:center;gap:8px;font-size:14px;white-space:nowrap;line-height:1.2}.breadcrumb-link{color:#0071e3;cursor:pointer;display:inline-flex;align-items:center;gap:4px;text-decoration:none;white-space:nowrap}.breadcrumb-link:hover{color:#0077ed;text-decoration:underline}.breadcrumb-sep,.breadcrumb-text{color:#86868b}.aah_title{font-size:15px;font-weight:500;line-height:1.6;color:#1d1d1f;margin-bottom:16px;padding:16px;background:#fbfbfd;border-radius:8px;border:1px solid rgba(0,0,0,.06);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.aah_title img{max-width:100%;height:auto;overflow:hidden;border-radius:8px;margin:12px 0}.aah_options{transition:all .2s ease;cursor:pointer}.aah_options:hover{border-color:#0071e34d!important;background:#f5f5f7}.aah_options[style*="color:green"]{background:#00cc3314!important;border-color:#00cc334d!important;font-weight:500;color:#0c3!important}.aah_active{box-shadow:0 0 0 2px #0071e3}.aah_bomHet50{padding:13px 0 13px 10px}.aah_bomHet50 span{display:inline-block;line-height:24px;padding-left:14px;color:#86868b;font-size:13px}.aah_bomHet50 span i{display:inline-block;width:10px;height:10px;border:1px solid #d2d2d7;border-radius:2px;vertical-align:middle;margin-right:4px;margin-top:-2px}.aah_bomHet50 .dq i{background-color:#0071e31a;box-shadow:0 0 0 2px #0071e34d;border-color:#0071e3}.aah_bomHet50 .yp i{background-color:#00cc331a;border-color:#0c3}.aah_bomHet50 .wp i{background-color:#cc33331a;border-color:#c33}.hljs{display:block;overflow-x:auto;padding:16px;background:#1d1d1f;color:#f5f5f7;border-radius:8px;box-shadow:0 2px 8px #00000014}.is-error{box-shadow:0 0 0 2px #cc33334d inset!important}.error-message{color:#c33;margin-top:8px;font-size:13px;font-weight:400}.btn{border:1px solid var(--c-border-medium);background:var(--c-bg-app);color:var(--c-text-main);padding:var(--s-xs) var(--s-md);border-radius:var(--r-md);font-size:var(--font-size-sm);cursor:pointer;transition:all var(--transition-base)}.btn:not(.btn-primary):hover:enabled{background:var(--c-bg-card);box-shadow:var(--shadow-md)}.btn:disabled{opacity:.6;cursor:not-allowed}.btn-primary{background:linear-gradient(135deg,#6fb1fc,#4364f7);color:#fff;border-color:transparent}.btn-primary:hover:enabled{filter:brightness(.95)}.btn-small{padding:var(--s-base) var(--s-sm);font-size:var(--font-size-xs);border-radius:var(--r-sm)}.btn-outline{background:var(--c-bg-card)}.btn-ghost{background:transparent;border-color:var(--c-border-light)}.btn.full{width:100%}.link-btn{background:transparent;border:none;color:#4364f7;cursor:pointer;margin-left:8px}.pill{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;font-size:13px;font-weight:600;letter-spacing:.1px}.pill-primary{background:#0071e31f;color:#0056b3}.pill-success{background:#10b98126;color:#0f5132}.pill-warn{background:#d9770626;color:#92400e}.highlight{color:#d97706;font-weight:700}.status-banner{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:10px;font-size:13px;border:1px solid rgba(0,0,0,.05);background:#f5f5f7}.status-dot{width:8px;height:8px;border-radius:50%;background:currentColor;display:inline-block}.status-success{color:#0f5132;background:#10b9811f;border-color:#10b9814d}.status-error{color:#b91c1c;background:#ef44441f;border-color:#ef44444d}.status-info{color:#1d4ed8;background:#3b82f61f;border-color:#3b82f647}.status-warning{color:#92400e;background:#f59e0b1f;border-color:#f59e0b47}.basic-card{background:#fff;border-radius:12px;border:1px solid rgba(0,0,0,.06);box-shadow:0 1px 3px #0000000a;padding:18px 20px}.info-card{display:flex;gap:12px;align-items:flex-start}.info-icon{font-size:18px}.info-text{font-size:13px;color:#1f2937;line-height:1.6}.info-highlight{color:#d97706;margin-left:4px;font-weight:600}.soft-loading{text-align:center;padding:16px 8px;color:#6b7280}.soft-alert{padding:12px;border-radius:10px;margin-bottom:12px;font-size:13px;line-height:1.5}.soft-alert.warning,.soft-alert-warning{background:#f59e0b1f;color:#92400e;border:1px solid rgba(245,158,11,.28)}.empty-block{grid-column:1 / -1;text-align:center;padding:48px 12px;background:#fff;border-radius:12px;border:1px dashed rgba(0,0,0,.08)}.empty-emoji{font-size:40px;margin-bottom:8px}.empty-text{margin:0;color:#6b7280}.empty-state{position:relative;padding:80px 20px;text-align:center}.empty-icon{font-size:48px;margin-bottom:16px}.icon-inline{display:inline-block;width:1em;height:1em;margin-right:6px;vertical-align:middle;position:relative;top:-.05em}.home-avatar-icon{width:48px;height:48px;color:#9ca3af}.home-page-icon{width:24px;height:24px;flex-shrink:0}.aah-card{background:var(--c-bg-card);border-radius:var(--r-lg);border:1px solid var(--c-border-light);box-shadow:var(--shadow-sm);padding:var(--s-md) var(--s-lg);transition:all var(--transition-base)}.aah-card:hover{box-shadow:var(--shadow-lg);border-color:var(--c-border-medium)}.aah-card-compact{padding:var(--s-sm) var(--s-md)}.aah-card-spacious{padding:var(--s-lg) var(--s-xl)}.aah-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--s-xs);padding:var(--s-sm) var(--s-md);border-radius:var(--r-md);border:1px solid var(--c-border-medium);background:var(--c-bg-app);color:var(--c-text-main);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);cursor:pointer;transition:all var(--transition-base)}.aah-btn:hover:enabled{box-shadow:var(--shadow-md)}.aah-btn:disabled{opacity:.6;cursor:not-allowed}.aah-btn-primary{background:linear-gradient(135deg,#6fb1fc,#4364f7);color:#fff;border-color:transparent}.aah-btn-primary:hover:enabled{filter:brightness(.95);box-shadow:var(--shadow-xl)}.aah-btn-plain{background:var(--c-bg-card)}.aah-btn-small{padding:var(--s-xs) var(--s-sm);font-size:var(--font-size-xs);border-radius:var(--r-sm)}.aah-btn-danger{background:#fee2e2;color:#b91c1c;border-color:#b91c1c66}.aah-tag{display:inline-flex;align-items:center;gap:var(--s-xs);padding:var(--s-xs) var(--s-sm);border-radius:var(--r-sm);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);border:1px solid transparent}.aah-tag-primary{background:#0071e31a;color:var(--c-primary);border-color:#0071e329}.aah-tag-success{background:#34c7591f;color:var(--c-success);border-color:#34c75933}.aah-tag-warning{background:#ff9f0a1f;color:var(--c-warning);border-color:#ff9f0a33}.aah-input{width:100%;padding:var(--s-sm) var(--s-md);border-radius:var(--r-md);border:1px solid var(--c-border-medium);background:var(--c-bg-input);color:var(--c-text-main);font-size:var(--font-size-sm);transition:all var(--transition-base)}.aah-input:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px #0071e31a}.aah-input:disabled{opacity:.6;cursor:not-allowed;background:var(--c-bg-app)}.aah-input.recording{border-color:var(--c-primary);box-shadow:0 0 0 3px #0071e326}.aah-select{width:100%;padding:var(--s-sm) var(--s-md);border-radius:var(--r-md);border:1px solid var(--c-border-medium);background:var(--c-bg-input);color:var(--c-text-main);font-size:var(--font-size-sm);cursor:pointer;transition:all var(--transition-base)}.aah-select:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px #0071e31a}.aah-select:disabled{opacity:.6;cursor:not-allowed;background:var(--c-bg-app)}.aah-alert{display:flex;align-items:flex-start;gap:var(--s-sm);padding:var(--s-md);border-radius:var(--r-md);font-size:var(--font-size-sm);line-height:1.6;border:1px solid transparent}.aah-alert-info{background:#3b82f61a;color:#1d4ed8;border-color:#3b82f633}.aah-alert-success{background:#34c7591a;color:#0f5132;border-color:#34c75933}.aah-alert-warning{background:#ff9f0a1a;color:#92400e;border-color:#ff9f0a33}.aah-alert-danger{background:#ef44441a;color:#b91c1c;border-color:#ef444433}.aah-page{display:flex;flex-direction:column;height:100%;overflow:hidden}.aah-page-header{display:flex;align-items:center;justify-content:space-between;padding:var(--s-md) var(--s-lg);border-bottom:1px solid var(--c-border-light);background:var(--c-bg-card);flex-shrink:0}.page-title{margin:0;font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);color:var(--c-text-main);letter-spacing:-.022em}.header-actions{display:flex;align-items:center;gap:var(--s-xs)}.aah-page-content{flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--s-md)}.aah-page-content.no-padding{padding:0}.aah-page-footer{padding:var(--s-md) var(--s-lg);border-top:1px solid var(--c-border-light);background:var(--c-bg-card);flex-shrink:0}.aah-page.is-loading .aah-page-content{position:relative;pointer-events:none;opacity:.6}.page-loader{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;background:#fffc;z-index:100}.spinner{width:32px;height:32px;border:3px solid var(--c-border-light);border-top-color:var(--c-primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}', '.floating-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:999999}#AiAskApp .el_wrapper>.floating-wrapper{pointer-events:none!important}#AiAskApp .el_wrapper>.minimized-dialog{pointer-events:auto!important}.minimized-dialog{position:fixed;bottom:20px;right:20px;z-index:9999999}.floating-dialog{position:fixed;pointer-events:auto;border-radius:12px;overflow:hidden;box-shadow:0 4px 24px #00000014,0 0 1px #0000000f;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background:#fff;border:1px solid rgba(0,0,0,.04);max-width:95vw;z-index:999999}#AiAskApp .el_wrapper>.floating-wrapper>.floating-dialog{pointer-events:auto!important}.floating-header{display:flex;align-items:center;justify-content:space-between;background:#fff;color:#1d1d1f;padding:24px 24px 16px;border-bottom:1px solid rgba(0,0,0,.06);cursor:move;-webkit-user-select:none;user-select:none;gap:12px}.floating-title{display:flex;align-items:center;gap:12px;font-size:17px;font-weight:600;color:#1d1d1f;letter-spacing:-.022em}.floating-title img{width:24px;height:24px;vertical-align:middle;border-radius:6px;box-shadow:0 1px 3px #00000014}.floating-version{margin-left:12px;background:#0071e31a;border:none;color:#0071e3;padding:4px 8px;border-radius:8px;font-size:12px;font-weight:600}.floating-actions{display:flex;align-items:center;gap:8px}.floating-btn{display:inline-flex;align-items:center;flex-direction:row;gap:6px;padding:8px 12px;border-radius:8px;border:1px solid rgba(0,0,0,.08);background:#f6f7fb;color:#1d1d1f;font-weight:500;cursor:pointer;transition:all .2s ease;white-space:nowrap;line-height:1.2}.floating-btn:hover{background:#fff;box-shadow:0 3px 10px #00000014}.floating-btn-plain{background:#fff}.floating-btn-small{padding:6px 10px;font-size:13px;border-radius:6px;min-height:32px}.floating-close{width:28px;height:28px;border:none;border-radius:50%;background:#0000000a;color:#333;font-size:18px;line-height:1;cursor:pointer;transition:all .2s ease}.floating-close:hover{background:#00000014}.floating-body{background:#fff}.floating-scroll{background:#fff;padding:24px;max-height:55vh;overflow:auto}@media (max-width: 600px){#AiAskApp .floating-scroll{max-height:50vh}}@media (min-width: 601px){#AiAskApp .floating-scroll{max-height:70vh}}.minimized-dialog img{pointer-events:auto;width:56px!important;height:56px!important;z-index:9999999!important;display:block;cursor:pointer}.mini-tooltip-wrapper{position:relative;display:inline-block}.mini-tooltip{position:absolute;bottom:calc(100% + 10px);right:0;background:#1f2937;color:#fff;padding:8px 10px;border-radius:10px;font-size:12px;box-shadow:0 4px 12px #0000001f;white-space:nowrap}.el-dialog{pointer-events:auto;border-radius:12px!important;overflow:hidden;box-shadow:0 4px 24px #00000014,0 0 1px #0000000f!important;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:999999!important;background:#fff!important;padding:0!important;max-width:95vw!important;border:1px solid rgba(0,0,0,.04)}.el-dialog__header{background:#fff!important;color:#1d1d1f!important;padding:24px 24px 16px!important;margin:0!important;border-bottom:1px solid rgba(0,0,0,.06)}.el-dialog__header div[style*="display: flex"]{color:#1d1d1f!important}.el-dialog__header img{box-shadow:0 1px 3px #00000014!important}.el-dialog__header span[style*="font-size: 18px"]{color:#1d1d1f!important}.el-dialog__header .el-tag[style*="background: rgba"]{background:#0071e31a!important;border:none!important;color:#0071e3!important}.el-dialog__header .el-button[style*="background: rgba"]{background:transparent!important;border:1px solid rgba(0,0,0,.1)!important;color:#1d1d1f!important}.el-dialog__header .el-button[style*="background: rgba"]:hover{background:#0000000a!important}.el-dialog__title{color:#1d1d1f!important;font-weight:600;font-size:17px;letter-spacing:-.022em}.el-dialog__headerbtn .el-dialog__close{color:#86868b!important;font-size:18px;transition:color .2s ease}.el-dialog__headerbtn .el-dialog__close:hover{color:#1d1d1f!important}.el-dialog__body{padding:0!important;background:#fff!important}', ".modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:grid;place-items:center;z-index:1000000;padding:20px}.modal-panel{background:#fff;border-radius:12px;width:min(600px,100%);max-height:80vh;display:flex;flex-direction:column;box-shadow:0 20px 60px #00000040}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(0,0,0,.06)}.modal-close{border:none;background:transparent;font-size:20px;cursor:pointer;color:#6b7280}.modal-body{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:14px}.modal-footer{padding:12px 16px;border-top:1px solid rgba(0,0,0,.06);display:flex;justify-content:flex-end;gap:10px}.form-row{display:flex;flex-direction:column;gap:6px}.option-list{display:flex;flex-direction:column;gap:8px}.option-row{display:flex;gap:8px;align-items:center}.option-selector{width:36px;height:36px;border-radius:50%;border:1px solid rgba(0,0,0,.15);background:#f5f5f7;cursor:pointer}.option-selector.active{background:#10b981;color:#fff;border-color:#10b981}", '.home-container{display:flex;flex-direction:column;gap:8px;padding:0}.user-status-card{margin-bottom:20px}.user-status{display:flex;align-items:center;justify-content:space-between;gap:16px}.user-info{display:flex;align-items:center;gap:14px;flex:1;min-width:0}.user-details{flex:1;min-width:0}.home-avatar{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#edf2ff,#f5f7fb);border:1px solid var(--c-border-light);display:grid;place-items:center;overflow:hidden}.home-avatar img{width:100%;height:100%;object-fit:cover}.home-avatar-icon{width:26px;height:26px;color:#5f6368}.user-details h3{margin:0;font-size:var(--font-size-xl);font-weight:var(--font-weight-semibold);color:var(--c-text-main);letter-spacing:-.022em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-details p{margin:0;font-size:var(--font-size-sm);color:var(--c-text-muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}.user-actions{flex-shrink:0}.home-tag{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:8px;font-size:12px;font-weight:500;border:1px solid transparent}.home-tag-primary{background:#0071e31a;color:#0071e3;border-color:#0071e329}.home-tag-success{background:#34c7591f;color:#34c759;border-color:#34c75933}.home-tag-warning{background:#ff9f0a1f;color:#ff9f0a;border-color:#ff9f0a33}.tag-gap{margin-left:6px}.home-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--s-xs);padding:var(--s-sm) var(--s-md);border-radius:var(--r-md);border:1px solid var(--c-border-medium);background:var(--c-bg-app);color:var(--c-text-main);font-weight:var(--font-weight-medium);cursor:pointer;transition:all var(--transition-base)}.home-btn:hover{box-shadow:var(--shadow-md)}.home-btn-primary{background:linear-gradient(135deg,#6fb1fc,#4364f7);color:#fff;border-color:transparent}.home-btn-primary:hover{box-shadow:var(--shadow-xl)}.home-btn-plain{background:var(--c-bg-card)}.home-btn-small{padding:var(--s-xs) var(--s-sm);font-size:var(--font-size-sm);border-radius:var(--r-sm)}.home-divider{display:flex;align-items:center;gap:var(--s-sm);margin:2px 0;color:var(--c-text-main);font-size:var(--font-size-md);font-weight:var(--font-weight-medium)}.home-divider:before,.home-divider:after{content:"";flex:1;height:1px;background:linear-gradient(90deg,transparent,var(--c-border-medium))}.home-divider:after{background:linear-gradient(90deg,var(--c-border-medium),transparent)}.home-pages-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.home-page-btn{width:100%;background:linear-gradient(135deg,#6fb1fc1a,#4364f70d);border:1px solid var(--c-border-light);color:var(--c-text-main);font-weight:var(--font-weight-semibold);display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:var(--s-sm) var(--s-md);gap:var(--s-sm)}.home-page-btn:hover{border-color:var(--c-border-medium);transform:translateY(-1px)}.home-page-btn .home-page-icon{width:24px;height:24px;color:var(--page-color, #4364f7);flex-shrink:0}.home-page-btn span{font-size:var(--font-size-base)}@media (max-width: 480px){.user-status{flex-direction:column;align-items:flex-start;gap:12px}.user-actions,.user-actions .home-btn{width:100%}}.version-section{margin:0;padding:var(--s-lg) var(--s-xl);background:var(--c-bg-hover);border-radius:var(--r-lg);border:1px solid var(--c-border-light);text-align:center}.version-section p{margin:0;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px}.version-section p:first-child{font-size:var(--font-size-base);margin-bottom:var(--s-xs)}.version-section p:last-child{font-size:var(--font-size-sm);color:var(--c-text-muted);margin-top:var(--s-sm);justify-content:center}.version-row{display:flex;align-items:center;gap:10px;margin:2px 0 0}.home-muted{color:var(--c-text-muted)}.tip-text{margin-top:2px}.notice-card{margin-top:12px;border-radius:10px;background:linear-gradient(135deg,#f7f9fc,#fff)}#AiAskApp .notice-content p{margin:0 0 6px;line-height:1.6}#AiAskApp .notice-content a{color:#409eff}#AiAskApp .notice-content{color:#606266;line-height:1.6;word-break:break-word;font-size:13px}', '.settings-layout{display:grid;grid-template-columns:260px 1fr;flex:1;min-height:0;gap:1px;background:var(--c-border-light);border:1px solid var(--c-border-light);border-radius:var(--r-lg);overflow:hidden}.settings-sidebar{display:flex;flex-direction:column;background:var(--c-bg-card);height:100%;overflow-y:auto}.sidebar-header{padding:var(--s-md);border-bottom:1px solid var(--c-border-light);flex-shrink:0}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:var(--s-sm);color:var(--c-text-muted);font-size:18px;pointer-events:none}.search-input{padding-left:36px!important;width:100%}.sidebar-nav{flex:1;padding:var(--s-xs);overflow-y:auto}.sidebar-nav .nav-item{display:flex;align-items:center;gap:var(--s-sm);padding:var(--s-sm) var(--s-md);border-radius:var(--r-md);color:var(--c-text-main);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);cursor:pointer;transition:all var(--transition-base);text-decoration:none;margin-bottom:var(--s-xs);width:100%;text-align:left;border:none;background:transparent}.sidebar-nav .nav-item:hover{background:var(--c-bg-hover)}.sidebar-nav .nav-item.active{background:#0071e31a;color:var(--c-primary);font-weight:var(--font-weight-semibold)}.nav-icon{font-size:20px;flex-shrink:0}.sidebar-footer{padding:var(--s-md);border-top:1px solid var(--c-border-light);flex-shrink:0}.sidebar-footer .aah-alert{font-size:var(--font-size-xs);padding:var(--s-xs) var(--s-sm)}.settings-content{background:var(--c-bg-card);height:100%;overflow-y:auto;padding:var(--s-lg)}.setting-group{margin-bottom:var(--s-xl)}.group-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--s-md);padding-bottom:var(--s-sm);border-bottom:1px solid var(--c-border-light)}.group-title{display:flex;align-items:center;gap:var(--s-xs);margin:0;font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);color:var(--c-text-main);letter-spacing:-.022em}.group-items{display:flex;flex-direction:column;gap:var(--s-sm)}.empty-search{text-align:center;padding:var(--s-2xl) var(--s-md);color:var(--c-text-muted)}.empty-icon{font-size:48px;margin-bottom:var(--s-md);opacity:.5}.empty-text{margin:0;font-size:var(--font-size-sm)}.config-item{padding:12px;background:#fff;border-radius:10px;transition:all .3s cubic-bezier(.25,.1,.25,1);border:1px solid rgba(0,0,0,.06)}.config-item:hover{background:#fbfbfd;box-shadow:0 2px 8px #0000000f;border-color:#00000014}.config-item-content{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}.config-label{display:flex;align-items:flex-start;gap:8px;flex:1;min-width:220px}.label-wrapper{display:flex;flex-direction:column;gap:4px}.label-text{font-size:15px;font-weight:500;color:#1d1d1f}.label-desc{font-size:13px;font-weight:400;color:var(--c-text-muted);line-height:1.5}.info-icon{color:#86868b;cursor:help;font-size:16px;transition:color .2s ease}.info-icon:hover{color:#0071e3}.config-control{display:flex;align-items:center;flex-shrink:0;gap:10px;flex-wrap:wrap;justify-content:flex-end}.checkbox-group{display:flex;flex-wrap:wrap;gap:10px}.base-alert{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:10px;border:1px solid rgba(0,0,0,.06);background:#f5f9ff;color:#1d1d1f;font-size:14px}.base-alert-info{background:#4364f714;border-color:#4364f729}.alert-icon{font-size:16px}.base-tag{display:inline-flex;align-items:center;padding:4px 8px;border-radius:8px;font-size:12px;font-weight:600;border:1px solid transparent}.base-tag-success{background:#34c7591f;color:#34c759;border-color:#34c75933}.base-input,.base-select{min-width:200px;padding:8px 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#1d1d1f;font-size:14px;transition:border-color .2s ease,box-shadow .2s ease}.base-input:focus,.base-select:focus{outline:none;border-color:#4364f7;box-shadow:0 0 0 3px #4364f72e}.base-select{min-width:180px}.toggle{position:relative;display:inline-flex;align-items:center;width:48px;height:26px}.toggle input{opacity:0;width:0;height:0;position:absolute}.toggle-slider{position:relative;display:block;width:100%;height:100%;background:#00000024;border-radius:26px;transition:all .2s ease}.toggle-slider:after{content:"";position:absolute;width:20px;height:20px;left:3px;top:3px;background:#fff;border-radius:50%;transition:all .2s ease;box-shadow:0 2px 6px #0000001f}.toggle input:checked+.toggle-slider{background:linear-gradient(135deg,#6fb1fc,#4364f7)}.toggle input:checked+.toggle-slider:after{transform:translate(22px)}.checkbox-item{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:8px;background:#f6f7fb;border:1px solid rgba(0,0,0,.06)}.hotkey-input-wrapper{position:relative;display:inline-flex;align-items:center;gap:8px}.hotkey-input-wrapper .hotkey-hint{font-size:12px;color:#86868b;background:#f6f7fb;padding:4px 8px;border-radius:8px}.hotkey-input-wrapper .hotkey-hint.danger{color:#c0392b;background:#c0392b1a}.hotkey-input-wrapper .base-input.recording{border-color:#c0392b;box-shadow:0 0 0 3px #c0392b29}.hotkey-input-wrapper :deep(.el-input.recording){border-color:#c33;animation:pulse 1.5s infinite}.hotkey-input-wrapper :deep(.el-input.recording input){background-color:#cc33330d;cursor:pointer}.hotkey-input-wrapper :deep(.el-input input){cursor:pointer}.ai-config-panel{display:flex;flex-direction:column;gap:var(--s-md)}.ai-config-toolbar{display:flex;flex-wrap:wrap;gap:var(--s-md);align-items:flex-end;justify-content:space-between}.ai-config-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:var(--s-md);align-items:flex-start}.ai-config-list{display:flex;flex-direction:column;gap:var(--s-xs)}.ai-config-list-item{min-height:38px;width:100%;border:1px solid var(--c-border-light);background:var(--c-bg-card);border-radius:var(--r-md);color:var(--c-text-main);display:flex;align-items:center;gap:var(--s-xs);padding:var(--s-sm) var(--s-md);cursor:pointer;text-align:left;transition:all var(--transition-base)}.ai-config-list-item:hover{border-color:var(--c-border-medium);background:var(--c-bg-hover)}.ai-config-list-item.active{border-color:var(--c-primary);color:var(--c-primary);background:#0071e314}.ai-config-list-item span:first-of-type{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-config-default{flex-shrink:0;color:var(--c-success);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}.ai-config-form{min-width:0;display:flex;flex-direction:column;gap:var(--s-md)}.ai-config-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-md)}.ai-config-field{display:grid;gap:var(--s-xs);color:var(--c-text-main);font-size:var(--font-size-sm)}.ai-config-field>span{font-weight:var(--font-weight-medium)}.ai-preset-select{min-width:220px}.ai-config-checkbox{min-height:38px}.ai-config-options,.ai-config-actions{display:flex;flex-wrap:wrap;gap:var(--s-sm);align-items:center}@media (max-width: 768px){.settings-layout{display:flex;flex-direction:column;height:auto;border:none;background:transparent}.settings-sidebar{position:sticky;top:0;z-index:10;height:auto;border-bottom:1px solid var(--c-border-light);border-radius:var(--r-lg) var(--r-lg) 0 0}.sidebar-footer{display:none}.sidebar-nav{flex-direction:row;overflow-x:auto;padding:0 var(--s-md);gap:var(--s-md)}.sidebar-nav .nav-item{white-space:nowrap;border-radius:0;border-bottom:2px solid transparent;padding:var(--s-md) var(--s-xs);margin-bottom:0}.sidebar-nav .nav-item.active{background:transparent;border-bottom-color:var(--c-primary);color:var(--c-primary)}.settings-content{padding:var(--s-md)}.config-item-content{flex-direction:column;align-items:flex-start}.config-control{width:100%;justify-content:flex-start}.ai-config-layout,.ai-config-form-grid{grid-template-columns:1fr}}', '.user-page{padding:0;max-width:100%}.user-page__login-section{position:relative;display:grid;grid-template-columns:1.1fr .9fr;align-items:center;gap:24px;padding:32px;border-radius:16px;background:radial-gradient(circle at 20% 20%,rgba(0,113,227,.18),transparent 40%),radial-gradient(circle at 80% 0%,rgba(255,193,7,.2),transparent 35%),linear-gradient(135deg,#f3f7ff,#fdf7ff);overflow:hidden;border:1px solid rgba(0,0,0,.05);box-shadow:0 12px 30px #0000000f}.user-page__login-section:after{content:"";position:absolute;right:-100px;bottom:-120px;width:260px;height:260px;background:radial-gradient(circle,rgba(0,113,227,.25),transparent 70%);filter:blur(4px);opacity:.6}.user-page__hero-card{position:relative;z-index:1;padding:24px 12px}.user-page__badge{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:#0071e31f;color:#0f67d3;font-size:13px;font-weight:600;letter-spacing:.01em;border:1px solid rgba(0,113,227,.2)}.user-page__hero-card h1{margin:16px 0 8px;font-size:28px;line-height:1.2;color:#0f172a;letter-spacing:-.02em}.user-page__hero-desc{margin:0 0 16px;color:#4b5563;font-size:15px}.user-page__highlight{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.user-page__bullet{margin:0;padding-left:18px;color:#374151;line-height:1.8;font-size:14px}.user-page__login-box{position:relative;z-index:1;max-width:420px;margin:0 auto;padding:32px 28px;background:#ffffffc7;border-radius:16px;box-shadow:0 20px 60px #0000001f;border:1px solid rgba(0,0,0,.06);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.user-page__login-header{text-align:center;margin-bottom:28px}.user-page__login-icon{font-size:56px;margin-bottom:12px}.user-page__login-header h2{margin:12px 0 8px;font-size:28px;font-weight:600;color:#1d1d1f;letter-spacing:-.022em}.user-page__login-header p{margin:0;color:#86868b;font-size:14px}.user-page__login-switch{display:inline-flex;gap:8px;margin-top:12px}.user-page__login-switch .btn{min-width:90px}.user-page__login-switch .btn.is-active{box-shadow:0 0 0 2px #4364f733}.user-page__login-form{margin-bottom:24px}.user-page__login-form .form-item{margin-bottom:20px}.user-page__login-btn{width:100%;height:44px;font-size:16px;font-weight:400;border-radius:980px!important}.user-page__login-hint{margin:12px 0 0;text-align:center;color:#6b7280;font-size:13px}.user-page__register-tip{text-align:center;margin-top:20px;color:#86868b;font-size:14px}.user-page__register-tip .link-btn{font-weight:400;margin-left:4px;color:#0071e3}.user-page__helper{margin:6px 0 0;color:#9ca3af;font-size:12px}.user-page__dashboard{padding:0;max-width:100%;margin:0 auto}.user-page__header-card{display:flex;align-items:center;gap:16px;padding:24px;background:#fbfbfd;border-radius:12px;margin-bottom:16px;border:1px solid rgba(0,0,0,.06)}.user-page__avatar{flex-shrink:0;width:64px;height:64px;border-radius:50%;border:3px solid rgba(255,255,255,.9);box-shadow:0 2px 8px #00000014;background:#f5f5f7;display:grid;place-items:center;overflow:hidden}.user-page__avatar img{width:100%;height:100%;object-fit:cover}.user-page__info-text h2{margin:0 0 4px;color:#1d1d1f;font-size:22px;font-weight:600;letter-spacing:-.022em}.user-page__username{margin:0;color:#86868b;font-size:14px}.user-page__stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px}.user-page__stat-card{display:flex;align-items:center;gap:12px;padding:16px;background:#fff;border-radius:10px;box-shadow:0 1px 3px #0000000a;border:1px solid rgba(0,0,0,.06);transition:all .2s ease}.user-page__stat-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px #00000014}.user-page__stat-icon{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0}.user-page__stat-icon--coin{background:#ffc10726;color:#f39c12}.user-page__stat-icon--money{background:#0071e326;color:#0071e3}.user-page__stat-icon--course{background:#ff572226;color:#ff5722}.user-page__stat-icon--question{background:#4caf5026;color:#4caf50}.user-page__stat-content{flex:1;min-width:0}.user-page__stat-label{margin:0 0 4px;color:#86868b;font-size:12px;font-weight:400}.user-page__stat-value{margin:0;color:#1d1d1f;font-size:20px;font-weight:600;letter-spacing:-.022em}.user-page__support-card{display:flex;align-items:center;gap:12px;padding:16px;background:#fff;border-radius:12px;box-shadow:0 1px 3px #0000000a;border:1px solid rgba(0,0,0,.06);margin-bottom:16px}.user-page__support-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:#4364f71f;color:#4364f7;font-size:20px}.user-page__support-content{flex:1;min-width:0}.user-page__support-title{margin:0 0 4px;font-size:15px;font-weight:600;color:#1d1d1f}.user-page__support-desc{margin:0;color:#6b7280;font-size:13px}.user-page__support-btn{white-space:nowrap}.user-page__apikey-section{padding:20px;background:#fff;border-radius:12px;box-shadow:0 1px 3px #0000000a;border:1px solid rgba(0,0,0,.06);margin-bottom:16px}.user-page__section-header{display:flex;align-items:center;gap:8px;margin-bottom:16px}.user-page__section-header h3{margin:0;font-size:17px;font-weight:600;color:#1d1d1f;letter-spacing:-.022em}.user-page__apikey-display{margin-top:12px}.user-page__apikey-input input{font-family:SF Mono,Monaco,Menlo,Courier New,monospace;font-size:13px}.user-page__actions{display:flex;justify-content:center;gap:12px;padding:20px;background:#fff;border-radius:12px;box-shadow:0 1px 3px #0000000a;border:1px solid rgba(0,0,0,.06)}.user-page__tips{text-align:center}.user-page__tips p{margin:12px 0 0;color:#6b7280;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 768px){.user-page__login-section{grid-template-columns:1fr;padding:22px}.user-page__hero-card h1{font-size:24px}.user-page__dashboard{padding:0}.user-page__header-card{flex-direction:column;text-align:center;padding:20px}.user-page__stats-grid{grid-template-columns:repeat(2,1fr);gap:10px}.user-page__stat-card{padding:14px}.user-page__stat-icon{width:36px;height:36px;font-size:18px}.user-page__stat-value{font-size:18px}.user-page__support-card{flex-direction:column;align-items:flex-start}.user-page__apikey-section{padding:16px}.user-page__actions{flex-direction:column}.user-page__actions .el-button{width:100%}}', ".ai-container{padding:0;display:flex;flex-direction:column;gap:16px}.basic-card.search-card,.basic-card.result-card,.basic-card.copyright-card{margin-bottom:4px}.question-type-select{margin-top:12px;display:flex;flex-direction:column;gap:6px}.helper-text{color:var(--el-text-color-secondary);font-size:13px;margin:0}.ai-textarea{width:100%;border:1px solid rgba(0,0,0,.12);border-radius:10px;padding:12px;font-size:14px;line-height:1.6;resize:vertical;outline:none;margin-bottom:12px}.ai-textarea:focus{border-color:#0071e380;box-shadow:0 0 0 3px #0071e326}.mode-switch{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.ai-action-row,.ai-result-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.ai-action-row{margin-top:10px}.pill-btn{border:1px solid rgba(0,0,0,.12);background:#f5f5f7;padding:8px 12px;border-radius:999px;font-size:13px;cursor:pointer;transition:all .2s ease}.pill-btn.active{background:linear-gradient(135deg,#6fb1fc,#4364f7);color:#fff;border-color:transparent;box-shadow:0 4px 10px #638bff40}.native-select{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.native-select select{width:100%;padding:10px 12px;border-radius:10px;border:1px solid rgba(0,0,0,.12);font-size:14px}.result-content{min-height:100px;padding:8px 0}.official-meta{border:1px solid rgba(0,0,0,.06);border-radius:10px;overflow:hidden;margin-bottom:12px}.meta-row{display:grid;grid-template-columns:120px 1fr;border-bottom:1px solid rgba(0,0,0,.06)}.meta-row:last-child{border-bottom:none}.meta-label{background:#f5f5f7;padding:10px 12px;font-weight:700;color:#111827}.meta-value{padding:10px 12px;color:#1f2937;line-height:1.6}.meta-options{padding:10px 12px;display:flex;flex-direction:column;gap:8px}.meta-option{display:flex;gap:8px;align-items:flex-start}.meta-option .option-label{font-weight:700;color:#6b7280}.meta-option .option-text{flex:1;color:#1f2937;line-height:1.6}.official-result-list{display:flex;flex-direction:column;gap:12px}.official-result-item{border:1px solid rgba(0,0,0,.06);border-radius:10px;padding:12px;background:#f9fafb;box-shadow:0 1px 2px #0000000a}.official-result-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.official-result-title{font-weight:700;color:#111827}.official-result-subtitle{color:#6b7280;margin-left:10px;font-size:12px}.official-section{margin-top:10px}.section-label{font-weight:700;color:#374151;margin-bottom:6px}.official-question{background:#fff;border:1px solid rgba(0,0,0,.04);border-radius:6px;padding:8px;line-height:1.6;color:#111827}.official-options{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.official-options li{display:flex;gap:8px;align-items:flex-start;background:#fff;border:1px solid rgba(0,0,0,.04);border-radius:6px;padding:8px}.official-options .option-label{font-weight:700;color:#6b7280}.official-options .option-text{color:#111827;line-height:1.5}.answer-chips{display:flex;flex-wrap:wrap;gap:8px}.answer-empty{color:#6b7280}", '.ask-shell{width:100%;display:flex;flex-direction:column;gap:8px}.ask-toolbar{display:flex;justify-content:space-between;gap:8px;align-items:center}.ask-toolbar__main{display:flex;gap:8px}.ask-toolbar__actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.ask-toolbar .btn.is-active{box-shadow:0 0 0 1px #4364f747}.ask-shell__body{display:flex;flex-direction:column;gap:8px;padding-right:2px}.ask-grid{display:grid;grid-template-columns:220px 1fr;gap:10px;align-items:start}.ask-col{display:flex;flex-direction:column;gap:8px}.ask-col--left{flex-shrink:0}.ask-col--right{min-width:0}.sticky-sidebar{position:sticky;top:var(--s-md, 16px);max-height:calc(100vh - var(--s-2xl, 32px) * 2);overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.2) transparent}.sticky-sidebar::-webkit-scrollbar{width:6px}.sticky-sidebar::-webkit-scrollbar-track{background:transparent}.sticky-sidebar::-webkit-scrollbar-thumb{background:#0003;border-radius:3px}.sticky-sidebar::-webkit-scrollbar-thumb:hover{background:#0000004d}.ask-section{background:var(--c-bg-card);border-radius:var(--r-lg);border:1px solid var(--c-border-light);padding:var(--s-sm);box-shadow:var(--shadow-sm);transition:all var(--transition-base)}.ask-section:hover{box-shadow:var(--shadow-md);transform:translateY(-1px)}.ask-section--nav{background:var(--c-bg-hover);border-color:var(--c-border-medium)}.ask-section__header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.ask-section__title{font-size:var(--font-size-md);font-weight:var(--font-weight-semibold);color:var(--c-text-main);letter-spacing:-.01em}.ask-section__actions{display:flex;gap:6px;align-items:center}.ask-section__actions--links{gap:4px}.ask-section__hint{color:var(--c-text-light);font-size:var(--font-size-xs)}.ask-container{padding:0;display:flex;flex-direction:column;gap:8px}.ask-info{display:flex;flex-direction:column;gap:4px}.ask-types summary{cursor:pointer;color:#4364f7;font-weight:600}.ask-actions{display:flex;gap:8px;flex-wrap:wrap}.ask-question-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(32px,1fr));gap:4px;padding:6px;background:var(--c-bg-hover);border-radius:var(--r-md)}.ask-question-btn{width:32px;height:32px;border-radius:var(--r-sm);border:none;background:var(--c-bg-hover);cursor:pointer;font-size:var(--font-size-xs);transition:all var(--transition-base);font-weight:var(--font-weight-medium);color:var(--c-text-main)}.ask-question-btn:hover{background:var(--c-bg-card);transform:translateY(-1px);box-shadow:var(--shadow-sm)}.ask-question-btn.status-success{border-color:#10b98166;background:#10b98126}.ask-question-btn.status-danger{border-color:#ef444466;background:#ef444426}.ask-legend{display:flex;align-items:center;gap:var(--s-sm);flex-shrink:0;font-size:var(--font-size-xs);color:var(--c-text-light);margin:0 2px var(--s-xs)}.ask-legend span{display:inline-flex;align-items:center;gap:4px}.ask-legend span i{display:inline-block;width:10px;height:10px;border:1px solid #d2d2d7;border-radius:2px}.ask-legend .dq i{background-color:#0071e31a;box-shadow:0 0 0 1px #0071e34d;border-color:#0071e3}.ask-legend .yp i{background-color:#00cc331a;border-color:#0c3}.ask-legend .wp i{background-color:#cc33331a;border-color:#c33}.ask-question-btn.aah_active{background:var(--c-primary);color:#fff;border-color:transparent;box-shadow:var(--shadow-md);font-weight:var(--font-weight-semibold)}.ask-settings{background:var(--c-bg-card);padding:var(--s-sm);border-radius:var(--r-md);border:1px solid var(--c-border-light);display:flex;flex-wrap:wrap;gap:var(--s-xs);align-items:center}.native-checkbox{display:inline-flex;align-items:center;gap:var(--s-xs);font-size:var(--font-size-sm);color:var(--c-text-main)}.native-checkbox input{width:16px;height:16px}.range-row{display:flex;flex-direction:column;gap:4px;flex:1;min-width:200px}.range-row input[type=range]{width:100%}.ask-tags{display:flex;flex-wrap:wrap;gap:6px}.ask-secondary-actions{display:flex;align-items:center;gap:6px}.ask-secondary-actions .divider{width:1px;height:16px;background:#0000001a}.ask-question-content{background:var(--c-bg-card);padding:var(--s-md);border-radius:var(--r-md);border:1px solid var(--c-border-light)}.ask-question-content .aah_options.active{color:var(--c-success);font-weight:var(--font-weight-medium)}.ask-match-table{width:100%;border-collapse:collapse;margin:6px 0}.ask-match-table td{border:1px solid var(--c-border-light);padding:var(--s-xs)}.ask-loading{position:relative}.ask-loading .loading-box{display:inline-block;padding:6px 10px;background:#3b82f61a;border-radius:8px;color:#1d4ed8;font-size:13px}.ask-answer-content{display:flex;flex-direction:column;gap:8px}.ai-answer-block{background:linear-gradient(to bottom,#4364f70f,#4364f705);border:2px solid rgba(67,100,247,.3);box-shadow:0 4px 12px #4364f726;position:relative;overflow:hidden}.ai-answer-block:before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#4364f7,#6fb1fc,#4364f7);background-size:200% 100%;animation:shimmer 3s linear infinite}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.ai-divider{display:flex;align-items:center;justify-content:space-between;gap:var(--s-xs);padding-top:var(--s-base)}.ai-title{display:flex;align-items:center;gap:var(--s-xs);font-weight:var(--font-weight-bold);color:#1d4ed8;font-size:var(--font-size-md)}.ai-icon{font-size:18px;color:#4364f7}.ai-streaming-tag{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:999px;background:#4364f71f;color:#1d4ed8;font-size:12px;font-weight:600}.ai-dot{width:6px;height:6px;border-radius:50%;background:#4364f7;display:inline-block;animation:ai-bounce 1.4s infinite ease-in-out}.ai-dot:nth-child(2){animation-delay:.2s}.ai-dot:nth-child(3){animation-delay:.4s}.ai-stream-placeholder{padding:10px 12px;border-radius:10px;border:1px dashed rgba(67,100,247,.3);background:linear-gradient(135deg,#6fb1fc14,#4364f70d);color:#475569;font-size:13px;line-height:1.6}.ai-answer-markdown{line-height:1.6}.ai-preview-block{border-color:#0071e33d;background:#0071e30f}.ask-preview-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.answer-block{background:var(--c-bg-card);border-radius:var(--r-md);border:1px solid var(--c-border-light);padding:var(--s-sm);transition:all var(--transition-base)}.answer-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--s-xs);padding-bottom:var(--s-xs);border-bottom:1px solid var(--c-border-light)}.source-badge{display:inline-flex;align-items:center;padding:var(--s-base) var(--s-xs);border-radius:var(--r-sm);background:var(--c-bg-hover);color:var(--c-text-main);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);border:1px solid var(--c-border-medium);transition:all var(--transition-fast)}.meta-info{font-size:var(--font-size-xs);color:var(--c-text-muted);font-weight:var(--font-weight-normal)}.answer-divider{font-weight:var(--font-weight-bold);color:var(--c-text-main);margin-bottom:var(--s-xs);font-size:var(--font-size-sm)}.answer-field{width:100%;border-radius:var(--r-sm);border:1px solid var(--c-border-medium);padding:var(--s-sm);font-size:var(--font-size-sm);background:var(--c-bg-app)}.answer-field-html{width:100%;border-radius:var(--r-sm);border:1px solid var(--c-border-light);padding:var(--s-md);background:var(--c-bg-card);font-size:var(--font-size-sm);color:var(--c-text-main);line-height:1.75;box-shadow:var(--shadow-sm);margin-bottom:var(--s-xs)}.answer-field-html img{max-width:100%;height:auto;border-radius:var(--r-sm);margin:var(--s-xs) 0}.answer-field-html table{width:100%;overflow-x:auto;display:block;border-collapse:collapse}.answer-field-html p{margin:var(--s-xs) 0}.answer-field-html:last-child{margin-bottom:0}.ask-container .aah_bomHet50{background:var(--c-bg-hover);border-radius:var(--r-md);padding:var(--s-sm) var(--s-md);margin-bottom:var(--s-md);border:1px solid var(--c-border-light)}.ask-section__actions .divider{background:var(--c-border-medium);height:12px;width:1px}.reading-passage{background:var(--c-bg-hover);border:1px solid var(--c-border-light);border-radius:var(--r-md);padding:var(--s-md);margin:var(--s-sm) 0;line-height:1.8;font-size:var(--font-size-base);color:var(--c-text-main);white-space:pre-wrap}.reading-questions{display:flex;flex-direction:column;gap:16px;margin-top:16px}.reading-sub-question{background:var(--c-bg-card);border:1px solid var(--c-border-light);border-radius:var(--r-sm);padding:var(--s-sm)}.sub-question-title{font-weight:var(--font-weight-semibold);color:var(--c-text-main);margin-bottom:var(--s-xs);font-size:var(--font-size-base);line-height:1.5}.reading-sub-question .aah_options{margin:var(--s-base) 0;padding:var(--s-xs);border-radius:var(--r-sm);transition:all var(--transition-base);cursor:pointer}.reading-sub-question .aah_options:hover{background:#4364f70d}.reading-sub-question .aah_options.active{background:#10b9811a;border-left:3px solid #10b981;color:#065f46;font-weight:500}@media (max-width: 768px){.ask-grid{grid-template-columns:1fr}.ask-col--left{order:2}.ask-col--right{order:1}.sticky-sidebar{position:static;height:auto;overflow-y:visible}.ask-question-grid{max-height:200px;overflow:auto}.ask-settings{flex-direction:column;align-items:flex-start}.reading-passage{padding:12px;font-size:13px}.reading-sub-question{padding:10px}.sub-question-title{font-size:13px}.ask-toolbar{flex-direction:column;gap:6px}.ask-toolbar__main,.ask-toolbar__actions{width:100%;justify-content:center}}', ".question-page{position:relative;padding:0}.question-page .watermark-bg{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;display:grid;place-items:center;gap:6px;font-size:18px;color:#0000000d;text-transform:uppercase;z-index:0}.question-page>*:not(.watermark-bg){position:relative;z-index:1}.question-card{margin-bottom:20px;animation:fadeIn .3s ease-out}.info-banner{background:#fff;border-radius:12px;border:1px solid rgba(0,0,0,.06);box-shadow:0 1px 3px #0000000a;padding:16px 18px;margin-bottom:14px}.info-title{font-size:15px;font-weight:700;color:#111827;margin-bottom:6px}.info-body{font-size:13px;color:#1f2937;line-height:1.6}.warn-text{color:#b91c1c;font-weight:600}.stats-row{display:flex;gap:12px;margin-bottom:14px}.stat-card{flex:1;min-width:0;background:linear-gradient(135deg,#0071e314,#638bff14);border:1px solid rgba(0,113,227,.18);border-radius:12px;padding:14px;box-shadow:0 1px 3px #0000000a}.stat-label{font-size:12px;color:#374151;margin-bottom:6px}.stat-value{font-size:26px;font-weight:800;color:#111827;letter-spacing:-.02em}.upload-box{background:#fff;border:1px dashed rgba(0,0,0,.15);border-radius:12px;padding:18px;text-align:center;cursor:pointer;margin-bottom:14px;transition:all .2s ease}.upload-box:hover{border-color:#0071e366;box-shadow:0 4px 12px #00000014}.upload-input{display:none}.upload-text{display:flex;flex-direction:column;gap:6px;align-items:center;color:#374151;font-size:14px}.upload-icon{font-size:22px}.upload-desc em{color:#4364f7;font-style:normal;font-weight:700}.upload-hint{font-size:12px;color:#6b7280}.actions-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.question-table{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:12px;overflow:hidden;box-shadow:0 1px 3px #0000000a}.table-head,.table-row{display:grid;grid-template-columns:120px 1.3fr 1fr 1fr}.table-head{background:#f5f5f7;font-weight:700;color:#111827;border-bottom:1px solid rgba(0,0,0,.06)}.table-row:nth-child(2n){background:#fbfbfc}.cell{padding:12px 14px;border-right:1px solid rgba(0,0,0,.04);font-size:13px;color:#1f2937;line-height:1.6;word-break:break-word}.table-head .cell{padding:12px 14px}.cell:last-child{border-right:none}.table-empty{padding:18px;text-align:center;color:#6b7280;font-size:13px}@media (max-width: 900px){.table-head,.table-row{grid-template-columns:100px 1fr}.cell-options,.cell-answer,.cell-question{grid-column:1 / -1}.cell-type{border-right:none;border-bottom:1px solid rgba(0,0,0,.04)}}.search-filter-row{display:flex;gap:12px;align-items:center;margin-bottom:16px;flex-wrap:wrap}.search-box{position:relative;flex:1;min-width:200px}.search-input{width:100%;padding:10px 40px 10px 14px;border:1px solid rgba(0,0,0,.12);border-radius:10px;background:#fff;font-size:14px;color:#1d1d1f;transition:all .2s ease}.search-input:focus{outline:none;border-color:#4364f7;box-shadow:0 0 0 3px #4364f726}.search-input::placeholder{color:#86868b}.search-clear{position:absolute;right:12px;top:50%;transform:translateY(-50%);background:none;border:none;font-size:18px;color:#86868b;cursor:pointer;width:20px;height:20px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s ease}.search-clear:hover{background:#00000014;color:#1d1d1f}.filter-select{padding:10px 12px;border:1px solid rgba(0,0,0,.12);border-radius:10px;background:#fff;font-size:14px;color:#1d1d1f;min-width:120px;cursor:pointer}.filter-select:focus{outline:none;border-color:#4364f7;box-shadow:0 0 0 3px #4364f726}.data-stats{margin-bottom:16px;padding:12px 16px;background:#f8f9fa;border-radius:10px;border:1px solid rgba(0,0,0,.06)}.stats-text{font-size:13px;color:#6b7280}.question-table-wrapper{margin-bottom:24px}.question-cards{display:flex;flex-direction:column;gap:16px}.question-card{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:12px;box-shadow:0 1px 3px #0000000a;overflow:hidden;transition:all .2s ease}.question-card:hover{box-shadow:0 4px 12px #00000014;border-color:#00000014}.card-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;background:#f8f9fa;border-bottom:1px solid rgba(0,0,0,.06)}.question-type-badge{display:inline-flex;align-items:center;padding:4px 10px;background:#4364f71a;color:#4364f7;border-radius:8px;font-size:12px;font-weight:600}.card-body{padding:18px;display:flex;flex-direction:column;gap:16px}.question-content,.options-content,.answer-content{display:flex;flex-direction:column;gap:8px}.question-label,.options-label,.answer-label{font-size:13px;font-weight:600;color:#374151;text-transform:uppercase;letter-spacing:.5px}.question-text,.options-text,.answer-text{font-size:14px;line-height:1.6;color:#1f2937}.question-text{background:#f8f9fa;padding:12px 14px;border-radius:8px;border-left:3px solid #4364f7}.options-text{background:#fff;padding:12px 14px;border:1px solid rgba(0,0,0,.06);border-radius:8px}.answer-text{background:#10b98114;padding:12px 14px;border-radius:8px;border-left:3px solid #10b981;font-weight:500;color:#065f46}.pagination-wrapper{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-top:24px}.pagination{display:flex;align-items:center;gap:8px}.page-btn{display:inline-flex;align-items:center;padding:8px 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#374151;font-size:14px;cursor:pointer;transition:all .2s ease}.page-btn:hover:not(:disabled){background:#f3f4f6;border-color:#0003}.page-btn:disabled{opacity:.5;cursor:not-allowed}.page-numbers{display:flex;align-items:center;gap:4px}.page-number{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#374151;font-size:14px;cursor:pointer;transition:all .2s ease}.page-number:hover{background:#f3f4f6;border-color:#0003}.page-number.active{background:#4364f7;border-color:#4364f7;color:#fff}.page-ellipsis{padding:0 8px;color:#6b7280}.page-size-selector{display:flex;align-items:center;gap:8px;font-size:14px;color:#374151}.page-size-selector select{padding:6px 10px;border:1px solid rgba(0,0,0,.12);border-radius:6px;background:#fff;font-size:13px;cursor:pointer}.sub-question{margin-bottom:20px;padding:16px;background:#f8f9fa;border-radius:10px;border:1px solid rgba(0,0,0,.06)}.sub-question:last-child{margin-bottom:0}.sub-question-title{font-size:14px;font-weight:600;color:#1f2937;margin-bottom:12px;line-height:1.5}.sub-question-options{margin-bottom:12px}.sub-option{padding:6px 0;font-size:13px;color:#374151;line-height:1.5}.sub-question-answer{padding:8px 12px;background:#10b9811a;border-radius:6px;border-left:3px solid #10b981;font-size:13px;font-weight:600;color:#065f46}.sub-answer-item{display:flex;align-items:flex-start;gap:8px;padding:6px 0;border-bottom:1px solid rgba(16,185,129,.15)}.sub-answer-item:last-child{border-bottom:none}.sub-answer-num{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;background:#10b981;color:#fff;border-radius:50%;font-size:12px;font-weight:700;flex-shrink:0}.sub-answer-text{flex:1;font-size:14px;font-weight:600;color:#065f46;line-height:1.5;padding-top:2px}@media (max-width: 768px){.search-filter-row{flex-direction:column;align-items:stretch}.search-box{min-width:0}.pagination-wrapper{flex-direction:column;gap:16px}.pagination{flex-wrap:wrap;justify-content:center}.card-header{flex-direction:column;align-items:flex-start;gap:8px}.sub-question{padding:12px}.sub-question-title{font-size:13px}.sub-option{font-size:12px}}", ".question-tool{padding:0}.qt-actions{margin:12px 0}.qt-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}.qt-editor,.qt-preview{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:12px;box-shadow:0 1px 3px #0000000a;padding:14px}.qt-textarea{width:100%;min-height:480px;border:1px solid rgba(0,0,0,.12);border-radius:10px;padding:12px;font-size:14px;line-height:1.6;resize:vertical;outline:none}.qt-textarea:focus{border-color:#0071e380;box-shadow:0 0 0 3px #0071e326}.qt-preview{max-height:640px;overflow:auto}.qt-empty{text-align:center;color:#6b7280;padding:24px 12px}.qt-card{border:1px solid rgba(0,0,0,.06);border-radius:10px;padding:12px;margin-bottom:12px;background:#f9fafb}.qt-card-error{border-color:#f87171;background:#fef2f2}.qt-card-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}.qt-title-no{font-weight:700;color:#1f2937}.qt-tag{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;background:#f3f4f6;color:#111827}.qt-tag.danger{background:#ef444426;color:#b91c1c}.qt-tag.success{background:#10b98126;color:#065f46}.qt-question,.qt-answer{margin:6px 0;font-size:14px;color:#1f2937;line-height:1.6}.qt-options{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.qt-error{margin-top:8px;padding:10px;border-radius:8px;background:#ef44441f;color:#991b1b;font-size:13px}.label{color:#6b7280;margin-right:4px}@media (max-width: 960px){.qt-grid{grid-template-columns:1fr}.qt-textarea{min-height:360px}}", ".preview-container{padding:16px;background:#f8f9fa;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;line-height:1.5}.toolbar{display:flex;justify-content:space-between;align-items:center;background:#fff;padding:12px 16px;border-radius:8px;box-shadow:0 2px 4px #0000001a;margin-bottom:16px;gap:16px}.toolbar-left .page-title{margin:0;font-size:16px;font-weight:600;color:#333}.toolbar-right{display:flex;align-items:center;gap:12px}.search-box{position:relative;display:flex;align-items:center}.search-input{width:200px;padding:6px 12px;border:1px solid #ddd;border-radius:4px;font-size:13px;outline:none}.search-input:focus{border-color:#007bff}.clear-btn{position:absolute;right:4px;width:20px;height:20px;border:none;background:#dc3545;color:#fff;border-radius:50%;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center}.page-size{padding:4px 8px;border:1px solid #ddd;border-radius:4px;font-size:12px;background:#fff}.search-info{background:#e3f2fd;color:#1976d2;padding:8px 12px;border-radius:4px;margin-bottom:12px;font-size:13px}.questions-container{background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;overflow:hidden}.loading{display:flex;align-items:center;justify-content:center;padding:40px;gap:12px;color:#666}.spinner{width:20px;height:20px;border:2px solid #f3f3f3;border-top:2px solid #007bff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.empty{text-align:center;padding:40px 20px;color:#666}.empty-icon{font-size:48px;margin-bottom:12px}.empty p{margin:0 0 16px}.btn-clear{background:#007bff;color:#fff;border:none;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px}.btn-clear:hover{background:#0056b3}.questions-list{display:flex;flex-direction:column}.question-item{border-bottom:1px solid #eee;padding:16px}.question-item:last-child{border-bottom:none}.question-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.question-info{display:flex;align-items:center;gap:8px}.question-num{background:#007bff;color:#fff;padding:2px 8px;border-radius:12px;font-size:12px;font-weight:500;min-width:24px;text-align:center}.question-type{background:#f8f9fa;color:#495057;padding:2px 8px;border-radius:12px;font-size:11px;border:1px solid #dee2e6}.question-actions{display:flex;gap:4px}.btn-edit,.btn-delete{width:28px;height:28px;border:none;border-radius:4px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center}.btn-edit{background:#e3f2fd;color:#1976d2}.btn-edit:hover{background:#bbdefb}.btn-delete{background:#ffebee;color:#d32f2f}.btn-delete:hover{background:#ffcdd2}.question-content{line-height:1.6}.question-text{margin-bottom:12px;color:#333}.question-text img{max-width:100%;height:auto;border-radius:4px;margin:8px 0}.options{margin-bottom:12px}.reading-type{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;padding:12px}.reading-title{font-weight:600;color:#495057;margin-bottom:8px;font-size:13px}.sub-questions{display:flex;flex-direction:column;gap:8px}.sub-question{background:#fff;padding:8px;border-radius:4px;border:1px solid #e9ecef;font-size:13px}.sub-num{color:#007bff;font-weight:600;margin-right:4px}.sub-type{color:#6c757d;font-size:11px;margin-right:8px}.sub-text{color:#495057;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.more-subs{text-align:center;color:#6c757d;font-size:12px;font-style:italic;padding:4px}.complex-type{background:#fff3cd;color:#856404;padding:8px 12px;border-radius:4px;font-size:13px;border:1px solid #ffeaa7}.normal-options{display:flex;flex-direction:column;gap:6px}.option{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:4px;background:#f8f9fa;position:relative}.option.correct{background:#d4edda;border:1px solid #c3e6cb}.option-label{color:#495057;font-weight:500;min-width:20px}.option-text{flex:1;color:#333}.correct-mark{color:#28a745;font-weight:700;font-size:16px}.answer{background:#d4edda;border:1px solid #c3e6cb;border-radius:4px;padding:8px 12px;margin-top:8px}.answer-label{color:#155724;font-weight:600;margin-right:8px}.answer-list{display:inline-flex;flex-wrap:wrap;gap:4px}.answer-item{background:#28a745;color:#fff;padding:2px 8px;border-radius:12px;font-size:12px}.answer-text{color:#155724;display:inline}.no-answer{color:#6c757d;font-style:italic}.pagination{display:flex;justify-content:center;align-items:center;gap:12px;padding:16px;background:#fff;border-top:1px solid #eee;margin-top:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.page-btn{background:#f8f9fa;border:1px solid #dee2e6;color:#495057;padding:6px 12px;border-radius:4px;cursor:pointer;font-size:13px}.page-btn:hover:not(:disabled){background:#e9ecef}.page-btn:disabled{opacity:.5;cursor:not-allowed}.page-info{display:flex;align-items:center;gap:4px;color:#495057;font-size:13px}.page-input{width:40px;text-align:center;border:1px solid #dee2e6;border-radius:4px;padding:2px 4px;font-size:13px}.total-info{color:#6c757d;font-size:12px}.highlight{background:#fff3cd;color:#856404;padding:1px 2px;border-radius:2px}@media (max-width: 600px){.toolbar{flex-direction:column;align-items:stretch;gap:12px}.toolbar-right{justify-content:space-between}.search-input{width:150px}.question-header{flex-direction:column;align-items:flex-start;gap:8px}.pagination{flex-wrap:wrap;gap:8px}}", ".log-container{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:12px;box-shadow:0 1px 3px #0000000a;overflow:hidden}.log-head,.log-row{display:grid;grid-template-columns:180px 1fr}.log-head{background:#f5f5f7;font-weight:700;color:#111827;border-bottom:1px solid rgba(0,0,0,.06)}.log-row{border-bottom:1px solid rgba(0,0,0,.04)}.log-row:last-child{border-bottom:none}.log-cell{padding:12px 14px;font-size:13px;line-height:1.5}.cell-time{color:#4b5563;border-right:1px solid rgba(0,0,0,.04)}.cell-content{color:#1f2937}.log-empty{padding:14px;text-align:center;color:#6b7280;font-size:13px}" ].join("\n"), get_href = () => location.href, hookXHR = () => { const e = { send: XMLHttpRequest.prototype.send }; Object.defineProperty(XMLHttpRequest.prototype, "send", { configurable: !1, writable: !1, value: function(t) { return this.addEventListener("readystatechange", (function() { switch (!0) { case /onlineexamh5new.zhihuishu.com/i.test(get_href()): break; case /icve.com.cn/i.test(location.host): 4 === this.readyState && this.responseURL && (this.responseURL.includes("examRecordPaperList") || this.responseURL.includes("queryXsDtjgSjInfo")) && JSON.parse(this.response); break; case /qingshuxuetang.com/i.test(get_href()): if (4 === this.readyState && (this.responseURL.includes("Student/DetailData") || this.responseURL.includes("Student/SimulationExercise/DetailData") || this.responseURL.includes("Student/Quiz/DetailData"))) { const e = JSON.parse(this.response); ce.qsques = e.data.paperDetail.questions, e.data.paperDetail.questions; } break; case /cce.org.uooconline.com/i.test(get_href()): if (4 === this.readyState && this.responseURL.includes("/exam/view?cid=")) { const e = JSON.parse(this.response); ce.cceques = e.data.questions, e.data.questions; } break; case /cj-edu.com/i.test(get_href()): if (4 === this.readyState && this.responseURL.includes("api/student/getHomeworkStudentInfo.do")) { const e = JSON.parse(this.response); ce.cjques = e.data, e.data; } break; case /gxk.yxlearning.com/i.test(get_href()): if (4 === this.readyState && this.responseURL.includes("cms/paper/start-do-paper-or-test.gson")) { const e = JSON.parse(this.response); ce.yxques = e.attribute.data, e.data; } } })), e.send.call(this, t); } }); }; (e => { if ("function" != typeof e) return; const t = e, n = getRuntime(); "function" != typeof n.GM_xmlhttpRequest && (n.GM_xmlhttpRequest = t), n.GM || (n.GM = {}), "function" != typeof n.GM.xmlHttpRequest && (n.GM.xmlHttpRequest = t); })(le); const loadVue = () => { var e, i, o; const s = function() { const e = vue.effectScope(!0), i = e.run((() => vue.ref({}))); let o = [], s = []; const r = vue.markRaw({ install(e) { setActivePinia(r), r._a = e, e.provide(Q, r), e.config.globalProperties.$pinia = r, s.forEach((e => o.push(e))), s = []; }, use(e) { return this._a ? o.push(e) : s.push(e), this; }, _p: o, _a: null, _e: e, _s: new Map, state: i }); return r; }(), r = vue.createApp(Md); r.use(s); const l = document.createElement("div"), c = document.createElement("div"); c.id = "AiAskApp", window.self !== window.top && (null == (i = null == (e = window.top) ? void 0 : e.location) ? void 0 : i.origin) === window.location.origin && Nt.iframe ? (c.id = "AiAskAppTop", null == (o = window.top) || o.document.body.appendChild(l)) : document.body.append(l); const p = l.attachShadow({ mode: "closed" }); p.appendChild(c); try { const e = document.createElement("style"); e.textContent = $d, p.appendChild(e); } catch (d) { console.error("\u5e94\u7528\u6837\u5f0f\u8868\u65f6\u51fa\u9519:", d); } r.mount(c); }, run = async () => { var e; (e = document.createElement("iframe")).style.display = "none", document.body.appendChild(e), window.console = e.contentWindow.console; (ce === ce.top || [ /\/work\/doHomeWorkNew/i, /selectWorkQuestionYiPiYue/i, /page\/quiz\/stu\/answerQuestion2/i, /page\/active\/stuActiveList/i, /uooconline.com/i, /edu-edu.com/i, /hblearning\/exam\/portal\/exam.jsp/i ].some((e => e.test(location.href))) || Ht.some((e => "hook" !== e.type && isRuleMatched(e)))) && (loadVue(), parseRule(Ht)); }; (() => { if (hookXHR(), /onlineexamh5new.zhihuishu.com/i.test(get_href())) { const e = ce.yxyz; ce.yxyz = function(t, n) { !ce.yxyzpush && (ce.yxyzpush = []); let a = e(t, n); return ce.yxyzpush.push({ ...t, data: a }), a; }; } if (/icve.com.cn/i.test(get_href()) || /courshare.cn/i.test(get_href()) || /webtrn.cn/i.test(get_href())) { const e = ce.open; ce.open = function() { return arguments[2] = "", e.apply(this, arguments); }; } if (/ytccr.com/i.test(get_href())) { const e = localStorage.getItem; localStorage.getItem = function(t) { if ("_debugger" === t) return !0; return e.apply(this, arguments); }; } if (/91huayi.com/i.test(get_href())) { const e = ce.$.cookie; ce.$.cookie = function(t, n, a) { return console.log("Cookie\u64cd\u4f5c:", t, n, a), t.startsWith("switchTime") && void 0 !== n ? (n = void 0, e.apply(this, [ t, n, a ])) : e.apply(this, arguments); }; } })(), Ht.filter((e => isRuleMatched(e) && e.hook)).forEach((e => { e.hook(); })), "complete" === document.readyState ? run() : window.addEventListener("load", run); })(Vue, Icon, DOMPurify, $, CryptoJS);