@kaifronsdal/transcript-viewer
Version:
A web-based viewer for AI conversation transcripts with rollback support
2 lines (1 loc) • 3.25 kB
JavaScript
import{a1 as ee,b as ae,a2 as K,a3 as H,h as N,a4 as re,a as ne,m as U,l as ie,a5 as fe,a6 as le,a7 as X,a8 as R,d as M,a9 as se,aa as ue,ab as P,c as Q,p as te,ac as S,ad as W,ae as ve,af as z,ag as k,ah as F,ai as O,q as de,aj as G,ak as _e,al as oe,am as ce,an as he,ao as Ee,ap as pe,aq as Te,N as Ae}from"./DDSnUQRm.js";function Ce(l,e){return e}function me(l,e,a,u){for(var v=[],_=e.length,t=0;t<_;t++)oe(e[t].e,v,!0);var o=_>0&&v.length===0&&a!==null;if(o){var T=a.parentNode;ce(T),T.append(a),u.clear(),x(l,e[0].prev,e[_-1].next)}he(v,()=>{for(var h=0;h<_;h++){var d=e[h];o||(u.delete(d.k),x(l,d.prev,d.next)),Ee(d.e,!o)}})}function we(l,e,a,u,v,_=null){var t=l,o={flags:e,items:new Map,first:null},T=(e&K)!==0;if(T){var h=l;t=N?H(re(h)):h.appendChild(ee())}N&&ne();var d=null,C=!1,i=ie(()=>{var s=a();return Ae(s)?s:s==null?[]:W(s)});ae(()=>{var s=U(i),r=s.length;if(C&&r===0)return;C=r===0;let m=!1;if(N){var E=fe(t)===le;E!==(r===0)&&(t=X(),H(t),R(!1),m=!0)}if(N){for(var p=null,A,c=0;c<r;c++){if(M.nodeType===se&&M.data===ue){t=M,m=!0,R(!1);break}var n=s[c],f=u(n,c);A=Z(M,o,p,null,n,f,c,v,e,a),o.items.set(f,A),p=A}r>0&&H(X())}N||Ie(s,o,t,v,e,u,a),_!==null&&(r===0?d?P(d):d=Q(()=>_(t)):d!==null&&te(d,()=>{d=null})),m&&R(!0),U(i)}),N&&(t=M)}function Ie(l,e,a,u,v,_,t){var q,L,V,Y;var o=(v&_e)!==0,T=(v&(k|O))!==0,h=l.length,d=e.items,C=e.first,i=C,s,r=null,m,E=[],p=[],A,c,n,f;if(o)for(f=0;f<h;f+=1)A=l[f],c=_(A,f),n=d.get(c),n!==void 0&&((q=n.a)==null||q.measure(),(m??(m=new Set)).add(n));for(f=0;f<h;f+=1){if(A=l[f],c=_(A,f),n=d.get(c),n===void 0){var $=i?i.e.nodes_start:a;r=Z($,e,r,r===null?e.first:r.next,A,c,f,u,v,t),d.set(c,r),E=[],p=[],i=r.next;continue}if(T&&xe(n,A,f,v),(n.e.f&S)!==0&&(P(n.e),o&&((L=n.a)==null||L.unfix(),(m??(m=new Set)).delete(n))),n!==i){if(s!==void 0&&s.has(n)){if(E.length<p.length){var b=p[0],I;r=b.prev;var y=E[0],g=E[E.length-1];for(I=0;I<E.length;I+=1)J(E[I],b,a);for(I=0;I<p.length;I+=1)s.delete(p[I]);x(e,y.prev,g.next),x(e,r,y),x(e,g,b),i=b,r=g,f-=1,E=[],p=[]}else s.delete(n),J(n,i,a),x(e,n.prev,n.next),x(e,n,r===null?e.first:r.next),x(e,r,n),r=n;continue}for(E=[],p=[];i!==null&&i.k!==c;)(i.e.f&S)===0&&(s??(s=new Set)).add(i),p.push(i),i=i.next;if(i===null)continue;n=i}E.push(n),r=n,i=n.next}if(i!==null||s!==void 0){for(var w=s===void 0?[]:W(s);i!==null;)(i.e.f&S)===0&&w.push(i),i=i.next;var D=w.length;if(D>0){var j=(v&K)!==0&&h===0?a:null;if(o){for(f=0;f<D;f+=1)(V=w[f].a)==null||V.measure();for(f=0;f<D;f+=1)(Y=w[f].a)==null||Y.fix()}me(e,w,j,d)}}o&&ve(()=>{var B;if(m!==void 0)for(n of m)(B=n.a)==null||B.apply()}),z.first=e.first&&e.first.e,z.last=r&&r.e}function xe(l,e,a,u){(u&k)!==0&&F(l.v,e),(u&O)!==0?F(l.i,a):l.i=a}function Z(l,e,a,u,v,_,t,o,T,h){var d=(T&k)!==0,C=(T&pe)===0,i=d?C?de(v,!1,!1):G(v):v,s=(T&O)===0?t:G(t),r={i:s,v:i,k:_,a:null,e:null,prev:a,next:u};try{return r.e=Q(()=>o(l,i,s,h),N),r.e.prev=a&&a.e,r.e.next=u&&u.e,a===null?e.first=r:(a.next=r,a.e.next=r.e),u!==null&&(u.prev=r,u.e.prev=r.e),r}finally{}}function J(l,e,a){for(var u=l.next?l.next.e.nodes_start:a,v=e?e.e.nodes_start:a,_=l.e.nodes_start;_!==u;){var t=Te(_);v.before(_),_=t}}function x(l,e,a){e===null?l.first=a:(e.next=a,e.e.next=a&&a.e),a!==null&&(a.prev=e,a.e.prev=e&&e.e)}export{we as e,Ce as i};