PageSourceSearch

https://app.vervepulse.io/_next/static/chunks/67469.beec99aa2971f672.js

js vervepulse.io collected 2026-10-09 22:59:51 UTC 10,442 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="90fb6510-3fa6-4177-92b9-8234aef1e5d0",e._sentryDebugIdIdentifier="sentry-dbid-90fb6510-3fa6-4177-92b9-8234aef1e5d0")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[67469],{54821:(e,t,a)=>{a.d(t,{PI:()=>h,Ti:()=>f,WA:()=>u,Y4:()=>i,fp:()=>l,jT:()=>g,jq:()=>c,k0:()=>o,vs:()=>r,wy:()=>m});let s="Australia/Sydney";function n(e,t){let a=e instanceof Date?e:new Date(e),n=new Intl.DateTimeFormat("en-US",{timeZone:t||s,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short"}).formatToParts(a).reduce((e,t)=>(e[t.type]=t.value,e),{}),l="24"===n.hour?0:parseInt(n.hour,10);return{year:+n.year,month:+n.month,day:+n.day,hour:l,minute:+n.minute,second:+n.second,weekday:n.weekday}}function l(e,t){return n(e,t).weekday.slice(0,3).toLowerCase()}function i(e,t){let{hour:a,minute:s}=n(e,t);return 60*a+s}function r(e,t){let{year:a,month:s,day:l}=n(e,t);return"".concat(a,"-").concat(String(s).padStart(2,"0"),"-").concat(String(l).padStart(2,"0"))}function c(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en-AU";return new Intl.DateTimeFormat(n,{...a,timeZone:t||s}).format(new Date(e))}function d(e,t){let a=n(e,t);return Date.UTC(a.year,a.month-1,a.day,a.hour,a.minute,a.second)-new Date(e).getTime()}function o(e,t,a,s,n,l){let i=Date.UTC(e,t-1,a,s,n,0),r=i-d(new Date(i),l);return new Date(i-d(new Date(r),l))}function m(e,t){if(!e)return null;let a=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(e);if(!a)return null;let[,s,n,l,i,r]=a;return o(+s,+n,+l,+i,+r,t).toISOString()}function h(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;if(!e)return null;let s=e.slice(0,10),n=r(a,t),l=e=>{let[t,a,s]=e.split("-").map(Number);return Date.UTC(t,a-1,s)};return Math.round((l(s)-l(n))/864e5)}function u(e,t,a){let[s,n]=r(e,a).split("-").map(Number),l=new Date(Date.UTC(s,n-1+t,1));return o(l.getUTCFullYear(),l.getUTCMonth()+1,1,0,0,a)}let p={Mon:0,Tue:1,Wed:2,Thu:3,Fri:4,Sat:5,Sun:6};function f(e,t){var a;let s=n(e,t),l=null!=(a=p[s.weekday])?a:0,i=new Date(Date.UTC(s.year,s.month-1,s.day-l));return"".concat(i.getUTCFullYear(),"-").concat(String(i.getUTCMonth()+1).padStart(2,"0"),"-").concat(String(i.getUTCDate()).padStart(2,"0"))}function g(e,t){let[a,s,n]=e.split("-").map(Number),l=new Date(Date.UTC(a,s-1,n+t));return"".concat(l.getUTCFullYear(),"-").concat(String(l.getUTCMonth()+1).padStart(2,"0"),"-").concat(String(l.getUTCDate()).padStart(2,"0"))}},67469:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var s=a(95155),n=a(12115),l=a(30814),i=a(6191),r=a(91595),c=a(83226),d=a(94561),o=a(2419),m=a(49498),h=a(95805),u=a(72274);a(54821),a(60332);let p=[["number","Number"],["text","Text"],["choice","Choice"]];function f(e){let{gym:t,onSaved:a}=e,[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(null),[y,j]=(0,n.useState)(!0),[N,T]=(0,n.use
1State)(""),[v,w]=(0,n.useState)({name:"",field_type:"number",unit:"",options:""}),[D,S]=(0,n.useState)(!1),[C,_]=(0,n.useState)(()=>{var e;return{enabled:!1,days_before_checkpoint:3,...(null==t||null==(e=t.settings)?void 0:e.progress_reminders)||{}}}),[k,A]=(0,n.useState)(!1),U=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/settings/progress-fields"),t=await e.json();if(!e.ok)throw Error(t.error||"Could not load custom fields");b(t.fields),j(t.entitled)}catch(e){T(e.message)}},[]);(0,h.A)(U,[U]);let P=async e=>{e.preventDefault(),S(!0),T("");try{let e=await fetch("/api/settings/progress-fields",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.name,field_type:v.field_type,unit:v.unit||null,options:"choice"===v.field_type?v.options.split(",").map(e=>e.trim()).filter(Boolean):[]})});if(await (0,u.Y)(e))return void j(!1);let t=await e.json();if(!e.ok)return void T(t.error||"Could not add the field");w({name:"",field_type:"number",unit:"",options:""}),g({message:"Added ".concat(t.field.name,".")}),U()}finally{S(!1)}},Y=async e=>{let t=await fetch("/api/settings/progress-fields/".concat(e.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({is_active:!e.is_active})}),a=await t.json().catch(()=>({}));g(t.ok?{message:"".concat(e.name," ").concat(e.is_active?"switched off":"switched on",".")}:{message:a.error||"Could not update the field.",tone:"error"}),U()},I=async e=>{_(e),A(!0);try{let t=await fetch("/api/settings/gym",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:{progress_reminders:e}})}),s=await t.json().catch(()=>({}));if(!t.ok)return void g({message:s.error||"Could not save reminders.",tone:"error"});g({message:"Reminder settings saved."}),a&&s.gym&&a(s.gym)}finally{A(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.A,{toast:f}),!y&&(0,s.jsx)(c.default,{plan:"pro",title:"Custom assessment fields and reminders",description:"Your own assessment fields, automated checkpoint reminders, the coach caseload and progress analytics are on the Pro plan. The core loop (assessments, goals, checkpoints, check-ins, the member app) is on every plan.",bullets:["Fields like sit-and-reach, 2 km row time or an FMS score","A push to the member a few days before each checkpoint","The coach caseload and the progress report"]}),(0,s.jsxs)("div",{className:o.PE,children:[(0,s.jsxs)("div",{className:o.Yw,children:[(0,s.jsxs)("h3",{className:(0,m.cn)(o.Yq,"flex items-center gap-2"),children:[(0,s.jsx)(l.A,{size:16,className:"text-primary"})," Custom assessment fields"]}),(0,s.jsx)("span",{className:o.Sc,children:"Pro plan"})]}),(0,s.jsxs)("div",{className:"p-4 md:p-5",children:[null===x&&!N&&(0,s.jsx)(o.EA,{bare:!0,rows:3}),x&&x.length>0&&(0,s.jsx)("div",{className:(0,m.cn)(o.KS,"mb-4"),children:(0,s.jsxs)("table",{className:o.Bt,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:o.TH,children:"Name"}),(0,s.jsx)("th",{className:o.TH,children:"Type"}),(0,s.jsx)("th",{className:o.TH,children:"Unit"}),(0,s.jsx)("th",{className:o.TH,children:"Active"})]})}),(0,s.jsx)("tbody",{children:x.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:(0,m.cn)(o.TR,!e.is_active&&"opacity-60"),children:[(0,s.jsxs)("td",{className:(0,m.cn)(o.TD,"font-semibold"),children:[e.name,"choice"===e.field_type&&(null==(t=e.options)?void 0:t.length)?(0,s.jsx)("div",{className:o.Sc,children:e.options.join(" \xb7 ")}):null]}),(0,s.jsx)("td",{className:o.TD,children:(null==(a=p.find(t=>{let[a]=t;return a===e.field_type}))?void 0:a[1])||e.field_type}),(0,s.jsx)("td",{className:o.TD,children:e.unit||"—"}),(0,s.jsx)("td",{className:o.TD,children:(0,s.jsx)(r.lM,{on:e.is_active,onToggle:()=>Y(e),disabled:!y,label:"".concat(e.name," active")})})]},e.id)})})]})}),x&&0===x.length&&(0,s.jsx)("p",{className:(0,m.cn)(o.Sc,"mb-4"),children:"No custom fields yet. The eight standard measures are always there."}),(0,s.jsxs)("form",{onSubmit:P,className:"grid grid-cols-1 md:grid-cols-[1fr_140px_120px_auto] gap-3 items-end",children:[(0,s.jsx)(r.D0,{label:"Name",children:(0,s.jsx)("input",{className:r.bO,value:v.name,onChange:e=>w(t=>({...t,name:e.target.value})),placeholder:"e.g. Broad jump",maxLength:60,disabled:!y})}),(0,s.jsx)(r.D0,{label:"Type",children:(0,s.jsx)("select",{className:r.bO,value:v.field_type,onCh
1ange:e=>w(t=>({...t,field_type:e.target.value})),disabled:!y,children:p.map(e=>{let[t,a]=e;return(0,s.jsx)("option",{value:t,children:a},t)})})}),(0,s.jsx)(r.D0,{label:"Unit",children:(0,s.jsx)("input",{className:r.bO,value:v.unit,onChange:e=>w(t=>({...t,unit:e.target.value})),placeholder:"cm",maxLength:20,disabled:!y})}),(0,s.jsx)("div",{className:"mb-[18px]",children:(0,s.jsxs)("button",{type:"submit",disabled:D||!y||!v.name.trim(),className:o.oE,children:[(0,s.jsx)(i.A,{size:14})," Add field"]})}),"choice"===v.field_type&&(0,s.jsx)("div",{className:"md:col-span-4",children:(0,s.jsx)(r.D0,{label:"Options, comma separated",hint:"At least two.",children:(0,s.jsx)("input",{className:r.bO,value:v.options,onChange:e=>w(t=>({...t,options:e.target.value})),placeholder:"Beginner, Intermediate, Advanced",disabled:!y})})})]}),N&&(0,s.jsx)("div",{className:(0,m.cn)(o.Ym,"mt-2"),children:N})]})]}),(0,s.jsxs)("div",{className:o.PE,children:[(0,s.jsxs)("div",{className:o.Yw,children:[(0,s.jsx)("h3",{className:o.Yq,children:"Checkpoint reminders"}),(0,s.jsx)(r.lM,{on:!!C.enabled,onToggle:()=>I({...C,enabled:!C.enabled}),disabled:!y||k,label:"Checkpoint reminders"})]}),(0,s.jsxs)("div",{className:"p-4 md:p-5",children:[(0,s.jsx)("p",{className:(0,m.cn)(o.Sc,"mb-3"),children:"A push to the member's app a few days before each goal checkpoint, once per checkpoint. Members can turn it off in the app; the coach caseload is the coach's reminder."}),(0,s.jsx)(r.D0,{label:"Days before the checkpoint",children:(0,s.jsx)("select",{className:(0,m.cn)(r.bO,"md:max-w-[200px]"),value:C.days_before_checkpoint,onChange:e=>I({...C,days_before_checkpoint:Number(e.target.value)}),disabled:!y||k,children:Array.from({length:14},(e,t)=>t+1).map(e=>(0,s.jsxs)("option",{value:e,children:[e," day",1===e?"":"s"]},e))})})]})]}),(0,s.jsxs)("div",{className:o.PE,children:[(0,s.jsx)("div",{className:o.Yw,children:(0,s.jsx)("h3",{className:o.Yq,children:"Plan availability"})}),(0,s.jsx)("div",{className:o.KS.replace("rounded-xl border border-border bg-card",""),children:(0,s.jsxs)("table",{className:o.Bt,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:o.TH,children:"Feature"}),(0,s.jsx)("th",{className:o.TH,children:"Availability"})]})}),(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{className:o.TR,children:[(0,s.jsx)("td",{className:o.TD,children:"Assessments, goals, checkpoints, check-ins, the member app"}),(0,s.jsx)("td",{className:(0,m.cn)(o.TD,"font-semibold"),children:"All plans"})]}),(0,s.jsxs)("tr",{className:o.TR,children:[(0,s.jsx)("td",{className:o.TD,children:"Custom fields, reminders, coach caseload, progress analytics"}),(0,s.jsx)("td",{className:(0,m.cn)(o.TD,"font-semibold"),children:"Pro plan"})]})]})]})}),(0,s.jsx)("p",{className:(0,m.cn)(o.Sc,"px-4 md:px-5 pb-4 m-0"),children:"Plan prices exclude GST."})]})]})}}}]);

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.