1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4ac3dc21-4933-598d-be3a-f3420c01ff63")}catch(e){}}(); 3import{a as Pe}from"./chunk-M5EE73NP.js";import{a as R}from"./chunk-4T4B3QE3.js";import{a as $e}from"./chunk-MYL2H5NC.js";import{a as De,b as ke,c as Re}from"./chunk-XHPBKMRW.js";import{a as b,b as Oe}from"./chunk-FMAAPPZH.js";import{a as Ee}from"./chunk-ZN3PVEIW.js";import{a as me}from"./chunk-XSZZWV5I.js";import{a as ae,b as re}from"./chunk-TJQH26S6.js";import{b as U}from"./chunk-277MHCBF.js";import"./chunk-Q4YI27RN.js";import"./chunk-Z4VFRRQH.js";import"./chunk-VIEDUWOT.js";import{a as _e,b as Ce,c as fe,e as ge,f as ve,h as xe,i as he,k as Ve,l as ye,n as Me,p as Se}from"./chunk-IZJQTZVB.js";import{c as we,d as be,f as D,g as k,h as Te}from"./chunk-JJSZFUPX.js";import"./chunk-XBHOMARE.js";import{a as de,c as ue,d as se,e as ce}from"./chunk-C5T7GUT6.js";import"./chunk-DSHWJW7U.js";import{a as pe}from"./chunk-FLZNG7WM.js";import{b as le}from"./chunk-Y53ZYOIU.js";import"./chunk-4OKMPB3H.js";import{a as T}from"./chunk-AGVOJNE2.js";import"./chunk-CN4EGA4I.js";import{d as oe}from"./chunk-Z5M2FKAZ.js";import"./chunk-5NDSS4DO.js";import"./chunk-TTUVP5SZ.js";import"./chunk-5CMUHLSG.js";import"./chunk-TNAGEFXD.js";import"./chunk-YH4N3M4B.js";import"./chunk-BHOSW24E.js";import"./chunk-56LBQIQP.js";import"./chunk-IKWIL4NU.js";import"./chunk-5K5PYV5V.js";import"./chunk-TDGVUJZJ.js";import{d as X}from"./chunk-MWF7JXGK.js";import"./chunk-UJXOZNZV.js";import{a as ne,b as ie}from"./chunk-KS3Q7H57.js";import"./chunk-DAOAKQM2.js";import"./chunk-MGCQ5S6F.js";import"./chunk-MJXNRHWH.js";import"./chunk-BUOPWRDV.js";import"./chunk-UQU3EU23.js";import"./chunk-346ISJSG.js";import"./chunk-CNRKNNWP.js";import"./chunk-L6Z7ZO7O.js";import"./chunk-TLCCWCNW.js";import"./chunk-5SJALNJN.js";import"./chunk-XEY266ER.js";import"./chunk-SEDEP525.js";import"./chunk-SECBI6OV.js";import"./chunk-LXBG4CPT.js";import"./chunk-56KVT3OQ.js";import"./chunk-MF7VZYLI.js";import{a as Z,b as ee,e as te}from"./chunk-NFMDOWTR.js";import"./chunk-QE6DXY66.js";import"./chunk-B5YZVWIB.js";import"./chunk-HCSN2NMS.js";import"./chunk-FDIRDMLL.js";import"./chunk-XQLUXGKM.js";import"./chunk-3JHJJCIF.js";import"./chunk-J4X36CU5.js";import"./chunk-X3ZU2Z3D.js";import"./chunk-QZXCI4ZV.js";import"./chunk-VO633UWN.js";import{e as J,f as K}from"./chunk-XIKGSSI2.js";import"./chunk-MNZQGPDO.js";import{g as G,k as W,p as Y}from"./chunk-NK2KZLT6.js";import"./chunk-MU5APV2L.js";import"./chunk-KRFZY2QT.js";import"./chunk-DFSGG2NH.js";import"./chunk-MREDPIUE.js";import"./chunk-BWICLBYB.js";import"./chunk-TYTNPDEC.js";import"./chunk-WAPZ5LEW.js";import{B as N,L as q,z as Q}from"./chunk-746D4QTP.js";import{Ac as _,Dc as d,Fd as j,Ib as P,Lc as B,Mc as I,Nc as A,Ob as s,Pc as H,Sc as p,Ua as $,Uc as V,Vc as F,bc as L,cc as x,dc as h,hd as S,ic as u,id as z,jc as o,kc as i,lc as c,nd as w,od as E,pc as g,pd as O,qa as y,qb as l,qc as v,uc as M,va as C,wa as f}from"./chunk-BZJI6Z2X.js";import"./chunk-WVYA44CB.js";import"./chunk-CS7K6LXP.js";var Le=()=>["create"],Ie=()=>["expandedDetail"],Ae=()=>[5,10,25,100],He=e=>[e,"edit"];function Fe(e,a){e&1&&(o(0,"div",6)(1,"div",15)(2,"div",16)(3,"span")(4,"span",17)(5,"span",18),c(6,"i",19),i(),p(7,"You have not created any opportunities yet."),i(),o(8,"a",20),p(9,"Create an opportunity"),i()()()()()),e&2&&(l(8),u("routerLink",S(1,Le)))}function ze(e,a){e&1&&(o(0,"th",41),p(1,"Type"),i())}function je(e,a){if(e&1&&(o(0,"td",42),p(1),i()),e&2){let t=a.$implicit,r=d(2);l(),V(" ",r.opportunityTypeMap.get(t.opportunity_type)," ")}}function Qe(e,a){e&1&&(o(0,"th",41),p(1,"Location"),i())}function Ne(e,a){if(e&1&&(o(0,"td",42),p(1),w(2,"snakeToTitleCase"),i()),e&2){let t=a.$implicit;l(),V(" ",E(2,1,t.hosting_type)," ")}}function qe(e,a){e&1&&(o(0,"th",41),p(1,"Title"),i())}function Ge(e,a){if(e&1&&(o(0,"td",42),p(1),i()),e&2){let t=a.$implicit;l(),V(" ",t.title," ")}}function We(e,a){e&1&&(o(0,"th",43),p(1,"Address"),i())}function Ye(e,a){if(e&1&&(o(0,"span"),p(1),i()),e&2){let t=d().$implicit;l(),F(" ",t.city,"",t.state?`, ${t.state}`:""," ")}}function Je(e,a){if(e&1&&(o(0,"span"),p(1),i()),e&2){let t=d().$implicit;l(),V(" ",t.external_event_url," ")}}function Ke(e,a){if(e&1&&(o(0,"td",42),x(1,Ye,2,2,"span"),x(2,Je,2,1,"span"),i()),e&2){let t=a.$implicit;l(),h(t.city?1:-1),l(),h(t.external_event_url?2:-1)}}function Ue(e,a){e&1&&(o(0,"th",41),p(1,"Created"),i())}function Xe(e,a){if(e&1&&(o(0,"td",42),p(1),w(2,"date"),i()),e&2){let t=a.$implicit;l(),V(" ",O(2,1,t.created_at,"MM-dd-yyyy")," ")}}function Ze(e,a){e&1&&(o(0,"th",43),p(1,"Status"),i())}function et(e,a){if(e&1&&(o(0,"td",42),p(1),w(2,"titlecase"),i()),e&2){let t=a.$implicit;l(),V(" ",E(2,1,t.opportunity_status)," ")}}function tt(e,a){e&1&&(o(0,"th",43),c(1,"i",44),i())}function nt(e,a){if(e&1){let t=M();o(0,"button",48),_("click",function(){C(t);let n=d().$implicit,m=d(2);return f(m.endOpportunity(n))}),p(1," End opportunity "),i()}}function it(e,a){if(e&1){let t=M();o(0,"td",42)(1,"div",null,0)(3,"button",45),_("click",function(n){return C(t),f(n.stopPropagation())}),c(4,"i",46),i(),o(5,"mat-menu",47,1)(7,"button",48),_("click",function(){let n=C(t).$implicit,m=d(2);return f(m.viewDetails(n))}),p(8," View details "),i(),o(9,"button",48),_("click",function(){let n=C(t).$implicit,m=d(2);return m.expandedElement=m.expandedElement===n?null:n,f(m.fetchVolunteers(n))}),p(10," View participants "),i(),o(11,"button",48),_("click",function(){let n=C(t).$implicit,m=d(2);return f(m.emailVolunteers(n))}),p(12," Email participants "),i(),o(13,"a",49),p(14," Edit "),i(),x(15,nt,2,0,"button",50),o(16,"button",48),_("click",function(){let n=C(t).$implicit,m=d(2);return f(m.deleteOpportunity(n))}),p(17," Delete "),i()()()()}if(e&2){let t=a.$implicit,r=A(6);l(3),u("matMenuTriggerFor",r),l(10),u("routerLink",z(3,He,t.id)),l(2),h(t.end_at?-1:15)}}function ot(e,a){e&1&&(o(0,"p",52),p(1,"There are no volunteers currently registered."),i())}function at(e,a){e&1&&(o(0,"th",43),p(1,"Volunteer"),i())}function rt(e,a){if(e&1&&(o(0,"td",42),p(1),i()),e&2){let t=a.$implicit;l(),V(" ",t.full_name," ")}}function lt(e,a){e&1&&(o(0,"th",43),p(1,"Email"),i())}function pt(e,a){if(e&1&&(o(0,"td",42),p(1),i()),e&2){let t=a.$implicit;l(),V(" ",t.email," ")}}function mt(e,a){e&1&&(o(0,"th",43),p(1,"Date Registered"),i())}function dt(e,a){if(e&1&&(o(0,"td",42),p(1),w(2,"date"),i()),e&2){let t=a.$implicit;l(),V(" ",O(2,1,t.registered_at,"MM-dd-yyyy")," ")}}function ut(e,a){e&1&&(o(0,"th",43),c(1,"i",44),i())}function st(e,a){if(e&1){let t=M();o(0,"td",42)(1,"button",62),_("click",function(){let n=C(t).$implicit,m=d(4);return f(m.emailVolunteer(n))}),c(2,"i",63),i(),o(3,"button",64),_("click",function(){let n=C(t).$implicit,m=d(4);return f(m.deleteVolunteer(n.id))}),c(4,"i",65),i()()}}function ct(e,a){e&1&&c(0,"tr",66)}function _t(e,a){e&1&&c(0,"tr",67)}function Ct(e,a){if(e&1&&(o(0,"div",53)(1,"div",22)(2,"table",57),g(3,58),s(4,at,2,0,"th",30)(5,rt,2,1,"td",26),v(),g(6,59),s(7,lt,2,0,"th",30)(8,pt,2,1,"td",26),v(),g(9,60),s(10,mt,2,0,"th",30)(11,dt,3,4,"td",26),v(),g(12,33),s(13,ut,2,0,"th",30)(14,st,5,0,"td",26),v(),s(15,ct,1,0,"tr",35)(16,_t,1,0,"tr",61),i()()()),e&2){let t=d(3);l(2),u("dataSource",t.volunteers),l(13),u("matHeaderRowDef",t.volunteersColumns),l(),u("matRowDefColumns",t.volunteersColumns)}}function ft(e,a){if(e&1){let t=M();o(0,"td",42)(1,"div",51),x(2,ot,2,0,"p",52),x(3,Ct,17,3,"div",53),o(4,"div",54)(5,"button",55),_("click",function(){let n=C(t).$implicit,m=d(2);
3return f(m.downloadVolunteers(n.id))}),o(6,"span",12),c(7,"i",56),i(),o(8,"span"),p(9,"Download participants"),i()()()()()}if(e&2){let t=a.$implicit,r=d(2);L("colspan",r.opportunityHistoryColumns.length),l(),u("@detailExpand",t===r.expandedElement?"expanded":"collapsed"),l(),h((r.volunteers==null?null:r.volunteers.length)===0?2:-1),l(),h((r.volunteers==null?null:r.volunteers.length)>0?3:-1),l(),u("hidden",(r.volunteers==null?null:r.volunteers.length)===0)}}function gt(e,a){e&1&&c(0,"tr",66)}function vt(e,a){if(e&1){let t=M();o(0,"tr",68),_("click",function(){let n=C(t).$implicit,m=d(2);return m.expandedElement=m.expandedElement===n?null:n,f(m.fetchVolunteers(n))}),i()}if(e&2){let t=a.$implicit,r=d(2);H("row-expanded",r.expandedElement===t)}}function xt(e,a){e&1&&c(0,"tr",69)}function ht(e,a){e&1&&(o(0,"div",38)(1,"p"),p(2,"No results found."),i()())}function Vt(e,a){e&1&&(o(0,"div",39)(1,"div",70),c(2,"mat-spinner",71),i()())}function yt(e,a){if(e&1){let t=M();o(0,"div",6)(1,"div",7)(2,"div",21)(3,"div",22)(4,"table",23),_("matSortChange",function(n){C(t);let m=d();return f(m.onSortChange(n))}),g(5,24),s(6,ze,2,0,"th",25)(7,je,2,1,"td",26),v(),g(8,27),s(9,Qe,2,0,"th",25)(10,Ne,3,3,"td",26),v(),g(11,28),s(12,qe,2,0,"th",25)(13,Ge,2,1,"td",26),v(),g(14,29),s(15,We,2,0,"th",30)(16,Ke,3,2,"td",26),v(),g(17,31),s(18,Ue,2,0,"th",25)(19,Xe,3,4,"td",26),v(),g(20,32),s(21,Ze,2,0,"th",30)(22,et,3,3,"td",26),v(),g(23,33),s(24,tt,2,0,"th",30)(25,it,18,5,"td",26),v(),g(26,34),s(27,ft,10,5,"td",26),v(),s(28,gt,1,0,"tr",35)(29,vt,1,2,"tr",36)(30,xt,1,0,"tr",37),i()(),x(31,ht,3,0,"div",38),x(32,Vt,3,0,"div",39),o(33,"mat-paginator",40),_("page",function(n){C(t);let m=d();return f(m.onPageChange(n))}),i()()()()}if(e&2){let t=d();l(4),u("dataSource",t.volunteerOpportunities.data),l(24),u("matHeaderRowDef",t.opportunityHistoryColumns),l(),u("matRowDefColumns",t.opportunityHistoryColumns),l(),u("matRowDefColumns",S(9,Ie)),l(),h(t.volunteerOpportunities.data.length===0?31:-1),l(),h(t.volunteerOpportunities.spinner?32:-1),l(),u("length",t.volunteerOpportunities.totalCount)("pageSize",t.volunteerOpportunities.perPage)("pageSizeOptions",S(10,Ae))}}var on=(()=>{class e{appService=y(K);route=y(G);dialog=y(X);volunteerService=y(re);orgService=y(oe);suggestedArticlesService=y(Ee);sidenavService=y(U);paginator=j(b);urn;org;pageLoading;expandedElement;volunteerOpportunities={data:[],totalCount:0,page:1,perPage:10,spinner:!1,sortBy:"created_at",sortOrder:"desc"};volunteers=[];spinner={volunteers:!1};opportunityHistoryColumns=["opportunity_type","hosting_type","title","address","created_at","status","actions"];volunteersColumns=["volunteer","email","registered","actions"];opportunityTypeMap=new Map(ae.map(t=>[t.value,t.viewValue]));platformId=y($);constructor(){this.appService.footer=!1,this.urn=this.route.snapshot.parent.params.urn,this.org=this.orgService.data,this.suggestedArticlesService.suggestedLabel="org-opportunities-management"}ngOnInit(){q(this.platformId)&&this.fetchVolunteerOpportunties()}fetchVolunteers(t){this.volunteers=null,this.spinner.volunteers=!0,this.volunteerService.getVolunteers(t.id).subscribe({next:r=>{this.volunteers=r,this.spinner.volunteers=!1},error:()=>{this.spinner.volunteers=!1}})}onSortChange(t){this.volunteerOpportunities.sortBy=t.active,this.volunteerOpportunities.sortOrder=t.direction,this.fetchVolunteerOpportunties()}onPageChange(t){this.volunteerOpportunities.page=t.pageIndex+1,this.volunteerOpportunities.perPage=t.pageSize,this.fetchVolunteerOpportunties()}viewDetails(t){this.dialog.open(me,{width:J.lg,data:{opportunity:t,org:this.org}}).afterClosed().subscribe(n=>{n&&this.fetchVolunteerOpportunties()})}emailVolunteers(t){this.dialog.open(R,{}).afterClosed().subscribe(n=>{n&&this.volunteerService.emailAllVolunteers(t.id,n.subject,n.body).subscribe()})}emailVolunteer(t){this.dialog.open(R,{}).afterClosed().subscribe(n=>{n&&this.volunteerService.emailVolunteer(t.id,n.subject,n.body).subscribe()})}endOpportunity(t){this.dialog.open(T,{data:{title:"End opportunity",content:"Participants can no longer register, and it will be removed from your list of active opportunities.",confirmButtonText:"Confirm",cancelButtonText:"Cancel"}}).afterClosed().subscribe(n=>{n&&this.volunteerService.endVolunteerOpportunity(t.id).subscribe(()=>{this.fetchVolunteerOpportunties()})})}deleteOpportunity(t){this.dialog.open(T,{data:{title:"Delete Opportunity",content:`All records of this opportunity and any volunteer information 4 associated with it will be deleted. This cannot be undone.`,confirmButtonText:"Confirm",cancelButtonText:"Cancel"}}).afterClosed().subscribe(n=>{n&&(this.volunteerOpportunities.spinner=!0,this.volunteerService.deleteVolunteerOpportunity(t.id).subscribe({next:()=>this.fetchVolunteerOpportunties(),error:()=>this.volunteerOpportunities.spinner=!1}))})}deleteVolunteer(t){this.dialog.open(T,{data:{title:"Are you sure?",confirmButtonText:"Confirm",cancelButtonText:"Cancel"}}).afterClosed().subscribe(n=>{n&&this.volunteerService.deleteVolunteer(t).subscribe(()=>{this.fetchVolunteerOpportunties()})})}downloadVolunteers(t){window.open(`/api/v4/volunteer_opportunities/${t}/volunteers/download_volunteers?status=active`,"_self")}fetchVolunteerOpportunties(){let t={page:this.volunteerOpportunities.page,per_page:this.volunteerOpportunities.perPage,sort_by:this.volunteerOpportunities.sortBy,sort_order:this.volunteerOpportunities.sortOrder};this.volunteerOpportunities.spinner=!0,this.volunteerService.getVolunteerOpportunities(this.urn,t).subscribe(r=>{this.volunteerOpportunities.data=r.volunteer_opportunities,this.volunteerOpportunities.totalCount=r.total_count,this.volunteerOpportunities.spinner=!1})}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=P({type:e,selectors:[["app-volunteer-management"]],viewQuery:function(r,n){r&1&&B(n.paginator,b,5),r&2&&I()},decls:18,vars:6,consts:[["opportunityActionBtn",""],["opportunityActionMenu","matMenu"],[1,"min-vh-100","pb-5"],[1,"container",3,"hidden"],["contentType","report",3,"changeContentLoading"],[1,"container-fluid",3,"hidden"],[1,"row"],[1,"col-12"],[1,"d-flex","flex-wrap","justify-content-between","align-items-center","volunteer-header"],[1,"display-2","mb-3"],[1,"actions"],["mat-button","","color","accent",1,"custom",3,"routerLink"],[1,"left-icon"],["aria-hidden","true",1,"fal","fa-plus"],[1,"mb-3"],[1,"col-12","text-center"],[1,"status-box","my-5"],[1,"me-2"],[1,"me-1"],[1,"fa-light","fa-empty-set"],["mat-button","","color","primary",1,"custom","xs",3,"routerLink"],[1,"table-wrapper"],[1,"table-responsive"],["mat-table","","matSort","","multiTemplateDataRows","",3,"matSortChange","dataSource"],["matColumnDef","opportunity_type"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","hosting_type"],["matColumnDef","title"],["matColumnDef","address"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","created_at"],["matColumnDef","status"],["matColumnDef","actions"],["matColumnDef","expandedDetail"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","expandable-row",3,"row-expanded","click",4,"matRowDef","matRowDefColumns"],["mat-row","","class","expandable-detail-row",4,"matRowDef","matRowDefColumns"],[1,"table-no-results"],[1,"update-overlay"],["showFirstLastButtons","",3,"page","length","pageSize","pageSizeOptions"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],[1,"fal","fa-tools"],["mat-icon-button","","aria-label","Opportunity Actions","matTooltip","Options",1,"sm",3,"click","matMenuTriggerFor"],[1,"fas","fa-ellipsis-v"],[1,"auto-width","shadow-lg"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"],["mat-menu-item",""],[1,"expandable-detail"],[1,"text-center"],[1,"position-relative","w-75","m-auto"],[1,"text-center","w-75","m-auto","mt-2",3,"hidden"],["mat-button","","color","accent",1,"custom","auto",3,"click"],[1,"fa-solid","fa-cloud-download-alt"],["mat-table","",1,"table-border",3,"dataSource"],["matColumnDef","volunteer"],["matColumnDef","email"],["matColumnDef","registered"],["mat-row","",4,"matRowDef","matRowDefColumns"],["type","button","mat-icon-button","","aria-label","email",3,"click"],[1,"fal","fa-envelope"],["type","button","mat-icon-button","","aria-label","delete",3,"click"],[1,"fal","fa-times"],["mat-header-row",""],["mat-row",""],["mat-row","",1,"expandable-row",3,"click"],["mat-row","",1,"expandable-detail-row"],[1,"spinner"],["diameter","50"]],template:function(r,n){r&1&&(o(0,"div",2)(1,"div",3)(2,"app-org-content-loader",4),_("changeContentLoading",function(Be){return n.pageLoading=!!Be}),i()(),o(3,"div",5)(4,"div",6)(5,"div",7)(6,"div",8)(7,"h1",9),p(8,"Opportunities"),i(),o(9,"div",10)(10,"a",11)(11,"span",12),c(12,"i",13),i(),p(13,"Add an opportunity "),i()()(),o(14,"p",14),p(15,' Create links to online or in-person opportunities like volunteering positions and calendar events. Display tiles for these opportunities in a "Get Involved" section on your Organization Page. '),i()()(),x(16,Fe,10,2,"div",6),x(17,yt,34,11,"div",6),i()()),r&2&&(l(),u("hidden",!n.pageLoading),l(2),u("hidden",n.pageLoading),l(7),u("routerLink",S(5,Le)),l(6),h(!n.volunteerOpportunities.spinner&&!n.pageLoading&&n.volunteerOpportunities.data.length===0?16:-1),l(),h(n.volunteerOpportunities.data.length!==0?17:-1))},dependencies:[Y,W,te,ee,Z,ce,ue,de,se,Oe,b,ie,ne,Re,De,ke,Se,_e,fe,he,ge,Ce,Ve,ve,xe,ye,Me,pe,le,$e,N,Q,Pe],styles:["@media (max-width: 575.98px){.volunteer-header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{width:100%;text-align:right}}"],data:{animation:[we("detailExpand",[k("collapsed",D({height:"0px",minHeight:"0",display:"none"})),k("expanded",D({height:"*"}
4)),Te("expanded <=> collapsed",be("225ms cubic-bezier(0.4, 0.0, 0.2, 1)"))])]}})}return e})();export{on as VolunteerManagementComponent}; 5 6//# debugId=4ac3dc21-4933-598d-be3a-f3420c01ff63
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.