PageSourceSearch

https://moosky.ai/chunk-7FDTKE66.js

js moosky.ai collected 2026-10-05 12:18:13 UTC 14,837 bytes, 1 lines download raw bytes

1import{a as we}from"./chunk-JI52N34L.js";import{a as le,b as me,c as ce,d as pe,e as ue,f as _e,g as ge,h as fe,i as be,j as ve,k as Ce,l as xe}from"./chunk-MO56SN4C.js";import"./chunk-N5WK3RDE.js";import"./chunk-WUQNPD47.js";import{a as se,b as de}from"./chunk-ZWMGFKR5.js";import{b as ie,d as ne}from"./chunk-4B3GWUJ7.js";import"./chunk-RE5PDJ4E.js";import"./chunk-Q4NZ5K3B.js";import"./chunk-OH3XPIE7.js";import{u as ae,v as oe}from"./chunk-N2XXJV2Y.js";import"./chunk-M4QIT5NQ.js";import{A as te,c as J,g as K,l as X,t as Y,u as Z,v as ee}from"./chunk-K7Z7SYIK.js";import{a as re}from"./chunk-RN5WWGMY.js";import"./chunk-KVO3EH33.js";import{a as E}from"./chunk-6VLCJVMZ.js";import{g as W,i as H,j as U,q as Q,u as G}from"./chunk-7MW7BGKA.js";import{A as L,Ac as B,Ca as V,Ec as r,Fb as j,Fc as u,Gc as F,Hc as P,Ic as h,Jc as R,Kc as M,Lb as p,O as T,Vb as $,W as k,Wc as N,Yc as z,_c as q,ac as m,bc as n,cc as a,dc as S,ea as D,g as I,ha as A,hc as f,ic as b,jb as y,kc as x,nb as s,oc as v,qc as l,u as O,wa as _,xa as g,yb as w}from"./chunk-7XXOVL5A.js";import"./chunk-EQDQRRRY.js";function he(t,i){t&1&&(n(0,"th",33),r(1,"ID"),a())}function Re(t,i){if(t&1&&(n(0,"td",34),r(1),a()),t&2){let e=i.$implicit;s(),u(e.id)}}function Me(t,i){t&1&&(n(0,"th",33),r(1,"User"),a())}function ye(t,i){if(t&1&&(n(0,"td",34)(1,"div",35)(2,"strong"),r(3),a(),n(4,"span"),r(5),a()()()),t&2){let e=i.$implicit;s(3),u((e.user==null?null:e.user.name)||"Unknown"),s(2),u(e.user==null?null:e.user.email)}}function Pe(t,i){t&1&&(n(0,"th",33),r(1,"Campaign"),a())}function Ee(t,i){if(t&1&&(n(0,"td",34),r(1),a()),t&2){let e=i.$implicit;s(),u(e.campaign==null?null:e.campaign.title)}}function Ie(t,i){t&1&&(n(0,"th",33),r(1,"URL"),a())}function Oe(t,i){if(t&1&&(n(0,"td",34)(1,"a",36),r(2),a()()),t&2){let e=i.$implicit;s(),m("href",e.submitted_url,y),s(),u(e.submitted_url)}}function Le(t,i){t&1&&(n(0,"th",33),r(1,"Credits"),a())}function Te(t,i){if(t&1&&(n(0,"td",34),r(1),a()),t&2){let e=i.$implicit;s(),u(e.reward_credits_snapshot)}}function ke(t,i){t&1&&(n(0,"th",33),r(1,"Status"),a())}function De(t,i){if(t&1&&(n(0,"td",34)(1,"span",37),r(2),a()()),t&2){let e=i.$implicit;s(),m("ngClass",e.status),s(),u(e.status)}}function Ae(t,i){t&1&&(n(0,"th",33),r(1,"Submitted"),a())}function Ve(t,i){if(t&1&&(n(0,"td",34),r(1),N(2,"date"),a()),t&2){let e=i.$implicit;
1s(),u(z(2,1,e.created_at,"short"))}}function je(t,i){t&1&&(n(0,"th",33),r(1,"Review"),a())}function $e(t,i){if(t&1){let e=x();n(0,"div",39)(1,"textarea",40),M("ngModelChange",function(d){_(e);let c=l().$implicit,C=l();return R(C.notesById[c.id],d)||(C.notesById[c.id]=d),g(d)}),a(),n(2,"div")(3,"button",41),v("click",function(){_(e);let d=l().$implicit,c=l();return g(c.approve(d))}),n(4,"mat-icon"),r(5,"check"),a()(),n(6,"button",42),v("click",function(){_(e);let d=l().$implicit,c=l();return g(c.reject(d))}),n(7,"mat-icon"),r(8,"close"),a()()()()}if(t&2){let e=l().$implicit,o=l();s(),h("ngModel",o.notesById[e.id]),s(2),m("disabled",o.actionId===e.id),s(3),m("disabled",o.actionId===e.id)}}function Be(t,i){t&1&&(n(0,"span",43),r(1,"Reviewed"),a())}function Fe(t,i){if(t&1&&(n(0,"td",34),p(1,$e,9,3,"div",38)(2,Be,2,0,"ng-template",null,0,q),a()),t&2){let e=i.$implicit,o=B(3),d=l();s(),m("ngIf",d.canReview(e))("ngIfElse",o)}}function Ne(t,i){t&1&&S(0,"tr",44)}function ze(t,i){t&1&&S(0,"tr",45)}function qe(t,i){if(t&1&&(n(0,"tr",46)(1,"td",47),r(2),a()()),t&2){let e=l();s(),$("colspan",e.displayedColumns.length),s(),u(e.loading?"Loading reward submissions...":"No reward submissions found.")}}function We(t,i){if(t&1){let e=x();n(0,"textarea",40),M("ngModelChange",function(d){_(e);let c=l().$implicit,C=l();return R(C.notesById[c.id],d)||(C.notesById[c.id]=d),g(d)}),a()}if(t&2){let e=l().$implicit,o=l();h("ngModel",o.notesById[e.id])}}
1function He(t,i){if(t&1){let e=x();n(0,"div",54)(1,"button",41),v("click",function(){_(e);let d=l().$implicit,c=l();return g(c.approve(d))}),n(2,"mat-icon"),r(3,"check"),a()(),n(4,"button",42),v("click",function(){_(e);let d=l().$implicit,c=l();return g(c.reject(d))}),n(5,"mat-icon"),r(6,"close"),a()()()}if(t&2){let e=l().$implicit,o=l();s(),m("disabled",o.actionId===e.id),s(3),m("disabled",o.actionId===e.id)}}function Ue(t,i){if(t&1&&(n(0,"div",48)(1,"div",49)(2,"div")(3,"div",50),r(4),a(),n(5,"div",51),r(6),a()(),n(7,"span",37),r(8),a()(),n(9,"a",36),r(10),a(),p(11,We,1,1,"textarea",52)(12,He,7,2,"div",53),a()),t&2){let e=i.$implicit,o=l();s(4),u(e.campaign==null?null:e.campaign.title),s(2),P("",e.user==null?null:e.user.name," \xB7 ",e.reward_credits_snapshot," credits"),s(),m("ngClass",e.status),s(),u(e.status),s(),m("href",e.submitted_url,y),s(),u(e.submitted_url),s(),m("ngIf",o.canReview(e)),s(),m("ngIf",o.canReview(e))}}function Qe(t,i){if(t&1){let e=x();n(0,"div",55)(1,"button",56),v("click",function(){_(e);let d=l();return g(d.previousPage())}),n(2,"mat-icon"),r(3,"chevron_left"),a()(),n(4,"span"),r(5),a(),n(6,"button",57),v("click",function(){_(e);let d=l();return g(d.nextPage())}),n(7,"mat-icon"),r(8,"chevron_right"),a()()()}if(t&2){let e=l();s(),m("disabled",e.page<=1),s(4),P("Page ",e.page," of ",e.lastPage),s(),m("disabled",e.page>=e.lastPage)}}function Ge(t,i){t&1&&(n(0,"div",58),S(1,"mat-spinner",59),a())}var Se=class t{constructor(i,e,o){this.adminService=i;this.toaster=e;this.destroyRef=o}loadRequest$=new I;displayedColumns=["id","user","campaign","url","credits","status","createdAt","actions"];submissions=[];loading=!1;actionId=null;page=1;lastPage=1;total=0;statusFilter="pending";notesById={};ngOnInit(){this.initializeSubmissionLoading(),this.loadSubmissions()}loadSubmissions(i=this.page){this.loadRequest$.next({page:i,status:this.statusFilter||void 0})}onFilterChange(){this.page=1,this.loadSubmissions(1)}approve(i){this.reviewSubmission(i,"approve")}reject(i){this.reviewSubmission(i,"reject")}previousPage(){this.page<=1||this.loadSubmissions(this.page-1)}nextPage(){this.page>=this.lastPage||this.loadSubmissions(this.page+1)}canReview(i){return!i.credited_at&&i.status!=="rejected"}initializeSubmissionLoading(){this.loadRequest$.pipe(A(()=>{this.loading=!0}),D(({page:i,status:e})=>this.adminService.getRewardSubmissions(i,25,e).pipe(L(o=>({response:o,failed:!1})),T(()=>O({response:null,failed:!0})))),E(this.destroyRef)).subscribe(({response:i,failed:e})=>{if(this.loading=!1,e||!i){this.toaster.open("Failed to load reward submissions","Close",{duration:3e3});return}this.submissions=i.data,this.page=i.current_page,this.lastPage=i.last_page,this.total=i.total})}reviewSubmission(i,e){this.actionId!==null||!this.canReview(i)||(this.actionId=i.id,this.getReviewRequest(i,e).pipe(k(()=>{this.actionId=null}),E(this.destroyRef)).subscribe({next:()=>{this.toaster.open(`Reward submission ${e==="approve"?"approved":"rejected"}`,"Close",{duration:3e3}),this.loadSubmissions(this.page)},error:o=>{let d=`Failed to ${e} reward submission`;this.toaster.open(o?.error?.message||d,"Close",{duration:4e3})}}))}getReviewRequest(i,e){let o=this.notesById[i.id];return e==="approve"?this.adminService.approveRewardSubmission(i.id,o):this.adminService.rejectRewardSubmission(i.id,o)}static \u0275fac=function(e){return new(e||t)(w(we),w(re),w(V))};static \u0275cmp=j({type:t,selectors:[["app-reward-submission-list"]],decls:58,vars:8,consts:[["reviewed",""],[1,"reward-submissions","admin-list-page"],[1,"header","admin-list-header"],[1,"admin-list-eyebrow"],[1,"admin-list-description"],[1,"admin-list-count"],["aria-label","Reward submission filters",1,"admin-list-toolbar"],[1,"admin-list-filter"],[3,"ngModelChange","ngModel"],["value",""],["value","pending"],["value","queued"],["value","credited"],["value","rejected"],[1,"table-container","admin-table-card"],["mat-table","",1,"reward-table","admin-data-table",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","user"],["matColumnDef","campaign"],["matColumnDef","url"],["matColumnDef","credits"],["matColumnDef","status"],["matColumnDef","createdAt"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],[1,"cards-container"],["class","reward-card",4,"ngFor","ngForOf"],["class","pager admin-list-pager",4,"ngIf"],["class","loading admin-list-loading",4,"ngIf"],["mat-header-cell",""],["mat-cell",""],[1,"stacked"],["target","_blank","rel","noopener noreferrer",3,"href"],[1,"status-pill",3,"ngClass"],["class","actions",4,"ngIf","ngIfElse"],[1,"actions"],["placeholder","Admin notes",3,"ngModelChange","ngModel"],["mat-icon-button","","title","Approve submission","aria-label","Approve submission",3,"click","disabled"],["mat-icon-button","","color","warn","title","Reject submission","aria-label","Reject submission",3,"click","disabled"],[1,"muted"],["mat-header-row",""],["mat-row",""],[1,"mat-row"],[1,"mat-cell","admin-table-empty"],[1,"reward-card"],[1,"card-header"],[1,"card-title"],[1,"card-subtitle"],["placeholder","Admin notes",3,"ngModel","ngModelChange",4,"ngIf"],["class","mobile-actions",4,"ngIf"],[1,"mobile-actions"],[1,"pager","admin-list-pager"],["mat-icon-button","","title","Previous page","aria-label","Previous page",3,"click","disabled"],["mat-icon-button","","title","Next page","aria-label","Next page",3,"click","disabled"],[1,"loading","admin-list-loading"],["diameter","40"]],template:function(e,o){e&1&&(n(0,"div",1)(1,"header",2)(2,"div")(3,"p",3),r(4,"Rewards Review"),a(),n(5,"h1"),r(6,"Reward Submissions"),a(),n(7,"p",4),r(8,"Review evidence, approve credits, and track submission status."),a()(),n(9,"span",5),r(10),a()(),n(11,"section",6)(12,"label",7),r(13," Status "),n(14,"select",8),M("ngModelChange",function(c){return R(o.statusFilter,c)||
1(o.statusFilter=c),c}),v("ngModelChange",function(){return o.onFilterChange()}),n(15,"option",9),r(16,"All"),a(),n(17,"option",10),r(18,"Pending"),a(),n(19,"option",11),r(20,"Queued"),a(),n(21,"option",12),r(22,"Credited"),a(),n(23,"option",13),r(24,"Rejected"),a()()()(),n(25,"div",14)(26,"table",15),f(27,16),p(28,he,2,0,"th",17)(29,Re,2,1,"td",18),b(),f(30,19),p(31,Me,2,0,"th",17)(32,ye,6,2,"td",18),b(),f(33,20),p(34,Pe,2,0,"th",17)(35,Ee,2,1,"td",18),b(),f(36,21),p(37,Ie,2,0,"th",17)(38,Oe,3,2,"td",18),b(),f(39,22),p(40,Le,2,0,"th",17)(41,Te,2,1,"td",18),b(),f(42,23),p(43,ke,2,0,"th",17)(44,De,3,2,"td",18),b(),f(45,24),p(46,Ae,2,0,"th",17)(47,Ve,3,4,"td",18),b(),f(48,25),p(49,je,2,0,"th",17)(50,Fe,4,2,"td",18),b(),p(51,Ne,1,0,"tr",26)(52,ze,1,0,"tr",27)(53,qe,3,2,"tr",28),a()(),n(54,"div",29),p(55,Ue,13,9,"div",30),a(),p(56,Qe,9,4,"div",31)(57,Ge,2,0,"div",32),a()),e&2&&(s(10),F("",o.total," submissions"),s(4),h("ngModel",o.statusFilter),s(12),m("dataSource",o.submissions),s(25),m("matHeaderRowDef",o.displayedColumns),s(),m("matRowDefColumns",o.displayedColumns),s(3),m("ngForOf",o.submissions),s(),m("ngIf",!o.loading&&o.total>0),s(),m("ngIf",o.loading))},dependencies:[G,W,H,U,te,Z,ee,J,Y,K,X,ne,ie,oe,ae,de,se,xe,le,ce,ge,pe,me,fe,ue,_e,be,ve,Ce,Q],styles:['.reward-submissions[_ngcontent-%COMP%]{padding:1.5rem 1.5rem 6rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.25rem}.header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0;color:var(--admin-text);font-size:clamp(1.45rem,3vw,2.15rem);line-height:1.05;font-weight:850}.header[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:.35rem 0 0;color:var(--admin-muted)}.header[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:grid;gap:.35rem;color:var(--admin-muted);font-size:.85rem}.header[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{min-height:var(--admin-control-height);border:1px solid var(--admin-border-strong);border-radius:var(--admin-radius);background:var(--admin-surface-2);color:var(--admin-text);padding:0 var(--admin-control-padding-x)}.table-container[_ngcontent-%COMP%]{overflow-x:auto;overflow-y:hidden;border:1px solid var(--admin-border);border-radius:var(--admin-radius);background:var(--admin-surface);box-shadow:var(--admin-shadow-sm)}.reward-table[_ngcontent-%COMP%]{width:100%;background:transparent}.stacked[_ngcontent-%COMP%]{display:grid;gap:.2rem}.stacked[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:var(--admin-text)}.stacked[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:var(--admin-muted);font-size:.82rem}a[_ngcontent-%COMP%]{display:inline-block;max-width:22rem;overflow:hidden;color:var(--admin-accent);text-overflow:ellipsis;white-space:nowrap}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;border:0;border-radius:999px;color:var(--admin-warning);background:#dda23a1f;font-size:.6875rem;font-weight:500;padding:.15rem .5rem;text-transform:capitalize}.status-pill[_ngcontent-%COMP%]:before{width:5px;height:5px;border-radius:999px;background:currentColor;content:""}.status-pill.credited[_ngcontent-%COMP%]{color:var(--admin-accent-2);background:#20b77e1f}.status-pill.rejected[_ngcontent-%COMP%]{color:var(--admin-danger);background:#e5484d1f}.status-pill.queued[_ngcontent-%COMP%]{color:var(--admin-accent);background:#2f8fe61f}.actions[_ngcontent-%COMP%], .mobile-actions[_ngcontent-%COMP%]{display:grid;gap:.5rem}.actions[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .mobile-actions[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}textarea[_ngcontent-%COMP%]{width:100%;min-width:14rem;min-height:var(--admin-textarea-min-height);border:1px solid var(--admin-border-strong);border-radius:var(--admin-radius);background:var(--admin-surface-2);color:var(--admin-text);padding:9px var(--admin-control-padding-x);outline:none;resize:vertical}textarea[_ngcontent-%COMP%]:focus{border-color:var(--admin-accent);box-shadow:var(--admin-focus-ring)}.muted[_ngcontent-%COMP%]{color:var(--admin-muted)}.cards-container[_ngcontent-%COMP%]{display:none;flex-direction:column;gap:.85rem}.reward-card[_ngcontent-%COMP%]{display:grid;gap:.75rem;padding:1rem;border:1px solid var(--admin-border);border-radius:var(--admin-radius);background:var(--admin-surface);box-shadow:var(--admin-shadow-sm)}.card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem}.card-title[_ngcontent-%COMP%]{color:var(--admin-text);font-weight:800}.card-subtitle[_ngcontent-%COMP%]{margin-top:.2rem;color:var(--admin-muted)}.pager[_ngcontent-%COMP%], .loading[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:1rem;padding:1.5rem;color:var(--admin-muted)}@media (max-width: 768px){.reward-submissions[_ngcontent-%COMP%]{padding:1rem 1rem 7.5rem}.header[_ngcontent-%COMP%]{align-items:stretch;flex-direction:column}.table-container[_ngcontent-%COMP%]{display:none!important}.cards-container[_ngcontent-%COMP%]{display:flex!important}}']})};export{Se as RewardSubmissionListComponent};

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.