1import{a as U}from"./chunk-BWXZEPBL.js";import"./chunk-OYNRP6MQ.js";import"./chunk-SEZWLEIJ.js";import"./chunk-GENQOKDX.js";import"./chunk-AG4QL2DO.js";import"./chunk-TBV4UZNX.js";import"./chunk-G3NM4LJ6.js";import"./chunk-CR6SM6H2.js";import"./chunk-V4OUT66V.js";import"./chunk-ABEOKCRC.js";import"./chunk-RKR3PV64.js";import"./chunk-CMBM2T6I.js";import{a as j}from"./chunk-UGZAR2UL.js";import"./chunk-3ZRUJ4CX.js";import"./chunk-QW7DBYYJ.js";import"./chunk-DWNZ5FNC.js";import"./chunk-N5NWG5FY.js";import{b as z,f as N}from"./chunk-BI27AAAN.js";import"./chunk-M5LALES5.js";import"./chunk-PT2NOXDG.js";import"./chunk-DTL7QM7N.js";import"./chunk-7RA2IJ2E.js";import"./chunk-5GBSNZOW.js";import"./chunk-7FHUT3JE.js";import{a as A,b as L}from"./chunk-ORG6X553.js";import"./chunk-SV45VXJJ.js";import"./chunk-HUJARPMZ.js";import"./chunk-4YBAZSHS.js";import"./chunk-PU5YZGKQ.js";import"./chunk-OLHHGXZN.js";import"./chunk-DBA44QWQ.js";import"./chunk-3GDD2Y6P.js";import{m as R}from"./chunk-WDXC2KYD.js";import"./chunk-ONZKB5CH.js";import"./chunk-T4ZSFXYG.js";import"./chunk-P47ABIHR.js";import"./chunk-53PDRIEQ.js";import"./chunk-QMZE6H57.js";import"./chunk-UUZAEKOK.js";import"./chunk-OYWHTECT.js";import"./chunk-B6ML3TBS.js";import"./chunk-7VPF77TY.js";import"./chunk-X2HFMDUG.js";import"./chunk-4SSS2OJZ.js";import"./chunk-3XIPWIBB.js";import{c as k,e as V}from"./chunk-WAWFYPMX.js";import{a as E,b as D}from"./chunk-7MQTEMAJ.js";import"./chunk-HTCLQCOU.js";import"./chunk-6XPI5QYW.js";import"./chunk-YWMD53KQ.js";import{b as O,g as P,j as T}from"./chunk-A6AWQOXQ.js";import"./chunk-PJ5GV7IK.js";import{i as M,x as I}from"./chunk-EDUSMAQY.js";import{Ab as S,Bb as _,Da as c,Xa as s,Ya as i,Za as n,_a as m,fb as C,gc as y,ia as d,jb as b,k as l,lb as p,p as u,q as x,xa as w,xb as v,zb as o}from"./chunk-FFQQO7O7.js";import"./chunk-ID4WHIPA.js";import"./chunk-QUA7QOZA.js";import{a as g,b as h}from"./chunk-C6Q5SG76.js";function F(r,t){if(r&1&&(i(0,"div",14)(1,"div",15)(2,"mat-icon"),o(3,"update"),n(),i(4,"span")(5,"strong"),o(6,"Last updated"),n(),o(7),n()(),i(8,"div",15)(9,"mat-icon"),o(10,"cloud_done"),n(),i(11,"span")(12,"strong"),o(13,"Data updated"),n(),o(14),n()()()),r&2){let e=p();d(7),_(" ",e.formatDateTime(e.report.linkUpdatedAt||e.report.createdAt)),d(7),_(" ",e.formatDataUpdated(e.report.dataUpdatedAt))}}function W(r,t){if(r&1){let e=C();i(0,"div",16)(1,"button",17),b("click",function(){u(e);let f=p();return x(f.setActiveTab("dashboard"))}),i(2,"mat-icon"),o(3,"dashboard"),n(),o(4," Dashboard "),n(),i(5,"button",17),b("click",function(){u(e);let f=p();return x(f.setActiveTab("intelligence"))}),i(6,"mat-icon"),o(7,"psychology"),n(),o(8," Intelligence "),n()()}if(r&2){let e=p();d(),v("active",e.activeTab==="dashboard"),d(4),v("active",e.activeTab==="intelligence")}}function G(r,t){r&1&&(i(0,"div",18),m(1,"mat-spinner",19),i(2,"p",20),o(3,"Preparing your shared analysis..."),n()())}function K(r,t){if(r&1&&(i(0,"div",21)(1,"mat-icon",22),o(2,"link_off"),n(),i(3,"h2"),o(4,"Link Inactive"),n(),i(5,"p"),o(6),n(),i(7,"button",23),o(8,"Go to Website"),n()()),r&2){let e=p();d(6),S(e.error)}}function $(r,t){if(r&1&&(i(0,"div",26),m(1,"app-dashboard",27),n()),r&2){let e=p(2);d(),s("isSharedView",!0)("sharedOrgId",e.report.orgId)("sharedAccountId",e.report.accountId)}}function q(r,t){if(r&1&&(i(0,"div",26),m(1,"app-intelligence",28),n()),r&2){let e=p(2);d(),s("isSharedView",!0)("sharedOrgId",e.report.orgId)("sharedAccountId",e.report.accountId)("lockedLiteView",e.report.config.lockedLiteView||!1)}}function H(r,t){if(r&1&&(i(0,"main",24),c(1,$,2,3,"div",25)(2,q,2,4,"div",25),n()),r&2){let e=p();d(),s("ngIf",e.showDashboard),d(),s("ngIf",e.showIntelligence)}}var B=class r{route=l(O);shareService=l(N);firestore=l(R);cdr=l(y);report=null;isLoading=!0;error=null;activeTab="dashboard";get showDashboard(){return this.report?this.report.reportType==="dashboard"||this.report.reportType==="combined"&&this.activeTab==="dashboard":!1}get showIntelligence(){return this.report?this.report.reportType==="intelligence"||this.report.reportType==="combined"&&this.activeTab==="intelligence":!1}setActiveTab(t){this.activeTab=t,this.cdr.detectChanges()}
1async ngOnInit(){let t=this.route.snapshot.paramMap.get("token");if(!t){this.error="No share token provided.",this.isLoading=!1,this.cdr.detectChanges();return}try{let e=decodeURIComponent((window.location.hash||"").replace(/^#/,"")),a=await this.shareService.getSharedReportView(t,e);if(this.report=this.withAllSharedModules(a.report),this.report){if(this.report.isActive===!1){this.error="Access to this report has been revoked by the owner.",this.report=null;return}this.report.reportType==="intelligence"&&(this.activeTab="intelligence"),this.firestore.loadSharedReportData(a.data),this.cdr.detectChanges()}else this.error="This share link doesn't exist or has been deleted."}catch(e){this.error=`Failed to load the shared report. ${this.errorMessage(e)}`,console.error(e)}finally{this.isLoading=!1,this.cdr.detectChanges()}}ngOnDestroy(){this.firestore.setSharedMode(!1)}errorMessage(t){return t instanceof Error&&t.message?t.message:"Please try again later."}formatDateTime(t){let e=z(t);return e==null?"Not available":new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}formatDataUpdated(t){return t?this.formatDateTime(t):"No imports yet"}withAllSharedModules(t){return h(g({},t),{reportType:"combined",config:h(g({},t.config||{}),{lockedLiteView:!0,includeIntelligence:!0})})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-shared-view"]],decls:20,vars:5,consts:[[1,"shared-container"],[1,"shared-header"],[1,"brand"],[2,"display","flex","align-items","center","gap","8px"],["color","primary",2,"font-size","32px","width","32px","height","32px"],[2,"font-weight","800","font-size","1.2rem","letter-spacing","-0.5px","color","#1e293b"],[2,"color","#2563eb"],[1,"badge"],["class","report-updates","aria-label","Shared report update information",4,"ngIf"],["class","report-tabs",4,"ngIf"],["class","loading-overlay",4,"ngIf"],["class","error-state",4,"ngIf"],["class","content",4,"ngIf"],[1,"shared-footer"],["aria-label","Shared report update information",1,"report-updates"],[1,"update-note"],[1,"report-tabs"],["type","button",1,"tab-btn",3,"click"],[1,"loading-overlay"],["diameter","40"],[2,"margin-top","16px","color","#64748b"],[1,"error-state"],[1,"error-icon"],["mat-flat-button","","color","primary","routerLink","/"],[1,"content"],["class","report-section",4,"ngIf"],[1,"report-section"],[3,"isSharedView","sharedOrgId","sharedAccountId"],[3,"isSharedView","sharedOrgId","sharedAccountId","lockedLiteView"]],template:function(e,a){e&1&&(i(0,"div",0)(1,"header",1)(2,"div",2)(3,"div",3)(4,"mat-icon",4),o(5,"analytics"),n(),i(6,"span",5),o(7,"NWC "),i(8,"span",6),o(9,"ADS"),n()()(),i(10,"span",7),o(11,"Public Shared Report"),n()(),c(12,F,15,2,"div",8)(13,W,9,4,"div",9),n(),c(14,G,4,0,"div",10)(15,K,9,1,"div",11)(16,H,3,2,"main",12),i(17,"footer",13)(18,"p"),o(19,"\xA9 2026 Northwest Coast Digital - Ads Intelligence Platform. Professional reporting for Amazon Advertisers."),n()()()),e&2&&(d(12),s("ngIf",a.report&&!a.isLoading&&!a.error),d(),s("ngIf",(a.report==null?null:a.report.reportType)==="combined"&&!a.isLoading&&!a.error),d(),s("ngIf",a.isLoading),d(),s("ngIf",a.error),d(),s("ngIf",a.report&&!a.isLoading))},dependencies:[I,M,T,P,L,A,D,E,V,k,j,U],styles:[".shared-container[_ngcontent-%COMP%]{min-height:100vh;display:flex;flex-direction:column;background:#f8fafc}.shared-header[_ngcontent-%COMP%]{background:#fff;padding:12px 32px;display:flex;justify-content:space-between;align-items:center;gap:24px;border-bottom:1px solid #e2e8f0;position:sticky;top:0;z-index:1000;box-shadow:0 1px 3px #0000000d}.brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.badge[_ngcontent-%COMP%]{background:#eff6ff;color:#2563eb;font-size:.7rem;font-weight:700;padding:4px 10px;border-radius:99px;text-transform:uppercase;letter-spacing:.05em}.report-updates[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:20px;margin-left:auto;color:#64748b}.update-note[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:.78rem;white-space:nowrap}.update-note[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2563eb;font-size:17px;width:17px;height:17px}.update-note[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#334155;font-weight:700}.report-tabs[_ngcontent-%COMP%]{display:flex;gap:4px;background:#f1f5f9;padding:4px;border-radius:8px}.tab-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 16px;border:none;background:transparent;font-family:Outfit,sans-serif;font-weight:600;color:#64748b;cursor:pointer;border-radius:6px;transition:all .2s}.tab-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.tab-btn.active[_ngcontent-%COMP%]{background:#fff;color:#2563eb;box-shadow:0 1px 3px #0000001a}.content[_ngcontent-%COMP%]{flex:1;padding:24px;max-width:1600px;margin:0 auto;width:100%}.report-section[_ngcontent-%COMP%]{margin-bottom:0}.loading-overlay[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;
1height:64px;color:#ef4444;margin-bottom:16px}.shared-footer[_ngcontent-%COMP%]{padding:32px;text-align:center;color:#94a3b8;font-size:.85rem;border-top:1px solid #e2e8f0}@media(max-width:1000px){.shared-header[_ngcontent-%COMP%]{flex-wrap:wrap}.report-updates[_ngcontent-%COMP%]{order:3;width:100%;justify-content:flex-start;margin-left:0}}@media(max-width:640px){.shared-header[_ngcontent-%COMP%]{padding:12px 16px}.brand[_ngcontent-%COMP%]{flex-wrap:wrap;gap:8px}.report-updates[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column;gap:6px}.report-tabs[_ngcontent-%COMP%]{width:100%}.tab-btn[_ngcontent-%COMP%]{flex:1;justify-content:center;padding:8px}}"]})};export{B as SharedViewComponent};
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.