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