You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.1 KiB

(()=>{"use strict";var e,t={9612:(e,t,a)=>{function n(e,t){const a=e.lastIndexOf(".");let n=t;return-1!==a&&(n=e.substring(a+1)),n}function o({onJson:e,onRequest:t,waitForBasename:a}){setTimeout((()=>{const n={};let o="",s=!1;const i=JSON.parse;JSON.parse=function(){const t=i.apply(this,arguments);let a=!1,r=!1;return e(t,(e=>{const t=window.location.pathname;void 0===n[t]&&(n[t]=[]),void 0===n[t].find((t=>t.label===e.label&&t.language===e.language))&&(n[t].push(e),a=!0)}),(e=>{o=e,r=!0})),s&&(a||r)&&document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:o,subtitles:n[window.location.pathname]}})),t},document.addEventListener("asbplayer-get-synced-data",(async()=>{t?.((e=>{const t=window.location.pathname;void 0===n[t]&&(n[t]=[]),void 0===n[t].find((t=>t.label===e.label&&t.language===e.language))&&n[t].push(e)}),(e=>{o=e,s||document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:o,subtitles:void 0}}))}));const e=()=>(!a||""!==o)&&window.location.pathname in n;e()||await function(e,t=1e4){return new Promise((async(a,n)=>{e()&&a(!0);const o=Date.now();let s=!1;for(;!s&&Date.now()<o+t;)await new Promise((t=>{setTimeout((()=>{s=e(),t()}),1e3)}));a(s)}))}(e),document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:o,subtitles:n[window.location.pathname]??[]}})),function(){for(const e of Object.keys(n))e!==window.location.pathname&&delete n[e]}(),s=!0}),!1)}),0)}a.d(t,{NC:()=>o,YU:()=>n})}},a={};function n(e){var o=a[e];if(void 0!==o)return o.exports;var s=a[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(0,(e=n(9612)).NC)({onJson:(t,a)=>{if(t?.subtitleUrls instanceof Array)for(const n of t.subtitleUrls)"string"==typeof t?.catalogMetadata?.catalog?.title&&"string"==typeof n.url&&"string"==typeof n.languageCode&&"string"==typeof n.displayName&&a({label:`${t.catalogMetadata.catalog.title} ${n.displayName}`,language:n.languageCode.toLowerCase(),url:n.url,extension:(0,e.YU)(n.url,"dfxp")})},waitForBasename:!1})})();