{#if pocketNotice}
Pocket Money {#if hasUnsetPocket}

Every child has a Pocket Money droplet. Set how it's awarded — pick the amount (£) and the % of weekly chores they must complete to earn it — then save. Until you set the amount, pocket money is paused for that child.

{:else}

All Pocket Money droplets are set. Children will earn pocket money as they complete chores.

{/if}
{/if}

Templates — Drag to assign

{#each templateConfigs as cfg}
handleDragStart(e, cfg)} style="border-left-color:{cfg.color}">
{cfg.name}
{cfg.target} {cfg.type} {cfg.occurrence} {#if cfg.period} {cfg.period} {/if} {#if cfg.isPocketMoney} Pocket Money {/if}
{formatReward(cfg.rewardType, cfg.rewardValue)}
{/each} {#if templateConfigs.length === 0}

No templates yet

{/if}
{#each allBonusConfigs.filter((c) => c.target === 'individual' && !doneConfigs.includes(c)) as cfg}
openEditConfig(cfg)} onkeydown={(e) => e.key === 'Enter' && openEditConfig(cfg)} >
{cfg.name}
{cfg.target} {cfg.type} {cfg.occurrence} {#if cfg.isPocketMoney} Pocket Money {/if}
{cfg.rewardType === 'cash' ? `£${Number(cfg.rewardValue).toFixed(2)}` : `${cfg.rewardValue} pts`}
{#each members as m} {#if !cfg.memberId || cfg.memberId === m.id} {@const p = progressByConfigId .get(cfg.id) ?.progress.find((pr: BonusProgress) => pr.memberId === m.id)} {#if cfg.type === 'manual'}
{m.name}
{:else} {@const criteria = p?.criteriaValue ?? cfg.criteriaValue ?? 0} {@const current = p?.current ?? 0} {@const achieved = p?.achieved ?? false} {@const isPct = cfg.thresholdType === 'percent'} {@const pct = isPct ? Math.min(100, current) : criteria > 0 ? Math.min(100, (current / criteria) * 100) : 0}
{m.name} {#if criteria > 0}
{/if} {#if !p || p.state === 'pending'}{:else}{p.state}{/if}
{/if} {/if} {/each}
Click to edit
{/each} {#if allBonusConfigs.filter((c) => c.target === 'individual' && !doneConfigs.includes(c)).length === 0}

No bonuses

{/if}
{#each allBonusConfigs.filter((c) => c.target === 'competitive' && !doneConfigs.includes(c)) as cfg} {@const prog = progressByConfigId.get(cfg.id)}
openEditConfig(cfg)} onkeydown={(e) => e.key === 'Enter' && openEditConfig(cfg)} >
{cfg.name}
{cfg.target} {cfg.type} {cfg.occurrence}
{cfg.rewardType === 'cash' ? `£${Number(cfg.rewardValue).toFixed(2)}` : `${cfg.rewardValue} pts`}
{#if prog}
{#each [...prog.progress].sort((a, b) => b.current - a.current) as p, i}
0}> #{i + 1} {p.memberName} {#if p.criteriaValue > 0}
{/if} {#if p.state === 'pending'}{:else}{p.state}{/if}
{/each}
{/if}
Click to edit
{/each} {#if allBonusConfigs.filter((c) => c.target === 'competitive' && !doneConfigs.includes(c)).length === 0}

No bonuses

{/if}
{#each allBonusConfigs.filter((c) => c.target === 'collaborative') as cfg} {@const prog = progressByConfigId.get(cfg.id)}
openEditConfig(cfg)} onkeydown={(e) => e.key === 'Enter' && openEditConfig(cfg)} >
{cfg.name}
{cfg.target} {cfg.type} {cfg.occurrence}
{cfg.rewardType === 'cash' ? `£${Number(cfg.rewardValue).toFixed(2)}` : `${cfg.rewardValue} pts`}
{#if prog} {@const team = prog.progress[0]} {#if team}
{team.memberName} {#if team.criteriaValue > 0}
{/if} {team.current}/{team.criteriaValue} {cfg.type === 'threshold' ? 'pts' : 'chores'} {#if team.state === 'pending'}{:else}{team.state}{/if}
{/if} {/if}
Click to edit
{/each} {#if allBonusConfigs.filter((c) => c.target === 'collaborative' && !doneConfigs.includes(c)).length === 0}

No bonuses

{/if}
{#if showEditModal && (editingConfig || creatingFromTemplate)} {@const targetCfg = creatingFromTemplate || editingConfig!}
{ showEditModal = false; creatingFromTemplate = null; editingConfig = null; }} role="presentation" >
{/if}