PageSourceSearch

https://scaleboy.com/chunk-MRUMR3DC.js

js scaleboy.com collected 2026-10-08 05:15:04 UTC 18,583 bytes, 1 lines download raw bytes

1import{a as j}from"./chunk-PTIRYV4N.js";import{a as U}from"./chunk-OYI2L6XI.js";import"./chunk-QXNX7IJ3.js";import{B as $,a as R,d as A,i as L}from"./chunk-TAZI5UEX.js";import"./chunk-W426BUQU.js";import"./chunk-NXSSJQBA.js";import"./chunk-NJTHKUGO.js";import"./chunk-WAFOWGNS.js";import{i as F}from"./chunk-A37OXCA6.js";import{Cb as N,Db as T,Eb as E,Fa as r,Gb as D,I as w,Oa as S,S as _,Ta as b,_a as f,aa as O,ab as x,f as P,gb as n,gc as I,ha as d,hb as o,hc as z,ia as p,ib as C,ja as k,lb as v,nb as g,ob as l,uc as V,vb as a,wb as u,xb as h}from"./chunk-WE2KTPFO.js";import"./chunk-2AVGQ2MQ.js";var B=()=>[];function H(s,e){s&1&&(n(0,"div",10)(1,"p",11),a(2,"Loading notifications..."),o()())}function Y(s,e){if(s&1&&(n(0,"div",12),a(1),o()),s&2){let t=l();r(),h(" ",t.error," ")}}function G(s,e){if(s&1&&(n(0,"div",13)(1,"div",14)(2,"div",15),a(3),o(),n(4,"div",16),a(5,"Total Notifications"),o()(),n(6,"div",14)(7,"div",15),a(8),o(),n(9,"div",16),a(10,"Unread"),o()(),n(11,"div",14)(12,"div",15),a(13),o(),n(14,"div",16),a(15,"This Week"),o()()()),s&2){let t=l();r(3),u(t.stats.total),r(5),u(t.stats.unread),r(5),u(t.stats.thisWeek)}}function J(s,e){if(s&1){let t=v();n(0,"div",17)(1,"div",18)(2,"div",19)(3,"button",20),g("click",function(){d(t);let i=l();return i.filterType="all",p(i.applyFilters())}),a(4," All "),o(),n(5,"button",20),g("click",function(){d(t);let i=l();return i.filterType="order",p(i.applyFilters())}),a(6," \u{1F4E6} Orders "),o(),n(7,"button",20),g("click",function(){d(t);let i=l();return i.filterType="message",p(i.applyFilters())}),a(8," \u{1F4AC} Messages "),o(),n(9,"button",20),g("click",function(){d(t);let i=l();return i.filterType="review",p(i.applyFilters())}),a(10," \u2B50 Reviews "),o(),n(11,"button",20),g("click",function(){d(t);let i=l();return i.filterType="dispute",p(i.applyFilters())}),a(12," \u2696\uFE0F Disputes "),o(),n(13,"button",20),g("click",function(){d(t);let i=l();return i.filterType="system",p(i.applyFilters())}),a(14," \u{1F514} System "),o()(),n(15,"div",21)(16,"label",22)(17,"input",23),E("ngModelChange",function(i){d(t);let m=l();return T(m.showUnreadOnly,i)||(m.showUnreadOnly=i),p(i)}),g("change",function(){d(t);let i=l();return p(i.applyFilters())}),o(),n(18,"span"),a(19,"Show unread only"),o()()()()()}if(s&2){let t=l();r(3),x("active",t.filterType==="all"),r(2),x("active",t.filterType==="order"),r(2),x("active",t.filterType==="message"),r(2),x("active",t.filterType==="review"),r(2),x("active",t.filterType==="dispute"),r(2),x("active",t.filterType==="system"),r(4),N("ngModel",t.showUnreadOnly)}}function q(s,e){s&1&&(n(0,"div",30)(1,"div",31),a(2,"\u{1F514}"),o(),n(3,"p",32),a(4,"No notifications found"),o(),n(5,"p",33),a(6,"You're all caught up!"),o()())}function K(s,e){if(s&1){let t=v();n(0,"div",36),g("click",function(){let i=d(t).$implicit,m=l(3);return p(m.onMarkAsRead(i))}),n(1,"div",37),a(2),o(),n(3,"div",38)(4,"div",39)(5,"h3",40),a(6),o(),n(7,"span",41),a(8),o()(),n(9,"p",42),a(10),o(),n(11,"span",43),a(12),o()(),n(13,"div",44)(14,"button",45),g("click",function(i){let m=d(t).$implicit;return l(3).onDelete(m),p(i.stopPropagation())}),k(),n(15,"svg",46),C(16,"path",47),o()()()()}if(s&2){let t=e.$implicit,c=l(3);x("unread",!t.isRead),r(2),u(t.icon),r(4),u(t.title),r(2),u(c.getTypeLabel(t.type)),r(2),u(t.message),r(2),u(c.formatDate(t.createdAt))}}function Q(s,e){if(s&1&&(n(0,"div",34),b(1,K,17,7,"div",35),o()),s&2){let t=l(2);r(),f("ngForOf",t.paginatedNotifications)}}function X(s,e){if(s&1){let t=v();n(0,"button",51),g("click",function(){let i=d(t).index,m=l(3);return p(m.currentPage=i+1)}),a(1),o()}if(s&2){let t=e.index,c=l(3);x("active",c.currentPage===t+1),r(),h(" ",t+1," ")}}function Z(s,e){if(s&1){let t=v();n(0,"div",48)(1,"button",49),g("click",function(){d(t);let i=l(2);return p(i.currentPage=i.currentPage-1)}),a(2," \xAB Previous "),o(),b(3,X,2,3,"button",50),n(4,"button",49),g("click",function(){d(t);let i=l(2);return p(i.currentPage=i.currentPage+1)}),a(5," Next \xBB "),o()()}if(s&2){let t=l(2);r(),f("disabled",t.currentPage===1),r(2),f("ngForOf",D(3,B).constructor(t.totalPages)),r(),f("disabled",t.currentPage===t.totalPages)}}function tt(s,e){if(s&1&&(n(0,"div",17)(1,"div",24)(2,"h2",25),a(3,"Notifications"),o(),n(4,"span",26),a(5),o()(),b(6,q,7,0,"div",27)(7,Q,2,1,"div",28)(8,Z,6,4,"div",29),o()),s&2){let t=l();r(5),h("",t.filteredNotifications.length," notifications"),r(),f("ngIf",t.filteredNotifications.length===0),r(),f("ngIf",t.filteredNotifications.length>0),r(),f("ngIf",t.totalPages>1)}}var W=class s{notificationService=O(j);destroy$=new P;isLoading=!1;error=null;notifications=[];filteredNotifications=[];stats={total:0,unread:0,thisWeek:0};filterType="all";showUnreadOnly=!1;pageSize=10;currentPage=1;get totalPages(){return Math.ceil(this.filteredNotifications.length/this.pageSize)}get paginatedNotifications(){let e=(this.currentPage-1)*this.pageSize,t=e+this.pageSize;return this.filteredNotifications.slice(e,t)}ngOnInit(){this.loadNotifications()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadNotifications(){this.isLoading=!0,this.error=null,this.notificationService.getSellerNotifications(50).pipe(_(this.destroy$),w(()=>this.isLoading=!1)).subscribe({next:e=>{this.notifications=e.map(t=>({id:t.id,type:this.mapNotificationType(t.type||t.eventType),title:t.title||this.getDefaultTitle(t.type),message:t.message||t.body||"",isRead:t.isRead||t.read||!1,createdAt:t.createdAt||t.created||new Date().toISOString(),relatedId:t.relatedId||t.orderId||t.productId,icon:this.getNotificationIcon(t.type||t.eventType)})),this.calculateStats(),this.applyFilters()},error:e=>{console.error("Error loading notifications:",e),this.error="Failed to load notifications. Please try again."}})}mapNotificationType(e){if(!e)return"system";let t=e.toLowerCase();return t.includes("order")?"order":t.includes("message")?"message":t.includes("review")?"review":t.includes("dispute")?"dispute":"system"}getDefaultTitle(e){let t=this.mapNotificationType(e);return{order:"New Order Received",message:"New Message",review:"New Review",dispute:"Dispute Opened",system:"System Notification",all:"Notification"}[t]}getNotificationIcon(e){let t=this.mapNotificationType(e);return{order:"\u{1F4E6}",message:"\u{1F4AC}",review:"\u2B50",dispute:"\u2696\uFE0F",system:"\u{1F514}",all:"\u{1F514}"}[t]}calculateStats(){this.stats.total=this.notifications.length,this.stats.unread=this.notifications.filter(t=>!t.isRead).length;let e=new Date;e.setDate(e.getDate()-7),this.stats.thisWeek=this.notifications.filter(t=>new Date(t.createdAt)>=e).length}applyFilters(){let e=[...this.notifications];this.filterType!=="all"&&(e=e.filter(t=>t.type===this.filterType)),this.showUnreadOnly&&(e=e.filter(t=>!t.isRead)),this.filteredNotifications=e,this.currentPage=1}onMarkAsRead(e){e.isRead||this.notificationService.markAsRead(e.id).pipe(_(this.destroy$)).subscribe({next:()=>{e.isRead=!0,this.calculateStats()},error:t=>{console.error("Error marking notification as read:",t)}})}onMarkAllAsRead(){let e=this.notifications.filter(t=>!t.isRead).map(t=>
1t.id);e.length!==0&&this.notificationService.markMultipleAsRead(e).pipe(_(this.destroy$)).subscribe({next:()=>{this.notifications.forEach(t=>t.isRead=!0),this.calculateStats()},error:t=>{console.error("Error marking all as read:",t),this.error="Failed to mark all as read."}})}onDelete(e){confirm("Delete this notification?")&&this.notificationService.deleteNotification(e.id).pipe(_(this.destroy$)).subscribe({next:()=>{this.notifications=this.notifications.filter(t=>t.id!==e.id),this.calculateStats(),this.applyFilters()},error:t=>{console.error("Error deleting notification:",t),this.error="Failed to delete notification."}})}formatDate(e){let t=new Date(e),i=new Date().getTime()-t.getTime(),m=Math.floor(i/6e4),y=Math.floor(i/36e5),M=Math.floor(i/864e5);return m<1?"Just now":m<60?`${m}m ago`:y<24?`${y}h ago`:M<7?`${M}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}getTypeLabel(e){return{order:"Order",message:"Message",review:"Review",dispute:"Dispute",system:"System",all:"All"}[e]}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=S({type:s,selectors:[["app-seller-notifications"]],decls:16,vars:6,consts:[[1,"dashboard-container"],[1,"main-content"],[1,"page-header"],[1,"page-title"],[1,"page-subtitle"],[1,"btn","btn-primary",3,"click","disabled"],["style","text-align: center; padding: 60px; background: #f9f9f9; border-radius: 12px; margin: 20px 0;",4,"ngIf"],["style","padding: 16px; background: #fee; border: 1px solid #fcc; border-radius: 8px; color: #c00; margin-bottom: 20px;",4,"ngIf"],["class","stats-grid",4,"ngIf"],["class","content-card",4,"ngIf"],[2,"text-align","center","padding","60px","background","#f9f9f9","border-radius","12px","margin","20px 0"],[2,"font-size","16px","color","#666"],[2,"padding","16px","background","#fee","border","1px solid #fcc","border-radius","8px","color","#c00","margin-bottom","20px"],[1,"stats-grid"],[1,"stat-card"],[1,"stat-value"],[1,"stat-label"],[1,"content-card"],[2,"display","flex","gap","16px","align-items","center","flex-wrap","wrap"],[2,"display","flex","gap","8px"],[1,"filter-btn",3,"click"],[2,"margin-left","auto"],[2,"display","flex","align-items","center","gap","8px","font-size","14px","cursor","pointer"],["type","checkbox",3,"ngModelChange","change","ngModel"],[1,"card-header"],[1,"card-title"],[2,"color","#666","font-size","14px"],["style","text-align: center; padding: 60px; color: #999;",4,"ngIf"],["class","notifications-list",4,"ngIf"],["class","pagination",4,"ngIf"],[2,"text-align","center","padding","60px","color","#999"],[2,"font-size","48px","margin-bottom","16px"],[2,"font-size","16px"],[2,"font-size","14px"],[1,"notifications-list"],["class","notification-item",3,"unread","click",4,"ngFor","ngForOf"],[1,"notification-item",3,"click"],[1,"notification-icon"],[1,"notification-content"],[1,"notification-header"],[1,"notification-title"],[1,"notification-type"],[1,"notification-message"],[1,"notification-time"],[1,"notification-actions"],["title","Delete",1,"btn-icon",3,"click"],["width","16","height","16","fill","none","stroke","currentColor","viewBox","0 0 24 24"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"],[1,"pagination"],[1,"page-btn",3,"click","disabled"],["class","page-btn",3,"active","click",4,"ngFor","ngForOf"],[1,"page-btn",3,"click"]],template:function(t,c){t&1&&(n(0,"div",0)(1,"main",1)(2,"div",2)(3,"div")(4,"h1",3),a(5,"\u{1F514} Seller Notifications"),o(),n(6,"p",4),a(7,"Stay updated on orders, returns, and messages"),o()(),n(8,"button",5),g("click",function(){return c.onMarkAllAsRead()}),a(9," Mark All as Read "),o()(),b(10,H,3,0,"div",6)(11,Y,2,1,"div",7)(12,G,16,3,"div",8)(13,J,20,13,"div",9)(14,tt,9,4,"div",9),o()(),C(15,"app-scaleboy-footer")),t&2&&(r(8),f("disabled",c.isLoading||c.stats.unread===0),r(2),f("ngIf",c.isLoading),r(),f("ngIf",c.error&&!c.isLoading),r(),f("ngIf",!c.isLoading),r(),f("ngIf",!c.isLoading),r(),f("ngIf",!c.isLoading))},dependencies:[V,I,z,F,$,R,A,L,U],styles:["*[_ngcontent-%COMP%]{margin:0;padding:0;box-sizing:border-box}.top-nav[_ngcontent-%COMP%]{background:linear-gradient(135deg,#74071e,#8b1538);padding:12px 24px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 2px 8px #0000001a;position:sticky;top:0;z-index:100}.logo-section[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}
1.logo-circle[_ngcontent-%COMP%]{width:40px;height:40px;background:linear-gradient(135deg,gold,orange);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#74071e}.logo-text[_ngcontent-%COMP%]{font-size:20px;font-weight:900;color:gold;letter-spacing:1.5px}.seller-badge[_ngcontent-%COMP%]{background:#ffd70033;color:gold;padding:4px 12px;border-radius:20px;font-size:11px;font-weight:600}.nav-icons[_ngcontent-%COMP%]{display:flex;gap:16px}.icon-btn[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;background:#ffffff1a;border:2px solid rgba(255,255,255,.3);display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;transition:all .3s}.icon-btn[_ngcontent-%COMP%]:hover{background:#fff3}.dashboard-container[_ngcontent-%COMP%]{display:flex;min-height:calc(100vh - 64px)}.sidebar[_ngcontent-%COMP%]{width:260px;background:#fff;border-right:1px solid #e0e0e0;padding:24px 0}.sidebar-section-title[_ngcontent-%COMP%]{font-size:12px;font-weight:700;text-transform:uppercase;color:#999;padding:0 24px;margin-bottom:8px}.sidebar-menu[_ngcontent-%COMP%]{list-style:none}.menu-item[_ngcontent-%COMP%]{padding:12px 24px;cursor:pointer;display:flex;align-items:center;gap:12px;color:#555;text-decoration:none;transition:all .3s}.menu-item[_ngcontent-%COMP%]:hover{background:#f8f8f8;color:#74071e}.menu-item.active[_ngcontent-%COMP%]{background:linear-gradient(90deg,rgba(116,7,30,.1) 0%,transparent 100%);color:#74071e;font-weight:600;border-left:3px solid #74071E}.main-content[_ngcontent-%COMP%]{flex:1;padding:32px;overflow-y:auto;max-width:1400px}.page-header[_ngcontent-%COMP%]{margin-bottom:32px;display:flex;justify-content:space-between;align-items:center}.page-title[_ngcontent-%COMP%]{font-size:32px;font-weight:700;color:#222;margin-bottom:8px}.page-subtitle[_ngcontent-%COMP%]{color:#666;font-size:15px}.content-card[_ngcontent-%COMP%]{background:#fff;border-radius:12px;padding:24px;box-shadow:0 2px 8px #0000000f;margin-bottom:24px}.card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding-bottom:16px;border-bottom:2px solid #f0f0f0}.card-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#222}.btn[_ngcontent-%COMP%]{padding:12px 24px;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;border:none;transition:all .3s;display:inline-flex;align-items:center;gap:8px}.btn-primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,#74071e,#a91d4d);color:#fff}.btn-primary[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 4px 12px #74071e4d}.btn-secondary[_ngcontent-%COMP%]{background:#fff;color:#74071e;border:2px solid #74071E}.btn-secondary[_ngcontent-%COMP%]:hover{background:#74071e;color:#fff}.stats-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:20px;margin-bottom:32px}.stat-card[_ngcontent-%COMP%]{background:#fff;padding:20px;border-radius:12px;box-shadow:0 2px 8px #0000000f}.stat-value[_ngcontent-%COMP%]{font-size:28px;font-weight:700;color:#222;margin-bottom:4px}.stat-label[_ngcontent-%COMP%]{font-size:13px;color:#666}.data-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.data-table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{text-align:left;padding:12px;font-size:13px;font-weight:600;color:#666;text-transform:uppercase;border-bottom:2px solid #f0f0f0;background:#fafafa}.data-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:16px 12px;border-bottom:1px solid #f5f5f5;font-size:14px}.data-table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:hover{background:#f8f8f8}.badge[_ngcontent-%COMP%]{padding:4px 12px;border-radius:20px;font-size:12px;font-weight:600;display:inline-block}.badge-success[_ngcontent-%COMP%]{background:#e8f5e9;color:#2e7d32}.badge-warning[_ngcontent-%COMP%]{background:#fff3e0;color:#f57c00}.badge-error[_ngcontent-%COMP%]{background:#ffebee;color:#c62828}.badge-info[_ngcontent-%COMP%]{background:#e3f2fd;color:#1976d2}.form-group[_ngcontent-%COMP%]{margin-bottom:20px}.form-label[_ngcontent-%COMP%]{display:block;margin-bottom:8px;font-weight:600;color:#555;font-size:14px}.form-input[_ngcontent-%COMP%], .form-select[_ngcontent-%COMP%], .form-textarea[_ngcontent-%COMP%]{width:100%;padding:12px 16px;border:2px solid #e0e0e0;border-radius:8px;font-size:15px;transition:all .3s;font-family:inherit}.form-input[_ngcontent-%COMP%]:focus, .form-select[_ngcontent-%COMP%]:focus, .form-textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:#74071e}.form-textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px}@media (max-width: 768px){.dashboard-container[_ngcontent-%COMP%]{flex-direction:column}.sidebar[_ngcontent-%COMP%]{width:100%;border-right:none;border-bottom:1px solid #e0e0e0}.main-content[_ngcontent-%COMP%]{padding:16px}.page-header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:16px}}",".filter-btn[_ngcontent-%COMP%]{padding:8px 16px;border:1px solid #ddd;background:#fff;border-radius:8px;
1cursor:pointer;font-size:14px;transition:all .2s}.filter-btn[_ngcontent-%COMP%]:hover{background:#f5f5f5}.filter-btn.active[_ngcontent-%COMP%]{background:#8b2e3c;color:#fff;border-color:#8b2e3c}.notifications-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;background:#f0f0f0}.notification-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px;padding:16px;background:#fff;cursor:pointer;transition:background .2s}.notification-item[_ngcontent-%COMP%]:hover{background:#f9f9f9}.notification-item.unread[_ngcontent-%COMP%]{background:#fffbf0;border-left:4px solid #8B2E3C}.notification-icon[_ngcontent-%COMP%]{font-size:32px;flex-shrink:0}.notification-content[_ngcontent-%COMP%]{flex:1;min-width:0}.notification-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-bottom:8px}.notification-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#333;margin:0}.notification-type[_ngcontent-%COMP%]{padding:2px 8px;background:#f0f0f0;border-radius:4px;font-size:12px;color:#666}.notification-message[_ngcontent-%COMP%]{font-size:14px;color:#666;margin:0 0 8px;line-height:1.5}.notification-time[_ngcontent-%COMP%]{font-size:12px;color:#999}.notification-actions[_ngcontent-%COMP%]{flex-shrink:0}.btn-icon[_ngcontent-%COMP%]{padding:8px;border:none;background:none;cursor:pointer;border-radius:4px;color:#999;transition:all .2s}.btn-icon[_ngcontent-%COMP%]:hover{background:#f0f0f0;color:#333}.pagination[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:8px;padding:20px;border-top:1px solid #eee}.page-btn[_ngcontent-%COMP%]{padding:8px 12px;border:1px solid #ddd;background:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s}.page-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f5f5f5}.page-btn.active[_ngcontent-%COMP%]{background:#8b2e3c;color:#fff;border-color:#8b2e3c}.page-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};export{W as SellerNotificationsComponent};

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.