PageSourceSearch

https://buddyone.io/static/js/1121.50cb3b1d.chunk.js

js buddyone.io collected 2026-10-02 02:01:10 UTC 9,781 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkbuddymarket_app=self.webpackChunkbuddymarket_app||[]).push([[1121],{37490:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(67977);const l={get:()=>t.A.get("household").json(),create:e=>t.A.post("household",{json:{name:e}}).json(),rename:e=>t.A.patch("household",{json:{name:e}}).json(),invite:(e,s)=>t.A.post("household/invitations",{json:{email:e,origin:s}}).json(),cancelInvitation:e=>t.A.delete("household/invitations/".concat(e)).json(),acceptInvitation:e=>t.A.post("household/invitations/accept",{json:{token:e}}).json(),getInvitationByToken:e=>t.A.get("household/invitations/token/".concat(e)).json(),updateMyPreferences:e=>t.A.patch("household/members/me",{json:e}).json(),removeMember:e=>t.A.delete("household/members/".concat(e)).json(),listAssignments:e=>t.A.get("household/recipes",{searchParams:{householdId:e}}).json(),myAssignments:()=>t.A.get("household/recipes/me").json(),assignRecipe:e=>t.A.post("household/recipes",{json:e}).json(),unassignRecipe:(e,s)=>t.A.delete("household/recipes/".concat(s),{searchParams:{householdId:e}}).json(),markCompleted:(e,s,a)=>t.A.patch("household/recipes/".concat(s,"/completed"),{json:{householdId:e,completed:a}}).json(),weekCalendar:(e,s)=>t.A.get("household/recipes/calendar",{searchParams:{householdId:e,weekStart:s}}).json(),searchRecipes:(e,s)=>t.A.get("household/recipes/search",{searchParams:{householdId:e,query:s}}).json(),generateFamilyMenu:e=>t.A.post("household/recipes/generate",{json:e}).json(),saveMenu:e=>t.A.post("household/menus",{json:e}).json(),listMenus:e=>t.A.get("household/menus",{searchParams:{householdId:e}}).json(),removeMenu:(e,s)=>t.A.delete("household/menus/".concat(s),{searchParams:{householdId:e}}).json(),updateMemberProfile:(e,s)=>t.A.patch("household/members/".concat(e,"/profile"),{json:s}).json(),membersNutrition:()=>t.A.get("household/members/nutrition").json()}},71121:(e,s,a)=>{a.r(s),a.d(s,{default:()=>p});var t=a(9950),l=a(42074),n=a(67818),i=a(50384),o=a(37490),r=a(38074),d=a(97726),c=a(44414);const m={desayuno:"\ud83c\udf05",media_manana:"\ud83e\udd50",almuerzo:"\u2600\ufe0f",pre_cena:"\ud83e\udd57",cena:"\ud83c\udf19",snack:"\ud83c\udf4e",merienda:"\ud83c\udf6a",comida:"\ud83c\udf7d\ufe0f"},h=["all","pending","completed"],p=()=>{const e=(0,r.dj)(),{t:s,i18n:a}=(0,n.Bd)(),[p,x]=(0,t.useState)([]),[g,u]=(0,t.useState)(!0),[y,j]=(0,t.useState)("all"),f=(0,t.useCallback)((async()=>{u(!0);try{var a;const e=await o.A.myAssignments();x(null!==(a=null===e||void 0===e?void 0:e.assignments)&&void 0!==a?a:[])}catch(l){var t;401!==(null===l||void 0===l||null===(t=l.response)||void 0===t?void 0:t.status)&&e.error(s("family.myAssigned.loadError")),x([])}finally{u(!1)}}),[e,s]);(0,t.useEffect)((()=>{f()}),[f]);const v=(0,t.useMemo)((()=>p.filter((e=>"pending"===y?!e.isCompleted:"completed"!==y||e.isCompleted))),[p,y]),b=p.filter((e=>!e.isCompleted)).length,A=p.filter((e=>e.isCompleted)).length,N=p.length,w=a.language||"es",k=(0,t.useMemo)((()=>{const e=new Map;return v.forEach((a=>{const t=a.scheduledDate?new Date(a.scheduledDate).toLocaleDateString(w,{weekday:"long",day:"numeric",month:"long"}):s("family.myAssigned.noScheduledDate");e.has(t)||e.set(t,[]),e.get(t).push(a)})),Array.from(e.entries())}),[v,w,s]);return g?(0,c.jsx)(d.A,{}):(0,c.jsxs)("div",{className:"mx-auto w-full max-w-2xl space-y-6 px-4 py-6",children:[(0,c.jsx)("div",{className:"flex items-center gap-3",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("h1",{className:"flex items-center gap-2 text-2xl font-bold text-gray-900",children:[(0,c.jsx)(i.yos,{className:"h-6 w-6 text-orange-500"}),s("family.myAssigned.title")]}),(0,c.jsx)("p",{className:"mt-0.5 text-sm text-gray-500",children:s("family.myAssigned.subtitle")})]})}),(0,c.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,c.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 text-center shadow-sm",children:[(0,c.jsx)("p",{className:"text-2xl font-bold text-orange-500",children:N}),(0,c.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:s("family.myAssigned.stats.total")})]}),(0,c.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 text-center shadow-sm",children:[(0,c.jsx)("p",{className:"text-2xl font-bold text-amber-500",children:b}),(0,c.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:s("family.myAssigned.stats.pending")})]}),(0,c.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 text-center shadow-sm",children:[(0,c.jsx)("p",{className:"text-2xl font-bold text-green-500",children:A}),(0,c.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:s("family.myAssigned.stats.completed")})]})]}),(0,c.jsx)("div",{className:"flex items-center gap-1 rounded-2xl border border-gray-200 bg-white p-1 shadow-sm",children:h.map((e=>
1{const a="all"===e?N:"pending"===e?b:A,t=y===e;return(0,c.jsxs)("button",{type:"button",onClick:()=>j(e),className:"inline-flex flex-1 items-center justify-center gap-1.5 rounded-xl px-3 py-2 text-xs font-semibold transition-colors ".concat(t?"bg-orange-500 text-white shadow-sm":"text-gray-600 hover:bg-gray-50"),children:[s("family.myAssigned.filters.".concat(e)),(0,c.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] ".concat(t?"bg-white/20 text-white":"bg-gray-100 text-gray-600"),children:a})]},e)}))}),0===v.length?(0,c.jsxs)("div",{className:"py-16 text-center text-gray-500",children:[(0,c.jsx)(i.xnF,{className:"mx-auto mb-3 h-10 w-10 opacity-30"}),(0,c.jsx)("p",{className:"font-medium",children:s("pending"===y?"family.myAssigned.emptyPending":"completed"===y?"family.myAssigned.emptyCompleted":"family.myAssigned.emptyAll")}),"all"===y&&(0,c.jsx)("p",{className:"mt-1 text-sm",children:s("family.myAssigned.emptyAllHint")})]}):k.map((a=>{let[t,n]=a;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-500",children:[(0,c.jsx)(i.g9p,{className:"h-3.5 w-3.5"}),(0,c.jsx)("span",{className:"capitalize",children:t}),(0,c.jsx)("div",{className:"h-px flex-1 bg-gray-200"})]}),n.map((a=>{var t,n,r,d,h,p,x,g,u,y;const j=a.mealType?m[a.mealType]:null,v=a.mealType?s("family.meals.".concat(a.mealType),{defaultValue:a.mealType}):null,b=(null!==(t=null===(n=a.recipe)||void 0===n?void 0:n.preparationTime)&&void 0!==t?t:0)+(null!==(r=null===(d=a.recipe)||void 0===d?void 0:d.cookTime)&&void 0!==r?r:0);return(0,c.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white p-4 shadow-sm transition-all ".concat(a.isCompleted?"opacity-60":""),children:[(0,c.jsxs)("div",{className:"flex items-start gap-4",children:[(0,c.jsx)("button",{type:"button",onClick:()=>(async a=>{try{await o.A.markCompleted(a.householdId,a.id,!a.isCompleted),e.success(a.isCompleted?s("family.myAssigned.pendingToast"):s("family.myAssigned.completedToast")),f()}catch(t){e.error(s("family.myAssigned.toggleError"))}})(a),"aria-label":a.isCompleted?s("family.calendar.markPendingAria"):s("family.calendar.markCompletedAria"),className:"mt-0.5 shrink-0 text-gray-400 transition-colors hover:text-orange-500",children:a.isCompleted?(0,c.jsx)(i.HU4,{className:"h-6 w-6 text-green-500"}):(0,c.jsx)(i.AMD,{className:"h-6 w-6"})}),(0,c.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,c.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,c.jsxs)("div",{className:"min-w-0",children:[(0,c.jsx)("p",{className:"truncate font-semibold ".concat(a.isCompleted?"text-gray-400 line-through":"text-gray-900"),children:null===(h=a.recipe)||void 0===h?void 0:h.name}),(0,c.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[a.child&&(0,c.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-purple-200 bg-purple-50 px-2 py-0 text-xs font-semibold text-purple-700",children:[a.child.imageUrl?(0,c.jsx)("img",{src:a.child.imageUrl,alt:"",className:"h-3.5 w-3.5 rounded-full object-cover"}):(0,c.jsx)("span",{"aria-hidden":"true",children:"\ud83d\udc76"}),s("family.myAssigned.forChild",{name:a.child.name})]}),v&&(0,c.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-gray-200 px-2 py-0 text-xs text-gray-600",children:[j," ",v]}),(null===(p=a.recipe)||void 0===p?void 0:p.calories)&&(0,c.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[(0,c.jsx)(i.GBC,{className:"h-3 w-3"}),a.recipe.calories," kcal"]}),b>0&&(0,c.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[(0,c.jsx)(i._yE,{className:"h-3 w-3"}),b," min"]})]})]}),(null===(x=a.recipe)||void 0===x?void 0:x.imageUrl)&&(0,c.jsx)("img",{src:a.recipe.imageUrl,alt:a.recipe.name,className:"h-16 w-16 shrink-0 rounded-xl object-cover"})]}),a.note&&(0,c.jsx)("div",{className:"mt-2 rounded-lg border border-orange-100 bg-orange-50 p-2.5",children:(0,c.jsxs)("p",{className:"text-xs italic text-orange-700",children:['"',a.note,'"']})}),(0,c.jsxs)("div",{className:"mt-2 flex items-center gap-1 text-xs text-gray-500",children:[(0,c.jsx)(i.Bl4,{className:"h-3 w-3"}),(0,c.jsxs)("span",{children:[s("family.myAssigned.assignedBy",{name:null!==(g=null===(u=a.assignedBy)||void 0===u?void 0:u.name)&&void 0!==g?g:"\u2014"})," \xb7 ",new Date(a.createdAt).toLocaleDateString(w)]})]})]})]}),(null===(y=a.recipe)||void 0===y?void 0:y.id)&&(0,c.jsx)("div",{className:"mt-3 border-t border-gray-100 pt-3",children:(0,c.jsxs)(l.N_,{to:"/recipe?id=".concat(a.recipe.id),className:"inline-flex w-full items-center justify-center gap-1.5 rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:bg-gray-50",children:[(0,c.jsx)(i.xnF,{className:"h-3.5 w-3.5"}),s("family.myAssigned.viewFullRecipe")]})})]},a.id)}))]},t)}))]})}}}]);

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.