/* The freelancer PHOTO — one endpoint, one constant. The photo does NOT live in the profile payload any more. It used to ride there as inline base64 under the key `Image`; the webhook no longer sends that key, so the payload is small and the photo is fetched separately, per card, by record id. ONE constant holds BOTH halves of the address: the route and the query-parameter name. Changing either is a one-line edit here, and both pages pick it up. The parameter name is `id`. It was recorded as UNVERIFIED in the brief (every probe answered "workflow is not registered"), and it is now CONFIRMED by measurement against the live route: `?id=` answers 200 with the photo for that record, while `/4`, `?profile_id=`, `?image_id=` and a missing id all fail. See webmaster/out/2026-11-03-photo-endpoint/REPORT.md. The endpoint currently answers `application/json` with `{"Image":"data:image/jpeg; base64,…"}` — a JSON envelope, NOT image bytes — so an cannot decode it and every card falls back to its monogram. That is the measured state, not a guess; the page is built for the shape the brief specifies (an pointed at this route) and starts showing photos the moment the route returns image bytes. `versionParam`: appended ONLY when the payload carries a version token, so a year-long immutable cache on the endpoint stays correct — the URL changes when the photo does. Without a token the URL is stable and the endpoint's own headers decide caching (see the report: it sends no Cache-Control and a weak ETag today). */ window.O4PExpertImage = { endpoint: "https://n8n.odoo4projects.com/webhook/ODOO4projects/odoo_experts_image", idParam: "id", versionParam: "v", // Anything that changes when the photo changes. `updatedAt` used to be in the payload. versionFields: ["updatedAt", "updated_at", "ImageVersion", "image_version"], version: function (rec) { if (!rec) return ""; for (var i = 0; i < this.versionFields.length; i++) { var v = rec[this.versionFields[i]]; if (v !== undefined && v !== null && v !== "") return String(v); } return ""; }, url: function (id, rec) { var u = this.endpoint + "?" + this.idParam + "=" + encodeURIComponent(id); var v = this.version(rec); if (v) u += "&" + this.versionParam + "=" + encodeURIComponent(v); return u; } };