// ==UserScript== // @name yt-video-time-management // @version 2.0.5 // @description extension for video time management // @match https://www.youtube.com/watch?* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant GM_addStyle // ==/UserScript== (function(){"use strict";const At=(t,e)=>t===e,T=Symbol("solid-proxy"),U=Symbol("solid-track"),N={equals:At};let rt=ct;const S=1,I=2,ot={owned:null,cleanups:null,context:null,owner:null};var m=null;let G=null,p=null,h=null,k=null,M=0;function H(t,e){const n=p,r=m,o=t.length===0,s=o?ot:{owned:null,cleanups:null,context:null,owner:e===void 0?r:e},l=o?t:()=>t(()=>_(()=>D(s)));m=s,p=null;try{return O(l,!0)}finally{p=n,m=r}}function v(t,e){e=e?Object.assign({},N,e):N;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),it(n,o));return[lt.bind(n),r]}function A(t,e,n){const r=X(t,e,!1,S);C(r)}function L(t,e,n){rt=jt;const r=X(t,e,!1,S);(!n||!n.render)&&(r.user=!0),k?k.push(r):C(r)}function j(t,e,n){n=n?Object.assign({},N,n):N;const r=X(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,C(r),lt.bind(r)}function z(t){return O(t,!1)}function _(t){if(p===null)return t();const e=p;p=null;try{return t()}finally{p=e}}function K(t){L(()=>_(t))}function Ot(t){return m===null||(m.cleanups===null?m.cleanups=[t]:m.cleanups.push(t)),t}function st(){return p}function lt(){if(this.sources&&this.state)if(this.state===S)C(this);else{const t=h;h=null,O(()=>V(this),!1),h=t}if(p){const t=this.observers?this.observers.length:0;p.sources?(p.sources.push(this),p.sourceSlots.push(t)):(p.sources=[this],p.sourceSlots=[t]),this.observers?(this.observers.push(p),this.observerSlots.push(p.sources.length-1)):(this.observers=[p],this.observerSlots=[p.sources.length-1])}return this.value}function it(t,e,n){let r=t.value;return(!t.comparator||!t.comparator(r,e))&&(t.value=e,t.observers&&t.observers.length&&O(()=>{for(let o=0;o1e6)throw h=[],new Error},!1)),e}function C(t){if(!t.fn)return;D(t);const e=m,n=p,r=M;p=m=t,$t(t,t.value,r),p=n,m=e}function $t(t,e,n){let r;try{r=t.fn(e)}catch(o){return t.pure&&(t.state=S,t.owned&&t.owned.forEach(D),t.owned=null),t.updatedAt=n+1,at(o)}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?it(t,r):t.value=r,t.updatedAt=n)}function X(t,e,n,r=S,o){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:m,context:null,pure:n};return m===null||m!==ot&&(m.owned?m.owned.push(s):m.owned=[s]),s}function B(t){if(t.state===0)return;if(t.state===I)return V(t);if(t.suspense&&_(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt=0;n--)if(t=e[n],t.state===S)C(t);else if(t.state===I){const r=h;h=null,O(()=>V(t,e[0]),!1),h=r}}function O(t,e){if(h)return t();let n=!1;e||(h=[]),k?n=!0:k=[],M++;try{const r=t();return Pt(n),r}catch(r){n||(k=null),h=null,at(r)}}function Pt(t){if(h&&(ct(h),h=null),t)return;const e=k;k=null,e.length&&O(()=>rt(e),!1)}function ct(t){for(let e=0;e=0;e--)D(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0,t.context=null}function at(t){throw t}const ft=Symbol("fallback");function pt(t){for(let e=0;ept(s)),()=>{const u=t()||[];return u[U],_(()=>{if(u.length===0)return i!==0&&(pt(s),s=[],r=[],o=[],i=0,l=[]),n.fallback&&(r=[ft],o[0]=H(a=>(s[0]=a,n.fallback())),i=1),o;for(r[0]===ft&&(s[0](),s=[],r=[],o=[],i=0),c=0;cu[c]):c>=r.length&&(o[c]=H(d));for(;ct(e||{}))}const Et=t=>`Stale read from <${t}>.`;function Nt(t){const e="fallback"in t&&{fallback:()=>t.fallback};return j(Ct(()=>t.each,t.children,e||void 0))}function It(t){const e=t.keyed,n=j(()=>t.when,void 0,{equals:(r,o)=>e?r===o:!r==!o});return j(()=>{const r=n();if(r){const o=t.children;return typeof o=="function"&&o.length>0?_(()=>o(e?r:()=>{if(!_(n))throw Et("Show");return t.when})):o}return t.fallback},void 0,void 0)}function Mt(t,e,n){let r=n.length,o=e.length,s=r,l=0,i=0,c=e[o-1].nextSibling,u=null;for(;ld-i){const x=e[l];for(;i{o=s,e===document?t():$(e,t(),e.firstChild?null:void 0,n)},r.owner),()=>{o(),e.textContent=""}}function y(t,e,n){let r;const o=()=>{const l=document.createElement("template");return l.innerHTML=t,n?l.content.firstChild.firstChild:l.content.firstChild},s=e?()=>_(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return s.cloneNode=s,s}function q(t,e=window.document){const n=e[dt]||(e[dt]=new Set);for(let r=0,o=t.length;rt(e,n))}function $(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return R(t,e,r,n);A(o=>R(t,e(),o,n),r)}function Vt(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[e];if(r&&!n.disabled){const o=n[`${e}Data`];if(o!==void 0?r.call(n,o,t):r.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function R(t,e,n,r,o){for(;typeof n=="function";)n=n();if(e===n)return n;const s=typeof e,l=r!==void 0;if(t=l&&n[0]&&n[0].parentNode||t,s==="string"||s==="number")if(s==="number"&&(e=e.toString()),l){let i=n[0];i&&i.nodeType===3?i.data=e:i=document.createTextNode(e),n=P(t,n,r,i)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e;else if(e==null||s==="boolean")n=P(t,n,r);else{if(s==="function")return A(()=>{let i=e();for(;typeof i=="function";)i=i();n=R(t,i,n,r)}),()=>n;if(Array.isArray(e)){const i=[],c=n&&Array.isArray(n);if(Y(i,e,n,o))return A(()=>n=R(t,i,n,r,!0)),()=>n;if(i.length===0){if(n=P(t,n,r),l)return n}else c?n.length===0?mt(t,i,r):Mt(t,n,i):(n&&P(t),mt(t,i));n=i}else if(e.nodeType){if(Array.isArray(n)){if(l)return n=P(t,n,r,e);P(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}else console.warn("Unrecognized value. Skipped inserting",e)}return n}function Y(t,e,n,r){let o=!1;for(let s=0,l=e.length;s=0;l--){const i=e[l];if(o!==i){const c=i.parentNode===t;!s&&!l?c?t.replaceChild(o,i):t.insertBefore(o,n):c&&i.remove()}else s=!0}}else t.insertBefore(o,n);return[o]}const Z=Symbol("store-raw"),E=Symbol("store-node");function ht(t){let e;return t!=null&&typeof t=="object"&&(t[T]||!(e=Object.getPrototypeOf(t))||e===Object.prototype||Array.isArray(t))}function F(t,e=new Set){let n,r,o,s;if(n=t!=null&&t[Z])return n;if(!ht(t)||e.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):e.add(t);for(let l=0,i=t.length;ln),Array.isArray(t)&&t.length!==s){for(let c=t.length;ct[T][e],n.set=r=>t[T][e]=r),n}const Rt={get(t,e,n){if(e===Z)return t;if(e===T)return n;if(e===U)return gt(t),n;const r=Q(t),o=r[e];let s=o?o():t[e];if(e===E||e==="__proto__")return s;if(!o){const l=Object.getOwnPropertyDescriptor(t,e),i=typeof s=="function";if(st()&&(!i||t.hasOwnProperty(e))&&!(l&&l.get))s=W(r,e,s)();else if(s!=null&&i&&s===Array.prototype[e])return(...c)=>z(()=>Array.prototype[e].apply(n,c))}return ht(s)?vt(s):s},has(t,e){return e===Z||e===T||e===U||e===E||e==="__proto__"?!0:(this.get(t,e,t),e in t)},set(t,e,n){return z(()=>yt(t,e,F(n))),!0},deleteProperty(t,e){return z(()=>yt(t,e,void 0,!0)),!0},ownKeys:Dt,getOwnPropertyDescriptor:qt};function vt(t){let e=t[T];if(!e){Object.defineProperty(t,T,{value:e=new Proxy(t,Rt)});const n=Object.keys(t),r=Object.getOwnPropertyDescriptors(t);for(let o=0,s=n.length;oz(()=>i.call(e,c))})}}}return e}function Ft(t,e){const n=F(t||{});return vt(n)}const Jt=t=>{let e=window.location.href;t({url:e}),navigation.addEventListener("navigate",n=>{e!==n.destination.url&&(e=n.destination.url,t({url:e}))})},Ut=y('