@isaiahiroko/tilmart-ngx-apps-admin 0.2.13 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -571,11 +571,11 @@ class CatalogComponent extends BaseDirective {
571
571
  this.stock = null;
572
572
  }
573
573
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: CatalogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
574
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: CatalogComponent, isStandalone: false, selector: "x-catalog", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Catalogue</div>\n <div class=\"x-page-subtitle\">Products, variants, attributes, media, pricing and stock.</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-cat-toolbar\">\n <input\n type=\"text\"\n class=\"x-cat-search\"\n placeholder=\"Search products\u2026\"\n [(ngModel)]=\"query\"\n (keyup.enter)=\"search()\"\n />\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"search()\">Search</button>\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"refresh()\">Refresh</button>\n <div class=\"x-cat-spacer\"></div>\n <a class=\"x-cat-btn\" routerLink=\"/admin/bulk-upload\">Bulk upload (Excel)</a>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" (click)=\"startCreate()\">+ New product</button>\n </div>\n\n <div class=\"x-cat-tabs\" role=\"tablist\" aria-label=\"Filter by status\">\n @for (tab of [''].concat(statuses); track tab) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"x-cat-tab\"\n [class.is-active]=\"statusFilter === tab\"\n [attr.aria-selected]=\"statusFilter === tab\"\n (click)=\"setStatusFilter(tab)\"\n >\n {{ tab ? (tab | titlecase) : 'All' }}\n </button>\n }\n </div>\n\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-catalog-table\">\n <div class=\"x-catalog-row x-catalog-head\">\n <div class=\"x-catalog-col-name\">Product</div>\n <div class=\"x-catalog-col-sku\">SKU</div>\n <div class=\"x-catalog-col-category\">Category</div>\n <div class=\"x-catalog-col-price\">Price</div>\n <div class=\"x-catalog-col-stock\">Stock</div>\n <div class=\"x-catalog-col-status\">Status</div>\n <div class=\"x-catalog-col-check\">Publish check</div>\n <div class=\"x-catalog-col-action\"></div>\n </div>\n @for (product of products; track product.id) {\n <div class=\"x-catalog-row\">\n <div class=\"x-catalog-col-name\">\n @if (product.thumbUrl) {\n <img class=\"x-catalog-thumb\" [src]=\"product.thumbUrl\" alt=\"\" loading=\"lazy\" />\n } @else {\n <span class=\"x-catalog-thumb x-catalog-thumb-empty\" aria-hidden=\"true\"></span>\n }\n <span>\n {{ product.name }}\n <span class=\"x-catalog-model\">\n {{ product.type }}@if (product.model) { \u00B7 {{ product.model }} } \u00B7 updated {{ product.updatedAt | date: 'd MMM' }}\n </span>\n </span>\n </div>\n <div class=\"x-catalog-col-sku\">{{ product.sku || '\u2014' }}</div>\n <div class=\"x-catalog-col-category\">{{ categoryName(product.primaryCategoryId) }}</div>\n <div class=\"x-catalog-col-price\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.price) {\n {{ money(product.price) }}\n } @else if (product.price === null) {\n <span class=\"x-catalog-warn\">No price</span>\n } @else {\n \u2014\n }\n </div>\n <div class=\"x-catalog-col-stock\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.stockFree === undefined) {\n \u2014\n } @else if (product.stockFree > 0) {\n {{ product.stockFree }}\n @if ((product.variantCount ?? 0) > 1) {\n <span class=\"x-catalog-model\">{{ product.variantCount }} variants</span>\n }\n } @else {\n <span class=\"x-catalog-warn\">Out</span>\n }\n </div>\n <div class=\"x-catalog-col-status\" [innerHTML]=\"statusBadge(product.status)\"></div>\n <div class=\"x-catalog-col-check\">\n @if (product.checking) {\n <span class=\"x-check-pending\">Checking\u2026</span>\n } @else if (product.checked && product.canPublish) {\n <span class=\"x-check-ok\">\u2713 Ready to publish</span>\n } @else if (!product.checked) {\n <span class=\"x-check-pending\">Not checked \u2014 press Check</span>\n } @else if (product.checked && product.errors?.length) {\n <ul class=\"x-check-errors\">\n @for (err of product.errors; track err.field) {\n <li>{{ err.message }}</li>\n }\n </ul>\n }\n </div>\n <div class=\"x-catalog-col-action\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"edit(product)\">Edit</button>\n <button\n type=\"button\"\n class=\"x-check-btn\"\n [disabled]=\"product.checking\"\n (click)=\"checkPublish(product)\"\n >\n Check\n </button>\n </div>\n </div>\n }\n @if (!products.length) {\n <div class=\"x-catalog-empty\">No products yet \u2014 use \"+ New product\" to add one.</div>\n }\n </div>\n\n <div class=\"x-cat-pager\">\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page <= 1\" (click)=\"prevPage()\">\u2190 Prev</button>\n <span class=\"x-cat-pager-label\">Page {{ page }} \u00B7 {{ total }} total</span>\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page * perPage >= total\" (click)=\"nextPage()\">\n Next \u2192\n </button>\n </div>\n }\n} @else if (draft) {\n <div class=\"x-cat-editor\">\n <div class=\"x-cat-editor-head\">\n <div class=\"x-cat-editor-title\">{{ draft.id ? 'Edit product' : 'New product' }}</div>\n <div class=\"x-cat-editor-actions\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" [disabled]=\"saving\" (click)=\"saveProduct()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Basic info</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Name\n <input type=\"text\" [(ngModel)]=\"draft.name\" />\n </label>\n <label class=\"x-cat-f\">\n Slug (optional)\n <input type=\"text\" [(ngModel)]=\"draft.slug\" placeholder=\"auto from name if blank\" />\n </label>\n </div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Model\n <input type=\"text\" [(ngModel)]=\"draft.model\" />\n </label>\n <label class=\"x-cat-f\">\n Type\n <select [(ngModel)]=\"draft.type\">\n @for (t of types; track t) { <option [value]=\"t\">{{ t }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Status\n <select [(ngModel)]=\"draft.status\">\n @for (s of statuses; track s) { <option [value]=\"s\">{{ s }}</option> }\n </select>\n </label>\n </div>\n @if (draft.type !== 'simple') {\n <div class=\"x-cat-hint\">\n \"{{ draft.type }}\" products still save through this one-variant form for now \u2014 a full\n per-variant / per-component editor is a follow-up.\n </div>\n }\n <label class=\"x-cat-f\">\n Short description\n <textarea rows=\"2\" [(ngModel)]=\"draft.shortDesc\"></textarea>\n </label>\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Category &amp; brand</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Category\n <select [(ngModel)]=\"draft.primaryCategoryId\" (ngModelChange)=\"onCategoryChange()\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (c of categories; track c.id) { <option [value]=\"c.id\">{{ c.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Brand\n <select [(ngModel)]=\"draft.brandId\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (b of brands; track b.id) { <option [value]=\"b.id\">{{ b.name }}</option> }\n </select>\n </label>\n </div>\n </section>\n\n @if (attributeDefs.length) {\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Attributes</div>\n <div class=\"x-cat-attr-grid\">\n @for (def of attributeDefs; track def.id) {\n <label class=\"x-cat-f x-cat-attr\">\n {{ def.label }}{{ def.unit ? ' (' + def.unit + ')' : '' }}\n @if (def.required) {\n <span class=\"x-cat-required\">*</span>\n }\n @switch (def.dataType) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"attributeValues[def.id].valueBool\" />\n }\n @case ('enum') {\n <select [(ngModel)]=\"attributeValues[def.id].valueText\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of def.allowedValues; track opt) { <option [value]=\"opt\">{{ opt }}</option> }\n </select>\n }\n @case ('range') {\n <div class=\"x-cat-range\">\n <input type=\"number\" placeholder=\"min\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n <span>\u2013</span>\n <input\n type=\"number\"\n placeholder=\"max\"\n [(ngModel)]=\"attributeValues[def.id].valueNumberHigh\"\n />\n </div>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"attributeValues[def.id].valueText\" />\n }\n }\n </label>\n }\n </div>\n </section>\n }\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Variant, price &amp; stock</div>\n @if (variant) {\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n SKU\n <input type=\"text\" [(ngModel)]=\"variant.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Weight (kg)\n <input type=\"number\" [(ngModel)]=\"variant.weight\" />\n </label>\n <label class=\"x-cat-f\">\n Handling class\n <select [(ngModel)]=\"variant.handlingClass\">\n <option value=\"standard\">standard</option>\n <option value=\"bulky\">bulky</option>\n <option value=\"freight\">freight</option>\n <option value=\"hazmat\">hazmat</option>\n </select>\n </label>\n </div>\n }\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Price (\u20A6)\n <input type=\"number\" [(ngModel)]=\"price!.amount\" [disabled]=\"!variant?.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Stock location\n <select [(ngModel)]=\"stock!.locationId\" [disabled]=\"!variant?.sku\">\n @for (loc of stockLocations; track loc.id) { <option [value]=\"loc.id\">{{ loc.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Available\n <input type=\"number\" [(ngModel)]=\"stock!.available\" [disabled]=\"!variant?.sku\" />\n </label>\n </div>\n @if (!variant?.sku) {\n <div class=\"x-cat-hint\">Enter a SKU above, then price/stock can be saved.</div>\n }\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Media</div>\n @if (!draft.id) {\n <div class=\"x-cat-hint\">Save the product once first \u2014 media needs a real product to attach to.</div>\n } @else {\n <div class=\"x-cat-media-grid\">\n @for (m of media; track m.id) {\n <div class=\"x-cat-media-item\">\n <img [src]=\"m.objectUrl\" [alt]=\"m.altText\" />\n <button type=\"button\" class=\"x-cat-media-remove\" (click)=\"removeMedia(m)\">Remove</button>\n </div>\n }\n </div>\n <label class=\"x-cat-btn x-cat-upload\">\n {{ uploadingMedia ? 'Uploading\u2026' : '+ Add image' }}\n <input type=\"file\" accept=\"image/*\" hidden [disabled]=\"uploadingMedia\" (change)=\"onMediaSelected($event)\" />\n </label>\n <div class=\"x-cat-hint\">\n Best results: <strong>1200 \u00D7 1200 px</strong> or larger, square (4:3 also works), product centred on a\n plain white/light background, JPG or WebP, under 8 MB. The first image is the listing thumbnail \u2014\n use a clean front-on shot; add the rating plate, ports/back and box contents as extra images.\n The site downsizes photos for phones automatically, so upload the sharp original.\n </div>\n }\n </section>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-cat-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:14px}.x-cat-search{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);min-width:220px}.x-cat-spacer{flex:1}.x-cat-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted);display:inline-flex;align-items:center}.x-cat-btn:disabled{opacity:.5;cursor:default}.x-cat-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-catalog-table{display:flex;flex-direction:column;border:1px solid var(--color-border);border-radius:var(--radius-lg);overflow:hidden}.x-catalog-row{display:grid;grid-template-columns:minmax(220px,2.4fr) 130px 1fr 100px 70px 110px 1.4fr 140px;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--color-border);font-size:13px}.x-catalog-row:last-child{border-bottom:none}.x-catalog-head{font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.02em;color:var(--color-text-muted);background:var(--color-surface-alt, rgba(0, 0, 0, .02))}.x-catalog-model{display:block;font-size:11.5px;color:var(--color-text-muted)}.x-catalog-col-action{display:flex;gap:6px;justify-content:flex-end}.x-catalog-empty{padding:24px;text-align:center;color:var(--color-text-muted);font-size:13px}.x-status-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;border:1px solid var(--color-border);text-transform:capitalize}.x-check-pending{color:var(--color-text-muted);font-size:12px}.x-check-ok{color:var(--color-success, #2a7a3b);font-size:12px;font-weight:700}.x-check-errors{margin:0;padding-left:16px;font-size:11.5px;color:var(--color-danger, #c0362c)}.x-check-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:4px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-check-btn:disabled{opacity:.5;cursor:default}.x-cat-pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:12px}.x-cat-pager-label{font-size:12px;color:var(--color-text-muted)}.x-cat-editor{display:flex;flex-direction:column;gap:16px}.x-cat-editor-head{display:flex;align-items:center;justify-content:space-between}.x-cat-editor-title{font-size:18px;font-weight:800;color:var(--color-text)}.x-cat-editor-actions{display:flex;gap:8px}.x-cat-section{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:10px}.x-cat-section-title{font-size:13px;font-weight:800;color:var(--color-text);text-transform:uppercase;letter-spacing:.02em}.x-cat-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-cat-f input,.x-cat-f select,.x-cat-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-cat-f-row{display:flex;gap:10px;flex-wrap:wrap}.x-cat-hint{font-size:12px;color:var(--color-text-muted);font-style:italic}.x-cat-required{color:var(--color-danger, #c0362c)}.x-cat-attr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}.x-cat-attr input[type=checkbox]{width:18px;height:18px}.x-cat-range{display:flex;align-items:center;gap:6px}.x-cat-range input{width:0;flex:1}.x-cat-media-grid{display:flex;flex-wrap:wrap;gap:12px}.x-cat-media-item{position:relative;width:100px;height:100px;border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden}.x-cat-media-item img{width:100%;height:100%;object-fit:cover;display:block}.x-cat-media-remove{position:absolute;bottom:0;left:0;right:0;border:none;background:#0009;color:#fff;font-size:10px;padding:3px 0;cursor:pointer}.x-cat-upload{align-self:flex-start;cursor:pointer}.x-catalog-col-name{display:flex;align-items:center;gap:10px;min-width:0}.x-catalog-thumb{flex:0 0 40px;width:40px;height:40px;object-fit:contain;border-radius:var(--radius-sm, 4px);border:1px solid var(--color-border);background:var(--color-surface)}.x-catalog-thumb-empty{display:inline-block;background:var(--color-surface-2, rgba(0, 0, 0, .04))}.x-catalog-col-sku{font-family:var(--font-mono);font-size:12px;overflow:hidden;text-overflow:ellipsis}.x-cat-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}.x-cat-tab{padding:5px 12px;border-radius:999px;border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text);font-size:12.5px;font-weight:600;cursor:pointer}.x-cat-tab.is-active{background:var(--color-accent);border-color:var(--color-accent);color:var(--color-accent-fg)}.x-catalog-table{overflow-x:auto}.x-catalog-row{min-width:1040px}.x-catalog-col-price,.x-catalog-col-stock{font-family:var(--font-mono);font-size:12px}.x-catalog-warn{color:var(--color-warn, #8a5a12);font-weight:600}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
574
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: CatalogComponent, isStandalone: false, selector: "x-catalog", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Catalogue</div>\n <div class=\"x-page-subtitle\">Products, variants, attributes, media, pricing and stock.</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-cat-toolbar\">\n <input\n type=\"text\"\n class=\"x-cat-search\"\n placeholder=\"Search products\u2026\"\n [(ngModel)]=\"query\"\n (keyup.enter)=\"search()\"\n />\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"search()\">Search</button>\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"refresh()\">Refresh</button>\n <div class=\"x-cat-spacer\"></div>\n <a class=\"x-cat-btn\" routerLink=\"/admin/bulk-upload\">Bulk upload (Excel)</a>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" (click)=\"startCreate()\">+ New product</button>\n </div>\n\n <div class=\"x-cat-tabs\" role=\"tablist\" aria-label=\"Filter by status\">\n @for (tab of [''].concat(statuses); track tab) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"x-cat-tab\"\n [class.is-active]=\"statusFilter === tab\"\n [attr.aria-selected]=\"statusFilter === tab\"\n (click)=\"setStatusFilter(tab)\"\n >\n {{ tab ? (tab | titlecase) : 'All' }}\n </button>\n }\n </div>\n\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-catalog-table\">\n <div class=\"x-catalog-row x-catalog-head\">\n <div class=\"x-catalog-col-name\">Product</div>\n <div class=\"x-catalog-col-sku\">SKU</div>\n <div class=\"x-catalog-col-category\">Category</div>\n <div class=\"x-catalog-col-price\">Price</div>\n <div class=\"x-catalog-col-stock\">Stock</div>\n <div class=\"x-catalog-col-status\">Status</div>\n <div class=\"x-catalog-col-check\">Publish check</div>\n <div class=\"x-catalog-col-action\"></div>\n </div>\n @for (product of products; track product.id) {\n <div class=\"x-catalog-row\">\n <div class=\"x-catalog-col-name\">\n @if (product.thumbUrl) {\n <img class=\"x-catalog-thumb\" [src]=\"product.thumbUrl\" alt=\"\" loading=\"lazy\" />\n } @else {\n <span class=\"x-catalog-thumb x-catalog-thumb-empty\" aria-hidden=\"true\"></span>\n }\n <span>\n {{ product.name }}\n <span class=\"x-catalog-model\">\n {{ product.type }}@if (product.model) { \u00B7 {{ product.model }} } \u00B7 updated {{ product.updatedAt | date: 'd MMM' }}\n </span>\n </span>\n </div>\n <div class=\"x-catalog-col-sku\">{{ product.sku || '\u2014' }}</div>\n <div class=\"x-catalog-col-category\">{{ categoryName(product.primaryCategoryId) }}</div>\n <div class=\"x-catalog-col-price\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.price) {\n {{ money(product.price) }}\n } @else if (product.price === null) {\n <span class=\"x-catalog-warn\">No price</span>\n } @else {\n \u2014\n }\n </div>\n <div class=\"x-catalog-col-stock\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.stockFree === undefined) {\n \u2014\n } @else if (product.stockFree > 0) {\n {{ product.stockFree }}\n @if ((product.variantCount ?? 0) > 1) {\n <span class=\"x-catalog-model\">{{ product.variantCount }} variants</span>\n }\n } @else {\n <span class=\"x-catalog-warn\">Out</span>\n }\n </div>\n <div class=\"x-catalog-col-status\" [innerHTML]=\"statusBadge(product.status)\"></div>\n <div class=\"x-catalog-col-check\">\n @if (product.checking) {\n <span class=\"x-check-pending\">Checking\u2026</span>\n } @else if (product.checked && product.canPublish) {\n <span class=\"x-check-ok\">\u2713 Ready to publish</span>\n } @else if (!product.checked) {\n <span class=\"x-check-pending\">Not checked \u2014 press Check</span>\n } @else if (product.checked && product.errors?.length) {\n <ul class=\"x-check-errors\">\n @for (err of product.errors; track err.field) {\n <li>{{ err.message }}</li>\n }\n </ul>\n }\n </div>\n <div class=\"x-catalog-col-action\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"edit(product)\">Edit</button>\n <button\n type=\"button\"\n class=\"x-check-btn\"\n [disabled]=\"product.checking\"\n (click)=\"checkPublish(product)\"\n >\n Check\n </button>\n </div>\n </div>\n }\n @if (!products.length) {\n <div class=\"x-catalog-empty\">No products yet \u2014 use \"+ New product\" to add one.</div>\n }\n </div>\n\n <div class=\"x-cat-pager\">\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page <= 1\" (click)=\"prevPage()\">\u2190 Prev</button>\n <span class=\"x-cat-pager-label\">Page {{ page }} \u00B7 {{ total }} total</span>\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page * perPage >= total\" (click)=\"nextPage()\">\n Next \u2192\n </button>\n </div>\n }\n} @else if (draft) {\n <div class=\"x-cat-editor\">\n <div class=\"x-cat-editor-head\">\n <div class=\"x-cat-editor-title\">{{ draft.id ? 'Edit product' : 'New product' }}</div>\n <div class=\"x-cat-editor-actions\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" [disabled]=\"saving\" (click)=\"saveProduct()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Basic info</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Name\n <input type=\"text\" [(ngModel)]=\"draft.name\" />\n </label>\n <label class=\"x-cat-f\">\n Slug (optional)\n <input type=\"text\" [(ngModel)]=\"draft.slug\" placeholder=\"auto from name if blank\" />\n </label>\n </div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Model\n <input type=\"text\" [(ngModel)]=\"draft.model\" />\n </label>\n <label class=\"x-cat-f\">\n Type\n <select [(ngModel)]=\"draft.type\">\n @for (t of types; track t) { <option [value]=\"t\">{{ t }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Status\n <select [(ngModel)]=\"draft.status\">\n @for (s of statuses; track s) { <option [value]=\"s\">{{ s }}</option> }\n </select>\n </label>\n </div>\n @if (draft.type !== 'simple') {\n <div class=\"x-cat-hint\">\n \"{{ draft.type }}\" products still save through this one-variant form for now \u2014 a full\n per-variant / per-component editor is a follow-up.\n </div>\n }\n <label class=\"x-cat-f\">\n Short description\n <textarea rows=\"2\" [(ngModel)]=\"draft.shortDesc\"></textarea>\n </label>\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Category &amp; brand</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Category\n <select [(ngModel)]=\"draft.primaryCategoryId\" (ngModelChange)=\"onCategoryChange()\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (c of categories; track c.id) { <option [value]=\"c.id\">{{ c.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Brand\n <select [(ngModel)]=\"draft.brandId\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (b of brands; track b.id) { <option [value]=\"b.id\">{{ b.name }}</option> }\n </select>\n </label>\n </div>\n </section>\n\n @if (attributeDefs.length) {\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Attributes</div>\n <div class=\"x-cat-attr-grid\">\n @for (def of attributeDefs; track def.id) {\n <label class=\"x-cat-f x-cat-attr\">\n {{ def.label }}{{ def.unit ? ' (' + def.unit + ')' : '' }}\n @if (def.required) {\n <span class=\"x-cat-required\">*</span>\n }\n @switch (def.dataType) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"attributeValues[def.id].valueBool\" />\n }\n @case ('enum') {\n <select [(ngModel)]=\"attributeValues[def.id].valueText\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of def.allowedValues; track opt) { <option [value]=\"opt\">{{ opt }}</option> }\n </select>\n }\n @case ('range') {\n <div class=\"x-cat-range\">\n <input type=\"number\" placeholder=\"min\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n <span>\u2013</span>\n <input\n type=\"number\"\n placeholder=\"max\"\n [(ngModel)]=\"attributeValues[def.id].valueNumberHigh\"\n />\n </div>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"attributeValues[def.id].valueText\" />\n }\n }\n </label>\n }\n </div>\n </section>\n }\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Variant, price &amp; stock</div>\n @if (variant) {\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n SKU\n <input type=\"text\" [(ngModel)]=\"variant.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Weight (kg)\n <input type=\"number\" min=\"0\" step=\"0.1\" [(ngModel)]=\"variant.weight\" />\n @if (variant.weight == null || variant.weight <= 0) {\n <small class=\"x-cat-hint\" style=\"color: var(--color-warn)\">\n No weight \u2014 delivery is priced with the default weight. Add the packed weight for an accurate shipping fee.\n </small>\n }\n </label>\n <label class=\"x-cat-f\">\n Handling class\n <select [(ngModel)]=\"variant.handlingClass\">\n <option value=\"standard\">standard</option>\n <option value=\"bulky\">bulky</option>\n <option value=\"freight\">freight</option>\n <option value=\"hazmat\">hazmat</option>\n </select>\n </label>\n </div>\n }\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Price (\u20A6)\n <input type=\"number\" [(ngModel)]=\"price!.amount\" [disabled]=\"!variant?.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Stock location\n <select [(ngModel)]=\"stock!.locationId\" [disabled]=\"!variant?.sku\">\n @for (loc of stockLocations; track loc.id) { <option [value]=\"loc.id\">{{ loc.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Available\n <input type=\"number\" [(ngModel)]=\"stock!.available\" [disabled]=\"!variant?.sku\" />\n </label>\n </div>\n @if (!variant?.sku) {\n <div class=\"x-cat-hint\">Enter a SKU above, then price/stock can be saved.</div>\n }\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Media</div>\n @if (!draft.id) {\n <div class=\"x-cat-hint\">Save the product once first \u2014 media needs a real product to attach to.</div>\n } @else {\n <div class=\"x-cat-media-grid\">\n @for (m of media; track m.id) {\n <div class=\"x-cat-media-item\">\n <img [src]=\"m.objectUrl\" [alt]=\"m.altText\" />\n <button type=\"button\" class=\"x-cat-media-remove\" (click)=\"removeMedia(m)\">Remove</button>\n </div>\n }\n </div>\n <label class=\"x-cat-btn x-cat-upload\">\n {{ uploadingMedia ? 'Uploading\u2026' : '+ Add image' }}\n <input type=\"file\" accept=\"image/*\" hidden [disabled]=\"uploadingMedia\" (change)=\"onMediaSelected($event)\" />\n </label>\n <div class=\"x-cat-hint\">\n Best results: <strong>1200 \u00D7 1200 px</strong> or larger, square (4:3 also works), product centred on a\n plain white/light background, JPG or WebP, under 8 MB. The first image is the listing thumbnail \u2014\n use a clean front-on shot; add the rating plate, ports/back and box contents as extra images.\n The site downsizes photos for phones automatically, so upload the sharp original.\n </div>\n }\n </section>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-cat-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:14px}.x-cat-search{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);min-width:220px}.x-cat-spacer{flex:1}.x-cat-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted);display:inline-flex;align-items:center}.x-cat-btn:disabled{opacity:.5;cursor:default}.x-cat-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-catalog-table{display:flex;flex-direction:column;border:1px solid var(--color-border);border-radius:var(--radius-lg);overflow:hidden}.x-catalog-row{display:grid;grid-template-columns:minmax(220px,2.4fr) 130px 1fr 100px 70px 110px 1.4fr 140px;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--color-border);font-size:13px}.x-catalog-row:last-child{border-bottom:none}.x-catalog-head{font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.02em;color:var(--color-text-muted);background:var(--color-surface-alt, rgba(0, 0, 0, .02))}.x-catalog-model{display:block;font-size:11.5px;color:var(--color-text-muted)}.x-catalog-col-action{display:flex;gap:6px;justify-content:flex-end}.x-catalog-empty{padding:24px;text-align:center;color:var(--color-text-muted);font-size:13px}.x-status-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;border:1px solid var(--color-border);text-transform:capitalize}.x-check-pending{color:var(--color-text-muted);font-size:12px}.x-check-ok{color:var(--color-success, #2a7a3b);font-size:12px;font-weight:700}.x-check-errors{margin:0;padding-left:16px;font-size:11.5px;color:var(--color-danger, #c0362c)}.x-check-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:4px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-check-btn:disabled{opacity:.5;cursor:default}.x-cat-pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:12px}.x-cat-pager-label{font-size:12px;color:var(--color-text-muted)}.x-cat-editor{display:flex;flex-direction:column;gap:16px}.x-cat-editor-head{display:flex;align-items:center;justify-content:space-between}.x-cat-editor-title{font-size:18px;font-weight:800;color:var(--color-text)}.x-cat-editor-actions{display:flex;gap:8px}.x-cat-section{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:10px}.x-cat-section-title{font-size:13px;font-weight:800;color:var(--color-text);text-transform:uppercase;letter-spacing:.02em}.x-cat-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-cat-f input,.x-cat-f select,.x-cat-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-cat-f-row{display:flex;gap:10px;flex-wrap:wrap}.x-cat-hint{font-size:12px;color:var(--color-text-muted);font-style:italic}.x-cat-required{color:var(--color-danger, #c0362c)}.x-cat-attr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}.x-cat-attr input[type=checkbox]{width:18px;height:18px}.x-cat-range{display:flex;align-items:center;gap:6px}.x-cat-range input{width:0;flex:1}.x-cat-media-grid{display:flex;flex-wrap:wrap;gap:12px}.x-cat-media-item{position:relative;width:100px;height:100px;border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden}.x-cat-media-item img{width:100%;height:100%;object-fit:cover;display:block}.x-cat-media-remove{position:absolute;bottom:0;left:0;right:0;border:none;background:#0009;color:#fff;font-size:10px;padding:3px 0;cursor:pointer}.x-cat-upload{align-self:flex-start;cursor:pointer}.x-catalog-col-name{display:flex;align-items:center;gap:10px;min-width:0}.x-catalog-thumb{flex:0 0 40px;width:40px;height:40px;object-fit:contain;border-radius:var(--radius-sm, 4px);border:1px solid var(--color-border);background:var(--color-surface)}.x-catalog-thumb-empty{display:inline-block;background:var(--color-surface-2, rgba(0, 0, 0, .04))}.x-catalog-col-sku{font-family:var(--font-mono);font-size:12px;overflow:hidden;text-overflow:ellipsis}.x-cat-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}.x-cat-tab{padding:5px 12px;border-radius:999px;border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text);font-size:12.5px;font-weight:600;cursor:pointer}.x-cat-tab.is-active{background:var(--color-accent);border-color:var(--color-accent);color:var(--color-accent-fg)}.x-catalog-table{overflow-x:auto}.x-catalog-row{min-width:1040px}.x-catalog-col-price,.x-catalog-col-stock{font-family:var(--font-mono);font-size:12px}.x-catalog-warn{color:var(--color-warn, #8a5a12);font-weight:600}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
575
575
  }
576
576
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: CatalogComponent, decorators: [{
577
577
  type: Component,
578
- args: [{ standalone: false, selector: 'x-catalog', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Catalogue</div>\n <div class=\"x-page-subtitle\">Products, variants, attributes, media, pricing and stock.</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-cat-toolbar\">\n <input\n type=\"text\"\n class=\"x-cat-search\"\n placeholder=\"Search products\u2026\"\n [(ngModel)]=\"query\"\n (keyup.enter)=\"search()\"\n />\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"search()\">Search</button>\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"refresh()\">Refresh</button>\n <div class=\"x-cat-spacer\"></div>\n <a class=\"x-cat-btn\" routerLink=\"/admin/bulk-upload\">Bulk upload (Excel)</a>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" (click)=\"startCreate()\">+ New product</button>\n </div>\n\n <div class=\"x-cat-tabs\" role=\"tablist\" aria-label=\"Filter by status\">\n @for (tab of [''].concat(statuses); track tab) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"x-cat-tab\"\n [class.is-active]=\"statusFilter === tab\"\n [attr.aria-selected]=\"statusFilter === tab\"\n (click)=\"setStatusFilter(tab)\"\n >\n {{ tab ? (tab | titlecase) : 'All' }}\n </button>\n }\n </div>\n\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-catalog-table\">\n <div class=\"x-catalog-row x-catalog-head\">\n <div class=\"x-catalog-col-name\">Product</div>\n <div class=\"x-catalog-col-sku\">SKU</div>\n <div class=\"x-catalog-col-category\">Category</div>\n <div class=\"x-catalog-col-price\">Price</div>\n <div class=\"x-catalog-col-stock\">Stock</div>\n <div class=\"x-catalog-col-status\">Status</div>\n <div class=\"x-catalog-col-check\">Publish check</div>\n <div class=\"x-catalog-col-action\"></div>\n </div>\n @for (product of products; track product.id) {\n <div class=\"x-catalog-row\">\n <div class=\"x-catalog-col-name\">\n @if (product.thumbUrl) {\n <img class=\"x-catalog-thumb\" [src]=\"product.thumbUrl\" alt=\"\" loading=\"lazy\" />\n } @else {\n <span class=\"x-catalog-thumb x-catalog-thumb-empty\" aria-hidden=\"true\"></span>\n }\n <span>\n {{ product.name }}\n <span class=\"x-catalog-model\">\n {{ product.type }}@if (product.model) { \u00B7 {{ product.model }} } \u00B7 updated {{ product.updatedAt | date: 'd MMM' }}\n </span>\n </span>\n </div>\n <div class=\"x-catalog-col-sku\">{{ product.sku || '\u2014' }}</div>\n <div class=\"x-catalog-col-category\">{{ categoryName(product.primaryCategoryId) }}</div>\n <div class=\"x-catalog-col-price\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.price) {\n {{ money(product.price) }}\n } @else if (product.price === null) {\n <span class=\"x-catalog-warn\">No price</span>\n } @else {\n \u2014\n }\n </div>\n <div class=\"x-catalog-col-stock\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.stockFree === undefined) {\n \u2014\n } @else if (product.stockFree > 0) {\n {{ product.stockFree }}\n @if ((product.variantCount ?? 0) > 1) {\n <span class=\"x-catalog-model\">{{ product.variantCount }} variants</span>\n }\n } @else {\n <span class=\"x-catalog-warn\">Out</span>\n }\n </div>\n <div class=\"x-catalog-col-status\" [innerHTML]=\"statusBadge(product.status)\"></div>\n <div class=\"x-catalog-col-check\">\n @if (product.checking) {\n <span class=\"x-check-pending\">Checking\u2026</span>\n } @else if (product.checked && product.canPublish) {\n <span class=\"x-check-ok\">\u2713 Ready to publish</span>\n } @else if (!product.checked) {\n <span class=\"x-check-pending\">Not checked \u2014 press Check</span>\n } @else if (product.checked && product.errors?.length) {\n <ul class=\"x-check-errors\">\n @for (err of product.errors; track err.field) {\n <li>{{ err.message }}</li>\n }\n </ul>\n }\n </div>\n <div class=\"x-catalog-col-action\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"edit(product)\">Edit</button>\n <button\n type=\"button\"\n class=\"x-check-btn\"\n [disabled]=\"product.checking\"\n (click)=\"checkPublish(product)\"\n >\n Check\n </button>\n </div>\n </div>\n }\n @if (!products.length) {\n <div class=\"x-catalog-empty\">No products yet \u2014 use \"+ New product\" to add one.</div>\n }\n </div>\n\n <div class=\"x-cat-pager\">\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page <= 1\" (click)=\"prevPage()\">\u2190 Prev</button>\n <span class=\"x-cat-pager-label\">Page {{ page }} \u00B7 {{ total }} total</span>\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page * perPage >= total\" (click)=\"nextPage()\">\n Next \u2192\n </button>\n </div>\n }\n} @else if (draft) {\n <div class=\"x-cat-editor\">\n <div class=\"x-cat-editor-head\">\n <div class=\"x-cat-editor-title\">{{ draft.id ? 'Edit product' : 'New product' }}</div>\n <div class=\"x-cat-editor-actions\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" [disabled]=\"saving\" (click)=\"saveProduct()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Basic info</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Name\n <input type=\"text\" [(ngModel)]=\"draft.name\" />\n </label>\n <label class=\"x-cat-f\">\n Slug (optional)\n <input type=\"text\" [(ngModel)]=\"draft.slug\" placeholder=\"auto from name if blank\" />\n </label>\n </div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Model\n <input type=\"text\" [(ngModel)]=\"draft.model\" />\n </label>\n <label class=\"x-cat-f\">\n Type\n <select [(ngModel)]=\"draft.type\">\n @for (t of types; track t) { <option [value]=\"t\">{{ t }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Status\n <select [(ngModel)]=\"draft.status\">\n @for (s of statuses; track s) { <option [value]=\"s\">{{ s }}</option> }\n </select>\n </label>\n </div>\n @if (draft.type !== 'simple') {\n <div class=\"x-cat-hint\">\n \"{{ draft.type }}\" products still save through this one-variant form for now \u2014 a full\n per-variant / per-component editor is a follow-up.\n </div>\n }\n <label class=\"x-cat-f\">\n Short description\n <textarea rows=\"2\" [(ngModel)]=\"draft.shortDesc\"></textarea>\n </label>\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Category &amp; brand</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Category\n <select [(ngModel)]=\"draft.primaryCategoryId\" (ngModelChange)=\"onCategoryChange()\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (c of categories; track c.id) { <option [value]=\"c.id\">{{ c.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Brand\n <select [(ngModel)]=\"draft.brandId\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (b of brands; track b.id) { <option [value]=\"b.id\">{{ b.name }}</option> }\n </select>\n </label>\n </div>\n </section>\n\n @if (attributeDefs.length) {\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Attributes</div>\n <div class=\"x-cat-attr-grid\">\n @for (def of attributeDefs; track def.id) {\n <label class=\"x-cat-f x-cat-attr\">\n {{ def.label }}{{ def.unit ? ' (' + def.unit + ')' : '' }}\n @if (def.required) {\n <span class=\"x-cat-required\">*</span>\n }\n @switch (def.dataType) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"attributeValues[def.id].valueBool\" />\n }\n @case ('enum') {\n <select [(ngModel)]=\"attributeValues[def.id].valueText\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of def.allowedValues; track opt) { <option [value]=\"opt\">{{ opt }}</option> }\n </select>\n }\n @case ('range') {\n <div class=\"x-cat-range\">\n <input type=\"number\" placeholder=\"min\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n <span>\u2013</span>\n <input\n type=\"number\"\n placeholder=\"max\"\n [(ngModel)]=\"attributeValues[def.id].valueNumberHigh\"\n />\n </div>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"attributeValues[def.id].valueText\" />\n }\n }\n </label>\n }\n </div>\n </section>\n }\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Variant, price &amp; stock</div>\n @if (variant) {\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n SKU\n <input type=\"text\" [(ngModel)]=\"variant.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Weight (kg)\n <input type=\"number\" [(ngModel)]=\"variant.weight\" />\n </label>\n <label class=\"x-cat-f\">\n Handling class\n <select [(ngModel)]=\"variant.handlingClass\">\n <option value=\"standard\">standard</option>\n <option value=\"bulky\">bulky</option>\n <option value=\"freight\">freight</option>\n <option value=\"hazmat\">hazmat</option>\n </select>\n </label>\n </div>\n }\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Price (\u20A6)\n <input type=\"number\" [(ngModel)]=\"price!.amount\" [disabled]=\"!variant?.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Stock location\n <select [(ngModel)]=\"stock!.locationId\" [disabled]=\"!variant?.sku\">\n @for (loc of stockLocations; track loc.id) { <option [value]=\"loc.id\">{{ loc.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Available\n <input type=\"number\" [(ngModel)]=\"stock!.available\" [disabled]=\"!variant?.sku\" />\n </label>\n </div>\n @if (!variant?.sku) {\n <div class=\"x-cat-hint\">Enter a SKU above, then price/stock can be saved.</div>\n }\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Media</div>\n @if (!draft.id) {\n <div class=\"x-cat-hint\">Save the product once first \u2014 media needs a real product to attach to.</div>\n } @else {\n <div class=\"x-cat-media-grid\">\n @for (m of media; track m.id) {\n <div class=\"x-cat-media-item\">\n <img [src]=\"m.objectUrl\" [alt]=\"m.altText\" />\n <button type=\"button\" class=\"x-cat-media-remove\" (click)=\"removeMedia(m)\">Remove</button>\n </div>\n }\n </div>\n <label class=\"x-cat-btn x-cat-upload\">\n {{ uploadingMedia ? 'Uploading\u2026' : '+ Add image' }}\n <input type=\"file\" accept=\"image/*\" hidden [disabled]=\"uploadingMedia\" (change)=\"onMediaSelected($event)\" />\n </label>\n <div class=\"x-cat-hint\">\n Best results: <strong>1200 \u00D7 1200 px</strong> or larger, square (4:3 also works), product centred on a\n plain white/light background, JPG or WebP, under 8 MB. The first image is the listing thumbnail \u2014\n use a clean front-on shot; add the rating plate, ports/back and box contents as extra images.\n The site downsizes photos for phones automatically, so upload the sharp original.\n </div>\n }\n </section>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-cat-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:14px}.x-cat-search{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);min-width:220px}.x-cat-spacer{flex:1}.x-cat-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted);display:inline-flex;align-items:center}.x-cat-btn:disabled{opacity:.5;cursor:default}.x-cat-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-catalog-table{display:flex;flex-direction:column;border:1px solid var(--color-border);border-radius:var(--radius-lg);overflow:hidden}.x-catalog-row{display:grid;grid-template-columns:minmax(220px,2.4fr) 130px 1fr 100px 70px 110px 1.4fr 140px;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--color-border);font-size:13px}.x-catalog-row:last-child{border-bottom:none}.x-catalog-head{font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.02em;color:var(--color-text-muted);background:var(--color-surface-alt, rgba(0, 0, 0, .02))}.x-catalog-model{display:block;font-size:11.5px;color:var(--color-text-muted)}.x-catalog-col-action{display:flex;gap:6px;justify-content:flex-end}.x-catalog-empty{padding:24px;text-align:center;color:var(--color-text-muted);font-size:13px}.x-status-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;border:1px solid var(--color-border);text-transform:capitalize}.x-check-pending{color:var(--color-text-muted);font-size:12px}.x-check-ok{color:var(--color-success, #2a7a3b);font-size:12px;font-weight:700}.x-check-errors{margin:0;padding-left:16px;font-size:11.5px;color:var(--color-danger, #c0362c)}.x-check-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:4px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-check-btn:disabled{opacity:.5;cursor:default}.x-cat-pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:12px}.x-cat-pager-label{font-size:12px;color:var(--color-text-muted)}.x-cat-editor{display:flex;flex-direction:column;gap:16px}.x-cat-editor-head{display:flex;align-items:center;justify-content:space-between}.x-cat-editor-title{font-size:18px;font-weight:800;color:var(--color-text)}.x-cat-editor-actions{display:flex;gap:8px}.x-cat-section{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:10px}.x-cat-section-title{font-size:13px;font-weight:800;color:var(--color-text);text-transform:uppercase;letter-spacing:.02em}.x-cat-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-cat-f input,.x-cat-f select,.x-cat-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-cat-f-row{display:flex;gap:10px;flex-wrap:wrap}.x-cat-hint{font-size:12px;color:var(--color-text-muted);font-style:italic}.x-cat-required{color:var(--color-danger, #c0362c)}.x-cat-attr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}.x-cat-attr input[type=checkbox]{width:18px;height:18px}.x-cat-range{display:flex;align-items:center;gap:6px}.x-cat-range input{width:0;flex:1}.x-cat-media-grid{display:flex;flex-wrap:wrap;gap:12px}.x-cat-media-item{position:relative;width:100px;height:100px;border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden}.x-cat-media-item img{width:100%;height:100%;object-fit:cover;display:block}.x-cat-media-remove{position:absolute;bottom:0;left:0;right:0;border:none;background:#0009;color:#fff;font-size:10px;padding:3px 0;cursor:pointer}.x-cat-upload{align-self:flex-start;cursor:pointer}.x-catalog-col-name{display:flex;align-items:center;gap:10px;min-width:0}.x-catalog-thumb{flex:0 0 40px;width:40px;height:40px;object-fit:contain;border-radius:var(--radius-sm, 4px);border:1px solid var(--color-border);background:var(--color-surface)}.x-catalog-thumb-empty{display:inline-block;background:var(--color-surface-2, rgba(0, 0, 0, .04))}.x-catalog-col-sku{font-family:var(--font-mono);font-size:12px;overflow:hidden;text-overflow:ellipsis}.x-cat-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}.x-cat-tab{padding:5px 12px;border-radius:999px;border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text);font-size:12.5px;font-weight:600;cursor:pointer}.x-cat-tab.is-active{background:var(--color-accent);border-color:var(--color-accent);color:var(--color-accent-fg)}.x-catalog-table{overflow-x:auto}.x-catalog-row{min-width:1040px}.x-catalog-col-price,.x-catalog-col-stock{font-family:var(--font-mono);font-size:12px}.x-catalog-warn{color:var(--color-warn, #8a5a12);font-weight:600}\n"] }]
578
+ args: [{ standalone: false, selector: 'x-catalog', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Catalogue</div>\n <div class=\"x-page-subtitle\">Products, variants, attributes, media, pricing and stock.</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-cat-toolbar\">\n <input\n type=\"text\"\n class=\"x-cat-search\"\n placeholder=\"Search products\u2026\"\n [(ngModel)]=\"query\"\n (keyup.enter)=\"search()\"\n />\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"search()\">Search</button>\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"refresh()\">Refresh</button>\n <div class=\"x-cat-spacer\"></div>\n <a class=\"x-cat-btn\" routerLink=\"/admin/bulk-upload\">Bulk upload (Excel)</a>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" (click)=\"startCreate()\">+ New product</button>\n </div>\n\n <div class=\"x-cat-tabs\" role=\"tablist\" aria-label=\"Filter by status\">\n @for (tab of [''].concat(statuses); track tab) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"x-cat-tab\"\n [class.is-active]=\"statusFilter === tab\"\n [attr.aria-selected]=\"statusFilter === tab\"\n (click)=\"setStatusFilter(tab)\"\n >\n {{ tab ? (tab | titlecase) : 'All' }}\n </button>\n }\n </div>\n\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-catalog-table\">\n <div class=\"x-catalog-row x-catalog-head\">\n <div class=\"x-catalog-col-name\">Product</div>\n <div class=\"x-catalog-col-sku\">SKU</div>\n <div class=\"x-catalog-col-category\">Category</div>\n <div class=\"x-catalog-col-price\">Price</div>\n <div class=\"x-catalog-col-stock\">Stock</div>\n <div class=\"x-catalog-col-status\">Status</div>\n <div class=\"x-catalog-col-check\">Publish check</div>\n <div class=\"x-catalog-col-action\"></div>\n </div>\n @for (product of products; track product.id) {\n <div class=\"x-catalog-row\">\n <div class=\"x-catalog-col-name\">\n @if (product.thumbUrl) {\n <img class=\"x-catalog-thumb\" [src]=\"product.thumbUrl\" alt=\"\" loading=\"lazy\" />\n } @else {\n <span class=\"x-catalog-thumb x-catalog-thumb-empty\" aria-hidden=\"true\"></span>\n }\n <span>\n {{ product.name }}\n <span class=\"x-catalog-model\">\n {{ product.type }}@if (product.model) { \u00B7 {{ product.model }} } \u00B7 updated {{ product.updatedAt | date: 'd MMM' }}\n </span>\n </span>\n </div>\n <div class=\"x-catalog-col-sku\">{{ product.sku || '\u2014' }}</div>\n <div class=\"x-catalog-col-category\">{{ categoryName(product.primaryCategoryId) }}</div>\n <div class=\"x-catalog-col-price\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.price) {\n {{ money(product.price) }}\n } @else if (product.price === null) {\n <span class=\"x-catalog-warn\">No price</span>\n } @else {\n \u2014\n }\n </div>\n <div class=\"x-catalog-col-stock\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">\u2026</span>\n } @else if (product.stockFree === undefined) {\n \u2014\n } @else if (product.stockFree > 0) {\n {{ product.stockFree }}\n @if ((product.variantCount ?? 0) > 1) {\n <span class=\"x-catalog-model\">{{ product.variantCount }} variants</span>\n }\n } @else {\n <span class=\"x-catalog-warn\">Out</span>\n }\n </div>\n <div class=\"x-catalog-col-status\" [innerHTML]=\"statusBadge(product.status)\"></div>\n <div class=\"x-catalog-col-check\">\n @if (product.checking) {\n <span class=\"x-check-pending\">Checking\u2026</span>\n } @else if (product.checked && product.canPublish) {\n <span class=\"x-check-ok\">\u2713 Ready to publish</span>\n } @else if (!product.checked) {\n <span class=\"x-check-pending\">Not checked \u2014 press Check</span>\n } @else if (product.checked && product.errors?.length) {\n <ul class=\"x-check-errors\">\n @for (err of product.errors; track err.field) {\n <li>{{ err.message }}</li>\n }\n </ul>\n }\n </div>\n <div class=\"x-catalog-col-action\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"edit(product)\">Edit</button>\n <button\n type=\"button\"\n class=\"x-check-btn\"\n [disabled]=\"product.checking\"\n (click)=\"checkPublish(product)\"\n >\n Check\n </button>\n </div>\n </div>\n }\n @if (!products.length) {\n <div class=\"x-catalog-empty\">No products yet \u2014 use \"+ New product\" to add one.</div>\n }\n </div>\n\n <div class=\"x-cat-pager\">\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page <= 1\" (click)=\"prevPage()\">\u2190 Prev</button>\n <span class=\"x-cat-pager-label\">Page {{ page }} \u00B7 {{ total }} total</span>\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page * perPage >= total\" (click)=\"nextPage()\">\n Next \u2192\n </button>\n </div>\n }\n} @else if (draft) {\n <div class=\"x-cat-editor\">\n <div class=\"x-cat-editor-head\">\n <div class=\"x-cat-editor-title\">{{ draft.id ? 'Edit product' : 'New product' }}</div>\n <div class=\"x-cat-editor-actions\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" [disabled]=\"saving\" (click)=\"saveProduct()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Basic info</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Name\n <input type=\"text\" [(ngModel)]=\"draft.name\" />\n </label>\n <label class=\"x-cat-f\">\n Slug (optional)\n <input type=\"text\" [(ngModel)]=\"draft.slug\" placeholder=\"auto from name if blank\" />\n </label>\n </div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Model\n <input type=\"text\" [(ngModel)]=\"draft.model\" />\n </label>\n <label class=\"x-cat-f\">\n Type\n <select [(ngModel)]=\"draft.type\">\n @for (t of types; track t) { <option [value]=\"t\">{{ t }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Status\n <select [(ngModel)]=\"draft.status\">\n @for (s of statuses; track s) { <option [value]=\"s\">{{ s }}</option> }\n </select>\n </label>\n </div>\n @if (draft.type !== 'simple') {\n <div class=\"x-cat-hint\">\n \"{{ draft.type }}\" products still save through this one-variant form for now \u2014 a full\n per-variant / per-component editor is a follow-up.\n </div>\n }\n <label class=\"x-cat-f\">\n Short description\n <textarea rows=\"2\" [(ngModel)]=\"draft.shortDesc\"></textarea>\n </label>\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Category &amp; brand</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Category\n <select [(ngModel)]=\"draft.primaryCategoryId\" (ngModelChange)=\"onCategoryChange()\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (c of categories; track c.id) { <option [value]=\"c.id\">{{ c.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Brand\n <select [(ngModel)]=\"draft.brandId\">\n <option value=\"\">\u2014 none \u2014</option>\n @for (b of brands; track b.id) { <option [value]=\"b.id\">{{ b.name }}</option> }\n </select>\n </label>\n </div>\n </section>\n\n @if (attributeDefs.length) {\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Attributes</div>\n <div class=\"x-cat-attr-grid\">\n @for (def of attributeDefs; track def.id) {\n <label class=\"x-cat-f x-cat-attr\">\n {{ def.label }}{{ def.unit ? ' (' + def.unit + ')' : '' }}\n @if (def.required) {\n <span class=\"x-cat-required\">*</span>\n }\n @switch (def.dataType) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"attributeValues[def.id].valueBool\" />\n }\n @case ('enum') {\n <select [(ngModel)]=\"attributeValues[def.id].valueText\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of def.allowedValues; track opt) { <option [value]=\"opt\">{{ opt }}</option> }\n </select>\n }\n @case ('range') {\n <div class=\"x-cat-range\">\n <input type=\"number\" placeholder=\"min\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n <span>\u2013</span>\n <input\n type=\"number\"\n placeholder=\"max\"\n [(ngModel)]=\"attributeValues[def.id].valueNumberHigh\"\n />\n </div>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"attributeValues[def.id].valueText\" />\n }\n }\n </label>\n }\n </div>\n </section>\n }\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Variant, price &amp; stock</div>\n @if (variant) {\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n SKU\n <input type=\"text\" [(ngModel)]=\"variant.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Weight (kg)\n <input type=\"number\" min=\"0\" step=\"0.1\" [(ngModel)]=\"variant.weight\" />\n @if (variant.weight == null || variant.weight <= 0) {\n <small class=\"x-cat-hint\" style=\"color: var(--color-warn)\">\n No weight \u2014 delivery is priced with the default weight. Add the packed weight for an accurate shipping fee.\n </small>\n }\n </label>\n <label class=\"x-cat-f\">\n Handling class\n <select [(ngModel)]=\"variant.handlingClass\">\n <option value=\"standard\">standard</option>\n <option value=\"bulky\">bulky</option>\n <option value=\"freight\">freight</option>\n <option value=\"hazmat\">hazmat</option>\n </select>\n </label>\n </div>\n }\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Price (\u20A6)\n <input type=\"number\" [(ngModel)]=\"price!.amount\" [disabled]=\"!variant?.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Stock location\n <select [(ngModel)]=\"stock!.locationId\" [disabled]=\"!variant?.sku\">\n @for (loc of stockLocations; track loc.id) { <option [value]=\"loc.id\">{{ loc.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Available\n <input type=\"number\" [(ngModel)]=\"stock!.available\" [disabled]=\"!variant?.sku\" />\n </label>\n </div>\n @if (!variant?.sku) {\n <div class=\"x-cat-hint\">Enter a SKU above, then price/stock can be saved.</div>\n }\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Media</div>\n @if (!draft.id) {\n <div class=\"x-cat-hint\">Save the product once first \u2014 media needs a real product to attach to.</div>\n } @else {\n <div class=\"x-cat-media-grid\">\n @for (m of media; track m.id) {\n <div class=\"x-cat-media-item\">\n <img [src]=\"m.objectUrl\" [alt]=\"m.altText\" />\n <button type=\"button\" class=\"x-cat-media-remove\" (click)=\"removeMedia(m)\">Remove</button>\n </div>\n }\n </div>\n <label class=\"x-cat-btn x-cat-upload\">\n {{ uploadingMedia ? 'Uploading\u2026' : '+ Add image' }}\n <input type=\"file\" accept=\"image/*\" hidden [disabled]=\"uploadingMedia\" (change)=\"onMediaSelected($event)\" />\n </label>\n <div class=\"x-cat-hint\">\n Best results: <strong>1200 \u00D7 1200 px</strong> or larger, square (4:3 also works), product centred on a\n plain white/light background, JPG or WebP, under 8 MB. The first image is the listing thumbnail \u2014\n use a clean front-on shot; add the rating plate, ports/back and box contents as extra images.\n The site downsizes photos for phones automatically, so upload the sharp original.\n </div>\n }\n </section>\n </div>\n}\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-cat-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:14px}.x-cat-search{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);min-width:220px}.x-cat-spacer{flex:1}.x-cat-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted);display:inline-flex;align-items:center}.x-cat-btn:disabled{opacity:.5;cursor:default}.x-cat-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-catalog-table{display:flex;flex-direction:column;border:1px solid var(--color-border);border-radius:var(--radius-lg);overflow:hidden}.x-catalog-row{display:grid;grid-template-columns:minmax(220px,2.4fr) 130px 1fr 100px 70px 110px 1.4fr 140px;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--color-border);font-size:13px}.x-catalog-row:last-child{border-bottom:none}.x-catalog-head{font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.02em;color:var(--color-text-muted);background:var(--color-surface-alt, rgba(0, 0, 0, .02))}.x-catalog-model{display:block;font-size:11.5px;color:var(--color-text-muted)}.x-catalog-col-action{display:flex;gap:6px;justify-content:flex-end}.x-catalog-empty{padding:24px;text-align:center;color:var(--color-text-muted);font-size:13px}.x-status-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;border:1px solid var(--color-border);text-transform:capitalize}.x-check-pending{color:var(--color-text-muted);font-size:12px}.x-check-ok{color:var(--color-success, #2a7a3b);font-size:12px;font-weight:700}.x-check-errors{margin:0;padding-left:16px;font-size:11.5px;color:var(--color-danger, #c0362c)}.x-check-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:4px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-check-btn:disabled{opacity:.5;cursor:default}.x-cat-pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:12px}.x-cat-pager-label{font-size:12px;color:var(--color-text-muted)}.x-cat-editor{display:flex;flex-direction:column;gap:16px}.x-cat-editor-head{display:flex;align-items:center;justify-content:space-between}.x-cat-editor-title{font-size:18px;font-weight:800;color:var(--color-text)}.x-cat-editor-actions{display:flex;gap:8px}.x-cat-section{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:10px}.x-cat-section-title{font-size:13px;font-weight:800;color:var(--color-text);text-transform:uppercase;letter-spacing:.02em}.x-cat-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-cat-f input,.x-cat-f select,.x-cat-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-cat-f-row{display:flex;gap:10px;flex-wrap:wrap}.x-cat-hint{font-size:12px;color:var(--color-text-muted);font-style:italic}.x-cat-required{color:var(--color-danger, #c0362c)}.x-cat-attr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}.x-cat-attr input[type=checkbox]{width:18px;height:18px}.x-cat-range{display:flex;align-items:center;gap:6px}.x-cat-range input{width:0;flex:1}.x-cat-media-grid{display:flex;flex-wrap:wrap;gap:12px}.x-cat-media-item{position:relative;width:100px;height:100px;border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden}.x-cat-media-item img{width:100%;height:100%;object-fit:cover;display:block}.x-cat-media-remove{position:absolute;bottom:0;left:0;right:0;border:none;background:#0009;color:#fff;font-size:10px;padding:3px 0;cursor:pointer}.x-cat-upload{align-self:flex-start;cursor:pointer}.x-catalog-col-name{display:flex;align-items:center;gap:10px;min-width:0}.x-catalog-thumb{flex:0 0 40px;width:40px;height:40px;object-fit:contain;border-radius:var(--radius-sm, 4px);border:1px solid var(--color-border);background:var(--color-surface)}.x-catalog-thumb-empty{display:inline-block;background:var(--color-surface-2, rgba(0, 0, 0, .04))}.x-catalog-col-sku{font-family:var(--font-mono);font-size:12px;overflow:hidden;text-overflow:ellipsis}.x-cat-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}.x-cat-tab{padding:5px 12px;border-radius:999px;border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text);font-size:12.5px;font-weight:600;cursor:pointer}.x-cat-tab.is-active{background:var(--color-accent);border-color:var(--color-accent);color:var(--color-accent-fg)}.x-catalog-table{overflow-x:auto}.x-catalog-row{min-width:1040px}.x-catalog-col-price,.x-catalog-col-stock{font-family:var(--font-mono);font-size:12px}.x-catalog-warn{color:var(--color-warn, #8a5a12);font-weight:600}\n"] }]
579
579
  }] });
580
580
 
581
581
  class CatalogModule {
@@ -602,4 +602,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
602
602
  }] });
603
603
 
604
604
  export { CatalogModule };
605
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs.map
605
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-catalog.module-CnS35rup.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs","sources":["../../../projects/admin/src/lib/pages/catalog/catalog.component.ts","../../../projects/admin/src/lib/pages/catalog/catalog.component.html","../../../projects/admin/src/lib/pages/catalog/catalog.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { BaseDirective, getEnv, notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, of, takeUntil } from 'rxjs';\nimport { statusBadge } from '../_shared/status-badge';\n\n// `ProductMedia.blobId` (P1.3) resolves to `GET {API_BASE_URL}/apps/blobs/\n// download/:id` — same helper/reasoning as the buyer app's\n// `lib/data/media.ts#blobUrl` (confirmed against the real\n// `ntx-apps/libs/blobs` controller, not guessed).\nfunction resolveBlobUrl(blobId?: string | null): string {\n if (!blobId) return '';\n return `${getEnv('API_BASE_URL')}/apps/blobs/download/${blobId}`;\n}\n\n// `@thescaffold/jsx-blobs`'s own `upload()` helper is broken against this\n// platform's response envelope: its internal `init()`/`verify()` return\n// the raw `{status, title, message, data}` body but `upload()` then reads\n// `file.id` (not `file.data.id`) — so it always reports \"Failed to init\n// file upload\" even on a 201. Confirmed by driving the real upload flow\n// in a browser and reading the network log: `init` returns 201 with a\n// real file id, `upload()` still fails. Rather than depend on a broken\n// vendor convenience function, this reimplements the same three-call\n// contract (init → chunked batch → verify) directly against\n// `apiService`, which is also how P1's demo-media seed script validated\n// the contract in the first place, and gets Angular's existing\n// `JwtInterceptor` auth for free instead of hand-managing SDK config.\nasync function uploadFileToBlobs(\n apiService: { post: (path: string, body?: any) => any },\n file: File,\n parentId: string,\n tags: string[],\n): Promise<string> {\n const ext = file.name.split('.').pop()?.toLowerCase() || '';\n const mime = file.type || 'application/octet-stream';\n const meta = { type: ext, parentId, name: file.name, tags, size: file.size, mime };\n\n const initRes: any = await firstValueFrom(apiService.post('apps/blobs/upload/init', meta));\n const fileId = initRes?.data?.id;\n if (!fileId) throw new Error('Failed to init file upload');\n\n const chunkSize = 512 * 1024;\n const reader = file.stream().getReader();\n let index = 0;\n let buffer = new Uint8Array();\n\n const flushChunk = async (bytes: Uint8Array) => {\n await firstValueFrom(\n apiService.post('apps/blobs/upload/batch', {\n pages: [{ fileId, index: index++, raw: uint8ToBase64(bytes) }],\n }),\n );\n };\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n const combined = new Uint8Array(buffer.length + value.length);\n combined.set(buffer);\n combined.set(value, buffer.length);\n buffer = combined;\n while (buffer.length >= chunkSize) {\n await flushChunk(buffer.slice(0, chunkSize));\n buffer = buffer.slice(chunkSize);\n }\n }\n if (buffer.length > 0) await flushChunk(buffer);\n\n const verifyRes: any = await firstValueFrom(apiService.post('apps/blobs/upload/verify', meta));\n const blobId = verifyRes?.data?.id;\n if (!blobId) throw new Error('Failed to verify file upload');\n return blobId;\n}\n\nfunction uint8ToBase64(bytes: Uint8Array): string {\n let binary = '';\n const chunkSize = 0x8000;\n for (let i = 0; i < bytes.length; i += chunkSize) {\n binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));\n }\n return btoa(binary);\n}\n\ninterface PublishError {\n field: string;\n message: string;\n}\n\ninterface ProductRowVm {\n id: string;\n name: string;\n model: string;\n type: string;\n status: string;\n updatedAt: string;\n primaryCategoryId?: string;\n /** Filled in after the row renders, from `product/admin-summary`. */\n sku?: string;\n thumbUrl?: string;\n price?: { amount: number; currency: string } | null;\n /** Free stock across every site (available − reserved). */\n stockFree?: number;\n variantCount?: number;\n summaryLoaded?: boolean;\n checking: boolean;\n checked: boolean;\n canPublish?: boolean;\n errors?: PublishError[];\n}\n\ninterface CategoryOption {\n id: string;\n name: string;\n slug: string;\n parentId?: string;\n}\n\ninterface BrandOption {\n id: string;\n name: string;\n}\n\ninterface AttributeDefVm {\n id: string;\n key: string;\n label: string;\n unit?: string;\n dataType: string;\n allowedValues?: string[];\n required: boolean;\n group?: string;\n}\n\ninterface AttributeValueVm {\n id?: string;\n valueNumber?: number | null;\n valueNumberHigh?: number | null;\n valueText?: string;\n valueBool?: boolean;\n}\n\ninterface MediaVm {\n id: string;\n blobId: string;\n altText: string;\n type: string;\n // `GET apps/blobs/download/:id` requires a bearer token, which a plain\n // `<img src>` can never send (browsers only attach cookies to image\n // requests, not custom headers) — confirmed by driving the real upload\n // flow in a browser: even a valid admin session gets a 401 loading the\n // thumbnail directly. Buyer's product-image rendering\n // (`lib/data/media.ts#blobUrl`, used the same naive way) has this same\n // bug; out of scope here, but worth flagging. This page instead fetches\n // the bytes through the authenticated `HttpClient` and renders a local\n // `blob:` object URL.\n objectUrl?: string;\n}\n\ninterface DraftProduct {\n id?: string;\n name: string;\n slug: string;\n model: string;\n brandId: string;\n primaryCategoryId: string;\n shortDesc: string;\n type: string;\n status: string;\n}\n\nconst PRODUCT_TYPES = ['simple', 'variant', 'kit'];\nconst PRODUCT_STATUSES = ['draft', 'active', 'archived', 'discontinued'];\n\n// A fixed \"folder\" id for every admin-uploaded product image.\n// `BlobsFiles.parentId` is NOT NULL in the DB despite the entity/DTO\n// marking it optional (`@IsOptional()`, `nullable: true`) — a genuine\n// vendor-package mismatch, found by running the demo-catalogue media seed\n// script against a live server and reading the resulting\n// QueryFailedError (see the commerce migrations' own notes). No FK is\n// declared on the column, so any UUID satisfies it.\n// Product photo guidance — mirrored in the bulk importer and the admin hint.\nconst MAX_IMAGE_BYTES = 8 * 1024 * 1024;\nconst MIN_IMAGE_SIDE = 800;\n\nasync function readImageSize(file: File): Promise<{ width: number; height: number } | undefined> {\n try {\n const bitmap = await createImageBitmap(file);\n const size = { width: bitmap.width, height: bitmap.height };\n bitmap.close();\n return size;\n } catch {\n return undefined;\n }\n}\n\nconst PRODUCT_MEDIA_PARENT_ID = '00000000-0000-4000-8000-000000000d30';\n\n// P1.15 (original slice) + R1 production-readiness pass (this rebuild).\n// The original version of this page was read-only: a product list plus\n// the CAT-03 publish-validation check, with no create/edit/media/\n// attribute/variant/pricing UI anywhere — \"no way to add items to\n// catalogue\" was the single most direct gap this session set out to\n// close. This keeps the publish-check list and adds a full create/edit\n// flow: basic info → category/brand → the category's resolved attribute\n// grid → one implicit variant (simple products; a per-variant grid for\n// `variant`-type products is real, isolated follow-up work, same\n// reasoning P1.15 originally gave for deferring it) → media upload → a\n// single default price + stock level. Search/refresh on the list are\n// real (not the generic `x-webget-collection` — this table needs a\n// bespoke \"Check\" action + inline errors the generic collection can't\n// render, so pagination/search are hand-wired here instead).\n@Component({\n standalone: false,\n selector: 'x-catalog',\n templateUrl: './catalog.component.html',\n styleUrl: './catalog.component.scss',\n})\nexport class CatalogComponent extends BaseDirective {\n private readonly http = inject(HttpClient);\n\n private readonly productSource = this.apiService.on('apps/commerce/product');\n private readonly categorySource = this.apiService.on('apps/commerce/category');\n private readonly brandSource = this.apiService.on('apps/commerce/brand');\n private readonly variantSource = this.apiService.on('apps/commerce/product-variant');\n private readonly attrValueSource = this.apiService.on('apps/commerce/product-attribute-value');\n private readonly mediaSource = this.apiService.on('apps/commerce/product-media');\n private readonly priceSource = this.apiService.on('apps/commerce/price');\n private readonly stockLevelSource = this.apiService.on('apps/commerce/stock-level');\n private readonly stockLocationSource = this.apiService.on('apps/commerce/stock-location');\n\n readonly types = PRODUCT_TYPES;\n readonly statuses = PRODUCT_STATUSES;\n\n loading = true;\n products: ProductRowVm[] = [];\n categories: CategoryOption[] = [];\n brands: BrandOption[] = [];\n stockLocations: { id: string; name: string }[] = [];\n\n query = '';\n /** Status tab: '' = all. */\n statusFilter = '';\n page = 1;\n perPage = 25;\n total = 0;\n statusBadge = statusBadge;\n\n editing = false;\n saving = false;\n uploadingMedia = false;\n\n draft: DraftProduct | null = null;\n variant: { id?: string; sku: string; weight: number | null; handlingClass: string } | null = null;\n attributeDefs: AttributeDefVm[] = [];\n attributeValues: Record<string, AttributeValueVm> = {};\n media: MediaVm[] = [];\n price: { id?: string; amount: number | null } | null = null;\n stock: { id?: string; locationId: string; available: number } | null = null;\n\n override init = () => {\n this.loadProducts();\n this.loadCategories();\n this.loadBrands();\n this.loadStockLocations();\n };\n\n loadProducts(page = this.page): void {\n this.loading = true;\n this.page = page;\n const params: any = { page, perPage: this.perPage };\n if (this.query.trim()) params.query = this.query.trim();\n if (this.statusFilter) params.status = this.statusFilter;\n this.productSource\n .getMany(params)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.products = (response?.data ?? []).map(\n (p: any): ProductRowVm => ({\n id: p.id,\n name: p.name,\n model: p.model,\n type: p.type,\n status: p.status,\n updatedAt: p.updatedAt,\n primaryCategoryId: p.primaryCategoryId,\n checking: false,\n checked: false,\n }),\n );\n this.total = response?.meta?.total ?? this.products.length;\n this.loading = false;\n void this.fillRowDetails(this.products);\n }),\n );\n }\n\n search(): void {\n this.loadProducts(1);\n }\n\n setStatusFilter(status: string): void {\n this.statusFilter = status;\n this.loadProducts(1);\n }\n\n categoryName(id?: string): string {\n return (id && this.categories.find((c) => c.id === id)?.name) || '—';\n }\n\n // SKU, thumbnail, price and stock for the visible rows, after the table\n // has rendered: one `product/admin-summary` call for the whole page.\n private async fillRowDetails(rows: ProductRowVm[]): Promise<void> {\n if (!rows.length) return;\n const res: any = await firstValueFrom(\n this.apiService\n .post('apps/commerce/product/admin-summary', { productIds: rows.map((r) => r.id) })\n .pipe(catchError(() => of(null))),\n );\n const data: Record<string, any> = res?.data ?? {};\n for (const row of rows) {\n const s = data[row.id];\n row.summaryLoaded = true;\n // Call failed / row missing: price and stock stay unknown (\"—\"), not \"none\".\n if (!s) continue;\n row.sku = s.sku ?? '';\n row.thumbUrl = s.thumbnailBlobId ? `${getEnv('API_BASE_URL')}/apps/commerce/media/${s.thumbnailBlobId}?w=96` : '';\n row.price = s.price ?? null;\n row.stockFree = Number(s.available ?? 0) - Number(s.reserved ?? 0);\n row.variantCount = Number(s.variants ?? 0);\n }\n }\n\n money(price?: { amount: number; currency: string } | null): string {\n if (!price) return '—';\n return new Intl.NumberFormat('en-NG', { style: 'currency', currency: price.currency || 'NGN', maximumFractionDigits: 0 }).format(price.amount);\n }\n\n refresh(): void {\n this.loadProducts(this.page);\n }\n\n prevPage(): void {\n if (this.page > 1) this.loadProducts(this.page - 1);\n }\n\n nextPage(): void {\n if (this.page * this.perPage < this.total) this.loadProducts(this.page + 1);\n }\n\n loadCategories(): void {\n this.categorySource\n .getMany({ page: 1, perPage: 300 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.categories = (response?.data ?? []).sort((a: any, b: any) =>\n String(a.name).localeCompare(String(b.name)),\n );\n }),\n );\n }\n\n loadBrands(): void {\n this.brandSource\n .getMany({ page: 1, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.brands = (response?.data ?? []).sort((a: any, b: any) =>\n String(a.name).localeCompare(String(b.name)),\n );\n }),\n );\n }\n\n loadStockLocations(): void {\n this.stockLocationSource\n .getMany({ page: 1, perPage: 50 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using((response: any) => (this.stockLocations = response?.data ?? [])));\n }\n\n checkPublish(product: ProductRowVm): void {\n product.checking = true;\n this.productSource\n .post(`apps/commerce/product/${product.id}/validate-publish`)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n product.checking = false;\n product.checked = true;\n product.canPublish = !!response?.data?.canPublish;\n product.errors = response?.data?.errors ?? [];\n }),\n );\n }\n\n startCreate(): void {\n this.editing = true;\n this.draft = {\n name: '',\n slug: '',\n model: '',\n brandId: '',\n primaryCategoryId: '',\n shortDesc: '',\n type: 'simple',\n status: 'draft',\n };\n this.variant = { sku: '', weight: null, handlingClass: 'standard' };\n this.attributeDefs = [];\n this.attributeValues = {};\n this.media = [];\n this.price = { amount: null };\n this.stock = { locationId: this.stockLocations[0]?.id ?? '', available: 0 };\n }\n\n async edit(row: ProductRowVm): Promise<void> {\n this.editing = true;\n const productRes: any = await firstValueFrom(this.productSource.getOne(row.id));\n const p = productRes?.data;\n this.draft = {\n id: p.id,\n name: p.name ?? '',\n slug: p.slug ?? '',\n model: p.model ?? '',\n brandId: p.brandId ?? '',\n primaryCategoryId: p.primaryCategoryId ?? '',\n shortDesc: p.shortDesc ?? '',\n type: p.type,\n status: p.status,\n };\n\n this.attributeValues = {};\n if (this.draft.primaryCategoryId) {\n await this.loadAttributeTemplate(this.draft.primaryCategoryId);\n } else {\n this.attributeDefs = [];\n }\n\n const [variantsRes, attrsRes, mediaRes] = await Promise.all([\n firstValueFrom(this.variantSource.getMany({ productId: p.id, page: 1, perPage: 50 } as any)),\n firstValueFrom(this.attrValueSource.getMany({ productId: p.id, page: 1, perPage: 200 } as any)),\n firstValueFrom(this.mediaSource.getMany({ productId: p.id, page: 1, perPage: 50 } as any)),\n ]);\n\n const firstVariant = (variantsRes as any)?.data?.[0];\n this.variant = firstVariant\n ? {\n id: firstVariant.id,\n sku: firstVariant.sku,\n weight: firstVariant.weight ?? null,\n handlingClass: firstVariant.handlingClass ?? 'standard',\n }\n : { sku: '', weight: null, handlingClass: 'standard' };\n\n for (const v of (attrsRes as any)?.data ?? []) {\n this.attributeValues[v.attributeDefinitionId] = {\n id: v.id,\n valueNumber: v.valueNumber,\n valueNumberHigh: v.valueNumberHigh,\n valueText: v.valueText,\n valueBool: v.valueBool,\n };\n }\n\n this.media = ((mediaRes as any)?.data ?? []).map((m: any) => ({\n id: m.id,\n blobId: m.blobId,\n altText: m.altText,\n type: m.type,\n }));\n for (const m of this.media) {\n m.objectUrl = await this.resolveMediaObjectUrl(m.blobId);\n }\n\n if (this.variant.id) {\n const priceRes: any = await firstValueFrom(\n this.priceSource.getMany({ variantId: this.variant.id, page: 1, perPage: 1 } as any),\n );\n const priceRow = priceRes?.data?.[0];\n this.price = priceRow ? { id: priceRow.id, amount: priceRow.amount } : { amount: null };\n\n const stockRes: any = await firstValueFrom(\n this.stockLevelSource.getMany({ variantId: this.variant.id, page: 1, perPage: 1 } as any),\n );\n const stockRow = stockRes?.data?.[0];\n this.stock = stockRow\n ? { id: stockRow.id, locationId: stockRow.locationId, available: stockRow.available }\n : { locationId: this.stockLocations[0]?.id ?? '', available: 0 };\n } else {\n this.price = { amount: null };\n this.stock = { locationId: this.stockLocations[0]?.id ?? '', available: 0 };\n }\n }\n\n async onCategoryChange(): Promise<void> {\n if (!this.draft?.primaryCategoryId) {\n this.attributeDefs = [];\n return;\n }\n await this.loadAttributeTemplate(this.draft.primaryCategoryId);\n }\n\n private async loadAttributeTemplate(categoryId: string): Promise<void> {\n try {\n const res: any = await firstValueFrom(\n this.apiService.get(`apps/commerce/category/${categoryId}/attribute-template`),\n );\n this.attributeDefs = (res?.data?.definitions ?? []) as AttributeDefVm[];\n for (const def of this.attributeDefs) {\n if (!this.attributeValues[def.id]) this.attributeValues[def.id] = {};\n }\n } catch {\n this.attributeDefs = [];\n }\n }\n\n async saveProduct(): Promise<void> {\n if (!this.draft || !this.draft.name.trim()) {\n notify('Name is required.', undefined, 'error');\n return;\n }\n this.saving = true;\n try {\n const payload: any = {\n name: this.draft.name.trim(),\n slug: this.draft.slug.trim() || undefined,\n brandId: this.draft.brandId || undefined,\n model: this.draft.model.trim() || undefined,\n primaryCategoryId: this.draft.primaryCategoryId || undefined,\n shortDesc: this.draft.shortDesc.trim() || undefined,\n type: this.draft.type,\n status: this.draft.status,\n };\n\n if (this.draft.id) {\n await firstValueFrom(this.productSource.update(this.draft.id, payload));\n } else {\n const res: any = await firstValueFrom(this.productSource.create(payload));\n this.draft.id = res?.data?.id;\n }\n const productId = this.draft.id!;\n\n if (this.variant && this.variant.sku.trim()) {\n const variantPayload: any = {\n productId,\n sku: this.variant.sku.trim(),\n weight: this.variant.weight != null ? Number(this.variant.weight) : undefined,\n handlingClass: this.variant.handlingClass || 'standard',\n };\n if (this.variant.id) {\n await firstValueFrom(this.variantSource.update(this.variant.id, variantPayload));\n } else {\n const vRes: any = await firstValueFrom(this.variantSource.create(variantPayload));\n this.variant.id = vRes?.data?.id;\n }\n }\n\n for (const def of this.attributeDefs) {\n const v = this.attributeValues[def.id];\n if (!v) continue;\n const hasValue =\n (v.valueNumber !== null && v.valueNumber !== undefined && `${v.valueNumber}` !== '') ||\n !!v.valueText ||\n v.valueBool !== null && v.valueBool !== undefined;\n if (!hasValue) continue;\n\n const attrPayload: any = {\n productId,\n attributeDefinitionId: def.id,\n valueNumber:\n def.dataType === 'number' || def.dataType === 'range'\n ? v.valueNumber != null && `${v.valueNumber}` !== ''\n ? Number(v.valueNumber)\n : undefined\n : undefined,\n valueNumberHigh:\n def.dataType === 'range' && v.valueNumberHigh != null && `${v.valueNumberHigh}` !== ''\n ? Number(v.valueNumberHigh)\n : undefined,\n valueText: def.dataType === 'text' || def.dataType === 'enum' ? v.valueText || undefined : undefined,\n valueBool: def.dataType === 'boolean' ? !!v.valueBool : undefined,\n };\n\n if (v.id) {\n await firstValueFrom(this.attrValueSource.update(v.id, attrPayload));\n } else {\n const aRes: any = await firstValueFrom(this.attrValueSource.create(attrPayload));\n v.id = aRes?.data?.id;\n }\n }\n\n if (this.variant?.id) {\n if (this.price && this.price.amount != null && `${this.price.amount}` !== '') {\n const pricePayload: any = {\n variantId: this.variant.id,\n amount: Number(this.price.amount),\n minQuantity: 1,\n };\n if (this.price.id) {\n await firstValueFrom(this.priceSource.update(this.price.id, pricePayload));\n } else {\n const prRes: any = await firstValueFrom(this.priceSource.create(pricePayload));\n this.price.id = prRes?.data?.id;\n }\n }\n\n if (this.stock?.locationId) {\n const stockPayload: any = {\n variantId: this.variant.id,\n locationId: this.stock.locationId,\n available: Number(this.stock.available ?? 0),\n };\n if (this.stock.id) {\n await firstValueFrom(this.stockLevelSource.update(this.stock.id, stockPayload));\n } else {\n const stRes: any = await firstValueFrom(this.stockLevelSource.create(stockPayload));\n this.stock.id = stRes?.data?.id;\n }\n }\n }\n\n notify('Product saved.', undefined, 'success');\n this.loadProducts(this.page);\n } catch {\n notify('Could not save the product (check required fields).', undefined, 'error');\n } finally {\n this.saving = false;\n }\n }\n\n async onMediaSelected(event: Event): Promise<void> {\n const input = event.target as HTMLInputElement;\n const files = input.files;\n if (!files || !files.length || !this.draft?.id) return;\n\n const file = files[0];\n if (file.size > MAX_IMAGE_BYTES) {\n notify('That image is over 8 MB — export it at 1200–2000 px (JPG/WebP) and try again.', undefined, 'error');\n input.value = '';\n return;\n }\n const size = await readImageSize(file);\n if (size && Math.min(size.width, size.height) < MIN_IMAGE_SIDE) {\n notify(\n `That image is only ${size.width} × ${size.height}px — it will look soft on large screens. 1200 × 1200 px or more is recommended.`,\n undefined,\n 'warning',\n );\n }\n\n this.uploadingMedia = true;\n try {\n const blobId = await uploadFileToBlobs(this.apiService, file, PRODUCT_MEDIA_PARENT_ID, [\n 'product-media',\n ]);\n const altText = `${this.draft.name} — product photo`;\n const res: any = await firstValueFrom(\n this.mediaSource.create({\n productId: this.draft.id,\n blobId,\n type: 'gallery',\n altText,\n position: this.media.length,\n } as any),\n );\n const objectUrl = await this.resolveMediaObjectUrl(blobId);\n this.media.push({ id: res?.data?.id, blobId, altText, type: 'gallery', objectUrl });\n notify('Image uploaded.', undefined, 'success');\n } catch (e) {\n console.error('media upload failed', e);\n notify('Could not upload the image.', undefined, 'error');\n } finally {\n this.uploadingMedia = false;\n input.value = '';\n }\n }\n\n async removeMedia(item: MediaVm): Promise<void> {\n try {\n await firstValueFrom(this.mediaSource.remove(item.id));\n this.media = this.media.filter((m) => m.id !== item.id);\n } catch {\n notify('Could not remove the image.', undefined, 'error');\n }\n }\n\n // `download/:id` needs the bearer header only `HttpClient` (via the\n // app's existing `JwtInterceptor`) can attach — see the `MediaVm.\n // objectUrl` comment. Empty string on failure just leaves the\n // thumbnail blank rather than breaking the editor.\n private async resolveMediaObjectUrl(blobId: string): Promise<string> {\n try {\n const blob = await firstValueFrom(this.http.get(resolveBlobUrl(blobId), { responseType: 'blob' }));\n // Not `URL.createObjectURL` — the app's CSP `img-src` allows `data:`\n // but not `blob:`, so an object URL renders as a CSP violation\n // (confirmed by driving this in a browser). A data URI sidesteps it.\n return await new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n } catch {\n return '';\n }\n }\n\n cancelEdit(): void {\n this.editing = false;\n this.draft = null;\n this.variant = null;\n this.attributeDefs = [];\n this.attributeValues = {};\n this.media = [];\n this.price = null;\n this.stock = null;\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Catalogue</div>\n <div class=\"x-page-subtitle\">Products, variants, attributes, media, pricing and stock.</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-cat-toolbar\">\n <input\n type=\"text\"\n class=\"x-cat-search\"\n placeholder=\"Search products…\"\n [(ngModel)]=\"query\"\n (keyup.enter)=\"search()\"\n />\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"search()\">Search</button>\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"refresh()\">Refresh</button>\n <div class=\"x-cat-spacer\"></div>\n <a class=\"x-cat-btn\" routerLink=\"/admin/bulk-upload\">Bulk upload (Excel)</a>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" (click)=\"startCreate()\">+ New product</button>\n </div>\n\n <div class=\"x-cat-tabs\" role=\"tablist\" aria-label=\"Filter by status\">\n @for (tab of [''].concat(statuses); track tab) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"x-cat-tab\"\n [class.is-active]=\"statusFilter === tab\"\n [attr.aria-selected]=\"statusFilter === tab\"\n (click)=\"setStatusFilter(tab)\"\n >\n {{ tab ? (tab | titlecase) : 'All' }}\n </button>\n }\n </div>\n\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-catalog-table\">\n <div class=\"x-catalog-row x-catalog-head\">\n <div class=\"x-catalog-col-name\">Product</div>\n <div class=\"x-catalog-col-sku\">SKU</div>\n <div class=\"x-catalog-col-category\">Category</div>\n <div class=\"x-catalog-col-price\">Price</div>\n <div class=\"x-catalog-col-stock\">Stock</div>\n <div class=\"x-catalog-col-status\">Status</div>\n <div class=\"x-catalog-col-check\">Publish check</div>\n <div class=\"x-catalog-col-action\"></div>\n </div>\n @for (product of products; track product.id) {\n <div class=\"x-catalog-row\">\n <div class=\"x-catalog-col-name\">\n @if (product.thumbUrl) {\n <img class=\"x-catalog-thumb\" [src]=\"product.thumbUrl\" alt=\"\" loading=\"lazy\" />\n } @else {\n <span class=\"x-catalog-thumb x-catalog-thumb-empty\" aria-hidden=\"true\"></span>\n }\n <span>\n {{ product.name }}\n <span class=\"x-catalog-model\">\n {{ product.type }}@if (product.model) { · {{ product.model }} } · updated {{ product.updatedAt | date: 'd MMM' }}\n </span>\n </span>\n </div>\n <div class=\"x-catalog-col-sku\">{{ product.sku || '—' }}</div>\n <div class=\"x-catalog-col-category\">{{ categoryName(product.primaryCategoryId) }}</div>\n <div class=\"x-catalog-col-price\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">…</span>\n } @else if (product.price) {\n {{ money(product.price) }}\n } @else if (product.price === null) {\n <span class=\"x-catalog-warn\">No price</span>\n } @else {\n —\n }\n </div>\n <div class=\"x-catalog-col-stock\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">…</span>\n } @else if (product.stockFree === undefined) {\n —\n } @else if (product.stockFree > 0) {\n {{ product.stockFree }}\n @if ((product.variantCount ?? 0) > 1) {\n <span class=\"x-catalog-model\">{{ product.variantCount }} variants</span>\n }\n } @else {\n <span class=\"x-catalog-warn\">Out</span>\n }\n </div>\n <div class=\"x-catalog-col-status\" [innerHTML]=\"statusBadge(product.status)\"></div>\n <div class=\"x-catalog-col-check\">\n @if (product.checking) {\n <span class=\"x-check-pending\">Checking…</span>\n } @else if (product.checked && product.canPublish) {\n <span class=\"x-check-ok\">✓ Ready to publish</span>\n } @else if (!product.checked) {\n <span class=\"x-check-pending\">Not checked — press Check</span>\n } @else if (product.checked && product.errors?.length) {\n <ul class=\"x-check-errors\">\n @for (err of product.errors; track err.field) {\n <li>{{ err.message }}</li>\n }\n </ul>\n }\n </div>\n <div class=\"x-catalog-col-action\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"edit(product)\">Edit</button>\n <button\n type=\"button\"\n class=\"x-check-btn\"\n [disabled]=\"product.checking\"\n (click)=\"checkPublish(product)\"\n >\n Check\n </button>\n </div>\n </div>\n }\n @if (!products.length) {\n <div class=\"x-catalog-empty\">No products yet — use \"+ New product\" to add one.</div>\n }\n </div>\n\n <div class=\"x-cat-pager\">\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page <= 1\" (click)=\"prevPage()\">← Prev</button>\n <span class=\"x-cat-pager-label\">Page {{ page }} · {{ total }} total</span>\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page * perPage >= total\" (click)=\"nextPage()\">\n Next →\n </button>\n </div>\n }\n} @else if (draft) {\n <div class=\"x-cat-editor\">\n <div class=\"x-cat-editor-head\">\n <div class=\"x-cat-editor-title\">{{ draft.id ? 'Edit product' : 'New product' }}</div>\n <div class=\"x-cat-editor-actions\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" [disabled]=\"saving\" (click)=\"saveProduct()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Basic info</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Name\n <input type=\"text\" [(ngModel)]=\"draft.name\" />\n </label>\n <label class=\"x-cat-f\">\n Slug (optional)\n <input type=\"text\" [(ngModel)]=\"draft.slug\" placeholder=\"auto from name if blank\" />\n </label>\n </div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Model\n <input type=\"text\" [(ngModel)]=\"draft.model\" />\n </label>\n <label class=\"x-cat-f\">\n Type\n <select [(ngModel)]=\"draft.type\">\n @for (t of types; track t) { <option [value]=\"t\">{{ t }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Status\n <select [(ngModel)]=\"draft.status\">\n @for (s of statuses; track s) { <option [value]=\"s\">{{ s }}</option> }\n </select>\n </label>\n </div>\n @if (draft.type !== 'simple') {\n <div class=\"x-cat-hint\">\n \"{{ draft.type }}\" products still save through this one-variant form for now — a full\n per-variant / per-component editor is a follow-up.\n </div>\n }\n <label class=\"x-cat-f\">\n Short description\n <textarea rows=\"2\" [(ngModel)]=\"draft.shortDesc\"></textarea>\n </label>\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Category &amp; brand</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Category\n <select [(ngModel)]=\"draft.primaryCategoryId\" (ngModelChange)=\"onCategoryChange()\">\n <option value=\"\">— none —</option>\n @for (c of categories; track c.id) { <option [value]=\"c.id\">{{ c.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Brand\n <select [(ngModel)]=\"draft.brandId\">\n <option value=\"\">— none —</option>\n @for (b of brands; track b.id) { <option [value]=\"b.id\">{{ b.name }}</option> }\n </select>\n </label>\n </div>\n </section>\n\n @if (attributeDefs.length) {\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Attributes</div>\n <div class=\"x-cat-attr-grid\">\n @for (def of attributeDefs; track def.id) {\n <label class=\"x-cat-f x-cat-attr\">\n {{ def.label }}{{ def.unit ? ' (' + def.unit + ')' : '' }}\n @if (def.required) {\n <span class=\"x-cat-required\">*</span>\n }\n @switch (def.dataType) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"attributeValues[def.id].valueBool\" />\n }\n @case ('enum') {\n <select [(ngModel)]=\"attributeValues[def.id].valueText\">\n <option value=\"\">— choose —</option>\n @for (opt of def.allowedValues; track opt) { <option [value]=\"opt\">{{ opt }}</option> }\n </select>\n }\n @case ('range') {\n <div class=\"x-cat-range\">\n <input type=\"number\" placeholder=\"min\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n <span>–</span>\n <input\n type=\"number\"\n placeholder=\"max\"\n [(ngModel)]=\"attributeValues[def.id].valueNumberHigh\"\n />\n </div>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"attributeValues[def.id].valueText\" />\n }\n }\n </label>\n }\n </div>\n </section>\n }\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Variant, price &amp; stock</div>\n @if (variant) {\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n SKU\n <input type=\"text\" [(ngModel)]=\"variant.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Weight (kg)\n <input type=\"number\" [(ngModel)]=\"variant.weight\" />\n </label>\n <label class=\"x-cat-f\">\n Handling class\n <select [(ngModel)]=\"variant.handlingClass\">\n <option value=\"standard\">standard</option>\n <option value=\"bulky\">bulky</option>\n <option value=\"freight\">freight</option>\n <option value=\"hazmat\">hazmat</option>\n </select>\n </label>\n </div>\n }\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Price (₦)\n <input type=\"number\" [(ngModel)]=\"price!.amount\" [disabled]=\"!variant?.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Stock location\n <select [(ngModel)]=\"stock!.locationId\" [disabled]=\"!variant?.sku\">\n @for (loc of stockLocations; track loc.id) { <option [value]=\"loc.id\">{{ loc.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Available\n <input type=\"number\" [(ngModel)]=\"stock!.available\" [disabled]=\"!variant?.sku\" />\n </label>\n </div>\n @if (!variant?.sku) {\n <div class=\"x-cat-hint\">Enter a SKU above, then price/stock can be saved.</div>\n }\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Media</div>\n @if (!draft.id) {\n <div class=\"x-cat-hint\">Save the product once first — media needs a real product to attach to.</div>\n } @else {\n <div class=\"x-cat-media-grid\">\n @for (m of media; track m.id) {\n <div class=\"x-cat-media-item\">\n <img [src]=\"m.objectUrl\" [alt]=\"m.altText\" />\n <button type=\"button\" class=\"x-cat-media-remove\" (click)=\"removeMedia(m)\">Remove</button>\n </div>\n }\n </div>\n <label class=\"x-cat-btn x-cat-upload\">\n {{ uploadingMedia ? 'Uploading…' : '+ Add image' }}\n <input type=\"file\" accept=\"image/*\" hidden [disabled]=\"uploadingMedia\" (change)=\"onMediaSelected($event)\" />\n </label>\n <div class=\"x-cat-hint\">\n Best results: <strong>1200 × 1200 px</strong> or larger, square (4:3 also works), product centred on a\n plain white/light background, JPG or WebP, under 8 MB. The first image is the listing thumbnail —\n use a clean front-on shot; add the rating plate, ports/back and box contents as extra images.\n The site downsizes photos for phones automatically, so upload the sharp original.\n </div>\n }\n </section>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { CatalogComponent } from './catalog.component';\n\n@NgModule({\n declarations: [CatalogComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: CatalogComponent }]),\n ],\n})\nexport class CatalogModule {}\n"],"names":["i2","i3","i4","i1"],"mappings":";;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,MAAsB,EAAA;AAC5C,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE;IACtB,OAAO,CAAA,EAAG,MAAM,CAAC,cAAc,CAAC,CAAA,qBAAA,EAAwB,MAAM,EAAE;AAClE;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB,CAC9B,UAAuD,EACvD,IAAU,EACV,QAAgB,EAChB,IAAc,EAAA;AAEd,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;AAC3D,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,0BAA0B;IACpD,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;AAElF,IAAA,MAAM,OAAO,GAAQ,MAAM,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;AAC1F,IAAA,MAAM,MAAM,GAAG,OAAO,EAAE,IAAI,EAAE,EAAE;AAChC,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC;AAE1D,IAAA,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI;IAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE;IACxC,IAAI,KAAK,GAAG,CAAC;AACb,IAAA,IAAI,MAAM,GA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A,EAAA,MAAA,EAAA,CAAA,spKAAA,CAAA,EAAA;;;MEtMV,aAAa,CAAA;+GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAb,aAAa,EAAA,YAAA,EAAA,CART,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAE7B,YAAY;YACZ,cAAc;YACd,aAAa,EAAAC,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIJ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YANtB,YAAY;YACZ,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGzD,aAAa,EAAA,UAAA,EAAA,CAAA;kBATzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACnE,qBAAA;AACF,iBAAA;;;;;"}
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-catalog.module-CnS35rup.mjs","sources":["../../../projects/admin/src/lib/pages/catalog/catalog.component.ts","../../../projects/admin/src/lib/pages/catalog/catalog.component.html","../../../projects/admin/src/lib/pages/catalog/catalog.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { BaseDirective, getEnv, notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, of, takeUntil } from 'rxjs';\nimport { statusBadge } from '../_shared/status-badge';\n\n// `ProductMedia.blobId` (P1.3) resolves to `GET {API_BASE_URL}/apps/blobs/\n// download/:id` — same helper/reasoning as the buyer app's\n// `lib/data/media.ts#blobUrl` (confirmed against the real\n// `ntx-apps/libs/blobs` controller, not guessed).\nfunction resolveBlobUrl(blobId?: string | null): string {\n if (!blobId) return '';\n return `${getEnv('API_BASE_URL')}/apps/blobs/download/${blobId}`;\n}\n\n// `@thescaffold/jsx-blobs`'s own `upload()` helper is broken against this\n// platform's response envelope: its internal `init()`/`verify()` return\n// the raw `{status, title, message, data}` body but `upload()` then reads\n// `file.id` (not `file.data.id`) — so it always reports \"Failed to init\n// file upload\" even on a 201. Confirmed by driving the real upload flow\n// in a browser and reading the network log: `init` returns 201 with a\n// real file id, `upload()` still fails. Rather than depend on a broken\n// vendor convenience function, this reimplements the same three-call\n// contract (init → chunked batch → verify) directly against\n// `apiService`, which is also how P1's demo-media seed script validated\n// the contract in the first place, and gets Angular's existing\n// `JwtInterceptor` auth for free instead of hand-managing SDK config.\nasync function uploadFileToBlobs(\n apiService: { post: (path: string, body?: any) => any },\n file: File,\n parentId: string,\n tags: string[],\n): Promise<string> {\n const ext = file.name.split('.').pop()?.toLowerCase() || '';\n const mime = file.type || 'application/octet-stream';\n const meta = { type: ext, parentId, name: file.name, tags, size: file.size, mime };\n\n const initRes: any = await firstValueFrom(apiService.post('apps/blobs/upload/init', meta));\n const fileId = initRes?.data?.id;\n if (!fileId) throw new Error('Failed to init file upload');\n\n const chunkSize = 512 * 1024;\n const reader = file.stream().getReader();\n let index = 0;\n let buffer = new Uint8Array();\n\n const flushChunk = async (bytes: Uint8Array) => {\n await firstValueFrom(\n apiService.post('apps/blobs/upload/batch', {\n pages: [{ fileId, index: index++, raw: uint8ToBase64(bytes) }],\n }),\n );\n };\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n const combined = new Uint8Array(buffer.length + value.length);\n combined.set(buffer);\n combined.set(value, buffer.length);\n buffer = combined;\n while (buffer.length >= chunkSize) {\n await flushChunk(buffer.slice(0, chunkSize));\n buffer = buffer.slice(chunkSize);\n }\n }\n if (buffer.length > 0) await flushChunk(buffer);\n\n const verifyRes: any = await firstValueFrom(apiService.post('apps/blobs/upload/verify', meta));\n const blobId = verifyRes?.data?.id;\n if (!blobId) throw new Error('Failed to verify file upload');\n return blobId;\n}\n\nfunction uint8ToBase64(bytes: Uint8Array): string {\n let binary = '';\n const chunkSize = 0x8000;\n for (let i = 0; i < bytes.length; i += chunkSize) {\n binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));\n }\n return btoa(binary);\n}\n\ninterface PublishError {\n field: string;\n message: string;\n}\n\ninterface ProductRowVm {\n id: string;\n name: string;\n model: string;\n type: string;\n status: string;\n updatedAt: string;\n primaryCategoryId?: string;\n /** Filled in after the row renders, from `product/admin-summary`. */\n sku?: string;\n thumbUrl?: string;\n price?: { amount: number; currency: string } | null;\n /** Free stock across every site (available − reserved). */\n stockFree?: number;\n variantCount?: number;\n summaryLoaded?: boolean;\n checking: boolean;\n checked: boolean;\n canPublish?: boolean;\n errors?: PublishError[];\n}\n\ninterface CategoryOption {\n id: string;\n name: string;\n slug: string;\n parentId?: string;\n}\n\ninterface BrandOption {\n id: string;\n name: string;\n}\n\ninterface AttributeDefVm {\n id: string;\n key: string;\n label: string;\n unit?: string;\n dataType: string;\n allowedValues?: string[];\n required: boolean;\n group?: string;\n}\n\ninterface AttributeValueVm {\n id?: string;\n valueNumber?: number | null;\n valueNumberHigh?: number | null;\n valueText?: string;\n valueBool?: boolean;\n}\n\ninterface MediaVm {\n id: string;\n blobId: string;\n altText: string;\n type: string;\n // `GET apps/blobs/download/:id` requires a bearer token, which a plain\n // `<img src>` can never send (browsers only attach cookies to image\n // requests, not custom headers) — confirmed by driving the real upload\n // flow in a browser: even a valid admin session gets a 401 loading the\n // thumbnail directly. Buyer's product-image rendering\n // (`lib/data/media.ts#blobUrl`, used the same naive way) has this same\n // bug; out of scope here, but worth flagging. This page instead fetches\n // the bytes through the authenticated `HttpClient` and renders a local\n // `blob:` object URL.\n objectUrl?: string;\n}\n\ninterface DraftProduct {\n id?: string;\n name: string;\n slug: string;\n model: string;\n brandId: string;\n primaryCategoryId: string;\n shortDesc: string;\n type: string;\n status: string;\n}\n\nconst PRODUCT_TYPES = ['simple', 'variant', 'kit'];\nconst PRODUCT_STATUSES = ['draft', 'active', 'archived', 'discontinued'];\n\n// A fixed \"folder\" id for every admin-uploaded product image.\n// `BlobsFiles.parentId` is NOT NULL in the DB despite the entity/DTO\n// marking it optional (`@IsOptional()`, `nullable: true`) — a genuine\n// vendor-package mismatch, found by running the demo-catalogue media seed\n// script against a live server and reading the resulting\n// QueryFailedError (see the commerce migrations' own notes). No FK is\n// declared on the column, so any UUID satisfies it.\n// Product photo guidance — mirrored in the bulk importer and the admin hint.\nconst MAX_IMAGE_BYTES = 8 * 1024 * 1024;\nconst MIN_IMAGE_SIDE = 800;\n\nasync function readImageSize(file: File): Promise<{ width: number; height: number } | undefined> {\n try {\n const bitmap = await createImageBitmap(file);\n const size = { width: bitmap.width, height: bitmap.height };\n bitmap.close();\n return size;\n } catch {\n return undefined;\n }\n}\n\nconst PRODUCT_MEDIA_PARENT_ID = '00000000-0000-4000-8000-000000000d30';\n\n// P1.15 (original slice) + R1 production-readiness pass (this rebuild).\n// The original version of this page was read-only: a product list plus\n// the CAT-03 publish-validation check, with no create/edit/media/\n// attribute/variant/pricing UI anywhere — \"no way to add items to\n// catalogue\" was the single most direct gap this session set out to\n// close. This keeps the publish-check list and adds a full create/edit\n// flow: basic info → category/brand → the category's resolved attribute\n// grid → one implicit variant (simple products; a per-variant grid for\n// `variant`-type products is real, isolated follow-up work, same\n// reasoning P1.15 originally gave for deferring it) → media upload → a\n// single default price + stock level. Search/refresh on the list are\n// real (not the generic `x-webget-collection` — this table needs a\n// bespoke \"Check\" action + inline errors the generic collection can't\n// render, so pagination/search are hand-wired here instead).\n@Component({\n standalone: false,\n selector: 'x-catalog',\n templateUrl: './catalog.component.html',\n styleUrl: './catalog.component.scss',\n})\nexport class CatalogComponent extends BaseDirective {\n private readonly http = inject(HttpClient);\n\n private readonly productSource = this.apiService.on('apps/commerce/product');\n private readonly categorySource = this.apiService.on('apps/commerce/category');\n private readonly brandSource = this.apiService.on('apps/commerce/brand');\n private readonly variantSource = this.apiService.on('apps/commerce/product-variant');\n private readonly attrValueSource = this.apiService.on('apps/commerce/product-attribute-value');\n private readonly mediaSource = this.apiService.on('apps/commerce/product-media');\n private readonly priceSource = this.apiService.on('apps/commerce/price');\n private readonly stockLevelSource = this.apiService.on('apps/commerce/stock-level');\n private readonly stockLocationSource = this.apiService.on('apps/commerce/stock-location');\n\n readonly types = PRODUCT_TYPES;\n readonly statuses = PRODUCT_STATUSES;\n\n loading = true;\n products: ProductRowVm[] = [];\n categories: CategoryOption[] = [];\n brands: BrandOption[] = [];\n stockLocations: { id: string; name: string }[] = [];\n\n query = '';\n /** Status tab: '' = all. */\n statusFilter = '';\n page = 1;\n perPage = 25;\n total = 0;\n statusBadge = statusBadge;\n\n editing = false;\n saving = false;\n uploadingMedia = false;\n\n draft: DraftProduct | null = null;\n variant: { id?: string; sku: string; weight: number | null; handlingClass: string } | null = null;\n attributeDefs: AttributeDefVm[] = [];\n attributeValues: Record<string, AttributeValueVm> = {};\n media: MediaVm[] = [];\n price: { id?: string; amount: number | null } | null = null;\n stock: { id?: string; locationId: string; available: number } | null = null;\n\n override init = () => {\n this.loadProducts();\n this.loadCategories();\n this.loadBrands();\n this.loadStockLocations();\n };\n\n loadProducts(page = this.page): void {\n this.loading = true;\n this.page = page;\n const params: any = { page, perPage: this.perPage };\n if (this.query.trim()) params.query = this.query.trim();\n if (this.statusFilter) params.status = this.statusFilter;\n this.productSource\n .getMany(params)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.products = (response?.data ?? []).map(\n (p: any): ProductRowVm => ({\n id: p.id,\n name: p.name,\n model: p.model,\n type: p.type,\n status: p.status,\n updatedAt: p.updatedAt,\n primaryCategoryId: p.primaryCategoryId,\n checking: false,\n checked: false,\n }),\n );\n this.total = response?.meta?.total ?? this.products.length;\n this.loading = false;\n void this.fillRowDetails(this.products);\n }),\n );\n }\n\n search(): void {\n this.loadProducts(1);\n }\n\n setStatusFilter(status: string): void {\n this.statusFilter = status;\n this.loadProducts(1);\n }\n\n categoryName(id?: string): string {\n return (id && this.categories.find((c) => c.id === id)?.name) || '—';\n }\n\n // SKU, thumbnail, price and stock for the visible rows, after the table\n // has rendered: one `product/admin-summary` call for the whole page.\n private async fillRowDetails(rows: ProductRowVm[]): Promise<void> {\n if (!rows.length) return;\n const res: any = await firstValueFrom(\n this.apiService\n .post('apps/commerce/product/admin-summary', { productIds: rows.map((r) => r.id) })\n .pipe(catchError(() => of(null))),\n );\n const data: Record<string, any> = res?.data ?? {};\n for (const row of rows) {\n const s = data[row.id];\n row.summaryLoaded = true;\n // Call failed / row missing: price and stock stay unknown (\"—\"), not \"none\".\n if (!s) continue;\n row.sku = s.sku ?? '';\n row.thumbUrl = s.thumbnailBlobId ? `${getEnv('API_BASE_URL')}/apps/commerce/media/${s.thumbnailBlobId}?w=96` : '';\n row.price = s.price ?? null;\n row.stockFree = Number(s.available ?? 0) - Number(s.reserved ?? 0);\n row.variantCount = Number(s.variants ?? 0);\n }\n }\n\n money(price?: { amount: number; currency: string } | null): string {\n if (!price) return '—';\n return new Intl.NumberFormat('en-NG', { style: 'currency', currency: price.currency || 'NGN', maximumFractionDigits: 0 }).format(price.amount);\n }\n\n refresh(): void {\n this.loadProducts(this.page);\n }\n\n prevPage(): void {\n if (this.page > 1) this.loadProducts(this.page - 1);\n }\n\n nextPage(): void {\n if (this.page * this.perPage < this.total) this.loadProducts(this.page + 1);\n }\n\n loadCategories(): void {\n this.categorySource\n .getMany({ page: 1, perPage: 300 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.categories = (response?.data ?? []).sort((a: any, b: any) =>\n String(a.name).localeCompare(String(b.name)),\n );\n }),\n );\n }\n\n loadBrands(): void {\n this.brandSource\n .getMany({ page: 1, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.brands = (response?.data ?? []).sort((a: any, b: any) =>\n String(a.name).localeCompare(String(b.name)),\n );\n }),\n );\n }\n\n loadStockLocations(): void {\n this.stockLocationSource\n .getMany({ page: 1, perPage: 50 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using((response: any) => (this.stockLocations = response?.data ?? [])));\n }\n\n checkPublish(product: ProductRowVm): void {\n product.checking = true;\n this.productSource\n .post(`apps/commerce/product/${product.id}/validate-publish`)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n product.checking = false;\n product.checked = true;\n product.canPublish = !!response?.data?.canPublish;\n product.errors = response?.data?.errors ?? [];\n }),\n );\n }\n\n startCreate(): void {\n this.editing = true;\n this.draft = {\n name: '',\n slug: '',\n model: '',\n brandId: '',\n primaryCategoryId: '',\n shortDesc: '',\n type: 'simple',\n status: 'draft',\n };\n this.variant = { sku: '', weight: null, handlingClass: 'standard' };\n this.attributeDefs = [];\n this.attributeValues = {};\n this.media = [];\n this.price = { amount: null };\n this.stock = { locationId: this.stockLocations[0]?.id ?? '', available: 0 };\n }\n\n async edit(row: ProductRowVm): Promise<void> {\n this.editing = true;\n const productRes: any = await firstValueFrom(this.productSource.getOne(row.id));\n const p = productRes?.data;\n this.draft = {\n id: p.id,\n name: p.name ?? '',\n slug: p.slug ?? '',\n model: p.model ?? '',\n brandId: p.brandId ?? '',\n primaryCategoryId: p.primaryCategoryId ?? '',\n shortDesc: p.shortDesc ?? '',\n type: p.type,\n status: p.status,\n };\n\n this.attributeValues = {};\n if (this.draft.primaryCategoryId) {\n await this.loadAttributeTemplate(this.draft.primaryCategoryId);\n } else {\n this.attributeDefs = [];\n }\n\n const [variantsRes, attrsRes, mediaRes] = await Promise.all([\n firstValueFrom(this.variantSource.getMany({ productId: p.id, page: 1, perPage: 50 } as any)),\n firstValueFrom(this.attrValueSource.getMany({ productId: p.id, page: 1, perPage: 200 } as any)),\n firstValueFrom(this.mediaSource.getMany({ productId: p.id, page: 1, perPage: 50 } as any)),\n ]);\n\n const firstVariant = (variantsRes as any)?.data?.[0];\n this.variant = firstVariant\n ? {\n id: firstVariant.id,\n sku: firstVariant.sku,\n weight: firstVariant.weight ?? null,\n handlingClass: firstVariant.handlingClass ?? 'standard',\n }\n : { sku: '', weight: null, handlingClass: 'standard' };\n\n for (const v of (attrsRes as any)?.data ?? []) {\n this.attributeValues[v.attributeDefinitionId] = {\n id: v.id,\n valueNumber: v.valueNumber,\n valueNumberHigh: v.valueNumberHigh,\n valueText: v.valueText,\n valueBool: v.valueBool,\n };\n }\n\n this.media = ((mediaRes as any)?.data ?? []).map((m: any) => ({\n id: m.id,\n blobId: m.blobId,\n altText: m.altText,\n type: m.type,\n }));\n for (const m of this.media) {\n m.objectUrl = await this.resolveMediaObjectUrl(m.blobId);\n }\n\n if (this.variant.id) {\n const priceRes: any = await firstValueFrom(\n this.priceSource.getMany({ variantId: this.variant.id, page: 1, perPage: 1 } as any),\n );\n const priceRow = priceRes?.data?.[0];\n this.price = priceRow ? { id: priceRow.id, amount: priceRow.amount } : { amount: null };\n\n const stockRes: any = await firstValueFrom(\n this.stockLevelSource.getMany({ variantId: this.variant.id, page: 1, perPage: 1 } as any),\n );\n const stockRow = stockRes?.data?.[0];\n this.stock = stockRow\n ? { id: stockRow.id, locationId: stockRow.locationId, available: stockRow.available }\n : { locationId: this.stockLocations[0]?.id ?? '', available: 0 };\n } else {\n this.price = { amount: null };\n this.stock = { locationId: this.stockLocations[0]?.id ?? '', available: 0 };\n }\n }\n\n async onCategoryChange(): Promise<void> {\n if (!this.draft?.primaryCategoryId) {\n this.attributeDefs = [];\n return;\n }\n await this.loadAttributeTemplate(this.draft.primaryCategoryId);\n }\n\n private async loadAttributeTemplate(categoryId: string): Promise<void> {\n try {\n const res: any = await firstValueFrom(\n this.apiService.get(`apps/commerce/category/${categoryId}/attribute-template`),\n );\n this.attributeDefs = (res?.data?.definitions ?? []) as AttributeDefVm[];\n for (const def of this.attributeDefs) {\n if (!this.attributeValues[def.id]) this.attributeValues[def.id] = {};\n }\n } catch {\n this.attributeDefs = [];\n }\n }\n\n async saveProduct(): Promise<void> {\n if (!this.draft || !this.draft.name.trim()) {\n notify('Name is required.', undefined, 'error');\n return;\n }\n this.saving = true;\n try {\n const payload: any = {\n name: this.draft.name.trim(),\n slug: this.draft.slug.trim() || undefined,\n brandId: this.draft.brandId || undefined,\n model: this.draft.model.trim() || undefined,\n primaryCategoryId: this.draft.primaryCategoryId || undefined,\n shortDesc: this.draft.shortDesc.trim() || undefined,\n type: this.draft.type,\n status: this.draft.status,\n };\n\n if (this.draft.id) {\n await firstValueFrom(this.productSource.update(this.draft.id, payload));\n } else {\n const res: any = await firstValueFrom(this.productSource.create(payload));\n this.draft.id = res?.data?.id;\n }\n const productId = this.draft.id!;\n\n if (this.variant && this.variant.sku.trim()) {\n const variantPayload: any = {\n productId,\n sku: this.variant.sku.trim(),\n weight: this.variant.weight != null ? Number(this.variant.weight) : undefined,\n handlingClass: this.variant.handlingClass || 'standard',\n };\n if (this.variant.id) {\n await firstValueFrom(this.variantSource.update(this.variant.id, variantPayload));\n } else {\n const vRes: any = await firstValueFrom(this.variantSource.create(variantPayload));\n this.variant.id = vRes?.data?.id;\n }\n }\n\n for (const def of this.attributeDefs) {\n const v = this.attributeValues[def.id];\n if (!v) continue;\n const hasValue =\n (v.valueNumber !== null && v.valueNumber !== undefined && `${v.valueNumber}` !== '') ||\n !!v.valueText ||\n v.valueBool !== null && v.valueBool !== undefined;\n if (!hasValue) continue;\n\n const attrPayload: any = {\n productId,\n attributeDefinitionId: def.id,\n valueNumber:\n def.dataType === 'number' || def.dataType === 'range'\n ? v.valueNumber != null && `${v.valueNumber}` !== ''\n ? Number(v.valueNumber)\n : undefined\n : undefined,\n valueNumberHigh:\n def.dataType === 'range' && v.valueNumberHigh != null && `${v.valueNumberHigh}` !== ''\n ? Number(v.valueNumberHigh)\n : undefined,\n valueText: def.dataType === 'text' || def.dataType === 'enum' ? v.valueText || undefined : undefined,\n valueBool: def.dataType === 'boolean' ? !!v.valueBool : undefined,\n };\n\n if (v.id) {\n await firstValueFrom(this.attrValueSource.update(v.id, attrPayload));\n } else {\n const aRes: any = await firstValueFrom(this.attrValueSource.create(attrPayload));\n v.id = aRes?.data?.id;\n }\n }\n\n if (this.variant?.id) {\n if (this.price && this.price.amount != null && `${this.price.amount}` !== '') {\n const pricePayload: any = {\n variantId: this.variant.id,\n amount: Number(this.price.amount),\n minQuantity: 1,\n };\n if (this.price.id) {\n await firstValueFrom(this.priceSource.update(this.price.id, pricePayload));\n } else {\n const prRes: any = await firstValueFrom(this.priceSource.create(pricePayload));\n this.price.id = prRes?.data?.id;\n }\n }\n\n if (this.stock?.locationId) {\n const stockPayload: any = {\n variantId: this.variant.id,\n locationId: this.stock.locationId,\n available: Number(this.stock.available ?? 0),\n };\n if (this.stock.id) {\n await firstValueFrom(this.stockLevelSource.update(this.stock.id, stockPayload));\n } else {\n const stRes: any = await firstValueFrom(this.stockLevelSource.create(stockPayload));\n this.stock.id = stRes?.data?.id;\n }\n }\n }\n\n notify('Product saved.', undefined, 'success');\n this.loadProducts(this.page);\n } catch {\n notify('Could not save the product (check required fields).', undefined, 'error');\n } finally {\n this.saving = false;\n }\n }\n\n async onMediaSelected(event: Event): Promise<void> {\n const input = event.target as HTMLInputElement;\n const files = input.files;\n if (!files || !files.length || !this.draft?.id) return;\n\n const file = files[0];\n if (file.size > MAX_IMAGE_BYTES) {\n notify('That image is over 8 MB — export it at 1200–2000 px (JPG/WebP) and try again.', undefined, 'error');\n input.value = '';\n return;\n }\n const size = await readImageSize(file);\n if (size && Math.min(size.width, size.height) < MIN_IMAGE_SIDE) {\n notify(\n `That image is only ${size.width} × ${size.height}px — it will look soft on large screens. 1200 × 1200 px or more is recommended.`,\n undefined,\n 'warning',\n );\n }\n\n this.uploadingMedia = true;\n try {\n const blobId = await uploadFileToBlobs(this.apiService, file, PRODUCT_MEDIA_PARENT_ID, [\n 'product-media',\n ]);\n const altText = `${this.draft.name} — product photo`;\n const res: any = await firstValueFrom(\n this.mediaSource.create({\n productId: this.draft.id,\n blobId,\n type: 'gallery',\n altText,\n position: this.media.length,\n } as any),\n );\n const objectUrl = await this.resolveMediaObjectUrl(blobId);\n this.media.push({ id: res?.data?.id, blobId, altText, type: 'gallery', objectUrl });\n notify('Image uploaded.', undefined, 'success');\n } catch (e) {\n console.error('media upload failed', e);\n notify('Could not upload the image.', undefined, 'error');\n } finally {\n this.uploadingMedia = false;\n input.value = '';\n }\n }\n\n async removeMedia(item: MediaVm): Promise<void> {\n try {\n await firstValueFrom(this.mediaSource.remove(item.id));\n this.media = this.media.filter((m) => m.id !== item.id);\n } catch {\n notify('Could not remove the image.', undefined, 'error');\n }\n }\n\n // `download/:id` needs the bearer header only `HttpClient` (via the\n // app's existing `JwtInterceptor`) can attach — see the `MediaVm.\n // objectUrl` comment. Empty string on failure just leaves the\n // thumbnail blank rather than breaking the editor.\n private async resolveMediaObjectUrl(blobId: string): Promise<string> {\n try {\n const blob = await firstValueFrom(this.http.get(resolveBlobUrl(blobId), { responseType: 'blob' }));\n // Not `URL.createObjectURL` — the app's CSP `img-src` allows `data:`\n // but not `blob:`, so an object URL renders as a CSP violation\n // (confirmed by driving this in a browser). A data URI sidesteps it.\n return await new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n } catch {\n return '';\n }\n }\n\n cancelEdit(): void {\n this.editing = false;\n this.draft = null;\n this.variant = null;\n this.attributeDefs = [];\n this.attributeValues = {};\n this.media = [];\n this.price = null;\n this.stock = null;\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Catalogue</div>\n <div class=\"x-page-subtitle\">Products, variants, attributes, media, pricing and stock.</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-cat-toolbar\">\n <input\n type=\"text\"\n class=\"x-cat-search\"\n placeholder=\"Search products…\"\n [(ngModel)]=\"query\"\n (keyup.enter)=\"search()\"\n />\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"search()\">Search</button>\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"refresh()\">Refresh</button>\n <div class=\"x-cat-spacer\"></div>\n <a class=\"x-cat-btn\" routerLink=\"/admin/bulk-upload\">Bulk upload (Excel)</a>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" (click)=\"startCreate()\">+ New product</button>\n </div>\n\n <div class=\"x-cat-tabs\" role=\"tablist\" aria-label=\"Filter by status\">\n @for (tab of [''].concat(statuses); track tab) {\n <button\n type=\"button\"\n role=\"tab\"\n class=\"x-cat-tab\"\n [class.is-active]=\"statusFilter === tab\"\n [attr.aria-selected]=\"statusFilter === tab\"\n (click)=\"setStatusFilter(tab)\"\n >\n {{ tab ? (tab | titlecase) : 'All' }}\n </button>\n }\n </div>\n\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-catalog-table\">\n <div class=\"x-catalog-row x-catalog-head\">\n <div class=\"x-catalog-col-name\">Product</div>\n <div class=\"x-catalog-col-sku\">SKU</div>\n <div class=\"x-catalog-col-category\">Category</div>\n <div class=\"x-catalog-col-price\">Price</div>\n <div class=\"x-catalog-col-stock\">Stock</div>\n <div class=\"x-catalog-col-status\">Status</div>\n <div class=\"x-catalog-col-check\">Publish check</div>\n <div class=\"x-catalog-col-action\"></div>\n </div>\n @for (product of products; track product.id) {\n <div class=\"x-catalog-row\">\n <div class=\"x-catalog-col-name\">\n @if (product.thumbUrl) {\n <img class=\"x-catalog-thumb\" [src]=\"product.thumbUrl\" alt=\"\" loading=\"lazy\" />\n } @else {\n <span class=\"x-catalog-thumb x-catalog-thumb-empty\" aria-hidden=\"true\"></span>\n }\n <span>\n {{ product.name }}\n <span class=\"x-catalog-model\">\n {{ product.type }}@if (product.model) { · {{ product.model }} } · updated {{ product.updatedAt | date: 'd MMM' }}\n </span>\n </span>\n </div>\n <div class=\"x-catalog-col-sku\">{{ product.sku || '—' }}</div>\n <div class=\"x-catalog-col-category\">{{ categoryName(product.primaryCategoryId) }}</div>\n <div class=\"x-catalog-col-price\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">…</span>\n } @else if (product.price) {\n {{ money(product.price) }}\n } @else if (product.price === null) {\n <span class=\"x-catalog-warn\">No price</span>\n } @else {\n —\n }\n </div>\n <div class=\"x-catalog-col-stock\">\n @if (!product.summaryLoaded) {\n <span class=\"x-check-pending\">…</span>\n } @else if (product.stockFree === undefined) {\n —\n } @else if (product.stockFree > 0) {\n {{ product.stockFree }}\n @if ((product.variantCount ?? 0) > 1) {\n <span class=\"x-catalog-model\">{{ product.variantCount }} variants</span>\n }\n } @else {\n <span class=\"x-catalog-warn\">Out</span>\n }\n </div>\n <div class=\"x-catalog-col-status\" [innerHTML]=\"statusBadge(product.status)\"></div>\n <div class=\"x-catalog-col-check\">\n @if (product.checking) {\n <span class=\"x-check-pending\">Checking…</span>\n } @else if (product.checked && product.canPublish) {\n <span class=\"x-check-ok\">✓ Ready to publish</span>\n } @else if (!product.checked) {\n <span class=\"x-check-pending\">Not checked — press Check</span>\n } @else if (product.checked && product.errors?.length) {\n <ul class=\"x-check-errors\">\n @for (err of product.errors; track err.field) {\n <li>{{ err.message }}</li>\n }\n </ul>\n }\n </div>\n <div class=\"x-catalog-col-action\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"edit(product)\">Edit</button>\n <button\n type=\"button\"\n class=\"x-check-btn\"\n [disabled]=\"product.checking\"\n (click)=\"checkPublish(product)\"\n >\n Check\n </button>\n </div>\n </div>\n }\n @if (!products.length) {\n <div class=\"x-catalog-empty\">No products yet — use \"+ New product\" to add one.</div>\n }\n </div>\n\n <div class=\"x-cat-pager\">\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page <= 1\" (click)=\"prevPage()\">← Prev</button>\n <span class=\"x-cat-pager-label\">Page {{ page }} · {{ total }} total</span>\n <button type=\"button\" class=\"x-cat-btn\" [disabled]=\"page * perPage >= total\" (click)=\"nextPage()\">\n Next →\n </button>\n </div>\n }\n} @else if (draft) {\n <div class=\"x-cat-editor\">\n <div class=\"x-cat-editor-head\">\n <div class=\"x-cat-editor-title\">{{ draft.id ? 'Edit product' : 'New product' }}</div>\n <div class=\"x-cat-editor-actions\">\n <button type=\"button\" class=\"x-cat-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-cat-btn x-cat-btn-primary\" [disabled]=\"saving\" (click)=\"saveProduct()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Basic info</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Name\n <input type=\"text\" [(ngModel)]=\"draft.name\" />\n </label>\n <label class=\"x-cat-f\">\n Slug (optional)\n <input type=\"text\" [(ngModel)]=\"draft.slug\" placeholder=\"auto from name if blank\" />\n </label>\n </div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Model\n <input type=\"text\" [(ngModel)]=\"draft.model\" />\n </label>\n <label class=\"x-cat-f\">\n Type\n <select [(ngModel)]=\"draft.type\">\n @for (t of types; track t) { <option [value]=\"t\">{{ t }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Status\n <select [(ngModel)]=\"draft.status\">\n @for (s of statuses; track s) { <option [value]=\"s\">{{ s }}</option> }\n </select>\n </label>\n </div>\n @if (draft.type !== 'simple') {\n <div class=\"x-cat-hint\">\n \"{{ draft.type }}\" products still save through this one-variant form for now — a full\n per-variant / per-component editor is a follow-up.\n </div>\n }\n <label class=\"x-cat-f\">\n Short description\n <textarea rows=\"2\" [(ngModel)]=\"draft.shortDesc\"></textarea>\n </label>\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Category &amp; brand</div>\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Category\n <select [(ngModel)]=\"draft.primaryCategoryId\" (ngModelChange)=\"onCategoryChange()\">\n <option value=\"\">— none —</option>\n @for (c of categories; track c.id) { <option [value]=\"c.id\">{{ c.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Brand\n <select [(ngModel)]=\"draft.brandId\">\n <option value=\"\">— none —</option>\n @for (b of brands; track b.id) { <option [value]=\"b.id\">{{ b.name }}</option> }\n </select>\n </label>\n </div>\n </section>\n\n @if (attributeDefs.length) {\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Attributes</div>\n <div class=\"x-cat-attr-grid\">\n @for (def of attributeDefs; track def.id) {\n <label class=\"x-cat-f x-cat-attr\">\n {{ def.label }}{{ def.unit ? ' (' + def.unit + ')' : '' }}\n @if (def.required) {\n <span class=\"x-cat-required\">*</span>\n }\n @switch (def.dataType) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"attributeValues[def.id].valueBool\" />\n }\n @case ('enum') {\n <select [(ngModel)]=\"attributeValues[def.id].valueText\">\n <option value=\"\">— choose —</option>\n @for (opt of def.allowedValues; track opt) { <option [value]=\"opt\">{{ opt }}</option> }\n </select>\n }\n @case ('range') {\n <div class=\"x-cat-range\">\n <input type=\"number\" placeholder=\"min\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n <span>–</span>\n <input\n type=\"number\"\n placeholder=\"max\"\n [(ngModel)]=\"attributeValues[def.id].valueNumberHigh\"\n />\n </div>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"attributeValues[def.id].valueNumber\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"attributeValues[def.id].valueText\" />\n }\n }\n </label>\n }\n </div>\n </section>\n }\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Variant, price &amp; stock</div>\n @if (variant) {\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n SKU\n <input type=\"text\" [(ngModel)]=\"variant.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Weight (kg)\n <input type=\"number\" min=\"0\" step=\"0.1\" [(ngModel)]=\"variant.weight\" />\n @if (variant.weight == null || variant.weight <= 0) {\n <small class=\"x-cat-hint\" style=\"color: var(--color-warn)\">\n No weight — delivery is priced with the default weight. Add the packed weight for an accurate shipping fee.\n </small>\n }\n </label>\n <label class=\"x-cat-f\">\n Handling class\n <select [(ngModel)]=\"variant.handlingClass\">\n <option value=\"standard\">standard</option>\n <option value=\"bulky\">bulky</option>\n <option value=\"freight\">freight</option>\n <option value=\"hazmat\">hazmat</option>\n </select>\n </label>\n </div>\n }\n <div class=\"x-cat-f-row\">\n <label class=\"x-cat-f\">\n Price (₦)\n <input type=\"number\" [(ngModel)]=\"price!.amount\" [disabled]=\"!variant?.sku\" />\n </label>\n <label class=\"x-cat-f\">\n Stock location\n <select [(ngModel)]=\"stock!.locationId\" [disabled]=\"!variant?.sku\">\n @for (loc of stockLocations; track loc.id) { <option [value]=\"loc.id\">{{ loc.name }}</option> }\n </select>\n </label>\n <label class=\"x-cat-f\">\n Available\n <input type=\"number\" [(ngModel)]=\"stock!.available\" [disabled]=\"!variant?.sku\" />\n </label>\n </div>\n @if (!variant?.sku) {\n <div class=\"x-cat-hint\">Enter a SKU above, then price/stock can be saved.</div>\n }\n </section>\n\n <section class=\"x-cat-section\">\n <div class=\"x-cat-section-title\">Media</div>\n @if (!draft.id) {\n <div class=\"x-cat-hint\">Save the product once first — media needs a real product to attach to.</div>\n } @else {\n <div class=\"x-cat-media-grid\">\n @for (m of media; track m.id) {\n <div class=\"x-cat-media-item\">\n <img [src]=\"m.objectUrl\" [alt]=\"m.altText\" />\n <button type=\"button\" class=\"x-cat-media-remove\" (click)=\"removeMedia(m)\">Remove</button>\n </div>\n }\n </div>\n <label class=\"x-cat-btn x-cat-upload\">\n {{ uploadingMedia ? 'Uploading…' : '+ Add image' }}\n <input type=\"file\" accept=\"image/*\" hidden [disabled]=\"uploadingMedia\" (change)=\"onMediaSelected($event)\" />\n </label>\n <div class=\"x-cat-hint\">\n Best results: <strong>1200 × 1200 px</strong> or larger, square (4:3 also works), product centred on a\n plain white/light background, JPG or WebP, under 8 MB. The first image is the listing thumbnail —\n use a clean front-on shot; add the rating plate, ports/back and box contents as extra images.\n The site downsizes photos for phones automatically, so upload the sharp original.\n </div>\n }\n </section>\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { CatalogComponent } from './catalog.component';\n\n@NgModule({\n declarations: [CatalogComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: CatalogComponent }]),\n ],\n})\nexport class CatalogModule {}\n"],"names":["i2","i3","i4","i1"],"mappings":";;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,MAAsB,EAAA;AAC5C,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE;IACtB,OAAO,CAAA,EAAG,MAAM,CAAC,cAAc,CAAC,CAAA,qBAAA,EAAwB,MAAM,EAAE;AAClE;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB,CAC9B,UAAuD,EACvD,IAAU,EACV,QAAgB,EAChB,IAAc,EAAA;AAEd,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;AAC3D,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,0BAA0B;IACpD,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,Q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,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGzD,aAAa,EAAA,UAAA,EAAA,CAAA;kBATzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACnE,qBAAA;AACF,iBAAA;;;;;"}
@@ -463,11 +463,11 @@ class HomepageComponent extends BaseDirective {
463
463
  return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
464
464
  }
465
465
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
466
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: HomepageComponent, isStandalone: false, selector: "x-homepage", usesInheritance: true, ngImport: i0, template: "<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">\u283F</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">\u25BC</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">\u00D7</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add\u2026' : 'Search by name to add\u2026'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n .x-hc-chip { background: #eef2f8; border: 1px solid #c9d3e4; border-radius: 12px; padding: 2px 8px; font-size: 12px; }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; }\n .x-hc-opt { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eee; background: none; padding: 6px 4px; font-size: 13px; cursor: pointer; }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n", styles: [".x-hc-picked{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.x-hc-chip{background:#eef2f8;border:1px solid #c9d3e4;border-radius:12px;padding:2px 8px;font-size:12px}.x-hc-chip button{border:0;background:none;cursor:pointer;margin-left:4px}.x-hc-opt{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #eee;background:none;padding:6px 4px;font-size:13px;cursor:pointer}.x-hc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;flex-wrap:wrap}.x-hc-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-hc-sub{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-hc-head-controls{display:flex;gap:10px;align-items:flex-end}.x-hc-page-field{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700;text-transform:uppercase;letter-spacing:.4px}.x-hc-page-field input,.x-hc-add select,.x-hc-f input,.x-hc-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text)}.x-hc-add{display:flex;gap:10px;margin-bottom:16px}.x-hc-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-hc-btn-primary,.x-hc-btn-active{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-hc-empty{font-size:14px;color:var(--color-text-muted)}.x-hc-list{display:flex;flex-direction:column;gap:10px;max-width:860px}.x-hc-item{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:12px 14px}.x-hc-item-off{opacity:.55}.x-hc-item-main{display:flex;align-items:center;gap:12px}.x-hc-grip{cursor:grab;color:var(--color-text-muted);font-size:16px}.x-hc-order{display:flex;flex-direction:column}.x-hc-order button{border:0;background:transparent;cursor:pointer;color:var(--color-text-muted);font-size:10px;line-height:1.1;padding:1px 3px}.x-hc-order button:disabled{opacity:.3;cursor:default}.x-hc-item-body{flex:1;min-width:0}.x-hc-item-row{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}.x-hc-type{font-weight:800;text-transform:uppercase;letter-spacing:.4px;font-size:11px;color:var(--color-accent-hover)}.x-hc-item-title{font-size:13.5px;font-weight:600;color:var(--color-text)}.x-hc-sched{font-size:11px;color:var(--color-text-muted)}.x-hc-item-preview{font-size:12.5px;color:var(--color-text-muted);margin-top:2px}.x-hc-item-actions{display:flex;gap:8px;align-items:center}.x-hc-toggle{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:transparent;padding:3px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-hc-link{border:0;background:transparent;cursor:pointer;font-size:12px;font-weight:700;color:var(--color-accent-hover)}.x-hc-danger{color:var(--color-danger, #c0362c)}.x-hc-edit{margin-top:12px;padding-top:12px;border-top:1px solid var(--color-border);display:flex;flex-direction:column;gap:10px}.x-hc-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-hc-f-row{display:flex;gap:10px}.x-hc-edit-actions{display:flex;gap:8px}.x-hc-preview{display:flex;flex-direction:column;gap:6px;max-width:860px}.x-hc-preview-block{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);padding:18px 16px;display:flex;flex-direction:column;gap:4px;background:var(--color-surface)}.x-hc-preview-type{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--color-accent-hover)}.x-hc-preview-title{font-size:14px;color:var(--color-text)}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }] }); }
466
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: HomepageComponent, isStandalone: false, selector: "x-homepage", usesInheritance: true, ngImport: i0, template: "<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">\u283F</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">\u25BC</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">\u00D7</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add\u2026' : 'Search by name to add\u2026'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n /* Theme tokens, not hard-coded light greys: a bare <button> otherwise\n takes the browser's own button text colour, which in dark mode is\n near-white on the composer's light card (text only showed when\n highlighted). */\n .x-hc-chip {\n background: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n padding: 2px 8px;\n font-size: 12px;\n color: var(--color-text);\n }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; color: var(--color-text-muted); }\n .x-hc-opt {\n display: block;\n width: 100%;\n text-align: left;\n border: 0;\n border-bottom: 1px solid var(--color-border);\n background: none;\n color: var(--color-text);\n padding: 6px 4px;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n }\n .x-hc-opt:hover,\n .x-hc-opt:focus-visible { background: var(--color-bg); color: var(--color-brand); }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n", styles: [".x-hc-picked{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.x-hc-chip{background:var(--color-bg);border:1px solid var(--color-border);border-radius:12px;padding:2px 8px;font-size:12px;color:var(--color-text)}.x-hc-chip button{border:0;background:none;cursor:pointer;margin-left:4px;color:var(--color-text-muted)}.x-hc-opt{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--color-border);background:none;color:var(--color-text);padding:6px 4px;font:inherit;font-size:13px;cursor:pointer}.x-hc-opt:hover,.x-hc-opt:focus-visible{background:var(--color-bg);color:var(--color-brand)}.x-hc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;flex-wrap:wrap}.x-hc-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-hc-sub{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-hc-head-controls{display:flex;gap:10px;align-items:flex-end}.x-hc-page-field{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700;text-transform:uppercase;letter-spacing:.4px}.x-hc-page-field input,.x-hc-add select,.x-hc-f input,.x-hc-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text)}.x-hc-add{display:flex;gap:10px;margin-bottom:16px}.x-hc-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-hc-btn-primary,.x-hc-btn-active{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-hc-empty{font-size:14px;color:var(--color-text-muted)}.x-hc-list{display:flex;flex-direction:column;gap:10px;max-width:860px}.x-hc-item{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:12px 14px}.x-hc-item-off{opacity:.55}.x-hc-item-main{display:flex;align-items:center;gap:12px}.x-hc-grip{cursor:grab;color:var(--color-text-muted);font-size:16px}.x-hc-order{display:flex;flex-direction:column}.x-hc-order button{border:0;background:transparent;cursor:pointer;color:var(--color-text-muted);font-size:10px;line-height:1.1;padding:1px 3px}.x-hc-order button:disabled{opacity:.3;cursor:default}.x-hc-item-body{flex:1;min-width:0}.x-hc-item-row{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}.x-hc-type{font-weight:800;text-transform:uppercase;letter-spacing:.4px;font-size:11px;color:var(--color-accent-hover)}.x-hc-item-title{font-size:13.5px;font-weight:600;color:var(--color-text)}.x-hc-sched{font-size:11px;color:var(--color-text-muted)}.x-hc-item-preview{font-size:12.5px;color:var(--color-text-muted);margin-top:2px}.x-hc-item-actions{display:flex;gap:8px;align-items:center}.x-hc-toggle{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:transparent;padding:3px 10px;font-size:11.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-hc-link{border:0;background:transparent;cursor:pointer;font-size:12px;font-weight:700;color:var(--color-accent-hover)}.x-hc-danger{color:var(--color-danger, #c0362c)}.x-hc-edit{margin-top:12px;padding-top:12px;border-top:1px solid var(--color-border);display:flex;flex-direction:column;gap:10px}.x-hc-f{display:flex;flex-direction:column;gap:4px;flex:1;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-hc-f-row{display:flex;gap:10px}.x-hc-edit-actions{display:flex;gap:8px}.x-hc-preview{display:flex;flex-direction:column;gap:6px;max-width:860px}.x-hc-preview-block{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);padding:18px 16px;display:flex;flex-direction:column;gap:4px;background:var(--color-surface)}.x-hc-preview-type{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--color-accent-hover)}.x-hc-preview-title{font-size:14px;color:var(--color-text)}\n"], dependencies: [{ kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }] }); }
467
467
  }
468
468
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: HomepageComponent, decorators: [{
469
469
  type: Component,
470
- args: [{ standalone: false, selector: 'x-homepage', template: "<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">\u283F</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">\u25BC</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">\u00D7</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add\u2026' : 'Search by name to add\u2026'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n .x-hc-chip { background: #eef2f8; border: 1px solid #c9d3e4; border-radius: 12px; padding: 2px 8px; font-size: 12px; }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; }\n .x-hc-opt { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eee; background: none; padding: 6px 4px; font-size: 13px; cursor: pointer; }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n" }]
470
+ args: [{ standalone: false, selector: 'x-homepage', template: "<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">\u283F</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">\u25B2</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">\u25BC</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">\u00D7</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add\u2026' : 'Search by name to add\u2026'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n /* Theme tokens, not hard-coded light greys: a bare <button> otherwise\n takes the browser's own button text colour, which in dark mode is\n near-white on the composer's light card (text only showed when\n highlighted). */\n .x-hc-chip {\n background: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n padding: 2px 8px;\n font-size: 12px;\n color: var(--color-text);\n }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; color: var(--color-text-muted); }\n .x-hc-opt {\n display: block;\n width: 100%;\n text-align: left;\n border: 0;\n border-bottom: 1px solid var(--color-border);\n background: none;\n color: var(--color-text);\n padding: 6px 4px;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n }\n .x-hc-opt:hover,\n .x-hc-opt:focus-visible { background: var(--color-bg); color: var(--color-brand); }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n" }]
471
471
  }] });
472
472
 
473
473
  class HomepageModule {
@@ -491,4 +491,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
491
491
  }] });
492
492
 
493
493
  export { HomepageModule };
494
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs.map
494
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-homepage.module-Be43nqYG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-homepage.module-Be43nqYG.mjs","sources":["../../../projects/admin/src/lib/pages/homepage/homepage.component.ts","../../../projects/admin/src/lib/pages/homepage/homepage.component.html","../../../projects/admin/src/lib/pages/homepage/homepage.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, forkJoin, of, takeUntil } from 'rxjs';\n\ninterface ModuleVm {\n id: string;\n page: string;\n type: string;\n title?: string;\n position: number;\n config: Record<string, any>;\n channelIds?: string[];\n segmentIds?: string[];\n startsAt?: string;\n endsAt?: string;\n enabled: boolean;\n}\n\ninterface TypeDef {\n value: string;\n label: string;\n // Config fields this type carries. `ids` = comma-separated id list,\n // `id` = single id, `num` = number, `text` = free text / html.\n fields: { key: string; label: string; kind: 'ids' | 'id' | 'num' | 'text' }[];\n}\n\n// P6.7, PROMO-06 / TRD §9.2 — the homepage composer. A drag-ordered list\n// of `MerchandisingModule` rows for a page, each with a type-aware config\n// editor, schedule and targeting, plus a resolved preview line (ids →\n// names) and a page-shape preview mode. The storefront renderer is P6.8.\nconst TYPES: TypeDef[] = [\n {\n value: 'hero_carousel',\n label: 'Hero carousel',\n fields: [{ key: 'bannerIds', label: 'Banner IDs', kind: 'ids' }],\n },\n {\n value: 'promo_banner',\n label: 'Promo banner',\n fields: [{ key: 'bannerIds', label: 'Banner IDs', kind: 'ids' }],\n },\n {\n value: 'product_rail',\n label: 'Product rail',\n fields: [\n { key: 'categoryId', label: 'From category ID', kind: 'id' },\n { key: 'productIds', label: 'Hand-picked products (in order)', kind: 'ids' },\n { key: 'limit', label: 'Max items', kind: 'num' },\n ],\n },\n {\n value: 'category_grid',\n label: 'Category grid',\n fields: [{ key: 'categoryIds', label: 'Category IDs', kind: 'ids' }],\n },\n {\n value: 'brand_strip',\n label: 'Brand strip',\n fields: [{ key: 'brandIds', label: 'Brand IDs', kind: 'ids' }],\n },\n {\n value: 'flash_sale_rail',\n label: 'Flash sale rail',\n fields: [{ key: 'flashSaleId', label: 'Flash sale ID (blank = all live)', kind: 'id' }],\n },\n {\n value: 'article_rail',\n label: 'Article rail',\n fields: [\n { key: 'articleIds', label: 'Article IDs', kind: 'ids' },\n { key: 'limit', label: 'Max items', kind: 'num' },\n ],\n },\n {\n value: 'rich_text',\n label: 'Rich text',\n fields: [{ key: 'html', label: 'HTML', kind: 'text' }],\n },\n { value: 'newsletter', label: 'Newsletter signup', fields: [] },\n { value: 'trust_bar', label: 'Trust bar', fields: [] },\n];\n\n@Component({\n standalone: false,\n selector: 'x-homepage',\n templateUrl: './homepage.component.html',\n})\nexport class HomepageComponent extends BaseDirective {\n private readonly source = this.apiService.on('apps/commerce/merchandising-module');\n\n readonly types = TYPES;\n\n page = 'home';\n loading = true;\n modules: ModuleVm[] = [];\n previewMode = false;\n\n newType = TYPES[0].value;\n\n editing?: ModuleVm;\n editModel: {\n title: string;\n startsAt: string;\n endsAt: string;\n channelIds: string;\n segmentIds: string;\n config: Record<string, string>;\n } = this.blankEditModel();\n\n private dragIndex: number | null = null;\n\n // ── id pickers (products / categories / brands / banners) ─────────\n pickerQuery: Record<string, string> = {};\n\n lookupFor(key: string): Map<string, string> | undefined {\n switch (key) {\n case 'productIds': return this.productName;\n case 'categoryIds': return this.categoryName;\n case 'brandIds': return this.brandName;\n case 'bannerIds': return this.bannerName;\n default: return undefined;\n }\n }\n\n selectedIds(key: string): string[] {\n return (this.editModel.config[key] ?? '').split(',').map((s) => s.trim()).filter(Boolean);\n }\n\n // Products are searched server-side (the catalogue can exceed one page of\n // lookups); the other lists are small enough to filter from the preloaded maps.\n private productHits: { id: string; name: string }[] = [];\n private pickerTimer?: ReturnType<typeof setTimeout>;\n\n onPickerInput(key: string, value: string): void {\n this.pickerQuery[key] = value;\n if (key !== 'productIds') return;\n clearTimeout(this.pickerTimer);\n const q = value.trim();\n if (!q) {\n this.productHits = [];\n return;\n }\n this.pickerTimer = setTimeout(async () => {\n // SKUs are unique, so an exact SKU resolves to exactly one product and\n // is listed first; the text search covers names, brands and partial SKUs.\n const [bySku, byText] = await Promise.all([\n this.findBySku(q),\n firstValueFrom(\n this.apiService.on('apps/commerce/search').create({ q, page: 1, perPage: 8 }),\n ).catch(() => null) as Promise<any>,\n ]);\n const hits: { id: string; name: string }[] = [...bySku];\n for (const i of byText?.data?.items ?? []) {\n this.productName.set(i.productId, i.name);\n if (!hits.some((h) => h.id === i.productId)) hits.push({ id: i.productId, name: i.name });\n }\n this.productHits = hits;\n }, 250);\n }\n\n private async findBySku(sku: string): Promise<{ id: string; name: string }[]> {\n try {\n const res: any = await firstValueFrom(\n this.apiService\n .on('apps/commerce/product-variant')\n .getMany({ sku, page: 1, perPage: 5 } as any),\n );\n return (res?.data ?? [])\n // The list filter may be loose; only an exact SKU counts as a SKU match.\n .filter((v: any) => String(v.sku).toLowerCase() === sku.toLowerCase() && v.productId)\n .map((v: any) => ({\n id: v.productId as string,\n name: `${this.productName.get(v.productId) ?? v.name ?? 'Product'} · SKU ${v.sku}`,\n }));\n } catch {\n return [];\n }\n }\n\n /** Enter in the picker adds the top match (an exact SKU is always on top). */\n addFirstMatch(key: string): void {\n const first = this.pickerMatches(key)[0];\n if (first) this.addId(key, first.id);\n }\n\n pickerMatches(key: string): { id: string; name: string }[] {\n if (key === 'productIds') {\n const taken = new Set(this.selectedIds(key));\n return (this.pickerQuery[key] ?? '').trim()\n ? this.productHits.filter((h) => !taken.has(h.id))\n : [];\n }\n const q = (this.pickerQuery[key] ?? '').trim().toLowerCase();\n const map = this.lookupFor(key);\n if (!q || !map) return [];\n const taken = new Set(this.selectedIds(key));\n return [...map.entries()]\n .filter(([id, name]) => !taken.has(id) && String(name).toLowerCase().includes(q))\n .slice(0, 8)\n .map(([id, name]) => ({ id, name }));\n }\n\n addId(key: string, id: string): void {\n this.editModel.config[key] = [...this.selectedIds(key), id].join(', ');\n this.pickerQuery[key] = '';\n }\n\n removeId(key: string, id: string): void {\n this.editModel.config[key] = this.selectedIds(key).filter((x) => x !== id).join(', ');\n }\n\n // id → name lookups for the preview line.\n private productName = new Map<string, string>();\n private categoryName = new Map<string, string>();\n private brandName = new Map<string, string>();\n private bannerName = new Map<string, string>();\n private flashSaleName = new Map<string, string>();\n\n override init = () => {\n this.loadLookups();\n this.load();\n };\n\n typeLabel(value: string): string {\n return TYPES.find((t) => t.value === value)?.label ?? value;\n }\n\n typeDef(value: string): TypeDef | undefined {\n return TYPES.find((t) => t.value === value);\n }\n\n get orderedModules(): ModuleVm[] {\n return [...this.modules].sort((a, b) => a.position - b.position);\n }\n\n get previewModules(): ModuleVm[] {\n const now = Date.now();\n return this.orderedModules.filter(\n (m) =>\n m.enabled &&\n (!m.startsAt || Date.parse(m.startsAt) <= now) &&\n (!m.endsAt || Date.parse(m.endsAt) >= now),\n );\n }\n\n load(): void {\n this.loading = true;\n this.source\n .getMany({ page: this.page, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n this.modules = ((res?.data ?? []) as ModuleVm[])\n .filter((m) => m.page === this.page)\n .map((m) => ({ ...m, config: m.config ?? {} }))\n .sort((a, b) => a.position - b.position);\n this.loading = false;\n }),\n );\n }\n\n changePage(page: string): void {\n this.page = page.trim() || 'home';\n this.cancelEdit();\n this.load();\n }\n\n private loadLookups(): void {\n forkJoin({\n products: this.apiService\n .on('apps/commerce/product')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n categories: this.apiService\n .on('apps/commerce/category')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n brands: this.apiService\n .on('apps/commerce/brand')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n banners: this.apiService\n .on('apps/commerce/banner')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n flashSales: this.apiService\n .on('apps/commerce/flash-sale')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n for (const p of res?.products?.data ?? []) this.productName.set(p.id, p.name);\n for (const c of res?.categories?.data ?? []) this.categoryName.set(c.id, c.name);\n for (const b of res?.brands?.data ?? []) this.brandName.set(b.id, b.name);\n for (const b of res?.banners?.data ?? [])\n this.bannerName.set(b.id, b.title || b.slot || b.id);\n for (const f of res?.flashSales?.data ?? []) this.flashSaleName.set(f.id, f.name);\n }),\n );\n }\n\n previewLine(m: ModuleVm): string {\n const c: any = m.config ?? {};\n const names = (ids: any, map: Map<string, string>) =>\n (Array.isArray(ids) ? ids : [])\n .map((id: string) => map.get(id) ?? id)\n .filter(Boolean);\n\n switch (m.type) {\n case 'hero_carousel':\n case 'promo_banner': {\n const list = names(c.bannerIds, this.bannerName);\n return list.length ? `${list.length} banner(s): ${list.join(', ')}` : 'No banners set';\n }\n case 'product_rail': {\n if (c.categoryId) {\n const cat = this.categoryName.get(c.categoryId) ?? c.categoryId;\n return `Top ${c.limit || 12} from ${cat}`;\n }\n const list = names(c.productIds, this.productName);\n return list.length ? `${list.length} product(s): ${list.join(', ')}` : 'No products set';\n }\n case 'category_grid': {\n const list = names(c.categoryIds, this.categoryName);\n return list.length ? list.join(', ') : 'No categories set';\n }\n case 'brand_strip': {\n const list = names(c.brandIds, this.brandName);\n return list.length ? list.join(', ') : 'No brands set';\n }\n case 'flash_sale_rail':\n return c.flashSaleId\n ? this.flashSaleName.get(c.flashSaleId) ?? c.flashSaleId\n : 'All live flash sales';\n case 'article_rail': {\n const n = Array.isArray(c.articleIds) ? c.articleIds.length : 0;\n return n ? `${n} article(s)` : `Latest ${c.limit || 6} articles`;\n }\n case 'rich_text':\n return (c.html ? String(c.html).replace(/<[^>]+>/g, ' ').trim().slice(0, 80) : '') || 'Empty';\n default:\n return '—';\n }\n }\n\n scheduleLine(m: ModuleVm): string {\n if (!m.startsAt && !m.endsAt) return '';\n const fmt = (v?: string) => (v ? new Date(v).toLocaleDateString() : '…');\n return `${fmt(m.startsAt)} → ${fmt(m.endsAt)}`;\n }\n\n // ── ordering ──────────────────────────────────────────────────────\n\n onDragStart(index: number): void {\n this.dragIndex = index;\n }\n\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n }\n\n onDrop(targetIndex: number): void {\n if (this.dragIndex === null || this.dragIndex === targetIndex) return;\n const ordered = this.orderedModules;\n const [moved] = ordered.splice(this.dragIndex, 1);\n ordered.splice(targetIndex, 0, moved);\n this.dragIndex = null;\n void this.persistOrder(ordered);\n }\n\n moveUp(index: number): void {\n if (index <= 0) return;\n const ordered = this.orderedModules;\n [ordered[index - 1], ordered[index]] = [ordered[index], ordered[index - 1]];\n void this.persistOrder(ordered);\n }\n\n moveDown(index: number): void {\n const ordered = this.orderedModules;\n if (index >= ordered.length - 1) return;\n [ordered[index + 1], ordered[index]] = [ordered[index], ordered[index + 1]];\n void this.persistOrder(ordered);\n }\n\n private async persistOrder(ordered: ModuleVm[]): Promise<void> {\n const changed: ModuleVm[] = [];\n ordered.forEach((m, i) => {\n if (m.position !== i) {\n m.position = i;\n changed.push(m);\n }\n });\n this.modules = ordered;\n try {\n await Promise.all(\n changed.map((m) =>\n firstValueFrom(this.source.update(m.id, { position: m.position } as any)),\n ),\n );\n } catch {\n notify('Could not save the new order.', undefined, 'error');\n this.load();\n }\n }\n\n // ── add / toggle / delete ─────────────────────────────────────────\n\n async addModule(): Promise<void> {\n try {\n await firstValueFrom(\n this.source.create({\n page: this.page,\n type: this.newType,\n position: this.modules.length,\n config: {},\n enabled: false,\n } as any),\n );\n notify('Module added.', undefined, 'success');\n this.load();\n } catch {\n notify('Could not add the module.', undefined, 'error');\n }\n }\n\n async toggleEnabled(m: ModuleVm): Promise<void> {\n const next = !m.enabled;\n try {\n await firstValueFrom(this.source.update(m.id, { enabled: next } as any));\n m.enabled = next;\n } catch {\n notify('Could not update the module.', undefined, 'error');\n }\n }\n\n async removeModule(m: ModuleVm): Promise<void> {\n try {\n await firstValueFrom(this.source.remove(m.id));\n this.modules = this.modules.filter((x) => x.id !== m.id);\n if (this.editing?.id === m.id) this.cancelEdit();\n notify('Module removed.', undefined, 'success');\n } catch {\n notify('Could not remove the module.', undefined, 'error');\n }\n }\n\n // ── edit ──────────────────────────────────────────────────────────\n\n editModule(m: ModuleVm): void {\n this.editing = m;\n const config: Record<string, string> = {};\n for (const field of this.typeDef(m.type)?.fields ?? []) {\n const value = (m.config ?? {})[field.key];\n config[field.key] = Array.isArray(value) ? value.join(', ') : value != null ? String(value) : '';\n }\n this.editModel = {\n title: m.title ?? '',\n startsAt: this.toLocalInput(m.startsAt),\n endsAt: this.toLocalInput(m.endsAt),\n channelIds: (m.channelIds ?? []).join(', '),\n segmentIds: (m.segmentIds ?? []).join(', '),\n config,\n };\n }\n\n cancelEdit(): void {\n this.editing = undefined;\n this.editModel = this.blankEditModel();\n }\n\n async saveEdit(): Promise<void> {\n if (!this.editing) return;\n const def = this.typeDef(this.editing.type);\n const config: Record<string, any> = { ...(this.editing.config ?? {}) };\n for (const field of def?.fields ?? []) {\n const raw = (this.editModel.config[field.key] ?? '').trim();\n if (field.kind === 'ids') {\n config[field.key] = raw ? raw.split(',').map((s) => s.trim()).filter(Boolean) : [];\n } else if (field.kind === 'num') {\n config[field.key] = raw ? Number(raw) : undefined;\n } else {\n config[field.key] = raw || undefined;\n }\n }\n const csv = (s: string) => s.split(',').map((x) => x.trim()).filter(Boolean);\n const body = {\n title: this.editModel.title.trim() || undefined,\n startsAt: this.editModel.startsAt ? new Date(this.editModel.startsAt).toISOString() : null,\n endsAt: this.editModel.endsAt ? new Date(this.editModel.endsAt).toISOString() : null,\n channelIds: csv(this.editModel.channelIds),\n segmentIds: csv(this.editModel.segmentIds),\n config,\n };\n try {\n await firstValueFrom(this.source.update(this.editing.id, body as any));\n Object.assign(this.editing, {\n title: body.title,\n startsAt: body.startsAt ?? undefined,\n endsAt: body.endsAt ?? undefined,\n channelIds: body.channelIds,\n segmentIds: body.segmentIds,\n config,\n });\n notify('Module saved.', undefined, 'success');\n this.cancelEdit();\n } catch {\n notify('Could not save the module.', undefined, 'error');\n }\n }\n\n private blankEditModel() {\n return {\n title: '',\n startsAt: '',\n endsAt: '',\n channelIds: '',\n segmentIds: '',\n config: {} as Record<string, string>,\n };\n }\n\n private toLocalInput(iso?: string): string {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n }\n}\n","<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">⠿</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">▲</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">▼</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">×</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add…' : 'Search by name to add…'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n /* Theme tokens, not hard-coded light greys: a bare <button> otherwise\n takes the browser's own button text colour, which in dark mode is\n near-white on the composer's light card (text only showed when\n highlighted). */\n .x-hc-chip {\n background: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n padding: 2px 8px;\n font-size: 12px;\n color: var(--color-text);\n }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; color: var(--color-text-muted); }\n .x-hc-opt {\n display: block;\n width: 100%;\n text-align: left;\n border: 0;\n border-bottom: 1px solid var(--color-border);\n background: none;\n color: var(--color-text);\n padding: 6px 4px;\n font: inherit;\n font-size: 13px;\n cursor: pointer;\n }\n .x-hc-opt:hover,\n .x-hc-opt:focus-visible { background: var(--color-bg); color: var(--color-brand); }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { HomepageComponent } from './homepage.component';\n\n@NgModule({\n declarations: [HomepageComponent],\n imports: [\n SharedModule,\n ElementsModule,\n RouterModule.forChild([{ path: '', component: HomepageComponent }]),\n ],\n})\nexport class HomepageModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;AA0BA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAc;AACvB,IAAA;AACE,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACjE,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACjE,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,MAAM,EAAE;YACN,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAE;YAC5D,EAAE,GAAG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AAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG1D,cAAc,EAAA,UAAA,EAAA,CAAA;kBAR1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;AACd,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpE,qBAAA;AACF,iBAAA;;;;;"}
@@ -135,7 +135,7 @@ class PagesModule {
135
135
  },
136
136
  {
137
137
  path: 'catalog',
138
- loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs').then((m) => m.CatalogModule),
138
+ loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-catalog.module-CnS35rup.mjs').then((m) => m.CatalogModule),
139
139
  },
140
140
  {
141
141
  path: 'brands',
@@ -185,7 +185,7 @@ class PagesModule {
185
185
  {
186
186
  // P6.7 — PROMO-06 homepage composer.
187
187
  path: 'homepage',
188
- loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs').then((m) => m.HomepageModule),
188
+ loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-homepage.module-Be43nqYG.mjs').then((m) => m.HomepageModule),
189
189
  },
190
190
  {
191
191
  path: 'banners',
@@ -355,7 +355,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
355
355
  },
356
356
  {
357
357
  path: 'catalog',
358
- loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs').then((m) => m.CatalogModule),
358
+ loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-catalog.module-CnS35rup.mjs').then((m) => m.CatalogModule),
359
359
  },
360
360
  {
361
361
  path: 'brands',
@@ -405,7 +405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
405
405
  {
406
406
  // P6.7 — PROMO-06 homepage composer.
407
407
  path: 'homepage',
408
- loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs').then((m) => m.HomepageModule),
408
+ loadChildren: () => import('./isaiahiroko-tilmart-ngx-apps-admin-homepage.module-Be43nqYG.mjs').then((m) => m.HomepageModule),
409
409
  },
410
410
  {
411
411
  path: 'banners',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isaiahiroko/tilmart-ngx-apps-admin",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^21.1.3",
6
6
  "@angular/common": "^21.1.3",
@@ -1 +0,0 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs","sources":["../../../projects/admin/src/lib/pages/homepage/homepage.component.ts","../../../projects/admin/src/lib/pages/homepage/homepage.component.html","../../../projects/admin/src/lib/pages/homepage/homepage.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, forkJoin, of, takeUntil } from 'rxjs';\n\ninterface ModuleVm {\n id: string;\n page: string;\n type: string;\n title?: string;\n position: number;\n config: Record<string, any>;\n channelIds?: string[];\n segmentIds?: string[];\n startsAt?: string;\n endsAt?: string;\n enabled: boolean;\n}\n\ninterface TypeDef {\n value: string;\n label: string;\n // Config fields this type carries. `ids` = comma-separated id list,\n // `id` = single id, `num` = number, `text` = free text / html.\n fields: { key: string; label: string; kind: 'ids' | 'id' | 'num' | 'text' }[];\n}\n\n// P6.7, PROMO-06 / TRD §9.2 — the homepage composer. A drag-ordered list\n// of `MerchandisingModule` rows for a page, each with a type-aware config\n// editor, schedule and targeting, plus a resolved preview line (ids →\n// names) and a page-shape preview mode. The storefront renderer is P6.8.\nconst TYPES: TypeDef[] = [\n {\n value: 'hero_carousel',\n label: 'Hero carousel',\n fields: [{ key: 'bannerIds', label: 'Banner IDs', kind: 'ids' }],\n },\n {\n value: 'promo_banner',\n label: 'Promo banner',\n fields: [{ key: 'bannerIds', label: 'Banner IDs', kind: 'ids' }],\n },\n {\n value: 'product_rail',\n label: 'Product rail',\n fields: [\n { key: 'categoryId', label: 'From category ID', kind: 'id' },\n { key: 'productIds', label: 'Hand-picked products (in order)', kind: 'ids' },\n { key: 'limit', label: 'Max items', kind: 'num' },\n ],\n },\n {\n value: 'category_grid',\n label: 'Category grid',\n fields: [{ key: 'categoryIds', label: 'Category IDs', kind: 'ids' }],\n },\n {\n value: 'brand_strip',\n label: 'Brand strip',\n fields: [{ key: 'brandIds', label: 'Brand IDs', kind: 'ids' }],\n },\n {\n value: 'flash_sale_rail',\n label: 'Flash sale rail',\n fields: [{ key: 'flashSaleId', label: 'Flash sale ID (blank = all live)', kind: 'id' }],\n },\n {\n value: 'article_rail',\n label: 'Article rail',\n fields: [\n { key: 'articleIds', label: 'Article IDs', kind: 'ids' },\n { key: 'limit', label: 'Max items', kind: 'num' },\n ],\n },\n {\n value: 'rich_text',\n label: 'Rich text',\n fields: [{ key: 'html', label: 'HTML', kind: 'text' }],\n },\n { value: 'newsletter', label: 'Newsletter signup', fields: [] },\n { value: 'trust_bar', label: 'Trust bar', fields: [] },\n];\n\n@Component({\n standalone: false,\n selector: 'x-homepage',\n templateUrl: './homepage.component.html',\n})\nexport class HomepageComponent extends BaseDirective {\n private readonly source = this.apiService.on('apps/commerce/merchandising-module');\n\n readonly types = TYPES;\n\n page = 'home';\n loading = true;\n modules: ModuleVm[] = [];\n previewMode = false;\n\n newType = TYPES[0].value;\n\n editing?: ModuleVm;\n editModel: {\n title: string;\n startsAt: string;\n endsAt: string;\n channelIds: string;\n segmentIds: string;\n config: Record<string, string>;\n } = this.blankEditModel();\n\n private dragIndex: number | null = null;\n\n // ── id pickers (products / categories / brands / banners) ─────────\n pickerQuery: Record<string, string> = {};\n\n lookupFor(key: string): Map<string, string> | undefined {\n switch (key) {\n case 'productIds': return this.productName;\n case 'categoryIds': return this.categoryName;\n case 'brandIds': return this.brandName;\n case 'bannerIds': return this.bannerName;\n default: return undefined;\n }\n }\n\n selectedIds(key: string): string[] {\n return (this.editModel.config[key] ?? '').split(',').map((s) => s.trim()).filter(Boolean);\n }\n\n // Products are searched server-side (the catalogue can exceed one page of\n // lookups); the other lists are small enough to filter from the preloaded maps.\n private productHits: { id: string; name: string }[] = [];\n private pickerTimer?: ReturnType<typeof setTimeout>;\n\n onPickerInput(key: string, value: string): void {\n this.pickerQuery[key] = value;\n if (key !== 'productIds') return;\n clearTimeout(this.pickerTimer);\n const q = value.trim();\n if (!q) {\n this.productHits = [];\n return;\n }\n this.pickerTimer = setTimeout(async () => {\n // SKUs are unique, so an exact SKU resolves to exactly one product and\n // is listed first; the text search covers names, brands and partial SKUs.\n const [bySku, byText] = await Promise.all([\n this.findBySku(q),\n firstValueFrom(\n this.apiService.on('apps/commerce/search').create({ q, page: 1, perPage: 8 }),\n ).catch(() => null) as Promise<any>,\n ]);\n const hits: { id: string; name: string }[] = [...bySku];\n for (const i of byText?.data?.items ?? []) {\n this.productName.set(i.productId, i.name);\n if (!hits.some((h) => h.id === i.productId)) hits.push({ id: i.productId, name: i.name });\n }\n this.productHits = hits;\n }, 250);\n }\n\n private async findBySku(sku: string): Promise<{ id: string; name: string }[]> {\n try {\n const res: any = await firstValueFrom(\n this.apiService\n .on('apps/commerce/product-variant')\n .getMany({ sku, page: 1, perPage: 5 } as any),\n );\n return (res?.data ?? [])\n // The list filter may be loose; only an exact SKU counts as a SKU match.\n .filter((v: any) => String(v.sku).toLowerCase() === sku.toLowerCase() && v.productId)\n .map((v: any) => ({\n id: v.productId as string,\n name: `${this.productName.get(v.productId) ?? v.name ?? 'Product'} · SKU ${v.sku}`,\n }));\n } catch {\n return [];\n }\n }\n\n /** Enter in the picker adds the top match (an exact SKU is always on top). */\n addFirstMatch(key: string): void {\n const first = this.pickerMatches(key)[0];\n if (first) this.addId(key, first.id);\n }\n\n pickerMatches(key: string): { id: string; name: string }[] {\n if (key === 'productIds') {\n const taken = new Set(this.selectedIds(key));\n return (this.pickerQuery[key] ?? '').trim()\n ? this.productHits.filter((h) => !taken.has(h.id))\n : [];\n }\n const q = (this.pickerQuery[key] ?? '').trim().toLowerCase();\n const map = this.lookupFor(key);\n if (!q || !map) return [];\n const taken = new Set(this.selectedIds(key));\n return [...map.entries()]\n .filter(([id, name]) => !taken.has(id) && String(name).toLowerCase().includes(q))\n .slice(0, 8)\n .map(([id, name]) => ({ id, name }));\n }\n\n addId(key: string, id: string): void {\n this.editModel.config[key] = [...this.selectedIds(key), id].join(', ');\n this.pickerQuery[key] = '';\n }\n\n removeId(key: string, id: string): void {\n this.editModel.config[key] = this.selectedIds(key).filter((x) => x !== id).join(', ');\n }\n\n // id → name lookups for the preview line.\n private productName = new Map<string, string>();\n private categoryName = new Map<string, string>();\n private brandName = new Map<string, string>();\n private bannerName = new Map<string, string>();\n private flashSaleName = new Map<string, string>();\n\n override init = () => {\n this.loadLookups();\n this.load();\n };\n\n typeLabel(value: string): string {\n return TYPES.find((t) => t.value === value)?.label ?? value;\n }\n\n typeDef(value: string): TypeDef | undefined {\n return TYPES.find((t) => t.value === value);\n }\n\n get orderedModules(): ModuleVm[] {\n return [...this.modules].sort((a, b) => a.position - b.position);\n }\n\n get previewModules(): ModuleVm[] {\n const now = Date.now();\n return this.orderedModules.filter(\n (m) =>\n m.enabled &&\n (!m.startsAt || Date.parse(m.startsAt) <= now) &&\n (!m.endsAt || Date.parse(m.endsAt) >= now),\n );\n }\n\n load(): void {\n this.loading = true;\n this.source\n .getMany({ page: this.page, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n this.modules = ((res?.data ?? []) as ModuleVm[])\n .filter((m) => m.page === this.page)\n .map((m) => ({ ...m, config: m.config ?? {} }))\n .sort((a, b) => a.position - b.position);\n this.loading = false;\n }),\n );\n }\n\n changePage(page: string): void {\n this.page = page.trim() || 'home';\n this.cancelEdit();\n this.load();\n }\n\n private loadLookups(): void {\n forkJoin({\n products: this.apiService\n .on('apps/commerce/product')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n categories: this.apiService\n .on('apps/commerce/category')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n brands: this.apiService\n .on('apps/commerce/brand')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n banners: this.apiService\n .on('apps/commerce/banner')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n flashSales: this.apiService\n .on('apps/commerce/flash-sale')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n for (const p of res?.products?.data ?? []) this.productName.set(p.id, p.name);\n for (const c of res?.categories?.data ?? []) this.categoryName.set(c.id, c.name);\n for (const b of res?.brands?.data ?? []) this.brandName.set(b.id, b.name);\n for (const b of res?.banners?.data ?? [])\n this.bannerName.set(b.id, b.title || b.slot || b.id);\n for (const f of res?.flashSales?.data ?? []) this.flashSaleName.set(f.id, f.name);\n }),\n );\n }\n\n previewLine(m: ModuleVm): string {\n const c: any = m.config ?? {};\n const names = (ids: any, map: Map<string, string>) =>\n (Array.isArray(ids) ? ids : [])\n .map((id: string) => map.get(id) ?? id)\n .filter(Boolean);\n\n switch (m.type) {\n case 'hero_carousel':\n case 'promo_banner': {\n const list = names(c.bannerIds, this.bannerName);\n return list.length ? `${list.length} banner(s): ${list.join(', ')}` : 'No banners set';\n }\n case 'product_rail': {\n if (c.categoryId) {\n const cat = this.categoryName.get(c.categoryId) ?? c.categoryId;\n return `Top ${c.limit || 12} from ${cat}`;\n }\n const list = names(c.productIds, this.productName);\n return list.length ? `${list.length} product(s): ${list.join(', ')}` : 'No products set';\n }\n case 'category_grid': {\n const list = names(c.categoryIds, this.categoryName);\n return list.length ? list.join(', ') : 'No categories set';\n }\n case 'brand_strip': {\n const list = names(c.brandIds, this.brandName);\n return list.length ? list.join(', ') : 'No brands set';\n }\n case 'flash_sale_rail':\n return c.flashSaleId\n ? this.flashSaleName.get(c.flashSaleId) ?? c.flashSaleId\n : 'All live flash sales';\n case 'article_rail': {\n const n = Array.isArray(c.articleIds) ? c.articleIds.length : 0;\n return n ? `${n} article(s)` : `Latest ${c.limit || 6} articles`;\n }\n case 'rich_text':\n return (c.html ? String(c.html).replace(/<[^>]+>/g, ' ').trim().slice(0, 80) : '') || 'Empty';\n default:\n return '—';\n }\n }\n\n scheduleLine(m: ModuleVm): string {\n if (!m.startsAt && !m.endsAt) return '';\n const fmt = (v?: string) => (v ? new Date(v).toLocaleDateString() : '…');\n return `${fmt(m.startsAt)} → ${fmt(m.endsAt)}`;\n }\n\n // ── ordering ──────────────────────────────────────────────────────\n\n onDragStart(index: number): void {\n this.dragIndex = index;\n }\n\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n }\n\n onDrop(targetIndex: number): void {\n if (this.dragIndex === null || this.dragIndex === targetIndex) return;\n const ordered = this.orderedModules;\n const [moved] = ordered.splice(this.dragIndex, 1);\n ordered.splice(targetIndex, 0, moved);\n this.dragIndex = null;\n void this.persistOrder(ordered);\n }\n\n moveUp(index: number): void {\n if (index <= 0) return;\n const ordered = this.orderedModules;\n [ordered[index - 1], ordered[index]] = [ordered[index], ordered[index - 1]];\n void this.persistOrder(ordered);\n }\n\n moveDown(index: number): void {\n const ordered = this.orderedModules;\n if (index >= ordered.length - 1) return;\n [ordered[index + 1], ordered[index]] = [ordered[index], ordered[index + 1]];\n void this.persistOrder(ordered);\n }\n\n private async persistOrder(ordered: ModuleVm[]): Promise<void> {\n const changed: ModuleVm[] = [];\n ordered.forEach((m, i) => {\n if (m.position !== i) {\n m.position = i;\n changed.push(m);\n }\n });\n this.modules = ordered;\n try {\n await Promise.all(\n changed.map((m) =>\n firstValueFrom(this.source.update(m.id, { position: m.position } as any)),\n ),\n );\n } catch {\n notify('Could not save the new order.', undefined, 'error');\n this.load();\n }\n }\n\n // ── add / toggle / delete ─────────────────────────────────────────\n\n async addModule(): Promise<void> {\n try {\n await firstValueFrom(\n this.source.create({\n page: this.page,\n type: this.newType,\n position: this.modules.length,\n config: {},\n enabled: false,\n } as any),\n );\n notify('Module added.', undefined, 'success');\n this.load();\n } catch {\n notify('Could not add the module.', undefined, 'error');\n }\n }\n\n async toggleEnabled(m: ModuleVm): Promise<void> {\n const next = !m.enabled;\n try {\n await firstValueFrom(this.source.update(m.id, { enabled: next } as any));\n m.enabled = next;\n } catch {\n notify('Could not update the module.', undefined, 'error');\n }\n }\n\n async removeModule(m: ModuleVm): Promise<void> {\n try {\n await firstValueFrom(this.source.remove(m.id));\n this.modules = this.modules.filter((x) => x.id !== m.id);\n if (this.editing?.id === m.id) this.cancelEdit();\n notify('Module removed.', undefined, 'success');\n } catch {\n notify('Could not remove the module.', undefined, 'error');\n }\n }\n\n // ── edit ──────────────────────────────────────────────────────────\n\n editModule(m: ModuleVm): void {\n this.editing = m;\n const config: Record<string, string> = {};\n for (const field of this.typeDef(m.type)?.fields ?? []) {\n const value = (m.config ?? {})[field.key];\n config[field.key] = Array.isArray(value) ? value.join(', ') : value != null ? String(value) : '';\n }\n this.editModel = {\n title: m.title ?? '',\n startsAt: this.toLocalInput(m.startsAt),\n endsAt: this.toLocalInput(m.endsAt),\n channelIds: (m.channelIds ?? []).join(', '),\n segmentIds: (m.segmentIds ?? []).join(', '),\n config,\n };\n }\n\n cancelEdit(): void {\n this.editing = undefined;\n this.editModel = this.blankEditModel();\n }\n\n async saveEdit(): Promise<void> {\n if (!this.editing) return;\n const def = this.typeDef(this.editing.type);\n const config: Record<string, any> = { ...(this.editing.config ?? {}) };\n for (const field of def?.fields ?? []) {\n const raw = (this.editModel.config[field.key] ?? '').trim();\n if (field.kind === 'ids') {\n config[field.key] = raw ? raw.split(',').map((s) => s.trim()).filter(Boolean) : [];\n } else if (field.kind === 'num') {\n config[field.key] = raw ? Number(raw) : undefined;\n } else {\n config[field.key] = raw || undefined;\n }\n }\n const csv = (s: string) => s.split(',').map((x) => x.trim()).filter(Boolean);\n const body = {\n title: this.editModel.title.trim() || undefined,\n startsAt: this.editModel.startsAt ? new Date(this.editModel.startsAt).toISOString() : null,\n endsAt: this.editModel.endsAt ? new Date(this.editModel.endsAt).toISOString() : null,\n channelIds: csv(this.editModel.channelIds),\n segmentIds: csv(this.editModel.segmentIds),\n config,\n };\n try {\n await firstValueFrom(this.source.update(this.editing.id, body as any));\n Object.assign(this.editing, {\n title: body.title,\n startsAt: body.startsAt ?? undefined,\n endsAt: body.endsAt ?? undefined,\n channelIds: body.channelIds,\n segmentIds: body.segmentIds,\n config,\n });\n notify('Module saved.', undefined, 'success');\n this.cancelEdit();\n } catch {\n notify('Could not save the module.', undefined, 'error');\n }\n }\n\n private blankEditModel() {\n return {\n title: '',\n startsAt: '',\n endsAt: '',\n channelIds: '',\n segmentIds: '',\n config: {} as Record<string, string>,\n };\n }\n\n private toLocalInput(iso?: string): string {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;\n }\n}\n","<div class=\"x-hc-head\">\n <div>\n <div class=\"x-hc-title\">Homepage composer</div>\n <div class=\"x-hc-sub\">Drag to reorder the modules that build a storefront page.</div>\n </div>\n <div class=\"x-hc-head-controls\">\n <label class=\"x-hc-page-field\">\n Page\n <input\n type=\"text\"\n [ngModel]=\"page\"\n (ngModelChange)=\"changePage($event)\"\n placeholder=\"home\"\n />\n </label>\n <button\n type=\"button\"\n class=\"x-hc-btn\"\n [class.x-hc-btn-active]=\"previewMode\"\n (click)=\"previewMode = !previewMode\"\n >\n {{ previewMode ? 'Exit preview' : 'Preview' }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n <x-element-loader></x-element-loader>\n} @else {\n @if (!previewMode) {\n <div class=\"x-hc-add\">\n <select [(ngModel)]=\"newType\">\n @for (t of types; track t.value) {\n <option [value]=\"t.value\">{{ t.label }}</option>\n }\n </select>\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"addModule()\">\n Add module\n </button>\n </div>\n }\n\n @if (!orderedModules.length) {\n <div class=\"x-hc-empty\">No modules on this page yet.</div>\n }\n\n @if (previewMode) {\n <div class=\"x-hc-preview\">\n @for (m of previewModules; track m.id) {\n <div class=\"x-hc-preview-block\">\n <span class=\"x-hc-preview-type\">{{ typeLabel(m.type) }}</span>\n <span class=\"x-hc-preview-title\">{{ m.title || previewLine(m) }}</span>\n </div>\n } @empty {\n <div class=\"x-hc-empty\">Nothing live on this page right now.</div>\n }\n </div>\n } @else {\n <div class=\"x-hc-list\">\n @for (m of orderedModules; track m.id; let i = $index) {\n <div\n class=\"x-hc-item\"\n [class.x-hc-item-off]=\"!m.enabled\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(i)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(i)\"\n >\n <div class=\"x-hc-item-main\">\n <span class=\"x-hc-grip\" title=\"Drag to reorder\">⠿</span>\n <div class=\"x-hc-order\">\n <button type=\"button\" (click)=\"moveUp(i)\" [disabled]=\"i === 0\">▲</button>\n <button type=\"button\" (click)=\"moveDown(i)\" [disabled]=\"i === orderedModules.length - 1\">▼</button>\n </div>\n <div class=\"x-hc-item-body\">\n <div class=\"x-hc-item-row\">\n <span class=\"x-hc-type\">{{ typeLabel(m.type) }}</span>\n @if (m.title) {\n <span class=\"x-hc-item-title\">{{ m.title }}</span>\n }\n @if (scheduleLine(m)) {\n <span class=\"x-hc-sched\">{{ scheduleLine(m) }}</span>\n }\n </div>\n <div class=\"x-hc-item-preview\">{{ previewLine(m) }}</div>\n </div>\n <div class=\"x-hc-item-actions\">\n <button type=\"button\" class=\"x-hc-toggle\" (click)=\"toggleEnabled(m)\">\n {{ m.enabled ? 'On' : 'Off' }}\n </button>\n <button type=\"button\" class=\"x-hc-link\" (click)=\"editModule(m)\">Edit</button>\n <button type=\"button\" class=\"x-hc-link x-hc-danger\" (click)=\"removeModule(m)\">Delete</button>\n </div>\n </div>\n\n @if (editing?.id === m.id) {\n <div class=\"x-hc-edit\">\n <label class=\"x-hc-f\">\n Title\n <input type=\"text\" [(ngModel)]=\"editModel.title\" />\n </label>\n @for (field of typeDef(m.type)?.fields ?? []; track field.key) {\n <label class=\"x-hc-f\">\n {{ field.label }}\n @if (field.kind === 'ids' && lookupFor(field.key)) {\n <div class=\"x-hc-picked\">\n @for (id of selectedIds(field.key); track id) {\n <span class=\"x-hc-chip\">\n {{ lookupFor(field.key)!.get(id) || id }}\n <button type=\"button\" (click)=\"removeId(field.key, id)\" aria-label=\"Remove\">×</button>\n </span>\n }\n </div>\n <input\n type=\"search\"\n [placeholder]=\"field.key === 'productIds' ? 'Type a SKU or a name to add…' : 'Search by name to add…'\"\n [ngModel]=\"pickerQuery[field.key] || ''\"\n (ngModelChange)=\"onPickerInput(field.key, $event)\"\n (keydown.enter)=\"$event.preventDefault(); addFirstMatch(field.key)\"\n />\n @for (opt of pickerMatches(field.key); track opt.id) {\n <button type=\"button\" class=\"x-hc-opt\" (click)=\"addId(field.key, opt.id)\">\n + {{ opt.name }}\n </button>\n }\n } @else if (field.kind === 'text') {\n <textarea rows=\"3\" [(ngModel)]=\"editModel.config[field.key]\"></textarea>\n } @else {\n <input\n [type]=\"field.kind === 'num' ? 'number' : 'text'\"\n [(ngModel)]=\"editModel.config[field.key]\"\n />\n }\n </label>\n }\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Starts\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.startsAt\" />\n </label>\n <label class=\"x-hc-f\">\n Ends\n <input type=\"datetime-local\" [(ngModel)]=\"editModel.endsAt\" />\n </label>\n </div>\n <div class=\"x-hc-f-row\">\n <label class=\"x-hc-f\">\n Channel IDs\n <input type=\"text\" [(ngModel)]=\"editModel.channelIds\" placeholder=\"blank = all\" />\n </label>\n <label class=\"x-hc-f\">\n Segment IDs\n <input type=\"text\" [(ngModel)]=\"editModel.segmentIds\" placeholder=\"blank = all\" />\n </label>\n </div>\n <div class=\"x-hc-edit-actions\">\n <button type=\"button\" class=\"x-hc-btn x-hc-btn-primary\" (click)=\"saveEdit()\">Save</button>\n <button type=\"button\" class=\"x-hc-btn\" (click)=\"cancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n}\n\n<style>\n .x-hc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }\n .x-hc-chip { background: #eef2f8; border: 1px solid #c9d3e4; border-radius: 12px; padding: 2px 8px; font-size: 12px; }\n .x-hc-chip button { border: 0; background: none; cursor: pointer; margin-left: 4px; }\n .x-hc-opt { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eee; background: none; padding: 6px 4px; font-size: 13px; cursor: pointer; }\n .x-hc-head {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n margin-bottom: 20px;\n flex-wrap: wrap;\n }\n .x-hc-title { font-size: 24px; font-weight: 800; color: var(--color-text); }\n .x-hc-sub { font-size: 13.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-head-controls { display: flex; gap: 10px; align-items: flex-end; }\n .x-hc-page-field {\n display: flex; flex-direction: column; gap: 4px;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.4px;\n }\n .x-hc-page-field input, .x-hc-add select, .x-hc-f input, .x-hc-f textarea {\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n padding: 6px 10px;\n font-size: 13px;\n background: var(--color-surface);\n color: var(--color-text);\n }\n .x-hc-add { display: flex; gap: 10px; margin-bottom: 16px; }\n .x-hc-btn {\n border: 1px solid var(--color-border);\n background: transparent;\n border-radius: var(--radius-md);\n padding: 6px 14px;\n font-size: 12.5px;\n font-weight: 700;\n cursor: pointer;\n color: var(--color-text-muted);\n }\n .x-hc-btn-primary { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-btn-active { border-color: var(--color-accent); color: var(--color-accent-hover); }\n .x-hc-empty { font-size: 14px; color: var(--color-text-muted); }\n .x-hc-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }\n .x-hc-item {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n padding: 12px 14px;\n }\n .x-hc-item-off { opacity: 0.55; }\n .x-hc-item-main { display: flex; align-items: center; gap: 12px; }\n .x-hc-grip { cursor: grab; color: var(--color-text-muted); font-size: 16px; }\n .x-hc-order { display: flex; flex-direction: column; }\n .x-hc-order button {\n border: 0; background: transparent; cursor: pointer;\n color: var(--color-text-muted); font-size: 10px; line-height: 1.1; padding: 1px 3px;\n }\n .x-hc-order button:disabled { opacity: 0.3; cursor: default; }\n .x-hc-item-body { flex: 1; min-width: 0; }\n .x-hc-item-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }\n .x-hc-type {\n font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;\n font-size: 11px; color: var(--color-accent-hover);\n }\n .x-hc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text); }\n .x-hc-sched { font-size: 11px; color: var(--color-text-muted); }\n .x-hc-item-preview { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }\n .x-hc-item-actions { display: flex; gap: 8px; align-items: center; }\n .x-hc-toggle {\n border: 1px solid var(--color-border); border-radius: var(--radius-sm);\n background: transparent; padding: 3px 10px; font-size: 11.5px; font-weight: 700;\n cursor: pointer; color: var(--color-text-muted);\n }\n .x-hc-link {\n border: 0; background: transparent; cursor: pointer;\n font-size: 12px; font-weight: 700; color: var(--color-accent-hover);\n }\n .x-hc-danger { color: var(--color-danger, #c0362c); }\n .x-hc-edit {\n margin-top: 12px; padding-top: 12px;\n border-top: 1px solid var(--color-border);\n display: flex; flex-direction: column; gap: 10px;\n }\n .x-hc-f {\n display: flex; flex-direction: column; gap: 4px; flex: 1;\n font-size: 11.5px; color: var(--color-text-muted); font-weight: 700;\n }\n .x-hc-f-row { display: flex; gap: 10px; }\n .x-hc-edit-actions { display: flex; gap: 8px; }\n .x-hc-preview { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }\n .x-hc-preview-block {\n border: 1px dashed var(--color-border-strong);\n border-radius: var(--radius-md);\n padding: 18px 16px;\n display: flex; flex-direction: column; gap: 4px;\n background: var(--color-surface);\n }\n .x-hc-preview-type {\n font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;\n color: var(--color-accent-hover);\n }\n .x-hc-preview-title { font-size: 14px; color: var(--color-text); }\n</style>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { HomepageComponent } from './homepage.component';\n\n@NgModule({\n declarations: [HomepageComponent],\n imports: [\n SharedModule,\n ElementsModule,\n RouterModule.forChild([{ path: '', component: HomepageComponent }]),\n ],\n})\nexport class HomepageModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;AA0BA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAc;AACvB,IAAA;AACE,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,KAAK,EAAE,eAAe;AACtB,QAAA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACjE,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,E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