@vue-skuilder/platform-ui 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{About-74htcNLT.js → About-BkMENQtD.js} +2 -2
- package/dist/assets/{About-74htcNLT.js.map → About-BkMENQtD.js.map} +1 -1
- package/dist/assets/{AdminDashboard-B00qno2M.js → AdminDashboard-5R-xgY-M.js} +2 -2
- package/dist/assets/{AdminDashboard-B00qno2M.js.map → AdminDashboard-5R-xgY-M.js.map} +1 -1
- package/dist/assets/{AdminLearner-SJNtSyJ_.js → AdminLearner-Br10DFSt.js} +2 -2
- package/dist/assets/{AdminLearner-SJNtSyJ_.js.map → AdminLearner-Br10DFSt.js.map} +1 -1
- package/dist/assets/BaseUserDB-BRgNfdWx.js +1 -0
- package/dist/assets/{ClassroomCtrlPanel-BSAG3h8B.js → ClassroomCtrlPanel-DQJQ0B7M.js} +2 -2
- package/dist/assets/{ClassroomCtrlPanel-BSAG3h8B.js.map → ClassroomCtrlPanel-DQJQ0B7M.js.map} +1 -1
- package/dist/assets/{Classrooms-DXNEbtsM.js → Classrooms-B5tQPFEE.js} +2 -2
- package/dist/assets/{Classrooms-DXNEbtsM.js.map → Classrooms-B5tQPFEE.js.map} +1 -1
- package/dist/assets/CouchDBSyncStrategy-0EgX8AAz.js +1 -0
- package/dist/assets/{CourseRouter-CsVa_92r.js → CourseRouter-W6S7DpZN.js} +2 -2
- package/dist/assets/{CourseRouter-CsVa_92r.js.map → CourseRouter-W6S7DpZN.js.map} +1 -1
- package/dist/assets/CourseSyncService-CrHp0wsl.js +1 -0
- package/dist/assets/{CourseWare-BTFRjgBR-DBp_fIwH.js → CourseWare-BTFRjgBR-lpqcYpAW.js} +3 -3
- package/dist/assets/{CourseWare-BTFRjgBR-DBp_fIwH.js.map → CourseWare-BTFRjgBR-lpqcYpAW.js.map} +1 -1
- package/dist/assets/{Courses-CB6GGtdm.js → Courses-TzwgFdwn.js} +2 -2
- package/dist/assets/{Courses-CB6GGtdm.js.map → Courses-TzwgFdwn.js.map} +1 -1
- package/dist/assets/{EloModeration-DUBgs-Vh.js → EloModeration-BCz7VKla.js} +2 -2
- package/dist/assets/{EloModeration-DUBgs-Vh.js.map → EloModeration-BCz7VKla.js.map} +1 -1
- package/dist/assets/{JoinCode-BBvYapCA.js → JoinCode-CEeZkFOp.js} +2 -2
- package/dist/assets/{JoinCode-BBvYapCA.js.map → JoinCode-CEeZkFOp.js.map} +1 -1
- package/dist/assets/{NewCourseDialog-DBgFVnt3.js → NewCourseDialog-DNzvvz_H.js} +2 -2
- package/dist/assets/{NewCourseDialog-DBgFVnt3.js.map → NewCourseDialog-DNzvvz_H.js.map} +1 -1
- package/dist/assets/{PipelineDebugger-BHaqzqZw.js → PipelineDebugger-DhnKlMgD.js} +3 -3
- package/dist/assets/{PipelineDebugger-BHaqzqZw.js.map → PipelineDebugger-DhnKlMgD.js.map} +1 -1
- package/dist/assets/PouchDataLayerProvider-CAuhZYIc.js +2 -0
- package/dist/assets/PouchDataLayerProvider-CAuhZYIc.js.map +1 -0
- package/dist/assets/{ReleaseNotes-Dg6mLL1C.js → ReleaseNotes-Bvw24QDI.js} +2 -2
- package/dist/assets/{ReleaseNotes-Dg6mLL1C.js.map → ReleaseNotes-Bvw24QDI.js.map} +1 -1
- package/dist/assets/{RequestPasswordReset-CcFMTnTc.js → RequestPasswordReset-YOq1JJ_o.js} +2 -2
- package/dist/assets/{RequestPasswordReset-CcFMTnTc.js.map → RequestPasswordReset-YOq1JJ_o.js.map} +1 -1
- package/dist/assets/{ResetPassword-Dw_cBJU2.js → ResetPassword-CQCb3B_Z.js} +2 -2
- package/dist/assets/{ResetPassword-Dw_cBJU2.js.map → ResetPassword-CQCb3B_Z.js.map} +1 -1
- package/dist/assets/{StaticDataLayerProvider-CtgU3VBh.js → StaticDataLayerProvider-DbGLKpb1.js} +2 -2
- package/dist/assets/{StaticDataLayerProvider-CtgU3VBh.js.map → StaticDataLayerProvider-DbGLKpb1.js.map} +1 -1
- package/dist/assets/{Study-DDsGQCTJ.js → Study-D2mXR27s.js} +2 -2
- package/dist/assets/{Study-DDsGQCTJ.js.map → Study-D2mXR27s.js.map} +1 -1
- package/dist/assets/{TagInformation-DBLoXA2a.js → TagInformation-DHw5jRNt.js} +2 -2
- package/dist/assets/{TagInformation-DBLoXA2a.js.map → TagInformation-DHw5jRNt.js.map} +1 -1
- package/dist/assets/{User-DfXUXjFb.js → User-C0xEcKaU.js} +2 -2
- package/dist/assets/{User-DfXUXjFb.js.map → User-C0xEcKaU.js.map} +1 -1
- package/dist/assets/{UserDBDebugger-DPqlc4O_.js → UserDBDebugger-BXLoT28w.js} +2 -2
- package/dist/assets/{UserDBDebugger-DPqlc4O_.js.map → UserDBDebugger-BXLoT28w.js.map} +1 -1
- package/dist/assets/UserDBDebugger-DHONc_-t.js +1 -0
- package/dist/assets/{UserStats-C04YVYv7.js → UserStats-Blm_daoT.js} +2 -2
- package/dist/assets/{UserStats-C04YVYv7.js.map → UserStats-Blm_daoT.js.map} +1 -1
- package/dist/assets/{VerifyEmail-Y05BSR57.js → VerifyEmail-DTwA6sFY.js} +2 -2
- package/dist/assets/{VerifyEmail-Y05BSR57.js.map → VerifyEmail-DTwA6sFY.js.map} +1 -1
- package/dist/assets/{admin-DcFjvYJw.js → admin-hzNSXp0o.js} +2 -2
- package/dist/assets/{admin-DcFjvYJw.js.map → admin-hzNSXp0o.js.map} +1 -1
- package/dist/assets/{chess-E2uOAyQS-BZi0vihz.js → chess-E2uOAyQS-DDTgqZMJ.js} +2 -2
- package/dist/assets/{chess-E2uOAyQS-BZi0vihz.js.map → chess-E2uOAyQS-DDTgqZMJ.js.map} +1 -1
- package/dist/assets/chess-Lfm7Fsvs-RaFhFnIh.js +1 -0
- package/dist/assets/{contentSource-DwznMSMs.js → contentSource-FGhM_ge8.js} +8 -8
- package/dist/assets/contentSource-FGhM_ge8.js.map +1 -0
- package/dist/assets/dist-5Z6GjIpR.js +1 -0
- package/dist/assets/{dist-CAHkbl3M.js → dist-BJLhyG8r.js} +3 -3
- package/dist/assets/{dist-CAHkbl3M.js.map → dist-BJLhyG8r.js.map} +1 -1
- package/dist/assets/dist-C5-_1l75.js +1 -0
- package/dist/assets/{dist-BsRvt0gH.js → dist-C8EQUxWW.js} +3 -3
- package/dist/assets/{dist-BsRvt0gH.js.map → dist-C8EQUxWW.js.map} +1 -1
- package/dist/assets/{dist-Dp6eBE2S.js → dist-DGbpjpKB.js} +2 -2
- package/dist/assets/{dist-Dp6eBE2S.js.map → dist-DGbpjpKB.js.map} +1 -1
- package/dist/assets/dist-M4o-5YLq.js +1 -0
- package/dist/assets/edit-ui.es-BT7ftsox.js +1 -0
- package/dist/assets/{edit-ui.es-UaQFL_My.js → edit-ui.es-DJgikaS7.js} +2 -2
- package/dist/assets/{edit-ui.es-UaQFL_My.js.map → edit-ui.es-DJgikaS7.js.map} +1 -1
- package/dist/assets/elo-5Z2qkwtw.js +1 -0
- package/dist/assets/{elo-COgu6Hu5.js → elo-C4ZdbMIJ.js} +2 -2
- package/dist/assets/{elo-COgu6Hu5.js.map → elo-C4ZdbMIJ.js.map} +1 -1
- package/dist/assets/{eloDistance-BV7vfiK5.js → eloDistance-CRxxdYPJ.js} +2 -2
- package/dist/assets/{eloDistance-BV7vfiK5.js.map → eloDistance-CRxxdYPJ.js.map} +1 -1
- package/dist/assets/eloDistance-DF4pmPOI.js +1 -0
- package/dist/assets/{french-Dk7YG8Td-CD7Hms2j.js → french-Dk7YG8Td-C2awfrzV.js} +2 -2
- package/dist/assets/{french-Dk7YG8Td-CD7Hms2j.js.map → french-Dk7YG8Td-C2awfrzV.js.map} +1 -1
- package/dist/assets/french-evUMlbbq-4izQyIk4.js +1 -0
- package/dist/assets/{hierarchyDefinition-DLC5DjaA.js → hierarchyDefinition-BbqnGEfR.js} +2 -2
- package/dist/assets/{hierarchyDefinition-DLC5DjaA.js.map → hierarchyDefinition-BbqnGEfR.js.map} +1 -1
- package/dist/assets/{index-CK-rfSIx.js → index-BRaeVAZb.js} +4 -4
- package/dist/assets/{index-CK-rfSIx.js.map → index-BRaeVAZb.js.map} +1 -1
- package/dist/assets/{interferenceMitigator-D78KgOxz.js → interferenceMitigator-BtAQm-0d.js} +2 -2
- package/dist/assets/{interferenceMitigator-D78KgOxz.js.map → interferenceMitigator-BtAQm-0d.js.map} +1 -1
- package/dist/assets/math-DR3fXDcX-Bj6dcLDF.js +1 -0
- package/dist/assets/{math-D_8HiEQR-E4QDLrWp.js → math-D_8HiEQR-CQynsoTm.js} +2 -2
- package/dist/assets/{math-D_8HiEQR-E4QDLrWp.js.map → math-D_8HiEQR-CQynsoTm.js.map} +1 -1
- package/dist/assets/piano-BN5Btq91-onBUnVgA.js +1 -0
- package/dist/assets/{piano-DF1g6yaX-Ck3BH5EK.js → piano-DF1g6yaX-vXbP1jX_.js} +2 -2
- package/dist/assets/{piano-DF1g6yaX-Ck3BH5EK.js.map → piano-DF1g6yaX-vXbP1jX_.js.map} +1 -1
- package/dist/assets/{pitch-CgGJFkZ1-Dd0LzmEe.js → pitch-CgGJFkZ1-DVzOpIVa.js} +2 -2
- package/dist/assets/{pitch-CgGJFkZ1-Dd0LzmEe.js.map → pitch-CgGJFkZ1-DVzOpIVa.js.map} +1 -1
- package/dist/assets/pitch-Dn0iNqiS-L2k4d66s.js +1 -0
- package/dist/assets/prescribed-Cjutx2ct.js +2 -0
- package/dist/assets/prescribed-Cjutx2ct.js.map +1 -0
- package/dist/assets/{relativePriority-DwPMECAp.js → relativePriority-fx6BMJm9.js} +2 -2
- package/dist/assets/{relativePriority-DwPMECAp.js.map → relativePriority-fx6BMJm9.js.map} +1 -1
- package/dist/assets/{server-CqR7xtQy.js → server-CUqWbXPL.js} +2 -2
- package/dist/assets/{server-CqR7xtQy.js.map → server-CUqWbXPL.js.map} +1 -1
- package/dist/assets/{sightsing-BFQ7HRig-DV69ELZf.js → sightsing-BFQ7HRig-CYuNcd8z.js} +2 -2
- package/dist/assets/{sightsing-BFQ7HRig-DV69ELZf.js.map → sightsing-BFQ7HRig-CYuNcd8z.js.map} +1 -1
- package/dist/assets/sightsing-CJX3k0Fd-C4-zGBSZ.js +1 -0
- package/dist/assets/{srs-DOsG9Y-i.js → srs-B3R2C3TU.js} +2 -2
- package/dist/assets/{srs-DOsG9Y-i.js.map → srs-B3R2C3TU.js.map} +1 -1
- package/dist/assets/srs-BD4FD2rw.js +1 -0
- package/dist/assets/{typing-BevtfWlp-CvStu5BY.js → typing-BevtfWlp-C0NbuTKI.js} +2 -2
- package/dist/assets/{typing-BevtfWlp-CvStu5BY.js.map → typing-BevtfWlp-C0NbuTKI.js.map} +1 -1
- package/dist/assets/typing-k-ojjO7G-gZjZ4YQx.js +1 -0
- package/dist/assets/{userDBKeys-DYLGKnVC.js → userDBKeys-3SQjNVdK.js} +4 -4
- package/dist/assets/{userDBKeys-DYLGKnVC.js.map → userDBKeys-3SQjNVdK.js.map} +1 -1
- package/dist/assets/{userTagPreference-cZCPqadC.js → userTagPreference-B23ZX5J4.js} +2 -2
- package/dist/assets/{userTagPreference-cZCPqadC.js.map → userTagPreference-B23ZX5J4.js.map} +1 -1
- package/dist/assets/validators-CnxSFY0I.js +2 -0
- package/dist/assets/{validators-lpYAHmRR.js.map → validators-CnxSFY0I.js.map} +1 -1
- package/dist/assets/{word-work-BOnRlZgd-CCGZdwyf.js → word-work-BOnRlZgd-CsMkeNdI.js} +2 -2
- package/dist/assets/{word-work-BOnRlZgd-CCGZdwyf.js.map → word-work-BOnRlZgd-CsMkeNdI.js.map} +1 -1
- package/dist/assets/word-work-Dd6tIKrt-WI45cKxO.js +1 -0
- package/dist/index.html +9 -9
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/package.json +7 -7
- package/dist/assets/BaseUserDB-CV2ZPZOR.js +0 -1
- package/dist/assets/CouchDBSyncStrategy-BjM7ROXC.js +0 -1
- package/dist/assets/CourseSyncService-CPU_Ll1h.js +0 -1
- package/dist/assets/PouchDataLayerProvider-DxsnSIKd.js +0 -2
- package/dist/assets/PouchDataLayerProvider-DxsnSIKd.js.map +0 -1
- package/dist/assets/UserDBDebugger-xmycWjck.js +0 -1
- package/dist/assets/chess-Lfm7Fsvs-DgN08Qx9.js +0 -1
- package/dist/assets/contentSource-DwznMSMs.js.map +0 -1
- package/dist/assets/dist-BcwaOf54.js +0 -1
- package/dist/assets/dist-CgW7D_Gh.js +0 -1
- package/dist/assets/dist-Dnehy0sn.js +0 -1
- package/dist/assets/edit-ui.es-BWqvElsJ.js +0 -1
- package/dist/assets/elo-Cwa8a3Yo.js +0 -1
- package/dist/assets/eloDistance-MReQeAuj.js +0 -1
- package/dist/assets/french-evUMlbbq-nGCjilG6.js +0 -1
- package/dist/assets/math-DR3fXDcX-C9KfHLHP.js +0 -1
- package/dist/assets/piano-BN5Btq91-CnKhyLGE.js +0 -1
- package/dist/assets/pitch-Dn0iNqiS-BxAdpDDb.js +0 -1
- package/dist/assets/prescribed-BWO17Gan.js +0 -2
- package/dist/assets/prescribed-BWO17Gan.js.map +0 -1
- package/dist/assets/sightsing-CJX3k0Fd-CG94OiDr.js +0 -1
- package/dist/assets/srs-DGscV6W4.js +0 -1
- package/dist/assets/typing-k-ojjO7G-AF8vU_q7.js +0 -1
- package/dist/assets/validators-lpYAHmRR.js +0 -2
- package/dist/assets/word-work-Dd6tIKrt-BNTSCq5F.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,r as t}from"./chunk-D6hFPZc3.js";import{$ as n,C as r,H as i,Ht as a,I as o,K as s,Lt as c,N as l,S as u,T as d,W as f,Z as p,_ as m,b as h,f as g,ft as _,g as v,gt as y,l as b,ut as x,v as S,y as C,z as w,zt as T}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{D as E,O as D}from"./contentSource-DwznMSMs.js";import{n as O,t as k}from"./tagRoles-jR-PJAgj.js";import{n as A}from"./index-CK-rfSIx.js";var j={cardHistory:`cardH`,scheduled:`card_review_`,session:`SESSION::`,strategyState:`STRATEGY_STATE::`,registrations:`CourseRegistrations`};function toIsoTimestamp(e){if(typeof e==`number`)return new Date(e).toISOString();let t=String(e??``),n=Date.parse(t);return Number.isNaN(n)?t:new Date(n).toISOString()}function dumpFileName(e){return`userdb-${e.username}-${e.fetchedAt.slice(0,16).replace(`:`,``)}Z.json`}function parseLearnerDump(e){let t=JSON.parse(e);if(!t||typeof t.username!=`string`||!Array.isArray(t.docs))throw Error("[diagnostics] Not a learner dump: expected `username` and a `docs` array");return t}function questionTypeOf(e){if(typeof e!=`string`)return;let t=e.split(`.`);return t.length>=2?t[t.length-2]:e}function summarizeCards(e){let t=new Map(e.displayableData.map(e=>[e._id,e])),n=new Map;for(let r of e.cards){let e={};for(let n of t.get(r.id_displayable_data?.[0]??``)?.data??[])e[n.name]=n.data;n.set(r._id,{cardId:r._id,questionType:questionTypeOf(r.id_view),elo:r.elo,tags:[],data:e})}for(let t of e.tags)for(let e of t.taggedCards??[])n.get(e)?.tags.push(t.name);return n}function inferCourseId(e){if(e.courseId)return e.courseId;if(e.course)return e.course.courseId;let t=new Map;for(let n of e.docs)n._id.startsWith(j.session)&&typeof n.courseId==`string`&&t.set(n.courseId,(t.get(n.courseId)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0]}function fromDump(e,t){let n=t??inferCourseId(e);if(!n)throw Error(`[diagnostics] No course id given, and none found in the dump`);let r=[],i=[],a=[],o={},s;for(let t of e.docs){let e=t._id;if(e.startsWith(j.session))t.courseId===n&&r.push(t);else if(e.startsWith(j.cardHistory)){if(t.courseID!==n)continue;let e=t;i.push({...e,records:(e.records??[]).map(e=>({...e,timeStamp:toIsoTimestamp(e.timeStamp)})).sort((e,t)=>e.timeStamp.localeCompare(t.timeStamp))})}else if(e.startsWith(j.scheduled))t.courseId===n&&a.push(t);else if(e.startsWith(j.strategyState)){let[,r,i]=e.split(`::`);r===n&&i&&(o[i]=t.data)}else e===j.registrations&&(s=t)}return r.sort((e,t)=>e.startTime.localeCompare(t.startTime)),a.sort((e,t)=>String(e.reviewTime).localeCompare(String(t.reviewTime))),{username:e.username,courseId:n,asOf:e.fetchedAt,sessions:r,cardHistories:i,scheduled:a,registration:s,strategyState:o,tombstones:(e.tombstones??[]).map(({id:e,seq:t})=>({id:e,seq:t})),...e.course&&e.course.courseId===n?{cards:summarizeCards(e.course),...e.course.strategies?{strategies:e.course.strategies}:{}}:{}}}function userDbName(e){let t=``;for(let n of new TextEncoder().encode(e))t+=n.toString(16).padStart(2,`0`);return`userdb-`+t}function base64(e){let t=``;for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function trimTrailingSlashes(e){let t=e.length;for(;t>0&&e[t-1]===`/`;)t--;return e.slice(0,t)}function couchReader(e){let t=e.fetchImpl??fetch,n=trimTrailingSlashes(e.couchUrl),r={Accept:`application/json`};e.auth.kind===`basic`&&(r.Authorization=`Basic `+base64(`${e.auth.username}:${e.auth.password}`));let i=e.auth.kind===`cookie`?`include`:void 0;async function get(e,a={}){let o=await t(`${n}/${e}`,{method:a.method??`GET`,headers:a.body?{...r,"Content-Type":`application/json`}:r,...a.body?{body:JSON.stringify(a.body)}:{},...i?{credentials:i}:{}});if(!o.ok){let t=await o.text().catch(()=>``);throw Error(`[diagnostics] ${a.method??`GET`} ${e} -> ${o.status} ${t}`)}return await o.json()}async function byKeys(e,t){let n=[];for(let r=0;r<t.length;r+=500){let i=await get(`${e}/_all_docs?include_docs=true`,{method:`POST`,body:{keys:t.slice(r,r+500)}});for(let e of i.rows)e.doc&&n.push(e.doc)}return n}async function byPrefix(e,t){return(await get(`${e}/_all_docs?${new URLSearchParams({include_docs:`true`,startkey:JSON.stringify(t),endkey:JSON.stringify(t+``)})}`)).rows.map(e=>e.doc).filter(e=>!!e)}return{base:n,get,byKeys,byPrefix}}function touchedCardIds(e){let t=new Set;for(let n of e)if(n._id.startsWith(`cardH`)&&typeof n.cardID==`string`)t.add(n.cardID);else if(n._id.startsWith(`card_review_`)&&typeof n.cardId==`string`)t.add(n.cardId);else if(n._id.startsWith(`SESSION::`)&&Array.isArray(n.eloEvents))for(let e of n.eloEvents)e.cardId&&t.add(e.cardId);return[...t]}async function fetchLearnerDump(e){let t=couchReader(e),n=userDbName(e.username),r=new Date().toISOString(),i=await t.get(n),a=new URLSearchParams({include_docs:`true`});e.attachments&&a.set(`attachments`,`true`);let o=(await t.get(`${n}/_all_docs?${a}`)).rows.map(e=>e.doc).filter(e=>!!e),s=(await t.get(`${n}/_changes?style=main_only`)).results.filter(e=>e.deleted).map(e=>({id:e.id,rev:e.changes[0]?.rev,seq:Number(String(e.seq).split(`-`)[0])})),c=e.cards??`touched`,l;if(c!==`none`){let n=`coursedb-${e.courseId}`,r;r=c===`all`?(await t.get(`${n}/_find`,{method:`POST`,body:{selector:{docType:`CARD`},limit:1e6}})).docs:await t.byKeys(n,touchedCardIds(o));let i=new Set(r.map(e=>e._id)),a=new Set;for(let e of r)for(let t of e.id_displayable_data??[])a.add(t);let s=await t.byKeys(n,[...a]),u=(await t.byPrefix(n,`TAG`)).map(e=>{let t=Array.isArray(e.taggedCards)?e.taggedCards:[];return{...e,taggedCount:t.length,taggedCards:c===`all`?t:t.filter(e=>i.has(e))}}).filter(e=>c===`all`||e.taggedCards.length>0),d=await t.byPrefix(n,`NAVIGATION_STRATEGY`);l={courseId:e.courseId,source:`${t.base}/${n}`,scope:c,cards:r,displayableData:s,tags:u,strategies:d}}return{formatVersion:1,username:e.username,dbName:n,source:t.base,fetchedAt:r,courseId:e.courseId,info:i,docs:o,tombstones:s,...l?{course:l}:{}}}var isSkillTag=(e,t)=>e?.isSkillTag?.(t)??!1,shortTag=(e,t)=>e?.shortTag?.(t)??t;function bySkillThenName(e){return(t,n)=>{let r=Number(isSkillTag(e,n))-Number(isSkillTag(e,t));return r===0?t.localeCompare(n):r}}function defaultSnapshotMetrics(e){let t={};for(let[n,r]of Object.entries(e))if(typeof r==`number`)t[n]=r;else if(r&&typeof r==`object`&&!Array.isArray(r))for(let[e,i]of Object.entries(r))typeof i==`number`&&(t[`${n}.${e}`]=i);return t}var M={churned:{label:`Churned`,help:`Many pipeline runs relative to cards served: the plan kept being rebuilt rather than consumed.`},"out-of-content":{label:`Out of content`,help:`Ended with time left on the clock: content ran out before the session did.`},walked:{label:`Walked`,help:`Abandoned or never closed, after real time invested. Not a mis-click.`},stalled:{label:`Stalled`,help:`No progress metric moved and ELO was essentially flat. The sitting produced nothing measurable.`},grinding:{label:`Grinding`,help:`Majority-incorrect, or ended with unfinished cards still in the failed queue.`}},N={churnRunsPerCard:1/3,churnMinCards:4,outOfContentSeconds:20,walkMinCards:2,stallEloEpsilon:5,grindAccuracy:.5};function stateRows(e,t){let n=t?.snapshotMetrics??defaultSnapshotMetrics,r=e.stateAtStart?n(e.stateAtStart):{},i=e.stateAtEnd?n(e.stateAtEnd):{};return[...new Set([...Object.keys(r),...Object.keys(i)])].map(e=>{let t=r[e]??null,n=i[e]??null;return{label:e,from:t,to:n,delta:t!==null&&n!==null?n-t:null}})}function flagSession(e,t){let n=N,{doc:r,accuracy:i,eloNet:a}=e,o=[],s=r.tally?.cardsPresented??0,c=r.runs?.length??0;s>=n.churnMinCards&&c/s>n.churnRunsPerCard&&o.push(`churned`),r.status===`closed`&&(r.tally?.secondsRemaining??0)>n.outOfContentSeconds&&o.push(`out-of-content`),(r.status===`open`||r.status===`abandoned`&&s>=n.walkMinCards)&&o.push(`walked`);let l=e.state.filter(e=>t?.progressMetrics?.includes(e.label)),u=a!==null||l.some(e=>e.delta!==null);return s>0&&u&&l.every(e=>(e.delta??0)===0)&&Math.abs(a??0)<n.stallEloEpsilon&&o.push(`stalled`),(i!==null&&i<n.grindAccuracy&&s>0||(r.tally?.failedQRemaining??0)>0)&&o.push(`grinding`),o}function summarizeSession(e,t){let n=Date.parse(e.startTime),r=e.endTime?Date.parse(e.endTime):NaN,i=Number.isNaN(n)||Number.isNaN(r)?null:Math.round((r-n)/1e3),a=e.tally?.responses??0,o=a>0?(e.tally?.correct??0)/a:null,s=e.eloEvents??[],c={doc:e,durationSeconds:i,accuracy:o,eloNet:s.length?s.reduce((e,t)=>e+(t.global.after-t.global.before),0):null,state:stateRows(e,t)};return{...c,flags:flagSession(c,t)}}function summarizeSessions(e,t){return e.sessions.map(e=>summarizeSession(e,t)).reverse()}function toResponseEloDelta(e,t){let n=bySkillThenName(t),r=Object.entries(e.tags??{}).map(([e,t])=>({tag:e,before:t.before,after:t.after,delta:t.after-t.before,score:t.score})).sort((e,t)=>n(e.tag,t.tag));return{userScore:e.userScore,global:{before:e.global.before,after:e.global.after,delta:e.global.after-e.global.before},...e.card?{card:{before:e.card.before,after:e.card.after,delta:e.card.after-e.card.before}}:{},tags:r}}function attachEloEvents(e,t,n){let r=new Set;for(let i of t){let t=Date.parse(i.at),a=-1,o=1/0;e.forEach((e,n)=>{if(r.has(n)||e.cardId!==i.cardId)return;let s=Math.abs(Date.parse(e.at)+e.timeSpentMs-t);s<o&&(o=s,a=n)}),a>=0&&(r.add(a),e[a].elo=toResponseEloDelta(i,n))}}function byTime(e,t){let n=Date.parse(e.at),r=Date.parse(t.at);return Number.isNaN(n)||Number.isNaN(r)?e.at.localeCompare(t.at):n-r}function sessionDetail(e,t,n){let r=e.sessions.find(e=>e.sessionId===t);if(!r)return null;let i=[];for(let r of e.cardHistories){let a=e.cards?.get(r.cardID);for(let e of r.records)e.sessionId===t&&i.push({kind:`response`,at:e.timeStamp,cardId:r.cardID,...a?{card:a,questionType:a.questionType}:{},tags:a?[...a.tags].sort(bySkillThenName(n)):[],isCorrect:typeof e.isCorrect==`boolean`?e.isCorrect:null,timeSpentMs:e.timeSpent??0,priorAttempts:typeof e.priorAttemps==`number`?e.priorAttemps:null,userAnswer:e.userAnswer})}r.eloEvents?.length&&attachEloEvents(i,r.eloEvents,n);let a=[...(r.runs??[]).map(e=>({kind:`run`,at:e.at,run:e})),...i].sort(byTime);return{summary:summarizeSession(r,n),timeline:a,responsesMissing:(r.tally?.responses??0)>i.length}}function servedTags(e,t){let n=new Map;for(let t of e)if(t.kind===`response`)for(let e of t.tags){let r=n.get(e);r||(r={responses:0,correct:0,incorrect:0,totalTimeMs:0,cards:new Set},n.set(e,r)),r.responses+=1,r.totalTimeMs+=t.timeSpentMs,r.cards.add(t.cardId),t.isCorrect===!0?r.correct+=1:t.isCorrect===!1&&(r.incorrect+=1)}return[...n.entries()].map(([e,t])=>{let n=t.correct+t.incorrect;return{tag:e,responses:t.responses,correct:t.correct,incorrect:t.incorrect,accuracy:n>0?t.correct/n:null,totalTimeMs:t.totalTimeMs,cards:t.cards.size}}).sort((e,n)=>{let r=Number(isSkillTag(t,n.tag))-Number(isSkillTag(t,e.tag));return r===0?n.responses===e.responses?e.tag.localeCompare(n.tag):n.responses-e.responses:r})}function eloLedger(e){let t={count:0,net:0,gained:0,lost:0,wins:0,losses:0};for(let n of e){if(n.kind!==`response`||!n.elo)continue;let e=n.elo.global.delta;t.count+=1,t.net+=e,e>0?(t.gained+=e,t.wins+=1):e<0&&(t.lost+=e,t.losses+=1)}return t.count?t:null}var P=3;function cardDossiers(e){let t=Date.parse(e.asOf),n=new Map;for(let t of e.scheduled){let e=String(t.reviewTime),r=n.get(t.cardId);(!r||e<r)&&n.set(t.cardId,e)}return e.cardHistories.map(r=>{let i=e.cards?.get(r.cardID),a=r.records.filter(e=>e.isCorrect===!1).length,o=r.records.reduce((e,t)=>e+(t.timeSpent??0),0),s=n.get(r.cardID),c=s?{reviewTime:s,overdue:Date.parse(s)<=t}:null,l=i?.elo?.global?.score??null,u=i?.elo?.global?.count??null;return{cardId:r.cardID,...i?{card:i}:{},records:r.records,lapses:r.lapses??0,streak:r.streak??0,bestIntervalSeconds:r.bestInterval??0,attempts:r.records.length,fails:a,firstSeen:r.records[0]?.timeStamp??null,lastSeen:r.records[r.records.length-1]?.timeStamp??null,totalTimeMs:o,pendingReview:c,cardElo:l,cardEloCount:u,stuck:a>0&&!!c?.overdue,frozenElo:a>=P&&u!==null&&u<a,painScore:o*(a+1)}}).sort((e,t)=>t.painScore-e.painScore)}function recordPerformance(e){let t=e.performance;return typeof t==`number`?t:t&&typeof t==`object`&&typeof t._global==`number`?t._global:null}function runCardSource(e){return e.required?`required: ${e.required}`:e.generator??`unknown`}function selectedBySource(e){let t=new Map;for(let n of e.cards??[]){if(!n.selected)continue;let e=runCardSource(n);t.set(e,(t.get(e)??0)+1)}return[...t].map(([e,t])=>({source:e,count:t})).sort((e,t)=>t.count-e.count)}function pipelineRunStats(e,t={}){let n=e.sessions.filter(e=>!t.since||e.startTime>=t.since),r=new Map;for(let t of e.cardHistories)for(let e of t.records){if(!e.sessionId)continue;let n=r.get(e.sessionId)??[];n.push({cardId:t.cardID,record:e}),r.set(e.sessionId,n)}let i=new Map,gen=e=>{let t=i.get(e);return t||(t={name:e,runs:0,cards:0,newCards:0,reviewCards:0,topScoreMax:0,topScoreLast:0,selected:0,firstAttempts:0,firstAttemptsCorrect:0},i.set(e,t)),t},a=new Map,o=new Map,s=0,c=0,l=0,u,d;for(let e of n){let t=new Map;for(let n of e.runs??[]){s++,(!u||n.at<u)&&(u=n.at),(!d||n.at>d)&&(d=n.at);for(let e of n.generators??[]){let t=gen(e.name);t.runs++,t.cards+=e.cardCount,t.newCards+=e.newCount,t.reviewCards+=e.reviewCount,t.topScoreMax=Math.max(t.topScoreMax,e.topScore),t.topScoreLast=e.topScore}for(let e of n.filters??[]){let t=a.get(e.name)??{name:e.name,runs:0,boosted:0,penalized:0,passed:0,removed:0};t.runs++,e.kind&&(t.kind=e.kind),t.boosted+=e.boosted,t.penalized+=e.penalized,t.passed+=e.passed,t.removed+=e.removed,a.set(e.name,t)}for(let e of n.regulators??[]){let t=o.get(e.name)??{name:e.name,class:e.class,runs:0,meanMultiplier:0,maxMultiplier:0,runsActive:0,last:e,sumMultiplier:0};t.runs++,t.sumMultiplier+=e.multiplier,t.maxMultiplier=Math.max(t.maxMultiplier,e.multiplier),e.multiplier>1&&t.runsActive++,t.last=e,o.set(e.name,t)}if(n.cards){c++;for(let e of n.cards)if(e.selected){if(!e.generator){l++;continue}gen(e.generator).selected++,t.has(e.cardId)||t.set(e.cardId,e.generator)}}}for(let{cardId:n,record:i}of r.get(e.sessionId)??[]){let e=t.get(n);if(!e||i.priorAttemps!==0)continue;let r=gen(e);r.firstAttempts++,i.isCorrect===!0&&r.firstAttemptsCorrect++}}return{sessions:n.length,runs:s,runsWithSelection:c,firstRunAt:u,lastRunAt:d,generators:[...i.values()].map(({cards:e,newCards:t,reviewCards:n,...r})=>({...r,meanCards:r.runs?e/r.runs:0,meanNew:r.runs?t/r.runs:0,meanReview:r.runs?n/r.runs:0})).sort((e,t)=>t.runs-e.runs||e.name.localeCompare(t.name)),filters:[...a.values()].sort((e,t)=>e.name.localeCompare(t.name)),regulators:[...o.values()].map(({sumMultiplier:e,...t})=>({...t,meanMultiplier:t.runs?e/t.runs:0})),selectedUnattributed:l}}function fmtDelta(e){if(e===null)return`—`;if(e===0)return`0`;let t=Number.isInteger(e)?e:Number(e.toFixed(1));return t>0?`+${t}`:String(t)}function fmtDuration(e){let t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m${t%60}s`:`${n}m`:`${(n/60).toFixed(1)}h`}function fmtAnswer(e,t=40){if(e==null)return``;if(typeof e==`string`||typeof e==`number`)return String(e);try{let n=JSON.stringify(e);return n.length>t?`${n.slice(0,t)}…`:n}catch{return String(e)}}function fmtScore(e){return e===null||!Number.isFinite(e)?`∞`:Math.abs(e)>=.01||e===0?e.toFixed(2):e.toExponential(1)}function trailText(e,t){let n=[` ${e}: ${t.cardId} (${t.origin}, ${runCardSource(t)}) final ${fmtScore(t.score)}`];for(let e of t.trail)n.push(` ${e.action} ${e.strategyName} → ${fmtScore(e.score)}: ${e.reason}`);return n}function regulatorText(e){let t=e.inputs;if(e.name===`review-mass`)return`review mass ${e.urgency.toFixed(1)} over ${t.due??e.applied} due (healthy ${t.healthyMass}) → ×${e.multiplier.toFixed(2)}`;let n=t.frozenHours?`, ${t.frozenHours.toFixed(1)}h frozen`:``;return`intake ${e.urgency.toFixed(1)}h since a new card${n}; ${t.eligibleNew??e.applied}/${t.newCandidates??`?`} new eligible → ×${e.multiplier.toFixed(2)}`}function runText(e){let t=[];if(t.push(`RUN ${e.label}${e.mode?` [${e.mode}]`:``} @ ${e.at} — generated ${e.generatedCount} → selected ${e.finalCount} (${e.newSelected} new, ${e.reviewsSelected} review)`+(e.generatedCount>0&&e.finalCount===0?` ⚠ nothing survived`:``)),typeof e.userElo==`number`&&t.push(` userElo: ${Math.round(e.userElo)}`),e.versions&&t.push(` versions: strategies ${e.versions.strategies??`—`} · content ${e.versions.content??`—`}`),e.generators?.length){t.push(` generators:`);for(let n of e.generators)t.push(` - ${n.name}: ${n.cardCount} cards (${n.newCount} new, ${n.reviewCount} review), topScore ${n.topScore.toFixed(2)}`)}if(e.filters?.length){t.push(` filters:`);for(let n of e.filters)t.push(` - ${n.name}${n.kind?` (${n.kind})`:``}: +${n.boosted} boosted, -${n.penalized} penalized, ${n.passed} passed, ${n.removed} removed`)}if(e.regulators?.length){t.push(` regulators:`);for(let n of e.regulators)t.push(` - ${regulatorText(n)}`)}if(e.hints&&t.push(` hints: ${JSON.stringify(e.hints)}`),e.cards?.length){let n=selectedBySource(e).map(e=>`${e.source} ${e.count}`);n.length&&t.push(` selected by source: ${n.join(` · `)}`),t.push(` selection (✓ selected, · runner-up):`);for(let n of e.cards)t.push(` ${n.selected?`✓`:`·`} ${n.cardId} (${n.origin}, ${runCardSource(n)}) ${fmtScore(n.score)}`)}if(e.unselectedNew?.nextInLine&&t.push(...trailText(`next new in line`,e.unselectedNew.nextInLine)),e.unselectedNew?.topGenerated&&t.push(...trailText(`top-generated new (sunk)`,e.unselectedNew.topGenerated)),e.discardedTail){let n=e.discardedTail;t.push(` discardedTail: ${n.count} cards`+(n.scoreRange?` · score [${n.scoreRange[0].toFixed(2)}, ${n.scoreRange[1].toFixed(2)}]`:``)+(n.eloRange?` · elo [${Math.round(n.eloRange[0])}, ${Math.round(n.eloRange[1])}]`:``)),n.note&&t.push(` ${n.note}`)}return t.join(`
|
|
1
|
+
import{i as e,r as t}from"./chunk-D6hFPZc3.js";import{$ as n,C as r,H as i,Ht as a,I as o,K as s,Lt as c,N as l,S as u,T as d,W as f,Z as p,_ as m,b as h,f as g,ft as _,g as v,gt as y,l as b,ut as x,v as S,y as C,z as w,zt as T}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{D as E,O as D}from"./contentSource-FGhM_ge8.js";import{n as O,t as k}from"./tagRoles-jR-PJAgj.js";import{n as A}from"./index-BRaeVAZb.js";var j={cardHistory:`cardH`,scheduled:`card_review_`,session:`SESSION::`,strategyState:`STRATEGY_STATE::`,registrations:`CourseRegistrations`};function toIsoTimestamp(e){if(typeof e==`number`)return new Date(e).toISOString();let t=String(e??``),n=Date.parse(t);return Number.isNaN(n)?t:new Date(n).toISOString()}function dumpFileName(e){return`userdb-${e.username}-${e.fetchedAt.slice(0,16).replace(`:`,``)}Z.json`}function parseLearnerDump(e){let t=JSON.parse(e);if(!t||typeof t.username!=`string`||!Array.isArray(t.docs))throw Error("[diagnostics] Not a learner dump: expected `username` and a `docs` array");return t}function questionTypeOf(e){if(typeof e!=`string`)return;let t=e.split(`.`);return t.length>=2?t[t.length-2]:e}function summarizeCards(e){let t=new Map(e.displayableData.map(e=>[e._id,e])),n=new Map;for(let r of e.cards){let e={};for(let n of t.get(r.id_displayable_data?.[0]??``)?.data??[])e[n.name]=n.data;n.set(r._id,{cardId:r._id,questionType:questionTypeOf(r.id_view),elo:r.elo,tags:[],data:e})}for(let t of e.tags)for(let e of t.taggedCards??[])n.get(e)?.tags.push(t.name);return n}function inferCourseId(e){if(e.courseId)return e.courseId;if(e.course)return e.course.courseId;let t=new Map;for(let n of e.docs)n._id.startsWith(j.session)&&typeof n.courseId==`string`&&t.set(n.courseId,(t.get(n.courseId)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0]}function fromDump(e,t){let n=t??inferCourseId(e);if(!n)throw Error(`[diagnostics] No course id given, and none found in the dump`);let r=[],i=[],a=[],o={},s;for(let t of e.docs){let e=t._id;if(e.startsWith(j.session))t.courseId===n&&r.push(t);else if(e.startsWith(j.cardHistory)){if(t.courseID!==n)continue;let e=t;i.push({...e,records:(e.records??[]).map(e=>({...e,timeStamp:toIsoTimestamp(e.timeStamp)})).sort((e,t)=>e.timeStamp.localeCompare(t.timeStamp))})}else if(e.startsWith(j.scheduled))t.courseId===n&&a.push(t);else if(e.startsWith(j.strategyState)){let[,r,i]=e.split(`::`);r===n&&i&&(o[i]=t.data)}else e===j.registrations&&(s=t)}return r.sort((e,t)=>e.startTime.localeCompare(t.startTime)),a.sort((e,t)=>String(e.reviewTime).localeCompare(String(t.reviewTime))),{username:e.username,courseId:n,asOf:e.fetchedAt,sessions:r,cardHistories:i,scheduled:a,registration:s,strategyState:o,tombstones:(e.tombstones??[]).map(({id:e,seq:t})=>({id:e,seq:t})),...e.course&&e.course.courseId===n?{cards:summarizeCards(e.course),...e.course.strategies?{strategies:e.course.strategies}:{}}:{}}}function userDbName(e){let t=``;for(let n of new TextEncoder().encode(e))t+=n.toString(16).padStart(2,`0`);return`userdb-`+t}function base64(e){let t=``;for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function trimTrailingSlashes(e){let t=e.length;for(;t>0&&e[t-1]===`/`;)t--;return e.slice(0,t)}function couchReader(e){let t=e.fetchImpl??fetch,n=trimTrailingSlashes(e.couchUrl),r={Accept:`application/json`};e.auth.kind===`basic`&&(r.Authorization=`Basic `+base64(`${e.auth.username}:${e.auth.password}`));let i=e.auth.kind===`cookie`?`include`:void 0;async function get(e,a={}){let o=await t(`${n}/${e}`,{method:a.method??`GET`,headers:a.body?{...r,"Content-Type":`application/json`}:r,...a.body?{body:JSON.stringify(a.body)}:{},...i?{credentials:i}:{}});if(!o.ok){let t=await o.text().catch(()=>``);throw Error(`[diagnostics] ${a.method??`GET`} ${e} -> ${o.status} ${t}`)}return await o.json()}async function byKeys(e,t){let n=[];for(let r=0;r<t.length;r+=500){let i=await get(`${e}/_all_docs?include_docs=true`,{method:`POST`,body:{keys:t.slice(r,r+500)}});for(let e of i.rows)e.doc&&n.push(e.doc)}return n}async function byPrefix(e,t){return(await get(`${e}/_all_docs?${new URLSearchParams({include_docs:`true`,startkey:JSON.stringify(t),endkey:JSON.stringify(t+``)})}`)).rows.map(e=>e.doc).filter(e=>!!e)}return{base:n,get,byKeys,byPrefix}}function touchedCardIds(e){let t=new Set;for(let n of e)if(n._id.startsWith(`cardH`)&&typeof n.cardID==`string`)t.add(n.cardID);else if(n._id.startsWith(`card_review_`)&&typeof n.cardId==`string`)t.add(n.cardId);else if(n._id.startsWith(`SESSION::`)&&Array.isArray(n.eloEvents))for(let e of n.eloEvents)e.cardId&&t.add(e.cardId);return[...t]}async function fetchLearnerDump(e){let t=couchReader(e),n=userDbName(e.username),r=new Date().toISOString(),i=await t.get(n),a=new URLSearchParams({include_docs:`true`});e.attachments&&a.set(`attachments`,`true`);let o=(await t.get(`${n}/_all_docs?${a}`)).rows.map(e=>e.doc).filter(e=>!!e),s=(await t.get(`${n}/_changes?style=main_only`)).results.filter(e=>e.deleted).map(e=>({id:e.id,rev:e.changes[0]?.rev,seq:Number(String(e.seq).split(`-`)[0])})),c=e.cards??`touched`,l;if(c!==`none`){let n=`coursedb-${e.courseId}`,r;r=c===`all`?(await t.get(`${n}/_find`,{method:`POST`,body:{selector:{docType:`CARD`},limit:1e6}})).docs:await t.byKeys(n,touchedCardIds(o));let i=new Set(r.map(e=>e._id)),a=new Set;for(let e of r)for(let t of e.id_displayable_data??[])a.add(t);let s=await t.byKeys(n,[...a]),u=(await t.byPrefix(n,`TAG`)).map(e=>{let t=Array.isArray(e.taggedCards)?e.taggedCards:[];return{...e,taggedCount:t.length,taggedCards:c===`all`?t:t.filter(e=>i.has(e))}}).filter(e=>c===`all`||e.taggedCards.length>0),d=await t.byPrefix(n,`NAVIGATION_STRATEGY`);l={courseId:e.courseId,source:`${t.base}/${n}`,scope:c,cards:r,displayableData:s,tags:u,strategies:d}}return{formatVersion:1,username:e.username,dbName:n,source:t.base,fetchedAt:r,courseId:e.courseId,info:i,docs:o,tombstones:s,...l?{course:l}:{}}}var isSkillTag=(e,t)=>e?.isSkillTag?.(t)??!1,shortTag=(e,t)=>e?.shortTag?.(t)??t;function bySkillThenName(e){return(t,n)=>{let r=Number(isSkillTag(e,n))-Number(isSkillTag(e,t));return r===0?t.localeCompare(n):r}}function defaultSnapshotMetrics(e){let t={};for(let[n,r]of Object.entries(e))if(typeof r==`number`)t[n]=r;else if(r&&typeof r==`object`&&!Array.isArray(r))for(let[e,i]of Object.entries(r))typeof i==`number`&&(t[`${n}.${e}`]=i);return t}var M={churned:{label:`Churned`,help:`Many pipeline runs relative to cards served: the plan kept being rebuilt rather than consumed.`},"out-of-content":{label:`Out of content`,help:`Ended with time left on the clock: content ran out before the session did.`},walked:{label:`Walked`,help:`Abandoned or never closed, after real time invested. Not a mis-click.`},stalled:{label:`Stalled`,help:`No progress metric moved and ELO was essentially flat. The sitting produced nothing measurable.`},grinding:{label:`Grinding`,help:`Majority-incorrect, or ended with unfinished cards still in the failed queue.`}},N={churnRunsPerCard:1/3,churnMinCards:4,outOfContentSeconds:20,walkMinCards:2,stallEloEpsilon:5,grindAccuracy:.5};function stateRows(e,t){let n=t?.snapshotMetrics??defaultSnapshotMetrics,r=e.stateAtStart?n(e.stateAtStart):{},i=e.stateAtEnd?n(e.stateAtEnd):{};return[...new Set([...Object.keys(r),...Object.keys(i)])].map(e=>{let t=r[e]??null,n=i[e]??null;return{label:e,from:t,to:n,delta:t!==null&&n!==null?n-t:null}})}function flagSession(e,t){let n=N,{doc:r,accuracy:i,eloNet:a}=e,o=[],s=r.tally?.cardsPresented??0,c=r.runs?.length??0;s>=n.churnMinCards&&c/s>n.churnRunsPerCard&&o.push(`churned`),r.status===`closed`&&(r.tally?.secondsRemaining??0)>n.outOfContentSeconds&&o.push(`out-of-content`),(r.status===`open`||r.status===`abandoned`&&s>=n.walkMinCards)&&o.push(`walked`);let l=e.state.filter(e=>t?.progressMetrics?.includes(e.label)),u=a!==null||l.some(e=>e.delta!==null);return s>0&&u&&l.every(e=>(e.delta??0)===0)&&Math.abs(a??0)<n.stallEloEpsilon&&o.push(`stalled`),(i!==null&&i<n.grindAccuracy&&s>0||(r.tally?.failedQRemaining??0)>0)&&o.push(`grinding`),o}function summarizeSession(e,t){let n=Date.parse(e.startTime),r=e.endTime?Date.parse(e.endTime):NaN,i=Number.isNaN(n)||Number.isNaN(r)?null:Math.round((r-n)/1e3),a=e.tally?.responses??0,o=a>0?(e.tally?.correct??0)/a:null,s=e.eloEvents??[],c={doc:e,durationSeconds:i,accuracy:o,eloNet:s.length?s.reduce((e,t)=>e+(t.global.after-t.global.before),0):null,state:stateRows(e,t)};return{...c,flags:flagSession(c,t)}}function summarizeSessions(e,t){return e.sessions.map(e=>summarizeSession(e,t)).reverse()}function toResponseEloDelta(e,t){let n=bySkillThenName(t),r=Object.entries(e.tags??{}).map(([e,t])=>({tag:e,before:t.before,after:t.after,delta:t.after-t.before,score:t.score})).sort((e,t)=>n(e.tag,t.tag));return{userScore:e.userScore,global:{before:e.global.before,after:e.global.after,delta:e.global.after-e.global.before},...e.card?{card:{before:e.card.before,after:e.card.after,delta:e.card.after-e.card.before}}:{},tags:r}}function attachEloEvents(e,t,n){let r=new Set;for(let i of t){let t=Date.parse(i.at),a=-1,o=1/0;e.forEach((e,n)=>{if(r.has(n)||e.cardId!==i.cardId)return;let s=Math.abs(Date.parse(e.at)+e.timeSpentMs-t);s<o&&(o=s,a=n)}),a>=0&&(r.add(a),e[a].elo=toResponseEloDelta(i,n))}}function byTime(e,t){let n=Date.parse(e.at),r=Date.parse(t.at);return Number.isNaN(n)||Number.isNaN(r)?e.at.localeCompare(t.at):n-r}function sessionDetail(e,t,n){let r=e.sessions.find(e=>e.sessionId===t);if(!r)return null;let i=[];for(let r of e.cardHistories){let a=e.cards?.get(r.cardID);for(let e of r.records)e.sessionId===t&&i.push({kind:`response`,at:e.timeStamp,cardId:r.cardID,...a?{card:a,questionType:a.questionType}:{},tags:a?[...a.tags].sort(bySkillThenName(n)):[],isCorrect:typeof e.isCorrect==`boolean`?e.isCorrect:null,timeSpentMs:e.timeSpent??0,priorAttempts:typeof e.priorAttemps==`number`?e.priorAttemps:null,userAnswer:e.userAnswer})}r.eloEvents?.length&&attachEloEvents(i,r.eloEvents,n);let a=[...(r.runs??[]).map(e=>({kind:`run`,at:e.at,run:e})),...i].sort(byTime);return{summary:summarizeSession(r,n),timeline:a,responsesMissing:(r.tally?.responses??0)>i.length}}function servedTags(e,t){let n=new Map;for(let t of e)if(t.kind===`response`)for(let e of t.tags){let r=n.get(e);r||(r={responses:0,correct:0,incorrect:0,totalTimeMs:0,cards:new Set},n.set(e,r)),r.responses+=1,r.totalTimeMs+=t.timeSpentMs,r.cards.add(t.cardId),t.isCorrect===!0?r.correct+=1:t.isCorrect===!1&&(r.incorrect+=1)}return[...n.entries()].map(([e,t])=>{let n=t.correct+t.incorrect;return{tag:e,responses:t.responses,correct:t.correct,incorrect:t.incorrect,accuracy:n>0?t.correct/n:null,totalTimeMs:t.totalTimeMs,cards:t.cards.size}}).sort((e,n)=>{let r=Number(isSkillTag(t,n.tag))-Number(isSkillTag(t,e.tag));return r===0?n.responses===e.responses?e.tag.localeCompare(n.tag):n.responses-e.responses:r})}function eloLedger(e){let t={count:0,net:0,gained:0,lost:0,wins:0,losses:0};for(let n of e){if(n.kind!==`response`||!n.elo)continue;let e=n.elo.global.delta;t.count+=1,t.net+=e,e>0?(t.gained+=e,t.wins+=1):e<0&&(t.lost+=e,t.losses+=1)}return t.count?t:null}var P=3;function cardDossiers(e){let t=Date.parse(e.asOf),n=new Map;for(let t of e.scheduled){let e=String(t.reviewTime),r=n.get(t.cardId);(!r||e<r)&&n.set(t.cardId,e)}return e.cardHistories.map(r=>{let i=e.cards?.get(r.cardID),a=r.records.filter(e=>e.isCorrect===!1).length,o=r.records.reduce((e,t)=>e+(t.timeSpent??0),0),s=n.get(r.cardID),c=s?{reviewTime:s,overdue:Date.parse(s)<=t}:null,l=i?.elo?.global?.score??null,u=i?.elo?.global?.count??null;return{cardId:r.cardID,...i?{card:i}:{},records:r.records,lapses:r.lapses??0,streak:r.streak??0,bestIntervalSeconds:r.bestInterval??0,attempts:r.records.length,fails:a,firstSeen:r.records[0]?.timeStamp??null,lastSeen:r.records[r.records.length-1]?.timeStamp??null,totalTimeMs:o,pendingReview:c,cardElo:l,cardEloCount:u,stuck:a>0&&!!c?.overdue,frozenElo:a>=P&&u!==null&&u<a,painScore:o*(a+1)}}).sort((e,t)=>t.painScore-e.painScore)}function recordPerformance(e){let t=e.performance;return typeof t==`number`?t:t&&typeof t==`object`&&typeof t._global==`number`?t._global:null}function runCardSource(e){return e.required?`required: ${e.required}`:e.generator??`unknown`}function selectedBySource(e){let t=new Map;for(let n of e.cards??[]){if(!n.selected)continue;let e=runCardSource(n);t.set(e,(t.get(e)??0)+1)}return[...t].map(([e,t])=>({source:e,count:t})).sort((e,t)=>t.count-e.count)}function pipelineRunStats(e,t={}){let n=e.sessions.filter(e=>!t.since||e.startTime>=t.since),r=new Map;for(let t of e.cardHistories)for(let e of t.records){if(!e.sessionId)continue;let n=r.get(e.sessionId)??[];n.push({cardId:t.cardID,record:e}),r.set(e.sessionId,n)}let i=new Map,gen=e=>{let t=i.get(e);return t||(t={name:e,runs:0,cards:0,newCards:0,reviewCards:0,topScoreMax:0,topScoreLast:0,selected:0,firstAttempts:0,firstAttemptsCorrect:0},i.set(e,t)),t},a=new Map,o=new Map,s=0,c=0,l=0,u,d;for(let e of n){let t=new Map;for(let n of e.runs??[]){s++,(!u||n.at<u)&&(u=n.at),(!d||n.at>d)&&(d=n.at);for(let e of n.generators??[]){let t=gen(e.name);t.runs++,t.cards+=e.cardCount,t.newCards+=e.newCount,t.reviewCards+=e.reviewCount,t.topScoreMax=Math.max(t.topScoreMax,e.topScore),t.topScoreLast=e.topScore}for(let e of n.filters??[]){let t=a.get(e.name)??{name:e.name,runs:0,boosted:0,penalized:0,passed:0,removed:0};t.runs++,e.kind&&(t.kind=e.kind),t.boosted+=e.boosted,t.penalized+=e.penalized,t.passed+=e.passed,t.removed+=e.removed,a.set(e.name,t)}for(let e of n.regulators??[]){let t=o.get(e.name)??{name:e.name,class:e.class,runs:0,meanMultiplier:0,maxMultiplier:0,runsActive:0,last:e,sumMultiplier:0};t.runs++,t.sumMultiplier+=e.multiplier,t.maxMultiplier=Math.max(t.maxMultiplier,e.multiplier),e.multiplier>1&&t.runsActive++,t.last=e,o.set(e.name,t)}if(n.cards){c++;for(let e of n.cards)if(e.selected){if(!e.generator){l++;continue}gen(e.generator).selected++,t.has(e.cardId)||t.set(e.cardId,e.generator)}}}for(let{cardId:n,record:i}of r.get(e.sessionId)??[]){let e=t.get(n);if(!e||i.priorAttemps!==0)continue;let r=gen(e);r.firstAttempts++,i.isCorrect===!0&&r.firstAttemptsCorrect++}}return{sessions:n.length,runs:s,runsWithSelection:c,firstRunAt:u,lastRunAt:d,generators:[...i.values()].map(({cards:e,newCards:t,reviewCards:n,...r})=>({...r,meanCards:r.runs?e/r.runs:0,meanNew:r.runs?t/r.runs:0,meanReview:r.runs?n/r.runs:0})).sort((e,t)=>t.runs-e.runs||e.name.localeCompare(t.name)),filters:[...a.values()].sort((e,t)=>e.name.localeCompare(t.name)),regulators:[...o.values()].map(({sumMultiplier:e,...t})=>({...t,meanMultiplier:t.runs?e/t.runs:0})),selectedUnattributed:l}}function fmtDelta(e){if(e===null)return`—`;if(e===0)return`0`;let t=Number.isInteger(e)?e:Number(e.toFixed(1));return t>0?`+${t}`:String(t)}function fmtDuration(e){let t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m${t%60}s`:`${n}m`:`${(n/60).toFixed(1)}h`}function fmtAnswer(e,t=40){if(e==null)return``;if(typeof e==`string`||typeof e==`number`)return String(e);try{let n=JSON.stringify(e);return n.length>t?`${n.slice(0,t)}…`:n}catch{return String(e)}}function fmtScore(e){return e===null||!Number.isFinite(e)?`∞`:Math.abs(e)>=.01||e===0?e.toFixed(2):e.toExponential(1)}function trailText(e,t){let n=[` ${e}: ${t.cardId} (${t.origin}, ${runCardSource(t)}) final ${fmtScore(t.score)}`];for(let e of t.trail)n.push(` ${e.action} ${e.strategyName} → ${fmtScore(e.score)}: ${e.reason}`);return n}function regulatorText(e){let t=e.inputs;if(e.name===`review-mass`)return`review mass ${e.urgency.toFixed(1)} over ${t.due??e.applied} due (healthy ${t.healthyMass}) → ×${e.multiplier.toFixed(2)}`;let n=t.frozenHours?`, ${t.frozenHours.toFixed(1)}h frozen`:``;return`intake ${e.urgency.toFixed(1)}h since a new card${n}; ${t.eligibleNew??e.applied}/${t.newCandidates??`?`} new eligible → ×${e.multiplier.toFixed(2)}`}function runText(e){let t=[];if(t.push(`RUN ${e.label}${e.mode?` [${e.mode}]`:``} @ ${e.at} — generated ${e.generatedCount} → selected ${e.finalCount} (${e.newSelected} new, ${e.reviewsSelected} review)`+(e.generatedCount>0&&e.finalCount===0?` ⚠ nothing survived`:``)),typeof e.userElo==`number`&&t.push(` userElo: ${Math.round(e.userElo)}`),e.versions&&t.push(` versions: strategies ${e.versions.strategies??`—`} · content ${e.versions.content??`—`}`),e.generators?.length){t.push(` generators:`);for(let n of e.generators)t.push(` - ${n.name}: ${n.cardCount} cards (${n.newCount} new, ${n.reviewCount} review), topScore ${n.topScore.toFixed(2)}`)}if(e.filters?.length){t.push(` filters:`);for(let n of e.filters)t.push(` - ${n.name}${n.kind?` (${n.kind})`:``}: +${n.boosted} boosted, -${n.penalized} penalized, ${n.passed} passed, ${n.removed} removed`)}if(e.regulators?.length){t.push(` regulators:`);for(let n of e.regulators)t.push(` - ${regulatorText(n)}`)}if(e.hints&&t.push(` hints: ${JSON.stringify(e.hints)}`),e.cards?.length){let n=selectedBySource(e).map(e=>`${e.source} ${e.count}`);n.length&&t.push(` selected by source: ${n.join(` · `)}`),t.push(` selection (✓ selected, · runner-up):`);for(let n of e.cards)t.push(` ${n.selected?`✓`:`·`} ${n.cardId} (${n.origin}, ${runCardSource(n)}) ${fmtScore(n.score)}`)}if(e.unselectedNew?.nextInLine&&t.push(...trailText(`next new in line`,e.unselectedNew.nextInLine)),e.unselectedNew?.topGenerated&&t.push(...trailText(`top-generated new (sunk)`,e.unselectedNew.topGenerated)),e.discardedTail){let n=e.discardedTail;t.push(` discardedTail: ${n.count} cards`+(n.scoreRange?` · score [${n.scoreRange[0].toFixed(2)}, ${n.scoreRange[1].toFixed(2)}]`:``)+(n.eloRange?` · elo [${Math.round(n.eloRange[0])}, ${Math.round(n.eloRange[1])}]`:``)),n.note&&t.push(` ${n.note}`)}return t.join(`
|
|
2
2
|
`)}function scoredTagDeltas(e){return e.tags.filter(e=>e.score!==null&&e.delta!==0).slice(0,4)}function eloSuffix(e,t){if(!e)return``;let n=`ELO g:${e.global.before}→${e.global.after} (${fmtDelta(e.global.delta)})`,r=scoredTagDeltas(e).map(e=>`${shortTag(t,e.tag)}:${fmtDelta(e.delta)}`);return` ${n}${r.length?` | ${r.join(` `)}`:``}`}function clock(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,19)}function sessionText(e,t,n={},r){let i=t.summary,a=i.doc,o=t.timeline.filter(e=>e.kind===`response`).length,s=[];if(s.push(`# Study session ${a.sessionId} — user ${e}`),s.push(``),s.push(`## Legend`),s.push(`- The TIMELINE is one time-ordered stream: RUN lines are pipeline (re)plans;`),s.push(` the lines between them are card responses in the order presented.`),s.push(`- RUN "generated N → selected M (a new, b review)": the pipeline produced N`),s.push(` candidates and chose M. "nothing survived" = generated > 0 but 0 selected.`),s.push(` Bootstrap runs fire before card #1; replans are interleaved by time.`),s.push(`- generators: each source's contribution. filters: how each reshaped scores`),s.push(` (gate: not ready yet; signal: preference). regulators: the pressure on each class,`),s.push(` review mass (due reviews by value) and intake (hours since a new card).`),s.push(` hints: the ReplanHints the navigator was told (_label = replan reason).`),s.push(` versions: the strategy docs' hash and the content version the run ran on; the`),s.push(` headline's are the framework and app versions. A change between runs marks a deploy.`),s.push(` selection: the chosen cards and top runners-up. "next new in line" / "top-generated`),s.push(` new (sunk)": the unselected new cards worth explaining, with each score change.`),s.push(` Each card reads (origin, source). origin: review = a scheduled review, new = anything`),s.push(` else. source: the generator that produced it, or "required: <hint>" when a hint forced`),s.push(` it. Older runs show origin "unknown" for prescribed and hint-required cards.`),s.push(`- RESP "✓/✗ type <cardId> [tags] Ts (attempt k) 'answer'": one presentation and`),s.push(` its outcome. A trailing "ELO g:before→after (Δ) | tag:Δ …" is the exchange it`),s.push(` produced. Only first attempts move ELO.`),s.push(``),s.push(`## Headline`),s.push(`- status: ${a.status}`),s.push(`- start: ${a.startTime}${a.endTime?` · end: ${a.endTime}`:``}`),a.versions&&s.push(`- versions: framework ${a.versions.framework}`+(a.versions.app?` · app ${a.versions.app}`:``)),s.push(`- clock: ${i.durationSeconds??`—`}s of ${a.plannedSeconds}s planned`+(a.tally?` · ${a.tally.secondsRemaining}s remaining`:``)),a.tally&&s.push(`- tally: ${a.tally.cardsPresented} cards, ${a.tally.responses} responses (${a.tally.correct} correct / ${a.tally.incorrect} incorrect) · failedQ remaining ${a.tally.failedQRemaining}`),s.push(`- flags: ${i.flags.length?i.flags.join(`, `):`none`}`),s.push(`- config: batchLimit ${a.config?.defaultBatchLimit??`?`}, ${a.config?.sourceCount??`?`} source(s), opening queues supply ${a.initialQueues?.supplyQ??`?`} / failed ${a.initialQueues?.failedQ??`?`}`),t.responsesMissing&&s.push(`- ⚠ responsesMissing: tally claims ${a.tally?.responses} responses but only ${o} stamped records were found.`),s.push(``),i.state.length){s.push(`## Learner state (start → end, Δ)`);for(let e of i.state)s.push(`- ${e.label}: ${e.from??`—`} → ${e.to??`—`} (${fmtDelta(e.delta)})`);s.push(``)}if(s.push(`## Session hints`),s.push(`- at open: ${a.config?.initHints?JSON.stringify(a.config.initHints):`none`}`),s.push(`- at close: ${a.finalHints?JSON.stringify(a.finalHints):`none`}`),s.push(``),n.servedTags?.length){s.push(`## Served tags`);for(let e of n.servedTags)s.push(`- ${e.tag}: ${e.responses} resp / ${e.cards} card(s), acc ${e.accuracy===null?`n/a`:`${Math.round(e.accuracy*100)}%`} (${e.correct}✓/${e.incorrect}✗), ${(e.totalTimeMs/1e3).toFixed(1)}s`);s.push(``)}let c=n.eloLedger;c&&(s.push(`## ELO ledger (learner global)`),s.push(`- net ${fmtDelta(c.net)} across ${c.count} exchange(s) · gained ${fmtDelta(c.gained)} over ${c.wins} win(s) · lost ${fmtDelta(c.lost)} over ${c.losses} loss(es)`),s.push(``)),s.push(`## Timeline (${t.timeline.length} entries)`);for(let e of t.timeline){if(e.kind===`run`){s.push(runText(e.run));continue}let t=e.isCorrect===!0?`✓`:e.isCorrect===!1?`✗`:`·`,n=e.tags.length?` [${e.tags.join(`, `)}]`:``,i=e.priorAttempts?` (attempt ${e.priorAttempts+1})`:``,a=e.userAnswer==null?``:` '${fmtAnswer(e.userAnswer)}'`;s.push(`RESP ${clock(e.at)} ${t} ${e.questionType??`card`} ${e.cardId}${n} — ${(e.timeSpentMs/1e3).toFixed(1)}s${i}${a}${eloSuffix(e.elo,r)}`)}return s.join(`
|
|
3
3
|
`)}function beforeRole(e,t){let n=RegExp(`(^|:)${t}:(?=.)`).exec(e);return n?e.slice(0,n.index):``}function tagNamespace(e){let t=O(e);if(t)return beforeRole(e,t);let n=e.indexOf(`:`);return n>0?e.slice(0,n):``}function matchesTagBatch(e,t,n=O(e)){return!(t.namespaces&&!t.namespaces.includes(tagNamespace(e))||t.roles&&!t.roles.includes(n??`none`)||t.prefixes&&!t.prefixes.some(t=>e.startsWith(t))||t.excludePrefixes?.some(t=>e.startsWith(t)))}function tagGroupBatch(e){let t=O(e),n=tagNamespace(e),r=[n,t].filter(Boolean).join(`:`)||`(no namespace)`;return{id:r,label:r,namespaces:[n],roles:[t??`none`]}}function learnerCourseElo(e){let t=e.registration?.courses?.find(t=>t.courseID===e.courseId)?.elo;return typeof t==`number`?{global:{score:t,count:0},tags:{},misc:{}}:!t||typeof t!=`object`||!t.global?null:{...t,tags:t.tags??{},misc:t.misc??{}}}function minIso(e,t){return e===null||t<e?t:e}function maxIso(e,t){return e===null||t>e?t:e}function step(e,t,n,r){n!==-1&&e[e.length-1]?.score!==n&&e.push({at:t,score:n}),e.push({at:t,score:r})}function tagEloView(e){let t=learnerCourseElo(e);if(!t)return null;let n=new Map;for(let t of e.cardHistories)for(let e of t.records){let t=e.performance;if(!(!t||typeof t!=`object`))for(let r of Object.keys(t)){if(r===`_global`)continue;let t=n.get(r)??{first:null,last:null};t.first=minIso(t.first,e.timeStamp),t.last=maxIso(t.last,e.timeStamp),n.set(r,t)}}let r=e.sessions.flatMap(e=>e.eloEvents??[]).sort((e,t)=>e.at.localeCompare(t.at)),i=[],a={},o=new Map;for(let e of r){step(i,e.at,e.global.before,e.global.after);for(let[t,n]of Object.entries(e.tags??{}))o.set(t,(o.get(t)??0)+1),!(n.score===null||k(t)||n.after===-1)&&step(a[t]??(a[t]=[]),e.at,n.before,n.after)}let s=Object.entries(t.tags).map(([e,r])=>{let i=O(e),a=k(e)||r.score===-1,s=a?null:r.score,c=r.recent??[],{first:l,last:u}=n.get(e)??{first:null,last:null};for(let e of c)l=minIso(l,e.at),u=maxIso(u,e.at);return{tag:e,role:i,namespace:tagNamespace(e),group:tagGroupBatch(e).id,score:s,...a&&r.score!==-1?{staleScore:r.score}:{},count:r.count,vsGlobal:s===null?null:s-t.global.score,recent:c,recentOk:c.filter(e=>e.ok).length,firstSeen:l,lastSeen:u,events:o.get(e)??0}});s.sort((e,t)=>e.score===null||t.score===null?Number(e.score===null)-Number(t.score===null)||e.tag.localeCompare(t.tag):t.score-e.score||e.tag.localeCompare(t.tag)),i.length>0&&i.push({at:e.asOf,score:t.global.score});for(let t of s){let n=a[t.tag];n&&t.score!==null&&n.push({at:e.asOf,score:t.score})}let c=new Map;for(let e of s)c.has(e.group)||c.set(e.group,tagGroupBatch(e.tag));let countOnlyGroup=e=>e.roles?.some(e=>e===`intro`||e===`expose`)??!1;return{global:t.global,rows:s,groups:[...c.values()].sort((e,t)=>Number(countOnlyGroup(e))-Number(countOnlyGroup(t))||e.id.localeCompare(t.id)),series:{global:i,tags:a},seriesFrom:r[0]?.at??null}}var I=e(function(e,t){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},I(e,t)},`extendStatics`);function __extends$1(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);I(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}e(__extends$1,`__extends`);var L=function(){function Browser(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return Browser}(),R=new(function(){function Env(){this.browser=new L,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<`u`}return Env}());typeof wx==`object`&&typeof wx.getSystemInfoSync==`function`?(R.wxa=!0,R.touchEventsSupported=!0):typeof document>`u`&&typeof self<`u`?R.worker=!0:!R.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(R.node=!0,R.svgSupported=!0):detect(navigator.userAgent,R);function detect(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`){var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var z=`12px sans-serif`,B=20,ee=100,te=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function getTextWidthMap(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n<e.length;n++){var r=String.fromCharCode(n+32);t[r]=(e.charCodeAt(n)-B)/ee}return t}var ne=getTextWidthMap(te),re={createCanvas:function(){return typeof document<`u`&&document.createElement(`canvas`)},measureText:(function(){var e,t;return function(n,r){if(!e){var i=re.createCanvas();e=i&&i.getContext(`2d`)}if(e)return t!==r&&(t=e.font=r||`12px sans-serif`),e.measureText(n);n=n||``,r=r||`12px sans-serif`;var a=/((?:\d+)?\.?\d*)px/.exec(r),o=a&&+a[1]||12,s=0;if(r.indexOf(`mono`)>=0)s=o*n.length;else for(var c=0;c<n.length;c++){var l=ne[n[c]];s+=l==null?o:l*o}return{width:s}}})(),loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r},getTime:function(){return Date.now?Date.now():+new Date}},ie=reduce([`Function`,`RegExp`,`Date`,`Error`,`CanvasGradient`,`CanvasPattern`,`Image`,`Canvas`],function(e,t){return e[`[object `+t+`]`]=!0,e},{}),ae=reduce([`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`],function(e,t){return e[`[object `+t+`Array]`]=!0,e},{}),V=Object.prototype.toString,H=Array.prototype,oe=H.forEach,se=H.filter,ce=H.slice,le=H.map,ue=function(){}.constructor,de=ue?ue.prototype:null,fe=`__proto__`,pe=2311,me=2**53-1;function guid(){return pe>=me&&(pe=0),pe++}function logError(){var e=[...arguments];typeof console<`u`&&console.error.apply(console,e)}function clone$2(e){if(typeof e!=`object`||!e)return e;var t=e,n=V.call(e);if(n===`[object Array]`){if(!isPrimitive(e)){t=[];for(var r=0,i=e.length;r<i;r++)t[r]=clone$2(e[r])}}else if(ae[n]){if(!isPrimitive(e)){var a=e.constructor;if(a.from)t=a.from(e);else{t=new a(e.length);for(var r=0,i=e.length;r<i;r++)t[r]=e[r]}}}else if(!ie[n]&&!isPrimitive(e)&&!isDom(e))for(var o in t={},e)e.hasOwnProperty(o)&&o!==fe&&(t[o]=clone$2(e[o]));return t}e(clone$2,`clone`);function merge(e,t,n){if(!isObject$2(t)||!isObject$2(e))return n?clone$2(t):e;for(var r in t)if(t.hasOwnProperty(r)&&r!==fe){var i=e[r],a=t[r];isObject$2(a)&&isObject$2(i)&&!isArray(a)&&!isArray(i)&&!isDom(a)&&!isDom(i)&&!isBuiltInObject(a)&&!isBuiltInObject(i)&&!isPrimitive(a)&&!isPrimitive(i)?merge(i,a,n):(n||!(r in e))&&(e[r]=clone$2(t[r]))}return e}function extend(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==fe&&(e[n]=t[n]);return e}function assignProps(e,t,n){e=e||{};for(var r=0;r<n.length;r++){var i=n[r];e[i]=t[i]}return e}function defaults(e,t,n){for(var r=keys(t),i=0,a=r.length;i<a;i++){var o=r[i];(n?t[o]!=null:e[o]==null)&&(e[o]=t[o])}return e}re.createCanvas;function indexOf(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1}function inherits(e,t){var n=e.prototype;function F(){}for(var r in F.prototype=t.prototype,e.prototype=new F,n)n.hasOwnProperty(r)&&(e.prototype[r]=n[r]);e.prototype.constructor=e,e.superClass=t}function mixin(e,t,n){if(e=`prototype`in e?e.prototype:e,t=`prototype`in t?t.prototype:t,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++){var a=r[i];a!==`constructor`&&(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}else defaults(e,t,n)}function isArrayLike(e){return!e||typeof e==`string`?!1:typeof e.length==`number`}function each$4(e,t,n){if(e&&t)if(e.forEach&&e.forEach===oe)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(n,e[a],a,e)}e(each$4,`each`);function map$1(e,t,n){if(!e)return[];if(!t)return slice(e);if(e.map&&e.map===le)return e.map(t,n);for(var r=[],i=0,a=e.length;i<a;i++)r.push(t.call(n,e[i],i,e));return r}e(map$1,`map`);function reduce(e,t,n,r){if(e&&t){for(var i=0,a=e.length;i<a;i++)n=t.call(r,n,e[i],i,e);return n}}function filter(e,t,n){if(!e)return[];if(!t)return slice(e);if(e.filter&&e.filter===se)return e.filter(t,n);for(var r=[],i=0,a=e.length;i<a;i++)t.call(n,e[i],i,e)&&r.push(e[i]);return r}function find(e,t,n){if(e&&t){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return e[r]}}function keys(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function bindPolyfill(e,t){var n=[...arguments].slice(2);return function(){return e.apply(t,n.concat(ce.call(arguments)))}}var U=de&&isFunction(de.bind)?de.call.bind(de.bind):bindPolyfill;function curry$1(e){var t=[...arguments].slice(1);return function(){return e.apply(this,t.concat(ce.call(arguments)))}}e(curry$1,`curry`);function isArray(e){return Array.isArray?Array.isArray(e):V.call(e)===`[object Array]`}function isFunction(e){return typeof e==`function`}function isString(e){return typeof e==`string`}function isStringSafe(e){return V.call(e)===`[object String]`}function isNumber(e){return typeof e==`number`}function isObject$2(e){var t=typeof e;return t===`function`||!!e&&t===`object`}e(isObject$2,`isObject`);function isBuiltInObject(e){return!!ie[V.call(e)]}function isTypedArray(e){return!!ae[V.call(e)]}function isDom(e){return typeof e==`object`&&typeof e.nodeType==`number`&&typeof e.ownerDocument==`object`}function isGradientObject(e){return e.colorStops!=null}function isImagePatternObject(e){return e.image!=null}function eqNaN(e){return e!==e}function retrieve(){for(var e=[...arguments],t=0,n=e.length;t<n;t++)if(e[t]!=null)return e[t]}function retrieve2(e,t){return e??t}function retrieve3(e,t,n){return e??t??n}function slice(e){var t=[...arguments].slice(1);return ce.apply(e,t)}function normalizeCssArray$1(e){if(typeof e==`number`)return[e,e,e,e];var t=e.length;return t===2?[e[0],e[1],e[0],e[1]]:t===3?[e[0],e[1],e[2],e[1]]:e}e(normalizeCssArray$1,`normalizeCssArray`);function assert(e,t){if(!e)throw Error(t)}function trim(e){return e==null?null:typeof e.trim==`function`?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``)}var he=`__ec_primitive__`;function setAsPrimitive(e){e[he]=!0}function isPrimitive(e){return e[he]}var ge=function(){function MapPolyfill(){this.data={}}return MapPolyfill.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},MapPolyfill.prototype.has=function(e){return this.data.hasOwnProperty(e)},MapPolyfill.prototype.get=function(e){return this.data[e]},MapPolyfill.prototype.set=function(e,t){return this.data[e]=t,this},MapPolyfill.prototype.keys=function(){return keys(this.data)},MapPolyfill.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},MapPolyfill}(),_e=typeof Map==`function`;function maybeNativeMap(){return _e?new Map:new ge}var ve=function(){function HashMap(e){var t=isArray(e);this.data=maybeNativeMap();var n=this;e instanceof HashMap?e.each(visit):e&&each$4(e,visit);function visit(e,r){t?n.set(e,r):n.set(r,e)}}return HashMap.prototype.hasKey=function(e){return this.data.has(e)},HashMap.prototype.get=function(e){return this.data.get(e)},HashMap.prototype.set=function(e,t){return this.data.set(e,t),t},HashMap.prototype.each=function(e,t){this.data.forEach(function(n,r){e.call(t,n,r)})},HashMap.prototype.keys=function(){var e=this.data.keys();return _e?Array.from(e):e},HashMap.prototype.removeKey=function(e){this.data.delete(e)},HashMap}();function createHashMap(e){return new ve(e)}function concatArray(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];for(var i=e.length,r=0;r<t.length;r++)n[r+i]=t[r];return n}function createObject(e,t){var n;if(Object.create)n=Object.create(e);else{var StyleCtor=function(){};StyleCtor.prototype=e,n=new StyleCtor}return t&&extend(n,t),n}function disableUserSelect(e){var t=e.style;t.webkitUserSelect=`none`,t.userSelect=`none`,t.webkitTapHighlightColor=`rgba(0,0,0,0)`,t[`-webkit-touch-callout`]=`none`}function hasOwn(e,t){return e.hasOwnProperty(t)}function noop(){}var ye=180/Math.PI,extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},extendStatics(e,t)};function __extends(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}function create$1(e,t){return e??(e=0),t??(t=0),[e,t]}e(create$1,`create`);function clone$1(e){return[e[0],e[1]]}e(clone$1,`clone`);function set$1(e,t,n){return e[0]=t,e[1]=n,e}e(set$1,`set`);function add(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function sub(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function len(e){return Math.sqrt(lenSquare(e))}function lenSquare(e){return e[0]*e[0]+e[1]*e[1]}function scale$1(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}e(scale$1,`scale`);function normalize(e,t){var n=len(t);return n===0?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function distance(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var be=distance;function distanceSquare(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var xe=distanceSquare;function applyTransform$1(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}e(applyTransform$1,`applyTransform`);function min$1(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}e(min$1,`min`);function max$1(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}e(max$1,`max`);var Se=function(){function Param(e,t){this.target=e,this.topTarget=t&&t.topTarget}return Param}(),Ce=function(){function Draggable(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return Draggable.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Se(t,e),`dragstart`,e.event))},Draggable.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new Se(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new Se(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new Se(o,e),`dragenter`,e.event))}},Draggable.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new Se(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new Se(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},Draggable}(),we=function(){function Eventful(e){e&&(this._$eventProcessor=e)}return Eventful.prototype.on=function(e,t,n,r){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o<i[e].length;o++)if(i[e][o].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,l=i[e][c];return l&&l.callAtLast?i[e].splice(c,0,s):i[e].push(s),this},Eventful.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},Eventful.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,a=n[e].length;i<a;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},Eventful.prototype.trigger=function(e){var t=[...arguments].slice(1);if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var i=t.length,a=n.length,o=0;o<a;o++){var s=n[o];if(!(r&&r.filter&&s.query!=null&&!r.filter(e,s.query)))switch(i){case 0:s.h.call(s.ctx);break;case 1:s.h.call(s.ctx,t[0]);break;case 2:s.h.call(s.ctx,t[0],t[1]);break;default:s.h.apply(s.ctx,t);break}}return r&&r.afterTrigger&&r.afterTrigger(e),this},Eventful.prototype.triggerWithContext=function(e){var t=[...arguments].slice(1);if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var i=t.length,a=t[i-1],o=n.length,s=0;s<o;s++){var c=n[s];if(!(r&&r.filter&&c.query!=null&&!r.filter(e,c.query)))switch(i){case 0:c.h.call(a);break;case 1:c.h.call(a,t[0]);break;case 2:c.h.call(a,t[0],t[1]);break;default:c.h.apply(a,t.slice(1,i-1));break}}return r&&r.afterTrigger&&r.afterTrigger(e),this},Eventful}(),Te=Math.log(2);function determinant(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<<s)-1&~i)/Te);return e[n][c]}for(var l=r|1<<n,u=n+1;r&1<<u;)u++;for(var d=0,f=0,p=0;f<s;f++){var m=1<<f;m&i||(d+=(p%2?-1:1)*e[n][f]*determinant(e,t-1,u,l,i|m,a),p++)}return a[o]=d,d}function buildTransformer(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],r={},i=determinant(n,8,0,0,0,r);if(i!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]??(a[s]=0),a[s]+=((o+s)%2?-1:1)*determinant(n,7,o===0?1:0,1<<o,1<<s,r)/i*t[o];return function(e,t,n){var r=t*a[6]+n*a[7]+1;e[0]=(t*a[0]+n*a[1]+a[2])/r,e[1]=(t*a[3]+n*a[4]+a[5])/r}}}var Ee=`___zrEVENTSAVED`,De=[];function transformLocalCoord(e,t,n,r,i){return transformCoordWithViewport(De,t,r,i,!0)&&transformCoordWithViewport(e,n,De[0],De[1])}function transformLocalCoordClear(e,t){e&&dealClear(e),t&&dealClear(t);function dealClear(e){var t=e[Ee];t&&(t.clearMarkers&&t.clearMarkers(),delete e[Ee])}}function transformCoordWithViewport(e,t,n,r,i){if(t.getBoundingClientRect&&R.domSupported&&!isCanvasEl(t)){var a=t[Ee]||(t[Ee]={}),o=preparePointerTransformer(prepareCoordMarkers(t,a),a,i);if(o)return o(e,n,r),!0}return!1}function prepareCoordMarkers(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=[`left`,`right`],i=[`top`,`bottom`],a=0;a<4;a++){var o=document.createElement(`div`),s=o.style,c=a%2,l=(a>>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){each$4(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function preparePointerTransformer(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?buildTransformer(s,o):buildTransformer(o,s))}function isCanvasEl(e){return e.nodeName.toUpperCase()===`CANVAS`}var Oe=/([&<>"'])/g,ke={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function encodeHTML(e){return e==null?``:(e+``).replace(Oe,function(e,t){return ke[t]})}var Ae=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,je=[],Me=R.browser.firefox&&+R.browser.version.split(`.`)[0]<39;function clientToLocal(e,t,n,r){return n=n||{},r?calculateZrXY(e,t,n):Me&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?calculateZrXY(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function calculateZrXY(e,t,n){if(R.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(isCanvasEl(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}else if(transformCoordWithViewport(je,e,r,i)){n.zrX=je[0],n.zrY=je[1];return}}n.zrX=n.zrY=0}function getNativeEvent(e){return e||window.event}function normalizeEvent(e,t,n){if(t=getNativeEvent(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&clientToLocal(e,i,t,n)}else{clientToLocal(e,t,t,n);var a=getWheelDeltaMayPolyfill(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&Ae.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function getWheelDeltaMayPolyfill(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=r===0?Math.abs(n):Math.abs(r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function addEventListener(e,t,n,r){e.addEventListener(t,n,r)}function removeEventListener(e,t,n,r){e.removeEventListener(t,n,r)}var stop=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function isMiddleOrRightButtonOnMouseUpDown(e){return e.which===2||e.which===3}var Ne=function(){function GestureMgr(){this._track=[]}return GestureMgr.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},GestureMgr.prototype.clear=function(){return this._track.length=0,this},GestureMgr.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a<o;a++){var s=r[a],c=clientToLocal(n,s,{});i.points.push([c.zrX,c.zrY]),i.touches.push(s)}this._track.push(i)}},GestureMgr.prototype._recognize=function(e){for(var t in Pe)if(Pe.hasOwnProperty(t)){var n=Pe[t](this._track,e);if(n)return n}},GestureMgr}();function dist(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}function center(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}var Pe={pinch:function(e,t){var n=e.length;if(n){var r=(e[n-1]||{}).points,i=(e[n-2]||{}).points||r;if(i&&i.length>1&&r&&r.length>1){var a=dist(r)/dist(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=center(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}};function create(){return[1,0,0,1,0,0]}function identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function mul(e,t,n){var r=t[0]*n[0]+t[2]*n[1],i=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],c=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e}function translate(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function rotate(e,t,n,r){r===void 0&&(r=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],c=t[3],l=t[5],u=Math.sin(n),d=Math.cos(n);return e[0]=i*d+s*u,e[1]=-i*u+s*d,e[2]=a*d+c*u,e[3]=-a*u+d*c,e[4]=d*(o-r[0])+u*(l-r[1])+r[0],e[5]=d*(l-r[1])-u*(o-r[0])+r[1],e}function scale(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e}function invert(e,t){var n=t[0],r=t[2],i=t[4],a=t[1],o=t[3],s=t[5],c=n*o-a*r;return c?(c=1/c,e[0]=o*c,e[1]=-a*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*s-o*i)*c,e[5]=(a*i-n*s)*c,e):null}var W=function(){function Point(e,t){this.x=e||0,this.y=t||0}return Point.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},Point.prototype.clone=function(){return new Point(this.x,this.y)},Point.prototype.set=function(e,t){return this.x=e,this.y=t,this},Point.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},Point.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},Point.prototype.scale=function(e){this.x*=e,this.y*=e},Point.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},Point.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},Point.prototype.dot=function(e){return this.x*e.x+this.y*e.y},Point.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},Point.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},Point.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},Point.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},Point.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},Point.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},Point.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},Point.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},Point.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},Point.set=function(e,t,n){e.x=t,e.y=n},Point.copy=function(e,t){e.x=t.x,e.y=t.y},Point.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},Point.lenSquare=function(e){return e.x*e.x+e.y*e.y},Point.dot=function(e,t){return e.x*t.x+e.y*t.y},Point.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},Point.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},Point.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},Point.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},Point.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},Point}(),Fe=Math.min,Ie=Math.max,Le=Math.abs,Re=[`x`,`y`],ze=[`width`,`height`],Be=new W,Ve=new W,He=new W,Ue=new W,We=createIntersectContext(),Ge=We.minTv,Ke=We.maxTv,qe=[0,0],G=function(){function BoundingRect(e,t,n,r){Je(this,e,t,n,r)}return BoundingRect.set=function(e,t,n,r,i){return r<0&&(t+=r,r=-r),i<0&&(n+=i,i=-i),e.x=t,e.y=n,e.width=r,e.height=i,e},BoundingRect.prototype.union=function(e){var t=Fe(e.x,this.x),n=Fe(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ie(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ie(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},BoundingRect.prototype.applyTransform=function(e){BoundingRect.applyTransform(this,this,e)},BoundingRect.prototype.calculateTransform=function(e){return Xe(create(),this,e)},BoundingRect.prototype.intersect=function(e,t,n){return BoundingRect.intersect(this,e,t,n)},BoundingRect.intersect=function(e,t,n,r){n&&W.set(n,0,0);var i=r&&r.outIntersectRect||null,a=r&&r.clamp;if(i&&(i.x=i.y=i.width=i.height=NaN),!e||!t)return!1;e instanceof BoundingRect||(e=Je(Ze,e.x,e.y,e.width,e.height)),t instanceof BoundingRect||(t=Je(Qe,t.x,t.y,t.width,t.height));var o=!!n;We.reset(r,o);var s=We.touchThreshold,c=e.x+s,l=e.x+e.width-s,u=e.y+s,d=e.y+e.height-s,f=t.x+s,p=t.x+t.width-s,m=t.y+s,h=t.y+t.height-s;if(c>l||u>d||f>p||m>h)return!1;var g=!(l<f||p<c||d<m||h<u);return(o||i)&&(qe[0]=1/0,qe[1]=0,intersectOneDim(c,l,f,p,0,o,i,a),intersectOneDim(u,d,m,h,1,o,i,a),o&&W.copy(n,g?We.useDir?We.dirMinTv:Ge:Ke)),g},BoundingRect.contain=function(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},BoundingRect.prototype.contain=function(e,t){return BoundingRect.contain(this,e,t)},BoundingRect.prototype.clone=function(){return new BoundingRect(this.x,this.y,this.width,this.height)},BoundingRect.prototype.copy=function(e){Ye(this,e)},BoundingRect.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},BoundingRect.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},BoundingRect.prototype.isZero=function(){return this.width===0||this.height===0},BoundingRect.create=function(e){return new BoundingRect(e?e.x:0,e?e.y:0,e?e.width:0,e?e.height:0)},BoundingRect.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},BoundingRect.applyTransform=function(e,t,n){if(!n){e!==t&&Ye(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Be.x=He.x=t.x,Be.y=Ue.y=t.y,Ve.x=Ue.x=t.x+t.width,Ve.y=He.y=t.y+t.height,Be.transform(n),Ue.transform(n),Ve.transform(n),He.transform(n),e.x=Fe(Be.x,Ve.x,He.x,Ue.x),e.y=Fe(Be.y,Ve.y,He.y,Ue.y);var s=Ie(Be.x,Ve.x,He.x,Ue.x),c=Ie(Be.y,Ve.y,He.y,Ue.y);e.width=s-e.x,e.height=c-e.y},BoundingRect.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=identity(e||[]),translate(e,e,set$1($e,-t.x,-t.y)),scale(e,e,set$1($e,r,i)),translate(e,e,set$1($e,n.x,n.y)),e},BoundingRect}();G.create;var Je=G.set,Ye=G.copy,Xe=G.calculateTransform;G.applyTransform,G.contain;var Ze=new G(0,0,0,0),Qe=new G(0,0,0,0),$e=[];function intersectOneDim(e,t,n,r,i,a,o,s){var c=Le(t-n),l=Le(r-e),u=Fe(c,l),d=Re[i],f=Re[1-i],p=ze[i];t<n||r<e?c<l?(a&&(Ke[d]=-c),s&&(o[d]=t,o[p]=0)):(a&&(Ke[d]=l),s&&(o[d]=e,o[p]=0)):(o&&(o[d]=Ie(e,n),o[p]=Fe(t,r)-o[d]),a&&(u<qe[0]||We.useDir)&&(qe[0]=Fe(u,qe[0]),(c<l||!We.bidirectional)&&(Ge[d]=c,Ge[f]=0,We.useDir&&We.calcDirMTV()),(c>=l||!We.bidirectional)&&(Ge[d]=-l,Ge[f]=0,We.useDir&&We.calcDirMTV())))}function createIntersectContext(){var e=0,t=new W,n=new W,r={minTv:new W,maxTv:new W,useDir:!1,dirMinTv:new W,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,a){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=Ie(0,i.touchThreshold)),r.negativeSize=!1,a&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var i=r.minTv,a=r.dirMinTv,o=i.y*i.y+i.x*i.x,s=Math.sin(e),c=Math.cos(e),l=s*i.y+c*i.x;if(nearZero(l)){nearZero(i.x)&&nearZero(i.y)&&a.set(0,0);return}if(n.x=o*c/l,n.y=o*s/l,nearZero(n.x)&&nearZero(n.y)){a.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()<a.len()&&a.copy(n)}};function nearZero(e){return Le(e)<1e-10}return r}var et=`silent`;function makeEventPacket(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:stopEvent}}function stopEvent(){stop(this.event)}var tt=function(e){__extends(EmptyProxy,e);function EmptyProxy(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return EmptyProxy.prototype.dispose=function(){},EmptyProxy.prototype.setCursor=function(){},EmptyProxy}(we),nt=function(){function HoveredResult(e,t){this.x=e,this.y=t}return HoveredResult}(),rt=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],it=new G(0,0,0,0),at=function(e){__extends(Handler,e);function Handler(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new nt(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r=r||new tt,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new Ce(o),o}return Handler.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(each$4(rt,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},Handler.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=isOutsideBoundary(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new nt(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},Handler.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},Handler.prototype.resize=function(){this._hovered=new nt(0,0)},Handler.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},Handler.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},Handler.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},Handler.prototype.dispatchToElement=function(e,t,n){e=e||{};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=makeEventPacket(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},Handler.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new nt(e,t);if(setHoverTarget(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new G(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(it.copy(u.getBoundingRect()),u.transform&&it.applyTransform(u.transform),it.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m<s;m+=d)for(var h=0;h<p;h+=f)if(setHoverTarget(a,i,e+m*Math.cos(h),t+m*Math.sin(h),n),i.target)return i}}return i},Handler.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new Ne);var n=this._gestureMgr;t===`start`&&n.clear();var r=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if(t===`end`&&n.clear(),r){var i=r.type;e.gestureEvent=i;var a=new nt;a.target=r.target,this.dispatchToElement(a,i,r.event)}},Handler}(we);each$4([`click`,`mousedown`,`mouseup`,`mousewheel`,`dblclick`,`contextmenu`],function(e){at.prototype[e]=function(t){var n=t.zrX,r=t.zrY,i=isOutsideBoundary(this,n,r),a,o;if((e!==`mouseup`||!i)&&(a=this.findHover(n,r),o=a.target),e===`mousedown`)this._downEl=o,this._downPoint=[t.zrX,t.zrY],this._upEl=o;else if(e===`mouseup`)this._upEl=o;else if(e===`click`){if(this._downEl!==this._upEl||!this._downPoint||be(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function isHover(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return i?et:!0}return!1}function setHoverTarget(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=isHover(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==et)){t.target=o;break}}}function isOutsideBoundary(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var ot=32,st=7;function minRunLength(e){for(var t=0;e>=ot;)t|=e&1,e>>=1;return e+t}function makeAscendingRun(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i<n&&r(e[i],e[i-1])<0;)i++;reverseRun(e,t,i)}else for(;i<n&&r(e[i],e[i-1])>=0;)i++;return i-t}function reverseRun(e,t,n){for(n--;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}function binaryInsertionSort(e,t,n,r,i){for(r===t&&r++;r<n;r++){for(var a=e[r],o=t,s=r,c;o<s;)c=o+s>>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function gallopLeft(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c<s&&a(e,t[n+i+c])>0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;c<s&&a(e,t[n+i-c])<=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o<c;){var u=o+(c-o>>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function gallopRight(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;c<s&&a(e,t[n+i-c])<0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c<s&&a(e,t[n+i+c])>=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o<c;){var u=o+(c-o>>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function TimSort(e,t){var n=st,r,i,a=0,o=[];r=[],i=[];function pushRun(e,t){r[a]=e,i[a]=t,a+=1}function mergeRuns(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]<i[e+1]&&e--;else if(i[e]>i[e+1])break;mergeAt(e)}}function forceMergeRuns(){for(;a>1;){var e=a-2;e>0&&i[e-1]<i[e+1]&&e--,mergeAt(e)}}function mergeAt(n){var o=r[n],s=i[n],c=r[n+1],l=i[n+1];i[n]=s+l,n===a-3&&(r[n+1]=r[n+2],i[n+1]=i[n+2]),a--;var u=gallopRight(e[c],e,o,s,0,t);o+=u,s-=u,s!==0&&(l=gallopLeft(e[o+s-1],e,c,l,l-1,t),l!==0&&(s<=l?mergeLow(o,s,c,l):mergeHigh(o,s,c,l)))}function mergeLow(r,i,a,s){var c=0;for(c=0;c<i;c++)o[c]=e[r+c];var l=0,u=a,d=r;if(e[d++]=e[u++],--s===0){for(c=0;c<i;c++)e[d+c]=o[l+c];return}if(i===1){for(c=0;c<s;c++)e[d+c]=e[u+c];e[d+s]=o[l];return}for(var f=n,p,m,h;;){p=0,m=0,h=!1;do if(t(e[u],o[l])<0){if(e[d++]=e[u++],m++,p=0,--s===0){h=!0;break}}else if(e[d++]=o[l++],p++,m=0,--i===1){h=!0;break}while((p|m)<f);if(h)break;do{if(p=gallopRight(e[u],o,l,i,0,t),p!==0){for(c=0;c<p;c++)e[d+c]=o[l+c];if(d+=p,l+=p,i-=p,i<=1){h=!0;break}}if(e[d++]=e[u++],--s===0){h=!0;break}if(m=gallopLeft(o[l],e,u,s,0,t),m!==0){for(c=0;c<m;c++)e[d+c]=e[u+c];if(d+=m,u+=m,s-=m,s===0){h=!0;break}}if(e[d++]=o[l++],--i===1){h=!0;break}f--}while(p>=st||m>=st);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c<s;c++)e[d+c]=e[u+c];e[d+s]=o[l]}else if(i===0)throw Error();else for(c=0;c<i;c++)e[d+c]=o[l+c]}function mergeHigh(r,i,a,s){var c=0;for(c=0;c<s;c++)o[c]=e[a+c];var l=r+i-1,u=s-1,d=a+s-1,f=0,p=0;if(e[d--]=e[l--],--i===0){for(f=d-(s-1),c=0;c<s;c++)e[f+c]=o[c];return}if(s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)<m);if(_)break;do{if(h=i-gallopRight(o[u],e,r,i,i-1,t),h!==0){for(d-=h,l-=h,i-=h,p=d+1,f=l+1,c=h-1;c>=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-gallopLeft(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c<g;c++)e[p+c]=o[f+c];if(s<=1){_=!0;break}}if(e[d--]=e[l--],--i===0){_=!0;break}m--}while(h>=st||g>=st);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;c<s;c++)e[f+c]=o[c]}return{mergeRuns,forceMergeRuns,pushRun}}function sort(e,t,n,r){n||(n=0),r||(r=e.length);var i=r-n;if(!(i<2)){var a=0;if(i<ot){a=makeAscendingRun(e,n,r,t),binaryInsertionSort(e,n,r,n+a,t);return}var o=TimSort(e,t),s=minRunLength(i);do{if(a=makeAscendingRun(e,n,r,t),a<s){var c=i;c>s&&(c=s),binaryInsertionSort(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var ct=!1;function logInvalidZError(){ct||(ct=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function shapeCompareFunc(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var lt=function(){function Storage(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=shapeCompareFunc}return Storage.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},Storage.prototype.getDisplayList=function(e,t){t=t||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(t),n},Storage.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,r=0,i=t.length;r<i;r++)this._updateAndAddDisplayable(t[r],null,e);n.length=this._displayListLen,sort(n,shapeCompareFunc)},Storage.prototype._updateAndAddDisplayable=function(e,t,n){if(!(e.ignore&&!n)){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath(),i=t&&t.length,a=0,o=e.__clipPaths;if(!e.ignoreClip&&(i||r)){if(o||(o=e.__clipPaths=[]),i)for(var s=0;s<t.length;s++)o[a++]=t[s];for(var c=r,l=e;c;)c.parent=l,c.updateTransform(),o[a++]=c,l=c,c=c.getClipPath()}if(o&&(o.length=a),e.childrenRef){for(var u=e.childrenRef(),d=0;d<u.length;d++){var f=u[d];e.__dirty&&(f.__dirty|=1),this._updateAndAddDisplayable(f,o,n)}e.__dirty=0}else{var p=e;isNaN(p.z)&&(logInvalidZError(),p.z=0),isNaN(p.z2)&&(logInvalidZError(),p.z2=0),isNaN(p.zlevel)&&(logInvalidZError(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var m=e.getDecalElement&&e.getDecalElement();m&&this._updateAndAddDisplayable(m,o,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,o,n);var g=e.getTextContent();g&&this._updateAndAddDisplayable(g,o,n)}},Storage.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},Storage.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);return}var r=indexOf(this._roots,e);r>=0&&this._roots.splice(r,1)},Storage.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},Storage.prototype.getRoots=function(){return this._roots},Storage.prototype.dispose=function(){this._displayList=null,this._roots=null},Storage}(),ut=R.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},dt={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=1.70158*1.525;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-dt.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?dt.bounceIn(e*2)*.5:dt.bounceOut(e*2-1)*.5+.5}},ft=Math.pow,pt=Math.sqrt,mt=1e-8,ht=1e-4,gt=pt(3),_t=1/3,vt=create$1(),yt=create$1(),bt=create$1();function isAroundZero(e){return e>-mt&&e<mt}function isNotAroundZero$1(e){return e>mt||e<-mt}e(isNotAroundZero$1,`isNotAroundZero`);function cubicAt(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function cubicDerivativeAt(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function cubicRootAt(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(isAroundZero(u)&&isAroundZero(d))if(isAroundZero(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}else{var h=d*d-4*u*f;if(isAroundZero(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=pt(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-ft(-y,_t):ft(y,_t),b=b<0?-ft(-b,_t):ft(b,_t);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*pt(u*u*u)),S=Math.acos(x)/3,C=pt(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+gt*Math.sin(S)))/(3*o),T=(-s+C*(w-gt*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function cubicExtrema(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(isAroundZero(o)){if(isNotAroundZero$1(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(isAroundZero(u))i[0]=-a/(2*o);else if(u>0){var d=pt(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function cubicSubdivide(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function cubicProjectPoint(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;vt[0]=c,vt[1]=l;for(var v=0;v<1;v+=.05)yt[0]=cubicAt(e,n,i,o,v),yt[1]=cubicAt(t,r,a,s,v),g=xe(vt,yt),g<p&&(d=v,p=g);p=1/0;for(var y=0;y<32&&!(f<ht);y++)m=d-f,h=d+f,yt[0]=cubicAt(e,n,i,o,m),yt[1]=cubicAt(t,r,a,s,m),g=xe(yt,vt),m>=0&&g<p?(d=m,p=g):(bt[0]=cubicAt(e,n,i,o,h),bt[1]=cubicAt(t,r,a,s,h),_=xe(bt,vt),h<=1&&_<p?(d=h,p=_):f*=.5);return u&&(u[0]=cubicAt(e,n,i,o,d),u[1]=cubicAt(t,r,a,s,d)),pt(p)}function cubicLength(e,t,n,r,i,a,o,s,c){for(var l=e,u=t,d=0,f=1/c,p=1;p<=c;p++){var m=p*f,h=cubicAt(e,n,i,o,m),g=cubicAt(t,r,a,s,m),_=h-l,v=g-u;d+=Math.sqrt(_*_+v*v),l=h,u=g}return d}function quadraticAt(e,t,n,r){var i=1-r;return i*(i*e+2*r*t)+r*r*n}function quadraticDerivativeAt(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function quadraticRootAt(e,t,n,r,i){var a=e-2*t+n,o=2*(t-e),s=e-r,c=0;if(isAroundZero(a)){if(isNotAroundZero$1(o)){var l=-s/o;l>=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(isAroundZero(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=pt(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function quadraticExtremum(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function quadraticSubdivide(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function quadraticProjectPoint(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;vt[0]=o,vt[1]=s;for(var f=0;f<1;f+=.05){yt[0]=quadraticAt(e,n,i,f),yt[1]=quadraticAt(t,r,a,f);var p=xe(vt,yt);p<d&&(l=f,d=p)}d=1/0;for(var m=0;m<32&&!(u<ht);m++){var h=l-u,g=l+u;yt[0]=quadraticAt(e,n,i,h),yt[1]=quadraticAt(t,r,a,h);var p=xe(yt,vt);if(h>=0&&p<d)l=h,d=p;else{bt[0]=quadraticAt(e,n,i,g),bt[1]=quadraticAt(t,r,a,g);var _=xe(bt,vt);g<=1&&_<d?(l=g,d=_):u*=.5}}return c&&(c[0]=quadraticAt(e,n,i,l),c[1]=quadraticAt(t,r,a,l)),pt(d)}function quadraticLength(e,t,n,r,i,a,o){for(var s=e,c=t,l=0,u=1/o,d=1;d<=o;d++){var f=d*u,p=quadraticAt(e,n,i,f),m=quadraticAt(t,r,a,f),h=p-s,g=m-c;l+=Math.sqrt(h*h+g*g),s=p,c=m}return l}var xt=/cubic-bezier\(([0-9,\.e ]+)\)/;function createCubicEasingFunc(e){var t=e&&xt.exec(e);if(t){var n=t[1].split(`,`),r=+trim(n[0]),i=+trim(n[1]),a=+trim(n[2]),o=+trim(n[3]);if(isNaN(r+i+a+o))return;var s=[];return function(e){return e<=0?0:e>=1?1:cubicRootAt(0,r,a,1,e,s)&&cubicAt(0,i,o,1,s[0])}}}var St=function(){function Clip(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||noop,this.ondestroy=e.ondestroy||noop,this.onrestart=e.onrestart||noop,e.easing&&this.setEasing(e.easing)}return Clip.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1)if(this.loop)this._startTime=e-r%n,this._pausedTime=0,this.onrestart();else return!0;return!1},Clip.prototype.pause=function(){this._paused=!0},Clip.prototype.resume=function(){this._paused=!1},Clip.prototype.setEasing=function(e){this.easing=e,this.easingFunc=isFunction(e)?e:dt[e]||createCubicEasingFunc(e)},Clip}(),Ct=function(){function Entry(e){this.value=e}return Entry}(),wt=function(){function LinkedList(){this._len=0}return LinkedList.prototype.insert=function(e){var t=new Ct(e);return this.insertEntry(t),t},LinkedList.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},LinkedList.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},LinkedList.prototype.len=function(){return this._len},LinkedList.prototype.clear=function(){this.head=this.tail=null,this._len=0},LinkedList}(),Tt=function(){function LRU(e){this._list=new wt,this._maxSize=10,this._map={},this._maxSize=e}return LRU.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Ct(t),o.key=e,n.insertEntry(o),r[e]=o}return i},LRU.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},LRU.prototype.clear=function(){this._list.clear(),this._map={}},LRU.prototype.len=function(){return this._list.len()},LRU}(),Et={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function clampCssByte(e){return e=Math.round(e),e<0?0:e>255?255:e}function clampCssAngle(e){return e=Math.round(e),e<0?0:e>360?360:e}function clampCssFloat(e){return e<0?0:e>1?1:e}function parseCssInt(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?clampCssByte(parseFloat(t)/100*255):clampCssByte(parseInt(t,10))}function parseCssFloat(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?clampCssFloat(parseFloat(t)/100):clampCssFloat(parseFloat(t))}function cssHueToRgb(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function lerpNumber(e,t,n){return e+(t-e)*n}function setRgba(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function copyRgba(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Dt=new Tt(20),Ot=null;function putToCache(e,t){Ot&©Rgba(Ot,t),Ot=Dt.put(e,Ot||t.slice())}function parse(e,t){if(e){t=t||[];var n=Dt.get(e);if(n)return copyRgba(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in Et)return copyRgba(t,Et[r]),putToCache(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){setRgba(t,0,0,0,1);return}return setRgba(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),putToCache(e,t),t}else if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){setRgba(t,0,0,0,1);return}return setRgba(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),putToCache(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?setRgba(t,+l[0],+l[1],+l[2],1):setRgba(t,0,0,0,1);u=parseCssFloat(l.pop());case`rgb`:if(l.length>=3)return setRgba(t,parseCssInt(l[0]),parseCssInt(l[1]),parseCssInt(l[2]),l.length===3?u:parseCssFloat(l[3])),putToCache(e,t),t;setRgba(t,0,0,0,1);return;case`hsla`:if(l.length!==4){setRgba(t,0,0,0,1);return}return l[3]=parseCssFloat(l[3]),hsla2rgba(l,t),putToCache(e,t),t;case`hsl`:if(l.length!==3){setRgba(t,0,0,0,1);return}return hsla2rgba(l,t),putToCache(e,t),t;default:return}}setRgba(t,0,0,0,1)}}function hsla2rgba(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=parseCssFloat(e[1]),i=parseCssFloat(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t=t||[],setRgba(t,clampCssByte(cssHueToRgb(o,a,n+1/3)*255),clampCssByte(cssHueToRgb(o,a,n)*255),clampCssByte(cssHueToRgb(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function rgba2hsla(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function lift(e,t){var n=parse(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return stringify(n,n.length===4?`rgba`:`rgb`)}}function lerp(e,t,n){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=parse(t[i]),s=parse(t[a]),c=r-i,l=stringify([clampCssByte(lerpNumber(o[0],s[0],c)),clampCssByte(lerpNumber(o[1],s[1],c)),clampCssByte(lerpNumber(o[2],s[2],c)),clampCssFloat(lerpNumber(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function modifyHSL(e,t,n,r){var i=parse(e);if(e)return i=rgba2hsla(i),t!=null&&(i[0]=clampCssAngle(isFunction(t)?t(i[0]):t)),n!=null&&(i[1]=parseCssFloat(isFunction(n)?n(i[1]):n)),r!=null&&(i[2]=parseCssFloat(isFunction(r)?r(i[2]):r)),stringify(hsla2rgba(i),`rgba`)}function stringify(e,t){if(!(!e||!e.length)){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function lum(e,t){var n=parse(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var kt=new Tt(100);function liftColor(e){if(isString(e)){var t=kt.get(e);return t||(t=lift(e,-.1),kt.put(e,t)),t}else if(isGradientObject(e)){var n=extend({},e);return n.colorStops=map$1(e.colorStops,function(e){return{offset:e.offset,color:lift(e.color,-.1)}}),n}return e}function isLinearGradient(e){return e.type===`linear`}function isRadialGradient(e){return e.type===`radial`}(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})();var At=Array.prototype.slice;function interpolateNumber$1(e,t,n){return(t-e)*n+e}e(interpolateNumber$1,`interpolateNumber`);function interpolate1DArray(e,t,n,r){for(var i=t.length,a=0;a<i;a++)e[a]=interpolateNumber$1(t[a],n[a],r);return e}function interpolate2DArray(e,t,n,r){for(var i=t.length,a=i&&t[0].length,o=0;o<i;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=interpolateNumber$1(t[o][s],n[o][s],r)}return e}function add1DArray(e,t,n,r){for(var i=t.length,a=0;a<i;a++)e[a]=t[a]+n[a]*r;return e}function add2DArray(e,t,n,r){for(var i=t.length,a=i&&t[0].length,o=0;o<i;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=t[o][s]+n[o][s]*r}return e}function fillColorStops(e,t){for(var n=e.length,r=t.length,i=n>r?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(n,r);s++)i.push({offset:o.offset,color:o.color.slice()})}function fillArray(e,t,n){var r=e,i=t;if(!(!r.push||!i.push)){var a=r.length,o=i.length;if(a!==o)if(a>o)r.length=o;else for(var s=a;s<o;s++)r.push(n===1?i[s]:At.call(i[s]));for(var c=r[0]&&r[0].length,s=0;s<r.length;s++)if(n===1)isNaN(r[s])&&(r[s]=i[s]);else for(var l=0;l<c;l++)isNaN(r[s][l])&&(r[s][l]=i[s][l])}}function cloneValue(e){if(isArrayLike(e)){var t=e.length;if(isArrayLike(e[0])){for(var n=[],r=0;r<t;r++)n.push(At.call(e[r]));return n}return At.call(e)}return e}function rgba2String(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=e[3]==null?1:e[3],`rgba(`+e.join(`,`)+`)`}function guessArrayDim(e){return isArrayLike(e&&e[0])?2:1}var jt=0,Mt=1,Nt=2,Pt=3,Ft=4,It=5,Lt=6;function isGradientValueType(e){return e===Ft||e===It}function isArrayValueType(e){return e===Mt||e===Nt}var Rt=[0,0,0,0],zt=function(){function Track(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return Track.prototype.isFinished=function(){return this._finished},Track.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},Track.prototype.needsAnimate=function(){return this.keyframes.length>=1},Track.prototype.getAdditiveTrack=function(){return this._additiveTrack},Track.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=Lt,s=t;if(isArrayLike(t)){var c=guessArrayDim(t);o=c,(c===1&&!isNumber(t[0])||c===2&&!isNumber(t[0][0]))&&(a=!0)}else if(isNumber(t)&&!eqNaN(t))o=jt;else if(isString(t))if(!isNaN(+t))o=jt;else{var l=parse(t);l&&(s=l,o=Pt)}else if(isGradientObject(t)){var u=extend({},s);u.colorStops=map$1(t.colorStops,function(e){return{offset:e.offset,color:parse(e.color)}}),isLinearGradient(t)?o=Ft:isRadialGradient(t)&&(o=It),s=u}i===0?this.valType=o:(o!==this.valType||o===Lt)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=isFunction(n)?n:dt[n]||createCubicEasingFunc(n)),r.push(d),d},Track.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=isArrayValueType(r),c=isGradientValueType(r),l=0;l<i;l++){var u=n[l],d=u.value,f=a.value;u.percent=u.time/e,o||(s&&l!==i-1?fillArray(d,f,r):c&&fillColorStops(d.colorStops,f.colorStops))}if(!o&&r!==It&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;for(var p=n[0].value,l=0;l<i;l++)r===jt?n[l].additiveValue=n[l].value-p:r===Pt?n[l].additiveValue=add1DArray([],n[l].value,p,-1):isArrayValueType(r)&&(n[l].additiveValue=r===Mt?add1DArray([],n[l].value,p,-1):add2DArray([],n[l].value,p,-1))}},Track.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,r=n?`additiveValue`:`value`,i=this.valType,a=this.keyframes,o=a.length,s=this.propName,c=i===Pt,l,u=this._lastFr,d=Math.min,f,p;if(o===1)f=p=a[0];else{if(t<0)l=0;else if(t<this._lastFrP){for(l=d(u+1,o-1);l>=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;l<o&&!(a[l].percent>t);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?Rt:e[s];if((isArrayValueType(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(isArrayValueType(i))i===Mt?interpolate1DArray(g,f[r],p[r],h):interpolate2DArray(g,f[r],p[r],h);else if(isGradientValueType(i)){var _=f[r],v=p[r],y=i===Ft;e[s]={type:y?`linear`:`radial`,x:interpolateNumber$1(_.x,v.x,h),y:interpolateNumber$1(_.y,v.y,h),colorStops:map$1(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:interpolateNumber$1(e.offset,n.offset,h),color:rgba2String(interpolate1DArray([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=interpolateNumber$1(_.x2,v.x2,h),e[s].y2=interpolateNumber$1(_.y2,v.y2,h)):e[s].r=interpolateNumber$1(_.r,v.r,h)}else if(c)interpolate1DArray(g,f[r],p[r],h),n||(e[s]=rgba2String(g));else{var b=interpolateNumber$1(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},Track.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===jt?e[n]=e[n]+r:t===Pt?(parse(e[n],Rt),add1DArray(Rt,Rt,r,1),e[n]=rgba2String(Rt)):t===Mt?add1DArray(e[n],e[n],r,1):t===Nt&&add2DArray(e[n],e[n],r,1)},Track}(),Bt=function(){function Animator(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){logError(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return Animator.prototype.getMaxTime=function(){return this._maxTime},Animator.prototype.getDelay=function(){return this._delay},Animator.prototype.getLoop=function(){return this._loop},Animator.prototype.getTarget=function(){return this._target},Animator.prototype.changeTarget=function(e){this._target=e},Animator.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,keys(t),n)},Animator.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a<n.length;a++){var o=n[a],s=i[o];if(!s){s=i[o]=new zt(o);var c=void 0,l=this._getAdditiveTrack(o);if(l){var u=l.keyframes,d=u[u.length-1];c=d&&d.value,l.valType===Pt&&c&&(c=rgba2String(c))}else c=this._target[o];if(c==null)continue;e>0&&s.addKeyframe(0,cloneValue(c),r),this._trackKeys.push(o)}s.addKeyframe(e,cloneValue(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},Animator.prototype.pause=function(){this._clip.pause(),this._paused=!0},Animator.prototype.resume=function(){this._clip.resume(),this._paused=!1},Animator.prototype.isPaused=function(){return!!this._paused},Animator.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},Animator.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},Animator.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},Animator.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},Animator.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},Animator.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var a=this._trackKeys[i],o=this._tracks[a],s=this._getAdditiveTrack(a),c=o.keyframes,l=c.length;if(o.prepare(r,s),o.needsAnimate())if(!this._allowDiscrete&&o.discrete){var u=c[l-1];u&&(t._target[o.propName]=u.rawValue),o.setFinished()}else n.push(o)}if(n.length||this._force){var d=new St({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,a=0;a<r.length;a++)if(r[a]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(var a=0;a<n.length;a++)n[a].step(t._target,e);var o=t._onframeCbs;if(o)for(var a=0;a<o.length;a++)o[a](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.setEasing(e)}else this._doneCallback();return this}},Animator.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},Animator.prototype.delay=function(e){return this._delay=e,this},Animator.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},Animator.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},Animator.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},Animator.prototype.getClip=function(){return this._clip},Animator.prototype.getTrack=function(e){return this._tracks[e]},Animator.prototype.getTracks=function(){var e=this;return map$1(this._trackKeys,function(t){return e._tracks[t]})},Animator.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var a=n[e[i]];a&&!a.isFinished()&&(t?a.step(this._target,1):this._started===1&&a.step(this._target,0),a.setFinished())}for(var o=!0,i=0;i<r.length;i++)if(!n[r[i]].isFinished()){o=!1;break}return o&&this._abortedCallback(),o},Animator.prototype.saveTo=function(e,t,n){if(e){t=t||this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],a=this._tracks[i];if(!(!a||a.isFinished())){var o=a.keyframes,s=o[n?0:o.length-1];s&&(e[i]=cloneValue(s.rawValue))}}}},Animator.prototype.__changeFinalValue=function(e,t){t=t||keys(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var a=i.keyframes;if(a.length>1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},Animator}();function getTime(){return new Date().getTime()}var Vt=function(e){__extends(Animation,e);function Animation(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return Animation.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},Animation.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},Animation.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},Animation.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},Animation.prototype.update=function(e){for(var t=getTime()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},Animation.prototype._startLoop=function(){var e=this;this._running=!0;function step(){e._running&&(ut(step),!e._paused&&e.update())}ut(step)},Animation.prototype.start=function(){this._running||(this._time=getTime(),this._pausedTime=0,this._startLoop())},Animation.prototype.stop=function(){this._running=!1},Animation.prototype.pause=function(){this._paused||(this._pauseStart=getTime(),this._paused=!0)},Animation.prototype.resume=function(){this._paused&&(this._pausedTime+=getTime()-this._pauseStart,this._paused=!1)},Animation.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},Animation.prototype.isFinished=function(){return this._head==null},Animation.prototype.animate=function(e,t){t=t||{},this.start();var n=new Bt(e,t.loop);return this.addAnimator(n),n},Animation}(we),Ht=300,Ut=R.domSupported,Wt=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:map$1(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),Gt={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},Kt=!1;function isPointerFromTouch(e){var t=e.pointerType;return t===`pen`||t===`touch`}function setTouchTimer(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function markTouch(e){e&&(e.zrByTouch=!0)}function normalizeGlobalEvent(e,t){return normalizeEvent(e.dom,new qt(e,t),!0)}function isLocalEl(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var qt=function(){function FakeGlobalEvent(e,t){this.stopPropagation=noop,this.stopImmediatePropagation=noop,this.preventDefault=noop,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return FakeGlobalEvent}(),Jt={mousedown:function(e){e=normalizeEvent(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=normalizeEvent(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=normalizeEvent(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=normalizeEvent(this.dom,e);var t=e.toElement||e.relatedTarget;isLocalEl(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){Kt=!0,e=normalizeEvent(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){Kt||(e=normalizeEvent(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=normalizeEvent(this.dom,e),markTouch(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),Jt.mousemove.call(this,e),Jt.mousedown.call(this,e)},touchmove:function(e){e=normalizeEvent(this.dom,e),markTouch(e),this.handler.processGesture(e,`change`),Jt.mousemove.call(this,e)},touchend:function(e){e=normalizeEvent(this.dom,e),markTouch(e),this.handler.processGesture(e,`end`),Jt.mouseup.call(this,e),new Date-+this.__lastTouchMoment<Ht&&Jt.click.call(this,e)},pointerdown:function(e){Jt.mousedown.call(this,e)},pointermove:function(e){isPointerFromTouch(e)||Jt.mousemove.call(this,e)},pointerup:function(e){Jt.mouseup.call(this,e)},pointerout:function(e){isPointerFromTouch(e)||Jt.mouseout.call(this,e)}};each$4([`click`,`dblclick`,`contextmenu`],function(e){Jt[e]=function(t){t=normalizeEvent(this.dom,t),this.trigger(e,t)}});var Yt={pointermove:function(e){isPointerFromTouch(e)||Yt.mousemove.call(this,e)},pointerup:function(e){Yt.mouseup.call(this,e)},mousemove:function(e){this.trigger(`mousemove`,e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger(`mouseup`,e),t&&(e.zrEventControl=`only_globalout`,this.trigger(`mouseout`,e))}};function mountLocalDOMEventListeners(e,t){var n=t.domHandlers;R.pointerEventsSupported?each$4(Wt.pointer,function(r){mountSingleDOMEventListener(t,r,function(t){n[r].call(e,t)})}):(R.touchEventsSupported&&each$4(Wt.touch,function(r){mountSingleDOMEventListener(t,r,function(i){n[r].call(e,i),setTouchTimer(t)})}),each$4(Wt.mouse,function(r){mountSingleDOMEventListener(t,r,function(i){i=getNativeEvent(i),t.touching||n[r].call(e,i)})}))}function mountGlobalDOMEventListeners(e,t){R.pointerEventsSupported?each$4(Gt.pointer,mount):R.touchEventsSupported||each$4(Gt.mouse,mount);function mount(n){function nativeEventListener(r){r=getNativeEvent(r),isLocalEl(e,r.target)||(r=normalizeGlobalEvent(e,r),t.domHandlers[n].call(e,r))}mountSingleDOMEventListener(t,n,nativeEventListener,{capture:!0})}}function mountSingleDOMEventListener(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,addEventListener(e.domTarget,t,n,r)}function unmountDOMEventListeners(e){var t=e.mounted;for(var n in t)t.hasOwnProperty(n)&&removeEventListener(e.domTarget,n,t[n],e.listenerOpts[n]);e.mounted={}}var Xt=function(){function DOMHandlerScope(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return DOMHandlerScope}(),Zt=function(e){__extends(HandlerDomProxy,e);function HandlerDomProxy(t,n){var r=e.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=n,r._localHandlerScope=new Xt(t,Jt),Ut&&(r._globalHandlerScope=new Xt(document,Yt)),mountLocalDOMEventListeners(r,r._localHandlerScope),r}return HandlerDomProxy.prototype.dispose=function(){unmountDOMEventListeners(this._localHandlerScope),Ut&&unmountDOMEventListeners(this._globalHandlerScope)},HandlerDomProxy.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||`default`)},HandlerDomProxy.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,Ut&&this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?mountGlobalDOMEventListeners(this,t):unmountDOMEventListeners(t)}},HandlerDomProxy}(we),Qt=1;R.hasGlobalWindow&&(Qt=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var $t=Qt,en=.4,tn=`#333`,nn=`#ccc`,rn=`#eee`,an=identity,on=5e-5;function isNotAroundZero(e){return e>on||e<-on}var sn=[],cn=[],ln=create(),un=Math.abs,dn=function(){function Transformable(){}return Transformable.prototype.getLocalTransform=function(e){return fn(this,e)},Transformable.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},Transformable.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},Transformable.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},Transformable.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},Transformable.prototype.needLocalTransform=function(){return isNotAroundZero(this.rotation)||isNotAroundZero(this.x)||isNotAroundZero(this.y)||isNotAroundZero(this.scaleX-1)||isNotAroundZero(this.scaleY-1)||isNotAroundZero(this.skewX)||isNotAroundZero(this.skewY)},Transformable.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(an(n),this.invTransform=null);return}n=n||create(),t?this.getLocalTransform(n):an(n),e&&(t?mul(n,e,n):copy(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||create(),invert(this.invTransform,n)},Transformable.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(sn);var n=sn[0]<0?-1:1,r=sn[1]<0?-1:1,i=((sn[0]-n)*t+n)/sn[0]||0,a=((sn[1]-r)*t+r)/sn[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},Transformable.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},Transformable.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},Transformable.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||create(),mul(cn,e.invTransform,t),t=cn);var n=this.originX,r=this.originY;(n||r)&&(ln[4]=n,ln[5]=r,mul(cn,t,ln),cn[4]-=n,cn[5]-=r,t=cn),this.setLocalTransform(t)}},Transformable.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},Transformable.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&applyTransform$1(n,n,r),n},Transformable.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&applyTransform$1(n,n,r),n},Transformable.prototype.getLineScale=function(){var e=this.transform;return e&&un(e[0]-1)>1e-10&&un(e[3]-1)>1e-10?Math.sqrt(un(e[0]*e[3]-e[2]*e[1])):1},Transformable.prototype.copyTransform=function(e){copyTransform(this,e)},Transformable.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&rotate(t,t,c),t[4]+=n+l,t[5]+=r+u,t},Transformable.initDefaultProps=(function(){var e=Transformable.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0})(),Transformable}(),fn=dn.getLocalTransform,pn=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function copyTransform(e,t){return assignProps(e,t,pn)}function ensureFontMeasureInfo(e){mn||(mn=new Tt(100)),e=e||`12px sans-serif`;var t=mn.get(e);return t||(t={font:e,strWidthCache:new Tt(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:re.measureText(`国`,e).width,asciiCharWidth:re.measureText(`a`,e).width},mn.put(e,t)),t}var mn;function tryCreateASCIIWidthMap(e){if(!(hn>=gn)){e=e||`12px sans-serif`;for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=re.measureText(String.fromCharCode(r),e).width;var i=+new Date-n;return i>16?hn=gn:i>2&&hn++,t}}var hn=0,gn=5;function measureCharWidth(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=tryCreateASCIIWidthMap(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap==null?e.asciiCharWidth:e.asciiWidthMap[t]:e.stWideCharWidth}function measureWidth(e,t){var n=e.strWidthCache,r=n.get(t);return r??(r=re.measureText(t,e.font).width,n.put(t,r)),r}function innerGetBoundingRect(e,t,n,r){var i=measureWidth(ensureFontMeasureInfo(t),e),a=getLineHeight(t);return new G(adjustTextX(0,i,n),adjustTextY(0,a,r),i,a)}function getBoundingRect(e,t,n,r){var i=((e||``)+``).split(`
|
|
4
4
|
`);if(i.length===1)return innerGetBoundingRect(i[0],t,n,r);for(var a=new G(0,0,0,0),o=0;o<i.length;o++){var s=innerGetBoundingRect(i[o],t,n,r);o===0?a.copy(s):a.union(s)}return a}function adjustTextX(e,t,n,r){return n===`right`?r?e+=t:e-=t:n===`center`&&(r?e+=t/2:e-=t/2),e}function adjustTextY(e,t,n,r){return n===`middle`?r?e+=t/2:e-=t/2:n===`bottom`&&(r?e+=t:e-=t),e}function getLineHeight(e){return ensureFontMeasureInfo(e).stWideCharWidth}function parsePercent$1(e,t){return typeof e==`string`?e.lastIndexOf(`%`)>=0?parseFloat(e)/100*t:parseFloat(e):e}e(parsePercent$1,`parsePercent`);function calculateTextPosition(e,t,n){var r=t.position||`inside`,i=t.distance==null?5:t.distance,a=n.height,o=n.width,s=a/2,c=n.x,l=n.y,u=`left`,d=`top`;if(r instanceof Array)c+=parsePercent$1(r[0],n.width),l+=parsePercent$1(r[1],n.height),u=null,d=null;else switch(r){case`left`:c-=i,l+=s,u=`right`,d=`middle`;break;case`right`:c+=i+o,l+=s,d=`middle`;break;case`top`:c+=o/2,l-=i,u=`center`,d=`bottom`;break;case`bottom`:c+=o/2,l+=a+i,u=`center`;break;case`inside`:c+=o/2,l+=s,u=`center`,d=`middle`;break;case`insideLeft`:c+=i,l+=s,d=`middle`;break;case`insideRight`:c+=o-i,l+=s,u=`right`,d=`middle`;break;case`insideTop`:c+=o/2,l+=i,u=`center`;break;case`insideBottom`:c+=o/2,l+=a-i,u=`center`,d=`bottom`;break;case`insideTopLeft`:c+=i,l+=i;break;case`insideTopRight`:c+=o-i,l+=i,u=`right`;break;case`insideBottomLeft`:c+=i,l+=a-i,d=`bottom`;break;case`insideBottomRight`:c+=o-i,l+=a-i,u=`right`,d=`bottom`;break}return e=e||{},e.x=c,e.y=l,e.align=u,e.verticalAlign=d,e}var _n=`__zr_normal__`,vn=pn.concat([`ignore`]),yn=reduce(pn,function(e,t){return e[t]=!0,e},{ignore:!1}),bn={},xn=new G(0,0,0,0),Sn=[],Cn=function(){function Element(e){this.id=guid(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return Element.prototype._init=function(e){this.attr(e)},Element.prototype.drift=function(e,t,n){switch(this.draggable){case`horizontal`:t=0;break;case`vertical`:e=0;break}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},Element.prototype.beforeUpdate=function(){},Element.prototype.afterUpdate=function(){},Element.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},Element.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,r=n.local,i=t.innerTransformable,a=void 0,o=void 0,s=!1;i.parent=r?this:null;var c=!1;i.copyTransform(t);var l=n.position!=null,u=n.autoOverflowArea,d=void 0;if((u||l)&&(d=xn,n.layoutRect?d.copy(n.layoutRect):d.copy(this.getBoundingRect()),r||d.applyTransform(this.transform)),l){this.calculateTextPosition?this.calculateTextPosition(bn,n,d):calculateTextPosition(bn,n,d),i.x=bn.x,i.y=bn.y,a=bn.align,o=bn.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var p=void 0,m=void 0;f===`center`?(p=d.width*.5,m=d.height*.5):(p=parsePercent$1(f[0],d.width),m=parsePercent$1(f[1],d.height)),c=!0,i.originX=-i.x+p+(r?0:d.x),i.originY=-i.y+m+(r?0:d.y)}}n.rotation!=null&&(i.rotation=n.rotation);var h=n.offset;h&&(i.x+=h[0],i.y+=h[1],c||(i.originX=-h[0],i.originY=-h[1]));var g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(u){var _=g.overflowRect=g.overflowRect||new G(0,0,0,0);i.getLocalTransform(Sn),invert(Sn,Sn),G.copy(_,d),_.applyTransform(Sn)}else g.overflowRect=null;var v=n.inside==null?typeof n.position==`string`&&n.position.indexOf(`inside`)>=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y=y||`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},Element.prototype.canBeInsideText=function(){return!0},Element.prototype.getInsideTextFill=function(){return`#fff`},Element.prototype.getInsideTextStroke=function(e){return`#000`},Element.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?nn:tn},Element.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&parse(t);n||(n=[255,255,255,1]);for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,stringify(n,`rgba`)},Element.prototype.traverse=function(e,t){},Element.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},extend(this.extra,t)):this[e]=t},Element.prototype.hide=function(){this.ignore=!0,this.markRedraw()},Element.prototype.show=function(){this.ignore=!1,this.markRedraw()},Element.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(isObject$2(e))for(var n=keys(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},Element.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==`__zr_normal__`)){var a=r.targetName,o=a?t[a]:t;r.saveTo(o)}}},Element.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,vn)},Element.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]!=null&&!(i in t)&&(t[i]=this[i])}},Element.prototype.hasState=function(){return this.currentStates.length>0},Element.prototype.getState=function(e){return this.states[e]},Element.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},Element.prototype.clearStates=function(e){this.useState(_n,!1,e)},Element.prototype.useState=function(e,t,n,r){var i=e===_n;if(!(!this.hasState()&&i)){var a=this.currentStates,o=this.stateTransition;if(!(indexOf(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),!s&&!i){logError(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=this._textContent,l=shouldUseHoverLayer(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,canTransition(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}},Element.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s<a;s++)if(e[s]!==i[s]){o=!1;break}}if(o)return;for(var s=0;s<a;s++){var c=e[s],l=void 0;this.stateProxy&&(l=this.stateProxy(c,e)),l||(l=this.states[c]),l&&r.push(l)}var u=r[a-1],d=this._textContent,f=shouldUseHoverLayer(this,d,u,n);f&&!this.__inHover&&(this.__inHover=f);var p=this._mergeStates(r),m=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(e.join(`,`),p,this._normalState,!1,canTransition(this,t,m),m);var h=this._textGuide;d&&d.useStates(e,t,!!f),h&&h.useStates(e,t,!!f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2)}},Element.prototype.isSilent=function(){for(var e=this;e;){if(e.silent)return!0;var t=e.__hostTarget;e=t?e.ignoreHostSilent?null:t:e.parent}return!1},Element.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},Element.prototype.removeState=function(e){var t=indexOf(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},Element.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=indexOf(r,e),a=indexOf(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},Element.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},Element.prototype._mergeStates=function(e){for(var t={},n,r=0;r<e.length;r++){var i=e[r];extend(t,i),i.textConfig&&(n=n||{},extend(n,i.textConfig))}return n&&(t.textConfig=n),t},Element.prototype._applyStateObj=function(e,t,n,r,i,a){if(this.__inHover!==1){var o=!(t&&r);t&&t.textConfig?(this.textConfig=extend({},r?this.textConfig:n.textConfig),extend(this.textConfig,t.textConfig)):o&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},c=!1,l=0;l<vn.length;l++){var u=vn[l],d=i&&yn[u];t&&t[u]!=null?d?(c=!0,s[u]=t[u]):this[u]=t[u]:o&&n[u]!=null&&(d?(c=!0,s[u]=n[u]):this[u]=n[u])}if(!i)for(var l=0;l<this.animators.length;l++){var f=this.animators[l],p=f.targetName;f.getLoop()||f.__changeFinalValue(p?(t||n)[p]:t||n)}c&&this._transitionState(e,s,a)}},Element.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},Element.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},Element.prototype.getClipPath=function(){return this._clipPath},Element.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},Element.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},Element.prototype.getTextContent=function(){return this._textContent},Element.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new dn,this._attachComponent(e),this._textContent=e,this.markRedraw())},Element.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),extend(this.textConfig,e),this.markRedraw()},Element.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},Element.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},Element.prototype.getTextGuideLine=function(){return this._textGuide},Element.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},Element.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},Element.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},Element.prototype.dirty=function(){this.markRedraw()},Element.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},Element.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},Element.prototype.animate=function(e,t,n){var r=new Bt(e?this[e]:this,t,n);return e&&(r.targetName=e),this.addAnimator(r,e),r},Element.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during(function(){r.updateDuringAnimation(t)}).done(function(){var t=r.animators,n=indexOf(t,e);n>=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},Element.prototype.updateDuringAnimation=function(e){this.markRedraw()},Element.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a<r;a++){var o=n[a];!e||e===o.scope?o.stop(t):i.push(o)}return this.animators=i,this},Element.prototype.animateTo=function(e,t,n){animateTo(this,e,t,n)},Element.prototype.animateFrom=function(e,t,n){animateTo(this,e,t,n,!0)},Element.prototype._transitionState=function(e,t,n,r){for(var i=animateTo(this,t,n,r),a=0;a<i.length;a++)i[a].__fromStateTransition=e},Element.prototype.getBoundingRect=function(){return null},Element.prototype.getPaintRect=function(){return null},Element.initDefaultProps=(function(){var e=Element.prototype;e.type=`element`,e.name=``,e.ignore=e.silent=e.ignoreHostSilent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=!1,e.__inHover=0,e.__dirty=1;function createLegacyProperty(t,n,r,i){Object.defineProperty(e,t,{get:function(){if(!this[n]){var e=this[n]=[];enhanceArray(this,e)}return this[n]},set:function(e){this[r]=e[0],this[i]=e[1],this[n]=e,enhanceArray(this,e)}});function enhanceArray(e,t){Object.defineProperty(t,0,{get:function(){return e[r]},set:function(t){e[r]=t}}),Object.defineProperty(t,1,{get:function(){return e[i]},set:function(t){e[i]=t}})}}Object.defineProperty&&(createLegacyProperty(`position`,`_legacyPos`,`x`,`y`),createLegacyProperty(`scale`,`_legacyScale`,`scaleX`,`scaleY`),createLegacyProperty(`origin`,`_legacyOrigin`,`originX`,`originY`))})(),Element}();mixin(Cn,we),mixin(Cn,dn);function animateTo(e,t,n,r,i){n=n||{};var a=[];animateToShallow(e,``,e,t,n,r,a,i);var o=a.length,s=!1,c=n.done,l=n.aborted,doneCb=function(){s=!0,o--,o<=0&&(s?c&&c():l&&l())},abortedCb=function(){o--,o<=0&&(s?c&&c():l&&l())};o||c&&c(),a.length>0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var u=0;u<a.length;u++){var d=a[u];doneCb&&d.done(doneCb),abortedCb&&d.aborted(abortedCb),n.force&&d.duration(n.duration),d.start(n.easing)}return a}function copyArrShallow(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function is2DArray(e){return isArrayLike(e[0])}function copyValue(e,t,n){if(isArrayLike(t[n]))if(isArrayLike(e[n])||(e[n]=[]),isTypedArray(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),copyArrShallow(e[n],t[n],r))}else{var i=t[n],a=e[n],o=i.length;if(is2DArray(i))for(var s=i[0].length,c=0;c<o;c++)a[c]?copyArrShallow(a[c],i[c],s):a[c]=Array.prototype.slice.call(i[c]);else copyArrShallow(a,i,o);a.length=i.length}else e[n]=t[n]}function isValueSame(e,t){return e===t||isArrayLike(e)&&isArrayLike(t)&&is1DArraySame(e,t)}function is1DArraySame(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function animateToShallow(e,t,n,r,i,a,o,s){for(var c=keys(r),l=i.duration,u=i.delay,d=i.additive,f=i.setToFinal,p=!isObject$2(a),m=e.animators,h=[],g=0;g<c.length;g++){var _=c[g],v=r[_];if(v!=null&&n[_]!=null&&(p||a[_]))if(isObject$2(v)&&!isArrayLike(v)&&!isGradientObject(v)){if(t){s||(n[_]=v,e.updateDuringAnimation(t));continue}animateToShallow(e,_,n[_],v,i,a&&a[_],o,s)}else h.push(_);else s||(n[_]=v,e.updateDuringAnimation(t),h.push(_))}var y=h.length;if(!d&&y)for(var b=0;b<m.length;b++){var x=m[b];if(x.targetName===t&&x.stopTracks(h)){var S=indexOf(m,x);m.splice(S,1)}}if(i.force||(h=filter(h,function(e){return!isValueSame(r[e],n[e])}),y=h.length),y>0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b<y;b++){var _=h[b];w[_]=n[_],f?C[_]=r[_]:n[_]=r[_]}}else if(f){T={};for(var b=0;b<y;b++){var _=h[b];T[_]=cloneValue(n[_]),copyValue(n,r,_)}}var x=new Bt(n,!1,!1,d?filter(m,function(e){return e.targetName===t}):null);x.targetName=t,i.scope&&(x.scope=i.scope),f&&C&&x.whenWithKeys(0,C,h),T&&x.whenWithKeys(0,T,h),x.whenWithKeys(l??500,s?w:r,h).delay(u||0),e.addAnimator(x,t),o.push(x)}}function shouldUseHoverLayer(e,t,n,r){return!(n&&n.hoverLayer||r)||isTextRelatedEl(e)||t&&isTextRelatedEl(t)?0:1}function isTextRelatedEl(e){return e.type===`text`||e.type===`tspan`}function canTransition(e,t,n){return!t&&!e.__inHover&&n&&n.duration>0}var wn=function(e){__extends(Group,e);function Group(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return Group.prototype.childrenRef=function(){return this._children},Group.prototype.children=function(){return this._children.slice()},Group.prototype.childAt=function(e){return this._children[e]},Group.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},Group.prototype.childCount=function(){return this._children.length},Group.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},Group.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},Group.prototype.replace=function(e,t){var n=indexOf(this._children,e);return n>=0&&this.replaceAt(t,n),this},Group.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},Group.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},Group.prototype.remove=function(e){var t=this.__zr,n=this._children,r=indexOf(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},Group.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},Group.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},Group.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},Group.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(t)},Group.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(t)},Group.prototype.getBoundingRect=function(e){for(var t=new G(0,0,0,0),n=e||this._children,r=[],i=null,a=0;a<n.length;a++){var o=n[a];if(!(o.ignore||o.invisible)){var s=o.getBoundingRect(),c=o.getLocalTransform(r);c?(G.applyTransform(t,s,c),i=i||t.clone(),i.union(t)):(i=i||s.clone(),i.union(s))}}return i||t},Group}(Cn);wn.prototype.type=`group`;var Tn={},En={};function delInstance(e){delete En[e]}function isDarkMode(e){if(!e)return!1;if(typeof e==`string`)return lum(e,1)<en;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,i=0;i<r;i++)n+=lum(t[i].color,1);return n/=r,n<en}return!1}var Dn=function(){function ZRender(e,t,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!1,this._darkMode=!1,n=n||{},this.dom=t,this.id=e;var i=new lt,a=n.renderer||`canvas`;Tn[a]||(a=keys(Tn)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var o=new Tn[a](t,i,n,e),s=n.ssr||o.ssrOnly;this.storage=i,this.painter=o;var c=!R.node&&!R.worker&&!s?new Zt(o.getViewportRoot(),o.root):null,l=n.useCoarsePointer,u=l==null||l===`auto`?R.touchEventsSupported:!!l,d=44,f;u&&(f=retrieve2(n.pointerSize,d)),this.handler=new at(i,o,c,o.root,f),this.animation=new Vt({stage:{update:s?null:function(){return r._flush(!1)}}}),s||this.animation.start()}return ZRender.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},ZRender.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},ZRender.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},ZRender.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=isDarkMode(e))},ZRender.prototype.getBackgroundColor=function(){return this._backgroundColor},ZRender.prototype.setDarkMode=function(e){this._darkMode=e},ZRender.prototype.isDarkMode=function(){return this._darkMode},ZRender.prototype.refreshImmediately=function(e){this._disposed||this._refresh({animUpdate:!e,refresh:!0,refreshHover:!1})},ZRender.prototype._refresh=function(e){e.animUpdate&&this.animation.update(!0),this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh({refresh:e.refresh,refreshHover:e.refreshHover}),this._needsRefresh=this._needsRefreshHover=!1},ZRender.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},ZRender.prototype.flush=function(){this._disposed||this._flush(!0)},ZRender.prototype._flush=function(e){var t,n=getTime(),r=this._needsRefresh,i=this._needsRefreshHover;(r||i)&&(t=!0,this._refresh({animUpdate:e,refresh:r,refreshHover:i}));var a=getTime();t?(this._stillFrameAccum=0,this.trigger(`rendered`,{elapsedTime:a-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},ZRender.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},ZRender.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},ZRender.prototype.refreshHover=function(){this._needsRefreshHover=!0},ZRender.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},ZRender.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},ZRender.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},ZRender.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},ZRender.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},ZRender.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},ZRender.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},ZRender.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},ZRender.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},ZRender.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},ZRender.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof wn&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},ZRender.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,delInstance(this.id))},ZRender}();function init$1(e,t){var n=new Dn(guid(),e,t);return En[n.id]=n,n}e(init$1,`init`);function registerPainter(e,t){Tn[e]=t}var On=1e-4,kn=20;function _trim(e){return e.replace(/^\s+|\s+$/g,``)}var An=Math.min,K=Math.max,jn=Math.abs,Mn=Math.round,Nn=Math.floor,Pn=Math.ceil,Fn=Math.pow,In=Math.log,Ln=Math.LN10,Rn=Math.PI,zn=Math.random;function linearMap(e,t,n,r){var i=t[0],a=t[1],o=n[0],s=n[1],c=a-i,l=s-o;if(c===0)return l===0?o:(o+s)/2;if(r){if(c>0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}var Bn=parsePositionOption;function parsePositionOption(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`;break}return parsePositionSizeOption(e,t,n)}function parsePositionSizeOption(e,t,n){return isString(e)?isOptionStringPercent(e)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function isOptionStringPercent(e){return!!_trim(e).match(/%$/)}function round$1(e,t,n){return isNaN(t)?n?``+e:+e:(t=An(K(0,t),kn),e=(+e).toFixed(t),n?e:+e)}e(round$1,`round`);function asc(e){return e.sort(function(e,t){return e-t}),e}function getPrecision(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(Mn(e*t)/t===e)return n}return getPrecisionSafe(e)}function getPrecisionSafe(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`);return K(0,(a<0?0:i-1-a)-r)}function getAcceptableTickPrecision(e,t,n){var r=jn(e[1]-e[0]);if(!isFinite(r)||r===0)return NaN;var i=In(2*jn(n||1)*jn(r))/Ln,a=In(jn(t))/Ln,o=K(0,Pn(-i+a));return isFinite(o)||(o=NaN),o}function addSafe(e,t){var n=K(getPrecision(e),getPrecision(t)),r=e+t;return n>kn?r:round$1(r,n)}var Vn=Fn(2,53)-1;function remRadian(e){var t=Rn*2;return(e%t+t)%t}function isRadianAroundZero(e){return e>-On&&e<On}var Hn=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function parseDate(e){if(e instanceof Date)return e;if(isString(e)){var t=Hn.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return t[8].toUpperCase()!==`Z`&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}else return new Date(+t[1],(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}else if(e==null)return new Date(NaN);return new Date(Mn(e))}function quantity(e){return Fn(10,quantityExponent(e))}function quantityExponent(e){if(e===0)return 0;var t=Nn(In(e)/Ln);return e/Fn(10,t)>=10&&t++,t}function nice(e,t){var n=quantityExponent(e),r=Fn(10,n),i=e/r;return e=(t===2?1:t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,round$1(e,-n)}function numericToNumber(e){var t=parseFloat(e);return t==e&&(t!==0||!isString(e)||e.indexOf(`x`)<=0)?t:NaN}function isNumeric(e){return!isNaN(numericToNumber(e))}function getRandomIdBase(){return Mn(zn()*9)}function getGreatestCommonDividor(e,t){return t===0?e:getGreatestCommonDividor(t,e%t)}function getLeastCommonMultiple(e,t){return e==null?t:t==null?e:e*t/getGreatestCommonDividor(e,t)}function isNullableNumberFinite(e){return e!=null&&isFinite(e)}var Un=`[ECharts] `,Wn={},Gn=typeof console<`u`&&console.warn&&console.log;function outputLog(e,t,n){if(Gn){if(n){if(Wn[t])return;Wn[t]=!0}console[e](Un+t)}}function error(e,t){outputLog(`error`,e,t)}function throwError(e){throw Error(e)}function interpolateNumber(e,t,n){return(t-e)*n+e}var Kn=`series\0`,qn=`\0_ec_\0`;function normalizeToArray(e){return e instanceof Array?e:e==null?[]:[e]}function defaultEmphasis(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,i=n.length;r<i;r++){var a=n[r];!e.emphasis[t].hasOwnProperty(a)&&e[t].hasOwnProperty(a)&&(e.emphasis[t][a]=e[t][a])}}}var Jn=`fontStyle.fontWeight.fontSize.fontFamily.rich.tag.color.textBorderColor.textBorderWidth.width.height.lineHeight.align.verticalAlign.baseline.shadowColor.shadowBlur.shadowOffsetX.shadowOffsetY.textShadowColor.textShadowBlur.textShadowOffsetX.textShadowOffsetY.backgroundColor.borderColor.borderWidth.borderRadius.padding`.split(`.`);function getDataItemValue(e){return isObject$2(e)&&!isArray(e)&&!(e instanceof Date)?e.value:e}function isDataItemOption(e){return isObject$2(e)&&!(e instanceof Array)}function mappingToExists(e,t,n){var r=n===`normalMerge`,i=n===`replaceMerge`,a=n===`replaceAll`;e=e||[],t=(t||[]).slice();var o=createHashMap();each$4(t,function(e,n){if(!isObject$2(e)){t[n]=null;return}});var s=prepareResult(e,o,n);return(r||i)&&mappingById(s,e,o,t),r&&mappingByName(s,t),r||i?mappingByIndex(s,t,i):a&&mappingInReplaceAllMode(s,t),makeIdAndName(s),s}function prepareResult(e,t,n){var r=[];if(n===`replaceAll`)return r;for(var i=0;i<e.length;i++){var a=e[i];a&&a.id!=null&&t.set(a.id,i),r.push({existing:n===`replaceMerge`||isComponentIdInternal(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return r}function mappingById(e,t,n,r){each$4(r,function(i,a){if(!(!i||i.id==null)){var o=makeComparableKey(i.id),s=n.get(o);if(s!=null){var c=e[s];assert(!c.newOption,`Duplicated option on id "`+o+`".`),c.newOption=i,c.existing=t[s],r[a]=null}}})}function mappingByName(e,t){each$4(t,function(n,r){if(!(!n||n.name==null))for(var i=0;i<e.length;i++){var a=e[i].existing;if(!e[i].newOption&&a&&(a.id==null||n.id==null)&&!isComponentIdInternal(n)&&!isComponentIdInternal(a)&&keyExistAndEqual(`name`,a,n)){e[i].newOption=n,t[r]=null;return}}})}function mappingByIndex(e,t,n){each$4(t,function(t){if(t){for(var r,i=0;(r=e[i])&&(r.newOption||isComponentIdInternal(r.existing)||r.existing&&t.id!=null&&!keyExistAndEqual(`id`,t,r.existing));)i++;r?(r.newOption=t,r.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),i++}})}function mappingInReplaceAllMode(e,t){each$4(t,function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function makeIdAndName(e){var t=createHashMap();each$4(e,function(e){var n=e.existing;n&&t.set(n.id,e)}),each$4(e,function(e){var n=e.newOption;assert(!n||n.id==null||!t.get(n.id)||t.get(n.id)===e,`id duplicates: `+(n&&n.id)),n&&n.id!=null&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})}),each$4(e,function(e,n){var r=e.existing,i=e.newOption,a=e.keyInfo;if(isObject$2(i)){if(a.name=i.name==null?r?r.name:Kn+n:makeComparableKey(i.name),r)a.id=makeComparableKey(r.id);else if(i.id!=null)a.id=makeComparableKey(i.id);else{var o=0;do a.id=`\0`+a.name+`\0`+ o++;while(t.get(a.id))}t.set(a.id,e)}})}function keyExistAndEqual(e,t,n){var r=convertOptionIdName(t[e],null),i=convertOptionIdName(n[e],null);return r!=null&&i!=null&&r===i}function makeComparableKey(e){return convertOptionIdName(e,``)}function convertOptionIdName(e,t){return e==null?t:isString(e)?e:isNumber(e)||isStringSafe(e)?e+``:t}function isNameSpecified(e){var t=e.name;return!!(t&&t.indexOf(Kn))}function isComponentIdInternal(e){return e&&e.id!=null&&makeComparableKey(e.id).indexOf(qn)===0}function setComponentTypeToKeyInfo(e,t,n){each$4(e,function(e){var r=e.newOption;isObject$2(r)&&(e.keyInfo.mainType=t,e.keyInfo.subType=determineSubType(t,r,e.existing,n))})}function determineSubType(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}function queryDataIndex(e,t){if(t.dataIndexInside!=null)return t.dataIndexInside;if(t.dataIndex!=null)return isArray(t.dataIndex)?map$1(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex);if(t.name!=null)return isArray(t.name)?map$1(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name)}function makeInner(){var e=`__ec_inner_`+ Yn++;return function(t){return t[e]||(t[e]={})}}var Yn=getRandomIdBase();function parseFinder(e,t,n){var r=preParseFinder(t,n),i=r.mainTypeSpecified,a=r.queryOptionMap,o=r.others,s=n?n.defaultMainType:null;return!i&&s&&a.set(s,{}),a.each(function(t,r){var i=queryReferringComponents(e,r,t,{useDefault:s===r,enableAll:n&&n.enableAll!=null?n.enableAll:!0,enableNone:n&&n.enableNone!=null?n.enableNone:!0});o[r+`Models`]=i.models,o[r+`Model`]=i.models[0]}),o}function preParseFinder(e,t){var n;if(isString(e)){var r={};r[e+`Index`]=0,n=r}else n=e;var i=createHashMap(),a={},o=!1;return each$4(n,function(e,n){if(n===`dataIndex`||n===`dataIndexInside`){a[n]=e;return}var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],c=(r[2]||``).toLowerCase();if(!(!s||!c||t&&t.includeMainTypes&&indexOf(t.includeMainTypes,s)<0)){o=o||!!s;var l=i.get(s)||i.set(s,{});l[c]=e}}),{mainTypeSpecified:o,queryOptionMap:i,others:a}}var Xn={useDefault:!0,enableAll:!1,enableNone:!1},Zn={useDefault:!1,enableAll:!0,enableNone:!0};function queryReferringComponents(e,t,n,r){r=r||Xn;var i=n.index,a=n.id,o=n.name,s={models:null,specified:i!=null||a!=null||o!=null};if(!s.specified){var c=void 0;return s.models=r.useDefault&&(c=e.getComponent(t))?[c]:[],s}if(i===`none`||i===!1){if(r.enableNone)return s.models=[],s;i=-1}return i===`all`&&(i=r.enableAll?a=o=null:-1),s.models=e.queryComponents({mainType:t,index:i,id:a,name:o}),s}function makeQueryConditionKindA(e,t,n){var r={};r[t+`Id`]=e[t+`Id`],r[t+`Index`]=e[t+`Index`],r[t+`Name`]=e[t+`Name`];var i={mainType:t,query:r};return n&&(i.subType=n),i}function setAttribute(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function getAttribute(e,t){return e.getAttribute?e.getAttribute(t):e[t]}function getTooltipRenderMode(e){return e===`auto`?R.domSupported?`html`:`richText`:e||`html`}function interpolateRawValues(e,t,n,r,i){var a=t==null||t===`auto`;if(r==null)return r;if(isNumber(r)){var o=interpolateNumber(n||0,r,i);return round$1(o,a?Math.max(getPrecision(n||0),getPrecision(r)):t)}else if(isString(r))return i<1?n:r;else{for(var s=[],c=n,l=r,u=Math.max(c?c.length:0,l.length),d=0;d<u;++d){var f=e.getDimensionInfo(d);if(f&&f.type===`ordinal`)s[d]=(i<1&&c?c:l)[d];else{var p=c&&c[d]?c[d]:0,m=l[d],o=interpolateNumber(p,m,i);s[d]=round$1(o,a?Math.max(getPrecision(p),getPrecision(m)):t)}}return s}}(function(){function ListIterator(){}return ListIterator.prototype.reset=function(e,t,n,r){return this._list=e,this._step=r=r||1,this._idx=t,this._end=n??(r>0?e.length:0),this.item=null,this.key=NaN,this},ListIterator.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)?(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0):!1},ListIterator})();function initExtentForUnion(){return[1/0,-1/0]}function unionExtentFromNumber(e,t){isValidNumberForExtent(t)&&(t<e[0]&&(e[0]=t),t>e[1]&&(e[1]=t))}function unionExtentStartFromNumber(e,t){isValidNumberForExtent(t)&&t<e[0]&&(e[0]=t)}function unionExtentEndFromNumber(e,t){isValidNumberForExtent(t)&&t>e[1]&&(e[1]=t)}function unionExtentFromExtent(e,t){isValidBoundsForExtent(t[0],t[1])&&(t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]))}function isValidNumberForExtent(e){return e!=null&&isFinite(e)}function isValidBoundsForExtent(e,t){return isValidNumberForExtent(e)&&isValidNumberForExtent(t)&&e<=t}function extentHasValue(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function ensureExtentAscSimply(e){isValidBoundsForExtent(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function makeCallOnlyOnce(){var e=`__ec_once_`+ Qn++;return function(t,n){hasOwn(t,e)||(t[e]=1,n())}}var Qn=getRandomIdBase();function removeDuplicates(e,t,n){var r=createHashMap(),i=0;each$4(e,function(a){var o=t(a),s=r.get(o)||0;n&&n(a,s),!s&&!n&&(e[i++]=a),r.set(o,s+1)}),n||(e.length=i)}function removeDuplicatesGetKeyFromValueProp(e){return e.value+``}function removeDuplicatesGetKeyFromItemItself(e){return e+``}function getIncrementalId(e,t){return retrieve2(t,!0)?e.seriesIndex+2:0}function preparePipelineContext(e,t,n){var r=e.getData().count();return{progressiveRender:n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,large:e.get(`large`)&&r>=e.get(`largeThreshold`),modDataCount:e.get(`progressiveChunkMode`)===`mod`?e.getData().count():null}}function createSimpleOverallStageHandler2(e){return{overallReset:e}}var $n=`.`,er=`___EC__COMPONENT__CONTAINER___`,tr=`___EC__EXTENDED_CLASS___`;function parseClassType(e){var t={main:``,sub:``};if(e){var n=e.split($n);t.main=n[0]||``,t.sub=n[1]||``}return t}function checkClassType(e){assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),`componentType "`+e+`" illegal`)}function isExtendedClass(e){return!!(e&&e[tr])}function enableClassExtend(e,t){e.$constructor=e,e.extend=function(e){var t=this,ExtendedClass;return isESClass(t)?ExtendedClass=function(e){__extends$1(class_1,e);function class_1(){return e.apply(this,arguments)||this}return class_1}(t):(ExtendedClass=function(){(e.$constructor||t).apply(this,arguments)},inherits(ExtendedClass,this)),extend(ExtendedClass.prototype,e),ExtendedClass[tr]=!0,ExtendedClass.extend=this.extend,ExtendedClass.superCall=superCall,ExtendedClass.superApply=superApply,ExtendedClass.superClass=t,ExtendedClass}}function isESClass(e){return isFunction(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function mountExtend(e,t){e.extend=t.extend}var nr=Math.round(Math.random()*10);function enableClassCheck(e){var t=[`__\0is_clz`,nr++].join(`_`);e.prototype[t]=!0,e.isInstance=function(e){return!!(e&&e[t])}}function superCall(e,t){var n=[...arguments].slice(2);return this.superClass.prototype[t].apply(e,n)}function superApply(e,t,n){return this.superClass.prototype[t].apply(e,n)}function enableClassManagement(e){var t={};e.registerClass=function(e){var n=e.type||e.prototype.type;if(n){checkClassType(n),e.prototype.type=n;var r=parseClassType(n);if(!r.sub)t[r.main]=e;else if(r.sub!==er){var i=makeContainer(r);i[r.sub]=e}}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[er]&&(i=n?i[n]:null),r&&!i)throw Error(n?`Component `+e+`.`+(n||``)+` is used but not imported.`:e+`.type should be specified.`);return i},e.getClassesByMainType=function(e){var n=parseClassType(e),r=[],i=t[n.main];return i&&i[er]?each$4(i,function(e,t){t!==er&&r.push(e)}):r.push(i),r},e.hasClass=function(e){return!!t[parseClassType(e).main]},e.getAllClassMainTypes=function(){var e=[];return each$4(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[parseClassType(e).main];return n&&n[er]};function makeContainer(e){var n=t[e.main];return(!n||!n[er])&&(n=t[e.main]={},n[er]=!0),n}}function makeStyleMapper(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(n,r,i){for(var a={},o=0;o<e.length;o++){var s=e[o][1];if(!(r&&indexOf(r,s)>=0||i&&indexOf(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var rr=makeStyleMapper([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),ir=function(){function AreaStyleMixin(){}return AreaStyleMixin.prototype.getAreaStyle=function(e,t){return rr(this,e,t)},AreaStyleMixin}(),ar=new Tt(50);function findExistImage(e){if(typeof e==`string`){var t=ar.get(e);return t&&t.image}else return e}function createOrUpdateImage(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=ar.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!isImageReady(t)&&a.pending.push(o)):(t=re.loadImage(e,imageOnLoad,imageOnLoad),t.__zrImageSrc=e,ar.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e}function imageOnLoad(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function isImageReady(e){return e&&e.width&&e.height}var or=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function truncateText2(e,t,n,r,i,a){if(!n){e.text=``,e.isTruncated=!1;return}var o=(t+``).split(`
|
|
@@ -18,4 +18,4 @@ import{i as e,r as t}from"./chunk-D6hFPZc3.js";import{$ as n,C as r,H as i,Ht as
|
|
|
18
18
|
`:`<br/>`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},TooltipView.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=Y(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=buildTooltipModel([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(!(m!=null&&m!==`item`)){var h=s.getDataParams(c,l),g=new tc;h.marker=g.makeTooltipMarker(`item`,convertToColorString(h.color),d);var _=normalizeTooltipFormatResult(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?buildTooltipMarkup(y?extend({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},TooltipView.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=Y(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(isString(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=clone$2(a),a.content=encodeHTML(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=buildTooltipModel(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new tc;this._showOrMove(d,function(){var n=clone$2(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},TooltipView.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,!(!e.get(`showContent`)||!e.get(`show`))){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o=o||e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u)if(isString(u)){var p=e.ecModel.get(`useUTC`),m=isArray(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=format(m.axisValue,d,p)),d=formatTpl(d,n,!0)}else if(isFunction(u)){var g=U(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u;l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},TooltipView.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||isArray(t))return{color:r||i};if(!isArray(t))return{color:r||t.color||t.borderColor}},TooltipView.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t=t||e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),isFunction(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),isArray(t))n=Bn(t[0],s),r=Bn(t[1],c);else if(isObject$2(t)){var p=t;p.width=l[0],p.height=l[1];var m=getLayoutRect(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(isString(t)&&o){var h=calcTooltipPosition(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=refixTooltipPosition(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=isCenterAlign(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=isCenterAlign(d)?l[1]/2:d===`bottom`?l[1]:0),shouldTooltipConfine(e)){var h=confineTooltipPosition(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},TooltipView.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&each$4(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i=i&&o.length===s.length,i&&each$4(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&each$4(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&each$4(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},TooltipView.prototype._hide=function(e){this._lastDataByCoordSys=null,this._cbParamsList=null,e({type:`hideTip`,from:this.uid})},TooltipView.prototype.dispose=function(e,t){R.node||!t.getDom()||(clear(this,`_updatePosition`),this._tooltipContent.dispose(),unregister(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},TooltipView.type=`tooltip`,TooltipView}(ic);function buildTooltipModel(e,t,n){var r=t.ecModel,i;n?(i=new bo(n,r,r),i=new bo(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof bo&&(o=o.get(`tooltip`,!0)),isString(o)&&(o={formatter:o}),o&&(i=new bo(o,i,r)))}return i}function makeDispatchAction(e,t){return e.dispatchAction||U(t.dispatchAction,t)}function refixTooltipPosition(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function confineTooltipPosition(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function calcTooltipPosition(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function isCenterAlign(e){return e===`center`||e===`middle`}function findComponentReference(e,t,n){var r=preParseFinder(e).queryOptionMap,i=r.keys()[0];if(!(!i||i===`series`)){var a=queryReferringComponents(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=Y(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function install$8(e){use(install$10),e.registerComponentModel(If),e.registerComponentView(Gf),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},noop),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},noop)}e(install$8,`install`);function checkMarkerInSeries(e,t){if(!e)return!1;for(var n=isArray(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function fillLabel(e){defaultEmphasis(e,`label`,[`show`])}var Kf=makeInner(),qf=function(e){__extends$1(MarkerModel,e);function MarkerModel(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=MarkerModel.type,t.createdBySelf=!1,t.preventAutoZ=!0,t}return MarkerModel.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},MarkerModel.prototype.isAnimationEnabled=function(){if(R.node)return!1;var e=this.__hostSeries;return this.getShallow(`animation`)&&e&&e.isAnimationEnabled()},MarkerModel.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},MarkerModel.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),a=Kf(e)[i];if(!n||!n.data){Kf(e)[i]=null;return}a?a._mergeOption(n,t,!0):(r&&fillLabel(n),each$4(n.data,function(e){e instanceof Array?(fillLabel(e[0]),fillLabel(e[1])):fillLabel(e)}),a=this.createMarkerModelFromSeries(n,this,t),extend(a,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),a.__hostSeries=e),Kf(e)[i]=a},this)},MarkerModel.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),a=r.getName(e);return createTooltipMarkup(`section`,{header:this.name,blocks:[createTooltipMarkup(`nameValue`,{name:a,value:i,noName:!a,noValue:i==null})]})},MarkerModel.prototype.getData=function(){return this._data},MarkerModel.prototype.setData=function(e){this._data=e},MarkerModel.prototype.getDataParams=function(e,t){var n=Ls.prototype.getDataParams.call(this,e,t),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},MarkerModel.getMarkerModelFromSeries=function(e,t){return Kf(e)[t]},MarkerModel.type=`marker`,MarkerModel.dependencies=[`series`,`grid`,`polar`,`geo`],MarkerModel}(Z);mixin(qf,Ls.prototype);function hasXOrY(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function hasXAndY(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}function markerTypeCalculatorWithExtent(e,t,n,r,i,a,o){var s=[],c=isDimensionStacked(t,i)?t.getCalculationInfo(`stackResultDimension`):i,l=numCalculate(t,c,e),u=t.hostModel.indicesOfNearest(n,c,l)[0];s[a]=t.get(r,u),s[o]=t.get(c,u);var d=t.get(i,u),f=getPrecision(t.get(i,u));return f=Math.min(f,20),f>=0&&(s[o]=+s[o].toFixed(f)),[s,d]}var Jf={min:curry$1(markerTypeCalculatorWithExtent,`min`),max:curry$1(markerTypeCalculatorWithExtent,`max`),average:curry$1(markerTypeCalculatorWithExtent,`average`),median:curry$1(markerTypeCalculatorWithExtent,`median`)};function dataTransform(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!hasXAndY(t)&&!isArray(t.coord)&&isArray(i)){var a=getAxisInfo(t,n,r,e);if(t=clone$2(t),t.type&&Jf[t.type]&&a.baseAxis&&a.valueAxis){var o=indexOf(i,a.baseAxis.dim),s=indexOf(i,a.valueAxis.dim),c=Jf[t.type](n,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!isArray(i)){t.coord=[];var l=e.getBaseAxis();if(l&&t.type&&Jf[t.type]){var u=r.getOtherAxis(l);u&&(t.value=numCalculate(n,n.mapDimension(u.dim),t.type))}}else for(var d=t.coord,f=0;f<2;f++)Jf[d[f]]&&(d[f]=numCalculate(n,n.mapDimension(i[f]),d[f]));return t}}function getAxisInfo(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(dataDimToCoordDim(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function dataDimToCoordDim(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function dataFilter(e,t){return e&&e.containData&&t.coord&&!hasXOrY(t)?e.containData(t.coord):!0}function createMarkerDimValueGetter(e,t){return e?function(e,n,r,i){return parseDataValue(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return parseDataValue(e.value,t[i])}}function numCalculate(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}else if(n===`median`)return e.getMedian(t);else return e.getDataExtent(t)[n===`max`?1:0]}var Yf=makeInner(),Xf=function(e){__extends$1(MarkerView,e);function MarkerView(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=MarkerView.type,t}return MarkerView.prototype.init=function(){this.markerGroupMap=createHashMap()},MarkerView.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){Yf(e).keep=!1}),t.eachSeries(function(e){var i=qf.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!Yf(e).keep&&r.group.remove(e.group)}),updateZ(t,i,this.type)},MarkerView.prototype.markKeep=function(e){Yf(e).keep=!0},MarkerView.prototype.toggleBlurSeries=function(e,t){var n=this;each$4(e,function(e){var r=qf.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?enterBlur(e):leaveBlur(e))})})},MarkerView.type=`marker`,MarkerView}(ic);function updateZ(e,t,n){e.eachSeries(function(e){var r=qf.getMarkerModelFromSeries(e,n),i=t.get(e.id);if(r&&i&&i.group){var a=retrieveZInfo(r),o=a.z,s=a.zlevel;traverseUpdateZ(i.group,o,s)}})}var Zf=function(e){__extends$1(MarkLineModel,e);function MarkLineModel(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=MarkLineModel.type,t}return MarkLineModel.prototype.createMarkerModelFromSeries=function(e,t,n){return new MarkLineModel(e,t,n)},MarkLineModel.type=`markLine`,MarkLineModel.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},MarkLineModel}(qf),Qf=makeInner(),markLineTransform=function(e,t,n,r){var i=e.getData(),a;if(isArray(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=retrieve(r.yAxis,r.xAxis);else{var l=getAxisInfo(r,i,t,e);s=l.valueAxis,c=numCalculate(i,getStackedDimension(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=clone$2(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&isNumber(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[dataTransform(e,a[0]),dataTransform(e,a[1]),extend({},a[2])];return h[2].type=h[2].type||null,merge(h[2],h[0]),merge(h[2],h[1]),h};function isInfinity(e){return!isNaN(e)&&!isFinite(e)}function ifMarkLineHasOnlyDim(e,t,n,r){var i=1-e,a=r.dimensions[e];return isInfinity(t[i])&&isInfinity(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function markLineFilter(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(ifMarkLineHasOnlyDim(1,n,r,e)||ifMarkLineHasOnlyDim(0,n,r,e)))return!0}return dataFilter(e,t[0])&&dataFilter(e,t[1])}function updateSingleMarkerEndLayout(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Bn(o.get(`x`),i.getWidth()),l=Bn(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(isCoordinateSystemType(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;isInfinity(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):isInfinity(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[n?0:1]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}var $f=function(e){__extends$1(MarkLineView,e);function MarkLineView(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=MarkLineView.type,t}return MarkLineView.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=qf.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=Qf(t).from,a=Qf(t).to;i.each(function(t){updateSingleMarkerEndLayout(i,t,!0,e,n),updateSingleMarkerEndLayout(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},MarkLineView.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new hf);this.group.add(c.group);var l=createList(i,e,t),u=l.from,d=l.to,f=l.line;Qf(t).from=u,Qf(t).to=d,t.setData(f);var p=t.get(`symbol`),m=t.get(`symbolSize`),h=t.get(`symbolRotate`),g=t.get(`symbolOffset`);isArray(p)||(p=[p,p]),isArray(m)||(m=[m,m]),isArray(h)||(h=[h,h]),isArray(g)||(g=[g,g]),l.from.each(function(e){updateDataVisualAndLayout(u,e,!0),updateDataVisualAndLayout(d,e,!1)}),f.each(function(e){var t=f.getItemModel(e),n=t.getModel(`lineStyle`).getLineStyle();f.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]);var r=t.get(`z2`);n.stroke??(n.stroke=u.getItemVisual(e,`style`).fill),f.setItemVisual(e,{z2:retrieve2(r,0),fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:n})}),c.updateData(f),l.line.eachItemGraphicEl(function(e){Y(e).dataModel=t,e.traverse(function(e){Y(e).dataModel=t})});function updateDataVisualAndLayout(t,n,i){var a=t.getItemModel(n);updateSingleMarkerEndLayout(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??(s.fill=getVisualFromData(o,`color`)),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:retrieve2(a.get(`symbolOffset`,!0),g[i?0:1]),symbolRotate:retrieve2(a.get(`symbolRotate`,!0),h[i?0:1]),symbolSize:retrieve2(a.get(`symbolSize`),m[i?0:1]),symbol:retrieve2(a.get(`symbol`,!0),p[i?0:1]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},MarkLineView.type=`markLine`,MarkLineView}(Xf);function createList(e,t,n){var r=e?map$1(e&&e.dimensions,function(e){var n=t.getData();return extend(extend({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new lu(r,n),a=new lu(r,n),o=new lu([],n),s=map$1(n.get(`data`),curry$1(markLineTransform,t,e,n));e&&(s=filter(s,curry$1(markLineFilter,e)));var c=createMarkerDimValueGetter(!!e,r);return i.initData(map$1(s,function(e){return e[0]}),null,c),a.initData(map$1(s,function(e){return e[1]}),null,c),o.initData(map$1(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function install$7(e){e.registerComponentModel(Zf),e.registerComponentView($f),e.registerPreprocessor(function(e){checkMarkerInSeries(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}e(install$7,`install`);var getDefaultSelectorOptions=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},ep=function(e){__extends$1(LegendModel,e);function LegendModel(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=LegendModel.type,t.layoutMode={type:`box`,ignoreSize:!0},t}return LegendModel.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},LegendModel.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},LegendModel.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),isArray(t)&&each$4(t,function(e,r){isString(e)&&(e={type:e}),t[r]=merge(e,getDefaultSelectorOptions(n,e.type))})},LegendModel.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get(`name`);if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get(`name`))}},LegendModel.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i=r.name;n.push(i);var a;if(r.legendVisualProvider){var o=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&isNameSpecified(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get(`data`)||t,i=createHashMap();this._data=filter(map$1(r,function(e){return(isString(e)||isNumber(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new bo(e,this,this.ecModel))},this),function(e){return!!e})},LegendModel.prototype.getData=function(){return this._data},LegendModel.prototype.select=function(e){var t=this.option.selected;if(this.get(`selectedMode`)===`single`){var n=this._data;each$4(n,function(e){t[e.get(`name`)]=!1})}t[e]=!0},LegendModel.prototype.unSelect=function(e){this.get(`selectedMode`)!==`single`&&(this.option.selected[e]=!1)},LegendModel.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?`unSelect`:`select`](e)},LegendModel.prototype.allSelect=function(){var e=this._data,t=this.option.selected;each$4(e,function(e){t[e.get(`name`,!0)]=!0})},LegendModel.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;each$4(e,function(e){var n=e.get(`name`,!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},LegendModel.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&indexOf(this._availableNames,e)>=0},LegendModel.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},LegendModel.type=`legend.plain`,LegendModel.dependencies=[`series`],LegendModel.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:Q.size.m,align:`auto`,backgroundColor:Q.color.transparent,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:Q.color.disabled,inactiveBorderColor:Q.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:Q.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:Q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:Q.color.tertiary,borderWidth:1,borderColor:Q.color.border},emphasis:{selectorLabel:{show:!0,color:Q.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},LegendModel}(Z),tp=curry$1,np=each$4,rp=wn,ip=function(e){__extends$1(LegendView,e);function LegendView(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=LegendView.type,t.newlineDisabled=!1,t}return LegendView.prototype.init=function(){this.group.add(this._contentGroup=new rp),this.group.add(this._selectorGroup=new rp),this._isFirstRender=!0},LegendView.prototype.getContentGroup=function(){return this._contentGroup},LegendView.prototype.getSelectorGroup=function(){return this._selectorGroup},LegendView.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=createBoxLayoutReference(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=getLayoutRect(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=getLayoutRect(defaults({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(f,e))}},LegendView.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},LegendView.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=createHashMap(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),np(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===`
|
|
19
19
|
`)){var p=new rp;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f))if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,tp(dispatchSelectAction,f,null,r,d)).on(`mouseover`,tp(dispatchHighlightAction,m.name,null,r,d)).on(`mouseout`,tp(dispatchDownplayAction,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=Y(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=parse(h.fill);_&&_[3]===0&&(_[3]=.2,h=extend(extend({},h),{fill:stringify(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,tp(dispatchSelectAction,null,f,r,d)).on(`mouseover`,tp(dispatchHighlightAction,null,f,r,d)).on(`mouseout`,tp(dispatchDownplayAction,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=Y(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)},this),i&&this._createSelector(i,t,r,a,o)},LegendView.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};Y(e).eventData=a},LegendView.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();np(e,function createSelectorButton(e){var r=e.type,i=new gi({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),setLabelStyle(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),enableHoverEmphasis(i)})},LegendView.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=getLegendStyle(c,r,o,s,d,m,u),y=new rp,b=r.getModel(`textStyle`);if(isFunction(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(getDefaultLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;isString(w)&&w?T=w.replace(`{name}`,t??``):isFunction(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new gi({style:createTextStyle(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new di({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&setTooltipConfig({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),enableHoverEmphasis(y),y.__legendDataIndex=n,y},LegendView.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();Qo(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){Qo(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}else return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},LegendView.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},LegendView.type=`legend.plain`,LegendView}(ic);function getLegendStyle(e,t,n,r,i,a,o){function handleCommonProps(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),np(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var s=t.getModel(`itemStyle`),c=s.getItemStyle(),l=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,u=s.getShallow(`decal`);c.decal=!u||u===`inherit`?r.decal:createOrUpdatePatternFromDecal(u,o),c.fill===`inherit`&&(c.fill=r[i]),c.stroke===`inherit`&&(c.stroke=r[l]),c.opacity===`inherit`&&(c.opacity=(i===`fill`?r:n).opacity),handleCommonProps(c,r);var d=t.getModel(`lineStyle`),f=d.getLineStyle();if(handleCommonProps(f,n),c.fill===`auto`&&(c.fill=r.fill),c.stroke===`auto`&&(c.stroke=r.fill),f.stroke===`auto`&&(f.stroke=r.fill),!a){var p=t.get(`inactiveBorderWidth`),m=c[l];c.lineWidth=p===`auto`?r.lineWidth>0&&m?2:0:c.lineWidth,c.fill=t.get(`inactiveColor`),c.stroke=t.get(`inactiveBorderColor`),f.stroke=d.get(`inactiveColor`),f.lineWidth=d.get(`inactiveWidth`)}return{itemStyle:c,lineStyle:f}}function getDefaultLegendIcon(e){var t=e.icon||`roundRect`,n=createSymbol$1(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function dispatchSelectAction(e,t,n,r){dispatchDownplayAction(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),dispatchHighlightAction(e,t,n,r)}function dispatchHighlightAction(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function dispatchDownplayAction(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function legendSelectActionHandler(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),makeSelectedMap(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){each$4(i,function(t,n){e[t?`select`:`unSelect`](n)}),makeSelectedMap(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function makeSelectedMap(e,t){var n=t||{};return each$4(e.getData(),function(t){var r=t.get(`name`);if(!(r===`
|
|
20
20
|
`||r===``)){var i=e.isSelected(r);hasOwn(n,r)?n[r]=n[r]&&i:n[r]=i}}),n}function installLegendAction(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,curry$1(legendSelectActionHandler,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,curry$1(legendSelectActionHandler,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,curry$1(legendSelectActionHandler,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,curry$1(legendSelectActionHandler,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,curry$1(legendSelectActionHandler,`unSelect`))}var ap=createSimpleOverallStageHandler2(legendFilter);function legendFilter(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function install$6(e){e.registerComponentModel(ep),e.registerComponentView(ip),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,ap),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),installLegendAction(e)}e(install$6,`install`);var op=function(e){__extends$1(ScrollableLegendModel,e);function ScrollableLegendModel(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=ScrollableLegendModel.type,t}return ScrollableLegendModel.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},ScrollableLegendModel.prototype.init=function(t,n,r){var i=getLayoutParams(t);e.prototype.init.call(this,t,n,r),mergeAndNormalizeLayoutParams(this,t,i)},ScrollableLegendModel.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),mergeAndNormalizeLayoutParams(this,this.option,t)},ScrollableLegendModel.type=`legend.scroll`,ScrollableLegendModel.defaultOption=inheritDefaultOption(ep.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:`end`,pageFormatter:`{current}/{total}`,pageIcons:{horizontal:[`M0,0L12,-10L12,10z`,`M0,0L-12,-10L-12,10z`],vertical:[`M0,0L20,0L10,-20z`,`M0,0L20,0L10,20z`]},pageIconColor:Q.color.accent50,pageIconInactiveColor:Q.color.accent10,pageIconSize:15,pageTextStyle:{color:Q.color.tertiary},animationDurationUpdate:800}),ScrollableLegendModel}(ep);function mergeAndNormalizeLayoutParams(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,mergeLayoutParam(t,n,{type:`box`,ignoreSize:!!i})}var sp=wn,cp=[`width`,`height`],lp=[`x`,`y`],up=function(e){__extends$1(ScrollableLegendView,e);function ScrollableLegendView(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=ScrollableLegendView.type,t.newlineDisabled=!0,t._currentIndex=0,t}return ScrollableLegendView.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new sp),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new sp)},ScrollableLegendView.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},ScrollableLegendView.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=isArray(u)?u:[u,u];createPageButton(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new gi({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),createPageButton(`pageNext`,1);function createPageButton(e,t){var r=e+`DataIndex`,a=createIcon(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:U(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},ScrollableLegendView.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=cp[s],l=lp[s],u=cp[1-s],d=lp[1-s];i&&Qo(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=clone$2(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},ScrollableLegendView.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;Qo(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),Qo(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=retrieve2(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new di({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&updateProps$1(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},ScrollableLegendView.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},ScrollableLegendView.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;each$4([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,isString(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},ScrollableLegendView.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=cp[i],o=lp[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=u?1:0,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=getItemInfo(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=getItemInfo(c[m]),(!_&&g.e>h.s+r||_&&!intersect(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??(f.pageNextDataIndex=h.i),++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=getItemInfo(c[m]),(!_||!intersect(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??(f.pagePrevDataIndex=h.i),++f.pageCount,++f.pageIndex),h=_;return f;function getItemInfo(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function intersect(e,t){return e.e>=t&&e.s<=t+r}},ScrollableLegendView.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},ScrollableLegendView.type=`legend.scroll`,ScrollableLegendView}(ip);function installScrollableLegendAction(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function install$5(e){use(install$6),e.registerComponentModel(op),e.registerComponentView(up),installScrollableLegendAction(e)}e(install$5,`install`);function install$4(e){use(install$6),use(install$5)}e(install$4,`install`);var dp=function(e){__extends$1(InsideZoomModel,e);function InsideZoomModel(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=InsideZoomModel.type,t}return InsideZoomModel.type=`dataZoom.inside`,InsideZoomModel.defaultOption=inheritDefaultOption(jf.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),InsideZoomModel}(jf),fp=makeInner();function setViewInfoToCoordSysRecord(e,t,n){fp(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function disposeCoordSysRecordIfNeeded(e,t){for(var n=fp(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var a=r[i],o=n.get(a),s=o.dataZoomInfoMap;if(s){var c=t.uid;s.get(c)&&(s.removeKey(c),s.keys().length||disposeCoordSysRecord(n,o))}}}function disposeCoordSysRecord(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function createCoordSysRecord(e,t){var n={model:t,containsPoint:curry$1(containsPoint,t),dispatchAction:curry$1(dispatchAction,e),dataZoomInfoMap:null,controller:null},r=n.controller=new sf(e.getZr());return each$4([`pan`,`zoom`,`scrollMove`],function(e){r.on(e,function(t){var r=[];n.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var a=(i.getRange||{})[e],o=a&&a(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get(`disabled`,!0)&&o&&r.push({dataZoomId:i.model.id,start:o[0],end:o[1]})}}),r.length&&n.dispatchAction(r)})}),n}function dispatchAction(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function containsPoint(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function mergeControllerParams(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,s,c;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:t.get(`zoomLock`,!0)?`move`:!0;a[i+n]>a[i+r]&&(r=n),o=o&&t.get(`preventDefaultMouseMove`,!0),s=retrieve2(t.get(`cursorGrab`,!0),s),c=retrieve2(t.get(`cursorGrabbing`,!0),c)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint},cursorGrab:s,cursorGrabbing:c}}}function installDataZoomRoamProcessor(e){e.registerUpdateLifecycle(`coordsys:aftercreate`,function(e,t){var n=fp(t),r=n.coordSysRecordMap||(n.coordSysRecordMap=createHashMap());r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){each$4(collectReferCoordSysModelInfo(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,createCoordSysRecord(t,n.model));(a.dataZoomInfoMap||(a.dataZoomInfoMap=createHashMap())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){disposeCoordSysRecord(r,e);return}var s=mergeControllerParams(a,e,t);n.enable(s.controlType,s.opt),createOrUpdate(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}var pp=function(e){__extends$1(InsideZoomView,e);function InsideZoomView(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return InsideZoomView.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),setViewInfoToCoordSysRecord(r,t,{pan:U(mp.pan,this),zoom:U(mp.zoom,this),scrollMove:U(mp.scrollMove,this)})},InsideZoomView.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},InsideZoomView.prototype._clear=function(){disposeCoordSysRecordIfNeeded(this.api,this.dataZoomModel),this.range=null},InsideZoomView.type=`dataZoom.inside`,InsideZoomView}(Mf),mp={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=hp[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(sliderMove(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:makeMover(function(e,t,n,r,i,a){var o=hp[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:makeMover(function(e,t,n,r,i,a){return hp[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function makeMover(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(sliderMove(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var hp={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e=e||[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e=e||[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function install$3(e){installCommon(e),e.registerComponentModel(dp),e.registerComponentView(pp),installDataZoomRoamProcessor(e)}e(install$3,`install`);var gp=function(e){__extends$1(SliderZoomModel,e);function SliderZoomModel(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=SliderZoomModel.type,t}return SliderZoomModel.type=`dataZoom.slider`,SliderZoomModel.layoutMode=`box`,SliderZoomModel.defaultOption=inheritDefaultOption(jf.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:Q.color.accent10,borderRadius:0,backgroundColor:Q.color.transparent,dataBackground:{lineStyle:{color:Q.color.accent30,width:.5},areaStyle:{color:Q.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:Q.color.accent40,width:.5},areaStyle:{color:Q.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:Q.color.neutral00,borderColor:Q.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:Q.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:Q.color.tertiary},brushSelect:!0,brushStyle:{color:Q.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:Q.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),SliderZoomModel}(jf),_p=di,vp=1,yp=30,bp=7,xp=`horizontal`,Sp=`vertical`,Cp=5,wp=[`line`,`bar`,`candlestick`,`scatter`],Tp={easing:`cubicOut`,duration:100,delay:0},Ep=function(e){__extends$1(SliderZoomView,e);function SliderZoomView(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=SliderZoomView.type,t._displayables={},t}return SliderZoomView.prototype.init=function(e,t){this.api=t,this._onBrush=U(this._onBrush,this),this._onBrushEnd=U(this._onBrushEnd,this)},SliderZoomView.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),createOrUpdate(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},SliderZoomView.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},SliderZoomView.prototype._clear=function(){clear(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},SliderZoomView.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new wn;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},SliderZoomView.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?bp:0,r=createBoxLayoutReference(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===xp?{right:r.width-i.x-i.width,top:r.height-yp-a-n,width:i.width,height:yp}:{right:a,top:i.y,width:yp,height:i.height},s=getLayoutParams(e.option);each$4([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=getLayoutRect(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===Sp&&this._size.reverse()},SliderZoomView.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===xp&&!i?{scaleY:o?1:-1,scaleX:1}:n===xp&&i?{scaleY:o?1:-1,scaleX:-1}:n===Sp&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]),c=isNaN(s.x)?0:s.x,l=isNaN(s.y)?0:s.y;e.x=t.x-c,e.y=t.y-l,e.markRedraw()},SliderZoomView.prototype._getViewExtent=function(){return[0,this._size[0]]},SliderZoomView.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new _p({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new _p({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:U(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},SliderZoomView.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:linearMap(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function createDataShadowGroup(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new wn,r=new xa({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new Ca({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var C=0;C<3;C++){var w=createDataShadowGroup(C===1);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}},SliderZoomView.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){each$4(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&indexOf(wp,e.get(`type`))<0)){var o=r.getComponent(getAxisMainType(i),a).axis,s=getOtherDim(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},SliderZoomView.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new _p({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new _p({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:vp,fill:Q.color.transparent}})),each$4([0,1],function(t){var a=o.get(`handleIcon`);!Uc[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=createSymbol$1(a,-1,0,2,2,null,!0);s.attr({cursor:getCursor(this._orient),draggable:!0,drift:U(this._onDragMove,this,t),ondragend:U(this._onDragEnd,this),onmouseover:U(this._onOverDataInfoTriggerArea,this,!0),onmouseout:U(this._onOverDataInfoTriggerArea,this,!1),z2:5});var c=s.getBoundingRect();this._handleHeight=Bn(o.get(`handleSize`),this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),enableHoverEmphasis(s);var l=o.get(`handleColor`);l!=null&&(s.style.fill=l),i.add(n[t]=s);var u=o.getModel(`textStyle`),d=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new gi({silent:!0,invisible:!d,style:createTextStyle(u,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:u.getTextColor(),font:u.getFont()}),z2:10}))},this);var d=u;if(l){var f=Bn(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new di({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=createSymbol$1(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,Q.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new di({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`grab`,drift:U(this._onActualMoveZoneDrift,this),ondragstart:U(this._onActualMoveZoneDragStart,this),ondragend:U(this._onActualMoveZoneDragEnd,this),onmouseover:U(this._onOverDataInfoTriggerArea,this,!0),onmouseout:U(this._onOverDataInfoTriggerArea,this,!1)})},SliderZoomView.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[linearMap(e[0],[0,100],t,!0),linearMap(e[1],[0,100],t,!0)]},SliderZoomView.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];sliderMove(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:linearMap(a.minSpan,o,i,!0),a.maxSpan==null?null:linearMap(a.maxSpan,o,i,!0));var s=this._range,c=this._range=asc([linearMap(r[0],i,o,!0),linearMap(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},SliderZoomView.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=asc(n.slice()),i=this._size;each$4([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new di,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},SliderZoomView.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy(),s=o.getAxisModel().axis.scale;if(o){var c=this._range,l;if(e){var u={start:c[0],end:c[1]},d=getAlignTo(t,o);if(d){var f=d.calculateDataWindow(u).percentInverted;u={start:f[0],end:f[1]}}l=o.calculateDataWindow(u)}else l=o.getWindow();a=[formatLabel(t,0,l,s),formatLabel(t,1,l,s)]}}var p=asc(this._handleEnds.slice());setLabel.call(this,0),setLabel.call(this,1);function setLabel(e){var t=getTransform(n.handles[e].parent,this.group),o=transformDirection(e===0?`right`:`left`,t),s=this._handleWidth/2+Cp,c=applyTransform([p[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===xp?`middle`:o,align:i===xp?o:`center`,text:a[e]})}},SliderZoomView.prototype._onOverDataInfoTriggerArea=function(e){this._isOverDataInfoTriggerArea=e,this._showDataInfo(e)},SliderZoomView.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},SliderZoomView.prototype._onActualMoveZoneDrift=function(e,t,n){this.api.getZr().setCursorStyle(`grabbing`),this._onDragMove(`all`,e,t,n)},SliderZoomView.prototype._onActualMoveZoneDragStart=function(e){e.target.attr(`cursor`,`grabbing`),this._showDataInfo(!0)},SliderZoomView.prototype._onActualMoveZoneDragEnd=function(e){e.target.attr(`cursor`,`grab`),this._onDragEnd()},SliderZoomView.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,stop(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=applyTransform([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},SliderZoomView.prototype._onDragEnd=function(){this._dragging=!1,this._isOverDataInfoTriggerArea||this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},SliderZoomView.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},SliderZoomView.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new W(t,n),this._brushing=!0,this._brushStartTime=+new Date},SliderZoomView.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();sliderMove(0,a,r,0,o.minSpan==null?null:linearMap(o.minSpan,i,r,!0),o.maxSpan==null?null:linearMap(o.maxSpan,i,r,!0)),this._range=asc([linearMap(a[0],r,i,!0),linearMap(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},SliderZoomView.prototype._onBrush=function(e){this._brushing&&(stop(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},SliderZoomView.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new _p({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},SliderZoomView.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?Tp:null,start:t[0],end:t[1]})},SliderZoomView.prototype._findCoordRect=function(){var e,t=collectReferCoordSysModelInfo(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},SliderZoomView.type=`dataZoom.slider`,SliderZoomView}(Mf);function formatLabel(e,t,n,r){var i=e.get(`labelFormatter`),a=e.get(`labelPrecision`);(a==null||a===`auto`)&&(a=n.valuePrecision);var o=n.value[t],s=o==null||isNaN(o)?``:isOrdinalScale(r)||isTimeScale(r)?r.getLabel({value:Math.round(o)}):isFinite(a)?round$1(o,a,!0):o+``;return isFunction(i)?i(o,s):isString(i)?i.replace(`{value}`,s):s}function getOtherDim(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function getCursor(e){return e===`vertical`?`ns-resize`:`ew-resize`}function install$2(e){e.registerComponentModel(gp),e.registerComponentView(Ep),installCommon(e)}e(install$2,`install`);function install$1(e){use(install$3),use(install$2)}e(install$1,`install`);function createDom(e,t,n){var r=re.createCanvas(),i=t.getWidth(),a=t.getHeight(),o=r.style;return o&&(o.position=`absolute`,o.left=`0`,o.top=`0`,o.width=i+`px`,o.height=a+`px`,r.setAttribute(`data-zr-dom-id`,e)),r.width=i*n,r.height=a*n,r}function isIncrementalLayer(e){return!e.__cursors.get(0)}function getStartEndFromCursor(e){var t=e.__cursors.get(0);return{startIdx:t?t.startIdx:0,endIdx:t?t.endIdx:0}}var Dp=function(e){__extends(Layer,e);function Layer(t,n,r){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.zlevel=0,i.zlevel2=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__prevIdx={startIdx:0,endIdx:0};var a;r=r||$t,typeof t==`string`?a=createDom(t,n,r):isObject$2(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(disableUserSelect(a),a.onselectstart=function(){return!1},o.padding=`0`,o.margin=`0`,o.borderWidth=`0`),i.painter=n,i.dpr=r,i}return Layer.prototype.afterBrush=function(){this.__prevIdx=getStartEndFromCursor(this)},Layer.prototype.initContext=function(){this.ctx=this.dom.getContext(`2d`),this.ctx.dpr=this.dpr},Layer.prototype.setUnpainted=function(){this.__firstTimePaint=!0},Layer.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=createDom(`back-`+this.id,this.painter,e),this.ctxBack=this.domBack.getContext(`2d`),e!==1&&this.ctxBack.scale(e,e)},Layer.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],a=this.maxRepaintRectCount,o=!1,s=new G(0,0,0,0);function addRectToMergePool(e){if(!(!e.isFinite()||e.isZero()))if(i.length===0){var t=new G(0,0,0,0);t.copy(e),i.push(t)}else{for(var n=!1,r=1/0,c=0,l=0;l<i.length;++l){var u=i[l];if(u.intersect(e)){var d=new G(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}else if(o){s.copy(e),s.union(u);var f=e.width*e.height,p=u.width*u.height,m=s.width*s.height-f-p;m<r&&(r=m,c=l)}}if(o&&(i[c].union(e),n=!0),!n){var t=new G(0,0,0,0);t.copy(e),i.push(t)}o||(o=i.length>=a)}}for(var c=getStartEndFromCursor(this),l=c.startIdx;l<c.endIdx;++l){var u=e[l];if(u){var d=u.shouldBePainted(n,r,!0,!0),f=u.__isRendered&&(u.__dirty&1||!d)?u.getPrevPaintRect():null;f&&addRectToMergePool(f);var p=d&&(u.__dirty&1||!u.__isRendered)?u.getPaintRect():null;p&&addRectToMergePool(p)}}for(var m=this.__prevIdx,l=m.startIdx;l<m.endIdx;++l){var u=t[l],d=u&&u.shouldBePainted(n,r,!0,!0);if(u&&(!d||!u.__zr)&&u.__isRendered){var f=u.getPrevPaintRect();f&&addRectToMergePool(f)}}var h;do{h=!1;for(var l=0;l<i.length;){if(i[l].isZero()){i.splice(l,1);continue}for(var g=l+1;g<i.length;)i[l].intersect(i[g])?(h=!0,i[l].union(i[g]),i.splice(g,1)):g++;l++}}while(h);return this._paintRects=i,i},Layer.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},Layer.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,a=this.domBack;i&&(i.width=e+`px`,i.height=t+`px`),r.width=e*n,r.height=t*n,a&&(a.width=e*n,a.height=t*n,n!==1&&this.ctxBack.scale(n,n))},Layer.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,a=r.width,o=r.height;t=t||this.clearColor;var s=this.motionBlur&&!e,c=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation=`copy`,this.ctxBack.drawImage(r,0,0,a/l,o/l));var d=this.domBack;function doClear(e,n,r,a){if(i.clearRect(e,n,r,a),t&&t!==`transparent`){var o=void 0;isGradientObject(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||getCanvasGradient(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):isImagePatternObject(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=createCanvasPattern(i,t,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),i.save(),i.fillStyle=o||t,i.fillRect(e,n,r,a),i.restore()}s&&(i.save(),i.globalAlpha=c,i.drawImage(d,e,n,r,a),i.restore())}!n||s?doClear(0,0,a,o):n.length&&each$4(n,function(e){doClear(e.x*l,e.y*l,e.width*l,e.height*l)})},Layer}(we),Op=1e5,kp=314159,Ap=void 0,jp=1,Mp=2;function isLayerValid(e){return e?e.__builtin__?!0:!(typeof e.resize!=`function`||typeof e.refresh!=`function`):!1}function createRoot(e,t){var n=document.createElement(`div`);return n.style.cssText=[`position:relative`,`width:`+e+`px`,`height:`+t+`px`,`padding:0`,`margin:0`,`border-width:0`].join(`;`)+`;`,n}function createBuiltinLayer(e,t,n,r){var i=new Dp(e,t,t.dpr);return i.zlevel=n,i.zlevel2=r,i.__builtin__=!0,resetLayerDrawCursors(i),i}function resetLayerDrawCursors(e){e.__cursorStack=[],e.__cursors=createHashMap()}function resetLayerDrawCursor(e){return e.startIdx=e.drawIdx=e.endIdx=e.endIdxNew=0,e.used=!1,e.first=e.last=NaN,e.notClearIdx=-1,e}function ensureLayerDrawCursor(e,t){var n=e.__cursors,r=+t;return n.get(r)||(e.__cursorStack.push(r),n.set(r,resetLayerDrawCursor({key:r})))}function eachCursorInLayer(e,t){for(var n=e.__cursorStack,r=0;r<n.length;r++)t(e.__cursors.get(n[r]))}function ensureLayerListInZLevel(e,t){var n=e.layers;return n[t]||(n[t]=[,,,])}function eachLayer(e,t,n){for(var r=e.layerStack,i=0;i<r.length;i++){var a=r[i].zl,o=r[i].zl2,s=e.layers[a][o];(!n||(!(n&Np)||s.__builtin__)&&(!(n&Pp)||!s.__builtin__)&&(!(n&Fp)||s!==e.hoverlayer))&&t(s,a,o,i)}}var Np=1,Pp=2,Fp=4,Ip=Np|Fp,Lp=function(){function CanvasPainter(e,t,n,r){this.type=`canvas`,this._prevDisplayList=[],this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`,this._i={layerStack:[],layers:[]};var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;if(this._opts=n=extend({},n||{}),this.dpr=n.devicePixelRatio||$t,this._singleCanvas=i,this.root=e,e.style&&(disableUserSelect(e),e.innerHTML=``),this.storage=t,this._prevDisplayList=[],i){var a=e,o=a.width,s=a.height;n.width!=null&&(o=n.width),n.height!=null&&(s=n.height),this.dpr=n.devicePixelRatio||1,a.width=o*this.dpr,a.height=s*this.dpr,this._width=o,this._height=s;var c=createBuiltinLayer(a,this,kp,0);c.initContext(),this._insertLayer(c,kp,0,!0),this._domRoot=e}else{this._width=getSize(e,0,n),this._height=getSize(e,1,n);var l=this._domRoot=createRoot(this._width,this._height);e.appendChild(l)}}return CanvasPainter.prototype.getType=function(){return`canvas`},CanvasPainter.prototype.isSingleCanvas=function(){return this._singleCanvas},CanvasPainter.prototype.getViewportRoot=function(){return this._domRoot},CanvasPainter.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},CanvasPainter.prototype.refresh=function(e){var t=e&&!isObject$2(e)?{paintAll:!!e}:e||{},n=retrieve2(t.refresh,!0),r=retrieve2(t.refreshHover,!1);if(r&&(this._hoverLayerDirty=Mp),!n)return r&&this._paintHoverList(this.storage.getDisplayList(!1)),this;var i=this.storage.getDisplayList(!0);this._updateLayerStatus(i,t.paintAll),this._redrawId=Math.random();var a=this._prevDisplayList;this._paintList(i,a,this._redrawId);var o=this._backgroundColor;return eachLayer(this._i,function(e,t,n,r){e.refresh&&e.refresh(r===0?o:null)},Pp),this._opts.useDirtyRect&&(this._prevDisplayList=i.slice()),this},CanvasPainter.prototype._paintHoverList=function(e){var t=this._i.hoverlayer,n=this._hoverLayerDirty;if(this._hoverLayerDirty=Ap,n!==Ap&&(!t&&n===Mp&&(t=this._i.hoverlayer=this._ensureLayer(Op)),t)){t.clear();for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},i,a=0,o=e.length;a<o;a++){var s=e[a];if(s.__inHover){i||(i=t.ctx,i.save());var c=s.__hoverStyle,l=void 0;c&&(l=s.style,s.style=c),brush(i,s,r),c&&(s.style=l)}}i&&(brushLoopFinalize(i,r),i.restore())}},CanvasPainter.prototype.getHoverLayer=function(){return this._ensureLayer(Op)},CanvasPainter.prototype.paintOne=function(e,t){brushSingle(e,t)},CanvasPainter.prototype._paintList=function(e,t,n){if(this._redrawId===n){var r=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),r)eachLayer(this._i,function(e){e.afterBrush&&e.afterBrush()},Ip),this._paintHoverList(e);else{var i=this;ut(function(){i._paintList(e,t,n)})}}},CanvasPainter.prototype._compositeManually=function(){var e=this._ensureLayer(kp).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),eachLayer(this._i,function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)},Np)},CanvasPainter.prototype._doPaintList=function(e,t){var n=this,r=!0;return eachLayer(this._i,function(i){var a=!1;if(eachCursorInLayer(i,function(e){(e.drawIdx<e.endIdx||e.notClearIdx>=0)&&(a=!0)}),!(!a&&!i.__dirty)){var o=n._opts.useDirtyRect&&!isIncrementalLayer(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}eachCursorInLayer(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r=r&&a})}},Ip),R.wxa&&eachLayer(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},CanvasPainter.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r)if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s<r.length;++s){var c=r[s];a.save(),a.beginPath(),a.rect(c.x*o,c.y*o,c.width*o,c.height*o),a.clip(),this._paintPerCursorInRect(e,t,n,c,i),a.restore()}else a.save(),this._paintPerCursorInRect(e,t,n,null,i),a.restore();return t.drawIdx>=t.endIdx},CanvasPainter.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=isIncrementalLayer(e),c=s&&re.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d<t.endIdx;d++){var f=n[d];if(!(d<l&&!f.notClear)){if(f.__inHover&&(this._hoverLayerDirty=Mp),r!=null){var p=f.getPaintRect();p&&p.intersect(r)&&(brush(o,f,a),f.setPrevPaintRect(p))}else brush(o,f,a);if(s&&re.getTime()-c>15){d++;break}}}brushLoopFinalize(o,a),t.drawIdx=Math.max(d,l)},CanvasPainter.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},CanvasPainter.prototype._ensureLayer=function(e,t,n){t=t||0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=kp,t=0);var i=ensureLayerListInZLevel(this._i,e)[t];return i||(i=createBuiltinLayer(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&merge(i,this._layerConfig[e],!0),(n||r&&e!==kp)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},CanvasPainter.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},CanvasPainter.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&isLayerValid(e)){for(var l=o.length,u=0;u<l&&(o[u].zl<t||o[u].zl===t&&o[u].zl2<n);)u++;if(u>0&&(c=ensureLayerListInZLevel(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),ensureLayerListInZLevel(i,t)[n]=e,!r&&!e.virtual)if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom);e.painter||(e.painter=this)}},CanvasPainter.prototype.eachLayer=function(e,t){return eachLayer(this._i,function(n,r){e.call(t,n,r)})},CanvasPainter.prototype.eachBuiltinLayer=function(e,t){return eachLayer(this._i,function(n,r){e.call(t,n,r)},Np)},CanvasPainter.prototype.eachOtherLayer=function(e,t){return eachLayer(this._i,function(n,r){e.call(t,n,r)},Pp)},CanvasPainter.prototype.getLayers=function(){var e={};return eachLayer(this._i,function(t,n,r){e[t.id]=t}),e},CanvasPainter.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){n._needsManuallyCompositing=!0;break}}eachLayer(n._i,function(e){e.__dirty=!1,eachCursorInLayer(e,function(e){e.used=!1,e.endIdxNew=0,e.notClearIdx=-1})},Ip);for(var a,o=null,s=null,c=!1,l=0,u=e.length;l<u;l++){var i=e[l],d=i.zlevel,f=i.incremental,p=void 0;if(a!==d&&(a=d,c=!1),f?(c=!0,p=1):p=c?2:0,(!o||d!==o.zlevel||p!==o.zlevel2)&&(o=n._ensureLayer(d,p),s=null,!o.__builtin__)){logError(`ZLevel `+d+` has been used by unknown layer `+o.id);continue}if((!s||f!==s.key)&&(s=ensureLayerDrawCursor(o,f),!s.used))if(s.used=!0,!t&&s.first===i.id){var m=l-s.startIdx;s.startIdx=l,s.drawIdx+=m,s.endIdx+=m}else o.__dirty=!0,s.first=i.id,s.startIdx=s.drawIdx=l,s.endIdx=l+1;s.endIdxNew=l+1,i.__dirty&1&&!i.__inHover&&((!f||!i.notClear&&l<s.drawIdx)&&(o.__dirty=!0),f&&i.notClear&&s.notClearIdx<0&&(s.notClearIdx=l))}eachLayer(n._i,function(t){for(var r=t.__cursorStack,i=t.__cursors,a=r.length-1;a>=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(isIncrementalLayer(t)?s<o.drawIdx:s!==o.endIdx||!s||e[s-1].id!==o.last)&&(t.__dirty=!0),o.endIdx=o.endIdxNew,o.last=s?e[s-1].id:NaN}}t.__dirty&&(eachCursorInLayer(t,function(e){e.drawIdx=e.startIdx}),n._hoverLayerDirty===Ap&&(n._hoverLayerDirty=jp))},Ip)},CanvasPainter.prototype.clear=function(){return eachLayer(this._i,function(e){e.clear(),resetLayerDrawCursors(e)},Np),this},CanvasPainter.prototype.setBackgroundColor=function(e){this._backgroundColor=e,eachLayer(this._i,function(e){e.setUnpainted()})},CanvasPainter.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?merge(n[e],t,!0):n[e]=t,eachLayer(this._i,function(e,t){merge(e,n[t],!0)})}},CanvasPainter.prototype.delLayer=function(e){for(var t=this._i.layerStack,n=this._i.layers,r=t.length-1;r>=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},CanvasPainter.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;e!=null&&(r.width=e),t!=null&&(r.height=t),e=getSize(i,0,r),t=getSize(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,eachLayer(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(kp).resize(e,t)}return this},CanvasPainter.prototype.clearLayer=function(e){each$4(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},CanvasPainter.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},CanvasPainter.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._i.layers[kp][0].dom;var t=new Dp(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;eachLayer(this._i,function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else{for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];brush(n,l,a)}brushLoopFinalize(n,a)}return t.dom},CanvasPainter.prototype.getWidth=function(){return this._width},CanvasPainter.prototype.getHeight=function(){return this._height},CanvasPainter}();function install(e){e.registerPainter(`canvas`,Lp)}var Rp=Object.defineProperty,__name=(e,t)=>Rp(e,`name`,{value:t,configurable:!0});function useLearnerDataset(){let e=_(null),t=_(null),n=x(!1),r=x(null);async function load(i,a){n.value=!0,r.value=null;try{let n=await i();t.value=fromDump(n,a),e.value=n}catch(e){r.value=e instanceof Error?e.message:String(e)}finally{n.value=!1}}function loadFromCouch(e){return load(()=>fetchLearnerDump({...e,auth:{kind:`cookie`}}),e.courseId)}function loadFromFile(e,t){return load(async()=>parseLearnerDump(await e.text()),t)}return{dump:e,dataset:t,loading:n,error:r,loadFromCouch,loadFromFile}}function downloadLearnerDump(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=dumpFileName(e),r.click(),URL.revokeObjectURL(n)}var zp={class:`d-flex flex-wrap align-center ga-2`},Bp={key:1,class:`d-flex flex-wrap align-center ga-2 mt-3`},Vp=d({__name:`LearnerDatasetSource`,props:{couchUrl:{},courseId:{},initialUsername:{},autoload:{type:Boolean}},emits:[`loaded`],setup(e,{emit:t}){let o=e,c=t,{dump:l,dataset:d,loading:f,error:_,loadFromCouch:T,loadFromFile:E}=useLearnerDataset(),D=x(o.initialUsername??``),O=x(null),k=v(()=>{let e=d.value?.sessions??[];return e.length?`${e[0].startTime.slice(0,10)} .. ${e[e.length-1].startTime.slice(0,10)}`:``});function loadLive(){!o.couchUrl||!o.courseId||!D.value||T({couchUrl:o.couchUrl,courseId:o.courseId,username:D.value})}function onFile(e){let t=e.target,n=t.files?.[0];n&&E(n,o.courseId),t.value=``}return p(d,e=>{e&&l.value&&c(`loaded`,e,l.value)}),w(()=>{o.autoload&&loadLive()}),(e,t)=>{let o=s(`v-text-field`),c=s(`v-btn`),p=s(`v-alert`),v=s(`v-spacer`),x=s(`v-card-text`),w=s(`v-card`);return i(),S(w,{variant:`outlined`},{default:n(()=>[r(x,null,{default:n(()=>[m(`div`,zp,[r(o,{modelValue:D.value,"onUpdate:modelValue":t[0]||(t[0]=e=>D.value=e),label:`Learner`,density:`compact`,"hide-details":``,style:{"max-width":`16rem`},disabled:!e.couchUrl||!e.courseId,onKeydown:b(loadLive,[`enter`])},null,8,[`modelValue`,`disabled`]),r(c,{color:`primary`,loading:y(f),disabled:!e.couchUrl||!e.courseId||!D.value,onClick:loadLive},{default:n(()=>t[3]||(t[3]=[u(` Load `)])),_:1},8,[`loading`,`disabled`]),t[5]||(t[5]=m(`span`,{class:`text-medium-emphasis mx-2`},`or`,-1)),r(c,{variant:`tonal`,"prepend-icon":`mdi-file-upload-outline`,onClick:t[1]||(t[1]=e=>O.value?.click())},{default:n(()=>t[4]||(t[4]=[u(` Open dump file `)])),_:1}),m(`input`,{ref_key:`fileInput`,ref:O,type:`file`,accept:`.json,application/json`,hidden:``,onChange:onFile},null,544)]),y(_)?(i(),S(p,{key:0,type:`error`,variant:`tonal`,density:`compact`,class:`mt-3`},{default:n(()=>[u(a(y(_)),1)]),_:1})):C(``,!0),y(d)&&y(l)?(i(),h(`div`,Bp,[m(`span`,null,[m(`strong`,null,a(y(d).username),1),u(` · `+a(y(d).sessions.length)+` sessions `,1),k.value?(i(),h(g,{key:0},[u(`(`+a(k.value)+`)`,1)],64)):C(``,!0),u(` · `+a(y(d).cardHistories.length)+` cards seen · as of `+a(y(d).asOf.slice(0,16))+`Z `,1),y(d).cards?C(``,!0):(i(),h(g,{key:1},[u(`· no course slice`)],64))]),r(v),r(c,{variant:`text`,size:`small`,"prepend-icon":`mdi-download`,onClick:t[2]||(t[2]=e=>y(downloadLearnerDump)(y(l)))},{default:n(()=>t[6]||(t[6]=[u(` Save dump `)])),_:1})])):C(``,!0)]),_:1})]),_:1})}}}),Hp={churned:{icon:`mdi-autorenew`,color:`warning`},"out-of-content":{icon:`mdi-cup-off-outline`,color:`error`},walked:{icon:`mdi-exit-run`,color:`error`},stalled:{icon:`mdi-arrow-collapse-horizontal`,color:`grey`},grinding:{icon:`mdi-alert-octagon-outline`,color:`warning`}};function statusColor(e){return e===`closed`?`success`:e===`abandoned`?`warning`:`error`}function accuracyClass(e){return e===null?`text-disabled`:e>=.8?`text-success`:e<.5?`text-error`:``}function deltaClass(e){return e===null||e===0?`text-disabled`:e>0?`text-success`:`text-error`}function deltaColor(e){return e>0?`success`:e<0?`error`:`grey`}function fmtTime(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function fmtClock(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString(void 0,{hour12:!1})}function shortId(e,t=28){return e.length>t?`…${e.slice(-(t-2))}`:e}function useCopy(){let e=x(null),t=null;async function copy(n,r){try{await navigator.clipboard.writeText(n),e.value=r,t&&clearTimeout(t),t=setTimeout(()=>e.value=null,1400)}catch(e){console.warn(`[admin] clipboard write failed`,e)}}return{copied:e,copy}}var Up={key:0,class:`text-caption mb-2`},Wp={class:`text-medium-emphasis`},Gp={class:`d-flex flex-wrap mb-2 ga-1`},Kp={key:0,class:`text-caption text-disabled`},qp={class:`text-caption text-medium-emphasis mb-2`},Jp={key:0,class:`text-error`},Yp={class:`text-no-wrap`},Xp={key:2,class:`text-disabled`},Zp={class:`text-truncate`,style:{"max-width":`200px`}},Qp=d({__name:`CardDossierDetail`,props:{dossier:{},interpreters:{}},setup(e){function perf(e){let t=recordPerformance(e);return t===null?`—`:t.toFixed(2)}function fmtInterval(e){return e?e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`:`none`}return(e,t)=>{let o=s(`v-chip`),l=s(`v-icon`),d=s(`v-table`);return i(),h(`div`,null,[e.dossier.card&&Object.keys(e.dossier.card.data).length?(i(),h(`div`,Up,[(i(!0),h(g,null,f(e.dossier.card.data,(e,t)=>(i(),h(`span`,{key:t,class:`mr-3`},[m(`span`,Wp,a(t)+`:`,1),u(` `+a(y(fmtAnswer)(e,60)),1)]))),128))])):C(``,!0),m(`div`,Gp,[(i(!0),h(g,null,f(e.dossier.card?.tags??[],t=>(i(),S(o,{key:t,size:`x-small`,variant:`outlined`,color:y(isSkillTag)(e.interpreters,t)?`primary`:void 0},{default:n(()=>[u(a(t),1)]),_:2},1032,[`color`]))),128)),e.dossier.card?C(``,!0):(i(),h(`span`,Kp,`no course data in this dataset`))]),m(`div`,qp,[u(` lapses `+a(e.dossier.lapses)+` · streak `+a(e.dossier.streak)+` · best interval `+a(fmtInterval(e.dossier.bestIntervalSeconds))+` · `,1),e.dossier.pendingReview?(i(),h(g,{key:0},[u(` next review `+a(y(fmtTime)(e.dossier.pendingReview.reviewTime))+` `,1),e.dossier.pendingReview.overdue?(i(),h(`span`,Jp,`(overdue)`)):C(``,!0)],64)):(i(),h(g,{key:1},[u(`no review scheduled`)],64))]),r(d,{density:`compact`,class:`sk-record-table`},{default:n(()=>[t[2]||(t[2]=m(`thead`,null,[m(`tr`,null,[m(`th`,null,`#`),m(`th`,null,`When`),m(`th`,null,`Result`),m(`th`,null,`Perf`),m(`th`,null,`Prior att.`),m(`th`,null,`Time`),m(`th`,null,`Answer`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(e.dossier.records,(e,r)=>(i(),h(`tr`,{key:r,class:c(e.isCorrect===!1?`sk-fail-row`:``)},[m(`td`,null,a(r+1),1),m(`td`,Yp,a(y(fmtTime)(e.timeStamp)),1),m(`td`,null,[e.isCorrect===!0?(i(),S(l,{key:0,size:`small`,color:`success`},{default:n(()=>t[0]||(t[0]=[u(`mdi-check`)])),_:1})):e.isCorrect===!1?(i(),S(l,{key:1,size:`small`,color:`error`},{default:n(()=>t[1]||(t[1]=[u(`mdi-close`)])),_:1})):(i(),h(`span`,Xp,`—`))]),m(`td`,null,a(perf(e)),1),m(`td`,null,a(e.priorAttemps??`—`),1),m(`td`,null,a(((e.timeSpent??0)/1e3).toFixed(1))+`s`,1),m(`td`,Zp,a(y(fmtAnswer)(e.userAnswer)),1)],2))),128))])]),_:1})])}}}),$p=__name((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},`default`),em=$p(Qp,[[`__scopeId`,`data-v-76b0a622`]]),tm={class:`text-caption text-medium-emphasis mb-4`},nm={class:`text-h6`},rm={class:`text-caption`},im={class:`d-flex align-center flex-wrap mb-3 ga-3`},am={class:`d-flex align-center flex-wrap ga-2`,style:{width:`100%`}},om={class:`text-body-2 font-weight-medium`},sm={class:`text-caption text-medium-emphasis`},cm={key:2,class:`text-caption`},lm={key:0,class:`ml-1 text-disabled`},um=$p(d({__name:`LearnerCardHistory`,props:{dataset:{},interpreters:{},focus:{}},setup(e){let t=e,o=v(()=>cardDossiers(t.dataset)),d=x(`all`),_=x(``),b=x([]),w=x(null),T=v(()=>({stuck:o.value.filter(e=>e.stuck).length,failed:o.value.filter(e=>e.fails>0).length,frozen:o.value.filter(e=>e.frozenElo).length})),E=v(()=>[{label:`cards seen`,value:o.value.length,color:`primary`},{label:`total attempts`,value:o.value.reduce((e,t)=>e+t.attempts,0),color:`primary`},{label:`total fails`,value:o.value.reduce((e,t)=>e+t.fails,0),color:`error`},{label:`time on cards`,value:fmtDuration(o.value.reduce((e,t)=>e+t.totalTimeMs,0)/1e3),color:`grey`},{label:`stuck reviews`,value:T.value.stuck,color:`error`},{label:`frozen ELO`,value:T.value.frozen,color:`warning`}]),D=v(()=>{let e=o.value;d.value===`stuck`?e=e.filter(e=>e.stuck):d.value===`failed`?e=e.filter(e=>e.fails>0):d.value===`frozen`&&(e=e.filter(e=>e.frozenElo));let t=_.value?.trim().toLowerCase();return t&&(e=e.filter(e=>e.cardId.toLowerCase().includes(t)||(e.card?.questionType??``).toLowerCase().includes(t)||(e.card?.tags??[]).some(e=>e.toLowerCase().includes(t))||Object.values(e.card?.data??{}).some(e=>typeof e==`string`&&e.toLowerCase().includes(t)))),e});function headline(e){let t=Object.values(e.card?.data??{}).find(e=>typeof e==`string`&&e.length<=40);return typeof t==`string`?t:``}async function applyFocus(e){!e||!o.value.some(t=>t.cardId===e)||(d.value=`all`,_.value=e,b.value=[e],await l(),document.querySelector(`[data-card="${CSS.escape(e)}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}),w.value=e,setTimeout(()=>{w.value===e&&(w.value=null)},2200))}return p(()=>t.focus,e=>void applyFocus(e),{immediate:!0}),(e,t)=>{let l=s(`v-icon`),p=s(`v-card`),v=s(`v-col`),x=s(`v-row`),O=s(`v-btn`),k=s(`v-btn-toggle`),A=s(`v-text-field`),j=s(`v-alert`),M=s(`v-spacer`),N=s(`v-chip`),P=s(`v-expansion-panel-title`),I=s(`v-expansion-panel-text`),L=s(`v-expansion-panel`),R=s(`v-expansion-panels`);return i(),h(`div`,null,[m(`p`,tm,[t[5]||(t[5]=u(` Every card the learner has met, most painful first (time sunk × failures), with its pending review and current card ELO. `)),r(l,{size:`x-small`,color:`error`},{default:n(()=>t[3]||(t[3]=[u(`mdi-sync-alert`)])),_:1}),t[6]||(t[6]=u(` is a failed card holding an overdue review; `)),r(l,{size:`x-small`,color:`warning`},{default:n(()=>t[4]||(t[4]=[u(`mdi-snowflake`)])),_:1}),t[7]||(t[7]=u(` is a repeatedly failed card whose ELO has fewer updates than failures. `))]),r(x,{dense:``,class:`mb-2`},{default:n(()=>[(i(!0),h(g,null,f(E.value,e=>(i(),S(v,{key:e.label,cols:`6`,sm:`4`,md:`2`},{default:n(()=>[r(p,{variant:`tonal`,color:e.color,class:`pa-2 text-center`},{default:n(()=>[m(`div`,nm,a(e.value),1),m(`div`,rm,a(e.label),1)]),_:2},1032,[`color`])]),_:2},1024))),128))]),_:1}),m(`div`,im,[r(k,{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=e=>d.value=e),density:`compact`,color:`primary`,variant:`outlined`},{default:n(()=>[r(O,{value:`all`,size:`small`},{default:n(()=>[u(`All (`+a(o.value.length)+`)`,1)]),_:1}),r(O,{value:`stuck`,size:`small`},{default:n(()=>[r(l,{start:``,size:`small`,color:`error`},{default:n(()=>t[8]||(t[8]=[u(`mdi-sync-alert`)])),_:1}),u(` Stuck (`+a(T.value.stuck)+`) `,1)]),_:1}),r(O,{value:`failed`,size:`small`},{default:n(()=>[u(`Ever failed (`+a(T.value.failed)+`)`,1)]),_:1}),r(O,{value:`frozen`,size:`small`},{default:n(()=>[r(l,{start:``,size:`small`,color:`warning`},{default:n(()=>t[9]||(t[9]=[u(`mdi-snowflake`)])),_:1}),u(` Frozen ELO (`+a(T.value.frozen)+`) `,1)]),_:1})]),_:1},8,[`modelValue`]),r(A,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=e=>_.value=e),density:`compact`,variant:`outlined`,"hide-details":``,clearable:``,placeholder:`filter by card / tag / type / content`,"prepend-inner-icon":`mdi-magnify`,style:{"max-width":`320px`}},null,8,[`modelValue`])]),o.value.length===0?(i(),S(j,{key:0,type:`info`,variant:`tonal`},{default:n(()=>t[10]||(t[10]=[u(`No card history for this learner.`)])),_:1})):(i(),S(R,{key:1,modelValue:b.value,"onUpdate:modelValue":t[2]||(t[2]=e=>b.value=e),multiple:``,variant:`accordion`},{default:n(()=>[(i(!0),h(g,null,f(D.value,o=>(i(),S(L,{key:o.cardId,value:o.cardId,"data-card":o.cardId,class:c(o.cardId===w.value?`sk-card-flash`:``)},{default:n(()=>[r(P,null,{default:n(()=>[m(`div`,am,[o.stuck?(i(),S(l,{key:0,color:`error`,size:`small`,title:`failed + overdue review`},{default:n(()=>t[11]||(t[11]=[u(`mdi-sync-alert`)])),_:1})):C(``,!0),o.frozenElo?(i(),S(l,{key:1,color:`warning`,size:`small`,title:`repeatedly failed, ELO barely updated`},{default:n(()=>t[12]||(t[12]=[u(` mdi-snowflake `)])),_:1})):C(``,!0),m(`span`,om,a(o.card?.questionType??`card`),1),m(`code`,sm,a(y(shortId)(o.cardId,24)),1),headline(o)?(i(),h(`span`,cm,a(headline(o)),1)):C(``,!0),r(M),o.fails>0?(i(),S(N,{key:3,size:`x-small`,color:`error`,variant:`tonal`},{default:n(()=>[u(a(o.fails)+` fail`+a(o.fails===1?``:`s`),1)]),_:2},1024)):C(``,!0),r(N,{size:`x-small`,variant:`tonal`},{default:n(()=>[u(a(o.attempts)+` view`+a(o.attempts===1?``:`s`),1)]),_:2},1024),r(N,{size:`x-small`,variant:`tonal`,color:`grey`},{default:n(()=>[u(a(y(fmtDuration)(o.totalTimeMs/1e3)),1)]),_:2},1024),o.pendingReview?(i(),S(N,{key:4,size:`x-small`,color:o.pendingReview.overdue?`error`:`success`,variant:`flat`},{default:n(()=>[u(` review `+a(o.pendingReview.overdue?`overdue`:`scheduled`),1)]),_:2},1032,[`color`])):C(``,!0),r(N,{size:`x-small`,variant:`tonal`,color:o.frozenElo?`warning`:void 0},{default:n(()=>[u(` ELO `+a(o.cardElo===null?`?`:Math.round(o.cardElo))+` `,1),o.cardEloCount===null?C(``,!0):(i(),h(`span`,lm,`/`+a(o.cardEloCount),1))]),_:2},1032,[`color`])])]),_:2},1024),r(I,null,{default:n(()=>[r(em,{dossier:o,interpreters:e.interpreters},null,8,[`dossier`,`interpreters`])]),_:2},1024)]),_:2},1032,[`value`,`data-card`,`class`]))),128))]),_:1},8,[`modelValue`]))])}}}),[[`__scopeId`,`data-v-bb6b302b`]]),dm={class:`sk-run-detail`},fm={key:0,class:`mb-2`},pm={class:`text-right`},mm={class:`text-right`},hm={class:`text-right`},gm={class:`text-right`},_m={key:1,class:`mb-2`},vm={class:`text-right`},ym={class:`text-right`},bm={class:`text-right`},xm={key:2,class:`mb-2 sk-mini-line text-medium-emphasis`},Sm={key:3,class:`mb-2`},Cm={key:4,class:`mb-2`},wm={class:`text-caption font-weight-medium`},Tm={key:0,class:`text-medium-emphasis font-weight-regular`},Em={key:1,title:`runner-up`},Dm=[`onClick`],Om={class:`text-right`},km={class:`text-caption font-weight-medium`},Am=[`onClick`],jm={class:`text-medium-emphasis`},Mm={class:`text-no-wrap`},Nm={class:`text-no-wrap`},Pm={class:`text-right text-no-wrap`},Fm={class:`text-caption`},Im={key:5,class:`mb-2`},Lm={class:`sk-hint-block`},Rm={key:6,class:`text-caption text-medium-emphasis`},zm={key:2},Bm=$p(d({__name:`RunDetail`,props:{run:{}},emits:[`open-card`],setup(e,{emit:t}){let o=e,l=t,d=v(()=>{let e=o.run.unselectedNew,t=[];return e?.nextInLine&&t.push({label:`next new card in line`,card:e.nextInLine}),e?.topGenerated&&t.push({label:`top-generated new card (sunk)`,card:e.topGenerated}),t}),p=v(()=>selectedBySource(o.run).map(e=>`${e.source} ${e.count}`).join(` · `));return(e,t)=>{let o=s(`v-table`),_=s(`v-icon`);return i(),h(`div`,dm,[e.run.generators?.length?(i(),h(`div`,fm,[t[1]||(t[1]=m(`div`,{class:`text-caption font-weight-medium`},`generators`,-1)),r(o,{density:`compact`,class:`sk-mini-table`},{default:n(()=>[t[0]||(t[0]=m(`thead`,null,[m(`tr`,null,[m(`th`),m(`th`,{class:`text-right`},`cards`),m(`th`,{class:`text-right`},`new`),m(`th`,{class:`text-right`},`review`),m(`th`,{class:`text-right`},`top`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(e.run.generators,e=>(i(),h(`tr`,{key:e.name},[m(`td`,null,a(e.name),1),m(`td`,pm,a(e.cardCount),1),m(`td`,mm,a(e.newCount),1),m(`td`,hm,a(e.reviewCount),1),m(`td`,gm,a(e.topScore.toFixed(2)),1)]))),128))])]),_:1})])):C(``,!0),e.run.filters?.length?(i(),h(`div`,_m,[t[3]||(t[3]=m(`div`,{class:`text-caption font-weight-medium`},`filters`,-1)),r(o,{density:`compact`,class:`sk-mini-table`},{default:n(()=>[t[2]||(t[2]=m(`thead`,null,[m(`tr`,null,[m(`th`),m(`th`,null,`kind`),m(`th`,{class:`text-right`},`boosted`),m(`th`,{class:`text-right`},`penalized`),m(`th`,{class:`text-right`},`passed`),m(`th`,{class:`text-right`},`removed`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(e.run.filters,e=>(i(),h(`tr`,{key:e.name},[m(`td`,null,a(e.name),1),m(`td`,null,a(e.kind??`—`),1),m(`td`,vm,a(e.boosted),1),m(`td`,ym,a(e.penalized),1),m(`td`,bm,a(e.passed),1),m(`td`,{class:c([`text-right`,e.removed>0?`text-error`:``])},a(e.removed),3)]))),128))])]),_:1})])):C(``,!0),e.run.versions?(i(),h(`div`,xm,` strategies `+a(e.run.versions.strategies??`—`)+` · content `+a(e.run.versions.content??`—`),1)):C(``,!0),e.run.regulators?.length?(i(),h(`div`,Sm,[t[4]||(t[4]=m(`div`,{class:`text-caption font-weight-medium`},`regulators`,-1)),(i(!0),h(g,null,f(e.run.regulators,e=>(i(),h(`div`,{key:e.name,class:`sk-mini-line`},[m(`span`,{class:c(e.multiplier>1?`text-warning`:`text-medium-emphasis`)},` ×`+a(e.multiplier.toFixed(2)),3),u(` `+a(y(regulatorText)(e)),1)]))),128))])):C(``,!0),e.run.cards?.length?(i(),h(`div`,Cm,[m(`div`,wm,[t[5]||(t[5]=u(` selection `)),p.value?(i(),h(`span`,Tm,` · by source: `+a(p.value),1)):C(``,!0)]),r(o,{density:`compact`,class:`sk-mini-table`},{default:n(()=>[t[7]||(t[7]=m(`thead`,null,[m(`tr`,null,[m(`th`),m(`th`,null,`card`),m(`th`,null,`origin`),m(`th`,null,`source`),m(`th`,{class:`text-right`},`score`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(e.run.cards,e=>(i(),h(`tr`,{key:e.cardId,class:c(e.selected?``:`text-medium-emphasis`)},[m(`td`,null,[e.selected?(i(),S(_,{key:0,size:`x-small`,color:`success`},{default:n(()=>t[6]||(t[6]=[u(`mdi-check`)])),_:1})):(i(),h(`span`,Em,`·`))]),m(`td`,null,[m(`a`,{class:`sk-card-link`,onClick:t=>l(`open-card`,e.cardId)},a(e.cardId),9,Dm)]),m(`td`,null,a(e.origin),1),m(`td`,null,a(y(runCardSource)(e)),1),m(`td`,Om,a(y(fmtScore)(e.score)),1)],2))),128))])]),_:1})])):C(``,!0),(i(!0),h(g,null,f(d.value,e=>(i(),h(`div`,{key:e.label,class:`mb-2`},[m(`div`,km,[u(a(e.label)+`: `,1),m(`a`,{class:`sk-card-link`,onClick:t=>l(`open-card`,e.card.cardId)},a(e.card.cardId),9,Am),m(`span`,jm,` (`+a(e.card.origin)+`, `+a(y(runCardSource)(e.card))+`) final `+a(y(fmtScore)(e.card.score)),1)]),r(o,{density:`compact`,class:`sk-mini-table`},{default:n(()=>[m(`tbody`,null,[(i(!0),h(g,null,f(e.card.trail,(e,t)=>(i(),h(`tr`,{key:t},[m(`td`,Mm,a(e.action),1),m(`td`,Nm,a(e.strategyName),1),m(`td`,Pm,a(y(fmtScore)(e.score)),1),m(`td`,Fm,a(e.reason),1)]))),128))])]),_:2},1024)]))),128)),e.run.hints?(i(),h(`div`,Im,[t[8]||(t[8]=m(`div`,{class:`text-caption font-weight-medium`},`hints`,-1)),m(`pre`,Lm,a(JSON.stringify(e.run.hints,null,2)),1)])):C(``,!0),e.run.discardedTail?(i(),h(`div`,Rm,[u(` discarded tail: `+a(e.run.discardedTail.count)+` cards `,1),e.run.discardedTail.scoreRange?(i(),h(g,{key:0},[u(` · score [`+a(e.run.discardedTail.scoreRange[0].toFixed(2))+`, `+a(e.run.discardedTail.scoreRange[1].toFixed(2))+`] `,1)],64)):C(``,!0),e.run.discardedTail.eloRange?(i(),h(g,{key:1},[u(` · ELO [`+a(Math.round(e.run.discardedTail.eloRange[0]))+`, `+a(Math.round(e.run.discardedTail.eloRange[1]))+`] `,1)],64)):C(``,!0),e.run.discardedTail.note?(i(),h(`div`,zm,a(e.run.discardedTail.note),1)):C(``,!0)])):C(``,!0)])}}}),[[`__scopeId`,`data-v-90c88783`]]),Vm={class:`d-flex align-center flex-wrap mb-4 ga-2`},Hm={class:`text-caption text-medium-emphasis`},Um={class:`text-right`},Wm={class:`text-right`},Gm={key:1,class:`text-caption text-disabled`},Km={class:`sk-hint-block`},qm={class:`sk-hint-block`},Jm={class:`text-caption text-medium-emphasis mb-4`},Ym={class:`text-right`},Xm={class:`text-right`},Zm={class:`text-disabled`},Qm={class:`text-right`},$m={class:`d-flex flex-wrap ga-5`},eh={class:`text-caption text-medium-emphasis`},th={class:`text-h6 text-success`},nh={class:`text-caption text-medium-emphasis`},rh={class:`text-h6 text-error`},ih={class:`text-h6`},ah={class:`text-caption text-disabled`},oh={class:`d-flex align-center flex-wrap mb-2 ga-3`},sh={key:4,class:`sk-timeline`},ch={class:`sk-tl-time text-caption text-disabled`},lh={class:`sk-tl-gutter`},uh={key:0,class:`sk-tl-body`},dh={class:`d-flex align-center flex-wrap ga-1`},fh={class:`font-weight-medium`},ph={class:`text-caption text-medium-emphasis ml-2`},mh={key:1,class:`text-caption text-error ml-2`},hh={key:1,class:`sk-tl-body`},gh=[`title`,`onClick`],_h={class:`text-caption`},vh={class:`text-caption text-medium-emphasis ml-2`},yh={key:0,class:`text-caption text-disabled ml-2`},bh=$p(d({__name:`LearnerSessionDetail`,props:{dataset:{},sessionId:{},interpreters:{}},emits:[`open-card`],setup(e,{emit:t}){let o=e,l=t,d=v(()=>sessionDetail(o.dataset,o.sessionId,o.interpreters)),p=v(()=>d.value.summary.doc),_=v(()=>servedTags(d.value?.timeline??[],o.interpreters)),b=v(()=>eloLedger(d.value?.timeline??[])),w=v(()=>d.value?.timeline.filter(e=>e.kind===`response`).length??0),T=x(`all`),E=v(()=>{let e=d.value?.timeline??[];return!T.value||T.value===`all`?e:e.filter(e=>e.kind===T.value)}),D=x(new Set);function toggle(e){let t=new Set(D.value);t.has(e)?t.delete(e):t.add(e),D.value=t}let{copied:O,copy:k}=useCopy();function asText(){return d.value?sessionText(o.dataset.username,d.value,{servedTags:_.value,eloLedger:b.value},o.interpreters):``}let A=v(()=>{let e=d.value?.summary;if(!e)return``;let t=fmtDuration(e.doc.plannedSeconds);return e.durationSeconds===null?`— of ${t}`:`${fmtDuration(e.durationSeconds)} of ${t}`});function skillTags(e){return e.filter(e=>isSkillTag(o.interpreters,e)).slice(0,3)}function fmtNum(e){return e===null?`—`:Number.isInteger(e)?String(e):e.toFixed(1)}function fmtHints(e){return e==null?`none`:JSON.stringify(e,null,2)}function entryIcon(e){return e.kind===`run`?`mdi-cog-refresh-outline`:e.isCorrect===!0?`mdi-check-circle-outline`:e.isCorrect===!1?`mdi-close-circle-outline`:`mdi-circle-small`}function entryColor(e){return e.kind===`run`?`primary`:e.isCorrect===!0?`success`:e.isCorrect===!1?`error`:`grey`}function rowClass(e){return e.kind===`run`?`sk-tl-run`:e.isCorrect===!1?`sk-tl-fail`:``}return(e,t)=>{let o=s(`v-alert`),v=s(`v-chip`),x=s(`v-icon`),j=s(`v-spacer`),N=s(`v-btn`),P=s(`v-table`),I=s(`v-card`),L=s(`v-col`),R=s(`v-row`),z=s(`v-btn-toggle`);return i(),h(`div`,null,[d.value?(i(),h(g,{key:1},[m(`div`,Vm,[r(v,{size:`small`,variant:`flat`,color:y(statusColor)(p.value.status)},{default:n(()=>[u(a(p.value.status),1)]),_:1},8,[`color`]),r(v,{size:`small`,variant:`tonal`},{default:n(()=>[u(a(y(fmtTime)(p.value.startTime)),1)]),_:1}),r(v,{size:`small`,variant:`tonal`,color:`grey`},{default:n(()=>[u(a(A.value),1)]),_:1}),(i(!0),h(g,null,f(d.value.summary.flags,e=>(i(),S(v,{key:e,size:`small`,variant:`tonal`,color:y(Hp)[e].color,title:y(M)[e].help},{default:n(()=>[r(x,{start:``,size:`small`},{default:n(()=>[u(a(y(Hp)[e].icon),1)]),_:2},1024),u(` `+a(y(M)[e].label),1)]),_:2},1032,[`color`,`title`]))),128)),r(j),m(`code`,Hm,a(e.sessionId),1),r(N,{variant:`text`,size:`small`,"prepend-icon":y(O)===`session`?`mdi-check`:`mdi-clipboard-text-outline`,color:y(O)===`session`?`success`:void 0,onClick:t[0]||(t[0]=e=>y(k)(asText(),`session`))},{default:n(()=>[u(a(y(O)===`session`?`Copied`:`Copy as text`),1)]),_:1},8,[`prepend-icon`,`color`])]),d.value.responsesMissing?(i(),S(o,{key:0,type:`warning`,variant:`tonal`,density:`compact`,class:`mb-4`},{default:n(()=>[u(` The session records `+a(p.value.tally?.responses)+` responses but only `+a(w.value)+` card records carry its id. The timeline is incomplete. `,1)]),_:1})):C(``,!0),r(R,{class:`mb-2`},{default:n(()=>[r(L,{cols:`12`,md:`6`},{default:n(()=>[r(I,{variant:`outlined`,class:`pa-3 h-100`},{default:n(()=>[t[4]||(t[4]=m(`div`,{class:`text-subtitle-2 mb-1`},`Learner state`,-1)),t[5]||(t[5]=m(`div`,{class:`text-caption text-medium-emphasis mb-3`},` What the navigator was choosing against, and what moved. `,-1)),d.value.summary.state.length?(i(),S(P,{key:0,density:`compact`,class:`sk-mini-table`},{default:n(()=>[t[3]||(t[3]=m(`thead`,null,[m(`tr`,null,[m(`th`),m(`th`,{class:`text-right`},`Start`),m(`th`,{class:`text-right`},`End`),m(`th`,{class:`text-right`},`Δ`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(d.value.summary.state,e=>(i(),h(`tr`,{key:e.label},[m(`td`,null,a(e.label),1),m(`td`,Um,a(fmtNum(e.from)),1),m(`td`,Wm,a(fmtNum(e.to)),1),m(`td`,{class:c([`text-right`,y(deltaClass)(e.delta)])},a(y(fmtDelta)(e.delta)),3)]))),128))])]),_:1})):(i(),h(`div`,Gm,`No state snapshot recorded.`))]),_:1})]),_:1}),r(L,{cols:`12`,md:`6`},{default:n(()=>[r(I,{variant:`outlined`,class:`pa-3 h-100`},{default:n(()=>[t[6]||(t[6]=m(`div`,{class:`text-subtitle-2 mb-1`},`Session hints`,-1)),t[7]||(t[7]=m(`div`,{class:`text-caption text-medium-emphasis mb-3`},` What outcome observers told the navigator. They act only through these. `,-1)),t[8]||(t[8]=m(`span`,{class:`text-caption font-weight-medium`},`at open`,-1)),m(`pre`,Km,a(fmtHints(p.value.config?.initHints)),1),t[9]||(t[9]=m(`span`,{class:`text-caption font-weight-medium`},`at close`,-1)),m(`pre`,qm,a(fmtHints(p.value.finalHints)),1)]),_:1})]),_:1})]),_:1}),m(`div`,Jm,[u(` batch limit `+a(p.value.config?.defaultBatchLimit??`?`)+` · `+a(p.value.config?.sourceCount??`?`)+` source(s) · opening queues supply `+a(p.value.initialQueues?.supplyQ??`?`)+` / failed `+a(p.value.initialQueues?.failedQ??`?`)+` `,1),p.value.tally?(i(),h(g,{key:0},[u(` · ended with `+a(p.value.tally.failedQRemaining)+` still in the failed queue`,1)],64)):C(``,!0),p.value.versions?(i(),h(g,{key:1},[u(` · framework `+a(p.value.versions.framework),1),p.value.versions.app?(i(),h(g,{key:0},[u(` · app `+a(p.value.versions.app),1)],64)):C(``,!0)],64)):C(``,!0)]),_.value.length?(i(),S(I,{key:1,variant:`outlined`,class:`pa-3 mb-4`},{default:n(()=>[t[11]||(t[11]=m(`div`,{class:`text-subtitle-2 mb-1`},`Served tags`,-1)),t[12]||(t[12]=m(`div`,{class:`text-caption text-medium-emphasis mb-2`},` What this sitting put in front of the learner, by content tag. A response with several tags counts toward each. `,-1)),r(P,{density:`compact`,class:`sk-mini-table`},{default:n(()=>[t[10]||(t[10]=m(`thead`,null,[m(`tr`,null,[m(`th`,null,`Tag`),m(`th`,{class:`text-right`},`Resp.`),m(`th`,{class:`text-right`},`Cards`),m(`th`,{class:`text-right`},`Accuracy`),m(`th`,{class:`text-right`},`Time`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(_.value,t=>(i(),h(`tr`,{key:t.tag},[m(`td`,null,[m(`code`,{class:c(y(isSkillTag)(e.interpreters,t.tag)?`text-primary`:``)},a(t.tag),3)]),m(`td`,Ym,a(t.responses),1),m(`td`,Xm,a(t.cards),1),m(`td`,{class:c([`text-right`,y(accuracyClass)(t.accuracy)])},[t.accuracy===null?(i(),h(g,{key:0},[u(`—`)],64)):(i(),h(g,{key:1},[u(a(Math.round(t.accuracy*100))+`% `,1),m(`span`,Zm,`(`+a(t.correct)+`/`+a(t.correct+t.incorrect)+`)`,1)],64))],2),m(`td`,Qm,a((t.totalTimeMs/1e3).toFixed(1))+`s`,1)]))),128))])]),_:1})]),_:1})):C(``,!0),b.value?(i(),S(I,{key:2,variant:`outlined`,class:`pa-3 mb-4`},{default:n(()=>[t[15]||(t[15]=m(`div`,{class:`text-subtitle-2 mb-1`},`ELO ledger`,-1)),t[16]||(t[16]=m(`div`,{class:`text-caption text-medium-emphasis mb-3`},` The per-response learner global-ELO exchanges that net to the session's ELO move. Wins above the learner's level pay little; losses below it cost a lot, so a high hit rate can still net negative. `,-1)),m(`div`,$m,[m(`div`,null,[t[13]||(t[13]=m(`div`,{class:`text-caption text-medium-emphasis`},`net`,-1)),m(`div`,{class:c([`text-h6`,y(deltaClass)(b.value.net)])},a(y(fmtDelta)(b.value.net)),3)]),m(`div`,null,[m(`div`,eh,`gained · `+a(b.value.wins)+` win(s)`,1),m(`div`,th,a(y(fmtDelta)(b.value.gained)),1)]),m(`div`,null,[m(`div`,nh,`lost · `+a(b.value.losses)+` loss(es)`,1),m(`div`,rh,a(y(fmtDelta)(b.value.lost)),1)]),m(`div`,null,[t[14]||(t[14]=m(`div`,{class:`text-caption text-medium-emphasis`},`exchanges`,-1)),m(`div`,ih,a(b.value.count),1),m(`div`,ah,`of `+a(w.value)+` response(s)`,1)])])]),_:1})):C(``,!0),m(`div`,oh,[t[17]||(t[17]=m(`h2`,{class:`text-h6`},`Timeline`,-1)),r(z,{modelValue:T.value,"onUpdate:modelValue":t[1]||(t[1]=e=>T.value=e),density:`compact`,color:`primary`,variant:`outlined`},{default:n(()=>[r(N,{value:`all`,size:`small`},{default:n(()=>[u(`All (`+a(d.value.timeline.length)+`)`,1)]),_:1}),r(N,{value:`response`,size:`small`},{default:n(()=>[u(`Responses (`+a(w.value)+`)`,1)]),_:1}),r(N,{value:`run`,size:`small`},{default:n(()=>[u(`Runs (`+a(d.value.timeline.length-w.value)+`)`,1)]),_:1})]),_:1},8,[`modelValue`])]),d.value.timeline.length===0?(i(),S(o,{key:3,type:`info`,variant:`tonal`},{default:n(()=>t[18]||(t[18]=[u(`Nothing recorded for this session.`)])),_:1})):(i(),h(`div`,sh,[(i(!0),h(g,null,f(E.value,(o,s)=>(i(),h(`div`,{key:s,class:c([`sk-tl-row`,rowClass(o)])},[m(`div`,ch,a(y(fmtClock)(o.at)),1),m(`div`,lh,[r(x,{size:`small`,color:entryColor(o)},{default:n(()=>[u(a(entryIcon(o)),1)]),_:2},1032,[`color`])]),o.kind===`run`?(i(),h(`div`,uh,[m(`div`,dh,[m(`span`,fh,a(o.run.label),1),o.run.mode?(i(),S(v,{key:0,size:`x-small`,variant:`tonal`},{default:n(()=>[u(a(o.run.mode),1)]),_:2},1024)):C(``,!0),m(`span`,ph,` generated `+a(o.run.generatedCount)+` → selected `+a(o.run.finalCount)+` (`+a(o.run.newSelected)+` new, `+a(o.run.reviewsSelected)+` review) `,1),o.run.generatedCount>0&&o.run.finalCount===0?(i(),h(`span`,mh,` nothing survived `)):C(``,!0),typeof o.run.userElo==`number`?(i(),S(v,{key:2,size:`x-small`,variant:`tonal`,color:`grey`,class:`ml-2`},{default:n(()=>[u(` ELO `+a(Math.round(o.run.userElo)),1)]),_:2},1024)):C(``,!0),r(j),r(N,{icon:D.value.has(o.run.runId)?`mdi-chevron-up`:`mdi-chevron-down`,size:`x-small`,variant:`text`,onClick:e=>toggle(o.run.runId)},null,8,[`icon`,`onClick`]),r(N,{icon:y(O)===o.run.runId?`mdi-check`:`mdi-content-copy`,size:`x-small`,variant:`text`,color:y(O)===o.run.runId?`success`:void 0,title:`Copy run as text`,onClick:e=>y(k)(y(runText)(o.run),o.run.runId)},null,8,[`icon`,`color`,`onClick`])]),D.value.has(o.run.runId)?(i(),S(Bm,{key:0,run:o.run,class:`mt-1`,onOpenCard:t[2]||(t[2]=e=>l(`open-card`,e))},null,8,[`run`])):C(``,!0)])):(i(),h(`div`,hh,[m(`a`,{class:`sk-card-link`,title:`Open ${o.cardId} in card history`,onClick:e=>l(`open-card`,o.cardId)},[u(a(o.questionType??`card`)+` `,1),m(`code`,_h,a(y(shortId)(o.cardId)),1)],8,gh),(i(!0),h(g,null,f(skillTags(o.tags),t=>(i(),S(v,{key:t,size:`x-small`,variant:`outlined`,color:`primary`,class:`ml-1`},{default:n(()=>[u(a(y(shortTag)(e.interpreters,t)),1)]),_:2},1024))),128)),m(`span`,vh,[u(a((o.timeSpentMs/1e3).toFixed(1))+`s `,1),o.priorAttempts?(i(),h(g,{key:0},[u(` · attempt `+a(o.priorAttempts+1),1)],64)):C(``,!0)]),o.userAnswer==null?C(``,!0):(i(),h(`span`,yh,`“`+a(y(fmtAnswer)(o.userAnswer))+`”`,1)),o.elo?(i(),h(g,{key:1},[r(v,{size:`x-small`,variant:`tonal`,color:y(deltaColor)(o.elo.global.delta),class:`ml-2`,title:`learner global ELO ${o.elo.global.before} → ${o.elo.global.after} · userScore ${o.elo.userScore.toFixed(2)}`},{default:n(()=>[u(` ELO `+a(y(fmtDelta)(o.elo.global.delta)),1)]),_:2},1032,[`color`,`title`]),(i(!0),h(g,null,f(y(scoredTagDeltas)(o.elo),t=>(i(),S(v,{key:t.tag,size:`x-small`,variant:`text`,color:y(deltaColor)(t.delta),class:`sk-elo-tag`,title:`${t.tag}: ${t.before} → ${t.after} (score ${t.score?.toFixed(2)})`},{default:n(()=>[u(a(y(shortTag)(e.interpreters,t.tag))+` `+a(y(fmtDelta)(t.delta)),1)]),_:2},1032,[`color`,`title`]))),128))],64)):C(``,!0)]))],2))),128))]))],64)):(i(),S(o,{key:0,type:`info`,variant:`tonal`},{default:n(()=>[u(`No session with id `+a(e.sessionId)+`.`,1)]),_:1}))])}}}),[[`__scopeId`,`data-v-3cc6eb88`]]),xh={class:`text-h6`},Sh={class:`text-caption`},Ch={class:`d-flex align-center flex-wrap mb-3 ga-3`},wh=[`onClick`],Th={class:`text-no-wrap`},Eh={class:`text-right`},Dh={class:`text-right`},Oh={key:1,class:`text-disabled`},kh={class:`text-right`},Ah={class:`text-no-wrap text-caption`},jh={class:`text-no-wrap text-caption`},Mh={key:0},Nh={key:0,class:`text-disabled`},Ph={class:`text-right`},Fh=$p(d({__name:`LearnerSessionList`,props:{dataset:{},interpreters:{}},emits:[`open`],setup(e,{emit:t}){let o=e,l=t,d=v(()=>summarizeSessions(o.dataset,o.interpreters)),p=x(`all`),_=v(()=>{let e=new Map;for(let t of d.value)for(let n of t.flags)e.set(n,(e.get(n)??0)+1);return[...e.entries()].map(([e,t])=>({flag:e,count:t})).sort((e,t)=>t.count-e.count)}),b=v(()=>!p.value||p.value===`all`?d.value:d.value.filter(e=>e.flags.includes(p.value))),w=v(()=>{let e=d.value,t=e.filter(e=>e.doc.status===`closed`).length,n=e.reduce((e,t)=>e+(t.doc.tally?.responses??0),0),r=e.reduce((e,t)=>e+(t.doc.tally?.correct??0),0),i=e.reduce((e,t)=>e+(t.durationSeconds??0),0);return[{label:`sessions`,value:e.length,color:`primary`},{label:`completed`,value:t,color:`success`},{label:`not completed`,value:e.length-t,color:`error`},{label:`responses`,value:n,color:`primary`},{label:`overall acc.`,value:n>0?`${Math.round(r/n*100)}%`:`—`,color:`primary`},{label:`time studied`,value:fmtDuration(i),color:`grey`}]});function deltas(e){let t=[];e.eloNet!==null&&t.push({label:`elo`,delta:Math.round(e.eloNet)});for(let n of o.interpreters?.progressMetrics??[]){let r=e.state.find(e=>e.label===n);r&&t.push({label:n,delta:r.delta})}return t}function clockText(e){let t=fmtDuration(e.doc.plannedSeconds);return e.durationSeconds===null?`— of ${t}`:`${fmtDuration(e.durationSeconds)} of ${t}`}return(e,t)=>{let o=s(`v-card`),v=s(`v-col`),x=s(`v-row`),T=s(`v-btn`),E=s(`v-icon`),D=s(`v-btn-toggle`),O=s(`v-alert`),k=s(`v-chip`),A=s(`v-table`);return i(),h(`div`,null,[t[4]||(t[4]=m(`p`,{class:`text-caption text-medium-emphasis mb-4`},[u(` One row per sitting. Flags name a specific way the session failed to do its job; open one to read its interleaved timeline of responses and pipeline runs. `),m(`strong`,null,`Δ`),u(` is movement across the session: ELO, then any progress metrics the course declares. `)],-1)),r(x,{dense:``,class:`mb-2`},{default:n(()=>[(i(!0),h(g,null,f(w.value,e=>(i(),S(v,{key:e.label,cols:`6`,sm:`4`,md:`2`},{default:n(()=>[r(o,{variant:`tonal`,color:e.color,class:`pa-2 text-center`},{default:n(()=>[m(`div`,xh,a(e.value),1),m(`div`,Sh,a(e.label),1)]),_:2},1032,[`color`])]),_:2},1024))),128))]),_:1}),m(`div`,Ch,[r(D,{modelValue:p.value,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e),density:`compact`,color:`primary`,variant:`outlined`},{default:n(()=>[r(T,{value:`all`,size:`small`},{default:n(()=>[u(`All (`+a(d.value.length)+`)`,1)]),_:1}),(i(!0),h(g,null,f(_.value,e=>(i(),S(T,{key:e.flag,value:e.flag,size:`small`,title:y(M)[e.flag].help},{default:n(()=>[r(E,{start:``,size:`small`,color:y(Hp)[e.flag].color},{default:n(()=>[u(a(y(Hp)[e.flag].icon),1)]),_:2},1032,[`color`]),u(` `+a(y(M)[e.flag].label)+` (`+a(e.count)+`) `,1)]),_:2},1032,[`value`,`title`]))),128))]),_:1},8,[`modelValue`])]),d.value.length===0?(i(),S(O,{key:0,type:`info`,variant:`tonal`},{default:n(()=>t[1]||(t[1]=[u(` No study sessions recorded. Session records began with a framework release; there is no backfill, so earlier activity shows only in card history. `)])),_:1})):(i(),S(A,{key:1,density:`compact`,class:`sk-admin-table`},{default:n(()=>[t[3]||(t[3]=m(`thead`,null,[m(`tr`,null,[m(`th`,null,`Started`),m(`th`,null,`Status`),m(`th`,{class:`text-right`},`Cards`),m(`th`,{class:`text-right`},`Acc.`),m(`th`,{class:`text-right`},`Runs`),m(`th`,null,`Clock`),m(`th`,null,`Δ`),m(`th`,null,`Flags`),m(`th`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(b.value,e=>(i(),h(`tr`,{key:e.doc.sessionId,class:`sk-admin-row`,onClick:t=>l(`open`,e.doc.sessionId)},[m(`td`,Th,a(y(fmtTime)(e.doc.startTime)),1),m(`td`,null,[r(k,{size:`x-small`,variant:`flat`,color:y(statusColor)(e.doc.status)},{default:n(()=>[u(a(e.doc.status),1)]),_:2},1032,[`color`])]),m(`td`,Eh,a(e.doc.tally?.cardsPresented??`—`),1),m(`td`,Dh,[e.accuracy===null?(i(),h(`span`,Oh,`—`)):(i(),h(`span`,{key:0,class:c(y(accuracyClass)(e.accuracy))},a(Math.round(e.accuracy*100))+`% `,3))]),m(`td`,kh,a(e.doc.runs?.length??0),1),m(`td`,Ah,a(clockText(e)),1),m(`td`,jh,[(i(!0),h(g,null,f(deltas(e),(e,t)=>(i(),h(g,{key:e.label},[t>0?(i(),h(`span`,Mh,` · `)):C(``,!0),m(`span`,{class:c(y(deltaClass)(e.delta))},a(y(fmtDelta)(e.delta))+`\xA0`+a(e.label),3)],64))),128)),deltas(e).length===0?(i(),h(`span`,Nh,`—`)):C(``,!0)]),m(`td`,null,[(i(!0),h(g,null,f(e.flags,e=>(i(),S(E,{key:e,size:`small`,class:`mr-1`,color:y(Hp)[e].color,title:`${y(M)[e].label}: ${y(M)[e].help}`},{default:n(()=>[u(a(y(Hp)[e].icon),1)]),_:2},1032,[`color`,`title`]))),128))]),m(`td`,Ph,[r(E,{size:`small`,class:`text-disabled`},{default:n(()=>t[2]||(t[2]=[u(`mdi-chevron-right`)])),_:1})])],8,wh))),128))])]),_:1}))])}}}),[[`__scopeId`,`data-v-5c46cc58`]]),Ih=d({__name:`EChart`,props:{option:{},height:{}},emits:[`click`],setup(e,{emit:t}){use([install$13,install$11,install$1,install$9,install$4,install$7,install$8,install]);let n=e,r=t,a=x(null),s=_(null),c=null;return w(()=>{a.value&&(s.value=init(a.value),s.value.setOption(n.option,{notMerge:!0}),s.value.on(`click`,e=>r(`click`,e)),c=new ResizeObserver(()=>s.value?.resize()),c.observe(a.value))}),p(()=>n.option,e=>s.value?.setOption(e,{notMerge:!0})),o(()=>{c?.disconnect(),s.value?.dispose()}),(e,t)=>(i(),h(`div`,{ref_key:`el`,ref:a,style:T({height:`${e.height}px`,width:`100%`})},null,4))}}),Lh={class:`text-h6`},Rh={class:`text-caption`},zh={class:`d-flex align-center flex-wrap mb-1 ga-3`},Bh={class:`d-flex align-center flex-wrap mb-4 ga-3`},Vh={class:`text-caption text-medium-emphasis`},Hh={key:1,class:`text-caption text-disabled pa-4`},Uh={class:`sk-tag-elo-sticky`},Wh={class:`text-caption text-medium-emphasis mb-1`},Gh=[`onClick`],Kh={class:`text-caption`},qh={class:`text-caption text-medium-emphasis`},Jh={class:`text-right`},Yh=[`title`],Xh={class:`text-right`},Zh={key:0,class:`sk-ticks`},Qh=[`title`],$h={class:`text-caption ml-1`},eg={key:1,class:`text-caption text-disabled`},tg={class:`text-caption`},ng={class:`text-caption`},rg={class:`text-right`},ig=8,ag=20,og=$p(d({__name:`LearnerTagElo`,props:{dataset:{},interpreters:{}},setup(e){let t=e,o=v(()=>tagEloView(t.dataset)),l=v(()=>{let e=o.value?.rows??[];return[...(o.value?.groups??[]).map(e=>({key:`group:${e.id}`,batch:e,course:!1})),...(t.interpreters?.tagBatches??[]).map(e=>({key:`course:${e.id}`,batch:e,course:!0}))].map(t=>({...t,matches:e.filter(e=>matchesTagBatch(e.tag,t.batch,e.role)).length}))}),isBookkeeping=e=>e.roles?.some(e=>e===`intro`||e===`expose`)??!1,d=x([]),_=x(`score`),b=x(0),w=x(``),byScore=(e,t)=>e.score===null||t.score===null?Number(e.score===null)-Number(t.score===null):t.score-e.score,byLastSeen=(e,t)=>(t.lastSeen??``).localeCompare(e.lastSeen??``),E={score:byScore,count:(e,t)=>t.count-e.count,lastSeen:byLastSeen,tag:(e,t)=>e.tag.localeCompare(t.tag)},D=v(()=>{let e=l.value.filter(e=>d.value.includes(e.key)).map(e=>e.batch),t=w.value?.trim().toLowerCase(),n=Number(b.value)||0;return(o.value?.rows??[]).filter(r=>e.some(e=>matchesTagBatch(r.tag,e,r.role))&&r.count>=n&&(!t||r.tag.toLowerCase().includes(t))).sort((e,t)=>E[_.value](e,t)||e.tag.localeCompare(t.tag))}),O=v(()=>D.value.filter(e=>e.score!==null)),k=x(new Map);function toggle(e){let t=new Map(k.value);if(t.has(e))t.delete(e);else{if(t.size>=ig)return;let n=new Set(t.values()),r=0;for(;n.has(r);)r++;t.set(e,r)}k.value=t}p(()=>t.dataset,()=>{k.value=new Map,d.value=l.value.filter(e=>!e.course&&!isBookkeeping(e.batch)).map(e=>e.key)},{immediate:!0});let j=v(()=>{let e=new Map,n=new Map;for(let r of D.value){let i=shortTag(t.interpreters,r.tag);e.set(r.tag,i),n.set(i,(n.get(i)??0)+1)}return new Map([...e].map(([e,t])=>[e,(n.get(t)??0)>1?e:t]))}),labelOf=e=>j.value.get(e)??shortTag(t.interpreters,e),M=A(),N=v(()=>M.current.value.dark),P={light:[`#2a78d6`,`#eb6834`,`#1baf7a`,`#eda100`,`#e87ba4`,`#008300`,`#6250d6`,`#e34948`],dark:[`#3987e5`,`#d95926`,`#199e70`,`#c98500`,`#d55181`,`#008300`,`#9085e9`,`#e66767`]},I={light:{primary:`#0b0b0b`,secondary:`#52514e`,muted:`#898781`,grid:`#e1e0d9`,axis:`#c3c2b7`},dark:{primary:`#f0efec`,secondary:`#c3c2b7`,muted:`#898781`,grid:`#2c2c2a`,axis:`#383835`}},L=v(()=>I[N.value?`dark`:`light`]),slotColor=e=>P[N.value?`dark`:`light`][e],R=v(()=>N.value?`rgba(195,194,183,0.18)`:`rgba(82,81,78,0.16)`),z=v(()=>M.current.value.colors.surface),B=v(()=>Math.max(160,O.value.length*ag+72)),dotSize=e=>Math.min(20,8+2.2*Math.log1p(e));function escapeHtml(e){return e.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`)}function rowTooltip(e){let t=e.recent.length?`recent ${e.recentOk}/${e.recent.length} correct`:`no recent buffer`;return[`<b>${escapeHtml(e.tag)}</b>`,`ELO ${e.score} (${signed(e.vsGlobal)} vs global) · ${e.count} responses`,`${t} · last seen ${fmtDate(e.lastSeen)}`].join(`<br/>`)}let ee=v(()=>{let e=O.value,t=L.value,n=o.value?.global.score??0,r=[n,...e.map(e=>e.score)];return{animation:!1,grid:{left:8,right:16,top:24,bottom:8,containLabel:!0},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`,axis:`y`},formatter:t=>{let n=t[0]?.dataIndex;return n===void 0?``:rowTooltip(e[n])}},xAxis:{type:`value`,position:`top`,min:Math.floor((Math.min(...r)-20)/50)*50,max:Math.ceil((Math.max(...r)+20)/50)*50,axisLabel:{color:t.muted},axisLine:{show:!1},splitLine:{lineStyle:{color:t.grid}}},yAxis:{type:`category`,inverse:!0,triggerEvent:!0,data:e.map(e=>labelOf(e.tag)),axisLabel:{color:t.secondary,fontSize:11,interval:0},axisTick:{show:!1},axisLine:{lineStyle:{color:t.axis}}},series:[{type:`scatter`,data:e.map((e,n)=>{let r=k.value.get(e.tag);return{name:e.tag,value:[e.score,n],symbolSize:dotSize(e.count),itemStyle:{color:r===void 0?t.muted:slotColor(r),borderColor:z.value,borderWidth:2}}}),markLine:{silent:!0,symbol:`none`,lineStyle:{color:t.primary,type:`solid`,width:1},label:{formatter:`global ${n}`,color:t.secondary,position:`end`},data:[{xAxis:n}]}}]}});function onDotClick(e){if(e.componentType===`series`&&typeof e.name==`string`)toggle(e.name);else if(e.componentType===`yAxis`){let t=e.value,n=O.value.find(e=>labelOf(e.tag)===t);n&&toggle(n.tag)}}let toData=e=>e.map(e=>[e.at,e.score]);function valueAt(e,t){let n=null;for(let r of e){if(Date.parse(r.at)>t)break;n=r.score}return n}let te=v(()=>{let e=o.value,t=L.value;if(!e)return{};let n=[...k.value].filter(([t])=>e.series.tags[t]),r=O.value.filter(t=>!k.value.has(t.tag)&&e.series.tags[t.tag]),i=n.length<=4,a=[{name:`global`,color:t.primary,points:e.series.global},...n.map(([t,n])=>({name:labelOf(t),color:slotColor(n),points:e.series.tags[t]}))];return{animation:!1,grid:{left:8,right:i?96:16,top:36,bottom:48,containLabel:!0},legend:{top:0,data:a.map(e=>e.name),textStyle:{color:t.secondary},selectedMode:!1},tooltip:{trigger:`axis`,formatter:e=>{let t=Number(e[0]?.axisValue);if(!Number.isFinite(t))return``;let n=a.map(e=>({s:e,value:valueAt(e.points,t)})).filter(e=>e.value!==null).map(({s:e,value:t})=>`<span style="display:inline-block;width:8px;height:8px;border-radius:4px;margin-right:6px;background:${e.color}"></span>${escapeHtml(e.name)} ${t}`);return[fmtTime(new Date(t).toISOString()),...n].join(`<br/>`)}},xAxis:{type:`time`,axisLabel:{color:t.muted},axisLine:{lineStyle:{color:t.axis}},splitLine:{show:!1}},yAxis:{type:`value`,scale:!0,axisLabel:{color:t.muted},splitLine:{lineStyle:{color:t.grid}}},dataZoom:[{type:`inside`},{type:`slider`,height:16,bottom:8}],series:[...r.map(n=>({type:`line`,name:n.tag,data:toData(e.series.tags[n.tag]),step:`end`,showSymbol:!1,triggerLineEvent:!0,lineStyle:{width:1,color:R.value},itemStyle:{color:R.value},emphasis:{lineStyle:{width:2,color:t.muted}},z:1})),...a.map((e,n)=>({type:`line`,name:e.name,data:toData(e.points),step:`end`,showSymbol:!1,triggerLineEvent:!0,lineStyle:{width:2,color:e.color},itemStyle:{color:e.color},endLabel:{show:n===0||i,formatter:e.name,color:t.secondary},z:n===0?3:4}))]}});function onLineClick(e){if(e.componentType!==`series`||typeof e.seriesName!=`string`)return;let t=o.value?.series.tags[e.seriesName]===void 0?[...k.value.keys()].find(t=>labelOf(t)===e.seriesName):e.seriesName;t&&toggle(t)}function signed(e){return e===null?`—`:e>0?`+${e}`:String(e)}function fmtDate(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString()}function staleTitle(e){return e.staleScore===void 0?`counted, not rated`:`counted, not rated: the bracketed score predates count-only roles and is ignored`}let ne=v(()=>{let e=o.value,t=(e?.rows??[]).filter(e=>e.score!==null),n=O.value.map(e=>e.vsGlobal).sort((e,t)=>e-t),r=n.length?n[Math.floor(n.length/2)]:null;return[{label:`global ELO (${e?.global.count??0} responses)`,value:e?.global.score??`—`},{label:`rated tags in view`,value:`${O.value.length} / ${t.length}`},{label:`median vs global, in view`,value:signed(r)},{label:`trajectories from`,value:fmtDate(e?.seriesFrom??null)}]});return(e,t)=>{let p=s(`v-alert`),v=s(`v-card`),x=s(`v-col`),E=s(`v-row`),A=s(`v-chip`),j=s(`v-chip-group`),M=s(`v-btn`),N=s(`v-btn-toggle`),P=s(`v-text-field`),I=s(`v-spacer`),L=s(`v-table`);return i(),h(`div`,null,[o.value?(i(),h(g,{key:1},[t[17]||(t[17]=m(`p`,{class:`text-caption text-medium-emphasis mb-4`},[u(` The learner's ELO on each tag (from their course registration) beside their global ELO. A tag's rating starts at the learner's global ELO when first graded and moves only on responses that grade it: read it with its response count. Bookkeeping tags (`),m(`code`,null,`intro`),u(`, `),m(`code`,null,`expose`),u(`) are counted, never rated, and are hidden by default. `)],-1)),r(E,{dense:``,class:`mb-2`},{default:n(()=>[(i(!0),h(g,null,f(ne.value,e=>(i(),S(x,{key:e.label,cols:`6`,sm:`3`},{default:n(()=>[r(v,{variant:`tonal`,color:`primary`,class:`pa-2 text-center`},{default:n(()=>[m(`div`,Lh,a(e.value),1),m(`div`,Rh,a(e.label),1)]),_:2},1024)]),_:2},1024))),128))]),_:1}),m(`div`,zh,[r(j,{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=e=>d.value=e),multiple:``,column:``,"selected-class":`text-primary`},{default:n(()=>[(i(!0),h(g,null,f(l.value,e=>(i(),S(A,{key:e.key,value:e.key,size:`small`,filter:``,variant:e.course?`outlined`:`tonal`,title:e.course?`course batch`:`namespace × role`},{default:n(()=>[u(a(e.batch.label)+` (`+a(e.matches)+`) `,1)]),_:2},1032,[`value`,`variant`,`title`]))),128))]),_:1},8,[`modelValue`])]),m(`div`,Bh,[r(N,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=e=>_.value=e),mandatory:``,density:`compact`,color:`primary`,variant:`outlined`},{default:n(()=>[r(M,{value:`score`,size:`small`},{default:n(()=>t[6]||(t[6]=[u(`ELO`)])),_:1}),r(M,{value:`count`,size:`small`},{default:n(()=>t[7]||(t[7]=[u(`Responses`)])),_:1}),r(M,{value:`lastSeen`,size:`small`},{default:n(()=>t[8]||(t[8]=[u(`Last seen`)])),_:1}),r(M,{value:`tag`,size:`small`},{default:n(()=>t[9]||(t[9]=[u(`Name`)])),_:1})]),_:1},8,[`modelValue`]),r(P,{modelValue:b.value,"onUpdate:modelValue":t[2]||(t[2]=e=>b.value=e),modelModifiers:{number:!0},type:`number`,min:`0`,density:`compact`,variant:`outlined`,"hide-details":``,label:`min responses`,style:{"max-width":`140px`}},null,8,[`modelValue`]),r(P,{modelValue:w.value,"onUpdate:modelValue":t[3]||(t[3]=e=>w.value=e),density:`compact`,variant:`outlined`,"hide-details":``,clearable:``,placeholder:`filter by tag`,"prepend-inner-icon":`mdi-magnify`,style:{"max-width":`280px`}},null,8,[`modelValue`]),r(I),m(`span`,Vh,[u(a(k.value.size)+`/`+a(ig)+` plotted `,1),k.value.size?(i(),S(M,{key:0,variant:`text`,size:`x-small`,onClick:t[4]||(t[4]=e=>k.value=new Map)},{default:n(()=>t[10]||(t[10]=[u(`clear`)])),_:1})):C(``,!0)])]),D.value.length===0?(i(),S(p,{key:0,type:`info`,variant:`tonal`},{default:n(()=>t[11]||(t[11]=[u(`No tags match these filters.`)])),_:1})):(i(),S(E,{key:1},{default:n(()=>[r(x,{cols:`12`,md:`5`},{default:n(()=>[t[12]||(t[12]=m(`div`,{class:`text-subtitle-2`},`ELO by tag`,-1)),t[13]||(t[13]=m(`div`,{class:`text-caption text-medium-emphasis mb-1`},` Dot size: responses (log scale). Click a dot or a name to plot its trajectory. `,-1)),O.value.length?(i(),S(Ih,{key:0,option:ee.value,height:B.value,onClick:onDotClick},null,8,[`option`,`height`])):(i(),h(`div`,Hh,`No rated tags in this selection.`))]),_:1}),r(x,{cols:`12`,md:`7`},{default:n(()=>[m(`div`,Uh,[t[14]||(t[14]=m(`div`,{class:`text-subtitle-2`},`Trajectories`,-1)),m(`div`,Wh,[o.value.seriesFrom?(i(),h(g,{key:0},[u(` From `+a(y(fmtTime)(o.value.seriesFrom))+`, when sessions began recording ELO events. Faint lines are the other tags in view; click one to plot it. A jump between recorded events is a session that didn't save its events. `,1)],64)):(i(),h(g,{key:1},[u(`No session in this dataset recorded ELO events.`)],64))]),o.value.seriesFrom?(i(),S(Ih,{key:0,option:te.value,height:380,onClick:onLineClick},null,8,[`option`])):C(``,!0)])]),_:1})]),_:1})),D.value.length?(i(),S(L,{key:2,density:`compact`,class:`mt-4 sk-tag-elo-table`},{default:n(()=>[t[16]||(t[16]=m(`thead`,null,[m(`tr`,null,[m(`th`,null,`Tag`),m(`th`,null,`Batch`),m(`th`,{class:`text-right`},`ELO`),m(`th`,{class:`text-right`},`vs global`),m(`th`,{class:`text-right`},`Responses`),m(`th`,null,`Recent first attempts`),m(`th`,null,`First seen`),m(`th`,null,`Last seen`),m(`th`,{class:`text-right`},`ELO events`)])],-1)),m(`tbody`,null,[(i(!0),h(g,null,f(D.value,e=>(i(),h(`tr`,{key:e.tag,class:c({"sk-pickable":e.score!==null}),onClick:t=>e.score!==null&&toggle(e.tag)},[m(`td`,null,[m(`span`,{class:`sk-swatch`,style:T({background:k.value.has(e.tag)?slotColor(k.value.get(e.tag)):`transparent`})},null,4),m(`code`,Kh,a(e.tag),1)]),m(`td`,qh,a(e.group),1),m(`td`,Jh,[e.score===null?(i(),h(`span`,{key:1,class:`text-disabled`,title:staleTitle(e)},[t[15]||(t[15]=u(` —`)),e.staleScore===void 0?C(``,!0):(i(),h(g,{key:0},[u(` (`+a(e.staleScore)+`)`,1)],64))],8,Yh)):(i(),h(g,{key:0},[u(a(e.score),1)],64))]),m(`td`,{class:c([`text-right`,y(deltaClass)(e.vsGlobal)])},a(signed(e.vsGlobal)),3),m(`td`,Xh,a(e.count),1),m(`td`,null,[e.recent.length?(i(),h(`span`,Zh,[(i(!0),h(g,null,f(e.recent,(e,t)=>(i(),h(`span`,{key:t,class:c([`sk-tick`,e.ok?`bg-success`:`bg-error`]),title:`${y(fmtTime)(e.at)} · ${e.ok?`correct`:`missed`} · ${e.card}`},null,10,Qh))),128)),m(`span`,$h,a(e.recentOk)+`/`+a(e.recent.length),1)])):(i(),h(`span`,eg,`—`))]),m(`td`,tg,a(fmtDate(e.firstSeen)),1),m(`td`,ng,a(fmtDate(e.lastSeen)),1),m(`td`,rg,a(e.events||``),1)],10,Gh))),128))])]),_:1})):C(``,!0)],64)):(i(),S(p,{key:0,type:`info`,variant:`tonal`},{default:n(()=>t[5]||(t[5]=[u(` This learner's registration carries no ELO for this course. `)])),_:1}))])}}}),[[`__scopeId`,`data-v-ec9e083c`]]),sg={class:`sk-pipeline`},cg={class:`d-flex flex-wrap align-center ga-2 mb-3`},lg={class:`text-caption`},ug={key:0,class:`text-caption text-medium-emphasis`},dg={class:`sk-stage`},fg={class:`d-flex align-center mb-1`},pg={class:`sk-stage-num`},mg={class:`font-weight-medium`},hg={class:`text-caption text-medium-emphasis mb-2`},gg={class:`d-flex flex-wrap align-center ga-2`},_g={class:`font-weight-medium`},vg={class:`text-caption`},yg={key:0,class:`text-caption mt-1`},bg={key:1,class:`text-caption mt-1`},xg={key:1,class:`text-medium-emphasis`},Sg={key:2,class:`mt-1`},Cg=[`onClick`],wg={key:0,class:`sk-config`},Tg={key:0,class:`text-caption text-medium-emphasis`},Eg={class:`d-flex flex-wrap align-center ga-2`},Dg={class:`font-weight-medium`},Og={class:`text-caption`},kg={key:0,class:`text-caption mt-1`},Ag={key:1,class:`text-caption mt-1 text-medium-emphasis`},jg={key:2,class:`mt-1`},Mg={class:`sk-impact-bar`},Ng=[`title`],Pg={class:`text-caption`},Fg={key:1,class:`text-caption text-medium-emphasis`},Ig={key:3,class:`mt-1`},Lg=[`onClick`],Rg={key:0,class:`sk-config`},zg={class:`sk-nav`},Bg={class:`d-flex flex-wrap align-center ga-2`},Vg={class:`text-caption mt-1`},Hg={key:0,class:`text-caption mt-1`},Ug={class:`sk-nav`},Wg={class:`d-flex flex-wrap align-center ga-2`},Gg={class:`text-caption mt-1`},Kg={key:0,class:`text-caption mt-1`},qg={key:0,class:`text-caption text-medium-emphasis`},Jg={key:3,class:`text-caption`},Yg={key:0,class:`sk-stage-arrow`},Xg={key:0,class:`text-caption text-medium-emphasis mt-3`},Zg=$p(d({__name:`PipelineOverview`,props:{strategies:{},courseId:{},stats:{},statsLabel:{}},setup(e){let t=e,o={"strategy-doc":{label:`strategy doc`,color:`primary`},"assembler-default":{label:`added by the assembler`,color:`secondary`},"default-pipeline":{label:`default pipeline`,color:`warning`}},regStat=e=>t.stats?.regulators.find(t=>t.name===e);function regStatText(e){return`In these runs: active (×>1) in ${e.runsActive}/${e.runs}, mean ×${e.meanMultiplier.toFixed(2)}, max ×${e.maxMultiplier.toFixed(2)}. Last: ${regulatorText(e.last)}.`}let l={gate:`Gate: its penalties mean not ready yet; regulators will not lift what it penalized.`,signal:`Signal: its penalties express preference.`};function filterKind(e){let t=e.kind??filterStat(e.name)?.kind;return t?{kind:t,label:t,help:l[t]}:{kind:`gate`,label:`gate (undeclared)`,help:`${l.gate} Its class declares no kind, so it counts as a gate.`}}let d=v(()=>D(t.strategies,t.courseId)),p=v(()=>new Map((t.stats?.generators??[]).map(e=>[e.name,e]))),_=v(()=>new Map((t.stats?.filters??[]).map(e=>[e.name,e]))),genStat=e=>p.value.get(e),filterStat=e=>_.value.get(e),b=v(()=>{let e=[...d.value.notes],n=t.stats;if(!n)return e;for(let t of d.value.filters){let n=filterStat(t.name);n&&n.boosted+n.penalized+n.removed===0&&e.push(`${t.name} changed no candidate's score in ${n.runs} runs.`)}if(n.runsWithSelection>0)for(let t of d.value.generators){let n=genStat(t.name);n&&n.runs>0&&n.selected===0&&e.push(`${t.name} proposed candidates in ${n.runs} runs, and none was selected.`)}return e});function accuracyOf(e){return e.firstAttempts>0?e.firstAttemptsCorrect/e.firstAttempts:null}function impactParts(e){let t=e.boosted+e.penalized+e.passed+e.removed||1;return[{key:`boosted`,count:e.boosted,color:`success`},{key:`penalized`,count:e.penalized,color:`warning`},{key:`passed`,count:e.passed,color:`grey`},{key:`removed`,count:e.removed,color:`error`}].map(e=>({...e,share:e.count/t}))}function fmtNum(e){return e>=10?Math.round(e).toString():e.toFixed(1)}function fmtPct(e){return e===0?`0%`:e<.01?`<1%`:`${Math.round(e*100)}%`}let w=x(new Set);function toggleConfig(e){let t=new Set(w.value);t.has(e)?t.delete(e):t.add(e),w.value=t}function prettyConfig(e){if(!e)return``;try{let t=JSON.parse(e),n=JSON.stringify(t,null,2);return n===`{}`?``:n}catch{return e}}return(e,t)=>{let l=s(`v-chip`),p=s(`v-alert`),_=s(`v-icon`);return i(),h(`div`,sg,[m(`div`,cg,[r(l,{size:`small`,variant:`tonal`,color:d.value.kind===`default`?`warning`:`primary`},{default:n(()=>[u(a(d.value.kind===`default`?`default pipeline: the course has no strategy docs`:`assembled from strategy docs`),1)]),_:1},8,[`color`]),m(`span`,lg,a(d.value.generators.length)+` generator(s) · `+a(d.value.filters.length)+` filter(s) `,1),e.stats?(i(),h(`span`,ug,` · run stats`+a(e.statsLabel?` for ${e.statsLabel}`:``)+`: `+a(e.stats.runs)+` runs over `+a(e.stats.sessions)+` sessions, `+a(y(fmtTime)(e.stats.firstRunAt))+` – `+a(y(fmtTime)(e.stats.lastRunAt)),1)):C(``,!0)]),(i(!0),h(g,null,f(d.value.skipped,e=>(i(),S(p,{key:e.strategy._id,type:`warning`,variant:`tonal`,density:`compact`,class:`mb-2`},{default:n(()=>[m(`strong`,null,a(e.strategy.name),1),t[0]||(t[0]=u(` (`)),m(`code`,null,a(e.strategy.implementingClass),1),u(`) is `+a(e.reason)+` in this app, so it would not run here. A course's own navigators only plan correctly in the app that registers them. `,1)]),_:2},1024))),128)),(i(!0),h(g,null,f(d.value.warnings,e=>(i(),S(p,{key:e,type:`warning`,variant:`tonal`,density:`compact`,class:`mb-2`},{default:n(()=>[u(a(e),1)]),_:2},1024))),128)),(i(!0),h(g,null,f(b.value,e=>(i(),S(p,{key:e,type:`info`,variant:`tonal`,density:`compact`,class:`mb-2`},{default:n(()=>[u(a(e),1)]),_:2},1024))),128)),(i(!0),h(g,null,f(y(E),(s,p)=>(i(),h(`div`,{key:s.key},[m(`div`,dg,[m(`div`,fg,[m(`span`,pg,a(p+1),1),m(`span`,mg,a(s.title),1)]),m(`div`,hg,a(s.summary),1),s.key===`generate`?(i(!0),h(g,{key:0},f(d.value.generators,s=>(i(),h(`div`,{key:s.name,class:`sk-nav`},[m(`div`,gg,[m(`span`,_g,a(s.name),1),m(`code`,vg,a(s.implementingClass),1),r(l,{size:`x-small`,variant:`outlined`,color:o[s.origin].color},{default:n(()=>[u(a(o[s.origin].label),1)]),_:2},1032,[`color`])]),s.strategy?.description?(i(),h(`div`,yg,a(s.strategy.description),1)):C(``,!0),e.stats?(i(),h(`div`,bg,[genStat(s.name)?(i(),h(g,{key:0},[u(a(fmtNum(genStat(s.name).meanCards))+` candidates/run (`+a(fmtNum(genStat(s.name).meanNew))+` new, `+a(fmtNum(genStat(s.name).meanReview))+` review) · top score `+a(genStat(s.name).topScoreLast.toFixed(2))+` last, `+a(genStat(s.name).topScoreMax.toFixed(2))+` max `,1),e.stats.runsWithSelection>0?(i(),h(g,{key:0},[t[1]||(t[1]=u(` · `)),m(`strong`,null,a(genStat(s.name).selected),1),t[2]||(t[2]=u(` selected `)),genStat(s.name).firstAttempts>0?(i(),h(g,{key:0},[u(` · first attempts `+a(genStat(s.name).firstAttemptsCorrect)+`/`+a(genStat(s.name).firstAttempts)+` correct `,1),m(`span`,{class:c(y(accuracyClass)(accuracyOf(genStat(s.name))))},` (`+a(Math.round(100*accuracyOf(genStat(s.name))))+`%) `,3)],64)):C(``,!0)],64)):C(``,!0)],64)):(i(),h(`span`,xg,`absent from these runs`))])):C(``,!0),prettyConfig(s.strategy?.serializedData)?(i(),h(`div`,Sg,[m(`a`,{class:`sk-config-link text-caption`,onClick:e=>toggleConfig(`g:${s.name}`)},a(w.value.has(`g:${s.name}`)?`Hide`:`Show`)+` config `,9,Cg),w.value.has(`g:${s.name}`)?(i(),h(`pre`,wg,a(prettyConfig(s.strategy?.serializedData)),1)):C(``,!0)])):C(``,!0)]))),128)):s.key===`filter`?(i(),h(g,{key:1},[d.value.filters.length===0?(i(),h(`div`,Tg,`No filters.`)):C(``,!0),(i(!0),h(g,null,f(d.value.filters,s=>(i(),h(`div`,{key:s.name,class:`sk-nav`},[m(`div`,Eg,[m(`span`,Dg,a(s.name),1),m(`code`,Og,a(s.implementingClass),1),r(l,{size:`x-small`,variant:`outlined`,color:o[s.origin].color},{default:n(()=>[u(a(o[s.origin].label),1)]),_:2},1032,[`color`]),s.strategy?.learnable?(i(),S(l,{key:0,size:`x-small`,variant:`outlined`},{default:n(()=>t[3]||(t[3]=[u(`learnable weight`)])),_:1})):C(``,!0),r(l,{size:`x-small`,variant:`tonal`,color:filterKind(s).kind===`gate`?`deep-orange`:`blue-grey`,title:filterKind(s).help},{default:n(()=>[u(a(filterKind(s).label),1)]),_:2},1032,[`color`,`title`])]),s.strategy?.description?(i(),h(`div`,kg,a(s.strategy.description),1)):s.strategy?C(``,!0):(i(),h(`div`,Ag,` Built in code; no strategy document. `)),e.stats?(i(),h(`div`,jg,[filterStat(s.name)?(i(),h(g,{key:0},[m(`div`,Mg,[(i(!0),h(g,null,f(impactParts(filterStat(s.name)),e=>(i(),h(`div`,{key:e.key,class:c(`bg-${e.color}`),style:T({width:`${e.share*100}%`}),title:`${e.key}: ${e.count}`},null,14,Ng))),128))]),m(`div`,Pg,[u(` over `+a(filterStat(s.name).runs)+` runs: `,1),(i(!0),h(g,null,f(impactParts(filterStat(s.name)),e=>(i(),h(`span`,{key:e.key,class:`mr-2`},[m(`span`,{class:c(`text-${e.color}`)},`●`,2),u(` `+a(e.key)+` `+a(fmtPct(e.share)),1)]))),128))])],64)):(i(),h(`span`,Fg,`absent from these runs`))])):C(``,!0),prettyConfig(s.strategy?.serializedData)?(i(),h(`div`,Ig,[m(`a`,{class:`sk-config-link text-caption`,onClick:e=>toggleConfig(`f:${s.name}`)},a(w.value.has(`f:${s.name}`)?`Hide`:`Show`)+` config `,9,Lg),w.value.has(`f:${s.name}`)?(i(),h(`pre`,Rg,a(prettyConfig(s.strategy?.serializedData)),1)):C(``,!0)])):C(``,!0)]))),128))],64)):s.key===`regulate`?(i(),h(g,{key:2},[m(`div`,zg,[m(`div`,Bg,[t[5]||(t[5]=m(`span`,{class:`font-weight-medium`},`Review mass`,-1)),r(l,{size:`x-small`,variant:`outlined`},{default:n(()=>t[4]||(t[4]=[u(`on review cards`)])),_:1})]),m(`div`,Vg,` Each due review weighs its SRS urgency (0–1) times the filters' net effect on it. Above `+a(d.value.regulators.reviewMass.healthyMass)+` card-equivalents, every review is multiplied by ×`+a(d.value.regulators.reviewMass.rate)+` per `+a(d.value.regulators.reviewMass.healthyMass)+` in excess (uncapped). Reviews without an urgency weigh their score against `+a(d.value.regulators.reviewMass.referenceScore)+`. `,1),regStat(`review-mass`)?(i(),h(`div`,Hg,a(regStatText(regStat(`review-mass`))),1)):C(``,!0)]),m(`div`,Ug,[m(`div`,Wg,[t[7]||(t[7]=m(`span`,{class:`font-weight-medium`},`Intake`,-1)),r(l,{size:`x-small`,variant:`outlined`},{default:n(()=>t[6]||(t[6]=[u(`on new cards no gate penalized`)])),_:1})]),m(`div`,Gg,` ×`+a(d.value.regulators.intake.rate)+` per `+a(d.value.regulators.intake.scaleHours)+` hours since a new card was last presented (uncapped). The clock stops while no eligible new card exists. `,1),regStat(`intake`)?(i(),h(`div`,Kg,a(regStatText(regStat(`intake`))),1)):C(``,!0)]),e.stats&&e.stats.regulators.length===0?(i(),h(`div`,qg,` None of these runs recorded regulator readings (recorded from 0.2.29). `)):C(``,!0)],64)):s.key===`select`&&e.stats&&e.stats.runsWithSelection>0?(i(),h(`div`,Jg,[u(a(e.stats.selectedUnattributed)+` selected card(s) had no generator: forced in by a hint's `,1),t[8]||(t[8]=m(`code`,null,`requireCards`,-1)),t[9]||(t[9]=u(`. `))])):C(``,!0)]),p<y(E).length-1?(i(),h(`div`,Yg,[r(_,{size:`small`},{default:n(()=>t[10]||(t[10]=[u(`mdi-arrow-down`)])),_:1})])):C(``,!0)]))),128)),e.stats&&e.stats.runsWithSelection===0?(i(),h(`div`,Xg,` None of these runs recorded which cards they selected (recorded from 0.2.28), so selection and first-attempt counts are not shown. `)):C(``,!0)])}}}),[[`__scopeId`,`data-v-24b6038f`]]),Qg=d({__name:`LearnerDiagnostics`,props:{dataset:{},interpreters:{}},setup(e){let t=e,o=x(`sessions`),c=x(null),l=x(void 0),d=v(()=>pipelineRunStats(t.dataset));function openCard(e){l.value=void 0,o.value=`cards`,setTimeout(()=>l.value=e)}return p(()=>t.dataset,()=>{o.value=`sessions`,c.value=null,l.value=void 0}),(e,t)=>{let f=s(`v-tab`),p=s(`v-tabs`),m=s(`v-btn`);return i(),h(`div`,null,[r(p,{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),density:`compact`,class:`mb-4`},{default:n(()=>[r(f,{value:`sessions`},{default:n(()=>[u(`Sessions (`+a(e.dataset.sessions.length)+`)`,1)]),_:1}),r(f,{value:`cards`},{default:n(()=>[u(`Cards (`+a(e.dataset.cardHistories.length)+`)`,1)]),_:1}),e.dataset.strategies?(i(),S(f,{key:0,value:`pipeline`},{default:n(()=>t[3]||(t[3]=[u(`Pipeline`)])),_:1})):C(``,!0),r(f,{value:`elo`},{default:n(()=>t[4]||(t[4]=[u(`ELO`)])),_:1})]),_:1},8,[`modelValue`]),o.value===`sessions`?(i(),h(g,{key:0},[c.value?(i(),h(g,{key:0},[r(m,{variant:`text`,size:`small`,"prepend-icon":`mdi-arrow-left`,class:`mb-2`,onClick:t[1]||(t[1]=e=>c.value=null)},{default:n(()=>t[5]||(t[5]=[u(` All sessions `)])),_:1}),r(bh,{dataset:e.dataset,"session-id":c.value,interpreters:e.interpreters,onOpenCard:openCard},null,8,[`dataset`,`session-id`,`interpreters`])],64)):(i(),S(Fh,{key:1,dataset:e.dataset,interpreters:e.interpreters,onOpen:t[2]||(t[2]=e=>c.value=e)},null,8,[`dataset`,`interpreters`]))],64)):o.value===`cards`?(i(),S(um,{key:1,dataset:e.dataset,interpreters:e.interpreters,focus:l.value},null,8,[`dataset`,`interpreters`,`focus`])):o.value===`pipeline`&&e.dataset.strategies?(i(),S(Zg,{key:2,strategies:e.dataset.strategies,"course-id":e.dataset.courseId,stats:d.value,"stats-label":e.dataset.username},null,8,[`strategies`,`course-id`,`stats`,`stats-label`])):o.value===`elo`?(i(),S(og,{key:3,dataset:e.dataset,interpreters:e.interpreters},null,8,[`dataset`,`interpreters`])):C(``,!0)])}}});export{fetchLearnerDump as a,cardDossiers as i,Qg as n,fromDump as o,Vp as r,em as t};
|
|
21
|
-
//# sourceMappingURL=admin-
|
|
21
|
+
//# sourceMappingURL=admin-hzNSXp0o.js.map
|