// v2-extras.jsx — Lista v2 add-ons: extra icons, new i18n strings, recipes.
// Loaded after icons.jsx + i18n.jsx; patches window.Ico and window.I18N.

(function () {
  // ── extra icons ────────────────────────────────────────────────────
  Object.assign(window.Ico, {
    chef: (c, s = 16) => (
      <svg width={s} height={s} viewBox="0 0 16 16" fill="none" stroke={c} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"><path d="M4.6 6.2a2.4 2.4 0 01.5-4.6 2.6 2.6 0 015.8 0 2.4 2.4 0 01.5 4.6V11H4.6zM4.6 13h6.8M6.5 6.5v2.3M9.5 6.5v2.3" /></svg>
    ),
    bolt: (c, s = 14) => (
      <svg width={s} height={s} viewBox="0 0 14 14" fill={c}><path d="M8 1L2.8 8H6.4L5.6 13 11.2 6H7.4z" /></svg>
    ),
  });

  // ── new UI strings (en / fi / ar) ──────────────────────────────────
  const add = (loc, obj) => { if (window.I18N[loc]) Object.assign(window.I18N[loc].ui, obj); };
  add('en', {
    searchList: 'Search this list\u2026', noMatches: 'No items match', undo: 'Undo',
    itemRemoved: 'Item removed', clearedChecked: 'Checked items cleared', listRemoved: 'List deleted',
    recipes: 'Recipes', ingredients: 'ingredients', addAll: 'Add all', alreadyIn: 'in list',
    recipeAdded: 'added to list', search: 'Search',
    background: 'Background', backgroundHint: 'Soft abstract shapes behind the glass.', dynamic: 'Dynamic', static: 'Static', off: 'Off',
    newRecipe: 'New recipe', recipeName: 'Recipe name', addIngredient: 'Add an ingredient\u2026', deleteRecipe: 'Delete recipe', cancel: 'Cancel', saveRecipe: 'Save recipe', editRecipe: 'Edit recipe',
  });
  add('fi', {
    searchList: 'Hae t\u00e4st\u00e4 listasta\u2026', noMatches: 'Ei osumia', undo: 'Kumoa',
    itemRemoved: 'Tuote poistettu', clearedChecked: 'Valitut tyhjennetty', listRemoved: 'Lista poistettu',
    recipes: 'Reseptit', ingredients: 'ainesta', addAll: 'Lis\u00e4\u00e4 kaikki', alreadyIn: 'listalla',
    recipeAdded: 'lis\u00e4tty listaan', search: 'Haku',
    background: 'Tausta', backgroundHint: 'Pehmeit\u00e4 abstrakteja muotoja lasin takana.', dynamic: 'El\u00e4v\u00e4', static: 'Staattinen', off: 'Pois',
    newRecipe: 'Uusi resepti', recipeName: 'Reseptin nimi', addIngredient: 'Lis\u00e4\u00e4 aines\u2026', deleteRecipe: 'Poista resepti', cancel: 'Peruuta', saveRecipe: 'Tallenna resepti', editRecipe: 'Muokkaa resepti\u00e4',
  });
  add('ar', {
    searchList: '\u0627\u0628\u062d\u062b \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0642\u0627\u0626\u0645\u0629\u2026', noMatches: '\u0644\u0627 \u062a\u0648\u062c\u062f \u0646\u062a\u0627\u0626\u062c', undo: '\u062a\u0631\u0627\u062c\u0639',
    itemRemoved: '\u062a\u0645 \u062d\u0630\u0641 \u0627\u0644\u0639\u0646\u0635\u0631', clearedChecked: '\u062a\u0645 \u0645\u0633\u062d \u0627\u0644\u0645\u062d\u062f\u062f\u0629', listRemoved: '\u062a\u0645 \u062d\u0630\u0641 \u0627\u0644\u0642\u0627\u0626\u0645\u0629',
    recipes: '\u0648\u0635\u0641\u0627\u062a', ingredients: '\u0645\u0643\u0648\u0646\u0627\u062a', addAll: '\u0623\u0636\u0641 \u0627\u0644\u0643\u0644', alreadyIn: '\u0641\u064a \u0627\u0644\u0642\u0627\u0626\u0645\u0629',
    recipeAdded: '\u0623\u064f\u0636\u064a\u0641\u062a \u0644\u0644\u0642\u0627\u0626\u0645\u0629', search: '\u0628\u062d\u062b',
    background: '\u0627\u0644\u062e\u0644\u0641\u064a\u0629', backgroundHint: '\u0623\u0634\u0643\u0627\u0644 \u062a\u062c\u0631\u064a\u062f\u064a\u0629 \u0646\u0627\u0639\u0645\u0629 \u062e\u0644\u0641 \u0627\u0644\u0632\u062c\u0627\u062c.', dynamic: '\u0645\u062a\u062d\u0631\u0643\u0629', static: '\u062b\u0627\u0628\u062a\u0629', off: '\u0625\u064a\u0642\u0627\u0641',
    newRecipe: '\u0648\u0635\u0641\u0629 \u062c\u062f\u064a\u062f\u0629', recipeName: '\u0627\u0633\u0645 \u0627\u0644\u0648\u0635\u0641\u0629', addIngredient: '\u0623\u0636\u0641 \u0645\u0643\u0648\u0651\u0646\u064b\u0627\u2026', deleteRecipe: '\u062d\u0630\u0641 \u0627\u0644\u0648\u0635\u0641\u0629', cancel: '\u0625\u0644\u063a\u0627\u0621', saveRecipe: '\u062d\u0641\u0638 \u0627\u0644\u0648\u0635\u0641\u0629', editRecipe: '\u062a\u0639\u062f\u064a\u0644 \u0627\u0644\u0648\u0635\u0641\u0629',
  });
  // recipe display names translate via the items map
  const addItems = (loc, obj) => { if (window.I18N[loc]) Object.assign(window.I18N[loc].items, obj); };
  addItems('fi', {
    'Taco night': 'Tacoilta', 'Salmon dinner': 'Lohi-illallinen', 'Pasta marinara': 'Pasta marinara',
    'Big breakfast': 'Iso aamiainen', 'Green salad': 'Vihre\u00e4 salaatti', 'Chili con carne': 'Chili con carne',
    'Lime': 'Limetti', 'Sour cream': 'Ranskankerma', 'Bell peppers': 'Paprikat', 'Cucumber': 'Kurkku', 'Feta': 'Feta',
  });
  addItems('ar', {
    'Taco night': '\u0644\u064a\u0644\u0629 \u0627\u0644\u062a\u0627\u0643\u0648', 'Salmon dinner': '\u0639\u0634\u0627\u0621 \u0627\u0644\u0633\u0644\u0645\u0648\u0646', 'Pasta marinara': '\u0645\u0639\u0643\u0631\u0648\u0646\u0629 \u0645\u0627\u0631\u064a\u0646\u0627\u0631\u0627',
    'Big breakfast': '\u0641\u0637\u0648\u0631 \u0643\u0628\u064a\u0631', 'Green salad': '\u0633\u0644\u0637\u0629 \u062e\u0636\u0631\u0627\u0621', 'Chili con carne': '\u062a\u0634\u064a\u0644\u064a \u0643\u0648\u0646 \u0643\u0627\u0631\u0646\u064a',
    'Lime': '\u0644\u064a\u0645', 'Sour cream': '\u0642\u0634\u0637\u0629 \u062d\u0627\u0645\u0636\u0629', 'Bell peppers': '\u0641\u0644\u0641\u0644 \u062d\u0644\u0648', 'Cucumber': '\u062e\u064a\u0627\u0631', 'Feta': '\u062c\u0628\u0646\u0629 \u0641\u064a\u062a\u0627',
  });

  // ── recipes (grocery lists only) — names align with the catalog so
  //    category / unit / emoji inference and translations mostly come free.
  window.RECIPES = [
    { id: 'tacos', name: 'Taco night', emoji: '\uD83C\uDF2E', ingredients: [
      { name: 'Tortillas' }, { name: 'Ground beef' }, { name: 'Cheddar' }, { name: 'Tomatoes' },
      { name: 'Onions' }, { name: 'Lime' }, { name: 'Sour cream' },
    ]},
    { id: 'salmon', name: 'Salmon dinner', emoji: '\uD83D\uDC1F', ingredients: [
      { name: 'Salmon' }, { name: 'Lemons' }, { name: 'Baby spinach' }, { name: 'Rice' }, { name: 'Garlic' },
    ]},
    { id: 'marinara', name: 'Pasta marinara', emoji: '\uD83C\uDF5D', ingredients: [
      { name: 'Pasta' }, { name: 'Diced tomatoes' }, { name: 'Garlic' }, { name: 'Onions' }, { name: 'Olive oil' },
    ]},
    { id: 'breakfast', name: 'Big breakfast', emoji: '\uD83C\uDF73', ingredients: [
      { name: 'Eggs' }, { name: 'Bacon' }, { name: 'Sourdough' }, { name: 'Butter' }, { name: 'Orange juice' },
    ]},
    { id: 'salad', name: 'Green salad', emoji: '\uD83E\uDD57', ingredients: [
      { name: 'Baby spinach' }, { name: 'Avocados' }, { name: 'Cucumber' }, { name: 'Feta' }, { name: 'Lemons' }, { name: 'Olive oil' },
    ]},
    { id: 'chili', name: 'Chili con carne', emoji: '\uD83C\uDF36\uFE0F', ingredients: [
      { name: 'Ground beef' }, { name: 'Black beans' }, { name: 'Diced tomatoes' }, { name: 'Onions' }, { name: 'Bell peppers' }, { name: 'Rice' },
    ]},
  ];
})();
