1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8544],{8544:(e,t,a)=>{a.r(t),a.d(t,{clusterCountLayer:()=>ea,clusterLayer:()=>et,default:()=>Z,heatMapLayer:()=>J,unclusteredPointLayer:()=>es});var s=a(95155);a(75173);var r=a(93585),l=a(12115),n=a(47166),o=a(6296),i=a(57420),d=a(6962),c=a(68822),u=a(33210),m=a(95685),h=a(68758),g=a(89239),p=a(41641),x=a(21362),f=a(66088),y=a(29759),b=a(8417),v=a(40980);function j({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:r="label",buttonVariant:l="ghost",formatters:n,components:o,...i}){let d=(0,y.a)();return(0,s.jsx)(b.h,{showOutsideDays:a,className:(0,v.cn)("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...n},classNames:{root:(0,v.cn)("w-fit",d.root),months:(0,v.cn)("flex gap-4 flex-col md:flex-row relative",d.months),month:(0,v.cn)("flex flex-col w-full gap-4",d.month),nav:(0,v.cn)("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",d.nav),button_previous:(0,v.cn)((0,g.r)({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_previous),button_next:(0,v.cn)((0,g.r)({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_next),month_caption:(0,v.cn)("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",d.month_caption),dropdowns:(0,v.cn)("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",d.dropdowns),dropdown_root:(0,v.cn)("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",d.dropdown_root),dropdown:(0,v.cn)("absolute bg-popover inset-0 opacity-0",d.dropdown),caption_label:(0,v.cn)("select-none font-medium","label"===r?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:(0,v.cn)("flex",d.weekdays),weekday:(0,v.cn)("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",d.weekday),week:(0,v.cn)("flex w-full mt-2",d.week),week_number_header:(0,v.cn)("select-none w-(--cell-size)",d.week_number_header),week_number:(0,v.cn)("text-[0.8rem] select-none text-muted-foreground",d.week_number),day:(0,v.cn)("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",d.day),range_start:(0,v.cn)("rounded-l-md bg-accent",d.range_start),range_middle:(0,v.cn)("rounded-none",d.range_middle),range_end:(0,v.cn)("rounded-r-md bg-accent",d.range_end),today:(0,v.cn)("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:(0,v.cn)("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:(0,v.cn)("text-muted-foreground opacity-50",d.disabled),hidden:(0,v.cn)("invisible",d.hidden),...t},components:{Root:({className:e,rootRef:t,...a})=>(0,s.jsx)("div",{"data-slot":"calendar",ref:t,className:(0,v.cn)(e),...a}),Chevron:({className:e,orientation:t,...a})=>"left"===t?(0,s.jsx)(p.A,{className:(0,v.cn)("size-4",e),...a}):"right"===t?(0,s.jsx)(x.A,{className:(0,v.cn)("size-4",e),...a}):(0,s.jsx)(f.A,{className:(0,v.cn)("size-4",e),...a}),DayButton:N,WeekNumber:({children:e,...t})=>(0,s.jsx)("td",{...t,children:(0,s.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:e})}),...o},...i})}function N({className:e,day:t,modifiers:a,...r}){let n=(0,y.a)(),o=l.useRef(null);return l.useEffect(()=>{a.focused&&o.current?.focus()},[a.focused]),(0,s.jsx)(g.$,{ref:o,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:(0,v.cn)("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",n.day,e),...r})}var w=a(48884),C=a(17414),k=a(8697);let _=l.forwardRef(({className:e,value:t,indicatorClassName:a,...r},l)=>(0,s.jsx)(k.bL,{ref:l,className:(0,v.cn)("relative h-2 w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800",e),...r,children:(0,s.jsx)(k.C1,{className:(0,v.cn)("h-full w-full flex-1 bg-primary transition-all",a),style:{transform:`translateX(-${100-(t||0)}%)`}})}));_.displayName=k.bL.displayName;
1var S=a(15435),A=a(30283);let L={schools:13e4,students:5e7,states:50,middleSchools:13500,highSchools:27e3};function M({schools:e,totalStudentCount:t,activeUsers:a,countryIso:r}){let n=A.L_[r],o="US"===r?L:void 0,i=(0,l.useMemo)(()=>{let a=new Set(e.filter(e=>e.state&&e.hasActivePrayerLast30Days).map(e=>e.state)),s=e.filter(e=>0===e.type&&e.hasActivePrayerLast30Days).length,r=e.filter(e=>0!==e.type&&e.hasActivePrayerLast30Days).length;return{schools:e.filter(e=>e.hasActivePrayerLast30Days).length,students:t,regions:a.size,middleSchools:s,highSchools:r}},[e,t]),d=({label:e,value:t,total:a})=>{let r;return(0,s.jsxs)("div",{className:"flex flex-col gap-1 p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"number"==typeof t&&t%1!=0?t.toFixed(1):t.toLocaleString()}),(0,s.jsx)("span",{className:"text-xs text-gray-600 dark:text-gray-300",children:e})]}),void 0!==a&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[(r=t/a*100)<.01?"<0.01%":`${r.toFixed(2)}%`," of ",a.toLocaleString()]})]})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Prayer Impact Statistics"})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsx)(d,{label:"Schools",value:i.schools,total:o?.schools}),(0,s.jsx)(d,{label:"Students",value:i.students,total:o?.students}),(0,s.jsx)(d,{label:n.regionPluralLabel,value:i.regions,total:o?.states}),(0,s.jsx)(d,{label:"Middle Schools",value:i.middleSchools,total:o?.middleSchools}),(0,s.jsx)(d,{label:"High Schools",value:i.highSchools,total:o?.highSchools}),(0,s.jsx)(d,{label:"Active Users",value:a})]})]})}var P=a(80865),z=a(34009),D=a(67389),R=a(1728),I=a(65671),W=a(96647);let F={light:"",dark:".dark"},T=l.createContext(null);function q(){let e=l.useContext(T);if(!e)throw Error("useChart must be used within a <ChartContainer />");return e}let $=l.forwardRef(({id:e,className:t,children:a,config:r,...n},o)=>{let i=l.useId(),d=`chart-${e||i.replace(/:/g,"")}`;return(0,s.jsx)(T.Provider,{value:{config:r},children:(0,s.jsxs)("div",{"data-chart":d,ref:o,className:(0,v.cn)("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...n,children:[(0,s.jsx)(E,{id:d,config:r}),(0,s.jsx)(R.u,{children:a})]})})});$.displayName="Chart";let E=({id:e,config:t})=>{let a=Object.entries(t).filter(([e,t])=>t.theme||t.color);return a.length?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Object.entries(F).map(([t,s])=>` 2${s} [data-chart=${e}] { 3${a.map(([e,a])=>{let s=a.theme?.[t]||a.color;return s?` --color-${e}: ${s};`:null}).join("\n")} 4} 5`).join("\n")}}):null},O=I.m;l.forwardRef(({active:e,payload:t,className:a,indicator:r="dot",hideLabel:n=!1,hideIndicator:o=!1,label:i,labelFormatter:d,labelClassName:c,formatter:u,color:m,nameKey:h,labelKey:g},p)=>{let{config:x}=q(),f=l.useMemo(()=>{if(n||!t?.length)return null;let[e]=t,a=x[`${g||e.dataKey||e.name||"value"}`],r=g||"string"!=typeof i?a?.label:x[i]?.label||i;return d?(0,s.jsx)("div",{className:(0,v.cn)("font-medium",c),children:d(r,t)}):r?(0,s.jsx)("div",{className:(0,v.cn)("font-medium",c),children:r}):null},[i,d,t,n,c,x,g]);if(!e||!t?.length)return null;let y=1===t.length&&"dot"!==r;return(0,s.jsxs)("div",{ref:p,className:(0,v.cn)("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",a),children:[y?null:f,(0,s.jsx)("div",{className:"grid gap-1.5",children:t.map((e,t)=>{let a=x[`${h||e.name||e.dataKey||"value"}`],l=m||e.payload.fill||e.color;return(0,s.jsx)("div",{className:(0,v.cn)("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground","dot"===r&&"items-center"),children:u&&e?.value!==void 0&&e.name?u(e.value,e.name,e,t,e.payload):(0,s.jsxs)(s.Fragment,{children:[a?.icon?(0,s.jsx)(a.icon,{}):!o&&(0,s.jsx)("div",{className:(0,v.cn)("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":"dot"===r,"w-1":"line"===r,"w-0 border-[1.5px] border-dashed bg-transparent":"dashed"===r,"my-0.5":y&&"dashed"===r}),style:{"--color-bg":l,"--color-border":l}}),(0,s.jsxs)("div",{className:(0,v.cn)("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[(0,s.jsxs)("div",{className:"grid gap-1.5",children:[y?f:null,(0,s.jsx)("span",{className:"text-muted-foreground",children:a?.label||e.name})]}),e.value&&(0,s.jsx)("span",{className:"font-mono font-medium tabular-nums text-foreground",children:e.value.toLocaleStr
5ing()})]})]})},e.dataKey)})})]})}).displayName="ChartTooltip",W.s,l.forwardRef(({className:e,hideIcon:t=!1,payload:a,verticalAlign:r="bottom",nameKey:l},n)=>{let{config:o}=q();return a?.length?(0,s.jsx)("div",{ref:n,className:(0,v.cn)("flex items-center justify-center gap-4","top"===r?"pb-3":"pt-3",e),children:a.map(e=>{let a=o[`${l||e.dataKey||"value"}`];return(0,s.jsxs)("div",{className:(0,v.cn)("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[a?.icon&&!t?(0,s.jsx)(a.icon,{}):(0,s.jsx)("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:e.color}}),(0,s.jsx)("span",{className:"text-muted-foreground",children:a?.label||e.value})]},e.value)})}):null}).displayName="ChartLegend";let V=["hsl(45, 93%, 47%)","hsl(45, 93%, 55%)","hsl(45, 93%, 60%)","hsl(45, 93%, 65%)","hsl(45, 93%, 70%)","hsl(45, 93%, 75%)","hsl(45, 93%, 80%)"],Y={prayers:{label:"Prayers"}},U=(0,l.memo)(({prayersByDayOfWeek:e})=>{let t={Sunday:"Sun",Monday:"Mon",Tuesday:"Tue",Wednesday:"Wed",Thursday:"Thu",Friday:"Fri",Saturday:"Sat"},a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((a,s)=>({day:a,shortDay:t[a],prayers:e[a]||0,fill:V[s]})).filter(e=>e.prayers>0),r=a.reduce((e,t)=>e+t.prayers,0);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Prayer Activity by Day"})}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:(0,s.jsx)("div",{className:"col-span-2 flex items-center justify-center",children:(0,s.jsx)($,{config:Y,className:"w-full overflow-visible",children:(0,s.jsxs)(P.r,{width:280,height:200,margin:{top:5,right:35,left:35,bottom:5},children:[(0,s.jsx)(O,{cursor:!1,content:({active:e,payload:t})=>{if(!e||!t||!t.length)return null;let a=t[0],l=(a.value/r*100).toFixed(1);return(0,s.jsxs)("div",{className:"rounded-lg border bg-background px-2.5 py-1.5 text-xs shadow-xl",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"h-2.5 w-2.5 rounded-sm",style:{backgroundColor:a.payload.fill}}),(0,s.jsx)("span",{className:"font-medium",children:a.name})]}),(0,s.jsxs)("div",{className:"mt-1 font-mono font-medium tabular-nums",children:[l,"%"]})]})}}),(0,s.jsx)(z.Fq,{data:a,dataKey:"prayers",nameKey:"day",innerRadius:0,outerRadius:65,startAngle:90,endAngle:-270,isAnimationActive:!1,label:e=>{let{cx:t,cy:a,midAngle:l,outerRadius:n,shortDay:o,prayers:i}=e;if(!o||!t||!a||!n)return null;if(i/r*100>8){let e=Math.PI/180,r=n+15,i=t+r*Math.cos(-l*e),d=a+r*Math.sin(-l*e);return(0,s.jsx)("text",{x:i,y:d,fill:"#000000",textAnchor:i>t?"start":"end",dominantBaseline:"central",fontSize:"12",fontWeight:"500",style:{pointerEvents:"none"},children:o})}return null},labelLine:!1,children:a.map(e=>(0,s.jsx)(D.f,{fill:e.fill,stroke:"#ffffff",strokeWidth:1},`cell-${e.day}`))})]})})})})]})});var H=a(42763),G=a(29991);let K={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico"},B=(e,t)=>e?"US"===t?K[e]??e:e:null;function Z({schools:e,totalStudentCount:t,totalGroupCount:a,studentsByState:p,activeUsers:x,prayersByDayOfWeek:f,dateRange:y,onDateRangeChange:b,isLoading:v,onExport:N,isExporting:k,countryIso:L,onCountryChange:P}){let[z,D]=(0,l.useState)(()=>(0,A.GC)(L)),R=A.L_[L],I="US"===L,W=(0,l.useRef)(null),[F,T]=(0,l.useState)(!1),[q,$]=(0,l.useState)(null),[E,O]=(0,l.useState)("auto"),[V,Y]=(0,l.useState)(null),[K,Z]=(0,l.useState)("schools"),[Q,ee]=(0,l.useState)(null),[er,el]=(0,l.useState)(!1),[en,eo]=(0,l.useState)(!1),[ei,ed]=(0,l.useState)(null),ec=(0,m.IT)(h.FH.prayerRequests.listApprovedForCampus,ei?{campusId:ei.id}:"skip"),eu=(0,l.useMemo)(()=>ec??[],[ec]),em=null!=ei&&void 0===ec,eh=(0,l.useCallback)((e,t=!1)=>{ed(e),t&&eo(!0)},[]),eg=(0,l.useCallback)((e,t=0)=>{e.fitBounds(R.bounds,{padding:R.fitPadding,duration:t})},[R.bounds,R.fitPadding]),ep=(0,l.useCallback)(e=>{W.current=e.target,T(!0)},[]);(0,l.useEffect)(()=>{$(null),ee(null),Y(null),ed(null),eo(!1),F&&W.current&&eg(W.current,700)},[L,eg,F]);let ex=(0,l.useMemo)(()=>{let t={};
5return e.forEach(e=>{let a=B(e.state,L);!a||e.hasActivePrayerLast30Days&&(t[a]||(t[a]={schoolCount:0,activeStudentCount:0}),t[a].schoolCount++)}),Object.keys(p).forEach(e=>{let a=B(e,L);a&&t[a]&&(t[a].activeStudentCount=p[e])}),t},[e,p,L]),ef=(0,l.useCallback)(t=>{let a=t.features;if(!a||0===a.length){$(null),ee(null);return}if("heatmap"===K){let e=a.find(e=>e.layer?.id==="state-fills");if(e&&e.properties){t.preventDefault();let a=e.properties.name,s=ex[a]??{schoolCount:0,activeStudentCount:0};$(null),setTimeout(()=>{$({name:a,schoolCount:s.schoolCount,activeStudentCount:s.activeStudentCount,lat:t.lngLat.lat,lng:t.lngLat.lng})},0)}else $(null)}else{let s=a.find(e=>e.layer?.id==="unclustered-point"||e.layer?.id==="clusters");if(s){if(s.properties.cluster){let e=s.properties.cluster_id;W.current.getSource("schools-data").getClusterExpansionZoom(e,(e,t)=>{e||W.current.easeTo({center:s.geometry.coordinates,zoom:t,duration:500})});return}let t=e.find(e=>e.id===s.properties.id);t&&($(null),ee(null),setTimeout(()=>{ee(t),t.hasPrayerRequests&&eh(t)},0));return}let r=a.find(e=>e.layer?.id==="state-fills");if(r&&r.properties){t.preventDefault();let e=r.properties.name,a=ex[e]??{schoolCount:0,activeStudentCount:0};$(null),ee(null),setTimeout(()=>{$({name:e,schoolCount:a.schoolCount,activeStudentCount:a.activeStudentCount,lat:t.lngLat.lat,lng:t.lngLat.lng})},0);return}}},[ex,K,e,eh]),ey=(0,l.useCallback)(e=>{let t=e.features;if(t&&t.length>0){if("heatmap"===K){let e=t.find(e=>e.layer?.id==="state-fills");if(e){O("pointer"),e.id&&Y(e.id);return}}else if(t.find(e=>e.layer?.id==="unclustered-point"||e.layer?.id==="clusters"))return void O("pointer")}O("auto"),Y(null)},[K]),eb=(0,l.useMemo)(()=>{let t=[];return e.forEach(e=>{let a=e.hasActivePrayerLast30Days?20:.5,s=e.hasActivePrayerLast30Days?10:1;for(let r=0;r<s;r++)t.push({type:"Feature",geometry:{type:"Point",coordinates:[e.long,e.lat]},properties:{id:e.id,name:e.schoolName,weight:a}})}),{type:"FeatureCollection",features:t}},[e]),ev=(0,l.useMemo)(()=>({type:"FeatureCollection",features:(er?e:e.filter(e=>e.hasActivePrayerLast30Days)).map(e=>({type:"Feature",geometry:{type:"Point",coordinates:[e.long,e.lat]},properties:{id:e.id,name:e.schoolName,hasActivePrayer:e.hasActivePrayerLast30Days,hasSchoolYearPrayer:!1,hasPrayerRequests:e.hasPrayerRequests}}))}),[e,er]);return(0,s.jsxs)("div",{className:"w-full h-full",children:[(0,s.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex flex-col items-end gap-2",children:[(0,s.jsx)("label",{htmlFor:"admin-map-country",className:"sr-only",children:"Country"}),(0,s.jsxs)(G.l6,{value:L,onValueChange:e=>P(e),children:[(0,s.jsx)(G.bq,{id:"admin-map-country","aria-label":"Country",className:"w-[190px] border-gray-200 bg-white/95 shadow-lg",children:(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)(n.A,{className:"h-4 w-4 shrink-0 text-gray-500"}),(0,s.jsx)(G.yv,{placeholder:"Select a country"})]})}),(0,s.jsx)(G.gC,{align:"end",children:A.cd.map(e=>(0,s.jsx)(G.eb,{value:e.iso,children:e.label},e.iso))})]}),(0,s.jsxs)(C.AM,{children:[(0,s.jsx)(C.Wv,{asChild:!0,children:(0,s.jsxs)(g.$,{variant:"outline",className:"bg-white/90 shadow-lg justify-start text-left font-normal",children:[v?(0,s.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(i.A,{className:"mr-2 h-4 w-4"}),(0,S.GP)(y.from,"MMM d, yyyy")," -"," ",(0,S.GP)(y.to,"MMM d, yyyy")]})}),(0,s.jsx)(C.hl,{className:"w-auto p-0",align:"end",children:(0,s.jsx)(j,{mode:"range",defaultMonth:y.from,selected:{from:y.from,to:y.to},onSelect:e=>{e?.from&&e?.to&&b({from:e.from,to:e.to})},numberOfMonths:1,className:"rounded-lg border shadow-sm"})})]}),N&&(0,s.jsxs)(g.$,{variant:"outline",className:"bg-white/90 shadow-lg justify-start text-left font-normal",onClick:N,disabled:k||v,children:[k?(0,s.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(d.A,{className:"mr-2 h-4 w-4"}),"Export CSV"]})]}),(0,s.jsx)("div",{className:"absolute top-4 left-4 z-10 flex items-center gap-2",children:(0,s.jsx)("div",{className:"bg-white/90 p-3 rounded-lg shadow-lg",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"heatmap"===K?`${R.label} Prayer Activity`:`${R.label} Schools Map`}),(0,s.jsxs)(C.AM,{children:[(0,s.jsx)(C.Wv,{asChild:!0,children:(0,s.jsx)(g.$,{variant:"ghost",size:"icon",className:"h-6 w-6",children:(0,s.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,s.jsx)(C.hl,{className:"w-80 text-sm ml-4 mt-2",align:"center",side:"bottom",sideOffset:8,children:"heatmap"===K?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"font-semibold",children:"Heat Map Legend"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 bg-red-500 rounded"}),(0,s.jsx)("span",{children:"High activity (active in last 30 days)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 bg-yellow-500 rounded"}),(0,s.jsx)("span",{children:"Medium activity"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 bg-blue-500 rounded"}),(0,s.jsx)("span",{children:"Lower activity"})]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:I?`Click on a ${R.regionLabel.toLowerCase()} to see statistics`:`Statistics are grouped by ${R.regionPluralLabel.toLowerCase()}`})]}):(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"font-semibold",children:"Schools Legend"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:X}}),(0,s.jsx)("span",{children:"Active in selected date range"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 bg-gray-400 rounded-full"}),(0,s.jsx)("span",{children:"No activity in date range"})]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:I?`Click on schools or ${R.regionPluralLabel.toLowerCase()} to see details`:"Click on a school to see details"})]})})]})]})})}),(0,s.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col gap-3 max-w-md w-80",children:[(0,s.jsx)("div",{className:"bg-white/90 dark:bg-gray-800/90 p-3 rounded-lg shadow-lg",children:(0,s.jsx)(U,{prayersByDayOfWeek:f})}),(0,s.jsx)("div",{className:"bg-white/90 dark:bg-gray-800/90 p-3 rounded-lg shadow-lg",children:(0,s.jsx)(M,{schools:e,totalStudentCount:t,activeUsers:x,countryIso:L})}),(0,s.jsxs)("div",{className:"bg-white/90 dark:bg-gray-800/90 p-3 rounded-lg shadow-lg",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Students Praying"}),(0,s.jsxs)("span",{className:"text-sm font-bold",children:[t.toLocaleStr
5ing()," / 1,000,000"]})]}),(0,s.jsx)(_,{value:t/1e6*100,className:"h-4",indicatorClassName:"bg-gradient-to-r from-green-500 to-yellow-500"}),(0,s.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,s.jsx)("span",{className:"text-xs text-gray-600 dark:text-gray-300",children:"Goal: 1 Million Students"}),(0,s.jsxs)("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:[a.toLocaleString()," Prayer Groups"]})]})]})]}),(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 top-0",children:(0,s.jsxs)(r.Ay,{...z,reuseMaps:!0,pitchWithRotate:!1,dragRotate:!1,doubleClickZoom:!1,styleDiffing:!1,onMove:e=>D(e.viewState),onLoad:ep,mapStyle:"mapbox://styles/caleb65/clhrsghy300dc01p8e6vw1mf1",mapboxAccessToken:"pk.eyJ1IjoiY2FsZWI2NSIsImEiOiJjbGhxbjJvY3owMHhrM2pxaWVhcnRjZHp3In0.WTRbijtVMgPxS0ZjJQuj6w",onClick:ef,onMouseMove:ey,cursor:E,interactiveLayerIds:"heatmap"===K?I?["state-fills"]:[]:I?["state-fills","unclustered-point","clusters"]:["unclustered-point","clusters"],children:[I&&(0,s.jsxs)(r.kL,{id:"states",type:"geojson",data:"https://raw.githubusercontent.com/PublicaMundi/MappingAPI/master/data/geojson/us-states.json",children:[(0,s.jsx)(r.Wd,{id:"state-fills",type:"fill",paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],"rgba(100, 100, 100, 0.1)","rgba(0, 0, 0, 0)"],"fill-opacity":1},layout:{visibility:"visible"}}),(0,s.jsx)(r.Wd,{id:"state-borders",type:"line",paint:{"line-color":"rgba(100, 100, 100, 0.4)","line-width":1.5},layout:{visibility:"visible"}})]}),(0,s.jsx)(r.kL,{id:"prayer-activity",type:"geojson",data:eb,children:(0,s.jsx)(r.Wd,{id:"prayer-heat",type:"heatmap",source:"prayer-activity",maxzoom:15,paint:J.paint,layout:{visibility:"heatmap"===K?"visible":"none"}})}),(0,s.jsxs)(r.kL,{id:"schools-data",type:"geojson",data:ev,cluster:er,clusterMaxZoom:14,clusterRadius:50,clusterProperties:{has_active_prayer_count:["+",["case",["get","hasActivePrayer"],1,0]],has_school_year_prayer_count:["+",["case",["get","hasSchoolYearPrayer"],1,0]],has_prayer_requests_count:["+",["case",["get","hasPrayerRequests"],1,0]]},children:[(0,s.jsx)(r.Wd,{id:"clusters",type:"circle",source:"schools-data",filter:["has","point_count"],paint:et.paint,layout:{visibility:"schools"===K?"visible":"none"}}),(0,s.jsx)(r.Wd,{id:"cluster-count",type:"symbol",source:"schools-data",filter:["has","point_count"],layout:{...ea.layout,visibility:"schools"===K?"visible":"none"}}),(0,s.jsx)(r.Wd,{id:"unclustered-point",type:"circle",source:"schools-data",filter:["!",["has","point_count"]],paint:es.paint,layout:{...es.layout,visibility:"schools"===K?"visible":"none"}})]},`schools-${er}`),q&&(0,s.jsx)(r.zD,{latitude:q.lat,longitude:q.lng,closeButton:!1,onClose:()=>$(null),anchor:"bottom",offset:10,children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-3 shadow-lg min-w-[200px]",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,s.jsx)("h3",{className:"font-bold text-lg text-gray-900",children:q.name}),(0,s.jsx)("button",{onClick:()=>$(null),className:"text-gray-500 hover:text-gray-700 ml-2",children:(0,s.jsx)(u.A,{size:16})})]}),(0,s.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("span",{className:"text-gray-600",children:"Schools:"}),(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:q.schoolCount})]}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("span",{className:"text-gray-600",children:"Active Students:"}),(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:q.activeStudentCount})]})]})]})}),Q&&(0,s.jsx)(r.zD,{latitude:Q.lat,longitude:Q.long,offset:[0,-10],closeButton:!1,onClose:()=>ee(null),children:(0,s.jsx)("div",{className:"bg-primary/80 rounded-lg overflow-hidden cursor-pointer",children:(0,s.jsxs)("div",{className:"p-2 font-bold rounded-lg text-primary-foreground",children:[Q.schoolName,(0,s.jsx)("br",{}),(0,s.jsx)("span",{className:"text-white/70",children:Q.hasActivePrayerLast30Days?"Active Prayer Group":Q.hasSchoolYearPrayer?"Prayer Group This Year":"No prayer group yet"}),Q.hasPrayerRequests&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),ei?.id===Q.id&&eu.length>0?eo(!0):eh(Q,!0)},className:"mt-2 text-sm underline text-white hover:text-white/80",children:"See Prayer Requests"})]})]})})}),!(0,w.CN)()&&(0,s.jsx)(r.ov,{showCompass:!1,position:"bottom-right"})]})}),(0,s.jsx)(H.lG,{open:en,onOpenChange:eo,children:(0,s.jsxs)(H.Cf,{className:"max-w-md max-h-[80vh] overflow-y-auto",children:[(0,s.jsxs)(H.c7,{children:[(0,s.jsxs)(H.L3,{className:"text-lg",children:["\uD83D\uDE4F Prayer Requests",ei&&(0,s.jsx)("span",{className:"block text-sm font-normal text-gray-500 mt-1",children:ei.schoolName})]}),(0,s.jsx)(H.rr,{className:"sr-only",children:"Approved prayer requests for the selected campus."})]}),(0,s.jsx)("div",{className:"mt-4",children:em?(0,s.jsx)("div",{className:"text-center text-gray-500 py-4",children:"Loading..."}):0===eu.length?(0,s.jsx)("div",{className:"text-center text-gray-500 py-4",children:"No prayer requests yet."}):(0,s.jsxs)("div",{className:"space-y-6",children:[eu.filter(e=>!e.isCompleted).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-600 mb-2",children:"Unanswered"}),(0,s.jsx)("ul",{className:"space-y-2",children:eu.filter(e=>!e.isCompleted).map(e=>(0,s.jsx)("li",{className:"p-3 rounded-lg border bg-gray-50 border-gray-200",children:(0,s.jsx)("p",{className:"text-gray-800",children:e.requestText})},e.id))})]}),eu.filter(e=>e.isCompleted).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-600 mb-2",children:"\uD83D\uDE4F Answered"}),(0,s.jsx)("ul",{className:"space-y-2",children:eu.filter(e=>e.isCompleted).map(e=>(0,s.jsx)("li",{className:"p-3 rounded-lg border bg-green-50 border-green-200",children:(0,s.jsx)("p",{className:"text-gray-600",children:e.requestText})},e.id))})]})]})})]})})]})}let J={id:"prayer-heat",type:"heatmap",source:"prayer-activity",maxzoom:15,paint:{"heatmap-weight":["interpolate",["linear"],["get","weight"],0,0,20,1],"heatmap-intensity":["interpolate",["linear"],["zoom"],0,.7,15,1.5],"heatmap-color":["interpolate",["linear"],["heatmap-density"],0,"rgba(33,102,172,0)",.05,"rgb(103,169,207)",.2,"rgb(209,229,240)",.4,"rgb(253,219,199)",.6,"rgb(239,138,98)",.8,"rgb(239,101,72)",1,"rgb(178,24,43)"],"heatmap-radius":["interpolate",["linear"],["zoom"],0,5,5,20,10,35,15,50],"heatmap-opacity":["interpolate",["linear"],["zoom"],7,1,15,.5]}}
5,X="#FFD234",Q="#E5744A",ee="#8B5CF6",et={id:"clusters",type:"circle",source:"schools-data",filter:["has","point_count"],paint:{"circle-color":["case",[">=",["get","has_prayer_requests_count"],1],ee,[">=",["get","has_active_prayer_count"],1],X,[">=",["get","has_school_year_prayer_count"],1],Q,"#AAB8CD"],"circle-radius":["step",["get","point_count"],20,100,30]}},ea={id:"cluster-count",type:"symbol",source:"schools-data",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12}},es={id:"unclustered-point",type:"circle",source:"schools-data",filter:["!",["has","point_count"]],layout:{"circle-sort-key":["case",["==",["get","hasPrayerRequests"],!0],3,["==",["get","hasActivePrayer"],!0],2,["==",["get","hasSchoolYearPrayer"],!0],1,0]},paint:{"circle-color":["case",["==",["get","hasPrayerRequests"],!0],ee,["==",["get","hasActivePrayer"],!0],X,["==",["get","hasSchoolYearPrayer"],!0],Q,"#AAB8CD"],"circle-radius":10,"circle-stroke-width":1,"circle-stroke-color":"#fff"}}},17414:(e,t,a)=>{a.d(t,{AM:()=>n,Wv:()=>o,hl:()=>i});var s=a(95155);a(12115);var r=a(20623),l=a(40980);function n({...e}){return(0,s.jsx)(r.bL,{"data-slot":"popover",...e})}function o({...e}){return(0,s.jsx)(r.l9,{"data-slot":"popover-trigger",...e})}function i({className:e,align:t="center",sideOffset:a=4,...n}){return(0,s.jsx)(r.ZL,{children:(0,s.jsx)(r.UC,{"data-slot":"popover-content",align:t,sideOffset:a,className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}},29991:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>h,gC:()=>m,l6:()=>d,yv:()=>c});var s=a(95155),r=a(12115),l=a(28737),n=a(66088),o=a(94514),i=a(40980);let d=l.bL;l.YJ;let c=l.WT,u=r.forwardRef(({className:e,children:t,...a},r)=>(0,s.jsxs)(l.l9,{ref:r,className:(0,i.cn)("flex h-10 w-full items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm r
5ing-offset-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...a,children:[t,(0,s.jsx)(l.In,{asChild:!0,children:(0,s.jsx)(n.A,{className:"h-4 w-4 opacity-50"})})]}));u.displayName=l.l9.displayName;let m=r.forwardRef(({className:e,children:t,position:a="popper",...r},n)=>(0,s.jsx)(l.ZL,{children:(0,s.jsx)(l.UC,{ref:n,className:(0,i.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white text-gray-950 shadow-md animate-in fade-in-0 zoom-in-95","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...r,children:(0,s.jsx)(l.LM,{className:(0,i.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));m.displayName=l.UC.displayName;let h=r.forwardRef(({className:e,children:t,...a},r)=>(0,s.jsxs)(l.q7,{ref:r,className:(0,i.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.VF,{children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})}),(0,s.jsx)(l.p4,{children:t})]}));h.displayName=l.q7.displayName},42763:(e,t,a)=>{a.d(t,{Cf:()=>u,Es:()=>h,L3:()=>g,c7:()=>m,lG:()=>i,rr:()=>p});var s=a(95155),r=a(12115),l=a(7254),n=a(33210),o=a(40980);let i=l.bL;l.l9;let d=l.ZL;l.bm;let c=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.hJ,{ref:a,className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));c.displayName=l.hJ.displayName;let u=r.forwardRef(({className:e,children:t,...a},r)=>(0,s.jsxs)(d,{children:[(0,s.jsx)(c,{}),(0,s.jsxs)(l.UC,{ref:r,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 sm:rounded-lg",e),...a,children:[t,(0,s.jsxs)(l.bm,{className:"absolute right-4 top-4 roun
5ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(n.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));u.displayName=l.UC.displayName;let m=({className:e,...t})=>(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});m.displayName="DialogHeader";let h=({className:e,...t})=>(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});h.displayName="DialogFooter";let g=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.hE,{ref:a,className:(0,o.cn)("text-lg font-semibold leading-none tracking-tight",e),...t}));g.displayName=l.hE.displayName;let p=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.VY,{ref:a,className:(0,o.cn)("text-sm text-muted-foreground",e),...t}));p.displayName=l.VY.displayName},48884:(e,t,a)=>{a.d(t,{CN:()=>s});let s=()=>window.matchMedia("(pointer: coarse)").matches},89239:(e,t,a)=>{a.d(t,{$:()=>i,r:()=>o});var s=a(95155);a(12115);var r=a(35273),l=a(18460),n=a(40980);let o=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i({className:e,variant:t,size:a,asChild:l=!1,...i}){let d=l?r.DX:"button";return(0,s.jsx)(d,{"data-slot":"button",className:(0,n.cn)(o({variant:t,size:a,className:e})),...i})}}}]);
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.