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]="ec24e4f7-2091-5c60-b7e8-2ca2131ad815")}catch(e){}}(); 3import{a as Ut}from"./chunk-VAZWI6EK.js";import{a as St}from"./chunk-ZN3PVEIW.js";import{a as Vt,b as gt}from"./chunk-TJQH26S6.js";import{a as bt}from"./chunk-WRXC5ORK.js";import{a as Et}from"./chunk-ZXVXVPQZ.js";import"./chunk-TMNV4PDT.js";import{d as h}from"./chunk-AAFBOZHS.js";import{a as Ot}from"./chunk-A7W5NRHC.js";import"./chunk-Y53ZYOIU.js";import{a as ft,c as ht}from"./chunk-4OKMPB3H.js";import{a as Ct,b as xt,c as Ft}from"./chunk-HJXQJEZE.js";import{c as _t}from"./chunk-CN4EGA4I.js";import{d as yt}from"./chunk-Z5M2FKAZ.js";import{b as ut}from"./chunk-5NDSS4DO.js";import"./chunk-TTUVP5SZ.js";import"./chunk-5CMUHLSG.js";import{a as vt}from"./chunk-TNAGEFXD.js";import"./chunk-YH4N3M4B.js";import"./chunk-BHOSW24E.js";import"./chunk-56LBQIQP.js";import"./chunk-IKWIL4NU.js";import{a as st}from"./chunk-5K5PYV5V.js";import"./chunk-TDGVUJZJ.js";import"./chunk-MWF7JXGK.js";import{b as ct}from"./chunk-UJXOZNZV.js";import"./chunk-KS3Q7H57.js";import"./chunk-DAOAKQM2.js";import{a as O}from"./chunk-MGCQ5S6F.js";import"./chunk-MJXNRHWH.js";import"./chunk-BUOPWRDV.js";import{d as lt,e as mt}from"./chunk-UQU3EU23.js";import"./chunk-346ISJSG.js";import{b as dt,d as pt}from"./chunk-CNRKNNWP.js";import{d as et}from"./chunk-L6Z7ZO7O.js";import"./chunk-TLCCWCNW.js";import{a as at}from"./chunk-5SJALNJN.js";import{a as it,b as ot,c as nt,i as rt}from"./chunk-XEY266ER.js";import"./chunk-SEDEP525.js";import"./chunk-SECBI6OV.js";import"./chunk-LXBG4CPT.js";import"./chunk-56KVT3OQ.js";import{C as J,D as K,G as X,I as tt,b as B,d as s,g as R,h as $,o as G,r as W,s as z,t as Q,u as Z,v as Y,w as j,x as H}from"./chunk-MF7VZYLI.js";import{b as L,e as P}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"./chunk-XIKGSSI2.js";import"./chunk-MNZQGPDO.js";import{g as I,j as k}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"./chunk-746D4QTP.js";import{$c as N,Ac as g,Dc as p,Ib as A,Sc as n,Uc as f,a as S,ad as M,bc as w,bd as D,cc as m,dc as u,fc as q,gc as F,hc as V,ic as v,jc as o,kc as e,lc as d,qa as _,qb as r,uc as E,va as C,w as U,wa as x,xa as T}from"./chunk-BZJI6Z2X.js";import"./chunk-CS7K6LXP.js";var Tt=(i,a)=>a.value,At=(i,a)=>a.code;function wt(i,a){i&1&&(o(0,"div")(1,"div",2)(2,"div",5)(3,"content-loader",6),T(),d(4,"rect",7),e()()()())}function qt(i,a){if(i&1&&(o(0,"mat-option",16),n(1),e()),i&2){let t=a.$implicit;v("value",t.value),r(),f(" ",t.viewValue," ")}}function Nt(i,a){if(i&1&&(o(0,"mat-option",16),n(1),e()),i&2){let t=a.$implicit;v("value",t.value),r(),f(" ",t.viewValue," ")}}function Mt(i,a){i&1&&(o(0,"span",21),n(1," Direct participants to your opportunity listing "),e())}function Dt(i,a){i&1&&(o(0,"mat-error"),n(1," Opportunity URL is "),o(2,"strong"),n(3,"required"),e()())}function It(i,a){i&1&&(o(0,"mat-error"),n(1," Opportunity URL is "),o(2,"strong"),n(3,"invalid"),e()())}function kt(i,a){if(i&1&&(o(0,"span",22)(1,"mat-form-field")(2,"mat-label"),n(3,"URL"),e(),d(4,"input",62),o(5,"mat-hint",28),n(6,"Where should we send participants to register?"),e(),m(7,Dt,4,0,"mat-error"),m(8,It,4,0,"mat-error"),e()()),i&2){let t=p(2);r(7),u(t.volunteerOpportunityForm.controls.url.errors!=null&&t.volunteerOpportunityForm.controls.url.errors.required?7:-1),r(),u(t.volunteerOpportunityForm.controls.url.errors!=null&&t.volunteerOpportunityForm.controls.url.errors.invalidUrl?8:-1)}}function Lt(i,a){i&1&&(o(0,"span",24),n(1," Participants will register and receive notifications through Mightycause "),e())}function Pt(i,a){i&1&&(o(0,"mat-error"),n(1," Enter opportunity title "),e())}function Bt(i,a){i&1&&(o(0,"mat-hint",28),n(1,' "Springfield Golf Club", "Diner parking lot" '),e())}function Rt(i,a){i&1&&(o(0,"mat-hint",28),n(1,' "Youtube", "Zoom call" '),e())}function $t(i,a){i&1&&(o(0,"mat-error"),n(1," Enter Apt # "),e())}function Gt(i,a){i&1&&(o(0,"mat-error"),n(1," Enter city "),e())}function Wt(i,a){if(i&1&&(o(0,"option",16),n(1),e()),i&2){let t=a.$implicit;v("value",t.code),r(),f(" ",t.name," ")}}function zt(i,a){i&1&&(o(0,"mat-error"),n(1," Enter state "),e())}function Qt(i,a){i&1&&(o(0,"mat-error"),n(1," Enter ZIP / Post code "),e())}function Zt(i,a){if(i&1&&(o(0,"option",16),n(1),e()),i&2){let t=a.$implicit;v("value",t.code),r(),f(" ",t.name," ")}}function Yt(i,a){i&1&&(o(0,"mat-error"),n(1," URL cannot be blank "),e())}function jt(i,a){i&1&&(o(0,"mat-error"),n(1," URL is "),o(2,"strong"),n(3,"invali
3d"),e()())}function Ht(i,a){if(i&1&&(o(0,"div",2)(1,"div",12)(2,"mat-form-field")(3,"mat-label"),n(4,"URL"),e(),d(5,"input",63),m(6,Yt,2,0,"mat-error"),m(7,jt,4,0,"mat-error"),e()()()),i&2){let t=p(2);r(6),u(t.volunteerOpportunityForm.controls.externalEventUrl.errors!=null&&t.volunteerOpportunityForm.controls.externalEventUrl.errors.required?6:-1),r(),u(t.volunteerOpportunityForm.controls.externalEventUrl.errors!=null&&t.volunteerOpportunityForm.controls.externalEventUrl.errors.invalidUrl?7:-1)}}function Jt(i,a){i&1&&(o(0,"div",2)(1,"div",12)(2,"mat-form-field")(3,"mat-label"),n(4,"Number of positions"),e(),d(5,"input",64),o(6,"mat-hint",28),n(7,"Max number of participants you need (Optional)"),e()()()())}function Kt(i,a){i&1&&(o(0,"mat-error"),n(1," Enter valid "),o(2,"strong"),n(3,"email"),e(),n(4," address "),e())}function Xt(i,a){i&1&&(o(0,"mat-error"),n(1," Board term length is "),o(2,"strong"),n(3,"required"),e()())}function te(i,a){i&1&&(o(0,"mat-error"),n(1," Role available is "),o(2,"strong"),n(3,"required"),e()())}function ee(i,a){i&1&&(o(0,"mat-error"),n(1," Estimated monthly time commitment is "),o(2,"strong"),n(3,"required"),e()())}function ie(i,a){i&1&&(o(0,"mat-error"),n(1," This field is "),o(2,"strong"),n(3,"required"),e(),n(4," when fundraising expectation is Yes "),e())}function oe(i,a){if(i&1&&(o(0,"div",12)(1,"mat-form-field")(2,"mat-label"),n(3,"Expected board fundraising commitment"),e(),d(4,"input",70),m(5,ie,5,0,"mat-error"),e()()),i&2){let t=p(3);r(5),u(t.volunteerOpportunityForm.controls.boardFundraisingCommitment.errors!=null&&t.volunteerOpportunityForm.controls.boardFundraisingCommitment.errors.required?5:-1)}}function ne(i,a){if(i&1&&(o(0,"div",2)(1,"div",14)(2,"mat-form-field")(3,"mat-label"),n(4,"Board term length"),e(),d(5,"input",65),m(6,Xt,4,0,"mat-error"),e()(),o(7,"div",14)(8,"mat-form-field")(9,"mat-label"),n(10,"Role available"),e(),d(11,"input",66),m(12,te,4,0,"mat-error"),e()(),o(13,"div",12)(14,"mat-form-field")(15,"mat-label"),n(16,"Estimated monthly time commitment"),e(),d(17,"input",67),m(18,ee,4,0,"mat-error"),e()(),o(19,"div",12)(20,"p",52),n(21,"Board member fundraising expectation"),e(),o(22,"mat-radio-group",68)(23,"mat-radio-button",69),n(24,"Yes"),e(),o(25,"mat-radio-button",69),n(26,"No"),e()()(),m(27,oe,6,1,"div",12),e()),i&2){let t=p(2);r(6),u(t.volunteerOpportunityForm.controls.boardTermLength.errors!=null&&t.volunteerOpportunityForm.controls.boardTermLength.errors.required?6:-1),r(6),u(t.volunteerOpportunityForm.controls.roleAvailable.errors!=null&&t.volunteerOpportunityForm.controls.roleAvailable.errors.required?12:-1),r(6),u(t.volunteerOpportunityForm.controls.estimatedMonthlyTimeCommitment.errors!=null&&t.volunteerOpportunityForm.controls.estimatedMonthlyTimeCommitment.errors.required?18:-1),r(5),v("value",!0),r(2),v("value",!1),r(2),u(t.volunteerOpportunityForm.value.boardFundraisingExpectation?27:-1)}}function re(i,a){if(i&1&&(o(0,"div",48)(1,"app-date-time-picker",71)(2,"mat-hint"),d(3,"app-display-time-zone",72),e()()(),o(4,"div",48)(5,"app-date-time-picker",73)(6,"mat-hint"),d(7,"app-display-time-zone",72),e()()()),i&2){let t=p(2);r(),v("min",t.minDate)("type","start")("disabled",t.readonlyStartDate),r(4),v("min",t.volunteerOpportunityForm.value.startDate)}}function ae(i,a){i&1&&(o(0,"p",13),n(1," What special conditions or skillsets are required for this opportunity? "),e())}function le(i,a){i&1&&(o(0,"p",13),n(1,"What special conditions might this opportunity entail?"),e())}function me(i,a){if(i&1){let t=E();o(0,"mat-hint",26)(1,"span",78),g("click",function(){C(t);let c=p().$index,y=p(3);return x(y.removeQualification(c))})("keydown.enter",function(){C(t);let c=p().$index,y=p(3);return x(y.removeQualification(c))}),n(2,"Remove"),e()()}if(i&2){let t=p().$index;r(),w("aria-label",`Remove qualification ${t}`)}}function ue(i,a){if(i&1&&(o(0,"div",74)(1,"mat-form-field",76)(2,"mat-label"),n(3),e(),d(4,"input",77),m(5,me,3,1,"mat-hint",26),e()()),i&2){let t=a.$index,l=p(3);r(),v("formGroupName",t),r(2),f("Condition (e.g. '",l.qualificationsPlaceholder[t],"')"),r(),v("id",`qualification-${t}`),r(),u(l.volunteerOpportunityForm.value.qualifications.length>1?5:-1)}}function de(i,a){if(i&1){let t=E();o(0,"div",75)(1,"button",79),g("click",function(){C(t);let c=p(3);return x(c.addQualification())}),o(2,"span",80),d(3,"i",81),e(),n(4,"Add another condition "),e()()}}function pe(i,a){if(i&1&&(o(0,"div",51)(1,"div",12),m(2,ae,2,0,"p",13)(3,le,2,0,"p",13),e(),o(4,"div",12),F(5,ue,6,4,"div",74,q),m(7,de,5,0,"div",75),e()()),i&2){p();let t=D(6),l=p();r(2),u(t==="board_member"?2:3),r(3),V(l.qualifications().controls),r(2),u(l.volunteerOpportunityForm.value.qualifications.length<3?7:-1)}}function se(i,a){if(i&1){let t=E();o(0,"div",59)(1,"p",13),n(2,"Attach a waiver agreement"),e(),o(3,"p",57),n(4," Will require volunteer registrant to confirm they have downloaded and read the waiver agreement. "),e(),o(5,"app-file-upload",58),g("fileChange",function(c){C(t);let y=p(2);return x(y.onWaiverFileUpload(c))}),e()()}if(i&2){let t=p(2);r(5),v("directory",t.attachment.directory)("filePath",t.attachment.waiverUrl)}}function ce(i,a){if(i&1){let t=E();o(0,"div",2)(1,"div",8)(2,"div",9)(3,"div",2)(4,"div",8)(5,"form",10),g("ngSubmit",function(){C(t);let c=p();return x(c.createEditOpportunity())}),N(6),o(7,"div",11)(8,"div",12)(9,"p",13),n(10,"What type of opportunity is it?"),e()(),o(11,"div",14)(12,"mat-form-field")(13,"mat-label"),n(14,"Location"),e(),o(15,"mat-select",15),F(16,qt,2,2,"mat-option",16,Tt),e()()(),o(18,"div",14)(19,"mat-form-field")(20,"mat-label"),n(21,"Type"),e(),o(22,"mat-select",17),F(23,Nt,2,2,"mat-option",16,Tt),e()()()(),o(25,"div",18)(26,"div",12)(27,"p",13),n(28,"Where is this opportunity managed?"),e()(),o(29,"div",12)(30,"mat-radio-group",19)(31,"mat-radio-button",20),n(32," Link to an existing opportunity "),e(),m(33,Mt,2,0,"span",21),m(34,kt,9,2,"span",22),o(35,"mat-radio-button",23),n(36," Host this opportunity on Mightycause "),e(),m(37,Lt,2,0,"span",24),e()()(),o(38,"div",2)(39,"div",12)(40,"p",13),n(41,"What are the details of the opportunity?"),e()(),o(42,"div",12)(43,"div",2)(44,"div",12)(45,"mat-form-field")(46,"mat-label"),n(47,"Opportunity title"),e(),d(48,"input",25),o(49,"mat-hint",26),n(50),e(),m(51,Pt,2,0,"mat-error"),e()()(),o(52,"div",2)(53,"div",12)(54,"mat-form-field")(55,"mat-label"),n(56,"Location"),e(),d(57,"input",27),m(58,Bt,2,0,"mat-hint",28),m(59,Rt,2,0,"mat-hint",28),e()()(),o(60,"div",29)(61,"div",30)(62,"mat-form-field")(63,"mat-label"),n(64,"Address"),e(),d(65,"input",31),e()(),o(66,"div",32)(67,"mat-form-field")(68,"mat-label"),n(69,"Apt #"),e(),d(70,"input",33),m(71,$t,2,0,"mat-error"),e()(),o(72,"div",34)(73,"mat-form-field")(74,"mat-label",35),n(75,"City"),e(),d(76,"input",36),m(77,Gt,2,0,"mat-error"),e()(),o(78,"div",37)(79,"mat-form-field")(80,"mat-label",38),n(81,"
3State"),e(),o(82,"select",39),d(83,"option",40),F(84,Wt,2,2,"option",16,At),e(),m(86,zt,2,0,"mat-error"),e()(),o(87,"div",32)(88,"mat-form-field")(89,"mat-label",41),n(90,"ZIP / Post code"),e(),d(91,"input",42),m(92,Qt,2,0,"mat-error"),e()(),o(93,"div",30)(94,"mat-form-field")(95,"mat-label",43),n(96,"Country"),e(),o(97,"select",44),F(98,Zt,2,2,"option",16,At),e()()()(),m(100,Ht,8,2,"div",2),m(101,Jt,8,0,"div",2),o(102,"div",2)(103,"div",45)(104,"mat-form-field",46)(105,"mat-label"),n(106,"Opportunity description"),e(),d(107,"textarea",47),o(108,"mat-hint",28),n(109,"Optional"),e()()()(),o(110,"div",2)(111,"div",48)(112,"mat-form-field")(113,"mat-label"),n(114,"Lead contact name"),e(),d(115,"input",49),o(116,"mat-hint",28),n(117,"Who can participants reach out to? (Optional)"),e()()(),o(118,"div",48)(119,"mat-form-field")(120,"mat-label"),n(121,"Lead contact email address"),e(),d(122,"input",50),o(123,"mat-hint",28),n(124,"Optional"),e(),m(125,Kt,5,0,"mat-error"),e()()(),m(126,ne,28,6,"div",2),o(127,"div",51)(128,"div",12)(129,"p",52),n(130,"When is this opportunity happening?"),e()(),o(131,"div",12)(132,"mat-radio-group",53)(133,"mat-radio-button",54),n(134,' Label as "Ongoing" '),e(),o(135,"mat-radio-button",55),n(136," Show a date and time "),e()()(),m(137,re,8,4),e(),m(138,pe,8,2,"div",51),o(139,"div",2)(140,"div",56)(141,"p",13),n(142,"Attach a file"),e(),o(143,"p",57),n(144," Users can download an informational file prior to registering for the opportunity. "),e(),o(145,"app-file-upload",58),g("fileChange",function(c){C(t);let y=p();return x(y.onFileUpload(c))}),e()(),m(146,se,6,2,"div",59),e()()(),o(147,"div",60)(148,"div",12)(149,"button",61),n(150),e()()()()()()()()()}if(i&2){let t=p();r(5),v("formGroup",t.volunteerOpportunityForm),r();let l=M(t.volunteerOpportunityForm.value.type);r(10),V(t.hostingTypes),r(7),V(t.types),r(10),u(t.volunteerOpportunityForm.value.managed==="linked"?33:-1),r(),u(t.volunteerOpportunityForm.value.managed==="linked"?34:-1),r(3),u(t.volunteerOpportunityForm.value.managed==="hosted"?37:-1),r(13),f("",t.volunteerOpportunityForm.controls.title.value.length||0," / 80"),r(),u(t.volunteerOpportunityForm.controls.title.errors&&t.volunteerOpportunityForm.controls.title.errors.required?51:-1),r(7),u(t.volunteerOpportunityForm.value.hostingType==="in_person"?58:-1),r(),u(t.volunteerOpportunityForm.value.hostingType==="online"?59:-1),r(),v("hidden",t.volunteerOpportunityForm.value.hostingType==="online"),r(11),u(t.volunteerOpportunityForm.controls.apt.errors&&t.volunteerOpportunityForm.controls.apt.errors.required?71:-1),r(6),u(t.volunteerOpportunityForm.controls.city.errors&&t.volunteerOpportunityForm.controls.city.errors.required?77:-1),r(7),V(t.states),r(2),u(t.volunteerOpportunityForm.controls.state.errors&&t.volunteerOpportunityForm.controls.state.errors.required?86:-1),r(6),u(t.volunteerOpportunityForm.controls.postalCode.errors&&t.volunteerOpportunityForm.controls.postalCode.errors.required?92:-1),r(6),V(t.countries),r(2),u(t.volunteerOpportunityForm.value.hostingType==="online"?100:-1),r(),u(l==="volunteering"||l==="board_member"?101:-1),r(24),u(t.volunteerOpportunityForm.controls.contactEmail.errors&&t.volunteerOpportunityForm.controls.contactEmail.errors.invalidEmail?125:-1),r(),u(l==="board_member"?126:-1),r(11),u(t.volunteerOpportunityForm.value.timePeriod==="date"?137:-1),r(),u(l==="volunteering"||l==="board_member"?138:-1),r(7),v("directory",t.attachment.directory)("filePath",t.attachment.fileUrl),r(),u(l==="volunteering"?146:-1),r(3),v("active",t.processing),r(),f(" ",t.updateOpportunity?"Update opportunity":"Create opportunity"," ")}}var je=(()=>{class i{fb=_(X);route=_(I);localeService=_(Ot);volunteerService=_(gt);orgService=_(yt);router=_(k);snackBar=_(_t);suggestedArticlesService=_(St);updateOpportunity=!1;loadingForm=!1;org;states;countries;qualificationsPlaceholder=["Ability to lift heavy objects","Good verbal skills","Age 16+"];hostingTypes=[{value:"in_person",viewValue:"In-person"},{value:"online",viewValue:"Online"}];types=Vt;attachment={directory:null,fileUrl:null,waiverUrl:null};minDate=h.now();userTimeZone="";processing=!1;readonlyStartDate=!1;volunteerOpportunityForm=this.fb.group({hostingType:[this.hostingTypes[0].value],type:[this.types[0].value],managed:["hosted"],url:[""],title:["",s.required],location:[""],startDate:[h.now().startOf("day"),s.required],endDate:[h.now().set({hour:23,minute:59,second:59}),s.required],address:[""],apt:[""],city:["",s.required],state:["",s.required],postalCode:["",s.required],country:["USA"],externalEventUrl:[""],contactName:[""],contactEmail:["",O.emailValidator],timePeriod:["ongoing"],positions:[""],description:[""],qual
3ifications:this.fb.array([]),boardTermLength:[""],roleAvailable:[""],estimatedMonthlyTimeCommitment:[""],boardFundraisingExpectation:[!1],boardFundraisingCommitment:[""]});subscription=new S;constructor(){this.org=this.orgService.data,this.suggestedArticlesService.suggestedLabel="opportunities-create",this.route.snapshot.params.volunteerId?(this.updateOpportunity=!0,this.loadingForm=!0,this.volunteerService.getVolunteerOpportunity(this.route.snapshot.params.volunteerId).subscribe(t=>{this.loadingForm=!1,t.opportunity_status==="active"&&h.now()>h.fromISO(t.start_at)&&(this.minDate=null,this.readonlyStartDate=!0,this.volunteerOpportunityForm.controls.startDate.disable()),this.volunteerOpportunityForm.controls.hostingType.setValue(t.hosting_type),this.volunteerOpportunityForm.controls.type.setValue(t.opportunity_type),this.volunteerOpportunityForm.controls.managed.setValue(t.opportunity_managed),this.volunteerOpportunityForm.controls.url.setValue(t.opportunity_url),this.volunteerOpportunityForm.controls.title.setValue(t.title),this.volunteerOpportunityForm.controls.location.setValue(t.location),t.start_at&&t.end_at?(this.volunteerOpportunityForm.controls.timePeriod.setValue("date"),this.volunteerOpportunityForm.controls.startDate.setValue(t.start_at),this.volunteerOpportunityForm.controls.endDate.setValue(t.end_at)):this.volunteerOpportunityForm.controls.timePeriod.setValue("ongoing"),this.volunteerOpportunityForm.controls.address.setValue(t.address1),this.volunteerOpportunityForm.controls.apt.setValue(t.address2),this.volunteerOpportunityForm.controls.city.setValue(t.city),this.volunteerOpportunityForm.controls.state.setValue(t.state),this.volunteerOpportunityForm.controls.postalCode.setValue(t.postal_code),this.volunteerOpportunityForm.controls.country.setValue(t.country),this.volunteerOpportunityForm.controls.contactName.setValue(t.contact_name),this.volunteerOpportunityForm.controls.contactEmail.setValue(t.contact_email),this.volunteerOpportunityForm.controls.positions.setValue(t.total_positions),this.volunteerOpportunityForm.controls.description.setValue(t.description),this.volunteerOpportunityForm.controls.externalEventUrl.setValue(t.external_event_url),this.volunteerOpportunityForm.patchValue({boardTermLength:t.board_term_length??"",roleAvailable:t.role_available??"",estimatedMonthlyTimeCommitment:t.estimated_monthly_time_commitment??"",boardFundraisingExpectation:!!t.board_fundraising_expectation,boardFundraisingCommitment:t.board_fundraising_commitment??""}),this.updateBoardMemberValidators(t.opportunity_type),t.qualifications?.length>0?t.qualifications.forEach(l=>{this.qualifications().push(this.fb.group({value:l}))}):this.addQualification(),this.attachment.fileUrl=t.file_url,this.attachment.waiverUrl=t.waiver_file_url})):this.addQualification(),this.org&&(this.attachment.directory=`org_uploads_v2/${this.org.perm_urn}/volunteer_attachments/`)}ngOnInit(){this.states=this.localeService.statesList,this.countries=this.localeService.countriesList,this.userTimeZone=h.local().zoneName,this.subscription.add(this.volunteerOpportunityForm.get("hostingType").valueChanges.subscribe(t=>{t==="in_person"?this.volunteerOpportunityForm.value.managed==="linked"?(this.removeAddressValidation(),this.removeExternalEventUrlValidation()):this.volunteerOpportunityForm.value.managed==="hosted"&&(this.addAddressValidation(),this.removeExternalEventUrlValidation()):t==="online"&&(this.volunteerOpportunityForm.value.managed==="linked"?(this.removeAddressValidation(),this.removeExternalEventUrlValidation()):this.volunteerOpportunityForm.value.managed==="hosted"&&(this.removeAddressValidation(),this.addExternalEventUrlValidation()))})),this.subscription.add(this.volunteerOpportunityForm.get("managed").valueChanges.subscribe(t=>{t==="linked"?(this.volunteerOpportunityForm.controls.url.setValidators(s.compose([s.required,O.urlValidator])),this.volunteerOpportunityForm.controls.url.updateValueAndValidity(),this.volunteerOpportunityForm.value.hostingType==="in_person"?(this.removeAddressValidation(),this.removeExternalEventUrlValidation()):this.volunteerOpportunityForm.value.hostingType==="online"&&(this.removeAddressValidation(),this.removeExternalEventUrlValidation())):t==="hosted"&&(this.volunteerOpportunityForm.controls.url.setValue(""),this.volunteerOpportunityForm.controls.url.clearValidators(),this.volunteerOpportunityForm.controls.url.updateValueAndValidity(),this.volunteerOpportunityForm.value.hostingType==="in_person"?(this.addAddressValidation(),this.removeExternalEventUrlValidation()):this.volunteerOpportunityForm.value.hostingType==="online"&&(this.removeAddressValidation(),this.addExternalEventUrlValidation()))})),this.subscription.add(this.volunteerOpportunityForm.get("timePeriod").valueChanges.subscribe(t=>{t==="date"?(this.volunteerOpportunityForm.controls.startDate.setValue(h.now().startOf("day")),this.volunteerOpportunityForm.controls.endDate.setValue(h.now().set({hour:23,minute:59,second:59})),this.volunteerOpportunityForm.controls.startDate.setValidators(s.required),this.volunteerOpportunityForm.controls.endDate.setValidators(s.required),this.volunteerOpportunityForm.controls.startDate.updateValueAndValidity(),this.volunteerOpportunityForm.controls.endDate.updateValueAndValidity()):t==="ongoing"&&(this.volunteerOpportunityForm.controls.startDate.setValue(null),this.volunteerOpportunityForm.controls.endDate.setValue(null),this.volunteerOpportunityForm.controls.startDate.setValidators(null),this.volunteerOpportunityForm.controls.endDate.setValidators(null),this.volunteerOpportunityForm.controls.startDate.updateValueAndValidity(),this.volunteerOpportunityForm.controls.endDate.updateValueAndValidity())}
3)),this.route.snapshot.params.volunteerId||(this.volunteerOpportunityForm.controls.managed.setValue("linked"),this.volunteerOpportunityForm.controls.managed.updateValueAndValidity()),this.updateBoardMemberValidators(this.volunteerOpportunityForm.value.type),this.subscription.add(this.volunteerOpportunityForm.get("type").valueChanges.subscribe(t=>{t!=="board_member"&&this.volunteerOpportunityForm.patchValue({boardTermLength:"",roleAvailable:"",estimatedMonthlyTimeCommitment:"",boardFundraisingExpectation:!1,boardFundraisingCommitment:""},{emitEvent:!1}),this.updateBoardMemberValidators(t)})),this.subscription.add(this.volunteerOpportunityForm.get("boardFundraisingExpectation").valueChanges.subscribe(t=>{this.updateFundraisingCommitmentValidator(!!t)}))}ngOnDestroy(){this.subscription.unsubscribe()}qualifications(){return this.volunteerOpportunityForm.get("qualifications")}addQualification(){this.qualifications().push(this.fb.group({value:""}))}removeQualification(t){this.qualifications().removeAt(t)}updateBoardMemberValidators(t){let l=t==="board_member";if(["boardTermLength","roleAvailable","estimatedMonthlyTimeCommitment"].forEach(y=>{let b=this.volunteerOpportunityForm.get(y);l?b?.setValidators(s.required):b?.clearValidators(),b?.updateValueAndValidity({emitEvent:!1})}),l)this.updateFundraisingCommitmentValidator(!!this.volunteerOpportunityForm.value.boardFundraisingExpectation);else{let y=this.volunteerOpportunityForm.get("boardFundraisingCommitment");y?.clearValidators(),y?.updateValueAndValidity({emitEvent:!1})}}updateFundraisingCommitmentValidator(t){if(this.volunteerOpportunityForm.value.type!=="board_member")return;let l=this.volunteerOpportunityForm.get("boardFundraisingCommitment");t?l?.setValidators(s.required):(l?.clearValidators(),l?.setValue("")),l?.updateValueAndValidity({emitEvent:!1})}onFileUpload(t){this.attachment.fileUrl=t.filePath}onWaiverFileUpload(t){this.attachment.waiverUrl=t.filePath}createEditOpportunity(){if(this.volunteerOpportunityForm.invalid){this.snackBar.open("Fill in mandatory fields.","",{duration:5e3});return}this.processing=!0;let t={org_id:this.org.id,hosting_type:this.volunteerOpportunityForm.value.hostingType,opportunity_type:this.volunteerOpportunityForm.value.type,opportunity_managed:this.volunteerOpportunityForm.value.managed,title:this.volunteerOpportunityForm.value.title,location:this.volunteerOpportunityForm.value.location,description:this.volunteerOpportunityForm.value.description,country:this.volunteerOpportunityForm.value.country,address1:this.volunteerOpportunityForm.value.address,address2:this.volunteerOpportunityForm.value.apt,city:this.volunteerOpportunityForm.value.city,state:this.volunteerOpportunityForm.value.state,postal_code:this.volunteerOpportunityForm.value.postalCode,contact_name:this.volunteerOpportunityForm.value.contactName,contact_email:this.volunteerOpportunityForm.value.contactEmail,total_positions:this.volunteerOpportunityForm.value.positions,file_url:this.attachment.fileUrl,waiver_file_url:this.attachment.waiverUrl,user_timezone:this.userTimeZone};if(this.volunteerOpportunityForm.value.qualifications.length>0){let c=[];this.volunteerOpportunityForm.value.qualifications.forEach(y=>{y.value.trim()!==""&&c.push(y.value)}),t.qualifications=c}this.volunteerOpportunityForm.value.managed==="linked"?t.opportunity_url=O.resolveUrlValue(this.volunteerOpportunityForm.value.url):t.opportunity_url=null,this.volunteerOpportunityForm.value.hostingType==="online"?t.external_event_url=O.resolveUrlValue(this.volunteerOpportunityForm.value.externalEventUrl):t.external_event_url=null,this.volunteerOpportunityForm.value.timePeriod==="date"?(t.start_at=this.volunteerOpportunityForm.value.startDate,t.end_at=this.volunteerOpportunityForm.value.endDate):(t.start_at=null,t.end_at=null),this.volunteerOpportunityForm.value.type==="board_member"&&(t.board_term_length=this.volunteerOpportunityForm.value.boardTermLength,t.role_available=this.volunteerOpportunityForm.value.roleAvailable,t.estimated_monthly_time_commitment=this.volunteerOpportunityForm.value.estimatedMonthlyTimeCommitment,t.board_fundraising_expectation=this.volunteerOpportunityForm.value.boardFundraisingExpectation,t.board_fundraising_commitment=this.volunteerOpportunityForm.value.boardFundraisingCommitment||null);let l;this.updateOpportunity?l=this.volunteerService.updateVolunteerOpportunity(this.route.
3snapshot.params.volunteerId,t):l=this.volunteerService.createVolunteerOpportunity(t),U(l).then(()=>{this.processing=!1,this.updateOpportunity?this.router.navigate(["../../"],{relativeTo:this.route}):this.router.navigate(["../"],{relativeTo:this.route})},()=>{this.processing=!1})}addAddressValidation(){this.volunteerOpportunityForm.controls.country.setValue("USA"),this.volunteerOpportunityForm.controls.city.setValidators(s.required),this.volunteerOpportunityForm.controls.state.setValidators(s.required),this.volunteerOpportunityForm.controls.postalCode.setValidators(s.required),this.volunteerOpportunityForm.controls.country.setValidators(s.required),this.volunteerOpportunityForm.controls.apt.updateValueAndValidity(),this.volunteerOpportunityForm.controls.city.updateValueAndValidity(),this.volunteerOpportunityForm.controls.state.updateValueAndValidity(),this.volunteerOpportunityForm.controls.postalCode.updateValueAndValidity(),this.volunteerOpportunityForm.controls.country.updateValueAndValidity()}removeAddressValidation(){this.volunteerOpportunityForm.controls.city.setValue(null),this.volunteerOpportunityForm.controls.state.setValue(null),this.volunteerOpportunityForm.controls.postalCode.setValue(null),this.volunteerOpportunityForm.controls.country.setValue(null),this.volunteerOpportunityForm.controls.city.setValidators(null),this.volunteerOpportunityForm.controls.state.setValidators(null),this.volunteerOpportunityForm.controls.postalCode.setValidators(null),this.volunteerOpportunityForm.controls.country.setValidators(null),this.volunteerOpportunityForm.controls.city.updateValueAndValidity(),this.volunteerOpportunityForm.controls.state.updateValueAndValidity(),this.volunteerOpportunityForm.controls.postalCode.updateValueAndValidity(),this.volunteerOpportunityForm.controls.country.updateValueAndValidity()}addExternalEventUrlValidation(){this.volunteerOpportunityForm.controls.externalEventUrl.setValidators(s.compose([s.required,O.urlValidator])),this.volunteerOpportunityForm.controls.externalEventUrl.updateValueAndValidity()}removeExternalEventUrlValidation(){this.volunteerOpportunityForm.controls.externalEventUrl.setValue(""),this.volunteerOpportunityForm.controls.externalEventUrl.setValidators(null),this.volunteerOpportunityForm.controls.externalEventUrl.updateValueAndValidity()}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=A({type:i,selectors:[["app-create-update-volunteer"]],decls:8,vars:2,consts:[[1,"min-vh-100","pb-5"],[1,"container"],[1,"row"],[1,"col-12","text-center"],[1,"h3","mb-3"],[1,"col-12","mb-2"],["viewBox","0 0 100 25"],["x","0","y","0","rx","3","ry","3","width","100%","height","100%"],[1,"col-10","offset-1"],[1,"bg-white"],["appScrollToFirstInvalid","",3,"ngSubmit","formGroup"],[1,"row","my-4"],[1,"col-12"],[1,"mb-0"],[1,"col-12","col-md-6"],["formControlName","hostingType"],[3,"value"],["formControlName","type"],[1,"row","mb-4"],["formControlName","managed",1,"d-flex","flex-column"],["value","linked","color","primary"],[1,"sm","ms-3","text-secondary","mb-0"],[1,"ms-2"],["value","hosted","color","primary"],[1,"sm","ms-3","text-secondary"],["type","text","id","title","matInput","","formControlName","title","autocomplete","off","maxlength","80","cdkFocusInitial",""],["align","end"],["type","text","matInput","","formControlName","location","autocomplete","off"],["align","start"],[1,"row",3,"hidden"],[1,"col-12","col-sm-8"],["type","text","matInput","","formControlName","address","id","address1","autocomplete","billing street-address"],[1,"col-12","col-sm-4"],["type","text","matInput","","formControlName","apt","id","address2"],[1,"col-12","col-sm-7"],["for","city"],["type","text","matInput","","formControlName","city","id","city","autocomplete","billing address-level2"],[1,"col-12","col-sm-5"],["for","state"],["matNativeControl","","formControlName","state","id","state","autocomplete","billing address-level1"],["label","Select state","selected","","disabled",""],["for","postalCode"],["type","text","matInput","","formControlName","postalCode","id","postalCode","autocomplete","billing postal-code","maxlength","20"],["for","country"],["matNativeControl","","formControlName","country","id","country","autocomplete","billing country-name"],[1,"col-12","mt-3"],["appearance","outline"],["matInput","","formControlName","description"],[1,"col-12","col-sm-6"],["type","text","id","contactName","matInput","","formControlName","contactName"],["type","text","id","contactEmail","matInput","","formControlName","contactEmail"],[1,"row","mt-4"],[1,"mb-1"],["formControlName","timePeriod",1,"d-flex","flex-column"],["value","ongoing","color","primary"],["value","date","color","primary"],[1,"col-12","mt-2","mb-2"],[1,"sm"],[3,"fileChange","directory","filePath"],[1,"col-12","mt-2","mb-1"],[1,"row","mt-2","pb-4","text-center"],["type","submit","mat-raised-button","","color","primary","appLoadingBtn","",1,"auto",3,"active"],["type","text","matInput","","formControlName","url","appNormalizeUrl",""],["type","text","id","URL","matInput","","formControlName","externalEventUrl","appNormalizeUrl",""],["type","text","id","positions","matInput","","formControlName","positions","appMask","numeral","inputmode","numeric","pattern","[0-9.,]*"],["type","text","matInput","","formControlName","boardTermLength","autocomplete","off"],["type","text","matInput","","formControlName","roleAvailable","autocomplete","off"],["type","text","matInput","","formControlName","estimatedMonthlyTimeCommitment","autocomplete","off"],["formControlName","boardFundraisingExpectation",1,"d-flex","flex-column"],["color","primary",3,"value"],["type","text","matInput","","formControlName","boardFundraisingCommitment","autocomplete","off"],["label","Start","formControlName","startDate",3,"min","type","disabled"],["tz","browser"],["type","end","label","End","formControlName","endDate",3,"min"],["formArrayName","qualifications"],[1,"text-center","mb-2"],[3,"formGroupName"],["type","text","matInput","","formControlName","value",3,"id"],["tabindex","0","role","button",1,"curs
3or-pointer",3,"click","keydown.enter"],["type","button","mat-button","","color","accent",1,"custom",3,"click"],[1,"left-icon"],[1,"fal","fa-plus"]],template:function(l,c){l&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),n(5),e()()(),m(6,wt,5,0,"div")(7,ce,151,25,"div",2),e()()),l&2&&(r(5),f(" ",c.updateOpportunity?"Edit an opportunity":"Add an opportunity"," "),r(),u(c.loadingForm?6:7))},dependencies:[tt,G,j,H,B,Y,R,$,J,K,W,Z,z,Q,P,L,at,rt,it,nt,ot,mt,lt,Ft,Ct,xt,pt,dt,et,ht,ft,st,vt,ct,bt,Et,Ut,ut],encapsulation:2})}return i})();export{je as CreateUpdateVolunteerComponent}; 4 5//# debugId=ec24e4f7-2091-5c60-b7e8-2ca2131ad815
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.