Quantumbraid's picture
download
raw
10.1 kB
"use strict";exports.id=5699,exports.ids=[5699],exports.modules={70576:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(21124),e=c(38301);function f(a,b,c){return Math.min(c,Math.max(b,a))}function g(a){if(!isFinite(a)||a<0)return"0:00";let b=Math.floor(a%60),c=Math.floor(a/60);return`${c}:${String(b).padStart(2,"0")}`}function h({src:a,title:b="Audio",subtitle:c,defaultAlbumArtUrl:h,className:i="",autoPlay:j=!1,onPlay:k,onPause:l}){let m=(0,e.useRef)(`aud_${Math.random().toString(16).slice(2)}_${Date.now()}`),n=(0,e.useRef)(null),o=(0,e.useRef)(null),p=(0,e.useRef)(null),q=(0,e.useRef)(null),[r,s]=(0,e.useState)(256),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(0),[D,E]=(0,e.useState)(0),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(0),[J,K]=(0,e.useState)(null),L=(0,e.useRef)(null),M=(0,e.useRef)(null),N=(0,e.useRef)(null),O=(0,e.useRef)(null),P=(0,e.useRef)(0),Q=(0,e.useMemo)(()=>{let a=F?H:D;return B?f(a/B,0,1):0},[D,B,F,H]),R=Math.max(0,(B||0)-(F?H:D));async function S(){let a=o.current;if(a){var b;A(null),b=m.current,window.dispatchEvent(new CustomEvent("app:exclusive-audio-play",{detail:{token:b}}));try{!function(){if(L.current)return;let a=o.current;if(!a)return;let b=window.AudioContext||window.webkitAudioContext;if(!b)return;let c=new b,d=c.createMediaElementSource(a),e=c.createAnalyser();e.fftSize=2048,e.smoothingTimeConstant=.85,d.connect(e),e.connect(c.destination),L.current=c,M.current=e,N.current=new Uint8Array(e.fftSize)}(),L.current&&"suspended"===L.current.state&&await L.current.resume(),await a.play(),k?.(),function(){if(null!=O.current)return;let a=()=>{O.current=requestAnimationFrame(a);let b=M.current,c=N.current,d=0;if(b&&c){b.getByteTimeDomainData(c);let a=0;for(let b=0;b<c.length;b++)a+=Math.abs(c[b]-128);d=a/c.length/128}let e=P.current,g=e+(d-e)*.12;P.current=g;let h=o.current,i=F?H:h?.currentTime??D;!function(a,b,c,d){let e=q.current;if(!e)return;let f=e.getContext("2d");if(!f)return;let g=e.width,h=e.height;if(f.clearRect(0,0,g,h),!b||!c)return;b.getByteTimeDomainData(c);let i=Math.floor(g*d);f.fillStyle="rgba(251,191,36,0.10)",f.fillRect(0,0,i,h),function(a,b,c,d,e){let f=.5*d,g=d*(.26+.3*e);a.beginPath();for(let d=0;d<b.length;d++){let e=d/(b.length-1)*c,h=f+(b[d]-128)/128*g;0===d?a.moveTo(e,h):a.lineTo(e,h)}}(f,c,g,h,a),f.strokeStyle="rgba(251,191,36,0.70)",f.lineWidth=Math.max(2,Math.floor(.02*h)),f.stroke()}(g,b,c,B>0?f(i/B,0,1):0)};O.current=requestAnimationFrame(a)}()}catch{A("Playback was blocked or failed.")}}}function T(a){let b=o.current;b&&isFinite(B)&&!(B<=0)&&(b.currentTime=f(a,0,B),E(b.currentTime))}function U(a){let b=p.current;if(!b||!B)return 0;let c=b.getBoundingClientRect();return f((a-c.left)/c.width,0,1)*B}let V=f(Math.round(.06*r),12,36),W=f(Math.round(.05*r),12,22),X=f(Math.round(.035*r),10,16),Y=f(Math.round(.04*r),11,18),Z=f(Math.round(.035*r),10,16),$=f(Math.round(.065*r),16,30),_=f(Math.round(.3*r),76,260),aa=Math.round(.4*_),ab=f(Math.round(.55*_),42,140),ac=Math.round(.5*ab),ad=Math.round(1.3*Y+Z+.9*V),ae=J||(h??null);return(0,d.jsxs)("div",{ref:n,className:`relative h-full w-full overflow-hidden bg-gray-900 ${i}`,children:[ae?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${ae})`}}),(0,d.jsx)("div",{className:"absolute inset-0 bg-gray-900/50"})]}):null,(0,d.jsxs)("div",{className:"relative z-10 flex h-full w-full flex-col",style:{padding:V},children:[(0,d.jsxs)("div",{className:"min-h-0",children:[(0,d.jsx)("div",{className:"truncate text-gray-200",style:{fontSize:W,lineHeight:1.1,letterSpacing:"0.01em"},children:b}),c?(0,d.jsx)("div",{className:"mt-1 truncate text-gray-400",style:{fontSize:X,lineHeight:1.15},children:c}):null,z?(0,d.jsx)("div",{className:"mt-2 text-gray-300",style:{fontSize:X},children:z}):t?null:(0,d.jsx)("div",{className:"mt-2 text-gray-500",style:{fontSize:X},children:"Loading…"})]}),(0,d.jsxs)("div",{className:"mt-3 flex-1 min-h-0",children:[(0,d.jsxs)("div",{className:"group relative w-full overflow-hidden rounded-lg border border-2 border-yellow-400 bg-gray-900/80",style:{height:`calc(100% - ${ad}px)`},children:[(0,d.jsx)("canvas",{ref:q,className:"h-full w-full"}),(0,d.jsxs)("div",{className:"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center gap-3",children:[(0,d.jsx)("button",{onClick:function(){T(0)},className:"rounded-full border border-gray-700 bg-gray-950/80 text-gray-200 transition group-hover:border-gray-600 group-hover:bg-gray-950/90 focus:outline-none focus:ring-2 focus:ring-gray-500/40",style:{width:ab,height:ab},"aria-label":"Restart",title:"Restart",children:(0,d.jsx)("svg",{width:ac,height:ac,viewBox:"0 0 24 24",className:"mx-auto","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M12 5a7 7 0 1 1-6.4 4H3l3.5-3.5L10 9H7.8A5 5 0 1 0 12 7v-2z",fill:"currentColor"})})}),(0,d.jsxs)("button",{onClick:function(){let a=o.current;if(a)if(a.paused)S();else{let a=o.current;a&&(a.pause(),l?.(),null!=O.current&&(cancelAnimationFrame(O.current),O.current=null),P.current=0)}},className:"rounded-full border border-gray-700 bg-gray-950/80 text-gray-200 transition group-hover:border-gray-600 group-hover:bg-gray-950/90 focus:outline-none focus:ring-2 focus:ring-gray-500/40",style:{width:_,height:_},"aria-label":v?"Pause":"Play",title:v?"Pause":"Play",children:[v?(0,d.jsx)("svg",{width:aa,height:aa,viewBox:"0 0 24 24",className:"mx-auto","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M7 6h3v12H7zM14 6h3v12h-3z",fill:"currentColor"})}):(0,d.jsx)("svg",{width:aa,height:aa,viewBox:"0 0 24 24",className:"mx-auto","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M8.5 5.5v13l11-6.5-11-6.5z",fill:"currentColor"})}),x?(0,d.jsx)("div",{className:"absolute -bottom-7 left-1/2 -translate-x-1/2 text-xs text-gray-300",children:"Buffering…"}):null]})]})]}),(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between tabular-nums text-gray-300",style:{fontSize:Y},children:[(0,d.jsx)("div",{children:g(F?H:D)}),(0,d.jsx)("div",{children:B?`-${g(R)}`:"0:00"})]}),(0,d.jsxs)("div",{ref:p,className:"mt-2 relative w-full cursor-pointer select-none rounded-full bg-gray-800",style:{height:Z},onPointerDown:function(a){B&&(a.currentTarget.setPointerCapture(a.pointerId),G(!0),I(U(a.clientX)))},onPointerMove:function(a){F&&B&&I(U(a.clientX))},onPointerUp:function(a){if(!B)return;let b=U(a.clientX);G(!1),I(0),T(b)},onPointerCancel:()=>G(!1),title:"Scrub",children:[(0,d.jsx)("div",{className:"absolute left-0 top-0 h-full rounded-full bg-gray-600",style:{width:`${100*Q}%`,transition:F?"none":"width 80ms linear"}}),(0,d.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 rounded-full bg-gray-200",style:{left:`calc(${100*Q}% - ${Math.floor($/2)}px)`,width:$,height:$,transform:`translateY(-50%) scale(${F?1.08:1})`,transition:"transform 120ms ease-out"}})]})]})]})]}),(0,d.jsx)("audio",{ref:o,preload:"metadata"})]})}c(74776),c(38934)},93350:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(38301),e=c(74776);class f{reset(){this.lines=[""],this.row=0,this.col=0,this.pending=""}write(a){let b=this.pending+a;this.pending="";let c=b.length,d=0;for(;d<c;){let a=b.charCodeAt(d);if(27===a){let a=this.consumeEscape(b,d);if(0===a){c-d<=4096&&(this.pending=b.slice(d));return}d+=a}else if(13===a)this.col=0,d++;else if(10===a)this.newline(),d++;else if(8===a)this.col>0&&this.col--,d++;else if(9===a)this.putText(" ".repeat(8-this.col%8)),d++;else if(a<32||127===a)d++;else{let a=d+1;for(;a<c;){let c=b.charCodeAt(a);if(c<32||127===c)break;a++}this.putText(b.slice(d,a)),d=a}}}toLines(){return this.lines.slice()}toString(){return this.lines.join("\n")}putText(a){let b=this.lines[this.row];b.length<this.col&&(b=b.padEnd(this.col)),this.lines[this.row]=b.slice(0,this.col)+a+b.slice(this.col+a.length),this.col+=a.length}newline(){this.row++,this.col=0,this.ensureRow();let a=this.lines.length-5e3;a>0&&(this.lines.splice(0,a),this.row=Math.max(0,this.row-a))}ensureRow(){for(;this.lines.length<=this.row;)this.lines.push("")}consumeEscape(a,b){let c=a.length;if(b+1>=c)return 0;let d=a[b+1];if("["===d){let d=b+2;for(;d<c&&/[0-9;?]/.test(a[d]);)d++;for(;d<c&&a[d]>=" "&&a[d]<="/";)d++;if(d>=c)return 0;let e=a[d];return e>="@"&&e<="~"?(this.applyCsi(a.slice(b+2,d),e),d-b+1):2}if("]"===d){for(let d=b+2;d<c;d++){if(7===a.charCodeAt(d))return d-b+1;if(27===a.charCodeAt(d)){if(d+1>=c)return 0;if("\\"===a[d+1])return d-b+2}}return 0}return"M"===d&&(this.row=Math.max(0,this.row-1)),2}applyCsi(a,b){let c=a.replace(/^\?/,"").split(";").map(a=>parseInt(a,10)),d=(a,b)=>{let d=c[a];return Number.isNaN(d)||void 0===d?b:d};switch(b){case"A":case"F":this.row=Math.max(0,this.row-d(0,1)),"F"===b&&(this.col=0);break;case"B":case"e":case"E":this.row+=d(0,1),this.ensureRow(),"E"===b&&(this.col=0);break;case"C":case"a":this.col+=d(0,1);break;case"D":this.col=Math.max(0,this.col-d(0,1));break;case"G":case"`":this.col=Math.max(0,d(0,1)-1);break;case"K":{let a=d(0,0),b=this.lines[this.row];0===a?this.lines[this.row]=b.slice(0,this.col):1===a?this.lines[this.row]=" ".repeat(Math.min(this.col+1,b.length))+b.slice(this.col+1):2===a&&(this.lines[this.row]="");break}case"J":{let a=d(0,0);0===a?(this.lines[this.row]=this.lines[this.row].slice(0,this.col),this.lines.length=this.row+1):(2===a||3===a)&&this.reset()}}}constructor(){this.lines=[""],this.row=0,this.col=0,this.pending=""}}var g=c(38979);function h(a,b=null){let[c,i]=(0,d.useState)(""),j=(0,d.useRef)(null);null===j.current&&(j.current=new f);let k=(0,d.useRef)(!1),l=(0,d.useRef)(null),m=(0,d.useRef)(!1),[n,o]=(0,d.useState)("idle"),p=()=>{if(m.current)return;m.current=!0;let b="loading";k.current&&(b="refreshing"),o(b);let c=l.current;return e.u.get(`/api/jobs/${a}/log`,null!==c?{params:{offset:c}}:void 0).then(a=>a.data).then(a=>{l.current=a.offset??null;let b=j.current;a.reset&&b.reset(),b.write(a.log??""),i(b.toString()),o("success"),k.current=!0}).catch(a=>{console.error("Error fetching log:",a),o("error")}).finally(()=>{m.current=!1})};return(0,g.A)(p,b,[a]),{log:c,status:n,refresh:p}}}};

Xet Storage Details

Size:
10.1 kB
·
Xet hash:
d96889add0743c97ac0f9b93690740168608997171886e94e645e2fe49ce8772

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.