writetrack 0.10.1 → 0.10.2

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/viz.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ye=Object.create;var pt=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var Ce=(r,t)=>{for(var e in t)pt(r,e,{get:t[e],enumerable:!0})},Zt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of be(t))!xe.call(r,a)&&a!==e&&pt(r,a,{get:()=>t[a],enumerable:!(n=we(t,a))||n.enumerable});return r};var W=(r,t,e)=>(e=r!=null?ye(ve(r)):{},Zt(t||!r||!r.__esModule?pt(e,"default",{value:r,enumerable:!0}):e,r)),ke=r=>Zt(pt({},"__esModule",{value:!0}),r);var Cr={};Ce(Cr,{BaseChart:()=>y,CATEGORY_NAMES:()=>q,CorrectionsBubble:()=>H,DocumentGrowth:()=>I,EditBeeswarm:()=>L,EditWaterfall:()=>F,GLOSSARY:()=>Nt,IntegrityFooter:()=>ot,PauseDistribution:()=>Z,RhythmHeatmap:()=>N,Sparkline:()=>gt,SpeedTimeline:()=>O,TIER1_CATEGORIES:()=>ue,TIER2_CATEGORIES:()=>pe,WtBadge:()=>lt,WtOriginBar:()=>tt,WtScorecard:()=>mt,extractBeeswarmData:()=>$t,extractCorrectionBubbles:()=>Wt,extractGrowthData:()=>At,extractOriginData:()=>et,extractPauseHistogram:()=>Pt,extractRhythmPairs:()=>Et,extractSeries:()=>kt,extractSpeedData:()=>St,extractStatBadges:()=>dt,extractWaterfallData:()=>Mt,formatDuration:()=>Ot,generateCaption:()=>vt,generateSummary:()=>it,generateWritingSummary:()=>bt,getMetrics:()=>st,getStatus:()=>z,isPass:()=>me,renderOriginBar:()=>rt,renderStatBadges:()=>xt,wrapTerms:()=>ct});module.exports=ke(Cr);var ht=`:host {
1
+ "use strict";var ye=Object.create;var pt=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var Ce=(r,t)=>{for(var e in t)pt(r,e,{get:t[e],enumerable:!0})},Zt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of be(t))!xe.call(r,a)&&a!==e&&pt(r,a,{get:()=>t[a],enumerable:!(n=we(t,a))||n.enumerable});return r};var W=(r,t,e)=>(e=r!=null?ye(ve(r)):{},Zt(t||!r||!r.__esModule?pt(e,"default",{value:r,enumerable:!0}):e,r)),ke=r=>Zt(pt({},"__esModule",{value:!0}),r);var Cr={};Ce(Cr,{BaseChart:()=>y,CATEGORY_NAMES:()=>q,CorrectionsBubble:()=>H,DocumentGrowth:()=>I,EditBeeswarm:()=>L,EditWaterfall:()=>F,GLOSSARY:()=>Nt,IntegrityFooter:()=>ot,PauseDistribution:()=>Z,RhythmHeatmap:()=>N,Sparkline:()=>ft,SpeedTimeline:()=>O,TIER1_CATEGORIES:()=>ue,TIER2_CATEGORIES:()=>pe,WtBadge:()=>lt,WtOriginBar:()=>tt,WtScorecard:()=>mt,extractBeeswarmData:()=>$t,extractCorrectionBubbles:()=>Wt,extractGrowthData:()=>At,extractOriginData:()=>et,extractPauseHistogram:()=>Pt,extractRhythmPairs:()=>Et,extractSeries:()=>kt,extractSpeedData:()=>St,extractStatBadges:()=>dt,extractWaterfallData:()=>Mt,formatDuration:()=>Ot,generateCaption:()=>vt,generateSummary:()=>it,generateWritingSummary:()=>bt,getMetrics:()=>st,getStatus:()=>z,isPass:()=>me,renderOriginBar:()=>rt,renderStatBadges:()=>xt,wrapTerms:()=>ct});module.exports=ke(Cr);var ht=`:host {
2
2
  --wt-color-primary: #fbbf24;
3
3
  --wt-color-secondary: #22d3ee;
4
4
  --wt-color-bg: #111113;
@@ -47,9 +47,9 @@
47
47
  }
48
48
 
49
49
  /* Force light text on dark tooltips regardless of chart theme */
50
- [aria-label="tip"] { color: #fafafa; }`,M={fill:"#1a1a1d",stroke:"#27272a",textPadding:6,fontSize:11,fontFamily:"'JetBrains Mono', ui-monospace, monospace"};function _(r){console.warn(`[WriteTrack] ${r}`)}function Ct(r){return r instanceof Error?r.message:String(r)}var y=class extends HTMLElement{constructor(){super();this._data=null;this._resizeObserver=null;this._resizeRaf=null;this.e=null;this.s=0;this.t=!1;this.a=!1;this.shadow=this.attachShadow({mode:"open"});let e=document.createElement("style");e.textContent=this.getStylesheet(),this.shadow.appendChild(e),this.container=document.createElement("div"),this.container.className="wt-chart",this.shadow.appendChild(this.container)}static get observedAttributes(){return["data","theme","label","compact"]}get compact(){return this.hasAttribute("compact")}getChartWidth(e){let n=getComputedStyle(this).getPropertyValue("--wt-chart-width").trim();return n?parseInt(n,10)||e:this.container.clientWidth||this.clientWidth||e}getChartHeight(e){let n=getComputedStyle(this).getPropertyValue("--wt-chart-height").trim();if(n)return parseInt(n,10)||e;let a=this.style.height;return a&&parseInt(a,10)||e}getStylesheet(){return ht}connectedCallback(){typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>{var a,o;let n=((o=(a=e[0])==null?void 0:a.contentRect)==null?void 0:o.width)??0;n===0||n===this.s||(this.s=n,this.t&&this._data&&(this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._resizeRaf=requestAnimationFrame(()=>{this._resizeRaf=null,this.onResize()})))}),this._resizeObserver.observe(this.container)),this.c(),typeof MutationObserver<"u"&&(this.e=new MutationObserver(()=>{this.c()}),this.e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),document.body&&this.e.observe(document.body,{attributes:!0,attributeFilter:["data-theme"]}))}disconnectedCallback(){this.destroy()}attributeChangedCallback(e,n,a){if(e==="data"&&a)try{let o=JSON.parse(a);this.setData(o)}catch(o){_(`BaseChart: invalid JSON in data attribute: ${Ct(o)}`)}(e==="theme"||e==="compact")&&this._data&&this.t&&this.safeRender()}setData(e){this._data=e,this.safeRender()}getData(){return this._data}get hasRendered(){return this.t}replaceChart(...e){for(let n of e)if(n instanceof SVGElement){n.setAttribute("role","img");let a=this.getAttribute("label")??this.tagName.toLowerCase().replace("wt-","").replace(/-/g," ")+" chart";n.setAttribute("aria-label",a)}this.container.replaceChildren(...e),this.t=!0,this.dispatchEvent(new CustomEvent("wt-render",{bubbles:!1}))}showEmptyState(e="No data"){if(this.compact){this.container.replaceChildren(),this.t=!1;return}let n=document.createElement("div");n.className="wt-empty",n.textContent=e,n.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;font-family:var(--wt-font-ui,system-ui,sans-serif);font-size:11px;color:var(--wt-color-text-muted,#a1a1aa);",this.container.replaceChildren(n),this.t=!1}destroy(){this._resizeRaf&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=null),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.e&&(this.e.disconnect(),this.e=null),this.container.replaceChildren(),this._data=null,this.t=!1}onResize(){this.safeRender()}safeRender(){try{this.render()}catch(e){_(`${this.constructor.name} render failed: ${Ct(e)}`)}}static register(){customElements.get(this.tagName)||customElements.define(this.tagName,this)}c(){if(this.hasAttribute("theme")&&!this.a)return;let e=this.parentElement;for(;e;){let n=e.getAttribute("data-theme");if(n){this.shadow.host.setAttribute("theme",n),this.a=!0;return}e=e.parentElement}this.a&&(this.shadow.host.removeAttribute("theme"),this.a=!1)}};y.tagName="wt-base-chart";var G=W(require("@observablehq/plot"),1);var Te=5;function kt(r){var o;let t=(((o=r.session)==null?void 0:o.events)??[]).filter(s=>s.type==="keydown"&&s.flightTime!=null&&s.flightTime>0);if(t.length<2)return[[],[]];let e=r.session.sessionStartTime,n=[],a=[];for(let s=0;s<t.length;s++){let i=Math.max(0,s-Te+1),c=0,l=0;for(let p=i;p<=s;p++)c+=t[p].flightTime,l++;let d=c/l,u=Math.round(6e4/d);n.push(Math.round((t[s].timestamp-e)/1e3*100)/100),a.push(u)}return[n,a]}var Q=class Q extends y{connectedCallback(){super.connectedCallback();let t=getComputedStyle(this);!this.style.display&&t.display==="inline"&&(this.style.display="inline-block"),!this.style.width&&(t.width==="auto"||t.width==="0px")&&(this.style.width="200px"),!this.style.height&&(t.height==="auto"||t.height==="0px")&&(this.style.height="40px")}render(){if(!this._data)return;let[t,e]=kt(this._data);if(t.length===0){this.showEmptyState("No data");return}let n=t.map((c,l)=>({time:c,speed:e[l]})),a=this.getBoundingClientRect(),o=Math.max(a.width||200,50),s=Math.max(a.height||40,20),i=G.plot({width:o,height:s,axis:null,x:{axis:null},y:{axis:null},marks:[G.areaY(n,{x:"time",y:"speed",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.1}),G.lineY(n,{x:"time",y:"speed",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:1.5})],style:{background:"transparent",overflow:"visible"},margin:0,marginTop:2,marginBottom:2,marginLeft:0,marginRight:0});this.replaceChart(i)}static create(t,e){Q.register();let n=document.createElement(Q.tagName);return t.appendChild(n),n.setData(e),n}};Q.tagName="wt-sparkline";var gt=Q;var P=W(require("@observablehq/plot"),1);var Tt="monotone-x",X="step-after",E={marginTop:4,marginRight:0,marginBottom:4,marginLeft:0};function ft(r){let t=document.createElement("div");t.style.cssText="display:flex;flex-wrap:wrap;gap:10px;padding:6px 0 2px;font-family:var(--wt-font-data,ui-monospace,monospace);font-size:10px;color:var(--wt-color-text-muted,#a1a1aa);";for(let{label:e,color:n,shape:a}of r){let o=document.createElement("span");o.style.cssText="display:inline-flex;align-items:center;gap:4px;";let s=document.createElement("span"),i=a==="square"?"2px":"50%";s.style.cssText=`width:8px;height:8px;border-radius:${i};background:${n};flex-shrink:0;`,o.appendChild(s),o.appendChild(document.createTextNode(e)),t.appendChild(o)}return t}var S={background:"transparent",color:"var(--wt-color-text, #fafafa)",fontFamily:"var(--wt-font-data)",fontSize:"11px"},J={strokeDasharray:"4,4",strokeWidth:1};function St(r){var a,o,s;let t=(o=(a=r.temporalPatterns)==null?void 0:a.metrics)==null?void 0:o.speedTimeline;if(!((s=t==null?void 0:t.timestamps)!=null&&s.length))return[];let e=Math.min(t.timestamps.length,t.values.length),n=[];for(let i=0;i<e;i++)n.push({time:t.timestamps[i]/1e3,speed:t.values[i]});return n.sort((i,c)=>i.time-c.time),n}var O=class extends y{render(){if(!this._data)return;let t=St(this._data);if(t.length===0){this.showEmptyState("No speed data");return}let e=this.getChartWidth(640),n=this.getChartHeight(200),a=this.compact,o=[P.areaY(t,{x:"time",y:"speed",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.15,curve:Tt}),P.lineY(t,{x:"time",y:"speed",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:a?1.5:2,curve:Tt})];a||o.push(P.ruleY([0],{stroke:"var(--wt-color-border, #27272a)"}),P.tip(t,P.pointerX({x:"time",y:"speed",title:i=>`${i.time.toFixed(1)}s \u2014 ${Math.round(i.speed)} CPM`,...M})));let s=P.plot({width:e,height:n,...a?E:{marginLeft:50,marginBottom:35},x:a?{axis:null}:{label:"Time (s)"},y:a?{axis:null}:{label:"Speed (CPM)",grid:!0},marks:o,style:S});this.replaceChart(s)}};O.tagName="wt-speed-timeline";var B=W(require("@observablehq/plot"),1);var Se=10;function Et(r){var s,i,c,l,d;let t=(i=(s=r.timingAuthenticity)==null?void 0:s.metrics)==null?void 0:i.timingOverTime;if(!((c=t==null?void 0:t.timestamps)!=null&&c.length))return[];let e=((l=t.series)==null?void 0:l.meanDwell)??[],n=((d=t.series)==null?void 0:d.meanFlight)??[];if(!e.length||!n.length)return[];let a=[],o=Math.min(t.timestamps.length,e.length,n.length);for(let u=0;u<o;u++)e[u]!=null&&n[u]!=null&&a.push({dwell:e[u],flight:n[u]});return a}var N=class extends y{render(){if(!this._data)return;let t=Et(this._data);if(t.length<Se){this.showEmptyState("Insufficient timing data");return}let e=this.getChartWidth(400),n=Math.min(e,this.getChartHeight(300)),a=this.compact,o=[B.dot(t,{x:"dwell",y:"flight",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:a?.4:.5,r:a?2:3,stroke:"none"})];a||o.push(B.ruleX([t.reduce((i,c)=>i+c.dwell,0)/t.length],{stroke:"var(--wt-color-secondary, #22d3ee)",...J}),B.ruleY([t.reduce((i,c)=>i+c.flight,0)/t.length],{stroke:"var(--wt-color-secondary, #22d3ee)",...J}));let s=B.plot({width:e,height:n,...a?E:{marginLeft:50,marginBottom:35},x:a?{axis:null}:{label:"Dwell (ms)",grid:!0},y:a?{axis:null}:{label:"Flight (ms)",grid:!0},marks:o,style:S});this.replaceChart(s)}};N.tagName="wt-rhythm-heatmap";var V=W(require("@observablehq/plot"),1);function Pt(r){var e,n,a;let t=(n=(e=r.temporalPatterns)==null?void 0:e.metrics)==null?void 0:n.pauseDistribution;return(a=t==null?void 0:t.histogram)!=null&&a.length?t.histogram.map(o=>({start:o.binStart,end:o.binEnd,count:o.count})):[]}var Z=class extends y{render(){if(!this._data)return;let t=Pt(this._data);if(t.length===0){this.showEmptyState("No pause data");return}let e=this.getChartWidth(640),n=this.clientHeight||200,a=V.plot({width:e,height:n,marginLeft:50,marginBottom:35,x:{label:"Pause Duration (ms)"},y:{label:"Count",grid:!0},marks:[V.rectY(t,{x1:"start",x2:"end",y:"count",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.8,inset:.5}),V.ruleY([0])],style:S});this.replaceChart(a)}};Z.tagName="wt-pause-distribution";var C=W(require("@observablehq/plot"),1);var j=/^.$/u;function k(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ee(r){let t=[];for(let e of r)e.key==="Backspace"||e.key==="Delete"?t.push({timestamp:e.timestamp,type:"key",delta:-1}):j.test(e.key)&&t.push({timestamp:e.timestamp,type:"key",delta:1});return t}function Pe(r){let t=[];for(let e of r??[])e.type==="paste"?t.push({timestamp:e.timestamp,type:"paste",delta:e.length,pasteLength:e.length}):e.type==="cut"&&t.push({timestamp:e.timestamp,type:"cut",delta:-e.length,cutLength:e.length});return t}function Ae(r,t){let e=[],n=0;for(let a of r){let o=(a.timestamp-t)/1e3;a.type==="paste"?(e.push({time:o,chars:n,isPaste:!1,isCut:!1}),n+=a.delta,e.push({time:o+.001,chars:n,isPaste:!0,isCut:!1,pasteLength:a.pasteLength})):a.type==="cut"?(e.push({time:o,chars:n,isPaste:!1,isCut:!1}),n=Math.max(0,n+a.delta),e.push({time:o+.001,chars:n,isPaste:!1,isCut:!0,cutLength:a.cutLength})):(n=Math.max(0,n+a.delta),e.push({time:o,chars:n,isPaste:!1,isCut:!1}))}return e}function At(r){var o,s;let t=(o=r.session)==null?void 0:o.events;if(!(t!=null&&t.length))return[];let e=t.filter(i=>i.type==="keydown");if(e.length===0)return[];let n=e[0].timestamp,a=[...Ee(e),...Pe((s=r.session)==null?void 0:s.clipboardEvents)];return a.sort((i,c)=>i.timestamp-c.timestamp),Ae(a,n)}function $e(r,t,e){let n=[C.areaY(r,{x:"time",y:"chars",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.1,curve:X}),C.lineY(r,{x:"time",y:"chars",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:2,curve:X})];return t.length>0&&n.push(C.text(t,{x:"time",y:"chars",text:a=>`+${a.pasteLength}`,fill:"var(--wt-color-secondary, #22d3ee)",fontSize:10,dy:-8})),e.length>0&&n.push(C.text(e,{x:"time",y:"chars",text:a=>`\u2212${a.cutLength}`,fill:"#ef4444",fontSize:10,dy:12})),n.push(C.tip(r,C.pointerX({x:"time",y:"chars",title:a=>{let o=`${a.time.toFixed(1)}s \u2014 ${a.chars} chars`;return a.isPaste?`${o}
50
+ [aria-label="tip"] { color: #fafafa; }`,M={fill:"#1a1a1d",stroke:"#27272a",textPadding:6,fontSize:11,fontFamily:"'JetBrains Mono', ui-monospace, monospace"};function _(r){console.warn(`[WriteTrack] ${r}`)}function Ct(r){return r instanceof Error?r.message:String(r)}var y=class extends HTMLElement{constructor(){super();this._data=null;this._resizeObserver=null;this._resizeRaf=null;this.e=null;this.s=0;this.t=!1;this.a=!1;this.shadow=this.attachShadow({mode:"open"});let e=document.createElement("style");e.textContent=this.getStylesheet(),this.shadow.appendChild(e),this.container=document.createElement("div"),this.container.className="wt-chart",this.shadow.appendChild(this.container)}static get observedAttributes(){return["data","theme","label","compact"]}get compact(){return this.hasAttribute("compact")}getChartWidth(e){let n=getComputedStyle(this).getPropertyValue("--wt-chart-width").trim();return n?parseInt(n,10)||e:this.container.clientWidth||this.clientWidth||e}getChartHeight(e){let n=getComputedStyle(this).getPropertyValue("--wt-chart-height").trim();if(n)return parseInt(n,10)||e;let a=this.style.height;return a&&parseInt(a,10)||e}getStylesheet(){return ht}connectedCallback(){typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>{var a,o;let n=((o=(a=e[0])==null?void 0:a.contentRect)==null?void 0:o.width)??0;n===0||n===this.s||(this.s=n,this.t&&this._data&&(this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._resizeRaf=requestAnimationFrame(()=>{this._resizeRaf=null,this.onResize()})))}),this._resizeObserver.observe(this.container)),this.c(),typeof MutationObserver<"u"&&(this.e=new MutationObserver(()=>{this.c()}),this.e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),document.body&&this.e.observe(document.body,{attributes:!0,attributeFilter:["data-theme"]}))}disconnectedCallback(){this.destroy()}attributeChangedCallback(e,n,a){if(e==="data"&&a)try{let o=JSON.parse(a);this.setData(o)}catch(o){_(`BaseChart: invalid JSON in data attribute: ${Ct(o)}`)}(e==="theme"||e==="compact")&&this._data&&this.t&&this.safeRender()}setData(e){this._data=e,this.safeRender()}getData(){return this._data}get hasRendered(){return this.t}replaceChart(...e){for(let n of e)if(n instanceof SVGElement){n.setAttribute("role","img");let a=this.getAttribute("label")??this.tagName.toLowerCase().replace("wt-","").replace(/-/g," ")+" chart";n.setAttribute("aria-label",a)}this.container.replaceChildren(...e),this.t=!0,this.dispatchEvent(new CustomEvent("wt-render",{bubbles:!1}))}showEmptyState(e="No data"){if(this.compact){this.container.replaceChildren(),this.t=!1;return}let n=document.createElement("div");n.className="wt-empty",n.textContent=e,n.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;font-family:var(--wt-font-ui,system-ui,sans-serif);font-size:11px;color:var(--wt-color-text-muted,#a1a1aa);",this.container.replaceChildren(n),this.t=!1}destroy(){this._resizeRaf&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=null),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.e&&(this.e.disconnect(),this.e=null),this.container.replaceChildren(),this._data=null,this.t=!1}onResize(){this.safeRender()}safeRender(){try{this.render()}catch(e){_(`${this.constructor.name} render failed: ${Ct(e)}`)}}static register(){customElements.get(this.tagName)||customElements.define(this.tagName,this)}c(){if(this.hasAttribute("theme")&&!this.a)return;let e=this.parentElement;for(;e;){let n=e.getAttribute("data-theme");if(n){this.shadow.host.setAttribute("theme",n),this.a=!0;return}e=e.parentElement}this.a&&(this.shadow.host.removeAttribute("theme"),this.a=!1)}};y.tagName="wt-base-chart";var G=W(require("@observablehq/plot"),1);var Te=5;function kt(r){var o;let t=(((o=r.session)==null?void 0:o.events)??[]).filter(s=>s.type==="keydown"&&s.flightTime!=null&&s.flightTime>0);if(t.length<2)return[[],[]];let e=r.session.sessionStartTime,n=[],a=[];for(let s=0;s<t.length;s++){let i=Math.max(0,s-Te+1),c=0,l=0;for(let p=i;p<=s;p++)c+=t[p].flightTime,l++;let d=c/l,u=Math.round(6e4/d);n.push(Math.round((t[s].timestamp-e)/1e3*100)/100),a.push(u)}return[n,a]}var Q=class Q extends y{connectedCallback(){super.connectedCallback();let t=getComputedStyle(this);!this.style.display&&t.display==="inline"&&(this.style.display="inline-block"),!this.style.width&&(t.width==="auto"||t.width==="0px")&&(this.style.width="200px"),!this.style.height&&(t.height==="auto"||t.height==="0px")&&(this.style.height="40px")}render(){if(!this._data)return;let[t,e]=kt(this._data);if(t.length===0){this.showEmptyState("No data");return}let n=t.map((c,l)=>({time:c,speed:e[l]})),a=this.getBoundingClientRect(),o=Math.max(a.width||200,50),s=Math.max(a.height||40,20),i=G.plot({width:o,height:s,axis:null,x:{axis:null},y:{axis:null},marks:[G.areaY(n,{x:"time",y:"speed",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.1}),G.lineY(n,{x:"time",y:"speed",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:1.5})],style:{background:"transparent",overflow:"visible"},margin:0,marginTop:2,marginBottom:2,marginLeft:0,marginRight:0});this.replaceChart(i)}static create(t,e){Q.register();let n=document.createElement(Q.tagName);return t.appendChild(n),n.setData(e),n}};Q.tagName="wt-sparkline";var ft=Q;var P=W(require("@observablehq/plot"),1);var Tt="monotone-x",X="step-after",E={marginTop:4,marginRight:0,marginBottom:4,marginLeft:0};function gt(r){let t=document.createElement("div");t.style.cssText="display:flex;flex-wrap:wrap;gap:10px;padding:6px 0 2px;font-family:var(--wt-font-data,ui-monospace,monospace);font-size:10px;color:var(--wt-color-text-muted,#a1a1aa);";for(let{label:e,color:n,shape:a}of r){let o=document.createElement("span");o.style.cssText="display:inline-flex;align-items:center;gap:4px;";let s=document.createElement("span"),i=a==="square"?"2px":"50%";s.style.cssText=`width:8px;height:8px;border-radius:${i};background:${n};flex-shrink:0;`,o.appendChild(s),o.appendChild(document.createTextNode(e)),t.appendChild(o)}return t}var S={background:"transparent",color:"var(--wt-color-text, #fafafa)",fontFamily:"var(--wt-font-data)",fontSize:"11px"},J={strokeDasharray:"4,4",strokeWidth:1};function St(r){var a,o,s;let t=(o=(a=r.temporalPatterns)==null?void 0:a.metrics)==null?void 0:o.speedTimeline;if(!((s=t==null?void 0:t.timestamps)!=null&&s.length))return[];let e=Math.min(t.timestamps.length,t.values.length),n=[];for(let i=0;i<e;i++)n.push({time:t.timestamps[i]/1e3,speed:t.values[i]});return n.sort((i,c)=>i.time-c.time),n}var O=class extends y{render(){if(!this._data)return;let t=St(this._data);if(t.length===0){this.showEmptyState("No speed data");return}let e=this.getChartWidth(640),n=this.getChartHeight(200),a=this.compact,o=[P.areaY(t,{x:"time",y:"speed",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.15,curve:Tt}),P.lineY(t,{x:"time",y:"speed",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:a?1.5:2,curve:Tt})];a||o.push(P.ruleY([0],{stroke:"var(--wt-color-border, #27272a)"}),P.tip(t,P.pointerX({x:"time",y:"speed",title:i=>`${i.time.toFixed(1)}s \u2014 ${Math.round(i.speed)} CPM`,...M})));let s=P.plot({width:e,height:n,...a?E:{marginLeft:50,marginBottom:35},x:a?{axis:null}:{label:"Time (s)"},y:a?{axis:null}:{label:"Speed (CPM)",grid:!0},marks:o,style:S});this.replaceChart(s)}};O.tagName="wt-speed-timeline";var B=W(require("@observablehq/plot"),1);var Se=10;function Et(r){var s,i,c,l,d;let t=(i=(s=r.timingAuthenticity)==null?void 0:s.metrics)==null?void 0:i.timingOverTime;if(!((c=t==null?void 0:t.timestamps)!=null&&c.length))return[];let e=((l=t.series)==null?void 0:l.meanDwell)??[],n=((d=t.series)==null?void 0:d.meanFlight)??[];if(!e.length||!n.length)return[];let a=[],o=Math.min(t.timestamps.length,e.length,n.length);for(let u=0;u<o;u++)e[u]!=null&&n[u]!=null&&a.push({dwell:e[u],flight:n[u]});return a}var N=class extends y{render(){if(!this._data)return;let t=Et(this._data);if(t.length<Se){this.showEmptyState("Insufficient timing data");return}let e=this.getChartWidth(400),n=Math.min(e,this.getChartHeight(300)),a=this.compact,o=[B.dot(t,{x:"dwell",y:"flight",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:a?.4:.5,r:a?2:3,stroke:"none"})];a||o.push(B.ruleX([t.reduce((i,c)=>i+c.dwell,0)/t.length],{stroke:"var(--wt-color-secondary, #22d3ee)",...J}),B.ruleY([t.reduce((i,c)=>i+c.flight,0)/t.length],{stroke:"var(--wt-color-secondary, #22d3ee)",...J}));let s=B.plot({width:e,height:n,...a?E:{marginLeft:50,marginBottom:35},x:a?{axis:null}:{label:"Dwell (ms)",grid:!0},y:a?{axis:null}:{label:"Flight (ms)",grid:!0},marks:o,style:S});this.replaceChart(s)}};N.tagName="wt-rhythm-heatmap";var V=W(require("@observablehq/plot"),1);function Pt(r){var e,n,a;let t=(n=(e=r.temporalPatterns)==null?void 0:e.metrics)==null?void 0:n.pauseDistribution;return(a=t==null?void 0:t.histogram)!=null&&a.length?t.histogram.map(o=>({start:o.binStart,end:o.binEnd,count:o.count})):[]}var Z=class extends y{render(){if(!this._data)return;let t=Pt(this._data);if(t.length===0){this.showEmptyState("No pause data");return}let e=this.getChartWidth(640),n=this.clientHeight||200,a=V.plot({width:e,height:n,marginLeft:50,marginBottom:35,x:{label:"Pause Duration (ms)"},y:{label:"Count",grid:!0},marks:[V.rectY(t,{x1:"start",x2:"end",y:"count",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.8,inset:.5}),V.ruleY([0])],style:S});this.replaceChart(a)}};Z.tagName="wt-pause-distribution";var C=W(require("@observablehq/plot"),1);var j=/^.$/u;function k(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ee(r){let t=[];for(let e of r)e.key==="Backspace"||e.key==="Delete"?t.push({timestamp:e.timestamp,type:"key",delta:-1}):j.test(e.key)&&t.push({timestamp:e.timestamp,type:"key",delta:1});return t}function Pe(r){let t=[];for(let e of r??[])e.type==="paste"?t.push({timestamp:e.timestamp,type:"paste",delta:e.length,pasteLength:e.length}):e.type==="cut"&&t.push({timestamp:e.timestamp,type:"cut",delta:-e.length,cutLength:e.length});return t}function Ae(r,t){let e=[],n=0;for(let a of r){let o=(a.timestamp-t)/1e3;a.type==="paste"?(e.push({time:o,chars:n,isPaste:!1,isCut:!1}),n+=a.delta,e.push({time:o+.001,chars:n,isPaste:!0,isCut:!1,pasteLength:a.pasteLength})):a.type==="cut"?(e.push({time:o,chars:n,isPaste:!1,isCut:!1}),n=Math.max(0,n+a.delta),e.push({time:o+.001,chars:n,isPaste:!1,isCut:!0,cutLength:a.cutLength})):(n=Math.max(0,n+a.delta),e.push({time:o,chars:n,isPaste:!1,isCut:!1}))}return e}function At(r){var o,s;let t=(o=r.session)==null?void 0:o.events;if(!(t!=null&&t.length))return[];let e=t.filter(i=>i.type==="keydown");if(e.length===0)return[];let n=e[0].timestamp,a=[...Ee(e),...Pe((s=r.session)==null?void 0:s.clipboardEvents)];return a.sort((i,c)=>i.timestamp-c.timestamp),Ae(a,n)}function $e(r,t,e){let n=[C.areaY(r,{x:"time",y:"chars",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.1,curve:X}),C.lineY(r,{x:"time",y:"chars",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:2,curve:X})];return t.length>0&&n.push(C.text(t,{x:"time",y:"chars",text:a=>`+${a.pasteLength}`,fill:"var(--wt-color-secondary, #22d3ee)",fontSize:10,dy:-8})),e.length>0&&n.push(C.text(e,{x:"time",y:"chars",text:a=>`\u2212${a.cutLength}`,fill:"#ef4444",fontSize:10,dy:12})),n.push(C.tip(r,C.pointerX({x:"time",y:"chars",title:a=>{let o=`${a.time.toFixed(1)}s \u2014 ${a.chars} chars`;return a.isPaste?`${o}
51
51
  +${a.pasteLength} pasted`:a.isCut?`${o}
52
- \u2212${a.cutLength} cut`:o},...M}))),n}var I=class extends y{constructor(){super(...arguments);this.i=null}setChangePoint(e){this.i=e,this._data&&this.render()}render(){if(!this._data)return;let e=At(this._data);if(e.length===0){this.showEmptyState("No keystroke data");return}let n=e.filter(c=>c.isPaste),a=e.filter(c=>c.isCut),o=this.getChartWidth(640),s=this.getChartHeight(200),i=this.compact;try{let c;i?c=[C.areaY(e,{x:"time",y:"chars",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.1,curve:X}),C.lineY(e,{x:"time",y:"chars",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:2,curve:X})]:(c=$e(e,n,a),this.i!=null&&c.push(C.ruleX([this.i],{stroke:"var(--wt-color-secondary, #22d3ee)",...J})));let l=C.plot({width:o,height:s,...i?E:{marginLeft:50,marginBottom:35},x:i?{axis:null}:{label:"Time (s)"},y:i?{axis:null}:{label:"Characters",grid:!0},marks:c,style:S});this.replaceChart(l)}catch(c){_(`DocumentGrowth render failed: ${c}`)}}};I.tagName="wt-document-growth";var v=W(require("@observablehq/plot"),1);var yt={insert:"var(--wt-beeswarm-insert, #22c55e)",delete:"var(--wt-beeswarm-delete, #ef4444)",paste:"var(--wt-beeswarm-paste, #22d3ee)",cut:"var(--wt-beeswarm-cut, #f97316)"},Me=["insert","delete","paste","cut"];function $t(r){var o,s;let t=(o=r.session)==null?void 0:o.events;if(!(t!=null&&t.length))return[];let e=t.filter(i=>i.type==="keydown");if(e.length===0)return[];let n=e[0].timestamp,a=[];for(let i of e){let c=(i.timestamp-n)/1e3;i.key==="Backspace"||i.key==="Delete"?a.push({time:c,type:"delete",chars:1,key:"\u232B"}):j.test(i.key)&&a.push({time:c,type:"insert",chars:1,key:i.key})}for(let i of((s=r.session)==null?void 0:s.clipboardEvents)??[])if(i.type==="paste"||i.type==="cut"){let c=Math.max(0,(i.timestamp-n)/1e3);a.push({time:c,type:i.type,chars:i.length,key:i.type==="paste"?"\u{1F4CB}":"\u2702"})}return a.sort((i,c)=>i.time-c.time),a}function We(r,t){if(r.length===0)return[];let e=r[r.length-1].time;if(e===0)return r;let n=Math.max(10,Math.floor(t/4)),a=e/n,o=new Map;for(let s of r){let i=Math.floor(s.time/a),c=`${i}-${s.type}`,l=o.get(c);l?l.chars=s.type==="paste"||s.type==="cut"?Math.max(l.chars,s.chars):l.chars+s.chars:o.set(c,{time:(i+.5)*a,type:s.type,chars:s.chars,key:s.key})}return[...o.values()].sort((s,i)=>s.time-i.time)}var L=class extends y{static get observedAttributes(){return[...super.observedAttributes,"glyphs"]}get glyphs(){return this.hasAttribute("glyphs")}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),t==="glyphs"&&this._data&&this.hasRendered&&this.setData(this._data)}render(){if(!this._data)return;let t=$t(this._data);if(t.length===0){this.showEmptyState("No edit data");return}let e=this.getChartWidth(640),n=this.getChartHeight(160);if(this.compact){let l=this.renderCompact(t,e,n);this.replaceChart(l);return}let s=this.glyphs?this.buildGlyphMarks(t):this.buildDotMarks(t),i=v.plot({width:e,height:400,marginLeft:40,marginBottom:35,marginTop:10,x:{label:"Time (s)"},y:{axis:null},marks:s,style:S}),c=document.createElement("div");c.appendChild(i),c.appendChild(ft(Me.map(l=>({label:l.charAt(0).toUpperCase()+l.slice(1),color:yt[l]})))),this.replaceChart(c),this.cropViewBox(i,e)}renderCompact(t,e,n){let a=We(t,e);return v.plot({width:e,height:n,...E,marginLeft:6,marginRight:6,x:{axis:null},y:{axis:null},marks:[v.dot(a,v.dodgeY({x:"time",r:o=>Math.min(1.5+Math.sqrt(o.chars)*.5,6),fill:o=>yt[o.type],fillOpacity:.6,stroke:"none",clip:!1}))],style:{background:"transparent"}})}buildDotMarks(t){return[v.dot(t,v.dodgeY({x:"time",r:e=>Math.min(1.5+Math.sqrt(e.chars)*.7,14),fill:e=>yt[e.type],fillOpacity:.7,stroke:"none",clip:!1})),v.tip(t,v.pointer(v.dodgeY({x:"time",title:e=>`${e.time.toFixed(1)}s \u2014 ${e.key} (${e.type}${e.chars>1?`, ${e.chars} chars`:""})`,...M})))]}buildGlyphMarks(t){let e={insert:n=>n.key,delete:()=>"\xD7",paste:()=>"\u25AE",cut:()=>"\u25AF"};return[v.text(t,v.dodgeY({x:"time",text:n=>e[n.type](n),fontSize:n=>n.type==="paste"||n.type==="cut"?Math.min(14+Math.sqrt(n.chars)*.8,36):9,r:n=>n.type==="paste"||n.type==="cut"?Math.min(8+Math.sqrt(n.chars)*.5,20):5,fill:n=>yt[n.type],opacity:.8,fontFamily:"ui-monospace, monospace",fontWeight:600,clip:!1})),v.tip(t,v.pointer(v.dodgeY({x:"time",title:n=>`${n.time.toFixed(1)}s \u2014 ${n.key} (${n.type}${n.chars>1?`, ${n.chars} chars`:""})`,...M})))]}cropViewBox(t,e){let a=['g[aria-label="dot"]','g[aria-label="text"]'].map(o=>t.querySelector(o)).filter(Boolean);if(a.length!==0)try{let o=1/0;for(let l of a){let d=l.getBBox();o=Math.min(o,d.y)}let s=parseInt(t.getAttribute("height")||"400",10),i=Math.max(0,o-10),c=s-i;t.setAttribute("height",String(c)),t.setAttribute("viewBox",`0 ${i} ${e} ${c}`)}catch{}}};L.tagName="wt-edit-beeswarm";var A=W(require("@observablehq/plot"),1);var Re=null;function te(){return Re}function ee(r,t,e,n){let a=r.length;if(a<=t||t<3)return r;let o=te();if(!o)return r;let s=new Float64Array(a),i=new Float64Array(a);for(let d=0;d<a;d++)s[d]=e(r[d]),i[d]=n(r[d]);let c=o.lttb_downsample(s,i,t);if(c.length===0)return r;let l=new Array(c.length);for(let d=0;d<c.length;d++)l[d]=r[c[d]];return l}var re=2e3;function De(r,t){let e=[],n=[];for(let a of r??[])a.type==="paste"?e.push({time:Math.max(0,(a.timestamp-t)/1e3),position:a.position}):a.type==="cut"&&n.push({time:Math.max(0,(a.timestamp-t)/1e3),position:a.position});return{pastes:e,cuts:n}}function Mt(r){var i,c;let t=(i=r.session)==null?void 0:i.events;if(!(t!=null&&t.length))return{keystrokes:[],pastes:[],cuts:[]};let e=t.filter(l=>l.type==="keydown"&&l.cursorPosition!=null);if(e.length===0)return{keystrokes:[],pastes:[],cuts:[]};let n=e[0].timestamp,a=e.map(l=>({time:(l.timestamp-n)/1e3,position:l.cursorPosition})),{pastes:o,cuts:s}=De((c=r.session)==null?void 0:c.clipboardEvents,n);return{keystrokes:a,pastes:o,cuts:s}}function Be(r,t,e){let n=[A.line(r,{x:"time",y:"position",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:1.5,strokeOpacity:.8})];return t.length>0&&n.push(A.dot(t,{x:"time",y:"position",fill:"var(--wt-color-secondary, #22d3ee)",r:6,stroke:"var(--wt-color-bg, #111113)",strokeWidth:1})),e.length>0&&n.push(A.dot(e,{x:"time",y:"position",fill:"var(--wt-color-cut, #f97316)",r:6,stroke:"var(--wt-color-bg, #111113)",strokeWidth:1})),n.push(A.tip(r,A.pointerX({x:"time",y:"position",title:a=>`${a.time.toFixed(1)}s \u2014 position ${a.position}`,...M}))),n}var F=class extends y{render(){if(!this._data)return;let t=Mt(this._data);if(t.keystrokes.length===0){this.showEmptyState("No cursor position data");return}let e=ee(t.keystrokes,re,c=>c.time,c=>c.position),{pastes:n,cuts:a}=t,o=this.getChartWidth(640),s=this.getChartHeight(200),i=this.compact;try{let c;i?c=[A.line(e,{x:"time",y:"position",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:1.5,strokeOpacity:.6})]:c=Be(e,n,a);let l=A.plot({width:o,height:s,...i?E:{marginLeft:50,marginBottom:35},x:i?{axis:null}:{label:"Time (s)"},y:i?{axis:null,reverse:!0}:{label:"Position",reverse:!0,grid:!0},marks:c,style:S});this.replaceChart(l)}catch(c){_(`EditWaterfall render failed: ${c}`)}}};F.tagName="wt-edit-waterfall";var $=W(require("@observablehq/plot"),1);var wt={insert:"var(--wt-bubble-insert, #22c55e)",delete:"var(--wt-bubble-delete, #ef4444)",paste:"var(--wt-bubble-paste, var(--wt-color-secondary, #22d3ee))",cut:"var(--wt-bubble-cut, #f97316)"},ne=["insert","delete","paste","cut"];function Wt(r){var l,d;let t=(l=r.session)==null?void 0:l.events;if(!(t!=null&&t.length))return[];let e=t.filter(u=>u.type==="keydown");if(e.length===0)return[];let n=e[0].timestamp,a=[],o=null,s=0,i=0;function c(){o&&s>0&&a.push({time:i,chars:s,type:o}),o=null,s=0}for(let u of e){let p=(u.timestamp-n)/1e3,m=null;u.key==="Backspace"||u.key==="Delete"?m="delete":j.test(u.key)&&(m="insert"),m!==null&&(m!==o&&(c(),o=m,i=p),s++)}c();for(let u of((d=r.session)==null?void 0:d.clipboardEvents)??[])if(u.type==="paste"||u.type==="cut"){let p=Math.max(0,(u.timestamp-n)/1e3),m=u.length;a.push({time:p,chars:m,type:u.type})}return a.sort((u,p)=>u.time-p.time),a}var H=class extends y{render(){if(!this._data)return;let t=Wt(this._data);if(t.length===0){this.showEmptyState("No edit data");return}let e=this.getChartWidth(640),n=this.getChartHeight(200);if(this.compact){let i=this.renderCompact(t,e,n);this.replaceChart(i);return}let o=$.plot({width:e,height:n,marginLeft:70,marginBottom:35,marginTop:10,x:{label:"Time (s)"},y:{label:null,domain:ne},r:{range:[3,12]},marks:[$.dot(t,{x:"time",y:"type",r:"chars",fill:i=>wt[i.type],fillOpacity:.7,stroke:"none"}),$.tip(t,$.pointer({x:"time",y:"type",title:i=>`${i.time.toFixed(1)}s \u2014 ${i.type}, ${i.chars} chars`,...M}))],style:S}),s=document.createElement("div");s.appendChild(o),s.appendChild(ft(ne.map(i=>({label:i.charAt(0).toUpperCase()+i.slice(1),color:wt[i]})))),this.replaceChart(s)}renderCompact(t,e,n){if(!t.some(m=>m.type==="paste"||m.type==="cut"))return $.plot({width:e,height:n,...E,marginLeft:4,marginRight:4,x:{axis:null},y:{axis:null,domain:["insert","delete"]},marks:[$.dot(t,{x:"time",y:"type",r:Math.min(3,Math.max(2,e/t.length/4)),fill:m=>wt[m.type],fillOpacity:.6,stroke:"none"})],style:{background:"transparent"}});let o=t.map(m=>m.time),s=Math.min(...o),c=Math.max(...o)-s||1,l=20,d=c/l,u=new Map;for(let m of t){let g=Math.min(l-1,Math.floor((m.time-s)/d)),h=`${g}-${m.type}`,f=u.get(h);f?f.chars+=m.chars:u.set(h,{time:s+(g+.5)*d,chars:m.chars,type:m.type})}let p=[...u.values()];return $.plot({width:e,height:n,...E,marginLeft:4,marginRight:4,x:{axis:null},y:{axis:null,domain:["cut","paste","insert","delete"]},marks:[$.dot(p,{x:"time",y:"type",r:Math.min(4,Math.max(2,e/p.length/3)),fill:m=>wt[m.type],fillOpacity:.6,stroke:"none"})],style:{background:"transparent"}})}};H.tagName="wt-corrections-bubble";var R=W(require("@observablehq/plot"),1);var _e={Typed:"typed",Pasted:"pasted",Autocompleted:"autocompleted"},Oe={typed:"var(--wt-color-primary, #2B7A5D)",pasted:"var(--wt-color-secondary, #B8412D)",autocompleted:"var(--wt-color-tertiary, #7C6DAF)"};function et(r){var o,s;let t=(s=(o=r.contentOrigin)==null?void 0:o.metrics)==null?void 0:s.charactersByOrigin,e=Math.round(((t==null?void 0:t.typed)??1)*100),n=Math.round(((t==null?void 0:t.pasted)??0)*100),a=Math.round(((t==null?void 0:t.autocompleted)??0)*100);return[{category:"origin",segment:"Typed",value:e},{category:"origin",segment:"Pasted",value:n},{category:"origin",segment:"Autocompleted",value:a}].filter(i=>i.value>0)}function rt(r,t,e=Oe){if(r.length===0){let o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width",String(t)),o.setAttribute("height","24"),o.setAttribute("viewBox",`0 0 ${t} 24`);let s=document.createElementNS("http://www.w3.org/2000/svg","rect");return s.setAttribute("width",String(t)),s.setAttribute("height","24"),s.setAttribute("rx","4"),s.setAttribute("fill","var(--wt-color-border, #3f3f46)"),s.setAttribute("opacity","0.3"),o.appendChild(s),o}let a=[R.barX(r,R.stackX({x:"value",fill:o=>e[_e[o.segment]??"typed"],inset:.5})),R.text(r,R.stackX({x:"value",text:o=>o.value<10?"":o.value<25?`${o.value}%`:`${o.segment} ${o.value}%`,fill:"white",fontSize:11,fontWeight:500}))];return R.plot({width:t,height:32,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,x:{axis:null,domain:[0,100]},y:{axis:null},marks:a,style:{background:"transparent",fontFamily:"var(--wt-scorecard-font-data, var(--wt-font-data, ui-monospace))"}})}var tt=class extends y{render(){if(!this._data)return;let t=et(this._data);if(t.length===0){this.showEmptyState("No content origin data");return}let e=this.clientWidth||400,n=rt(t,e);n&&this.replaceChart(n)}};tt.tagName="wt-origin-bar";var nt=`:host {
52
+ \u2212${a.cutLength} cut`:o},...M}))),n}var I=class extends y{constructor(){super(...arguments);this.i=null}setChangePoint(e){this.i=e,this._data&&this.render()}render(){if(!this._data)return;let e=At(this._data);if(e.length===0){this.showEmptyState("No keystroke data");return}let n=e.filter(c=>c.isPaste),a=e.filter(c=>c.isCut),o=this.getChartWidth(640),s=this.getChartHeight(200),i=this.compact;try{let c;i?c=[C.areaY(e,{x:"time",y:"chars",fill:"var(--wt-color-primary, #fbbf24)",fillOpacity:.1,curve:X}),C.lineY(e,{x:"time",y:"chars",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:2,curve:X})]:(c=$e(e,n,a),this.i!=null&&c.push(C.ruleX([this.i],{stroke:"var(--wt-color-secondary, #22d3ee)",...J})));let l=C.plot({width:o,height:s,...i?E:{marginLeft:50,marginBottom:35},x:i?{axis:null}:{label:"Time (s)"},y:i?{axis:null}:{label:"Characters",grid:!0},marks:c,style:S});this.replaceChart(l)}catch(c){_(`DocumentGrowth render failed: ${c}`)}}};I.tagName="wt-document-growth";var v=W(require("@observablehq/plot"),1);var yt={insert:"var(--wt-beeswarm-insert, #22c55e)",delete:"var(--wt-beeswarm-delete, #ef4444)",paste:"var(--wt-beeswarm-paste, #22d3ee)",cut:"var(--wt-beeswarm-cut, #f97316)"},Me=["insert","delete","paste","cut"];function $t(r){var o,s;let t=(o=r.session)==null?void 0:o.events;if(!(t!=null&&t.length))return[];let e=t.filter(i=>i.type==="keydown");if(e.length===0)return[];let n=e[0].timestamp,a=[];for(let i of e){let c=(i.timestamp-n)/1e3;i.key==="Backspace"||i.key==="Delete"?a.push({time:c,type:"delete",chars:1,key:"\u232B"}):j.test(i.key)&&a.push({time:c,type:"insert",chars:1,key:i.key})}for(let i of((s=r.session)==null?void 0:s.clipboardEvents)??[])if(i.type==="paste"||i.type==="cut"){let c=Math.max(0,(i.timestamp-n)/1e3);a.push({time:c,type:i.type,chars:i.length,key:i.type==="paste"?"\u{1F4CB}":"\u2702"})}return a.sort((i,c)=>i.time-c.time),a}function We(r,t){if(r.length===0)return[];let e=r[r.length-1].time;if(e===0)return r;let n=Math.max(10,Math.floor(t/4)),a=e/n,o=new Map;for(let s of r){let i=Math.floor(s.time/a),c=`${i}-${s.type}`,l=o.get(c);l?l.chars=s.type==="paste"||s.type==="cut"?Math.max(l.chars,s.chars):l.chars+s.chars:o.set(c,{time:(i+.5)*a,type:s.type,chars:s.chars,key:s.key})}return[...o.values()].sort((s,i)=>s.time-i.time)}var L=class extends y{static get observedAttributes(){return[...super.observedAttributes,"glyphs"]}get glyphs(){return this.hasAttribute("glyphs")}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),t==="glyphs"&&this._data&&this.hasRendered&&this.setData(this._data)}render(){if(!this._data)return;let t=$t(this._data);if(t.length===0){this.showEmptyState("No edit data");return}let e=this.getChartWidth(640),n=this.getChartHeight(160);if(this.compact){let l=this.renderCompact(t,e,n);this.replaceChart(l);return}let s=this.glyphs?this.buildGlyphMarks(t):this.buildDotMarks(t),i=v.plot({width:e,height:400,marginLeft:40,marginBottom:35,marginTop:10,x:{label:"Time (s)"},y:{axis:null},marks:s,style:S}),c=document.createElement("div");c.appendChild(i),c.appendChild(gt(Me.map(l=>({label:l.charAt(0).toUpperCase()+l.slice(1),color:yt[l]})))),this.replaceChart(c),this.cropViewBox(i,e)}renderCompact(t,e,n){let a=We(t,e);return v.plot({width:e,height:n,...E,marginLeft:6,marginRight:6,x:{axis:null},y:{axis:null},marks:[v.dot(a,v.dodgeY({x:"time",r:o=>Math.min(1.5+Math.sqrt(o.chars)*.5,6),fill:o=>yt[o.type],fillOpacity:.6,stroke:"none",clip:!1}))],style:{background:"transparent"}})}buildDotMarks(t){return[v.dot(t,v.dodgeY({x:"time",r:e=>Math.min(1.5+Math.sqrt(e.chars)*.7,14),fill:e=>yt[e.type],fillOpacity:.7,stroke:"none",clip:!1})),v.tip(t,v.pointer(v.dodgeY({x:"time",title:e=>`${e.time.toFixed(1)}s \u2014 ${e.key} (${e.type}${e.chars>1?`, ${e.chars} chars`:""})`,...M})))]}buildGlyphMarks(t){let e={insert:n=>n.key,delete:()=>"\xD7",paste:()=>"\u25AE",cut:()=>"\u25AF"};return[v.text(t,v.dodgeY({x:"time",text:n=>e[n.type](n),fontSize:n=>n.type==="paste"||n.type==="cut"?Math.min(14+Math.sqrt(n.chars)*.8,36):9,r:n=>n.type==="paste"||n.type==="cut"?Math.min(8+Math.sqrt(n.chars)*.5,20):5,fill:n=>yt[n.type],opacity:.8,fontFamily:"ui-monospace, monospace",fontWeight:600,clip:!1})),v.tip(t,v.pointer(v.dodgeY({x:"time",title:n=>`${n.time.toFixed(1)}s \u2014 ${n.key} (${n.type}${n.chars>1?`, ${n.chars} chars`:""})`,...M})))]}cropViewBox(t,e){let a=['g[aria-label="dot"]','g[aria-label="text"]'].map(o=>t.querySelector(o)).filter(Boolean);if(a.length!==0)try{let o=1/0;for(let l of a){let d=l.getBBox();o=Math.min(o,d.y)}let s=parseInt(t.getAttribute("height")||"400",10),i=Math.max(0,o-10),c=s-i;t.setAttribute("height",String(c)),t.setAttribute("viewBox",`0 ${i} ${e} ${c}`)}catch{}}};L.tagName="wt-edit-beeswarm";var A=W(require("@observablehq/plot"),1);var Re=null;function te(){return Re}function ee(r,t,e,n){let a=r.length;if(a<=t||t<3)return r;let o=te();if(!o)return r;let s=new Float64Array(a),i=new Float64Array(a);for(let d=0;d<a;d++)s[d]=e(r[d]),i[d]=n(r[d]);let c=o.lttb_downsample(s,i,t);if(c.length===0)return r;let l=new Array(c.length);for(let d=0;d<c.length;d++)l[d]=r[c[d]];return l}var re=2e3;function De(r,t){let e=[],n=[];for(let a of r??[])a.type==="paste"?e.push({time:Math.max(0,(a.timestamp-t)/1e3),position:a.position}):a.type==="cut"&&n.push({time:Math.max(0,(a.timestamp-t)/1e3),position:a.position});return{pastes:e,cuts:n}}function Mt(r){var i,c;let t=(i=r.session)==null?void 0:i.events;if(!(t!=null&&t.length))return{keystrokes:[],pastes:[],cuts:[]};let e=t.filter(l=>l.type==="keydown"&&l.cursorPosition!=null);if(e.length===0)return{keystrokes:[],pastes:[],cuts:[]};let n=e[0].timestamp,a=e.map(l=>({time:(l.timestamp-n)/1e3,position:l.cursorPosition})),{pastes:o,cuts:s}=De((c=r.session)==null?void 0:c.clipboardEvents,n);return{keystrokes:a,pastes:o,cuts:s}}function Be(r,t,e){let n=[A.line(r,{x:"time",y:"position",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:1.5,strokeOpacity:.8})];return t.length>0&&n.push(A.dot(t,{x:"time",y:"position",fill:"var(--wt-color-secondary, #22d3ee)",r:6,stroke:"var(--wt-color-bg, #111113)",strokeWidth:1})),e.length>0&&n.push(A.dot(e,{x:"time",y:"position",fill:"var(--wt-color-cut, #f97316)",r:6,stroke:"var(--wt-color-bg, #111113)",strokeWidth:1})),n.push(A.tip(r,A.pointerX({x:"time",y:"position",title:a=>`${a.time.toFixed(1)}s \u2014 position ${a.position}`,...M}))),n}var F=class extends y{render(){if(!this._data)return;let t=Mt(this._data);if(t.keystrokes.length===0){this.showEmptyState("No cursor position data");return}let e=ee(t.keystrokes,re,c=>c.time,c=>c.position),{pastes:n,cuts:a}=t,o=this.getChartWidth(640),s=this.getChartHeight(200),i=this.compact;try{let c;i?c=[A.line(e,{x:"time",y:"position",stroke:"var(--wt-color-primary, #fbbf24)",strokeWidth:1.5,strokeOpacity:.6})]:c=Be(e,n,a);let l=A.plot({width:o,height:s,...i?E:{marginLeft:50,marginBottom:35},x:i?{axis:null}:{label:"Time (s)"},y:i?{axis:null,reverse:!0}:{label:"Position",reverse:!0,grid:!0},marks:c,style:S});this.replaceChart(l)}catch(c){_(`EditWaterfall render failed: ${c}`)}}};F.tagName="wt-edit-waterfall";var $=W(require("@observablehq/plot"),1);var wt={insert:"var(--wt-bubble-insert, #22c55e)",delete:"var(--wt-bubble-delete, #ef4444)",paste:"var(--wt-bubble-paste, var(--wt-color-secondary, #22d3ee))",cut:"var(--wt-bubble-cut, #f97316)"},ne=["insert","delete","paste","cut"];function Wt(r){var l,d;let t=(l=r.session)==null?void 0:l.events;if(!(t!=null&&t.length))return[];let e=t.filter(u=>u.type==="keydown");if(e.length===0)return[];let n=e[0].timestamp,a=[],o=null,s=0,i=0;function c(){o&&s>0&&a.push({time:i,chars:s,type:o}),o=null,s=0}for(let u of e){let p=(u.timestamp-n)/1e3,m=null;u.key==="Backspace"||u.key==="Delete"?m="delete":j.test(u.key)&&(m="insert"),m!==null&&(m!==o&&(c(),o=m,i=p),s++)}c();for(let u of((d=r.session)==null?void 0:d.clipboardEvents)??[])if(u.type==="paste"||u.type==="cut"){let p=Math.max(0,(u.timestamp-n)/1e3),m=u.length;a.push({time:p,chars:m,type:u.type})}return a.sort((u,p)=>u.time-p.time),a}var H=class extends y{render(){if(!this._data)return;let t=Wt(this._data);if(t.length===0){this.showEmptyState("No edit data");return}let e=this.getChartWidth(640),n=this.getChartHeight(200);if(this.compact){let i=this.renderCompact(t,e,n);this.replaceChart(i);return}let o=$.plot({width:e,height:n,marginLeft:70,marginBottom:35,marginTop:10,x:{label:"Time (s)"},y:{label:null,domain:ne},r:{range:[3,12]},marks:[$.dot(t,{x:"time",y:"type",r:"chars",fill:i=>wt[i.type],fillOpacity:.7,stroke:"none"}),$.tip(t,$.pointer({x:"time",y:"type",title:i=>`${i.time.toFixed(1)}s \u2014 ${i.type}, ${i.chars} chars`,...M}))],style:S}),s=document.createElement("div");s.appendChild(o),s.appendChild(gt(ne.map(i=>({label:i.charAt(0).toUpperCase()+i.slice(1),color:wt[i]})))),this.replaceChart(s)}renderCompact(t,e,n){if(!t.some(m=>m.type==="paste"||m.type==="cut"))return $.plot({width:e,height:n,...E,marginLeft:4,marginRight:4,x:{axis:null},y:{axis:null,domain:["insert","delete"]},marks:[$.dot(t,{x:"time",y:"type",r:Math.min(3,Math.max(2,e/t.length/4)),fill:m=>wt[m.type],fillOpacity:.6,stroke:"none"})],style:{background:"transparent"}});let o=t.map(m=>m.time),s=Math.min(...o),c=Math.max(...o)-s||1,l=20,d=c/l,u=new Map;for(let m of t){let f=Math.min(l-1,Math.floor((m.time-s)/d)),h=`${f}-${m.type}`,g=u.get(h);g?g.chars+=m.chars:u.set(h,{time:s+(f+.5)*d,chars:m.chars,type:m.type})}let p=[...u.values()];return $.plot({width:e,height:n,...E,marginLeft:4,marginRight:4,x:{axis:null},y:{axis:null,domain:["cut","paste","insert","delete"]},marks:[$.dot(p,{x:"time",y:"type",r:Math.min(4,Math.max(2,e/p.length/3)),fill:m=>wt[m.type],fillOpacity:.6,stroke:"none"})],style:{background:"transparent"}})}};H.tagName="wt-corrections-bubble";var R=W(require("@observablehq/plot"),1);var _e={Typed:"typed",Pasted:"pasted",Autocompleted:"autocompleted"},Oe={typed:"var(--wt-color-primary, #2B7A5D)",pasted:"var(--wt-color-secondary, #B8412D)",autocompleted:"var(--wt-color-tertiary, #7C6DAF)"};function et(r){var o,s;let t=(s=(o=r.contentOrigin)==null?void 0:o.metrics)==null?void 0:s.charactersByOrigin,e=Math.round(((t==null?void 0:t.typed)??1)*100),n=Math.round(((t==null?void 0:t.pasted)??0)*100),a=Math.round(((t==null?void 0:t.autocompleted)??0)*100);return[{category:"origin",segment:"Typed",value:e},{category:"origin",segment:"Pasted",value:n},{category:"origin",segment:"Autocompleted",value:a}].filter(i=>i.value>0)}function rt(r,t,e=Oe){if(r.length===0){let o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width",String(t)),o.setAttribute("height","24"),o.setAttribute("viewBox",`0 0 ${t} 24`);let s=document.createElementNS("http://www.w3.org/2000/svg","rect");return s.setAttribute("width",String(t)),s.setAttribute("height","24"),s.setAttribute("rx","4"),s.setAttribute("fill","var(--wt-color-border, #3f3f46)"),s.setAttribute("opacity","0.3"),o.appendChild(s),o}let a=[R.barX(r,R.stackX({x:"value",fill:o=>e[_e[o.segment]??"typed"],inset:.5})),R.text(r,R.stackX({x:"value",text:o=>o.value<10?"":o.value<25?`${o.value}%`:`${o.segment} ${o.value}%`,fill:"white",fontSize:11,fontWeight:500}))];return R.plot({width:t,height:32,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,x:{axis:null,domain:[0,100]},y:{axis:null},marks:a,style:{background:"transparent",fontFamily:"var(--wt-scorecard-font-data, var(--wt-font-data, ui-monospace))"}})}var tt=class extends y{render(){if(!this._data)return;let t=et(this._data);if(t.length===0){this.showEmptyState("No content origin data");return}let e=this.clientWidth||400,n=rt(t,e);n&&this.replaceChart(n)}};tt.tagName="wt-origin-bar";var nt=`:host {
53
53
  /* \u2500\u2500 Surface colors (light default) \u2500\u2500 */
54
54
  --wt-scorecard-bg: #F7F6F2;
55
55
  --wt-scorecard-bg-card: #FFFFFF;
@@ -118,7 +118,7 @@
118
118
  .wt-term:hover {
119
119
  text-decoration-color: var(--wt-scorecard-text-secondary);
120
120
  }
121
- `,bn=(()=>{try{let r=new CSSStyleSheet;return r.replaceSync(nt),r}catch{return null}})();var at=new Uint8Array(256),Rt=new Uint8Array(256);(function(){let r=1;for(let t=0;t<255;t++)at[t]=r,Rt[r]=t,r=r<<1^(r>=128?285:0);at[255]=at[0]})();function ie(r,t){return r===0||t===0?0:at[(Rt[r]+Rt[t])%255]}function Ne(r){let t=[1];for(let e=0;e<r;e++){let n=new Array(t.length+1).fill(0);for(let a=0;a<t.length;a++)n[a]^=t[a],n[a+1]^=ie(t[a],at[e]);t=n}return t}function Ie(r,t){let e=Ne(t),n=new Uint8Array(r.length+t);n.set(r);for(let a=0;a<r.length;a++){let o=n[a];if(o!==0)for(let s=0;s<e.length;s++)n[a+s]^=ie(e[s],o)}return n.slice(r.length)}var Le=[{ver:1,size:21,dc:16,ec:10,blocks:1,cap:14},{ver:2,size:25,dc:28,ec:16,blocks:1,cap:26},{ver:3,size:29,dc:44,ec:26,blocks:1,cap:42},{ver:4,size:33,dc:64,ec:18,blocks:2,cap:62},{ver:5,size:37,dc:86,ec:24,blocks:2,cap:84},{ver:6,size:41,dc:108,ec:16,blocks:4,cap:106}],Fe=[[],[6,18],[6,22],[6,26],[6,30],[6,34]];function He(r){for(let t of Le)if(r<=t.cap)return t;return null}function ze(r,t){let e=[];function n(h,f){for(let b=f-1;b>=0;b--)e.push(h>>b&1)}n(4,4),n(r.length,8);for(let h of r)n(h,8);let a=t.dc*8;for(n(0,Math.min(4,a-e.length));e.length%8!==0;)e.push(0);let o=[236,17],s=0;for(;e.length<a;)n(o[s%2],8),s++;let i=[];for(let h=0;h<e.length;h+=8){let f=0;for(let b=0;b<8;b++)f=f<<1|e[h+b];i.push(f)}let c=Math.floor(t.dc/t.blocks),l=t.dc-c*t.blocks,d=[],u=[],p=0;for(let h=0;h<t.blocks;h++){let f=c+(h>=t.blocks-l?1:0),b=new Uint8Array(i.slice(p,p+f));d.push(b),u.push(Ie(b,t.ec)),p+=f}let m=[],g=0;for(let h of d)g=Math.max(g,h.length);for(let h=0;h<g;h++)for(let f of d)h<f.length&&m.push(f[h]);for(let h=0;h<t.ec;h++)for(let f of u)m.push(f[h]);return m}function Ge(r){let t=r.size,e=[],n=[];for(let i=0;i<t;i++)e.push(new Int8Array(t)),n.push(new Uint8Array(t));function a(i,c,l){e[c][i]=l?1:-1,n[c][i]=1}function o(i,c){for(let d=-3;d<=3;d++)for(let u=-3;u<=3;u++){let p=i+u,m=c+d;p<0||p>=t||m<0||m>=t||a(p,m,Math.max(Math.abs(u),Math.abs(d))!==2)}let l=[[-4,0],[4,0],[0,-4],[0,4]];for(let d=-4;d<=4;d++)for(let u of l){let p=i+(u[0]!==0?u[0]:d),m=c+(u[1]!==0?u[1]:d);p>=0&&p<t&&m>=0&&m<t&&a(p,m,!1)}}o(3,3),o(t-4,3),o(3,t-4);for(let i=8;i<t-8;i++)a(i,6,i%2===0),a(6,i,i%2===0);let s=Fe[r.ver-1];if(s.length>0)for(let i=0;i<s.length;i++)for(let c=0;c<s.length;c++){let l=s[i],d=s[c];if(!n[l][d])for(let u=-2;u<=2;u++)for(let p=-2;p<=2;p++)a(d+p,l+u,Math.max(Math.abs(p),Math.abs(u))!==1)}a(8,4*r.ver+9,!0);for(let i=0;i<8;i++)n[8][i]||(n[8][i]=1),n[8][t-1-i]||(n[8][t-1-i]=1),n[i][8]||(n[i][8]=1),n[t-1-i][8]||(n[t-1-i][8]=1);return n[8][8]=1,{grid:e,reserved:n,n:t}}function Ve(r,t){let{grid:e,reserved:n,n:a}=r,o=[];for(let l of t)for(let d=7;d>=0;d--)o.push(l>>d&1);let s=0,i=a-1,c=!0;for(;i>=0;){if(i===6){i--;continue}let l=c?a-1:0,d=c?-1:a,u=c?-1:1;for(let p=l;p!==d;p+=u)for(let m=0;m<2;m++){let g=i-m;g<0||n[p][g]||(e[p][g]=s<o.length&&o[s]?1:-1,s++)}i-=2,c=!c}}var je=[(r,t)=>(r+t)%2===0,(r,t)=>t%2===0,(r,t)=>r%3===0,(r,t)=>(r+t)%3===0,(r,t)=>(Math.floor(t/2)+Math.floor(r/3))%2===0,(r,t)=>r*t%2+r*t%3===0,(r,t)=>(r*t%2+r*t%3)%2===0,(r,t)=>((r+t)%2+r*t%3)%2===0];function ae(r,t,e,n){let a=je[n],o=r.map(s=>Int8Array.from(s));for(let s=0;s<e;s++)for(let i=0;i<e;i++)!t[s][i]&&a(i,s)&&(o[s][i]=o[s][i]===1?-1:1);return o}var qe=[21522,20773,24188,23371,17913,16590,20375,19104];function oe(r,t,e){let n=qe[e],a=[];for(let i=14;i>=0;i--)a.push(n>>i&1);let o=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]],s=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[t-8,8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let i=0;i<15;i++){let c=a[i]?1:-1;r[o[i][1]][o[i][0]]=c,r[s[i][1]][s[i][0]]=c}}function Ye(r,t){let e=0;for(let l=0;l<t;l++){let d=1;for(let u=1;u<t;u++)r[l][u]>0==r[l][u-1]>0?d++:(d>=5&&(e+=3+(d-5)),d=1);d>=5&&(e+=3+(d-5))}for(let l=0;l<t;l++){let d=1;for(let u=1;u<t;u++)r[u][l]>0==r[u-1][l]>0?d++:(d>=5&&(e+=3+(d-5)),d=1);d>=5&&(e+=3+(d-5))}for(let l=0;l<t-1;l++)for(let d=0;d<t-1;d++){let u=r[l][d]>0;u===r[l][d+1]>0&&u===r[l+1][d]>0&&u===r[l+1][d+1]>0&&(e+=3)}let n=[1,0,1,1,1,0,1,0,0,0,0],a=[0,0,0,0,1,0,1,1,1,0,1];for(let l=0;l<t;l++)for(let d=0;d<=t-11;d++){let u=!0,p=!0;for(let m=0;m<11;m++){let g=r[l][d+m]>0;if(g!==(n[m]===1)&&(u=!1),g!==(a[m]===1)&&(p=!1),!u&&!p)break}u&&(e+=40),p&&(e+=40)}for(let l=0;l<t;l++)for(let d=0;d<=t-11;d++){let u=!0,p=!0;for(let m=0;m<11;m++){let g=r[d+m][l]>0;if(g!==(n[m]===1)&&(u=!1),g!==(a[m]===1)&&(p=!1),!u&&!p)break}u&&(e+=40),p&&(e+=40)}let o=0;for(let l=0;l<t;l++)for(let d=0;d<t;d++)r[l][d]>0&&o++;let s=o*100/(t*t),i=Math.floor(s/5)*5,c=i+5;return e+=10*Math.min(Math.abs(i-50)/5,Math.abs(c-50)/5),e}function Dt(r){let t=[];for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);l<128?t.push(l):l<2048&&(t.push(192|l>>6),t.push(128|l&63))}let e=He(t.length);if(!e)return null;let n=ze(t,e),a=Ge(e);Ve(a,n);let o=0,s=1/0;for(let c=0;c<8;c++){let l=ae(a.grid,a.reserved,a.n,c);oe(l,a.n,c);let d=Ye(l,a.n);d<s&&(s=d,o=c)}let i=ae(a.grid,a.reserved,a.n,o);return oe(i,a.n,o),{grid:i,size:a.n}}function Bt(r,t,e){let n=r.size,a=Math.max(2,Math.floor(88/n)),o=n*a,s=a/2,i=s*.82;function c(d,u){let p=Math.sin(d*31+u*17)*1e4;return .75+.25*(p-Math.floor(p))}let l="";for(let d=0;d<n;d++)for(let u=0;u<n;u++){if(r.grid[d][u]<=0)continue;if(u<7&&d<7||u>=n-7&&d<7||u<7&&d>=n-7)l+=`<rect x="${u*a}" y="${d*a}" width="${a}" height="${a}" rx="${a*.15}" fill="${t}"/>`;else{let m=i*c(u,d);l+=`<circle cx="${u*a+s}" cy="${d*a+s}" r="${m.toFixed(1)}" fill="${t}"/>`}}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${o}" width="${o}" height="${o}">${l}</svg>`}function se(r,t,e){let a=72*(r/100),o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 72" width="${r}" height="${a}">`;return o+=`<path d="M86 2 L86 64" stroke="${e}" stroke-width="5" stroke-linecap="round"/>`,o+=`<path d="M7 12 L98 12" stroke="${e}" stroke-width="5" stroke-linecap="round"/>`,o+=`<path d="M7 18 C7 32, 16 64, 30 64 C44 64, 38 28, 52 28 C66 28, 62 64, 86 64" stroke="${t}" stroke-width="5" stroke-linecap="round" fill="none"/>`,o+=`<circle cx="7" cy="12" r="7" fill="${t}"/>`,o+=`<circle cx="86" cy="64" r="7" fill="${e}"/>`,o+="</svg>",o}var Ke=`.integrity-section {
121
+ `,bn=(()=>{try{let r=new CSSStyleSheet;return r.replaceSync(nt),r}catch{return null}})();var at=new Uint8Array(256),Rt=new Uint8Array(256);(function(){let r=1;for(let t=0;t<255;t++)at[t]=r,Rt[r]=t,r=r<<1^(r>=128?285:0);at[255]=at[0]})();function ie(r,t){return r===0||t===0?0:at[(Rt[r]+Rt[t])%255]}function Ne(r){let t=[1];for(let e=0;e<r;e++){let n=new Array(t.length+1).fill(0);for(let a=0;a<t.length;a++)n[a]^=t[a],n[a+1]^=ie(t[a],at[e]);t=n}return t}function Ie(r,t){let e=Ne(t),n=new Uint8Array(r.length+t);n.set(r);for(let a=0;a<r.length;a++){let o=n[a];if(o!==0)for(let s=0;s<e.length;s++)n[a+s]^=ie(e[s],o)}return n.slice(r.length)}var Le=[{ver:1,size:21,dc:16,ec:10,blocks:1,cap:14},{ver:2,size:25,dc:28,ec:16,blocks:1,cap:26},{ver:3,size:29,dc:44,ec:26,blocks:1,cap:42},{ver:4,size:33,dc:64,ec:18,blocks:2,cap:62},{ver:5,size:37,dc:86,ec:24,blocks:2,cap:84},{ver:6,size:41,dc:108,ec:16,blocks:4,cap:106}],Fe=[[],[6,18],[6,22],[6,26],[6,30],[6,34]];function He(r){for(let t of Le)if(r<=t.cap)return t;return null}function ze(r,t){let e=[];function n(h,g){for(let b=g-1;b>=0;b--)e.push(h>>b&1)}n(4,4),n(r.length,8);for(let h of r)n(h,8);let a=t.dc*8;for(n(0,Math.min(4,a-e.length));e.length%8!==0;)e.push(0);let o=[236,17],s=0;for(;e.length<a;)n(o[s%2],8),s++;let i=[];for(let h=0;h<e.length;h+=8){let g=0;for(let b=0;b<8;b++)g=g<<1|e[h+b];i.push(g)}let c=Math.floor(t.dc/t.blocks),l=t.dc-c*t.blocks,d=[],u=[],p=0;for(let h=0;h<t.blocks;h++){let g=c+(h>=t.blocks-l?1:0),b=new Uint8Array(i.slice(p,p+g));d.push(b),u.push(Ie(b,t.ec)),p+=g}let m=[],f=0;for(let h of d)f=Math.max(f,h.length);for(let h=0;h<f;h++)for(let g of d)h<g.length&&m.push(g[h]);for(let h=0;h<t.ec;h++)for(let g of u)m.push(g[h]);return m}function Ge(r){let t=r.size,e=[],n=[];for(let i=0;i<t;i++)e.push(new Int8Array(t)),n.push(new Uint8Array(t));function a(i,c,l){e[c][i]=l?1:-1,n[c][i]=1}function o(i,c){for(let d=-3;d<=3;d++)for(let u=-3;u<=3;u++){let p=i+u,m=c+d;p<0||p>=t||m<0||m>=t||a(p,m,Math.max(Math.abs(u),Math.abs(d))!==2)}let l=[[-4,0],[4,0],[0,-4],[0,4]];for(let d=-4;d<=4;d++)for(let u of l){let p=i+(u[0]!==0?u[0]:d),m=c+(u[1]!==0?u[1]:d);p>=0&&p<t&&m>=0&&m<t&&a(p,m,!1)}}o(3,3),o(t-4,3),o(3,t-4);for(let i=8;i<t-8;i++)a(i,6,i%2===0),a(6,i,i%2===0);let s=Fe[r.ver-1];if(s.length>0)for(let i=0;i<s.length;i++)for(let c=0;c<s.length;c++){let l=s[i],d=s[c];if(!n[l][d])for(let u=-2;u<=2;u++)for(let p=-2;p<=2;p++)a(d+p,l+u,Math.max(Math.abs(p),Math.abs(u))!==1)}a(8,4*r.ver+9,!0);for(let i=0;i<8;i++)n[8][i]||(n[8][i]=1),n[8][t-1-i]||(n[8][t-1-i]=1),n[i][8]||(n[i][8]=1),n[t-1-i][8]||(n[t-1-i][8]=1);return n[8][8]=1,{grid:e,reserved:n,n:t}}function Ve(r,t){let{grid:e,reserved:n,n:a}=r,o=[];for(let l of t)for(let d=7;d>=0;d--)o.push(l>>d&1);let s=0,i=a-1,c=!0;for(;i>=0;){if(i===6){i--;continue}let l=c?a-1:0,d=c?-1:a,u=c?-1:1;for(let p=l;p!==d;p+=u)for(let m=0;m<2;m++){let f=i-m;f<0||n[p][f]||(e[p][f]=s<o.length&&o[s]?1:-1,s++)}i-=2,c=!c}}var je=[(r,t)=>(r+t)%2===0,(r,t)=>t%2===0,(r,t)=>r%3===0,(r,t)=>(r+t)%3===0,(r,t)=>(Math.floor(t/2)+Math.floor(r/3))%2===0,(r,t)=>r*t%2+r*t%3===0,(r,t)=>(r*t%2+r*t%3)%2===0,(r,t)=>((r+t)%2+r*t%3)%2===0];function ae(r,t,e,n){let a=je[n],o=r.map(s=>Int8Array.from(s));for(let s=0;s<e;s++)for(let i=0;i<e;i++)!t[s][i]&&a(i,s)&&(o[s][i]=o[s][i]===1?-1:1);return o}var qe=[21522,20773,24188,23371,17913,16590,20375,19104];function oe(r,t,e){let n=qe[e],a=[];for(let i=14;i>=0;i--)a.push(n>>i&1);let o=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]],s=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[t-8,8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let i=0;i<15;i++){let c=a[i]?1:-1;r[o[i][1]][o[i][0]]=c,r[s[i][1]][s[i][0]]=c}}function Ye(r,t){let e=0;for(let l=0;l<t;l++){let d=1;for(let u=1;u<t;u++)r[l][u]>0==r[l][u-1]>0?d++:(d>=5&&(e+=3+(d-5)),d=1);d>=5&&(e+=3+(d-5))}for(let l=0;l<t;l++){let d=1;for(let u=1;u<t;u++)r[u][l]>0==r[u-1][l]>0?d++:(d>=5&&(e+=3+(d-5)),d=1);d>=5&&(e+=3+(d-5))}for(let l=0;l<t-1;l++)for(let d=0;d<t-1;d++){let u=r[l][d]>0;u===r[l][d+1]>0&&u===r[l+1][d]>0&&u===r[l+1][d+1]>0&&(e+=3)}let n=[1,0,1,1,1,0,1,0,0,0,0],a=[0,0,0,0,1,0,1,1,1,0,1];for(let l=0;l<t;l++)for(let d=0;d<=t-11;d++){let u=!0,p=!0;for(let m=0;m<11;m++){let f=r[l][d+m]>0;if(f!==(n[m]===1)&&(u=!1),f!==(a[m]===1)&&(p=!1),!u&&!p)break}u&&(e+=40),p&&(e+=40)}for(let l=0;l<t;l++)for(let d=0;d<=t-11;d++){let u=!0,p=!0;for(let m=0;m<11;m++){let f=r[d+m][l]>0;if(f!==(n[m]===1)&&(u=!1),f!==(a[m]===1)&&(p=!1),!u&&!p)break}u&&(e+=40),p&&(e+=40)}let o=0;for(let l=0;l<t;l++)for(let d=0;d<t;d++)r[l][d]>0&&o++;let s=o*100/(t*t),i=Math.floor(s/5)*5,c=i+5;return e+=10*Math.min(Math.abs(i-50)/5,Math.abs(c-50)/5),e}function Dt(r){let t=[];for(let c=0;c<r.length;c++){let l=r.charCodeAt(c);l<128?t.push(l):l<2048&&(t.push(192|l>>6),t.push(128|l&63))}let e=He(t.length);if(!e)return null;let n=ze(t,e),a=Ge(e);Ve(a,n);let o=0,s=1/0;for(let c=0;c<8;c++){let l=ae(a.grid,a.reserved,a.n,c);oe(l,a.n,c);let d=Ye(l,a.n);d<s&&(s=d,o=c)}let i=ae(a.grid,a.reserved,a.n,o);return oe(i,a.n,o),{grid:i,size:a.n}}function Bt(r,t,e){let n=r.size,a=Math.max(2,Math.floor(88/n)),o=n*a,s=a/2,i=s*.82;function c(d,u){let p=Math.sin(d*31+u*17)*1e4;return .75+.25*(p-Math.floor(p))}let l="";for(let d=0;d<n;d++)for(let u=0;u<n;u++){if(r.grid[d][u]<=0)continue;if(u<7&&d<7||u>=n-7&&d<7||u<7&&d>=n-7)l+=`<rect x="${u*a}" y="${d*a}" width="${a}" height="${a}" rx="${a*.15}" fill="${t}"/>`;else{let m=i*c(u,d);l+=`<circle cx="${u*a+s}" cy="${d*a+s}" r="${m.toFixed(1)}" fill="${t}"/>`}}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${o}" width="${o}" height="${o}">${l}</svg>`}function se(r,t,e){let a=72*(r/100),o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 72" width="${r}" height="${a}">`;return o+=`<path d="M86 2 L86 64" stroke="${e}" stroke-width="5" stroke-linecap="round"/>`,o+=`<path d="M7 12 L98 12" stroke="${e}" stroke-width="5" stroke-linecap="round"/>`,o+=`<path d="M7 18 C7 32, 16 64, 30 64 C44 64, 38 28, 52 28 C66 28, 62 64, 86 64" stroke="${t}" stroke-width="5" stroke-linecap="round" fill="none"/>`,o+=`<circle cx="7" cy="12" r="7" fill="${t}"/>`,o+=`<circle cx="86" cy="64" r="7" fill="${e}"/>`,o+="</svg>",o}var Ke=`.integrity-section {
122
122
  margin-top: 2rem;
123
123
  padding-top: 1.5rem;
124
124
  border-top: 1px solid var(--wt-scorecard-border);
@@ -184,7 +184,7 @@
184
184
  flex: 1;
185
185
  }
186
186
  `,ot=class extends y{getStylesheet(){return nt+`
187
- `+Ke}render(){if(!this._data)return;let{integrity:t,outputSignature:e}=this._data,n=document.createElement("div");n.className="integrity-section";let a=document.createElement("div");a.className="integrity-title",a.textContent="Integrity & Verification",n.appendChild(a);let o=document.createElement("div");o.className="integrity-stats",o.textContent=`${t.eventCount} events \xB7 ${t.checkpoints.length} checkpoints`,n.appendChild(o);let s=document.createElement("div");s.className="integrity-hash-block";let i=document.createElement("span");i.className="integrity-hash-label",i.textContent="Digest (SHA-256)";let c=document.createElement("code");c.className="hash",c.textContent=t.finalDigest,s.append(i,c),n.appendChild(s);let l=document.createElement("div");l.className="integrity-hash-block";let d=document.createElement("span");d.className="integrity-hash-label",d.textContent="Output Signature";let u=document.createElement("code");u.className="hash",u.textContent=e,l.append(d,u),n.appendChild(l);let p=document.createElement("div");p.className="integrity-bottom";let m=document.createElement("div");m.className="qr-container";let g=document.createElement("p");g.className="integrity-explainer",g.textContent="This scorecard includes cryptographic integrity verification. The digest covers all input events; the signature covers the analysis output. Compare against original session data or scan for verification.",p.appendChild(m),p.appendChild(g),n.appendChild(p),this.replaceChart(n),requestAnimationFrame(()=>this.renderQr(t.finalDigest))}renderQr(t){let e=this.shadow.querySelector(".qr-container");if(!e)return;let n=Dt(t);if(!n)return;let a=getComputedStyle(this),o=a.getPropertyValue("--wt-scorecard-text").trim()||"#E4E2DA",s=a.getPropertyValue("--wt-scorecard-status-clear").trim()||"#5EAE78";e.innerHTML=Bt(n,o,s)}};ot.tagName="wt-integrity-footer";function ce(r){if(r<1e3)return"0 seconds";let t=Math.floor(r/1e3),e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),o=t%60,s=[];return e>0&&s.push(`${e} ${e===1?"day":"days"}`),n>0&&s.push(`${n} ${n===1?"hour":"hours"}`),a>0&&s.push(`${a} ${a===1?"minute":"minutes"}`),o>0&&e===0&&s.push(`${o} ${o===1?"second":"seconds"}`),s.join(" ")||"0 seconds"}function bt(r){var x,w,T,D,Y,K,ut,It,Lt,Ft,Ht,zt,Gt,Vt,jt,qt,Yt,Kt,Ut,Qt,Xt,Jt;if(!r.sufficientData){let U=r.keydownCount??0,ge=((w=(x=r.temporalPatterns)==null?void 0:x.metrics)==null?void 0:w.sessionDurationMs)??0;if(U===0)return null;let fe=ce(ge);return`This session captured ${U} keystroke${U===1?"":"s"} over ${fe}.`}let t=((Y=(D=(T=r.contentOrigin)==null?void 0:T.metrics)==null?void 0:D.charactersByOrigin)==null?void 0:Y.typed)??0,e=((It=(ut=(K=r.contentOrigin)==null?void 0:K.metrics)==null?void 0:ut.charactersByOrigin)==null?void 0:It.pasted)??0,n=((Ht=(Ft=(Lt=r.revisionBehavior)==null?void 0:Lt.metrics)==null?void 0:Ft.insertionDeletion)==null?void 0:Ht.deletionCount)??0,a=((Vt=(Gt=(zt=r.contentOrigin)==null?void 0:zt.metrics)==null?void 0:Gt.pasteEditSummary)==null?void 0:Vt.meanReworkRatio)??0,o=((qt=(jt=r.temporalPatterns)==null?void 0:jt.metrics)==null?void 0:qt.sessionDurationMs)??0,s=((Ut=(Kt=(Yt=r.temporalPatterns)==null?void 0:Yt.metrics)==null?void 0:Kt.pause2000ms)==null?void 0:Ut.count)??0,i=((Jt=(Xt=(Qt=r.sessionContinuity)==null?void 0:Qt.metrics)==null?void 0:Xt.tabAwayEvents)==null?void 0:Jt.length)??0,c=ce(o),l=(t*100).toFixed(1),d=(e*100).toFixed(1),u=t>=.8,p=e>.5,m;u?m=`This text was typed directly over ${c}.`:p?m=`${d}% of this text was pasted from an external source.`:m=`This text contains a mix of typed (${l}%) and pasted (${d}%) content.`;let g=a>0?", and edited pasted content afterward":"",h;n>0?h=`The author made ${n} ${n===1?"correction":"corrections"}${g}.`:h=`No corrections were made${g}.`;let f=i>0?` and ${i} tab-away${i===1?"":"s"}`:"",b;return s>0?b=`The session lasted ${c} with ${s} ${s===1?"pause":"pauses"} to think${f}.`:b=`The session lasted ${c} with no significant pauses${f}.`,`${m} ${h} ${b}`}function _t(r){let t=r.internalPct??0,e=r.externalPct??0,n=r.unknownPct??0,a=r.copyPct??0,o=r.cutPct??0,s=t+e+n;if(s>0&&t>s*.8)return o>a?{type:"internal-cut",label:"cut and re-pasted within the document",breakdown:null}:a>o?{type:"internal-copy",label:"copied and re-pasted within the document",breakdown:null}:{type:"internal",label:"reorganised within the document",breakdown:null};if(s>0&&e>s*.8)return{type:"external",label:"pasted from external sources",breakdown:null};let i=[];return t>0&&(o>a?i.push(`${Math.round(t)}% cut-pasted`):a>o?i.push(`${Math.round(t)}% copy-pasted`):i.push(`${Math.round(t)}% reorganised`)),e>0&&i.push(`${Math.round(e)}% external`),n>0&&i.push(`${Math.round(n)}% unclassified`),i.length>=1?{type:"mixed",label:"pasted",breakdown:i.join(", ")}:{type:"unknown",label:"pasted",breakdown:null}}var de=new Set(["WT-103","WT-104","WT-106","WT-204","WT-301","WT-302","WT-403","WT-500","WT-503","WT-505","WT-506","WT-509","WT-601","WT-602","WT-603","WT-606","WT-700","WT-701","WT-702","WT-703","WT-704"]);function me(r){return de.has(r)}function z(r){return r?de.has(r)?"pass":"flag":"unknown"}var q={contentOrigin:"Content Origin",timingAuthenticity:"Timing & Rhythm",revisionBehavior:"Revision Behavior",sessionContinuity:"Session Continuity",physicalPlausibility:"Physical Plausibility",temporalPatterns:"Temporal Patterns",writingProcess:"Writing Process"};var ue=["contentOrigin","timingAuthenticity","revisionBehavior"],pe=["sessionContinuity","physicalPlausibility","temporalPatterns","writingProcess"],Ue={"WT-100":()=>"No content was recorded during this session.","WT-101":r=>{let t=r.params.pct??0,e=100-t,n=_t(r.params);return n.type==="internal-cut"?`Nearly all content (${t}%) was cut and re-pasted within the document \u2014 the writer reorganised their own text. ${e}% of characters were typed directly.`:n.type==="internal-copy"?`Nearly all content (${t}%) was copied and re-pasted within the document \u2014 the writer duplicated and reworked their own text. ${e}% of characters were typed directly.`:n.type==="internal"?`Nearly all content (${t}%) was reorganised within the document. ${e}% of characters were typed directly.`:n.type==="external"?`Nearly all content (${t}%) was pasted from an external source. Only ${e}% of characters were typed directly.`:n.breakdown?`${t}% of content was pasted \u2014 ${n.breakdown}. ${e}% was typed directly.`:`Nearly all content (${t}%) was pasted. Only ${e}% of characters were typed directly.`},"WT-102":r=>`${r.params.pct??0}% of text was inserted via autocomplete, suggesting reliance on predictive input rather than original composition.`,"WT-103":r=>{let t=r.params.pct??0,e=100-t,n=_t(r.params);return n.type==="internal-cut"?`${t}% of text was cut and re-pasted within the document \u2014 the writer reorganised their own text. The remaining ${e}% was typed directly.`:n.type==="internal-copy"?`${t}% of text was copied and re-pasted within the document \u2014 the writer duplicated and reworked their own text. The remaining ${e}% was typed directly.`:n.type==="internal"?`${t}% of text was reorganised within the document. The remaining ${e}% was typed directly.`:n.type==="external"?`${t}% of text was pasted from external sources. The remaining ${e}% was typed directly.`:n.breakdown?`${t}% of text was pasted \u2014 ${n.breakdown}. The remaining ${e}% was typed directly.`:`${t}% of text was pasted. The remaining ${e}% was typed directly.`},"WT-104":()=>"All text was typed directly \u2014 no paste or autocomplete events were detected.","WT-105":()=>"Unmodified external content detected \u2014 pasted text was not edited after insertion, suggesting pre-composed content.","WT-106":r=>`${r.params.rework??0}% of pasted content was subsequently reworked, indicating the writer integrated external material into their own composition.`,"WT-107":r=>{let t=r.params.pasteRatio??0,e=r.params.retentionPct??0;return`High paste volume (${t}% paste ratio) with ${e}% left unmodified \u2014 content was pasted in bulk without rework.`}},Qe={"WT-105":()=>"Unmodified external content detected \u2014 pasted text was not edited after insertion, suggesting pre-composed content.","WT-106":r=>`${r.params.rework??0}% of pasted content was subsequently reworked, indicating the writer integrated external material into their own composition.`,"WT-107":r=>{let t=r.params.pasteRatio??0,e=r.params.retentionPct??0;return`High paste volume (${t}% paste ratio) with ${e}% left unmodified \u2014 content was pasted in bulk without rework.`}},Xe={"WT-200":r=>{let t=(r.params.dwellMean??0).toFixed(1),e=(r.params.flightMean??0).toFixed(1);return`Keystroke timing magnitudes (dwell ${t}ms, flight ${e}ms) fall below plausible human ranges, consistent with programmatic input injection.`},"WT-201":r=>`Keystroke timing is mechanically uniform \u2014 the coefficient of variation (${(r.params.cv??0).toFixed(2)}) falls far below the human range of 0.3\u20130.8. This pattern is consistent with automated input.`,"WT-202":r=>`A highly periodic keystroke pattern was detected (score ${(r.params.score??0).toFixed(2)}). Human typing naturally varies; metronomic regularity suggests automation.`,"WT-203":r=>`Flight times between keystrokes are suspiciously uniform (CV ${(r.params.cv??0).toFixed(2)}), lacking the natural variability expected from human finger movement.`,"WT-204":()=>"Keystroke timing variability falls within normal human ranges. The rhythm is consistent with natural typing.","WT-205":r=>{let t=(r.params.dwellCv??0).toFixed(2),e=(r.params.flightCv??0).toFixed(2);return`Metronomic keystroke timing \u2014 dwell CV ${t} and flight CV ${e} are far below human ranges, indicating machine-perfect regularity.`}},Je={"WT-500":(r,t)=>{let e=t.keydownCount;return e<50?`No corrections in a short ${e}-keystroke session. This is normal for brief input.`:`No corrections in a ${e}-keystroke session. Longer sessions typically include some corrections.`},"WT-501":()=>"No keystrokes were recorded, so revision behavior could not be analyzed.","WT-502":r=>`Very low correction rate (${(r.params.pct??0).toFixed(1)}%). While some writers are precise, this level of accuracy across an entire session is unusual.`,"WT-503":r=>`Normal correction rate (${(r.params.pct??0).toFixed(1)}%). The writer made and fixed mistakes at a rate consistent with natural composition.`,"WT-504":r=>`No corrections, navigation, or undo in a ${r.params.count??0}-keystroke session \u2014 the text was entered linearly without any revision.`,"WT-505":()=>"Non-linear editing was detected despite a low correction rate, suggesting some revision activity.","WT-506":r=>`Authentic revision depth detected (product-process ratio ${(r.params.ratio??0).toFixed(2)}). The writing process shows genuine iterative refinement.`,"WT-507":r=>{let t=r.params.count??0,e=r.params.keydowns??0;return`Sequential typing pattern: ${t} mid-document insertions in a ${e}-keystroke session. Content was entered start-to-finish without returning to edit earlier sections.`},"WT-508":r=>`Forward-edge concentration: ${Math.round((r.params.ratio??0)*100)}% of keystrokes occurred at the end of the document with almost no in-document editing, consistent with copy-typing or automation.`,"WT-509":r=>`Multi-word restructuring detected (${Math.round((r.params.ratio??0)*100)}% of chars from multi-word pastes), suggesting authentic revision where the writer rearranged their own text.`},Ze={"WT-300":r=>{let t=Math.round(r.params.timestamp??0),e=(r.params.magnitude??0).toFixed(1);return`Typing rhythm changed abruptly at ${t}s (magnitude ${e}), suggesting a possible switch in input method or author.`},"WT-301":r=>`${r.params.count??0} tab-away events detected \u2014 the writer left and returned to this field multiple times during the session.`,"WT-302":()=>"Behavior was consistent throughout the session with no abrupt changes in typing rhythm or style.","WT-303":()=>"No focus events were detected during the session. Real browsers generate focus events on interaction; absence is consistent with headless automation."},tr={"WT-400":r=>`${r.params.pct??0}% of events lack browser trust indicators (isTrusted=false), suggesting synthetic event injection.`,"WT-401":r=>{let t=r.params.count??0,e=r.params.pct??0;return`${t} keydown events had no matching keyup (${e}% of keydowns). Automation tools often omit keyup events.`},"WT-402":r=>`${r.params.count??0} keystroke sequences exceed the maximum human typing speed, indicating programmatic input.`,"WT-403":()=>"All keystroke timing is physically plausible \u2014 no evidence of synthetic or injected events.","WT-404":r=>{let t=r.params.chars??0,e=r.params.pct??0;return`${t} characters (${e}%) were inserted via untrusted programmatic events rather than direct user input.`},"WT-405":r=>{let t=r.params.count??0,e=r.params.pct??0;return`${t} events (${e}% of keydowns) have sub-millisecond dwell time. Human key press/release always takes 30\u2013150ms; zero-latency events indicate programmatic injection.`},"WT-406":()=>"All dwell times fall within a single histogram bin, indicating uniform key-hold duration. Human typing always produces variation in how long keys are held."},er={"WT-600":r=>`No speed variation over a ${r.params.minutes??0}-minute session. Human typing naturally fluctuates; constant speed suggests automation.`,"WT-601":()=>"Natural warmup and fatigue pattern detected \u2014 the writer started slow, reached peak speed, then gradually slowed.","WT-602":()=>"Significant fatigue detected toward the end of the session, consistent with sustained human cognitive effort.","WT-603":()=>"Temporal patterns fall within normal range \u2014 typing pace varied naturally over the session.","WT-604":r=>`${r.params.ratio??0}% of keystrokes occurred in machine-like bursts, suggesting automated input segments.`,"WT-605":r=>`Uniform typing pace across the session (fluency SD ${(r.params.sd??0).toFixed(1)}). Human writers show more variation as they think, pause, and revise.`,"WT-606":r=>`Frequent revision interruptions detected (R-burst median ${(r.params.median??0).toFixed(1)}s), consistent with active editing behavior.`,"WT-607":r=>`No linguistic pause structure detected (sentence/word pause ratio ${(r.params.ratio??0).toFixed(2)}). Human writers pause longer before sentences than within words.`,"WT-608":r=>`Low cognitive pause rate (${(r.params.rate??0).toFixed(1)}% of keystrokes), suggesting text was transcribed rather than composed.`},rr={"WT-700":()=>"Insufficient data for writing process analysis \u2014 the session was too short to classify phases.","WT-701":r=>`${r.params.pct??0}% of the session was spent in a planning phase \u2014 pausing and thinking before typing. This is a strong human signal.`,"WT-702":r=>`${r.params.pct??0}% of the session was spent in continuous drafting with minimal planning or revision, consistent with transcription or copy-typing.`,"WT-703":r=>`${r.params.pct??0}% of the session was spent revising earlier text. Frequent returns to edit are a strong human signal.`,"WT-704":r=>{let t=r.params.planning??0,e=r.params.drafting??0,n=r.params.revision??0;return`Balanced writing process \u2014 ${t}% planning, ${e}% drafting, ${n}% revision. This distribution is typical of genuine composition.`}},nr={contentOrigin:Ue,timingAuthenticity:Xe,revisionBehavior:Je,sessionContinuity:Ze,physicalPlausibility:tr,temporalPatterns:er,writingProcess:rr};function it(r,t){let e=t[r];if(!(e!=null&&e.indicator))return"Analysis data not available.";let n=nr[r];if(!n)return le(e.indicator);if(r==="contentOrigin"&&e.pasteReworkIndicator){let o=e.pasteReworkIndicator.code,s=Qe[o];if(s)return s(e.pasteReworkIndicator,t)}let a=n[e.indicator.code];return a?a(e.indicator,t):le(e.indicator)}function le(r){return`Indicator ${r.code} detected.`}var ar={contentOrigin:"Shows the mix of typed, pasted, and autocompleted content. Most writing sessions include some paste events \u2014 the balance and context matter more than presence alone.",timingAuthenticity:"A human heatmap shows scattered clusters reflecting natural variation in finger movement. Tight single-point concentration indicates programmatic keystroke injection.",revisionBehavior:"Human writers produce clusters of corrections as they re-read and revise. Absence of corrections suggests transcription rather than composition.",sessionContinuity:"Steady growth with small plateaus (thinking pauses) is typical. A sudden vertical jump indicates bulk content insertion.",physicalPlausibility:"Human editing jumps around the document \u2014 revising earlier sections, appending new text. Strictly sequential cursor movement suggests automated input.",temporalPatterns:"Human typing shows varied pause durations \u2014 short pauses within words, longer pauses between sentences. Uniform pause lengths suggest automated pacing.",writingProcess:"Shows the session divided into planning, drafting, and revision phases. Balanced phase distribution is typical of genuine composition; near-100% drafting suggests transcription."};function vt(r){return ar[r]??null}function st(r,t){return({contentOrigin:or,timingAuthenticity:ir,revisionBehavior:sr,sessionContinuity:cr,physicalPlausibility:lr,temporalPatterns:dr,writingProcess:mr}[r]??(()=>[]))(t)}function or(r){let t=r.contentOrigin.metrics,e=Math.round(t.charactersByOrigin.pasted*100),n=Math.round(t.charactersByOrigin.typed*100),a=t.pasteEvents.length,o=t.pasteEvents.reduce((s,i)=>s+i.characterCount,0);return[{label:"pasted",value:`${e}%`,flagged:e>50},{label:"typed",value:`${n}%`,flagged:!1},{label:"paste events",value:String(a),flagged:!1},{label:"chars pasted",value:ur(o),flagged:!1}]}function ir(r){let t=r.timingAuthenticity.metrics,e=t.flightTimeDistribution.cv,n=t.dwellTimeDistribution.mean;return[{label:"timing cv",value:e.toFixed(2),flagged:e<.2},{label:"mean dwell",value:`${Math.round(n)}ms`,flagged:n<20},{label:"periodicity",value:t.periodicityScore.toFixed(2),flagged:t.periodicityScore>.5},{label:"entropy",value:t.entropy.toFixed(1),flagged:t.entropy<1.5}]}function sr(r){let t=r.revisionBehavior.metrics;return[{label:"corrections",value:String(t.correctionCount),flagged:t.correctionCount===0&&r.keydownCount>=50},{label:"navigation",value:String(t.navigationCount),flagged:t.navigationCount===0&&r.keydownCount>=50},{label:"undo / redo",value:String(t.undoRedoCount),flagged:!1},{label:"product-process",value:t.productProcessRatio.toFixed(2),flagged:t.productProcessRatio===0}]}function cr(r){let t=r.sessionContinuity.metrics;return[{label:"change points",value:String(t.changePoints.length),flagged:t.changePoints.length>2},{label:"tab-away events",value:String(t.tabAwayEvents.length),flagged:!1}]}function lr(r){let t=r.physicalPlausibility.metrics;return[{label:"synthetic ratio",value:`${Math.round(t.syntheticEventRatio*100)}%`,flagged:t.syntheticEventRatio>.05},{label:"impossible seq.",value:String(t.impossibleSequences.count),flagged:t.impossibleSequences.count>0},{label:"unmatched keydowns",value:String(t.unmatchedKeydownCount),flagged:t.unmatchedKeydownCount>5},{label:"zero-latency",value:String(t.zeroLatencyEventCount),flagged:t.zeroLatencyEventCount>0},{label:"Bulk Insert",value:String(t.bulkInsertCharCount),flagged:!1}]}function dr(r){let t=r.temporalPatterns.metrics;return[{label:"duration",value:Ot(t.sessionDurationMs),flagged:!1},{label:"warmup ratio",value:t.warmupRatio.toFixed(2),flagged:!1},{label:"fatigue ratio",value:t.fatigueRatio.toFixed(2),flagged:!1},{label:"burst ratio",value:t.burstPattern.burstToTotalRatio.toFixed(2),flagged:t.burstPattern.burstToTotalRatio>.7}]}function mr(r){let t=r.writingProcess.metrics,e=Math.round(t.timeInPhase.planning*100),n=Math.round(t.timeInPhase.drafting*100),a=Math.round(t.timeInPhase.revision*100);return[{label:"planning",value:`${e}%`,flagged:!1},{label:"drafting",value:`${n}%`,flagged:n>85},{label:"revision",value:`${a}%`,flagged:!1},{label:"phase changes",value:String(t.phaseChangeCount),flagged:t.phaseChangeCount===0&&r.keydownCount>=200}]}function ur(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function Ot(r){let t=Math.round(r/1e3);if(t<60)return`${t}s`;let e=Math.floor(t/60),n=t%60;return n===0?`${e}m`:`${e}m ${n}s`}var Nt={"coefficient of variation":{definition:"Standard deviation divided by the mean \u2014 measures how spread out values are relative to their average. Low CV means uniform timing.",docsPath:"/docs/analysis/timing/"},"dwell time":{definition:"How long a key is held down before being released.",docsPath:"/docs/analysis/timing/"},"flight time":{definition:"The gap between releasing one key and pressing the next.",docsPath:"/docs/analysis/timing/"},"product-process ratio":{definition:"The ratio of final text length to total characters typed. Low values suggest heavy revision; near 1.0 suggests linear transcription.",docsPath:"/docs/analysis/revision/"},periodicity:{definition:"How rhythmically regular the typing pattern is. High periodicity suggests metronomic (automated) input."},entropy:{definition:"A measure of randomness in timing. Low entropy means predictable, uniform intervals."},burst:{definition:"A rapid sequence of keystrokes between pauses. Human typing naturally occurs in bursts."},"synthetic event":{definition:"A keyboard event generated programmatically rather than by a real keypress. Browsers mark these with isTrusted=false."},"change point":{definition:"A moment where typing rhythm shifts abruptly, potentially indicating a switch in input method."}};function ct(r,t){let e=k(r);for(let[n,a]of Object.entries(Nt)){let o=new RegExp(`\\b(${pr(n)})\\b`,"gi");e=e.replace(o,s=>{let i=`title="${k(a.definition)}" class="wt-term"`,c=k(s);if(a.docsPath){let l=(t??"https://writetrack.dev")+a.docsPath;return`<a href="${k(l)}" target="_blank" rel="noopener"><abbr ${i}>${c}</abbr></a>`}return`<abbr ${i}>${c}</abbr>`})}return e}function pr(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var hr=10;function dt(r){var p,m,g,h,f,b,x,w,T,D,Y,K;let t=r.finalTextLength??0,e=r.keydownCount??0,o=e>=hr&&t>0?Math.round(e/t*100)/100:null,s=((m=(p=r.contentOrigin)==null?void 0:p.metrics)==null?void 0:m.pasteEvents)??[],i=s.length>0&&t>0?Math.round(Math.max(...s.map(ut=>ut.characterCount))/t*100):null,c=((f=(h=(g=r.revisionBehavior)==null?void 0:g.metrics)==null?void 0:h.insertionDeletion)==null?void 0:f.deletionCount)??0,l=((x=(b=r.revisionBehavior)==null?void 0:b.metrics)==null?void 0:x.revisionAtFrontierRatio)??0,d=((T=(w=r.revisionBehavior)==null?void 0:w.metrics)==null?void 0:T.revisionAtPriorRatio)??0,u=((K=(Y=(D=r.sessionContinuity)==null?void 0:D.metrics)==null?void 0:Y.tabAwayEvents)==null?void 0:K.length)??0;return[{label:"Effort Ratio",value:o!==null?`${o.toFixed(2)}\xD7`:"--",status:o===null?"neutral":o<1?"flag":"clear",metric:"effort-ratio"},{label:"Largest Paste",value:i!==null?`${i}%`:"--",status:"neutral",metric:"largest-paste"},{label:"Corrections",value:c>0?`${Math.round(l*100)}% typo / ${Math.round(d*100)}% revision`:"--",status:"neutral",metric:"corrections"},{label:"Tab-Aways",value:String(u),status:"neutral",metric:"tab-aways"}]}var gr=new Set(["effort-ratio","largest-paste","corrections","tab-aways"]),fr=`
187
+ `+Ke}render(){if(!this._data)return;let{integrity:t,outputSignature:e}=this._data,n=document.createElement("div");n.className="integrity-section";let a=document.createElement("div");a.className="integrity-title",a.textContent="Integrity & Verification",n.appendChild(a);let o=document.createElement("div");o.className="integrity-stats",o.textContent=`${t.eventCount} events \xB7 ${t.checkpoints.length} checkpoints`,n.appendChild(o);let s=document.createElement("div");s.className="integrity-hash-block";let i=document.createElement("span");i.className="integrity-hash-label",i.textContent="Digest (SHA-256)";let c=document.createElement("code");c.className="hash",c.textContent=t.finalDigest,s.append(i,c),n.appendChild(s);let l=document.createElement("div");l.className="integrity-hash-block";let d=document.createElement("span");d.className="integrity-hash-label",d.textContent="Output Signature";let u=document.createElement("code");u.className="hash",u.textContent=e,l.append(d,u),n.appendChild(l);let p=document.createElement("div");p.className="integrity-bottom";let m=document.createElement("div");m.className="qr-container";let f=document.createElement("p");f.className="integrity-explainer",f.textContent="This scorecard includes cryptographic integrity verification. The digest covers all input events; the signature covers the analysis output. Compare against original session data or scan for verification.",p.appendChild(m),p.appendChild(f),n.appendChild(p),this.replaceChart(n),requestAnimationFrame(()=>this.renderQr(t.finalDigest))}renderQr(t){let e=this.shadow.querySelector(".qr-container");if(!e)return;let n=Dt(t);if(!n)return;let a=getComputedStyle(this),o=a.getPropertyValue("--wt-scorecard-text").trim()||"#E4E2DA",s=a.getPropertyValue("--wt-scorecard-status-clear").trim()||"#5EAE78";e.innerHTML=Bt(n,o,s)}};ot.tagName="wt-integrity-footer";function ce(r){if(r<1e3)return"0 seconds";let t=Math.floor(r/1e3),e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),o=t%60,s=[];return e>0&&s.push(`${e} ${e===1?"day":"days"}`),n>0&&s.push(`${n} ${n===1?"hour":"hours"}`),a>0&&s.push(`${a} ${a===1?"minute":"minutes"}`),o>0&&e===0&&s.push(`${o} ${o===1?"second":"seconds"}`),s.join(" ")||"0 seconds"}function bt(r){var x,w,T,D,Y,K,ut,It,Lt,Ft,Ht,zt,Gt,Vt,jt,qt,Yt,Kt,Ut,Qt,Xt,Jt;if(!r.sufficientData){let U=r.keydownCount??0,fe=((w=(x=r.temporalPatterns)==null?void 0:x.metrics)==null?void 0:w.sessionDurationMs)??0;if(U===0)return null;let ge=ce(fe);return`This session captured ${U} keystroke${U===1?"":"s"} over ${ge}.`}let t=((Y=(D=(T=r.contentOrigin)==null?void 0:T.metrics)==null?void 0:D.charactersByOrigin)==null?void 0:Y.typed)??0,e=((It=(ut=(K=r.contentOrigin)==null?void 0:K.metrics)==null?void 0:ut.charactersByOrigin)==null?void 0:It.pasted)??0,n=((Ht=(Ft=(Lt=r.revisionBehavior)==null?void 0:Lt.metrics)==null?void 0:Ft.insertionDeletion)==null?void 0:Ht.deletionCount)??0,a=((Vt=(Gt=(zt=r.contentOrigin)==null?void 0:zt.metrics)==null?void 0:Gt.pasteEditSummary)==null?void 0:Vt.meanReworkRatio)??0,o=((qt=(jt=r.temporalPatterns)==null?void 0:jt.metrics)==null?void 0:qt.sessionDurationMs)??0,s=((Ut=(Kt=(Yt=r.temporalPatterns)==null?void 0:Yt.metrics)==null?void 0:Kt.pause2000ms)==null?void 0:Ut.count)??0,i=((Jt=(Xt=(Qt=r.sessionContinuity)==null?void 0:Qt.metrics)==null?void 0:Xt.tabAwayEvents)==null?void 0:Jt.length)??0,c=ce(o),l=(t*100).toFixed(1),d=(e*100).toFixed(1),u=t>=.8,p=e>.5,m;u?m=`This text was typed directly over ${c}.`:p?m=`${d}% of this text was pasted from an external source.`:m=`This text contains a mix of typed (${l}%) and pasted (${d}%) content.`;let f=a>0?", and edited pasted content afterward":"",h;n>0?h=`The author made ${n} ${n===1?"correction":"corrections"}${f}.`:h=`No corrections were made${f}.`;let g=i>0?` and ${i} tab-away${i===1?"":"s"}`:"",b;return s>0?b=`The session lasted ${c} with ${s} ${s===1?"pause":"pauses"} to think${g}.`:b=`The session lasted ${c} with no significant pauses${g}.`,`${m} ${h} ${b}`}function _t(r){let t=r.internalPct??0,e=r.externalPct??0,n=r.unknownPct??0,a=r.copyPct??0,o=r.cutPct??0,s=t+e+n;if(s>0&&t>s*.8)return o>a?{type:"internal-cut",label:"cut and re-pasted within the document",breakdown:null}:a>o?{type:"internal-copy",label:"copied and re-pasted within the document",breakdown:null}:{type:"internal",label:"reorganised within the document",breakdown:null};if(s>0&&e>s*.8)return{type:"external",label:"pasted from external sources",breakdown:null};let i=[];return t>0&&(o>a?i.push(`${Math.round(t)}% cut-pasted`):a>o?i.push(`${Math.round(t)}% copy-pasted`):i.push(`${Math.round(t)}% reorganised`)),e>0&&i.push(`${Math.round(e)}% external`),n>0&&i.push(`${Math.round(n)}% unclassified`),i.length>=1?{type:"mixed",label:"pasted",breakdown:i.join(", ")}:{type:"unknown",label:"pasted",breakdown:null}}var de=new Set(["WT-103","WT-104","WT-106","WT-204","WT-301","WT-302","WT-403","WT-500","WT-503","WT-505","WT-506","WT-509","WT-601","WT-602","WT-603","WT-606","WT-700","WT-701","WT-702","WT-703","WT-704"]);function me(r){return de.has(r)}function z(r){return r?de.has(r)?"pass":"flag":"unknown"}var q={contentOrigin:"Content Origin",timingAuthenticity:"Timing & Rhythm",revisionBehavior:"Revision Behavior",sessionContinuity:"Session Continuity",physicalPlausibility:"Physical Plausibility",temporalPatterns:"Temporal Patterns",writingProcess:"Writing Process"};var ue=["contentOrigin","timingAuthenticity","revisionBehavior"],pe=["sessionContinuity","physicalPlausibility","temporalPatterns","writingProcess"],Ue={"WT-100":()=>"No content was recorded during this session.","WT-101":r=>{let t=r.params.pct??0,e=100-t,n=_t(r.params);return n.type==="internal-cut"?`Nearly all content (${t}%) was cut and re-pasted within the document \u2014 the writer reorganised their own text. ${e}% of characters were typed directly.`:n.type==="internal-copy"?`Nearly all content (${t}%) was copied and re-pasted within the document \u2014 the writer duplicated and reworked their own text. ${e}% of characters were typed directly.`:n.type==="internal"?`Nearly all content (${t}%) was reorganised within the document. ${e}% of characters were typed directly.`:n.type==="external"?`Nearly all content (${t}%) was pasted from an external source. Only ${e}% of characters were typed directly.`:n.breakdown?`${t}% of content was pasted \u2014 ${n.breakdown}. ${e}% was typed directly.`:`Nearly all content (${t}%) was pasted. Only ${e}% of characters were typed directly.`},"WT-102":r=>`${r.params.pct??0}% of text was inserted via autocomplete, suggesting reliance on predictive input rather than original composition.`,"WT-103":r=>{let t=r.params.pct??0,e=100-t,n=_t(r.params);return n.type==="internal-cut"?`${t}% of text was cut and re-pasted within the document \u2014 the writer reorganised their own text. The remaining ${e}% was typed directly.`:n.type==="internal-copy"?`${t}% of text was copied and re-pasted within the document \u2014 the writer duplicated and reworked their own text. The remaining ${e}% was typed directly.`:n.type==="internal"?`${t}% of text was reorganised within the document. The remaining ${e}% was typed directly.`:n.type==="external"?`${t}% of text was pasted from external sources. The remaining ${e}% was typed directly.`:n.breakdown?`${t}% of text was pasted \u2014 ${n.breakdown}. The remaining ${e}% was typed directly.`:`${t}% of text was pasted. The remaining ${e}% was typed directly.`},"WT-104":()=>"All text was typed directly \u2014 no paste or autocomplete events were detected.","WT-105":()=>"Unmodified external content detected \u2014 pasted text was not edited after insertion, suggesting pre-composed content.","WT-106":r=>`${r.params.rework??0}% of pasted content was subsequently reworked, indicating the writer integrated external material into their own composition.`,"WT-107":r=>{let t=r.params.pasteRatio??0,e=r.params.retentionPct??0;return`High paste volume (${t}% paste ratio) with ${e}% left unmodified \u2014 content was pasted in bulk without rework.`}},Qe={"WT-105":()=>"Unmodified external content detected \u2014 pasted text was not edited after insertion, suggesting pre-composed content.","WT-106":r=>`${r.params.rework??0}% of pasted content was subsequently reworked, indicating the writer integrated external material into their own composition.`,"WT-107":r=>{let t=r.params.pasteRatio??0,e=r.params.retentionPct??0;return`High paste volume (${t}% paste ratio) with ${e}% left unmodified \u2014 content was pasted in bulk without rework.`}},Xe={"WT-200":r=>{let t=(r.params.dwellMean??0).toFixed(1),e=(r.params.flightMean??0).toFixed(1);return`Keystroke timing magnitudes (dwell ${t}ms, flight ${e}ms) fall below plausible human ranges, consistent with programmatic input injection.`},"WT-201":r=>`Keystroke timing is mechanically uniform \u2014 the coefficient of variation (${(r.params.cv??0).toFixed(2)}) falls far below the human range of 0.3\u20130.8. This pattern is consistent with automated input.`,"WT-202":r=>`A highly periodic keystroke pattern was detected (score ${(r.params.score??0).toFixed(2)}). Human typing naturally varies; metronomic regularity suggests automation.`,"WT-203":r=>`Flight times between keystrokes are suspiciously uniform (CV ${(r.params.cv??0).toFixed(2)}), lacking the natural variability expected from human finger movement.`,"WT-204":()=>"Keystroke timing variability falls within normal human ranges. The rhythm is consistent with natural typing.","WT-205":r=>{let t=(r.params.dwellCv??0).toFixed(2),e=(r.params.flightCv??0).toFixed(2);return`Metronomic keystroke timing \u2014 dwell CV ${t} and flight CV ${e} are far below human ranges, indicating machine-perfect regularity.`}},Je={"WT-500":(r,t)=>{let e=t.keydownCount;return e<50?`No corrections in a short ${e}-keystroke session. This is normal for brief input.`:`No corrections in a ${e}-keystroke session. Longer sessions typically include some corrections.`},"WT-501":()=>"No keystrokes were recorded, so revision behavior could not be analyzed.","WT-502":r=>`Very low correction rate (${(r.params.pct??0).toFixed(1)}%). While some writers are precise, this level of accuracy across an entire session is unusual.`,"WT-503":r=>`Normal correction rate (${(r.params.pct??0).toFixed(1)}%). The writer made and fixed mistakes at a rate consistent with natural composition.`,"WT-504":r=>`No corrections, navigation, or undo in a ${r.params.count??0}-keystroke session \u2014 the text was entered linearly without any revision.`,"WT-505":()=>"Non-linear editing was detected despite a low correction rate, suggesting some revision activity.","WT-506":r=>`Authentic revision depth detected (product-process ratio ${(r.params.ratio??0).toFixed(2)}). The writing process shows genuine iterative refinement.`,"WT-507":r=>{let t=r.params.count??0,e=r.params.keydowns??0;return`Sequential typing pattern: ${t} mid-document insertions in a ${e}-keystroke session. Content was entered start-to-finish without returning to edit earlier sections.`},"WT-508":r=>`Forward-edge concentration: ${Math.round((r.params.ratio??0)*100)}% of keystrokes occurred at the end of the document with almost no in-document editing, consistent with copy-typing or automation.`,"WT-509":r=>`Multi-word restructuring detected (${Math.round((r.params.ratio??0)*100)}% of chars from multi-word pastes), suggesting authentic revision where the writer rearranged their own text.`},Ze={"WT-300":r=>{let t=Math.round(r.params.timestamp??0),e=(r.params.magnitude??0).toFixed(1);return`Typing rhythm changed abruptly at ${t}s (magnitude ${e}), suggesting a possible switch in input method or author.`},"WT-301":r=>`${r.params.count??0} tab-away events detected \u2014 the writer left and returned to this field multiple times during the session.`,"WT-302":()=>"Behavior was consistent throughout the session with no abrupt changes in typing rhythm or style.","WT-303":()=>"No focus events were detected during the session. Real browsers generate focus events on interaction; absence is consistent with headless automation."},tr={"WT-400":r=>`${r.params.pct??0}% of events lack browser trust indicators (isTrusted=false), suggesting synthetic event injection.`,"WT-401":r=>{let t=r.params.count??0,e=r.params.pct??0;return`${t} keydown events had no matching keyup (${e}% of keydowns). Automation tools often omit keyup events.`},"WT-402":r=>`${r.params.count??0} keystroke sequences exceed the maximum human typing speed, indicating programmatic input.`,"WT-403":()=>"All keystroke timing is physically plausible \u2014 no evidence of synthetic or injected events.","WT-404":r=>{let t=r.params.chars??0,e=r.params.pct??0;return`${t} characters (${e}%) were inserted via untrusted programmatic events rather than direct user input.`},"WT-405":r=>{let t=r.params.count??0,e=r.params.pct??0;return`${t} events (${e}% of keydowns) have sub-millisecond dwell time. Human key press/release always takes 30\u2013150ms; zero-latency events indicate programmatic injection.`},"WT-406":()=>"All dwell times fall within a single histogram bin, indicating uniform key-hold duration. Human typing always produces variation in how long keys are held."},er={"WT-600":r=>`No speed variation over a ${r.params.minutes??0}-minute session. Human typing naturally fluctuates; constant speed suggests automation.`,"WT-601":()=>"Natural warmup and fatigue pattern detected \u2014 the writer started slow, reached peak speed, then gradually slowed.","WT-602":()=>"Significant fatigue detected toward the end of the session, consistent with sustained human cognitive effort.","WT-603":()=>"Temporal patterns fall within normal range \u2014 typing pace varied naturally over the session.","WT-604":r=>`${r.params.ratio??0}% of keystrokes occurred in machine-like bursts, suggesting automated input segments.`,"WT-605":r=>`Uniform typing pace across the session (fluency SD ${(r.params.sd??0).toFixed(1)}). Human writers show more variation as they think, pause, and revise.`,"WT-606":r=>`Frequent revision interruptions detected (R-burst median ${(r.params.median??0).toFixed(1)}s), consistent with active editing behavior.`,"WT-607":r=>`No linguistic pause structure detected (sentence/word pause ratio ${(r.params.ratio??0).toFixed(2)}). Human writers pause longer before sentences than within words.`,"WT-608":r=>`Low cognitive pause rate (${(r.params.rate??0).toFixed(1)}% of keystrokes), suggesting text was transcribed rather than composed.`},rr={"WT-700":()=>"Insufficient data for writing process analysis \u2014 the session was too short to classify phases.","WT-701":r=>`${r.params.pct??0}% of the session was spent in a planning phase \u2014 pausing and thinking before typing. This is a strong human signal.`,"WT-702":r=>`${r.params.pct??0}% of the session was spent in continuous drafting with minimal planning or revision, consistent with transcription or copy-typing.`,"WT-703":r=>`${r.params.pct??0}% of the session was spent revising earlier text. Frequent returns to edit are a strong human signal.`,"WT-704":r=>{let t=r.params.planning??0,e=r.params.drafting??0,n=r.params.revision??0;return`Balanced writing process \u2014 ${t}% planning, ${e}% drafting, ${n}% revision. This distribution is typical of genuine composition.`}},nr={contentOrigin:Ue,timingAuthenticity:Xe,revisionBehavior:Je,sessionContinuity:Ze,physicalPlausibility:tr,temporalPatterns:er,writingProcess:rr};function it(r,t){let e=t[r];if(!(e!=null&&e.indicator))return"Analysis data not available.";let n=nr[r];if(!n)return le(e.indicator);if(r==="contentOrigin"&&e.pasteReworkIndicator){let o=e.pasteReworkIndicator.code,s=Qe[o];if(s)return s(e.pasteReworkIndicator,t)}let a=n[e.indicator.code];return a?a(e.indicator,t):le(e.indicator)}function le(r){return`Indicator ${r.code} detected.`}var ar={contentOrigin:"Shows the mix of typed, pasted, and autocompleted content. Most writing sessions include some paste events \u2014 the balance and context matter more than presence alone.",timingAuthenticity:"A human heatmap shows scattered clusters reflecting natural variation in finger movement. Tight single-point concentration indicates programmatic keystroke injection.",revisionBehavior:"Human writers produce clusters of corrections as they re-read and revise. Absence of corrections suggests transcription rather than composition.",sessionContinuity:"Steady growth with small plateaus (thinking pauses) is typical. A sudden vertical jump indicates bulk content insertion.",physicalPlausibility:"Human editing jumps around the document \u2014 revising earlier sections, appending new text. Strictly sequential cursor movement suggests automated input.",temporalPatterns:"Human typing shows varied pause durations \u2014 short pauses within words, longer pauses between sentences. Uniform pause lengths suggest automated pacing.",writingProcess:"Shows the session divided into planning, drafting, and revision phases. Balanced phase distribution is typical of genuine composition; near-100% drafting suggests transcription."};function vt(r){return ar[r]??null}function st(r,t){return({contentOrigin:or,timingAuthenticity:ir,revisionBehavior:sr,sessionContinuity:cr,physicalPlausibility:lr,temporalPatterns:dr,writingProcess:mr}[r]??(()=>[]))(t)}function or(r){let t=r.contentOrigin.metrics,e=Math.round(t.charactersByOrigin.pasted*100),n=Math.round(t.charactersByOrigin.typed*100),a=t.pasteEvents.length,o=t.pasteEvents.reduce((s,i)=>s+i.characterCount,0);return[{label:"pasted",value:`${e}%`,flagged:e>50},{label:"typed",value:`${n}%`,flagged:!1},{label:"paste events",value:String(a),flagged:!1},{label:"chars pasted",value:ur(o),flagged:!1}]}function ir(r){let t=r.timingAuthenticity.metrics,e=t.flightTimeDistribution.cv,n=t.dwellTimeDistribution.mean;return[{label:"timing cv",value:e.toFixed(2),flagged:e<.2},{label:"mean dwell",value:`${Math.round(n)}ms`,flagged:n<20},{label:"periodicity",value:t.periodicityScore.toFixed(2),flagged:t.periodicityScore>.5},{label:"entropy",value:t.entropy.toFixed(1),flagged:t.entropy<1.5}]}function sr(r){let t=r.revisionBehavior.metrics;return[{label:"corrections",value:String(t.correctionCount),flagged:t.correctionCount===0&&r.keydownCount>=50},{label:"navigation",value:String(t.navigationCount),flagged:t.navigationCount===0&&r.keydownCount>=50},{label:"undo / redo",value:String(t.undoRedoCount),flagged:!1},{label:"product-process",value:t.productProcessRatio.toFixed(2),flagged:t.productProcessRatio===0}]}function cr(r){let t=r.sessionContinuity.metrics;return[{label:"change points",value:String(t.changePoints.length),flagged:t.changePoints.length>2},{label:"tab-away events",value:String(t.tabAwayEvents.length),flagged:!1}]}function lr(r){let t=r.physicalPlausibility.metrics;return[{label:"synthetic ratio",value:`${Math.round(t.syntheticEventRatio*100)}%`,flagged:t.syntheticEventRatio>.05},{label:"impossible seq.",value:String(t.impossibleSequences.count),flagged:t.impossibleSequences.count>0},{label:"unmatched keydowns",value:String(t.unmatchedKeydownCount),flagged:t.unmatchedKeydownCount>5},{label:"zero-latency",value:String(t.zeroLatencyEventCount),flagged:t.zeroLatencyEventCount>0},{label:"Bulk Insert",value:String(t.bulkInsertCharCount),flagged:!1}]}function dr(r){let t=r.temporalPatterns.metrics;return[{label:"duration",value:Ot(t.sessionDurationMs),flagged:!1},{label:"warmup ratio",value:t.warmupRatio.toFixed(2),flagged:!1},{label:"fatigue ratio",value:t.fatigueRatio.toFixed(2),flagged:!1},{label:"burst ratio",value:t.burstPattern.burstToTotalRatio.toFixed(2),flagged:t.burstPattern.burstToTotalRatio>.7}]}function mr(r){let t=r.writingProcess.metrics,e=Math.round(t.timeInPhase.planning*100),n=Math.round(t.timeInPhase.drafting*100),a=Math.round(t.timeInPhase.revision*100);return[{label:"planning",value:`${e}%`,flagged:!1},{label:"drafting",value:`${n}%`,flagged:n>85},{label:"revision",value:`${a}%`,flagged:!1},{label:"phase changes",value:String(t.phaseChangeCount),flagged:t.phaseChangeCount===0&&r.keydownCount>=200}]}function ur(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function Ot(r){let t=Math.round(r/1e3);if(t<60)return`${t}s`;let e=Math.floor(t/60),n=t%60;return n===0?`${e}m`:`${e}m ${n}s`}var Nt={"coefficient of variation":{definition:"Standard deviation divided by the mean \u2014 measures how spread out values are relative to their average. Low CV means uniform timing.",docsPath:"/docs/analysis/timing/"},"dwell time":{definition:"How long a key is held down before being released.",docsPath:"/docs/analysis/timing/"},"flight time":{definition:"The gap between releasing one key and pressing the next.",docsPath:"/docs/analysis/timing/"},"product-process ratio":{definition:"The ratio of final text length to total characters typed. Low values suggest heavy revision; near 1.0 suggests linear transcription.",docsPath:"/docs/analysis/revision/"},periodicity:{definition:"How rhythmically regular the typing pattern is. High periodicity suggests metronomic (automated) input."},entropy:{definition:"A measure of randomness in timing. Low entropy means predictable, uniform intervals."},burst:{definition:"A rapid sequence of keystrokes between pauses. Human typing naturally occurs in bursts."},"synthetic event":{definition:"A keyboard event generated programmatically rather than by a real keypress. Browsers mark these with isTrusted=false."},"change point":{definition:"A moment where typing rhythm shifts abruptly, potentially indicating a switch in input method."}};function ct(r,t){let e=k(r);for(let[n,a]of Object.entries(Nt)){let o=new RegExp(`\\b(${pr(n)})\\b`,"gi");e=e.replace(o,s=>{let i=`title="${k(a.definition)}" class="wt-term"`,c=k(s);if(a.docsPath){let l=(t??"https://writetrack.dev")+a.docsPath;return`<a href="${k(l)}" target="_blank" rel="noopener"><abbr ${i}>${c}</abbr></a>`}return`<abbr ${i}>${c}</abbr>`})}return e}function pr(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var hr=10;function dt(r){var p,m,f,h,g,b,x,w,T,D,Y,K;let t=r.finalTextLength??0,e=r.keydownCount??0,o=e>=hr&&t>0?Math.round(e/t*100)/100:null,s=((m=(p=r.contentOrigin)==null?void 0:p.metrics)==null?void 0:m.pasteEvents)??[],i=s.length>0&&t>0?Math.round(Math.max(...s.map(ut=>ut.characterCount))/t*100):null,c=((g=(h=(f=r.revisionBehavior)==null?void 0:f.metrics)==null?void 0:h.insertionDeletion)==null?void 0:g.deletionCount)??0,l=((x=(b=r.revisionBehavior)==null?void 0:b.metrics)==null?void 0:x.revisionAtFrontierRatio)??0,d=((T=(w=r.revisionBehavior)==null?void 0:w.metrics)==null?void 0:T.revisionAtPriorRatio)??0,u=((K=(Y=(D=r.sessionContinuity)==null?void 0:D.metrics)==null?void 0:Y.tabAwayEvents)==null?void 0:K.length)??0;return[{label:"Effort Ratio",value:o!==null?`${o.toFixed(2)}\xD7`:"--",status:o===null?"neutral":o<1?"flag":"clear",metric:"effort-ratio"},{label:"Largest Paste",value:i!==null?`${i}%`:"--",status:"neutral",metric:"largest-paste"},{label:"Corrections",value:c>0?`${Math.round(l*100)}% typo / ${Math.round(d*100)}% revision`:"--",status:"neutral",metric:"corrections"},{label:"Tab-Aways",value:String(u),status:"neutral",metric:"tab-aways"}]}var fr=new Set(["effort-ratio","largest-paste","corrections","tab-aways"]),gr=`
188
188
  .wt-badge {
189
189
  display: inline-flex;
190
190
  flex-direction: column;
@@ -216,7 +216,7 @@
216
216
  color: var(--wt-color-flag, #B8412D);
217
217
  }
218
218
  `;function xt(r){let t=document.createElement("div");t.className="stat-badges";for(let e of r){let n=document.createElement("span");n.className="stat-badge";let a=document.createElement("span");a.className="stat-badge-label",a.textContent=e.label;let o=document.createElement("span");o.className=`stat-badge-value ${e.status}`,o.textContent=e.value,n.append(a,o),t.appendChild(n)}return t}var lt=class extends y{static get observedAttributes(){return["data","theme","label","metric"]}attributeChangedCallback(t,e,n){if(t==="metric"&&this._data){this.setData(this._data);return}super.attributeChangedCallback(t,e,n)}getStylesheet(){return ht+`
219
- `+fr}render(){if(!this._data)return;let t=this.getAttribute("metric");if(!t||!gr.has(t)){this.container.replaceChildren();return}let n=dt(this._data).find(i=>i.metric===t);if(!n||n.value==="--"){this.container.replaceChildren();return}let a=document.createElement("div");a.className="wt-badge";let o=document.createElement("span");o.className="wt-badge-label",o.textContent=n.label;let s=document.createElement("span");s.className=`wt-badge-value ${n.status}`,s.textContent=n.value,a.append(o,s),this.replaceChart(a)}};lt.tagName="wt-badge";var yr="0.10.1",he=["contentOrigin","timingAuthenticity","revisionBehavior","sessionContinuity","physicalPlausibility","temporalPatterns"],wr={contentOrigin:[0,1],timingAuthenticity:[0,1],revisionBehavior:[0,3],sessionContinuity:[0,1],physicalPlausibility:[0,1],temporalPatterns:[1,2],writingProcess:[0,1]},br={contentOrigin:"Origin",timingAuthenticity:"Rhythm",revisionBehavior:"Revisions",sessionContinuity:"Continuity",physicalPlausibility:"Plausibility",temporalPatterns:"Temporal",writingProcess:"Process"},vr={contentOrigin:{name:"Edit Beeswarm",desc:"Per-keystroke dot plot showing inserts, deletes, pastes, and cuts over time"},timingAuthenticity:{name:"Rhythm Heatmap",desc:"Dwell time vs flight time scatter showing keystroke timing distribution"},revisionBehavior:{name:"Corrections Timeline",desc:"Edit operations plotted over session time, sized by magnitude"},sessionContinuity:{name:"Document Growth Curve",desc:"Document length over session time, highlighting change points"},physicalPlausibility:{name:"Edit Waterfall",desc:"Cursor position over time, showing insertion and deletion patterns"},temporalPatterns:{name:"Speed Timeline",desc:"Words per minute over session duration, showing warmup, peak, and fatigue"},writingProcess:{name:"Writing Process",desc:"Planning, drafting, and revision phases over session time"}},xr=`:host { display: block; overflow: hidden; }
219
+ `+gr}render(){if(!this._data)return;let t=this.getAttribute("metric");if(!t||!fr.has(t)){this.container.replaceChildren();return}let n=dt(this._data).find(i=>i.metric===t);if(!n||n.value==="--"){this.container.replaceChildren();return}let a=document.createElement("div");a.className="wt-badge";let o=document.createElement("span");o.className="wt-badge-label",o.textContent=n.label;let s=document.createElement("span");s.className=`wt-badge-value ${n.status}`,s.textContent=n.value,a.append(o,s),this.replaceChart(a)}};lt.tagName="wt-badge";var yr="0.10.2",he=["contentOrigin","timingAuthenticity","revisionBehavior","sessionContinuity","physicalPlausibility","temporalPatterns"],wr={contentOrigin:[0,1],timingAuthenticity:[0,1],revisionBehavior:[0,3],sessionContinuity:[0,1],physicalPlausibility:[0,1],temporalPatterns:[1,2],writingProcess:[0,1]},br={contentOrigin:"Origin",timingAuthenticity:"Rhythm",revisionBehavior:"Revisions",sessionContinuity:"Continuity",physicalPlausibility:"Plausibility",temporalPatterns:"Temporal",writingProcess:"Process"},vr={contentOrigin:{name:"Edit Beeswarm",desc:"Per-keystroke dot plot showing inserts, deletes, pastes, and cuts over time"},timingAuthenticity:{name:"Rhythm Heatmap",desc:"Dwell time vs flight time scatter showing keystroke timing distribution"},revisionBehavior:{name:"Corrections Timeline",desc:"Edit operations plotted over session time, sized by magnitude"},sessionContinuity:{name:"Document Growth Curve",desc:"Document length over session time, highlighting change points"},physicalPlausibility:{name:"Edit Waterfall",desc:"Cursor position over time, showing insertion and deletion patterns"},temporalPatterns:{name:"Speed Timeline",desc:"Words per minute over session duration, showing warmup, peak, and fatigue"},writingProcess:{name:"Writing Process",desc:"Planning, drafting, and revision phases over session time"}},xr=`:host { display: block; overflow-x: hidden; overflow-y: visible; }
220
220
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
221
221
  .page {
222
222
  max-width: 100%;
@@ -423,7 +423,7 @@
423
423
  .detail-status-label.flagged { color: var(--wt-scorecard-status-flagged); }
424
424
  .detail-summary { font-size: 0.9375rem; color: var(--wt-scorecard-text-secondary); margin-bottom: 1rem; line-height: 1.5; }
425
425
  .detail-chart-area { min-height: 120px; margin-bottom: 0.375rem; display: flex; align-items: center; justify-content: center; }
426
- .detail-chart-area svg { display: block; width: 100%; }
426
+ .detail-chart-area svg { display: block; width: 100%; overflow: visible; }
427
427
  .detail-chart-empty { font-size: 0.8125rem; color: var(--wt-scorecard-text-tertiary); font-style: italic; }
428
428
  .detail-chart-caption { font-size: 0.6875rem; color: var(--wt-scorecard-text-tertiary); margin-bottom: 1.25rem; font-style: italic; }
429
429
  .detail-metrics {
@@ -488,4 +488,4 @@
488
488
  .detail-inner { padding: 1rem; }
489
489
  }
490
490
  `,mt=class extends y{constructor(){super(...arguments);this.o="contentOrigin"}static get observedAttributes(){return[...super.observedAttributes,"share","download"]}onResize(){this.rerenderAllCharts()}getStylesheet(){return nt+`
491
- `+xr}attributeChangedCallback(e,n,a){if(e==="theme"&&this._data&&this.hasRendered){requestAnimationFrame(()=>this.rerenderAllCharts());return}if((e==="share"||e==="download")&&this._data&&this.hasRendered){this.setData(this._data);return}super.attributeChangedCallback(e,n,a)}render(){var f;if(!((f=this._data)!=null&&f.analysis))return;let{data:e,analysis:n}=this._data,a=this.o,o=document.createElement("div");o.className="page",o.appendChild(this.buildHeader(n,e));let s=dt(n);o.appendChild(xt(s));let i=bt(n)??"No text was entered.",c=document.createElement("p");c.className="narrative",c.textContent=i,o.appendChild(c);let l=document.createElement("div");l.className="origin-bar-container",l.id="origin-bar",o.appendChild(l);let d=this.buildFlags(n);d&&o.appendChild(d);let u=this.buildGrid(n);o.appendChild(u);let p=this.buildDetailPanel();o.appendChild(p),o.appendChild(this.buildIntegrityDetails(n));let m=document.createElement("div");m.className="version-footer",m.textContent=`WriteTrack v${yr}`,o.appendChild(m);let g=this.closest('[class*="scorecard"]')??this.parentElement,h=(g==null?void 0:g.scrollTop)??0;this.replaceChart(o),requestAnimationFrame(()=>{this.renderAllCharts(),this.renderOriginBarIfPresent(),this.selectCell(a),g&&h>0&&(g.scrollTop=h)})}buildHeader(e,n){let a=document.createElement("header");a.className="header";let o=document.createElement("div");o.className="header-logo",a.appendChild(o);let s=document.createElement("div");s.className="header-meta";let i=document.createElement("div");i.className="header-title",i.textContent="WriteTrack Session",s.appendChild(i);let c=n.metadata.sessionId??"";if(c){let x=document.createElement("div");x.className="header-session-id",x.textContent=c,s.appendChild(x)}let l=document.createElement("div");l.className="header-meta-line";let d=n.metadata.timestamp,p=n.metadata.duration,m=d?new Date(d):new Date(e.analyzedAt),g={day:"numeric",month:"long",year:"numeric"};if(p&&p>0){let x=new Date(m.getTime()+p),w=m.toLocaleDateString("en-GB",g),T=x.toLocaleDateString("en-GB",g);l.textContent=w===T?w:`${w} \u2013 ${T}`}else l.textContent=m.toLocaleDateString("en-GB",g);s.appendChild(l),a.appendChild(s);let h=document.createElement("div");h.className="header-qr",a.appendChild(h);let f=this.hasAttribute("share"),b=this.hasAttribute("download");if(f||b){let x=document.createElement("div");if(x.className="header-actions",f){let w=document.createElement("button");w.setAttribute("data-action","share"),w.setAttribute("aria-label","Share report"),w.title="Share",w.innerHTML='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12v1a1 1 0 001 1h6a1 1 0 001-1v-1M8 2v8M5 5l3-3 3 3"/></svg>',w.addEventListener("click",T=>{T.stopPropagation(),this.dispatchEvent(new CustomEvent("wt-share",{bubbles:!0,composed:!0,detail:{report:this._data}}))}),x.appendChild(w)}if(b){let w=document.createElement("button");w.setAttribute("data-action","download"),w.setAttribute("aria-label","Download as image"),w.title="Download",w.innerHTML='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12v1a1 1 0 001 1h6a1 1 0 001-1v-1M8 10V2M5 7l3 3 3-3"/></svg>',w.addEventListener("click",T=>{T.stopPropagation(),this.dispatchEvent(new CustomEvent("wt-download",{bubbles:!0,composed:!0,detail:{report:this._data}}))}),x.appendChild(w)}a.appendChild(x)}return requestAnimationFrame(()=>{let x=getComputedStyle(this),w=x.getPropertyValue("--wt-scorecard-text").trim()||"#E4E2DA",T=x.getPropertyValue("--wt-scorecard-status-clear").trim()||"#5EAE78";o.innerHTML=se(60,w,T);let D=Dt(e.integrity.finalDigest);D&&(h.innerHTML=Bt(D,w))}),a}buildFlags(e){if(!e.sufficientData)return null;let n=he.filter(o=>z(this.getIndicatorCode(e,o))==="flag");if(n.length===0)return null;let a=document.createElement("div");a.className="flags";for(let o of n){let s=document.createElement("div");s.className="flag-item";let i=it(o,e);s.innerHTML=`<strong class="flag-label">Flagged</strong> ${k(q[o]??o)}\u2009\u2014\u2009${k(i)}`,a.appendChild(s)}return a}buildIntegrityDetails(e){let n=document.createElement("details");n.className="integrity-details";let a=document.createElement("summary"),o=document.createElement("span");o.textContent="Integrity & Verification";let s=document.createElement("span");s.className="integrity-stats",s.textContent=`${e.integrity.eventCount} events \xB7 ${e.integrity.checkpoints.length} checkpoints`,a.append(o,s),n.appendChild(a);let i=document.createElement("div");i.className="integrity-hash-block";let c=document.createElement("span");c.className="integrity-hash-label",c.textContent="Digest (SHA-256)";let l=document.createElement("code");if(l.className="hash",l.textContent=e.integrity.finalDigest,i.append(c,l),n.appendChild(i),e.outputSignature){let d=document.createElement("div");d.className="integrity-hash-block";let u=document.createElement("span");u.className="integrity-hash-label",u.textContent="Output Signature";let p=document.createElement("code");p.className="hash",p.textContent=e.outputSignature,d.append(u,p),n.appendChild(d)}return n}buildGrid(e){let n=document.createElement("div");n.className="grid-container";let a=document.createElement("div");a.className="indicator-grid",a.id="grid";for(let o of he)a.appendChild(this.buildCell(o,e));return n.appendChild(a),n}buildCell(e,n){let a=this.getIndicatorCode(n,e),o=z(a),s=n.sufficientData&&o==="flag",i=document.createElement("div");i.className="cell"+(s?" flagged":""),i.setAttribute("data-category",e),i.addEventListener("click",()=>this.selectCell(e));let c=document.createElement("div");c.className="cell-header";let l=document.createElement("div");l.className="cell-name-col";let d=document.createElement("span");d.className="cell-name";let u=document.createElement("span");u.className="cell-name-short",u.textContent=br[e]??e;let p=document.createElement("span");p.className="cell-name-full",p.textContent=q[e]??e,d.append(u,p),l.appendChild(d);let m=document.createElement("span");m.className=`cell-status ${s?"flagged":"clear"}`,m.title=s?"Flagged":"Clear",c.append(l,m),i.appendChild(c);let g=document.createElement("div");g.className="cell-chart",i.appendChild(g);let h=st(e,n),f=wr[e];return i.appendChild(this.buildCellMetrics(h,f)),i}buildCellMetrics(e,n){let a=document.createElement("div");a.className="cell-metrics";for(let o of n){let s=e[o];if(!s)continue;let i=document.createElement("div");i.className="cell-metric",i.innerHTML=`<span class="cell-metric-label">${k(s.label)}</span><span class="cell-metric-value">${k(s.value)}</span>`,a.appendChild(i)}return a}buildDetailPanel(){let e=document.createElement("div");e.className="detail-panel",e.id="detail";let n=document.createElement("div");return n.className="detail-inner",n.id="detail-inner",e.appendChild(n),e}selectCell(e){var c;let n=(c=this._data)==null?void 0:c.analysis;if(!n)return;let a=this.shadow.getElementById("detail-inner"),o=a&&a.children.length===0;if(this.o===e&&!o)return;this.o=e;let s=this.shadow.getElementById("grid");s==null||s.querySelectorAll(".cell").forEach(l=>l.classList.remove("selected"));let i=s==null?void 0:s.querySelector(`[data-category="${e}"]`);i==null||i.classList.add("selected"),this.populateAndRenderDetail(e,n)}populateAndRenderDetail(e,n){let a=this.shadow.getElementById("detail-inner");if(!a)return;a.classList.add("fading");let o=()=>{this.populateDetail(a,e,n),requestAnimationFrame(()=>{let s=a.querySelector(".detail-chart-area");if(s){let i=this.createDetailChart(e);if(i){let c=s.clientWidth;c>0&&i.el.style.setProperty("--wt-chart-width",`${c}px`),s.replaceChildren(i.el),i.init()}else{let c=document.createElement("span");c.className="detail-chart-empty",c.textContent="Insufficient data for chart",s.replaceChildren(c)}}a.classList.remove("fading")})};if(a.children.length===0)o();else{let s=!1,i=()=>{s||(s=!0,o())},c=setTimeout(i,300);a.addEventListener("transitionend",()=>{clearTimeout(c),i()},{once:!0})}}populateDetail(e,n,a){let o=this.getIndicatorCode(a,n),s=z(o),i=a.sufficientData&&s==="flag",c='<div class="detail-head">';c+=`<span class="detail-name">${k(q[n]??n)}</span>`,c+=`<span class="detail-code">${k(o??"")}</span>`,c+=`<span class="detail-status-label ${i?"flagged":"clear"}">${i?"flagged":"clear"}</span>`,c+="</div>";let l=it(n,a);c+=`<p class="detail-summary">${ct(l)}</p>`,c+='<div class="detail-chart-area"></div>';let d=vr[n];c+=`<div class="detail-chart-caption">${k(d.name)} \u2014 ${k(d.desc)}</div>`;let u=st(n,a);c+='<div class="detail-metrics">';for(let m of u)c+=`<div class="detail-metric"><span class="detail-metric-value">${k(m.value)}</span><span class="detail-metric-label">${k(m.label)}</span></div>`;c+="</div>";let p=vt(n);p&&(c+=`<p class="detail-explainer">${ct(p)}</p>`),e.innerHTML=c}getIndicatorCode(e,n){var o;let a=e[n];return(o=a==null?void 0:a.indicator)==null?void 0:o.code}getComputedColors(){let e=getComputedStyle(this);return{line:e.getPropertyValue("--wt-scorecard-chart-line").trim()||"#1C1B18",accent:e.getPropertyValue("--wt-scorecard-chart-accent").trim()||"#2B7A5D",flagged:e.getPropertyValue("--wt-scorecard-chart-flagged").trim()||"#B8412D",border:e.getPropertyValue("--wt-scorecard-border").trim()||"#E0DED6",tertiary:e.getPropertyValue("--wt-scorecard-text-tertiary").trim()||"#706E64",chartTertiary:e.getPropertyValue("--wt-scorecard-chart-tertiary").trim()||"#7C6DAF",cyan:e.getPropertyValue("--wt-scorecard-chart-cyan").trim()||"#22d3ee"}}renderOriginBarIfPresent(){var c;let e=(c=this._data)==null?void 0:c.analysis;if(!e)return;let n=this.shadow.getElementById("origin-bar");if(!n)return;let a=this.getComputedColors(),o={typed:a.accent,pasted:a.chartTertiary,autocompleted:a.cyan},s=n.getBoundingClientRect().width||400,i=rt(et(e),s,o);i&&n.replaceChildren(i)}createDetailChart(e,n=!1){var p;if(!((p=this._data)!=null&&p.analysis))return null;let{data:a,analysis:o}=this._data,s=this.getComputedColors(),i=this.getIndicatorCode(o,e),l=z(i)==="flag"?s.flagged:s.accent,d=(m,g)=>{g&&m.style.setProperty("--wt-chart-height",`${g}px`),m.style.setProperty("--wt-color-primary",l),m.style.setProperty("--wt-color-secondary",s.accent),m.style.setProperty("--wt-color-text",s.tertiary),m.style.setProperty("--wt-color-text-muted",s.tertiary),m.style.setProperty("--wt-color-border",s.border),m.style.setProperty("--wt-color-bg","transparent"),m.style.setProperty("--wt-color-surface","transparent"),m.style.setProperty("--wt-font-data","var(--wt-scorecard-font-data)"),m.style.setProperty("--wt-font-ui","var(--wt-scorecard-font-display)"),m.style.setProperty("--wt-beeswarm-insert",s.accent),m.style.setProperty("--wt-beeswarm-delete",s.flagged),m.style.setProperty("--wt-beeswarm-paste",s.chartTertiary),m.style.setProperty("--wt-beeswarm-cut",s.tertiary),m.style.setProperty("--wt-bubble-insert",s.accent),m.style.setProperty("--wt-bubble-delete",s.flagged),m.style.setProperty("--wt-bubble-paste",s.chartTertiary),m.style.setProperty("--wt-bubble-cut",s.tertiary),m.style.setProperty("--wt-color-cut",s.flagged),m.style.display="block"},u=(m,g)=>{m.register();let h=new m;return d(h,n?void 0:200),n&&(h.setAttribute("compact",""),h.style.height="52px"),{el:h,init:()=>g(h)}};switch(e){case"contentOrigin":return u(L,m=>m.setData(a));case"timingAuthenticity":return u(N,m=>m.setData(o));case"revisionBehavior":return u(H,m=>m.setData(a));case"sessionContinuity":return u(I,m=>{var h,f;let g=((f=(h=o.sessionContinuity)==null?void 0:h.metrics)==null?void 0:f.changePoints)??[];g.length>0&&m.setChangePoint(g[0].timestamp/1e3),m.setData(a)});case"physicalPlausibility":return u(F,m=>m.setData(a));case"temporalPatterns":return u(O,m=>m.setData(o));default:return null}}renderAllCharts(){this.shadow.querySelectorAll(".cell-chart").forEach(e=>{let n=e.closest(".cell"),a=n==null?void 0:n.getAttribute("data-category");if(!a)return;let o=this.createDetailChart(a,!0);o&&(e.replaceChildren(o.el),o.init())})}rerenderAllCharts(){this.renderAllCharts();let e=this.o;if(e){let n=this.shadow.querySelector("#detail-inner .detail-chart-area");if(n){let a=this.createDetailChart(e);if(a){let o=n.clientWidth;o>0&&a.el.style.setProperty("--wt-chart-width",`${o}px`),n.replaceChildren(a.el),a.init()}}}this.renderOriginBarIfPresent()}};mt.tagName="wt-scorecard";0&&(module.exports={BaseChart,CATEGORY_NAMES,CorrectionsBubble,DocumentGrowth,EditBeeswarm,EditWaterfall,GLOSSARY,IntegrityFooter,PauseDistribution,RhythmHeatmap,Sparkline,SpeedTimeline,TIER1_CATEGORIES,TIER2_CATEGORIES,WtBadge,WtOriginBar,WtScorecard,extractBeeswarmData,extractCorrectionBubbles,extractGrowthData,extractOriginData,extractPauseHistogram,extractRhythmPairs,extractSeries,extractSpeedData,extractStatBadges,extractWaterfallData,formatDuration,generateCaption,generateSummary,generateWritingSummary,getMetrics,getStatus,isPass,renderOriginBar,renderStatBadges,wrapTerms});
491
+ `+xr}attributeChangedCallback(e,n,a){if(e==="theme"&&this._data&&this.hasRendered){requestAnimationFrame(()=>this.rerenderAllCharts());return}if((e==="share"||e==="download")&&this._data&&this.hasRendered){this.setData(this._data);return}super.attributeChangedCallback(e,n,a)}render(){var g;if(!((g=this._data)!=null&&g.analysis))return;let{data:e,analysis:n}=this._data,a=this.o,o=document.createElement("div");o.className="page",o.appendChild(this.buildHeader(n,e));let s=dt(n);o.appendChild(xt(s));let i=bt(n)??"No text was entered.",c=document.createElement("p");c.className="narrative",c.textContent=i,o.appendChild(c);let l=document.createElement("div");l.className="origin-bar-container",l.id="origin-bar",o.appendChild(l);let d=this.buildFlags(n);d&&o.appendChild(d);let u=this.buildGrid(n);o.appendChild(u);let p=this.buildDetailPanel();o.appendChild(p),o.appendChild(this.buildIntegrityDetails(n));let m=document.createElement("div");m.className="version-footer",m.textContent=`WriteTrack v${yr}`,o.appendChild(m);let f=this.closest('[class*="scorecard"]')??this.parentElement,h=(f==null?void 0:f.scrollTop)??0;this.replaceChart(o),requestAnimationFrame(()=>{this.renderAllCharts(),this.renderOriginBarIfPresent(),this.selectCell(a),f&&h>0&&(f.scrollTop=h)})}buildHeader(e,n){let a=document.createElement("header");a.className="header";let o=document.createElement("div");o.className="header-logo",a.appendChild(o);let s=document.createElement("div");s.className="header-meta";let i=document.createElement("div");i.className="header-title",i.textContent="WriteTrack Session",s.appendChild(i);let c=n.metadata.sessionId??"";if(c){let x=document.createElement("div");x.className="header-session-id",x.textContent=c,s.appendChild(x)}let l=document.createElement("div");l.className="header-meta-line";let d=n.metadata.timestamp,p=n.metadata.duration,m=d?new Date(d):new Date(e.analyzedAt),f={day:"numeric",month:"long",year:"numeric"};if(p&&p>0){let x=new Date(m.getTime()+p),w=m.toLocaleDateString("en-GB",f),T=x.toLocaleDateString("en-GB",f);l.textContent=w===T?w:`${w} \u2013 ${T}`}else l.textContent=m.toLocaleDateString("en-GB",f);s.appendChild(l),a.appendChild(s);let h=document.createElement("div");h.className="header-qr",a.appendChild(h);let g=this.hasAttribute("share"),b=this.hasAttribute("download");if(g||b){let x=document.createElement("div");if(x.className="header-actions",g){let w=document.createElement("button");w.setAttribute("data-action","share"),w.setAttribute("aria-label","Share report"),w.title="Share",w.innerHTML='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12v1a1 1 0 001 1h6a1 1 0 001-1v-1M8 2v8M5 5l3-3 3 3"/></svg>',w.addEventListener("click",T=>{T.stopPropagation(),this.dispatchEvent(new CustomEvent("wt-share",{bubbles:!0,composed:!0,detail:{report:this._data}}))}),x.appendChild(w)}if(b){let w=document.createElement("button");w.setAttribute("data-action","download"),w.setAttribute("aria-label","Download as image"),w.title="Download",w.innerHTML='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12v1a1 1 0 001 1h6a1 1 0 001-1v-1M8 10V2M5 7l3 3 3-3"/></svg>',w.addEventListener("click",T=>{T.stopPropagation(),this.dispatchEvent(new CustomEvent("wt-download",{bubbles:!0,composed:!0,detail:{report:this._data}}))}),x.appendChild(w)}a.appendChild(x)}return requestAnimationFrame(()=>{let x=getComputedStyle(this),w=x.getPropertyValue("--wt-scorecard-text").trim()||"#E4E2DA",T=x.getPropertyValue("--wt-scorecard-status-clear").trim()||"#5EAE78";o.innerHTML=se(60,w,T);let D=Dt(e.integrity.finalDigest);D&&(h.innerHTML=Bt(D,w))}),a}buildFlags(e){if(!e.sufficientData)return null;let n=he.filter(o=>z(this.getIndicatorCode(e,o))==="flag");if(n.length===0)return null;let a=document.createElement("div");a.className="flags";for(let o of n){let s=document.createElement("div");s.className="flag-item";let i=it(o,e);s.innerHTML=`<strong class="flag-label">Flagged</strong> ${k(q[o]??o)}\u2009\u2014\u2009${k(i)}`,a.appendChild(s)}return a}buildIntegrityDetails(e){let n=document.createElement("details");n.className="integrity-details";let a=document.createElement("summary"),o=document.createElement("span");o.textContent="Integrity & Verification";let s=document.createElement("span");s.className="integrity-stats",s.textContent=`${e.integrity.eventCount} events \xB7 ${e.integrity.checkpoints.length} checkpoints`,a.append(o,s),n.appendChild(a);let i=document.createElement("div");i.className="integrity-hash-block";let c=document.createElement("span");c.className="integrity-hash-label",c.textContent="Digest (SHA-256)";let l=document.createElement("code");if(l.className="hash",l.textContent=e.integrity.finalDigest,i.append(c,l),n.appendChild(i),e.outputSignature){let d=document.createElement("div");d.className="integrity-hash-block";let u=document.createElement("span");u.className="integrity-hash-label",u.textContent="Output Signature";let p=document.createElement("code");p.className="hash",p.textContent=e.outputSignature,d.append(u,p),n.appendChild(d)}return n}buildGrid(e){let n=document.createElement("div");n.className="grid-container";let a=document.createElement("div");a.className="indicator-grid",a.id="grid";for(let o of he)a.appendChild(this.buildCell(o,e));return n.appendChild(a),n}buildCell(e,n){let a=this.getIndicatorCode(n,e),o=z(a),s=n.sufficientData&&o==="flag",i=document.createElement("div");i.className="cell"+(s?" flagged":""),i.setAttribute("data-category",e),i.addEventListener("click",()=>this.selectCell(e));let c=document.createElement("div");c.className="cell-header";let l=document.createElement("div");l.className="cell-name-col";let d=document.createElement("span");d.className="cell-name";let u=document.createElement("span");u.className="cell-name-short",u.textContent=br[e]??e;let p=document.createElement("span");p.className="cell-name-full",p.textContent=q[e]??e,d.append(u,p),l.appendChild(d);let m=document.createElement("span");m.className=`cell-status ${s?"flagged":"clear"}`,m.title=s?"Flagged":"Clear",c.append(l,m),i.appendChild(c);let f=document.createElement("div");f.className="cell-chart",i.appendChild(f);let h=st(e,n),g=wr[e];return i.appendChild(this.buildCellMetrics(h,g)),i}buildCellMetrics(e,n){let a=document.createElement("div");a.className="cell-metrics";for(let o of n){let s=e[o];if(!s)continue;let i=document.createElement("div");i.className="cell-metric",i.innerHTML=`<span class="cell-metric-label">${k(s.label)}</span><span class="cell-metric-value">${k(s.value)}</span>`,a.appendChild(i)}return a}buildDetailPanel(){let e=document.createElement("div");e.className="detail-panel",e.id="detail";let n=document.createElement("div");return n.className="detail-inner",n.id="detail-inner",e.appendChild(n),e}selectCell(e){var c;let n=(c=this._data)==null?void 0:c.analysis;if(!n)return;let a=this.shadow.getElementById("detail-inner"),o=a&&a.children.length===0;if(this.o===e&&!o)return;this.o=e;let s=this.shadow.getElementById("grid");s==null||s.querySelectorAll(".cell").forEach(l=>l.classList.remove("selected"));let i=s==null?void 0:s.querySelector(`[data-category="${e}"]`);i==null||i.classList.add("selected"),this.populateAndRenderDetail(e,n)}populateAndRenderDetail(e,n){let a=this.shadow.getElementById("detail-inner");if(!a)return;a.classList.add("fading");let o=()=>{this.populateDetail(a,e,n),requestAnimationFrame(()=>{let s=a.querySelector(".detail-chart-area");if(s){let i=this.createDetailChart(e);if(i){let c=s.clientWidth;c>0&&i.el.style.setProperty("--wt-chart-width",`${c}px`),s.replaceChildren(i.el),i.init()}else{let c=document.createElement("span");c.className="detail-chart-empty",c.textContent="Insufficient data for chart",s.replaceChildren(c)}}a.classList.remove("fading")})};if(a.children.length===0)o();else{let s=!1,i=()=>{s||(s=!0,o())},c=setTimeout(i,300);a.addEventListener("transitionend",()=>{clearTimeout(c),i()},{once:!0})}}populateDetail(e,n,a){let o=this.getIndicatorCode(a,n),s=z(o),i=a.sufficientData&&s==="flag",c='<div class="detail-head">';c+=`<span class="detail-name">${k(q[n]??n)}</span>`,c+=`<span class="detail-code">${k(o??"")}</span>`,c+=`<span class="detail-status-label ${i?"flagged":"clear"}">${i?"flagged":"clear"}</span>`,c+="</div>";let l=it(n,a);c+=`<p class="detail-summary">${ct(l)}</p>`,c+='<div class="detail-chart-area"></div>';let d=vr[n];c+=`<div class="detail-chart-caption">${k(d.name)} \u2014 ${k(d.desc)}</div>`;let u=st(n,a);c+='<div class="detail-metrics">';for(let m of u)c+=`<div class="detail-metric"><span class="detail-metric-value">${k(m.value)}</span><span class="detail-metric-label">${k(m.label)}</span></div>`;c+="</div>";let p=vt(n);p&&(c+=`<p class="detail-explainer">${ct(p)}</p>`),e.innerHTML=c}getIndicatorCode(e,n){var o;let a=e[n];return(o=a==null?void 0:a.indicator)==null?void 0:o.code}getComputedColors(){let e=getComputedStyle(this);return{line:e.getPropertyValue("--wt-scorecard-chart-line").trim()||"#1C1B18",accent:e.getPropertyValue("--wt-scorecard-chart-accent").trim()||"#2B7A5D",flagged:e.getPropertyValue("--wt-scorecard-chart-flagged").trim()||"#B8412D",border:e.getPropertyValue("--wt-scorecard-border").trim()||"#E0DED6",tertiary:e.getPropertyValue("--wt-scorecard-text-tertiary").trim()||"#706E64",chartTertiary:e.getPropertyValue("--wt-scorecard-chart-tertiary").trim()||"#7C6DAF",cyan:e.getPropertyValue("--wt-scorecard-chart-cyan").trim()||"#22d3ee"}}renderOriginBarIfPresent(){var c;let e=(c=this._data)==null?void 0:c.analysis;if(!e)return;let n=this.shadow.getElementById("origin-bar");if(!n)return;let a=this.getComputedColors(),o={typed:a.accent,pasted:a.chartTertiary,autocompleted:a.cyan},s=n.getBoundingClientRect().width||400,i=rt(et(e),s,o);i&&n.replaceChildren(i)}createDetailChart(e,n=!1){var p;if(!((p=this._data)!=null&&p.analysis))return null;let{data:a,analysis:o}=this._data,s=this.getComputedColors(),i=this.getIndicatorCode(o,e),l=z(i)==="flag"?s.flagged:s.accent,d=(m,f)=>{f&&m.style.setProperty("--wt-chart-height",`${f}px`),m.style.setProperty("--wt-color-primary",l),m.style.setProperty("--wt-color-secondary",s.accent),m.style.setProperty("--wt-color-text",s.tertiary),m.style.setProperty("--wt-color-text-muted",s.tertiary),m.style.setProperty("--wt-color-border",s.border),m.style.setProperty("--wt-color-bg","transparent"),m.style.setProperty("--wt-color-surface","transparent"),m.style.setProperty("--wt-font-data","var(--wt-scorecard-font-data)"),m.style.setProperty("--wt-font-ui","var(--wt-scorecard-font-display)"),m.style.setProperty("--wt-beeswarm-insert",s.accent),m.style.setProperty("--wt-beeswarm-delete",s.flagged),m.style.setProperty("--wt-beeswarm-paste",s.chartTertiary),m.style.setProperty("--wt-beeswarm-cut",s.tertiary),m.style.setProperty("--wt-bubble-insert",s.accent),m.style.setProperty("--wt-bubble-delete",s.flagged),m.style.setProperty("--wt-bubble-paste",s.chartTertiary),m.style.setProperty("--wt-bubble-cut",s.tertiary),m.style.setProperty("--wt-color-cut",s.flagged),m.style.display="block"},u=(m,f)=>{m.register();let h=new m;return d(h,n?void 0:200),n&&(h.setAttribute("compact",""),h.style.height="52px"),{el:h,init:()=>f(h)}};switch(e){case"contentOrigin":return u(L,m=>m.setData(a));case"timingAuthenticity":return u(N,m=>m.setData(o));case"revisionBehavior":return u(H,m=>m.setData(a));case"sessionContinuity":return u(I,m=>{var h,g;let f=((g=(h=o.sessionContinuity)==null?void 0:h.metrics)==null?void 0:g.changePoints)??[];f.length>0&&m.setChangePoint(f[0].timestamp/1e3),m.setData(a)});case"physicalPlausibility":return u(F,m=>m.setData(a));case"temporalPatterns":return u(O,m=>m.setData(o));default:return null}}renderAllCharts(){this.shadow.querySelectorAll(".cell-chart").forEach(e=>{let n=e.closest(".cell"),a=n==null?void 0:n.getAttribute("data-category");if(!a)return;let o=this.createDetailChart(a,!0);o&&(e.replaceChildren(o.el),o.init())})}rerenderAllCharts(){this.renderAllCharts();let e=this.o;if(e){let n=this.shadow.querySelector("#detail-inner .detail-chart-area");if(n){let a=this.createDetailChart(e);if(a){let o=n.clientWidth;o>0&&a.el.style.setProperty("--wt-chart-width",`${o}px`),n.replaceChildren(a.el),a.init()}}}this.renderOriginBarIfPresent()}};mt.tagName="wt-scorecard";0&&(module.exports={BaseChart,CATEGORY_NAMES,CorrectionsBubble,DocumentGrowth,EditBeeswarm,EditWaterfall,GLOSSARY,IntegrityFooter,PauseDistribution,RhythmHeatmap,Sparkline,SpeedTimeline,TIER1_CATEGORIES,TIER2_CATEGORIES,WtBadge,WtOriginBar,WtScorecard,extractBeeswarmData,extractCorrectionBubbles,extractGrowthData,extractOriginData,extractPauseHistogram,extractRhythmPairs,extractSeries,extractSpeedData,extractStatBadges,extractWaterfallData,formatDuration,generateCaption,generateSummary,generateWritingSummary,getMetrics,getStatus,isPass,renderOriginBar,renderStatBadges,wrapTerms});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "writetrack",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "private": false,
5
5
  "description": "Lightweight keystroke telemetry capture for web applications",
6
6
  "main": "dist/index.cjs",