1import{a as be}from"./chunk-XPLYBCSC.js";import{a as B}from"./chunk-4CVZBQNN.js";import"./chunk-U22BTVEZ.js";import{$b as he,Ec as ue,Gc as Se,Hc as _e,Hd as Ce,Mb as fe,Wc as xe,b as te,d as ie,k as ne,kd as ve,kh as ye,ve as M,ye as ge}from"./chunk-X5J6QTCG.js";import{$ as D,$a as u,Ad as U,Bf as pe,E as N,Fa as p,Ib as e,Jf as me,Ka as h,Kb as w,Ma as v,Na as A,Qb as K,Rb as X,Sa as E,Sb as Y,U as b,Xa as P,_ as k,ba as j,bb as S,be as le,bg as ce,d as I,db as $,dc as Z,eb as V,fa as _,fb as z,fi as de,ga as x,gb as d,hb as s,hd as ee,ib as a,jb as m,nb as H,ob as W,pb as Q,pj as R,qb as L,sb as C,tb as c,u as O,vd as oe,wd as re,xb as q,xd as se,yb as G,yd as ae,zb as J}from"./chunk-SMW7PHYX.js";import"./chunk-BMIYOSOG.js";var g=(()=>{let n=class n{get baseURL(){return"admin/club-sponsors/"}constructor(t){this.webAPI=t,this.sponsorColumns=[{field:"name",header:"Name"},{field:"sponsorTypeID",header:"Affiliate Type"},{field:"sortOrder",header:"Sort Order"}]}getSponsorMetadata(){return this.webAPI.getData(this.baseURL+"metadata")}getSponsor(t){return this.webAPI.getData(this.baseURL+`${t}`)}saveSponsor(t){return t.sponsorID?this.webAPI.putData(this.baseURL+`${t.sponsorID}`,t):this.webAPI.postData(this.baseURL,t)}searchHomePageSponsors(){return this.webAPI.getData(this.baseURL,this.getHomePageSponsorsSearchParams())}saveSponsorImage(t,i){return t?this.webAPI.postMultiPartContent(this.baseURL+`${t}/file`,i,i.name):this.webAPI.postMultiPartContent(this.baseURL+"file",i,i.name)}deleteSponsor(t){return this.webAPI.deleteData(this.baseURL+`${t}`)}getHomePageSponsorsSearchParams(){let t=new ee;return t=t.append("page",this.sponsorFilters.page.toString()),t=t.append("rows",this.sponsorFilters.rows.toString()),t=t.append("includeCount",this.sponsorFilters.getTotalCount.toString()),this.sponsorFilters.orderBy&&(t=t.append("orderBy",this.sponsorFilters.orderBy)),t}};n.\u0275fac=function(i){return new(i||n)(j(de))},n.\u0275prov=k({token:n,factory:n.\u0275fac});let o=n;return o})();var Re=["fileUploadField"];function Me(o,n){o&1&&(e(0,` 2 `),s(1,"app-inline-alert",2),e(2,"This Sponsor Is Owned By A Parent Club"),a(),e(3,` 3`)),o&2&&(p(),d("isInline",!1))}function Pe(o,n){o&1&&(e(0,` 4 `),s(1,"app-dynamic-form-field",11),e(2,` 5 `),a(),e(3,` 6 `)),o&2&&(p(),d("enableFilter",!0))}function Ue(o,n){if(o&1){let r=L();e(0,` 7 `),s(1,"app-dynamic-form",3),C("onSubmit",function(i){_(r);let l=c(2);return x(l.save(i))})("onDelete",function(){_(r);let i=c(2);return x(i.delete())})("onCancel",function(){_(r);let i=c(2);return x(i.cancel())}),e(2,` 8 `),m(3,"app-dynamic-form-field",4),e(4,` 9 `),m(5,"app-dynamic-form-field",5),e(6,` 10 `),s(7,"app-dynamic-form-field",6,0),C("onChange",function(i){_(r);let l=c(2);return x(l.file=i.target.files[0])}),e(9,` 11 `),a(),e(10,` 12 `),m(11,"app-dynamic-form-field",7),e(12,` 13 `),m(13,"app-dynamic-form-field",8),e(14,` 14 `),u(15,Pe,4,1),m(16,"hr"),e(17,` 15 `),s(18,"div"),e(19,` 16 `),s(20,"h4"),e(21,"Mobile options"),a(),e(22,` 17 `),m(23,"app-dynamic-form-field",9),e(24,` 18 `),m(25,"app-dynamic-form-field",10),e(26,` 19 `),a(),e(27,` 20 `),a(),e(28,` 21 `)}if(o&2){let r=c(2);p(),d("fields",r.fields)("entity",r.sponsor)("horizontalForm",!0)("contentFieldsMode",!0)("showCancelButton",!0)("showSaveAndAddButton",!1)("showDeleteButton",!!r.sponsorID)("viewOnly",r.viewOnly),p(6),d("selectedFileName",r.sponsor.file)("canDownload",!1)("acceptedFileExtensions",r.acceptedFileTypes)("acceptType",r.fileImageUploadAcceptTypes),p(8),S(r.viewOnly?-1:15)}}function Be(o,n){if(o&1&&(e(0,` 22 `),u(1,Ue,29,13)),o&2){let r=c();p(),S(r.fields?1:-1)}}function Oe(o,n){o&1&&(e(0,` 23 `),m(1,"app-skeleton-template",12),e(2,` 24 `))}var Fe=(()=>{let n=class n{constructor(t,i,l,f,y){this.siteDataService=t,this.sponsorService=i,this.route=l,this.router=f,this.formService=y,this.unsubscribe$=new I,this.loading=!0,this.activeTab=0,this.viewOnly=!1,this.acceptedFileTypes=pe,this.fileImageUploadAcceptTypes=me}
24ngOnInit(){this.siteDataService.hideSiteLoader(),this.route.params.subscribe(t=>{t.id&&(t.id==="new"?(this.sponsorID=void 0,this.sponsorService.getSponsorMetadata().pipe(b(this.unsubscribe$)).subscribe(i=>{this.sponsor=new be,this.sponsor.sponsorTypeID=1,this.fields=i.formMetadata.fields,this.loading=!1})):(this.sponsorID=+t.id,O([this.sponsorService.getSponsorMetadata(),this.sponsorService.getSponsor(this.sponsorID)]).pipe(b(this.unsubscribe$)).subscribe(i=>{let l=i[0];this.fields=l.formMetadata.fields,this.sponsor=i[1],this.viewOnly=!this.sponsor.sponsorClubAssignment.find(f=>f.clubId===l.clubID).isOwner,this.loading=!1})))})}save(t){t.sponsorID=this.sponsorID,t.linkURL===""&&(t.linkURL=void 0),t.file=this.sponsor.file,this.fileUploadField.hasFileChanged&&this.file?this.sponsorService.saveSponsorImage(t.sponsorID,this.file).pipe(N(i=>(t.file=i.location,this.sponsorService.saveSponsor(t)))).subscribe(i=>{this.fileUploadField.hasFileChanged=!1,i&&(this.sponsor=i,this.sponsorID=i.sponsorID),t.file&&(this.sponsor.file=t.file),this.router.navigate(["../"],{relativeTo:this.route}),this.siteDataService.showSiteSuccessAlert("Sponsor saved successfully"),this.formService.hideFormLoader()},i=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving this sponsor.")}):this.sponsorService.saveSponsor(t).pipe(b(this.unsubscribe$)).subscribe(i=>{i&&(this.sponsor=i,this.sponsorID=i.sponsorID),this.router.navigate(["../"],{relativeTo:this.route}),this.siteDataService.showSiteSuccessAlert("Sponsor saved successfully"),this.formService.hideFormLoader()},i=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("There was a problem saving this sponsor.")})}delete(){this.sponsorService.deleteSponsor(this.sponsorID).pipe(b(this.unsubscribe$)).subscribe(t=>{this.siteDataService.showSiteSuccessAlert("Sponsor deleted successfully"),this.cancel()},t=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting this sponsor"),this.formService.hideFormLoader()})}cancel(){this.router.navigate([".."],{relativeTo:this.route})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};n.\u0275fac=function(i){return new(i||n)(h(R),h(g),h(oe),h(se),h(he))},n.\u0275cmp=v({type:n,selectors:[["ng-component"]],viewQuery:function(i,l){if(i&1&&q(Re,5),i&2){let f;G(f=J())&&(l.fileUploadField=f.first)}},standalone:!1,decls:7,vars:4,consts:[["fileUploadField",""],["parentLinkUrl","./","parentLinkText","Sponsors",3,"pageTitle","showBackButton"],["alertType","warning",3,"isInline"],["formID","club-form","buttonsPosition","left",3,"onSubmit","onDelete","onCancel","fields","entity","horizontalForm","contentFieldsMode","showCancelButton","showSaveAndAddButton","showDeleteButton","viewOnly"],["fieldName","name"],["fieldName","linkURL"],["fieldName","file",3,"onChange","selectedFileName","canDownload","acceptedFileExtensions","acceptType"],["fieldName","sortOrder"],["fieldName","sponsorTypeID"],["fieldName","isMobileBannerAd"],["fieldName","isInterstitialAd"],["fieldName","sponsorClubAssignment",3,"enableFilter"],["skeletonType","form"]],template:function(i,l){i&1&&(m(0,"app-admin-header",1),e(1,` 25`),u(2,Me,4,1),s(3,"section"),e(4,` 26 `),u(5,Be,2,1)(6,Oe,3,0),a()),i&2&&(d("pageTitle","Sponsor")("showBackButton",!0),p(2),S(l.fields&&l.viewOnly?2:-1),p(3),S(l.loading?6:5))},dependencies:[Ce,ve,xe,fe,M],encapsulation:2});let o=n;return o})();var F=class{constructor(n=void 0){this.rows=25,this.orderBy=n}};var Ne=o=>["/admin/content/sponsors",o];function ke(o,n){if(o&1&&(e(0,` 27 `),m(1,"p-sortIcon",15),e(2,` 28 `)),o&2){let r=c().$implicit;p(),d("field",r.field)}}function je(o,n){if(o&1&&(e(0,` 29 `),s(1,"th",14),e(2),u(3,ke,3,1),a(),e(4,` 30 `)),o&2){let r=n.$implicit,t=c(3);p(),d("pSortableColumn",r.field?r.field:null),P("aria-label",r.field?t.AriaLabels.ACTIVATE_SORT:""),p(),w(` 31 `,r.header,` 32 `),p(),S(r.field?3:-1)}}function $e(o,n){if(o&1&&(e(0,` 33 `),s(1,"tr"),e(2,` 34 `),V(3,je,5,4,null,null,$),a(),e(5,` 35 `)),o&2){let r=c(2);p(3),z(r.sponsorService.sponsorColumns)}}function Ve(o,n){if(o&1&&(e(0,` 36 `),s(1,"tr"),e(2,` 37 `),s(3,"td"),e(4,` 38 `),s(5,"a",16),e(6),a(),e(7,` 39 `),a(),e(8,` 40 `),s(9,"td"),e(10),a(),e(11,` 41 `),s(12,"td"),e(13),a(),e(14,` 42 `),a(),e(15,` 43 `)),o&2){let r=n.$implicit;p(5),d("routerLink",Z(4,Ne,r.sponsor.sponsorID)),p(),w(` 44 `,r.sponsor.name,` 45 `),p(4),w(` 46 `,r.sponsor.zSponsorType.description,` 47 `),p(3),w(` 48 `,r.sponsor.sortOrder,` 49 `)}}function ze(o,n){if(o&1&&(e(0,` 50 `),s(1,"tr"),e(2,` 51 `),s(3,"td",17),e(4,` 52 The search criteria produced no results. 53 `),a(),e(5,` 54 `),a(),e(6,` 55 `)),o&2){let r=n.$implicit;p(3),P("colspan",r?r.length:2)}}function He(o,n){if(o&1){let r=L();e(0,` 56 `),s(1,"p-table",10),C("onLazyLoad",function(i){_(r);let l=c();return x(l.search(i))}),e(2,` 57 `),E(3,$e,6,0,"ng-template",11),e(4,` 58 `),E(5,Ve,16,6,"ng-template",12),e(6,` 59 `),E(7,ze,7,1,"ng-template",13),e(8,` 60 `),a(),e(9,` 61 `)}if(o&2){let r=c();p(),d("columns",r.sponsorService.sponsorColumns)("value",r.searchResults)("lazy",!0)("paginator",!0)("alwaysShowPaginator",!1)("totalRecords",r.totalRecords)("rows",25)("loading",r.loading)}}var Ie=(()=>{let n=class n{constructor(t,i){this.siteDataService=t,this.sponsorService=i,this.unsubscribe$=new I,this.loading=!0,this.totalRecords=0,this.showTable=!1,this.AriaLabels=ce}ngOnInit(){this.sponsorService.sponsorFilters&&this.sponsorService.sponsorFilters.page?this.showTable=!0:this.sponsorService.sponsorFilters=new F,this.run(),this.siteDataService.hide
61SiteLoader()}run(){this.sponsorService.sponsorFilters.page=1,this.totalRecords=0,this.showTable?this.search():setTimeout(()=>{this.showTable=!0},15)}search(t=null){let i=this.sponsorService.sponsorFilters;t&&t.sortField&&(i.orderBy=t.sortField+" "+(t.sortOrder===1?"ASC":"DESC"),i.page=t.first/i.rows+1),i.getTotalCount=this.totalRecords===0,this.loading=!0,this.sponsorService.searchHomePageSponsors().subscribe(l=>{this.searchResults=l.results,i.getTotalCount&&(this.totalRecords=l.count),this.loading=!1},()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")})}resetFilters(){this.sponsorService.sponsorFilters=new F(this.sponsorService.sponsorFilters.orderBy)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};n.\u0275fac=function(i){return new(i||n)(h(R),h(g))},n.\u0275cmp=v({type:n,selectors:[["ng-component"]],standalone:!1,decls:29,vars:4,consts:[["pageTitle","Sponsors",3,"primaryBtnText","primaryBtnUrl"],[3,"adminFilterReset","adminFilterSearch"],["primary",""],[1,"col","pr-0"],[1,"p-input-icon-left","full-width"],[1,"fa","fa-magnifying-glass"],["type","text","id","search","pInputText","","placeholder","Search",1,"full-width","pl-4",3,"ngModelChange","ngModel"],["for","search",1,"sr-only"],["advanced",""],[1,"table-responsive"],["sortField","internalName",1,"table","table-striped","table-sm",3,"onLazyLoad","columns","value","lazy","paginator","alwaysShowPaginator","totalRecords","rows","loading"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],[3,"pSortableColumn"],[3,"field"],[3,"routerLink"],[2,"text-align","left"]],template:function(i,l){i&1&&(s(0,"app-admin-header",0),e(1,` 62`),a(),e(2,` 63`),s(3,"app-admin-filter",1),C("adminFilterReset",function(){return l.resetFilters()})("adminFilterSearch",function(){return l.run()}),e(4,` 64 `),H(5,2),e(6,` 65 `),s(7,"div",3),e(8,` 66 `),s(9,"span",4),e(10,` 67 `),m(11,"i",5),e(12,` 68 `),s(13,"input",6),Y("ngModelChange",function(y){return X(l.sponsorService.sponsorFilters.name,y)||(l.sponsorService.sponsorFilters.name=y),y}),a(),e(14,` 69 `),m(15,"label",7),e(16,` 70 `),a(),e(17,` 71 `),a(),e(18,` 72 `),W(),e(19,` 73 `),Q(20,8),e(21,` 74`),a(),e(22,` 75 76`),s(23,"section"),e(24,` 77 `),s(25,"div",9),e(26,` 78 `),u(27,He,10,8),a(),e(28,` 79`),a()),i&2&&(d("primaryBtnText","Add Sponsor")("primaryBtnUrl","./new"),p(13),K("ngModel",l.sponsorService.sponsorFilters.name),p(14),S(l.showTable?27:-1))},dependencies:[te,ie,ne,ae,le,M,ge,ue,Se,_e],encapsulation:2});let o=n;return o})();var De=(()=>{let n=class n{constructor(){}ngOnInit(){}};n.\u0275fac=function(i){return new(i||n)},n.\u0275cmp=v({type:n,selectors:[["ng-component"]],standalone:!1,decls:6,vars:0,consts:[["role","main"]],template:function(i,l){i&1&&(e(0,` 80 `),s(1,"main",0),e(2,` 81 `),m(3,"router-outlet"),e(4,` 82 `),a(),e(5,` 83 `))},dependencies:[re],encapsulation:2});let o=n;return o})();var Ae=(()=>{let n=class n{};n.\u0275fac=function(i){return new(i||n)},n.\u0275mod=A({type:n}),n.\u0275inj=D({imports:[U.forChild([{path:"",component:De,children:[{path:":id",canActivate:[B],component:Fe},{path:"",canActivate:[B],component:Ie}]}]),U]});let o=n;return o})();var Vt=(()=>{let n=class n{};n.\u0275fac=function(i){return new(i||n)},n.\u0275mod=A({type:n}),n.\u0275inj=D({providers:[g],imports:[ye,Ae]});let o=n;return o})();export{Vt as SponsorModule};
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.