2 lines
145 KiB
JavaScript
2 lines
145 KiB
JavaScript
|
var AsciinemaPlayer=function(A){"use strict";const g={};const I=Symbol("solid-proxy"),B=Symbol("solid-track"),Q={equals:(A,g)=>A===g};let C=p;const E=1,e=2,t={owned:null,cleanups:null,context:null,owner:null};var i=null;let o=null,s=null,n=null,r=null,a=0;function c(A,g){const I=s,B=i,Q=0===A.length,C=Q?t:{owned:null,cleanups:null,context:null,owner:void 0===g?B:g},E=Q?A:()=>A((()=>h((()=>L(C)))));i=C,s=null;try{return M(E,!0)}finally{s=I,i=B}}function w(A,g){const I={value:A,observers:null,observerSlots:null,comparator:(g=g?Object.assign({},Q,g):Q).equals||void 0};return[k.bind(I),A=>("function"==typeof A&&(A=A(I.value)),d(I,A))]}function D(A,g,I){f(F(A,g,!1,E))}function l(A,g,I){I=I?Object.assign({},Q,I):Q;const B=F(A,g,!0,0);return B.observers=null,B.observerSlots=null,B.comparator=I.equals||void 0,f(B),k.bind(B)}function h(A){if(null===s)return A();const g=s;s=null;try{return A()}finally{s=g}}function y(A){!function(A,g,I){C=J;const B=F(A,g,!1,E);B.user=!0,r?r.push(B):f(B)}((()=>h(A)))}function G(A){return null===i||(null===i.cleanups?i.cleanups=[A]:i.cleanups.push(A)),A}function u(){return s}function N(A){const g=l(A),I=l((()=>K(g())));return I.toArray=()=>{const A=I();return Array.isArray(A)?A:null!=A?[A]:[]},I}function k(){const A=o;if(this.sources&&(this.state||A))if(this.state===E||A)f(this);else{const A=n;n=null,M((()=>Y(this)),!1),n=A}if(s){const A=this.observers?this.observers.length:0;s.sources?(s.sources.push(this),s.sourceSlots.push(A)):(s.sources=[this],s.sourceSlots=[A]),this.observers?(this.observers.push(s),this.observerSlots.push(s.sources.length-1)):(this.observers=[s],this.observerSlots=[s.sources.length-1])}return this.value}function d(A,g,I){let B=A.value;return A.comparator&&A.comparator(B,g)||(A.value=g,A.observers&&A.observers.length&&M((()=>{for(let g=0;g<A.observers.length;g+=1){const I=A.observers[g],B=o&&o.running;B&&o.disposed.has(I),(B&&!I.tState||!B&&!I.state)&&(I.pure?n.push(I):r.push(I),I.observers&&S(I)),B||(I.state=E)}if(n.length>1e6)throw n=[],new Error}),!1)),g}function f(A){if(!A.fn)return;L(A);const g=i,I=s,B=a;s=i=A,function(A,g,I){let B;try{B=A.fn(g)}catch(g){A.pure&&(A.state=E,A.owned&&A.owned.forEach(L),A.owned=null),U(g)}(!A.updatedAt||A.updatedAt<=I)&&(null!=A.updatedAt&&"observers"in A?d(A,B):A.value=B,A.updatedAt=I)}(A,A.value,B),s=I,i=g}function F(A,g,I,B=E,Q){const C={fn:A,state:B,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:g,owner:i,context:null,pure:I};return null===i||i!==t&&(i.owned?i.owned.push(C):i.owned=[C]),C}function R(A){const g=o;if(0===A.state||g)return;if(A.state===e||g)return Y(A);if(A.suspense&&h(A.suspense.inFallback))return A.suspense.effects.push(A);const I=[A];for(;(A=A.owner)&&(!A.updatedAt||A.updatedAt<a);)(A.state||g)&&I.push(A);for(let B=I.length-1;B>=0;B--)if((A=I[B]).state===E||g)f(A);else if(A.state===e||g){const g=n;n=null,M((()=>Y(A,I[0])),!1),n=g}}function M(A,g){if(n)return A();let I=!1;g||(n=[]),r?I=!0:r=[],a++;try{const g=A();return function(A){n&&(p(n),n=null);if(A)return;const g=r;r=null,g.length&&M((()=>C(g)),!1)}(I),g}catch(A){I||(r=null),n=null,U(A)}}function p(A){for(let g=0;g<A.length;g++)R(A[g])}function J(A){let I,B=0;for(I=0;I<A.length;I++){const g=A[I];g.user?A[B++]=g:R(g)}var Q;for(g.context&&(g.context=Q),I=0;I<B;I++)R(A[I])}function Y(A,g){const I=o;A.state=0;for(let B=0;B<A.sources.length;B+=1){const Q=A.sources[B];Q.sources&&(Q.state===E||I?Q!==g&&R(Q):(Q.state===e||I)&&Y(Q,g))}}function S(A){const g=o;for(let I=0;I<A.observers.length;I+=1){const B=A.observers[I];B.state&&!g||(B.state=e,B.pure?n.push(B):r.push(B),B.observers&&S(B))}}function L(A){let g;if(A.sources)for(;A.sources.length;){const g=A.sources.pop(),I=A.sourceSlots.pop(),B=g.observers;if(B&&B.length){const A=B.pop(),Q=g.observerSlots.pop();I<B.length&&(A.sourceSlots[Q]=I,B[I]=A,g.observerSlots[I]=Q)}}if(A.owned){for(g=0;g<A.owned.length;g++)L(A.owned[g]);A.owned=null}if(A.cleanups){for(g=0;g<A.cleanups.length;g++)A.cleanups[g]();A.cleanups=null}A.state=0,A.context=null}function U(A){throw A=function(A){return A instanceof Error
|