1import{x as N}from"./chunk-NGADLQNA.js";import{$a as c,Aa as y,Ba as I,Ea as T,Fa as r,Ga as v,Pa as g,Qc as D,Sa as l,Ua as M,Uc as k,Wb as z,Y as u,Za as o,_a as i,a as E,ca as F,da as _,db as P,eb as h,fb as p,gc as j,hc as R,ka as x,la as C,mb as b,nb as O,ob as S,qb as d,rb as m,sb as w,wc as V}from"./chunk-ZBB2FDI3.js";import"./chunk-MRT7IOGV.js";import"./chunk-AG43DLNM.js";import"./chunk-TQIZSBFB.js";import"./chunk-US5ASVOF.js";import"./chunk-NIJN5YNO.js";import"./chunk-OX62P4D5.js";var q=["videoPlayer"],$=["speedControlRef"];function K(t,s){t&1&&(o(0,"div",6)(1,"div",7),c(2,"i",8),i(),o(3,"h2"),d(4,"Loading..."),i(),o(5,"p"),d(6,"Fetching your file"),i()())}function Y(t,s){t&1&&(o(0,"div",6)(1,"div",9),c(2,"i",10),i(),o(3,"h2"),d(4,"Still Uploading"),i(),o(5,"p"),d(6,"This file is being uploaded. Please wait a moment..."),i(),o(7,"div",11),c(8,"div",12)(9,"div",12)(10,"div",12),i(),o(11,"p",13),d(12,"This page will automatically update when the file is ready."),i()())}function G(t,s){t&1&&(o(0,"div",6)(1,"div",14),c(2,"i",15),i(),o(3,"h2"),d(4,"File Not Found"),i(),o(5,"p"),d(6,"This file doesn't exist or may have been removed."),i()())}function J(t,s){t&1&&c(0,"i",29)}function W(t,s){if(t&1){let e=P();o(0,"button",27),h("click",function(){let a=x(e).$implicit,f=p(3);return C(f.setPlaybackSpeed(a))}),d(1),g(2,J,1,0,"i",28),i()}if(t&2){let e=s.$implicit,n=p(3);M("active",n.playbackSpeed===e),r(),w(" ",n.formatSpeed(e)," "),r(),l("ngIf",n.playbackSpeed===e)}}function X(t,s){if(t&1&&(o(0,"div",25),g(1,W,3,4,"button",26),i()),t&2){let e=p(2);r(),l("ngForOf",e.speedOptions)}}function Z(t,s){if(t&1){let e=P();o(0,"div",16)(1,"div",17)(2,"h1"),d(3),i(),o(4,"div",18,0)(6,"button",19),h("click",function(){x(e);let a=p();return C(a.toggleSpeedMenu())}),c(7,"i",20),o(8,"span"),d(9),i(),c(10,"i",21),i(),g(11,X,2,1,"div",22),i()(),o(12,"div",23)(13,"video",24,1),h("loadedmetadata",function(){x(e);let a=p();return C(a.applyPlaybackSpeed())}),i()()()}if(t&2){let e=p();r(3),m(e.displayTitle),r(6),m(e.formatSpeed(e.playbackSpeed)),r(),M("open",e.showSpeedMenu),r(),l("ngIf",e.showSpeedMenu),r(2),l("src",e.media==null?null:e.media.url,y)}}function ee(t,s){if(t&1&&(o(0,"div",16)(1,"div",17)(2,"h1"),d(3),i()(),o(4,"div",30),c(5,"img",31),i()()),t&2){let e=p();r(3),m(e.displayTitle),r(2),l("src",e.media==null?null:e.media.url,y)("alt",e.displayTitle)}}function te(t,s){if(t&1&&(o(0,"div",16)(1,"div",17)(2,"h1"),d(3),i()(),o(4,"div",32),c(5,"iframe",33),i()()),t&2){let e=p();r(3),m(e.displayTitle),r(2),l("src",e.media==null?null:e.media.url,I)}}function ne(t,s){if(t&1&&(o(0,"p",39),d(1),i()),t&2){let e=p(2);r(),w(".",e.media==null?null:e.media.fileExtension,"")}}function ie(t,s){if(t&1&&(o(0,"div",16)(1,"div",17)(2,"h1"),d(3),i()(),o(4,"div",34)(5,"div",35),c(6,"i",36),i(),o(7,"p",37),d(8),i(),g(9,ne,2,1,"p",38),i()()),t&2){let e=p();r(3),m(e.displayTitle),r(5),m((e.media==null?null:e.media.file)||"Unknown file"),r(),l("ngIf",e.media==null?null:e.media.fileExtension)}}var A="platfio-video-playback-speed",Q=[1,1.25,1.5,1.75,2,2.25,2.5,2.75,3],U=(()=>{class t{constructor(e,n,a){this.route=e,this.afs=n,this.cdr=a,this.fileId=null,this.media=null,this.state="loading",this.playbackSpeed=1,this.speedOptions=Q,this.showSpeedMenu=!1,this.subscription=new E}ngOnInit(){this.loadPlaybackSpeed(),this.subscription.add(this.route.paramMap.subscribe(e=>{this.fileId=e.get("fileId"),this.fileId?this.loadMedia(this.fileId):(this.state="not-found",this.cdr.markForCheck())}))}ngAfterViewInit(){this.applyPlaybackSpeed()}ngOnDestroy(){this.subscription.unsubscribe()}loadMedia(e){this.state="loading",this.cdr.markForCheck(),this.subscription.add(this.afs.doc(`media/${e}`).valueChanges().subscribe({next:n=>{n?n.url?(this.state="ready",this.media=n):(this.state="uploading",this.media=n):(this.state="not-found",this.media=null),this.cdr.markForCheck()},error:n=>{console.error("Error loading media:",n),this.state="not-found",this.cdr.markForCheck()}}))}get isVideo(){return this.media?this.media.type==="video"||this.media.fileExtension==="webm"||this.media.fileExtension==="mp4":!1}get isImage(){if(!this.media)return!1;let e=["png","jpg","jpeg","gif","webp","svg"];return this.media.type==="image"||e.includes(this.media.fileExtension?.toLowerCase()||"")}get isPdf(){return this.media?this.media.type==="pdf"||this.media.fileExtension==="pdf":!1}get displayTitle(){return this.media?.title?this.media.title:this.media?.file?this.media.file:"Shared File"}loadPlaybackSpeed(){let e=localStorage.getItem(A);if(e){let n=parseFloat(e);Q.includes(n)&&(this.playbackSpeed=n)}}applyPlaybackSpeed(){setTimeout(()=>{this.videoPlayer?.nativeElement&&(this.videoPlayer.nativeElement.playbackRate=this.playbackSpeed)},0)}setPlaybackSpeed(e){this.playbackSpeed=e,localStorage.setItem(A,e.toString()),this.videoPlayer?.nativeElement&&(this.videoPlayer.nativeElement.playbackRate=e),this.showSpeedMenu=!1,this.cdr.markForCheck()}toggleSpeedMenu(){this.showSpeedMenu=!this.showSpeedMenu,this.cdr.markForCheck()}onDocumentClick(e){this.showSpeedMenu&&this.speedControlRef&&(this.speedControlRef.nativeElement.contains(e.target)||(this.showSpeedMenu=!1,this.cdr.markForCheck()))}formatSpeed(e){return e===1?"Normal":e+"x"}copyLink(){let e=window.location.href;navigator.clipboard.writeText(e).then(()=>{})}downloadFile(){this.media?.url&&window.open(this.media.url,"_blank")}static{this.\u0275fac=function(n){return new(n||t)(v(D),v(N),v(z))}}static{this.\u0275cmp=F({type:t,selectors:[["app-file-share"]],viewQuery:function(n,a){if(n&1&&(b(q,5),b($,5)),n&2){let f;O(f=S())&&(a.videoPlayer=f.first),O(f=S())&&(a.speedControlRef=f.first)}},hostBindings:function(n,a){n&1&&h("click",function(H){return a.onDocumentClick(H)},!1,T)},decls:9,vars:7,consts:[["speedControlRef",""],["videoPlayer",""],[1,"file-share-page"],[1,"container"],["class","state-card",4,"ngIf"],["class","file-card",4,"ngIf"],[1,"state-card"],[1,"state-icon","loading"],[1,"fa-solid","fa-spinner","fa-spin"],[1,"state-icon","uploading"],[1,"fa-solid","fa-cloud-arrow-up"],[1,"upload-animation"],[1,"dot"],[1,"hint"],[1,"state-icon","not-found"],[1,"fa-solid","fa-file-circle-question"],[1,"file-card"],[1,"file-header"],[1,"speed-control"],[1,"speed-button",3,"click"],[1,"fa-solid","fa-gauge-high"],[1,"fa-solid","fa-chevron-down","chevron"],["class","speed-menu",4,"ngIf"],[1,"video-container"],["controls","","autoplay","","playsinline","","preload","auto",1,"video-player",3,"loadedmetadata","
1src"],[1,"speed-menu"],["class","speed-option",3,"active","click",4,"ngFor","ngForOf"],[1,"speed-option",3,"click"],["class","fa-solid fa-check",4,"ngIf"],[1,"fa-solid","fa-check"],[1,"image-container"],[1,"image-preview",3,"src","alt"],[1,"pdf-container"],[1,"pdf-viewer",3,"src"],[1,"generic-file"],[1,"file-icon"],[1,"fa-solid","fa-file"],[1,"file-name"],["class","file-type",4,"ngIf"],[1,"file-type"]],template:function(n,a){n&1&&(o(0,"div",2)(1,"div",3),g(2,K,7,0,"div",4)(3,Y,13,0,"div",4)(4,G,7,0,"div",4)(5,Z,15,6,"div",5)(6,ee,6,3,"div",5)(7,te,6,2,"div",5)(8,ie,10,3,"div",5),i()()),n&2&&(r(2),l("ngIf",a.state==="loading"),r(),l("ngIf",a.state==="uploading"),r(),l("ngIf",a.state==="not-found"),r(),l("ngIf",a.state==="ready"&&a.isVideo),r(),l("ngIf",a.state==="ready"&&a.isImage),r(),l("ngIf",a.state==="ready"&&a.isPdf),r(),l("ngIf",a.state==="ready"&&!a.isVideo&&!a.isImage&&!a.isPdf))},dependencies:[j,R],styles:[".file-share-page[_ngcontent-%COMP%]{min-height:100vh;background:linear-gradient(135deg,#f8f9fa,#e9ecef);padding:40px 20px;display:flex;align-items:flex-start;justify-content:center}.container[_ngcontent-%COMP%]{width:100%;max-width:916px}.state-card[_ngcontent-%COMP%]{background:#fff;border-radius:16px;box-shadow:0 4px 20px #00000014;padding:60px 40px;text-align:center}.state-card[_ngcontent-%COMP%] .state-icon[_ngcontent-%COMP%]{width:80px;height:80px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 24px;font-size:36px}.state-card[_ngcontent-%COMP%] .state-icon.loading[_ngcontent-%COMP%]{background:#e3f2fd;color:#1976d2}.state-card[_ngcontent-%COMP%] .state-icon.uploading[_ngcontent-%COMP%]{background:#fff3e0;color:#f57c00;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite}.state-card[_ngcontent-%COMP%] .state-icon.not-found[_ngcontent-%COMP%]{background:#ffebee;color:#d32f2f}.state-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#1a1a1a;margin:0 0 8px}.state-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:16px;color:#666;margin:0}.state-card[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin-top:16px;font-size:14px;color:#999}.upload-animation[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:8px;margin-top:24px}.upload-animation[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{width:12px;height:12px;background:#f57c00;border-radius:50%;animation:_ngcontent-%COMP%_bounce 1.4s ease-in-out infinite}.upload-animation[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]:nth-child(1){animation-delay:0s}.upload-animation[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.upload-animation[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_bounce{0%,80%,to{transform:scale(.6);opacity:.5}40%{transform:scale(1);opacity:1}}@keyframes _ngcontent-%COMP%_pulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}.file-card[_ngcontent-%COMP%]{background:#fff;border-radius:16px;box-shadow:0 4px 20px #00000014;overflow:hidden}.file-header[_ngcontent-%COMP%]{padding:24px 32px;display:flex;align-items:center;justify-content:space-between;gap:16px}.file-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:20px;font-weight:600;color:#1a1a1a;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.file-header[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:14px;color:#666;margin:8px 0 0;line-height:1.5}.speed-control[_ngcontent-%COMP%]{position:relative;flex-shrink:0}.speed-button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#f5f5f5;border:1px solid #e0e0e0;border-radius:8px;font-size:14px;font-weight:500;color:#333;cursor:pointer;transition:all .2s ease}.speed-button[_ngcontent-%COMP%]:hover{background:#ebebeb;border-color:#d0d0d0}.speed-button[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:12px;color:#666}.speed-button[_ngcontent-%COMP%] .chevron[_ngcontent-%COMP%]{font-size:10px;transition:transform .2s ease}.speed-button[_ngcontent-%COMP%] .chevron.open[_ngcontent-%COMP%]{transform:rotate(180deg)}.speed-menu[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 4px);right:0;background:#fff;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 4px 16px #0000001f;min-width:120px;z-index:100;overflow:hidden}.speed-option[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 14px;background:none;border:none;font-size:14px;color:#333;cursor:pointer;transition:background .15s ease}.speed-option[_ngcontent-%COMP%]:hover{background:#f5f5f5}.speed-option.active[_ngcontent-%COMP%]{background:#e3f2fd;color:#1976d2;font-weight:500}.speed-option[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:12px;color:#1976d2}.video-container[_ngcontent-%COMP%]{background:#000;position:relative;width:100%;aspect-ratio:16/9}.video-player[_ngcontent-%COMP%]{width:100%;height:100%;display:block;object-fit:contain}.image-container[_ngcontent-%COMP%]{background:#f5f5f5;display:flex;align-items:center;justify-content:center;padding:20px;min-height:200px}.image-preview[_ngcontent-%COMP%]{max-width:100%;max-height:70vh;border-radius:8px;box-shadow:0 2px 10px #0000001a}.pdf-container[_ngcontent-%COMP%]{background:#f5f5f5;height:70vh}.pdf-viewer[_ngcontent-%COMP%]{width:100%;height:100%;border:none}.generic-file[_ngcontent-%COMP%]{padding:60px 40px;text-align:center}.generic-file[_ngcontent-%COMP%] .file-icon[_ngcontent-%COMP%]{width:100px;height:100px;background:#f5f5f5;border-radius:16px;display:flex;align-items:center;justify-content:center;margin:0 auto 20px;font-size:48px;color:#666}
1.generic-file[_ngcontent-%COMP%] .file-name[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:#1a1a1a;margin:0 0 4px;word-break:break-all}.generic-file[_ngcontent-%COMP%] .file-type[_ngcontent-%COMP%]{font-size:14px;color:#999;text-transform:uppercase;margin:0}.file-actions[_ngcontent-%COMP%]{padding:20px 32px;border-top:1px solid #eee;display:flex;justify-content:flex-end;gap:12px}.btn-primary[_ngcontent-%COMP%], .btn-secondary[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s ease;border:none}.btn-primary[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .btn-secondary[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px}.btn-primary[_ngcontent-%COMP%]{background:#1976d2;color:#fff}.btn-primary[_ngcontent-%COMP%]:hover{background:#1565c0}.btn-secondary[_ngcontent-%COMP%]{background:#f5f5f5;color:#333}.btn-secondary[_ngcontent-%COMP%]:hover{background:#e8e8e8}@media (max-width: 600px){.file-share-page[_ngcontent-%COMP%]{padding:20px 12px}.state-card[_ngcontent-%COMP%]{padding:40px 24px}.state-card[_ngcontent-%COMP%] .state-icon[_ngcontent-%COMP%]{width:64px;height:64px;font-size:28px}.state-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:20px}.file-header[_ngcontent-%COMP%]{padding:16px 20px}.file-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:18px}.file-actions[_ngcontent-%COMP%]{padding:16px 20px;flex-direction:column}.file-actions[_ngcontent-%COMP%] .btn-primary[_ngcontent-%COMP%], .file-actions[_ngcontent-%COMP%] .btn-secondary[_ngcontent-%COMP%]{justify-content:center}.generic-file[_ngcontent-%COMP%]{padding:40px 24px}.generic-file[_ngcontent-%COMP%] .file-icon[_ngcontent-%COMP%]{width:80px;height:80px;font-size:36px}}"],changeDetection:0})}}return t})();var oe=[{path:"",component:U}],B=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=_({type:t})}static{this.\u0275inj=u({imports:[k.forChild(oe),k]})}}return t})();var _e=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=_({type:t})}static{this.\u0275inj=u({imports:[V,B]})}}return t})();export{_e as FileShareModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.