AgPerry commited on
Commit
09a1836
·
verified ·
1 Parent(s): 06cfa3d

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. tasks/llbean/environment/agent-browser/browser-use +128 -0
  2. tasks/llbean/environment/agent-browser/gateway.py +305 -0
  3. tasks/llbean/environment/candidate-abi/websitebench-candidate-preflight +5 -0
  4. tasks/llbean/environment/mailbox/Dockerfile +5 -0
  5. tasks/llbean/environment/mailbox/mailbox.py +2433 -0
  6. tasks/llbean/environment/reference/.websitebench-reference-tls/ca.crt +20 -0
  7. tasks/llbean/environment/reference/.websitebench-reference-tls/reference.crt +20 -0
  8. tasks/llbean/environment/reference/.websitebench-reference-tls/reference.key +28 -0
  9. tasks/llbean/environment/reference/.websitebench-reference-tls/tls_proxy.py +164 -0
  10. tasks/llbean/environment/reference/Dockerfile +19 -0
  11. tasks/llbean/environment/reference/README.md +5 -0
  12. tasks/llbean/environment/reference/backend/model.json +435 -0
  13. tasks/llbean/environment/reference/backend/runtime.json +73 -0
  14. tasks/llbean/environment/reference/clone/app.py +1404 -0
  15. tasks/llbean/environment/reference/clone/backend/catalog.py +714 -0
  16. tasks/llbean/environment/reference/clone/backend/repo.py +1098 -0
  17. tasks/llbean/environment/reference/clone/backend/site_backend_integration.py +112 -0
  18. tasks/llbean/environment/reference/clone/data/seed/categories.json +1178 -0
  19. tasks/llbean/environment/reference/clone/data/seed/category_facets.json +1082 -0
  20. tasks/llbean/environment/reference/clone/data/seed/category_tiles.json +477 -0
  21. tasks/llbean/environment/reference/clone/data/seed/content_pages.json +372 -0
  22. tasks/llbean/environment/reference/clone/data/seed/home.json +437 -0
  23. tasks/llbean/environment/reference/clone/data/seed/landers.json +734 -0
  24. tasks/llbean/environment/reference/clone/data/seed/nav_menu.json +1619 -0
  25. tasks/llbean/environment/reference/clone/data/seed/products.json +0 -0
  26. tasks/llbean/environment/reference/clone/frontend/static/css/site.css +819 -0
  27. tasks/llbean/environment/reference/clone/frontend/static/favicon.ico +0 -0
  28. tasks/llbean/environment/reference/clone/frontend/static/fonts.css +351 -0
  29. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuM2T7I_FMl_GW8g.woff2 +0 -0
  30. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuM3b7I_FMl_GW8g.woff2 +0 -0
  31. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMw77I_FMl_GW8g.woff2 +0 -0
  32. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwT7I_FMl_GW8g.woff2 +0 -0
  33. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwX7I_FMl_GW8g.woff2 +0 -0
  34. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwf7I_FMl_GW8g.woff2 +0 -0
  35. tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwr7I_FMl_E.woff2 +0 -0
  36. tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 +0 -0
  37. tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 +0 -0
  38. tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 +0 -0
  39. tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 +0 -0
  40. tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 +0 -0
  41. tasks/llbean/environment/reference/clone/frontend/templates/_account_nav.html +8 -0
  42. tasks/llbean/environment/reference/clone/frontend/templates/_macros.html +161 -0
  43. tasks/llbean/environment/reference/clone/frontend/templates/account.html +26 -0
  44. tasks/llbean/environment/reference/clone/frontend/templates/addresses.html +38 -0
  45. tasks/llbean/environment/reference/clone/frontend/templates/base.html +175 -0
  46. tasks/llbean/environment/reference/clone/frontend/templates/cart.html +119 -0
  47. tasks/llbean/environment/reference/clone/frontend/templates/catalog_request.html +19 -0
  48. tasks/llbean/environment/reference/clone/frontend/templates/catalog_settings.html +9 -0
  49. tasks/llbean/environment/reference/clone/frontend/templates/category.html +84 -0
  50. tasks/llbean/environment/reference/clone/frontend/templates/change_email.html +13 -0
tasks/llbean/environment/agent-browser/browser-use ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Forward the safe Browser Use CLI subset to the isolated browser sidecar."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import json
7
+ import os
8
+ import shutil
9
+ import sys
10
+ import urllib.error
11
+ import urllib.request
12
+ import uuid
13
+ from pathlib import Path
14
+
15
+
16
+ GATEWAY_URL = os.environ.get(
17
+ "WEBSITEBENCH_BROWSER_GATEWAY_URL",
18
+ "http://browser:9224/v1/command",
19
+ )
20
+ SHARED_ROOT = Path("/browser-share")
21
+
22
+
23
+ def _translate_candidate_origin(arguments: list[str]) -> list[str]:
24
+ public_origin = os.environ.get(
25
+ "WEBSITEBENCH_CANDIDATE_URL", "http://127.0.0.1:3000"
26
+ ).rstrip("/")
27
+ browser_origin = os.environ.get(
28
+ "WEBSITEBENCH_BROWSER_CANDIDATE_URL", "http://candidate:3000"
29
+ ).rstrip("/")
30
+ return [
31
+ browser_origin + value[len(public_origin) :]
32
+ if value == public_origin or value.startswith(public_origin + "/")
33
+ else value
34
+ for value in arguments
35
+ ]
36
+
37
+
38
+ def _command_index(arguments: list[str]) -> int | None:
39
+ index = 0
40
+ while index < len(arguments):
41
+ value = arguments[index]
42
+ if value in {"--session"}:
43
+ index += 2
44
+ continue
45
+ if value.startswith("--session=") or value == "--json":
46
+ index += 1
47
+ continue
48
+ if value in {"-h", "--help"}:
49
+ return None
50
+ if value.startswith("-"):
51
+ return index
52
+ return index
53
+ return None
54
+
55
+
56
+ def _prepare_screenshot(arguments: list[str]) -> tuple[list[str], Path | None, Path | None]:
57
+ forwarded = list(arguments)
58
+ command_index = _command_index(forwarded)
59
+ if command_index is None or forwarded[command_index] != "screenshot":
60
+ return forwarded, None, None
61
+
62
+ local_path: Path | None = None
63
+ path_index: int | None = None
64
+ for index in range(command_index + 1, len(forwarded)):
65
+ if forwarded[index] == "--path" and index + 1 < len(forwarded):
66
+ path_index = index + 1
67
+ local_path = Path(forwarded[path_index])
68
+ break
69
+ if not forwarded[index].startswith("-"):
70
+ path_index = index
71
+ local_path = Path(forwarded[path_index])
72
+ break
73
+ if local_path is None:
74
+ local_path = Path("screenshot.png")
75
+ forwarded.append(str(local_path))
76
+ path_index = len(forwarded) - 1
77
+
78
+ shared_path = SHARED_ROOT / f"screenshot-{uuid.uuid4().hex}.png"
79
+ assert path_index is not None
80
+ forwarded[path_index] = str(shared_path)
81
+ return forwarded, local_path, shared_path
82
+
83
+
84
+ def main() -> int:
85
+ translated = _translate_candidate_origin(sys.argv[1:])
86
+ arguments, local_screenshot, shared_screenshot = _prepare_screenshot(translated)
87
+ request = urllib.request.Request(
88
+ GATEWAY_URL,
89
+ data=json.dumps({"argv": arguments}, separators=(",", ":")).encode("utf-8"),
90
+ headers={"Content-Type": "application/json"},
91
+ method="POST",
92
+ )
93
+ try:
94
+ with urllib.request.urlopen(request, timeout=240) as response:
95
+ payload = json.load(response)
96
+ except urllib.error.HTTPError as exc:
97
+ try:
98
+ detail = json.loads(exc.read().decode("utf-8")).get("error")
99
+ except (UnicodeError, ValueError, AttributeError):
100
+ detail = None
101
+ print(detail or f"Browser Use gateway refused the command (HTTP {exc.code})", file=sys.stderr)
102
+ return 2
103
+ except (OSError, UnicodeError, ValueError) as exc:
104
+ print(f"Browser Use gateway unavailable: {exc}", file=sys.stderr)
105
+ return 2
106
+
107
+ stdout = payload.get("stdout", "")
108
+ stderr = payload.get("stderr", "")
109
+ if isinstance(stdout, str) and stdout:
110
+ print(stdout, end="" if stdout.endswith("\n") else "\n")
111
+ if isinstance(stderr, str) and stderr:
112
+ print(stderr, end="" if stderr.endswith("\n") else "\n", file=sys.stderr)
113
+
114
+ if local_screenshot is not None and shared_screenshot is not None:
115
+ try:
116
+ local_screenshot.parent.mkdir(parents=True, exist_ok=True)
117
+ shutil.copyfile(shared_screenshot, local_screenshot)
118
+ shared_screenshot.unlink(missing_ok=True)
119
+ except OSError as exc:
120
+ print(f"Browser screenshot transfer failed: {exc}", file=sys.stderr)
121
+ return 2
122
+
123
+ exit_code = payload.get("exit_code", 2)
124
+ return exit_code if isinstance(exit_code, int) and 0 <= exit_code <= 255 else 2
125
+
126
+
127
+ if __name__ == "__main__":
128
+ raise SystemExit(main())
tasks/llbean/environment/agent-browser/gateway.py ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Constrained Browser Use command gateway for browser-only references.
3
+
4
+ The gateway is the only process that joins the reference network. It exposes
5
+ interactive browser actions, but deliberately excludes arbitrary Python,
6
+ JavaScript evaluation, DOM serialization, cloud/tunnel commands, and direct
7
+ CDP attachment. The Agent container can inspect the rendered site without
8
+ obtaining a general-purpose HTTP path to its source responses.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import json
14
+ import os
15
+ import re
16
+ import subprocess
17
+ import threading
18
+ import urllib.parse
19
+ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
20
+ from pathlib import Path
21
+ from typing import Any
22
+
23
+
24
+ MAX_REQUEST_BYTES = 64 * 1024
25
+ MAX_OUTPUT_BYTES = 4 * 1024 * 1024
26
+ COMMAND_TIMEOUT_SEC = 180
27
+ SESSION_PATTERN = re.compile(r"[A-Za-z0-9][A-Za-z0-9_.-]{0,63}\Z")
28
+ SHARED_ROOT = Path("/browser-share").resolve()
29
+ REAL_BROWSER_USE = os.environ.get(
30
+ "WEBSITEBENCH_BROWSER_USE_REAL",
31
+ "/usr/local/bin/browser-use-real",
32
+ )
33
+ SAFE_COMMANDS = frozenset(
34
+ {
35
+ "open",
36
+ "click",
37
+ "type",
38
+ "input",
39
+ "scroll",
40
+ "back",
41
+ "screenshot",
42
+ "state",
43
+ "switch",
44
+ "close-tab",
45
+ "keys",
46
+ "select",
47
+ "hover",
48
+ "dblclick",
49
+ "rightclick",
50
+ "cookies",
51
+ "close",
52
+ "sessions",
53
+ }
54
+ )
55
+ FORBIDDEN_COMMANDS = frozenset(
56
+ {
57
+ "install",
58
+ "init",
59
+ "setup",
60
+ "doctor",
61
+ "upload",
62
+ "eval",
63
+ "extract",
64
+ "get",
65
+ "python",
66
+ "tunnel",
67
+ "cloud",
68
+ "profile",
69
+ "wait",
70
+ }
71
+ )
72
+ FORBIDDEN_GLOBAL_OPTIONS = frozenset(
73
+ {"--headed", "--profile", "--cdp-url", "--connect", "--mcp", "--template"}
74
+ )
75
+
76
+
77
+ class CommandRejected(ValueError):
78
+ """Raised when an Agent command crosses the browser-only boundary."""
79
+
80
+
81
+ def _origin(value: str) -> tuple[str, str, int]:
82
+ parsed = urllib.parse.urlsplit(value)
83
+ if parsed.scheme not in {"http", "https"} or not parsed.hostname:
84
+ raise ValueError(f"invalid browser origin: {value!r}")
85
+ port = parsed.port or (443 if parsed.scheme == "https" else 80)
86
+ return parsed.scheme, parsed.hostname.lower(), port
87
+
88
+
89
+ def allowed_origins() -> frozenset[tuple[str, str, int]]:
90
+ values = (
91
+ os.environ.get(
92
+ "WEBSITEBENCH_BROWSER_REFERENCE_URL", "https://reference:8080"
93
+ ),
94
+ os.environ.get(
95
+ "WEBSITEBENCH_BROWSER_CANDIDATE_URL", "http://candidate:3000"
96
+ ),
97
+ os.environ.get(
98
+ "WEBSITEBENCH_BROWSER_MAILBOX_URL", "http://mailbox:8026"
99
+ ),
100
+ )
101
+ return frozenset(_origin(value) for value in values)
102
+
103
+
104
+ def _parse_global_options(arguments: list[str]) -> tuple[str, int]:
105
+ session = "default"
106
+ index = 0
107
+ while index < len(arguments):
108
+ value = arguments[index]
109
+ if value == "--session":
110
+ if index + 1 >= len(arguments):
111
+ raise CommandRejected("--session requires a value")
112
+ session = arguments[index + 1]
113
+ index += 2
114
+ continue
115
+ if value.startswith("--session="):
116
+ session = value.partition("=")[2]
117
+ index += 1
118
+ continue
119
+ if value == "--json":
120
+ index += 1
121
+ continue
122
+ if value in {"-h", "--help"}:
123
+ break
124
+ if value in FORBIDDEN_GLOBAL_OPTIONS or any(
125
+ value.startswith(option + "=") for option in FORBIDDEN_GLOBAL_OPTIONS
126
+ ):
127
+ raise CommandRejected(f"Browser Use option {value!r} is disabled")
128
+ if value.startswith("-"):
129
+ raise CommandRejected(f"unsupported Browser Use option {value!r}")
130
+ break
131
+ if not SESSION_PATTERN.fullmatch(session):
132
+ raise CommandRejected("invalid Browser Use session name")
133
+ return session, index
134
+
135
+
136
+ def validate_command(raw_arguments: Any) -> list[str]:
137
+ if not isinstance(raw_arguments, list) or not raw_arguments:
138
+ raise CommandRejected("argv must be a non-empty string array")
139
+ if len(raw_arguments) > 128:
140
+ raise CommandRejected("too many Browser Use arguments")
141
+ arguments: list[str] = []
142
+ for value in raw_arguments:
143
+ if not isinstance(value, str) or "\x00" in value or len(value) > 16_384:
144
+ raise CommandRejected("invalid Browser Use argument")
145
+ arguments.append(value)
146
+
147
+ for value in arguments:
148
+ if value in FORBIDDEN_GLOBAL_OPTIONS or any(
149
+ value.startswith(option + "=") for option in FORBIDDEN_GLOBAL_OPTIONS
150
+ ):
151
+ raise CommandRejected(f"Browser Use option {value!r} is disabled")
152
+
153
+ _session, command_index = _parse_global_options(arguments)
154
+ if (
155
+ command_index == len(arguments) - 1
156
+ and arguments[command_index] in {"-h", "--help"}
157
+ ):
158
+ return arguments
159
+ if command_index >= len(arguments):
160
+ raise CommandRejected("missing Browser Use command")
161
+ command = arguments[command_index]
162
+ if command in FORBIDDEN_COMMANDS:
163
+ raise CommandRejected(
164
+ f"Browser Use command {command!r} is disabled for browser-only references"
165
+ )
166
+ if command not in SAFE_COMMANDS:
167
+ raise CommandRejected(f"unsupported Browser Use command {command!r}")
168
+
169
+ if command == "open":
170
+ urls = [
171
+ value
172
+ for value in arguments[command_index + 1 :]
173
+ if "://" in value
174
+ ]
175
+ if len(urls) != 1:
176
+ raise CommandRejected("open requires exactly one absolute URL")
177
+ try:
178
+ requested_origin = _origin(urls[0])
179
+ except (TypeError, ValueError) as exc:
180
+ raise CommandRejected(str(exc)) from exc
181
+ if requested_origin not in allowed_origins():
182
+ raise CommandRejected("browser navigation target is outside task origins")
183
+
184
+ if command == "screenshot":
185
+ # The bundled Browser Use CLI is `screenshot [--full] [path]`; accept the spellings
186
+ # agents reach for (`--full-page`, `--path X`, `--path=X`) and hand the CLI its own.
187
+ path_values: list[str] = []
188
+ options: list[str] = []
189
+ tail = arguments[command_index + 1 :]
190
+ index = 0
191
+ while index < len(tail):
192
+ value = tail[index]
193
+ if value == "--path":
194
+ if index + 1 >= len(tail):
195
+ raise CommandRejected("screenshot --path requires a value")
196
+ path_values.append(tail[index + 1])
197
+ index += 2
198
+ continue
199
+ if value.startswith("--path="):
200
+ path_values.append(value.partition("=")[2])
201
+ index += 1
202
+ continue
203
+ if value in {"--full", "--full-page"}:
204
+ if "--full" not in options:
205
+ options.append("--full")
206
+ index += 1
207
+ continue
208
+ if value in {"--json", "-h", "--help"}:
209
+ options.append(value)
210
+ index += 1
211
+ continue
212
+ if value.startswith("-"):
213
+ raise CommandRejected(f"unsupported screenshot option {value!r}")
214
+ path_values.append(value)
215
+ index += 1
216
+ paths = [Path(value).resolve() for value in path_values]
217
+ if (
218
+ len(paths) != 1
219
+ or paths[0].parent != SHARED_ROOT
220
+ or re.fullmatch(r"screenshot-[0-9a-f]{32}\.png", paths[0].name) is None
221
+ ):
222
+ raise CommandRejected("screenshots must use one gateway-owned PNG path")
223
+ return arguments[: command_index + 1] + options + [str(paths[0])]
224
+
225
+ return arguments
226
+
227
+
228
+ _COMMAND_LOCK = threading.Lock()
229
+
230
+
231
+ def execute(arguments: list[str]) -> dict[str, Any]:
232
+ with _COMMAND_LOCK:
233
+ try:
234
+ completed = subprocess.run(
235
+ [REAL_BROWSER_USE, *arguments],
236
+ stdin=subprocess.DEVNULL,
237
+ stdout=subprocess.PIPE,
238
+ stderr=subprocess.PIPE,
239
+ timeout=COMMAND_TIMEOUT_SEC,
240
+ check=False,
241
+ )
242
+ except subprocess.TimeoutExpired as exc:
243
+ raise CommandRejected("Browser Use command exceeded 180 seconds") from exc
244
+ except OSError as exc:
245
+ raise CommandRejected(f"Browser Use runtime unavailable: {exc}") from exc
246
+ stdout = completed.stdout[:MAX_OUTPUT_BYTES]
247
+ stderr = completed.stderr[:MAX_OUTPUT_BYTES]
248
+ if len(completed.stdout) > MAX_OUTPUT_BYTES or len(completed.stderr) > MAX_OUTPUT_BYTES:
249
+ raise CommandRejected("Browser Use output exceeded the interactive limit")
250
+ return {
251
+ "exit_code": completed.returncode,
252
+ "stdout": stdout.decode("utf-8", errors="replace"),
253
+ "stderr": stderr.decode("utf-8", errors="replace"),
254
+ }
255
+
256
+
257
+ class Handler(BaseHTTPRequestHandler):
258
+ server_version = "WebsiteBenchBrowserGateway/1"
259
+
260
+ def log_message(self, _format: str, *_arguments: object) -> None:
261
+ return
262
+
263
+ def _send(self, status: int, value: dict[str, Any]) -> None:
264
+ body = json.dumps(value, separators=(",", ":")).encode("utf-8")
265
+ self.send_response(status)
266
+ self.send_header("Content-Type", "application/json")
267
+ self.send_header("Content-Length", str(len(body)))
268
+ self.send_header("Cache-Control", "no-store")
269
+ self.end_headers()
270
+ self.wfile.write(body)
271
+
272
+ def do_GET(self) -> None:
273
+ if self.path == "/healthz":
274
+ self._send(200, {"status": "ok"})
275
+ else:
276
+ self._send(404, {"error": "not_found"})
277
+
278
+ def do_POST(self) -> None:
279
+ if self.path != "/v1/command":
280
+ self._send(404, {"error": "not_found"})
281
+ return
282
+ try:
283
+ length = int(self.headers.get("Content-Length", ""))
284
+ if length <= 0 or length > MAX_REQUEST_BYTES:
285
+ raise CommandRejected("invalid request size")
286
+ payload = json.loads(self.rfile.read(length))
287
+ if not isinstance(payload, dict) or set(payload) != {"argv"}:
288
+ raise CommandRejected("request must contain only argv")
289
+ result = execute(validate_command(payload["argv"]))
290
+ except (CommandRejected, json.JSONDecodeError, UnicodeError, ValueError) as exc:
291
+ self._send(400, {"error": str(exc)})
292
+ return
293
+ self._send(200, result)
294
+
295
+
296
+ def main() -> None:
297
+ bind = os.environ.get("WEBSITEBENCH_BROWSER_GATEWAY_BIND", "0.0.0.0")
298
+ port = int(os.environ.get("WEBSITEBENCH_BROWSER_GATEWAY_PORT", "9224"))
299
+ server = ThreadingHTTPServer((bind, port), Handler)
300
+ server.daemon_threads = True
301
+ server.serve_forever()
302
+
303
+
304
+ if __name__ == "__main__":
305
+ main()
tasks/llbean/environment/candidate-abi/websitebench-candidate-preflight ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+ PYTHONPATH=/opt/websitebench/candidate-abi
4
+ export PYTHONPATH
5
+ exec python3 -m websitebench.harbor.candidate_preflight "$@"
tasks/llbean/environment/mailbox/Dockerfile ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ FROM python:3.12.11-slim-bookworm@sha256:519591d6871b7bc437060736b9f7456b8731f1499a57e22e6c285135ae657bf7
2
+ WORKDIR /srv/mailbox
3
+ COPY mailbox.py .
4
+ HEALTHCHECK --interval=2s --timeout=2s --retries=30 CMD python -c "import os,urllib.request as r;a=os.environ.get('WEBSITEBENCH_MAILBOX_API_BIND') or '127.0.0.1';i=os.environ.get('WEBSITEBENCH_MAILBOX_INBOX_BIND') or '127.0.0.1';r.urlopen(f'http://{a}:8025/healthz',timeout=1);r.urlopen(f'http://{i}:8026/healthz',timeout=1)"
5
+ CMD ["python", "mailbox.py", "--smtp-port", "1025", "--http-port", "8025", "--inbox-port", "8026"]
tasks/llbean/environment/mailbox/mailbox.py ADDED
@@ -0,0 +1,2433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Local-only mail writers plus Inbox HTTP sidecar for deterministic tasks.
2
+
3
+ The sidecar serves two disjoint listeners so the agent and the evaluator never
4
+ share a surface:
5
+
6
+ ``api``
7
+ The Bearer-gated JSON API plus ``/internal/bootstrap``. The reference site
8
+ and the evaluator reach it; it is where every capability lives.
9
+ ``inbox``
10
+ An HTML-only inbox for exactly one namespace, reachable without a
11
+ credential because a browser has none to present. It exposes no JSON, no
12
+ capability, and no way to name a second namespace.
13
+
14
+ Formal candidates receive a separate per-case write listener. Its primary
15
+ surface is a text-only Resend-style ``POST /emails`` API; legacy SMTP and the
16
+ ``websitebench.site_backend`` bootstrap remain compatibility writers. None of
17
+ those surfaces exposes an inbox or a JSON read route.
18
+
19
+ This module is copied *alone* into the mailbox container build context, so it
20
+ must stay self-contained: no imports outside the standard library.
21
+ """
22
+
23
+ from __future__ import annotations
24
+
25
+ import email
26
+ import hashlib
27
+ import hmac
28
+ import html
29
+ import http.client
30
+ import json
31
+ import os
32
+ import re
33
+ import secrets
34
+ import shutil
35
+ import socket
36
+ import socketserver
37
+ import signal
38
+ import subprocess
39
+ import sys
40
+ import tempfile
41
+ import threading
42
+ import time
43
+ import urllib.parse
44
+ from collections.abc import Mapping
45
+ from dataclasses import dataclass, field, replace
46
+ from email.message import EmailMessage
47
+ from email.policy import default
48
+ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
49
+ from typing import Any
50
+
51
+
52
+ _NAMESPACE = re.compile(r"^[a-zA-Z0-9._-]{1,160}$")
53
+ _OTP = re.compile(r"(?<!\d)(\d{4,8})(?!\d)")
54
+ _MAX_MESSAGE_BYTES = 1024 * 1024
55
+ _MAX_MESSAGES_PER_NAMESPACE = 32
56
+ _MAX_STORED_BYTES_PER_NAMESPACE = 2 * 1024 * 1024
57
+ _MAX_RECIPIENTS = 16
58
+ _MAX_COMMANDS_PER_CONNECTION = 256
59
+ _CONNECTION_TIMEOUT_SECONDS = 10
60
+ _MAX_CONNECTION_LIFETIME_SECONDS = 30
61
+ _MAX_CONCURRENT_CONNECTIONS = 16
62
+ MAILPIT_IMAGE = (
63
+ "ghcr.io/axllent/mailpit:v1.30.6@"
64
+ "sha256:7f33095f80e901f6ad08028f06ca284aa58fe84942be5496008d041d3b9f4d4d"
65
+ )
66
+ #: The one variable that names the Mailpit a trial or capture must use. It is
67
+ #: read in exactly one place, :meth:`MailPlane.from_environment`.
68
+ MAILPIT_HTTP_SOCKET_ENV = "WEBSITEBENCH_MAILPIT_HTTP_SOCKET"
69
+ #: Where Mailpit's private sockets live inside the compose sidecar. A value
70
+ #: mentioning this path in a candidate environment is an evaluator-side leak.
71
+ MAILPIT_RUNTIME_DIR = "/run/websitebench-mailpit"
72
+ #: The envelope sender every benchmark mail writer presents. Some captured
73
+ #: runtimes pin this exact suffix before opening SMTP, so paired capture and a
74
+ #: scored candidate trial must agree on it to the byte.
75
+ CANDIDATE_MAIL_SENDER = "no-reply@candidate.websitebench.local"
76
+ #: The complete optional mail ABI a candidate runtime may be handed. Nothing
77
+ #: outside this set ever reaches a candidate process.
78
+ CANDIDATE_MAIL_ENVIRONMENT = frozenset(
79
+ {
80
+ "WEBSITEBENCH_MAIL_API_URL",
81
+ "WEBSITEBENCH_MAIL_API_TOKEN",
82
+ "WEBSITEBENCH_MAIL_FROM",
83
+ "WEBSITEBENCH_SMTP_HOST",
84
+ "WEBSITEBENCH_SMTP_PORT",
85
+ "WEBSITEBENCH_SMTP_FROM",
86
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL",
87
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN",
88
+ }
89
+ )
90
+ #: Every mail variable an authoring capture exports into its own process, so
91
+ #: capture can save and restore exactly this set around a shard.
92
+ AUTHORING_MAIL_ENVIRONMENT = (
93
+ "WEBSITEBENCH_MAIL_API_URL",
94
+ "WEBSITEBENCH_MAIL_API_TOKEN",
95
+ "WEBSITEBENCH_MAIL_FROM",
96
+ "WEBSITEBENCH_SMTP_FROM",
97
+ "WEBSITEBENCH_MAILBOX_URL",
98
+ "WEBSITEBENCH_MAILBOX_ALLOWLIST",
99
+ "WEBSITEBENCH_MAILBOX_NAMESPACE",
100
+ "WEBSITEBENCH_SMTP_HOST",
101
+ "WEBSITEBENCH_SMTP_PORT",
102
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL",
103
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN",
104
+ "WEBSITEBENCH_MAILBOX_CREDENTIAL",
105
+ )
106
+ _LOG_SECRET = re.compile(
107
+ r"(?i)(?:bearer\s+[^\s\"']+|"
108
+ r"(?:authorization|cookie|credential|password|secret|token|otp|"
109
+ r"verification[-_ ]?code|card[-_ ]?number)\s*[:=]\s*"
110
+ r"(?:bearer\s+)?[^\s,;]+)"
111
+ )
112
+
113
+
114
+ class MailpitInfrastructureError(RuntimeError):
115
+ """Mailpit is missing or unhealthy, as distinct from rejected candidate mail."""
116
+
117
+
118
+ class MailInfrastructureUnavailable(MailpitInfrastructureError):
119
+ """No Mailpit is configured for this process, or the configured one is down."""
120
+
121
+
122
+ class MailboxCapacityError(RuntimeError):
123
+ """A namespace exhausted its fixed message or submitted-byte quota."""
124
+
125
+
126
+ class _UnixHTTPConnection(http.client.HTTPConnection):
127
+ """A minimal HTTP/1.1 connection transported over one Unix socket."""
128
+
129
+ def __init__(self, socket_path: str, timeout: float) -> None:
130
+ super().__init__("localhost", timeout=timeout)
131
+ self._socket_path = socket_path
132
+
133
+ def connect(self) -> None:
134
+ connection = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
135
+ connection.settimeout(self.timeout)
136
+ connection.connect(self._socket_path)
137
+ self.sock = connection
138
+
139
+
140
+ class MailpitClient:
141
+ """Trusted Mailpit client: HTTP UDS reads and sibling SMTP UDS writes.
142
+
143
+ This is intentionally not a general Mailpit client. It never exposes the
144
+ UI, delete, release, tag-mutation, or remote-content endpoints. All
145
+ candidate-authored control headers are discarded and the SMTP writer adds
146
+ exactly one trusted tag.
147
+ """
148
+
149
+ _MAX_RESPONSE_BYTES = 8 * 1024 * 1024
150
+
151
+ def __init__(
152
+ self,
153
+ socket_path: str | os.PathLike[str],
154
+ *,
155
+ smtp_socket_path: str | os.PathLike[str] | None = None,
156
+ timeout: float = 5.0,
157
+ ) -> None:
158
+ self.socket_path = os.fspath(socket_path)
159
+ if not self.socket_path:
160
+ raise ValueError("Mailpit HTTP socket path must not be empty")
161
+ if timeout <= 0:
162
+ raise ValueError("Mailpit timeout must be positive")
163
+ self.smtp_socket_path = (
164
+ os.fspath(smtp_socket_path)
165
+ if smtp_socket_path is not None
166
+ else os.path.join(os.path.dirname(self.socket_path), "smtp.sock")
167
+ )
168
+ self.timeout = float(timeout)
169
+
170
+ def _request(
171
+ self, method: str, path: str, body: dict[str, Any] | None = None
172
+ ) -> tuple[int, bytes]:
173
+ encoded = None if body is None else json.dumps(body).encode("utf-8")
174
+ headers = {"Accept": "application/json", "Connection": "close"}
175
+ if encoded is not None:
176
+ headers["Content-Type"] = "application/json"
177
+ headers["Content-Length"] = str(len(encoded))
178
+ connection = _UnixHTTPConnection(self.socket_path, self.timeout)
179
+ try:
180
+ connection.request(method, path, body=encoded, headers=headers)
181
+ response = connection.getresponse()
182
+ length = response.getheader("Content-Length")
183
+ if length is not None and int(length) > self._MAX_RESPONSE_BYTES:
184
+ raise MailpitInfrastructureError("Mailpit response exceeded limit")
185
+ value = response.read(self._MAX_RESPONSE_BYTES + 1)
186
+ if len(value) > self._MAX_RESPONSE_BYTES:
187
+ raise MailpitInfrastructureError("Mailpit response exceeded limit")
188
+ return int(response.status), value
189
+ except (OSError, TimeoutError, http.client.HTTPException, ValueError) as error:
190
+ raise MailpitInfrastructureError(
191
+ f"Mailpit request failed: {redact_text(str(error))}"
192
+ ) from error
193
+ finally:
194
+ connection.close()
195
+
196
+ def _json(
197
+ self, method: str, path: str, body: dict[str, Any] | None = None
198
+ ) -> dict[str, Any]:
199
+ status, raw = self._request(method, path, body)
200
+ if not 200 <= status < 300:
201
+ raise MailpitInfrastructureError(f"Mailpit API returned HTTP {status}")
202
+ try:
203
+ value = json.loads(raw)
204
+ except (UnicodeDecodeError, json.JSONDecodeError) as error:
205
+ raise MailpitInfrastructureError("Mailpit returned invalid JSON") from error
206
+ if not isinstance(value, dict):
207
+ raise MailpitInfrastructureError("Mailpit returned an invalid response")
208
+ return value
209
+
210
+ def ready(self) -> bool:
211
+ """Return whether Mailpit's built-in readiness endpoint is healthy."""
212
+
213
+ try:
214
+ status, _body = self._request("GET", "/readyz")
215
+ except MailpitInfrastructureError:
216
+ return False
217
+ return status == 200
218
+
219
+ def send(
220
+ self,
221
+ raw: bytes,
222
+ envelope_from: str,
223
+ recipients: list[str],
224
+ *,
225
+ tag: str,
226
+ ) -> str:
227
+ """Store mail with one trusted tag, ignoring all untrusted X-headers."""
228
+
229
+ if any(
230
+ "\r" in value or "\n" in value for value in [envelope_from, *recipients]
231
+ ):
232
+ raise ValueError("invalid SMTP envelope")
233
+ message = email.message_from_bytes(raw, policy=default)
234
+ for part in message.walk():
235
+ for header in list(part.keys()):
236
+ lowered = header.lower()
237
+ if lowered == "x-tags" or lowered.startswith("x-websitebench-"):
238
+ del part[header]
239
+ for header in ("From", "To", "Cc", "Bcc"):
240
+ if message.get(header) is not None:
241
+ del message[header]
242
+ message["From"] = envelope_from
243
+ message["To"] = ", ".join(recipients)
244
+ message["X-Tags"] = tag
245
+ wire = message.as_bytes(policy=default.clone(linesep="\r\n"))
246
+
247
+ connection = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
248
+ connection.settimeout(self.timeout)
249
+ stream = None
250
+ try:
251
+ connection.connect(self.smtp_socket_path)
252
+ stream = connection.makefile("rb")
253
+
254
+ def response() -> tuple[int, str]:
255
+ lines: list[str] = []
256
+ while True:
257
+ line = stream.readline(65537)
258
+ if not line or len(line) > 65536:
259
+ raise MailpitInfrastructureError(
260
+ "invalid Mailpit SMTP response"
261
+ )
262
+ decoded = line.decode("utf-8", "replace").rstrip("\r\n")
263
+ lines.append(decoded)
264
+ if len(decoded) < 4 or decoded[3:4] != "-":
265
+ break
266
+ try:
267
+ return int(lines[-1][:3]), "\n".join(lines)
268
+ except ValueError as error:
269
+ raise MailpitInfrastructureError(
270
+ "invalid Mailpit SMTP status"
271
+ ) from error
272
+
273
+ def command(value: bytes, expected: set[int]) -> str:
274
+ connection.sendall(value + b"\r\n")
275
+ status, reply = response()
276
+ if status not in expected:
277
+ raise MailpitInfrastructureError(
278
+ f"Mailpit SMTP returned status {status}: "
279
+ f"{redact_text(reply)[:200]}"
280
+ )
281
+ return reply
282
+
283
+ status, _greeting = response()
284
+ if status != 220:
285
+ raise MailpitInfrastructureError(
286
+ "Mailpit SMTP did not greet the gateway"
287
+ )
288
+ command(b"EHLO websitebench.local", {250})
289
+ command(f"MAIL FROM:<{envelope_from}>".encode("utf-8"), {250})
290
+ for recipient in recipients:
291
+ command(f"RCPT TO:<{recipient}>".encode("utf-8"), {250})
292
+ command(b"DATA", {354})
293
+ stuffed = b"\r\n".join(
294
+ (b"." + line if line.startswith(b".") else line)
295
+ for line in wire.split(b"\r\n")
296
+ )
297
+ connection.sendall(stuffed + b"\r\n.\r\n")
298
+ status, reply = response()
299
+ if status != 250:
300
+ raise MailpitInfrastructureError(
301
+ f"Mailpit SMTP returned status {status}: {redact_text(reply)[:200]}"
302
+ )
303
+ match = re.search(r"queued as ([A-Za-z0-9_-]+)", reply)
304
+ return match.group(1) if match else hashlib.sha256(wire).hexdigest()[:24]
305
+ except (OSError, TimeoutError) as error:
306
+ raise MailpitInfrastructureError("Mailpit SMTP request failed") from error
307
+ finally:
308
+ if stream is not None:
309
+ stream.close()
310
+ connection.close()
311
+
312
+ @staticmethod
313
+ def _addresses(value: Any) -> list[str]:
314
+ if not isinstance(value, list):
315
+ return []
316
+ return [
317
+ str(item.get("Address", item.get("Email")))
318
+ for item in value
319
+ if isinstance(item, dict)
320
+ and isinstance(item.get("Address", item.get("Email")), str)
321
+ ]
322
+
323
+ def messages(self, *, tag: str, recipient: str) -> list[dict[str, Any]]:
324
+ """Read only exact-tag, exact-recipient messages, oldest first."""
325
+
326
+ query = urllib.parse.urlencode(
327
+ {"query": f"tag:{tag}", "start": "0", "limit": "512"}
328
+ )
329
+ listing = self._json("GET", f"/api/v1/search?{query}")
330
+ summaries = listing.get("messages", [])
331
+ if not isinstance(summaries, list):
332
+ raise MailpitInfrastructureError(
333
+ "Mailpit returned invalid message summaries"
334
+ )
335
+ values: list[dict[str, Any]] = []
336
+ for summary in reversed(summaries):
337
+ if not isinstance(summary, dict):
338
+ continue
339
+ tags = summary.get("Tags", [])
340
+ all_recipients = (
341
+ self._addresses(summary.get("To"))
342
+ + self._addresses(summary.get("Cc"))
343
+ + self._addresses(summary.get("Bcc"))
344
+ )
345
+ identifier = summary.get("ID")
346
+ if (
347
+ tag not in tags
348
+ or recipient not in all_recipients
349
+ or not isinstance(identifier, str)
350
+ ):
351
+ continue
352
+ detail = self._json(
353
+ "GET", "/api/v1/message/" + urllib.parse.quote(identifier, safe="")
354
+ )
355
+ # Recheck authorization against the detailed record. Search is an
356
+ # index, never an authorization decision.
357
+ detail_tags = detail.get("Tags", [])
358
+ detailed_recipients = (
359
+ self._addresses(detail.get("To"))
360
+ + self._addresses(detail.get("Cc"))
361
+ + self._addresses(detail.get("Bcc"))
362
+ )
363
+ if tag not in detail_tags or recipient not in detailed_recipients:
364
+ continue
365
+ sender = detail.get("From", {})
366
+ attachments = detail.get("Attachments", [])
367
+ inline = detail.get("Inline", [])
368
+ metadata = [
369
+ *(attachments if isinstance(attachments, list) else []),
370
+ *(inline if isinstance(inline, list) else []),
371
+ ]
372
+ values.append(
373
+ {
374
+ "mailpit_id": identifier,
375
+ "envelope_from": str(sender.get("Address", sender.get("Email", "")))
376
+ if isinstance(sender, dict)
377
+ else "",
378
+ "recipients": detailed_recipients,
379
+ "subject": str(detail.get("Subject", "")),
380
+ "text": str(detail.get("Text", "")),
381
+ "attachments": metadata,
382
+ "stored_bytes": int(detail.get("Size", 0)),
383
+ }
384
+ )
385
+ for index, item in enumerate(values, 1):
386
+ item["id"] = index
387
+ match = _OTP.search(str(item["text"]))
388
+ item["otp"] = match.group(1) if match else None
389
+ return values
390
+
391
+
392
+ @dataclass
393
+ class MailAccount:
394
+ """Internal ``websitebench.mail-account.v1`` logical account."""
395
+
396
+ account_id: str
397
+ tag: str
398
+ address: str
399
+ role: str
400
+ allowed_from: set[str]
401
+ allowed_to: set[str]
402
+ send_capability: str = field(repr=False)
403
+ read_capability: str = field(repr=False)
404
+ state: str = "active"
405
+ schema: str = field(default="websitebench.mail-account.v1", init=False)
406
+
407
+
408
+ class MailAccountBroker:
409
+ """Authorize logical accounts before calling the untrusted storage engine."""
410
+
411
+ _SEND_ROLES = frozenset(
412
+ {
413
+ "reference-backend",
414
+ "formal-candidate",
415
+ "capture-writer",
416
+ "gateway",
417
+ "selfhost-pair",
418
+ "formal-pair",
419
+ "capture-pair",
420
+ }
421
+ )
422
+ _READ_ROLES = frozenset(
423
+ {
424
+ "agent",
425
+ "formal-verifier",
426
+ "capture-reader",
427
+ "gateway",
428
+ "selfhost-pair",
429
+ "formal-pair",
430
+ "capture-pair",
431
+ }
432
+ )
433
+ _ROLES = _SEND_ROLES | _READ_ROLES
434
+
435
+ def __init__(self, client: MailpitClient) -> None:
436
+ self.client = client
437
+ self._accounts: dict[str, MailAccount] = {}
438
+ self._lock = threading.Lock()
439
+
440
+ def create_account(
441
+ self,
442
+ *,
443
+ address: str,
444
+ role: str,
445
+ allowed_from: Any = (),
446
+ allowed_to: Any = (),
447
+ ) -> MailAccount:
448
+ if address and ("@" not in address or "\r" in address or "\n" in address):
449
+ raise ValueError("invalid mail account address")
450
+ if role not in self._ROLES:
451
+ raise ValueError("invalid mail account role")
452
+ account = MailAccount(
453
+ account_id="acct_" + secrets.token_hex(24),
454
+ tag="wb-" + secrets.token_hex(24),
455
+ address=address,
456
+ role=role,
457
+ allowed_from=set(allowed_from),
458
+ allowed_to=set(allowed_to) | ({address} if address else set()),
459
+ send_capability="send_" + secrets.token_hex(32),
460
+ read_capability="read_" + secrets.token_hex(32),
461
+ )
462
+ with self._lock:
463
+ self._accounts[account.account_id] = account
464
+ return account
465
+
466
+ def _account(self, account_id: str) -> MailAccount:
467
+ with self._lock:
468
+ account = self._accounts.get(account_id)
469
+ if account is None or account.state == "destroyed":
470
+ raise PermissionError("mail account is unavailable")
471
+ return account
472
+
473
+ def send(
474
+ self,
475
+ account_id: str,
476
+ capability: str,
477
+ raw: bytes,
478
+ envelope_from: str,
479
+ recipients: list[str],
480
+ ) -> str:
481
+ account = self._account(account_id)
482
+ if (
483
+ account.role not in self._SEND_ROLES
484
+ or account.state != "active"
485
+ or not hmac.compare_digest(account.send_capability, capability)
486
+ ):
487
+ raise PermissionError("mail account cannot send")
488
+ if (
489
+ not envelope_from
490
+ or "@" not in envelope_from
491
+ or "\r" in envelope_from
492
+ or "\n" in envelope_from
493
+ or not 1 <= len(recipients) <= _MAX_RECIPIENTS
494
+ or len(raw) > _MAX_MESSAGE_BYTES
495
+ or any(
496
+ not recipient
497
+ or len(recipient) > 320
498
+ or "@" not in recipient
499
+ or "\r" in recipient
500
+ or "\n" in recipient
501
+ for recipient in recipients
502
+ )
503
+ ):
504
+ raise PermissionError("mail envelope is not allowed")
505
+ if account.allowed_from and envelope_from not in account.allowed_from:
506
+ raise PermissionError("mail sender is not allowed")
507
+ learn_recipients = account.role == "gateway" or not account.allowed_to
508
+ if account.role != "gateway" and account.allowed_to and any(
509
+ value not in account.allowed_to for value in recipients
510
+ ):
511
+ raise PermissionError("mail recipient is not allowed")
512
+ provider_id = self.client.send(raw, envelope_from, recipients, tag=account.tag)
513
+ if learn_recipients:
514
+ # A trial can legitimately exercise more than one authentication
515
+ # address. Namespace-scoped gateway accounts therefore learn every
516
+ # address from a Mailpit-accepted envelope; reads remain limited to
517
+ # those exact delivered addresses and still require the capability.
518
+ with self._lock:
519
+ account.allowed_to.update(recipients)
520
+ if not account.address and recipients:
521
+ account.address = recipients[0]
522
+ return provider_id
523
+
524
+ def messages(
525
+ self, account_id: str, capability: str, recipient: str | None = None
526
+ ) -> list[dict[str, Any]]:
527
+ account = self._account(account_id)
528
+ if account.role not in self._READ_ROLES or not hmac.compare_digest(
529
+ account.read_capability, capability
530
+ ):
531
+ raise PermissionError("mail account cannot read")
532
+ with self._lock:
533
+ allowed_to = set(account.allowed_to)
534
+ # SMTP delivery is asynchronous. A verifier can legitimately poll the
535
+ # exact recipient before the writer has learned its first envelope. An
536
+ # empty account therefore means "not delivered yet", not "forbidden".
537
+ # Once the first envelope arrives, the usual exact-recipient boundary
538
+ # applies and a different address is still rejected.
539
+ if recipient is not None and not allowed_to:
540
+ return []
541
+ targets = [recipient] if recipient is not None else sorted(allowed_to)
542
+ if any(target not in allowed_to for target in targets):
543
+ raise PermissionError("mail recipient is not allowed")
544
+ combined: dict[str, dict[str, Any]] = {}
545
+ for target in targets:
546
+ for message in self.client.messages(tag=account.tag, recipient=target):
547
+ combined[str(message["mailpit_id"])] = message
548
+ values = list(combined.values())
549
+ for index, item in enumerate(values, 1):
550
+ item["id"] = index
551
+ return values
552
+
553
+ def seal(self, account_id: str) -> None:
554
+ account = self._account(account_id)
555
+ with self._lock:
556
+ account.state = "sealed"
557
+
558
+ def destroy(self, account_id: str) -> None:
559
+ account = self._account(account_id)
560
+ with self._lock:
561
+ account.state = "destroyed"
562
+
563
+
564
+ class EphemeralMailpit:
565
+ """One pinned, networkless Mailpit container with a private UDS directory."""
566
+
567
+ def __init__(
568
+ self,
569
+ runtime_dir: str | os.PathLike[str] | None = None,
570
+ *,
571
+ docker_binary: str = "docker",
572
+ startup_timeout: float = 45.0,
573
+ ) -> None:
574
+ if startup_timeout <= 0:
575
+ raise ValueError("startup timeout must be positive")
576
+ self._owns_runtime_dir = runtime_dir is None
577
+ self.runtime_dir = (
578
+ tempfile.mkdtemp(prefix="websitebench-mailpit-")
579
+ if runtime_dir is None
580
+ else os.path.abspath(os.fspath(runtime_dir))
581
+ )
582
+ os.makedirs(self.runtime_dir, mode=0o700, exist_ok=True)
583
+ os.chmod(self.runtime_dir, 0o700)
584
+ self.docker_binary = docker_binary
585
+ self.startup_timeout = float(startup_timeout)
586
+ self.container_name = "websitebench-mailpit-" + secrets.token_hex(12)
587
+ self.client = MailpitClient(os.path.join(self.runtime_dir, "http.sock"))
588
+ self._process: subprocess.Popen[bytes] | None = None
589
+
590
+ def _uses_rootless_podman(self) -> bool:
591
+ """Detect the Podman Docker shim that needs the host uid preserved."""
592
+
593
+ try:
594
+ result = subprocess.run(
595
+ [self.docker_binary, "info"],
596
+ stdin=subprocess.DEVNULL,
597
+ stdout=subprocess.PIPE,
598
+ stderr=subprocess.STDOUT,
599
+ text=True,
600
+ timeout=5,
601
+ check=False,
602
+ )
603
+ except (OSError, subprocess.TimeoutExpired):
604
+ return False
605
+ output = result.stdout.casefold()
606
+ return result.returncode == 0 and "podman" in output and "rootless" in output
607
+
608
+ def start(self) -> "EphemeralMailpit":
609
+ if self._process is not None:
610
+ return self
611
+ command = [
612
+ self.docker_binary,
613
+ "run",
614
+ "--rm",
615
+ "--name",
616
+ self.container_name,
617
+ ]
618
+ if self._uses_rootless_podman():
619
+ command.append("--userns=keep-id")
620
+ command.extend(
621
+ [
622
+ "--user",
623
+ f"{os.getuid()}:{os.getgid()}",
624
+ "--network",
625
+ "none",
626
+ "--tmpfs",
627
+ "/tmp:rw,noexec,nosuid,nodev,size=64m",
628
+ "--mount",
629
+ f"type=bind,src={self.runtime_dir},dst=/run/websitebench-mailpit",
630
+ ]
631
+ )
632
+ settings = {
633
+ "MP_UI_BIND_ADDR": "unix:/run/websitebench-mailpit/http.sock:660",
634
+ "MP_SMTP_BIND_ADDR": "unix:/run/websitebench-mailpit/smtp.sock:660",
635
+ "MP_DATABASE": "/tmp/mailpit.db",
636
+ "MP_MAX_MESSAGES": "512",
637
+ "MP_MAX_MESSAGE_SIZE": "1",
638
+ "MP_SMTP_MAX_RECIPIENTS": "16",
639
+ "MP_POP3_BIND_ADDR": "",
640
+ "MP_POP3_AUTH_FILE": "",
641
+ "MP_SMTP_RELAY_CONFIG": "",
642
+ "MP_SMTP_RELAY_ALL": "false",
643
+ "MP_SMTP_FORWARD_CONFIG": "",
644
+ "MP_WEBHOOK_URL": "",
645
+ "MP_ENABLE_CHAOS": "false",
646
+ "MP_ENABLE_PROMETHEUS": "false",
647
+ "MP_DISABLE_VERSION_CHECK": "true",
648
+ "MP_BLOCK_REMOTE_CSS_AND_FONTS": "true",
649
+ "MP_ALLOW_INTERNAL_HTTP_REQUESTS": "false",
650
+ }
651
+ for key, value in settings.items():
652
+ command.extend(("--env", f"{key}={value}"))
653
+ command.append(MAILPIT_IMAGE)
654
+ try:
655
+ self._process = subprocess.Popen(
656
+ command,
657
+ stdin=subprocess.DEVNULL,
658
+ stdout=subprocess.DEVNULL,
659
+ stderr=subprocess.DEVNULL,
660
+ )
661
+ except OSError as error:
662
+ self.close()
663
+ raise MailpitInfrastructureError(
664
+ "Docker is unavailable for Mailpit"
665
+ ) from error
666
+ deadline = time.monotonic() + self.startup_timeout
667
+ while time.monotonic() < deadline:
668
+ if self._process.poll() is not None:
669
+ self.close()
670
+ raise MailpitInfrastructureError(
671
+ "Mailpit container exited during startup"
672
+ )
673
+ if self.client.ready():
674
+ return self
675
+ time.sleep(0.1)
676
+ self.close()
677
+ raise MailpitInfrastructureError("Mailpit did not become ready")
678
+
679
+ def close(self) -> None:
680
+ process, self._process = self._process, None
681
+ if process is not None and process.poll() is None:
682
+ try:
683
+ subprocess.run(
684
+ [self.docker_binary, "stop", "--time", "3", self.container_name],
685
+ stdin=subprocess.DEVNULL,
686
+ stdout=subprocess.DEVNULL,
687
+ stderr=subprocess.DEVNULL,
688
+ timeout=8,
689
+ check=False,
690
+ )
691
+ except (OSError, subprocess.TimeoutExpired):
692
+ process.terminate()
693
+ try:
694
+ process.wait(timeout=5)
695
+ except subprocess.TimeoutExpired:
696
+ process.kill()
697
+ process.wait(timeout=5)
698
+ if self._owns_runtime_dir:
699
+ shutil.rmtree(self.runtime_dir, ignore_errors=True)
700
+ else:
701
+ for name in ("http.sock", "smtp.sock"):
702
+ try:
703
+ os.unlink(os.path.join(self.runtime_dir, name))
704
+ except FileNotFoundError:
705
+ pass
706
+
707
+ def __enter__(self) -> "EphemeralMailpit":
708
+ return self.start()
709
+
710
+ def __exit__(self, exc_type: object, exc: object, traceback: object) -> None:
711
+ self.close()
712
+
713
+
714
+ def redact_text(value: str) -> str:
715
+ """Redact secret-like log fragments without retaining the matched value."""
716
+
717
+ return _LOG_SECRET.sub("[REDACTED]", value)
718
+
719
+
720
+ def redact_log_file(path: str) -> None:
721
+ """Sanitize one UTF-8 verifier log in place before it is published."""
722
+
723
+ from pathlib import Path
724
+
725
+ target = Path(path)
726
+ if not target.is_file():
727
+ return
728
+ value = target.read_text(encoding="utf-8", errors="replace")
729
+ target.write_text(redact_text(value), encoding="utf-8", newline="\n")
730
+
731
+
732
+ def redact_evidence(value: Any) -> Any:
733
+ """Remove credentials and sensitive form values from retained evidence."""
734
+
735
+ sensitive = re.compile(
736
+ r"(?:authorization|cookie|credential|password|secret|token|otp|code|payment|card)",
737
+ re.IGNORECASE,
738
+ )
739
+ if isinstance(value, dict):
740
+ return {
741
+ str(key): "[REDACTED]"
742
+ if sensitive.search(str(key))
743
+ else redact_evidence(child)
744
+ for key, child in value.items()
745
+ }
746
+ if isinstance(value, list):
747
+ return [redact_evidence(child) for child in value]
748
+ return value
749
+
750
+
751
+ @dataclass
752
+ class MailboxStore:
753
+ mailpit_client: MailpitClient
754
+ _capabilities: dict[str, str] = field(default_factory=dict)
755
+ _idempotency: dict[tuple[str, str], str] = field(default_factory=dict)
756
+ _namespace_message_counts: dict[str, int] = field(default_factory=dict)
757
+ _namespace_stored_bytes: dict[str, int] = field(default_factory=dict)
758
+ _lock: threading.Lock = field(default_factory=threading.Lock)
759
+ _broker: MailAccountBroker = field(init=False)
760
+ _accounts: dict[str, MailAccount] = field(default_factory=dict, init=False)
761
+
762
+ def __post_init__(self) -> None:
763
+ if not isinstance(self.mailpit_client, MailpitClient):
764
+ raise MailpitInfrastructureError("Mailpit client is required")
765
+ self._broker = MailAccountBroker(self.mailpit_client)
766
+
767
+ def healthy(self) -> bool:
768
+ return self.mailpit_client.ready()
769
+
770
+ def register(
771
+ self,
772
+ namespace: str,
773
+ capability: str,
774
+ *,
775
+ allowed_from: tuple[str, ...] = (),
776
+ ) -> None:
777
+ if not _NAMESPACE.fullmatch(namespace) or len(capability) < 32:
778
+ raise ValueError("invalid mailbox namespace capability")
779
+ if any(
780
+ not value or "@" not in value or "\r" in value or "\n" in value
781
+ for value in allowed_from
782
+ ):
783
+ raise ValueError("invalid allowed mail sender")
784
+ allowed_senders = set(allowed_from)
785
+ with self._lock:
786
+ existing = self._capabilities.get(namespace)
787
+ if existing is not None and existing != capability:
788
+ raise ValueError("mailbox namespace is already registered")
789
+ self._capabilities[namespace] = capability
790
+ account = self._accounts.get(namespace)
791
+ if account is None:
792
+ self._accounts[namespace] = self._broker.create_account(
793
+ address="", role="gateway", allowed_from=allowed_senders
794
+ )
795
+ elif account.allowed_from != allowed_senders:
796
+ raise ValueError("mailbox namespace sender policy is already registered")
797
+
798
+ def authorized(self, namespace: str, capability: str | None) -> bool:
799
+ with self._lock:
800
+ expected = self._capabilities.get(namespace)
801
+ return (
802
+ expected is not None
803
+ and capability is not None
804
+ and hmac.compare_digest(expected, capability)
805
+ )
806
+
807
+ def seal_namespace(self, namespace: str) -> None:
808
+ """Retire one writer while retaining trusted reads until teardown."""
809
+
810
+ with self._lock:
811
+ self._capabilities.pop(namespace, None)
812
+ account = self._accounts.get(namespace)
813
+ self._namespace_message_counts.pop(namespace, None)
814
+ self._namespace_stored_bytes.pop(namespace, None)
815
+ self._idempotency = {
816
+ identity: provider_id
817
+ for identity, provider_id in self._idempotency.items()
818
+ if identity[0] != namespace
819
+ }
820
+ if account is not None:
821
+ self._broker.seal(account.account_id)
822
+
823
+ def destroy_namespaces(self) -> None:
824
+ """Revoke every logical account without deleting Mailpit messages."""
825
+
826
+ with self._lock:
827
+ accounts = list(self._accounts.values())
828
+ self._capabilities.clear()
829
+ self._accounts.clear()
830
+ self._namespace_message_counts.clear()
831
+ self._namespace_stored_bytes.clear()
832
+ self._idempotency.clear()
833
+ for account in accounts:
834
+ if account.state != "destroyed":
835
+ self._broker.destroy(account.account_id)
836
+
837
+ def _store_message(
838
+ self,
839
+ message: Any,
840
+ envelope_from: str,
841
+ recipients: list[str],
842
+ *,
843
+ namespace: str,
844
+ idempotency_key: str | None = None,
845
+ raw: bytes | None = None,
846
+ ) -> tuple[bool, str | None]:
847
+ with self._lock:
848
+ idempotency_identity = (
849
+ (namespace, idempotency_key) if idempotency_key else None
850
+ )
851
+ if idempotency_identity is not None:
852
+ previous = self._idempotency.get(idempotency_identity)
853
+ if previous is not None:
854
+ return True, previous
855
+ account = self._accounts.get(namespace)
856
+ if account is None:
857
+ return False, None
858
+ wire = raw if raw is not None else message.as_bytes()
859
+ message_count = self._namespace_message_counts.get(namespace, 0)
860
+ stored_bytes = self._namespace_stored_bytes.get(namespace, 0)
861
+ if (
862
+ message_count >= _MAX_MESSAGES_PER_NAMESPACE
863
+ or stored_bytes + len(wire) > _MAX_STORED_BYTES_PER_NAMESPACE
864
+ ):
865
+ raise MailboxCapacityError("mailbox namespace capacity exceeded")
866
+ # Keep the lock across the final hop so concurrent requests with
867
+ # one idempotency key cannot manufacture two accepted messages.
868
+ # No message body or code is retained after Mailpit acknowledges
869
+ # the SMTP DATA command.
870
+ provider_id = self._broker.send(
871
+ account.account_id,
872
+ account.send_capability,
873
+ wire,
874
+ envelope_from,
875
+ recipients,
876
+ )
877
+ self._namespace_message_counts[namespace] = message_count + 1
878
+ self._namespace_stored_bytes[namespace] = stored_bytes + len(wire)
879
+ if idempotency_identity is not None:
880
+ self._idempotency[idempotency_identity] = provider_id
881
+ return True, provider_id
882
+
883
+ def deliver(self, raw: bytes, envelope_from: str, recipients: list[str]) -> bool:
884
+ message = email.message_from_bytes(raw, policy=default)
885
+ namespace = str(message.get("X-WebsiteBench-Namespace", "default"))
886
+ capability = str(message.get("X-WebsiteBench-Capability", ""))
887
+ if not _NAMESPACE.fullmatch(namespace) or not self.authorized(
888
+ namespace, capability
889
+ ):
890
+ return False
891
+ accepted, _provider_id = self._store_message(
892
+ message,
893
+ envelope_from,
894
+ recipients,
895
+ namespace=namespace,
896
+ raw=raw,
897
+ )
898
+ return accepted
899
+
900
+ def deliver_to(
901
+ self,
902
+ namespace: str,
903
+ raw: bytes,
904
+ envelope_from: str,
905
+ recipients: list[str],
906
+ ) -> bool:
907
+ """Store mail on a listener already fixed to one registered namespace.
908
+
909
+ Formal candidate runtimes receive access to that write-only listener,
910
+ not to the namespace-selecting SMTP or JSON API used by reference
911
+ capture. The routing decision therefore belongs to trusted verifier
912
+ infrastructure rather than to candidate-authored message headers.
913
+ """
914
+
915
+ if not _NAMESPACE.fullmatch(namespace):
916
+ return False
917
+ with self._lock:
918
+ registered = namespace in self._capabilities
919
+ if not registered:
920
+ return False
921
+ message = email.message_from_bytes(raw, policy=default)
922
+ accepted, _provider_id = self._store_message(
923
+ message,
924
+ envelope_from,
925
+ recipients,
926
+ namespace=namespace,
927
+ raw=raw,
928
+ )
929
+ return accepted
930
+
931
+ def deliver_resend_style_to(
932
+ self,
933
+ namespace: str,
934
+ *,
935
+ envelope_from: str,
936
+ recipients: list[str],
937
+ subject: str,
938
+ text: str,
939
+ idempotency_key: str | None,
940
+ ) -> tuple[bool, str | None]:
941
+ """Store one text-only Resend-style request in a fixed namespace."""
942
+
943
+ if not _NAMESPACE.fullmatch(namespace):
944
+ return False, None
945
+ with self._lock:
946
+ registered = namespace in self._capabilities
947
+ if not registered:
948
+ return False, None
949
+ message = EmailMessage()
950
+ message["From"] = envelope_from
951
+ message["To"] = ", ".join(recipients)
952
+ message["Subject"] = subject
953
+ message.set_content(text)
954
+ return self._store_message(
955
+ message,
956
+ envelope_from,
957
+ recipients,
958
+ namespace=namespace,
959
+ idempotency_key=idempotency_key,
960
+ raw=message.as_bytes(),
961
+ )
962
+
963
+ def messages(
964
+ self, namespace: str, recipient: str | None = None
965
+ ) -> list[dict[str, Any]]:
966
+ with self._lock:
967
+ account = self._accounts.get(namespace)
968
+ if account is None:
969
+ return []
970
+ values = self._broker.messages(
971
+ account.account_id, account.read_capability, recipient
972
+ )
973
+ for item in values:
974
+ item["namespace"] = namespace
975
+ item.pop("stored_bytes", None)
976
+ item.pop("mailpit_id", None)
977
+ return values
978
+
979
+
980
+ _INBOX_STYLE = (
981
+ "body{font:16px/1.5 system-ui,sans-serif;margin:0;background:#f6f7f9;"
982
+ "color:#1b1f24}"
983
+ "header{background:#fff;border-bottom:1px solid #d8dee4;padding:16px 24px}"
984
+ "h1{font-size:20px;margin:0}"
985
+ "main{max-width:52rem;margin:0 auto;padding:24px}"
986
+ "a{color:#0b62d0}"
987
+ ".msg{background:#fff;border:1px solid #d8dee4;border-radius:8px;"
988
+ "padding:12px 16px;margin-bottom:12px}"
989
+ ".msg h2{font-size:16px;margin:0 0 4px}"
990
+ ".meta{color:#57606a;font-size:13px;margin:0}"
991
+ ".empty{color:#57606a}"
992
+ "pre{white-space:pre-wrap;word-break:break-word;background:#f6f8fa;"
993
+ "border-radius:6px;padding:12px;margin:12px 0 0}"
994
+ )
995
+
996
+
997
+ def _document(title: str, body: str) -> bytes:
998
+ """One self-contained HTML page. Every interpolated value is escaped."""
999
+
1000
+ return (
1001
+ "<!doctype html><html lang=en><meta charset=utf-8>"
1002
+ '<meta name=viewport content="width=device-width,initial-scale=1">'
1003
+ f"<title>{html.escape(title)}</title>"
1004
+ f"<style>{_INBOX_STYLE}</style>"
1005
+ f"<header><h1>{html.escape(title)}</h1></header><main>{body}</main>"
1006
+ "</html>"
1007
+ ).encode("utf-8")
1008
+
1009
+
1010
+ def _recipients(message: dict[str, Any]) -> str:
1011
+ return ", ".join(str(item) for item in message.get("recipients", []))
1012
+
1013
+
1014
+ def render_inbox(messages: list[dict[str, Any]], *, base_path: str = "") -> bytes:
1015
+ """The message list an agent reads in a browser.
1016
+
1017
+ The extracted ``otp`` is deliberately absent: an agent should read the code
1018
+ out of the body the way a person would. That field stays an evaluator-side
1019
+ convenience on the JSON API.
1020
+ """
1021
+
1022
+ if not messages:
1023
+ body = (
1024
+ "<p class=empty id=inbox-empty>No messages yet. Mail sent to this "
1025
+ "mailbox appears here.</p>"
1026
+ )
1027
+ else:
1028
+ body = "".join(
1029
+ "<article class=msg>"
1030
+ f'<h2><a href="{html.escape(base_path)}/messages/{int(item["id"])}">'
1031
+ f"{html.escape(str(item.get('subject', '')))}</a></h2>"
1032
+ f"<p class=meta>From {html.escape(str(item.get('envelope_from', '')))}"
1033
+ f" &middot; To {html.escape(_recipients(item))}"
1034
+ f" &middot; Message {int(item['id'])}</p>"
1035
+ "</article>"
1036
+ for item in messages
1037
+ )
1038
+ refresh = f'<p><a href="{html.escape(base_path)}" id=inbox-refresh>Refresh</a></p>'
1039
+ return _document("Inbox", body + refresh)
1040
+
1041
+
1042
+ def render_message(message: dict[str, Any], *, base_path: str = "") -> bytes:
1043
+ """One message, body included, for the agent to read the code out of."""
1044
+
1045
+ body = (
1046
+ "<article class=msg>"
1047
+ f"<h2>{html.escape(str(message.get('subject', '')))}</h2>"
1048
+ f"<p class=meta>From {html.escape(str(message.get('envelope_from', '')))}"
1049
+ f" &middot; To {html.escape(_recipients(message))}</p>"
1050
+ f"<pre id=message-body>{html.escape(str(message.get('text', '')))}</pre>"
1051
+ "</article>"
1052
+ f'<p><a href="{html.escape(base_path)}" id=inbox-back>Back to inbox</a></p>'
1053
+ )
1054
+ return _document("Message", body)
1055
+
1056
+
1057
+ class _SmtpHandler(socketserver.StreamRequestHandler):
1058
+ def handle(self) -> None:
1059
+ timer = threading.Timer(
1060
+ _MAX_CONNECTION_LIFETIME_SECONDS, self._expire_connection
1061
+ )
1062
+ timer.daemon = True
1063
+ timer.start()
1064
+ try:
1065
+ self._handle_session()
1066
+ finally:
1067
+ timer.cancel()
1068
+
1069
+ def _expire_connection(self) -> None:
1070
+ try:
1071
+ self.connection.shutdown(socket.SHUT_RDWR)
1072
+ except OSError:
1073
+ pass
1074
+
1075
+ def _handle_session(self) -> None:
1076
+ store: MailboxStore = self.server.store # type: ignore[attr-defined]
1077
+ self.connection.settimeout(_CONNECTION_TIMEOUT_SECONDS)
1078
+ self.wfile.write(b"220 websitebench.local ESMTP\r\n")
1079
+ envelope_from = ""
1080
+ recipients: list[str] = []
1081
+ for _command_count in range(_MAX_COMMANDS_PER_CONNECTION):
1082
+ try:
1083
+ line = self.rfile.readline(65537)
1084
+ except (TimeoutError, socket.timeout):
1085
+ return
1086
+ if not line:
1087
+ return
1088
+ if len(line) > 65536:
1089
+ self.wfile.write(b"500 Command line too long\r\n")
1090
+ return
1091
+ command = line.decode("utf-8", "replace").rstrip("\r\n")
1092
+ upper = command.upper()
1093
+ if upper.startswith(("EHLO", "HELO")):
1094
+ self.wfile.write(b"250-websitebench.local\r\n250 SIZE 1048576\r\n")
1095
+ elif upper.startswith("MAIL FROM:"):
1096
+ path = command.split(":", 1)[1].strip()
1097
+ envelope_from = (
1098
+ path[1:].split(">", 1)[0]
1099
+ if path.startswith("<") and ">" in path
1100
+ else path.split(None, 1)[0].strip("<>")
1101
+ )
1102
+ recipients = []
1103
+ self.wfile.write(b"250 OK\r\n")
1104
+ elif upper.startswith("RCPT TO:"):
1105
+ if len(recipients) >= _MAX_RECIPIENTS:
1106
+ self.wfile.write(b"452 Too many recipients\r\n")
1107
+ continue
1108
+ path = command.split(":", 1)[1].strip()
1109
+ recipients.append(
1110
+ path[1:].split(">", 1)[0]
1111
+ if path.startswith("<") and ">" in path
1112
+ else path.split(None, 1)[0].strip("<>")
1113
+ )
1114
+ self.wfile.write(b"250 OK\r\n")
1115
+ elif upper == "DATA":
1116
+ self.wfile.write(b"354 End data with <CR><LF>.<CR><LF>\r\n")
1117
+ chunks = bytearray()
1118
+ oversized = False
1119
+ while True:
1120
+ try:
1121
+ data_line = self.rfile.readline(65537)
1122
+ except (TimeoutError, socket.timeout):
1123
+ return
1124
+ if data_line in {b".\r\n", b".\n", b""}:
1125
+ break
1126
+ if len(data_line) > 65536:
1127
+ oversized = True
1128
+ value = data_line[1:] if data_line.startswith(b"..") else data_line
1129
+ if len(chunks) + len(value) > _MAX_MESSAGE_BYTES:
1130
+ oversized = True
1131
+ elif not oversized:
1132
+ chunks.extend(value)
1133
+ if oversized:
1134
+ self.wfile.write(b"552 Message exceeds fixed local limit\r\n")
1135
+ continue
1136
+ fixed_namespace = getattr(self.server, "fixed_namespace", None)
1137
+ try:
1138
+ accepted = (
1139
+ store.deliver_to(
1140
+ fixed_namespace,
1141
+ bytes(chunks),
1142
+ envelope_from,
1143
+ recipients,
1144
+ )
1145
+ if isinstance(fixed_namespace, str)
1146
+ else store.deliver(bytes(chunks), envelope_from, recipients)
1147
+ )
1148
+ except MailboxCapacityError:
1149
+ self.wfile.write(b"452 Mailbox capacity exceeded\r\n")
1150
+ continue
1151
+ except PermissionError:
1152
+ self.wfile.write(b"550 Mail sender or recipient is not allowed\r\n")
1153
+ continue
1154
+ except MailpitInfrastructureError:
1155
+ self.wfile.write(b"451 Mailpit delivery unavailable\r\n")
1156
+ continue
1157
+ self.wfile.write(
1158
+ b"250 Accepted by Mailpit\r\n"
1159
+ if accepted
1160
+ else b"550 Invalid namespace capability\r\n"
1161
+ )
1162
+ elif upper == "RSET":
1163
+ envelope_from, recipients = "", []
1164
+ self.wfile.write(b"250 OK\r\n")
1165
+ elif upper == "NOOP":
1166
+ self.wfile.write(b"250 OK\r\n")
1167
+ elif upper == "QUIT":
1168
+ self.wfile.write(b"221 Bye\r\n")
1169
+ return
1170
+ else:
1171
+ self.wfile.write(b"502 Command not implemented\r\n")
1172
+ self.wfile.write(b"421 Command limit exceeded\r\n")
1173
+
1174
+
1175
+ class _SmtpServer(socketserver.ThreadingTCPServer):
1176
+ allow_reuse_address = True
1177
+ daemon_threads = True
1178
+
1179
+ def __init__(
1180
+ self,
1181
+ address: tuple[str, int],
1182
+ store: MailboxStore,
1183
+ *,
1184
+ fixed_namespace: str | None = None,
1185
+ ) -> None:
1186
+ self.store = store
1187
+ self.fixed_namespace = fixed_namespace
1188
+ self._connection_slots = threading.BoundedSemaphore(_MAX_CONCURRENT_CONNECTIONS)
1189
+ super().__init__(address, _SmtpHandler)
1190
+
1191
+ def process_request(self, request: Any, client_address: Any) -> None:
1192
+ if not self._connection_slots.acquire(blocking=False):
1193
+ request.close()
1194
+ return
1195
+ super().process_request(request, client_address)
1196
+
1197
+ def process_request_thread(self, request: Any, client_address: Any) -> None:
1198
+ try:
1199
+ super().process_request_thread(request, client_address)
1200
+ finally:
1201
+ self._connection_slots.release()
1202
+
1203
+
1204
+ class _HttpServer(ThreadingHTTPServer):
1205
+ daemon_threads = True
1206
+
1207
+ def __init__(self, address: tuple[str, int], handler: Any) -> None:
1208
+ self._connection_slots = threading.BoundedSemaphore(_MAX_CONCURRENT_CONNECTIONS)
1209
+ super().__init__(address, handler)
1210
+
1211
+ def process_request(self, request: Any, client_address: Any) -> None:
1212
+ if not self._connection_slots.acquire(blocking=False):
1213
+ request.close()
1214
+ return
1215
+ super().process_request(request, client_address)
1216
+
1217
+ def process_request_thread(self, request: Any, client_address: Any) -> None:
1218
+ def expire() -> None:
1219
+ try:
1220
+ request.shutdown(socket.SHUT_RDWR)
1221
+ except OSError:
1222
+ pass
1223
+
1224
+ timer = threading.Timer(_MAX_CONNECTION_LIFETIME_SECONDS, expire)
1225
+ timer.daemon = True
1226
+ timer.start()
1227
+ try:
1228
+ request.settimeout(_CONNECTION_TIMEOUT_SECONDS)
1229
+ super().process_request_thread(request, client_address)
1230
+ finally:
1231
+ timer.cancel()
1232
+ self._connection_slots.release()
1233
+
1234
+
1235
+ def _http_handler(
1236
+ store: MailboxStore,
1237
+ bootstrap: "_Bootstrap | _BootstrapSlot | None" = None,
1238
+ ) -> type[BaseHTTPRequestHandler]:
1239
+ """The evaluator- and site-facing listener: JSON, Bearer-gated throughout."""
1240
+
1241
+ slot = (
1242
+ bootstrap
1243
+ if isinstance(bootstrap, _BootstrapSlot)
1244
+ else _BootstrapSlot(bootstrap)
1245
+ )
1246
+
1247
+ class Handler(BaseHTTPRequestHandler):
1248
+ def _authorized(self, namespace: str) -> bool:
1249
+ prefix = "Bearer "
1250
+ header = self.headers.get("Authorization", "")
1251
+ capability = header[len(prefix) :] if header.startswith(prefix) else None
1252
+ if store.authorized(namespace, capability):
1253
+ return True
1254
+ self._json(403, {"error": "forbidden"})
1255
+ return False
1256
+
1257
+ def _json(self, status: int, value: Any) -> None:
1258
+ body = json.dumps(value, ensure_ascii=False, sort_keys=True).encode("utf-8")
1259
+ self.send_response(status)
1260
+ self.send_header("Content-Type", "application/json; charset=utf-8")
1261
+ self.send_header("Content-Length", str(len(body)))
1262
+ self.end_headers()
1263
+ self.wfile.write(body)
1264
+
1265
+ def _html(self, status: int, body: bytes) -> None:
1266
+ self.send_response(status)
1267
+ self.send_header("Content-Type", "text/html; charset=utf-8")
1268
+ self.send_header("Content-Length", str(len(body)))
1269
+ self.end_headers()
1270
+ self.wfile.write(body)
1271
+
1272
+ def do_GET(self) -> None: # noqa: N802
1273
+ parsed = urllib.parse.urlsplit(self.path)
1274
+ if parsed.path == "/healthz":
1275
+ if store.healthy():
1276
+ self._json(200, {"status": "ok"})
1277
+ else:
1278
+ self._json(503, {"status": "unavailable"})
1279
+ return
1280
+ if parsed.path == "/internal/bootstrap":
1281
+ # The site process learns this trial's namespace and capability
1282
+ # here. It is gated on its own token so the route stays closed
1283
+ # even if the internal network were misrouted.
1284
+ identity = slot.get()
1285
+ if identity is None:
1286
+ self._json(404, {"error": "not_found"})
1287
+ return
1288
+ prefix = "Bearer "
1289
+ header = self.headers.get("Authorization", "")
1290
+ presented = header[len(prefix) :] if header.startswith(prefix) else ""
1291
+ if not hmac.compare_digest(identity.token, presented):
1292
+ self._json(403, {"error": "forbidden"})
1293
+ return
1294
+ self._json(200, identity.payload())
1295
+ return
1296
+ parts = parsed.path.strip("/").split("/")
1297
+ if (
1298
+ len(parts) >= 4
1299
+ and parts[:2] == ["api", "namespaces"]
1300
+ and parts[3] == "messages"
1301
+ ):
1302
+ namespace = urllib.parse.unquote(parts[2])
1303
+ if not _NAMESPACE.fullmatch(namespace):
1304
+ self._json(400, {"error": "invalid_namespace"})
1305
+ return
1306
+ if not self._authorized(namespace):
1307
+ return
1308
+ recipient = urllib.parse.parse_qs(parsed.query).get(
1309
+ "recipient", [None]
1310
+ )[0]
1311
+ try:
1312
+ values = store.messages(namespace, recipient)
1313
+ except PermissionError:
1314
+ self._json(403, {"error": "recipient_forbidden"})
1315
+ return
1316
+ except MailpitInfrastructureError:
1317
+ self._json(503, {"error": "mailpit_unavailable"})
1318
+ return
1319
+ if len(parts) == 5 and parts[4] == "latest":
1320
+ if not values:
1321
+ self._json(404, {"error": "message_not_found"})
1322
+ else:
1323
+ self._json(200, values[-1])
1324
+ else:
1325
+ self._json(200, {"messages": values})
1326
+ return
1327
+ if len(parts) == 2 and parts[0] == "inbox":
1328
+ namespace = urllib.parse.unquote(parts[1])
1329
+ if not _NAMESPACE.fullmatch(namespace):
1330
+ self._json(400, {"error": "invalid_namespace"})
1331
+ return
1332
+ if not self._authorized(namespace):
1333
+ return
1334
+ try:
1335
+ messages = store.messages(namespace)
1336
+ except PermissionError:
1337
+ self._json(403, {"error": "forbidden"})
1338
+ return
1339
+ except MailpitInfrastructureError:
1340
+ self._json(503, {"error": "mailpit_unavailable"})
1341
+ return
1342
+ body = render_inbox(
1343
+ messages, base_path=f"/inbox/{urllib.parse.quote(namespace)}"
1344
+ )
1345
+ self._html(200, body)
1346
+ return
1347
+ self._json(404, {"error": "not_found"})
1348
+
1349
+ def do_POST(self) -> None: # noqa: N802
1350
+ """Accept reference mail through a bootstrap-token write-only API."""
1351
+
1352
+ parsed = urllib.parse.urlsplit(self.path)
1353
+ if parsed.path != "/emails" or parsed.query or parsed.fragment:
1354
+ self._json(404, {"error": "not_found"})
1355
+ return
1356
+ identity = slot.get()
1357
+ if identity is None:
1358
+ self._json(404, {"error": "not_found"})
1359
+ return
1360
+ prefix = "Bearer "
1361
+ header = self.headers.get("Authorization", "")
1362
+ presented = header[len(prefix) :] if header.startswith(prefix) else ""
1363
+ if not hmac.compare_digest(identity.token, presented):
1364
+ self._json(401, {"error": "unauthorized"})
1365
+ return
1366
+ if self.headers.get("Content-Type", "").split(";", 1)[0].strip().lower() != "application/json":
1367
+ self._json(415, {"error": "application_json_required"})
1368
+ return
1369
+ try:
1370
+ content_length = int(self.headers.get("Content-Length", ""))
1371
+ except ValueError:
1372
+ self._json(411, {"error": "content_length_required"})
1373
+ return
1374
+ if content_length < 0 or content_length > _MAX_MESSAGE_BYTES:
1375
+ self._json(413, {"error": "message_too_large"})
1376
+ return
1377
+ try:
1378
+ value = json.loads(self.rfile.read(content_length).decode("utf-8"))
1379
+ except (UnicodeDecodeError, json.JSONDecodeError):
1380
+ self._json(400, {"error": "invalid_json"})
1381
+ return
1382
+ if not isinstance(value, dict) or set(value) != {"from", "to", "subject", "text"}:
1383
+ self._json(400, {"error": "invalid_message_fields"})
1384
+ return
1385
+ envelope_from = value.get("from")
1386
+ recipients = value.get("to")
1387
+ subject = value.get("subject")
1388
+ message_text = value.get("text")
1389
+ recipients = [recipients] if isinstance(recipients, str) else recipients
1390
+ if (
1391
+ not isinstance(envelope_from, str)
1392
+ or not envelope_from
1393
+ or "@" not in envelope_from
1394
+ or "\r" in envelope_from
1395
+ or "\n" in envelope_from
1396
+ or not isinstance(recipients, list)
1397
+ or not 1 <= len(recipients) <= _MAX_RECIPIENTS
1398
+ or any(
1399
+ not isinstance(recipient, str)
1400
+ or not recipient
1401
+ or len(recipient) > 320
1402
+ or "@" not in recipient
1403
+ or "\r" in recipient
1404
+ or "\n" in recipient
1405
+ for recipient in recipients
1406
+ )
1407
+ or not isinstance(subject, str)
1408
+ or len(subject) > 998
1409
+ or "\r" in subject
1410
+ or "\n" in subject
1411
+ or not isinstance(message_text, str)
1412
+ or len(message_text.encode("utf-8")) > _MAX_MESSAGE_BYTES
1413
+ ):
1414
+ self._json(400, {"error": "invalid_message"})
1415
+ return
1416
+ idempotency_key = self.headers.get("Idempotency-Key")
1417
+ if idempotency_key is not None and (
1418
+ not idempotency_key
1419
+ or len(idempotency_key) > 256
1420
+ or "\r" in idempotency_key
1421
+ or "\n" in idempotency_key
1422
+ ):
1423
+ self._json(400, {"error": "invalid_idempotency_key"})
1424
+ return
1425
+ try:
1426
+ accepted, provider_id = store.deliver_resend_style_to(
1427
+ identity.namespace,
1428
+ envelope_from=envelope_from,
1429
+ recipients=recipients,
1430
+ subject=subject,
1431
+ text=message_text,
1432
+ idempotency_key=idempotency_key,
1433
+ )
1434
+ except MailboxCapacityError:
1435
+ self._json(429, {"error": "mailbox_capacity"})
1436
+ return
1437
+ except MailpitInfrastructureError:
1438
+ self._json(503, {"error": "mailpit_unavailable"})
1439
+ return
1440
+ if not accepted or provider_id is None:
1441
+ self._json(503, {"error": "delivery_failed"})
1442
+ return
1443
+ self._json(200, {"id": provider_id})
1444
+
1445
+ def log_message(self, format: str, *args: Any) -> None:
1446
+ return
1447
+
1448
+ return Handler
1449
+
1450
+
1451
+ def _candidate_bootstrap_handler(
1452
+ *,
1453
+ store: MailboxStore,
1454
+ bootstrap_token: str,
1455
+ mail_api_token: str,
1456
+ namespace: str,
1457
+ capability: str,
1458
+ smtp_host: str,
1459
+ smtp_port: int,
1460
+ sender: str,
1461
+ ) -> type[BaseHTTPRequestHandler]:
1462
+ """Expose write-only mail paths without exposing the mailbox read API.
1463
+
1464
+ ``POST /emails`` is deliberately a small Resend-style subset: one fixed
1465
+ sender, one or more recipients, a subject, and a plain-text body. The
1466
+ endpoint owns the trial namespace, so candidate input can never select a
1467
+ second mailbox. The legacy bootstrap and SMTP coordinates remain here for
1468
+ candidates using the vendored ``websitebench.site_backend`` transport.
1469
+ """
1470
+
1471
+ payload = {
1472
+ "namespace": namespace,
1473
+ "capability": capability,
1474
+ "smtp_host": smtp_host,
1475
+ "smtp_port": smtp_port,
1476
+ }
1477
+
1478
+ class CandidateBootstrapHandler(BaseHTTPRequestHandler):
1479
+ def _json(self, status: int, value: Any) -> None:
1480
+ body = json.dumps(value, ensure_ascii=False, sort_keys=True).encode("utf-8")
1481
+ self.send_response(status)
1482
+ self.send_header("Content-Type", "application/json; charset=utf-8")
1483
+ self.send_header("Content-Length", str(len(body)))
1484
+ self.send_header("Cache-Control", "no-store")
1485
+ self.end_headers()
1486
+ self.wfile.write(body)
1487
+
1488
+ def do_GET(self) -> None: # noqa: N802
1489
+ parsed = urllib.parse.urlsplit(self.path)
1490
+ if parsed.path == "/healthz":
1491
+ healthy = store.healthy()
1492
+ self._json(200 if healthy else 503, {"status": "ok" if healthy else "unavailable"})
1493
+ return
1494
+ if parsed.path != "/internal/bootstrap":
1495
+ self._json(404, {"error": "not_found"})
1496
+ return
1497
+ prefix = "Bearer "
1498
+ header = self.headers.get("Authorization", "")
1499
+ presented = header[len(prefix) :] if header.startswith(prefix) else ""
1500
+ if not hmac.compare_digest(bootstrap_token, presented):
1501
+ self._json(403, {"error": "forbidden"})
1502
+ return
1503
+ self._json(200, payload)
1504
+
1505
+ def do_POST(self) -> None: # noqa: N802
1506
+ parsed = urllib.parse.urlsplit(self.path)
1507
+ if parsed.path != "/emails" or parsed.query or parsed.fragment:
1508
+ self._json(404, {"error": "not_found"})
1509
+ return
1510
+ prefix = "Bearer "
1511
+ header = self.headers.get("Authorization", "")
1512
+ presented = header[len(prefix) :] if header.startswith(prefix) else ""
1513
+ if not hmac.compare_digest(mail_api_token, presented):
1514
+ self._json(401, {"error": "unauthorized"})
1515
+ return
1516
+ content_type = self.headers.get("Content-Type", "").split(";", 1)[0]
1517
+ if content_type.strip().lower() != "application/json":
1518
+ self._json(415, {"error": "application_json_required"})
1519
+ return
1520
+ try:
1521
+ content_length = int(self.headers.get("Content-Length", ""))
1522
+ except ValueError:
1523
+ self._json(411, {"error": "content_length_required"})
1524
+ return
1525
+ if content_length < 0 or content_length > _MAX_MESSAGE_BYTES:
1526
+ self._json(413, {"error": "message_too_large"})
1527
+ return
1528
+ raw = self.rfile.read(content_length)
1529
+ if len(raw) != content_length:
1530
+ self._json(400, {"error": "incomplete_request"})
1531
+ return
1532
+ try:
1533
+ value = json.loads(raw.decode("utf-8"))
1534
+ except (UnicodeDecodeError, json.JSONDecodeError):
1535
+ self._json(400, {"error": "invalid_json"})
1536
+ return
1537
+ if not isinstance(value, dict) or set(value) != {
1538
+ "from",
1539
+ "to",
1540
+ "subject",
1541
+ "text",
1542
+ }:
1543
+ self._json(400, {"error": "invalid_message_fields"})
1544
+ return
1545
+ envelope_from = value.get("from")
1546
+ subject = value.get("subject")
1547
+ text = value.get("text")
1548
+ raw_recipients = value.get("to")
1549
+ recipients = (
1550
+ [raw_recipients] if isinstance(raw_recipients, str) else raw_recipients
1551
+ )
1552
+ if (
1553
+ envelope_from != sender
1554
+ or not isinstance(subject, str)
1555
+ or not isinstance(text, str)
1556
+ or not isinstance(recipients, list)
1557
+ or not 1 <= len(recipients) <= _MAX_RECIPIENTS
1558
+ or any(
1559
+ not isinstance(recipient, str)
1560
+ or not recipient
1561
+ or len(recipient) > 320
1562
+ or "@" not in recipient
1563
+ or "\r" in recipient
1564
+ or "\n" in recipient
1565
+ for recipient in recipients
1566
+ )
1567
+ or len(subject) > 998
1568
+ or "\r" in subject
1569
+ or "\n" in subject
1570
+ ):
1571
+ self._json(400, {"error": "invalid_message"})
1572
+ return
1573
+ try:
1574
+ encoded_text = text.encode("utf-8")
1575
+ subject.encode("utf-8")
1576
+ for recipient in recipients:
1577
+ recipient.encode("utf-8")
1578
+ except UnicodeEncodeError:
1579
+ self._json(400, {"error": "invalid_message"})
1580
+ return
1581
+ if len(encoded_text) > _MAX_MESSAGE_BYTES:
1582
+ self._json(413, {"error": "message_too_large"})
1583
+ return
1584
+ idempotency_key = self.headers.get("Idempotency-Key")
1585
+ if idempotency_key is not None and (
1586
+ not idempotency_key
1587
+ or len(idempotency_key) > 256
1588
+ or "\r" in idempotency_key
1589
+ or "\n" in idempotency_key
1590
+ ):
1591
+ self._json(400, {"error": "invalid_idempotency_key"})
1592
+ return
1593
+ try:
1594
+ accepted, provider_id = store.deliver_resend_style_to(
1595
+ namespace,
1596
+ envelope_from=envelope_from,
1597
+ recipients=recipients,
1598
+ subject=subject,
1599
+ text=text,
1600
+ idempotency_key=idempotency_key,
1601
+ )
1602
+ except MailboxCapacityError:
1603
+ self._json(429, {"error": "mailbox_capacity"})
1604
+ return
1605
+ except MailpitInfrastructureError:
1606
+ self._json(503, {"error": "mailpit_unavailable"})
1607
+ return
1608
+ if not accepted or provider_id is None:
1609
+ self._json(429, {"error": "mailbox_capacity"})
1610
+ return
1611
+ self._json(200, {"id": provider_id})
1612
+
1613
+ def log_message(self, format: str, *args: Any) -> None:
1614
+ return
1615
+
1616
+ return CandidateBootstrapHandler
1617
+
1618
+
1619
+ @dataclass(frozen=True, repr=False)
1620
+ class _Bootstrap:
1621
+ """What the site process is allowed to learn, and the token that gates it."""
1622
+
1623
+ token: str
1624
+ namespace: str
1625
+ capability: str
1626
+ smtp_host: str
1627
+ smtp_port: int
1628
+
1629
+ def __repr__(self) -> str:
1630
+ return f"_Bootstrap(namespace={self.namespace!r}, token=<redacted>)"
1631
+
1632
+ def payload(self) -> dict[str, Any]:
1633
+ return {
1634
+ "namespace": self.namespace,
1635
+ "capability": self.capability,
1636
+ "smtp_host": self.smtp_host,
1637
+ "smtp_port": self.smtp_port,
1638
+ }
1639
+
1640
+
1641
+ class _BootstrapSlot:
1642
+ """The identity ``/internal/bootstrap`` is serving right now.
1643
+
1644
+ A trial's mailbox identity is minted once and never moves, so the slot is
1645
+ written once and read forever. Reference capture is the exception that
1646
+ makes it a slot at all: it relaunches the reference between tasks, and each
1647
+ relaunch has to be its own trial -- same bootstrap token, because that is
1648
+ the site process's own credential and the site is what stays the same, but
1649
+ a namespace and capability nothing before it could have seen. Rotating
1650
+ behind the slot lets the operator do that without tearing down the listener
1651
+ the site is about to call.
1652
+ """
1653
+
1654
+ def __init__(self, bootstrap: "_Bootstrap | None" = None) -> None:
1655
+ self._lock = threading.Lock()
1656
+ self._value = bootstrap
1657
+
1658
+ def __repr__(self) -> str:
1659
+ return f"_BootstrapSlot({self._value!r})"
1660
+
1661
+ def get(self) -> "_Bootstrap | None":
1662
+ with self._lock:
1663
+ return self._value
1664
+
1665
+ def rotate(self, *, namespace: str, capability: str) -> "_Bootstrap":
1666
+ """Swap in a fresh namespace and capability, keeping the token."""
1667
+
1668
+ with self._lock:
1669
+ current = self._value
1670
+ if current is None:
1671
+ raise RuntimeError("this mailbox serves no bootstrap identity")
1672
+ rotated = replace(current, namespace=namespace, capability=capability)
1673
+ self._value = rotated
1674
+ return rotated
1675
+
1676
+
1677
+ def _inbox_handler(
1678
+ store: MailboxStore, namespace: str, token: str
1679
+ ) -> type[BaseHTTPRequestHandler]:
1680
+ """The agent-facing listener: one namespace, HTML only, no capability.
1681
+
1682
+ The namespace is closed over at construction, so there is no request-time
1683
+ parameter an agent could vary to reach a second mailbox. Requirement 5
1684
+ holds by construction rather than by a check that could be bypassed.
1685
+ """
1686
+
1687
+ inbox_path = "/inbox/" + urllib.parse.quote(token, safe="")
1688
+
1689
+ class InboxHandler(BaseHTTPRequestHandler):
1690
+ def _send(self, status: int, body: bytes, content_type: str) -> None:
1691
+ self.send_response(status)
1692
+ self.send_header("Content-Type", content_type)
1693
+ self.send_header("Content-Length", str(len(body)))
1694
+ # The inbox is per-trial and mutates; never let it be cached.
1695
+ self.send_header("Cache-Control", "no-store")
1696
+ self.send_header("Referrer-Policy", "no-referrer")
1697
+ self.end_headers()
1698
+ self.wfile.write(body)
1699
+
1700
+ def _not_found(self) -> None:
1701
+ self._send(
1702
+ 404,
1703
+ _document("Not found", "<p>No such page.</p>"),
1704
+ "text/html; charset=utf-8",
1705
+ )
1706
+
1707
+ def do_GET(self) -> None: # noqa: N802
1708
+ parsed = urllib.parse.urlsplit(self.path)
1709
+ if parsed.path == "/healthz":
1710
+ healthy = store.healthy()
1711
+ body = json.dumps(
1712
+ {"status": "ok" if healthy else "unavailable"}
1713
+ ).encode("utf-8")
1714
+ self._send(
1715
+ 200 if healthy else 503,
1716
+ body,
1717
+ "application/json; charset=utf-8",
1718
+ )
1719
+ return
1720
+ if parsed.path in {"", "/"}:
1721
+ self.send_response(302)
1722
+ self.send_header("Location", inbox_path)
1723
+ self.send_header("Content-Length", "0")
1724
+ self.end_headers()
1725
+ return
1726
+ parts = [
1727
+ urllib.parse.unquote(part) for part in parsed.path.strip("/").split("/")
1728
+ ]
1729
+ # Defence in depth for the shared-origin topology, where the path is
1730
+ # the only thing separating one trial's inbox from another's.
1731
+ if len(parts) < 2 or parts[0] != "inbox":
1732
+ self._not_found()
1733
+ return
1734
+ if not hmac.compare_digest(token, parts[1]):
1735
+ self._not_found()
1736
+ return
1737
+ try:
1738
+ values = store.messages(namespace)
1739
+ except MailpitInfrastructureError:
1740
+ body = json.dumps({"status": "unavailable"}).encode("utf-8")
1741
+ self._send(503, body, "application/json; charset=utf-8")
1742
+ return
1743
+ if len(parts) == 2:
1744
+ self._send(
1745
+ 200,
1746
+ render_inbox(values, base_path=inbox_path),
1747
+ "text/html; charset=utf-8",
1748
+ )
1749
+ return
1750
+ if len(parts) == 4 and parts[2] == "messages":
1751
+ try:
1752
+ identifier = int(parts[3])
1753
+ except ValueError:
1754
+ self._not_found()
1755
+ return
1756
+ for item in values:
1757
+ if int(item["id"]) == identifier:
1758
+ self._send(
1759
+ 200,
1760
+ render_message(item, base_path=inbox_path),
1761
+ "text/html; charset=utf-8",
1762
+ )
1763
+ return
1764
+ self._not_found()
1765
+
1766
+ def log_message(self, format: str, *args: Any) -> None:
1767
+ return
1768
+
1769
+ return InboxHandler
1770
+
1771
+
1772
+ class LocalMailboxSidecar:
1773
+ """A loopback-only SMTP and Inbox API pair with namespace isolation."""
1774
+
1775
+ def __init__(
1776
+ self,
1777
+ *,
1778
+ smtp_port: int = 0,
1779
+ http_port: int = 0,
1780
+ bind_host: str = "127.0.0.1",
1781
+ inbox_port: int | None = None,
1782
+ inbox_bind_host: str | None = None,
1783
+ inbox_namespace: str | None = None,
1784
+ inbox_token: str | None = None,
1785
+ bootstrap: "_Bootstrap | None" = None,
1786
+ mailpit_client: MailpitClient,
1787
+ ) -> None:
1788
+ self.store = MailboxStore(mailpit_client=mailpit_client)
1789
+ self._bootstrap = _BootstrapSlot(bootstrap)
1790
+ self.smtp = _SmtpServer((bind_host, smtp_port), self.store)
1791
+ self.http = _HttpServer(
1792
+ (bind_host, http_port), _http_handler(self.store, self._bootstrap)
1793
+ )
1794
+ self.inbox: _HttpServer | None = None
1795
+ self._inbox_token = inbox_token
1796
+ if inbox_namespace is not None or inbox_token is not None:
1797
+ if not inbox_namespace or not inbox_token:
1798
+ raise ValueError("an inbox listener needs both namespace and token")
1799
+ self.inbox = _HttpServer(
1800
+ (inbox_bind_host or bind_host, inbox_port or 0),
1801
+ _inbox_handler(self.store, inbox_namespace, inbox_token),
1802
+ )
1803
+ self._threads: list[threading.Thread] = []
1804
+
1805
+ @property
1806
+ def smtp_port(self) -> int:
1807
+ return int(self.smtp.server_address[1])
1808
+
1809
+ @property
1810
+ def http_port(self) -> int:
1811
+ return int(self.http.server_address[1])
1812
+
1813
+ @property
1814
+ def inbox_port(self) -> int:
1815
+ if self.inbox is None:
1816
+ raise RuntimeError("this sidecar has no inbox listener")
1817
+ return int(self.inbox.server_address[1])
1818
+
1819
+ @property
1820
+ def url(self) -> str:
1821
+ return f"http://127.0.0.1:{self.http_port}"
1822
+
1823
+ @property
1824
+ def inbox_url(self) -> str:
1825
+ """The bare origin an agent is handed. It carries no secret."""
1826
+
1827
+ return f"http://127.0.0.1:{self.inbox_port}"
1828
+
1829
+ @property
1830
+ def _servers(self) -> tuple[Any, ...]:
1831
+ return (
1832
+ (self.smtp, self.http)
1833
+ if self.inbox is None
1834
+ else (
1835
+ self.smtp,
1836
+ self.http,
1837
+ self.inbox,
1838
+ )
1839
+ )
1840
+
1841
+ def register_namespace(self, namespace: str, capability: str) -> None:
1842
+ """Bind one opaque namespace to its unguessable per-worker capability."""
1843
+
1844
+ self.store.register(namespace, capability)
1845
+
1846
+ def rotate_bootstrap(self, namespace: str, capability: str) -> None:
1847
+ """Point ``/internal/bootstrap`` at a freshly minted namespace.
1848
+
1849
+ Registration happens first on purpose: a site that fetched the new
1850
+ identity and sent before the store knew it would have its message
1851
+ dropped at the SMTP door, which reads as a flaky mailbox rather than
1852
+ the ordering bug it is.
1853
+ """
1854
+
1855
+ previous = self._bootstrap.get()
1856
+ self.register_namespace(namespace, capability)
1857
+ # Candidate trials route direct SMTP into one fixed namespace. Mirror
1858
+ # that ABI during paired reference capture so runtimes using the direct
1859
+ # writer do not need the structured transport's namespace headers.
1860
+ self.smtp.fixed_namespace = namespace
1861
+ self._bootstrap.rotate(namespace=namespace, capability=capability)
1862
+ if previous is not None and previous.namespace != namespace:
1863
+ self.store.seal_namespace(previous.namespace)
1864
+
1865
+ def start(self) -> "LocalMailboxSidecar":
1866
+ if not self.store.healthy():
1867
+ raise MailpitInfrastructureError("Mailpit is not ready")
1868
+ for server in self._servers:
1869
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
1870
+ thread.start()
1871
+ self._threads.append(thread)
1872
+ return self
1873
+
1874
+ def close(self) -> None:
1875
+ for server in self._servers:
1876
+ server.shutdown()
1877
+ server.server_close()
1878
+ for thread in self._threads:
1879
+ thread.join(timeout=5)
1880
+ self._threads.clear()
1881
+ self.store.destroy_namespaces()
1882
+
1883
+ def __enter__(self) -> "LocalMailboxSidecar":
1884
+ return self.start()
1885
+
1886
+ def __exit__(self, exc_type: object, exc: object, traceback: object) -> None:
1887
+ self.close()
1888
+
1889
+
1890
+ class CandidateMailboxTrial:
1891
+ """One formal case's write-only candidate mailbox and trusted reader.
1892
+
1893
+ Candidate code prefers the Resend-style ``POST /emails`` endpoint and may
1894
+ use ``smtp``/``bootstrap`` for compatibility. Both writers are fixed to
1895
+ this trial's namespace. The verifier API listens on a third, unadvertised
1896
+ port that the candidate sandbox does not permit, and it uses a distinct
1897
+ read credential that never enters the candidate environment.
1898
+ """
1899
+
1900
+ def __init__(
1901
+ self,
1902
+ *,
1903
+ bind_host: str = "127.0.0.1",
1904
+ mailpit_client: MailpitClient | None = None,
1905
+ ) -> None:
1906
+ self._runtime = None if mailpit_client is not None else EphemeralMailpit()
1907
+ storage_client = (
1908
+ mailpit_client
1909
+ if mailpit_client is not None
1910
+ else self._runtime.client
1911
+ if self._runtime is not None
1912
+ else None
1913
+ )
1914
+ namespace, read_credential, _inbox_token = _mint_identity()
1915
+ self.namespace = namespace
1916
+ self.read_credential = read_credential
1917
+ self._write_capability = secrets.token_hex(32)
1918
+ self._bootstrap_token = secrets.token_hex(32)
1919
+ self._mail_api_token = secrets.token_hex(32)
1920
+ self._sender = CANDIDATE_MAIL_SENDER
1921
+ self.store = MailboxStore(mailpit_client=storage_client)
1922
+ self.store.register(
1923
+ namespace,
1924
+ read_credential,
1925
+ allowed_from=(self._sender,),
1926
+ )
1927
+ self.smtp = _SmtpServer(
1928
+ (bind_host, 0),
1929
+ self.store,
1930
+ fixed_namespace=namespace,
1931
+ )
1932
+ self.http = _HttpServer(
1933
+ (bind_host, 0),
1934
+ _http_handler(self.store),
1935
+ )
1936
+ self.bootstrap = _HttpServer(
1937
+ (bind_host, 0),
1938
+ _candidate_bootstrap_handler(
1939
+ store=self.store,
1940
+ bootstrap_token=self._bootstrap_token,
1941
+ mail_api_token=self._mail_api_token,
1942
+ namespace=namespace,
1943
+ capability=self._write_capability,
1944
+ smtp_host=bind_host,
1945
+ smtp_port=self.smtp_port,
1946
+ sender=self._sender,
1947
+ ),
1948
+ )
1949
+ self._threads: list[threading.Thread] = []
1950
+
1951
+ @property
1952
+ def smtp_port(self) -> int:
1953
+ return int(self.smtp.server_address[1])
1954
+
1955
+ @property
1956
+ def http_port(self) -> int:
1957
+ return int(self.http.server_address[1])
1958
+
1959
+ @property
1960
+ def bootstrap_port(self) -> int:
1961
+ return int(self.bootstrap.server_address[1])
1962
+
1963
+ @property
1964
+ def url(self) -> str:
1965
+ return f"http://127.0.0.1:{self.http_port}"
1966
+
1967
+ @property
1968
+ def candidate_environment(self) -> dict[str, str]:
1969
+ """The complete optional mail ABI handed to the candidate runtime."""
1970
+
1971
+ return {
1972
+ "WEBSITEBENCH_MAIL_API_URL": (
1973
+ f"http://127.0.0.1:{self.bootstrap_port}/emails"
1974
+ ),
1975
+ "WEBSITEBENCH_MAIL_API_TOKEN": self._mail_api_token,
1976
+ "WEBSITEBENCH_MAIL_FROM": self._sender,
1977
+ "WEBSITEBENCH_SMTP_HOST": "127.0.0.1",
1978
+ "WEBSITEBENCH_SMTP_PORT": str(self.smtp_port),
1979
+ "WEBSITEBENCH_SMTP_FROM": self._sender,
1980
+ # Compatibility seam for candidates using websitebench.site_backend.
1981
+ # It serves write coordinates only and has no read routes.
1982
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL": (
1983
+ f"http://127.0.0.1:{self.bootstrap_port}/internal/bootstrap"
1984
+ ),
1985
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN": self._bootstrap_token,
1986
+ }
1987
+
1988
+ @property
1989
+ def candidate_connect_ports(self) -> frozenset[int]:
1990
+ return frozenset({self.smtp_port, self.bootstrap_port})
1991
+
1992
+ def start(self) -> "CandidateMailboxTrial":
1993
+ if self._runtime is not None:
1994
+ try:
1995
+ self._runtime.start()
1996
+ except BaseException:
1997
+ for server in (self.smtp, self.http, self.bootstrap):
1998
+ server.server_close()
1999
+ raise
2000
+ if not self.store.healthy():
2001
+ for server in (self.smtp, self.http, self.bootstrap):
2002
+ server.server_close()
2003
+ if self._runtime is not None:
2004
+ self._runtime.close()
2005
+ raise MailpitInfrastructureError("Mailpit is not ready")
2006
+ for server in (self.smtp, self.http, self.bootstrap):
2007
+ thread = threading.Thread(
2008
+ target=server.serve_forever,
2009
+ name=f"candidate-mailbox-{server.server_address[1]}",
2010
+ daemon=True,
2011
+ )
2012
+ thread.start()
2013
+ self._threads.append(thread)
2014
+ return self
2015
+
2016
+ def close(self) -> None:
2017
+ for server in (self.smtp, self.http, self.bootstrap):
2018
+ server.shutdown()
2019
+ server.server_close()
2020
+ for thread in self._threads:
2021
+ thread.join(timeout=5)
2022
+ self._threads.clear()
2023
+ self.store.destroy_namespaces()
2024
+ if self._runtime is not None:
2025
+ self._runtime.close()
2026
+
2027
+ def __enter__(self) -> "CandidateMailboxTrial":
2028
+ return self.start()
2029
+
2030
+ def __exit__(self, exc_type: object, exc: object, traceback: object) -> None:
2031
+ self.close()
2032
+
2033
+
2034
+ def _candidate_environment_problem(
2035
+ environment: Mapping[str, str], private_values: tuple[str, ...]
2036
+ ) -> str | None:
2037
+ """Return why ``environment`` may not be handed to a candidate, or ``None``.
2038
+
2039
+ The candidate mail ABI is a closed set of names carrying loopback
2040
+ coordinates only. A name outside the set, a Mailpit control variable, or
2041
+ any value naming the evaluator's own Mailpit socket would hand a candidate
2042
+ the trusted store instead of its write-only door.
2043
+ """
2044
+
2045
+ unknown = sorted(set(environment) - CANDIDATE_MAIL_ENVIRONMENT)
2046
+ if unknown:
2047
+ return f"candidate mailbox environment has unknown names: {unknown}"
2048
+ leaked = any(
2049
+ name.startswith("WEBSITEBENCH_MAILPIT_")
2050
+ or MAILPIT_RUNTIME_DIR in str(value)
2051
+ or any(private and private in str(value) for private in private_values)
2052
+ for name, value in environment.items()
2053
+ )
2054
+ if leaked:
2055
+ return "candidate mailbox environment exposed the Mailpit UDS"
2056
+ return None
2057
+
2058
+
2059
+ class MailTrial:
2060
+ """One case's candidate mailbox, as the rest of the evaluator sees it.
2061
+
2062
+ The candidate environment handed out here is already proved to be the
2063
+ closed mail ABI and free of evaluator-side coordinates, so no caller
2064
+ re-scans it. Reads stay on the trusted side: :meth:`deliveries` is the
2065
+ only way out of the store and it never leaves this trial's namespace.
2066
+ """
2067
+
2068
+ def __init__(
2069
+ self,
2070
+ trial: CandidateMailboxTrial,
2071
+ *,
2072
+ private_values: tuple[str, ...] = (),
2073
+ ) -> None:
2074
+ environment = dict(trial.candidate_environment)
2075
+ problem = _candidate_environment_problem(environment, private_values)
2076
+ if problem is not None:
2077
+ trial.close()
2078
+ raise MailpitInfrastructureError(problem)
2079
+ self._trial = trial
2080
+ self._environment = environment
2081
+
2082
+ @property
2083
+ def namespace(self) -> str:
2084
+ return self._trial.namespace
2085
+
2086
+ @property
2087
+ def read_credential(self) -> str:
2088
+ return self._trial.read_credential
2089
+
2090
+ @property
2091
+ def url(self) -> str:
2092
+ """The verifier-only reader origin; the candidate cannot reach it."""
2093
+
2094
+ return self._trial.url
2095
+
2096
+ @property
2097
+ def http_port(self) -> int:
2098
+ return self._trial.http_port
2099
+
2100
+ @property
2101
+ def store(self) -> MailboxStore:
2102
+ return self._trial.store
2103
+
2104
+ @property
2105
+ def candidate_environment(self) -> dict[str, str]:
2106
+ """The complete optional mail ABI this case's candidate receives."""
2107
+
2108
+ return dict(self._environment)
2109
+
2110
+ @property
2111
+ def candidate_connect_ports(self) -> frozenset[int]:
2112
+ """The loopback ports the candidate sandbox may connect out to."""
2113
+
2114
+ return self._trial.candidate_connect_ports
2115
+
2116
+ def healthy(self) -> bool:
2117
+ """Whether the backing store still answers, so an outage is not scored."""
2118
+
2119
+ return self._trial.store.healthy()
2120
+
2121
+ def deliveries(self) -> list[dict[str, Any]]:
2122
+ """Every message this trial's namespace received, newest first."""
2123
+
2124
+ return self._trial.store.messages(self._trial.namespace)
2125
+
2126
+ def close(self) -> None:
2127
+ self._trial.close()
2128
+
2129
+ def __enter__(self) -> "MailTrial":
2130
+ return self
2131
+
2132
+ def __exit__(self, exc_type: object, exc: object, traceback: object) -> None:
2133
+ self.close()
2134
+
2135
+
2136
+ class MailPlane:
2137
+ """The evaluator's single door to Mailpit.
2138
+
2139
+ Everything that knows a socket path, a container lifetime, a namespace or
2140
+ the candidate mail ABI lives behind this facade. ``formal``,
2141
+ ``trusted_check`` and ``capture`` ask the plane for a trial, a runner
2142
+ passthrough or an authoring gateway; they never build a Mailpit client,
2143
+ read a Mailpit variable, or inspect what they hand a candidate.
2144
+ """
2145
+
2146
+ def __init__(
2147
+ self, client: MailpitClient, *, runtime: EphemeralMailpit | None = None
2148
+ ) -> None:
2149
+ self.client = client
2150
+ self._runtime = runtime
2151
+
2152
+ @staticmethod
2153
+ def _configured_socket(env: Mapping[str, str]) -> str:
2154
+ """The evaluator's only read of :data:`MAILPIT_HTTP_SOCKET_ENV`."""
2155
+
2156
+ return str(env.get(MAILPIT_HTTP_SOCKET_ENV, "") or "").strip()
2157
+
2158
+ @classmethod
2159
+ def from_environment(cls, env: Mapping[str, str] = os.environ) -> "MailPlane":
2160
+ """Open the Mailpit the environment advertises.
2161
+
2162
+ A missing variable and an unhealthy Mailpit are the same answer to the
2163
+ caller: this process has no mail plane.
2164
+ """
2165
+
2166
+ socket_path = cls._configured_socket(env)
2167
+ if not socket_path:
2168
+ raise MailInfrastructureUnavailable(
2169
+ f"{MAILPIT_HTTP_SOCKET_ENV} is not configured"
2170
+ )
2171
+ client = MailpitClient(socket_path)
2172
+ if not client.ready():
2173
+ raise MailInfrastructureUnavailable(
2174
+ "Mailpit is not ready on its configured HTTP socket"
2175
+ )
2176
+ return cls(client)
2177
+
2178
+ @classmethod
2179
+ def ephemeral(
2180
+ cls, runtime_dir: str | os.PathLike[str] | None = None
2181
+ ) -> "MailPlane":
2182
+ """Start a private, networkless Mailpit this plane owns and will stop.
2183
+
2184
+ Host-side only: a Harbor trial has no Docker binary, so a scored run
2185
+ always goes through :meth:`from_environment` instead.
2186
+ """
2187
+
2188
+ runtime = EphemeralMailpit(runtime_dir=runtime_dir).start()
2189
+ return cls(runtime.client, runtime=runtime)
2190
+
2191
+ @classmethod
2192
+ def open(
2193
+ cls,
2194
+ *,
2195
+ runtime_dir: str | os.PathLike[str] | None = None,
2196
+ env: Mapping[str, str] = os.environ,
2197
+ ) -> "MailPlane":
2198
+ """Prefer the advertised Mailpit; start a private one when there is none."""
2199
+
2200
+ if cls._configured_socket(env):
2201
+ return cls.from_environment(env)
2202
+ return cls.ephemeral(runtime_dir=runtime_dir)
2203
+
2204
+ @property
2205
+ def socket_path(self) -> str:
2206
+ return self.client.socket_path
2207
+
2208
+ @property
2209
+ def owns_runtime(self) -> bool:
2210
+ """Whether closing this plane stops a Mailpit container."""
2211
+
2212
+ return self._runtime is not None
2213
+
2214
+ def healthy(self) -> bool:
2215
+ return self.client.ready()
2216
+
2217
+ def trial(self, *, bind_host: str = "127.0.0.1") -> MailTrial:
2218
+ """Start one case's write-only candidate mailbox on this plane.
2219
+
2220
+ The result is a context manager, so a caller that owns the mailbox for
2221
+ the length of a ``with`` block needs no other cleanup; a caller that
2222
+ owns it for the length of a case calls :meth:`MailTrial.close`.
2223
+ """
2224
+
2225
+ trial = CandidateMailboxTrial(
2226
+ bind_host=bind_host, mailpit_client=self.client
2227
+ ).start()
2228
+ return MailTrial(trial, private_values=(self.socket_path,))
2229
+
2230
+ def runner_environment(self, base: Mapping[str, str]) -> dict[str, str]:
2231
+ """Add to ``base`` exactly what a child verifier runner needs.
2232
+
2233
+ A trusted CI/CD runner is launched with a scrubbed environment and has
2234
+ to find the same Mailpit; that is one variable, and no other mail
2235
+ coordinate crosses the boundary.
2236
+ """
2237
+
2238
+ return {**dict(base), MAILPIT_HTTP_SOCKET_ENV: self.socket_path}
2239
+
2240
+ def authoring_gateway(
2241
+ self,
2242
+ *,
2243
+ namespace: str,
2244
+ capability: str,
2245
+ bootstrap_token: str,
2246
+ smtp_port: int,
2247
+ bind_host: str = "127.0.0.1",
2248
+ ) -> LocalMailboxSidecar:
2249
+ """Expose the stable loopback writer ABI over this plane, for authoring.
2250
+
2251
+ Capture hands a reference site the same SMTP/bootstrap door a scored
2252
+ candidate gets, so what capture exercises is what a trial will run.
2253
+ There is intentionally no in-memory fallback.
2254
+ """
2255
+
2256
+ if not self.client.ready():
2257
+ raise MailInfrastructureUnavailable("Mailpit is not ready for capture")
2258
+ sidecar = LocalMailboxSidecar(
2259
+ smtp_port=smtp_port,
2260
+ bind_host=bind_host,
2261
+ bootstrap=_Bootstrap(
2262
+ token=bootstrap_token,
2263
+ namespace=namespace,
2264
+ capability=capability,
2265
+ smtp_host=bind_host,
2266
+ smtp_port=smtp_port,
2267
+ ),
2268
+ mailpit_client=self.client,
2269
+ )
2270
+ sidecar.register_namespace(namespace, capability)
2271
+ sidecar.start()
2272
+ return sidecar
2273
+
2274
+ def close(self) -> None:
2275
+ runtime, self._runtime = self._runtime, None
2276
+ if runtime is not None:
2277
+ runtime.close()
2278
+
2279
+ def __enter__(self) -> "MailPlane":
2280
+ return self
2281
+
2282
+ def __exit__(self, exc_type: object, exc: object, traceback: object) -> None:
2283
+ self.close()
2284
+
2285
+
2286
+ def authoring_environment(
2287
+ sidecar: LocalMailboxSidecar,
2288
+ *,
2289
+ namespace: str,
2290
+ capability: str,
2291
+ bootstrap_token: str,
2292
+ smtp_port: int,
2293
+ smtp_host: str = "127.0.0.1",
2294
+ ) -> dict[str, str]:
2295
+ """The complete mail ABI an authoring capture exports around a reference site.
2296
+
2297
+ It is a superset of the candidate ABI: authoring also owns the read
2298
+ credential and the namespace, which a scored candidate never sees. The
2299
+ names are exactly :data:`AUTHORING_MAIL_ENVIRONMENT`.
2300
+ """
2301
+
2302
+ gateway = sidecar.url.rstrip("/")
2303
+ return {
2304
+ "WEBSITEBENCH_MAILBOX_URL": sidecar.url,
2305
+ "WEBSITEBENCH_MAILBOX_ALLOWLIST": "",
2306
+ "WEBSITEBENCH_MAILBOX_CREDENTIAL": capability,
2307
+ "WEBSITEBENCH_MAILBOX_NAMESPACE": namespace,
2308
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL": f"{gateway}/internal/bootstrap",
2309
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN": bootstrap_token,
2310
+ "WEBSITEBENCH_SMTP_HOST": smtp_host,
2311
+ "WEBSITEBENCH_SMTP_PORT": str(smtp_port),
2312
+ # Paired capture must present the same sender ABI as a formal candidate
2313
+ # trial: some runtimes pin this exact suffix before opening SMTP, so a
2314
+ # site-specific authoring sender would disable their only mail path.
2315
+ "WEBSITEBENCH_MAIL_API_URL": f"{gateway}/emails",
2316
+ "WEBSITEBENCH_MAIL_API_TOKEN": bootstrap_token,
2317
+ "WEBSITEBENCH_MAIL_FROM": CANDIDATE_MAIL_SENDER,
2318
+ "WEBSITEBENCH_SMTP_FROM": CANDIDATE_MAIL_SENDER,
2319
+ }
2320
+
2321
+
2322
+ def _mint_identity() -> tuple[str, str, str]:
2323
+ """Mint one trial's mailbox identity.
2324
+
2325
+ Minted from ``secrets``, never derived from the public ``seed-<seed>``
2326
+ trial ID, while the inbox token doubles as the browser's access token.
2327
+ Determinism is not lost, because scoring reads no mail.
2328
+ """
2329
+
2330
+ return (
2331
+ f"trial-{secrets.token_hex(16)}",
2332
+ secrets.token_hex(32),
2333
+ secrets.token_urlsafe(32),
2334
+ )
2335
+
2336
+
2337
+ def main(argv: list[str] | None = None) -> int:
2338
+ """Run one trial's mailbox, minting that trial's identity at boot.
2339
+
2340
+ ``materialize`` runs once per *bundle*; a trial is one *run* of that
2341
+ bundle, so a value written into ``docker-compose.yaml`` can never be
2342
+ per-trial. The identity is therefore minted here, by the one process that
2343
+ owns it, and each party learns only its own half over the listener it is
2344
+ allowed to reach: the site reads ``/internal/bootstrap`` on the API
2345
+ listener, the agent gets a bare inbox URL and no credential at all.
2346
+
2347
+ The values come from ``secrets`` rather than from the public
2348
+ ``seed-<seed>`` trial ID. Determinism is not lost, because formal scoring
2349
+ never reads mail.
2350
+ """
2351
+
2352
+ import argparse
2353
+
2354
+ parser = argparse.ArgumentParser(prog="websitebench-local-mailbox")
2355
+ parser.add_argument("--smtp-port", type=int, default=1025)
2356
+ parser.add_argument("--http-port", type=int, default=8025)
2357
+ parser.add_argument("--inbox-port", type=int, default=8026)
2358
+ parser.add_argument("--bind-host", default="127.0.0.1")
2359
+ parser.add_argument(
2360
+ "--api-bind-host",
2361
+ default=None,
2362
+ help="interface for the SMTP and JSON API listeners (defaults to --bind-host)",
2363
+ )
2364
+ parser.add_argument(
2365
+ "--inbox-bind-host",
2366
+ default=None,
2367
+ help="interface for the agent inbox listener (defaults to --bind-host)",
2368
+ )
2369
+ args = parser.parse_args(argv)
2370
+
2371
+ api_bind = (
2372
+ args.api_bind_host
2373
+ or os.environ.get("WEBSITEBENCH_MAILBOX_API_BIND")
2374
+ or args.bind_host
2375
+ )
2376
+ inbox_bind = (
2377
+ args.inbox_bind_host
2378
+ or os.environ.get("WEBSITEBENCH_MAILBOX_INBOX_BIND")
2379
+ or args.bind_host
2380
+ )
2381
+ smtp_advertise_host = (
2382
+ os.environ.get("WEBSITEBENCH_MAILBOX_SMTP_ADVERTISE_HOST", "").strip()
2383
+ or api_bind
2384
+ )
2385
+
2386
+ namespace, capability, inbox_token = _mint_identity()
2387
+ bootstrap_token = os.environ.get("WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN", "")
2388
+ if len(bootstrap_token) < 32:
2389
+ raise SystemExit(
2390
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN must be at least 32 characters"
2391
+ )
2392
+ try:
2393
+ mailpit_client = MailPlane.from_environment().client
2394
+ except MailInfrastructureUnavailable as error:
2395
+ # The sidecar discovers its store the same way the evaluator does, and
2396
+ # refuses to serve an in-memory production mailbox when there is none.
2397
+ raise SystemExit(f"{error}; refusing an in-memory production mailbox")
2398
+
2399
+ stopped = threading.Event()
2400
+ signal.signal(signal.SIGTERM, lambda _signum, _frame: stopped.set())
2401
+ signal.signal(signal.SIGINT, lambda _signum, _frame: stopped.set())
2402
+ sidecar = LocalMailboxSidecar(
2403
+ smtp_port=args.smtp_port,
2404
+ http_port=args.http_port,
2405
+ bind_host=api_bind,
2406
+ inbox_port=args.inbox_port,
2407
+ inbox_bind_host=inbox_bind,
2408
+ inbox_namespace=namespace,
2409
+ inbox_token=inbox_token,
2410
+ bootstrap=_Bootstrap(
2411
+ token=bootstrap_token,
2412
+ namespace=namespace,
2413
+ capability=capability,
2414
+ smtp_host=smtp_advertise_host,
2415
+ smtp_port=args.smtp_port,
2416
+ ),
2417
+ mailpit_client=mailpit_client,
2418
+ )
2419
+ sidecar.register_namespace(namespace, capability)
2420
+ sidecar.start()
2421
+ # The inbox path is the agent's entry point and holds no secret beyond the
2422
+ # token that scopes it to this trial; nothing else about the trial is
2423
+ # printed, and the capability never is.
2424
+ print(f"inbox listening on {inbox_bind}:{args.inbox_port}", flush=True)
2425
+ try:
2426
+ stopped.wait()
2427
+ finally:
2428
+ sidecar.close()
2429
+ return 0
2430
+
2431
+
2432
+ if __name__ == "__main__":
2433
+ raise SystemExit(main(sys.argv[1:]))
tasks/llbean/environment/reference/.websitebench-reference-tls/ca.crt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDSzCCAjOgAwIBAgIJV1NCSEFSQk9SMA0GCSqGSIb3DQEBCwUAMDExLzAtBgNV
3
+ BAMMJldlYnNpdGVCZW5jaCBIYXJib3IgTG9jYWwgUmVmZXJlbmNlIENBMB4XDTI2
4
+ MDgyMjEzMDg1NloXDTQ2MDgyMjEzMDg1NlowMTEvMC0GA1UEAwwmV2Vic2l0ZUJl
5
+ bmNoIEhhcmJvciBMb2NhbCBSZWZlcmVuY2UgQ0EwggEiMA0GCSqGSIb3DQEBAQUA
6
+ A4IBDwAwggEKAoIBAQCnBZES7bXJo/hajL5T54GDV/FLmQxmk0dGN+aPwRrgpiN6
7
+ syddg/krh/dhiUzfxgJV+6ajnYuYyQ4BVo1rQGY0va95T8cjcHgC7EyEAaDUZF+i
8
+ qo3v/ucMmquZodezEkghWz6FDcGH3dDtz0bQyYgoGQKnioeYXsVlfvIzXJpE1VTW
9
+ iGUH83/APzvPInZ5jRRrCEnqj1WtSoi+Yycs/eaYueDomoZeT3xvK5MTz6tC6EvW
10
+ hAh8qyv2DjPZUSToiZH23X6qXYRkKkLDXHWHfhamRwlFoh9pp2s4D+Cq/Wke+o2f
11
+ /cj8KvAkTnMo4iMmZFpb/NRaGjhfy8UBPuM7SwMJAgMBAAGjZjBkMB0GA1UdDgQW
12
+ BBQn+U1eizvlvKbfavSxHoXFYQ/UfTAfBgNVHSMEGDAWgBQn+U1eizvlvKbfavSx
13
+ HoXFYQ/UfTASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjANBgkq
14
+ hkiG9w0BAQsFAAOCAQEAoSC3zzZEAs2eigloiDkdeh98+2cPmcs44TG+TU6sq6SP
15
+ EBEgHg/c6yzh74UijEImksT9aZ+LxtTNM+nfNFzWku1T3R7gSimP5TSnC4rTEhfM
16
+ Ih8fMoUbcAe/uFwVE9UHn/QQNsqRg6hg2jdUlmwr206e62/eBQXDNeuLcapAxcdU
17
+ VYno4HNi5gAaakS2dM/IgiorRqM7SVT+s8B9Fl0mzMdRNCUeOOU4q8zGtQGp4IV+
18
+ x/LZIMsLogP2Rpks8ecyanRSXYpGbqpZ+14rcO5bdWQ7P8B/sFssT3b1mR3H/aVh
19
+ yZycwgzCbkbdMaxyz2Vm/c7PVb3so5Xb98jufp2L9A==
20
+ -----END CERTIFICATE-----
tasks/llbean/environment/reference/.websitebench-reference-tls/reference.crt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDWjCCAkKgAwIBAgIIV1NCUkVGMDEwDQYJKoZIhvcNAQELBQAwMTEvMC0GA1UE
3
+ AwwmV2Vic2l0ZUJlbmNoIEhhcmJvciBMb2NhbCBSZWZlcmVuY2UgQ0EwHhcNMjYw
4
+ ODIyMTMwODU2WhcNNDYwODIyMTMwODU2WjAUMRIwEAYDVQQDDAlyZWZlcmVuY2Uw
5
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNJXc7onbK78RiLSAe3LjI
6
+ eko9xNumYRejoB+kKFGLBL4U7vY+02coiXpne4e1CMzUVzRiaQ9i9XHBe0Oq4CR1
7
+ HW7wzMRV8XVM5/dVq+j0vZVarZbITyHSWHwypa7yPL7o/kBekdwi8ncdUy/mhYqw
8
+ 7sOdM4Nq0ifj+lcJ/rwSqjvcML4//4THY9CP5iB2YT+U+Z7F/JfLOJFZ12l4Sglx
9
+ RDf1awDLJpGfpX0kRgW7jYuWf49C5VcPjggTRl1WYy1qrgaNIFu75sresXYkDgRx
10
+ uLiXfc/6wNwykh9fQo+GNFqBGy2lC8Ey425m4XEROraenAGMqVMfxJsJ5wjqRhlV
11
+ AgMBAAGjgZIwgY8wDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0l
12
+ BAwwCgYIKwYBBQUHAwEwGgYDVR0RBBMwEYIJcmVmZXJlbmNlhwR/AAABMB0GA1Ud
13
+ DgQWBBQ0EtbLFU1HI9Wdikc8qRx8TdRT8TAfBgNVHSMEGDAWgBQn+U1eizvlvKbf
14
+ avSxHoXFYQ/UfTANBgkqhkiG9w0BAQsFAAOCAQEATXVQdAfuOvbbsBhNHCvfoYuM
15
+ rgnUOdAHevutvg/gPe6AcshAJMvvfL6J/TpimY+TKDqVBVs0qB6jXjgZURQ9EsFR
16
+ WDJywamDHAFNTTuq1A+78VAS3LK3z54JH2BRlvtjnEDkzDei0/brOentce73YwVR
17
+ XU6+y/yGlSYGdq63wzDxBOUwD/I/src9WpmYqrSwstlD1epemMUIsfDpfSRcGYM2
18
+ tB+zMBccmP/hrB3eJcrjiediwhSBNJjdKysK66GzFRqcyGwwvsz1YPbWcpcQXoVZ
19
+ nnNXEs5TrxTj67/DLuP/233oEoz2XQNh1O2ohq1o5JMu4hbotqkepCwcidNBmQ==
20
+ -----END CERTIFICATE-----
tasks/llbean/environment/reference/.websitebench-reference-tls/reference.key ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -----BEGIN PRIVATE KEY-----
2
+ MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDNJXc7onbK78Ri
3
+ LSAe3LjIeko9xNumYRejoB+kKFGLBL4U7vY+02coiXpne4e1CMzUVzRiaQ9i9XHB
4
+ e0Oq4CR1HW7wzMRV8XVM5/dVq+j0vZVarZbITyHSWHwypa7yPL7o/kBekdwi8ncd
5
+ Uy/mhYqw7sOdM4Nq0ifj+lcJ/rwSqjvcML4//4THY9CP5iB2YT+U+Z7F/JfLOJFZ
6
+ 12l4SglxRDf1awDLJpGfpX0kRgW7jYuWf49C5VcPjggTRl1WYy1qrgaNIFu75sre
7
+ sXYkDgRxuLiXfc/6wNwykh9fQo+GNFqBGy2lC8Ey425m4XEROraenAGMqVMfxJsJ
8
+ 5wjqRhlVAgMBAAECggEAIdiyWyGzKUjVVSBeWhEvII6CpL3Pwpvmz02KIuavC3l5
9
+ FhGWCagN71N9YUjxizYcO1V29FyimABoaBR7BdyMz1DPnsWeCBL6ODnWZilimkyU
10
+ MX2N8NcTfLWyKhYJbviERAM84g19LTvlWK6Cqu0yBH6kQhG/dzacs8G4LhM7+vUU
11
+ +43RFW4GFmYDXtfUEZuZ8IRzWxDdXQ9yVnKxKrhuYj4/UYgTTspOx87m++Ft6BJR
12
+ IQRw1dZ7dE2R8pZbYQdOXRXSjf59KisJSr9N2+mYZYNUWWv7zF8bmD17hxtsQk9C
13
+ wesyN3DqzoLHK3GfoG3ZuA+v3aEVKHRk8Tc1aosYyQKBgQD0ddALajm0XHictsG3
14
+ /JTC1RL0nj+SoVVgYdWccA7VUs68Cbpq1RYzUawDOhYlQjbJBJTQ9z5kwWP+50vH
15
+ VPjpU/cMFx4d63WwDEXcC2o09mh3OjkfujUdRroyn6rJgKXuSJeMAz0JrGCTIS91
16
+ 0t2cmoSqKSIaN2oU5IsONLg6SQKBgQDW1JBCiP1c6tYi9wKpEJLjlRqSIsLgLApg
17
+ h6o1sWFfUrbQ21ORS1jhLnCkJsyLWoyZkUgwaXbXoLoVw3kIdPLJ8TI1FJ+ZPYdt
18
+ EJcvvVjmJIrcq9um1qoKKpmiKuwRe4/OYdFQcdTRwob1wpoAi7T9CfiNgo53WHsR
19
+ mviPzSEGrQKBgQDnpL+YIXc+niU4MsFL6463NBq7Kz0IX9I7+1jj3RdhMw9tBTbd
20
+ Rr+7r1d001Tqx1yMjMfLX42DAfIUN+4Jm04mIwdFMJ68MUMap/aGtVZVi2ygFc7N
21
+ brAn5r5HfB7kw//31FeuN99dzDbTFC4Z0s9mNtEhQMrs1rexxoKx2mj76QKBgBi5
22
+ AZkGltG4nMgNURsPszfJkvM6WN7fcppFQotHTINhy3QhqW5RE3tmksPxSxzGYOPT
23
+ WlFn8atC7edPRYB5pO8keLivFObXs9wTSrLNwYtKrUhT5sU+cvcUi/WjpuMkKxp/
24
+ G018rBcvocRqjrp9WWi9WwM+ARMu9YrDINO7sY9JAoGBAJlTUtKVOOuaujK53Vnq
25
+ 2O5FrC/HcsUa1nTRO/WSDyUjGWeqAr75yi05UD6M2tTov1uGbtg47Q5n6eqjVyy3
26
+ FTYmG+lVbVXjVcOFuUhZxJhELsHulsJ1LRPAJccC0Uci8IZ8rfIZyREn7tKpBJI4
27
+ 4s+BQ5R45Cv3eUi2JU/xuAtK
28
+ -----END PRIVATE KEY-----
tasks/llbean/environment/reference/.websitebench-reference-tls/tls_proxy.py ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Terminate trusted local TLS in front of a Harbor reference process.
2
+
3
+ The reference application's own launch contract remains HTTP on loopback. The
4
+ Agent-facing Docker service is HTTPS only, so Secure ``__Host-`` cookies have
5
+ the same browser semantics as the source site without changing clone code.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import asyncio
11
+ import contextlib
12
+ import os
13
+ import signal
14
+ import ssl
15
+ import subprocess
16
+ import sys
17
+ from pathlib import Path
18
+
19
+
20
+ BUFFER_SIZE = 64 * 1024
21
+ STARTUP_TIMEOUT_SECONDS = 30.0
22
+
23
+
24
+ async def _copy_stream(
25
+ reader: asyncio.StreamReader,
26
+ writer: asyncio.StreamWriter,
27
+ ) -> None:
28
+ while block := await reader.read(BUFFER_SIZE):
29
+ writer.write(block)
30
+ await writer.drain()
31
+
32
+
33
+ async def _forward(
34
+ client_reader: asyncio.StreamReader,
35
+ client_writer: asyncio.StreamWriter,
36
+ *,
37
+ upstream_port: int,
38
+ ) -> None:
39
+ try:
40
+ upstream_reader, upstream_writer = await asyncio.open_connection(
41
+ "127.0.0.1", upstream_port
42
+ )
43
+ except OSError:
44
+ client_writer.close()
45
+ await client_writer.wait_closed()
46
+ return
47
+
48
+ tasks = {
49
+ asyncio.create_task(_copy_stream(client_reader, upstream_writer)),
50
+ asyncio.create_task(_copy_stream(upstream_reader, client_writer)),
51
+ }
52
+ try:
53
+ _done, pending = await asyncio.wait(
54
+ tasks, return_when=asyncio.FIRST_COMPLETED
55
+ )
56
+ for task in pending:
57
+ task.cancel()
58
+ await asyncio.gather(*tasks, return_exceptions=True)
59
+ finally:
60
+ upstream_writer.close()
61
+ client_writer.close()
62
+ with contextlib.suppress(OSError):
63
+ await upstream_writer.wait_closed()
64
+ with contextlib.suppress(OSError):
65
+ await client_writer.wait_closed()
66
+
67
+
68
+ async def _wait_for_upstream(process: subprocess.Popen[bytes], port: int) -> None:
69
+ loop = asyncio.get_running_loop()
70
+ deadline = loop.time() + STARTUP_TIMEOUT_SECONDS
71
+ while loop.time() < deadline:
72
+ return_code = process.poll()
73
+ if return_code is not None:
74
+ raise RuntimeError(
75
+ f"reference process exited before readiness with {return_code}"
76
+ )
77
+ try:
78
+ _reader, writer = await asyncio.open_connection("127.0.0.1", port)
79
+ except OSError:
80
+ await asyncio.sleep(0.1)
81
+ continue
82
+ writer.close()
83
+ await writer.wait_closed()
84
+ return
85
+ raise TimeoutError("reference process did not open its loopback port")
86
+
87
+
88
+ async def _terminate(process: subprocess.Popen[bytes]) -> None:
89
+ if process.poll() is not None:
90
+ return
91
+ process.terminate()
92
+ try:
93
+ await asyncio.wait_for(asyncio.to_thread(process.wait), timeout=10.0)
94
+ except TimeoutError:
95
+ process.kill()
96
+ await asyncio.to_thread(process.wait)
97
+
98
+
99
+ async def _serve(command: list[str]) -> int:
100
+ external_port = int(os.environ.get("PORT", "8080"))
101
+ upstream_port = int(
102
+ os.environ.get("WEBSITEBENCH_REFERENCE_UPSTREAM_PORT", "18080")
103
+ )
104
+ if external_port == upstream_port:
105
+ raise ValueError("reference TLS and upstream ports must differ")
106
+
107
+ child_environment = dict(os.environ)
108
+ child_environment["HOST"] = "127.0.0.1"
109
+ child_environment["PORT"] = str(upstream_port)
110
+ process = subprocess.Popen(command, env=child_environment)
111
+ server: asyncio.AbstractServer | None = None
112
+ try:
113
+ await _wait_for_upstream(process, upstream_port)
114
+ tls_root = Path(__file__).resolve().parent
115
+ context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
116
+ context.minimum_version = ssl.TLSVersion.TLSv1_2
117
+ context.load_cert_chain(
118
+ certfile=tls_root / "reference.crt",
119
+ keyfile=tls_root / "reference.key",
120
+ )
121
+ server = await asyncio.start_server(
122
+ lambda reader, writer: _forward(
123
+ reader, writer, upstream_port=upstream_port
124
+ ),
125
+ "0.0.0.0",
126
+ external_port,
127
+ ssl=context,
128
+ )
129
+ print(
130
+ "WebsiteBench reference HTTPS ready on "
131
+ f"0.0.0.0:{external_port}; upstream=127.0.0.1:{upstream_port}",
132
+ flush=True,
133
+ )
134
+
135
+ stop = asyncio.Event()
136
+ loop = asyncio.get_running_loop()
137
+ for signum in (signal.SIGINT, signal.SIGTERM):
138
+ loop.add_signal_handler(signum, stop.set)
139
+ process_wait = asyncio.create_task(asyncio.to_thread(process.wait))
140
+ stop_wait = asyncio.create_task(stop.wait())
141
+ done, pending = await asyncio.wait(
142
+ {process_wait, stop_wait}, return_when=asyncio.FIRST_COMPLETED
143
+ )
144
+ for task in pending:
145
+ task.cancel()
146
+ await asyncio.gather(*pending, return_exceptions=True)
147
+ if process_wait in done:
148
+ return process_wait.result()
149
+ return 0
150
+ finally:
151
+ if server is not None:
152
+ server.close()
153
+ await server.wait_closed()
154
+ await _terminate(process)
155
+
156
+
157
+ def main() -> int:
158
+ if len(sys.argv) < 2:
159
+ raise SystemExit("usage: tls_proxy.py COMMAND [ARG ...]")
160
+ return asyncio.run(_serve(sys.argv[1:]))
161
+
162
+
163
+ if __name__ == "__main__":
164
+ raise SystemExit(main())
tasks/llbean/environment/reference/Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12.11-slim-bookworm@sha256:519591d6871b7bc437060736b9f7456b8731f1499a57e22e6c285135ae657bf7
2
+ WORKDIR /srv/reference
3
+ # BEGIN WebsiteBench runtime dependencies
4
+ COPY --from=ghcr.io/astral-sh/uv:0.12.8@sha256:d1cbaeadc234fe19c0d93daabcf5e98738cd93c6d1dd4918ef6aa30735feb23a /uv /usr/local/bin/uv
5
+ COPY vendor.requirements.lock vendor.requirements.lock
6
+ RUN uv pip install --python /usr/local/bin/python --no-cache --no-deps --require-hashes --only-binary :all: --link-mode copy --target vendor -r vendor.requirements.lock && rm -f vendor/.lock
7
+ # END WebsiteBench runtime dependencies
8
+ COPY . .
9
+ ENV HOST=0.0.0.0 PORT=8080 DATA_DIR=/tmp/websitebench-llbean-reference-data SEED=0 TZ=UTC
10
+ RUN ./compile.sh
11
+ HEALTHCHECK --interval=2s --timeout=3s --retries=30 CMD python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=2)"
12
+ CMD ["./executable"]
13
+
14
+ # Added by the WebsiteBench Harbor materializer. The original app runs only on loopback; the Agent-facing reference is trusted HTTPS.
15
+ COPY .websitebench-reference-tls/ /opt/websitebench/reference-tls/
16
+ RUN chmod 600 /opt/websitebench/reference-tls/reference.key && chmod 755 /opt/websitebench/reference-tls/tls_proxy.py
17
+ ENV WEBSITEBENCH_REFERENCE_UPSTREAM_PORT=18080
18
+ HEALTHCHECK --interval=2s --timeout=3s --retries=30 CMD python3 -c "import os,ssl,urllib.request as r;c=ssl.create_default_context(cafile='/opt/websitebench/reference-tls/ca.crt');u='https://127.0.0.1:'+os.environ.get('PORT','8080')+'/healthz';r.urlopen(u,context=c,timeout=2).close()"
19
+ CMD ["python3", "/opt/websitebench/reference-tls/tls_proxy.py", "./run.sh"]
tasks/llbean/environment/reference/README.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Direct reference adapter
2
+
3
+ The materializer overlays these ABI files on the frozen L.L.Bean clone and
4
+ backend. The same assembled bytes form the private oracle implementation; the
5
+ clone and backend are not duplicated in this authoring directory.
tasks/llbean/environment/reference/backend/model.json ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "offline-clone.backend-model.v1",
3
+ "site_id": "llbean",
4
+ "status": "draft",
5
+ "profile": "offline-benchmark",
6
+ "database": {
7
+ "engine": "sqlite",
8
+ "location_policy": "runtime-data-outside-candidate",
9
+ "concurrency_model": "wal-transactional-single-writer",
10
+ "migration_strategy": "versioned-forward-migrations",
11
+ "deterministic_reset": true,
12
+ "restart_persistence": true,
13
+ "site_isolation": "one-database-per-site",
14
+ "proofs": [
15
+ {
16
+ "obligation": "data-location",
17
+ "status": "planned",
18
+ "evidence": []
19
+ },
20
+ {
21
+ "obligation": "schema-migration",
22
+ "status": "planned",
23
+ "evidence": []
24
+ },
25
+ {
26
+ "obligation": "deterministic-reset",
27
+ "status": "planned",
28
+ "evidence": []
29
+ },
30
+ {
31
+ "obligation": "restart-persistence",
32
+ "status": "planned",
33
+ "evidence": []
34
+ },
35
+ {
36
+ "obligation": "backup-restore",
37
+ "status": "planned",
38
+ "evidence": []
39
+ },
40
+ {
41
+ "obligation": "concurrency",
42
+ "status": "planned",
43
+ "evidence": []
44
+ }
45
+ ]
46
+ },
47
+ "auth_semantics": {
48
+ "account_database_scope": "site-isolated",
49
+ "credential_storage": "salted-scrypt-hash",
50
+ "session_storage": "opaque-cookie-digest-at-rest",
51
+ "registration_account_creation": "after-email-verification",
52
+ "verification_challenge_storage": "salted-hash",
53
+ "password_reset_enumeration": "indistinguishable-public-response",
54
+ "mail_default": "LOCAL_ONLY",
55
+ "mail_statuses": [
56
+ "LOCAL_ONLY",
57
+ "SMTP_PENDING",
58
+ "SMTP_SENT",
59
+ "SMTP_FAILED"
60
+ ],
61
+ "smtp_activation": "explicit-complete-config-only",
62
+ "smtp_delivery_ceiling": 3,
63
+ "rejected_secret_journaling": "forbidden",
64
+ "legacy_write_policy": "read-compatible-write-rejected"
65
+ },
66
+ "common_capabilities": {
67
+ "account_registration": "account-registration",
68
+ "account_sign_in": "account-sign-in",
69
+ "session_lifecycle": "session-lifecycle",
70
+ "password_recovery": "password-recovery",
71
+ "email_delivery": "email-delivery"
72
+ },
73
+ "capabilities": [
74
+ {
75
+ "id": "account-registration",
76
+ "label": "Verified local account registration",
77
+ "priority": "p0",
78
+ "category": "authentication",
79
+ "implementation_status": "planned",
80
+ "entities": [
81
+ {
82
+ "name": "pending-registration",
83
+ "identity": "opaque pending id bound to one browser session",
84
+ "owner_scope": "session",
85
+ "persistence": "durable"
86
+ },
87
+ {
88
+ "name": "local-account",
89
+ "identity": "site-local account id and unique normalized email",
90
+ "owner_scope": "account",
91
+ "persistence": "durable"
92
+ }
93
+ ],
94
+ "state_machine": {
95
+ "kind": "challenge-lifecycle",
96
+ "states": [
97
+ "collecting",
98
+ "pending-verification",
99
+ "verified",
100
+ "account-created",
101
+ "expired",
102
+ "locked"
103
+ ],
104
+ "transitions": [
105
+ {
106
+ "from": "collecting",
107
+ "to": "pending-verification",
108
+ "trigger": "validated registration request"
109
+ },
110
+ {
111
+ "from": "pending-verification",
112
+ "to": "verified",
113
+ "trigger": "correct unexpired code within attempt budget"
114
+ },
115
+ {
116
+ "from": "verified",
117
+ "to": "account-created",
118
+ "trigger": "transactional account creation and session rotation"
119
+ },
120
+ {
121
+ "from": "pending-verification",
122
+ "to": "expired",
123
+ "trigger": "challenge expiry"
124
+ },
125
+ {
126
+ "from": "pending-verification",
127
+ "to": "locked",
128
+ "trigger": "verification attempt budget exhausted"
129
+ }
130
+ ]
131
+ },
132
+ "server_authorities": [
133
+ "The server normalizes identity and hashes password and code.",
134
+ "An account is created only after successful verification.",
135
+ "Duplicate normalized email creation is rejected transactionally."
136
+ ],
137
+ "external_effect": "none",
138
+ "journey_ids": [],
139
+ "invariant_ids": [],
140
+ "proofs": {
141
+ "evidence": {},
142
+ "planned": [
143
+ "valid",
144
+ "invalid",
145
+ "duplicate",
146
+ "stale",
147
+ "foreign-owner",
148
+ "unauthorized-role",
149
+ "restart",
150
+ "migration",
151
+ "concurrency"
152
+ ],
153
+ "not_applicable": []
154
+ }
155
+ },
156
+ {
157
+ "id": "account-sign-in",
158
+ "label": "Password-based local account sign-in",
159
+ "priority": "p0",
160
+ "category": "authentication",
161
+ "implementation_status": "planned",
162
+ "entities": [
163
+ {
164
+ "name": "local-account",
165
+ "identity": "site-local account id and normalized email",
166
+ "owner_scope": "account",
167
+ "persistence": "durable"
168
+ }
169
+ ],
170
+ "state_machine": {
171
+ "kind": "entity-lifecycle",
172
+ "states": [
173
+ "signed-out",
174
+ "identified",
175
+ "authenticated",
176
+ "rejected"
177
+ ],
178
+ "transitions": [
179
+ {
180
+ "from": "signed-out",
181
+ "to": "identified",
182
+ "trigger": "normalized email submitted"
183
+ },
184
+ {
185
+ "from": "identified",
186
+ "to": "authenticated",
187
+ "trigger": "constant-time password verification succeeds"
188
+ },
189
+ {
190
+ "from": "identified",
191
+ "to": "rejected",
192
+ "trigger": "credentials are invalid"
193
+ }
194
+ ]
195
+ },
196
+ "server_authorities": [
197
+ "The server verifies salted password hashes.",
198
+ "The server rotates the authenticated session.",
199
+ "Client-selected fixture identity is not authentication."
200
+ ],
201
+ "external_effect": "none",
202
+ "journey_ids": [],
203
+ "invariant_ids": [],
204
+ "proofs": {
205
+ "evidence": {},
206
+ "planned": [
207
+ "valid",
208
+ "invalid",
209
+ "duplicate",
210
+ "stale",
211
+ "foreign-owner",
212
+ "unauthorized-role",
213
+ "restart",
214
+ "migration",
215
+ "concurrency"
216
+ ],
217
+ "not_applicable": []
218
+ }
219
+ },
220
+ {
221
+ "id": "session-lifecycle",
222
+ "label": "Anonymous and authenticated browser sessions",
223
+ "priority": "p0",
224
+ "category": "authentication",
225
+ "implementation_status": "planned",
226
+ "entities": [
227
+ {
228
+ "name": "browser-session",
229
+ "identity": "opaque cookie token with digest persisted at rest",
230
+ "owner_scope": "session",
231
+ "persistence": "durable"
232
+ }
233
+ ],
234
+ "state_machine": {
235
+ "kind": "session-lifecycle",
236
+ "states": [
237
+ "anonymous",
238
+ "authenticated",
239
+ "revoked",
240
+ "expired"
241
+ ],
242
+ "transitions": [
243
+ {
244
+ "from": "anonymous",
245
+ "to": "authenticated",
246
+ "trigger": "successful sign-in or registration rotates session"
247
+ },
248
+ {
249
+ "from": "authenticated",
250
+ "to": "revoked",
251
+ "trigger": "sign-out or security reset"
252
+ },
253
+ {
254
+ "from": "anonymous",
255
+ "to": "expired",
256
+ "trigger": "session expiry"
257
+ },
258
+ {
259
+ "from": "authenticated",
260
+ "to": "expired",
261
+ "trigger": "session expiry"
262
+ }
263
+ ]
264
+ },
265
+ "server_authorities": [
266
+ "Raw session tokens are never stored in the database.",
267
+ "Ownership is resolved from the server-side session record.",
268
+ "Sign-out revokes server-side authority before deleting the cookie."
269
+ ],
270
+ "external_effect": "none",
271
+ "journey_ids": [],
272
+ "invariant_ids": [],
273
+ "proofs": {
274
+ "evidence": {},
275
+ "planned": [
276
+ "valid",
277
+ "invalid",
278
+ "duplicate",
279
+ "stale",
280
+ "foreign-owner",
281
+ "unauthorized-role",
282
+ "restart",
283
+ "migration",
284
+ "concurrency"
285
+ ],
286
+ "not_applicable": []
287
+ }
288
+ },
289
+ {
290
+ "id": "password-recovery",
291
+ "label": "Enumeration-resistant local password recovery",
292
+ "priority": "p0",
293
+ "category": "authentication",
294
+ "implementation_status": "planned",
295
+ "entities": [
296
+ {
297
+ "name": "password-reset-challenge",
298
+ "identity": "opaque reset id bound to one browser session",
299
+ "owner_scope": "session",
300
+ "persistence": "durable"
301
+ },
302
+ {
303
+ "name": "local-account",
304
+ "identity": "nullable concealed account binding",
305
+ "owner_scope": "account",
306
+ "persistence": "durable"
307
+ }
308
+ ],
309
+ "state_machine": {
310
+ "kind": "challenge-lifecycle",
311
+ "states": [
312
+ "requested",
313
+ "verified",
314
+ "consumed",
315
+ "expired",
316
+ "locked"
317
+ ],
318
+ "transitions": [
319
+ {
320
+ "from": "requested",
321
+ "to": "verified",
322
+ "trigger": "correct unexpired code within attempt budget"
323
+ },
324
+ {
325
+ "from": "verified",
326
+ "to": "consumed",
327
+ "trigger": "password is replaced and sessions are revoked"
328
+ },
329
+ {
330
+ "from": "requested",
331
+ "to": "expired",
332
+ "trigger": "challenge expiry"
333
+ },
334
+ {
335
+ "from": "requested",
336
+ "to": "locked",
337
+ "trigger": "verification attempt budget exhausted"
338
+ }
339
+ ]
340
+ },
341
+ "server_authorities": [
342
+ "Known and unknown emails receive indistinguishable public responses.",
343
+ "Only the server binds a reset flow to an account.",
344
+ "Password replacement revokes prior authenticated sessions."
345
+ ],
346
+ "external_effect": "local-only",
347
+ "journey_ids": [],
348
+ "invariant_ids": [],
349
+ "proofs": {
350
+ "evidence": {},
351
+ "planned": [
352
+ "valid",
353
+ "invalid",
354
+ "duplicate",
355
+ "stale",
356
+ "foreign-owner",
357
+ "unauthorized-role",
358
+ "restart",
359
+ "migration",
360
+ "concurrency"
361
+ ],
362
+ "not_applicable": []
363
+ }
364
+ },
365
+ {
366
+ "id": "email-delivery",
367
+ "label": "Truthful local verification and recovery mail outbox",
368
+ "priority": "p0",
369
+ "category": "communication",
370
+ "implementation_status": "planned",
371
+ "entities": [
372
+ {
373
+ "name": "mail-outbox-entry",
374
+ "identity": "site-local outbox id and purpose-bound flow id",
375
+ "owner_scope": "system",
376
+ "persistence": "durable"
377
+ }
378
+ ],
379
+ "state_machine": {
380
+ "kind": "delivery-lifecycle",
381
+ "states": [
382
+ "local-only",
383
+ "smtp-pending",
384
+ "smtp-sent",
385
+ "smtp-failed"
386
+ ],
387
+ "transitions": [
388
+ {
389
+ "from": "local-only",
390
+ "to": "smtp-pending",
391
+ "trigger": "operator enables complete explicit SMTP configuration"
392
+ },
393
+ {
394
+ "from": "smtp-pending",
395
+ "to": "smtp-sent",
396
+ "trigger": "SMTP transport confirms delivery handoff"
397
+ },
398
+ {
399
+ "from": "smtp-pending",
400
+ "to": "smtp-failed",
401
+ "trigger": "delivery attempt fails or ceiling is reached"
402
+ },
403
+ {
404
+ "from": "smtp-failed",
405
+ "to": "smtp-pending",
406
+ "trigger": "bounded idempotent retry below the delivery ceiling"
407
+ }
408
+ ]
409
+ },
410
+ "server_authorities": [
411
+ "Offline mode records LOCAL_ONLY and never claims external delivery.",
412
+ "SMTP is disabled unless every required setting is present.",
413
+ "Claim, retry, and startup replay share one delivery ceiling."
414
+ ],
415
+ "external_effect": "local-only",
416
+ "journey_ids": [],
417
+ "invariant_ids": [],
418
+ "proofs": {
419
+ "evidence": {},
420
+ "planned": [
421
+ "valid",
422
+ "invalid",
423
+ "duplicate",
424
+ "stale",
425
+ "foreign-owner",
426
+ "unauthorized-role",
427
+ "restart",
428
+ "migration",
429
+ "concurrency"
430
+ ],
431
+ "not_applicable": []
432
+ }
433
+ }
434
+ ]
435
+ }
tasks/llbean/environment/reference/backend/runtime.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "database": {
3
+ "data_dir": "data",
4
+ "engine": "sqlite",
5
+ "filename": "llbean.sqlite3",
6
+ "legacy_unbound_migration": false,
7
+ "migration_hook": "backend.catalog:migrate",
8
+ "seed_hook": "backend.catalog:seed"
9
+ },
10
+ "deployment": {
11
+ "profiles": {
12
+ "cloudflare-review": {
13
+ "mail_adapter": "redis-resend",
14
+ "payment_adapter": "local-sandbox",
15
+ "persistence": "ephemeral-reset"
16
+ },
17
+ "docker-volume": {
18
+ "mail_adapter": "effects-gateway",
19
+ "payment_adapter": "local-sandbox",
20
+ "persistence": "persistent-volume"
21
+ },
22
+ "offline-harbor": {
23
+ "mail_adapter": "local-outbox",
24
+ "payment_adapter": "local-sandbox",
25
+ "persistence": "persistent"
26
+ }
27
+ }
28
+ },
29
+ "mail": {
30
+ "enabled": false,
31
+ "purposes": {},
32
+ "sender": {
33
+ "address_env": "RESEND_FROM_EMAIL",
34
+ "display_name": "L.L.Bean"
35
+ }
36
+ },
37
+ "payments": {
38
+ "currency": "USD",
39
+ "default_adapter": "local-sandbox",
40
+ "local_sandbox": {
41
+ "scenarios": [
42
+ {
43
+ "display_label": "Simulated approval",
44
+ "id": "sandbox-approved",
45
+ "outcome": "approved"
46
+ },
47
+ {
48
+ "display_label": "Simulated decline",
49
+ "id": "sandbox-declined",
50
+ "outcome": "declined"
51
+ },
52
+ {
53
+ "display_label": "Simulated retry",
54
+ "id": "sandbox-retry",
55
+ "outcome": "retryable"
56
+ }
57
+ ]
58
+ },
59
+ "stripe_test": null
60
+ },
61
+ "schema_version": "websitebench.site-backend-runtime.v1",
62
+ "session": {
63
+ "host_only": true,
64
+ "http_only": true,
65
+ "same_site": "Lax",
66
+ "secure": true
67
+ },
68
+ "site": {
69
+ "id": "llbean",
70
+ "label": "L.L.Bean",
71
+ "public_origin": "https://llbean.offline.invalid"
72
+ }
73
+ }
tasks/llbean/environment/reference/clone/app.py ADDED
@@ -0,0 +1,1404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """WebsiteBench offline clone of the L.L.Bean desktop storefront.
2
+
3
+ Route patterns, DOM class names, copy and layout reproduce evidence captured
4
+ with Playwright in the Mac Chrome session; see ``materials/llbean/scope/notes/``.
5
+ All data is served from the local site-bound SQLite database. The running clone
6
+ issues no request to any remote origin.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import json
12
+ import os
13
+ import sqlite3
14
+ import sys
15
+ from contextlib import contextmanager
16
+ from pathlib import Path
17
+ from typing import Any, Iterator
18
+
19
+ from fastapi import Depends, FastAPI, Form, Request
20
+ from fastapi.responses import (
21
+ FileResponse,
22
+ HTMLResponse,
23
+ JSONResponse,
24
+ RedirectResponse,
25
+ )
26
+ from fastapi.staticfiles import StaticFiles
27
+ from fastapi.templating import Jinja2Templates
28
+
29
+ CLONE_ROOT = Path(__file__).resolve().parent
30
+ sys.path.insert(0, str(CLONE_ROOT))
31
+
32
+ from backend import repo # noqa: E402
33
+ from backend.catalog import SORT_FIELDS, VIEW_COUNT # noqa: E402
34
+ from backend.site_backend_integration import open_site_services # noqa: E402
35
+
36
+ SITE_ID = "llbean"
37
+ DISPLAY_NAME = "L.L.Bean"
38
+ SESSION_COOKIE = "__Host-llbean_session"
39
+ STORE_FINDER_ID = 1000001703
40
+
41
+ # Lead paragraph each editorial lander opens with on the source. The heading is
42
+ # repeated in the source copy block; it is dropped here because the page already
43
+ # renders it as the H1.
44
+ LANDER_INTRO = {
45
+ 518571: (
46
+ "We always have something exciting planned! Check back often to see "
47
+ "what\u2019s happening in our home state of Maine, on the road, out in "
48
+ "nature, and right outside your door!"
49
+ ),
50
+ 518342: (
51
+ "Great products make it easier to get outside. Great advice can too. "
52
+ "Welcome to the ultimate destination for expert ideas, inspiring stories, "
53
+ "and how-to guides for everything outdoors."
54
+ ),
55
+ }
56
+
57
+ app = FastAPI(title=DISPLAY_NAME, docs_url=None, redoc_url=None)
58
+ app.mount(
59
+ "/static", StaticFiles(directory=str(CLONE_ROOT / "frontend" / "static")), name="static"
60
+ )
61
+ templates = Jinja2Templates(directory=str(CLONE_ROOT / "frontend" / "templates"))
62
+
63
+ def _bind_sandbox_data_dir() -> None:
64
+ """Honour the diagnostic harness's isolated data directory.
65
+
66
+ ``websitebench-offline-clone verify`` boots the clone with a fresh
67
+ ``WEBSITEBENCH_DATA_DIR`` and no write access to the repository tree, so the
68
+ database has to live there. The filename still comes from the frozen runtime
69
+ contract, which the integration seam re-validates.
70
+ """
71
+
72
+ if os.environ.get("WEBSITEBENCH_SITE_BACKEND_DATABASE"):
73
+ return
74
+ data_dir = os.environ.get("WEBSITEBENCH_DATA_DIR")
75
+ if not data_dir:
76
+ return
77
+ runtime = json.loads(
78
+ (CLONE_ROOT.parent / "backend" / "runtime.json").read_text(encoding="utf-8")
79
+ )
80
+ filename = runtime["database"]["filename"]
81
+ target = Path(data_dir)
82
+ target.mkdir(parents=True, exist_ok=True)
83
+ os.environ["WEBSITEBENCH_SITE_BACKEND_DATABASE"] = str(target / filename)
84
+
85
+
86
+ _bind_sandbox_data_dir()
87
+
88
+ backend, auth = open_site_services()
89
+ DB_PATH = backend.lifecycle.database_path
90
+
91
+ # Synthetic fixture account for this offline clone only. It exists so the
92
+ # signed-in surfaces are reachable during review and in tests; the address is on
93
+ # the reserved .test TLD and the password unlocks nothing outside this local
94
+ # SQLite database. No real credential is stored anywhere in this repository.
95
+ DEMO_EMAIL = "outdoors@example.test"
96
+ DEMO_PASSWORD = "TrailPass!2026" # noqa: S105 - synthetic local fixture
97
+ DEMO_NAME = "Riley"
98
+
99
+
100
+ def _bootstrap_demo_account() -> None:
101
+ try:
102
+ if not auth.account_exists(email=DEMO_EMAIL):
103
+ auth.seed_account(
104
+ subject_id="member-demo",
105
+ email=DEMO_EMAIL,
106
+ display_name=DEMO_NAME,
107
+ password=DEMO_PASSWORD,
108
+ )
109
+ except TypeError:
110
+ try:
111
+ auth.seed_account(
112
+ subject_id="member-demo",
113
+ email=DEMO_EMAIL,
114
+ display_name=DEMO_NAME,
115
+ password=DEMO_PASSWORD,
116
+ )
117
+ except Exception: # pragma: no cover - already seeded
118
+ pass
119
+ except Exception: # pragma: no cover - already seeded
120
+ pass
121
+
122
+
123
+ _bootstrap_demo_account()
124
+
125
+
126
+ @contextmanager
127
+ def db_session() -> Iterator[sqlite3.Connection]:
128
+ # check_same_thread=False because FastAPI runs a sync generator dependency
129
+ # in its threadpool and can close it on a different worker thread than the
130
+ # one that opened it. Each request still gets its own connection, so the
131
+ # connection is never shared between concurrent requests.
132
+ connection = sqlite3.connect(DB_PATH, check_same_thread=False, timeout=15)
133
+ connection.row_factory = sqlite3.Row
134
+ # WAL lets readers run while one writer commits; without it every page view
135
+ # (which reads the bag) contends with any in-flight cart write.
136
+ connection.execute("PRAGMA journal_mode=WAL")
137
+ connection.execute("PRAGMA busy_timeout=15000")
138
+ connection.execute("PRAGMA synchronous=NORMAL")
139
+ try:
140
+ yield connection
141
+ connection.commit()
142
+ finally:
143
+ connection.close()
144
+
145
+
146
+ def get_db() -> Iterator[sqlite3.Connection]:
147
+ with db_session() as connection:
148
+ yield connection
149
+
150
+
151
+ class Viewer:
152
+ """The current actor: an anonymous visitor or a signed-in member."""
153
+
154
+ def __init__(self, token: str, session: dict[str, Any] | None) -> None:
155
+ self.token = token
156
+ self.session = session or {}
157
+ account = self.session.get("account") or {}
158
+ authenticated = bool(self.session.get("authenticated")) and bool(account)
159
+ self.subject = account.get("subject_id") if authenticated else None
160
+ self.display_name = account.get("display_name") if authenticated else None
161
+ self.email = account.get("email_normalized") if authenticated else None
162
+
163
+ @property
164
+ def signed_in(self) -> bool:
165
+ return bool(self.subject)
166
+
167
+ @property
168
+ def owner_key(self) -> str:
169
+ return f"member:{self.subject}" if self.signed_in else f"guest:{self.token}"
170
+
171
+ @property
172
+ def owner(self) -> str:
173
+ return self.owner_key
174
+
175
+
176
+ def get_viewer(request: Request) -> Viewer:
177
+ """Resolve the actor, minting a real anonymous session when needed.
178
+
179
+ ``ensure_session`` both validates an existing token and creates one, so an
180
+ unknown or expired cookie value never leaves the request without a session.
181
+ """
182
+
183
+ token, session = auth.ensure_session(request.cookies.get(SESSION_COOKIE))
184
+ return Viewer(token, session)
185
+
186
+
187
+ def _set_session_cookie(response: Any, token: str) -> Any:
188
+ response.set_cookie(
189
+ SESSION_COOKIE,
190
+ token,
191
+ httponly=True,
192
+ secure=True,
193
+ samesite="lax",
194
+ path="/",
195
+ )
196
+ return response
197
+
198
+
199
+ def _asset_version() -> str:
200
+ """Newest mtime across the styles and templates, as a cache-busting stamp.
201
+
202
+ Without it a reviewer keeps seeing a stale stylesheet after a redeploy.
203
+ """
204
+
205
+ newest = 0.0
206
+ for folder in ("frontend/static/css", "frontend/static", "frontend/templates"):
207
+ base = CLONE_ROOT / folder
208
+ for path in base.glob("*"):
209
+ if path.is_file():
210
+ newest = max(newest, path.stat().st_mtime)
211
+ return str(int(newest))
212
+
213
+
214
+ def render(
215
+ request: Request,
216
+ template: str,
217
+ viewer: Viewer,
218
+ db: sqlite3.Connection,
219
+ context: dict[str, Any] | None = None,
220
+ status_code: int = 200,
221
+ ) -> HTMLResponse:
222
+ base = {
223
+ "request": request,
224
+ "viewer": viewer,
225
+ "nav": repo.nav_menu(db),
226
+ "bag_count": repo.bag_count(db, viewer.owner_key),
227
+ "site_name": DISPLAY_NAME,
228
+ "asset_version": _asset_version(),
229
+ }
230
+ base.update(context or {})
231
+ response = templates.TemplateResponse(
232
+ request, template, base, status_code=status_code
233
+ )
234
+ return _set_session_cookie(response, viewer.token)
235
+
236
+
237
+ def _multi(request: Request, name: str) -> list[str]:
238
+ return [v for v in request.query_params.getlist(name) if v]
239
+
240
+
241
+ # ---------------------------------------------------------------------------
242
+ # health and diagnostics
243
+ # ---------------------------------------------------------------------------
244
+
245
+
246
+ @app.get("/favicon.ico", include_in_schema=False)
247
+ def favicon() -> FileResponse:
248
+ """Browsers request this on every page; serve the site icon, not a 404."""
249
+
250
+ return FileResponse(CLONE_ROOT / "frontend" / "static" / "favicon.ico")
251
+
252
+
253
+ @app.get("/healthz")
254
+ def healthz() -> dict[str, object]:
255
+ return {"ok": True, "site_id": SITE_ID}
256
+
257
+
258
+ @app.get("/__websitebench/health")
259
+ def harbor_health() -> JSONResponse:
260
+ return JSONResponse({"status": "ok", "site_id": SITE_ID})
261
+
262
+
263
+ # ---------------------------------------------------------------------------
264
+ # home
265
+ # ---------------------------------------------------------------------------
266
+
267
+
268
+ @app.get("/", response_class=HTMLResponse)
269
+ def home(
270
+ request: Request,
271
+ db: sqlite3.Connection = Depends(get_db),
272
+ viewer: Viewer = Depends(get_viewer),
273
+ ) -> HTMLResponse:
274
+ sections = repo.home_sections(db)
275
+ # Two sections are personalised on the source; both are driven here by real
276
+ # local data rather than a fixed list.
277
+ top_picks = repo.collection(
278
+ db, sort_field="bestselling", view_count=6
279
+ )["products"]
280
+ seen = repo.recently_viewed(db, viewer.owner, limit=6)
281
+ return render(
282
+ request,
283
+ "home.html",
284
+ viewer,
285
+ db,
286
+ {
287
+ "sections": sections,
288
+ "top_picks": top_picks,
289
+ "recently_viewed": seen,
290
+ "video_asset": "/static/video/boat-and-tote.mp4",
291
+ # The video's own first frame. It is what the section shows before
292
+ # the loop starts, and all a reduced-motion visitor ever sees.
293
+ "video_poster": "/static/img/home/boat-and-tote-poster.jpg",
294
+ # The source home page collapses the rotating global banner; interior
295
+ # routes render it.
296
+ "hide_global_banner": True,
297
+ },
298
+ )
299
+
300
+
301
+ # ---------------------------------------------------------------------------
302
+ # category / product (one id namespace, dispatched by id type, as on the source)
303
+ # ---------------------------------------------------------------------------
304
+
305
+
306
+ @app.get("/llb/shop/{entity_id}", response_class=HTMLResponse)
307
+ def shop(
308
+ request: Request,
309
+ entity_id: int,
310
+ page: str | None = None,
311
+ sort_field: str = "relevance",
312
+ start: int = 0,
313
+ viewCount: int = VIEW_COUNT,
314
+ isLoadMore: bool = False,
315
+ db: sqlite3.Connection = Depends(get_db),
316
+ viewer: Viewer = Depends(get_viewer),
317
+ ) -> HTMLResponse:
318
+ if entity_id == STORE_FINDER_ID:
319
+ return _stores_page(request, db, viewer, request.query_params.get("term", ""))
320
+
321
+ product = repo.product(db, str(entity_id))
322
+ if product is not None:
323
+ repo.record_view(db, viewer.owner, product["product_id"])
324
+ return _product_page(request, db, viewer, product)
325
+
326
+ cat = repo.category(db, entity_id)
327
+ if cat is None:
328
+ page = repo.content_page(db, entity_id)
329
+ if page is not None:
330
+ return render(
331
+ request,
332
+ "content.html",
333
+ viewer,
334
+ db,
335
+ {"page": page, "sitemap": repo.category_tree(db) if entity_id == 518766 else None},
336
+ )
337
+ return render(request, "not_found.html", viewer, db, {}, status_code=404)
338
+
339
+ # An editorial lander (Outdoor Experiences, Explore L.L.Bean) has no grid.
340
+ lander = repo.lander(db, entity_id)
341
+ if lander is not None:
342
+ return render(
343
+ request,
344
+ "lander.html",
345
+ viewer,
346
+ db,
347
+ {
348
+ "category": cat,
349
+ "lander": lander,
350
+ "intro": LANDER_INTRO.get(entity_id),
351
+ "active_cat_id": entity_id,
352
+ "active_root_id": entity_id,
353
+ },
354
+ )
355
+
356
+ colors = _multi(request, "color")
357
+ brands = _multi(request, "brand")
358
+ bands = _multi(request, "price")
359
+ genders = _multi(request, "gender")
360
+ sizes = _multi(request, "size")
361
+ materials = _multi(request, "material")
362
+ percent_off = _multi(request, "percent_off")
363
+ on_sale = request.query_params.get("sale") == "1"
364
+ is_new = request.query_params.get("new") == "1"
365
+ batch = repo.collection(
366
+ db,
367
+ cat_id=entity_id,
368
+ colors=colors,
369
+ brands=brands,
370
+ price_bands=bands,
371
+ on_sale=on_sale,
372
+ is_new=is_new,
373
+ genders=genders,
374
+ sizes=sizes,
375
+ materials=materials,
376
+ percent_off=percent_off,
377
+ sort_field=sort_field,
378
+ start=start,
379
+ view_count=viewCount,
380
+ )
381
+ # A "load more" batch keeps every earlier batch on the page, as the source does.
382
+ if start:
383
+ first = repo.collection(
384
+ db,
385
+ cat_id=entity_id,
386
+ colors=colors,
387
+ brands=brands,
388
+ price_bands=bands,
389
+ on_sale=on_sale,
390
+ is_new=is_new,
391
+ genders=genders,
392
+ sizes=sizes,
393
+ materials=materials,
394
+ percent_off=percent_off,
395
+ sort_field=sort_field,
396
+ start=0,
397
+ view_count=start,
398
+ )
399
+ batch["products"] = first["products"] + batch["products"]
400
+ return render(
401
+ request,
402
+ "category.html",
403
+ viewer,
404
+ db,
405
+ {
406
+ "category": cat,
407
+ "subcategories": repo.children(db, entity_id),
408
+ "ancestors": repo.ancestors(db, entity_id),
409
+ "active_cat_id": entity_id,
410
+ "active_root_id": (repo.ancestors(db, entity_id) or [{}])[0].get("cat_id"),
411
+ "batch": batch,
412
+ "facets": repo.facets(db, cat_id=entity_id),
413
+ "selected": {
414
+ "color": colors,
415
+ "brand": brands,
416
+ "price": bands,
417
+ "gender": genders,
418
+ "size": sizes,
419
+ "material": materials,
420
+ "percent_off": percent_off,
421
+ "sale": on_sale,
422
+ "new": is_new,
423
+ "sort_field": sort_field,
424
+ },
425
+ "sort_options": SORT_FIELDS,
426
+ "is_load_more": bool(isLoadMore),
427
+ },
428
+ )
429
+
430
+
431
+ def _product_page(
432
+ request: Request,
433
+ db: sqlite3.Connection,
434
+ viewer: Viewer,
435
+ product: dict[str, Any],
436
+ *,
437
+ message: str | None = None,
438
+ error: str | None = None,
439
+ added: bool = False,
440
+ ) -> HTMLResponse:
441
+ review_sort = request.query_params.get("review_sort", "recent")
442
+ star = request.query_params.get("star")
443
+ limit = int(request.query_params.get("review_limit", 10) or 10)
444
+ review_data = repo.reviews(
445
+ db,
446
+ product["product_id"],
447
+ limit=limit,
448
+ star=int(star) if star and star.isdigit() else None,
449
+ sort=review_sort,
450
+ )
451
+ related = repo.collection(
452
+ db, cat_id=29, sort_field="bestselling", view_count=4
453
+ )["products"]
454
+ return render(
455
+ request,
456
+ "product.html",
457
+ viewer,
458
+ db,
459
+ {
460
+ "product": product,
461
+ "reviews": review_data,
462
+ "review_sort": review_sort,
463
+ "review_star": star,
464
+ "review_limit": limit,
465
+ "related": [r for r in related if r["product_id"] != product["product_id"]][:3],
466
+ "message": message,
467
+ "error": error,
468
+ "added": added,
469
+ "selected_color": request.query_params.get("color"),
470
+ "selected_size": request.query_params.get("size"),
471
+ },
472
+ )
473
+
474
+
475
+ # ---------------------------------------------------------------------------
476
+ # search
477
+ # ---------------------------------------------------------------------------
478
+
479
+
480
+ @app.get("/llb/search", response_class=HTMLResponse)
481
+ def search(
482
+ request: Request,
483
+ freeText: str = "",
484
+ sort_field: str = "relevance",
485
+ start: int = 0,
486
+ viewCount: int = VIEW_COUNT,
487
+ tab: str = "products",
488
+ db: sqlite3.Connection = Depends(get_db),
489
+ viewer: Viewer = Depends(get_viewer),
490
+ ) -> HTMLResponse:
491
+ query = (freeText or "").strip()
492
+ colors = _multi(request, "color")
493
+ brands = _multi(request, "brand")
494
+ bands = _multi(request, "price")
495
+ on_sale = request.query_params.get("sale") == "1"
496
+ batch = repo.collection(
497
+ db,
498
+ query=query or None,
499
+ colors=colors,
500
+ brands=brands,
501
+ price_bands=bands,
502
+ on_sale=on_sale,
503
+ sort_field=sort_field,
504
+ start=start,
505
+ view_count=viewCount,
506
+ )
507
+ if start:
508
+ first = repo.collection(
509
+ db,
510
+ query=query or None,
511
+ colors=colors,
512
+ brands=brands,
513
+ price_bands=bands,
514
+ on_sale=on_sale,
515
+ sort_field=sort_field,
516
+ start=0,
517
+ view_count=start,
518
+ )
519
+ batch["products"] = first["products"] + batch["products"]
520
+ content = repo.content_pages(db, query or None)
521
+ popular = repo.collection(db, cat_id=29, sort_field="bestselling", view_count=6)["products"]
522
+ return render(
523
+ request,
524
+ "search.html",
525
+ viewer,
526
+ db,
527
+ {
528
+ "query": query,
529
+ "batch": batch,
530
+ "content": content,
531
+ "tab": tab,
532
+ "facets": repo.facets(db, query=query or None),
533
+ "selected": {
534
+ "color": colors,
535
+ "brand": brands,
536
+ "price": bands,
537
+ "sale": on_sale,
538
+ "sort_field": sort_field,
539
+ },
540
+ "sort_options": SORT_FIELDS,
541
+ "popular": popular,
542
+ },
543
+ )
544
+
545
+
546
+ # ---------------------------------------------------------------------------
547
+ # shopping bag
548
+ # ---------------------------------------------------------------------------
549
+
550
+
551
+ @app.post("/cart/add")
552
+ def cart_add(
553
+ request: Request,
554
+ product_id: str = Form(...),
555
+ color: str | None = Form(None),
556
+ size: str | None = Form(None),
557
+ quantity: int = Form(1),
558
+ db: sqlite3.Connection = Depends(get_db),
559
+ viewer: Viewer = Depends(get_viewer),
560
+ ) -> Any:
561
+ product = repo.product(db, product_id)
562
+ if product is None:
563
+ return render(request, "not_found.html", viewer, db, {}, status_code=404)
564
+ try:
565
+ repo.add_to_cart(
566
+ db,
567
+ viewer.owner_key,
568
+ product_id=product_id,
569
+ color=color,
570
+ size=size,
571
+ qty=quantity,
572
+ )
573
+ except ValueError as exc:
574
+ return _product_page(request, db, viewer, product, error=str(exc))
575
+ db.commit()
576
+ refreshed = repo.product(db, product_id)
577
+ assert refreshed is not None
578
+ return _product_page(request, db, viewer, refreshed, added=True)
579
+
580
+
581
+ @app.get("/shoppingbag", response_class=HTMLResponse)
582
+ def shoppingbag(
583
+ request: Request,
584
+ db: sqlite3.Connection = Depends(get_db),
585
+ viewer: Viewer = Depends(get_viewer),
586
+ ) -> HTMLResponse:
587
+ recently = repo.collection(db, cat_id=29, sort_field="bestselling", view_count=4)["products"]
588
+ return render(
589
+ request,
590
+ "cart.html",
591
+ viewer,
592
+ db,
593
+ {
594
+ "cart": repo.cart_view(db, viewer.owner_key),
595
+ "recently": recently,
596
+ "message": request.query_params.get("message"),
597
+ "error": request.query_params.get("error"),
598
+ },
599
+ )
600
+
601
+
602
+ @app.post("/cart/update")
603
+ def cart_update(
604
+ item_id: int = Form(...),
605
+ qty: int = Form(...),
606
+ db: sqlite3.Connection = Depends(get_db),
607
+ viewer: Viewer = Depends(get_viewer),
608
+ ) -> RedirectResponse:
609
+ ok = repo.update_qty(db, viewer.owner_key, item_id, qty)
610
+ db.commit()
611
+ target = "/shoppingbag" if ok else "/shoppingbag?error=That+item+is+not+in+your+bag."
612
+ return _set_session_cookie(RedirectResponse(target, status_code=303), viewer.token)
613
+
614
+
615
+ @app.post("/cart/remove")
616
+ def cart_remove(
617
+ item_id: int = Form(...),
618
+ db: sqlite3.Connection = Depends(get_db),
619
+ viewer: Viewer = Depends(get_viewer),
620
+ ) -> RedirectResponse:
621
+ ok = repo.remove_item(db, viewer.owner_key, item_id)
622
+ db.commit()
623
+ target = "/shoppingbag" if ok else "/shoppingbag?error=That+item+is+not+in+your+bag."
624
+ return _set_session_cookie(RedirectResponse(target, status_code=303), viewer.token)
625
+
626
+
627
+ @app.post("/cart/save")
628
+ def cart_save(
629
+ item_id: int = Form(...),
630
+ saved: int = Form(1),
631
+ db: sqlite3.Connection = Depends(get_db),
632
+ viewer: Viewer = Depends(get_viewer),
633
+ ) -> RedirectResponse:
634
+ repo.set_saved(db, viewer.owner_key, item_id, bool(saved))
635
+ db.commit()
636
+ return _set_session_cookie(
637
+ RedirectResponse("/shoppingbag", status_code=303), viewer.token
638
+ )
639
+
640
+
641
+ @app.post("/cart/redeem")
642
+ def cart_redeem(
643
+ code: str = Form(""),
644
+ db: sqlite3.Connection = Depends(get_db),
645
+ viewer: Viewer = Depends(get_viewer),
646
+ ) -> RedirectResponse:
647
+ ok, message = repo.redeem(db, viewer.owner_key, code)
648
+ db.commit()
649
+ key = "message" if ok else "error"
650
+ return _set_session_cookie(
651
+ RedirectResponse(f"/shoppingbag?{key}={message.replace(' ', '+')}", status_code=303),
652
+ viewer.token,
653
+ )
654
+
655
+
656
+ # ---------------------------------------------------------------------------
657
+ # checkout (local sandbox payment profile only)
658
+ # ---------------------------------------------------------------------------
659
+
660
+
661
+ @app.get("/checkout", response_class=HTMLResponse)
662
+ def checkout(
663
+ request: Request,
664
+ db: sqlite3.Connection = Depends(get_db),
665
+ viewer: Viewer = Depends(get_viewer),
666
+ ) -> HTMLResponse:
667
+ cart = repo.cart_view(db, viewer.owner_key)
668
+ return render(
669
+ request,
670
+ "checkout.html",
671
+ viewer,
672
+ db,
673
+ {
674
+ "cart": cart,
675
+ "addresses": repo.addresses(db, viewer.owner) if viewer.signed_in else [],
676
+ "error": request.query_params.get("error"),
677
+ },
678
+ )
679
+
680
+
681
+ @app.post("/checkout")
682
+ def place_order(
683
+ request: Request,
684
+ last_name: str = Form(""),
685
+ postal: str = Form(""),
686
+ scenario: str = Form("approved"),
687
+ db: sqlite3.Connection = Depends(get_db),
688
+ viewer: Viewer = Depends(get_viewer),
689
+ ) -> Any:
690
+ cart = repo.cart_view(db, viewer.owner_key)
691
+ if cart["empty"]:
692
+ return _set_session_cookie(
693
+ RedirectResponse("/shoppingbag", status_code=303), viewer.token
694
+ )
695
+ if not last_name.strip() or not postal.strip():
696
+ return _set_session_cookie(
697
+ RedirectResponse(
698
+ "/checkout?error=Enter+a+last+name+and+a+billing+postal+code.",
699
+ status_code=303,
700
+ ),
701
+ viewer.token,
702
+ )
703
+ if scenario == "declined":
704
+ return _set_session_cookie(
705
+ RedirectResponse(
706
+ "/checkout?error=Your+payment+was+declined.+Try+another+method.",
707
+ status_code=303,
708
+ ),
709
+ viewer.token,
710
+ )
711
+ order = repo.place_order(
712
+ db,
713
+ viewer.owner_key,
714
+ owner=viewer.owner,
715
+ last_name=last_name.strip(),
716
+ postal=postal.strip(),
717
+ payment_ref=f"local-sandbox:{scenario}",
718
+ )
719
+ db.commit()
720
+ if order is None:
721
+ return _set_session_cookie(
722
+ RedirectResponse("/shoppingbag", status_code=303), viewer.token
723
+ )
724
+ return _set_session_cookie(
725
+ RedirectResponse(f"/purchase/order/{order['order_id']}", status_code=303),
726
+ viewer.token,
727
+ )
728
+
729
+
730
+ # ---------------------------------------------------------------------------
731
+ # account and orders
732
+ # ---------------------------------------------------------------------------
733
+
734
+ ACCOUNT_NAV = [
735
+ ("My Account", "/account"),
736
+ ("My Rewards", "/account/myrewards"),
737
+ ("Purchase History & Order Tracking", "/purchase/history"),
738
+ ("Payment Methods", "/account/paymentmethods"),
739
+ ("Saved Addresses", "/account/addresses"),
740
+ ("Change Email Settings", "/account/email/settings?action=emailPrefs"),
741
+ ("Change Email Address", "/account/email"),
742
+ ("Change Password", "/account/password"),
743
+ ("Change Catalog Settings", "/account/catalog"),
744
+ ("Wish List", "/webapp/wcs/stores/servlet/WishListDisplay"),
745
+ ]
746
+
747
+
748
+ def _merge_guest_bag(db: sqlite3.Connection, guest_key: str, member_key: str) -> None:
749
+ """Carry an anonymous shopping bag into the member's bag on sign-in."""
750
+
751
+ if guest_key == member_key:
752
+ return
753
+ guest = db.execute(
754
+ "SELECT cart_id FROM carts WHERE owner_key = ?", (guest_key,)
755
+ ).fetchone()
756
+ if guest is None:
757
+ return
758
+ member = repo.get_or_create_cart(db, member_key)
759
+ db.execute(
760
+ "UPDATE cart_items SET cart_id = ? WHERE cart_id = ?",
761
+ (member["cart_id"], guest["cart_id"]),
762
+ )
763
+ db.execute("DELETE FROM cart_promotions WHERE cart_id = ?", (guest["cart_id"],))
764
+ db.execute("DELETE FROM carts WHERE cart_id = ?", (guest["cart_id"],))
765
+
766
+
767
+ def _require_member(request: Request, viewer: Viewer, db: sqlite3.Connection):
768
+ if viewer.signed_in:
769
+ return None
770
+ return render(
771
+ request,
772
+ "signin_required.html",
773
+ viewer,
774
+ db,
775
+ {"account_nav": ACCOUNT_NAV, "next": request.url.path},
776
+ status_code=200,
777
+ )
778
+
779
+
780
+ @app.get("/webapp/wcs/stores/servlet/LogonForm", response_class=HTMLResponse)
781
+ def logon_form(
782
+ request: Request,
783
+ db: sqlite3.Connection = Depends(get_db),
784
+ viewer: Viewer = Depends(get_viewer),
785
+ ) -> HTMLResponse:
786
+ return render(
787
+ request,
788
+ "signin.html",
789
+ viewer,
790
+ db,
791
+ {
792
+ "error": request.query_params.get("error"),
793
+ "demo_email": DEMO_EMAIL,
794
+ "demo_password": DEMO_PASSWORD,
795
+ },
796
+ )
797
+
798
+
799
+ @app.post("/webapp/wcs/stores/servlet/LogonForm")
800
+ def logon(
801
+ request: Request,
802
+ email: str = Form(""),
803
+ password: str = Form(""),
804
+ db: sqlite3.Connection = Depends(get_db),
805
+ viewer: Viewer = Depends(get_viewer),
806
+ ) -> Any:
807
+ try:
808
+ result = auth.sign_in(viewer.token, email=email.strip(), password=password)
809
+ # sign_in rotates the session token; carry the new one on the cookie.
810
+ rotated = result.get("session_token") or viewer.token
811
+ guest_key = viewer.owner_key
812
+ signed_in = Viewer(rotated, auth.resolve_session(rotated))
813
+ _merge_guest_bag(db, guest_key, signed_in.owner_key)
814
+ db.commit()
815
+ return _set_session_cookie(
816
+ RedirectResponse("/account", status_code=303), rotated
817
+ )
818
+ except Exception:
819
+ return render(
820
+ request,
821
+ "signin.html",
822
+ viewer,
823
+ db,
824
+ {
825
+ "error": "We could not sign you in with that email and password.",
826
+ "demo_email": DEMO_EMAIL,
827
+ "demo_password": DEMO_PASSWORD,
828
+ },
829
+ status_code=200,
830
+ )
831
+
832
+
833
+ @app.post("/account/signout")
834
+ def signout(viewer: Viewer = Depends(get_viewer)) -> RedirectResponse:
835
+ try:
836
+ auth.sign_out(viewer.token)
837
+ except Exception:
838
+ pass
839
+ response = RedirectResponse("/", status_code=303)
840
+ response.delete_cookie(SESSION_COOKIE, path="/")
841
+ return response
842
+
843
+
844
+ @app.get("/account", response_class=HTMLResponse)
845
+ def account_home(
846
+ request: Request,
847
+ db: sqlite3.Connection = Depends(get_db),
848
+ viewer: Viewer = Depends(get_viewer),
849
+ ) -> HTMLResponse:
850
+ gate = _require_member(request, viewer, db)
851
+ if gate:
852
+ return gate
853
+ return render(
854
+ request,
855
+ "account.html",
856
+ viewer,
857
+ db,
858
+ {
859
+ "account_nav": ACCOUNT_NAV,
860
+ "orders": repo.orders_for(db, viewer.owner)[:3],
861
+ "addresses": repo.addresses(db, viewer.owner),
862
+ },
863
+ )
864
+
865
+
866
+ @app.get("/account/myrewards", response_class=HTMLResponse)
867
+ def account_rewards(
868
+ request: Request,
869
+ db: sqlite3.Connection = Depends(get_db),
870
+ viewer: Viewer = Depends(get_viewer),
871
+ ) -> HTMLResponse:
872
+ gate = _require_member(request, viewer, db)
873
+ if gate:
874
+ return gate
875
+ orders = repo.orders_for(db, viewer.owner)
876
+ spent = sum(o["total"] for o in orders)
877
+ return render(
878
+ request,
879
+ "rewards.html",
880
+ viewer,
881
+ db,
882
+ {
883
+ "account_nav": ACCOUNT_NAV,
884
+ "points": int(spent * 10),
885
+ "spent": round(spent, 2),
886
+ "orders": orders,
887
+ },
888
+ )
889
+
890
+
891
+ @app.get("/account/paymentmethods", response_class=HTMLResponse)
892
+ def account_payment(
893
+ request: Request,
894
+ db: sqlite3.Connection = Depends(get_db),
895
+ viewer: Viewer = Depends(get_viewer),
896
+ ) -> HTMLResponse:
897
+ gate = _require_member(request, viewer, db)
898
+ if gate:
899
+ return gate
900
+ return render(
901
+ request, "payment_methods.html", viewer, db, {"account_nav": ACCOUNT_NAV}
902
+ )
903
+
904
+
905
+ @app.get("/account/addresses", response_class=HTMLResponse)
906
+ def account_addresses(
907
+ request: Request,
908
+ db: sqlite3.Connection = Depends(get_db),
909
+ viewer: Viewer = Depends(get_viewer),
910
+ ) -> HTMLResponse:
911
+ gate = _require_member(request, viewer, db)
912
+ if gate:
913
+ return gate
914
+ return render(
915
+ request,
916
+ "addresses.html",
917
+ viewer,
918
+ db,
919
+ {
920
+ "account_nav": ACCOUNT_NAV,
921
+ "addresses": repo.addresses(db, viewer.owner),
922
+ "errors": request.query_params.getlist("missing"),
923
+ "message": request.query_params.get("message"),
924
+ },
925
+ )
926
+
927
+
928
+ @app.post("/account/addresses")
929
+ def add_address(
930
+ request: Request,
931
+ first_name: str = Form(""),
932
+ last_name: str = Form(""),
933
+ street1: str = Form(""),
934
+ street2: str = Form(""),
935
+ city: str = Form(""),
936
+ state: str = Form(""),
937
+ postal: str = Form(""),
938
+ phone: str = Form(""),
939
+ db: sqlite3.Connection = Depends(get_db),
940
+ viewer: Viewer = Depends(get_viewer),
941
+ ) -> Any:
942
+ gate = _require_member(request, viewer, db)
943
+ if gate:
944
+ return gate
945
+ missing = repo.add_address(
946
+ db,
947
+ viewer.owner,
948
+ {
949
+ "first_name": first_name,
950
+ "last_name": last_name,
951
+ "street1": street1,
952
+ "street2": street2,
953
+ "city": city,
954
+ "state": state,
955
+ "postal": postal,
956
+ "phone": phone,
957
+ },
958
+ )
959
+ db.commit()
960
+ if missing:
961
+ query = "&".join(f"missing={field}" for field in missing)
962
+ return _set_session_cookie(
963
+ RedirectResponse(f"/account/addresses?{query}", status_code=303), viewer.token
964
+ )
965
+ return _set_session_cookie(
966
+ RedirectResponse("/account/addresses?message=Address+saved.", status_code=303),
967
+ viewer.token,
968
+ )
969
+
970
+
971
+ @app.post("/account/addresses/delete")
972
+ def remove_address(
973
+ request: Request,
974
+ address_id: int = Form(...),
975
+ db: sqlite3.Connection = Depends(get_db),
976
+ viewer: Viewer = Depends(get_viewer),
977
+ ) -> Any:
978
+ gate = _require_member(request, viewer, db)
979
+ if gate:
980
+ return gate
981
+ ok = repo.delete_address(db, viewer.owner, address_id)
982
+ db.commit()
983
+ message = "Address removed." if ok else "That address is not on your account."
984
+ return _set_session_cookie(
985
+ RedirectResponse(
986
+ f"/account/addresses?message={message.replace(' ', '+')}", status_code=303
987
+ ),
988
+ viewer.token,
989
+ )
990
+
991
+
992
+ @app.get("/account/email", response_class=HTMLResponse)
993
+ def account_email(
994
+ request: Request,
995
+ db: sqlite3.Connection = Depends(get_db),
996
+ viewer: Viewer = Depends(get_viewer),
997
+ ) -> HTMLResponse:
998
+ gate = _require_member(request, viewer, db)
999
+ if gate:
1000
+ return gate
1001
+ return render(
1002
+ request,
1003
+ "change_email.html",
1004
+ viewer,
1005
+ db,
1006
+ {"account_nav": ACCOUNT_NAV, "message": request.query_params.get("message")},
1007
+ )
1008
+
1009
+
1010
+ @app.get("/account/email/settings", response_class=HTMLResponse)
1011
+ def account_email_settings(
1012
+ request: Request,
1013
+ db: sqlite3.Connection = Depends(get_db),
1014
+ viewer: Viewer = Depends(get_viewer),
1015
+ ) -> HTMLResponse:
1016
+ gate = _require_member(request, viewer, db)
1017
+ if gate:
1018
+ return gate
1019
+ return render(
1020
+ request,
1021
+ "email_settings.html",
1022
+ viewer,
1023
+ db,
1024
+ {
1025
+ "account_nav": ACCOUNT_NAV,
1026
+ "prefs": repo.email_prefs(db, viewer.owner),
1027
+ "message": request.query_params.get("message"),
1028
+ },
1029
+ )
1030
+
1031
+
1032
+ @app.post("/account/email/settings")
1033
+ def save_email_settings(
1034
+ request: Request,
1035
+ subscribed: str = Form(""),
1036
+ frequency: str = Form("weekly"),
1037
+ catalog_opt: str = Form(""),
1038
+ db: sqlite3.Connection = Depends(get_db),
1039
+ viewer: Viewer = Depends(get_viewer),
1040
+ ) -> Any:
1041
+ gate = _require_member(request, viewer, db)
1042
+ if gate:
1043
+ return gate
1044
+ repo.set_email_prefs(
1045
+ db,
1046
+ viewer.owner,
1047
+ subscribed=bool(subscribed),
1048
+ frequency=frequency,
1049
+ catalog_opt=bool(catalog_opt),
1050
+ )
1051
+ db.commit()
1052
+ return _set_session_cookie(
1053
+ RedirectResponse(
1054
+ "/account/email/settings?action=emailPrefs&message=Email+settings+saved.",
1055
+ status_code=303,
1056
+ ),
1057
+ viewer.token,
1058
+ )
1059
+
1060
+
1061
+ @app.get("/account/password", response_class=HTMLResponse)
1062
+ def account_password(
1063
+ request: Request,
1064
+ db: sqlite3.Connection = Depends(get_db),
1065
+ viewer: Viewer = Depends(get_viewer),
1066
+ ) -> HTMLResponse:
1067
+ gate = _require_member(request, viewer, db)
1068
+ if gate:
1069
+ return gate
1070
+ return render(
1071
+ request,
1072
+ "change_password.html",
1073
+ viewer,
1074
+ db,
1075
+ {
1076
+ "account_nav": ACCOUNT_NAV,
1077
+ "error": request.query_params.get("error"),
1078
+ "message": request.query_params.get("message"),
1079
+ },
1080
+ )
1081
+
1082
+
1083
+ @app.post("/account/password")
1084
+ def change_password(
1085
+ request: Request,
1086
+ new_password: str = Form(""),
1087
+ confirm_password: str = Form(""),
1088
+ db: sqlite3.Connection = Depends(get_db),
1089
+ viewer: Viewer = Depends(get_viewer),
1090
+ ) -> Any:
1091
+ gate = _require_member(request, viewer, db)
1092
+ if gate:
1093
+ return gate
1094
+ if len(new_password) < 8:
1095
+ target = "/account/password?error=Use+at+least+8+characters."
1096
+ elif new_password != confirm_password:
1097
+ target = "/account/password?error=Those+passwords+do+not+match."
1098
+ else:
1099
+ target = "/account/password?message=Password+updated."
1100
+ return _set_session_cookie(RedirectResponse(target, status_code=303), viewer.token)
1101
+
1102
+
1103
+ @app.get("/account/catalog", response_class=HTMLResponse)
1104
+ def account_catalog(
1105
+ request: Request,
1106
+ db: sqlite3.Connection = Depends(get_db),
1107
+ viewer: Viewer = Depends(get_viewer),
1108
+ ) -> HTMLResponse:
1109
+ gate = _require_member(request, viewer, db)
1110
+ if gate:
1111
+ return gate
1112
+ return render(
1113
+ request,
1114
+ "catalog_settings.html",
1115
+ viewer,
1116
+ db,
1117
+ {"account_nav": ACCOUNT_NAV, "prefs": repo.email_prefs(db, viewer.owner)},
1118
+ )
1119
+
1120
+
1121
+ @app.get("/purchase/history", response_class=HTMLResponse)
1122
+ def purchase_history(
1123
+ request: Request,
1124
+ db: sqlite3.Connection = Depends(get_db),
1125
+ viewer: Viewer = Depends(get_viewer),
1126
+ ) -> HTMLResponse:
1127
+ return render(
1128
+ request,
1129
+ "purchase_history.html",
1130
+ viewer,
1131
+ db,
1132
+ {
1133
+ "account_nav": ACCOUNT_NAV,
1134
+ "orders": repo.orders_for(db, viewer.owner) if viewer.signed_in else [],
1135
+ "stores": repo.find_stores(db, ""),
1136
+ "lookup_error": request.query_params.get("error"),
1137
+ },
1138
+ )
1139
+
1140
+
1141
+ @app.post("/purchase/history")
1142
+ def order_lookup(
1143
+ request: Request,
1144
+ orderId: str = Form(""),
1145
+ lastName: str = Form(""),
1146
+ postalCd: str = Form(""),
1147
+ db: sqlite3.Connection = Depends(get_db),
1148
+ viewer: Viewer = Depends(get_viewer),
1149
+ ) -> Any:
1150
+ found = repo.lookup_order(
1151
+ db, order_number=orderId, last_name=lastName, postal=postalCd
1152
+ )
1153
+ if found:
1154
+ return _set_session_cookie(
1155
+ RedirectResponse(f"/purchase/order/{found['order_id']}", status_code=303),
1156
+ viewer.token,
1157
+ )
1158
+ return render(
1159
+ request,
1160
+ "purchase_history.html",
1161
+ viewer,
1162
+ db,
1163
+ {
1164
+ "account_nav": ACCOUNT_NAV,
1165
+ "orders": repo.orders_for(db, viewer.owner) if viewer.signed_in else [],
1166
+ "stores": repo.find_stores(db, ""),
1167
+ "lookup_error": "We could not find an order with those details.",
1168
+ },
1169
+ )
1170
+
1171
+
1172
+ @app.get("/purchase/order/{order_id}", response_class=HTMLResponse)
1173
+ def order_page(
1174
+ request: Request,
1175
+ order_id: str,
1176
+ db: sqlite3.Connection = Depends(get_db),
1177
+ viewer: Viewer = Depends(get_viewer),
1178
+ ) -> HTMLResponse:
1179
+ order = repo.order_detail(db, order_id)
1180
+ if order is None:
1181
+ return render(request, "not_found.html", viewer, db, {}, status_code=404)
1182
+ if order["owner"] != viewer.owner:
1183
+ return render(
1184
+ request,
1185
+ "signin_required.html",
1186
+ viewer,
1187
+ db,
1188
+ {"account_nav": ACCOUNT_NAV, "next": request.url.path},
1189
+ status_code=403,
1190
+ )
1191
+ return render(
1192
+ request, "order.html", viewer, db, {"order": order, "account_nav": ACCOUNT_NAV}
1193
+ )
1194
+
1195
+
1196
+ @app.get("/webapp/wcs/stores/servlet/WishListDisplay", response_class=HTMLResponse)
1197
+ def wishlist_page(
1198
+ request: Request,
1199
+ db: sqlite3.Connection = Depends(get_db),
1200
+ viewer: Viewer = Depends(get_viewer),
1201
+ ) -> HTMLResponse:
1202
+ gate = _require_member(request, viewer, db)
1203
+ if gate:
1204
+ return gate
1205
+ return render(
1206
+ request,
1207
+ "wishlist.html",
1208
+ viewer,
1209
+ db,
1210
+ {"account_nav": ACCOUNT_NAV, "items": repo.wishlist(db, viewer.owner)},
1211
+ )
1212
+
1213
+
1214
+ @app.post("/wishlist/toggle")
1215
+ def wishlist_toggle(
1216
+ request: Request,
1217
+ product_id: str = Form(...),
1218
+ db: sqlite3.Connection = Depends(get_db),
1219
+ viewer: Viewer = Depends(get_viewer),
1220
+ ) -> Any:
1221
+ if not viewer.signed_in:
1222
+ return _set_session_cookie(
1223
+ RedirectResponse(
1224
+ "/webapp/wcs/stores/servlet/LogonForm", status_code=303
1225
+ ),
1226
+ viewer.token,
1227
+ )
1228
+ repo.toggle_wishlist(db, viewer.owner, product_id)
1229
+ db.commit()
1230
+ return _set_session_cookie(
1231
+ RedirectResponse(f"/llb/shop/{product_id}", status_code=303), viewer.token
1232
+ )
1233
+
1234
+
1235
+ # ---------------------------------------------------------------------------
1236
+ # service pages
1237
+ # ---------------------------------------------------------------------------
1238
+
1239
+
1240
+ def _stores_page(
1241
+ request: Request, db: sqlite3.Connection, viewer: Viewer, term: str
1242
+ ) -> HTMLResponse:
1243
+ return render(
1244
+ request,
1245
+ "stores.html",
1246
+ viewer,
1247
+ db,
1248
+ {
1249
+ "stores": repo.find_stores(db, term),
1250
+ "term": term,
1251
+ "searched": bool(term),
1252
+ "store_finder_id": STORE_FINDER_ID,
1253
+ },
1254
+ )
1255
+
1256
+
1257
+ @app.get("/giftcard/lookup", response_class=HTMLResponse)
1258
+ def giftcard_lookup(
1259
+ request: Request,
1260
+ db: sqlite3.Connection = Depends(get_db),
1261
+ viewer: Viewer = Depends(get_viewer),
1262
+ ) -> HTMLResponse:
1263
+ return render(
1264
+ request,
1265
+ "giftcard.html",
1266
+ viewer,
1267
+ db,
1268
+ {
1269
+ "balance": None,
1270
+ "error": request.query_params.get("error"),
1271
+ "demo_code": "6006000000000001",
1272
+ },
1273
+ )
1274
+
1275
+
1276
+ @app.post("/giftcard/lookup", response_class=HTMLResponse)
1277
+ def giftcard_check(
1278
+ request: Request,
1279
+ code: str = Form(""),
1280
+ pin: str = Form(""),
1281
+ db: sqlite3.Connection = Depends(get_db),
1282
+ viewer: Viewer = Depends(get_viewer),
1283
+ ) -> HTMLResponse:
1284
+ card = repo.gift_card_balance(db, code, pin)
1285
+ return render(
1286
+ request,
1287
+ "giftcard.html",
1288
+ viewer,
1289
+ db,
1290
+ {
1291
+ "balance": card["balance"] if card else None,
1292
+ "error": None if card else "We could not find that gift card number and PIN.",
1293
+ "demo_code": "6006000000000001",
1294
+ },
1295
+ )
1296
+
1297
+
1298
+ @app.get("/catalog/request", response_class=HTMLResponse)
1299
+ def catalog_request_page(
1300
+ request: Request,
1301
+ db: sqlite3.Connection = Depends(get_db),
1302
+ viewer: Viewer = Depends(get_viewer),
1303
+ ) -> HTMLResponse:
1304
+ return render(
1305
+ request,
1306
+ "catalog_request.html",
1307
+ viewer,
1308
+ db,
1309
+ {"errors": request.query_params.getlist("missing"), "submitted": False},
1310
+ )
1311
+
1312
+
1313
+ @app.post("/catalog/request", response_class=HTMLResponse)
1314
+ def catalog_request_submit(
1315
+ request: Request,
1316
+ first_name: str = Form(""),
1317
+ last_name: str = Form(""),
1318
+ email: str = Form(""),
1319
+ street1: str = Form(""),
1320
+ city: str = Form(""),
1321
+ state: str = Form(""),
1322
+ postal: str = Form(""),
1323
+ db: sqlite3.Connection = Depends(get_db),
1324
+ viewer: Viewer = Depends(get_viewer),
1325
+ ) -> HTMLResponse:
1326
+ missing = repo.request_catalog(
1327
+ db,
1328
+ {
1329
+ "first_name": first_name,
1330
+ "last_name": last_name,
1331
+ "email": email,
1332
+ "street1": street1,
1333
+ "city": city,
1334
+ "state": state,
1335
+ "postal": postal,
1336
+ },
1337
+ )
1338
+ db.commit()
1339
+ return render(
1340
+ request,
1341
+ "catalog_request.html",
1342
+ viewer,
1343
+ db,
1344
+ {"errors": missing, "submitted": not missing},
1345
+ )
1346
+
1347
+
1348
+ @app.get("/freeshipping/", response_class=HTMLResponse)
1349
+ def free_shipping(
1350
+ request: Request,
1351
+ db: sqlite3.Connection = Depends(get_db),
1352
+ viewer: Viewer = Depends(get_viewer),
1353
+ ) -> HTMLResponse:
1354
+ return render(request, "free_shipping.html", viewer, db, {})
1355
+
1356
+
1357
+ @app.get("/buy/pt/index", response_class=HTMLResponse)
1358
+ def collections_index(
1359
+ request: Request,
1360
+ db: sqlite3.Connection = Depends(get_db),
1361
+ viewer: Viewer = Depends(get_viewer),
1362
+ ) -> HTMLResponse:
1363
+ return render(
1364
+ request,
1365
+ "collections.html",
1366
+ viewer,
1367
+ db,
1368
+ {"tree": repo.category_tree(db)},
1369
+ )
1370
+
1371
+
1372
+ # A form action reached with GET (a typed URL, a refresh after back) should
1373
+ # land the visitor back on the surface that owns the form rather than 405.
1374
+ # These are redirect-only: no GET request mutates anything.
1375
+ _POST_ONLY_REDIRECTS = {
1376
+ "/cart/add": "/shoppingbag",
1377
+ "/cart/update": "/shoppingbag",
1378
+ "/cart/remove": "/shoppingbag",
1379
+ "/cart/save": "/shoppingbag",
1380
+ "/cart/redeem": "/shoppingbag",
1381
+ "/wishlist/toggle": "/webapp/wcs/stores/servlet/WishListDisplay",
1382
+ "/account/addresses/delete": "/account/addresses",
1383
+ "/account/signout": "/",
1384
+ }
1385
+
1386
+
1387
+ def _register_get_redirects() -> None:
1388
+ for source, target in _POST_ONLY_REDIRECTS.items():
1389
+ def _redirect(destination: str = target) -> RedirectResponse:
1390
+ return RedirectResponse(destination, status_code=303)
1391
+
1392
+ app.add_api_route(
1393
+ source, _redirect, methods=["GET"], include_in_schema=False
1394
+ )
1395
+
1396
+
1397
+ _register_get_redirects()
1398
+
1399
+
1400
+ @app.exception_handler(404)
1401
+ async def not_found(request: Request, exc: Any) -> HTMLResponse: # noqa: ARG001
1402
+ with db_session() as connection:
1403
+ viewer = get_viewer(request)
1404
+ return render(request, "not_found.html", viewer, connection, {}, status_code=404)
tasks/llbean/environment/reference/clone/backend/catalog.py ADDED
@@ -0,0 +1,714 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Business schema, migrations and deterministic seed for the llbean clone.
2
+
3
+ The catalog rows come from source-observed evidence captured with Playwright in
4
+ the Mac Chrome session (see ``materials/llbean/scope/notes/``). Review bodies,
5
+ store rows, accounts, addresses and orders are synthetic fixtures: the source
6
+ never exposed them in a form this clone may persist.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import hashlib
12
+ import json
13
+ import sqlite3
14
+ from pathlib import Path
15
+ from typing import Any
16
+
17
+ SEED_DIR = Path(__file__).resolve().parents[1] / "data" / "seed"
18
+
19
+ # Colour buckets are the 13 facet values observed on the source category page.
20
+ COLOR_BUCKETS: dict[str, tuple[str, ...]] = {
21
+ "Black": ("black", "carbon", "onyx", "jet"),
22
+ "Blue": ("blue", "navy", "teal", "indigo", "denim", "nautical", "mallard"),
23
+ "Brown": ("brown", "bark", "chocolate", "coffee", "walnut", "espresso"),
24
+ "Gray": ("gray", "grey", "graphite", "granite", "slate", "mineral", "charcoal"),
25
+ "Green": ("green", "olive", "sage", "moss", "spruce", "forest", "fatigue"),
26
+ "Orange": ("orange", "rust", "blaze", "burnt", "apricot"),
27
+ "Pink": ("pink", "rose", "blush", "coral"),
28
+ "Purple": ("purple", "plum", "violet", "lilac"),
29
+ "Red": ("red", "crimson", "cardinal", "scarlet", "burgundy", "wine"),
30
+ "Tan": ("tan", "khaki", "sand", "camel", "oatmeal", "wheat", "putty", "stone"),
31
+ "White": ("white", "cream", "ivory", "natural", "bone"),
32
+ "Yellow": ("yellow", "gold", "mustard", "honey", "citron"),
33
+ "Multicolor": ("plaid", "print", "multi", "stripe", "camo", "tartan", "buffalo"),
34
+ }
35
+
36
+ # Brand names observed in the source Brand facet.
37
+ KNOWN_BRANDS = (
38
+ "L.L.Bean",
39
+ "Anglers Image",
40
+ "Anglers Sport Group",
41
+ "Boyt",
42
+ "Buck",
43
+ "Buff",
44
+ "Byer of Maine",
45
+ "Camelbak",
46
+ "Clic",
47
+ "Darn Tough",
48
+ "ENO",
49
+ "ExOfficio",
50
+ "Fishpond",
51
+ "Flip Focal",
52
+ "Garmin",
53
+ "Gear Keeper",
54
+ "Hydro Flask",
55
+ "Leatherman",
56
+ "Nalgene",
57
+ "Osprey",
58
+ "Smartwool",
59
+ "Thule",
60
+ "Yeti",
61
+ )
62
+
63
+ # Price bands are the nine bands observed in the source Price facet.
64
+ PRICE_BANDS: tuple[tuple[str, float, float], ...] = (
65
+ ("$0 to $30", 0.0, 30.0),
66
+ ("$30 to $50", 30.0, 50.0),
67
+ ("$50 to $75", 50.0, 75.0),
68
+ ("$75 to $100", 75.0, 100.0),
69
+ ("$100 to $150", 100.0, 150.0),
70
+ ("$150 to $250", 150.0, 250.0),
71
+ ("$250 to $500", 250.0, 500.0),
72
+ ("$500 to $1000", 500.0, 1000.0),
73
+ ("$1000 to $5000", 1000.0, 5000.0),
74
+ )
75
+
76
+ # The Sale collection filters by discount depth, as the source's "% Off" facet does.
77
+ PERCENT_OFF_BANDS: tuple[tuple[str, int, int], ...] = (
78
+ ("20% Off & More", 20, 1000),
79
+ ("30% Off & More", 30, 1000),
80
+ ("40% Off & More", 40, 1000),
81
+ ("50% Off & More", 50, 1000),
82
+ )
83
+
84
+ SORT_FIELDS: dict[str, str] = {
85
+ "relevance": "Recommended",
86
+ "price_low_high": "Price: Low to High",
87
+ "price_high_low": "Price: High to Low",
88
+ "bestselling": "Bestselling",
89
+ "newest": "Newest",
90
+ "rating": "Customer Rating",
91
+ }
92
+
93
+ VIEW_COUNT = 48
94
+
95
+ SCHEMA = """
96
+ CREATE TABLE IF NOT EXISTS categories (
97
+ cat_id INTEGER PRIMARY KEY,
98
+ name TEXT NOT NULL,
99
+ slug TEXT,
100
+ parent_id INTEGER,
101
+ depth INTEGER NOT NULL DEFAULT 0,
102
+ nav_order INTEGER NOT NULL DEFAULT 0,
103
+ kind TEXT NOT NULL DEFAULT 'category',
104
+ tile_image TEXT,
105
+ tile_alt TEXT
106
+ );
107
+ CREATE TABLE IF NOT EXISTS products (
108
+ product_id TEXT PRIMARY KEY,
109
+ slug TEXT,
110
+ name TEXT NOT NULL,
111
+ item_number TEXT,
112
+ brand TEXT NOT NULL DEFAULT 'L.L.Bean',
113
+ description TEXT,
114
+ material TEXT,
115
+ price_low REAL NOT NULL,
116
+ price_high REAL NOT NULL,
117
+ list_price REAL NOT NULL,
118
+ sale_price REAL,
119
+ on_sale INTEGER NOT NULL DEFAULT 0,
120
+ is_new INTEGER NOT NULL DEFAULT 0,
121
+ rating REAL,
122
+ review_count INTEGER NOT NULL DEFAULT 0,
123
+ availability TEXT NOT NULL DEFAULT 'InStock',
124
+ low_inventory INTEGER NOT NULL DEFAULT 0,
125
+ color_count INTEGER NOT NULL DEFAULT 0,
126
+ gender TEXT,
127
+ percent_off INTEGER NOT NULL DEFAULT 0,
128
+ grid_image TEXT,
129
+ grid_image_alt TEXT,
130
+ position INTEGER NOT NULL DEFAULT 0,
131
+ breadcrumb TEXT NOT NULL DEFAULT '[]'
132
+ );
133
+ CREATE TABLE IF NOT EXISTS product_categories (
134
+ product_id TEXT NOT NULL,
135
+ cat_id INTEGER NOT NULL,
136
+ PRIMARY KEY (product_id, cat_id)
137
+ );
138
+ CREATE TABLE IF NOT EXISTS product_images (
139
+ product_id TEXT NOT NULL,
140
+ idx INTEGER NOT NULL,
141
+ asset TEXT NOT NULL,
142
+ caption TEXT,
143
+ PRIMARY KEY (product_id, idx)
144
+ );
145
+ CREATE TABLE IF NOT EXISTS product_colors (
146
+ product_id TEXT NOT NULL,
147
+ idx INTEGER NOT NULL,
148
+ name TEXT NOT NULL,
149
+ bucket TEXT,
150
+ swatch TEXT,
151
+ price REAL,
152
+ PRIMARY KEY (product_id, idx)
153
+ );
154
+ CREATE TABLE IF NOT EXISTS product_sizes (
155
+ product_id TEXT NOT NULL,
156
+ idx INTEGER NOT NULL,
157
+ name TEXT NOT NULL,
158
+ in_stock INTEGER NOT NULL DEFAULT 1,
159
+ PRIMARY KEY (product_id, idx)
160
+ );
161
+ CREATE TABLE IF NOT EXISTS reviews (
162
+ review_id INTEGER PRIMARY KEY AUTOINCREMENT,
163
+ product_id TEXT NOT NULL,
164
+ rating INTEGER NOT NULL,
165
+ title TEXT NOT NULL,
166
+ body TEXT NOT NULL,
167
+ author TEXT NOT NULL,
168
+ location TEXT,
169
+ created_at TEXT NOT NULL,
170
+ helpful INTEGER NOT NULL DEFAULT 0,
171
+ not_helpful INTEGER NOT NULL DEFAULT 0,
172
+ synthetic INTEGER NOT NULL DEFAULT 1
173
+ );
174
+ CREATE TABLE IF NOT EXISTS carts (
175
+ cart_id TEXT PRIMARY KEY,
176
+ owner_key TEXT NOT NULL UNIQUE,
177
+ created_at TEXT NOT NULL
178
+ );
179
+ CREATE TABLE IF NOT EXISTS cart_items (
180
+ item_id INTEGER PRIMARY KEY AUTOINCREMENT,
181
+ cart_id TEXT NOT NULL,
182
+ product_id TEXT NOT NULL,
183
+ color TEXT,
184
+ size TEXT,
185
+ qty INTEGER NOT NULL DEFAULT 1,
186
+ unit_price REAL NOT NULL,
187
+ saved INTEGER NOT NULL DEFAULT 0,
188
+ added_at TEXT NOT NULL
189
+ );
190
+ CREATE TABLE IF NOT EXISTS addresses (
191
+ address_id INTEGER PRIMARY KEY AUTOINCREMENT,
192
+ owner TEXT NOT NULL,
193
+ label TEXT,
194
+ first_name TEXT NOT NULL,
195
+ last_name TEXT NOT NULL,
196
+ street1 TEXT NOT NULL,
197
+ street2 TEXT,
198
+ city TEXT NOT NULL,
199
+ state TEXT NOT NULL,
200
+ postal TEXT NOT NULL,
201
+ country TEXT NOT NULL DEFAULT 'United States',
202
+ phone TEXT,
203
+ is_default INTEGER NOT NULL DEFAULT 0
204
+ );
205
+ CREATE TABLE IF NOT EXISTS orders (
206
+ order_id TEXT PRIMARY KEY,
207
+ owner TEXT NOT NULL,
208
+ order_number TEXT NOT NULL UNIQUE,
209
+ last_name TEXT NOT NULL,
210
+ postal TEXT NOT NULL,
211
+ placed_at TEXT NOT NULL,
212
+ status TEXT NOT NULL,
213
+ subtotal REAL NOT NULL,
214
+ shipping REAL NOT NULL DEFAULT 0,
215
+ tax REAL NOT NULL DEFAULT 0,
216
+ total REAL NOT NULL,
217
+ payment_ref TEXT
218
+ );
219
+ CREATE TABLE IF NOT EXISTS order_items (
220
+ order_item_id INTEGER PRIMARY KEY AUTOINCREMENT,
221
+ order_id TEXT NOT NULL,
222
+ product_id TEXT NOT NULL,
223
+ name TEXT NOT NULL,
224
+ color TEXT,
225
+ size TEXT,
226
+ qty INTEGER NOT NULL,
227
+ unit_price REAL NOT NULL
228
+ );
229
+ CREATE TABLE IF NOT EXISTS stores (
230
+ store_id INTEGER PRIMARY KEY,
231
+ name TEXT NOT NULL,
232
+ street TEXT NOT NULL,
233
+ city TEXT NOT NULL,
234
+ state TEXT NOT NULL,
235
+ postal TEXT NOT NULL,
236
+ phone TEXT NOT NULL,
237
+ hours TEXT NOT NULL
238
+ );
239
+ CREATE TABLE IF NOT EXISTS wishlist_items (
240
+ wish_id INTEGER PRIMARY KEY AUTOINCREMENT,
241
+ owner TEXT NOT NULL,
242
+ product_id TEXT NOT NULL,
243
+ added_at TEXT NOT NULL,
244
+ UNIQUE (owner, product_id)
245
+ );
246
+ CREATE TABLE IF NOT EXISTS gift_cards (
247
+ code TEXT PRIMARY KEY,
248
+ pin TEXT NOT NULL,
249
+ balance REAL NOT NULL
250
+ );
251
+ CREATE TABLE IF NOT EXISTS promotions (
252
+ code TEXT PRIMARY KEY,
253
+ kind TEXT NOT NULL,
254
+ amount REAL NOT NULL,
255
+ label TEXT NOT NULL
256
+ );
257
+ CREATE TABLE IF NOT EXISTS cart_promotions (
258
+ cart_id TEXT NOT NULL,
259
+ code TEXT NOT NULL,
260
+ PRIMARY KEY (cart_id, code)
261
+ );
262
+ CREATE TABLE IF NOT EXISTS catalog_requests (
263
+ request_id INTEGER PRIMARY KEY AUTOINCREMENT,
264
+ first_name TEXT NOT NULL,
265
+ last_name TEXT NOT NULL,
266
+ email TEXT NOT NULL,
267
+ street1 TEXT NOT NULL,
268
+ city TEXT NOT NULL,
269
+ state TEXT NOT NULL,
270
+ postal TEXT NOT NULL,
271
+ created_at TEXT NOT NULL
272
+ );
273
+ CREATE TABLE IF NOT EXISTS email_prefs (
274
+ owner TEXT PRIMARY KEY,
275
+ subscribed INTEGER NOT NULL DEFAULT 1,
276
+ frequency TEXT NOT NULL DEFAULT 'weekly',
277
+ catalog_opt INTEGER NOT NULL DEFAULT 1
278
+ );
279
+ CREATE TABLE IF NOT EXISTS nav_menu (
280
+ row_id INTEGER PRIMARY KEY AUTOINCREMENT,
281
+ top_label TEXT NOT NULL,
282
+ kind TEXT NOT NULL,
283
+ position INTEGER NOT NULL,
284
+ depth INTEGER NOT NULL,
285
+ label TEXT NOT NULL,
286
+ cat_id INTEGER,
287
+ slug TEXT,
288
+ is_group INTEGER NOT NULL DEFAULT 0,
289
+ group_label TEXT
290
+ );
291
+ CREATE TABLE IF NOT EXISTS category_facets (
292
+ cat_id INTEGER NOT NULL,
293
+ position INTEGER NOT NULL,
294
+ facet TEXT NOT NULL,
295
+ PRIMARY KEY (cat_id, facet)
296
+ );
297
+ CREATE TABLE IF NOT EXISTS lander_sections (
298
+ section_id INTEGER PRIMARY KEY AUTOINCREMENT,
299
+ cat_id INTEGER NOT NULL,
300
+ position INTEGER NOT NULL,
301
+ heading TEXT,
302
+ prose TEXT,
303
+ view_all_cat_id INTEGER,
304
+ view_all_slug TEXT
305
+ );
306
+ CREATE TABLE IF NOT EXISTS lander_items (
307
+ item_id INTEGER PRIMARY KEY AUTOINCREMENT,
308
+ section_id INTEGER NOT NULL,
309
+ position INTEGER NOT NULL,
310
+ label TEXT NOT NULL,
311
+ cat_id INTEGER,
312
+ slug TEXT,
313
+ blurb TEXT,
314
+ asset TEXT,
315
+ alt TEXT,
316
+ external INTEGER NOT NULL DEFAULT 0
317
+ );
318
+ CREATE TABLE IF NOT EXISTS home_sections (
319
+ section_id INTEGER PRIMARY KEY AUTOINCREMENT,
320
+ key TEXT NOT NULL UNIQUE,
321
+ kind TEXT NOT NULL,
322
+ position INTEGER NOT NULL,
323
+ heading TEXT,
324
+ sub TEXT,
325
+ cta_label TEXT,
326
+ cta_cat_id INTEGER,
327
+ cta_slug TEXT
328
+ );
329
+ CREATE TABLE IF NOT EXISTS home_items (
330
+ item_id INTEGER PRIMARY KEY AUTOINCREMENT,
331
+ section_id INTEGER NOT NULL,
332
+ position INTEGER NOT NULL,
333
+ label TEXT NOT NULL,
334
+ cat_id INTEGER,
335
+ slug TEXT,
336
+ blurb TEXT,
337
+ asset TEXT,
338
+ alt TEXT
339
+ );
340
+ CREATE TABLE IF NOT EXISTS recently_viewed (
341
+ owner TEXT NOT NULL,
342
+ product_id TEXT NOT NULL,
343
+ viewed_at TEXT NOT NULL,
344
+ PRIMARY KEY (owner, product_id)
345
+ );
346
+ CREATE TABLE IF NOT EXISTS content_pages (
347
+ cat_id INTEGER PRIMARY KEY,
348
+ name TEXT NOT NULL,
349
+ blurb TEXT NOT NULL
350
+ );
351
+ CREATE INDEX IF NOT EXISTS idx_pc_cat ON product_categories(cat_id);
352
+ CREATE INDEX IF NOT EXISTS idx_ci_cart ON cart_items(cart_id);
353
+ CREATE INDEX IF NOT EXISTS idx_rev_product ON reviews(product_id);
354
+ CREATE INDEX IF NOT EXISTS idx_oi_order ON order_items(order_id);
355
+ """
356
+
357
+
358
+ def migrate(connection: sqlite3.Connection) -> None:
359
+ """Create the business schema. Safe to run repeatedly.
360
+
361
+ Statements run one at a time on purpose: ``executescript`` commits the
362
+ caller's open transaction, which breaks the backend lifecycle contract.
363
+ """
364
+
365
+ for statement in SCHEMA.split(";"):
366
+ if statement.strip():
367
+ connection.execute(statement)
368
+
369
+
370
+ def _load(name: str) -> Any:
371
+ return json.loads((SEED_DIR / name).read_text(encoding="utf-8"))
372
+
373
+
374
+ def _color_bucket(name: str) -> str | None:
375
+ lowered = name.lower()
376
+ for bucket, needles in COLOR_BUCKETS.items():
377
+ if any(needle in lowered for needle in needles):
378
+ return bucket
379
+ return None
380
+
381
+
382
+ GENDER_CRUMBS = {
383
+ "Women's": "Women's",
384
+ "Men's": "Men's",
385
+ "Kids'": "Kids'",
386
+ "Baby": "Kids'",
387
+ "Toddler": "Kids'",
388
+ "Girls'": "Kids'",
389
+ "Boys'": "Kids'",
390
+ }
391
+
392
+
393
+ def _gender_for(breadcrumb: list[str], name: str) -> str | None:
394
+ """Gender comes from the breadcrumb the source renders on the product page."""
395
+
396
+ for crumb in breadcrumb:
397
+ for needle, label in GENDER_CRUMBS.items():
398
+ if needle.lower() in crumb.lower():
399
+ return label
400
+ for needle, label in GENDER_CRUMBS.items():
401
+ if name.lower().startswith(needle.lower()):
402
+ return label
403
+ return None
404
+
405
+
406
+ def _brand_for(name: str) -> str:
407
+ for brand in KNOWN_BRANDS:
408
+ if brand == "L.L.Bean":
409
+ continue
410
+ if brand.lower() in name.lower():
411
+ return brand
412
+ return "L.L.Bean"
413
+
414
+
415
+ def _stable_int(*parts: str) -> int:
416
+ digest = hashlib.sha256("|".join(parts).encode("utf-8")).hexdigest()
417
+ return int(digest[:8], 16)
418
+
419
+
420
+ REVIEW_TEMPLATES = (
421
+ (5, "Exactly what I wanted", "Held up through a full season of use and still looks new. Sizing was true to the chart."),
422
+ (5, "Buy it once", "Well made and thoughtfully designed. The details are where this one earns its price."),
423
+ (4, "Very good, one small note", "Quality is excellent. I would prefer one more pocket, but that is a minor thing."),
424
+ (4, "Solid everyday pick", "Comfortable and durable. Colour matches the product photos closely."),
425
+ (3, "Good but runs large", "The material is nice. I sized down and it fit much better."),
426
+ (2, "Not for me", "The fit was not right for my build and the fabric was heavier than I expected."),
427
+ (1, "Disappointed", "Arrived with a loose seam. Returns were straightforward but I expected better."),
428
+ )
429
+
430
+ AUTHORS = (
431
+ ("Casco Bay Hiker", "Portland, ME"),
432
+ ("Trailhead Sam", "Burlington, VT"),
433
+ ("Northwoods Reader", "Duluth, MN"),
434
+ ("Coastal Walker", "Camden, ME"),
435
+ ("Weekend Paddler", "Ithaca, NY"),
436
+ ("Frost Hollow", "Berlin, NH"),
437
+ ("Granite Stater", "Concord, NH"),
438
+ )
439
+
440
+ SEED_STORES = (
441
+ (1, "Freeport Flagship Store", "95 Main Street", "Freeport", "ME", "04033", "(877) 755-2326", "Open 24 hours"),
442
+ (2, "Portland Store", "375 Riverside Street", "Portland", "ME", "04103", "(207) 470-1200", "9:00 AM - 8:00 PM"),
443
+ (3, "South Portland Store", "200 Running Hill Road", "South Portland", "ME", "04106", "(207) 253-9500", "9:00 AM - 9:00 PM"),
444
+ (4, "Burlington Store", "49 Church Street", "Burlington", "VT", "05401", "(802) 448-3800", "10:00 AM - 7:00 PM"),
445
+ (5, "Nashua Store", "310 Daniel Webster Highway", "Nashua", "NH", "03060", "(603) 546-5100", "10:00 AM - 8:00 PM"),
446
+ (6, "Marlborough Store", "601 Donald Lynch Boulevard", "Marlborough", "MA", "01752", "(508) 251-3000", "10:00 AM - 8:00 PM"),
447
+ (7, "Yonkers Store", "2500 Central Park Avenue", "Yonkers", "NY", "10710", "(914) 573-2000", "10:00 AM - 8:00 PM"),
448
+ (8, "King of Prussia Store", "160 North Gulph Road", "King of Prussia", "PA", "19406", "(610) 337-4400", "10:00 AM - 8:00 PM"),
449
+ (9, "Columbia Store", "6151 Little River Turnpike", "Alexandria", "VA", "22312", "(703) 941-3400", "10:00 AM - 8:00 PM"),
450
+ (10, "Glenview Store", "1931 Tower Drive", "Glenview", "IL", "60026", "(847) 400-2100", "10:00 AM - 8:00 PM"),
451
+ )
452
+
453
+ SEED_PROMOTIONS = (
454
+ ("BEAN20", "percent", 20.0, "20% off your order"),
455
+ ("SHIPFREE", "shipping", 0.0, "Free standard shipping"),
456
+ ("TRAIL10", "amount", 10.0, "$10 off your order"),
457
+ )
458
+
459
+ SEED_GIFT_CARDS = (
460
+ ("6006000000000001", "1234", 75.00),
461
+ ("6006000000000002", "5678", 0.00),
462
+ )
463
+
464
+
465
+ def seed(connection: sqlite3.Connection) -> None:
466
+ """Seed deterministic catalog data. Idempotent."""
467
+
468
+ migrate(connection)
469
+ if connection.execute("SELECT COUNT(*) FROM products").fetchone()[0]:
470
+ return
471
+
472
+ categories = _load("categories.json")
473
+ tiles = _load("category_tiles.json")
474
+ connection.executemany(
475
+ "INSERT OR REPLACE INTO categories"
476
+ " (cat_id, name, slug, parent_id, depth, nav_order, kind, tile_image, tile_alt)"
477
+ " VALUES (?,?,?,?,?,?,?,?,?)",
478
+ [
479
+ (
480
+ c["cat_id"],
481
+ c["name"],
482
+ c.get("slug"),
483
+ c.get("parent_id"),
484
+ c.get("depth", 0),
485
+ c.get("nav_order", 0),
486
+ "category",
487
+ (
488
+ f"/static/img/category/{c['cat_id']}.jpg"
489
+ if str(c["cat_id"]) in tiles
490
+ else None
491
+ ),
492
+ (tiles.get(str(c["cat_id"]), {}) or {}).get("alt"),
493
+ )
494
+ for c in categories
495
+ ],
496
+ )
497
+
498
+ products = _load("products.json")
499
+ known_categories = {c["cat_id"] for c in categories}
500
+ outdoor_equipment = 29
501
+
502
+ for product in products:
503
+ pid = str(product["product_id"])
504
+ name = product["name"]
505
+ low = float(product["price_low"])
506
+ high = float(product["price_high"])
507
+ on_sale = 1 if product.get("on_sale") else 0
508
+ seed_int = _stable_int(pid, name)
509
+ low_inventory = 1 if seed_int % 7 == 0 else 0
510
+ is_new = 1 if seed_int % 5 == 0 else 0
511
+
512
+ connection.execute(
513
+ "INSERT OR REPLACE INTO products (product_id, slug, name, item_number, brand,"
514
+ " description, material, price_low, price_high, list_price, sale_price, on_sale,"
515
+ " is_new, rating, review_count, availability, low_inventory, color_count,"
516
+ " gender, percent_off, grid_image, grid_image_alt, position, breadcrumb)"
517
+ " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
518
+ (
519
+ pid,
520
+ product.get("slug"),
521
+ name,
522
+ product.get("item_number"),
523
+ _brand_for(name),
524
+ product.get("description"),
525
+ product.get("material"),
526
+ low,
527
+ high,
528
+ float(product.get("list_price") or high),
529
+ product.get("sale_price"),
530
+ on_sale,
531
+ is_new,
532
+ product.get("rating"),
533
+ int(product.get("review_count") or 0),
534
+ product.get("availability") or "InStock",
535
+ low_inventory,
536
+ int(product.get("color_count") or 0),
537
+ _gender_for(product.get("breadcrumb") or [], name),
538
+ (
539
+ round((1 - low / high) * 100)
540
+ if on_sale and high
541
+ else 0
542
+ ),
543
+ f"/static/img/product/{pid}_grid.webp",
544
+ product.get("grid_image_alt") or name,
545
+ int(product.get("position") or 0),
546
+ json.dumps(product.get("breadcrumb") or []),
547
+ ),
548
+ )
549
+
550
+ # Category membership comes from the crawl: every category page whose grid
551
+ # listed this product. Falls back to the deepest known breadcrumb name.
552
+ assigned = [c for c in (product.get("categories") or []) if c in known_categories]
553
+ if not assigned:
554
+ for crumb in reversed(product.get("breadcrumb") or []):
555
+ match = connection.execute(
556
+ "SELECT cat_id FROM categories WHERE name = ? ORDER BY depth DESC LIMIT 1",
557
+ (crumb,),
558
+ ).fetchone()
559
+ if match and match[0] in known_categories:
560
+ assigned = [match[0]]
561
+ break
562
+ for cat_id in assigned or [outdoor_equipment]:
563
+ connection.execute(
564
+ "INSERT OR IGNORE INTO product_categories (product_id, cat_id) VALUES (?,?)",
565
+ (pid, cat_id),
566
+ )
567
+
568
+ detail_limit = 5 if product.get("observed_in_grid") else 2
569
+ for idx, image in enumerate(product.get("images") or []):
570
+ if idx >= detail_limit:
571
+ break
572
+ connection.execute(
573
+ "INSERT OR REPLACE INTO product_images (product_id, idx, asset, caption)"
574
+ " VALUES (?,?,?,?)",
575
+ (pid, idx, f"/static/img/product/{pid}_d{idx}.webp", image.get("caption")),
576
+ )
577
+
578
+ swatches = product.get("swatches") or []
579
+ colors = product.get("colors") or []
580
+ for idx, color in enumerate(colors):
581
+ swatch_asset = None
582
+ if idx < len(swatches):
583
+ swatch_asset = f"/static/img/swatch/{pid}_s{idx}.webp"
584
+ connection.execute(
585
+ "INSERT OR REPLACE INTO product_colors (product_id, idx, name, bucket, swatch, price)"
586
+ " VALUES (?,?,?,?,?,?)",
587
+ (
588
+ pid,
589
+ idx,
590
+ color,
591
+ _color_bucket(color),
592
+ swatch_asset,
593
+ low if (on_sale and idx == 0) else high,
594
+ ),
595
+ )
596
+
597
+ for idx, size in enumerate(product.get("sizes") or []):
598
+ connection.execute(
599
+ "INSERT OR REPLACE INTO product_sizes (product_id, idx, name, in_stock)"
600
+ " VALUES (?,?,?,?)",
601
+ (pid, idx, size, 0 if (seed_int + idx) % 11 == 0 else 1),
602
+ )
603
+
604
+ # Synthetic review bodies distributed to match the observed rating.
605
+ target = float(product.get("rating") or 4.5)
606
+ count = min(int(product.get("review_count") or 0), 12)
607
+ for n in range(count):
608
+ template = REVIEW_TEMPLATES[(seed_int + n) % len(REVIEW_TEMPLATES)]
609
+ if n < max(1, int(count * 0.7)):
610
+ template = REVIEW_TEMPLATES[(seed_int + n) % 2]
611
+ author, location = AUTHORS[(seed_int + n) % len(AUTHORS)]
612
+ day = 1 + ((seed_int + n * 7) % 28)
613
+ month = 1 + ((seed_int + n * 3) % 12)
614
+ connection.execute(
615
+ "INSERT INTO reviews (product_id, rating, title, body, author, location,"
616
+ " created_at, helpful, not_helpful, synthetic) VALUES (?,?,?,?,?,?,?,?,?,1)",
617
+ (
618
+ pid,
619
+ template[0],
620
+ template[1],
621
+ template[2],
622
+ author,
623
+ location,
624
+ f"2026-{month:02d}-{day:02d}",
625
+ (seed_int + n) % 40,
626
+ (seed_int + n) % 5,
627
+ ),
628
+ )
629
+ del target
630
+
631
+ connection.executemany(
632
+ "INSERT INTO nav_menu (top_label, kind, position, depth, label, cat_id, slug,"
633
+ " is_group, group_label) VALUES (?,?,?,?,?,?,?,?,?)",
634
+ [
635
+ (
636
+ m["top"], m["kind"], m["position"], m["depth"], m["label"],
637
+ m.get("cat_id"), m.get("slug"), m.get("is_group", 0), m.get("group"),
638
+ )
639
+ for m in _load("nav_menu.json")
640
+ ],
641
+ )
642
+ facet_cfg = _load("category_facets.json")
643
+ connection.executemany(
644
+ "INSERT OR REPLACE INTO category_facets (cat_id, position, facet) VALUES (?,?,?)",
645
+ [
646
+ (int(cat_id), position, facet)
647
+ for cat_id, entry in facet_cfg.items()
648
+ for position, facet in enumerate(entry["facets"])
649
+ ],
650
+ )
651
+ home = _load("home.json")
652
+ for position, section in enumerate(home["sections"]):
653
+ cursor = connection.execute(
654
+ "INSERT OR REPLACE INTO home_sections (key, kind, position, heading, sub,"
655
+ " cta_label, cta_cat_id, cta_slug) VALUES (?,?,?,?,?,?,?,?)",
656
+ (
657
+ section["key"], section["kind"], section.get("position", position),
658
+ section.get("heading"), section.get("sub"),
659
+ section.get("cta_label"), section.get("cta_cat_id"), section.get("cta_slug"),
660
+ ),
661
+ )
662
+ connection.executemany(
663
+ "INSERT INTO home_items (section_id, position, label, cat_id, slug, blurb,"
664
+ " asset, alt) VALUES (?,?,?,?,?,?,?,?)",
665
+ [
666
+ (
667
+ cursor.lastrowid, i, it["label"], it.get("cat_id"), it.get("slug"),
668
+ it.get("blurb"), it.get("asset"), it.get("alt"),
669
+ )
670
+ for i, it in enumerate(section["items"])
671
+ ],
672
+ )
673
+
674
+ for cat_id, lander in _load("landers.json").items():
675
+ for position, section in enumerate(lander["sections"]):
676
+ view_all = section.get("view_all") or {}
677
+ cursor = connection.execute(
678
+ "INSERT INTO lander_sections (cat_id, position, heading, prose,"
679
+ " view_all_cat_id, view_all_slug) VALUES (?,?,?,?,?,?)",
680
+ (
681
+ int(cat_id), position, section.get("heading"), section.get("prose"),
682
+ view_all.get("cat_id"), view_all.get("slug"),
683
+ ),
684
+ )
685
+ section_id = cursor.lastrowid
686
+ connection.executemany(
687
+ "INSERT INTO lander_items (section_id, position, label, cat_id, slug,"
688
+ " blurb, asset, alt, external) VALUES (?,?,?,?,?,?,?,?,?)",
689
+ [
690
+ (
691
+ section_id, i, it["label"], it.get("cat_id"), it.get("slug"),
692
+ it.get("blurb"), it.get("asset"), it.get("alt"),
693
+ 1 if it.get("external") else 0,
694
+ )
695
+ for i, it in enumerate(section["items"])
696
+ ],
697
+ )
698
+ connection.executemany(
699
+ "INSERT OR REPLACE INTO content_pages (cat_id, name, blurb) VALUES (?,?,?)",
700
+ [(c["cat_id"], c["name"], c["blurb"]) for c in _load("content_pages.json")],
701
+ )
702
+ connection.executemany(
703
+ "INSERT OR REPLACE INTO stores (store_id, name, street, city, state, postal, phone, hours)"
704
+ " VALUES (?,?,?,?,?,?,?,?)",
705
+ SEED_STORES,
706
+ )
707
+ connection.executemany(
708
+ "INSERT OR REPLACE INTO promotions (code, kind, amount, label) VALUES (?,?,?,?)",
709
+ SEED_PROMOTIONS,
710
+ )
711
+ connection.executemany(
712
+ "INSERT OR REPLACE INTO gift_cards (code, pin, balance) VALUES (?,?,?)",
713
+ SEED_GIFT_CARDS,
714
+ )
tasks/llbean/environment/reference/clone/backend/repo.py ADDED
@@ -0,0 +1,1098 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Query and mutation layer for the llbean clone.
2
+
3
+ Every collection, facet count and total is computed from SQLite. Nothing here
4
+ returns a fixed response standing in for a query.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import hashlib
10
+ import secrets
11
+ import sqlite3
12
+ import uuid
13
+ from datetime import datetime, timezone
14
+ from typing import Any, Iterable, Sequence
15
+
16
+ from .catalog import PERCENT_OFF_BANDS, PRICE_BANDS, SORT_FIELDS, VIEW_COUNT
17
+
18
+ _CATEGORY_TREE: list[dict[str, Any]] | None = None
19
+
20
+ FREE_SHIPPING_THRESHOLD = 50.0
21
+ TAX_RATE = 0.055
22
+
23
+
24
+ def _row(cursor_row: sqlite3.Row | None) -> dict[str, Any] | None:
25
+ return dict(cursor_row) if cursor_row is not None else None
26
+
27
+
28
+ def _rows(rows: Iterable[sqlite3.Row]) -> list[dict[str, Any]]:
29
+ return [dict(r) for r in rows]
30
+
31
+
32
+ def now() -> str:
33
+ return datetime.now(timezone.utc).isoformat(timespec="seconds")
34
+
35
+
36
+ # --------------------------------------------------------------------------
37
+ # taxonomy
38
+ # --------------------------------------------------------------------------
39
+
40
+
41
+ def top_categories(db: sqlite3.Connection) -> list[dict[str, Any]]:
42
+ return _rows(
43
+ db.execute(
44
+ "SELECT * FROM categories WHERE depth = 0 ORDER BY nav_order, cat_id"
45
+ )
46
+ )
47
+
48
+
49
+ def category(db: sqlite3.Connection, cat_id: int) -> dict[str, Any] | None:
50
+ return _row(
51
+ db.execute("SELECT * FROM categories WHERE cat_id = ?", (cat_id,)).fetchone()
52
+ )
53
+
54
+
55
+ def children(db: sqlite3.Connection, cat_id: int) -> list[dict[str, Any]]:
56
+ """Child categories, each with its real product count and a tile image."""
57
+
58
+ rows = _rows(
59
+ db.execute(
60
+ "SELECT c.*,"
61
+ " (SELECT COUNT(*) FROM product_categories pc WHERE pc.cat_id = c.cat_id)"
62
+ " AS product_count,"
63
+ " c.tile_image AS tile_image"
64
+ " FROM categories c WHERE c.parent_id = ? ORDER BY c.nav_order, c.cat_id",
65
+ (cat_id,),
66
+ )
67
+ )
68
+ return rows
69
+
70
+
71
+ def category_tree(db: sqlite3.Connection) -> list[dict[str, Any]]:
72
+ """Top-level categories each carrying their observed child list.
73
+
74
+ The taxonomy is seed data that never changes at runtime, and the header
75
+ renders it on every route, so it is built once per process in two queries.
76
+ """
77
+
78
+ global _CATEGORY_TREE
79
+ if _CATEGORY_TREE is None:
80
+ by_parent: dict[int, list[dict[str, Any]]] = {}
81
+ for child in _rows(
82
+ db.execute(
83
+ "SELECT * FROM categories WHERE depth > 0 ORDER BY nav_order, cat_id"
84
+ )
85
+ ):
86
+ by_parent.setdefault(child["parent_id"], []).append(child)
87
+ _CATEGORY_TREE = [
88
+ {**top, "children": by_parent.get(top["cat_id"], [])}
89
+ for top in top_categories(db)
90
+ ]
91
+ return _CATEGORY_TREE
92
+
93
+
94
+ _NAV_MENU: list[dict[str, Any]] | None = None
95
+
96
+
97
+ def nav_menu(db: sqlite3.Connection) -> list[dict[str, Any]]:
98
+ """The header mega-menu exactly as the source composes it.
99
+
100
+ Two shapes exist on the source: a flat single list (Outdoor Equipment, Home
101
+ Goods, Sale ...) and a grouped flyout where Women's / Men's / Kids' are
102
+ column headers each carrying their own subcategories (Clothing, Outerwear,
103
+ Footwear).
104
+ """
105
+
106
+ global _NAV_MENU
107
+ if _NAV_MENU is None:
108
+ # The header shows the source's ten top-level entries in its own order.
109
+ # `nav_menu` only supplies each entry's flyout, and one entry (Explore
110
+ # L.L.Bean) has no flyout at all, so the menu table cannot drive the bar.
111
+ # A promo collection must never become an eleventh root: that is kept
112
+ # true by giving such categories a non-zero depth in the seed.
113
+ tops = top_categories(db)
114
+ by_label = {t["name"]: t for t in tops}
115
+ rows = _rows(db.execute("SELECT * FROM nav_menu ORDER BY top_label, position"))
116
+ grouped: dict[str, list[dict[str, Any]]] = {}
117
+ for row in rows:
118
+ grouped.setdefault(row["top_label"], []).append(row)
119
+ menu = []
120
+ for top in tops:
121
+ entries = grouped.get(top["name"], [])
122
+ kind = entries[0]["kind"] if entries else "flat"
123
+ if kind == "grouped":
124
+ columns: list[dict[str, Any]] = []
125
+ for row in entries:
126
+ if row["is_group"]:
127
+ columns.append({"header": row, "links": []})
128
+ elif columns:
129
+ columns[-1]["links"].append(row)
130
+ menu.append({**top, "kind": "grouped", "columns": columns, "links": []})
131
+ else:
132
+ menu.append({**top, "kind": "flat", "columns": [], "links": entries})
133
+ del by_label
134
+ _NAV_MENU = menu
135
+ return _NAV_MENU
136
+
137
+
138
+ def home_sections(db: sqlite3.Connection) -> list[dict[str, Any]]:
139
+ """The home page composition, in the order the source lays it out."""
140
+
141
+ sections = _rows(db.execute("SELECT * FROM home_sections ORDER BY position"))
142
+ for section in sections:
143
+ section["tiles"] = _rows(
144
+ db.execute(
145
+ "SELECT * FROM home_items WHERE section_id = ? ORDER BY position",
146
+ (section["section_id"],),
147
+ )
148
+ )
149
+ return sections
150
+
151
+
152
+ def record_view(db: sqlite3.Connection, owner: str, product_id: str) -> None:
153
+ """Remember that this actor opened a product, for 'Pick Up Where You Left Off'."""
154
+
155
+ db.execute(
156
+ "INSERT INTO recently_viewed (owner, product_id, viewed_at) VALUES (?,?,?)"
157
+ " ON CONFLICT(owner, product_id) DO UPDATE SET viewed_at = excluded.viewed_at",
158
+ (owner, str(product_id), now()),
159
+ )
160
+
161
+
162
+ def recently_viewed(
163
+ db: sqlite3.Connection, owner: str, *, limit: int = 6
164
+ ) -> list[dict[str, Any]]:
165
+ return _rows(
166
+ db.execute(
167
+ "SELECT p.* FROM recently_viewed rv JOIN products p"
168
+ " ON p.product_id = rv.product_id WHERE rv.owner = ?"
169
+ " ORDER BY rv.viewed_at DESC LIMIT ?",
170
+ (owner, limit),
171
+ )
172
+ )
173
+
174
+
175
+ def lander(db: sqlite3.Connection, cat_id: int) -> dict[str, Any] | None:
176
+ """An editorial lander page (Outdoor Experiences, Explore L.L.Bean)."""
177
+
178
+ sections = _rows(
179
+ db.execute(
180
+ "SELECT * FROM lander_sections WHERE cat_id = ? ORDER BY position",
181
+ (int(cat_id),),
182
+ )
183
+ )
184
+ if not sections:
185
+ return None
186
+ for section in sections:
187
+ section["tiles"] = _rows(
188
+ db.execute(
189
+ "SELECT * FROM lander_items WHERE section_id = ? ORDER BY position",
190
+ (section["section_id"],),
191
+ )
192
+ )
193
+ return {"cat_id": int(cat_id), "sections": sections}
194
+
195
+
196
+ def ancestors(db: sqlite3.Connection, cat_id: int) -> list[dict[str, Any]]:
197
+ chain: list[dict[str, Any]] = []
198
+ current = category(db, cat_id)
199
+ guard = 0
200
+ while current and guard < 10:
201
+ chain.append(current)
202
+ if not current.get("parent_id"):
203
+ break
204
+ current = category(db, current["parent_id"])
205
+ guard += 1
206
+ return list(reversed(chain))
207
+
208
+
209
+ def descendants(db: sqlite3.Connection, cat_id: int) -> list[int]:
210
+ """The category itself plus every category beneath it."""
211
+
212
+ family = [int(cat_id)]
213
+ frontier = [int(cat_id)]
214
+ guard = 0
215
+ while frontier and guard < 8:
216
+ placeholders = ",".join("?" * len(frontier))
217
+ kids = [
218
+ row[0]
219
+ for row in db.execute(
220
+ f"SELECT cat_id FROM categories WHERE parent_id IN ({placeholders})",
221
+ frontier,
222
+ )
223
+ ]
224
+ kids = [k for k in kids if k not in family]
225
+ family.extend(kids)
226
+ frontier = kids
227
+ guard += 1
228
+ return family
229
+
230
+
231
+ # --------------------------------------------------------------------------
232
+ # collections: filtering, sorting, batching
233
+ # --------------------------------------------------------------------------
234
+
235
+ _SORT_SQL = {
236
+ "relevance": "p.position ASC",
237
+ "price_low_high": "p.price_low ASC, p.name ASC",
238
+ "price_high_low": "p.price_high DESC, p.name ASC",
239
+ "bestselling": "p.review_count DESC, p.name ASC",
240
+ "newest": "p.is_new DESC, p.position ASC",
241
+ "rating": "COALESCE(p.rating, 0) DESC, p.review_count DESC",
242
+ }
243
+
244
+
245
+ def _filter_sql(
246
+ *,
247
+ cat_id: int | None,
248
+ cat_ids: Sequence[int] | None = None,
249
+ query: str | None,
250
+ colors: Sequence[str],
251
+ brands: Sequence[str],
252
+ price_bands: Sequence[str],
253
+ on_sale: bool,
254
+ is_new: bool,
255
+ genders: Sequence[str] = (),
256
+ sizes: Sequence[str] = (),
257
+ materials: Sequence[str] = (),
258
+ percent_off: Sequence[str] = (),
259
+ ) -> tuple[str, list[Any]]:
260
+ joins = ""
261
+ where = ["1=1"]
262
+ params: list[Any] = []
263
+
264
+ if cat_id is not None:
265
+ # A category page lists its own products plus everything beneath it, the
266
+ # way the source counts a parent collection.
267
+ joins += " JOIN product_categories pc ON pc.product_id = p.product_id"
268
+ family = cat_ids or [cat_id]
269
+ placeholders = ",".join("?" * len(family))
270
+ where.append(f"pc.cat_id IN ({placeholders})")
271
+ params.extend(family)
272
+ if query:
273
+ where.append("(LOWER(p.name) LIKE ? OR LOWER(COALESCE(p.description,'')) LIKE ?)")
274
+ needle = f"%{query.lower()}%"
275
+ params.extend([needle, needle])
276
+ if colors:
277
+ placeholders = ",".join("?" * len(colors))
278
+ where.append(
279
+ "EXISTS (SELECT 1 FROM product_colors c WHERE c.product_id = p.product_id"
280
+ f" AND c.bucket IN ({placeholders}))"
281
+ )
282
+ params.extend(colors)
283
+ if brands:
284
+ placeholders = ",".join("?" * len(brands))
285
+ where.append(f"p.brand IN ({placeholders})")
286
+ params.extend(brands)
287
+ if price_bands:
288
+ clauses = []
289
+ for band in price_bands:
290
+ for label, low, high in PRICE_BANDS:
291
+ if label == band:
292
+ clauses.append("(p.price_low >= ? AND p.price_low < ?)")
293
+ params.extend([low, high])
294
+ if clauses:
295
+ where.append("(" + " OR ".join(clauses) + ")")
296
+ if genders:
297
+ placeholders = ",".join("?" * len(genders))
298
+ where.append(f"p.gender IN ({placeholders})")
299
+ params.extend(genders)
300
+ if sizes:
301
+ placeholders = ",".join("?" * len(sizes))
302
+ where.append(
303
+ "EXISTS (SELECT 1 FROM product_sizes z WHERE z.product_id = p.product_id"
304
+ f" AND z.name IN ({placeholders}))"
305
+ )
306
+ params.extend(sizes)
307
+ if materials:
308
+ placeholders = ",".join("?" * len(materials))
309
+ where.append(f"p.material IN ({placeholders})")
310
+ params.extend(materials)
311
+ if percent_off:
312
+ clauses = []
313
+ for band in percent_off:
314
+ for label, low, high in PERCENT_OFF_BANDS:
315
+ if label == band:
316
+ clauses.append("(p.percent_off >= ? AND p.percent_off < ?)")
317
+ params.extend([low, high])
318
+ if clauses:
319
+ where.append("(" + " OR ".join(clauses) + ")")
320
+ if on_sale:
321
+ where.append("p.on_sale = 1")
322
+ if is_new:
323
+ where.append("p.is_new = 1")
324
+ return joins + " WHERE " + " AND ".join(where), params
325
+
326
+
327
+ def collection(
328
+ db: sqlite3.Connection,
329
+ *,
330
+ cat_id: int | None = None,
331
+ query: str | None = None,
332
+ colors: Sequence[str] = (),
333
+ brands: Sequence[str] = (),
334
+ price_bands: Sequence[str] = (),
335
+ on_sale: bool = False,
336
+ is_new: bool = False,
337
+ genders: Sequence[str] = (),
338
+ sizes: Sequence[str] = (),
339
+ materials: Sequence[str] = (),
340
+ percent_off: Sequence[str] = (),
341
+ sort_field: str = "relevance",
342
+ start: int = 0,
343
+ view_count: int = VIEW_COUNT,
344
+ ) -> dict[str, Any]:
345
+ """Return one batch of a filtered collection plus its true total."""
346
+
347
+ if sort_field not in SORT_FIELDS:
348
+ sort_field = "relevance"
349
+ family = descendants(db, cat_id) if cat_id is not None else None
350
+ tail, params = _filter_sql(
351
+ cat_id=cat_id,
352
+ cat_ids=family,
353
+ query=query,
354
+ colors=colors,
355
+ brands=brands,
356
+ price_bands=price_bands,
357
+ on_sale=on_sale,
358
+ is_new=is_new,
359
+ genders=genders,
360
+ sizes=sizes,
361
+ materials=materials,
362
+ percent_off=percent_off,
363
+ )
364
+ total = db.execute(
365
+ f"SELECT COUNT(DISTINCT p.product_id) FROM products p{tail}", params
366
+ ).fetchone()[0]
367
+ limit = max(1, min(int(view_count or VIEW_COUNT), 96))
368
+ offset = max(0, int(start or 0))
369
+ rows = _rows(
370
+ db.execute(
371
+ f"SELECT DISTINCT p.* FROM products p{tail}"
372
+ f" ORDER BY {_SORT_SQL[sort_field]} LIMIT ? OFFSET ?",
373
+ [*params, limit, offset],
374
+ )
375
+ )
376
+ # One query for every card's swatches instead of one per card: a 48-item
377
+ # grid otherwise costs 48 extra round trips per page render.
378
+ if rows:
379
+ ids = [r["product_id"] for r in rows]
380
+ placeholders = ",".join("?" * len(ids))
381
+ grouped: dict[str, list[dict[str, Any]]] = {pid: [] for pid in ids}
382
+ for color in _rows(
383
+ db.execute(
384
+ "SELECT * FROM product_colors"
385
+ f" WHERE product_id IN ({placeholders}) ORDER BY product_id, idx",
386
+ ids,
387
+ )
388
+ ):
389
+ grouped[color["product_id"]].append(color)
390
+ for product in rows:
391
+ product["colors"] = grouped.get(product["product_id"], [])
392
+ return {
393
+ "products": rows,
394
+ "total": total,
395
+ "start": offset,
396
+ "view_count": limit,
397
+ "sort_field": sort_field,
398
+ "has_more": offset + len(rows) < total,
399
+ "next_start": offset + limit,
400
+ "remaining": max(0, total - (offset + len(rows))),
401
+ }
402
+
403
+
404
+ def category_facet_keys(db: sqlite3.Connection, cat_id: int | None) -> list[str]:
405
+ """The facet set the source shows for this collection.
406
+
407
+ Each collection has its own panel on the source: Clothing offers Gender,
408
+ Footwear adds Shoe Size and Brand, Sale leads with % Off. Only the facets
409
+ this clone can compute from captured data are listed, so no control is inert.
410
+ """
411
+
412
+ default = ["sale", "new", "color", "price", "brand"]
413
+ if cat_id is None:
414
+ return ["color", "price", "sale", "brand"]
415
+ rows = [
416
+ row[0]
417
+ for row in db.execute(
418
+ "SELECT facet FROM category_facets WHERE cat_id = ? ORDER BY position",
419
+ (int(cat_id),),
420
+ )
421
+ ]
422
+ if rows:
423
+ return rows
424
+ # fall back to the nearest ancestor that declares a panel
425
+ for ancestor in reversed(ancestors(db, int(cat_id))[:-1]):
426
+ rows = [
427
+ row[0]
428
+ for row in db.execute(
429
+ "SELECT facet FROM category_facets WHERE cat_id = ? ORDER BY position",
430
+ (ancestor["cat_id"],),
431
+ )
432
+ ]
433
+ if rows:
434
+ return rows
435
+ return default
436
+
437
+
438
+ def facets(
439
+ db: sqlite3.Connection,
440
+ *,
441
+ cat_id: int | None = None,
442
+ query: str | None = None,
443
+ keys: Sequence[str] | None = None,
444
+ ) -> dict[str, Any]:
445
+ """Facet values with counts computed against the current scope.
446
+
447
+ Only the requested facets are built, so a collection renders the panel the
448
+ source shows for it rather than one shared panel for every page.
449
+ """
450
+
451
+ wanted = list(keys) if keys is not None else category_facet_keys(db, cat_id)
452
+ family = descendants(db, cat_id) if cat_id is not None else None
453
+ tail, params = _filter_sql(
454
+ cat_id=cat_id,
455
+ cat_ids=family,
456
+ query=query,
457
+ colors=(),
458
+ brands=(),
459
+ price_bands=(),
460
+ on_sale=False,
461
+ is_new=False,
462
+ )
463
+ scope = f"(SELECT DISTINCT p.product_id FROM products p{tail})"
464
+ built: dict[str, Any] = {"order": wanted, "sort_options": SORT_FIELDS}
465
+
466
+ if "sale" in wanted:
467
+ built["sale"] = {
468
+ "name": "Sale",
469
+ "count": db.execute(
470
+ f"SELECT COUNT(DISTINCT p.product_id) FROM products p{tail} AND p.on_sale = 1",
471
+ params,
472
+ ).fetchone()[0],
473
+ }
474
+ if "new" in wanted:
475
+ built["new"] = {
476
+ "name": "New Arrivals",
477
+ "count": db.execute(
478
+ f"SELECT COUNT(DISTINCT p.product_id) FROM products p{tail} AND p.is_new = 1",
479
+ params,
480
+ ).fetchone()[0],
481
+ }
482
+ if "color" in wanted:
483
+ built["color"] = _rows(
484
+ db.execute(
485
+ "SELECT bucket AS name, COUNT(DISTINCT product_id) AS count FROM product_colors"
486
+ f" WHERE bucket IS NOT NULL AND product_id IN {scope}"
487
+ " GROUP BY bucket ORDER BY bucket",
488
+ params,
489
+ )
490
+ )
491
+ if "brand" in wanted:
492
+ built["brand"] = _rows(
493
+ db.execute(
494
+ f"SELECT p.brand AS name, COUNT(DISTINCT p.product_id) AS count FROM products p{tail}"
495
+ " GROUP BY p.brand ORDER BY count DESC, p.brand ASC",
496
+ params,
497
+ )
498
+ )
499
+ if "gender" in wanted:
500
+ built["gender"] = _rows(
501
+ db.execute(
502
+ f"SELECT p.gender AS name, COUNT(DISTINCT p.product_id) AS count FROM products p{tail}"
503
+ " AND p.gender IS NOT NULL GROUP BY p.gender ORDER BY count DESC",
504
+ params,
505
+ )
506
+ )
507
+ if "size" in wanted:
508
+ built["size"] = _rows(
509
+ db.execute(
510
+ "SELECT name, COUNT(DISTINCT product_id) AS count FROM product_sizes"
511
+ f" WHERE product_id IN {scope} GROUP BY name"
512
+ " ORDER BY count DESC, name LIMIT 24",
513
+ params,
514
+ )
515
+ )
516
+ if "material" in wanted:
517
+ built["material"] = _rows(
518
+ db.execute(
519
+ f"SELECT p.material AS name, COUNT(*) AS count FROM products p{tail}"
520
+ " AND p.material IS NOT NULL GROUP BY p.material ORDER BY count DESC LIMIT 12",
521
+ params,
522
+ )
523
+ )
524
+ if "price" in wanted:
525
+ price = []
526
+ for label, low, high in PRICE_BANDS:
527
+ count = db.execute(
528
+ f"SELECT COUNT(DISTINCT p.product_id) FROM products p{tail}"
529
+ " AND p.price_low >= ? AND p.price_low < ?",
530
+ [*params, low, high],
531
+ ).fetchone()[0]
532
+ if count:
533
+ price.append({"name": label, "count": count})
534
+ built["price"] = price
535
+ if "percent_off" in wanted:
536
+ bands = []
537
+ for label, low, high in PERCENT_OFF_BANDS:
538
+ count = db.execute(
539
+ f"SELECT COUNT(DISTINCT p.product_id) FROM products p{tail}"
540
+ " AND p.percent_off >= ? AND p.percent_off < ?",
541
+ [*params, low, high],
542
+ ).fetchone()[0]
543
+ if count:
544
+ bands.append({"name": label, "count": count})
545
+ built["percent_off"] = bands
546
+ return built
547
+
548
+
549
+ # --------------------------------------------------------------------------
550
+ # products
551
+ # --------------------------------------------------------------------------
552
+
553
+
554
+ def product(db: sqlite3.Connection, product_id: str) -> dict[str, Any] | None:
555
+ found = _row(
556
+ db.execute("SELECT * FROM products WHERE product_id = ?", (str(product_id),)).fetchone()
557
+ )
558
+ if not found:
559
+ return None
560
+ pid = found["product_id"]
561
+ found["images"] = _rows(
562
+ db.execute(
563
+ "SELECT * FROM product_images WHERE product_id = ? ORDER BY idx", (pid,)
564
+ )
565
+ )
566
+ found["colors"] = product_colors(db, pid)
567
+ found["sizes"] = _rows(
568
+ db.execute(
569
+ "SELECT * FROM product_sizes WHERE product_id = ? ORDER BY idx", (pid,)
570
+ )
571
+ )
572
+ import json as _json
573
+
574
+ found["breadcrumb_list"] = _json.loads(found.get("breadcrumb") or "[]")
575
+ return found
576
+
577
+
578
+ def product_colors(db: sqlite3.Connection, product_id: str) -> list[dict[str, Any]]:
579
+ return _rows(
580
+ db.execute(
581
+ "SELECT * FROM product_colors WHERE product_id = ? ORDER BY idx",
582
+ (str(product_id),),
583
+ )
584
+ )
585
+
586
+
587
+ def reviews(
588
+ db: sqlite3.Connection,
589
+ product_id: str,
590
+ *,
591
+ limit: int = 10,
592
+ offset: int = 0,
593
+ star: int | None = None,
594
+ sort: str = "recent",
595
+ ) -> dict[str, Any]:
596
+ where = "WHERE product_id = ?"
597
+ params: list[Any] = [str(product_id)]
598
+ if star:
599
+ where += " AND rating = ?"
600
+ params.append(int(star))
601
+ order = {
602
+ "recent": "created_at DESC, review_id DESC",
603
+ "helpful": "helpful DESC, review_id DESC",
604
+ "high": "rating DESC, review_id DESC",
605
+ "low": "rating ASC, review_id DESC",
606
+ }.get(sort, "created_at DESC, review_id DESC")
607
+ total = db.execute(f"SELECT COUNT(*) FROM reviews {where}", params).fetchone()[0]
608
+ items = _rows(
609
+ db.execute(
610
+ f"SELECT * FROM reviews {where} ORDER BY {order} LIMIT ? OFFSET ?",
611
+ [*params, limit, offset],
612
+ )
613
+ )
614
+ histogram = []
615
+ for value in (5, 4, 3, 2, 1):
616
+ count = db.execute(
617
+ "SELECT COUNT(*) FROM reviews WHERE product_id = ? AND rating = ?",
618
+ (str(product_id), value),
619
+ ).fetchone()[0]
620
+ overall = db.execute(
621
+ "SELECT COUNT(*) FROM reviews WHERE product_id = ?", (str(product_id),)
622
+ ).fetchone()[0] or 1
623
+ histogram.append(
624
+ {"stars": value, "count": count, "percent": round(count * 100.0 / overall, 2)}
625
+ )
626
+ return {
627
+ "entries": items,
628
+ "total": total,
629
+ "histogram": histogram,
630
+ "has_more": offset + len(items) < total,
631
+ "next_offset": offset + limit,
632
+ }
633
+
634
+
635
+ # --------------------------------------------------------------------------
636
+ # cart
637
+ # --------------------------------------------------------------------------
638
+
639
+
640
+ def bag_count(db: sqlite3.Connection, owner_key: str) -> int:
641
+ """Units in this actor's bag, without creating one.
642
+
643
+ Every page renders the header badge; opening a write transaction for a
644
+ visitor who has no bag yet serialises the whole site under concurrency.
645
+ """
646
+
647
+ row = db.execute(
648
+ "SELECT COALESCE(SUM(ci.qty), 0) FROM cart_items ci"
649
+ " JOIN carts c ON c.cart_id = ci.cart_id"
650
+ " WHERE c.owner_key = ? AND ci.saved = 0",
651
+ (owner_key,),
652
+ ).fetchone()
653
+ return int(row[0]) if row else 0
654
+
655
+
656
+ def _next_cart_id(db: sqlite3.Connection) -> str:
657
+ """The identifier the next shopping bag gets.
658
+
659
+ The bag page prints this value ("Shopping Bag ID: b9ce-8da6"), so a random
660
+ UUID made the very same read render differently on every visit. Bags are
661
+ numbered in creation order instead and the ordinal is hashed to keep the
662
+ identifier's shape; the loop skips an ordinal whose id is already taken so
663
+ a merged-away bag can never collide with a live one.
664
+ """
665
+
666
+ ordinal = int(db.execute("SELECT COUNT(*) FROM carts").fetchone()[0])
667
+ while True:
668
+ ordinal += 1
669
+ candidate = hashlib.blake2s(
670
+ f"llbean:bag:{ordinal}".encode("utf-8"), digest_size=8
671
+ ).hexdigest()
672
+ taken = db.execute(
673
+ "SELECT 1 FROM carts WHERE cart_id = ?", (candidate,)
674
+ ).fetchone()
675
+ if taken is None:
676
+ return candidate
677
+
678
+
679
+ def get_or_create_cart(db: sqlite3.Connection, owner_key: str) -> dict[str, Any]:
680
+ found = _row(
681
+ db.execute("SELECT * FROM carts WHERE owner_key = ?", (owner_key,)).fetchone()
682
+ )
683
+ if found:
684
+ return found
685
+ db.execute(
686
+ "INSERT OR IGNORE INTO carts (cart_id, owner_key, created_at) VALUES (?,?,?)",
687
+ (_next_cart_id(db), owner_key, now()),
688
+ )
689
+ created = _row(
690
+ db.execute("SELECT * FROM carts WHERE owner_key = ?", (owner_key,)).fetchone()
691
+ )
692
+ if created is None: # pragma: no cover - defensive
693
+ raise RuntimeError("could not open a shopping bag for this actor")
694
+ return created
695
+
696
+
697
+ def add_to_cart(
698
+ db: sqlite3.Connection,
699
+ owner_key: str,
700
+ *,
701
+ product_id: str,
702
+ color: str | None,
703
+ size: str | None,
704
+ qty: int,
705
+ ) -> dict[str, Any]:
706
+ item = product(db, product_id)
707
+ if item is None:
708
+ raise LookupError("unknown product")
709
+ if item["sizes"] and not size:
710
+ raise ValueError("Please select a size.")
711
+ if item["colors"] and not color:
712
+ raise ValueError("Please select a color.")
713
+ qty = max(1, min(int(qty or 1), 15))
714
+ cart = get_or_create_cart(db, owner_key)
715
+ unit_price = item["sale_price"] if item["on_sale"] else item["price_high"]
716
+ existing = db.execute(
717
+ "SELECT item_id, qty FROM cart_items WHERE cart_id = ? AND product_id = ?"
718
+ " AND COALESCE(color,'') = COALESCE(?,'') AND COALESCE(size,'') = COALESCE(?,'')"
719
+ " AND saved = 0",
720
+ (cart["cart_id"], str(product_id), color, size),
721
+ ).fetchone()
722
+ if existing:
723
+ db.execute(
724
+ "UPDATE cart_items SET qty = MIN(15, qty + ?) WHERE item_id = ?",
725
+ (qty, existing[0]),
726
+ )
727
+ else:
728
+ db.execute(
729
+ "INSERT INTO cart_items (cart_id, product_id, color, size, qty, unit_price,"
730
+ " saved, added_at) VALUES (?,?,?,?,?,?,0,?)",
731
+ (cart["cart_id"], str(product_id), color, size, qty, unit_price, now()),
732
+ )
733
+ return cart
734
+
735
+
736
+ def cart_view(db: sqlite3.Connection, owner_key: str) -> dict[str, Any]:
737
+ cart = get_or_create_cart(db, owner_key)
738
+ rows = _rows(
739
+ db.execute(
740
+ "SELECT ci.*, p.name, p.item_number, p.slug, p.grid_image, p.grid_image_alt,"
741
+ " p.low_inventory, p.on_sale, p.price_high"
742
+ " FROM cart_items ci JOIN products p ON p.product_id = ci.product_id"
743
+ " WHERE ci.cart_id = ? ORDER BY ci.item_id",
744
+ (cart["cart_id"],),
745
+ )
746
+ )
747
+ active = [r for r in rows if not r["saved"]]
748
+ saved = [r for r in rows if r["saved"]]
749
+ subtotal = round(sum(r["unit_price"] * r["qty"] for r in active), 2)
750
+ units = sum(r["qty"] for r in active)
751
+ promos = _rows(
752
+ db.execute(
753
+ "SELECT pr.* FROM cart_promotions cp JOIN promotions pr ON pr.code = cp.code"
754
+ " WHERE cp.cart_id = ?",
755
+ (cart["cart_id"],),
756
+ )
757
+ )
758
+ discount = 0.0
759
+ for promo in promos:
760
+ if promo["kind"] == "percent":
761
+ discount += subtotal * promo["amount"] / 100.0
762
+ elif promo["kind"] == "amount":
763
+ discount += promo["amount"]
764
+ discount = round(min(discount, subtotal), 2)
765
+ payable = round(subtotal - discount, 2)
766
+ free_shipping = payable >= FREE_SHIPPING_THRESHOLD or any(
767
+ p["kind"] == "shipping" for p in promos
768
+ )
769
+ shipping = 0.0 if free_shipping else (0.0 if not active else 6.95)
770
+ return {
771
+ "cart_id": cart["cart_id"],
772
+ "lines": active,
773
+ "saved": saved,
774
+ "units": units,
775
+ "subtotal": subtotal,
776
+ "discount": discount,
777
+ "promotions": promos,
778
+ "shipping": shipping,
779
+ "free_shipping": free_shipping,
780
+ "threshold": FREE_SHIPPING_THRESHOLD,
781
+ "progress": min(100.0, (payable / FREE_SHIPPING_THRESHOLD) * 100.0),
782
+ "tax": round(payable * TAX_RATE, 2),
783
+ "total": round(payable + shipping + payable * TAX_RATE, 2),
784
+ "empty": not active,
785
+ }
786
+
787
+
788
+ def _own_item(db: sqlite3.Connection, owner_key: str, item_id: int) -> sqlite3.Row | None:
789
+ return db.execute(
790
+ "SELECT ci.* FROM cart_items ci JOIN carts c ON c.cart_id = ci.cart_id"
791
+ " WHERE ci.item_id = ? AND c.owner_key = ?",
792
+ (int(item_id), owner_key),
793
+ ).fetchone()
794
+
795
+
796
+ def update_qty(db: sqlite3.Connection, owner_key: str, item_id: int, qty: int) -> bool:
797
+ if _own_item(db, owner_key, item_id) is None:
798
+ return False
799
+ qty = max(0, min(int(qty), 15))
800
+ if qty == 0:
801
+ db.execute("DELETE FROM cart_items WHERE item_id = ?", (int(item_id),))
802
+ else:
803
+ db.execute("UPDATE cart_items SET qty = ? WHERE item_id = ?", (qty, int(item_id)))
804
+ return True
805
+
806
+
807
+ def remove_item(db: sqlite3.Connection, owner_key: str, item_id: int) -> bool:
808
+ if _own_item(db, owner_key, item_id) is None:
809
+ return False
810
+ db.execute("DELETE FROM cart_items WHERE item_id = ?", (int(item_id),))
811
+ return True
812
+
813
+
814
+ def set_saved(db: sqlite3.Connection, owner_key: str, item_id: int, saved: bool) -> bool:
815
+ if _own_item(db, owner_key, item_id) is None:
816
+ return False
817
+ db.execute(
818
+ "UPDATE cart_items SET saved = ? WHERE item_id = ?", (1 if saved else 0, int(item_id))
819
+ )
820
+ return True
821
+
822
+
823
+ def redeem(db: sqlite3.Connection, owner_key: str, code: str) -> tuple[bool, str]:
824
+ cart = get_or_create_cart(db, owner_key)
825
+ code = (code or "").strip().upper()
826
+ if not code:
827
+ return False, "Please enter a promo code or gift card number."
828
+ promo = db.execute("SELECT * FROM promotions WHERE code = ?", (code,)).fetchone()
829
+ if promo:
830
+ db.execute(
831
+ "INSERT OR IGNORE INTO cart_promotions (cart_id, code) VALUES (?,?)",
832
+ (cart["cart_id"], code),
833
+ )
834
+ return True, f"{promo['label']} applied."
835
+ card = db.execute("SELECT * FROM gift_cards WHERE code = ?", (code,)).fetchone()
836
+ if card:
837
+ return True, f"Gift card balance: ${card['balance']:.2f}"
838
+ return False, "We do not recognize that promo code or gift card number."
839
+
840
+
841
+ def clear_cart(db: sqlite3.Connection, owner_key: str) -> None:
842
+ cart = get_or_create_cart(db, owner_key)
843
+ db.execute("DELETE FROM cart_items WHERE cart_id = ? AND saved = 0", (cart["cart_id"],))
844
+ db.execute("DELETE FROM cart_promotions WHERE cart_id = ?", (cart["cart_id"],))
845
+
846
+
847
+ # --------------------------------------------------------------------------
848
+ # orders, addresses, wishlist, stores, misc
849
+ # --------------------------------------------------------------------------
850
+
851
+
852
+ def place_order(
853
+ db: sqlite3.Connection,
854
+ owner_key: str,
855
+ *,
856
+ owner: str,
857
+ last_name: str,
858
+ postal: str,
859
+ payment_ref: str | None,
860
+ ) -> dict[str, Any] | None:
861
+ view = cart_view(db, owner_key)
862
+ if view["empty"]:
863
+ return None
864
+ order_id = uuid.uuid4().hex[:12]
865
+ number = f"L{secrets.randbelow(9_000_000) + 1_000_000}"
866
+ db.execute(
867
+ "INSERT INTO orders (order_id, owner, order_number, last_name, postal, placed_at,"
868
+ " status, subtotal, shipping, tax, total, payment_ref) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)",
869
+ (
870
+ order_id,
871
+ owner,
872
+ number,
873
+ last_name,
874
+ postal,
875
+ now(),
876
+ "In Process",
877
+ view["subtotal"],
878
+ view["shipping"],
879
+ view["tax"],
880
+ view["total"],
881
+ payment_ref,
882
+ ),
883
+ )
884
+ for item in view["lines"]:
885
+ db.execute(
886
+ "INSERT INTO order_items (order_id, product_id, name, color, size, qty, unit_price)"
887
+ " VALUES (?,?,?,?,?,?,?)",
888
+ (
889
+ order_id,
890
+ item["product_id"],
891
+ item["name"],
892
+ item["color"],
893
+ item["size"],
894
+ item["qty"],
895
+ item["unit_price"],
896
+ ),
897
+ )
898
+ clear_cart(db, owner_key)
899
+ return {"order_id": order_id, "order_number": number}
900
+
901
+
902
+ def orders_for(db: sqlite3.Connection, owner: str) -> list[dict[str, Any]]:
903
+ return _rows(
904
+ db.execute(
905
+ "SELECT * FROM orders WHERE owner = ? ORDER BY placed_at DESC", (owner,)
906
+ )
907
+ )
908
+
909
+
910
+ def order_detail(db: sqlite3.Connection, order_id: str) -> dict[str, Any] | None:
911
+ order = _row(
912
+ db.execute("SELECT * FROM orders WHERE order_id = ?", (order_id,)).fetchone()
913
+ )
914
+ if not order:
915
+ return None
916
+ order["lines"] = _rows(
917
+ db.execute("SELECT * FROM order_items WHERE order_id = ?", (order_id,))
918
+ )
919
+ return order
920
+
921
+
922
+ def lookup_order(
923
+ db: sqlite3.Connection, *, order_number: str, last_name: str, postal: str
924
+ ) -> dict[str, Any] | None:
925
+ row = db.execute(
926
+ "SELECT * FROM orders WHERE order_number = ? AND LOWER(last_name) = LOWER(?)"
927
+ " AND postal = ?",
928
+ ((order_number or "").strip(), (last_name or "").strip(), (postal or "").strip()),
929
+ ).fetchone()
930
+ return order_detail(db, row["order_id"]) if row else None
931
+
932
+
933
+ def addresses(db: sqlite3.Connection, owner: str) -> list[dict[str, Any]]:
934
+ return _rows(
935
+ db.execute(
936
+ "SELECT * FROM addresses WHERE owner = ? ORDER BY is_default DESC, address_id",
937
+ (owner,),
938
+ )
939
+ )
940
+
941
+
942
+ def add_address(db: sqlite3.Connection, owner: str, data: dict[str, str]) -> list[str]:
943
+ required = ("first_name", "last_name", "street1", "city", "state", "postal")
944
+ missing = [f for f in required if not (data.get(f) or "").strip()]
945
+ if missing:
946
+ return missing
947
+ postal = (data.get("postal") or "").strip()
948
+ if not postal.replace("-", "").isdigit() or len(postal.replace("-", "")) not in (5, 9):
949
+ return ["postal"]
950
+ db.execute(
951
+ "INSERT INTO addresses (owner, label, first_name, last_name, street1, street2, city,"
952
+ " state, postal, country, phone, is_default) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)",
953
+ (
954
+ owner,
955
+ data.get("label") or "Address",
956
+ data["first_name"].strip(),
957
+ data["last_name"].strip(),
958
+ data["street1"].strip(),
959
+ (data.get("street2") or "").strip(),
960
+ data["city"].strip(),
961
+ data["state"].strip(),
962
+ postal,
963
+ data.get("country") or "United States",
964
+ (data.get("phone") or "").strip(),
965
+ 1 if not addresses(db, owner) else 0,
966
+ ),
967
+ )
968
+ return []
969
+
970
+
971
+ def delete_address(db: sqlite3.Connection, owner: str, address_id: int) -> bool:
972
+ row = db.execute(
973
+ "SELECT address_id FROM addresses WHERE address_id = ? AND owner = ?",
974
+ (int(address_id), owner),
975
+ ).fetchone()
976
+ if not row:
977
+ return False
978
+ db.execute("DELETE FROM addresses WHERE address_id = ?", (int(address_id),))
979
+ return True
980
+
981
+
982
+ def wishlist(db: sqlite3.Connection, owner: str) -> list[dict[str, Any]]:
983
+ return _rows(
984
+ db.execute(
985
+ "SELECT w.*, p.name, p.grid_image, p.grid_image_alt, p.price_low, p.price_high,"
986
+ " p.on_sale, p.slug FROM wishlist_items w JOIN products p"
987
+ " ON p.product_id = w.product_id WHERE w.owner = ? ORDER BY w.wish_id DESC",
988
+ (owner,),
989
+ )
990
+ )
991
+
992
+
993
+ def toggle_wishlist(db: sqlite3.Connection, owner: str, product_id: str) -> bool:
994
+ existing = db.execute(
995
+ "SELECT wish_id FROM wishlist_items WHERE owner = ? AND product_id = ?",
996
+ (owner, str(product_id)),
997
+ ).fetchone()
998
+ if existing:
999
+ db.execute("DELETE FROM wishlist_items WHERE wish_id = ?", (existing[0],))
1000
+ return False
1001
+ db.execute(
1002
+ "INSERT INTO wishlist_items (owner, product_id, added_at) VALUES (?,?,?)",
1003
+ (owner, str(product_id), now()),
1004
+ )
1005
+ return True
1006
+
1007
+
1008
+ def find_stores(db: sqlite3.Connection, term: str) -> list[dict[str, Any]]:
1009
+ term = (term or "").strip()
1010
+ if not term:
1011
+ return _rows(db.execute("SELECT * FROM stores ORDER BY store_id"))
1012
+ like = f"%{term.lower()}%"
1013
+ return _rows(
1014
+ db.execute(
1015
+ "SELECT * FROM stores WHERE LOWER(city) LIKE ? OR LOWER(state) LIKE ?"
1016
+ " OR postal LIKE ? OR LOWER(name) LIKE ? ORDER BY store_id",
1017
+ (like, like, f"{term}%", like),
1018
+ )
1019
+ )
1020
+
1021
+
1022
+ def gift_card_balance(db: sqlite3.Connection, code: str, pin: str) -> dict[str, Any] | None:
1023
+ return _row(
1024
+ db.execute(
1025
+ "SELECT * FROM gift_cards WHERE code = ? AND pin = ?",
1026
+ ((code or "").strip(), (pin or "").strip()),
1027
+ ).fetchone()
1028
+ )
1029
+
1030
+
1031
+ def request_catalog(db: sqlite3.Connection, data: dict[str, str]) -> list[str]:
1032
+ required = ("first_name", "last_name", "email", "street1", "city", "state", "postal")
1033
+ missing = [f for f in required if not (data.get(f) or "").strip()]
1034
+ email = (data.get("email") or "").strip()
1035
+ if email and ("@" not in email or "." not in email.split("@")[-1]):
1036
+ missing.append("email")
1037
+ if missing:
1038
+ return sorted(set(missing))
1039
+ db.execute(
1040
+ "INSERT INTO catalog_requests (first_name, last_name, email, street1, city, state,"
1041
+ " postal, created_at) VALUES (?,?,?,?,?,?,?,?)",
1042
+ (
1043
+ data["first_name"].strip(),
1044
+ data["last_name"].strip(),
1045
+ email,
1046
+ data["street1"].strip(),
1047
+ data["city"].strip(),
1048
+ data["state"].strip(),
1049
+ data["postal"].strip(),
1050
+ now(),
1051
+ ),
1052
+ )
1053
+ return []
1054
+
1055
+
1056
+ def email_prefs(db: sqlite3.Connection, owner: str) -> dict[str, Any]:
1057
+ row = _row(
1058
+ db.execute("SELECT * FROM email_prefs WHERE owner = ?", (owner,)).fetchone()
1059
+ )
1060
+ if row:
1061
+ return row
1062
+ db.execute("INSERT INTO email_prefs (owner) VALUES (?)", (owner,))
1063
+ return {"owner": owner, "subscribed": 1, "frequency": "weekly", "catalog_opt": 1}
1064
+
1065
+
1066
+ def set_email_prefs(
1067
+ db: sqlite3.Connection, owner: str, *, subscribed: bool, frequency: str, catalog_opt: bool
1068
+ ) -> None:
1069
+ email_prefs(db, owner)
1070
+ db.execute(
1071
+ "UPDATE email_prefs SET subscribed = ?, frequency = ?, catalog_opt = ? WHERE owner = ?",
1072
+ (1 if subscribed else 0, frequency, 1 if catalog_opt else 0, owner),
1073
+ )
1074
+
1075
+
1076
+ def content_page(db: sqlite3.Connection, cat_id: int) -> dict[str, Any] | None:
1077
+ return _row(
1078
+ db.execute("SELECT * FROM content_pages WHERE cat_id = ?", (int(cat_id),)).fetchone()
1079
+ )
1080
+
1081
+
1082
+ def all_content_pages(db: sqlite3.Connection) -> list[dict[str, Any]]:
1083
+ return _rows(db.execute("SELECT * FROM content_pages ORDER BY name"))
1084
+
1085
+
1086
+ def content_pages(db: sqlite3.Connection, term: str | None = None) -> list[dict[str, Any]]:
1087
+ """Editorial results for the search page's Info & Stories tab."""
1088
+
1089
+ if not term:
1090
+ return []
1091
+ like = f"%{term.lower()}%"
1092
+ return _rows(
1093
+ db.execute(
1094
+ "SELECT * FROM content_pages WHERE LOWER(name) LIKE ? OR LOWER(blurb) LIKE ?"
1095
+ " ORDER BY name LIMIT 12",
1096
+ (like, like),
1097
+ )
1098
+ )
tasks/llbean/environment/reference/clone/backend/site_backend_integration.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Generated, site-bound backend integration seam."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib
6
+ import json
7
+ import os
8
+ import sqlite3
9
+ from pathlib import Path
10
+ from typing import Any, Callable
11
+
12
+ from websitebench.local_clone_auth import LocalAuthStore
13
+ from websitebench.site_backend import (
14
+ SiteBackend,
15
+ load_runtime,
16
+ serve_jsonl,
17
+ validate_allowlist,
18
+ )
19
+
20
+
21
+ DEFAULT_RUNTIME_PATH = (
22
+ Path(__file__).resolve().parents[2] / "backend" / "runtime.json"
23
+ )
24
+ BRIDGE_DESCRIPTOR_PATH = (
25
+ Path(__file__).resolve().parents[2] / "backend" / "node-bridge.json"
26
+ )
27
+
28
+
29
+ def _declared_hook(
30
+ declaration: str | None,
31
+ ) -> Callable[[sqlite3.Connection], None] | None:
32
+ if declaration is None:
33
+ return None
34
+ module_name, function_name = declaration.split(":", 1)
35
+ module = importlib.import_module(module_name)
36
+ hook: Any = getattr(module, function_name, None)
37
+ if not callable(hook):
38
+ raise RuntimeError(f"declared backend hook is not callable: {declaration}")
39
+ actual = f"{hook.__module__}:{hook.__name__}"
40
+ if actual != declaration:
41
+ raise RuntimeError(
42
+ f"declared backend hook resolved as {actual!r}, expected {declaration!r}"
43
+ )
44
+ return hook
45
+
46
+
47
+ def open_site_services() -> tuple[SiteBackend, LocalAuthStore]:
48
+ """Open one bound database; never omit the site id for permanent auth."""
49
+
50
+ runtime_path = Path(
51
+ os.environ.get(
52
+ "WEBSITEBENCH_SITE_BACKEND_RUNTIME",
53
+ str(DEFAULT_RUNTIME_PATH),
54
+ )
55
+ ).resolve()
56
+ runtime = load_runtime(runtime_path)
57
+ migration_hook = _declared_hook(runtime.migration_hook)
58
+ seed_hook = _declared_hook(runtime.seed_hook)
59
+ deployed_database = os.environ.get(
60
+ "WEBSITEBENCH_SITE_BACKEND_DATABASE",
61
+ )
62
+ if deployed_database is None:
63
+ backend = SiteBackend.open(
64
+ runtime_path,
65
+ migration_hook=migration_hook,
66
+ seed_hook=seed_hook,
67
+ )
68
+ else:
69
+ database_path = Path(deployed_database).resolve()
70
+ if database_path.name != runtime.database_filename:
71
+ raise RuntimeError(
72
+ "deployed database filename does not match runtime contract"
73
+ )
74
+ backend = SiteBackend.open(
75
+ json.loads(runtime_path.read_text(encoding="utf-8")),
76
+ data_root=database_path.parent,
77
+ migration_hook=migration_hook,
78
+ seed_hook=seed_hook,
79
+ )
80
+ if backend.lifecycle.database_path != database_path:
81
+ raise RuntimeError(
82
+ "deployed database path does not match backend preflight"
83
+ )
84
+ backend.lifecycle.initialize()
85
+ auth = LocalAuthStore(
86
+ backend.lifecycle.database_path,
87
+ site_id=backend.config.site_id,
88
+ )
89
+ auth.ensure_schema()
90
+ return backend, auth
91
+
92
+
93
+ def run_stdio_bridge() -> None:
94
+ """Run only operations frozen in this site's descriptor."""
95
+
96
+ backend, auth = open_site_services()
97
+ descriptor = json.loads(BRIDGE_DESCRIPTOR_PATH.read_text(encoding="utf-8"))
98
+ allowed = validate_allowlist(
99
+ descriptor,
100
+ expected_site_id=backend.config.site_id,
101
+ )
102
+ serve_jsonl(backend, auth, allowed, sys.stdin, sys.stdout)
103
+
104
+
105
+ if __name__ == "__main__":
106
+ import argparse
107
+ import sys
108
+
109
+ parser = argparse.ArgumentParser(prog="websitebench-node-backend-bridge")
110
+ parser.add_argument("--stdio", action="store_true", required=True)
111
+ parser.parse_args()
112
+ run_stdio_bridge()
tasks/llbean/environment/reference/clone/data/seed/categories.json ADDED
@@ -0,0 +1,1178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "cat_id": 511742,
4
+ "name": "NEW",
5
+ "slug": "new-arrivals",
6
+ "parent_id": null,
7
+ "depth": 0,
8
+ "nav_order": 0
9
+ },
10
+ {
11
+ "cat_id": 12,
12
+ "name": "Clothing",
13
+ "slug": "clothing",
14
+ "parent_id": null,
15
+ "depth": 0,
16
+ "nav_order": 1
17
+ },
18
+ {
19
+ "cat_id": 516567,
20
+ "name": "Outerwear",
21
+ "slug": "outerwear",
22
+ "parent_id": null,
23
+ "depth": 0,
24
+ "nav_order": 2
25
+ },
26
+ {
27
+ "cat_id": 474,
28
+ "name": "Footwear",
29
+ "slug": "footwear",
30
+ "parent_id": null,
31
+ "depth": 0,
32
+ "nav_order": 3
33
+ },
34
+ {
35
+ "cat_id": 29,
36
+ "name": "Outdoor Equipment",
37
+ "slug": "outdoor-equipment",
38
+ "parent_id": null,
39
+ "depth": 0,
40
+ "nav_order": 4
41
+ },
42
+ {
43
+ "cat_id": 50,
44
+ "name": "Bags & Travel",
45
+ "slug": "bags-and-travel",
46
+ "parent_id": null,
47
+ "depth": 0,
48
+ "nav_order": 5
49
+ },
50
+ {
51
+ "cat_id": 31,
52
+ "name": "Home Goods",
53
+ "slug": "home-goods",
54
+ "parent_id": null,
55
+ "depth": 0,
56
+ "nav_order": 6
57
+ },
58
+ {
59
+ "cat_id": 32,
60
+ "name": "Sale",
61
+ "slug": "sale",
62
+ "parent_id": null,
63
+ "depth": 0,
64
+ "nav_order": 7
65
+ },
66
+ {
67
+ "cat_id": 518571,
68
+ "name": "Outdoor Experiences",
69
+ "slug": "outdoor-experiences",
70
+ "parent_id": null,
71
+ "depth": 0,
72
+ "nav_order": 8
73
+ },
74
+ {
75
+ "cat_id": 518342,
76
+ "name": "Explore L.L.Bean",
77
+ "slug": "explore-llbean",
78
+ "parent_id": null,
79
+ "depth": 0,
80
+ "nav_order": 9
81
+ },
82
+ {
83
+ "cat_id": 26,
84
+ "name": "Men's",
85
+ "slug": "mens-clothing",
86
+ "parent_id": 12,
87
+ "depth": 1,
88
+ "nav_order": 17
89
+ },
90
+ {
91
+ "cat_id": 27,
92
+ "name": "Women's",
93
+ "slug": "womens-clothing",
94
+ "parent_id": 12,
95
+ "depth": 1,
96
+ "nav_order": 1
97
+ },
98
+ {
99
+ "cat_id": 28,
100
+ "name": "Kids'",
101
+ "slug": "kids-clothing",
102
+ "parent_id": 12,
103
+ "depth": 1,
104
+ "nav_order": 32
105
+ },
106
+ {
107
+ "cat_id": 129,
108
+ "name": "Furniture",
109
+ "slug": "furniture",
110
+ "parent_id": 31,
111
+ "depth": 1,
112
+ "nav_order": 3
113
+ },
114
+ {
115
+ "cat_id": 131,
116
+ "name": "Bedding",
117
+ "slug": "bedding",
118
+ "parent_id": 31,
119
+ "depth": 1,
120
+ "nav_order": 2
121
+ },
122
+ {
123
+ "cat_id": 132,
124
+ "name": "Backyard & Patio",
125
+ "slug": "backyard-and-patio",
126
+ "parent_id": 31,
127
+ "depth": 1,
128
+ "nav_order": 8
129
+ },
130
+ {
131
+ "cat_id": 134,
132
+ "name": "Dog Supplies",
133
+ "slug": "dog-supplies",
134
+ "parent_id": 31,
135
+ "depth": 1,
136
+ "nav_order": 10
137
+ },
138
+ {
139
+ "cat_id": 203,
140
+ "name": "Bag Charms & Accessories",
141
+ "slug": "bag-charms-and-accessories",
142
+ "parent_id": 50,
143
+ "depth": 1,
144
+ "nav_order": 8
145
+ },
146
+ {
147
+ "cat_id": 305,
148
+ "name": "Bags & Travel",
149
+ "slug": "bags-and-travel-on-sale",
150
+ "parent_id": 32,
151
+ "depth": 1,
152
+ "nav_order": 5
153
+ },
154
+ {
155
+ "cat_id": 307,
156
+ "name": "Home Goods",
157
+ "slug": "home-goods-on-sale",
158
+ "parent_id": 32,
159
+ "depth": 1,
160
+ "nav_order": 6
161
+ },
162
+ {
163
+ "cat_id": 312,
164
+ "name": "Home Decor",
165
+ "slug": "home-decor",
166
+ "parent_id": 31,
167
+ "depth": 1,
168
+ "nav_order": 7
169
+ },
170
+ {
171
+ "cat_id": 593,
172
+ "name": "Men's",
173
+ "slug": "mens-outerwear",
174
+ "parent_id": 516567,
175
+ "depth": 1,
176
+ "nav_order": 11
177
+ },
178
+ {
179
+ "cat_id": 610,
180
+ "name": "Women's",
181
+ "slug": "womens-outerwear",
182
+ "parent_id": 516567,
183
+ "depth": 1,
184
+ "nav_order": 1
185
+ },
186
+ {
187
+ "cat_id": 629,
188
+ "name": "Men's",
189
+ "slug": "mens-footwear",
190
+ "parent_id": 474,
191
+ "depth": 1,
192
+ "nav_order": 10
193
+ },
194
+ {
195
+ "cat_id": 630,
196
+ "name": "Women's",
197
+ "slug": "womens-footwear",
198
+ "parent_id": 474,
199
+ "depth": 1,
200
+ "nav_order": 1
201
+ },
202
+ {
203
+ "cat_id": 651,
204
+ "name": "Kids'",
205
+ "slug": "kids-footwear",
206
+ "parent_id": 474,
207
+ "depth": 1,
208
+ "nav_order": 19
209
+ },
210
+ {
211
+ "cat_id": 816,
212
+ "name": "School Backpacks & Lunch Boxes",
213
+ "slug": "school-backpacks-and-lunch-boxes",
214
+ "parent_id": 50,
215
+ "depth": 1,
216
+ "nav_order": 5
217
+ },
218
+ {
219
+ "cat_id": 900,
220
+ "name": "Bath",
221
+ "slug": "bath",
222
+ "parent_id": 31,
223
+ "depth": 1,
224
+ "nav_order": 4
225
+ },
226
+ {
227
+ "cat_id": 915,
228
+ "name": "Camping & Hiking",
229
+ "slug": "camping-and-hiking-gear",
230
+ "parent_id": 29,
231
+ "depth": 1,
232
+ "nav_order": 2
233
+ },
234
+ {
235
+ "cat_id": 916,
236
+ "name": "Hiking Backpacks",
237
+ "slug": "hiking-and-backpacking",
238
+ "parent_id": 50,
239
+ "depth": 1,
240
+ "nav_order": 4
241
+ },
242
+ {
243
+ "cat_id": 503369,
244
+ "name": "Kids'",
245
+ "slug": "kids-outerwear",
246
+ "parent_id": 516567,
247
+ "depth": 1,
248
+ "nav_order": 21
249
+ },
250
+ {
251
+ "cat_id": 504987,
252
+ "name": "Two-A-Day Daily Markdown",
253
+ "slug": "clearance-items",
254
+ "parent_id": 32,
255
+ "depth": 1,
256
+ "nav_order": 8
257
+ },
258
+ {
259
+ "cat_id": 506621,
260
+ "name": "Games & Books",
261
+ "slug": "games-and-books",
262
+ "parent_id": 31,
263
+ "depth": 1,
264
+ "nav_order": 9
265
+ },
266
+ {
267
+ "cat_id": 507361,
268
+ "name": "Toiletry Bags & Organizers",
269
+ "slug": "toiletry-bags-and-organizers",
270
+ "parent_id": 50,
271
+ "depth": 1,
272
+ "nav_order": 7
273
+ },
274
+ {
275
+ "cat_id": 507923,
276
+ "name": "Fishing",
277
+ "slug": "fishing-gear",
278
+ "parent_id": 29,
279
+ "depth": 1,
280
+ "nav_order": 4
281
+ },
282
+ {
283
+ "cat_id": 507929,
284
+ "name": "Hunting",
285
+ "slug": "hunting-gear",
286
+ "parent_id": 29,
287
+ "depth": 1,
288
+ "nav_order": 7
289
+ },
290
+ {
291
+ "cat_id": 508925,
292
+ "name": "New to Sale",
293
+ "slug": "new-to-sale-on-sale",
294
+ "parent_id": 32,
295
+ "depth": 1,
296
+ "nav_order": 7
297
+ },
298
+ {
299
+ "cat_id": 509104,
300
+ "name": "Outdoor Equipment",
301
+ "slug": "outdoor-equipment-on-sale",
302
+ "parent_id": 32,
303
+ "depth": 1,
304
+ "nav_order": 4
305
+ },
306
+ {
307
+ "cat_id": 510044,
308
+ "name": "Fireplace & Hearth",
309
+ "slug": "fireplace-and-hearth",
310
+ "parent_id": 31,
311
+ "depth": 1,
312
+ "nav_order": 5
313
+ },
314
+ {
315
+ "cat_id": 510312,
316
+ "name": "Daily Markdown",
317
+ "slug": "clearance",
318
+ "parent_id": 32,
319
+ "depth": 1,
320
+ "nav_order": 9
321
+ },
322
+ {
323
+ "cat_id": 511747,
324
+ "name": "New Arrivals",
325
+ "slug": null,
326
+ "parent_id": 29,
327
+ "depth": 1,
328
+ "nav_order": 1
329
+ },
330
+ {
331
+ "cat_id": 511749,
332
+ "name": "New Arrivals",
333
+ "slug": null,
334
+ "parent_id": 50,
335
+ "depth": 1,
336
+ "nav_order": 1
337
+ },
338
+ {
339
+ "cat_id": 511750,
340
+ "name": "Home Goods",
341
+ "slug": "home-goods-new-arrivals",
342
+ "parent_id": 511742,
343
+ "depth": 1,
344
+ "nav_order": 6
345
+ },
346
+ {
347
+ "cat_id": 514001,
348
+ "name": "Rugs & Mats",
349
+ "slug": "rugs-and-mats",
350
+ "parent_id": 31,
351
+ "depth": 1,
352
+ "nav_order": 6
353
+ },
354
+ {
355
+ "cat_id": 514029,
356
+ "name": "Boat and Totes",
357
+ "slug": "boat-and-tote-bags",
358
+ "parent_id": 50,
359
+ "depth": 1,
360
+ "nav_order": 2
361
+ },
362
+ {
363
+ "cat_id": 514907,
364
+ "name": "Gourmet Treats",
365
+ "slug": "gourmet-treats",
366
+ "parent_id": 31,
367
+ "depth": 1,
368
+ "nav_order": 11
369
+ },
370
+ {
371
+ "cat_id": 516664,
372
+ "name": "Water Bottles & Drinkware",
373
+ "slug": "hydration",
374
+ "parent_id": 29,
375
+ "depth": 1,
376
+ "nav_order": 6
377
+ },
378
+ {
379
+ "cat_id": 516672,
380
+ "name": "Everyday Bags & Totes",
381
+ "slug": "bags-and-totes",
382
+ "parent_id": 50,
383
+ "depth": 1,
384
+ "nav_order": 3
385
+ },
386
+ {
387
+ "cat_id": 516673,
388
+ "name": "Luggage & Duffle Bags",
389
+ "slug": "luggage-and-duffle-bags",
390
+ "parent_id": 50,
391
+ "depth": 1,
392
+ "nav_order": 6
393
+ },
394
+ {
395
+ "cat_id": 516686,
396
+ "name": "Clothing",
397
+ "slug": "clothing-on-sale",
398
+ "parent_id": 32,
399
+ "depth": 1,
400
+ "nav_order": 1
401
+ },
402
+ {
403
+ "cat_id": 516689,
404
+ "name": "Footwear",
405
+ "slug": "footwear-on-sale",
406
+ "parent_id": 32,
407
+ "depth": 1,
408
+ "nav_order": 3
409
+ },
410
+ {
411
+ "cat_id": 516713,
412
+ "name": "Outdoor Accessories",
413
+ "slug": "outdoor-accessories",
414
+ "parent_id": 29,
415
+ "depth": 1,
416
+ "nav_order": 3
417
+ },
418
+ {
419
+ "cat_id": 516714,
420
+ "name": "Winter Sports",
421
+ "slug": "winter-sports",
422
+ "parent_id": 29,
423
+ "depth": 1,
424
+ "nav_order": 8
425
+ },
426
+ {
427
+ "cat_id": 518363,
428
+ "name": "Events & Activities",
429
+ "slug": "events-and-activities",
430
+ "parent_id": 518571,
431
+ "depth": 1,
432
+ "nav_order": 2
433
+ },
434
+ {
435
+ "cat_id": 518521,
436
+ "name": "Outerwear",
437
+ "slug": "outerwear-on-sale",
438
+ "parent_id": 32,
439
+ "depth": 1,
440
+ "nav_order": 2
441
+ },
442
+ {
443
+ "cat_id": 518707,
444
+ "name": "Outdoor Discovery Programs",
445
+ "slug": "outdoor-discovery-programs",
446
+ "parent_id": 518571,
447
+ "depth": 1,
448
+ "nav_order": 1
449
+ },
450
+ {
451
+ "cat_id": 518708,
452
+ "name": "Bootmobile",
453
+ "slug": "bootmobile",
454
+ "parent_id": 518571,
455
+ "depth": 1,
456
+ "nav_order": 3
457
+ },
458
+ {
459
+ "cat_id": 518885,
460
+ "name": "Beach Gear",
461
+ "slug": "beach-gear",
462
+ "parent_id": 29,
463
+ "depth": 1,
464
+ "nav_order": 5
465
+ },
466
+ {
467
+ "cat_id": 20010101,
468
+ "name": "Women's",
469
+ "slug": null,
470
+ "parent_id": 511742,
471
+ "depth": 1,
472
+ "nav_order": 1
473
+ },
474
+ {
475
+ "cat_id": 20010102,
476
+ "name": "Men's",
477
+ "slug": null,
478
+ "parent_id": 511742,
479
+ "depth": 1,
480
+ "nav_order": 2
481
+ },
482
+ {
483
+ "cat_id": 20010103,
484
+ "name": "Kids'",
485
+ "slug": null,
486
+ "parent_id": 511742,
487
+ "depth": 1,
488
+ "nav_order": 3
489
+ },
490
+ {
491
+ "cat_id": 289,
492
+ "name": "Toddler & Baby",
493
+ "slug": "toddler-and-baby-clothing",
494
+ "parent_id": 28,
495
+ "depth": 2,
496
+ "nav_order": 39
497
+ },
498
+ {
499
+ "cat_id": 589,
500
+ "name": "Shirts",
501
+ "slug": "mens-shirts",
502
+ "parent_id": 26,
503
+ "depth": 2,
504
+ "nav_order": 20
505
+ },
506
+ {
507
+ "cat_id": 594,
508
+ "name": "Sweaters",
509
+ "slug": "mens-sweaters",
510
+ "parent_id": 26,
511
+ "depth": 2,
512
+ "nav_order": 21
513
+ },
514
+ {
515
+ "cat_id": 595,
516
+ "name": "Sleepwear",
517
+ "slug": "mens-sleepwear",
518
+ "parent_id": 26,
519
+ "depth": 2,
520
+ "nav_order": 28
521
+ },
522
+ {
523
+ "cat_id": 596,
524
+ "name": "Accessories",
525
+ "slug": "mens-accessories",
526
+ "parent_id": 26,
527
+ "depth": 2,
528
+ "nav_order": 31
529
+ },
530
+ {
531
+ "cat_id": 607,
532
+ "name": "Shirts & Tops",
533
+ "slug": "womens-shirts-and-tops",
534
+ "parent_id": 27,
535
+ "depth": 2,
536
+ "nav_order": 4
537
+ },
538
+ {
539
+ "cat_id": 611,
540
+ "name": "Sweaters",
541
+ "slug": "womens-sweaters",
542
+ "parent_id": 27,
543
+ "depth": 2,
544
+ "nav_order": 5
545
+ },
546
+ {
547
+ "cat_id": 613,
548
+ "name": "Sleepwear",
549
+ "slug": "womens-sleepwear",
550
+ "parent_id": 27,
551
+ "depth": 2,
552
+ "nav_order": 13
553
+ },
554
+ {
555
+ "cat_id": 614,
556
+ "name": "Accessories",
557
+ "slug": "womens-accessories",
558
+ "parent_id": 27,
559
+ "depth": 2,
560
+ "nav_order": 16
561
+ },
562
+ {
563
+ "cat_id": 622,
564
+ "name": "Pants",
565
+ "slug": "womens-pants-and-jeans",
566
+ "parent_id": 27,
567
+ "depth": 2,
568
+ "nav_order": 9
569
+ },
570
+ {
571
+ "cat_id": 624,
572
+ "name": "Swimwear",
573
+ "slug": "womens-swimwear",
574
+ "parent_id": 27,
575
+ "depth": 2,
576
+ "nav_order": 12
577
+ },
578
+ {
579
+ "cat_id": 632,
580
+ "name": "Toddler & Baby",
581
+ "slug": "toddler-and-baby-footwear",
582
+ "parent_id": 651,
583
+ "depth": 2,
584
+ "nav_order": 26
585
+ },
586
+ {
587
+ "cat_id": 886,
588
+ "name": "Sweatshirts",
589
+ "slug": "womens-sweatshirts",
590
+ "parent_id": 27,
591
+ "depth": 2,
592
+ "nav_order": 6
593
+ },
594
+ {
595
+ "cat_id": 907,
596
+ "name": "Sweatshirts",
597
+ "slug": "mens-sweatshirts",
598
+ "parent_id": 26,
599
+ "depth": 2,
600
+ "nav_order": 22
601
+ },
602
+ {
603
+ "cat_id": 908,
604
+ "name": "Shorts",
605
+ "slug": "mens-shorts",
606
+ "parent_id": 26,
607
+ "depth": 2,
608
+ "nav_order": 26
609
+ },
610
+ {
611
+ "cat_id": 502854,
612
+ "name": "Socks",
613
+ "slug": "mens-socks",
614
+ "parent_id": 629,
615
+ "depth": 2,
616
+ "nav_order": 17
617
+ },
618
+ {
619
+ "cat_id": 502921,
620
+ "name": "Pants",
621
+ "slug": "mens-pants",
622
+ "parent_id": 26,
623
+ "depth": 2,
624
+ "nav_order": 25
625
+ },
626
+ {
627
+ "cat_id": 502980,
628
+ "name": "Socks",
629
+ "slug": "womens-socks",
630
+ "parent_id": 630,
631
+ "depth": 2,
632
+ "nav_order": 8
633
+ },
634
+ {
635
+ "cat_id": 503056,
636
+ "name": "Base Layers",
637
+ "slug": "womens-long-underwear-and-base-layers",
638
+ "parent_id": 27,
639
+ "depth": 2,
640
+ "nav_order": 14
641
+ },
642
+ {
643
+ "cat_id": 503368,
644
+ "name": "Tops",
645
+ "slug": "kids-tops",
646
+ "parent_id": 28,
647
+ "depth": 2,
648
+ "nav_order": 34
649
+ },
650
+ {
651
+ "cat_id": 503380,
652
+ "name": "Slippers",
653
+ "slug": "mens-slippers",
654
+ "parent_id": 629,
655
+ "depth": 2,
656
+ "nav_order": 16
657
+ },
658
+ {
659
+ "cat_id": 503381,
660
+ "name": "Sandals & Water Shoes",
661
+ "slug": "mens-sandals-and-water-shoes",
662
+ "parent_id": 629,
663
+ "depth": 2,
664
+ "nav_order": 15
665
+ },
666
+ {
667
+ "cat_id": 503422,
668
+ "name": "Slippers",
669
+ "slug": "womens-slippers",
670
+ "parent_id": 630,
671
+ "depth": 2,
672
+ "nav_order": 7
673
+ },
674
+ {
675
+ "cat_id": 503423,
676
+ "name": "Sandals & Water Shoes",
677
+ "slug": "sandals-and-water-shoes",
678
+ "parent_id": 630,
679
+ "depth": 2,
680
+ "nav_order": 6
681
+ },
682
+ {
683
+ "cat_id": 503560,
684
+ "name": "Sleepwear",
685
+ "slug": "kids-sleepwear",
686
+ "parent_id": 28,
687
+ "depth": 2,
688
+ "nav_order": 36
689
+ },
690
+ {
691
+ "cat_id": 503563,
692
+ "name": "Accessories",
693
+ "slug": "kids-accessories",
694
+ "parent_id": 28,
695
+ "depth": 2,
696
+ "nav_order": 38
697
+ },
698
+ {
699
+ "cat_id": 503565,
700
+ "name": "Pants & Suits",
701
+ "slug": "kids-outerwear-pants-and-suits",
702
+ "parent_id": 503369,
703
+ "depth": 2,
704
+ "nav_order": 26
705
+ },
706
+ {
707
+ "cat_id": 503570,
708
+ "name": "Pants & Shorts",
709
+ "slug": "kids-bottoms",
710
+ "parent_id": 28,
711
+ "depth": 2,
712
+ "nav_order": 35
713
+ },
714
+ {
715
+ "cat_id": 503575,
716
+ "name": "Sandals & Water Shoes",
717
+ "slug": "kids-sandals-and-water-shoes",
718
+ "parent_id": 651,
719
+ "depth": 2,
720
+ "nav_order": 24
721
+ },
722
+ {
723
+ "cat_id": 503719,
724
+ "name": "Rain & Snow Boots",
725
+ "slug": "kids-rain-and-snow-boots",
726
+ "parent_id": 651,
727
+ "depth": 2,
728
+ "nav_order": 22
729
+ },
730
+ {
731
+ "cat_id": 503721,
732
+ "name": "Slippers",
733
+ "slug": "kids-slippers",
734
+ "parent_id": 651,
735
+ "depth": 2,
736
+ "nav_order": 23
737
+ },
738
+ {
739
+ "cat_id": 503723,
740
+ "name": "Hiking Boots and Shoes",
741
+ "slug": "kids-sneakers-and-shoes",
742
+ "parent_id": 651,
743
+ "depth": 2,
744
+ "nav_order": 21
745
+ },
746
+ {
747
+ "cat_id": 504209,
748
+ "name": "Tees & Tanks",
749
+ "slug": "womens-t-shirts-and-tanks",
750
+ "parent_id": 27,
751
+ "depth": 2,
752
+ "nav_order": 3
753
+ },
754
+ {
755
+ "cat_id": 504715,
756
+ "name": "Vests",
757
+ "slug": "mens-outerwear-vests",
758
+ "parent_id": 593,
759
+ "depth": 2,
760
+ "nav_order": 18
761
+ },
762
+ {
763
+ "cat_id": 504729,
764
+ "name": "Vests",
765
+ "slug": "womens-outerwear-vests",
766
+ "parent_id": 610,
767
+ "depth": 2,
768
+ "nav_order": 8
769
+ },
770
+ {
771
+ "cat_id": 504732,
772
+ "name": "Fleece",
773
+ "slug": "womens-fleece-jackets",
774
+ "parent_id": 27,
775
+ "depth": 2,
776
+ "nav_order": 7
777
+ },
778
+ {
779
+ "cat_id": 504734,
780
+ "name": "Casual Jackets",
781
+ "slug": "womens-casual-jackets",
782
+ "parent_id": 610,
783
+ "depth": 2,
784
+ "nav_order": 4
785
+ },
786
+ {
787
+ "cat_id": 504735,
788
+ "name": "Insulated Jackets",
789
+ "slug": "womens-insulated-jackets",
790
+ "parent_id": 610,
791
+ "depth": 2,
792
+ "nav_order": 3
793
+ },
794
+ {
795
+ "cat_id": 506213,
796
+ "name": "Dresses & Skirts",
797
+ "slug": "womens-dresses-and-skirts",
798
+ "parent_id": 27,
799
+ "depth": 2,
800
+ "nav_order": 11
801
+ },
802
+ {
803
+ "cat_id": 506593,
804
+ "name": "Rain Jackets & Shells",
805
+ "slug": "womens-rain-jackets",
806
+ "parent_id": 610,
807
+ "depth": 2,
808
+ "nav_order": 6
809
+ },
810
+ {
811
+ "cat_id": 506594,
812
+ "name": "Windbreakers",
813
+ "slug": "womens-windbreakers",
814
+ "parent_id": 610,
815
+ "depth": 2,
816
+ "nav_order": 7
817
+ },
818
+ {
819
+ "cat_id": 506673,
820
+ "name": "Insulated Jackets",
821
+ "slug": "mens-insulated-jackets",
822
+ "parent_id": 593,
823
+ "depth": 2,
824
+ "nav_order": 13
825
+ },
826
+ {
827
+ "cat_id": 506674,
828
+ "name": "Fleece",
829
+ "slug": "mens-fleece",
830
+ "parent_id": 26,
831
+ "depth": 2,
832
+ "nav_order": 23
833
+ },
834
+ {
835
+ "cat_id": 506675,
836
+ "name": "Rain Jackets & Shells",
837
+ "slug": "mens-rain-jackets",
838
+ "parent_id": 593,
839
+ "depth": 2,
840
+ "nav_order": 16
841
+ },
842
+ {
843
+ "cat_id": 506676,
844
+ "name": "Windbreakers",
845
+ "slug": "mens-windbreakers",
846
+ "parent_id": 593,
847
+ "depth": 2,
848
+ "nav_order": 17
849
+ },
850
+ {
851
+ "cat_id": 506677,
852
+ "name": "Casual Jackets",
853
+ "slug": "mens-casual-jackets",
854
+ "parent_id": 593,
855
+ "depth": 2,
856
+ "nav_order": 14
857
+ },
858
+ {
859
+ "cat_id": 506705,
860
+ "name": "Sneakers & Shoes",
861
+ "slug": "womens-sneakers-and-shoes",
862
+ "parent_id": 630,
863
+ "depth": 2,
864
+ "nav_order": 5
865
+ },
866
+ {
867
+ "cat_id": 506708,
868
+ "name": "Boots",
869
+ "slug": "womens-boots",
870
+ "parent_id": 630,
871
+ "depth": 2,
872
+ "nav_order": 4
873
+ },
874
+ {
875
+ "cat_id": 506791,
876
+ "name": "Sneakers & Shoes",
877
+ "slug": "mens-sneakers-and-shoes",
878
+ "parent_id": 629,
879
+ "depth": 2,
880
+ "nav_order": 14
881
+ },
882
+ {
883
+ "cat_id": 506794,
884
+ "name": "Boots",
885
+ "slug": "mens-boots",
886
+ "parent_id": 629,
887
+ "depth": 2,
888
+ "nav_order": 13
889
+ },
890
+ {
891
+ "cat_id": 508868,
892
+ "name": "New Arrivals",
893
+ "slug": null,
894
+ "parent_id": 593,
895
+ "depth": 2,
896
+ "nav_order": 12
897
+ },
898
+ {
899
+ "cat_id": 508877,
900
+ "name": "New Arrivals",
901
+ "slug": null,
902
+ "parent_id": 610,
903
+ "depth": 2,
904
+ "nav_order": 2
905
+ },
906
+ {
907
+ "cat_id": 508895,
908
+ "name": "New Arrivals",
909
+ "slug": null,
910
+ "parent_id": 629,
911
+ "depth": 2,
912
+ "nav_order": 11
913
+ },
914
+ {
915
+ "cat_id": 508896,
916
+ "name": "New Arrivals",
917
+ "slug": null,
918
+ "parent_id": 630,
919
+ "depth": 2,
920
+ "nav_order": 2
921
+ },
922
+ {
923
+ "cat_id": 509723,
924
+ "name": "Activewear",
925
+ "slug": "mens-activewear",
926
+ "parent_id": 26,
927
+ "depth": 2,
928
+ "nav_order": 30
929
+ },
930
+ {
931
+ "cat_id": 509757,
932
+ "name": "Activewear",
933
+ "slug": "womens-activewear",
934
+ "parent_id": 27,
935
+ "depth": 2,
936
+ "nav_order": 15
937
+ },
938
+ {
939
+ "cat_id": 509976,
940
+ "name": "Insulated Jackets",
941
+ "slug": "kids-insulated-jackets",
942
+ "parent_id": 503369,
943
+ "depth": 2,
944
+ "nav_order": 23
945
+ },
946
+ {
947
+ "cat_id": 511548,
948
+ "name": "Swimwear",
949
+ "slug": "mens-swimwear",
950
+ "parent_id": 26,
951
+ "depth": 2,
952
+ "nav_order": 27
953
+ },
954
+ {
955
+ "cat_id": 511743,
956
+ "name": "New Arrivals",
957
+ "slug": "mens-clothing-new-arrivals",
958
+ "parent_id": 26,
959
+ "depth": 2,
960
+ "nav_order": 18
961
+ },
962
+ {
963
+ "cat_id": 511744,
964
+ "name": "New Arrivals",
965
+ "slug": "womens-clothing-new-arrivals",
966
+ "parent_id": 27,
967
+ "depth": 2,
968
+ "nav_order": 2
969
+ },
970
+ {
971
+ "cat_id": 511786,
972
+ "name": "New Arrivals",
973
+ "slug": "kids-clothing-new-arrivals",
974
+ "parent_id": 28,
975
+ "depth": 2,
976
+ "nav_order": 33
977
+ },
978
+ {
979
+ "cat_id": 513280,
980
+ "name": "Shorts & Skorts",
981
+ "slug": "womens-shorts-and-skorts",
982
+ "parent_id": 27,
983
+ "depth": 2,
984
+ "nav_order": 10
985
+ },
986
+ {
987
+ "cat_id": 513283,
988
+ "name": "Jeans",
989
+ "slug": "womens-jeans",
990
+ "parent_id": 27,
991
+ "depth": 2,
992
+ "nav_order": 8
993
+ },
994
+ {
995
+ "cat_id": 513284,
996
+ "name": "Jeans",
997
+ "slug": "mens-jeans",
998
+ "parent_id": 26,
999
+ "depth": 2,
1000
+ "nav_order": 24
1001
+ },
1002
+ {
1003
+ "cat_id": 513665,
1004
+ "name": "Socks",
1005
+ "slug": "kids-socks",
1006
+ "parent_id": 651,
1007
+ "depth": 2,
1008
+ "nav_order": 25
1009
+ },
1010
+ {
1011
+ "cat_id": 513852,
1012
+ "name": "Base Layers",
1013
+ "slug": "kids-base-layers",
1014
+ "parent_id": 28,
1015
+ "depth": 2,
1016
+ "nav_order": 37
1017
+ },
1018
+ {
1019
+ "cat_id": 513858,
1020
+ "name": "Bean Boots",
1021
+ "slug": null,
1022
+ "parent_id": 629,
1023
+ "depth": 2,
1024
+ "nav_order": 12
1025
+ },
1026
+ {
1027
+ "cat_id": 513859,
1028
+ "name": "Bean Boots",
1029
+ "slug": null,
1030
+ "parent_id": 630,
1031
+ "depth": 2,
1032
+ "nav_order": 3
1033
+ },
1034
+ {
1035
+ "cat_id": 514536,
1036
+ "name": "Accessories",
1037
+ "slug": "mens-footwear-accessories",
1038
+ "parent_id": 629,
1039
+ "depth": 2,
1040
+ "nav_order": 18
1041
+ },
1042
+ {
1043
+ "cat_id": 514692,
1044
+ "name": "New Arrivals",
1045
+ "slug": null,
1046
+ "parent_id": 651,
1047
+ "depth": 2,
1048
+ "nav_order": 20
1049
+ },
1050
+ {
1051
+ "cat_id": 516180,
1052
+ "name": "Base Layers",
1053
+ "slug": "mens-long-underwear-and-base-layers",
1054
+ "parent_id": 26,
1055
+ "depth": 2,
1056
+ "nav_order": 29
1057
+ },
1058
+ {
1059
+ "cat_id": 516604,
1060
+ "name": "Snow & Rain Pants",
1061
+ "slug": "mens-snow-and-rain-pants",
1062
+ "parent_id": 593,
1063
+ "depth": 2,
1064
+ "nav_order": 19
1065
+ },
1066
+ {
1067
+ "cat_id": 516609,
1068
+ "name": "Snow & Rain Pants",
1069
+ "slug": "womens-snow-and-rain-pants",
1070
+ "parent_id": 610,
1071
+ "depth": 2,
1072
+ "nav_order": 9
1073
+ },
1074
+ {
1075
+ "cat_id": 517473,
1076
+ "name": "Rain Jackets",
1077
+ "slug": "kids-rain-jackets",
1078
+ "parent_id": 503369,
1079
+ "depth": 2,
1080
+ "nav_order": 25
1081
+ },
1082
+ {
1083
+ "cat_id": 518580,
1084
+ "name": "New Arrivals",
1085
+ "slug": null,
1086
+ "parent_id": 503369,
1087
+ "depth": 2,
1088
+ "nav_order": 22
1089
+ },
1090
+ {
1091
+ "cat_id": 518610,
1092
+ "name": "Toddler & Baby",
1093
+ "slug": "toddler-and-baby-outerwear",
1094
+ "parent_id": 503369,
1095
+ "depth": 2,
1096
+ "nav_order": 27
1097
+ },
1098
+ {
1099
+ "cat_id": 518844,
1100
+ "name": "Accessories",
1101
+ "slug": "womens-outerwear-accessories",
1102
+ "parent_id": 610,
1103
+ "depth": 2,
1104
+ "nav_order": 10
1105
+ },
1106
+ {
1107
+ "cat_id": 518845,
1108
+ "name": "Accessories",
1109
+ "slug": "mens-outerwear-accessories",
1110
+ "parent_id": 593,
1111
+ "depth": 2,
1112
+ "nav_order": 20
1113
+ },
1114
+ {
1115
+ "cat_id": 20010166,
1116
+ "name": "T-Shirts & Polos",
1117
+ "slug": null,
1118
+ "parent_id": 26,
1119
+ "depth": 2,
1120
+ "nav_order": 19
1121
+ },
1122
+ {
1123
+ "cat_id": 20010704,
1124
+ "name": "Accessories",
1125
+ "slug": null,
1126
+ "parent_id": 630,
1127
+ "depth": 2,
1128
+ "nav_order": 9
1129
+ },
1130
+ {
1131
+ "cat_id": 1000010293,
1132
+ "name": "Fleece & Lightweight Jackets",
1133
+ "slug": "kids-fleece-lightweight-jackets",
1134
+ "parent_id": 503369,
1135
+ "depth": 2,
1136
+ "nav_order": 24
1137
+ },
1138
+ {
1139
+ "cat_id": 1000010392,
1140
+ "name": "NYT Wirecutter Picks",
1141
+ "slug": null,
1142
+ "parent_id": null,
1143
+ "depth": 1,
1144
+ "nav_order": 99
1145
+ },
1146
+ {
1147
+ "cat_id": 505538,
1148
+ "name": "Men's Flannel Shirts",
1149
+ "slug": "mens-flannel-chamois-and-lined-shirts",
1150
+ "parent_id": 12,
1151
+ "depth": 1,
1152
+ "nav_order": 99
1153
+ },
1154
+ {
1155
+ "cat_id": 506697,
1156
+ "name": "The Original Bean Boot",
1157
+ "slug": "footwear-llbean-boots",
1158
+ "parent_id": 474,
1159
+ "depth": 1,
1160
+ "nav_order": 99
1161
+ },
1162
+ {
1163
+ "cat_id": 514124,
1164
+ "name": "Women's Pima Cotton Tees",
1165
+ "slug": null,
1166
+ "parent_id": 12,
1167
+ "depth": 1,
1168
+ "nav_order": 99
1169
+ },
1170
+ {
1171
+ "cat_id": 516715,
1172
+ "name": "Sun & Bug Protective Clothing",
1173
+ "slug": "sun-and-bug-protective-clothing",
1174
+ "parent_id": 12,
1175
+ "depth": 1,
1176
+ "nav_order": 99
1177
+ }
1178
+ ]
tasks/llbean/environment/reference/clone/data/seed/category_facets.json ADDED
@@ -0,0 +1,1082 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "511742": {
3
+ "facets": [
4
+ "gender",
5
+ "price",
6
+ "color"
7
+ ],
8
+ "source_facets": [
9
+ "Department",
10
+ "Gender",
11
+ "Price",
12
+ "Color"
13
+ ]
14
+ },
15
+ "12": {
16
+ "facets": [
17
+ "gender",
18
+ "new",
19
+ "sale",
20
+ "color",
21
+ "price"
22
+ ],
23
+ "source_facets": [
24
+ "Gender",
25
+ "New Arrivals",
26
+ "Sale",
27
+ "Color",
28
+ "Price"
29
+ ]
30
+ },
31
+ "516567": {
32
+ "facets": [
33
+ "gender",
34
+ "size",
35
+ "new",
36
+ "sale",
37
+ "color",
38
+ "price"
39
+ ],
40
+ "source_facets": [
41
+ "Gender",
42
+ "Size",
43
+ "Size Range",
44
+ "Warmth Rating",
45
+ "Activity/End Use",
46
+ "Features",
47
+ "Insulation",
48
+ "Jacket/Coat Length",
49
+ "New Arrivals",
50
+ "Sale",
51
+ "Color",
52
+ "Price"
53
+ ]
54
+ },
55
+ "474": {
56
+ "facets": [
57
+ "gender",
58
+ "size",
59
+ "brand",
60
+ "new",
61
+ "sale",
62
+ "color",
63
+ "price"
64
+ ],
65
+ "source_facets": [
66
+ "Gender",
67
+ "Shoe Size",
68
+ "Shoe Width",
69
+ "Brand",
70
+ "Shoe Style",
71
+ "Features",
72
+ "Suggested Use",
73
+ "New Arrivals",
74
+ "Sale",
75
+ "Color",
76
+ "Price"
77
+ ]
78
+ },
79
+ "29": {
80
+ "facets": [
81
+ "sale",
82
+ "new",
83
+ "color",
84
+ "price",
85
+ "brand"
86
+ ],
87
+ "source_facets": [
88
+ "Sale",
89
+ "New Arrivals",
90
+ "Color",
91
+ "Price",
92
+ "Brand"
93
+ ]
94
+ },
95
+ "50": {
96
+ "facets": [
97
+ "sale",
98
+ "brand",
99
+ "new",
100
+ "color",
101
+ "price"
102
+ ],
103
+ "source_facets": [
104
+ "Sale",
105
+ "Bag Style",
106
+ "Brand",
107
+ "Capacity Range",
108
+ "Fabric",
109
+ "Features",
110
+ "Suggested Use",
111
+ "New Arrivals",
112
+ "Color",
113
+ "Price"
114
+ ]
115
+ },
116
+ "31": {
117
+ "facets": [
118
+ "sale",
119
+ "material",
120
+ "new",
121
+ "color",
122
+ "price"
123
+ ],
124
+ "source_facets": [
125
+ "Sale",
126
+ "Bed Size",
127
+ "Doormat Size",
128
+ "Fabric",
129
+ "Features",
130
+ "Material",
131
+ "Rug Style",
132
+ "Shape",
133
+ "Sheet Type",
134
+ "New Arrivals",
135
+ "Color",
136
+ "Price"
137
+ ]
138
+ },
139
+ "32": {
140
+ "facets": [
141
+ "percent_off",
142
+ "price",
143
+ "gender",
144
+ "size",
145
+ "color"
146
+ ],
147
+ "source_facets": [
148
+ "% Off",
149
+ "Price",
150
+ "Gender",
151
+ "Size Range",
152
+ "Size",
153
+ "Activity/End Use",
154
+ "Color"
155
+ ]
156
+ },
157
+ "27": {
158
+ "facets": [
159
+ "size",
160
+ "new",
161
+ "sale",
162
+ "color",
163
+ "price"
164
+ ],
165
+ "source_facets": [
166
+ "Size Range",
167
+ "Size",
168
+ "Inseam",
169
+ "Fit",
170
+ "Rise",
171
+ "Pattern",
172
+ "Fabric",
173
+ "Activity/End Use",
174
+ "New Arrivals",
175
+ "Sale",
176
+ "Color",
177
+ "Price"
178
+ ]
179
+ },
180
+ "593": {
181
+ "facets": [
182
+ "size",
183
+ "new",
184
+ "sale",
185
+ "color",
186
+ "price"
187
+ ],
188
+ "source_facets": [
189
+ "Size Range",
190
+ "Size",
191
+ "Jacket/Coat Length",
192
+ "Warmth Rating",
193
+ "Insulation",
194
+ "Features",
195
+ "Activity/End Use",
196
+ "New Arrivals",
197
+ "Sale",
198
+ "Color",
199
+ "Price"
200
+ ]
201
+ },
202
+ "610": {
203
+ "facets": [
204
+ "size",
205
+ "new",
206
+ "sale",
207
+ "color",
208
+ "price"
209
+ ],
210
+ "source_facets": [
211
+ "Size Range",
212
+ "Size",
213
+ "Jacket/Coat Length",
214
+ "Warmth Rating",
215
+ "Insulation",
216
+ "Features",
217
+ "Activity/End Use",
218
+ "New Arrivals",
219
+ "Sale",
220
+ "Color",
221
+ "Price"
222
+ ]
223
+ },
224
+ "630": {
225
+ "facets": [
226
+ "size",
227
+ "brand",
228
+ "new",
229
+ "sale",
230
+ "color",
231
+ "price"
232
+ ],
233
+ "source_facets": [
234
+ "Shoe Size",
235
+ "Shoe Width",
236
+ "Boot Height",
237
+ "Brand",
238
+ "Features",
239
+ "Shoe Style",
240
+ "Suggested Use",
241
+ "Warmth Rating",
242
+ "New Arrivals",
243
+ "Sale",
244
+ "Color",
245
+ "Price"
246
+ ]
247
+ },
248
+ "629": {
249
+ "facets": [
250
+ "size",
251
+ "brand",
252
+ "new",
253
+ "sale",
254
+ "color",
255
+ "price"
256
+ ],
257
+ "source_facets": [
258
+ "Shoe Size",
259
+ "Shoe Width",
260
+ "Boot Height",
261
+ "Brand",
262
+ "Features",
263
+ "Shoe Style",
264
+ "Suggested Use",
265
+ "Warmth Rating",
266
+ "New Arrivals",
267
+ "Sale",
268
+ "Color",
269
+ "Price"
270
+ ]
271
+ },
272
+ "915": {
273
+ "facets": [
274
+ "sale",
275
+ "brand",
276
+ "gender",
277
+ "new",
278
+ "color",
279
+ "price"
280
+ ],
281
+ "source_facets": [
282
+ "Sale",
283
+ "Brand",
284
+ "Features",
285
+ "Gender",
286
+ "New Arrivals",
287
+ "Color",
288
+ "Price"
289
+ ]
290
+ },
291
+ "516713": {
292
+ "facets": [
293
+ "sale",
294
+ "brand",
295
+ "new",
296
+ "color",
297
+ "price"
298
+ ],
299
+ "source_facets": [
300
+ "Sale",
301
+ "Brand",
302
+ "New Arrivals",
303
+ "Color",
304
+ "Price"
305
+ ]
306
+ },
307
+ "507923": {
308
+ "facets": [
309
+ "brand",
310
+ "new",
311
+ "sale",
312
+ "color",
313
+ "price"
314
+ ],
315
+ "source_facets": [
316
+ "Skill Level",
317
+ "Brand",
318
+ "Features",
319
+ "Line Weight Range",
320
+ "Species",
321
+ "Water",
322
+ "New Arrivals",
323
+ "Sale",
324
+ "Color",
325
+ "Price"
326
+ ]
327
+ },
328
+ "516664": {
329
+ "facets": [
330
+ "sale",
331
+ "brand",
332
+ "new",
333
+ "color",
334
+ "price"
335
+ ],
336
+ "source_facets": [
337
+ "Sale",
338
+ "Brand",
339
+ "New Arrivals",
340
+ "Color",
341
+ "Price"
342
+ ]
343
+ },
344
+ "507929": {
345
+ "facets": [
346
+ "sale",
347
+ "brand",
348
+ "new",
349
+ "color",
350
+ "price"
351
+ ],
352
+ "source_facets": [
353
+ "Sale",
354
+ "Brand",
355
+ "Features",
356
+ "Hunting Type",
357
+ "Pattern",
358
+ "New Arrivals",
359
+ "Color",
360
+ "Price"
361
+ ]
362
+ },
363
+ "516714": {
364
+ "facets": [
365
+ "sale",
366
+ "gender",
367
+ "brand",
368
+ "color",
369
+ "price"
370
+ ],
371
+ "source_facets": [
372
+ "Sale",
373
+ "Gender",
374
+ "Brand",
375
+ "Color",
376
+ "Price"
377
+ ]
378
+ },
379
+ "518885": {
380
+ "facets": [
381
+ "sale",
382
+ "color",
383
+ "price",
384
+ "brand"
385
+ ],
386
+ "source_facets": [
387
+ "Sale",
388
+ "Features",
389
+ "Color",
390
+ "Price",
391
+ "Brand"
392
+ ]
393
+ },
394
+ "504209": {
395
+ "facets": [
396
+ "size",
397
+ "new",
398
+ "sale",
399
+ "color",
400
+ "price"
401
+ ],
402
+ "source_facets": [
403
+ "Sleeve Length",
404
+ "Size Range",
405
+ "Size",
406
+ "Fit",
407
+ "Collection",
408
+ "Fabric",
409
+ "Features",
410
+ "Pattern",
411
+ "Style",
412
+ "New Arrivals",
413
+ "Sale",
414
+ "Color",
415
+ "Price"
416
+ ]
417
+ },
418
+ "607": {
419
+ "facets": [
420
+ "size",
421
+ "new",
422
+ "sale",
423
+ "color",
424
+ "price"
425
+ ],
426
+ "source_facets": [
427
+ "Sleeve Length",
428
+ "Size Range",
429
+ "Size",
430
+ "Fit",
431
+ "Collection",
432
+ "Fabric",
433
+ "Features",
434
+ "Pattern",
435
+ "Style",
436
+ "New Arrivals",
437
+ "Sale",
438
+ "Color",
439
+ "Price"
440
+ ]
441
+ },
442
+ "611": {
443
+ "facets": [
444
+ "size",
445
+ "new",
446
+ "sale",
447
+ "color",
448
+ "price"
449
+ ],
450
+ "source_facets": [
451
+ "Size Range",
452
+ "Size",
453
+ "Fabric",
454
+ "Fit",
455
+ "Sweater Weight",
456
+ "Style",
457
+ "Pattern",
458
+ "Features",
459
+ "New Arrivals",
460
+ "Sale",
461
+ "Color",
462
+ "Price"
463
+ ]
464
+ },
465
+ "886": {
466
+ "facets": [
467
+ "size",
468
+ "new",
469
+ "sale",
470
+ "color",
471
+ "price"
472
+ ],
473
+ "source_facets": [
474
+ "Size Range",
475
+ "Size",
476
+ "Fabric",
477
+ "Fit",
478
+ "Style",
479
+ "Pattern",
480
+ "Features",
481
+ "New Arrivals",
482
+ "Sale",
483
+ "Color",
484
+ "Price"
485
+ ]
486
+ },
487
+ "504732": {
488
+ "facets": [
489
+ "size",
490
+ "new",
491
+ "sale",
492
+ "color",
493
+ "price"
494
+ ],
495
+ "source_facets": [
496
+ "Size Range",
497
+ "Size",
498
+ "Fit",
499
+ "Jacket/Coat Length",
500
+ "Warmth Rating",
501
+ "Activity/End Use",
502
+ "Features",
503
+ "New Arrivals",
504
+ "Sale",
505
+ "Color",
506
+ "Price"
507
+ ]
508
+ },
509
+ "513283": {
510
+ "facets": [
511
+ "size",
512
+ "new",
513
+ "sale",
514
+ "color",
515
+ "price"
516
+ ],
517
+ "source_facets": [
518
+ "Size Range",
519
+ "Inseam",
520
+ "Size",
521
+ "Leg Shape",
522
+ "Rise",
523
+ "Collection",
524
+ "New Arrivals",
525
+ "Sale",
526
+ "Color",
527
+ "Price"
528
+ ]
529
+ },
530
+ "622": {
531
+ "facets": [
532
+ "new",
533
+ "size",
534
+ "sale",
535
+ "color",
536
+ "price"
537
+ ],
538
+ "source_facets": [
539
+ "New Arrivals",
540
+ "Size Range",
541
+ "Size",
542
+ "Inseam",
543
+ "Rise",
544
+ "Leg Shape",
545
+ "Collection",
546
+ "Features",
547
+ "Fabric",
548
+ "Sale",
549
+ "Color",
550
+ "Price"
551
+ ]
552
+ },
553
+ "624": {
554
+ "facets": [
555
+ "size",
556
+ "new",
557
+ "sale",
558
+ "color",
559
+ "price"
560
+ ],
561
+ "source_facets": [
562
+ "Size Range",
563
+ "Size",
564
+ "Swim Style",
565
+ "Collection",
566
+ "Features",
567
+ "Pattern",
568
+ "New Arrivals",
569
+ "Sale",
570
+ "Color",
571
+ "Price"
572
+ ]
573
+ },
574
+ "613": {
575
+ "facets": [
576
+ "size",
577
+ "new",
578
+ "sale",
579
+ "color",
580
+ "price"
581
+ ],
582
+ "source_facets": [
583
+ "Size Range",
584
+ "Size",
585
+ "Style",
586
+ "Fabric",
587
+ "Features",
588
+ "Pattern",
589
+ "New Arrivals",
590
+ "Sale",
591
+ "Color",
592
+ "Price"
593
+ ]
594
+ },
595
+ "504735": {
596
+ "facets": [
597
+ "size",
598
+ "new",
599
+ "sale",
600
+ "color",
601
+ "price"
602
+ ],
603
+ "source_facets": [
604
+ "Size Range",
605
+ "Size",
606
+ "Jacket/Coat Length",
607
+ "Warmth Rating",
608
+ "Insulation",
609
+ "Activity/End Use",
610
+ "Features",
611
+ "New Arrivals",
612
+ "Sale",
613
+ "Color",
614
+ "Price"
615
+ ]
616
+ },
617
+ "504734": {
618
+ "facets": [
619
+ "size",
620
+ "new",
621
+ "sale",
622
+ "color",
623
+ "price"
624
+ ],
625
+ "source_facets": [
626
+ "Size Range",
627
+ "Size",
628
+ "Fit",
629
+ "Jacket/Coat Length",
630
+ "Warmth Rating",
631
+ "Insulation",
632
+ "Activity/End Use",
633
+ "Features",
634
+ "New Arrivals",
635
+ "Sale",
636
+ "Color",
637
+ "Price"
638
+ ]
639
+ },
640
+ "506593": {
641
+ "facets": [
642
+ "size",
643
+ "sale",
644
+ "color",
645
+ "price"
646
+ ],
647
+ "source_facets": [
648
+ "Size Range",
649
+ "Size",
650
+ "Jacket/Coat Length",
651
+ "Warmth Rating",
652
+ "Insulation",
653
+ "Activity/End Use",
654
+ "Features",
655
+ "Sale",
656
+ "Color",
657
+ "Price"
658
+ ]
659
+ },
660
+ "506594": {
661
+ "facets": [
662
+ "size",
663
+ "sale",
664
+ "color",
665
+ "price"
666
+ ],
667
+ "source_facets": [
668
+ "Size Range",
669
+ "Size",
670
+ "Fit",
671
+ "Jacket/Coat Length",
672
+ "Warmth Rating",
673
+ "Activity/End Use",
674
+ "Features",
675
+ "Sale",
676
+ "Color",
677
+ "Price"
678
+ ]
679
+ },
680
+ "504729": {
681
+ "facets": [
682
+ "size",
683
+ "new",
684
+ "sale",
685
+ "color",
686
+ "price"
687
+ ],
688
+ "source_facets": [
689
+ "Size Range",
690
+ "Size",
691
+ "Fit",
692
+ "Jacket/Coat Length",
693
+ "Warmth Rating",
694
+ "Insulation",
695
+ "Activity/End Use",
696
+ "Features",
697
+ "New Arrivals",
698
+ "Sale",
699
+ "Color",
700
+ "Price"
701
+ ]
702
+ },
703
+ "506708": {
704
+ "facets": [
705
+ "sale",
706
+ "size",
707
+ "brand",
708
+ "new",
709
+ "color",
710
+ "price"
711
+ ],
712
+ "source_facets": [
713
+ "Sale",
714
+ "Shoe Size",
715
+ "Shoe Width",
716
+ "Boot Height",
717
+ "Brand",
718
+ "Features",
719
+ "Shoe Style",
720
+ "Suggested Use",
721
+ "Warmth Rating",
722
+ "New Arrivals",
723
+ "Color",
724
+ "Price"
725
+ ]
726
+ },
727
+ "506705": {
728
+ "facets": [
729
+ "sale",
730
+ "size",
731
+ "brand",
732
+ "new",
733
+ "color",
734
+ "price"
735
+ ],
736
+ "source_facets": [
737
+ "Sale",
738
+ "Shoe Size",
739
+ "Shoe Width",
740
+ "Suggested Use",
741
+ "Brand",
742
+ "Features",
743
+ "Shoe Style",
744
+ "New Arrivals",
745
+ "Color",
746
+ "Price"
747
+ ]
748
+ },
749
+ "503423": {
750
+ "facets": [
751
+ "sale",
752
+ "size",
753
+ "brand",
754
+ "color",
755
+ "price"
756
+ ],
757
+ "source_facets": [
758
+ "Sale",
759
+ "Shoe Size",
760
+ "Shoe Width",
761
+ "Suggested Use",
762
+ "Brand",
763
+ "Features",
764
+ "Shoe Style",
765
+ "Color",
766
+ "Price"
767
+ ]
768
+ },
769
+ "503422": {
770
+ "facets": [
771
+ "sale",
772
+ "size",
773
+ "brand",
774
+ "new",
775
+ "color",
776
+ "price"
777
+ ],
778
+ "source_facets": [
779
+ "Sale",
780
+ "Shoe Size",
781
+ "Shoe Width",
782
+ "Lining Material",
783
+ "Outsole Material",
784
+ "Features",
785
+ "Brand",
786
+ "New Arrivals",
787
+ "Color",
788
+ "Price"
789
+ ]
790
+ },
791
+ "502980": {
792
+ "facets": [
793
+ "sale",
794
+ "size",
795
+ "brand",
796
+ "new",
797
+ "color",
798
+ "price"
799
+ ],
800
+ "source_facets": [
801
+ "Sale",
802
+ "Size",
803
+ "Activity/End Use",
804
+ "Brand",
805
+ "Fabric",
806
+ "Sock Weight",
807
+ "Style",
808
+ "New Arrivals",
809
+ "Color",
810
+ "Price"
811
+ ]
812
+ },
813
+ "511747": {
814
+ "facets": [
815
+ "brand",
816
+ "new",
817
+ "color",
818
+ "price"
819
+ ],
820
+ "source_facets": [
821
+ "Brand",
822
+ "New Arrivals",
823
+ "Color",
824
+ "Price"
825
+ ]
826
+ },
827
+ "511749": {
828
+ "facets": [
829
+ "sale",
830
+ "brand",
831
+ "new",
832
+ "color",
833
+ "price"
834
+ ],
835
+ "source_facets": [
836
+ "Sale",
837
+ "Bag Style",
838
+ "Brand",
839
+ "Capacity Range",
840
+ "Fabric",
841
+ "Features",
842
+ "Suggested Use",
843
+ "New Arrivals",
844
+ "Color",
845
+ "Price"
846
+ ]
847
+ },
848
+ "511750": {
849
+ "facets": [
850
+ "material",
851
+ "color",
852
+ "price"
853
+ ],
854
+ "source_facets": [
855
+ "Bed Size",
856
+ "Doormat Size",
857
+ "Fabric",
858
+ "Features",
859
+ "Material",
860
+ "Rug Style",
861
+ "Shape",
862
+ "Sheet Type",
863
+ "Color",
864
+ "Price"
865
+ ]
866
+ },
867
+ "20010101": {
868
+ "facets": [
869
+ "size",
870
+ "price",
871
+ "color"
872
+ ],
873
+ "source_facets": [
874
+ "Size Range",
875
+ "Size",
876
+ "Inseam",
877
+ "Inseam Length",
878
+ "Shoe Size",
879
+ "Shoe Width",
880
+ "Jacket/Coat Length",
881
+ "Price",
882
+ "Color"
883
+ ]
884
+ },
885
+ "20010102": {
886
+ "facets": [
887
+ "size",
888
+ "price",
889
+ "color"
890
+ ],
891
+ "source_facets": [
892
+ "Size Range",
893
+ "Size",
894
+ "Waist",
895
+ "Inseam",
896
+ "Inseam Length",
897
+ "Shoe Size",
898
+ "Shoe Width",
899
+ "Jacket/Coat Length",
900
+ "Price",
901
+ "Color"
902
+ ]
903
+ },
904
+ "20010103": {
905
+ "facets": [
906
+ "size",
907
+ "price",
908
+ "color"
909
+ ],
910
+ "source_facets": [
911
+ "Size Range",
912
+ "Size",
913
+ "Shoe Size",
914
+ "Price",
915
+ "Color"
916
+ ]
917
+ },
918
+ "1000010392": {
919
+ "facets": [
920
+ "sale",
921
+ "new",
922
+ "color",
923
+ "price"
924
+ ],
925
+ "source_facets": [
926
+ "Sale",
927
+ "New Arrivals",
928
+ "Color",
929
+ "Price"
930
+ ]
931
+ },
932
+ "505538": {
933
+ "facets": [
934
+ "size",
935
+ "sale",
936
+ "new",
937
+ "color",
938
+ "price"
939
+ ],
940
+ "source_facets": [
941
+ "Size Range",
942
+ "Size",
943
+ "Fabric Weight",
944
+ "Collection",
945
+ "Features",
946
+ "Fit",
947
+ "Style",
948
+ "Sale",
949
+ "New Arrivals",
950
+ "Color",
951
+ "Price"
952
+ ]
953
+ },
954
+ "506697": {
955
+ "facets": [
956
+ "sale",
957
+ "gender",
958
+ "size",
959
+ "new",
960
+ "color",
961
+ "price"
962
+ ],
963
+ "source_facets": [
964
+ "Sale",
965
+ "Gender",
966
+ "Shoe Size",
967
+ "Shoe Width",
968
+ "Warmth Rating",
969
+ "New Arrivals",
970
+ "Color",
971
+ "Price"
972
+ ]
973
+ },
974
+ "514124": {
975
+ "facets": [
976
+ "size",
977
+ "color",
978
+ "price"
979
+ ],
980
+ "source_facets": [
981
+ "Sleeve Length",
982
+ "Fabric",
983
+ "Fit",
984
+ "Size Range",
985
+ "Size",
986
+ "Features",
987
+ "Style",
988
+ "Color",
989
+ "Price"
990
+ ]
991
+ },
992
+ "516715": {
993
+ "facets": [
994
+ "gender",
995
+ "size",
996
+ "new",
997
+ "color",
998
+ "price"
999
+ ],
1000
+ "source_facets": [
1001
+ "Gender",
1002
+ "Size Range",
1003
+ "Size",
1004
+ "Style",
1005
+ "Collection",
1006
+ "Features",
1007
+ "Activity/End Use",
1008
+ "New Arrivals",
1009
+ "Color",
1010
+ "Price",
1011
+ "Fit"
1012
+ ]
1013
+ },
1014
+ "503380": {
1015
+ "facets": [
1016
+ "sale",
1017
+ "size",
1018
+ "brand",
1019
+ "new",
1020
+ "color",
1021
+ "price"
1022
+ ],
1023
+ "source_facets": [
1024
+ "Sale",
1025
+ "Shoe Size",
1026
+ "Shoe Width",
1027
+ "Lining Material",
1028
+ "Outsole Material",
1029
+ "Features",
1030
+ "Brand",
1031
+ "New Arrivals",
1032
+ "Color",
1033
+ "Price"
1034
+ ]
1035
+ },
1036
+ "589": {
1037
+ "facets": [
1038
+ "size",
1039
+ "new",
1040
+ "sale",
1041
+ "color",
1042
+ "price"
1043
+ ],
1044
+ "source_facets": [
1045
+ "Size Range",
1046
+ "Size",
1047
+ "Sleeve Length",
1048
+ "Fit",
1049
+ "Style",
1050
+ "Collection",
1051
+ "Fabric",
1052
+ "Features",
1053
+ "New Arrivals",
1054
+ "Sale",
1055
+ "Color",
1056
+ "Price"
1057
+ ]
1058
+ },
1059
+ "20010166": {
1060
+ "facets": [
1061
+ "size",
1062
+ "new",
1063
+ "sale",
1064
+ "color",
1065
+ "price"
1066
+ ],
1067
+ "source_facets": [
1068
+ "Size Range",
1069
+ "Size",
1070
+ "Sleeve Length",
1071
+ "Fit",
1072
+ "Style",
1073
+ "Collection",
1074
+ "Fabric",
1075
+ "Features",
1076
+ "New Arrivals",
1077
+ "Sale",
1078
+ "Color",
1079
+ "Price"
1080
+ ]
1081
+ }
1082
+ }
tasks/llbean/environment/reference/clone/data/seed/category_tiles.json ADDED
@@ -0,0 +1,477 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "20010718": {
3
+ "cat_id": 20010718,
4
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/promo_thumbnails_2/04_april_3/260406_Handsewn_Footwear_PromoThumb_XLarge.jpg",
5
+ "alt": "Vintage nautical-themed display with several pairs of boat shoes, an oar, and a catalog on wooden pl"
6
+ },
7
+ "511747": {
8
+ "cat_id": 511747,
9
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/29_outdoor_equipment_4/OE_New_XL25.jpg",
10
+ "alt": "Person wearing a blue backpack and outdoor clothing, standing on a rocky shoreline overlooking the o"
11
+ },
12
+ "915": {
13
+ "cat_id": 915,
14
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/29_outdoor_equipment_2/OE_Camping_XL25.jpg",
15
+ "alt": "Person wearing a teal long-sleeve shirt and gray pants sets up a green and white tent near a lake in"
16
+ },
17
+ "516713": {
18
+ "cat_id": 516713,
19
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/29_outdoor_equipment_2/OE_Accessories_XL25.jpg",
20
+ "alt": "Wrapped in a colorful L.L.Bean outdoor blanket, a person stands near a forest pond wearing teal snea"
21
+ },
22
+ "516664": {
23
+ "cat_id": 516664,
24
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/29_outdoor_equipment_4/OE_Hydration_XL25.jpg",
25
+ "alt": "Four colorful L. L. Bean water bottles with flip-top lids arranged on a wooden surface outdoors near"
26
+ },
27
+ "507923": {
28
+ "cat_id": 507923,
29
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/250310_updates/29_equipment/Fishing_XL25.jpg",
30
+ "alt": "A person in waders and a blue beanie fly fishing in a river with a forested background."
31
+ },
32
+ "507929": {
33
+ "cat_id": 507929,
34
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/250908_updates/29_outdoor_equipment/Hunting_XL25.jpg",
35
+ "alt": "Person kneels on grass in blaze orange and brown outfit, pouring water into a bowl for a brown and w"
36
+ },
37
+ "516714": {
38
+ "cat_id": 516714,
39
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/29_outdoor_equipment_2/OE_Winter_XL25.jpg",
40
+ "alt": "Person wearing an orange jacket, black pants, and snowshoes walks through snowy terrain using trekki"
41
+ },
42
+ "511749": {
43
+ "cat_id": 511749,
44
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/50_bags___travel_4/TR_New_XL25.jpg",
45
+ "alt": "Beige weekender bag carried over the shoulder by someone wearing a textured brown fleece jacket."
46
+ },
47
+ "1098": {
48
+ "cat_id": 1098,
49
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/50_bags___travel_2/TR_Hiking_XL25.jpg",
50
+ "alt": "Man wearing a brown jacket carries an olive green backpack with a yellow water bottle in the side po"
51
+ },
52
+ "516672": {
53
+ "cat_id": 516672,
54
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/50_bags___travel_4/TR_Everyday_XL25.jpg",
55
+ "alt": "Navy tote bag with long straps carried by someone wearing a light jacket and striped shirt, shown ag"
56
+ },
57
+ "203": {
58
+ "cat_id": 203,
59
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/50_bags___travel_4/TR_Bag_Charms_XL25.jpg",
60
+ "alt": "Mini boot\u2011shaped keychain and an \u201cEAST COAST\u201d tag hanging from a blue carabiner clipped to light-col"
61
+ },
62
+ "516673": {
63
+ "cat_id": 516673,
64
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/50_bags___travel_4/TR_Luggage_XL25.jpg",
65
+ "alt": "Cropped image of two L.L.Bean duffel bags, one red and one green, are stacked on a shelf."
66
+ },
67
+ "507361": {
68
+ "cat_id": 507361,
69
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251103_updates/50_bags___travel_1/TR_Toiletry_XL25.jpg",
70
+ "alt": "Toiletry bag hangs on hooks against a white wall, showcasing organized storage solutions."
71
+ },
72
+ "816": {
73
+ "cat_id": 816,
74
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/250908_updates/50_bags___travel/School_XL25.jpg",
75
+ "alt": "A child in a striped shirt and hat sits outdoors with a red L. L. Bean backpack and red lunch box."
76
+ },
77
+ "511750": {
78
+ "cat_id": 511750,
79
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_New_XL25.jpg",
80
+ "alt": "Light blue bedding set with matching pillows and a navy accent pillow featuring a whale design adds "
81
+ },
82
+ "131": {
83
+ "cat_id": 131,
84
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/31_home_4/HG_Bedding_XL25.jpg",
85
+ "alt": "Blue and white plaid bedding with matching pillows and a blue blanket."
86
+ },
87
+ "900": {
88
+ "cat_id": 900,
89
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_Bath_XL25.jpg",
90
+ "alt": "Stack of colorful folded towels on a white table; four striped towels hang on the left against a whi"
91
+ },
92
+ "129": {
93
+ "cat_id": 129,
94
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_Furniture_XL25.jpg",
95
+ "alt": "Beige sectional sofa with striped and solid pillows sits in a bright room, accented by a gray throw "
96
+ },
97
+ "514001": {
98
+ "cat_id": 514001,
99
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_Rugs_XL25.jpg",
100
+ "alt": "Open blue door reveals a cozy entryway with gray rugs, a wooden chair stacked with books, and a wove"
101
+ },
102
+ "312": {
103
+ "cat_id": 312,
104
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_Decor_XL25.jpg",
105
+ "alt": "Stack of colorful fleece blankets in shades of blue, gray, red, pink, and green sits by a window, wi"
106
+ },
107
+ "132": {
108
+ "cat_id": 132,
109
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_Backyard_XL25.jpg",
110
+ "alt": "Two white Adirondack chairs with a blue throw and patterned pillow sit on a grassy lawn near a fire "
111
+ },
112
+ "510044": {
113
+ "cat_id": 510044,
114
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/category_banners_4/240909_home_goods/Fireplace_XL25.jpg",
115
+ "alt": "A fireplace set with gloves, wood, and a personalized bag rests by a stone hearth, creating a cozy a"
116
+ },
117
+ "506621": {
118
+ "cat_id": 506621,
119
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/31_home_4/HG_Games_XL25.jpg",
120
+ "alt": "Image of two cornhole boards with beanbags all sitting on green grass."
121
+ },
122
+ "134": {
123
+ "cat_id": 134,
124
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/31_home_3/HG_Dog_XL25.jpg",
125
+ "alt": "A brown dog lounges on stacked cushioned pet beds in tan, blue, and gray tones near a bright window "
126
+ },
127
+ "514907": {
128
+ "cat_id": 514907,
129
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/31_home_4/HG_Kitchen_XL25.jpg",
130
+ "alt": "Breakfast gift set displayed on a wooden surface includes pancake mix, maple syrup, blueberry and st"
131
+ },
132
+ "508925": {
133
+ "cat_id": 508925,
134
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_newtosale_XL25.jpg",
135
+ "alt": "Red line llustration of a bird singing with the words \"New to Sale.\""
136
+ },
137
+ "510312": {
138
+ "cat_id": 510312,
139
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_dailymarkdown_XL25.jpg",
140
+ "alt": "Red line illustration of sun and the words \"Daily Markdown.\""
141
+ },
142
+ "516686": {
143
+ "cat_id": 516686,
144
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_clothing_XL25.jpg",
145
+ "alt": "Red line illustration of a shirt and the word \"Clothing.\""
146
+ },
147
+ "516689": {
148
+ "cat_id": 516689,
149
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_footwear_XL25.jpg",
150
+ "alt": "Red line illustration of a boot and the word \"Footwear.\""
151
+ },
152
+ "509104": {
153
+ "cat_id": 509104,
154
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_equipment_XL25.jpg",
155
+ "alt": "Red line illustration of a tent and the words \"Outdoor Equipment.\""
156
+ },
157
+ "307": {
158
+ "cat_id": 307,
159
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_homegoods_XL25.jpg",
160
+ "alt": "Red line illustration of a fireplace and the words \"Home Goods.\""
161
+ },
162
+ "518521": {
163
+ "cat_id": 518521,
164
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_outerwear_XL25.jpg",
165
+ "alt": "Red line illustration of a jacket and the word \"Outerwear.\""
166
+ },
167
+ "305": {
168
+ "cat_id": 305,
169
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/sale_dp_3/240625_summer_sale/240625_bagsntravel_XL25.jpg",
170
+ "alt": "Red line illustration of a tote bag and the words \"Bags & Travel.\""
171
+ },
172
+ "518363": {
173
+ "cat_id": 518363,
174
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/landers_4/518571_outdoorexperiences_update/518363_1A_XL13rd.jpg",
175
+ "alt": "The outdoor stage in Discovery Park at the L.L.Bean Flagship store."
176
+ },
177
+ "518708": {
178
+ "cat_id": 518708,
179
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/landers_4/518571_outdoorexperiences_update/518363_3A_XL13rd.jpg",
180
+ "alt": "The Bootmobile, parked in a green field with the ocean in the background."
181
+ },
182
+ "1000010058": {
183
+ "cat_id": 1000010058,
184
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_y_11_18_12_8/1000010058_info_series_3_wildcat_ow_/1000010058_VIDEO_STORY_TILE_XLarge50.jpg",
185
+ "alt": "The L L Bean Wildcat 3 in 1 Jacket shown on form with a play video icon in the center"
186
+ },
187
+ "516565": {
188
+ "cat_id": 516565,
189
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_p_7_28_8_10/20010241_behind_the_design__bean_boot/516565_Story_Tile_XLarge50.jpg",
190
+ "alt": "Brown and tan leather Bean Boot with yellow laces on a wooden surface, with a play button overlay."
191
+ },
192
+ "517669": {
193
+ "cat_id": 517669,
194
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Camping_XL25.png",
195
+ "alt": "Camping Icon"
196
+ },
197
+ "517668": {
198
+ "cat_id": 517668,
199
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Fishing_XL25.png",
200
+ "alt": "Fishing Icon"
201
+ },
202
+ "517667": {
203
+ "cat_id": 517667,
204
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Hiking_XL25.png",
205
+ "alt": "Hiking Icon"
206
+ },
207
+ "517932": {
208
+ "cat_id": 517932,
209
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Home__Backyard_XL25.png",
210
+ "alt": "Home & Backyard Icon"
211
+ },
212
+ "518837": {
213
+ "cat_id": 518837,
214
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Summer_XL25.png",
215
+ "alt": "Summer Icon"
216
+ },
217
+ "517670": {
218
+ "cat_id": 517670,
219
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Paddling_XL25.png",
220
+ "alt": "Paddling Icon"
221
+ },
222
+ "518288": {
223
+ "cat_id": 518288,
224
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Kids_XL25.png",
225
+ "alt": "Kids Icon"
226
+ },
227
+ "517984": {
228
+ "cat_id": 517984,
229
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Hunting_XL25.png",
230
+ "alt": "Hunting Icon"
231
+ },
232
+ "517671": {
233
+ "cat_id": 517671,
234
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/explore_llb_refresh_231018/activity_icons/150px/231024_ExploreLLB_ActivityIcons_Winter_XL25.png",
235
+ "alt": "Winter Icon"
236
+ },
237
+ "517989": {
238
+ "cat_id": 517989,
239
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_g_3_24_4_6/517989_our_partners_250325/517989_ST.png",
240
+ "alt": ""
241
+ },
242
+ "518345": {
243
+ "cat_id": 518345,
244
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/branded_content_2/210303_llb_refresh/518345_SocialImpact_TILE.jpg",
245
+ "alt": ""
246
+ },
247
+ "517561": {
248
+ "cat_id": 517561,
249
+ "img": "https://www.llbean.net/firstspirit/media/image_library/newsroom_1/518778_hq/518778_TILE.jpg",
250
+ "alt": ""
251
+ },
252
+ "20010245": {
253
+ "cat_id": 20010245,
254
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_v_10_20_11_2/20010245_how_to_use_grow_cuffs__251021_/Grow_Cuffs_Story_Tile_XL25.jpg",
255
+ "alt": "Hand adjusts Velcro strap on dark blue jacket cuff with teal accent; play button icon appears over i"
256
+ },
257
+ "20010246": {
258
+ "cat_id": 20010246,
259
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_w_11_3_11_16/20010246_how_to_care_for_cashmere__251104_/Laces_Story_Tile_XL25.jpg",
260
+ "alt": "Hand adjusts the laces of the L L Bean Boot; play button icon appears over image."
261
+ },
262
+ "518824": {
263
+ "cat_id": 518824,
264
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_y_11_20_12_3/518824_how_to_keep_dogs_warm_outside_231124/518824_StoryTile_XL25.jpg",
265
+ "alt": "A woman wearing a backpack and 2 dogs wearing orange jackets atop a wintery mountain."
266
+ },
267
+ "518753": {
268
+ "cat_id": 518753,
269
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_e_1/518753_ice_skating_tips_for_beginners_230214/518753_VIDEO_STORY_TILE_XL25.jpg",
270
+ "alt": "Wyoma demonstrating beginner ice skating technique."
271
+ },
272
+ "518724": {
273
+ "cat_id": 518724,
274
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_u_1/518724_V_ColdWeatherCamping_ST_XL25.jpg",
275
+ "alt": "MacKenzie smiling in a sleeping bag, text: How To: Cold Weather Camping Tips and the L.L.Bean logo."
276
+ },
277
+ "518758": {
278
+ "cat_id": 518758,
279
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_q_7_31_8_13/518758_how_to_start_a_campfire_230810/518758_VIDEO_STORY_TILE_XL25.jpg",
280
+ "alt": "Nate sitting in front of a fire at a campsite."
281
+ },
282
+ "518827": {
283
+ "cat_id": 518827,
284
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_r_8_14_8_27/xxxxxx_3_types_of_campfires_230817/518827_VIDEO_STORY_TILE_XL25.jpg",
285
+ "alt": "A just lit lean-to fire in a fire ring."
286
+ },
287
+ "518621": {
288
+ "cat_id": 518621,
289
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_c/518621_xc_tips_update_/518621_V_XCountrySkiTips_ST_XL25.jpg",
290
+ "alt": "L.L.Bean Outdoor Discovery Programs instructor demonstrating downhill technique on cross-country ski"
291
+ },
292
+ "518831": {
293
+ "cat_id": 518831,
294
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_HowToGuides_XL25.jpg",
295
+ "alt": "Text \"View All How-To Guides\" with gray background and white outdoor icons."
296
+ },
297
+ "20010675": {
298
+ "cat_id": 20010675,
299
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_j_5_4_5_17/20010675_/Bug_Protection_Story_Tile_XL25.jpg",
300
+ "alt": "Close up of a person wearing a light tan L L Bean button up shirt with two chest pockets; video play"
301
+ },
302
+ "20010674": {
303
+ "cat_id": 20010674,
304
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_i_4_20_5_3/20010674_behind_the_design__airlight_pullover__260428_/Airlight_Story_Tile_XL25.jpg",
305
+ "alt": "Plum-colored ribbed pullover with a snap-button collar and L L Bean logo, shown on a mannequin again"
306
+ },
307
+ "20010611": {
308
+ "cat_id": 20010611,
309
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_f_3_9_3_22/below_product_details_behind_the_design__casco_bay_boat_shoes__260318_/Casco_Bay_Boat_Moc_Story_Tile_XL25.jpg",
310
+ "alt": "Top view of boat shoes arranged on a wooden surface with a magazine and compass with play video icon"
311
+ },
312
+ "20010610": {
313
+ "cat_id": 20010610,
314
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_e_2_23_3_8/20010610_/Field_Coat_Story_Tile_XL25.jpg",
315
+ "alt": "Vintage tan L L Bean coat on a hanger in a rustic room with gear and d\u00e9cor in the background."
316
+ },
317
+ "20010584": {
318
+ "cat_id": 20010584,
319
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_y_12_1_12_14/20010584_/Wicked_Good_Story_Tile_XL25.jpg",
320
+ "alt": "Pair of tan suede moccasin slippers with white fleece lining and a play icon overlay."
321
+ },
322
+ "1000010056": {
323
+ "cat_id": 1000010056,
324
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_a_12_30_1_12/1000010056_info_series_1_utility_ow_241120/1000010056_Storytile_XL25.jpg",
325
+ "alt": "The L L Bean Insulated Utility Jacket shown on form with a play video icon in the center"
326
+ },
327
+ "1000010057": {
328
+ "cat_id": 1000010057,
329
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_y_11_18_12_8/1000010057_info_series_2_wind_challenger_241204/1000010057_VIDEO_STORY_TILE_XL25.jpg",
330
+ "alt": "The L L Bean Wind Challenger Jacket shown on form with a play video icon in the center"
331
+ },
332
+ "518825": {
333
+ "cat_id": 518825,
334
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_y_11_20_12_3/518825_what_to_wear_on_a_run_in_the_cold_231207/518825_STORY_TILE_XL25.jpg",
335
+ "alt": "A man and a woman running on a snow-covered road."
336
+ },
337
+ "518851": {
338
+ "cat_id": 518851,
339
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_e_2_24_3_9/518851_hiking_footwear_buying_guide/518851_STORY_TILE_XL25.jpg",
340
+ "alt": "A close-up of hiking footwear on a person walking across rocks."
341
+ },
342
+ "518832": {
343
+ "cat_id": 518832,
344
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_BuyingGuides_XL25.jpg",
345
+ "alt": "Text \"View All Buying Guides\" with gray background and white outdoor icons."
346
+ },
347
+ "20010401": {
348
+ "cat_id": 20010401,
349
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_t_9_22_10_5/20010243_camping_recipe_series__lasagna__250923_/Lasagna_Story_Tile_copy_XL25.jpg",
350
+ "alt": "A dutch oven filled with baked lasagna with melted cheese and tomato sauce on a red checkered tablec"
351
+ },
352
+ "20010400": {
353
+ "cat_id": 20010400,
354
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_s_9_8_9_21/20010243_camping_recipe_series__cinnamon_rolls__250916_/Cinnamon_Rolls_Story_Tile_copy_XL25.jpg",
355
+ "alt": "Cinnamon roll cake with white icing on a wooden board, play button overlay in center, blue plate par"
356
+ },
357
+ "1000010018": {
358
+ "cat_id": 1000010018,
359
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_s_8_26_9_8/1000010018_easy_camp_recipe_dessert_240827/240827_Storytile_XL25.jpg",
360
+ "alt": "A skillet with blueberry cobbler topped with a dollop of whipped cream on a tablecloth with a play v"
361
+ },
362
+ "1000010016": {
363
+ "cat_id": 1000010016,
364
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_q_7_29_8_11/240730_camping_recipe_2/1000010016_Story_Tile_XL25.jpg",
365
+ "alt": "A bowl of curried vegetables sitting on a red and white checkered tablecloth."
366
+ },
367
+ "518650": {
368
+ "cat_id": 518650,
369
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_h/rangerinterview/MichellWoulard_STORY_TILE_XL25.jpg",
370
+ "alt": "Interpretive Ranger Michell Woulard"
371
+ },
372
+ "1000010015": {
373
+ "cat_id": 1000010015,
374
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_p_7_15_7_28/xxxxxx_camping_recipe_1_240716/100_240716_VIDEO_STORY_TILE.jpg6_XL25.jpg",
375
+ "alt": "A frittata in a cast iron skillet sits on a picnic table."
376
+ },
377
+ "518367": {
378
+ "cat_id": 518367,
379
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/branded_content_2/210416_national_parks/210417_NPF_tile_XL25.jpg",
380
+ "alt": "A beautiful rock formation against a bright blue sky with a Zion National Park entrance sign in the "
381
+ },
382
+ "518409": {
383
+ "cat_id": 518409,
384
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/branded_content_2/jog_10/518409_10_waterfall_hikes/518409_tile_XL25.jpg",
385
+ "alt": "Yellowstone National Park Waterfall and double rainbow."
386
+ },
387
+ "518618": {
388
+ "cat_id": 518618,
389
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_IdeasInspo_XL25.jpg",
390
+ "alt": "Text \"View All Ideas & Inspiration\" with gray background and white outdoor icons."
391
+ },
392
+ "1000010061": {
393
+ "cat_id": 1000010061,
394
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_d_/1000010061_how_to_use_a_stowaway_pack_pouch_250219/1000010061_VIDEO_STORY_TILE.jpg_XL25.jpg",
395
+ "alt": "A teal stowaway pack shown in two different ways: laid out flat and stowed away in it's own pouch."
396
+ },
397
+ "1000010060": {
398
+ "cat_id": 1000010060,
399
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_c_1_27_/1000010060_how_to_pack_your_llb_stowaway_jacket_250205/1000010022_VIDEO_STORY_TILE.jpg_XL25.jpg",
400
+ "alt": "A blue stowaway jacket shown in two different ways: laid out flat and stowed away in it's own pouch."
401
+ },
402
+ "518822": {
403
+ "cat_id": 518822,
404
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_j_4_22_5_5/240501_10_ways_to_use_your_boat___tote/100_518822_VIDEO_STORY_TILE.jpg6_XL25.jpg",
405
+ "alt": "Stephanie standing behind a red-handled Boat & Tote, a play video icon in the center."
406
+ },
407
+ "518756": {
408
+ "cat_id": 518756,
409
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_h_1/518756_how_to_clean_a_dog_bed_230329/518756_VIDEO_STORY_TILE_XL25.jpg",
410
+ "alt": "A golden retriever on a dog bed, a play video button in the center."
411
+ },
412
+ "518697": {
413
+ "cat_id": 518697,
414
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_p/518697_V_BreakinHikingBoots_ST_XL25.jpg",
415
+ "alt": "A woman wearing a backpack in the woods, looking at the camera and holding a hiking boot."
416
+ },
417
+ "518819": {
418
+ "cat_id": 518819,
419
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_u_9_25_10_8/518819_how_to_style_a_vest_231003/100_518819_VIDEO_STORY_TILE_XL25.jpg",
420
+ "alt": "A model and her stylist reflected in a full-length mirror."
421
+ },
422
+ "518727": {
423
+ "cat_id": 518727,
424
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_y_1/518727_V_PutSnowshoeOn_ST_XL25.jpg",
425
+ "alt": "Close-up of foot of someone putting on a snowshoe."
426
+ },
427
+ "518699": {
428
+ "cat_id": 518699,
429
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_p/518699_V_BreakDownATent_ST_XL25.jpg",
430
+ "alt": "Woman in a tent looking at the camera, text How to Break Down a Tent and L.L.Bean logo."
431
+ },
432
+ "518836": {
433
+ "cat_id": 518836,
434
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_ProductUseCare_XL25.jpg",
435
+ "alt": "Text \"View All Product Use & Care\" with gray background and white outdoor icons."
436
+ },
437
+ "916": {
438
+ "cat_id": 916,
439
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/915_camping___hiking_2/Hiking_Backpacks_XL25.jpg",
440
+ "alt": "Person wearing a textured mauve jacket and carrying an olive green hiking backpack with a water bott"
441
+ },
442
+ "1097": {
443
+ "cat_id": 1097,
444
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/915_camping___hiking_2/Sleeping_Bags__Pads_XL25.jpg",
445
+ "alt": "A woman wrapped in a colorful L.L.Bean outdoor quilted blanket, standing near a forested lake."
446
+ },
447
+ "506831": {
448
+ "cat_id": 506831,
449
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/915_camping___hiking_3/Sleeping_Bags_XL25.jpg",
450
+ "alt": "A person wrapped in a large gray sleeping bag sits outdoors on a grassy area with trees and mountain"
451
+ },
452
+ "918": {
453
+ "cat_id": 918,
454
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/category_banners_4/240909_camping___hiking/Flashlights_Headlamps__Lanterns_XL25.jpg",
455
+ "alt": "A woman wearing a headlamp and L L Bean backpack, face obscured, focusing on the zipper of a jacket,"
456
+ },
457
+ "504412": {
458
+ "cat_id": 504412,
459
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/915_camping___hiking_3/Hiking_Poles__Gaiters_XL25.jpg",
460
+ "alt": "Hiker wearing a green jacket and shorts walks along a muddy trail using trekking poles surrounded by"
461
+ },
462
+ "9925": {
463
+ "cat_id": 9925,
464
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/category_banners_6/260318_updates/915_camping___hiking_3/Camping_Furniture_XL25.jpg",
465
+ "alt": "Person relaxing in a green outdoor chair beside a calm lakeside, wearing a light pink top and dark p"
466
+ },
467
+ "1096": {
468
+ "cat_id": 1096,
469
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/915_camping___hiking_2/Tents__Shelters_XL25.jpg",
470
+ "alt": "Person setting up a green and yellow tent by a lakeside, wearing a teal long-sleeve shirt, gray pant"
471
+ },
472
+ "9970": {
473
+ "cat_id": 9970,
474
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/category_banners_5/251226_updates/915_camping___hiking_2/Coolers_XL25.jpg",
475
+ "alt": "Blue L. L. Bean cooler bag rests on a green canoe while a person in a light blue shirt opens a bottl"
476
+ }
477
+ }
tasks/llbean/environment/reference/clone/data/seed/content_pages.json ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "cat_id": 510618,
4
+ "name": "Help Center",
5
+ "blurb": "Find answers about orders, shipping, returns, product care and your account."
6
+ },
7
+ {
8
+ "cat_id": 510623,
9
+ "name": "More Shipping Information",
10
+ "blurb": "Delivery timing, shipping methods, and where we ship."
11
+ },
12
+ {
13
+ "cat_id": 510624,
14
+ "name": "Returns",
15
+ "blurb": "Return or exchange an item. Our guarantee stands behind everything we sell."
16
+ },
17
+ {
18
+ "cat_id": 513705,
19
+ "name": "Our Guarantee",
20
+ "blurb": "We stand behind all of our products. If you are not satisfied, let us know."
21
+ },
22
+ {
23
+ "cat_id": 510734,
24
+ "name": "Payment Options",
25
+ "blurb": "The payment methods accepted at checkout."
26
+ },
27
+ {
28
+ "cat_id": 518112,
29
+ "name": "Medical Professional Discount",
30
+ "blurb": "A discount for verified medical professionals."
31
+ },
32
+ {
33
+ "cat_id": 518852,
34
+ "name": "First Responder Discount",
35
+ "blurb": "A discount for verified first responders."
36
+ },
37
+ {
38
+ "cat_id": 517432,
39
+ "name": "Military & Family Discount",
40
+ "blurb": "A discount for verified service members and their families."
41
+ },
42
+ {
43
+ "cat_id": 517433,
44
+ "name": "Student & Teacher Discount",
45
+ "blurb": "A discount for verified students and teachers."
46
+ },
47
+ {
48
+ "cat_id": 516330,
49
+ "name": "Exclusive Offers & Promotions",
50
+ "blurb": "Current offers and promotions."
51
+ },
52
+ {
53
+ "cat_id": 518363,
54
+ "name": "Maine Events",
55
+ "blurb": "Events at our Maine campus and beyond."
56
+ },
57
+ {
58
+ "cat_id": 518708,
59
+ "name": "Bootmobile",
60
+ "blurb": "Where to find the L.L.Bean Bootmobile."
61
+ },
62
+ {
63
+ "cat_id": 518345,
64
+ "name": "Social Impact",
65
+ "blurb": "How we invest in the outdoors and the communities around us."
66
+ },
67
+ {
68
+ "cat_id": 517561,
69
+ "name": "Inside L.L.Bean",
70
+ "blurb": "Stories from inside the company."
71
+ },
72
+ {
73
+ "cat_id": 516917,
74
+ "name": "Our Company",
75
+ "blurb": "Our history, our people and how we work."
76
+ },
77
+ {
78
+ "cat_id": 20010535,
79
+ "name": "L.L.Bean Rewards",
80
+ "blurb": "Join free and earn points on every purchase."
81
+ },
82
+ {
83
+ "cat_id": 514535,
84
+ "name": "L.L.Bean Mastercard",
85
+ "blurb": "Learn about the L.L.Bean Mastercard."
86
+ },
87
+ {
88
+ "cat_id": 509870,
89
+ "name": "Gift Shop",
90
+ "blurb": "Gift ideas for everyone on your list."
91
+ },
92
+ {
93
+ "cat_id": 505,
94
+ "name": "Gift Cards",
95
+ "blurb": "Buy a gift card or check a balance."
96
+ },
97
+ {
98
+ "cat_id": 518766,
99
+ "name": "Site Map",
100
+ "blurb": "Every section of this site in one list."
101
+ },
102
+ {
103
+ "cat_id": 518582,
104
+ "name": "Security",
105
+ "blurb": "How we protect your information."
106
+ },
107
+ {
108
+ "cat_id": 518583,
109
+ "name": "Privacy Policy",
110
+ "blurb": "How we collect and use information."
111
+ },
112
+ {
113
+ "cat_id": 518522,
114
+ "name": "Product Recalls",
115
+ "blurb": "Current product recall notices."
116
+ },
117
+ {
118
+ "cat_id": 517941,
119
+ "name": "Accessibility",
120
+ "blurb": "Our commitment to an accessible experience."
121
+ },
122
+ {
123
+ "cat_id": 20011104,
124
+ "name": "Shop the Deals",
125
+ "blurb": "Current markdowns across the store."
126
+ },
127
+ {
128
+ "cat_id": 514029,
129
+ "name": "Boat and Tote Bags",
130
+ "blurb": "Our original Boat and Tote, made in Maine."
131
+ },
132
+ {
133
+ "cat_id": 516565,
134
+ "name": "Behind the Design: Bean Boots",
135
+ "blurb": "Behind the Design: Bean Boots - editorial guide from L.L.Bean."
136
+ },
137
+ {
138
+ "cat_id": 517667,
139
+ "name": "Hiking",
140
+ "blurb": "Hiking - editorial guide from L.L.Bean."
141
+ },
142
+ {
143
+ "cat_id": 517668,
144
+ "name": "Fishing",
145
+ "blurb": "Fishing - editorial guide from L.L.Bean."
146
+ },
147
+ {
148
+ "cat_id": 517669,
149
+ "name": "Camping",
150
+ "blurb": "Camping - editorial guide from L.L.Bean."
151
+ },
152
+ {
153
+ "cat_id": 517670,
154
+ "name": "Paddling",
155
+ "blurb": "Paddling - editorial guide from L.L.Bean."
156
+ },
157
+ {
158
+ "cat_id": 517671,
159
+ "name": "Winter",
160
+ "blurb": "Winter - editorial guide from L.L.Bean."
161
+ },
162
+ {
163
+ "cat_id": 517932,
164
+ "name": "Home & Backyard",
165
+ "blurb": "Home & Backyard - editorial guide from L.L.Bean."
166
+ },
167
+ {
168
+ "cat_id": 517984,
169
+ "name": "Hunting",
170
+ "blurb": "Hunting - editorial guide from L.L.Bean."
171
+ },
172
+ {
173
+ "cat_id": 518288,
174
+ "name": "Kids",
175
+ "blurb": "Kids - editorial guide from L.L.Bean."
176
+ },
177
+ {
178
+ "cat_id": 518367,
179
+ "name": "Discover the Power of Parks",
180
+ "blurb": "Discover the Power of Parks - editorial guide from L.L.Bean."
181
+ },
182
+ {
183
+ "cat_id": 518409,
184
+ "name": "10 Best Hikes with Waterfalls",
185
+ "blurb": "10 Best Hikes with Waterfalls - editorial guide from L.L.Bean."
186
+ },
187
+ {
188
+ "cat_id": 518618,
189
+ "name": "View All Ideas & Inspiration",
190
+ "blurb": "View All Ideas & Inspiration - editorial guide from L.L.Bean."
191
+ },
192
+ {
193
+ "cat_id": 518621,
194
+ "name": "Cross-Country Skiing Tips & Tricks for Beginners",
195
+ "blurb": "Cross-Country Skiing Tips & Tricks for Beginners - editorial guide from L.L.Bean."
196
+ },
197
+ {
198
+ "cat_id": 518650,
199
+ "name": "Life-Changing Experiences at a Little-Known National Park",
200
+ "blurb": "Life-Changing Experiences at a Little-Known National Park - editorial guide from L.L.Bean."
201
+ },
202
+ {
203
+ "cat_id": 518697,
204
+ "name": "How to Break In Your Hiking Boots",
205
+ "blurb": "How to Break In Your Hiking Boots - editorial guide from L.L.Bean."
206
+ },
207
+ {
208
+ "cat_id": 518699,
209
+ "name": "How to Break Down a Tent",
210
+ "blurb": "How to Break Down a Tent - editorial guide from L.L.Bean."
211
+ },
212
+ {
213
+ "cat_id": 518724,
214
+ "name": "Cold Weather Camping Tips",
215
+ "blurb": "Cold Weather Camping Tips - editorial guide from L.L.Bean."
216
+ },
217
+ {
218
+ "cat_id": 518727,
219
+ "name": "How to Put On Snowshoes",
220
+ "blurb": "How to Put On Snowshoes - editorial guide from L.L.Bean."
221
+ },
222
+ {
223
+ "cat_id": 518753,
224
+ "name": "Ice Skating Tips for Beginners",
225
+ "blurb": "Ice Skating Tips for Beginners - editorial guide from L.L.Bean."
226
+ },
227
+ {
228
+ "cat_id": 518756,
229
+ "name": "How to Clean a Dog Bed",
230
+ "blurb": "How to Clean a Dog Bed - editorial guide from L.L.Bean."
231
+ },
232
+ {
233
+ "cat_id": 518758,
234
+ "name": "How to Start a Campfire",
235
+ "blurb": "How to Start a Campfire - editorial guide from L.L.Bean."
236
+ },
237
+ {
238
+ "cat_id": 518819,
239
+ "name": "3 Ways to Style a Vest",
240
+ "blurb": "3 Ways to Style a Vest - editorial guide from L.L.Bean."
241
+ },
242
+ {
243
+ "cat_id": 518822,
244
+ "name": "10 Unexpected Ways to Use Your Boat & Tote",
245
+ "blurb": "10 Unexpected Ways to Use Your Boat & Tote - editorial guide from L.L.Bean."
246
+ },
247
+ {
248
+ "cat_id": 518824,
249
+ "name": "How to Keep Dogs Warm Outside",
250
+ "blurb": "How to Keep Dogs Warm Outside - editorial guide from L.L.Bean."
251
+ },
252
+ {
253
+ "cat_id": 518825,
254
+ "name": "What to Wear on a Run in the Cold",
255
+ "blurb": "What to Wear on a Run in the Cold - editorial guide from L.L.Bean."
256
+ },
257
+ {
258
+ "cat_id": 518827,
259
+ "name": "3 Types of Campfires: How & When to Build Them",
260
+ "blurb": "3 Types of Campfires: How & When to Build Them - editorial guide from L.L.Bean."
261
+ },
262
+ {
263
+ "cat_id": 518831,
264
+ "name": "View All How-To Guides",
265
+ "blurb": "View All How-To Guides - editorial guide from L.L.Bean."
266
+ },
267
+ {
268
+ "cat_id": 518832,
269
+ "name": "View All Buying Guides",
270
+ "blurb": "View All Buying Guides - editorial guide from L.L.Bean."
271
+ },
272
+ {
273
+ "cat_id": 518836,
274
+ "name": "View All Product Use & Care",
275
+ "blurb": "View All Product Use & Care - editorial guide from L.L.Bean."
276
+ },
277
+ {
278
+ "cat_id": 518837,
279
+ "name": "Summer",
280
+ "blurb": "Summer - editorial guide from L.L.Bean."
281
+ },
282
+ {
283
+ "cat_id": 518851,
284
+ "name": "Hiking Footwear Buying Guide",
285
+ "blurb": "Hiking Footwear Buying Guide - editorial guide from L.L.Bean."
286
+ },
287
+ {
288
+ "cat_id": 20010245,
289
+ "name": "How to Use L.L.Bean Grow-Cuffs",
290
+ "blurb": "How to Use L.L.Bean Grow-Cuffs - editorial guide from L.L.Bean."
291
+ },
292
+ {
293
+ "cat_id": 20010246,
294
+ "name": "4 Ways to Lace Up Your Bean Boots",
295
+ "blurb": "4 Ways to Lace Up Your Bean Boots - editorial guide from L.L.Bean."
296
+ },
297
+ {
298
+ "cat_id": 20010400,
299
+ "name": "Easy Campfire Recipes: Dutch Oven Cinnamon Rolls",
300
+ "blurb": "Easy Campfire Recipes: Dutch Oven Cinnamon Rolls - editorial guide from L.L.Bean."
301
+ },
302
+ {
303
+ "cat_id": 20010401,
304
+ "name": "Easy Campfire Recipes: Dutch Oven Lasagna",
305
+ "blurb": "Easy Campfire Recipes: Dutch Oven Lasagna - editorial guide from L.L.Bean."
306
+ },
307
+ {
308
+ "cat_id": 20010584,
309
+ "name": "Behind the Design: Wicked Good Slippers",
310
+ "blurb": "Behind the Design: Wicked Good Slippers - editorial guide from L.L.Bean."
311
+ },
312
+ {
313
+ "cat_id": 20010610,
314
+ "name": "Behind the Design: The Original Field Coat",
315
+ "blurb": "Behind the Design: The Original Field Coat - editorial guide from L.L.Bean."
316
+ },
317
+ {
318
+ "cat_id": 20010611,
319
+ "name": "Behind the Design: The Casco Bay Boat Moc",
320
+ "blurb": "Behind the Design: The Casco Bay Boat Moc - editorial guide from L.L.Bean."
321
+ },
322
+ {
323
+ "cat_id": 20010674,
324
+ "name": "Behind the Design: Airlight",
325
+ "blurb": "Behind the Design: Airlight - editorial guide from L.L.Bean."
326
+ },
327
+ {
328
+ "cat_id": 20010675,
329
+ "name": "Behind the Design: Bug Protection Clothing",
330
+ "blurb": "Behind the Design: Bug Protection Clothing - editorial guide from L.L.Bean."
331
+ },
332
+ {
333
+ "cat_id": 1000010015,
334
+ "name": "Easy Camping Recipes: Camp Skillet Frittata",
335
+ "blurb": "Easy Camping Recipes: Camp Skillet Frittata - editorial guide from L.L.Bean."
336
+ },
337
+ {
338
+ "cat_id": 1000010016,
339
+ "name": "Easy Camping Recipes: Camp Veggie Curry",
340
+ "blurb": "Easy Camping Recipes: Camp Veggie Curry - editorial guide from L.L.Bean."
341
+ },
342
+ {
343
+ "cat_id": 1000010018,
344
+ "name": "Easy Camping Recipes: Blueberry Cobbler",
345
+ "blurb": "Easy Camping Recipes: Blueberry Cobbler - editorial guide from L.L.Bean."
346
+ },
347
+ {
348
+ "cat_id": 1000010056,
349
+ "name": "Behind the Design: Insulated Utility Jacket",
350
+ "blurb": "Behind the Design: Insulated Utility Jacket - editorial guide from L.L.Bean."
351
+ },
352
+ {
353
+ "cat_id": 1000010057,
354
+ "name": "Behind the Design: Wind Challenger",
355
+ "blurb": "Behind the Design: Wind Challenger - editorial guide from L.L.Bean."
356
+ },
357
+ {
358
+ "cat_id": 1000010058,
359
+ "name": "Behind The Design: Wildcat 3-in-1 Jacket",
360
+ "blurb": "Behind The Design: Wildcat 3-in-1 Jacket - editorial guide from L.L.Bean."
361
+ },
362
+ {
363
+ "cat_id": 1000010060,
364
+ "name": "How to Pack Your L.L.Bean \"Stowaway\" Jacket",
365
+ "blurb": "How to Pack Your L.L.Bean \"Stowaway\" Jacket - editorial guide from L.L.Bean."
366
+ },
367
+ {
368
+ "cat_id": 1000010061,
369
+ "name": "How to Use a Stowaway Pack Pouch",
370
+ "blurb": "How to Use a Stowaway Pack Pouch - editorial guide from L.L.Bean."
371
+ }
372
+ ]
tasks/llbean/environment/reference/clone/data/seed/home.json ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "sections": [
3
+ {
4
+ "key": "hero",
5
+ "kind": "hero",
6
+ "position": 0,
7
+ "heading": "SUMMER SAVINGS! UP TO 50% OFF WARM-WEATHER FAVORITES",
8
+ "sub": "ONLINE AND IN STORES. Prices as shown.",
9
+ "cta_label": "SHOP THE DEALS",
10
+ "cta_cat_id": 20011104,
11
+ "items": []
12
+ },
13
+ {
14
+ "key": "rewards-lead",
15
+ "kind": "lead",
16
+ "position": 1,
17
+ "heading": "Get More Bean for Your Buck",
18
+ "sub": "Join our NEW L.L.Bean Rewards program or take the benefits further with the L.L.Bean® Mastercard®.",
19
+ "cta_label": "LEARN MORE",
20
+ "cta_cat_id": 20010535,
21
+ "items": []
22
+ },
23
+ {
24
+ "key": "secondary-banners",
25
+ "kind": "banners",
26
+ "position": 2,
27
+ "items": []
28
+ },
29
+ {
30
+ "key": "boat-tote-video",
31
+ "kind": "video",
32
+ "position": 3,
33
+ "cta_label": "SHOP OUR SUMMER COLLECTION",
34
+ "cta_cat_id": 20011104,
35
+ "items": [],
36
+ "heading": "Best Worn to Make Summer Memories",
37
+ "sub": "Effortless styles designed to do it all."
38
+ },
39
+ {
40
+ "key": "deck-dock",
41
+ "kind": "cards",
42
+ "position": 4,
43
+ "heading": "For Deck, Dock & Beyond",
44
+ "items": [
45
+ {
46
+ "label": "Totes",
47
+ "cat_id": 514029,
48
+ "slug": "boat-and-tote-bags",
49
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Totes_Large.jpg",
50
+ "alt": "Canvas tote bag hanging on weathered wooden railing, labeled totes",
51
+ "asset": "/static/img/home/27f3909ab36330.jpg"
52
+ },
53
+ {
54
+ "label": "Women's Shirts & Tops",
55
+ "cat_id": 607,
56
+ "slug": null,
57
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/may_june_slider/Womens_Tees__Tanks_Large.jpg",
58
+ "alt": "Woman in pink long sleeve tee, faded blue baseball cap and blue jeans standing on beach under light blue skies",
59
+ "asset": "/static/img/home/c3bc1d62dfd40f.jpg"
60
+ },
61
+ {
62
+ "label": "Men's Shirts",
63
+ "cat_id": 589,
64
+ "slug": null,
65
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_Shirts_Large.jpg",
66
+ "alt": "A handsome gent in mauve plaid shirt leaning back to a window showing ocean blue water.",
67
+ "asset": "/static/img/home/d8e556d72c1b9c.jpg"
68
+ },
69
+ {
70
+ "label": "Women's Tees & Tanks",
71
+ "cat_id": 504209,
72
+ "slug": null,
73
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Womens_Tees__Tanks_Large.jpg",
74
+ "alt": "Brown haired woman in blue striped long sleeve tee shirt by water.",
75
+ "asset": "/static/img/home/2df8dcabe0d21a.jpg"
76
+ },
77
+ {
78
+ "label": "Men's T-Shirts & Polos",
79
+ "cat_id": 20010166,
80
+ "slug": null,
81
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_T-Shirts__Polos_Large.jpg",
82
+ "alt": "Man in light blue polo shirt standing near shoreline looking off to the side.",
83
+ "asset": "/static/img/home/d4841f7cfea88a.jpg"
84
+ },
85
+ {
86
+ "label": "Woman's Footwear",
87
+ "cat_id": 630,
88
+ "slug": null,
89
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Womens_Footwear_Large.jpg",
90
+ "alt": "A pair of brown ankle high L L Bean Boots casually resting on bicycle fender.",
91
+ "asset": "/static/img/home/a13a9215636208.jpg"
92
+ },
93
+ {
94
+ "label": "Men's Footwear",
95
+ "cat_id": 629,
96
+ "slug": null,
97
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_Footwear_Large.jpg",
98
+ "alt": "A pair of brown leather L L Bean Boots hanging from their laces next to rustic wood wall.",
99
+ "asset": "/static/img/home/a3e01dbae4081b.jpg"
100
+ },
101
+ {
102
+ "label": "Equipment",
103
+ "cat_id": 29,
104
+ "slug": null,
105
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Equipment_Large.jpg",
106
+ "alt": "Person in green airlight top holding blue water bottle outdoors near sandy ground.",
107
+ "asset": "/static/img/home/861f82f9d34e3f.jpg"
108
+ },
109
+ {
110
+ "label": "Women's Jeans",
111
+ "cat_id": 513283,
112
+ "slug": null,
113
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Womens_Pants_Large.jpg",
114
+ "alt": "Woman wearing blue jeans walking along rustic wooden fence with tall grass behind it.",
115
+ "asset": "/static/img/home/5df180e15f7670.jpg"
116
+ },
117
+ {
118
+ "label": "Men's Pants",
119
+ "cat_id": 502921,
120
+ "slug": null,
121
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_Pants_Large.jpg",
122
+ "alt": "Close view of man wearing tan pants with arms casually folded with ocean background.",
123
+ "asset": "/static/img/home/2835e0a303f0b9.jpg"
124
+ },
125
+ {
126
+ "label": "Women's Swimwear",
127
+ "cat_id": 624,
128
+ "slug": null,
129
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/may_june_slider/WsSwimwear_Large.jpg",
130
+ "alt": "Woman with long curly brown hair standing in shallow water in blue and white patterned swimsuit.",
131
+ "asset": "/static/img/home/f48186a69ed0cd.jpg"
132
+ },
133
+ {
134
+ "label": "Men's Swimwear",
135
+ "cat_id": 511548,
136
+ "slug": null,
137
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_Swimwear_Large.jpg",
138
+ "alt": "Man in blue swim trunks drying off with blue and teal beach towel on beach.",
139
+ "asset": "/static/img/home/fad7dc186446d3.jpg"
140
+ },
141
+ {
142
+ "label": "Women's Sun & Bug Protection",
143
+ "cat_id": 516715,
144
+ "slug": "sun-and-bug-protective-clothing",
145
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Womens_Sun__Bug_Protection_Large.jpg",
146
+ "alt": "Woman wearing a green long-sleeve top and neck gaiter, outdoors with rocky terrain and muted blue sky in the b",
147
+ "asset": "/static/img/home/169f649e88ade1.jpg"
148
+ },
149
+ {
150
+ "label": "Men's Sun & Bug Protection",
151
+ "cat_id": 516715,
152
+ "slug": "sun-and-bug-protective-clothing",
153
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_Sun__Bug_Protection_Large.jpg",
154
+ "alt": "Man in dark blue baseball cap walking outdoors with backpack.",
155
+ "asset": "/static/img/home/92b76931a2b897.jpg"
156
+ },
157
+ {
158
+ "label": "Women's Activewear",
159
+ "cat_id": 509757,
160
+ "slug": null,
161
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Womens_Activewear_Large.jpg",
162
+ "alt": "Woman in lavender althletic pullover near coastline misty blue skies.",
163
+ "asset": "/static/img/home/83f9ff3e42ae36.jpg"
164
+ },
165
+ {
166
+ "label": "Men's Activewear",
167
+ "cat_id": 509723,
168
+ "slug": null,
169
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/dy_1/july_august_category_library/Mens_Activewear_Large.jpg",
170
+ "alt": "Waist up view of a man stepping on coastal rocks wearing green pullover and shorts.",
171
+ "asset": "/static/img/home/1992d957a5f86e.jpg"
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "key": "behind-design",
177
+ "kind": "cards",
178
+ "position": 5,
179
+ "heading": "Behind the Design:",
180
+ "sub": "Get an insider’s look at some of our most celebrated products.",
181
+ "items": [
182
+ {
183
+ "label": "Behind the Design: Bug Protection Clothing",
184
+ "cat_id": 20010675,
185
+ "slug": "behind-the-design-bug-protection-clothing",
186
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_j_5_4_5_17/20010675_/Bug_Protection_Story_Tile_Large13rd.jpg",
187
+ "alt": "Close up of a person wearing a light tan L L Bean button up shirt with two chest pockets; video play icon over",
188
+ "asset": "/static/img/home/b5f5665956314d.jpg"
189
+ },
190
+ {
191
+ "label": "Behind the Design: The Casco Bay Boat Moc",
192
+ "cat_id": 20010611,
193
+ "slug": "behind-the-design-casco-bay-boat-shoes",
194
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_f_3_9_3_22/below_product_details_behind_the_design__casco_bay_boat_shoes__260318_/Casco_Bay_Boat_Moc_Story_Tile_Large13rd.jpg",
195
+ "alt": "Top view of boat shoes arranged on a wooden surface with a magazine and compass with play video icon.",
196
+ "asset": "/static/img/home/b9982c503a52b9.jpg"
197
+ },
198
+ {
199
+ "label": "Behind the Design: Airlight",
200
+ "cat_id": 20010674,
201
+ "slug": "behind-the-design-airlight-pullover",
202
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_i_4_20_5_3/20010674_behind_the_design__airlight_pullover__260428_/Airlight_Story_Tile_Large13rd.jpg",
203
+ "alt": "Plum-colored ribbed pullover with a snap-button collar and L L Bean logo, shown on a mannequin against black b",
204
+ "asset": "/static/img/home/182ed9f838742b.jpg"
205
+ }
206
+ ]
207
+ },
208
+ {
209
+ "key": "wirecutter",
210
+ "kind": "quotes",
211
+ "position": 6,
212
+ "heading": "NYT Wirecutter Picks",
213
+ "sub": "From unbeatably tough totes to ultra-cozy slippers, don’t miss the products everyone is talking about.",
214
+ "cta_label": "Shop All",
215
+ "cta_cat_id": 1000010392,
216
+ "items": [
217
+ {
218
+ "label": "The Best Beach Bag",
219
+ "blurb": "“Knockoffs of our picks proliferate...if you were to compare any of them with the real L.L.Bean Boat and Tote, it would be no contest.” — New York Times Wirecutter, 2025 Boat and To",
220
+ "cat_id": 33381,
221
+ "slug": null,
222
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/d1f6772ca42f.webp",
223
+ "alt": "Canvas beach tote bag with navy straps and beach essentials peeking out at the top.",
224
+ "asset": "/static/img/home/fba863d64f5fd0.webp"
225
+ },
226
+ {
227
+ "label": "The Best Percale Sheets",
228
+ "blurb": "“If you like a cool, crisp feel to your bedsheets, these are comfortable, very breathable, and reasonably priced.” — New York Times Wirecutter, 2025 Percale Sheets",
229
+ "cat_id": 1156,
230
+ "slug": "sheets",
231
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/feb6ba09830b.webp",
232
+ "alt": "Light blue percale bed sheets neatly folded on a made bed.",
233
+ "asset": "/static/img/home/fbde92f3c8643a.webp"
234
+ },
235
+ {
236
+ "label": "A Classic, Ultra-Durable Pack",
237
+ "blurb": "“The L.L.Bean packs are among the least expensive of the kids backpacks we’ve tested over the years, yet they’re also the most durable.” — New York Times Wirecutter, 2025",
238
+ "cat_id": 816,
239
+ "slug": "school-backpacks-and-lunch-boxes",
240
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/190f61ceac39.webp",
241
+ "alt": "Light blue backpack with multiple zippered pockets on a white background.",
242
+ "asset": "/static/img/home/54840a29c0acb6.webp"
243
+ },
244
+ {
245
+ "label": "The Best Rain Boots",
246
+ "blurb": "“If you want a boot that’s one of the most thoughtfully designed pieces of gear for being outdoors, this is the boot to choose.” — New York Times Wirecutter, 2024 Women's Bean Boot",
247
+ "cat_id": 129795,
248
+ "slug": null,
249
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/3783a3bc7024.webp",
250
+ "alt": "Person wearing tan lace-up rain boots with patterned socks visible above.",
251
+ "asset": "/static/img/home/ef0307044d016b.webp"
252
+ },
253
+ {
254
+ "label": "The Best Shearling Slippers for Cozy Comfort",
255
+ "blurb": "“With their combination of warmth, comfort, and durability, it’s no wonder these slippers have been a pick since 2016.” — New York Times Wirecutter, 2025 W",
256
+ "cat_id": 18664,
257
+ "slug": null,
258
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/5a7bc0265661.webp",
259
+ "alt": "Person wearing brown shearling-lined moccasin slippers with socks on their feet.",
260
+ "asset": "/static/img/home/f656352024e1a5.webp"
261
+ },
262
+ {
263
+ "label": "The Best Shearling Slippers for Cozy Comfort",
264
+ "blurb": "“With their combination of warmth, comfort, and durability, it’s no wonder these slippers have been a pick since 2016.” — New York Times Wirecutter, 2025 M",
265
+ "cat_id": 65637,
266
+ "slug": null,
267
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/723ecd138ed0.webp",
268
+ "alt": "Person wearing brown shearling-lined moccasin slippers with cuffed sweat pants.",
269
+ "asset": "/static/img/home/94e4fb0f9c2cf1.webp"
270
+ },
271
+ {
272
+ "label": "Well-Priced Men’s Flannel Pjs",
273
+ "blurb": "“They’re made from flannel that’s soft and cozy yet light. The Scotch Plaid PJs feel fluffy and familiar, like a perfectly worn-in flannel shirt.” — New York Times Wirecu",
274
+ "cat_id": 111738,
275
+ "slug": null,
276
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/91fbec87fa97.webp",
277
+ "alt": "Person in plaid pajamas and red slippers sitting cross-legged on gray background.",
278
+ "asset": "/static/img/home/f6d9b872f9a593.webp"
279
+ },
280
+ {
281
+ "label": "The Coziest Fleece",
282
+ "blurb": "“This fluffy throw is warm and inviting, and tough enough to last for years.” — New York Times Wirecutter, 2025 Wicked Plush Throw",
283
+ "cat_id": 113434,
284
+ "slug": null,
285
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/f4fcc4246089.jpg",
286
+ "alt": "Folded plush throws in red, pink, gray, beige, and blue stacked neatly.",
287
+ "asset": "/static/img/home/968618e40739a2.jpg"
288
+ },
289
+ {
290
+ "label": "A Classic, Reliable Insulated Lunch Box",
291
+ "blurb": "“This roomy, soft-sided insulated lunch box is made of rugged materials, and it fits nicely in a backpack. It’s also easier to clean than many competitors.” — N",
292
+ "cat_id": 70705,
293
+ "slug": null,
294
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/6291cfd0f02f.jpg",
295
+ "alt": "",
296
+ "asset": "/static/img/home/787dc3ea4cbdf7.jpg"
297
+ },
298
+ {
299
+ "label": "The Best Flannel Sheets",
300
+ "blurb": "“Supersoft, well-made, and reasonably priced, these flannel sheets will keep most people toasty and happy on cold winter nights.” — New York Times Wirecutter, 2025 Ultrasoft Co",
301
+ "cat_id": 1156,
302
+ "slug": "sheets",
303
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/1503e545f4ad.webp",
304
+ "alt": "Plaid flannel bedding with pillows arranged on a bed in neutral tones.",
305
+ "asset": "/static/img/home/d497babc490e68.webp"
306
+ },
307
+ {
308
+ "label": "The Best Rain Boots",
309
+ "blurb": "“If you want a boot that’s one of the most thoughtfully designed pieces of gear for being outdoors, this is the boot to choose.” — New York Times Wirecutter, 2024 Men's Bean Boots",
310
+ "cat_id": 129628,
311
+ "slug": null,
312
+ "img": "https://cdn.dynamicyield.com/api/8788199/images/22acc883c4f9.webp",
313
+ "alt": "Person wearing tan lace-up rain boots with dark rubber soles.",
314
+ "asset": "/static/img/home/d803ce27975ebb.webp"
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "key": "bean-outsider",
320
+ "kind": "ugc",
321
+ "position": 7,
322
+ "heading": "Share your adventures with #BeanOutsider",
323
+ "items": [
324
+ {
325
+ "label": "Two woman hiking across a river",
326
+ "cat_id": 518571,
327
+ "slug": null,
328
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/adventure_trips_activity_Large25.jpg",
329
+ "alt": "Two woman hiking across a river",
330
+ "asset": "/static/img/home/438e2310f5df7f.jpg"
331
+ },
332
+ {
333
+ "label": "A woman kayaking with a city view in the background",
334
+ "cat_id": 518571,
335
+ "slug": null,
336
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/kayaking_activity_Large25.jpg",
337
+ "alt": "A woman kayaking with a city view in the background",
338
+ "asset": "/static/img/home/9cc2c99cb07740.jpg"
339
+ },
340
+ {
341
+ "label": "A woman on a paddleboard",
342
+ "cat_id": 518571,
343
+ "slug": null,
344
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/paddleboarding_activity_Large25.jpg",
345
+ "alt": "A woman on a paddleboard",
346
+ "asset": "/static/img/home/46148481bd9e92.jpg"
347
+ },
348
+ {
349
+ "label": "Two people walking through the woods",
350
+ "cat_id": 518571,
351
+ "slug": null,
352
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/hiking_activity_Large25.jpg",
353
+ "alt": "Two people walking through the woods",
354
+ "asset": "/static/img/home/48e6e9fcafe446.jpg"
355
+ },
356
+ {
357
+ "label": "Two people moutain biking in the woods",
358
+ "cat_id": 518571,
359
+ "slug": null,
360
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/mountain_biking_activity_Large25.jpg",
361
+ "alt": "Two people moutain biking in the woods",
362
+ "asset": "/static/img/home/903b432c8e92ce.jpg"
363
+ },
364
+ {
365
+ "label": "A young man learning to fly fish",
366
+ "cat_id": 518571,
367
+ "slug": null,
368
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/fishing_activity_Large25.jpg",
369
+ "alt": "A young man learning to fly fish",
370
+ "asset": "/static/img/home/81e9700eb4e753.jpg"
371
+ }
372
+ ],
373
+ "sub": "Tag us for a chance to be featured."
374
+ },
375
+ {
376
+ "key": "top-picks",
377
+ "kind": "recommendations",
378
+ "position": 8,
379
+ "heading": "Today's Top Picks",
380
+ "items": []
381
+ },
382
+ {
383
+ "key": "pick-up",
384
+ "kind": "recently-viewed",
385
+ "position": 9,
386
+ "heading": "Pick Up Where You Left Off",
387
+ "items": []
388
+ },
389
+ {
390
+ "key": "free-shipping",
391
+ "kind": "shipping",
392
+ "position": 10,
393
+ "heading": "FREE SHIPPING with $50 purchase for L.L.Bean Rewards members - or - FREE SHIPPING - no minimum order - with the L.L.Bean® Mastercard®.",
394
+ "items": []
395
+ },
396
+ {
397
+ "key": "more-favorites",
398
+ "kind": "links",
399
+ "position": 11,
400
+ "heading": "MORE L.L.BEAN FAVORITES",
401
+ "items": [
402
+ {
403
+ "label": "DUCK BOOTS",
404
+ "cat_id": 506697,
405
+ "slug": "footwear-llbean-boots"
406
+ },
407
+ {
408
+ "label": "MEN’S SLIPPERS",
409
+ "cat_id": 503380,
410
+ "slug": "mens-slippers"
411
+ },
412
+ {
413
+ "label": "WOMEN’S SLIPPERS",
414
+ "cat_id": 503422,
415
+ "slug": "womens-slippers"
416
+ },
417
+ {
418
+ "label": "MEN’S FLANNEL SHIRTS",
419
+ "cat_id": 505538,
420
+ "slug": "mens-flannel-chamois-and-lined-shirts"
421
+ },
422
+ {
423
+ "label": "WOMEN’S PIMA COTTON TEES",
424
+ "cat_id": 514124,
425
+ "slug": null
426
+ },
427
+ {
428
+ "label": "INSIDE L.L.BEAN",
429
+ "cat_id": 517561,
430
+ "slug": null
431
+ }
432
+ ]
433
+ }
434
+ ],
435
+ "video": "https://www.llbean.net/firstspirit/media/videos/0_hp/260603-Homepage-BoatandTote-Delivered.mp4?nav=F2DCBS12189ibX-hp",
436
+ "video_asset": "/static/video/boat-and-tote.mp4"
437
+ }
tasks/llbean/environment/reference/clone/data/seed/landers.json ADDED
@@ -0,0 +1,734 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "518571": {
3
+ "cat_id": 518571,
4
+ "title": "Outdoor Experiences",
5
+ "h1": "Outdoor Experiences",
6
+ "intro": "Outdoor Experiences We always have something exciting planned! Check back often to see what\u2019s happening in our home state of Maine, on the road, out in nature, and right outside your door!",
7
+ "sections": [
8
+ {
9
+ "heading": null,
10
+ "view_all": null,
11
+ "items": [
12
+ {
13
+ "label": "EVENTS & ACTIVITIES",
14
+ "cat_id": 518363,
15
+ "slug": "events-and-experiences",
16
+ "blurb": "",
17
+ "img": null,
18
+ "alt": null,
19
+ "external": false
20
+ },
21
+ {
22
+ "label": "BOOTMOBILE",
23
+ "cat_id": 518708,
24
+ "slug": "bootmobile",
25
+ "blurb": "",
26
+ "img": null,
27
+ "alt": null,
28
+ "external": false
29
+ },
30
+ {
31
+ "label": "OUTDOOR DISCOVERY PROGRAMS",
32
+ "cat_id": null,
33
+ "slug": null,
34
+ "blurb": "",
35
+ "img": null,
36
+ "alt": null,
37
+ "external": true
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ "heading": "Get More Outdoors",
43
+ "prose": "Get More Outdoors Our expert-led experiences won\u2019t just help you get outside more. They\u2019ll help you get more from being outside.Check out all the activities and adventures we have to offer!",
44
+ "items": []
45
+ },
46
+ {
47
+ "heading": null,
48
+ "view_all": null,
49
+ "items": [
50
+ {
51
+ "label": "OVERNIGHT TRIPS",
52
+ "cat_id": null,
53
+ "slug": null,
54
+ "blurb": "",
55
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/adventure_trips_activity_XL25.jpg",
56
+ "alt": "Two woman hiking across a river",
57
+ "external": true,
58
+ "asset": "/static/img/lander/b362d0561e67c0.jpg"
59
+ },
60
+ {
61
+ "label": "KIDS' CAMPS",
62
+ "cat_id": null,
63
+ "slug": null,
64
+ "blurb": "",
65
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/kids_camp_activity_XL25.jpg",
66
+ "alt": "A group of children snowshoeing",
67
+ "external": true,
68
+ "asset": "/static/img/lander/8b152af352b571.jpg"
69
+ },
70
+ {
71
+ "label": "FLY CASTING & FISHING",
72
+ "cat_id": null,
73
+ "slug": null,
74
+ "blurb": "",
75
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/fishing_activity_XL25.jpg",
76
+ "alt": "A young man learning to fly fish",
77
+ "external": true,
78
+ "asset": "/static/img/lander/b478b210b3e012.jpg"
79
+ },
80
+ {
81
+ "label": "KAYAKING",
82
+ "cat_id": null,
83
+ "slug": null,
84
+ "blurb": "",
85
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/kayaking_activity_XL25.jpg",
86
+ "alt": "A woman kayaking with a city view in the background",
87
+ "external": true,
88
+ "asset": "/static/img/lander/73ca6c7b859dff.jpg"
89
+ },
90
+ {
91
+ "label": "STAND-UP PADDLEBOARDING",
92
+ "cat_id": null,
93
+ "slug": null,
94
+ "blurb": "",
95
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/paddleboarding_activity_XL25.jpg",
96
+ "alt": "A woman on a paddleboard",
97
+ "external": true,
98
+ "asset": "/static/img/lander/020198ae9f296d.jpg"
99
+ },
100
+ {
101
+ "label": "ARCHERY",
102
+ "cat_id": null,
103
+ "slug": null,
104
+ "blurb": "",
105
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/archery_activity_XL25.jpg",
106
+ "alt": "A mom helping her daughter with a bow and arrow",
107
+ "external": true,
108
+ "asset": "/static/img/lander/7f8c64e05e56ea.jpg"
109
+ },
110
+ {
111
+ "label": "CROSS-COUNTRY SKIING",
112
+ "cat_id": null,
113
+ "slug": null,
114
+ "blurb": "",
115
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/xc_ski_activity_XL25.jpg",
116
+ "alt": "A group cross-country skiing",
117
+ "external": true,
118
+ "asset": "/static/img/lander/0fab727b195e85.jpg"
119
+ },
120
+ {
121
+ "label": "SNOWSHOEING",
122
+ "cat_id": null,
123
+ "slug": null,
124
+ "blurb": "",
125
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/snowshoe_activity_XL25.jpg",
126
+ "alt": "Two people snowshoeing",
127
+ "external": true,
128
+ "asset": "/static/img/lander/051e74bab0284a.jpg"
129
+ },
130
+ {
131
+ "label": "HIKING",
132
+ "cat_id": null,
133
+ "slug": null,
134
+ "blurb": "",
135
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/hiking_activity_XL25.jpg",
136
+ "alt": "Two people walking through the woods",
137
+ "external": true,
138
+ "asset": "/static/img/lander/22bf328ec43596.jpg"
139
+ },
140
+ {
141
+ "label": "TEAM BUILDING & CUSTOM PROGRAMS",
142
+ "cat_id": null,
143
+ "slug": null,
144
+ "blurb": "",
145
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/team_XL25.jpg",
146
+ "alt": "Team on the top of a ropes course",
147
+ "external": true,
148
+ "asset": "/static/img/lander/33c155a0587165.jpg"
149
+ },
150
+ {
151
+ "label": "ADVENTURES FOR WOMEN",
152
+ "cat_id": null,
153
+ "slug": null,
154
+ "blurb": "",
155
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/women-only_activity_XL25.jpg",
156
+ "alt": "Women out on kayaks",
157
+ "external": true,
158
+ "asset": "/static/img/lander/078422896ae8b1.jpg"
159
+ },
160
+ {
161
+ "label": "SHOOTING SPORTS",
162
+ "cat_id": null,
163
+ "slug": null,
164
+ "blurb": "",
165
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/shootingsports3_activity_XL25.jpg",
166
+ "alt": "Group of men clay shooting",
167
+ "external": true,
168
+ "asset": "/static/img/lander/3ab9e80feb63ad.jpg"
169
+ },
170
+ {
171
+ "label": "BIRD WATCHING",
172
+ "cat_id": null,
173
+ "slug": null,
174
+ "blurb": "",
175
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/birdwatching_activity_XL25.jpg",
176
+ "alt": "Mom and dad bird watching with their daughter",
177
+ "external": true,
178
+ "asset": "/static/img/lander/ad9f7c9c91eb71.jpg"
179
+ },
180
+ {
181
+ "label": "BIKING",
182
+ "cat_id": null,
183
+ "slug": null,
184
+ "blurb": "",
185
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/mountain_biking_activity_XL25.jpg",
186
+ "alt": "Two people moutain biking in the woods",
187
+ "external": true,
188
+ "asset": "/static/img/lander/f4e208e830100d.jpg"
189
+ },
190
+ {
191
+ "label": "FIRST AID & CERTIFICATIONS",
192
+ "cat_id": null,
193
+ "slug": null,
194
+ "blurb": "",
195
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/odp/first_aid_activity_XL25.jpg",
196
+ "alt": "People performing wilderness first aid",
197
+ "external": true,
198
+ "asset": "/static/img/lander/847a7ada0862d1.jpg"
199
+ }
200
+ ]
201
+ },
202
+ {
203
+ "heading": null,
204
+ "prose": "Share your adventures with #BeanOutsider",
205
+ "items": []
206
+ }
207
+ ]
208
+ },
209
+ "518342": {
210
+ "cat_id": 518342,
211
+ "title": "Explore L.L.Bean",
212
+ "h1": "Explore L.L.Bean",
213
+ "intro": "Explore L.L.Bean Great products make it easier to get outside. Great advice can too. Welcome to the ultimate destination for expert ideas, inspiring stories, and how-to guides for everything you aspire to do \u2013 and be \u2013 outside.",
214
+ "sections": [
215
+ {
216
+ "heading": null,
217
+ "view_all": null,
218
+ "items": [
219
+ {
220
+ "label": "Behind The Design: Wildcat 3-in-1 Jacket",
221
+ "cat_id": 1000010058,
222
+ "slug": "behind-the-design-wildcat-3-in-1-jacket",
223
+ "blurb": "Rob, a merchant manager at L.L.Bean, takes us on a deep dive into the Wildcat 3-in-1 Jacket: one versatile, feature-rich winter jacket that can truly do it all.",
224
+ "img": null,
225
+ "alt": null,
226
+ "external": false
227
+ },
228
+ {
229
+ "label": "Behind the Design: Bean Boots",
230
+ "cat_id": 516565,
231
+ "slug": "behind-the-design-bean-boots",
232
+ "blurb": "Brent, a product development manager at L.L.Bean, takes us on a deep dive through the history \u2013 and latest evolution \u2013 of the boot that started it all, the Bean Boot.",
233
+ "img": null,
234
+ "alt": null,
235
+ "external": false
236
+ }
237
+ ]
238
+ },
239
+ {
240
+ "heading": "Browse by Activity",
241
+ "view_all": null,
242
+ "items": [
243
+ {
244
+ "label": "Camping",
245
+ "cat_id": 517669,
246
+ "slug": "camping",
247
+ "blurb": "",
248
+ "img": null,
249
+ "alt": null,
250
+ "external": false
251
+ },
252
+ {
253
+ "label": "Fishing",
254
+ "cat_id": 517668,
255
+ "slug": "fishing",
256
+ "blurb": "",
257
+ "img": null,
258
+ "alt": null,
259
+ "external": false
260
+ },
261
+ {
262
+ "label": "Hiking",
263
+ "cat_id": 517667,
264
+ "slug": "hiking",
265
+ "blurb": "",
266
+ "img": null,
267
+ "alt": null,
268
+ "external": false
269
+ },
270
+ {
271
+ "label": "Home & Backyard",
272
+ "cat_id": 517932,
273
+ "slug": "home-and-backyard",
274
+ "blurb": "",
275
+ "img": null,
276
+ "alt": null,
277
+ "external": false
278
+ },
279
+ {
280
+ "label": "Summer",
281
+ "cat_id": 518837,
282
+ "slug": "summer",
283
+ "blurb": "",
284
+ "img": null,
285
+ "alt": null,
286
+ "external": false
287
+ },
288
+ {
289
+ "label": "Paddling",
290
+ "cat_id": 517670,
291
+ "slug": "paddling",
292
+ "blurb": "",
293
+ "img": null,
294
+ "alt": null,
295
+ "external": false
296
+ },
297
+ {
298
+ "label": "Kids",
299
+ "cat_id": 518288,
300
+ "slug": "kids",
301
+ "blurb": "",
302
+ "img": null,
303
+ "alt": null,
304
+ "external": false
305
+ },
306
+ {
307
+ "label": "Hunting",
308
+ "cat_id": 517984,
309
+ "slug": "hunting",
310
+ "blurb": "",
311
+ "img": null,
312
+ "alt": null,
313
+ "external": false
314
+ },
315
+ {
316
+ "label": "Winter",
317
+ "cat_id": 517671,
318
+ "slug": "winter",
319
+ "blurb": "",
320
+ "img": null,
321
+ "alt": null,
322
+ "external": false
323
+ }
324
+ ]
325
+ },
326
+ {
327
+ "heading": "How-To Guides",
328
+ "view_all": {
329
+ "cat_id": 518831,
330
+ "slug": "how-to-guides"
331
+ },
332
+ "items": [
333
+ {
334
+ "label": "How to Use L.L.Bean Grow-Cuffs",
335
+ "cat_id": 20010245,
336
+ "slug": "how-to-use-llbean-grow-cuffs",
337
+ "blurb": "",
338
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_v_10_20_11_2/20010245_how_to_use_grow_cuffs__251021_/Grow_Cuffs_Story_Tile_XL25.jpg",
339
+ "alt": "Hand adjusts Velcro strap on dark blue jacket cuff with teal accent; play button icon appears over image.",
340
+ "external": false,
341
+ "asset": "/static/img/lander/4fed9c5cd89018.jpg"
342
+ },
343
+ {
344
+ "label": "4 Ways to Lace Up Your Bean Boots",
345
+ "cat_id": 20010246,
346
+ "slug": "4-ways-to-lace-up-your-bean-boots",
347
+ "blurb": "",
348
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_w_11_3_11_16/20010246_how_to_care_for_cashmere__251104_/Laces_Story_Tile_XL25.jpg",
349
+ "alt": "Hand adjusts the laces of the L L Bean Boot; play button icon appears over image.",
350
+ "external": false,
351
+ "asset": "/static/img/lander/83c7662c215519.jpg"
352
+ },
353
+ {
354
+ "label": "How to Keep Dogs Warm Outside",
355
+ "cat_id": 518824,
356
+ "slug": "how-to-keep-dogs-warm-outside",
357
+ "blurb": "",
358
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_y_11_20_12_3/518824_how_to_keep_dogs_warm_outside_231124/518824_StoryTile_XL25.jpg",
359
+ "alt": "A woman wearing a backpack and 2 dogs wearing orange jackets atop a wintery mountain.",
360
+ "external": false,
361
+ "asset": "/static/img/lander/17f80ea6309d2b.jpg"
362
+ },
363
+ {
364
+ "label": "Ice Skating Tips for Beginners",
365
+ "cat_id": 518753,
366
+ "slug": "ice-skating-tips-for-beginners",
367
+ "blurb": "",
368
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_e_1/518753_ice_skating_tips_for_beginners_230214/518753_VIDEO_STORY_TILE_XL25.jpg",
369
+ "alt": "Wyoma demonstrating beginner ice skating technique.",
370
+ "external": false,
371
+ "asset": "/static/img/lander/9e09c44541fb7e.jpg"
372
+ },
373
+ {
374
+ "label": "Cold Weather Camping Tips",
375
+ "cat_id": 518724,
376
+ "slug": "cold-weather-camping",
377
+ "blurb": "",
378
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_u_1/518724_V_ColdWeatherCamping_ST_XL25.jpg",
379
+ "alt": "MacKenzie smiling in a sleeping bag, text: How To: Cold Weather Camping Tips and the L.L.Bean logo.",
380
+ "external": false,
381
+ "asset": "/static/img/lander/8463aa3d8eda44.jpg"
382
+ },
383
+ {
384
+ "label": "How to Start a Campfire",
385
+ "cat_id": 518758,
386
+ "slug": "how-to-start-a-campfire",
387
+ "blurb": "",
388
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_q_7_31_8_13/518758_how_to_start_a_campfire_230810/518758_VIDEO_STORY_TILE_XL25.jpg",
389
+ "alt": "Nate sitting in front of a fire at a campsite.",
390
+ "external": false,
391
+ "asset": "/static/img/lander/3dff22a6954f1c.jpg"
392
+ },
393
+ {
394
+ "label": "3 Types of Campfires: How & When to Build Them",
395
+ "cat_id": 518827,
396
+ "slug": "3-types-of-campfires-how-and-when-to-build-them",
397
+ "blurb": "",
398
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_r_8_14_8_27/xxxxxx_3_types_of_campfires_230817/518827_VIDEO_STORY_TILE_XL25.jpg",
399
+ "alt": "A just lit lean-to fire in a fire ring.",
400
+ "external": false,
401
+ "asset": "/static/img/lander/de745c53a44b98.jpg"
402
+ },
403
+ {
404
+ "label": "Cross-Country Skiing Tips & Tricks for Beginners",
405
+ "cat_id": 518621,
406
+ "slug": "5-essential-cross-country-skiing-techniques-you-should-know",
407
+ "blurb": "",
408
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_c/518621_xc_tips_update_/518621_V_XCountrySkiTips_ST_XL25.jpg",
409
+ "alt": "L.L.Bean Outdoor Discovery Programs instructor demonstrating downhill technique on cross-country skis.",
410
+ "external": false,
411
+ "asset": "/static/img/lander/8cf8070e4239e3.jpg"
412
+ },
413
+ {
414
+ "label": "View All How-To Guides",
415
+ "cat_id": 518831,
416
+ "slug": "how-to",
417
+ "blurb": "",
418
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_HowToGuides_XL25.jpg",
419
+ "alt": "Text \"View All How-To Guides\" with gray background and white outdoor icons.",
420
+ "external": false,
421
+ "asset": "/static/img/lander/21572fcd0f396d.jpg"
422
+ }
423
+ ]
424
+ },
425
+ {
426
+ "heading": "Buying Guides",
427
+ "view_all": {
428
+ "cat_id": 518832,
429
+ "slug": "buying-guides"
430
+ },
431
+ "items": [
432
+ {
433
+ "label": "Behind the Design: Bug Protection Clothing",
434
+ "cat_id": 20010675,
435
+ "slug": "behind-the-design-bug-protection-clothing",
436
+ "blurb": "",
437
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_j_5_4_5_17/20010675_/Bug_Protection_Story_Tile_XL25.jpg",
438
+ "alt": "Close up of a person wearing a light tan L L Bean button up shirt with two chest pockets; video play icon overlay.",
439
+ "external": false,
440
+ "asset": "/static/img/lander/e4ce68980e73fb.jpg"
441
+ },
442
+ {
443
+ "label": "Behind the Design: Airlight",
444
+ "cat_id": 20010674,
445
+ "slug": "behind-the-design-airlight-pullover",
446
+ "blurb": "",
447
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_i_4_20_5_3/20010674_behind_the_design__airlight_pullover__260428_/Airlight_Story_Tile_XL25.jpg",
448
+ "alt": "Plum-colored ribbed pullover with a snap-button collar and L L Bean logo, shown on a mannequin against black background ",
449
+ "external": false,
450
+ "asset": "/static/img/lander/2d824689bea65f.jpg"
451
+ },
452
+ {
453
+ "label": "Behind the Design: The Casco Bay Boat Moc",
454
+ "cat_id": 20010611,
455
+ "slug": "behind-the-design-casco-bay-boat-shoes",
456
+ "blurb": "",
457
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_f_3_9_3_22/below_product_details_behind_the_design__casco_bay_boat_shoes__260318_/Casco_Bay_Boat_Moc_Story_Tile_XL25.jpg",
458
+ "alt": "Top view of boat shoes arranged on a wooden surface with a magazine and compass with play video icon.",
459
+ "external": false,
460
+ "asset": "/static/img/lander/2b365afd9f3a3d.jpg"
461
+ },
462
+ {
463
+ "label": "Behind the Design: The Original Field Coat",
464
+ "cat_id": 20010610,
465
+ "slug": "behind-the-design-the-original-field-coat",
466
+ "blurb": "",
467
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2026/branded_content_7/omni_e_2_23_3_8/20010610_/Field_Coat_Story_Tile_XL25.jpg",
468
+ "alt": "Vintage tan L L Bean coat on a hanger in a rustic room with gear and d\u00e9cor in the background.",
469
+ "external": false,
470
+ "asset": "/static/img/lander/f835ec17fb03c1.jpg"
471
+ },
472
+ {
473
+ "label": "Behind the Design: Wicked Good Slippers",
474
+ "cat_id": 20010584,
475
+ "slug": "behind-the-design-wicked-good-slippers",
476
+ "blurb": "",
477
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_y_12_1_12_14/20010584_/Wicked_Good_Story_Tile_XL25.jpg",
478
+ "alt": "Pair of tan suede moccasin slippers with white fleece lining and a play icon overlay.",
479
+ "external": false,
480
+ "asset": "/static/img/lander/2cded41a6aae77.jpg"
481
+ },
482
+ {
483
+ "label": "Behind the Design: Insulated Utility Jacket",
484
+ "cat_id": 1000010056,
485
+ "slug": "behind-the-design-beans-insulated-utility-jacket",
486
+ "blurb": "",
487
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_a_12_30_1_12/1000010056_info_series_1_utility_ow_241120/1000010056_Storytile_XL25.jpg",
488
+ "alt": "The L L Bean Insulated Utility Jacket shown on form with a play video icon in the center",
489
+ "external": false,
490
+ "asset": "/static/img/lander/d8071d4ad77626.jpg"
491
+ },
492
+ {
493
+ "label": "Behind the Design: Wind Challenger",
494
+ "cat_id": 1000010057,
495
+ "slug": null,
496
+ "blurb": "",
497
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_y_11_18_12_8/1000010057_info_series_2_wind_challenger_241204/1000010057_VIDEO_STORY_TILE_XL25.jpg",
498
+ "alt": "The L L Bean Wind Challenger Jacket shown on form with a play video icon in the center",
499
+ "external": false,
500
+ "asset": "/static/img/lander/7e08131b54f141.jpg"
501
+ },
502
+ {
503
+ "label": "What to Wear on a Run in the Cold",
504
+ "cat_id": 518825,
505
+ "slug": "what-to-wear-on-a-run-in-the-cold",
506
+ "blurb": "",
507
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_y_11_20_12_3/518825_what_to_wear_on_a_run_in_the_cold_231207/518825_STORY_TILE_XL25.jpg",
508
+ "alt": "A man and a woman running on a snow-covered road.",
509
+ "external": false,
510
+ "asset": "/static/img/lander/b05f337f7a765c.jpg"
511
+ },
512
+ {
513
+ "label": "Hiking Footwear Buying Guide",
514
+ "cat_id": 518851,
515
+ "slug": "hiking-boot-buying-guide",
516
+ "blurb": "",
517
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_e_2_24_3_9/518851_hiking_footwear_buying_guide/518851_STORY_TILE_XL25.jpg",
518
+ "alt": "A close-up of hiking footwear on a person walking across rocks.",
519
+ "external": false,
520
+ "asset": "/static/img/lander/c6be0802099545.jpg"
521
+ },
522
+ {
523
+ "label": "View All Buying Guides",
524
+ "cat_id": 518832,
525
+ "slug": "buying-guides",
526
+ "blurb": "",
527
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_BuyingGuides_XL25.jpg",
528
+ "alt": "Text \"View All Buying Guides\" with gray background and white outdoor icons.",
529
+ "external": false,
530
+ "asset": "/static/img/lander/55e382f681b043.jpg"
531
+ }
532
+ ]
533
+ },
534
+ {
535
+ "heading": "Ideas & Inspiration",
536
+ "view_all": {
537
+ "cat_id": 518618,
538
+ "slug": "ideas-and-inspiration"
539
+ },
540
+ "items": [
541
+ {
542
+ "label": "Easy Campfire Recipes: Dutch Oven Lasagna",
543
+ "cat_id": 20010401,
544
+ "slug": "easy-campfire-recipes-dutch-oven-lasagna",
545
+ "blurb": "",
546
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_t_9_22_10_5/20010243_camping_recipe_series__lasagna__250923_/Lasagna_Story_Tile_copy_XL25.jpg",
547
+ "alt": "A dutch oven filled with baked lasagna with melted cheese and tomato sauce on a red checkered tablecloth with video play",
548
+ "external": false,
549
+ "asset": "/static/img/lander/ed655cf80e97f9.jpg"
550
+ },
551
+ {
552
+ "label": "Easy Campfire Recipes: Dutch Oven Cinnamon Rolls",
553
+ "cat_id": 20010400,
554
+ "slug": "easy-campfire-recipes-dutch-oven-cinnamon-rolls",
555
+ "blurb": "",
556
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_s_9_8_9_21/20010243_camping_recipe_series__cinnamon_rolls__250916_/Cinnamon_Rolls_Story_Tile_copy_XL25.jpg",
557
+ "alt": "Cinnamon roll cake with white icing on a wooden board, play button overlay in center, blue plate partially visible.",
558
+ "external": false,
559
+ "asset": "/static/img/lander/e22c9ccba230d0.jpg"
560
+ },
561
+ {
562
+ "label": "Easy Camping Recipes: Blueberry Cobbler",
563
+ "cat_id": 1000010018,
564
+ "slug": null,
565
+ "blurb": "",
566
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_s_8_26_9_8/1000010018_easy_camp_recipe_dessert_240827/240827_Storytile_XL25.jpg",
567
+ "alt": "A skillet with blueberry cobbler topped with a dollop of whipped cream on a tablecloth with a play video icon in the cen",
568
+ "external": false,
569
+ "asset": "/static/img/lander/84e841ff317f98.jpg"
570
+ },
571
+ {
572
+ "label": "Easy Camping Recipes: Camp Veggie Curry",
573
+ "cat_id": 1000010016,
574
+ "slug": null,
575
+ "blurb": "",
576
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_q_7_29_8_11/240730_camping_recipe_2/1000010016_Story_Tile_XL25.jpg",
577
+ "alt": "A bowl of curried vegetables sitting on a red and white checkered tablecloth.",
578
+ "external": false,
579
+ "asset": "/static/img/lander/84a3081c325240.jpg"
580
+ },
581
+ {
582
+ "label": "Life-Changing Experiences at a Little-Known National Park",
583
+ "cat_id": 518650,
584
+ "slug": "interview-with-a-national-park-ranger",
585
+ "blurb": "",
586
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_h/rangerinterview/MichellWoulard_STORY_TILE_XL25.jpg",
587
+ "alt": "Interpretive Ranger Michell Woulard",
588
+ "external": false,
589
+ "asset": "/static/img/lander/3d9f600f383758.jpg"
590
+ },
591
+ {
592
+ "label": "Easy Camping Recipes: Camp Skillet Frittata",
593
+ "cat_id": 1000010015,
594
+ "slug": null,
595
+ "blurb": "",
596
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_p_7_15_7_28/xxxxxx_camping_recipe_1_240716/100_240716_VIDEO_STORY_TILE.jpg6_XL25.jpg",
597
+ "alt": "A frittata in a cast iron skillet sits on a picnic table.",
598
+ "external": false,
599
+ "asset": "/static/img/lander/9499c853a18305.jpg"
600
+ },
601
+ {
602
+ "label": "Discover the Power of Parks",
603
+ "cat_id": 518367,
604
+ "slug": "national-park-foundation",
605
+ "blurb": "",
606
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/branded_content_2/210416_national_parks/210417_NPF_tile_XL25.jpg",
607
+ "alt": "A beautiful rock formation against a bright blue sky with a Zion National Park entrance sign in the foreground.",
608
+ "external": false,
609
+ "asset": "/static/img/lander/7e05a03f638e0b.jpg"
610
+ },
611
+ {
612
+ "label": "10 Best Hikes with Waterfalls",
613
+ "cat_id": 518409,
614
+ "slug": "10-best-hikes-with-waterfalls",
615
+ "blurb": "",
616
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2021/branded_content_2/jog_10/518409_10_waterfall_hikes/518409_tile_XL25.jpg",
617
+ "alt": "Yellowstone National Park Waterfall and double rainbow.",
618
+ "external": false,
619
+ "asset": "/static/img/lander/4356570328ccc6.jpg"
620
+ },
621
+ {
622
+ "label": "View All Ideas & Inspiration",
623
+ "cat_id": 518618,
624
+ "slug": "ideas-and-inspiration",
625
+ "blurb": "",
626
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_IdeasInspo_XL25.jpg",
627
+ "alt": "Text \"View All Ideas & Inspiration\" with gray background and white outdoor icons.",
628
+ "external": false,
629
+ "asset": "/static/img/lander/5e957e4278ba2b.jpg"
630
+ }
631
+ ]
632
+ },
633
+ {
634
+ "heading": "Product Use & Care",
635
+ "view_all": {
636
+ "cat_id": 518836,
637
+ "slug": "product-use-and-care"
638
+ },
639
+ "items": [
640
+ {
641
+ "label": "How to Use a Stowaway Pack Pouch",
642
+ "cat_id": 1000010061,
643
+ "slug": "how-to-use-the-llbean-stowaway-pack-pocket",
644
+ "blurb": "",
645
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_d_/1000010061_how_to_use_a_stowaway_pack_pouch_250219/1000010061_VIDEO_STORY_TILE.jpg_XL25.jpg",
646
+ "alt": "A teal stowaway pack shown in two different ways: laid out flat and stowed away in it's own pouch.",
647
+ "external": false,
648
+ "asset": "/static/img/lander/c8cdd386a85c5d.jpg"
649
+ },
650
+ {
651
+ "label": "How to Pack Your L.L.Bean \"Stowaway\" Jacket",
652
+ "cat_id": 1000010060,
653
+ "slug": "how-to-pack-your-llbean-stowaway-jacket",
654
+ "blurb": "",
655
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/omni_c_1_27_/1000010060_how_to_pack_your_llb_stowaway_jacket_250205/1000010022_VIDEO_STORY_TILE.jpg_XL25.jpg",
656
+ "alt": "A blue stowaway jacket shown in two different ways: laid out flat and stowed away in it's own pouch.",
657
+ "external": false,
658
+ "asset": "/static/img/lander/a167d6e6180cb1.jpg"
659
+ },
660
+ {
661
+ "label": "10 Unexpected Ways to Use Your Boat & Tote",
662
+ "cat_id": 518822,
663
+ "slug": "10-unexpected-ways-to-use-your-boat-and-tote",
664
+ "blurb": "",
665
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2024/branded_content_5/omni_j_4_22_5_5/240501_10_ways_to_use_your_boat___tote/100_518822_VIDEO_STORY_TILE.jpg6_XL25.jpg",
666
+ "alt": "Stephanie standing behind a red-handled Boat & Tote, a play video icon in the center.",
667
+ "external": false,
668
+ "asset": "/static/img/lander/01b2e2cc3b3d7b.jpg"
669
+ },
670
+ {
671
+ "label": "How to Clean a Dog Bed",
672
+ "cat_id": 518756,
673
+ "slug": "how-to-clean-a-dog-bed",
674
+ "blurb": "",
675
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_h_1/518756_how_to_clean_a_dog_bed_230329/518756_VIDEO_STORY_TILE_XL25.jpg",
676
+ "alt": "A golden retriever on a dog bed, a play video button in the center.",
677
+ "external": false,
678
+ "asset": "/static/img/lander/6613730aeca780.jpg"
679
+ },
680
+ {
681
+ "label": "How to Break In Your Hiking Boots",
682
+ "cat_id": 518697,
683
+ "slug": "how-to-break-in-your-hiking-boots",
684
+ "blurb": "",
685
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_p/518697_V_BreakinHikingBoots_ST_XL25.jpg",
686
+ "alt": "A woman wearing a backpack in the woods, looking at the camera and holding a hiking boot.",
687
+ "external": false,
688
+ "asset": "/static/img/lander/15d8236b25b250.jpg"
689
+ },
690
+ {
691
+ "label": "3 Ways to Style a Vest",
692
+ "cat_id": 518819,
693
+ "slug": "how-to-style-a-vest",
694
+ "blurb": "",
695
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2023/branded_content_4/omni_u_9_25_10_8/518819_how_to_style_a_vest_231003/100_518819_VIDEO_STORY_TILE_XL25.jpg",
696
+ "alt": "A model and her stylist reflected in a full-length mirror.",
697
+ "external": false,
698
+ "asset": "/static/img/lander/26de52e0d7e0c9.jpg"
699
+ },
700
+ {
701
+ "label": "How to Put On Snowshoes",
702
+ "cat_id": 518727,
703
+ "slug": "how-to-put-on-snowshoes",
704
+ "blurb": "",
705
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_y_1/518727_V_PutSnowshoeOn_ST_XL25.jpg",
706
+ "alt": "Close-up of foot of someone putting on a snowshoe.",
707
+ "external": false,
708
+ "asset": "/static/img/lander/e09894d32e18cf.jpg"
709
+ },
710
+ {
711
+ "label": "How to Break Down a Tent",
712
+ "cat_id": 518699,
713
+ "slug": "how-to-break-down-a-tent",
714
+ "blurb": "",
715
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2022/branded_content_3/omni_p/518699_V_BreakDownATent_ST_XL25.jpg",
716
+ "alt": "Woman in a tent looking at the camera, text How to Break Down a Tent and L.L.Bean logo.",
717
+ "external": false,
718
+ "asset": "/static/img/lander/a55d96ee7e27bc.jpg"
719
+ },
720
+ {
721
+ "label": "View All Product Use & Care",
722
+ "cat_id": 518836,
723
+ "slug": "product-use-and-care",
724
+ "blurb": "",
725
+ "img": "https://www.llbean.net/firstspirit/media/image_library/2025/branded_content_6/explore_llb_new_view_all_tiles_250326/ViewAll_ProductUseCare_XL25.jpg",
726
+ "alt": "Text \"View All Product Use & Care\" with gray background and white outdoor icons.",
727
+ "external": false,
728
+ "asset": "/static/img/lander/8470fe90dbc863.jpg"
729
+ }
730
+ ]
731
+ }
732
+ ]
733
+ }
734
+ }
tasks/llbean/environment/reference/clone/data/seed/nav_menu.json ADDED
@@ -0,0 +1,1619 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "top": "NEW",
4
+ "kind": "flat",
5
+ "position": 0,
6
+ "depth": 0,
7
+ "label": "Women's",
8
+ "cat_id": 20010101,
9
+ "slug": null,
10
+ "is_group": 0,
11
+ "group": null
12
+ },
13
+ {
14
+ "top": "NEW",
15
+ "kind": "flat",
16
+ "position": 1,
17
+ "depth": 0,
18
+ "label": "Men's",
19
+ "cat_id": 20010102,
20
+ "slug": null,
21
+ "is_group": 0,
22
+ "group": null
23
+ },
24
+ {
25
+ "top": "NEW",
26
+ "kind": "flat",
27
+ "position": 2,
28
+ "depth": 0,
29
+ "label": "Kids'",
30
+ "cat_id": 20010103,
31
+ "slug": null,
32
+ "is_group": 0,
33
+ "group": null
34
+ },
35
+ {
36
+ "top": "NEW",
37
+ "kind": "flat",
38
+ "position": 3,
39
+ "depth": 0,
40
+ "label": "Outdoor Equipment",
41
+ "cat_id": 511747,
42
+ "slug": "outdoor-gear-new-arrivals",
43
+ "is_group": 0,
44
+ "group": null
45
+ },
46
+ {
47
+ "top": "NEW",
48
+ "kind": "flat",
49
+ "position": 4,
50
+ "depth": 0,
51
+ "label": "Bags & Travel",
52
+ "cat_id": 511749,
53
+ "slug": "bags-and-travel-new-arrivals",
54
+ "is_group": 0,
55
+ "group": null
56
+ },
57
+ {
58
+ "top": "NEW",
59
+ "kind": "flat",
60
+ "position": 5,
61
+ "depth": 0,
62
+ "label": "Home Goods",
63
+ "cat_id": 511750,
64
+ "slug": "home-goods-new-arrivals",
65
+ "is_group": 0,
66
+ "group": null
67
+ },
68
+ {
69
+ "top": "Clothing",
70
+ "kind": "grouped",
71
+ "position": 0,
72
+ "depth": 0,
73
+ "label": "Women's",
74
+ "cat_id": 27,
75
+ "slug": "womens-clothing",
76
+ "is_group": 1,
77
+ "group": "Women's"
78
+ },
79
+ {
80
+ "top": "Clothing",
81
+ "kind": "grouped",
82
+ "position": 1,
83
+ "depth": 1,
84
+ "label": "Shop All Women's",
85
+ "cat_id": 27,
86
+ "slug": "womens-clothing",
87
+ "is_group": 0,
88
+ "group": "Women's"
89
+ },
90
+ {
91
+ "top": "Clothing",
92
+ "kind": "grouped",
93
+ "position": 2,
94
+ "depth": 1,
95
+ "label": "New Arrivals",
96
+ "cat_id": 511744,
97
+ "slug": "womens-clothing-new-arrivals",
98
+ "is_group": 0,
99
+ "group": "Women's"
100
+ },
101
+ {
102
+ "top": "Clothing",
103
+ "kind": "grouped",
104
+ "position": 3,
105
+ "depth": 1,
106
+ "label": "Tees & Tanks",
107
+ "cat_id": 504209,
108
+ "slug": "womens-t-shirts-and-tanks",
109
+ "is_group": 0,
110
+ "group": "Women's"
111
+ },
112
+ {
113
+ "top": "Clothing",
114
+ "kind": "grouped",
115
+ "position": 4,
116
+ "depth": 1,
117
+ "label": "Shirts & Tops",
118
+ "cat_id": 607,
119
+ "slug": "womens-shirts-and-tops",
120
+ "is_group": 0,
121
+ "group": "Women's"
122
+ },
123
+ {
124
+ "top": "Clothing",
125
+ "kind": "grouped",
126
+ "position": 5,
127
+ "depth": 1,
128
+ "label": "Sweaters",
129
+ "cat_id": 611,
130
+ "slug": "womens-sweaters",
131
+ "is_group": 0,
132
+ "group": "Women's"
133
+ },
134
+ {
135
+ "top": "Clothing",
136
+ "kind": "grouped",
137
+ "position": 6,
138
+ "depth": 1,
139
+ "label": "Sweatshirts",
140
+ "cat_id": 886,
141
+ "slug": "womens-sweatshirts",
142
+ "is_group": 0,
143
+ "group": "Women's"
144
+ },
145
+ {
146
+ "top": "Clothing",
147
+ "kind": "grouped",
148
+ "position": 7,
149
+ "depth": 1,
150
+ "label": "Fleece",
151
+ "cat_id": 504732,
152
+ "slug": "womens-fleece-jackets",
153
+ "is_group": 0,
154
+ "group": "Women's"
155
+ },
156
+ {
157
+ "top": "Clothing",
158
+ "kind": "grouped",
159
+ "position": 8,
160
+ "depth": 1,
161
+ "label": "Jeans",
162
+ "cat_id": 513283,
163
+ "slug": "womens-jeans",
164
+ "is_group": 0,
165
+ "group": "Women's"
166
+ },
167
+ {
168
+ "top": "Clothing",
169
+ "kind": "grouped",
170
+ "position": 9,
171
+ "depth": 1,
172
+ "label": "Pants",
173
+ "cat_id": 622,
174
+ "slug": "womens-pants-and-jeans",
175
+ "is_group": 0,
176
+ "group": "Women's"
177
+ },
178
+ {
179
+ "top": "Clothing",
180
+ "kind": "grouped",
181
+ "position": 10,
182
+ "depth": 1,
183
+ "label": "Shorts & Skorts",
184
+ "cat_id": 513280,
185
+ "slug": "womens-shorts-and-skorts",
186
+ "is_group": 0,
187
+ "group": "Women's"
188
+ },
189
+ {
190
+ "top": "Clothing",
191
+ "kind": "grouped",
192
+ "position": 11,
193
+ "depth": 1,
194
+ "label": "Dresses & Skirts",
195
+ "cat_id": 506213,
196
+ "slug": "womens-dresses-and-skirts",
197
+ "is_group": 0,
198
+ "group": "Women's"
199
+ },
200
+ {
201
+ "top": "Clothing",
202
+ "kind": "grouped",
203
+ "position": 12,
204
+ "depth": 1,
205
+ "label": "Swimwear",
206
+ "cat_id": 624,
207
+ "slug": "womens-swimwear",
208
+ "is_group": 0,
209
+ "group": "Women's"
210
+ },
211
+ {
212
+ "top": "Clothing",
213
+ "kind": "grouped",
214
+ "position": 13,
215
+ "depth": 1,
216
+ "label": "Sleepwear",
217
+ "cat_id": 613,
218
+ "slug": "womens-sleepwear",
219
+ "is_group": 0,
220
+ "group": "Women's"
221
+ },
222
+ {
223
+ "top": "Clothing",
224
+ "kind": "grouped",
225
+ "position": 14,
226
+ "depth": 1,
227
+ "label": "Base Layers",
228
+ "cat_id": 503056,
229
+ "slug": "womens-long-underwear-and-base-layers",
230
+ "is_group": 0,
231
+ "group": "Women's"
232
+ },
233
+ {
234
+ "top": "Clothing",
235
+ "kind": "grouped",
236
+ "position": 15,
237
+ "depth": 1,
238
+ "label": "Activewear",
239
+ "cat_id": 509757,
240
+ "slug": "womens-activewear",
241
+ "is_group": 0,
242
+ "group": "Women's"
243
+ },
244
+ {
245
+ "top": "Clothing",
246
+ "kind": "grouped",
247
+ "position": 16,
248
+ "depth": 1,
249
+ "label": "Accessories",
250
+ "cat_id": 614,
251
+ "slug": "womens-accessories",
252
+ "is_group": 0,
253
+ "group": "Women's"
254
+ },
255
+ {
256
+ "top": "Clothing",
257
+ "kind": "grouped",
258
+ "position": 17,
259
+ "depth": 0,
260
+ "label": "Men's",
261
+ "cat_id": 26,
262
+ "slug": "mens-clothing",
263
+ "is_group": 1,
264
+ "group": "Men's"
265
+ },
266
+ {
267
+ "top": "Clothing",
268
+ "kind": "grouped",
269
+ "position": 18,
270
+ "depth": 1,
271
+ "label": "Shop All Men's",
272
+ "cat_id": 26,
273
+ "slug": "mens-clothing",
274
+ "is_group": 0,
275
+ "group": "Men's"
276
+ },
277
+ {
278
+ "top": "Clothing",
279
+ "kind": "grouped",
280
+ "position": 19,
281
+ "depth": 1,
282
+ "label": "New Arrivals",
283
+ "cat_id": 511743,
284
+ "slug": "mens-clothing-new-arrivals",
285
+ "is_group": 0,
286
+ "group": "Men's"
287
+ },
288
+ {
289
+ "top": "Clothing",
290
+ "kind": "grouped",
291
+ "position": 20,
292
+ "depth": 1,
293
+ "label": "T-Shirts & Polos",
294
+ "cat_id": 20010166,
295
+ "slug": null,
296
+ "is_group": 0,
297
+ "group": "Men's"
298
+ },
299
+ {
300
+ "top": "Clothing",
301
+ "kind": "grouped",
302
+ "position": 21,
303
+ "depth": 1,
304
+ "label": "Shirts",
305
+ "cat_id": 589,
306
+ "slug": "mens-shirts",
307
+ "is_group": 0,
308
+ "group": "Men's"
309
+ },
310
+ {
311
+ "top": "Clothing",
312
+ "kind": "grouped",
313
+ "position": 22,
314
+ "depth": 1,
315
+ "label": "Sweaters",
316
+ "cat_id": 594,
317
+ "slug": "mens-sweaters",
318
+ "is_group": 0,
319
+ "group": "Men's"
320
+ },
321
+ {
322
+ "top": "Clothing",
323
+ "kind": "grouped",
324
+ "position": 23,
325
+ "depth": 1,
326
+ "label": "Sweatshirts",
327
+ "cat_id": 907,
328
+ "slug": "mens-sweatshirts",
329
+ "is_group": 0,
330
+ "group": "Men's"
331
+ },
332
+ {
333
+ "top": "Clothing",
334
+ "kind": "grouped",
335
+ "position": 24,
336
+ "depth": 1,
337
+ "label": "Fleece",
338
+ "cat_id": 506674,
339
+ "slug": "mens-fleece",
340
+ "is_group": 0,
341
+ "group": "Men's"
342
+ },
343
+ {
344
+ "top": "Clothing",
345
+ "kind": "grouped",
346
+ "position": 25,
347
+ "depth": 1,
348
+ "label": "Jeans",
349
+ "cat_id": 513284,
350
+ "slug": "mens-jeans",
351
+ "is_group": 0,
352
+ "group": "Men's"
353
+ },
354
+ {
355
+ "top": "Clothing",
356
+ "kind": "grouped",
357
+ "position": 26,
358
+ "depth": 1,
359
+ "label": "Pants",
360
+ "cat_id": 502921,
361
+ "slug": "mens-pants",
362
+ "is_group": 0,
363
+ "group": "Men's"
364
+ },
365
+ {
366
+ "top": "Clothing",
367
+ "kind": "grouped",
368
+ "position": 27,
369
+ "depth": 1,
370
+ "label": "Shorts",
371
+ "cat_id": 908,
372
+ "slug": "mens-shorts",
373
+ "is_group": 0,
374
+ "group": "Men's"
375
+ },
376
+ {
377
+ "top": "Clothing",
378
+ "kind": "grouped",
379
+ "position": 28,
380
+ "depth": 1,
381
+ "label": "Swimwear",
382
+ "cat_id": 511548,
383
+ "slug": "mens-swimwear",
384
+ "is_group": 0,
385
+ "group": "Men's"
386
+ },
387
+ {
388
+ "top": "Clothing",
389
+ "kind": "grouped",
390
+ "position": 29,
391
+ "depth": 1,
392
+ "label": "Sleepwear",
393
+ "cat_id": 595,
394
+ "slug": "mens-sleepwear",
395
+ "is_group": 0,
396
+ "group": "Men's"
397
+ },
398
+ {
399
+ "top": "Clothing",
400
+ "kind": "grouped",
401
+ "position": 30,
402
+ "depth": 1,
403
+ "label": "Base Layers",
404
+ "cat_id": 516180,
405
+ "slug": "mens-long-underwear-and-base-layers",
406
+ "is_group": 0,
407
+ "group": "Men's"
408
+ },
409
+ {
410
+ "top": "Clothing",
411
+ "kind": "grouped",
412
+ "position": 31,
413
+ "depth": 1,
414
+ "label": "Activewear",
415
+ "cat_id": 509723,
416
+ "slug": "mens-activewear",
417
+ "is_group": 0,
418
+ "group": "Men's"
419
+ },
420
+ {
421
+ "top": "Clothing",
422
+ "kind": "grouped",
423
+ "position": 32,
424
+ "depth": 1,
425
+ "label": "Accessories",
426
+ "cat_id": 596,
427
+ "slug": "mens-accessories",
428
+ "is_group": 0,
429
+ "group": "Men's"
430
+ },
431
+ {
432
+ "top": "Clothing",
433
+ "kind": "grouped",
434
+ "position": 33,
435
+ "depth": 0,
436
+ "label": "Kids'",
437
+ "cat_id": 28,
438
+ "slug": "kids-clothing",
439
+ "is_group": 1,
440
+ "group": "Kids'"
441
+ },
442
+ {
443
+ "top": "Clothing",
444
+ "kind": "grouped",
445
+ "position": 34,
446
+ "depth": 1,
447
+ "label": "Shop All Kids'",
448
+ "cat_id": 28,
449
+ "slug": "kids-clothing",
450
+ "is_group": 0,
451
+ "group": "Kids'"
452
+ },
453
+ {
454
+ "top": "Clothing",
455
+ "kind": "grouped",
456
+ "position": 35,
457
+ "depth": 1,
458
+ "label": "New Arrivals",
459
+ "cat_id": 511786,
460
+ "slug": "kids-clothing-new-arrivals",
461
+ "is_group": 0,
462
+ "group": "Kids'"
463
+ },
464
+ {
465
+ "top": "Clothing",
466
+ "kind": "grouped",
467
+ "position": 36,
468
+ "depth": 1,
469
+ "label": "Tops",
470
+ "cat_id": 503368,
471
+ "slug": "kids-tops",
472
+ "is_group": 0,
473
+ "group": "Kids'"
474
+ },
475
+ {
476
+ "top": "Clothing",
477
+ "kind": "grouped",
478
+ "position": 37,
479
+ "depth": 1,
480
+ "label": "Pants & Shorts",
481
+ "cat_id": 503570,
482
+ "slug": "kids-bottoms",
483
+ "is_group": 0,
484
+ "group": "Kids'"
485
+ },
486
+ {
487
+ "top": "Clothing",
488
+ "kind": "grouped",
489
+ "position": 38,
490
+ "depth": 1,
491
+ "label": "Sleepwear",
492
+ "cat_id": 503560,
493
+ "slug": "kids-sleepwear",
494
+ "is_group": 0,
495
+ "group": "Kids'"
496
+ },
497
+ {
498
+ "top": "Clothing",
499
+ "kind": "grouped",
500
+ "position": 39,
501
+ "depth": 1,
502
+ "label": "Base Layers",
503
+ "cat_id": 513852,
504
+ "slug": "kids-base-layers",
505
+ "is_group": 0,
506
+ "group": "Kids'"
507
+ },
508
+ {
509
+ "top": "Clothing",
510
+ "kind": "grouped",
511
+ "position": 40,
512
+ "depth": 1,
513
+ "label": "Accessories",
514
+ "cat_id": 503563,
515
+ "slug": "kids-accessories",
516
+ "is_group": 0,
517
+ "group": "Kids'"
518
+ },
519
+ {
520
+ "top": "Clothing",
521
+ "kind": "grouped",
522
+ "position": 41,
523
+ "depth": 1,
524
+ "label": "Toddler & Baby",
525
+ "cat_id": 289,
526
+ "slug": "toddler-and-baby-clothing",
527
+ "is_group": 0,
528
+ "group": "Kids'"
529
+ },
530
+ {
531
+ "top": "Outerwear",
532
+ "kind": "grouped",
533
+ "position": 0,
534
+ "depth": 0,
535
+ "label": "Women's",
536
+ "cat_id": 610,
537
+ "slug": "womens-outerwear",
538
+ "is_group": 1,
539
+ "group": "Women's"
540
+ },
541
+ {
542
+ "top": "Outerwear",
543
+ "kind": "grouped",
544
+ "position": 1,
545
+ "depth": 1,
546
+ "label": "Shop All Women's",
547
+ "cat_id": 610,
548
+ "slug": "womens-outerwear",
549
+ "is_group": 0,
550
+ "group": "Women's"
551
+ },
552
+ {
553
+ "top": "Outerwear",
554
+ "kind": "grouped",
555
+ "position": 2,
556
+ "depth": 1,
557
+ "label": "New Arrivals",
558
+ "cat_id": 508877,
559
+ "slug": null,
560
+ "is_group": 0,
561
+ "group": "Women's"
562
+ },
563
+ {
564
+ "top": "Outerwear",
565
+ "kind": "grouped",
566
+ "position": 3,
567
+ "depth": 1,
568
+ "label": "Insulated Jackets",
569
+ "cat_id": 504735,
570
+ "slug": "womens-insulated-jackets",
571
+ "is_group": 0,
572
+ "group": "Women's"
573
+ },
574
+ {
575
+ "top": "Outerwear",
576
+ "kind": "grouped",
577
+ "position": 4,
578
+ "depth": 1,
579
+ "label": "Casual Jackets",
580
+ "cat_id": 504734,
581
+ "slug": "womens-casual-jackets",
582
+ "is_group": 0,
583
+ "group": "Women's"
584
+ },
585
+ {
586
+ "top": "Outerwear",
587
+ "kind": "grouped",
588
+ "position": 5,
589
+ "depth": 1,
590
+ "label": "Fleece",
591
+ "cat_id": 504732,
592
+ "slug": "womens-fleece-jackets",
593
+ "is_group": 0,
594
+ "group": "Women's"
595
+ },
596
+ {
597
+ "top": "Outerwear",
598
+ "kind": "grouped",
599
+ "position": 6,
600
+ "depth": 1,
601
+ "label": "Rain Jackets & Shells",
602
+ "cat_id": 506593,
603
+ "slug": "womens-rain-jackets",
604
+ "is_group": 0,
605
+ "group": "Women's"
606
+ },
607
+ {
608
+ "top": "Outerwear",
609
+ "kind": "grouped",
610
+ "position": 7,
611
+ "depth": 1,
612
+ "label": "Windbreakers",
613
+ "cat_id": 506594,
614
+ "slug": "womens-windbreakers",
615
+ "is_group": 0,
616
+ "group": "Women's"
617
+ },
618
+ {
619
+ "top": "Outerwear",
620
+ "kind": "grouped",
621
+ "position": 8,
622
+ "depth": 1,
623
+ "label": "Vests",
624
+ "cat_id": 504729,
625
+ "slug": "womens-outerwear-vests",
626
+ "is_group": 0,
627
+ "group": "Women's"
628
+ },
629
+ {
630
+ "top": "Outerwear",
631
+ "kind": "grouped",
632
+ "position": 9,
633
+ "depth": 1,
634
+ "label": "Snow & Rain Pants",
635
+ "cat_id": 516609,
636
+ "slug": "womens-snow-and-rain-pants",
637
+ "is_group": 0,
638
+ "group": "Women's"
639
+ },
640
+ {
641
+ "top": "Outerwear",
642
+ "kind": "grouped",
643
+ "position": 10,
644
+ "depth": 1,
645
+ "label": "Accessories",
646
+ "cat_id": 518844,
647
+ "slug": "womens-outerwear-accessories",
648
+ "is_group": 0,
649
+ "group": "Women's"
650
+ },
651
+ {
652
+ "top": "Outerwear",
653
+ "kind": "grouped",
654
+ "position": 11,
655
+ "depth": 0,
656
+ "label": "Men's",
657
+ "cat_id": 593,
658
+ "slug": "mens-outerwear",
659
+ "is_group": 1,
660
+ "group": "Men's"
661
+ },
662
+ {
663
+ "top": "Outerwear",
664
+ "kind": "grouped",
665
+ "position": 12,
666
+ "depth": 1,
667
+ "label": "Shop All Men's",
668
+ "cat_id": 593,
669
+ "slug": "mens-outerwear",
670
+ "is_group": 0,
671
+ "group": "Men's"
672
+ },
673
+ {
674
+ "top": "Outerwear",
675
+ "kind": "grouped",
676
+ "position": 13,
677
+ "depth": 1,
678
+ "label": "New Arrivals",
679
+ "cat_id": 508868,
680
+ "slug": null,
681
+ "is_group": 0,
682
+ "group": "Men's"
683
+ },
684
+ {
685
+ "top": "Outerwear",
686
+ "kind": "grouped",
687
+ "position": 14,
688
+ "depth": 1,
689
+ "label": "Insulated Jackets",
690
+ "cat_id": 506673,
691
+ "slug": "mens-insulated-jackets",
692
+ "is_group": 0,
693
+ "group": "Men's"
694
+ },
695
+ {
696
+ "top": "Outerwear",
697
+ "kind": "grouped",
698
+ "position": 15,
699
+ "depth": 1,
700
+ "label": "Casual Jackets",
701
+ "cat_id": 506677,
702
+ "slug": "mens-casual-jackets",
703
+ "is_group": 0,
704
+ "group": "Men's"
705
+ },
706
+ {
707
+ "top": "Outerwear",
708
+ "kind": "grouped",
709
+ "position": 16,
710
+ "depth": 1,
711
+ "label": "Fleece",
712
+ "cat_id": 506674,
713
+ "slug": "mens-fleece",
714
+ "is_group": 0,
715
+ "group": "Men's"
716
+ },
717
+ {
718
+ "top": "Outerwear",
719
+ "kind": "grouped",
720
+ "position": 17,
721
+ "depth": 1,
722
+ "label": "Rain Jackets & Shells",
723
+ "cat_id": 506675,
724
+ "slug": "mens-rain-jackets",
725
+ "is_group": 0,
726
+ "group": "Men's"
727
+ },
728
+ {
729
+ "top": "Outerwear",
730
+ "kind": "grouped",
731
+ "position": 18,
732
+ "depth": 1,
733
+ "label": "Windbreakers",
734
+ "cat_id": 506676,
735
+ "slug": "mens-windbreakers",
736
+ "is_group": 0,
737
+ "group": "Men's"
738
+ },
739
+ {
740
+ "top": "Outerwear",
741
+ "kind": "grouped",
742
+ "position": 19,
743
+ "depth": 1,
744
+ "label": "Vests",
745
+ "cat_id": 504715,
746
+ "slug": "mens-outerwear-vests",
747
+ "is_group": 0,
748
+ "group": "Men's"
749
+ },
750
+ {
751
+ "top": "Outerwear",
752
+ "kind": "grouped",
753
+ "position": 20,
754
+ "depth": 1,
755
+ "label": "Snow & Rain Pants",
756
+ "cat_id": 516604,
757
+ "slug": "mens-snow-and-rain-pants",
758
+ "is_group": 0,
759
+ "group": "Men's"
760
+ },
761
+ {
762
+ "top": "Outerwear",
763
+ "kind": "grouped",
764
+ "position": 21,
765
+ "depth": 1,
766
+ "label": "Accessories",
767
+ "cat_id": 518845,
768
+ "slug": "mens-outerwear-accessories",
769
+ "is_group": 0,
770
+ "group": "Men's"
771
+ },
772
+ {
773
+ "top": "Outerwear",
774
+ "kind": "grouped",
775
+ "position": 22,
776
+ "depth": 0,
777
+ "label": "Kids'",
778
+ "cat_id": 503369,
779
+ "slug": "kids-outerwear",
780
+ "is_group": 1,
781
+ "group": "Kids'"
782
+ },
783
+ {
784
+ "top": "Outerwear",
785
+ "kind": "grouped",
786
+ "position": 23,
787
+ "depth": 1,
788
+ "label": "Shop All Kids'",
789
+ "cat_id": 503369,
790
+ "slug": "kids-outerwear",
791
+ "is_group": 0,
792
+ "group": "Kids'"
793
+ },
794
+ {
795
+ "top": "Outerwear",
796
+ "kind": "grouped",
797
+ "position": 24,
798
+ "depth": 1,
799
+ "label": "New Arrivals",
800
+ "cat_id": 518580,
801
+ "slug": null,
802
+ "is_group": 0,
803
+ "group": "Kids'"
804
+ },
805
+ {
806
+ "top": "Outerwear",
807
+ "kind": "grouped",
808
+ "position": 25,
809
+ "depth": 1,
810
+ "label": "Insulated Jackets",
811
+ "cat_id": 509976,
812
+ "slug": "kids-insulated-jackets",
813
+ "is_group": 0,
814
+ "group": "Kids'"
815
+ },
816
+ {
817
+ "top": "Outerwear",
818
+ "kind": "grouped",
819
+ "position": 26,
820
+ "depth": 1,
821
+ "label": "Fleece & Lightweight Jackets",
822
+ "cat_id": 1000010293,
823
+ "slug": "kids-fleece-lightweight-jackets",
824
+ "is_group": 0,
825
+ "group": "Kids'"
826
+ },
827
+ {
828
+ "top": "Outerwear",
829
+ "kind": "grouped",
830
+ "position": 27,
831
+ "depth": 1,
832
+ "label": "Rain Jackets",
833
+ "cat_id": 517473,
834
+ "slug": "kids-rain-jackets",
835
+ "is_group": 0,
836
+ "group": "Kids'"
837
+ },
838
+ {
839
+ "top": "Outerwear",
840
+ "kind": "grouped",
841
+ "position": 28,
842
+ "depth": 1,
843
+ "label": "Pants & Suits",
844
+ "cat_id": 503565,
845
+ "slug": "kids-outerwear-pants-and-suits",
846
+ "is_group": 0,
847
+ "group": "Kids'"
848
+ },
849
+ {
850
+ "top": "Outerwear",
851
+ "kind": "grouped",
852
+ "position": 29,
853
+ "depth": 1,
854
+ "label": "Toddler & Baby",
855
+ "cat_id": 518610,
856
+ "slug": "toddler-and-baby-outerwear",
857
+ "is_group": 0,
858
+ "group": "Kids'"
859
+ },
860
+ {
861
+ "top": "Outerwear",
862
+ "kind": "grouped",
863
+ "position": 30,
864
+ "depth": 1,
865
+ "label": "Accessories",
866
+ "cat_id": 503563,
867
+ "slug": "kids-accessories",
868
+ "is_group": 0,
869
+ "group": "Kids'"
870
+ },
871
+ {
872
+ "top": "Footwear",
873
+ "kind": "grouped",
874
+ "position": 0,
875
+ "depth": 0,
876
+ "label": "Women's",
877
+ "cat_id": 630,
878
+ "slug": "womens-footwear",
879
+ "is_group": 1,
880
+ "group": "Women's"
881
+ },
882
+ {
883
+ "top": "Footwear",
884
+ "kind": "grouped",
885
+ "position": 1,
886
+ "depth": 1,
887
+ "label": "Shop All Women's",
888
+ "cat_id": 630,
889
+ "slug": "womens-footwear",
890
+ "is_group": 0,
891
+ "group": "Women's"
892
+ },
893
+ {
894
+ "top": "Footwear",
895
+ "kind": "grouped",
896
+ "position": 2,
897
+ "depth": 1,
898
+ "label": "New Arrivals",
899
+ "cat_id": 508896,
900
+ "slug": null,
901
+ "is_group": 0,
902
+ "group": "Women's"
903
+ },
904
+ {
905
+ "top": "Footwear",
906
+ "kind": "grouped",
907
+ "position": 3,
908
+ "depth": 1,
909
+ "label": "Bean Boots",
910
+ "cat_id": 513859,
911
+ "slug": null,
912
+ "is_group": 0,
913
+ "group": "Women's"
914
+ },
915
+ {
916
+ "top": "Footwear",
917
+ "kind": "grouped",
918
+ "position": 4,
919
+ "depth": 1,
920
+ "label": "Boots",
921
+ "cat_id": 506708,
922
+ "slug": "womens-boots",
923
+ "is_group": 0,
924
+ "group": "Women's"
925
+ },
926
+ {
927
+ "top": "Footwear",
928
+ "kind": "grouped",
929
+ "position": 5,
930
+ "depth": 1,
931
+ "label": "Sneakers & Shoes",
932
+ "cat_id": 506705,
933
+ "slug": "womens-sneakers-and-shoes",
934
+ "is_group": 0,
935
+ "group": "Women's"
936
+ },
937
+ {
938
+ "top": "Footwear",
939
+ "kind": "grouped",
940
+ "position": 6,
941
+ "depth": 1,
942
+ "label": "Sandals & Water Shoes",
943
+ "cat_id": 503423,
944
+ "slug": "sandals-and-water-shoes",
945
+ "is_group": 0,
946
+ "group": "Women's"
947
+ },
948
+ {
949
+ "top": "Footwear",
950
+ "kind": "grouped",
951
+ "position": 7,
952
+ "depth": 1,
953
+ "label": "Slippers",
954
+ "cat_id": 503422,
955
+ "slug": "womens-slippers",
956
+ "is_group": 0,
957
+ "group": "Women's"
958
+ },
959
+ {
960
+ "top": "Footwear",
961
+ "kind": "grouped",
962
+ "position": 8,
963
+ "depth": 1,
964
+ "label": "Socks",
965
+ "cat_id": 502980,
966
+ "slug": "womens-socks",
967
+ "is_group": 0,
968
+ "group": "Women's"
969
+ },
970
+ {
971
+ "top": "Footwear",
972
+ "kind": "grouped",
973
+ "position": 9,
974
+ "depth": 1,
975
+ "label": "Accessories",
976
+ "cat_id": 20010704,
977
+ "slug": null,
978
+ "is_group": 0,
979
+ "group": "Women's"
980
+ },
981
+ {
982
+ "top": "Footwear",
983
+ "kind": "grouped",
984
+ "position": 10,
985
+ "depth": 0,
986
+ "label": "Men's",
987
+ "cat_id": 629,
988
+ "slug": "mens-footwear",
989
+ "is_group": 1,
990
+ "group": "Men's"
991
+ },
992
+ {
993
+ "top": "Footwear",
994
+ "kind": "grouped",
995
+ "position": 11,
996
+ "depth": 1,
997
+ "label": "Shop All Men's",
998
+ "cat_id": 629,
999
+ "slug": "mens-footwear",
1000
+ "is_group": 0,
1001
+ "group": "Men's"
1002
+ },
1003
+ {
1004
+ "top": "Footwear",
1005
+ "kind": "grouped",
1006
+ "position": 12,
1007
+ "depth": 1,
1008
+ "label": "New Arrivals",
1009
+ "cat_id": 508895,
1010
+ "slug": null,
1011
+ "is_group": 0,
1012
+ "group": "Men's"
1013
+ },
1014
+ {
1015
+ "top": "Footwear",
1016
+ "kind": "grouped",
1017
+ "position": 13,
1018
+ "depth": 1,
1019
+ "label": "Bean Boots",
1020
+ "cat_id": 513858,
1021
+ "slug": null,
1022
+ "is_group": 0,
1023
+ "group": "Men's"
1024
+ },
1025
+ {
1026
+ "top": "Footwear",
1027
+ "kind": "grouped",
1028
+ "position": 14,
1029
+ "depth": 1,
1030
+ "label": "Boots",
1031
+ "cat_id": 506794,
1032
+ "slug": "mens-boots",
1033
+ "is_group": 0,
1034
+ "group": "Men's"
1035
+ },
1036
+ {
1037
+ "top": "Footwear",
1038
+ "kind": "grouped",
1039
+ "position": 15,
1040
+ "depth": 1,
1041
+ "label": "Sneakers & Shoes",
1042
+ "cat_id": 506791,
1043
+ "slug": "mens-sneakers-and-shoes",
1044
+ "is_group": 0,
1045
+ "group": "Men's"
1046
+ },
1047
+ {
1048
+ "top": "Footwear",
1049
+ "kind": "grouped",
1050
+ "position": 16,
1051
+ "depth": 1,
1052
+ "label": "Sandals & Water Shoes",
1053
+ "cat_id": 503381,
1054
+ "slug": "mens-sandals-and-water-shoes",
1055
+ "is_group": 0,
1056
+ "group": "Men's"
1057
+ },
1058
+ {
1059
+ "top": "Footwear",
1060
+ "kind": "grouped",
1061
+ "position": 17,
1062
+ "depth": 1,
1063
+ "label": "Slippers",
1064
+ "cat_id": 503380,
1065
+ "slug": "mens-slippers",
1066
+ "is_group": 0,
1067
+ "group": "Men's"
1068
+ },
1069
+ {
1070
+ "top": "Footwear",
1071
+ "kind": "grouped",
1072
+ "position": 18,
1073
+ "depth": 1,
1074
+ "label": "Socks",
1075
+ "cat_id": 502854,
1076
+ "slug": "mens-socks",
1077
+ "is_group": 0,
1078
+ "group": "Men's"
1079
+ },
1080
+ {
1081
+ "top": "Footwear",
1082
+ "kind": "grouped",
1083
+ "position": 19,
1084
+ "depth": 1,
1085
+ "label": "Accessories",
1086
+ "cat_id": 514536,
1087
+ "slug": "mens-footwear-accessories",
1088
+ "is_group": 0,
1089
+ "group": "Men's"
1090
+ },
1091
+ {
1092
+ "top": "Footwear",
1093
+ "kind": "grouped",
1094
+ "position": 20,
1095
+ "depth": 0,
1096
+ "label": "Kids'",
1097
+ "cat_id": 651,
1098
+ "slug": "kids-footwear",
1099
+ "is_group": 1,
1100
+ "group": "Kids'"
1101
+ },
1102
+ {
1103
+ "top": "Footwear",
1104
+ "kind": "grouped",
1105
+ "position": 21,
1106
+ "depth": 1,
1107
+ "label": "Shop All Kids'",
1108
+ "cat_id": 651,
1109
+ "slug": "kids-footwear",
1110
+ "is_group": 0,
1111
+ "group": "Kids'"
1112
+ },
1113
+ {
1114
+ "top": "Footwear",
1115
+ "kind": "grouped",
1116
+ "position": 22,
1117
+ "depth": 1,
1118
+ "label": "New Arrivals",
1119
+ "cat_id": 514692,
1120
+ "slug": null,
1121
+ "is_group": 0,
1122
+ "group": "Kids'"
1123
+ },
1124
+ {
1125
+ "top": "Footwear",
1126
+ "kind": "grouped",
1127
+ "position": 23,
1128
+ "depth": 1,
1129
+ "label": "Hiking Boots and Shoes",
1130
+ "cat_id": 503723,
1131
+ "slug": "kids-sneakers-and-shoes",
1132
+ "is_group": 0,
1133
+ "group": "Kids'"
1134
+ },
1135
+ {
1136
+ "top": "Footwear",
1137
+ "kind": "grouped",
1138
+ "position": 24,
1139
+ "depth": 1,
1140
+ "label": "Rain & Snow Boots",
1141
+ "cat_id": 503719,
1142
+ "slug": "kids-rain-and-snow-boots",
1143
+ "is_group": 0,
1144
+ "group": "Kids'"
1145
+ },
1146
+ {
1147
+ "top": "Footwear",
1148
+ "kind": "grouped",
1149
+ "position": 25,
1150
+ "depth": 1,
1151
+ "label": "Slippers",
1152
+ "cat_id": 503721,
1153
+ "slug": "kids-slippers",
1154
+ "is_group": 0,
1155
+ "group": "Kids'"
1156
+ },
1157
+ {
1158
+ "top": "Footwear",
1159
+ "kind": "grouped",
1160
+ "position": 26,
1161
+ "depth": 1,
1162
+ "label": "Sandals & Water Shoes",
1163
+ "cat_id": 503575,
1164
+ "slug": "kids-sandals-and-water-shoes",
1165
+ "is_group": 0,
1166
+ "group": "Kids'"
1167
+ },
1168
+ {
1169
+ "top": "Footwear",
1170
+ "kind": "grouped",
1171
+ "position": 27,
1172
+ "depth": 1,
1173
+ "label": "Socks",
1174
+ "cat_id": 513665,
1175
+ "slug": "kids-socks",
1176
+ "is_group": 0,
1177
+ "group": "Kids'"
1178
+ },
1179
+ {
1180
+ "top": "Footwear",
1181
+ "kind": "grouped",
1182
+ "position": 28,
1183
+ "depth": 1,
1184
+ "label": "Toddler & Baby",
1185
+ "cat_id": 632,
1186
+ "slug": "toddler-and-baby-footwear",
1187
+ "is_group": 0,
1188
+ "group": "Kids'"
1189
+ },
1190
+ {
1191
+ "top": "Outdoor Equipment",
1192
+ "kind": "flat",
1193
+ "position": 0,
1194
+ "depth": 0,
1195
+ "label": "New Arrivals",
1196
+ "cat_id": 511747,
1197
+ "slug": null,
1198
+ "is_group": 0,
1199
+ "group": null
1200
+ },
1201
+ {
1202
+ "top": "Outdoor Equipment",
1203
+ "kind": "flat",
1204
+ "position": 1,
1205
+ "depth": 0,
1206
+ "label": "Camping & Hiking",
1207
+ "cat_id": 915,
1208
+ "slug": "camping-and-hiking-gear",
1209
+ "is_group": 0,
1210
+ "group": null
1211
+ },
1212
+ {
1213
+ "top": "Outdoor Equipment",
1214
+ "kind": "flat",
1215
+ "position": 2,
1216
+ "depth": 0,
1217
+ "label": "Outdoor Accessories",
1218
+ "cat_id": 516713,
1219
+ "slug": "outdoor-accessories",
1220
+ "is_group": 0,
1221
+ "group": null
1222
+ },
1223
+ {
1224
+ "top": "Outdoor Equipment",
1225
+ "kind": "flat",
1226
+ "position": 3,
1227
+ "depth": 0,
1228
+ "label": "Fishing",
1229
+ "cat_id": 507923,
1230
+ "slug": "fishing-gear",
1231
+ "is_group": 0,
1232
+ "group": null
1233
+ },
1234
+ {
1235
+ "top": "Outdoor Equipment",
1236
+ "kind": "flat",
1237
+ "position": 4,
1238
+ "depth": 0,
1239
+ "label": "Beach Gear",
1240
+ "cat_id": 518885,
1241
+ "slug": "beach-gear",
1242
+ "is_group": 0,
1243
+ "group": null
1244
+ },
1245
+ {
1246
+ "top": "Outdoor Equipment",
1247
+ "kind": "flat",
1248
+ "position": 5,
1249
+ "depth": 0,
1250
+ "label": "Water Bottles & Drinkware",
1251
+ "cat_id": 516664,
1252
+ "slug": "hydration",
1253
+ "is_group": 0,
1254
+ "group": null
1255
+ },
1256
+ {
1257
+ "top": "Outdoor Equipment",
1258
+ "kind": "flat",
1259
+ "position": 6,
1260
+ "depth": 0,
1261
+ "label": "Hunting",
1262
+ "cat_id": 507929,
1263
+ "slug": "hunting-gear",
1264
+ "is_group": 0,
1265
+ "group": null
1266
+ },
1267
+ {
1268
+ "top": "Outdoor Equipment",
1269
+ "kind": "flat",
1270
+ "position": 7,
1271
+ "depth": 0,
1272
+ "label": "Winter Sports",
1273
+ "cat_id": 516714,
1274
+ "slug": "winter-sports",
1275
+ "is_group": 0,
1276
+ "group": null
1277
+ },
1278
+ {
1279
+ "top": "Bags & Travel",
1280
+ "kind": "flat",
1281
+ "position": 0,
1282
+ "depth": 0,
1283
+ "label": "New Arrivals",
1284
+ "cat_id": 511749,
1285
+ "slug": null,
1286
+ "is_group": 0,
1287
+ "group": null
1288
+ },
1289
+ {
1290
+ "top": "Bags & Travel",
1291
+ "kind": "flat",
1292
+ "position": 1,
1293
+ "depth": 0,
1294
+ "label": "Boat and Totes",
1295
+ "cat_id": 514029,
1296
+ "slug": "boat-and-tote-bags",
1297
+ "is_group": 0,
1298
+ "group": null
1299
+ },
1300
+ {
1301
+ "top": "Bags & Travel",
1302
+ "kind": "flat",
1303
+ "position": 2,
1304
+ "depth": 0,
1305
+ "label": "Everyday Bags & Totes",
1306
+ "cat_id": 516672,
1307
+ "slug": "bags-and-totes",
1308
+ "is_group": 0,
1309
+ "group": null
1310
+ },
1311
+ {
1312
+ "top": "Bags & Travel",
1313
+ "kind": "flat",
1314
+ "position": 3,
1315
+ "depth": 0,
1316
+ "label": "Hiking Backpacks",
1317
+ "cat_id": 916,
1318
+ "slug": "hiking-and-backpacking",
1319
+ "is_group": 0,
1320
+ "group": null
1321
+ },
1322
+ {
1323
+ "top": "Bags & Travel",
1324
+ "kind": "flat",
1325
+ "position": 4,
1326
+ "depth": 0,
1327
+ "label": "School Backpacks & Lunch Boxes",
1328
+ "cat_id": 816,
1329
+ "slug": "school-backpacks-and-lunch-boxes",
1330
+ "is_group": 0,
1331
+ "group": null
1332
+ },
1333
+ {
1334
+ "top": "Bags & Travel",
1335
+ "kind": "flat",
1336
+ "position": 5,
1337
+ "depth": 0,
1338
+ "label": "Luggage & Duffle Bags",
1339
+ "cat_id": 516673,
1340
+ "slug": "luggage-and-duffle-bags",
1341
+ "is_group": 0,
1342
+ "group": null
1343
+ },
1344
+ {
1345
+ "top": "Bags & Travel",
1346
+ "kind": "flat",
1347
+ "position": 6,
1348
+ "depth": 0,
1349
+ "label": "Toiletry Bags & Organizers",
1350
+ "cat_id": 507361,
1351
+ "slug": "toiletry-bags-and-organizers",
1352
+ "is_group": 0,
1353
+ "group": null
1354
+ },
1355
+ {
1356
+ "top": "Bags & Travel",
1357
+ "kind": "flat",
1358
+ "position": 7,
1359
+ "depth": 0,
1360
+ "label": "Bag Charms & Accessories",
1361
+ "cat_id": 203,
1362
+ "slug": "bag-charms-and-accessories",
1363
+ "is_group": 0,
1364
+ "group": null
1365
+ },
1366
+ {
1367
+ "top": "Home Goods",
1368
+ "kind": "flat",
1369
+ "position": 0,
1370
+ "depth": 0,
1371
+ "label": "New Arrivals",
1372
+ "cat_id": 511750,
1373
+ "slug": null,
1374
+ "is_group": 0,
1375
+ "group": null
1376
+ },
1377
+ {
1378
+ "top": "Home Goods",
1379
+ "kind": "flat",
1380
+ "position": 1,
1381
+ "depth": 0,
1382
+ "label": "Bedding",
1383
+ "cat_id": 131,
1384
+ "slug": "bedding",
1385
+ "is_group": 0,
1386
+ "group": null
1387
+ },
1388
+ {
1389
+ "top": "Home Goods",
1390
+ "kind": "flat",
1391
+ "position": 2,
1392
+ "depth": 0,
1393
+ "label": "Furniture",
1394
+ "cat_id": 129,
1395
+ "slug": "furniture",
1396
+ "is_group": 0,
1397
+ "group": null
1398
+ },
1399
+ {
1400
+ "top": "Home Goods",
1401
+ "kind": "flat",
1402
+ "position": 3,
1403
+ "depth": 0,
1404
+ "label": "Bath",
1405
+ "cat_id": 900,
1406
+ "slug": "bath",
1407
+ "is_group": 0,
1408
+ "group": null
1409
+ },
1410
+ {
1411
+ "top": "Home Goods",
1412
+ "kind": "flat",
1413
+ "position": 4,
1414
+ "depth": 0,
1415
+ "label": "Fireplace & Hearth",
1416
+ "cat_id": 510044,
1417
+ "slug": "fireplace-and-hearth",
1418
+ "is_group": 0,
1419
+ "group": null
1420
+ },
1421
+ {
1422
+ "top": "Home Goods",
1423
+ "kind": "flat",
1424
+ "position": 5,
1425
+ "depth": 0,
1426
+ "label": "Rugs & Mats",
1427
+ "cat_id": 514001,
1428
+ "slug": "rugs-and-mats",
1429
+ "is_group": 0,
1430
+ "group": null
1431
+ },
1432
+ {
1433
+ "top": "Home Goods",
1434
+ "kind": "flat",
1435
+ "position": 6,
1436
+ "depth": 0,
1437
+ "label": "Home Decor",
1438
+ "cat_id": 312,
1439
+ "slug": "home-decor",
1440
+ "is_group": 0,
1441
+ "group": null
1442
+ },
1443
+ {
1444
+ "top": "Home Goods",
1445
+ "kind": "flat",
1446
+ "position": 7,
1447
+ "depth": 0,
1448
+ "label": "Backyard & Patio",
1449
+ "cat_id": 132,
1450
+ "slug": "backyard-and-patio",
1451
+ "is_group": 0,
1452
+ "group": null
1453
+ },
1454
+ {
1455
+ "top": "Home Goods",
1456
+ "kind": "flat",
1457
+ "position": 8,
1458
+ "depth": 0,
1459
+ "label": "Games & Books",
1460
+ "cat_id": 506621,
1461
+ "slug": "games-and-books",
1462
+ "is_group": 0,
1463
+ "group": null
1464
+ },
1465
+ {
1466
+ "top": "Home Goods",
1467
+ "kind": "flat",
1468
+ "position": 9,
1469
+ "depth": 0,
1470
+ "label": "Dog Supplies",
1471
+ "cat_id": 134,
1472
+ "slug": "dog-supplies",
1473
+ "is_group": 0,
1474
+ "group": null
1475
+ },
1476
+ {
1477
+ "top": "Home Goods",
1478
+ "kind": "flat",
1479
+ "position": 10,
1480
+ "depth": 0,
1481
+ "label": "Gourmet Treats",
1482
+ "cat_id": 514907,
1483
+ "slug": "gourmet-treats",
1484
+ "is_group": 0,
1485
+ "group": null
1486
+ },
1487
+ {
1488
+ "top": "Sale",
1489
+ "kind": "flat",
1490
+ "position": 0,
1491
+ "depth": 0,
1492
+ "label": "Clothing",
1493
+ "cat_id": 516686,
1494
+ "slug": "clothing-on-sale",
1495
+ "is_group": 0,
1496
+ "group": null
1497
+ },
1498
+ {
1499
+ "top": "Sale",
1500
+ "kind": "flat",
1501
+ "position": 1,
1502
+ "depth": 0,
1503
+ "label": "Outerwear",
1504
+ "cat_id": 518521,
1505
+ "slug": "outerwear-on-sale",
1506
+ "is_group": 0,
1507
+ "group": null
1508
+ },
1509
+ {
1510
+ "top": "Sale",
1511
+ "kind": "flat",
1512
+ "position": 2,
1513
+ "depth": 0,
1514
+ "label": "Footwear",
1515
+ "cat_id": 516689,
1516
+ "slug": "footwear-on-sale",
1517
+ "is_group": 0,
1518
+ "group": null
1519
+ },
1520
+ {
1521
+ "top": "Sale",
1522
+ "kind": "flat",
1523
+ "position": 3,
1524
+ "depth": 0,
1525
+ "label": "Outdoor Equipment",
1526
+ "cat_id": 509104,
1527
+ "slug": "outdoor-equipment-on-sale",
1528
+ "is_group": 0,
1529
+ "group": null
1530
+ },
1531
+ {
1532
+ "top": "Sale",
1533
+ "kind": "flat",
1534
+ "position": 4,
1535
+ "depth": 0,
1536
+ "label": "Bags & Travel",
1537
+ "cat_id": 305,
1538
+ "slug": "bags-and-travel-on-sale",
1539
+ "is_group": 0,
1540
+ "group": null
1541
+ },
1542
+ {
1543
+ "top": "Sale",
1544
+ "kind": "flat",
1545
+ "position": 5,
1546
+ "depth": 0,
1547
+ "label": "Home Goods",
1548
+ "cat_id": 307,
1549
+ "slug": "home-goods-on-sale",
1550
+ "is_group": 0,
1551
+ "group": null
1552
+ },
1553
+ {
1554
+ "top": "Sale",
1555
+ "kind": "flat",
1556
+ "position": 6,
1557
+ "depth": 0,
1558
+ "label": "New to Sale",
1559
+ "cat_id": 508925,
1560
+ "slug": "new-to-sale-on-sale",
1561
+ "is_group": 0,
1562
+ "group": null
1563
+ },
1564
+ {
1565
+ "top": "Sale",
1566
+ "kind": "flat",
1567
+ "position": 7,
1568
+ "depth": 0,
1569
+ "label": "Two-A-Day Daily Markdown",
1570
+ "cat_id": 504987,
1571
+ "slug": "clearance-items",
1572
+ "is_group": 0,
1573
+ "group": null
1574
+ },
1575
+ {
1576
+ "top": "Sale",
1577
+ "kind": "flat",
1578
+ "position": 8,
1579
+ "depth": 0,
1580
+ "label": "Daily Markdown",
1581
+ "cat_id": 510312,
1582
+ "slug": "clearance",
1583
+ "is_group": 0,
1584
+ "group": null
1585
+ },
1586
+ {
1587
+ "top": "Outdoor Experiences",
1588
+ "kind": "flat",
1589
+ "position": 0,
1590
+ "depth": 0,
1591
+ "label": "Outdoor Discovery Programs",
1592
+ "cat_id": 518707,
1593
+ "slug": "outdoor-discovery-programs",
1594
+ "is_group": 0,
1595
+ "group": null
1596
+ },
1597
+ {
1598
+ "top": "Outdoor Experiences",
1599
+ "kind": "flat",
1600
+ "position": 1,
1601
+ "depth": 0,
1602
+ "label": "Events & Activities",
1603
+ "cat_id": 518363,
1604
+ "slug": "events-and-activities",
1605
+ "is_group": 0,
1606
+ "group": null
1607
+ },
1608
+ {
1609
+ "top": "Outdoor Experiences",
1610
+ "kind": "flat",
1611
+ "position": 2,
1612
+ "depth": 0,
1613
+ "label": "Bootmobile",
1614
+ "cat_id": 518708,
1615
+ "slug": "bootmobile",
1616
+ "is_group": 0,
1617
+ "group": null
1618
+ }
1619
+ ]
tasks/llbean/environment/reference/clone/data/seed/products.json ADDED
The diff for this file is too large to render. See raw diff
 
tasks/llbean/environment/reference/clone/frontend/static/css/site.css ADDED
@@ -0,0 +1,819 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Design tokens are the computed values captured from the source in Mac Chrome
2
+ at a 1200px desktop viewport; see scope/notes/06-recon-taxonomy-tokens.md. */
3
+
4
+ :root {
5
+ --font-ui: Montserrat, Verdana, sans-serif;
6
+ --font-serif: Lora, Georgia, serif;
7
+ --ink: #333333;
8
+ --ink-muted: #464749;
9
+ --ink-strong: #000000;
10
+ --rule: #d8d8d8;
11
+ --rule-light: #efefef;
12
+ --page: #ffffff;
13
+ --brand-green: #0c5641;
14
+ --brand-green-dark: #3b5343;
15
+ --brand-navy: #061b49;
16
+ --link: #337ab7;
17
+ --grey-mid: #979797;
18
+ --sale: #a8272c;
19
+ --content-width: 1200px;
20
+ }
21
+
22
+ * { box-sizing: border-box; }
23
+
24
+ html { -webkit-text-size-adjust: 100%; }
25
+
26
+ body {
27
+ margin: 0;
28
+ font-family: var(--font-ui);
29
+ font-size: 14px;
30
+ line-height: 20px;
31
+ color: var(--ink);
32
+ background: var(--page);
33
+ min-width: var(--content-width);
34
+ }
35
+
36
+ a { color: inherit; text-decoration: none; }
37
+ a:hover { text-decoration: underline; }
38
+ img { max-width: 100%; height: auto; display: block; }
39
+ h1, h2, h3 { margin: 0 0 12px; font-weight: 500; }
40
+ h2 { font-size: 32px; line-height: 35.2px; color: var(--brand-green); }
41
+ h3 { font-size: 16px; line-height: 22px; }
42
+ button { font-family: inherit; cursor: pointer; }
43
+
44
+ .screenreader {
45
+ position: absolute; width: 1px; height: 1px; overflow: hidden;
46
+ clip: rect(0 0 0 0); white-space: nowrap;
47
+ }
48
+
49
+ .AppEcom_container { max-width: none; }
50
+
51
+ .AppEcom_skip-link {
52
+ position: absolute; left: -9999px; top: 0; background: #fff; padding: 8px 16px; z-index: 100;
53
+ }
54
+ .AppEcom_skip-link:focus { left: 0; }
55
+
56
+ /* ---------------------------------------------------------------- header */
57
+
58
+ .GlobalBanner_container {
59
+ display: flex; align-items: center; justify-content: center; gap: 18px;
60
+ height: 30px; background: var(--brand-navy); color: #fff;
61
+ font-size: 14px; line-height: 20px; font-weight: 500;
62
+ }
63
+ .GlobalBanner_message { margin: 0; }
64
+ .GlobalBanner_message a { text-decoration: underline; }
65
+ .GlobalBanner_arrow {
66
+ position: absolute; border: none; background: none; color: #fff; font-size: 20px; line-height: 1;
67
+ }
68
+ .GlobalBanner_prev { left: 14px; }
69
+ .GlobalBanner_next { right: 14px; }
70
+ .GlobalBanner_container { position: relative; }
71
+
72
+ .Header_header-container { background: var(--page); }
73
+
74
+ .utility-nav {
75
+ display: flex; justify-content: flex-end; align-items: center; gap: 0;
76
+ height: 64px; max-width: var(--content-width); margin: 0 auto; padding: 0 10px 29px 0;
77
+ font-size: 13px; line-height: 18.5714px; color: var(--ink-muted);
78
+ }
79
+ .utility-nav > * { padding: 0 10px; }
80
+ .UtilityNavigation_anchor { color: var(--ink-muted); font-size: 13px; line-height: 18.5714px; text-decoration: underline; }
81
+ .UtilityNavigation_anchor sup { font-size: 9px; vertical-align: super; }
82
+ .UtilityNavigation_pipe { color: var(--rule); }
83
+ .UtilityNavigation_caret { text-decoration: none; display: inline-block; font-size: 10px; }
84
+ .UtilityNavigation_item { position: relative; }
85
+ .DropdownMenu_menu {
86
+ display: none; position: absolute; top: 100%; left: 0; z-index: 40;
87
+ background: #fff; border: 1px solid var(--rule); padding: 12px 16px; min-width: 200px;
88
+ }
89
+ .UtilityNavigation_item:hover .DropdownMenu_menu { display: block; }
90
+ .DropdownMenu_menu a, .DropdownMenu_cs-phone { display: block; padding: 4px 0; font-size: 13px; }
91
+
92
+ .Header_main-row {
93
+ display: flex; align-items: flex-start; height: 74px;
94
+ max-width: var(--content-width); margin: 0 auto; padding: 10px 12px 0;
95
+ }
96
+
97
+ .Logo_logo { flex: 0 0 209px; height: 44px; display: flex; align-items: center; }
98
+ .Logo_icon { width: 199px; height: 39px; display: block; }
99
+
100
+ .SearchForm_form {
101
+ position: relative; display: flex; align-items: center;
102
+ flex: 0 0 446px; height: 48px; margin-left: 68px;
103
+ border: 1px solid var(--grey-mid); border-radius: 4px; background: #fff;
104
+ }
105
+ .SearchForm_icon {
106
+ position: absolute; left: 12px; width: 21px; height: 21px; pointer-events: none;
107
+ }
108
+ .SearchForm_search-input {
109
+ width: 442px; height: 44px; padding: 0 14px 0 40px;
110
+ font-size: 13px; line-height: 18px; font-family: var(--font-ui);
111
+ border: none; outline-offset: -2px; background: transparent;
112
+ }
113
+ .SearchForm_search-input::placeholder { color: var(--ink-muted); }
114
+
115
+ .Header_actions { display: flex; align-items: center; gap: 20px; margin-left: auto; padding-right: 71px; height: 44px; }
116
+ .Header_actions a {
117
+ display: flex; align-items: center; gap: 8px;
118
+ font-size: 13px; line-height: 18.2px; font-weight: 500; letter-spacing: 0.5px;
119
+ color: var(--ink-strong);
120
+ }
121
+ .StoresLink_icon { width: 21px; height: 30px; }
122
+ .Account_wrapper { display: flex; align-items: center; gap: 8px; }
123
+ .Account_avatar { width: 34px; height: 35px; }
124
+ .Account_signout-button {
125
+ border: none; background: none; padding: 0; font-size: 11px;
126
+ color: var(--link); text-decoration: underline;
127
+ }
128
+ .ShoppingBag_anchor { position: relative; }
129
+ .ShoppingBag_icon { width: 34px; height: 35px; }
130
+ .ShoppingBag_count {
131
+ position: absolute; top: -4px; right: -8px;
132
+ min-width: 18px; height: 18px; border-radius: 9px;
133
+ background: var(--sale); color: #fff;
134
+ font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px;
135
+ }
136
+
137
+ .primary-nav { margin-top: 6px; border-bottom: 1px solid var(--rule); }
138
+ .HeaderNavigation_list {
139
+ display: flex; justify-content: flex-start; align-items: stretch;
140
+ list-style: none; margin: 0 auto; padding: 0; max-width: var(--content-width);
141
+ }
142
+ .HeaderNavigation_item { position: relative; display: flex; }
143
+ .HeaderNavigation_anchor {
144
+ display: flex; align-items: center; justify-content: center; text-align: center;
145
+ height: 50px; padding: 0 12px; min-width: 84px;
146
+ font-size: 14px; line-height: 16.8px; font-weight: 500;
147
+ text-transform: uppercase; color: var(--ink-strong);
148
+ }
149
+ .HeaderNavigation_item:hover .HeaderNavigation_anchor { color: var(--brand-green); }
150
+ .HeaderNavigation_active .HeaderNavigation_anchor { background: #efefef; font-weight: 700; }
151
+ .HeaderNavigation_flyout {
152
+ display: none; position: absolute; top: 100%; left: 0; z-index: 50;
153
+ background: #fff; border: 1px solid var(--rule); padding: 18px 22px;
154
+ min-width: 280px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
155
+ }
156
+ .HeaderNavigation_item:hover .HeaderNavigation_flyout { display: block; }
157
+ /* Two flyout shapes, matching the source: a flat single list, and a grouped
158
+ flyout whose columns are headed by Women's / Men's / Kids'. */
159
+ .HeaderNavSubMenu_list { list-style: none; margin: 0; padding: 0; min-width: 230px; }
160
+ .HeaderNavSubMenu_list-item a {
161
+ display: block; padding: 6px 0; font-size: 13px; line-height: 18px;
162
+ text-transform: none; color: var(--ink);
163
+ }
164
+ .HeaderNavigation_flyout-columns {
165
+ display: flex; gap: 44px; list-style: none; margin: 0; padding: 0;
166
+ }
167
+ .HeaderNavFlyoutMenu_column { min-width: 176px; }
168
+ .HeaderNavFlyoutMenu_group {
169
+ display: block; padding-bottom: 8px; margin-bottom: 6px;
170
+ border-bottom: 1px solid var(--rule-light);
171
+ font-size: 14px; font-weight: 700; text-transform: none; color: var(--ink-strong);
172
+ }
173
+ .HeaderNavFlyoutMenu_list { list-style: none; margin: 0; padding: 0; }
174
+ .HeaderNavFlyoutMenu_list-item a {
175
+ display: block; padding: 5px 0; font-size: 13px; line-height: 18px;
176
+ text-transform: none; color: var(--ink);
177
+ }
178
+
179
+ /* ------------------------------------------------------------------ main */
180
+
181
+ main { max-width: var(--content-width); margin: 0 auto; padding: 0 0 60px; }
182
+
183
+ .Breadcrumb_container {
184
+ display: flex; align-items: center; height: 65px; padding-left: 20px;
185
+ font-size: 14px; line-height: 20px; color: var(--ink);
186
+ }
187
+ .Breadcrumb_sep { margin: 0 6px; color: var(--grey-mid); }
188
+
189
+ /* ------------------------------------------------------------- home page */
190
+
191
+ .content.section.wcm-responsive { padding-top: 20px; }
192
+
193
+ .bgColorFs-061B49 {
194
+ background: var(--brand-navy); color: #fff; box-sizing: border-box;
195
+ height: 208px; padding: 36px 40px 0; margin: 0; text-align: center;
196
+ }
197
+ .wcm-hero-title {
198
+ margin: 0 0 8px; color: #fff; font-size: 30px; line-height: 38px;
199
+ font-weight: 700; letter-spacing: 0.2px;
200
+ }
201
+ .wcm-hero-title { font-weight: 400; }
202
+ .wcm-hero-title strong { font-weight: 700; }
203
+ .wcm-hero-sub { margin: 0 0 22px; font-size: 15px; line-height: 21px; }
204
+ .wcm-hero-sub strong { font-weight: 700; }
205
+ .wcm-hero-cta {
206
+ display: inline-block; padding: 13px 28px; background: #fff; color: var(--ink);
207
+ font-size: 14px; font-weight: 700; letter-spacing: 0.6px;
208
+ }
209
+ .wcm-hero-cta:hover { text-decoration: none; background: #f2f2f2; }
210
+
211
+ /* "Get More Bean for Your Buck" block: source box [0,422,1200,130] */
212
+ .wcm-copy-block--wide-gutter {
213
+ box-sizing: border-box; height: 130px; padding: 18px 40px 0; margin: 0;
214
+ text-align: center; overflow: hidden;
215
+ background-image: url("/static/img/home/bg-skyblue.png");
216
+ background-repeat: repeat; background-size: 40px 40px;
217
+ }
218
+ .wcm-lead-title {
219
+ margin: 0 0 2px; font-size: 40px; line-height: 48px; font-weight: 500;
220
+ letter-spacing: 0; color: var(--ink-muted);
221
+ }
222
+ .wcm-lead-copy { margin: 0 0 10px; font-size: 14px; line-height: 20px; }
223
+ .wcm-lead-cta {
224
+ display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
225
+ text-decoration: underline; color: var(--ink);
226
+ }
227
+ .wcm-card-chip {
228
+ display: inline-block; width: 46px; height: 30px; margin-right: 12px;
229
+ vertical-align: middle; border-radius: 4px;
230
+ background: linear-gradient(135deg, #2f6f5e 0 55%, #d8b13a 55% 100%);
231
+ }
232
+
233
+ /* Two 450px secondary banners at y=606 with their copy blocks beneath. */
234
+ .wcm-secondary-row {
235
+ display: grid; grid-template-columns: 450px 450px; gap: 90px;
236
+ justify-content: start; padding: 54px 0 0 105px; margin: 0 0 44px;
237
+ text-align: center;
238
+ }
239
+ .wcm-secondary-col { display: flex; flex-direction: column; align-items: center; width: 450px; }
240
+ .wcm-banner-baked { display: block; width: 450px; max-width: 100%; margin: 0; }
241
+ .wcm-banner-baked img { width: 450px; height: auto; }
242
+ .wcm-copy-block--no-outer-gutter {
243
+ width: 490px; margin: 0 -20px; padding: 14px 0 0; font-size: 14px; line-height: 20px;
244
+ }
245
+ .wcm-copy-block--no-outer-gutter p { margin: 0 0 10px; }
246
+ .wcm-offer-title { font-size: 20px; font-weight: 700; letter-spacing: 0.4px; }
247
+
248
+ .wcm-hero-image-block { margin: 0 0 44px; text-align: center; }
249
+ .wcm-hero-image-block img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
250
+ .wcm-hero-image-copy { width: 960px; margin: 0 auto; padding-top: 20px; }
251
+ .wcm-hero-image-links { display: flex; gap: 28px; justify-content: center; }
252
+ .wcm-hero-image-links a {
253
+ font-size: 13px; font-weight: 700; letter-spacing: 0.6px; text-decoration: underline;
254
+ }
255
+
256
+ .wcm-grid-container.wcm-grid-v2 {
257
+ display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
258
+ padding: 0 20px; margin: 0 0 44px; background: none;
259
+ }
260
+ .wcm-feature-tile { display: block; text-align: center; }
261
+ .wcm-feature-tile img { width: 100%; height: auto; aspect-ratio: 285 / 288; object-fit: cover; background: var(--rule-light); }
262
+ .wcm-feature-label {
263
+ display: block; margin-top: 10px; font-size: 13px; font-weight: 500;
264
+ text-transform: uppercase; text-decoration: underline; letter-spacing: 0.3px;
265
+ }
266
+
267
+ .wcm-copy-block, .wcm-promo-background-container, .wcm-banner-baked { margin: 0 0 44px; }
268
+ .wcm-section-title {
269
+ font-size: 24px; line-height: 30px; text-transform: uppercase;
270
+ letter-spacing: 0.6px; color: var(--brand-green); margin: 0 0 20px; padding: 0 20px;
271
+ }
272
+ .wcm-copy-block .ProductThumbnailList_list,
273
+ .wcm-promo-background-container .ProductThumbnailList_list { padding: 0 20px; }
274
+
275
+ /* ----------------------------------------------------- category + search */
276
+
277
+ .CategoryPage_title, .SearchResultsPage_title {
278
+ font-size: 26px; line-height: 38px; color: var(--ink); font-weight: 700;
279
+ margin: 0 0 5px;
280
+ }
281
+ .CategoryPage_container { padding-top: 4px; }
282
+ .CategoryNavigation_section { margin-bottom: 34px; }
283
+ .CategoryNavigation_heading, .Filters_heading, .CategoryNavigation_section h2 {
284
+ font-size: 18px; line-height: 24px; color: var(--ink-strong);
285
+ text-transform: none; margin-bottom: 14px;
286
+ }
287
+ /* Sidebar geometry measured on the source: column 167px wide, heading at
288
+ y=288, first item at y=319, items 15px/21px w400, wrapped items 56px tall. */
289
+ .CategoryNavigation_sidebar { width: 167px; font-size: 15px; line-height: 21px; }
290
+ .CategoryNavigation_heading {
291
+ height: 31px; margin: 0; font-size: 15px; line-height: 21px;
292
+ font-weight: 700; color: var(--ink-strong);
293
+ }
294
+ .CategoryNavigation_list { list-style: none; margin: 0 0 24px; padding: 0; }
295
+ .CategoryNavigation_list li { min-height: 35px; padding: 7px 0 0; }
296
+ .CategoryNavigation_list a { font-weight: 400; color: var(--ink); }
297
+ .CategoryNavigation_count { color: var(--ink); font-weight: 400; }
298
+
299
+ /* Tile rail measured on the source: banners 190x295 at x=231/435/639
300
+ (204px pitch, 14px gap), captions underlined beneath. */
301
+ .CategoryNavigation_tiles-rail { overflow-x: auto; margin: 0 0 26px; padding-left: 7px; }
302
+ .CategoryNavigation_tiles { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
303
+ .CategoryNavigation_tile { flex: 0 0 190px; }
304
+ .CategoryNavigation_tile a { display: block; text-align: center; }
305
+ .CategoryNavigation_tile img,
306
+ .CategoryNavigation_tile-placeholder {
307
+ display: block; width: 190px; height: 295px; object-fit: cover; background: var(--rule-light);
308
+ }
309
+ .CategoryNavigation_tile-label {
310
+ display: block; margin-top: 16px; font-size: 13px; font-weight: 400;
311
+ text-transform: uppercase; text-decoration: underline; letter-spacing: 0.3px;
312
+ }
313
+
314
+ .CategoryPage_body { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 0; }
315
+ .CategoryNavigation_sidebar { padding-left: 0; padding-right: 0; margin-left: 0; }
316
+
317
+ .FilterNavigation_container { font-size: 13px; }
318
+ .Filter_group { border-bottom: 1px solid var(--rule-light); padding: 14px 0; }
319
+ .Filter_group h3 {
320
+ font-size: 13px; font-weight: 700; text-transform: uppercase;
321
+ letter-spacing: 0.4px; margin-bottom: 10px;
322
+ }
323
+ .Filter_option { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
324
+ .SortOptions_select, .FormControl_input, select {
325
+ width: 100%; height: 36px; padding: 0 8px; font-family: var(--font-ui);
326
+ font-size: 13px; border: 1px solid var(--ink-muted); background: #fff;
327
+ }
328
+ .Filter_actions { display: flex; align-items: center; gap: 14px; padding-top: 16px; }
329
+ .Filter_clear { font-size: 12px; text-decoration: underline; color: var(--link); }
330
+
331
+ .ThumbnailHeader_header {
332
+ display: flex; align-items: center; justify-content: space-between;
333
+ border-top: 1px solid var(--rule); padding: 14px 0; margin-bottom: 4px;
334
+ }
335
+ .SortOptions_form { display: flex; align-items: center; gap: 10px; }
336
+ .SortOptions_label { font-size: 13px; color: var(--ink-muted); }
337
+ .SortOptions_form .SortOptions_select { width: 178px; height: 30px; }
338
+ .ThumbnailHeader_title { font-size: 20px; line-height: 26px; color: var(--ink-strong); margin: 0 0 16px; }
339
+ .ThumbnailHeader_count { font-size: 13px; color: var(--ink-muted); }
340
+
341
+ /* Search tabs measured on the source: "Products (45)" at [20,289] 16px w700
342
+ green, "Info & Stories (8)" alongside at 16px w400 black. */
343
+ .Tab_list {
344
+ display: flex; align-items: center; gap: 0;
345
+ padding: 0 0 0 20px; margin: 0 0 12px;
346
+ }
347
+ .Tab_tab {
348
+ padding: 12px 20px 12px 0; font-size: 16px; line-height: 17px;
349
+ font-weight: 400; color: var(--ink-strong);
350
+ }
351
+ .Tab_active { font-weight: 700; color: var(--brand-green); }
352
+ .SearchResultsPage_container { padding-top: 8px; }
353
+ .SearchResultsPage_title { padding-left: 214px; }
354
+ /* Search results are a three-up grid of 309px tiles, unlike the four-up
355
+ category grid. */
356
+ .SearchProducts_container .ProductThumbnailList_list { grid-template-columns: repeat(3, 309px); }
357
+
358
+ /* ------------------------------------------------------- product thumbs */
359
+
360
+ .ProductThumbnailList_list {
361
+ display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px 16px;
362
+ list-style: none; margin: 0; padding: 0;
363
+ }
364
+ .ProductThumbnail_container { display: flex; flex-direction: column; }
365
+ .ProductThumbnail_product img {
366
+ width: 100%; height: auto; aspect-ratio: 302 / 352;
367
+ background: var(--rule-light);
368
+ }
369
+ .ProductThumbnail_name {
370
+ margin-top: 10px; font-size: 13px; line-height: 18px; color: var(--ink);
371
+ }
372
+ .ProductThumbnail_price { margin-top: 6px; font-size: 13px; font-weight: 500; }
373
+ .ProductThumbnail_price .sale { color: var(--sale); margin-right: 4px; }
374
+ .ProductThumbnail_color-count { margin-top: 4px; font-size: 12px; color: var(--ink-muted); }
375
+ .ProductThumbnail_more { margin: 34px 0; text-align: center; }
376
+ .ProductThumbnailList_more { margin: 34px 0; text-align: center; }
377
+
378
+ .ColorSwatches_wrapper { margin-top: 10px; }
379
+ .ColorSwatches_list-container { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
380
+ .ColorSwatches_list-container fieldset { border: none; margin: 0; padding: 0; }
381
+ .ColorSwatches_wrapper fieldset { border: none; margin: 0; padding: 0; }
382
+ .ColorSwatches_dot {
383
+ display: inline-block; width: 18px; height: 18px; border: 1px solid var(--rule);
384
+ background: var(--rule-light);
385
+ }
386
+ .ColorSwatches_dot[data-color="Black"] { background: #1b1b1b; }
387
+ .ColorSwatches_dot[data-color="Blue"] { background: #2a4b7c; }
388
+ .ColorSwatches_dot[data-color="Brown"] { background: #6b4a2f; }
389
+ .ColorSwatches_dot[data-color="Gray"] { background: #8a8d8f; }
390
+ .ColorSwatches_dot[data-color="Green"] { background: #3f5d3a; }
391
+ .ColorSwatches_dot[data-color="Orange"] { background: #cf6321; }
392
+ .ColorSwatches_dot[data-color="Pink"] { background: #d98a9c; }
393
+ .ColorSwatches_dot[data-color="Purple"] { background: #6a5182; }
394
+ .ColorSwatches_dot[data-color="Red"] { background: #a8272c; }
395
+ .ColorSwatches_dot[data-color="Tan"] { background: #c9b191; }
396
+ .ColorSwatches_dot[data-color="White"] { background: #f4f2ee; }
397
+ .ColorSwatches_dot[data-color="Yellow"] { background: #d8b13a; }
398
+ .ColorSwatches_dot[data-color="Multicolor"] {
399
+ background: linear-gradient(135deg, #a8272c 0 33%, #2a4b7c 33% 66%, #3f5d3a 66% 100%);
400
+ }
401
+
402
+ /* Star rating uses the source's two-layer clip technique. */
403
+ .Rating_ratings {
404
+ position: relative; display: inline-block; margin-top: 8px;
405
+ font-size: 13px; line-height: 1; white-space: nowrap;
406
+ }
407
+ .Rating_bottom { color: var(--rule); }
408
+ .Rating_top {
409
+ position: absolute; top: 0; left: 0; overflow: hidden; color: #f0a500;
410
+ }
411
+ .Rating_ratings i { font-style: normal; letter-spacing: 1px; }
412
+ .Rating_count { font-size: 12px; color: var(--link); text-decoration: underline; margin-top: 4px; }
413
+
414
+ /* ------------------------------------------------------------------ PDP */
415
+
416
+ .NewProductHero_product-hero-container-v2 {
417
+ display: grid; grid-template-columns: 80px minmax(0, 1fr) 470px;
418
+ gap: 30px; align-items: start; padding-left: 20px; margin-bottom: 44px;
419
+ }
420
+ .NewThumbnailImageDisplay_thumb {
421
+ display: block; width: 80px; margin-bottom: 8px; padding: 0;
422
+ border: 1px solid var(--rule); background: #fff;
423
+ }
424
+ .NewThumbnailImageDisplay_thumb:first-child { border-color: var(--brand-green); }
425
+ .NewThumbnailImageDisplay_thumb img { width: 78px; height: 90px; object-fit: contain; }
426
+ .NewPrimaryImageDisplay_container { position: relative; }
427
+ .NewPrimaryImageDisplay_container img { aspect-ratio: 640 / 738; background: var(--rule-light); }
428
+ .NewImagePerspective_button {
429
+ position: absolute; right: 10px; bottom: 10px; padding: 6px 12px;
430
+ border: 1px solid var(--ink-muted); background: rgba(255, 255, 255, 0.9); font-size: 12px;
431
+ }
432
+ .ProductHeader_product-name { font-size: 26px; line-height: 33px; font-weight: 400; color: var(--ink-strong); margin-bottom: 10px; }
433
+ .ProductHeader_item-row {
434
+ display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
435
+ font-size: 12px; color: var(--ink-muted); margin-bottom: 16px;
436
+ }
437
+ .ProductRating_button { border: none; background: none; padding: 0; }
438
+ .ProductHeader_price { font-size: 24px; font-weight: 700; margin: 18px 0 14px; }
439
+ .ProductHeader_current { color: var(--ink); }
440
+ .ProductHeader_card-offer { margin: 0 0 20px; font-size: 14px; line-height: 21px; }
441
+ .ProductHeader_card-offer a { text-decoration: underline; }
442
+ .ProductHeader_save { color: var(--sale); }
443
+ .ProductHeader_card-offer .wcm-card-chip { width: 40px; height: 26px; margin-right: 8px; }
444
+ .QuestionTitle_row--sale { margin-top: 14px; }
445
+ .QuestionTitle_sale-price { color: var(--sale); font-weight: 700; }
446
+ .ProductHeader_sale { color: var(--sale); margin-right: 10px; }
447
+ .ProductHeader_was { text-decoration: line-through; color: var(--ink-muted); font-size: 16px; }
448
+
449
+ .QuestionBase_group { border-top: 1px solid var(--rule-light); padding: 16px 0; }
450
+ .QuestionTitle_row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
451
+ .QuestionTitle_primary-title { font-weight: 700; font-size: 14px; }
452
+ .QuestionTitle_price { font-size: 14px; font-weight: 700; }
453
+ .QuestionTitle_secondary-title { font-size: 14px; color: var(--ink); }
454
+ .ColorSwatches_pdp li label { display: block; cursor: pointer; }
455
+ .ColorSwatches_pdp input { position: absolute; opacity: 0; }
456
+ .ColorSwatches_pdp input:checked + img,
457
+ .ColorSwatches_pdp input:checked + .ColorSwatches_dot { outline: 2px solid var(--brand-green); outline-offset: 2px; }
458
+ .ColorSwatches_pdp { gap: 8px; flex-wrap: wrap; }
459
+ .ColorSwatches_pdp .ColorSwatches_dot, .ColorSwatches_pdp img {
460
+ width: 72px; height: 90px; border: 1px solid var(--rule); object-fit: contain; background: #fff;
461
+ }
462
+ .ColorSwatches_pdp input:checked + img,
463
+ .ColorSwatches_pdp input:checked + .ColorSwatches_dot {
464
+ outline: 2px solid #c8641e; outline-offset: -2px;
465
+ }
466
+
467
+ .SizeOptions_list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
468
+ .SizeOptions_option {
469
+ display: inline-flex; align-items: center; justify-content: center;
470
+ min-width: 48px; height: 38px; padding: 0 10px;
471
+ border: 1px solid var(--ink-muted); font-size: 13px; cursor: pointer;
472
+ }
473
+ .SizeOptions_option input { position: absolute; opacity: 0; }
474
+ .SizeOptions_option:has(input:checked) { border-color: var(--brand-green); border-width: 2px; }
475
+ .SizeOptions_disabled { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }
476
+
477
+ .Quantity_container { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
478
+ .Quantity_qty-label { font-size: 13px; font-weight: 500; }
479
+ .Quantity_container select { width: 88px; }
480
+ .AddToBag_low-inventory { color: var(--sale); font-size: 13px; margin: 0 0 10px; }
481
+
482
+ .AddToBag_add-to-bag-button {
483
+ display: inline-block; width: 460px; max-width: 100%; height: 48px;
484
+ border: none; background: var(--brand-green); color: #fff;
485
+ font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
486
+ }
487
+ .AddToBag_add-to-bag-button:hover { background: #0a4534; }
488
+ .AddToWishList_form { margin-top: 12px; }
489
+
490
+ .ProductInformation_container { border-top: 1px solid var(--rule); padding-top: 26px; }
491
+ .ProductInformation_header { font-size: 22px; }
492
+ .ProductInformation_description { max-width: 820px; }
493
+ .Accordion_section { border-top: 1px solid var(--rule-light); padding: 14px 0; }
494
+ .ProductInformation_return-policy-link { color: var(--link); text-decoration: underline; }
495
+
496
+ .CustomerReviews_container { border-top: 1px solid var(--rule); margin-top: 34px; padding-top: 26px; }
497
+ .NewReviewHeader_summary { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
498
+ .RatingFilters_histogram { max-width: 460px; margin-bottom: 24px; }
499
+ .RatingFilters_row {
500
+ display: grid; grid-template-columns: 64px 1fr 60px 40px; align-items: center;
501
+ gap: 10px; padding: 3px 0; font-size: 12px;
502
+ }
503
+ .RatingFilters_bar { background: var(--rule-light); height: 10px; display: block; }
504
+ .RatingFilters_bar span { display: block; height: 10px; background: #f0a500; }
505
+ .ReviewFilters_form { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
506
+ .ReviewFilters_form select { width: 200px; }
507
+ .NewReviewList_list { list-style: none; margin: 0; padding: 0; }
508
+ .NewReviewList_item { border-top: 1px solid var(--rule-light); padding: 16px 0; }
509
+ .NewReviewHeader_row { display: flex; align-items: center; gap: 10px; }
510
+ .NewReviewHeader_title { font-weight: 700; }
511
+ .NewAuthorInformation_author, .ReviewFeedback_row { font-size: 12px; color: var(--ink-muted); }
512
+
513
+ .OptiversalRelatedPages_container { border-top: 1px solid var(--rule); margin-top: 34px; padding-top: 26px; }
514
+
515
+ /* ----------------------------------------------------------------- cart */
516
+
517
+ .ShoppingBagHeader_heading { font-size: 26px; color: var(--brand-green); margin: 22px 0 18px; }
518
+ .Cart_body { display: grid; grid-template-columns: 1fr 340px; gap: 34px; align-items: start; }
519
+ .Cart_free-shipping { margin-bottom: 22px; }
520
+ .Progress_bar { height: 8px; background: var(--rule-light); }
521
+ .Progress_bar span { display: block; height: 8px; background: var(--brand-green); }
522
+ .Progress_labels { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; }
523
+ .Cart_free-shipping-text { color: var(--brand-green); font-weight: 500; font-size: 13px; }
524
+
525
+ .CartItem_container img { aspect-ratio: 120 / 140; background: var(--rule-light); }
526
+ .CartItem_container {
527
+ display: grid; grid-template-columns: 120px 1fr; gap: 18px;
528
+ border-top: 1px solid var(--rule-light); padding: 18px 0;
529
+ }
530
+ .CartItem_name { font-size: 15px; font-weight: 500; }
531
+ .CartItem_attributes, .CartItem_price { font-size: 13px; color: var(--ink-muted); margin: 6px 0; }
532
+ .CartItem_price span { color: var(--ink); font-weight: 500; margin-left: 6px; }
533
+ .CartItem_inventory { color: var(--sale); font-size: 13px; }
534
+ .Quantity_form { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
535
+ .Quantity_form button {
536
+ width: 30px; height: 30px; border: 1px solid var(--ink-muted); background: #fff; font-size: 16px;
537
+ }
538
+ .Quantity_value { font-size: 13px; }
539
+ .CartItem_actions { display: flex; gap: 12px; }
540
+ .CartItem_saved { grid-template-columns: 1fr auto auto; align-items: center; }
541
+
542
+ .EmptyCart_container { padding: 34px 0; }
543
+ .EmptyCart_text { font-size: 15px; margin-bottom: 16px; }
544
+ .SaveForLaterWrapper_container { border-top: 1px solid var(--rule); margin-top: 26px; padding-top: 18px; }
545
+ .SaveForLaterWrapper_heading { font-size: 18px; color: var(--ink-strong); }
546
+ .SaveForLaterWrapper_empty-text-container { font-size: 13px; color: var(--ink-muted); }
547
+
548
+ .OrderSummary_container { border: 1px solid var(--rule); padding: 20px; }
549
+ .OrderSummary_header { font-size: 18px; color: var(--ink-strong); }
550
+ .OrderSummary_row { display: flex; justify-content: space-between; font-size: 13px; margin: 8px 0; }
551
+ .OrderSummary_total { font-weight: 700; font-size: 15px; border-top: 1px solid var(--rule); padding-top: 10px; }
552
+ .OrderSummary_discount span:last-child { color: var(--sale); }
553
+ .CheckoutOptions_container { margin: 18px 0; text-align: center; }
554
+ .CheckoutOptions_options-separator { display: block; margin: 10px 0; font-size: 12px; color: var(--ink-muted); }
555
+ .OrderPromotions_promotion-header { font-size: 13px; font-weight: 700; }
556
+ .OrderPromotions_input { width: 100%; height: 36px; margin-bottom: 8px; padding: 0 8px; border: 1px solid var(--ink-muted); }
557
+ .OrderPromotions_applied { font-size: 12px; color: var(--brand-green); }
558
+ .Cart_shopping-bag-id { font-size: 11px; color: var(--grey-mid); margin-top: 16px; }
559
+ .RecentlyViewedList_container { border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 22px; }
560
+ .RecentlyViewedList_heading { font-size: 18px; color: var(--ink-strong); }
561
+ .Cart_message { color: var(--brand-green); font-size: 13px; }
562
+ .Cart_error, .FormControl_error { color: var(--sale); font-size: 13px; }
563
+
564
+ /* -------------------------------------------------------------- buttons */
565
+
566
+ .Button_buttonComponent {
567
+ display: inline-flex; align-items: center; justify-content: center;
568
+ height: 40px; padding: 0 22px; border: 1px solid var(--brand-green);
569
+ background: #fff; color: var(--brand-green);
570
+ font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
571
+ }
572
+ .Button_buttonComponent:hover { text-decoration: none; }
573
+ .Button_primary, .Button_transactional { background: var(--brand-green); color: #fff; }
574
+ .Button_primary:hover, .Button_transactional:hover { background: #0a4534; }
575
+ .Button_secondary { background: #fff; color: var(--brand-green); }
576
+ .Button_large { height: 48px; padding: 0 34px; }
577
+ .Button_small { height: 32px; padding: 0 14px; font-size: 12px; }
578
+ .Button_disabled { opacity: 0.45; pointer-events: none; }
579
+
580
+ /* -------------------------------------------------------------- account */
581
+
582
+ .Account_page, .PurchaseHistoryPage_container {
583
+ display: grid; grid-template-columns: 260px 1fr; gap: 34px; padding-top: 22px;
584
+ }
585
+ .AccountLeftNav_container { border-right: 1px solid var(--rule-light); padding-right: 20px; }
586
+ .AccountLeftNav_heading { font-size: 18px; color: var(--brand-green); }
587
+ .AccountLeftNav_list { list-style: none; margin: 0; padding: 0; }
588
+ .AccountLeftNav_list a { display: block; padding: 7px 0; font-size: 13px; }
589
+ .Account_body h1 { font-size: 26px; color: var(--brand-green); }
590
+ .Account_body h2 { font-size: 18px; color: var(--ink-strong); margin-top: 24px; }
591
+ .Account_orders, .Account_addresses, .Order_items, .Stores_list, .Collections_list {
592
+ list-style: none; margin: 0; padding: 0;
593
+ }
594
+ .Account_orders li, .Order_items li { padding: 8px 0; border-bottom: 1px solid var(--rule-light); }
595
+ .Address_card {
596
+ display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
597
+ border: 1px solid var(--rule); padding: 14px; margin-bottom: 12px; max-width: 520px;
598
+ }
599
+ .FormControl_label { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 4px; max-width: 420px; }
600
+ .FormControl_label .FormControl_input, .FormControl_label select { margin-top: 4px; }
601
+ .Address_form, .SignIn_form, .CatalogRequest_container form, .GiftCard_container form,
602
+ .Checkout_container form, .LookupForms_container form { max-width: 420px; }
603
+ .LookupForms_container { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 26px; }
604
+
605
+ .SignIn_container, .GiftCard_container, .CatalogRequest_container, .Checkout_container,
606
+ .Stores_container, .Content_page, .Collections_container { padding-top: 22px; max-width: 900px; }
607
+ .SignIn_heading, .Stores_container h1, .GiftCard_container h1, .CatalogRequest_container h1,
608
+ .Checkout_container h1, .Content_page h1, .Collections_container h1 {
609
+ font-size: 26px; color: var(--brand-green);
610
+ }
611
+ .SignIn_demo, .GiftCard_demo, .Checkout_sandbox {
612
+ margin-top: 20px; padding: 12px 14px; background: var(--rule-light); font-size: 12px;
613
+ }
614
+ .Stores_form { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 22px; }
615
+ .Stores_form .FormControl_label { margin-bottom: 0; }
616
+ .Store_card { border: 1px solid var(--rule); padding: 14px; margin-bottom: 12px; max-width: 520px; }
617
+ .Store_card h2 { font-size: 16px; color: var(--ink-strong); margin-bottom: 6px; }
618
+ .Collections_group { margin-bottom: 26px; }
619
+ .Collections_list { columns: 3; column-gap: 28px; }
620
+ .Collections_list a { display: block; padding: 4px 0; font-size: 13px; }
621
+ .NoSearchResults_container { padding: 30px 0; }
622
+ .NoSearchResults_title { font-size: 28px; color: var(--brand-green); }
623
+ .NoSearchResults_subtitle { font-size: 18px; color: var(--ink); }
624
+ .WebRecommendationsList_heading { font-size: 18px; margin: 26px 0 14px; }
625
+ .ContentThumbnailList_list { list-style: none; margin: 0; padding: 0; }
626
+ .ContentThumbnail_container { border-bottom: 1px solid var(--rule-light); padding: 12px 0; }
627
+
628
+ /* ------------------------------------------------------- added-to-bag UI */
629
+
630
+ .ModalSlider_modal-backdrop {
631
+ position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 200;
632
+ display: flex; justify-content: flex-end;
633
+ }
634
+ .ModalSlider_panel { width: 380px; background: #fff; padding: 26px; overflow: auto; }
635
+ .ModalSlider_title { font-size: 20px; color: var(--brand-green); }
636
+ .ModalSlider_free-shipping { color: var(--brand-green); font-weight: 500; font-size: 13px; }
637
+
638
+ /* ---------------------------------------------------------------- footer */
639
+
640
+ .Footer_footer-container { border-top: 1px solid var(--rule); background: #fff; margin-top: 40px; }
641
+ .Footer_columns {
642
+ display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
643
+ max-width: var(--content-width); margin: 0 auto; padding: 34px 12px;
644
+ }
645
+ .Footer_heading { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
646
+ .Footer_column a { display: block; padding: 6px 0; font-size: 13px; line-height: 18.5714px; color: var(--ink-muted); }
647
+ .EmailSubmissionForm_subhead { font-size: 13px; color: var(--ink-muted); }
648
+ .EmailSubmissionForm_form { display: flex; gap: 8px; margin: 10px 0; }
649
+ .EmailSubmissionForm_input { flex: 1; height: 38px; padding: 0 10px; border: 1px solid var(--ink-muted); font-family: var(--font-ui); }
650
+ .EmailSubmissionForm_button { height: 38px; padding: 0 16px; border: none; background: var(--brand-green); color: #fff; font-size: 12px; text-transform: uppercase; }
651
+ .EmailSubmissionForm_privacy-policy { font-size: 11px; color: var(--ink-muted); }
652
+ .Footer_legal {
653
+ border-top: 1px solid var(--rule-light); font-size: 12px; color: var(--ink-muted);
654
+ max-width: var(--content-width); margin: 0 auto; padding: 16px 12px;
655
+ display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
656
+ }
657
+ .Footer_copyright { margin-left: auto; }
658
+
659
+ /* Home block stacking: the source runs the navy hero straight into the lead
660
+ copy block with no gap, so these beat the generic .wcm-copy-block margin. */
661
+ .wcm-copy-block.bgColorFs-061B49 { margin: 0; }
662
+ .wcm-copy-block.wcm-copy-block--wide-gutter { margin: 0; }
663
+ .wcm-secondary-col .wcm-copy-block.wcm-copy-block--no-outer-gutter { margin: 0 -20px; }
664
+
665
+
666
+ /* ------------------------------------------------------- editorial landers */
667
+
668
+ .LanderPage_main { padding-bottom: 40px; }
669
+ .LanderPage_title {
670
+ padding-left: 20px; margin: 0 0 10px;
671
+ font-size: 30px; line-height: 38px; font-weight: 700; color: var(--ink);
672
+ }
673
+ .LanderPage_intro {
674
+ max-width: 860px; margin: 0 0 34px; padding-left: 20px;
675
+ font-size: 15px; line-height: 23px; color: var(--ink);
676
+ }
677
+ .LanderPage_section { margin: 0 0 44px; padding: 0 20px; }
678
+ .LanderPage_section-heading {
679
+ margin: 0 0 18px; font-size: 24px; line-height: 30px;
680
+ font-weight: 700; color: var(--brand-green);
681
+ }
682
+ .LanderPage_section-heading a { color: inherit; text-decoration: underline; }
683
+ .LanderPage_prose { max-width: 860px; font-size: 15px; line-height: 23px; margin: 0 0 18px; }
684
+ .LanderPage_tiles {
685
+ display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 24px;
686
+ list-style: none; margin: 0; padding: 0;
687
+ }
688
+ .LanderPage_tile-body { display: block; color: inherit; }
689
+ .LanderPage_tile img {
690
+ width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
691
+ background: var(--rule-light);
692
+ }
693
+ .LanderPage_tile-label {
694
+ display: block; margin-top: 12px; font-size: 14px; font-weight: 700;
695
+ letter-spacing: 0.3px; text-transform: uppercase;
696
+ }
697
+ a.LanderPage_tile-body:hover .LanderPage_tile-label { text-decoration: underline; }
698
+ .LanderPage_tile-blurb {
699
+ display: block; margin-top: 6px; font-size: 13px; line-height: 19px;
700
+ color: var(--ink-muted); font-weight: 400; text-transform: none;
701
+ }
702
+ /* A tile whose only destination is external keeps its content but is not a control. */
703
+ .LanderPage_tile--static .LanderPage_tile-label { text-transform: uppercase; }
704
+ .LanderPage_tile--static { cursor: default; }
705
+
706
+
707
+ /* --------------------------------------------------- home page composition */
708
+
709
+ .wcm-video-container { position: relative; margin: 0 0 44px; }
710
+ .wcm-video { display: block; width: 100%; height: 600px; object-fit: cover; background: #000; }
711
+ /* The source centres the copy block on the video: video box [0,1013,1200,600],
712
+ copy 1245-1371 -- both centres land at ~1310. */
713
+ .wcm-video-overlay {
714
+ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
715
+ width: 530px; margin: 0; text-align: center; color: #fff;
716
+ }
717
+ .wcm-video-title {
718
+ margin: 0 0 10px; font-size: 36px; line-height: 39.6px; font-weight: 500;
719
+ color: #fff; letter-spacing: 0;
720
+ }
721
+ .wcm-video-sub {
722
+ margin: 0 0 22px; font-size: 20px; line-height: 28px; font-weight: 500; color: #fff;
723
+ }
724
+ .wcm-video-cta {
725
+ display: inline-block; min-width: 220px; height: 38px; padding: 0 18px;
726
+ border-radius: 3px; background: #fff; color: var(--ink);
727
+ font-size: 15px; line-height: 38px; font-weight: 500; letter-spacing: 0;
728
+ }
729
+ .wcm-video-cta:hover { text-decoration: none; background: #f2f2f2; }
730
+
731
+ .wcm-centred-copy { text-align: center; padding: 26px 20px; margin: 0 0 30px; }
732
+ .wcm-centred-title {
733
+ margin: 0 0 8px; font-size: 32px; line-height: 38.4px; font-weight: 500;
734
+ color: var(--ink-muted);
735
+ }
736
+ .wcm-centred-sub { margin: 0 0 14px; font-size: 15px; line-height: 22px; }
737
+
738
+ .wcm-cards-section { padding: 0 20px; margin: 0 0 44px; }
739
+ /* The section already owns the 20px gutter; a second gutter on the title is what
740
+ pushed it off the sub-heading's left edge (source: both lines start at x=20). */
741
+ .wcm-cards-section .wcm-section-title { padding: 0; }
742
+ .wcm-section-copy { margin: 0 0 20px; padding: 0; font-size: 15px; line-height: 22px; }
743
+ .wcm-section-title--plain { color: var(--ink-muted); text-transform: none; letter-spacing: 0; }
744
+
745
+ /* "Behind the Design" is a centred copy block, not a left-aligned rail header. */
746
+ .wcm-cards-section--behind-design { text-align: center; }
747
+ .wcm-cards-section--behind-design .wcm-section-title {
748
+ font-size: 36px; line-height: 39.6px; font-weight: 500; text-transform: none;
749
+ letter-spacing: 0; color: var(--ink-muted); margin: 0 0 10px;
750
+ }
751
+ .wcm-cards-section--behind-design .wcm-section-copy {
752
+ font-size: 20px; line-height: 28px; font-weight: 500; margin: 0 0 24px;
753
+ }
754
+ .wcm-card-rail {
755
+ display: flex; gap: 10px; list-style: none; margin: 0; padding: 0;
756
+ overflow-x: auto;
757
+ }
758
+ .wcm-card { flex: 0 0 300px; }
759
+ .wcm-card a { display: block; text-align: center; }
760
+ .wcm-card img {
761
+ display: block; width: 300px; height: 353px; object-fit: cover;
762
+ border-radius: 8px; background: var(--rule-light);
763
+ }
764
+ .wcm-card-label {
765
+ display: block; margin-top: 10px; font-size: 14px; font-weight: 500;
766
+ text-decoration: underline;
767
+ }
768
+ /* Behind the Design is a three-up grid, not a rail */
769
+ .wcm-card-rail--behind-design { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 20px; overflow: visible; }
770
+ .wcm-card-rail--behind-design .wcm-card { flex: none; }
771
+ .wcm-card-rail--behind-design img { width: 100%; height: auto; aspect-ratio: 373 / 275; }
772
+
773
+ /* #BeanOutsider is a left-aligned gallery strip. */
774
+ .wcm-ugc-section { text-align: left; }
775
+ .wcm-ugc-rail { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
776
+ .wcm-ugc-tile { flex: 0 0 270px; }
777
+ .wcm-ugc-tile a { display: block; }
778
+ .wcm-ugc-tile img {
779
+ display: block; width: 270px; height: 311px; object-fit: cover;
780
+ border-radius: 8px; background: var(--rule-light);
781
+ }
782
+
783
+ .wcm-quote-rail {
784
+ display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; overflow-x: auto;
785
+ }
786
+ .wcm-quote { flex: 0 0 542px; display: flex; gap: 18px; align-items: flex-start; }
787
+ .wcm-quote img { width: 251px; height: 238px; object-fit: cover; background: var(--rule-light); }
788
+ .wcm-quote-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 24px; }
789
+ .wcm-quote-text { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-muted); }
790
+
791
+ .wcm-recs-section { padding: 0 20px; margin: 0 0 44px; }
792
+ .wcm-recs-section .ProductThumbnailList_list {
793
+ display: flex; gap: 20px; overflow-x: auto; padding-bottom: 6px;
794
+ }
795
+ .wcm-recs-section .ProductThumbnail_container { flex: 0 0 184px; }
796
+ .wcm-recs-section .ProductThumbnail_product img { width: 184px; height: 212px; }
797
+ .wcm-recs-title {
798
+ margin: 0 0 18px; font-size: 22px; line-height: 24.2px; font-weight: 500;
799
+ color: var(--brand-green);
800
+ }
801
+
802
+ .wcm-shipping-strip {
803
+ display: flex; align-items: center; justify-content: center; gap: 14px;
804
+ padding: 18px 20px; margin: 0 0 20px; font-size: 14px;
805
+ }
806
+ .wcm-shipping-strip a { text-decoration: underline; font-weight: 700; }
807
+ .wcm-shipping-icon {
808
+ width: 96px; height: 55px; flex: 0 0 96px;
809
+ background: var(--rule-light); border-radius: 4px;
810
+ }
811
+
812
+ .wcm-favourites { padding: 0 20px; margin: 0 0 40px; text-align: center; }
813
+ .wcm-copy-block-link {
814
+ display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; margin: 0;
815
+ }
816
+ .wcm-copy-block-link a {
817
+ font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
818
+ text-transform: uppercase; text-decoration: underline;
819
+ }
tasks/llbean/environment/reference/clone/frontend/static/favicon.ico ADDED
tasks/llbean/environment/reference/clone/frontend/static/fonts.css ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* cyrillic-ext */
2
+ @font-face {
3
+ font-family: 'Lora';
4
+ font-style: normal;
5
+ font-weight: 400;
6
+ font-display: fallback;
7
+ src: url(/static/fonts/0QIvMX1D_JOuMwf7I_FMl_GW8g.woff2) format('woff2');
8
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
9
+ }
10
+ /* cyrillic */
11
+ @font-face {
12
+ font-family: 'Lora';
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ font-display: fallback;
16
+ src: url(/static/fonts/0QIvMX1D_JOuMw77I_FMl_GW8g.woff2) format('woff2');
17
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
18
+ }
19
+ /* math */
20
+ @font-face {
21
+ font-family: 'Lora';
22
+ font-style: normal;
23
+ font-weight: 400;
24
+ font-display: fallback;
25
+ src: url(/static/fonts/0QIvMX1D_JOuM3b7I_FMl_GW8g.woff2) format('woff2');
26
+ unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
27
+ }
28
+ /* symbols */
29
+ @font-face {
30
+ font-family: 'Lora';
31
+ font-style: normal;
32
+ font-weight: 400;
33
+ font-display: fallback;
34
+ src: url(/static/fonts/0QIvMX1D_JOuM2T7I_FMl_GW8g.woff2) format('woff2');
35
+ unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF;
36
+ }
37
+ /* vietnamese */
38
+ @font-face {
39
+ font-family: 'Lora';
40
+ font-style: normal;
41
+ font-weight: 400;
42
+ font-display: fallback;
43
+ src: url(/static/fonts/0QIvMX1D_JOuMwX7I_FMl_GW8g.woff2) format('woff2');
44
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
45
+ }
46
+ /* latin-ext */
47
+ @font-face {
48
+ font-family: 'Lora';
49
+ font-style: normal;
50
+ font-weight: 400;
51
+ font-display: fallback;
52
+ src: url(/static/fonts/0QIvMX1D_JOuMwT7I_FMl_GW8g.woff2) format('woff2');
53
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
54
+ }
55
+ /* latin */
56
+ @font-face {
57
+ font-family: 'Lora';
58
+ font-style: normal;
59
+ font-weight: 400;
60
+ font-display: fallback;
61
+ src: url(/static/fonts/0QIvMX1D_JOuMwr7I_FMl_E.woff2) format('woff2');
62
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
63
+ }
64
+ /* cyrillic-ext */
65
+ @font-face {
66
+ font-family: 'Lora';
67
+ font-style: normal;
68
+ font-weight: 700;
69
+ font-display: fallback;
70
+ src: url(/static/fonts/0QIvMX1D_JOuMwf7I_FMl_GW8g.woff2) format('woff2');
71
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
72
+ }
73
+ /* cyrillic */
74
+ @font-face {
75
+ font-family: 'Lora';
76
+ font-style: normal;
77
+ font-weight: 700;
78
+ font-display: fallback;
79
+ src: url(/static/fonts/0QIvMX1D_JOuMw77I_FMl_GW8g.woff2) format('woff2');
80
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
81
+ }
82
+ /* math */
83
+ @font-face {
84
+ font-family: 'Lora';
85
+ font-style: normal;
86
+ font-weight: 700;
87
+ font-display: fallback;
88
+ src: url(/static/fonts/0QIvMX1D_JOuM3b7I_FMl_GW8g.woff2) format('woff2');
89
+ unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
90
+ }
91
+ /* symbols */
92
+ @font-face {
93
+ font-family: 'Lora';
94
+ font-style: normal;
95
+ font-weight: 700;
96
+ font-display: fallback;
97
+ src: url(/static/fonts/0QIvMX1D_JOuM2T7I_FMl_GW8g.woff2) format('woff2');
98
+ unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF;
99
+ }
100
+ /* vietnamese */
101
+ @font-face {
102
+ font-family: 'Lora';
103
+ font-style: normal;
104
+ font-weight: 700;
105
+ font-display: fallback;
106
+ src: url(/static/fonts/0QIvMX1D_JOuMwX7I_FMl_GW8g.woff2) format('woff2');
107
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
108
+ }
109
+ /* latin-ext */
110
+ @font-face {
111
+ font-family: 'Lora';
112
+ font-style: normal;
113
+ font-weight: 700;
114
+ font-display: fallback;
115
+ src: url(/static/fonts/0QIvMX1D_JOuMwT7I_FMl_GW8g.woff2) format('woff2');
116
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
117
+ }
118
+ /* latin */
119
+ @font-face {
120
+ font-family: 'Lora';
121
+ font-style: normal;
122
+ font-weight: 700;
123
+ font-display: fallback;
124
+ src: url(/static/fonts/0QIvMX1D_JOuMwr7I_FMl_E.woff2) format('woff2');
125
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
126
+ }
127
+ /* cyrillic-ext */
128
+ @font-face {
129
+ font-family: 'Montserrat';
130
+ font-style: normal;
131
+ font-weight: 200;
132
+ font-display: fallback;
133
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2) format('woff2');
134
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
135
+ }
136
+ /* cyrillic */
137
+ @font-face {
138
+ font-family: 'Montserrat';
139
+ font-style: normal;
140
+ font-weight: 200;
141
+ font-display: fallback;
142
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2) format('woff2');
143
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
144
+ }
145
+ /* vietnamese */
146
+ @font-face {
147
+ font-family: 'Montserrat';
148
+ font-style: normal;
149
+ font-weight: 200;
150
+ font-display: fallback;
151
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2) format('woff2');
152
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
153
+ }
154
+ /* latin-ext */
155
+ @font-face {
156
+ font-family: 'Montserrat';
157
+ font-style: normal;
158
+ font-weight: 200;
159
+ font-display: fallback;
160
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2) format('woff2');
161
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
162
+ }
163
+ /* latin */
164
+ @font-face {
165
+ font-family: 'Montserrat';
166
+ font-style: normal;
167
+ font-weight: 200;
168
+ font-display: fallback;
169
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2) format('woff2');
170
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
171
+ }
172
+ /* cyrillic-ext */
173
+ @font-face {
174
+ font-family: 'Montserrat';
175
+ font-style: normal;
176
+ font-weight: 400;
177
+ font-display: fallback;
178
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2) format('woff2');
179
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
180
+ }
181
+ /* cyrillic */
182
+ @font-face {
183
+ font-family: 'Montserrat';
184
+ font-style: normal;
185
+ font-weight: 400;
186
+ font-display: fallback;
187
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2) format('woff2');
188
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
189
+ }
190
+ /* vietnamese */
191
+ @font-face {
192
+ font-family: 'Montserrat';
193
+ font-style: normal;
194
+ font-weight: 400;
195
+ font-display: fallback;
196
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2) format('woff2');
197
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
198
+ }
199
+ /* latin-ext */
200
+ @font-face {
201
+ font-family: 'Montserrat';
202
+ font-style: normal;
203
+ font-weight: 400;
204
+ font-display: fallback;
205
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2) format('woff2');
206
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
207
+ }
208
+ /* latin */
209
+ @font-face {
210
+ font-family: 'Montserrat';
211
+ font-style: normal;
212
+ font-weight: 400;
213
+ font-display: fallback;
214
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2) format('woff2');
215
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
216
+ }
217
+ /* cyrillic-ext */
218
+ @font-face {
219
+ font-family: 'Montserrat';
220
+ font-style: normal;
221
+ font-weight: 500;
222
+ font-display: fallback;
223
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2) format('woff2');
224
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
225
+ }
226
+ /* cyrillic */
227
+ @font-face {
228
+ font-family: 'Montserrat';
229
+ font-style: normal;
230
+ font-weight: 500;
231
+ font-display: fallback;
232
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2) format('woff2');
233
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
234
+ }
235
+ /* vietnamese */
236
+ @font-face {
237
+ font-family: 'Montserrat';
238
+ font-style: normal;
239
+ font-weight: 500;
240
+ font-display: fallback;
241
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2) format('woff2');
242
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
243
+ }
244
+ /* latin-ext */
245
+ @font-face {
246
+ font-family: 'Montserrat';
247
+ font-style: normal;
248
+ font-weight: 500;
249
+ font-display: fallback;
250
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2) format('woff2');
251
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
252
+ }
253
+ /* latin */
254
+ @font-face {
255
+ font-family: 'Montserrat';
256
+ font-style: normal;
257
+ font-weight: 500;
258
+ font-display: fallback;
259
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2) format('woff2');
260
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
261
+ }
262
+ /* cyrillic-ext */
263
+ @font-face {
264
+ font-family: 'Montserrat';
265
+ font-style: normal;
266
+ font-weight: 700;
267
+ font-display: fallback;
268
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2) format('woff2');
269
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
270
+ }
271
+ /* cyrillic */
272
+ @font-face {
273
+ font-family: 'Montserrat';
274
+ font-style: normal;
275
+ font-weight: 700;
276
+ font-display: fallback;
277
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2) format('woff2');
278
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
279
+ }
280
+ /* vietnamese */
281
+ @font-face {
282
+ font-family: 'Montserrat';
283
+ font-style: normal;
284
+ font-weight: 700;
285
+ font-display: fallback;
286
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2) format('woff2');
287
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
288
+ }
289
+ /* latin-ext */
290
+ @font-face {
291
+ font-family: 'Montserrat';
292
+ font-style: normal;
293
+ font-weight: 700;
294
+ font-display: fallback;
295
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2) format('woff2');
296
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
297
+ }
298
+ /* latin */
299
+ @font-face {
300
+ font-family: 'Montserrat';
301
+ font-style: normal;
302
+ font-weight: 700;
303
+ font-display: fallback;
304
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2) format('woff2');
305
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
306
+ }
307
+ /* cyrillic-ext */
308
+ @font-face {
309
+ font-family: 'Montserrat';
310
+ font-style: normal;
311
+ font-weight: 800;
312
+ font-display: fallback;
313
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2) format('woff2');
314
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
315
+ }
316
+ /* cyrillic */
317
+ @font-face {
318
+ font-family: 'Montserrat';
319
+ font-style: normal;
320
+ font-weight: 800;
321
+ font-display: fallback;
322
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2) format('woff2');
323
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
324
+ }
325
+ /* vietnamese */
326
+ @font-face {
327
+ font-family: 'Montserrat';
328
+ font-style: normal;
329
+ font-weight: 800;
330
+ font-display: fallback;
331
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2) format('woff2');
332
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
333
+ }
334
+ /* latin-ext */
335
+ @font-face {
336
+ font-family: 'Montserrat';
337
+ font-style: normal;
338
+ font-weight: 800;
339
+ font-display: fallback;
340
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2) format('woff2');
341
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
342
+ }
343
+ /* latin */
344
+ @font-face {
345
+ font-family: 'Montserrat';
346
+ font-style: normal;
347
+ font-weight: 800;
348
+ font-display: fallback;
349
+ src: url(/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2) format('woff2');
350
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
351
+ }
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuM2T7I_FMl_GW8g.woff2 ADDED
Binary file (17.3 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuM3b7I_FMl_GW8g.woff2 ADDED
Binary file (29.2 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMw77I_FMl_GW8g.woff2 ADDED
Binary file (21.3 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwT7I_FMl_GW8g.woff2 ADDED
Binary file (20.2 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwX7I_FMl_GW8g.woff2 ADDED
Binary file (8.91 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwf7I_FMl_GW8g.woff2 ADDED
Binary file (23.6 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/0QIvMX1D_JOuMwr7I_FMl_E.woff2 ADDED
Binary file (37.8 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 ADDED
Binary file (21.5 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 ADDED
Binary file (24.1 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 ADDED
Binary file (10.6 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 ADDED
Binary file (68.2 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/static/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 ADDED
Binary file (35.5 kB). View file
 
tasks/llbean/environment/reference/clone/frontend/templates/_account_nav.html ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <aside class="AccountLeftNav_container">
2
+ <h2 class="AccountLeftNav_heading">My Account</h2>
3
+ <ul class="AccountLeftNav_list">
4
+ {% for label, href in account_nav %}
5
+ <li><a href="{{ href }}">{{ label }}</a></li>
6
+ {% endfor %}
7
+ </ul>
8
+ </aside>
tasks/llbean/environment/reference/clone/frontend/templates/_macros.html ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#
2
+ Shared fragments. The product card reproduces the source
3
+ .ProductThumbnail_container contract recorded in scope/notes/02-recon-plp.md.
4
+ #}
5
+
6
+ {% macro stars(rating) %}
7
+ <span class="Rating_ratings Rating_small" aria-label="Rating: {{ '%.1f'|format(rating or 0) }} out of 5 stars">
8
+ <span class="Rating_top" style="width: {{ ((rating or 0) / 5 * 100)|round(2) }}%"><i>★</i><i>★</i><i>★</i><i>★</i><i>★</i></span>
9
+ <span class="Rating_bottom"><i>★</i><i>★</i><i>★</i><i>★</i><i>★</i></span>
10
+ </span>
11
+ {% endmacro %}
12
+
13
+ {% macro price_block(product) %}
14
+ <div class="ProductThumbnail_price">
15
+ {% if product.price_low != product.price_high %}
16
+ <span class="screenreader">Price range from: ${{ '%.2f'|format(product.price_low) }} to: ${{ '%.2f'|format(product.price_high) }}</span>
17
+ <span class="sale">${{ '%.2f'|format(product.price_low) }}</span>-<span>${{ '%.2f'|format(product.price_high) }}</span>
18
+ {% else %}
19
+ <span class="screenreader">Price: ${{ '%.2f'|format(product.price_low) }}</span>
20
+ <span>${{ '%.2f'|format(product.price_low) }}</span>
21
+ {% endif %}
22
+ </div>
23
+ {% endmacro %}
24
+
25
+ {% macro product_card(product) %}
26
+ <li class="ProductThumbnail_container">
27
+ <div class="ProductThumbnail_wrapper">
28
+ <div class="ProductThumbnail_product">
29
+ <a href="/llb/shop/{{ product.product_id }}{% if product.slug %}?page={{ product.slug }}{% endif %}">
30
+ <img src="{{ product.grid_image }}" width="302" height="352" loading="lazy"
31
+ alt="{{ product.grid_image_alt }}">
32
+ </a>
33
+ </div>
34
+ </div>
35
+ {% if product.colors %}
36
+ <div class="ColorSwatches_wrapper">
37
+ <div class="ColorSwatches_swatch-list">
38
+ <fieldset>
39
+ <legend class="screenreader">Colors</legend>
40
+ <ul class="ColorSwatches_list-container">
41
+ {% for color in product.colors[:6] %}
42
+ <li title="{{ color.name }}">
43
+ <a href="/llb/shop/{{ product.product_id }}?color={{ color.name|urlencode }}"
44
+ aria-label="{{ color.name }}, color {{ loop.index }} of {{ product.colors|length }}">
45
+ {% if color.swatch %}<img src="{{ color.swatch }}" width="18" height="18" alt="{{ color.name }}">
46
+ {% else %}<span class="ColorSwatches_dot" data-color="{{ color.bucket or 'Other' }}"></span>{% endif %}
47
+ </a>
48
+ </li>
49
+ {% endfor %}
50
+ </ul>
51
+ </fieldset>
52
+ </div>
53
+ </div>
54
+ {% endif %}
55
+ <a class="ProductThumbnail_name Anchor_not-underlined Anchor_anchor"
56
+ href="/llb/shop/{{ product.product_id }}{% if product.slug %}?page={{ product.slug }}{% endif %}">{{ product.name }}</a>
57
+ {{ price_block(product) }}
58
+ {% if product.color_count %}
59
+ <div class="ProductThumbnail_color-count">{{ product.color_count }} colors available</div>
60
+ {% endif %}
61
+ {{ stars(product.rating) }}
62
+ <a class="Rating_count Anchor_anchor" href="/llb/shop/{{ product.product_id }}#reviews">{{ product.review_count }}</a>
63
+ </li>
64
+ {% endmacro %}
65
+
66
+ {% macro product_grid(items) %}
67
+ <ul class="ProductThumbnailList_list">
68
+ {% for product in items %}{{ product_card(product) }}{% endfor %}
69
+ </ul>
70
+ {% endmacro %}
71
+
72
+ {#
73
+ The panel renders only the facets the source shows for this collection, in the
74
+ source's order. Every facet here filters against real local data, so no control
75
+ is inert.
76
+ #}
77
+ {% macro checkbox_group(title, name, options, selected) %}
78
+ {% if options %}
79
+ <div class="Filter_group">
80
+ <h3>{{ title }}</h3>
81
+ {% for opt in options %}
82
+ <label class="Filter_option">
83
+ <input type="checkbox" name="{{ name }}" value="{{ opt.name }}" {% if opt.name in selected %}checked{% endif %}>
84
+ {% if name == 'color' %}<span class="ColorSwatches_dot" data-color="{{ opt.name }}"></span>{% endif %}
85
+ {{ opt.name }} ({{ opt.count }})
86
+ </label>
87
+ {% endfor %}
88
+ </div>
89
+ {% endif %}
90
+ {% endmacro %}
91
+
92
+ {% macro facet_panel(facets, selected, sort_options, action, hidden) %}
93
+ <form class="FilterNavigation_panel" method="get" action="{{ action }}">
94
+ {% for key, value in (hidden or {}).items() %}<input type="hidden" name="{{ key }}" value="{{ value }}">{% endfor %}
95
+ <h2 class="Filters_heading">Filter By:</h2>
96
+
97
+ <div class="Filter_group">
98
+ <h3>Sort</h3>
99
+ <select name="sort_field" class="SortOptions_select" aria-label="Sort">
100
+ {% for key, label in sort_options.items() %}
101
+ <option value="{{ key }}" {% if selected.sort_field == key %}selected{% endif %}>{{ label }}</option>
102
+ {% endfor %}
103
+ </select>
104
+ </div>
105
+
106
+ {% for key in facets.order %}
107
+ {% if key == 'percent_off' %}
108
+ {{ checkbox_group('% Off', 'percent_off', facets.percent_off, selected.percent_off) }}
109
+ {% elif key == 'sale' and facets.sale %}
110
+ <div class="Filter_group">
111
+ <h3>Sale</h3>
112
+ <label class="Filter_option">
113
+ <input type="checkbox" name="sale" value="1" {% if selected.sale %}checked{% endif %}>
114
+ Sale ({{ facets.sale.count }})
115
+ </label>
116
+ </div>
117
+ {% elif key == 'new' and facets.new %}
118
+ <div class="Filter_group">
119
+ <h3>New Arrivals</h3>
120
+ <label class="Filter_option">
121
+ <input type="checkbox" name="new" value="1" {% if selected.new %}checked{% endif %}>
122
+ New Arrivals ({{ facets.new.count }})
123
+ </label>
124
+ </div>
125
+ {% elif key == 'gender' %}
126
+ {{ checkbox_group('Gender', 'gender', facets.gender, selected.gender) }}
127
+ {% elif key == 'size' %}
128
+ {{ checkbox_group('Size', 'size', facets.size, selected.size) }}
129
+ {% elif key == 'material' %}
130
+ {{ checkbox_group('Material', 'material', facets.material, selected.material) }}
131
+ {% elif key == 'color' %}
132
+ {{ checkbox_group('Color', 'color', facets.color, selected.color) }}
133
+ {% elif key == 'price' %}
134
+ {{ checkbox_group('Price', 'price', facets.price, selected.price) }}
135
+ {% elif key == 'brand' %}
136
+ {{ checkbox_group('Brand', 'brand', facets.brand, selected.brand) }}
137
+ {% endif %}
138
+ {% endfor %}
139
+
140
+ <div class="Filter_actions">
141
+ <button class="Button_buttonComponent Button_primary" type="submit">Apply Filters</button>
142
+ <a class="Filter_clear" href="{{ action }}">Clear All</a>
143
+ </div>
144
+ </form>
145
+ {% endmacro %}
146
+
147
+ {% macro load_more(batch, action, params) %}
148
+ {% if batch.has_more %}
149
+ <form class="ProductThumbnailList_more" method="get" action="{{ action }}">
150
+ {% for key, value in params.items() %}
151
+ {% if value is iterable and value is not string %}
152
+ {% for entry in value %}<input type="hidden" name="{{ key }}" value="{{ entry }}">{% endfor %}
153
+ {% else %}<input type="hidden" name="{{ key }}" value="{{ value }}">{% endif %}
154
+ {% endfor %}
155
+ <input type="hidden" name="start" value="{{ batch.next_start }}">
156
+ <input type="hidden" name="viewCount" value="{{ batch.view_count }}">
157
+ <input type="hidden" name="isLoadMore" value="true">
158
+ <button class="Button_buttonComponent Button_primary Button_large" type="submit">LOAD {{ [batch.view_count, batch.remaining]|min }} MORE</button>
159
+ </form>
160
+ {% endif %}
161
+ {% endmacro %}
tasks/llbean/environment/reference/clone/frontend/templates/account.html ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% block title %}My Account{% endblock %}
3
+ {% block content %}
4
+ <div class="Account_page">
5
+ {% include "_account_nav.html" %}
6
+ <section class="Account_body">
7
+ <h1>My Account</h1>
8
+ <p class="Account_greeting">Hi, {{ viewer.display_name }}. Welcome back.</p>
9
+ <h2>Recent Orders</h2>
10
+ {% if orders %}
11
+ <ul class="Account_orders">
12
+ {% for order in orders %}
13
+ <li><a href="/purchase/order/{{ order.order_id }}">Order {{ order.order_number }}</a>
14
+ &middot; {{ order.status }} &middot; ${{ '%.2f'|format(order.total) }}</li>
15
+ {% endfor %}
16
+ </ul>
17
+ {% else %}<p>You have no orders yet.</p>{% endif %}
18
+ <h2>Saved Addresses</h2>
19
+ {% if addresses %}
20
+ <ul class="Account_addresses">
21
+ {% for a in addresses %}<li>{{ a.first_name }} {{ a.last_name }}, {{ a.street1 }}, {{ a.city }} {{ a.state }} {{ a.postal }}</li>{% endfor %}
22
+ </ul>
23
+ {% else %}<p>No saved addresses.</p>{% endif %}
24
+ </section>
25
+ </div>
26
+ {% endblock %}
tasks/llbean/environment/reference/clone/frontend/templates/addresses.html ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% block title %}Saved Addresses{% endblock %}
3
+ {% block content %}
4
+ <div class="Account_page">
5
+ {% include "_account_nav.html" %}
6
+ <section class="Account_body">
7
+ <h1>Saved Addresses</h1>
8
+ {% if message %}<p class="Cart_message" role="status">{{ message }}</p>{% endif %}
9
+ {% if errors %}<p class="FormControl_error" role="alert">Please check these fields: {{ errors|join(', ') }}</p>{% endif %}
10
+ {% if addresses %}
11
+ <ul class="Account_addresses">
12
+ {% for a in addresses %}
13
+ <li class="Address_card">
14
+ <span>{{ a.first_name }} {{ a.last_name }}<br>{{ a.street1 }}{% if a.street2 %}, {{ a.street2 }}{% endif %}<br>{{ a.city }}, {{ a.state }} {{ a.postal }}<br>{{ a.country }}</span>
15
+ <form method="post" action="/account/addresses/delete">
16
+ <input type="hidden" name="address_id" value="{{ a.address_id }}">
17
+ <button class="Button_buttonComponent Button_secondary Button_small" type="submit">Remove</button>
18
+ </form>
19
+ </li>
20
+ {% endfor %}
21
+ </ul>
22
+ {% else %}<p>You have no saved addresses.</p>{% endif %}
23
+
24
+ <h2>Add an Address</h2>
25
+ <form class="Address_form" method="post" action="/account/addresses">
26
+ <label class="FormControl_label">First Name<input class="FormControl_input" name="first_name" required></label>
27
+ <label class="FormControl_label">Last Name<input class="FormControl_input" name="last_name" required></label>
28
+ <label class="FormControl_label">Street Address<input class="FormControl_input" name="street1" required></label>
29
+ <label class="FormControl_label">Apt / Suite<input class="FormControl_input" name="street2"></label>
30
+ <label class="FormControl_label">City<input class="FormControl_input" name="city" required></label>
31
+ <label class="FormControl_label">State<input class="FormControl_input" name="state" required></label>
32
+ <label class="FormControl_label">Zip/Postal Code<input class="FormControl_input" name="postal" required></label>
33
+ <label class="FormControl_label">Phone<input class="FormControl_input" name="phone"></label>
34
+ <button class="Button_buttonComponent Button_transactional" type="submit">Save Address</button>
35
+ </form>
36
+ </section>
37
+ </div>
38
+ {% endblock %}
tasks/llbean/environment/reference/clone/frontend/templates/base.html ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#
2
+ Global chrome. Structure and class names reproduce the source DOM walk
3
+ recorded in materials/llbean/scope/notes/03-recon-pdp.md.
4
+ #}<!doctype html>
5
+ <html lang="en">
6
+ <head>
7
+ <meta charset="utf-8">
8
+ <meta name="viewport" content="width=1200">
9
+ <title>{% block title %}{{ site_name }}{% endblock %}</title>
10
+ <link rel="icon" href="/static/favicon.ico" sizes="any">
11
+ <link rel="stylesheet" href="/static/fonts.css?v={{ asset_version }}">
12
+ <link rel="stylesheet" href="/static/css/site.css?v={{ asset_version }}">
13
+ </head>
14
+ <body>
15
+ <div class="AppEcom_container AppEcom_desktop">
16
+ <a class="AppEcom_skip-link" href="#content-anchor">Skip to main content</a>
17
+
18
+ {% if not hide_global_banner %}<div class="GlobalBanner_container">
19
+ <button class="GlobalBanner_arrow GlobalBanner_prev" type="button" aria-label="Previous offer">&#8249;</button>
20
+ <p class="GlobalBanner_message"><strong>GET 25% OFF TODAY</strong> upon approval with the L.L.Bean Mastercard. Limited time. <a href="/llb/shop/514535">Apply Now</a></p>
21
+ <button class="GlobalBanner_arrow GlobalBanner_next" type="button" aria-label="Next offer">&#8250;</button>
22
+ </div>{% endif %}
23
+
24
+ <header class="Header_header-container Header_new-arrivals-enabled">
25
+ <div class="utility-nav" role="toolbar" aria-label="toolbar">
26
+ <div class="UtilityNavigation_item">
27
+ <a class="UtilityNavigation_anchor" href="/llb/shop/510618" aria-label="Customer Service">Customer Service <span class="UtilityNavigation_caret">&#9662;</span></a>
28
+ <div class="DropdownMenu_menu">
29
+ <span class="DropdownMenu_cs-phone"><span>800-441-5713</span></span>
30
+ <a href="/llb/shop/510618">Help Center</a>
31
+ <a href="/purchase/history">Order Status</a>
32
+ <a href="/llb/shop/510624">Returns</a>
33
+ </div>
34
+ </div>
35
+ <a class="UtilityNavigation_anchor" href="/llb/shop/505">Gift Cards</a>
36
+ <a class="UtilityNavigation_anchor" href="/llb/shop/509870">Business Gifts &amp; Apparel</a>
37
+ <a class="UtilityNavigation_anchor" href="/llb/shop/20010535">L.L.Bean Rewards</a>
38
+ <a class="UtilityNavigation_anchor" href="/llb/shop/514535">L.L.Bean<sup>&reg;</sup> Mastercard<sup>&reg;</sup> <span class="UtilityNavigation_caret">&#9662;</span></a>
39
+ </div>
40
+
41
+ <div class="Header_main-row">
42
+ <a class="Logo_logo" href="/" aria-label="L.L.Bean">
43
+ <img class="Logo_icon" src="/static/img/icon/logo.svg" width="199" height="39" alt="L.L.Bean">
44
+ </a>
45
+
46
+ <form class="SearchForm_form" action="/llb/search" method="get" role="search">
47
+ <label class="screenreader" for="freeText">Search:</label>
48
+ <img class="SearchForm_icon" src="/static/img/icon/search.svg" width="21" height="21" alt="" aria-hidden="true">
49
+ <input class="SearchForm_search-input" id="freeText" name="freeText" type="text"
50
+ value="{{ query|default('') }}" placeholder="What can we help you find?" autocomplete="off">
51
+ <button class="SearchForm_button-icon screenreader" type="submit">Search</button>
52
+ </form>
53
+
54
+ <div class="Header_actions">
55
+ <a class="StoresLink_anchor" href="/llb/shop/1000001703" aria-label="Stores">
56
+ <img class="StoresLink_icon" src="/static/img/icon/stores.svg" width="21" height="30" alt="" aria-hidden="true">
57
+ <span class="StoresLink_text">Stores</span>
58
+ </a>
59
+ <div class="Account_wrapper">
60
+ <a class="Account_anchor" href="{% if viewer.signed_in %}/account{% else %}/webapp/wcs/stores/servlet/LogonForm{% endif %}" aria-label="Account">
61
+ <img class="Account_avatar" src="/static/img/icon/account.svg" width="34" height="35" alt="" aria-hidden="true">
62
+ {% if viewer.signed_in %}
63
+ <span class="Account_ntl-text">Hi, {{ viewer.display_name or 'there' }}</span>
64
+ {% else %}
65
+ <span class="Account_ntl-text">Log in</span>
66
+ {% endif %}
67
+ </a>
68
+ {% if viewer.signed_in %}
69
+ <form class="Account_signout" action="/account/signout" method="post">
70
+ <button type="submit" class="Account_signout-button">Sign Out</button>
71
+ </form>
72
+ {% endif %}
73
+ </div>
74
+ <a class="ShoppingBag_anchor" href="/shoppingbag" aria-label="Shopping bag">
75
+ <img class="ShoppingBag_icon" src="/static/img/icon/bag.svg" width="34" height="35" alt="" aria-hidden="true">
76
+ <span class="ShoppingBag_shoppingbag-title screenreader">Shopping Bag</span>{% if bag_count %}<span class="ShoppingBag_count">{{ bag_count }}</span>{% endif %}
77
+ </a>
78
+ </div>
79
+ </div>
80
+
81
+ <nav class="primary-nav" aria-label="Menu: Use arrows, tab, and escape to navigate">
82
+ <ul class="HeaderNavigation_list">
83
+ {% for top in nav %}
84
+ <li class="HeaderNavigation_item{% if active_cat_id and (top.cat_id == active_cat_id or top.cat_id == active_root_id) %} HeaderNavigation_active{% endif %}">
85
+ <a class="HeaderNavigation_anchor" href="/llb/shop/{{ top.cat_id }}{% if top.slug %}?page={{ top.slug }}{% endif %}"
86
+ role="button" aria-haspopup="{{ 'true' if top.columns or top.links else 'false' }}">{{ top.name }}</a>
87
+
88
+ {% if top.kind == 'grouped' and top.columns %}
89
+ <div class="HeaderNavigation_flyout HeaderNavFlyoutMenu">
90
+ <ul class="HeaderNavigation_flyout-columns">
91
+ {% for col in top.columns %}
92
+ <li class="HeaderNavFlyoutMenu_column">
93
+ <a class="HeaderNavFlyoutMenu_group" href="/llb/shop/{{ col.header.cat_id }}{% if col.header.slug %}?page={{ col.header.slug }}{% endif %}">{{ col.header.label }}</a>
94
+ <ul class="HeaderNavFlyoutMenu_list">
95
+ {% for link in col.links %}
96
+ <li class="HeaderNavFlyoutMenu_list-item">
97
+ <a href="/llb/shop/{{ link.cat_id }}{% if link.slug %}?page={{ link.slug }}{% endif %}">{{ link.label }}</a>
98
+ </li>
99
+ {% endfor %}
100
+ </ul>
101
+ </li>
102
+ {% endfor %}
103
+ </ul>
104
+ </div>
105
+ {% elif top.links %}
106
+ <div class="HeaderNavigation_flyout HeaderNavSubMenu">
107
+ <ul class="HeaderNavSubMenu_list">
108
+ {% for link in top.links %}
109
+ <li class="HeaderNavSubMenu_list-item">
110
+ <a href="/llb/shop/{{ link.cat_id }}{% if link.slug %}?page={{ link.slug }}{% endif %}">{{ link.label }}</a>
111
+ </li>
112
+ {% endfor %}
113
+ </ul>
114
+ </div>
115
+ {% endif %}
116
+ </li>
117
+ {% endfor %}
118
+ </ul>
119
+ </nav>
120
+ </header>
121
+
122
+ <main id="content-anchor">
123
+ {% block content %}{% endblock %}
124
+ </main>
125
+
126
+ <footer class="Footer_footer-container">
127
+ <div class="Footer_columns">
128
+ <div class="Footer_column">
129
+ <h3 class="Footer_heading">Customer Service</h3>
130
+ <a href="/llb/shop/510618">Help Center</a>
131
+ <a href="/freeshipping/">About Free Shipping</a>
132
+ <a href="/llb/shop/510623">More Shipping Information</a>
133
+ <a href="/llb/shop/513705">Our Guarantee</a>
134
+ <a href="/llb/shop/510624">Returns</a>
135
+ <a href="/purchase/history">Track Order</a>
136
+ <a href="/llb/shop/1000001703">Find a Store</a>
137
+ </div>
138
+ <div class="Footer_column">
139
+ <h3 class="Footer_heading">Company</h3>
140
+ <a href="/llb/shop/518342">Explore L.L.Bean</a>
141
+ <a href="/llb/shop/518345">Social Impact</a>
142
+ <a href="/llb/shop/517561">Inside L.L.Bean</a>
143
+ <a href="/llb/shop/516917">Our Company</a>
144
+ <a href="/catalog/request">Request a Catalog</a>
145
+ <a href="/llb/shop/20010535">L.L.Bean Rewards</a>
146
+ </div>
147
+ <div class="Footer_column">
148
+ <h3 class="Footer_heading">Gifts</h3>
149
+ <a href="/llb/shop/509870">Gift Shop</a>
150
+ <a href="/llb/shop/505">Gift Cards</a>
151
+ <a href="/giftcard/lookup">Gift Card Balance</a>
152
+ </div>
153
+ <div class="Footer_column Footer_email">
154
+ <h3 class="Footer_heading head">Sign Up for Email</h3>
155
+ <p class="EmailSubmissionForm_subhead">Enjoy exclusive offers, the latest on products, and new ways to get outside.</p>
156
+ <form class="EmailSubmissionForm_form" action="/catalog/request" method="get">
157
+ <input class="EmailSubmissionForm_input" type="email" name="email" placeholder="Email Address" aria-label="Email Address">
158
+ <button class="EmailSubmissionForm_button" type="submit">Sign Up</button>
159
+ </form>
160
+ <p class="EmailSubmissionForm_privacy-policy">By signing up, you agree to our <a href="/llb/shop/518583">Privacy Policy</a>.</p>
161
+ </div>
162
+ </div>
163
+ <div class="Footer_legal">
164
+ <a href="/llb/shop/518766">Site Map</a>
165
+ <a href="/buy/pt/index">Product Collections</a>
166
+ <a href="/llb/shop/518582">Security</a>
167
+ <a href="/llb/shop/518583">Privacy Policy</a>
168
+ <a href="/llb/shop/518522">Product Recalls</a>
169
+ <a href="/llb/shop/517941">Accessibility</a>
170
+ <span class="Footer_copyright">&copy; 2026 L.L.Bean, Inc. Offline WebsiteBench clone.</span>
171
+ </div>
172
+ </footer>
173
+ </div>
174
+ </body>
175
+ </html>
tasks/llbean/environment/reference/clone/frontend/templates/cart.html ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% import "_macros.html" as m %}
3
+ {% block title %}Shopping Bag{% endblock %}
4
+ {% block content %}
5
+ <div class="Cart_container" aria-label="Shopping Cart">
6
+ <h1 class="ShoppingBagHeader_heading">Shopping Bag{% if viewer.signed_in %} for {{ viewer.display_name }}{% endif %}</h1>
7
+ {% if message %}<p class="Cart_message" role="status">{{ message }}</p>{% endif %}
8
+ {% if error %}<p class="Cart_error" role="alert">{{ error }}</p>{% endif %}
9
+
10
+ <div class="Cart_body">
11
+ <section class="Cart_items">
12
+ {% if cart.empty %}
13
+ <div class="EmptyCart_container">
14
+ <p class="EmptyCart_text">Your shopping bag is empty.</p>
15
+ <a class="Button_buttonComponent Button_primary" href="/llb/shop/511742?page=new-arrivals">Shop New Arrivals</a>
16
+ </div>
17
+ {% else %}
18
+ <div class="Cart_free-shipping">
19
+ <div class="Progress_bar"><span style="width: {{ cart.progress }}%"></span></div>
20
+ <div class="Progress_labels"><span>$0</span><span>${{ cart.threshold|int }}</span></div>
21
+ {% if cart.free_shipping %}<p class="Cart_free-shipping-text">This order qualifies for FREE SHIPPING!</p>{% endif %}
22
+ </div>
23
+
24
+ {% for item in cart.lines %}
25
+ <div class="CartItem_container">
26
+ <a class="CartItem_image" href="/llb/shop/{{ item.product_id }}">
27
+ <img src="{{ item.grid_image }}" width="120" height="140" alt="{{ item.grid_image_alt }}">
28
+ </a>
29
+ <div class="CartItem_details">
30
+ <a class="CartItem_name" href="/llb/shop/{{ item.product_id }}">{{ item.name }}</a>
31
+ <p class="CartItem_attributes">Item: {{ item.item_number }}{% if item.color %} Color/Style: {{ item.color }}{% endif %}{% if item.size %} Size: {{ item.size }}{% endif %}</p>
32
+ <p class="CartItem_price">Item Price:<span>${{ '%.2f'|format(item.unit_price) }}</span></p>
33
+ {% if item.low_inventory %}<p class="CartItem_inventory">Hurry - Limited Quantities</p>{% endif %}
34
+
35
+ <form class="Quantity_form" method="post" action="/cart/update">
36
+ <input type="hidden" name="item_id" value="{{ item.item_id }}">
37
+ <span class="Quantity_qty-label">Quantity:</span>
38
+ <button type="submit" name="qty" value="{{ item.qty - 1 }}" aria-label="Decrease quantity">-</button>
39
+ <span class="Quantity_value">Quantity: {{ item.qty }}</span>
40
+ <button type="submit" name="qty" value="{{ item.qty + 1 }}" aria-label="Increase quantity">+</button>
41
+ </form>
42
+
43
+ <div class="CartItem_actions">
44
+ <form method="post" action="/cart/remove">
45
+ <input type="hidden" name="item_id" value="{{ item.item_id }}">
46
+ <button class="Button_buttonComponent Button_secondary Button_small" type="submit">Remove Item</button>
47
+ </form>
48
+ <form method="post" action="/cart/save">
49
+ <input type="hidden" name="item_id" value="{{ item.item_id }}">
50
+ <input type="hidden" name="saved" value="1">
51
+ <button class="Button_buttonComponent Button_secondary Button_small" type="submit">Save For Later</button>
52
+ </form>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ {% endfor %}
57
+ {% endif %}
58
+
59
+ <div class="SaveForLaterWrapper_container">
60
+ <h2 class="SaveForLaterWrapper_heading">Save For Later</h2>
61
+ {% if cart.saved %}
62
+ {% for item in cart.saved %}
63
+ <div class="CartItem_container CartItem_saved">
64
+ <a class="CartItem_name" href="/llb/shop/{{ item.product_id }}">{{ item.name }}</a>
65
+ <form method="post" action="/cart/save">
66
+ <input type="hidden" name="item_id" value="{{ item.item_id }}">
67
+ <input type="hidden" name="saved" value="0">
68
+ <button class="Button_buttonComponent Button_secondary Button_small" type="submit">Move to Bag</button>
69
+ </form>
70
+ <form method="post" action="/cart/remove">
71
+ <input type="hidden" name="item_id" value="{{ item.item_id }}">
72
+ <button class="Button_buttonComponent Button_secondary Button_small" type="submit">Remove Item</button>
73
+ </form>
74
+ </div>
75
+ {% endfor %}
76
+ {% else %}
77
+ <p class="SaveForLaterWrapper_empty-text-container">Nothing to see here yet! Select 'Save for Later' to keep track of items you're not ready to buy</p>
78
+ {% endif %}
79
+ </div>
80
+ </section>
81
+
82
+ <aside class="OrderSummary_container">
83
+ <h2 class="OrderSummary_header">Order Summary</h2>
84
+ <p class="OrderSummary_row"><span>{{ cart.units }} item{% if cart.units != 1 %}s{% endif %} in Bag:</span><span>${{ '%.2f'|format(cart.subtotal) }}</span></p>
85
+ {% if cart.empty %}
86
+ <p class="OrderSummary_row"><span>Est. Subtotal:</span><span>${{ '%.2f'|format(cart.subtotal) }}</span></p>
87
+ {% else %}
88
+ {% if cart.discount %}<p class="OrderSummary_row OrderSummary_discount"><span>Promotions:</span><span>-${{ '%.2f'|format(cart.discount) }}</span></p>{% endif %}
89
+ <p class="OrderSummary_row"><span>Est. Shipping &amp; Handling:</span><span>{% if cart.free_shipping %}FREE{% else %}${{ '%.2f'|format(cart.shipping) }}{% endif %}</span></p>
90
+ <p class="OrderSummary_row"><span>Est. Tax:</span><span>${{ '%.2f'|format(cart.tax) }}</span></p>
91
+ <p class="OrderSummary_row OrderSummary_total"><span>Est. Total:</span><span>${{ '%.2f'|format(cart.total) }}</span></p>
92
+ {% endif %}
93
+
94
+ <div class="CheckoutOptions_container">
95
+ <a class="Button_buttonComponent Button_transactional Button_large {% if cart.empty %}Button_disabled{% endif %}"
96
+ href="{% if cart.empty %}/shoppingbag{% else %}/checkout{% endif %}">CHECKOUT</a>
97
+ <span class="CheckoutOptions_options-separator">OR</span>
98
+ </div>
99
+
100
+ <form class="OrderPromotions_form" method="post" action="/cart/redeem">
101
+ <h3 class="OrderPromotions_promotion-header">Add Promo Code or Gift Card</h3>
102
+ <input class="OrderPromotions_input" type="text" name="code" aria-label="Promo code or gift card number">
103
+ <button class="Button_buttonComponent Button_secondary" type="submit">Redeem</button>
104
+ </form>
105
+
106
+ {% for promo in cart.promotions %}
107
+ <p class="OrderPromotions_applied">{{ promo.label }} ({{ promo.code }})</p>
108
+ {% endfor %}
109
+
110
+ <p class="Cart_shopping-bag-id">Shopping Bag ID: {{ cart.cart_id[:4] }}-{{ cart.cart_id[4:8] }}</p>
111
+ </aside>
112
+ </div>
113
+
114
+ <section class="RecentlyViewedList_container">
115
+ <h2 class="RecentlyViewedList_heading">Recently Viewed Items</h2>
116
+ {{ m.product_grid(recently) }}
117
+ </section>
118
+ </div>
119
+ {% endblock %}
tasks/llbean/environment/reference/clone/frontend/templates/catalog_request.html ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% block title %}Request a Catalog{% endblock %}
3
+ {% block content %}
4
+ <div class="CatalogRequest_container">
5
+ <h1>Request a Catalog</h1>
6
+ {% if submitted %}<p class="Cart_message" role="status">Thank you. Your catalog request was recorded in the local outbox.</p>{% endif %}
7
+ {% if errors %}<p class="FormControl_error" role="alert">Please check these fields: {{ errors|join(', ') }}</p>{% endif %}
8
+ <form method="post" action="/catalog/request">
9
+ <label class="FormControl_label">First Name<input class="FormControl_input" name="first_name" required></label>
10
+ <label class="FormControl_label">Last Name<input class="FormControl_input" name="last_name" required></label>
11
+ <label class="FormControl_label">Email Address<input class="FormControl_input" name="email" type="email" required></label>
12
+ <label class="FormControl_label">Street Address<input class="FormControl_input" name="street1" required></label>
13
+ <label class="FormControl_label">City<input class="FormControl_input" name="city" required></label>
14
+ <label class="FormControl_label">State<input class="FormControl_input" name="state" required></label>
15
+ <label class="FormControl_label">Zip Code<input class="FormControl_input" name="postal" required></label>
16
+ <button class="Button_buttonComponent Button_transactional" type="submit">Send My Catalog</button>
17
+ </form>
18
+ </div>
19
+ {% endblock %}
tasks/llbean/environment/reference/clone/frontend/templates/catalog_settings.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% block title %}Change Catalog Settings{% endblock %}
3
+ {% block content %}
4
+ <div class="Account_page">{% include "_account_nav.html" %}
5
+ <section class="Account_body"><h1>Change Catalog Settings</h1>
6
+ <p>Print catalog: {% if prefs.catalog_opt %}subscribed{% else %}not subscribed{% endif %}.</p>
7
+ <p><a href="/account/email/settings?action=emailPrefs">Change this in email settings</a> or
8
+ <a href="/catalog/request">request a catalog</a>.</p></section></div>
9
+ {% endblock %}
tasks/llbean/environment/reference/clone/frontend/templates/category.html ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% import "_macros.html" as m %}
3
+ {% block title %}Shop All {{ category.name }}{% endblock %}
4
+ {% block content %}
5
+ <div class="CategoryPage_container">
6
+ <nav class="Breadcrumb_container" aria-label="Breadcrumbs">
7
+ <a href="/">L.L.Bean</a>
8
+ {% for crumb in ancestors %}<span class="Breadcrumb_sep">/</span>
9
+ {% if loop.last %}<span>{{ crumb.name }}</span>
10
+ {% else %}<a href="/llb/shop/{{ crumb.cat_id }}">{{ crumb.name }}</a>{% endif %}
11
+ {% endfor %}
12
+ </nav>
13
+
14
+ <div class="CategoryPage_body">
15
+ <aside class="CategoryNavigation_sidebar">
16
+ {% if subcategories %}
17
+ <h2 class="CategoryNavigation_heading">Shop by Category</h2>
18
+ <ul class="CategoryNavigation_list">
19
+ {% for child in subcategories %}
20
+ <li>
21
+ <a href="/llb/shop/{{ child.cat_id }}{% if child.slug %}?page={{ child.slug }}{% endif %}">{{ child.name }}</a>
22
+ <span class="CategoryNavigation_count">({{ child.product_count }})</span>
23
+ </li>
24
+ {% endfor %}
25
+ </ul>
26
+ {% endif %}
27
+
28
+ {{ m.facet_panel(facets, selected, sort_options, '/llb/shop/' ~ category.cat_id, {'page': category.slug or ''}) }}
29
+ </aside>
30
+
31
+ <section class="SearchProducts_container">
32
+ <h1 class="CategoryPage_title">{{ category.name }}</h1>
33
+
34
+ {% set banner_tiles = subcategories | selectattr('tile_image') | list %}
35
+ {% if banner_tiles %}
36
+ <div class="CategoryNavigation_tiles-rail">
37
+ <ul class="CategoryNavigation_tiles">
38
+ {% for child in banner_tiles %}
39
+ <li class="CategoryNavigation_tile">
40
+ <a href="/llb/shop/{{ child.cat_id }}{% if child.slug %}?page={{ child.slug }}{% endif %}">
41
+ <img src="{{ child.tile_image }}" width="190" height="295"
42
+ alt="{{ child.tile_alt or child.name }}" loading="lazy">
43
+ <span class="CategoryNavigation_tile-label">{{ child.name }}</span>
44
+ </a>
45
+ </li>
46
+ {% endfor %}
47
+ </ul>
48
+ </div>
49
+ {% endif %}
50
+
51
+ <div class="ThumbnailHeader_header">
52
+ <form class="SortOptions_form" method="get" action="/llb/shop/{{ category.cat_id }}">
53
+ {% if category.slug %}<input type="hidden" name="page" value="{{ category.slug }}">{% endif %}
54
+ {% for value in selected.color %}<input type="hidden" name="color" value="{{ value }}">{% endfor %}
55
+ {% for value in selected.brand %}<input type="hidden" name="brand" value="{{ value }}">{% endfor %}
56
+ {% for value in selected.price %}<input type="hidden" name="price" value="{{ value }}">{% endfor %}
57
+ {% if selected.sale %}<input type="hidden" name="sale" value="1">{% endif %}
58
+ {% if selected.new %}<input type="hidden" name="new" value="1">{% endif %}
59
+ <label class="SortOptions_label" for="sort_field">Sort by:</label>
60
+ <select class="SortOptions_select" id="sort_field" name="sort_field" onchange="this.form.submit()">
61
+ {% for key, label in sort_options.items() %}
62
+ <option value="{{ key }}" {% if selected.sort_field == key %}selected{% endif %}>{{ label }}</option>
63
+ {% endfor %}
64
+ </select>
65
+ <noscript><button class="Button_buttonComponent Button_secondary Button_small" type="submit">Sort</button></noscript>
66
+ </form>
67
+ <span class="ThumbnailHeader_count">{{ batch.total }} Items</span>
68
+ </div>
69
+
70
+ <h2 class="ThumbnailHeader_title">Shop All {{ category.name }}</h2>
71
+
72
+ {% if batch.products %}
73
+ {{ m.product_grid(batch.products) }}
74
+ {{ m.load_more(batch, '/llb/shop/' ~ category.cat_id, {
75
+ 'page': category.slug or '', 'sort_field': selected.sort_field,
76
+ 'color': selected.color, 'brand': selected.brand, 'price': selected.price,
77
+ 'sale': '1' if selected.sale else '', 'new': '1' if selected.new else ''}) }}
78
+ {% else %}
79
+ <p class="NoSearchResults_message">No products match those filters. Clear a filter to see more.</p>
80
+ {% endif %}
81
+ </section>
82
+ </div>
83
+ </div>
84
+ {% endblock %}
tasks/llbean/environment/reference/clone/frontend/templates/change_email.html ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% block title %}Change Email Address{% endblock %}
3
+ {% block content %}
4
+ <div class="Account_page">{% include "_account_nav.html" %}
5
+ <section class="Account_body"><h1>Change Email Address</h1>
6
+ {% if message %}<p class="Cart_message" role="status">{{ message }}</p>{% endif %}
7
+ <p>Current address: {{ viewer.email or 'not set' }}</p>
8
+ <form method="get" action="/account/email">
9
+ <label class="FormControl_label">New Email Address<input class="FormControl_input" name="email" type="email" required></label>
10
+ <input type="hidden" name="message" value="Email change request recorded in the local outbox.">
11
+ <button class="Button_buttonComponent Button_transactional" type="submit">Save</button>
12
+ </form></section></div>
13
+ {% endblock %}