PageSourceSearch

https://app.proflowphysiques.co.uk/_next/static/chunks/8984.dc47ee98b6716aa1.js

js proflowphysiques.co.uk collected 2026-10-02 02:11:22 UTC 37,112 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]="3cffb32a-ca22-4ea9-b7bd-b1055def14b8",e._sentryDebugIdIdentifier="sentry-dbid-3cffb32a-ca22-4ea9-b7bd-b1055def14b8")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8984],{27464:(e,t,r)=>{function i(e){let t=e.replace(/\s+/g," ").trim();return/[A-Z]/.test(t)?t:t.replace(/(^|[\s'\u2019-])([a-z])/g,(e,t,r)=>t+r.toUpperCase())}function a(e){let t=e.replace(/\s+/g," ").trim();return/[A-Z]/.test(t)?t:t.replace(/^([a-z])/,e=>e.toUpperCase())}r.d(t,{p:()=>a,q:()=>i})},98984:(e,t,r)=>{r.r(t),r.d(t,{ProgramExercisesSheet:()=>F,SET_TYPE_VALUES:()=>P,duplicateProgram:()=>q});var i=r(95155),a=r(12115),n=r(17787),s=r(49027),l=r(27587),d=r(6191),o=r(27209),c=r(61654),u=r(71360),h=r(49476),x=r(12108),m=r(24033),g=r(18514),p=r(75426),v=r(39142),f=r(75662),j=r(96648),_=r(94719),w=r(61313),b=r(64269),y=r(27063),N=r(21170),k=r(5917),C=r(65229),D=r(86651),S=r(76834);function L(e,t){var r;if(!t)return 0;let i=e.name.toLowerCase();return i.startsWith(t)?0:e.aliases.some(e=>e.toLowerCase().startsWith(t))?1:i.includes(t)?2:e.aliases.some(e=>e.toLowerCase().includes(t))?3:(null!=(r=e.body_part)?r:"").toLowerCase().includes(t)?4:e.secondary.some(e=>e.toLowerCase().includes(t))?5:6}function U(e){let{value:t,onPick:r,selectedIds:n,onClear:s}=e,{t:l}=(0,f.Bd)(),[d,o]=(0,a.useState)([]),[c,u]=(0,a.useState)(!0),[h,x]=(0,a.useState)(""),[m,g]=(0,a.useState)(null),p=(0,a.useCallback)(async()=>{let{data:e}=await j.ND.from("exercise_library").select("*").eq("archived",!1).order("name",{ascending:!0});o(null!=e?e:[]),u(!1)},[]);(0,a.useEffect)(()=>{p()},[p]);let v=(0,a.useMemo)(()=>{let e=new Set;for(let t of d)t.body_part&&e.add(t.body_part);return[...e].sort()},[d]),_=(0,a.useMemo)(()=>{let e=h.trim().toLowerCase();return d.filter(e=>!m||e.body_part===m).filter(t=>{var r;return!e||t.name.toLowerCase().includes(e)||(null!=(r=t.body_part)?r:"").toLowerCase().includes(e)||t.aliases.some(t=>t.toLowerCase().includes(e))||t.secondary.some(t=>t.toLowerCase().includes(e))}).sort((t,r)=>L(t,e)-L(r,e)||t.name.localeCompare(r.name)).slice(0,40)},[d,h,m]);return c||0!==d.length?t?(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:l("exerciseLibrary.pickedLabel")}),(0,i.jsxs)("div",{className:"flex items-center gap-3 rounded-xl bg-teal/10 px-3.5 py-3 ring-1 ring-inset ring-teal/25",children:[(0,i.jsx)(k.A,{className:"h-4 w-4 shrink-0 text-teal"}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("p",{className:"truncate text-sm font-semibold",children:t.name}),(0,i.jsx)("p",{className:"truncate text-[11px] text-white/50",children:[t.body_part,t.equipment].filter(
1Boolean).join(" \xb7 ")||l("exerciseLibrary.noDetail")})]}),(0,i.jsx)("button",{type:"button",onClick:s,className:"-my-2 -mr-1.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-white/45 transition hover:bg-white/10 hover:text-white active:scale-95","aria-label":l("exerciseLibrary.clearPick"),children:(0,i.jsx)(C.A,{className:"h-4 w-4"})})]}),t.cues&&(0,i.jsx)("p",{className:"mt-1.5 text-[11px] leading-relaxed text-white/60",children:t.cues})]}):(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:l("exerciseLibrary.searchLabel")}),(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(D.A,{className:"pointer-events-none absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-white/35"}),(0,i.jsx)(S.pd,{value:h,onChange:e=>x(e.target.value),placeholder:l("exerciseLibrary.searchPlaceholder"),className:"pl-10"})]}),v.length>0&&(0,i.jsx)("div",{className:"no-scrollbar -mx-1 mt-2 flex gap-1.5 overflow-x-auto px-1",children:v.map(e=>(0,i.jsx)("button",{type:"button",onClick:()=>g(t=>t===e?null:e),"aria-pressed":m===e,className:(0,b.cn)("shrink-0 rounded-full px-3 py-1.5 text-[11px] font-semibold transition active:scale-95",m===e?"bg-teal/15 text-teal ring-1 ring-inset ring-teal/30":"bg-white/[0.04] text-white/55 ring-1 ring-inset ring-white/[0.06]"),children:e},e))}),(0,i.jsx)("div",{className:(0,b.cn)("mt-2 max-h-60 space-y-1 overflow-y-auto pb-1",_.length>4&&"[mask-image:linear-gradient(to_bottom,black_calc(100%-2rem),transparent)]"),children:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(S.EA,{className:"h-12 w-full rounded-xl"}),(0,i.jsx)(S.EA,{className:"h-12 w-full rounded-xl"})]}):0===_.length?(0,i.jsx)("p",{className:"rounded-xl bg-white/[0.03] px-3.5 py-3 text-[13px] leading-relaxed text-white/60",children:l("exerciseLibrary.noMatches")}):_.map(e=>(0,i.jsxs)("button",{type:"button",onClick:()=>r(e),"aria-pressed":n?n.has(e.id):void 0,className:(null==n?void 0:n.has(e.id))?"flex w-full items-center gap-3 rounded-xl bg-teal/[0.12] px-3.5 py-2.5 text-left ring-1 ring-inset ring-teal/35 transition active:scale-[0.99]":"flex w-full items-center gap-3 rounded-xl bg-white/[0.03] px-3.5 py-2.5 text-left ring-1 ring-inset ring-white/[0.05] transition hover:bg-white/[0.06] active:scale-[0.99]",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("p",{className:"truncate text-sm font-semibold",children:e.name}),(0,i.jsx)("p",{className:"truncate text-[11px] text-white/60",children:[e.body_part,e.equipment].filter(
1Boolean).join(" \xb7 ")})]}),(null==n?void 0:n.has(e.id))&&(0,i.jsx)(k.A,{className:"h-4 w-4 shrink-0 text-teal"})]},e.id))})]}):null}var A=r(82410),M=r(27464);let P=["straight","top_back_off","pyramid","dropset","superset"];async function E(e,t){let r="".concat(e,"/voice-").concat(crypto.randomUUID(),"-").concat(t.name.replace(/\s+/g,"_"));return await (0,w.G7)({bucket:"exercise-demos",path:r,file:t}),r}function J(e){var t;return null!=(t=e.day_id)?t:""}function I(e){return"bucket-".concat(e||"unfiled")}function T(e){var t,r,i,a,n;return{name:e.name,library_id:null!=(t=e.library_id)?t:null,demo_video_id:null!=(r=e.demo_video_id)?r:null,demo_video_path:null!=(i=e.demo_video_path)?i:null,coach_audio_path:null,target_sets:e.target_sets,target_reps:e.target_reps,target_weight:e.target_weight,tempo:e.tempo,rest_seconds:e.rest_seconds,notes:e.notes,set_type:null!=(a=e.set_type)?a:null,superset_label:null!=(n=e.superset_label)?n:null}}async function q(e,t){let{data:r,error:i}=await j.ND.from("workout_programs").insert({coach_id:e.coach_id,title:t,description:e.description,archived:e.archived}).select("id").single();if(i||!r)throw null!=i?i:Error("copy failed");let a=r.id;try{let[{data:t,error:r},{data:i,error:n}]=await Promise.all([j.ND.from("workout_days").select("*").eq("program_id",e.id).order("sort_order"),j.ND.from("workout_exercises").select("*").eq("program_id",e.id).order("sort_order")]);if(r)throw r;if(n)throw n;let s=new Map;for(let[e,r]of(null!=t?t:[]).entries()){let{data:t,error:i}=await j.ND.from("workout_days").insert({program_id:a,name:r.name,is_rest:r.is_rest,notes:r.notes,sort_order:e}).select("id").single();if(i||!t)throw null!=i?i:Error("copy failed");s.set(r.id,t.id)}let l=null!=i?i:[];if(l.length){let{error:e}=await j.ND.from("workout_exercises").insert(l.map(e=>{var t;return{...T(e),program_id:a,day_id:e.day_id&&null!=(t=s.get(e.day_id))?t:null,sort_order:e.sort_order}}));if(e)throw e}}catch(e){throw await j.ND.from("workout_programs").delete().eq("id",a),e}return a}function F(e){let{program:t,onClose:r,onChanged:l}=e,{t:h}=(0,f.Bd)(),[x,m]=(0,a.useState)([]),[g,p]=(0,a.useState)([]),[v,b]=(0,a.useState)(!0),[k,C]=(0,a.useState)(null),[D,L]=(0,a.useState)(""),[q,F]=(0,a.useState)(""),[H,V]=(0,a.useState)(!1),[$,G]=(0,a.useState)(!1),[W,K]=(0,a.useState)(null),[O,Y]=(0,a.useState)(null),[Z,Q]=(0,a.useState)(""),[X,ee]=(0,a.useState)(null),[et,er]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)([]),[en,es]=(0,a.useState)(""),[el,ed]=(0,a.useState)(""),[eo,ec]=(0,a.useState)(""),[eu,eh]=(0,a.useState)(""),[ex,em]=(0,a.useState)(""),[eg,ep]=(0,a.useState)(""),[ev,ef]=(0,a.useState)("straight"),[ej,e_]=(0,a.useState)(""),[ew,eb]=(0,a.useState)(null),ey=(0,a.useRef)(null),[eN,ek]=(0,a.useState)(null),[eC,eD]=(0,a.useState)(!1),[eS,eL]=(0,a.useState)(null),eU=(0,a.useCallback)(async()=>{var e,r;let[i,a]=await Promise.all([j.ND.from("workout_exercises").select("*").eq("program_id",t.id).order("sort_order",{ascending:!0}),j.ND.from("workout_days").select("*").eq("program_id",t.id).order("sort_order",{ascending:!0})]);m(null!=(e=i.data)?e:[]);let n=null!=(r=a.data)?r:[];p(n),L(e=>{var t,r;return e&&n.some(t=>t.id===e)?e:null!=(r=null==(t=n.find(e=>!e.is_rest))?void 0:t.id)?r:""}),b(!1)},[t.id]);async function eA(){if(!ei.length)return;eD(!0),eL(null);let e=x.filter(e=>J(e)===D).length,{error:r}=await j.ND.from("workout_exercises").insert(ei.map((r,i)=>{var a;return{program_id:t.id,day_id:D||null,library_id:r.id,demo_video_path:null!=(a=r.demo_video_path)?a:null,coach_audio_path:null,name:r.name,sort_order:e+i,target_sets:en.trim()?Number(en):null,target_reps:el.trim()||null,target_weight:null,tempo:null,rest_seconds:ex.trim()?Number(ex):null,notes:null}}));if(eD(!1),r)return eL((0,_.a)(r,"errors.saveFailed"));ea([]),eU(),l()}async function eM(){var e,r;eD(!0),eL(null);let i=null,a=null;try{if(ew){let e="".concat(t.id,"/").concat(crypto.randomUUID(),"-").concat(ew.name.replace(/\s+/g,"_"));await (0,w.G7)({bucket:"exercise-demos",path:e,file:ew}),i=e}eN&&(a=await E(t.id,eN))}catch(e){return eD(!1),eL((0,_.a)(e,"errors.saveFailed"))}let{error:n}=await j.ND.from("workout_exercises").insert({program_id:t.id,day_id:D||null,library_id:null!=(e=null==X?void 0:X.id)?e:null,demo_video_path:null!=(r=null!=i?i:null==X?void 0:X.demo_video_path)?r:null,coach_audio_path:a,name:(0,M.p)(Z),sort_order:x.filter(e=>J(e)===D).length,target_sets:en.trim()?Number(en):null,target_reps:el.trim()||null,target_weight:eo.trim()||null,tempo:eu.trim()||null,rest_seconds:ex.trim()?Number(ex):null,notes:eg.trim()||null,set_type:"straight"===ev?null:ev,superset_label:"superset"===ev&&ej.trim()||null});if(eD(!1),n)return eL((0,_.a)(n,"errors.saveFailed"));Q(""),ee(null),es(""),ed(""),ec(""),eh(""),em(""),ep(""),ef("straight"),e_(""),eb(null),ek(null),eU(),l()}async function eP(e){await j.ND.from("workout_exercises").delete().eq("id",e),eU(),l()}async function eE(e){var r;eL(null);let i=eT(J(e)),a=i.findIndex(t=>t.id===e.id),{data:n,error:s}=await j.ND.from("workout_exercises").insert({...T(e),program_id:t.id,day_id:null!=(r=e.day_id)?r:null,sort_order:e.sort_order+1}).select("id").single();if(s||!n)return eL((0,_.a)(s,"errors.saveFailed"));let l=n.id,d=[...i.slice(0,a+1).map(e=>e.id),l,...i.slice(a+1).map(e=>e.id)];await eq(d.map((t,r)=>{var i;return{id:t,sort_order:r,day_id:null!=(i=e.day_id)?i:null}})),eU()}async function eJ(e){G(!0),K(null);try{let{data:r,error:i}=await j.ND.from("workout_days").insert({program_id:t.id,name:h("training.copyOf",{title:e.name}),is_rest:e.is_rest,notes:e.notes,sort_order:g.length}).select("id").single();if(i||!r)throw null!=i?i:Error("copy failed");
1let a=r.id,n=eT(e.id);if(n.length){let{error:e}=await j.ND.from("workout_exercises").insert(n.map((e,r)=>({...T(e),program_id:t.id,day_id:a,sort_order:r})));if(e)throw await j.ND.from("workout_days").delete().eq("id",a),e}eU(),l()}catch(e){K((0,_.a)(e,"errors.saveFailed"))}finally{G(!1)}}async function eI(){let e=q.trim();if(!e)return;G(!0),K(null);let{error:r}=await j.ND.from("workout_days").insert({program_id:t.id,name:(0,M.p)(e),is_rest:H,sort_order:g.length});if(G(!1),r)return K((0,_.a)(r,"errors.saveFailed"));F(""),V(!1),eU(),l()}function eT(e){return x.filter(t=>J(t)===e).sort((e,t)=>e.sort_order-t.sort_order)}async function eq(e){(await Promise.all(e.map(e=>j.ND.from("workout_exercises").update({sort_order:e.sort_order,day_id:e.day_id}).eq("id",e.id)))).some(e=>e.error)?(C(h("training.reorderFailed")),eU()):l()}async function eF(e){(await Promise.all(e.map(e=>j.ND.from("workout_days").update({sort_order:e.sort_order}).eq("id",e.id)))).some(e=>e.error)?(C(h("training.reorderFailed")),eU()):l()}function eB(e,t){let r=eT(J(e)),i=r.findIndex(t=>t.id===e.id),a=i+t;if(i<0||a<0||a>=r.length)return;let n=r[i],s=r[a];m(e=>e.map(e=>e.id===n.id?{...e,sort_order:s.sort_order}:e.id===s.id?{...e,sort_order:n.sort_order}:e)),eq([{id:n.id,sort_order:s.sort_order,day_id:n.day_id},{id:s.id,sort_order:n.sort_order,day_id:s.day_id}])}function eH(e,t){if(J(e)===t)return;let r=eT(t).length;m(i=>i.map(i=>i.id===e.id?{...i,day_id:t||null,sort_order:r}:i)),eq([{id:e.id,sort_order:r,day_id:t||null}])}(0,a.useEffect)(()=>{eU()},[eU]);let eR=(0,n.FR)((0,n.MS)(n.AN,{activationConstraint:{distance:8}})),ez=eT("");return(0,i.jsxs)(y.c,{open:!0,onClose:r,title:t.title,size:"lg",children:[(0,i.jsxs)("div",{className:"space-y-5",children:[k&&(0,i.jsx)("p",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3.5 py-2.5 text-sm text-red-300",children:k}),v?(0,i.jsx)(S.iH,{rows:2,className:"h-14"}):(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{className:"space-y-2.5 rounded-2xl border border-white/[0.08] p-4",children:[(0,i.jsx)(S._x,{children:h("training.daysHeading")}),(0,i.jsx)("p",{className:"-mt-1 text-[11px] leading-relaxed text-white/60",children:h("training.daysHint")}),g.length>0&&(0,i.jsx)(n.Mp,{sensors:eR,collisionDetection:n.fp,onDragEnd:function(e){let{active:t,over:r}=e;if(!r||t.id===r.id)return;let i=[...g].sort((e,t)=>e.sort_order-t.sort_order),a=i.findIndex(e=>e.id===t.id),n=i.findIndex(e=>e.id===r.id);if(a<0||n<0)return;let l=(0,s.be)(i,a,n).map((e,t)=>({...e,sort_order:t}));p(e=>e.map(e=>{var t;return null!=(t=l.find(t=>t.id===e.id))?t:e})),eF(l.map(e=>({id:e.id,sort_order:e.sort_order})))},children:(0,i.jsx)(s.gB,{items:[...g].sort((e,t)=>e.sort_order-t.sort_order).map(e=>e.id),strategy:s._G,children:(0,i.jsx)("div",{className:"space-y-1.5",children:[...g].sort((e,t)=>e.sort_order-t.sort_order).map((e,t,r)=>(0,i.jsx)(B,{day:e,count:x.filter(t=>t.day_id===e.id).length,canMoveUp:t>0,canMoveDown:t<r.length-1,onMove:t=>(function(e,t){let r=[...g].sort((e,t)=>e.sort_order-t.sort_order),i=r.findIndex(t=>t.id===e.id),a=i+t;if(i<0||a<0||a>=r.length)return;let n=r[i],s=r[a];p(e=>e.map(e=>e.id===n.id?{...e,sort_order:s.sort_order}:e.id===s.id?{...e,sort_order:n.sort_order}:e)),eF([{id:n.id,sort_order:s.sort_order},{id:s.id,sort_order:n.sort_order}])})(e,t),onRemove:()=>Y(e),onDuplicate:()=>eJ(e),onChanged:()=>{eU(),l()}},e.id))})})}),(0,i.jsxs)("div",{className:"flex items-end gap-2",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)(S.JU,{children:h("training.dayNameLabel")}),(0,i.jsx)(S.pd,{value:q,onChange:e=>F(e.target.value),placeholder:h("training.dayNamePlaceholder")})]}),(0,i.jsxs)(S.$n,{size:"sm",loading:$,disabled:!q.trim(),onClick:eI,children:[(0,i.jsx)(d.A,{className:"h-4 w-4"})," ",h("training.addDay")]})]}),(0,i.jsxs)("label",{className:"flex items-center gap-2.5 text-[13px] text-white/65",children:[(0,i.jsx)("input",{type:"checkbox",checked:H,onChange:e=>V(e.target.checked),className:"h-4 w-4 rounded border-white/20 bg-white/5 accent-teal"}),h("training.markAsRestDay")]}),W&&(0,i.jsx)("p",{className:"text-sm text-red-300",children:W})]}),(0,i.jsxs)(n.Mp,{sensors:eR,collisionDetection:n.fp,onDragEnd:function(e){let{active:t,over:r}=e;if(!r)return;let i=x.find(e=>e.id===t.id);if(!i)return;let a=J(i),n=String(r.id),l=x.find(e=>e.id===r.id),d=l?J(l):n.startsWith("bucket-")?n.slice(7):a,o="unfiled"===d?"":d;if(a===o){let e=eT(a),i=e.findIndex(e=>e.id===t.id),n=l?e.findIndex(e=>e.id===r.id):e.length-1;if(i<0||n<0||i===n)return;let d=(0,s.be)(e,i,n).map((e,t)=>({...e,sort_order:t}));m(e=>e.map(e=>{var t;return null!=(t=d.find(t=>
1t.id===e.id))?t:e})),eq(d.map(e=>({id:e.id,sort_order:e.sort_order,day_id:e.day_id})))}else eH(i,o)},children:[g.map(e=>{let r=eT(e.id);return(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(S._x,{children:e.name}),e.is_rest?(0,i.jsx)("p",{className:"rounded-2xl bg-white/[0.03] px-3.5 py-3 text-sm text-white/60",children:h("training.restDayCoachNote")}):(0,i.jsx)(s.gB,{items:r.map(e=>e.id),strategy:s._G,children:(0,i.jsx)("div",{className:"space-y-2",children:0===r.length?(0,i.jsx)(R,{bucketId:I(e.id),label:h("training.emptyDayDropHint")}):r.map((e,a)=>(0,i.jsx)(z,{id:e.id,ex:e,index:a,programId:t.id,days:g,canMoveUp:a>0,canMoveDown:a<r.length-1,onMove:t=>eB(e,t),onMoveToDay:t=>eH(e,t),onRemove:eP,onDuplicate:()=>eE(e),onChanged:()=>{eU(),l()}},e.id))})})]},e.id)}),g.length>0&&(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(S._x,{children:h("training.notInADay")}),(0,i.jsx)(s.gB,{items:ez.map(e=>e.id),strategy:s._G,children:(0,i.jsx)("div",{className:"space-y-2",children:0===ez.length?(0,i.jsx)(R,{bucketId:I(""),label:h("training.emptyUnfiledDropHint")}):ez.map((e,r)=>(0,i.jsx)(z,{id:e.id,ex:e,index:r,programId:t.id,days:g,canMoveUp:r>0,canMoveDown:r<ez.length-1,onMove:t=>eB(e,t),onMoveToDay:t=>eH(e,t),onRemove:eP,onDuplicate:()=>eE(e),onChanged:()=>{eU(),l()}},e.id))})})]}),0===g.length&&(0,i.jsx)("div",{className:"space-y-2",children:0===x.length?(0,i.jsx)("p",{className:"rounded-2xl bg-white/[0.04] px-3.5 py-3 text-center text-sm text-white/50",children:h("training.noExercisesYet")}):(0,i.jsx)(s.gB,{items:ez.map(e=>e.id),strategy:s._G,children:(0,i.jsx)("div",{className:"space-y-2",children:ez.map((e,r)=>(0,i.jsx)(z,{id:e.id,ex:e,index:r,programId:t.id,days:g,canMoveUp:r>0,canMoveDown:r<ez.length-1,onMove:t=>eB(e,t),onMoveToDay:t=>eH(e,t),onRemove:eP,onDuplicate:()=>eE(e),onChanged:()=>{eU(),l()}},e.id))})})})]})]}),(0,i.jsxs)("div",{className:"space-y-3 rounded-2xl border border-white/[0.08] p-4",children:[(0,i.jsx)(S._x,{children:h("training.addExercise")}),g.length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.addToDay")}),(0,i.jsxs)(S.l6,{value:D,onChange:e=>L(e.target.value),children:[g.filter(e=>!e.is_rest).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),(0,i.jsx)("option",{value:"",children:h("training.notInADay")})]})]}),(0,i.jsx)("div",{className:"flex gap-1.5",children:[!1,!0].map(e=>(0,i.jsx)("button",{type:"button",onClick:()=>{er(e),ea([])},"aria-pressed":et===e,className:et===e?"h-10 flex-1 rounded-xl bg-teal/15 text-[12px] font-semibold text-teal ring-1 ring-inset ring-teal/30":"h-10 flex-1 rounded-xl bg-white/[0.04] text-[12px] font-semibold text-white/55 ring-1 ring-inset ring-white/[0.06] hover:text-white/80",children:e?h("training.addSeveral"):h("training.addOne")},String(e)))}),(0,i.jsx)(U,{value:et?null:X,selectedIds:et?new Set(ei.map(e=>e.id)):void 0,onPick:e=>{if(et)return void ea(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]);ee(e),Q(t=>t.trim()||e.name)},onClear:()=>et?ea([]):ee(null)}),et?(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-[12px] leading-relaxed text-white/55",children:ei.length?h("training.chosenCount",{count:ei.length}):h("training.chooseSeveralHint")}),ei.length>0&&(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:ei.map(e=>(0,i.jsx)("span",{className:"rounded-full bg-teal/12 px-2.5 py-1 text-[11px] font-semibold text-teal ring-1 ring-inset ring-teal/25",children:e.name},e.id))}),(0,i.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.setsLabel")}),(0,i.jsx)(S.pd,{type:"number",inputMode:"numeric",value:en,onChange:e=>es(e.target.value)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.repsLabel")}),(0,i.jsx)(S.pd,{value:el,onChange:e=>ed(e.target.value),placeholder:h("training.repsPlaceholder")})]})]}),(0,i.jsx)("p",{className:"mt-1.5 text-[11px] leading-relaxed text-white/45",children:h("training.sharedNumbersHint")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.exerciseLabel")}),(0,i.jsx)(S.pd,{value:Z,onChange:e=>Q(e.target.value),placeholder:h("training.exercisePlaceholder")}),(0,i.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-white/60",children:h("training.exerciseNameHint")})]}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.setsLabel")}),(0,i.jsx)(S.pd,{type:"number",inputMode:"numeric",value:en,onChange:e=>es(e.target.value)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.repsLabel")}),(0,i.jsx)(S.pd,{value:el,onChange:e=>ed(e.target.value),placeholder:h("training.repsPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.targetLoad")}),(0,i.jsx)(S.pd,{value:eo,onChange:e=>ec(e.target.value),placeholder:h("training.targetLoadPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.tempoLabel")}),(0,i.jsx)(S.pd,{value:eu,onChange:e=>eh(e.target.value),placeholder:h("training.tempoPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.restLabel")}),(0,i.jsx)(S.pd,{type:"number",inputMode:"numeric",value:ex,onChange:e=>em(e.target.value)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.setTypeLabel")}),(0,i.jsx)(S.l6,{value:ev,onChange:e=>ef(e.target.value),children:P.map(e=>(0,i.jsx)("option",{value:e,children:h("training.setType.".concat(e))},e))})]})]}),"superset"===ev&&(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.supersetLabelField")}),(0,i.jsx)(S.pd,{value:ej,onChange:e=>e_(e.target.value),placeholder:h("training.supersetLabelPlaceholder")})]}),(0,i.jsx)("p",{className:"-mt-1 text-[11px] leading-relaxed text-white/60",children:h("training.tempoHint")}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.coachingNotes")}),(0,i.jsx)(S.TM,{rows:2,value:eg,onChange:e=>ep(e.target.value),placeholder:h("training.coachingNotesPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.voiceNote")}),(0,i.jsx)("p",{className:"-mt-1 mb-2 text-[11px] leading-relaxed text-white/60",children:h("training.voiceNoteHint")}),(0,i.jsx)(A.L,{value:eN,onChange:ek})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:h("training.demoVideo")}),(0,i.jsx)("input",{ref:ey,type:"file",accept:"video/*",className:"hidden",onChange:e=>{var t,r;return eb(null!=(r=null==(t=e.target.files)?void 0:t[0])?r:null)}}),(0,i.jsxs)("button",{type:"button",onClick:()=>{var e;return null==(e=ey.current)?void 0:e.click()},className:"flex w-full items-center gap-2.5 rounded-xl border border-dashed border-white/15 bg-white/[0.02] px-4 py-3 text-left transition-colors hover:border-teal/40 hover:bg-teal/[0.04]",children:[ew?(0,i.jsx)(o.A,{className:"h-5 w-5 text-teal"}):(0,i.jsx)(c.A,{className:"h-5 w-5 text-white/40"}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-white/70",children:ew?ew.name:h("training.attachClip")}),ew&&(0,i.jsx)("span",{onClick:e=>{e.stopPropagation(),eb(null)},className:"text-white/60 hover:text-red-400",children:(0,i.jsx)(u.A,{className:"h-4 w-4"})})]})]})]}),eS&&(0,i.jsx)("p",{className:"text-sm text-red-300",children:eS}),et?(0,i.jsxs)(S.$n,{fullWidth:!0,loading:eC,disabled:!ei.length,onClick:eA,children:[(0,i.jsx)(d.A,{className:"h-4 w-4"})," ",h("training.addCount",{count:ei.length})]}):(0,i.jsxs)(S.$n,{fullWidth:!0,loading:eC,disabled:!Z.trim(),onClick:eM,children:[(0,i.jsx)(d.A,{className:"h-4 w-4"})," ",eC&&(ew||eN)?h("training.uploading"):h("training.addExercise")]})]})]}),(0,i.jsx)(N.T,{open:!!O,title:h("training.removeDayTitle"),message:O?h("training.removeDayMessage",{day:O.name,count:x.filter(e=>e.day_id===O.id).length}):void 0,confirmLabel:h("common.delete"),onConfirm:async()=>
1{if(!O)return;let{error:e}=await j.ND.from("workout_days").delete().eq("id",O.id);if(e)throw e;Y(null),eU(),l()},onClose:()=>Y(null)})]})}function B(e){let{day:t,count:r,canMoveUp:a,canMoveDown:n,onMove:d,onRemove:o,onDuplicate:c,onChanged:u}=e,{attributes:h,listeners:x,setNodeRef:m,transform:g,transition:p,isDragging:v}=(0,s.gl)({id:t.id}),f={transform:l.Ks.Transform.toString(g),transition:p,opacity:v?.5:1};return(0,i.jsx)("div",{ref:m,style:f,children:(0,i.jsx)(H,{day:t,count:r,canMoveUp:a,canMoveDown:n,onMove:d,onRemove:o,onDuplicate:c,onChanged:u,dragHandleProps:{attributes:h,listeners:x}})})}function H(e){let{day:t,count:r,canMoveUp:n,canMoveDown:s,onMove:l,onRemove:d,onDuplicate:o,onChanged:c,dragHandleProps:v}=e,{t:w}=(0,f.Bd)(),[b,y]=(0,a.useState)(!1),[N,k]=(0,a.useState)(t.name),[C,D]=(0,a.useState)(t.is_rest),[L,U]=(0,a.useState)(!1),[A,P]=(0,a.useState)(null);async function E(){if(!N.trim())return;U(!0),P(null);let{error:e}=await j.ND.from("workout_days").update({name:(0,M.p)(N),is_rest:C}).eq("id",t.id);if(U(!1),e)return P((0,_.a)(e,"errors.saveFailed"));y(!1),c()}return b?(0,i.jsxs)("div",{className:"space-y-2 rounded-xl bg-white/[0.03] px-3 py-2.5 ring-1 ring-inset ring-teal/25",children:[(0,i.jsx)(S.pd,{value:N,onChange:e=>k(e.target.value)}),(0,i.jsxs)("label",{className:"flex items-center gap-2 text-[12px] text-white/60",children:[(0,i.jsx)("input",{type:"checkbox",checked:C,onChange:e=>D(e.target.checked),className:"h-4 w-4 rounded border-white/20 bg-white/5 accent-teal"}),w("training.markAsRestDay")]}),A&&(0,i.jsx)("p",{className:"text-xs text-red-300",children:A}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(S.$n,{size:"sm",variant:"secondary",onClick:()=>{k(t.name),D(t.is_rest),P(null),y(!1)},children:w("common.cancel")}),(0,i.jsx)(S.$n,{size:"sm",loading:L,disabled:!N.trim(),onClick:E,children:w("common.save")})]})]}):(0,i.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-white/[0.03] px-3 py-2 ring-1 ring-inset ring-white/[0.05]",children:[v&&(0,i.jsx)("button",{type:"button",...v.attributes,...v.listeners,className:"shrink-0 cursor-grab touch-none text-white/25 hover:text-white/50","aria-label":w("training.dragToReorder"),children:(0,i.jsx)(h.A,{className:"h-4 w-4"})}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:t.name}),t.is_rest?(0,i.jsx)(S.Ex,{tone:"muted",children:w("training.restDay")}):0===r?(0,i.jsx)(S.Ex,{tone:"gold",children:w("training.dayNotBuilt")}):(0,i.jsx)("span",{className:"shrink-0 text-[11px] text-white/60",children:w("training.exercises",{count:r})}),(0,i.jsxs)("div",{className:"-my-1.5 flex shrink-0 items-center gap-0.5",children:[(0,i.jsx)("button",{onClick:()=>l(-1),disabled:!n,className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70 disabled:opacity-25","aria-label":w("training.moveUp"),children:(0,i.jsx)(x.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:()=>l(1),disabled:!s,className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70 disabled:opacity-25","aria-label":w("training.moveDown"),children:(0,i.jsx)(m.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:()=>y(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70","aria-label":w("training.editDay"),children:(0,i.jsx)(g.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:o,className:"flex h-9 w-9 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70","aria-label":w("training.duplicateDay"),children:(0,i.jsx)(p.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:d,className:"flex h-9 w-9 items-center justify-center rounded-lg text-white/35 transition hover:bg-red-500/10 hover:text-red-400","aria-label":w("training.removeDay"),children:(0,i.jsx)(u.A,{className:"h-4 w-4"})})]})]})}function R(e){let{bucketId:t,label:r}=e,{setNodeRef:a,isOver:s}=(0,n.zM)({id:t});return(0,i.jsx)("div",{ref:a,className:(0,b.cn)("rounded-2xl border border-dashed px-3.5 py-3 text-center text-sm transition-colors",s?"border-teal/50 bg-teal/5 text-teal-soft":"border-white/10 bg-white/[0.03] text-white/50"),children:r})}function z(e){let{attributes:t,listeners:r,setNodeRef:a,transform:n,transition:d,isDragging:o}=(0,s.gl)({id:e.id}),c={transform:l.Ks.Transform.toString(n),transition:d,opacity:o?.5:1};return(0,i.jsx)("div",{ref:a,style:c,children:(0,i.jsx)(V,{...e,dragHandleProps:{attributes:t,listeners:r}})})}function V(e){var t,r,n,s,l,d,c;let{ex:w,index:b,programId:y,days:N,canMoveUp:k,canMoveDown:C,onMove:
1D,onMoveToDay:L,onRemove:U,onDuplicate:A,onChanged:E,dragHandleProps:J}=e,{t:I}=(0,f.Bd)(),[T,q]=(0,a.useState)(!1),[F,B]=(0,a.useState)(w.name),[H,R]=(0,a.useState)(null!=w.target_sets?String(w.target_sets):""),[z,V]=(0,a.useState)(null!=(t=w.target_reps)?t:""),[G,W]=(0,a.useState)(null!=(r=w.target_weight)?r:""),[K,O]=(0,a.useState)(null!=(n=w.tempo)?n:""),[Y,Z]=(0,a.useState)(null!=w.rest_seconds?String(w.rest_seconds):""),[Q,X]=(0,a.useState)(null!=(s=w.notes)?s:""),[ee,et]=(0,a.useState)(null!=(l=w.set_type)?l:"straight"),[er,ei]=(0,a.useState)(null!=(d=w.superset_label)?d:""),[ea,en]=(0,a.useState)(!1),[es,el]=(0,a.useState)(null);async function ed(){if(!F.trim())return;en(!0),el(null);let{error:e}=await j.ND.from("workout_exercises").update({name:(0,M.p)(F),target_sets:H.trim()?Number(H):null,target_reps:z.trim()||null,target_weight:G.trim()||null,tempo:K.trim()||null,rest_seconds:Y.trim()?Number(Y):null,notes:Q.trim()||null,set_type:"straight"===ee?null:ee,superset_label:"superset"===ee&&er.trim()||null}).eq("id",w.id);if(en(!1),e)return el((0,_.a)(e,"errors.saveFailed"));q(!1),E()}let eo=w.set_type&&"straight"!==w.set_type?I("training.setType.".concat(w.set_type)):null;return T?(0,i.jsxs)("div",{className:"space-y-3 rounded-2xl bg-white/[0.03] p-3.5 ring-1 ring-inset ring-teal/25",children:[(0,i.jsx)(S.pd,{value:F,onChange:e=>B(e.target.value),placeholder:I("training.exercisePlaceholder")}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.setsLabel")}),(0,i.jsx)(S.pd,{type:"number",inputMode:"numeric",value:H,onChange:e=>R(e.target.value)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.repsLabel")}),(0,i.jsx)(S.pd,{value:z,onChange:e=>V(e.target.value),placeholder:I("training.repsPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.targetLoad")}),(0,i.jsx)(S.pd,{value:G,onChange:e=>W(e.target.value),placeholder:I("training.targetLoadPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.tempoLabel")}),(0,i.jsx)(S.pd,{value:K,onChange:e=>O(e.target.value),placeholder:I("training.tempoPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.restLabel")}),(0,i.jsx)(S.pd,{type:"number",inputMode:"numeric",value:Y,onChange:e=>Z(e.target.value)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.setTypeLabel")}),(0,i.jsx)(S.l6,{value:ee,onChange:e=>et(e.target.value),children:P.map(e=>(0,i.jsx)("option",{value:e,children:I("training.setType.".concat(e))},e))})]})]}),"superset"===ee&&(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.supersetLabelField")}),(0,i.jsx)(S.pd,{value:er,onChange:e=>ei(e.target.value),placeholder:I("training.supersetLabelPlaceholder")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(S.JU,{children:I("training.coachingNotes")}),(0,i.jsx)(S.TM,{rows:2,value:Q,onChange:e=>X(e.target.value),placeholder:I("training.coachingNotesPlaceholder")})]}),es&&(0,i.jsx)("p",{className:"text-xs text-red-300",children:es}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(S.$n,{size:"sm",variant:"secondary",onClick:function(){var e,t,r,i,a,n;B(w.name),R(null!=w.target_sets?String(w.target_sets):""),V(null!=(e=w.target_reps)?e:""),W(null!=(t=w.target_weight)?t:""),O(null!=(r=w.tempo)?r:""),Z(null!=w.rest_seconds?String(w.rest_seconds):""),X(null!=(i=w.notes)?i:""),et(null!=(a=w.set_type)?a:"straight"),ei(null!=(n=w.superset_label)?n:""),el(null),q(!1)},children:I("common.cancel")}),(0,i.jsx)(S.$n,{size:"sm",loading:ea,disabled:!F.trim(),onClick:ed,children:I("common.save")})]})]}):(0,i.jsxs)("div",{className:"rounded-2xl bg-white/[0.03] p-3.5 ring-1 ring-inset ring-white/[0.05]",children:[(0,i.jsxs)("div",{className:"flex items-start gap-2",children:[J&&(0,i.jsx)("button",{type:"button",...J.attributes,...J.listeners,className:"mt-0.5 shrink-0 cursor-grab touch-none text-white/20 hover:text-white/45","aria-label":I("training.dragToReorder"),children:(0,i.jsx)(h.A,{className:"h-4 w-4"})}),(0,i.jsx)("span",{className:"mt-0.5 shrink-0 text-[11px] font-semibold text-white/30",children:b+1}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("p",{className:"flex flex-wrap items-center gap-1.5 font-semibold",children:[w.name,w.demo_video_path&&(0,i.jsx)(o.A,{className:"h-3.5 w-3.5 shrink-0 text-teal","aria-label":I("training.hasDemoVideo")}),w.coach_audio_path&&(0,i.jsx)(v.A,{className:"h-3.5 w-3.5 shrink-0 text-teal","aria-label":I("training.hasVoiceNote")}),eo&&(0,i.jsxs)(S.Ex,{tone:"teal",children:[eo,w.superset_label?" ".concat(w.superset_label):""]})]}),(0,i.jsx)("p",{className:"mt-0.5 text-xs text-white/60",children:[w.target_sets&&I("training.targetSets",{count:w.target_sets}),w.target_reps&&I("training.targetReps",{reps:w.target_reps}),w.target_weight,w.tempo&&I("training.targetTempo",{tempo:w.tempo}),w.rest_seconds&&I("training.restSeconds",{count:w.rest_seconds}
1)].filter(Boolean).join(" \xb7 ")||I("training.noTargets")})]}),(0,i.jsxs)("div",{className:"-my-1 flex shrink-0 items-center gap-0.5",children:[(0,i.jsx)("button",{onClick:()=>D(-1),disabled:!k,className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70 disabled:opacity-25","aria-label":I("training.moveUp"),children:(0,i.jsx)(x.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:()=>D(1),disabled:!C,className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70 disabled:opacity-25","aria-label":I("training.moveDown"),children:(0,i.jsx)(m.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:()=>q(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70","aria-label":I("training.editExercise"),children:(0,i.jsx)(g.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:A,className:"flex h-9 w-9 items-center justify-center rounded-lg text-white/30 transition hover:bg-white/[0.06] hover:text-white/70","aria-label":I("training.duplicateExercise"),children:(0,i.jsx)(p.A,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:()=>U(w.id),className:"flex h-9 w-9 items-center justify-center rounded-lg text-white/30 transition hover:bg-red-500/10 hover:text-red-400","aria-label":I("training.removeExercise"),children:(0,i.jsx)(u.A,{className:"h-4 w-4"})})]})]}),N.length>0&&(0,i.jsx)("div",{className:"mt-2.5 pl-6",children:(0,i.jsxs)(S.l6,{value:null!=(c=w.day_id)?c:"",onChange:e=>L(e.target.value),"aria-label":I("training.moveToDay"),className:"h-8 w-auto text-[12px]",children:[N.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),(0,i.jsx)("option",{value:"",children:I("training.notInADay")})]})}),(0,i.jsx)($,{ex:w,programId:y,onChanged:E})]})}function $(e){let{ex:t,programId:r,onChanged:n}=e,{t:s}=(0,f.Bd)(),[l,d]=(0,a.useState)(!1),[o,c]=(0,a.useState)(!1),[u,h]=(0,a.useState)(null);async function x(e){if(e){c(!0),h(null);try{let i=await E(r,e),{error:a}=await j.ND.from("workout_exercises").update({coach_audio_path:i}).eq("id",t.id);if(a)throw a;d(!1),n()}catch(e){h((0,_.a)(e,"errors.saveFailed"))}finally{c(!1)}}}async function m(){c(!0),h(null);let{error:e}=await j.ND.from("workout_exercises").update({coach_audio_path:null}).eq("id",t.id);if(c(!1),e)return h((0,_.a)(e,"errors.saveFailed"));n()}return(0,i.jsxs)("div",{className:"mt-2.5 pl-6",children:[t.coach_audio_path?(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)(A.u,{bucket:"exercise-demos",path:t.coach_audio_path,label:s("training.playVoiceNote")}),(0,i.jsx)("button",{onClick:()=>d(e=>!e),className:"text-[11px] font-semibold text-white/50 transition hover:text-white",children:s(l?"common.cancel":"training.replaceVoiceNote")}),(0,i.jsx)("button",{onClick:m,disabled:o,className:"text-[11px] font-semibold text-white/50 transition hover:text-red-400 disabled:opacity-50",children:s("training.removeVoiceNote")})]}):l?(0,i.jsx)("button",{onClick:()=>d(!1),className:"mb-2 text-[11px] font-semibold text-white/50 transition hover:text-white",children:s("common.cancel")}):(0,i.jsxs)("button",{onClick:()=>d(!0),className:"inline-flex items-center gap-1.5 rounded-full bg-white/[0.05] px-3 py-1.5 text-[11px] font-semibold text-white/70 ring-1 ring-inset ring-white/10 transition active:scale-95",children:[(0,i.jsx)(v.A,{className:"h-3.5 w-3.5 text-teal"})," ",s("training.addVoiceNote")]}),l&&(0,i.jsx)(A.L,{value:null,onChange:x,className:"mt-2"}),o&&(0,i.jsx)("p",{className:"mt-1 text-[11px] text-white/50",children:s("training.savingVoiceNote")}),u&&(0,i.jsx)("p",{className:"mt-1 text-[11px] text-red-300",children:u})]})}}}]);

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.