UNPKG

cloudcmd

Version:

File manager for the web with console and editor

2 lines 3.62 kB
(()=>{var t={4299:t=>{"use strict";const e=(t,...n)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),n.length>=t.length)return t(...n);const r=(...r)=>e(t,...n,...r),i=t.length-n.length-1,o=(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,i){return t(...arguments)},function(e,n,r,i,o){return t(...arguments)}])(r)[i];return o||r};t.exports=e},5606:t=>{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function c(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,u=[],a=!1,l=-1;function f(){a&&s&&(a=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!a){var t=c(f);a=!0;for(var e=u.length;e;){for(s=u,u=[];++l<e;)s&&s[l].run();l=-1,e=u.length}s=null,a=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new d(t,e)),1!==u.length||a||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},6790:t=>{"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}(()=>{"use strict";const t=n(5606),e=n(6790),r=n(4299),i="development"===t.env.NODE_ENV,o=r((t,e)=>e.waitUntil(t())),c=r((t,e)=>{const{request:n}=e,{url:r}=n,i=s(r);r.endsWith("/")||/\^\/fs/.test(i)||"GET"===n.method&&"basic"===n.type&&(i.startsWith("/api")||/^socket.io/.test(i)||e.respondWith(t(e)))}),s=t=>new URL(t).pathname,u="cloudcmd: Sat Jul 26 2025 22:53:07 GMT+0300 (Eastern European Summer Time)";self.addEventListener("install",o(async function(){console.info(`cloudcmd: sw: install: ${u}`),await self.skipWaiting()})),self.addEventListener("fetch",c(async function(t){const{request:n}=t,{url:r}=n,o=((t,e)=>"/"!==t?e:new Request("/",{credentials:"same-origin"}))(s(r),t.request),c=await caches.open(u),a=await c.match(n);if(!i&&a)return a;const[l,f]=await e(fetch,o,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(u)).put(t,e)}(n,f.clone()),f)})),self.addEventListener("activate",o(async function(){console.info(`cloudcmd: sw: activate: ${u}`),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))}))})()})(); //# sourceMappingURL=sw.js.map