@transcommerce/cwm-shared 1.1.84 → 1.1.87
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.
- package/fesm2022/transcommerce-cwm-shared.mjs +1154 -118
- package/fesm2022/transcommerce-cwm-shared.mjs.map +1 -1
- package/lib/models/category-slide.d.ts +12 -0
- package/lib/models/category.d.ts +2 -2
- package/lib/models/product.d.ts +8 -5
- package/lib/models/profile.d.ts +2 -2
- package/lib/models/style/color-style.d.ts +93 -0
- package/lib/models/style/coordinates-style.d.ts +8 -0
- package/lib/models/style/font-style.d.ts +11 -0
- package/lib/models/style/hex-color.d.ts +122 -0
- package/lib/models/style/image-style.d.ts +13 -0
- package/lib/models/{justifications.d.ts → style/justifications.d.ts} +1 -1
- package/lib/models/style/named-colors.d.ts +172 -0
- package/lib/models/style/ng-style-item.d.ts +3 -0
- package/lib/models/style/on-style.d.ts +4 -0
- package/lib/models/style/rgba-color-style.d.ts +16 -0
- package/lib/models/style/size-style.d.ts +8 -0
- package/lib/models/style/text-style.d.ts +15 -0
- package/lib/models/{create-subscription-request.d.ts → webapi-requests/create-subscription-request.d.ts} +2 -2
- package/lib/services/subscription-api.service.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +14 -10
- package/lib/models/color.d.ts +0 -2
- package/lib/models/font.d.ts +0 -9
- package/lib/models/image.d.ts +0 -8
- package/lib/models/logging-verbosity.d.ts +0 -7
- package/lib/models/model-map.d.ts +0 -4
- package/lib/models/named-colors.d.ts +0 -8
- package/lib/models/on-element-style.d.ts +0 -3
|
@@ -48,8 +48,8 @@ class ExternalNavigationComponent {
|
|
|
48
48
|
this.navigateToExternalUrl();
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
52
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ExternalNavigationComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
52
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: ExternalNavigationComponent, isStandalone: false, selector: "cwm-external-navigation", ngImport: i0, template: `<div class="container">
|
|
53
53
|
<h3>Enter the destination route, URL, or Href you want and press the button that uses the navigation method of your choosing:</h3>
|
|
54
54
|
<input id="txtRoute" type="text" [(ngModel)]="route" placeholder="Enter the destination route, URL, or Href..."
|
|
55
55
|
(keydown)="onKeyPress($event)"/>
|
|
@@ -60,7 +60,7 @@ class ExternalNavigationComponent {
|
|
|
60
60
|
<button (click)="navigateToExternalHref()">Navigate to external Href</button>
|
|
61
61
|
</div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
62
62
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ExternalNavigationComponent, decorators: [{
|
|
64
64
|
type: Component,
|
|
65
65
|
args: [{
|
|
66
66
|
selector: 'cwm-external-navigation',
|
|
@@ -97,10 +97,10 @@ class NavigateToRouteComponent {
|
|
|
97
97
|
this.navigateToRoute();
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
101
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
100
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: NavigateToRouteComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: NavigateToRouteComponent, isStandalone: false, selector: "cwm-navigate-to-route", ngImport: i0, template: "<div class=\"container\">\n <h2>Enter the route you want to navigate to:</h2>\n <input id=\"txtRoute\" type=\"text\" [(ngModel)]=\"route\" placeholder=\"Enter Route...\"\n (keydown)=\"onKeyPress($event)\"/>\n <button (click)=\"navigateToRoute()\">Navigate</button>\n</div>\n``\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
102
102
|
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: NavigateToRouteComponent, decorators: [{
|
|
104
104
|
type: Component,
|
|
105
105
|
args: [{ selector: 'cwm-navigate-to-route', standalone: false, template: "<div class=\"container\">\n <h2>Enter the route you want to navigate to:</h2>\n <input id=\"txtRoute\" type=\"text\" [(ngModel)]=\"route\" placeholder=\"Enter Route...\"\n (keydown)=\"onKeyPress($event)\"/>\n <button (click)=\"navigateToRoute()\">Navigate</button>\n</div>\n``\n", styles: [":host{display:block}\n"] }]
|
|
106
106
|
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
@@ -134,10 +134,10 @@ class PageNotFoundComponent {
|
|
|
134
134
|
}
|
|
135
135
|
}, 1000);
|
|
136
136
|
}
|
|
137
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
138
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: PageNotFoundComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: PageNotFoundComponent, isStandalone: false, selector: "cwm-page-not-found", ngImport: i0, template: "<div class=\"not-found-container\">\n <div class=\"not-found-card\">\n <div class=\"emoji-icon\">\uD83D\uDD0E</div>\n <div class=\"error-code\">404</div>\n <h1 class=\"error-title\">Page Not Found</h1>\n <p class=\"error-description\">\n The page you're looking for doesn't exist or has been moved. Let's get you back on track!\n </p>\n\n <div class=\"button-group\">\n <a routerLink=\"/\" class=\"btn btn-primary\">\uD83C\uDFE0 Go to Home</a>\n <a routerLink=\"/dashboard\" class=\"btn btn-secondary\">\uD83D\uDCCA Dashboard</a>\n <a href=\"javascript:history.back()\" class=\"btn btn-outline\">\u2190 Go Back</a>\n <a href=\"mailto:support@cheapweedmenu.com?subject=Broken%20link%20-%20404&body=I%20found%20a%20broken%20link\" class=\"btn btn-ghost\">\uD83D\uDCE7 Report Issue</a>\n </div>\n\n <div class=\"redirect-info\">\n <small class=\"redirect-timer\">You will be redirected to home in <span class=\"timer-badge\">{{ redirectCountdown }}</span> seconds</small>\n <div class=\"breadcrumb\">\n Requested URL: <code>{{ requestedUrl }}</code>\n </div>\n </div>\n </div>\n</div>\n", styles: [".menu{color:#fff}.menu-bg{background-color:#333}.hybrid{color:#375b2b}.hybrid-bg{background-color:#375b2b}.shake{color:#4e544c}.shake-bg{background-color:#4e544c}.indica{color:#1c2e16}.indica-bg{background-color:#1c2e16}.sativa{color:#d7d0c4}.sativa-bg{background-color:#d7d0c4}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.not-found-container{min-height:70vh;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#1c2e16,#375b2b)}.not-found-card{max-width:720px;width:100%;text-align:center;border-radius:12px;box-shadow:0 8px 30px #0000004d;padding:36px;background:linear-gradient(180deg,#d7d0c4,#e8e2d8);animation:fadeInUp .6s ease-out}.emoji-icon{font-size:80px;line-height:1;margin-bottom:16px;animation:float 3s ease-in-out infinite;display:inline-block}.error-code{margin:0;font-size:48px;font-weight:700;color:#1c2e16;letter-spacing:-1px}.error-title{margin:8px 0;font-size:28px;font-weight:600;color:#1c2e16}.error-description{color:#4e544c;margin:12px 0 28px;line-height:1.6;font-size:16px}.button-group{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:32px 0}.btn{padding:12px 24px;border-radius:8px;text-decoration:none;font-weight:600;font-size:14px;transition:all .5s ease;cursor:pointer;border:none;display:inline-block}.btn-primary{background-color:#1c2e16;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-primary:hover{background-color:#160816;color:#d7d0c4;transform:translateY(-2px);box-shadow:0 4px 12px #1c2e1666}.btn-secondary{background-color:#375b2b;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-secondary:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-outline{background-color:#d7d0c4;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-outline:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-ghost{background:transparent;border:2px solid #1c2e16;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-ghost:hover{border-color:#375b2b;background-color:#375b2b;color:#d7d0c4;transform:translateY(-2px)}.redirect-info{margin-top:24px;padding-top:24px;border-top:2px solid #1c2e16}.redirect-timer{font-size:14px;color:#4e544c;margin-top:12px}.timer-badge{display:inline-block;background-color:#1c2e16;color:#d7d0c4;padding:4px 10px;border-radius:4px;font-weight:600;margin-left:4px}.breadcrumb{margin-top:20px;font-size:12px;color:#4e544c}.breadcrumb code{background-color:#1c2e16;color:#d7d0c4;padding:2px 6px;border-radius:4px}\n"], dependencies: [{ kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
139
139
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: PageNotFoundComponent, decorators: [{
|
|
141
141
|
type: Component,
|
|
142
142
|
args: [{ selector: 'cwm-page-not-found', standalone: false, template: "<div class=\"not-found-container\">\n <div class=\"not-found-card\">\n <div class=\"emoji-icon\">\uD83D\uDD0E</div>\n <div class=\"error-code\">404</div>\n <h1 class=\"error-title\">Page Not Found</h1>\n <p class=\"error-description\">\n The page you're looking for doesn't exist or has been moved. Let's get you back on track!\n </p>\n\n <div class=\"button-group\">\n <a routerLink=\"/\" class=\"btn btn-primary\">\uD83C\uDFE0 Go to Home</a>\n <a routerLink=\"/dashboard\" class=\"btn btn-secondary\">\uD83D\uDCCA Dashboard</a>\n <a href=\"javascript:history.back()\" class=\"btn btn-outline\">\u2190 Go Back</a>\n <a href=\"mailto:support@cheapweedmenu.com?subject=Broken%20link%20-%20404&body=I%20found%20a%20broken%20link\" class=\"btn btn-ghost\">\uD83D\uDCE7 Report Issue</a>\n </div>\n\n <div class=\"redirect-info\">\n <small class=\"redirect-timer\">You will be redirected to home in <span class=\"timer-badge\">{{ redirectCountdown }}</span> seconds</small>\n <div class=\"breadcrumb\">\n Requested URL: <code>{{ requestedUrl }}</code>\n </div>\n </div>\n </div>\n</div>\n", styles: [".menu{color:#fff}.menu-bg{background-color:#333}.hybrid{color:#375b2b}.hybrid-bg{background-color:#375b2b}.shake{color:#4e544c}.shake-bg{background-color:#4e544c}.indica{color:#1c2e16}.indica-bg{background-color:#1c2e16}.sativa{color:#d7d0c4}.sativa-bg{background-color:#d7d0c4}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.not-found-container{min-height:70vh;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#1c2e16,#375b2b)}.not-found-card{max-width:720px;width:100%;text-align:center;border-radius:12px;box-shadow:0 8px 30px #0000004d;padding:36px;background:linear-gradient(180deg,#d7d0c4,#e8e2d8);animation:fadeInUp .6s ease-out}.emoji-icon{font-size:80px;line-height:1;margin-bottom:16px;animation:float 3s ease-in-out infinite;display:inline-block}.error-code{margin:0;font-size:48px;font-weight:700;color:#1c2e16;letter-spacing:-1px}.error-title{margin:8px 0;font-size:28px;font-weight:600;color:#1c2e16}.error-description{color:#4e544c;margin:12px 0 28px;line-height:1.6;font-size:16px}.button-group{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:32px 0}.btn{padding:12px 24px;border-radius:8px;text-decoration:none;font-weight:600;font-size:14px;transition:all .5s ease;cursor:pointer;border:none;display:inline-block}.btn-primary{background-color:#1c2e16;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-primary:hover{background-color:#160816;color:#d7d0c4;transform:translateY(-2px);box-shadow:0 4px 12px #1c2e1666}.btn-secondary{background-color:#375b2b;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-secondary:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-outline{background-color:#d7d0c4;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-outline:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-ghost{background:transparent;border:2px solid #1c2e16;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-ghost:hover{border-color:#375b2b;background-color:#375b2b;color:#d7d0c4;transform:translateY(-2px)}.redirect-info{margin-top:24px;padding-top:24px;border-top:2px solid #1c2e16}.redirect-timer{font-size:14px;color:#4e544c;margin-top:12px}.timer-badge{display:inline-block;background-color:#1c2e16;color:#d7d0c4;padding:4px 10px;border-radius:4px;font-weight:600;margin-left:4px}.breadcrumb{margin-top:20px;font-size:12px;color:#4e544c}.breadcrumb code{background-color:#1c2e16;color:#d7d0c4;padding:2px 6px;border-radius:4px}\n"] }]
|
|
143
143
|
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
@@ -339,10 +339,10 @@ class ClassLoggerService {
|
|
|
339
339
|
console.log(`${this.prefix} Trace: ${message}`, optionalParams);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
343
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
342
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ClassLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
343
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ClassLoggerService });
|
|
344
344
|
}
|
|
345
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
345
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ClassLoggerService, decorators: [{
|
|
346
346
|
type: Injectable
|
|
347
347
|
}], ctorParameters: () => [] });
|
|
348
348
|
|
|
@@ -576,10 +576,10 @@ class DbKeys {
|
|
|
576
576
|
static SHOW_DASHBOARD_NOTIFICATIONS = 'show_dashboard_notifications';
|
|
577
577
|
static SHOW_DASHBOARD_TODO = 'show_dashboard_todo';
|
|
578
578
|
static SHOW_DASHBOARD_BANNER = 'show_dashboard_banner';
|
|
579
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
580
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
579
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: DbKeys, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
580
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: DbKeys });
|
|
581
581
|
}
|
|
582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: DbKeys, decorators: [{
|
|
583
583
|
type: Injectable
|
|
584
584
|
}] });
|
|
585
585
|
|
|
@@ -1266,10 +1266,10 @@ class Utilities {
|
|
|
1266
1266
|
static convertToAbsoluteUrl(url) {
|
|
1267
1267
|
return Utilities.testIsAbsoluteUrl(url) ? url : '//' + url;
|
|
1268
1268
|
}
|
|
1269
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
1270
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
1269
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: Utilities, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1270
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: Utilities });
|
|
1271
1271
|
}
|
|
1272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: Utilities, decorators: [{
|
|
1273
1273
|
type: Injectable
|
|
1274
1274
|
}] });
|
|
1275
1275
|
|
|
@@ -1732,6 +1732,1030 @@ const CONFIGURATION_SCHEMA = {
|
|
|
1732
1732
|
]
|
|
1733
1733
|
};
|
|
1734
1734
|
|
|
1735
|
+
var NamedColors;
|
|
1736
|
+
(function (NamedColors) {
|
|
1737
|
+
// Basic colors
|
|
1738
|
+
NamedColors["White"] = "white";
|
|
1739
|
+
NamedColors["Black"] = "black";
|
|
1740
|
+
NamedColors["Red"] = "red";
|
|
1741
|
+
NamedColors["Green"] = "green";
|
|
1742
|
+
NamedColors["Blue"] = "blue";
|
|
1743
|
+
NamedColors["Yellow"] = "yellow";
|
|
1744
|
+
NamedColors["Cyan"] = "cyan";
|
|
1745
|
+
NamedColors["Magenta"] = "magenta";
|
|
1746
|
+
NamedColors["Lime"] = "lime";
|
|
1747
|
+
NamedColors["Maroon"] = "maroon";
|
|
1748
|
+
NamedColors["Navy"] = "navy";
|
|
1749
|
+
NamedColors["Olive"] = "olive";
|
|
1750
|
+
NamedColors["Purple"] = "purple";
|
|
1751
|
+
NamedColors["Teal"] = "teal";
|
|
1752
|
+
NamedColors["Silver"] = "silver";
|
|
1753
|
+
NamedColors["Gray"] = "gray";
|
|
1754
|
+
NamedColors["Grey"] = "grey";
|
|
1755
|
+
// Extended colors
|
|
1756
|
+
NamedColors["AliceBlue"] = "aliceblue";
|
|
1757
|
+
NamedColors["AntiqueWhite"] = "antiquewhite";
|
|
1758
|
+
NamedColors["Aqua"] = "aqua";
|
|
1759
|
+
NamedColors["Aquamarine"] = "aquamarine";
|
|
1760
|
+
NamedColors["Azure"] = "azure";
|
|
1761
|
+
NamedColors["Beige"] = "beige";
|
|
1762
|
+
NamedColors["Bisque"] = "bisque";
|
|
1763
|
+
NamedColors["BlanchedAlmond"] = "blanchedalmond";
|
|
1764
|
+
NamedColors["BlueViolet"] = "blueviolet";
|
|
1765
|
+
NamedColors["Brown"] = "brown";
|
|
1766
|
+
NamedColors["BurlyWood"] = "burlywood";
|
|
1767
|
+
NamedColors["CadetBlue"] = "cadetblue";
|
|
1768
|
+
NamedColors["Chartreuse"] = "chartreuse";
|
|
1769
|
+
NamedColors["Chocolate"] = "chocolate";
|
|
1770
|
+
NamedColors["Coral"] = "coral";
|
|
1771
|
+
NamedColors["CornflowerBlue"] = "cornflowerblue";
|
|
1772
|
+
NamedColors["Cornsilk"] = "cornsilk";
|
|
1773
|
+
NamedColors["Crimson"] = "crimson";
|
|
1774
|
+
NamedColors["DarkBlue"] = "darkblue";
|
|
1775
|
+
NamedColors["DarkCyan"] = "darkcyan";
|
|
1776
|
+
NamedColors["DarkGoldenRod"] = "darkgoldenrod";
|
|
1777
|
+
NamedColors["DarkGray"] = "darkgray";
|
|
1778
|
+
NamedColors["DarkGrey"] = "darkgrey";
|
|
1779
|
+
NamedColors["DarkGreen"] = "darkgreen";
|
|
1780
|
+
NamedColors["DarkKhaki"] = "darkkhaki";
|
|
1781
|
+
NamedColors["DarkMagenta"] = "darkmagenta";
|
|
1782
|
+
NamedColors["DarkOliveGreen"] = "darkolivegreen";
|
|
1783
|
+
NamedColors["DarkOrange"] = "darkorange";
|
|
1784
|
+
NamedColors["DarkOrchid"] = "darkorchid";
|
|
1785
|
+
NamedColors["DarkRed"] = "darkred";
|
|
1786
|
+
NamedColors["DarkSalmon"] = "darksalmon";
|
|
1787
|
+
NamedColors["DarkSeaGreen"] = "darkseagreen";
|
|
1788
|
+
NamedColors["DarkSlateBlue"] = "darkslateblue";
|
|
1789
|
+
NamedColors["DarkSlateGray"] = "darkslategray";
|
|
1790
|
+
NamedColors["DarkSlateGrey"] = "darkslategrey";
|
|
1791
|
+
NamedColors["DarkTurquoise"] = "darkturquoise";
|
|
1792
|
+
NamedColors["DarkViolet"] = "darkviolet";
|
|
1793
|
+
NamedColors["DeepPink"] = "deeppink";
|
|
1794
|
+
NamedColors["DeepSkyBlue"] = "deepskyblue";
|
|
1795
|
+
NamedColors["DimGray"] = "dimgray";
|
|
1796
|
+
NamedColors["DimGrey"] = "dimgrey";
|
|
1797
|
+
NamedColors["DodgerBlue"] = "dodgerblue";
|
|
1798
|
+
NamedColors["FireBrick"] = "firebrick";
|
|
1799
|
+
NamedColors["FloralWhite"] = "floralwhite";
|
|
1800
|
+
NamedColors["ForestGreen"] = "forestgreen";
|
|
1801
|
+
NamedColors["Fuchsia"] = "fuchsia";
|
|
1802
|
+
NamedColors["Gainsboro"] = "gainsboro";
|
|
1803
|
+
NamedColors["GhostWhite"] = "ghostwhite";
|
|
1804
|
+
NamedColors["Gold"] = "gold";
|
|
1805
|
+
NamedColors["GoldenRod"] = "goldenrod";
|
|
1806
|
+
NamedColors["GreenYellow"] = "greenyellow";
|
|
1807
|
+
NamedColors["Honeydew"] = "honeydew";
|
|
1808
|
+
NamedColors["HotPink"] = "hotpink";
|
|
1809
|
+
NamedColors["IndianRed"] = "indianred";
|
|
1810
|
+
NamedColors["Indigo"] = "indigo";
|
|
1811
|
+
NamedColors["Ivory"] = "ivory";
|
|
1812
|
+
NamedColors["Khaki"] = "khaki";
|
|
1813
|
+
NamedColors["Lavender"] = "lavender";
|
|
1814
|
+
NamedColors["LavenderBlush"] = "lavenderblush";
|
|
1815
|
+
NamedColors["LawnGreen"] = "lawngreen";
|
|
1816
|
+
NamedColors["LemonChiffon"] = "lemonchiffon";
|
|
1817
|
+
NamedColors["LightBlue"] = "lightblue";
|
|
1818
|
+
NamedColors["LightCoral"] = "lightcoral";
|
|
1819
|
+
NamedColors["LightCyan"] = "lightcyan";
|
|
1820
|
+
NamedColors["LightGoldenRodYellow"] = "lightgoldenrodyellow";
|
|
1821
|
+
NamedColors["LightGray"] = "lightgray";
|
|
1822
|
+
NamedColors["LightGrey"] = "lightgrey";
|
|
1823
|
+
NamedColors["LightGreen"] = "lightgreen";
|
|
1824
|
+
NamedColors["LightPink"] = "lightpink";
|
|
1825
|
+
NamedColors["LightSalmon"] = "lightsalmon";
|
|
1826
|
+
NamedColors["LightSeaGreen"] = "lightseagreen";
|
|
1827
|
+
NamedColors["LightSkyBlue"] = "lightskyblue";
|
|
1828
|
+
NamedColors["LightSlateGray"] = "lightslategray";
|
|
1829
|
+
NamedColors["LightSlateGrey"] = "lightslategrey";
|
|
1830
|
+
NamedColors["LightSteelBlue"] = "lightsteelblue";
|
|
1831
|
+
NamedColors["LightYellow"] = "lightyellow";
|
|
1832
|
+
NamedColors["LimeGreen"] = "limegreen";
|
|
1833
|
+
NamedColors["Linen"] = "linen";
|
|
1834
|
+
NamedColors["MediumAquaMarine"] = "mediumaquamarine";
|
|
1835
|
+
NamedColors["MediumBlue"] = "mediumblue";
|
|
1836
|
+
NamedColors["MediumOrchid"] = "mediumorchid";
|
|
1837
|
+
NamedColors["MediumPurple"] = "mediumpurple";
|
|
1838
|
+
NamedColors["MediumSeaGreen"] = "mediumseagreen";
|
|
1839
|
+
NamedColors["MediumSlateBlue"] = "mediumslateblue";
|
|
1840
|
+
NamedColors["MediumSpringGreen"] = "mediumspringgreen";
|
|
1841
|
+
NamedColors["MediumTurquoise"] = "mediumturquoise";
|
|
1842
|
+
NamedColors["MediumVioletRed"] = "mediumvioletred";
|
|
1843
|
+
NamedColors["MidnightBlue"] = "midnightblue";
|
|
1844
|
+
NamedColors["MintCream"] = "mintcream";
|
|
1845
|
+
NamedColors["MistyRose"] = "mistyrose";
|
|
1846
|
+
NamedColors["Moccasin"] = "moccasin";
|
|
1847
|
+
NamedColors["NavajoWhite"] = "navajowhite";
|
|
1848
|
+
NamedColors["OldLace"] = "oldlace";
|
|
1849
|
+
NamedColors["OliveDrab"] = "olivedrab";
|
|
1850
|
+
NamedColors["Orange"] = "orange";
|
|
1851
|
+
NamedColors["OrangeRed"] = "orangered";
|
|
1852
|
+
NamedColors["Orchid"] = "orchid";
|
|
1853
|
+
NamedColors["PaleGoldenRod"] = "palegoldenrod";
|
|
1854
|
+
NamedColors["PaleGreen"] = "palegreen";
|
|
1855
|
+
NamedColors["PaleTurquoise"] = "paleturquoise";
|
|
1856
|
+
NamedColors["PaleVioletRed"] = "palevioletred";
|
|
1857
|
+
NamedColors["PapayaWhip"] = "papayawhip";
|
|
1858
|
+
NamedColors["PeachPuff"] = "peachpuff";
|
|
1859
|
+
NamedColors["Peru"] = "peru";
|
|
1860
|
+
NamedColors["Pink"] = "pink";
|
|
1861
|
+
NamedColors["Plum"] = "plum";
|
|
1862
|
+
NamedColors["PowderBlue"] = "powderblue";
|
|
1863
|
+
NamedColors["RosyBrown"] = "rosybrown";
|
|
1864
|
+
NamedColors["RoyalBlue"] = "royalblue";
|
|
1865
|
+
NamedColors["SaddleBrown"] = "saddlebrown";
|
|
1866
|
+
NamedColors["Salmon"] = "salmon";
|
|
1867
|
+
NamedColors["SandyBrown"] = "sandybrown";
|
|
1868
|
+
NamedColors["SeaGreen"] = "seagreen";
|
|
1869
|
+
NamedColors["SeaShell"] = "seashell";
|
|
1870
|
+
NamedColors["Sienna"] = "sienna";
|
|
1871
|
+
NamedColors["SkyBlue"] = "skyblue";
|
|
1872
|
+
NamedColors["SlateBlue"] = "slateblue";
|
|
1873
|
+
NamedColors["SlateGray"] = "slategray";
|
|
1874
|
+
NamedColors["SlateGrey"] = "slategrey";
|
|
1875
|
+
NamedColors["Snow"] = "snow";
|
|
1876
|
+
NamedColors["SpringGreen"] = "springgreen";
|
|
1877
|
+
NamedColors["SteelBlue"] = "steelblue";
|
|
1878
|
+
NamedColors["Tan"] = "tan";
|
|
1879
|
+
NamedColors["Thistle"] = "thistle";
|
|
1880
|
+
NamedColors["Tomato"] = "tomato";
|
|
1881
|
+
NamedColors["Turquoise"] = "turquoise";
|
|
1882
|
+
NamedColors["Violet"] = "violet";
|
|
1883
|
+
NamedColors["Wheat"] = "wheat";
|
|
1884
|
+
NamedColors["WhiteSmoke"] = "whitesmoke";
|
|
1885
|
+
NamedColors["YellowGreen"] = "yellowgreen";
|
|
1886
|
+
NamedColors["Transparent"] = "transparent";
|
|
1887
|
+
})(NamedColors || (NamedColors = {}));
|
|
1888
|
+
/**
|
|
1889
|
+
* Comprehensive mapping of CSS named colors to their hex values.
|
|
1890
|
+
* Based on CSS Color Module Level 4 specification.
|
|
1891
|
+
*/
|
|
1892
|
+
const NAMED_COLOR_MAP = {
|
|
1893
|
+
// Basic colors
|
|
1894
|
+
'black': '#000000',
|
|
1895
|
+
'white': '#FFFFFF',
|
|
1896
|
+
'red': '#FF0000',
|
|
1897
|
+
'green': '#008000',
|
|
1898
|
+
'blue': '#0000FF',
|
|
1899
|
+
'yellow': '#FFFF00',
|
|
1900
|
+
'cyan': '#00FFFF',
|
|
1901
|
+
'magenta': '#FF00FF',
|
|
1902
|
+
'lime': '#00FF00',
|
|
1903
|
+
'maroon': '#800000',
|
|
1904
|
+
'navy': '#000080',
|
|
1905
|
+
'olive': '#808000',
|
|
1906
|
+
'purple': '#800080',
|
|
1907
|
+
'teal': '#008080',
|
|
1908
|
+
'silver': '#C0C0C0',
|
|
1909
|
+
'gray': '#808080',
|
|
1910
|
+
'grey': '#808080',
|
|
1911
|
+
// Extended colors
|
|
1912
|
+
'aliceblue': '#F0F8FF',
|
|
1913
|
+
'antiquewhite': '#FAEBD7',
|
|
1914
|
+
'aqua': '#00FFFF',
|
|
1915
|
+
'aquamarine': '#7FFFD4',
|
|
1916
|
+
'azure': '#F0FFFF',
|
|
1917
|
+
'beige': '#F5F5DC',
|
|
1918
|
+
'bisque': '#FFE4C4',
|
|
1919
|
+
'blanchedalmond': '#FFEBCD',
|
|
1920
|
+
'blueviolet': '#8A2BE2',
|
|
1921
|
+
'brown': '#A52A2A',
|
|
1922
|
+
'burlywood': '#DEB887',
|
|
1923
|
+
'cadetblue': '#5F9EA0',
|
|
1924
|
+
'chartreuse': '#7FFF00',
|
|
1925
|
+
'chocolate': '#D2691E',
|
|
1926
|
+
'coral': '#FF7F50',
|
|
1927
|
+
'cornflowerblue': '#6495ED',
|
|
1928
|
+
'cornsilk': '#FFF8DC',
|
|
1929
|
+
'crimson': '#DC143C',
|
|
1930
|
+
'darkblue': '#00008B',
|
|
1931
|
+
'darkcyan': '#008B8B',
|
|
1932
|
+
'darkgoldenrod': '#B8860B',
|
|
1933
|
+
'darkgray': '#A9A9A9',
|
|
1934
|
+
'darkgrey': '#A9A9A9',
|
|
1935
|
+
'darkgreen': '#006400',
|
|
1936
|
+
'darkkhaki': '#BDB76B',
|
|
1937
|
+
'darkmagenta': '#8B008B',
|
|
1938
|
+
'darkolivegreen': '#556B2F',
|
|
1939
|
+
'darkorange': '#FF8C00',
|
|
1940
|
+
'darkorchid': '#9932CC',
|
|
1941
|
+
'darkred': '#8B0000',
|
|
1942
|
+
'darksalmon': '#E9967A',
|
|
1943
|
+
'darkseagreen': '#8FBC8F',
|
|
1944
|
+
'darkslateblue': '#483D8B',
|
|
1945
|
+
'darkslategray': '#2F4F4F',
|
|
1946
|
+
'darkslategrey': '#2F4F4F',
|
|
1947
|
+
'darkturquoise': '#00CED1',
|
|
1948
|
+
'darkviolet': '#9400D3',
|
|
1949
|
+
'deeppink': '#FF1493',
|
|
1950
|
+
'deepskyblue': '#00BFFF',
|
|
1951
|
+
'dimgray': '#696969',
|
|
1952
|
+
'dimgrey': '#696969',
|
|
1953
|
+
'dodgerblue': '#1E90FF',
|
|
1954
|
+
'firebrick': '#B22222',
|
|
1955
|
+
'floralwhite': '#FFFAF0',
|
|
1956
|
+
'forestgreen': '#228B22',
|
|
1957
|
+
'fuchsia': '#FF00FF',
|
|
1958
|
+
'gainsboro': '#DCDCDC',
|
|
1959
|
+
'ghostwhite': '#F8F8FF',
|
|
1960
|
+
'gold': '#FFD700',
|
|
1961
|
+
'goldenrod': '#DAA520',
|
|
1962
|
+
'greenyellow': '#ADFF2F',
|
|
1963
|
+
'honeydew': '#F0FFF0',
|
|
1964
|
+
'hotpink': '#FF69B4',
|
|
1965
|
+
'indianred': '#CD5C5C',
|
|
1966
|
+
'indigo': '#4B0082',
|
|
1967
|
+
'ivory': '#FFFFF0',
|
|
1968
|
+
'khaki': '#F0E68C',
|
|
1969
|
+
'lavender': '#E6E6FA',
|
|
1970
|
+
'lavenderblush': '#FFF0F5',
|
|
1971
|
+
'lawngreen': '#7CFC00',
|
|
1972
|
+
'lemonchiffon': '#FFFACD',
|
|
1973
|
+
'lightblue': '#ADD8E6',
|
|
1974
|
+
'lightcoral': '#F08080',
|
|
1975
|
+
'lightcyan': '#E0FFFF',
|
|
1976
|
+
'lightgoldenrodyellow': '#FAFAD2',
|
|
1977
|
+
'lightgray': '#D3D3D3',
|
|
1978
|
+
'lightgrey': '#D3D3D3',
|
|
1979
|
+
'lightgreen': '#90EE90',
|
|
1980
|
+
'lightpink': '#FFB6C1',
|
|
1981
|
+
'lightsalmon': '#FFA07A',
|
|
1982
|
+
'lightseagreen': '#20B2AA',
|
|
1983
|
+
'lightskyblue': '#87CEFA',
|
|
1984
|
+
'lightslategray': '#778899',
|
|
1985
|
+
'lightslategrey': '#778899',
|
|
1986
|
+
'lightsteelblue': '#B0C4DE',
|
|
1987
|
+
'lightyellow': '#FFFFE0',
|
|
1988
|
+
'limegreen': '#32CD32',
|
|
1989
|
+
'linen': '#FAF0E6',
|
|
1990
|
+
'mediumaquamarine': '#66CDAA',
|
|
1991
|
+
'mediumblue': '#0000CD',
|
|
1992
|
+
'mediumorchid': '#BA55D3',
|
|
1993
|
+
'mediumpurple': '#9370DB',
|
|
1994
|
+
'mediumseagreen': '#3CB371',
|
|
1995
|
+
'mediumslateblue': '#7B68EE',
|
|
1996
|
+
'mediumspringgreen': '#00FA9A',
|
|
1997
|
+
'mediumturquoise': '#48D1CC',
|
|
1998
|
+
'mediumvioletred': '#C71585',
|
|
1999
|
+
'midnightblue': '#191970',
|
|
2000
|
+
'mintcream': '#F5FFFA',
|
|
2001
|
+
'mistyrose': '#FFE4E1',
|
|
2002
|
+
'moccasin': '#FFE4B5',
|
|
2003
|
+
'navajowhite': '#FFDEAD',
|
|
2004
|
+
'oldlace': '#FDF5E6',
|
|
2005
|
+
'olivedrab': '#6B8E23',
|
|
2006
|
+
'orange': '#FFA500',
|
|
2007
|
+
'orangered': '#FF4500',
|
|
2008
|
+
'orchid': '#DA70D6',
|
|
2009
|
+
'palegoldenrod': '#EEE8AA',
|
|
2010
|
+
'palegreen': '#98FB98',
|
|
2011
|
+
'paleturquoise': '#AFEEEE',
|
|
2012
|
+
'palevioletred': '#DB7093',
|
|
2013
|
+
'papayawhip': '#FFEFD5',
|
|
2014
|
+
'peachpuff': '#FFDAB9',
|
|
2015
|
+
'peru': '#CD853F',
|
|
2016
|
+
'pink': '#FFC0CB',
|
|
2017
|
+
'plum': '#DDA0DD',
|
|
2018
|
+
'powderblue': '#B0E0E6',
|
|
2019
|
+
'rosybrown': '#BC8F8F',
|
|
2020
|
+
'royalblue': '#4169E1',
|
|
2021
|
+
'saddlebrown': '#8B4513',
|
|
2022
|
+
'salmon': '#FA8072',
|
|
2023
|
+
'sandybrown': '#F4A460',
|
|
2024
|
+
'seagreen': '#2E8B57',
|
|
2025
|
+
'seashell': '#FFF5EE',
|
|
2026
|
+
'sienna': '#A0522D',
|
|
2027
|
+
'skyblue': '#87CEEB',
|
|
2028
|
+
'slateblue': '#6A5ACD',
|
|
2029
|
+
'slategray': '#708090',
|
|
2030
|
+
'slategrey': '#708090',
|
|
2031
|
+
'snow': '#FFFAFA',
|
|
2032
|
+
'springgreen': '#00FF7F',
|
|
2033
|
+
'steelblue': '#4682B4',
|
|
2034
|
+
'tan': '#D2B48C',
|
|
2035
|
+
'thistle': '#D8BFD8',
|
|
2036
|
+
'tomato': '#FF6347',
|
|
2037
|
+
'turquoise': '#40E0D0',
|
|
2038
|
+
'violet': '#EE82EE',
|
|
2039
|
+
'wheat': '#F5DEB3',
|
|
2040
|
+
'whitesmoke': '#F5F5F5',
|
|
2041
|
+
'yellowgreen': '#9ACD32',
|
|
2042
|
+
'transparent': '#00000000'
|
|
2043
|
+
};
|
|
2044
|
+
/**
|
|
2045
|
+
* Converts a named color to its hex representation
|
|
2046
|
+
* @param colorName - CSS named color (case-insensitive)
|
|
2047
|
+
* @returns Hex color string or null if color name is not recognized
|
|
2048
|
+
*/
|
|
2049
|
+
function namedColorToHex(colorName) {
|
|
2050
|
+
return NAMED_COLOR_MAP[colorName] || null;
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* Checks if a string is a valid CSS named color
|
|
2054
|
+
* @param colorName - String to check
|
|
2055
|
+
* @returns True if it's a valid named color
|
|
2056
|
+
*/
|
|
2057
|
+
function isNamedColor(colorName) {
|
|
2058
|
+
const normalized = colorName.toLowerCase().trim();
|
|
2059
|
+
return normalized in NAMED_COLOR_MAP;
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Gets all available named color names
|
|
2063
|
+
* @returns Array of all CSS named color names
|
|
2064
|
+
*/
|
|
2065
|
+
function getNamedColors() {
|
|
2066
|
+
return Object.keys(NAMED_COLOR_MAP);
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
class RgbaColorStyle {
|
|
2070
|
+
ngOnStyle(ngStyle) {
|
|
2071
|
+
if (ngStyle) {
|
|
2072
|
+
ngStyle['color'] = this.toCssString();
|
|
2073
|
+
}
|
|
2074
|
+
return ngStyle;
|
|
2075
|
+
}
|
|
2076
|
+
r;
|
|
2077
|
+
g;
|
|
2078
|
+
b;
|
|
2079
|
+
a;
|
|
2080
|
+
/* Static method to create an RGBAColor instance from a hex color string.
|
|
2081
|
+
* Supports both short (#RGB, #RGBA) and full (#RRGGBB, #RRGGBBAA) hex formats.
|
|
2082
|
+
*/
|
|
2083
|
+
static fromHexColor(hexColor) {
|
|
2084
|
+
// Remove the # if present
|
|
2085
|
+
const hex = hexColor.replace('#', '');
|
|
2086
|
+
// Parse the hex values
|
|
2087
|
+
let r, g, b, a = 1;
|
|
2088
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
2089
|
+
// Short format: #RGB or #RGBA
|
|
2090
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
2091
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
2092
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
2093
|
+
if (hex.length === 4) {
|
|
2094
|
+
a = parseInt(hex[3] + hex[3], 16) / 255;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
else if (hex.length === 6 || hex.length === 8) {
|
|
2098
|
+
// Full format: #RRGGBB or #RRGGBBAA
|
|
2099
|
+
r = parseInt(hex.substring(0, 2), 16);
|
|
2100
|
+
g = parseInt(hex.substring(2, 4), 16);
|
|
2101
|
+
b = parseInt(hex.substring(4, 6), 16);
|
|
2102
|
+
if (hex.length === 8) {
|
|
2103
|
+
a = parseInt(hex.substring(6, 8), 16) / 255;
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
else {
|
|
2107
|
+
throw new Error(`Invalid hex color format: ${hexColor}`);
|
|
2108
|
+
}
|
|
2109
|
+
const rgba = new RgbaColorStyle();
|
|
2110
|
+
rgba.r = r;
|
|
2111
|
+
rgba.g = g;
|
|
2112
|
+
rgba.b = b;
|
|
2113
|
+
rgba.a = a;
|
|
2114
|
+
return rgba;
|
|
2115
|
+
}
|
|
2116
|
+
/* Static method to create an RGBAColor instance from a CSS named color.
|
|
2117
|
+
* Supports all standard CSS named colors (case-insensitive).
|
|
2118
|
+
* @param colorName - CSS named color (e.g., 'red', 'blue', 'cornflowerblue')
|
|
2119
|
+
* @returns RGBAColor instance
|
|
2120
|
+
* @throws Error if the color name is not recognized
|
|
2121
|
+
*/
|
|
2122
|
+
static fromNamedColor(colorName) {
|
|
2123
|
+
const hexColor = namedColorToHex(colorName);
|
|
2124
|
+
if (!hexColor) {
|
|
2125
|
+
throw new Error(`Unknown named color: ${colorName}`);
|
|
2126
|
+
}
|
|
2127
|
+
return RgbaColorStyle.fromHexColor(hexColor);
|
|
2128
|
+
}
|
|
2129
|
+
/* Method to convert the RGBAColor instance back to a hex color string.
|
|
2130
|
+
* If includeAlpha is true, the alpha value will be included in the hex string.
|
|
2131
|
+
*/
|
|
2132
|
+
toHexColor(includeAlpha = false) {
|
|
2133
|
+
const toHex = (value) => {
|
|
2134
|
+
return Math.round(value).toString(16).padStart(2, '0');
|
|
2135
|
+
};
|
|
2136
|
+
const r = toHex(this.r);
|
|
2137
|
+
const g = toHex(this.g);
|
|
2138
|
+
const b = toHex(this.b);
|
|
2139
|
+
let hexColor;
|
|
2140
|
+
if (includeAlpha) {
|
|
2141
|
+
const a = toHex(this.a * 255); // Convert 0-1 to 0-255
|
|
2142
|
+
hexColor = `#${r}${g}${b}${a}`;
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
hexColor = `#${r}${g}${b}`;
|
|
2146
|
+
}
|
|
2147
|
+
return hexColor;
|
|
2148
|
+
}
|
|
2149
|
+
/* Method to convert the RGBAColor instance to a CSS rgba() string.
|
|
2150
|
+
* @returns CSS rgba string (e.g., "rgba(255, 0, 0, 1)")
|
|
2151
|
+
*/
|
|
2152
|
+
toCssString() {
|
|
2153
|
+
return `rgba(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)}, ${this.a})`;
|
|
2154
|
+
}
|
|
2155
|
+
/* Method to attempt to find the closest named color for this RGBA color.
|
|
2156
|
+
* Only works for fully opaque colors (alpha = 1).
|
|
2157
|
+
* @returns Named color string or null if no exact match found or color has alpha
|
|
2158
|
+
*/
|
|
2159
|
+
toNamedColor() {
|
|
2160
|
+
// Only match fully opaque colors
|
|
2161
|
+
if (this.a !== 1) {
|
|
2162
|
+
return null;
|
|
2163
|
+
}
|
|
2164
|
+
const hexColor = this.toHexColor(false).toLowerCase();
|
|
2165
|
+
// Find exact match
|
|
2166
|
+
for (const [name, hex] of Object.entries(NAMED_COLOR_MAP)) {
|
|
2167
|
+
if (hex.toLowerCase() === hexColor) {
|
|
2168
|
+
return name;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
return null;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* A unified Color class that can represent colors as Named, Hex, or RGBA formats
|
|
2177
|
+
* and provides conversion methods between all formats.
|
|
2178
|
+
*/
|
|
2179
|
+
class ColorStyle {
|
|
2180
|
+
_value;
|
|
2181
|
+
constructor(value) {
|
|
2182
|
+
this._value = value;
|
|
2183
|
+
}
|
|
2184
|
+
ngOnStyle(ngStyle) {
|
|
2185
|
+
return {
|
|
2186
|
+
...ngStyle,
|
|
2187
|
+
color: this.toCssString()
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Gets the original color value
|
|
2192
|
+
*/
|
|
2193
|
+
get value() {
|
|
2194
|
+
return this._value;
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Creates a Color from a named color string
|
|
2198
|
+
*/
|
|
2199
|
+
static fromNamedColor(colorName) {
|
|
2200
|
+
const normalized = colorName.toLowerCase().trim();
|
|
2201
|
+
if (!isNamedColor(normalized)) {
|
|
2202
|
+
throw new Error(`Unknown named color: ${colorName}`);
|
|
2203
|
+
}
|
|
2204
|
+
return new ColorStyle(normalized);
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Creates a Color from a hex color string
|
|
2208
|
+
*/
|
|
2209
|
+
static fromHexColor(hexColor) {
|
|
2210
|
+
return new ColorStyle(hexColor);
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* Creates a Color from an RGBAColor object
|
|
2214
|
+
*/
|
|
2215
|
+
static fromRGBAColor(rgba) {
|
|
2216
|
+
return new ColorStyle(rgba);
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Creates a Color from RGB values
|
|
2220
|
+
*/
|
|
2221
|
+
static fromRGB(r, g, b, a = 1) {
|
|
2222
|
+
const rgba = new RgbaColorStyle();
|
|
2223
|
+
rgba.r = Math.max(0, Math.min(255, Math.round(r)));
|
|
2224
|
+
rgba.g = Math.max(0, Math.min(255, Math.round(g)));
|
|
2225
|
+
rgba.b = Math.max(0, Math.min(255, Math.round(b)));
|
|
2226
|
+
rgba.a = Math.max(0, Math.min(1, a));
|
|
2227
|
+
return new ColorStyle(rgba);
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Parses a CSS color string (hex, named, or rgba)
|
|
2231
|
+
*/
|
|
2232
|
+
static parse(colorString) {
|
|
2233
|
+
const trimmed = colorString.trim();
|
|
2234
|
+
// Check if it's a named color
|
|
2235
|
+
if (isNamedColor(trimmed)) {
|
|
2236
|
+
return ColorStyle.fromNamedColor(trimmed);
|
|
2237
|
+
}
|
|
2238
|
+
// Check if it's a hex color
|
|
2239
|
+
if (trimmed.startsWith('#')) {
|
|
2240
|
+
return ColorStyle.fromHexColor(trimmed);
|
|
2241
|
+
}
|
|
2242
|
+
// Check if it's an rgba/rgb string
|
|
2243
|
+
const rgbaMatch = trimmed.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
|
|
2244
|
+
if (rgbaMatch) {
|
|
2245
|
+
const r = parseInt(rgbaMatch[1], 10);
|
|
2246
|
+
const g = parseInt(rgbaMatch[2], 10);
|
|
2247
|
+
const b = parseInt(rgbaMatch[3], 10);
|
|
2248
|
+
const a = rgbaMatch[4] ? parseFloat(rgbaMatch[4]) : 1;
|
|
2249
|
+
return ColorStyle.fromRGB(r, g, b, a);
|
|
2250
|
+
}
|
|
2251
|
+
throw new Error(`Invalid color string: ${colorString}`);
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* Checks if the current value is a named color
|
|
2255
|
+
*/
|
|
2256
|
+
isNamedColor() {
|
|
2257
|
+
return typeof this._value === 'string' && !this._value.startsWith('#');
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Checks if the current value is a hex color
|
|
2261
|
+
*/
|
|
2262
|
+
isHexColor() {
|
|
2263
|
+
return typeof this._value === 'string' && this._value.startsWith('#');
|
|
2264
|
+
}
|
|
2265
|
+
/**
|
|
2266
|
+
* Checks if the current value is an RGBA color object
|
|
2267
|
+
*/
|
|
2268
|
+
isRGBAColor() {
|
|
2269
|
+
return this._value instanceof RgbaColorStyle;
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* Converts to hex color format
|
|
2273
|
+
*/
|
|
2274
|
+
toHexColor(includeAlpha = false) {
|
|
2275
|
+
if (this.isHexColor()) {
|
|
2276
|
+
return this._value;
|
|
2277
|
+
}
|
|
2278
|
+
const rgba = this.toRGBAColor();
|
|
2279
|
+
return rgba.toHexColor(includeAlpha);
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Converts to RGBA color object
|
|
2283
|
+
*/
|
|
2284
|
+
toRGBAColor() {
|
|
2285
|
+
if (this.isRGBAColor()) {
|
|
2286
|
+
return this._value;
|
|
2287
|
+
}
|
|
2288
|
+
if (this.isNamedColor()) {
|
|
2289
|
+
return RgbaColorStyle.fromNamedColor(this._value);
|
|
2290
|
+
}
|
|
2291
|
+
if (this.isHexColor()) {
|
|
2292
|
+
return RgbaColorStyle.fromHexColor(this._value);
|
|
2293
|
+
}
|
|
2294
|
+
throw new Error('Invalid color value');
|
|
2295
|
+
}
|
|
2296
|
+
/**
|
|
2297
|
+
* Attempts to convert to a named color (only for exact matches)
|
|
2298
|
+
*/
|
|
2299
|
+
toNamedColor() {
|
|
2300
|
+
if (this.isNamedColor()) {
|
|
2301
|
+
return this._value;
|
|
2302
|
+
}
|
|
2303
|
+
const rgba = this.toRGBAColor();
|
|
2304
|
+
return rgba.toNamedColor();
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Converts to CSS string format (hex, named, or rgba)
|
|
2308
|
+
*/
|
|
2309
|
+
toCssString() {
|
|
2310
|
+
if (this.isNamedColor()) {
|
|
2311
|
+
return this._value;
|
|
2312
|
+
}
|
|
2313
|
+
if (this.isHexColor()) {
|
|
2314
|
+
return this._value;
|
|
2315
|
+
}
|
|
2316
|
+
if (this.isRGBAColor()) {
|
|
2317
|
+
return this._value.toCssString();
|
|
2318
|
+
}
|
|
2319
|
+
return this.toRGBAColor().toCssString();
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Returns the best CSS string representation (named if possible, otherwise hex)
|
|
2323
|
+
*/
|
|
2324
|
+
toString() {
|
|
2325
|
+
const namedColor = this.toNamedColor();
|
|
2326
|
+
if (namedColor) {
|
|
2327
|
+
return namedColor;
|
|
2328
|
+
}
|
|
2329
|
+
return this.toHexColor();
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* Lightens the color by a percentage
|
|
2333
|
+
*/
|
|
2334
|
+
lighten(percentage) {
|
|
2335
|
+
const rgba = this.toRGBAColor();
|
|
2336
|
+
const amount = percentage / 100;
|
|
2337
|
+
const lightened = new RgbaColorStyle();
|
|
2338
|
+
lightened.r = Math.min(255, Math.round(rgba.r + (255 - rgba.r) * amount));
|
|
2339
|
+
lightened.g = Math.min(255, Math.round(rgba.g + (255 - rgba.g) * amount));
|
|
2340
|
+
lightened.b = Math.min(255, Math.round(rgba.b + (255 - rgba.b) * amount));
|
|
2341
|
+
lightened.a = rgba.a;
|
|
2342
|
+
return new ColorStyle(lightened);
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Darkens the color by a percentage
|
|
2346
|
+
*/
|
|
2347
|
+
darken(percentage) {
|
|
2348
|
+
const rgba = this.toRGBAColor();
|
|
2349
|
+
const amount = percentage / 100;
|
|
2350
|
+
const darkened = new RgbaColorStyle();
|
|
2351
|
+
darkened.r = Math.max(0, Math.round(rgba.r * (1 - amount)));
|
|
2352
|
+
darkened.g = Math.max(0, Math.round(rgba.g * (1 - amount)));
|
|
2353
|
+
darkened.b = Math.max(0, Math.round(rgba.b * (1 - amount)));
|
|
2354
|
+
darkened.a = rgba.a;
|
|
2355
|
+
return new ColorStyle(darkened);
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* Adjusts the alpha channel
|
|
2359
|
+
*/
|
|
2360
|
+
withAlpha(alpha) {
|
|
2361
|
+
const rgba = this.toRGBAColor();
|
|
2362
|
+
const adjusted = new RgbaColorStyle();
|
|
2363
|
+
adjusted.r = rgba.r;
|
|
2364
|
+
adjusted.g = rgba.g;
|
|
2365
|
+
adjusted.b = rgba.b;
|
|
2366
|
+
adjusted.a = Math.max(0, Math.min(1, alpha));
|
|
2367
|
+
return new ColorStyle(adjusted);
|
|
2368
|
+
}
|
|
2369
|
+
/**
|
|
2370
|
+
* Checks if two colors are equal
|
|
2371
|
+
*/
|
|
2372
|
+
equals(other) {
|
|
2373
|
+
const thisRGBA = this.toRGBAColor();
|
|
2374
|
+
const otherRGBA = other.toRGBAColor();
|
|
2375
|
+
return thisRGBA.r === otherRGBA.r &&
|
|
2376
|
+
thisRGBA.g === otherRGBA.g &&
|
|
2377
|
+
thisRGBA.b === otherRGBA.b &&
|
|
2378
|
+
thisRGBA.a === otherRGBA.a;
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Creates a copy of the color
|
|
2382
|
+
*/
|
|
2383
|
+
clone() {
|
|
2384
|
+
if (this.isRGBAColor()) {
|
|
2385
|
+
const rgba = this._value;
|
|
2386
|
+
const cloned = new RgbaColorStyle();
|
|
2387
|
+
cloned.r = rgba.r;
|
|
2388
|
+
cloned.g = rgba.g;
|
|
2389
|
+
cloned.b = rgba.b;
|
|
2390
|
+
cloned.a = rgba.a;
|
|
2391
|
+
return new ColorStyle(cloned);
|
|
2392
|
+
}
|
|
2393
|
+
return new ColorStyle(this._value);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
const DEFAULT_FORECOLOR = ColorStyle.fromNamedColor("black");
|
|
2397
|
+
const DEFAULT_BACKCOLOR = ColorStyle.fromNamedColor("white");
|
|
2398
|
+
|
|
2399
|
+
class CoordinatesStyle {
|
|
2400
|
+
top;
|
|
2401
|
+
left;
|
|
2402
|
+
ngOnStyle(ngStyle) {
|
|
2403
|
+
if (this.top)
|
|
2404
|
+
ngStyle['top'] = typeof this.top === 'number' ? `${this.top}px` : this.top;
|
|
2405
|
+
if (this.left)
|
|
2406
|
+
ngStyle['left'] = typeof this.left === 'number' ? `${this.left}px` : this.left;
|
|
2407
|
+
return ngStyle;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
const DEFAULT_COORDINATES = new CoordinatesStyle();
|
|
2411
|
+
DEFAULT_COORDINATES.top = 0;
|
|
2412
|
+
DEFAULT_COORDINATES.left = 0;
|
|
2413
|
+
|
|
2414
|
+
class FontStyle {
|
|
2415
|
+
family;
|
|
2416
|
+
size;
|
|
2417
|
+
italic;
|
|
2418
|
+
bold;
|
|
2419
|
+
underline;
|
|
2420
|
+
ngOnStyle(ngStyle) {
|
|
2421
|
+
if (this.family)
|
|
2422
|
+
ngStyle['fontFamily'] = this.family;
|
|
2423
|
+
if (this.size)
|
|
2424
|
+
ngStyle['fontSize'] = `${this.size}px`;
|
|
2425
|
+
ngStyle['fontStyle'] = this.italic ? 'italic' : 'normal';
|
|
2426
|
+
ngStyle['fontWeight'] = this.bold ? 'bold' : 'normal';
|
|
2427
|
+
ngStyle['textDecoration'] = this.underline ? 'underline' : 'none';
|
|
2428
|
+
return ngStyle;
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
const DEFAULT_FONT = new FontStyle();
|
|
2432
|
+
DEFAULT_FONT.family = '"Newake-Regular", sans-serif';
|
|
2433
|
+
DEFAULT_FONT.size = 16;
|
|
2434
|
+
DEFAULT_FONT.italic = false;
|
|
2435
|
+
DEFAULT_FONT.bold = true;
|
|
2436
|
+
DEFAULT_FONT.underline = false;
|
|
2437
|
+
|
|
2438
|
+
/**
|
|
2439
|
+
* Converts a hex color to RGBA format
|
|
2440
|
+
* @param hex - Hex color string (e.g., "#FF0000" or "#FF0000FF")
|
|
2441
|
+
* @returns RGBAColor object with r, g, b (0-255) and a (0-1)
|
|
2442
|
+
*/
|
|
2443
|
+
function hexToRGBA(hex) {
|
|
2444
|
+
// Remove the # if present
|
|
2445
|
+
let hexValue = hex.replace('#', '');
|
|
2446
|
+
// Handle shorthand hex (e.g., #FFF)
|
|
2447
|
+
if (hexValue.length === 3) {
|
|
2448
|
+
hexValue = hexValue.split('').map(char => char + char).join('');
|
|
2449
|
+
}
|
|
2450
|
+
// Parse RGB values
|
|
2451
|
+
const r = parseInt(hexValue.substring(0, 2), 16);
|
|
2452
|
+
const g = parseInt(hexValue.substring(2, 4), 16);
|
|
2453
|
+
const b = parseInt(hexValue.substring(4, 6), 16);
|
|
2454
|
+
// Parse alpha value if present (8-character hex)
|
|
2455
|
+
let a = 1;
|
|
2456
|
+
if (hexValue.length === 8) {
|
|
2457
|
+
a = parseInt(hexValue.substring(6, 8), 16) / 255;
|
|
2458
|
+
}
|
|
2459
|
+
const rgba = new RgbaColorStyle();
|
|
2460
|
+
rgba.r = r;
|
|
2461
|
+
rgba.g = g;
|
|
2462
|
+
rgba.b = b;
|
|
2463
|
+
rgba.a = a;
|
|
2464
|
+
return rgba;
|
|
2465
|
+
}
|
|
2466
|
+
/**
|
|
2467
|
+
* Converts RGBA values to hex color format
|
|
2468
|
+
* @param r - Red value (0-255)
|
|
2469
|
+
* @param g - Green value (0-255)
|
|
2470
|
+
* @param b - Blue value (0-255)
|
|
2471
|
+
* @param a - Alpha value (0-1), optional
|
|
2472
|
+
* @returns Hex color string (e.g., "#FF0000" or "#FF0000FF" if alpha < 1)
|
|
2473
|
+
*/
|
|
2474
|
+
function rgbaToHex(r, g, b, a = 1) {
|
|
2475
|
+
// Clamp values to valid ranges
|
|
2476
|
+
r = Math.max(0, Math.min(255, Math.round(r)));
|
|
2477
|
+
g = Math.max(0, Math.min(255, Math.round(g)));
|
|
2478
|
+
b = Math.max(0, Math.min(255, Math.round(b)));
|
|
2479
|
+
a = Math.max(0, Math.min(1, a));
|
|
2480
|
+
// Convert to hex
|
|
2481
|
+
const rHex = r.toString(16).padStart(2, '0');
|
|
2482
|
+
const gHex = g.toString(16).padStart(2, '0');
|
|
2483
|
+
const bHex = b.toString(16).padStart(2, '0');
|
|
2484
|
+
// Include alpha if not fully opaque
|
|
2485
|
+
if (a < 1) {
|
|
2486
|
+
const aHex = Math.round(a * 255).toString(16).padStart(2, '0');
|
|
2487
|
+
return `#${rHex}${gHex}${bHex}${aHex}`;
|
|
2488
|
+
}
|
|
2489
|
+
return `#${rHex}${gHex}${bHex}`;
|
|
2490
|
+
}
|
|
2491
|
+
/**
|
|
2492
|
+
* Converts an RGBAColor object to hex color format
|
|
2493
|
+
* @param rgba - RGBAColor object
|
|
2494
|
+
* @returns Hex color string
|
|
2495
|
+
*/
|
|
2496
|
+
function rgbaObjectToHex(rgba) {
|
|
2497
|
+
return rgbaToHex(rgba.r, rgba.g, rgba.b, rgba.a);
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* Converts an RGBAColor object to CSS rgba() string format
|
|
2501
|
+
* @param rgba - RGBAColor object
|
|
2502
|
+
* @returns CSS rgba string (e.g., "rgba(255, 0, 0, 1)")
|
|
2503
|
+
*/
|
|
2504
|
+
function rgbaToCssString(rgba) {
|
|
2505
|
+
return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;
|
|
2506
|
+
}
|
|
2507
|
+
/**
|
|
2508
|
+
* Parses a CSS rgba() or rgb() string to RGBAColor object
|
|
2509
|
+
* @param cssString - CSS color string (e.g., "rgba(255, 0, 0, 1)" or "rgb(255, 0, 0)")
|
|
2510
|
+
* @returns RGBAColor object or null if parsing fails
|
|
2511
|
+
*/
|
|
2512
|
+
function cssStringToRGBA(cssString) {
|
|
2513
|
+
// Match rgba(r, g, b, a) or rgb(r, g, b)
|
|
2514
|
+
const rgbaMatch = cssString.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
|
|
2515
|
+
if (!rgbaMatch) {
|
|
2516
|
+
return null;
|
|
2517
|
+
}
|
|
2518
|
+
const r = parseInt(rgbaMatch[1], 10);
|
|
2519
|
+
const g = parseInt(rgbaMatch[2], 10);
|
|
2520
|
+
const b = parseInt(rgbaMatch[3], 10);
|
|
2521
|
+
const a = rgbaMatch[4] ? parseFloat(rgbaMatch[4]) : 1;
|
|
2522
|
+
const rgba = new RgbaColorStyle();
|
|
2523
|
+
rgba.r = r;
|
|
2524
|
+
rgba.g = g;
|
|
2525
|
+
rgba.b = b;
|
|
2526
|
+
rgba.a = a;
|
|
2527
|
+
return rgba;
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Creates an RGBAColor object from individual values
|
|
2531
|
+
* @param r - Red value (0-255)
|
|
2532
|
+
* @param g - Green value (0-255)
|
|
2533
|
+
* @param b - Blue value (0-255)
|
|
2534
|
+
* @param a - Alpha value (0-1), defaults to 1
|
|
2535
|
+
* @returns RGBAColor object
|
|
2536
|
+
*/
|
|
2537
|
+
function createRGBA(r, g, b, a = 1) {
|
|
2538
|
+
const rgba = new RgbaColorStyle();
|
|
2539
|
+
rgba.r = Math.max(0, Math.min(255, Math.round(r)));
|
|
2540
|
+
rgba.g = Math.max(0, Math.min(255, Math.round(g)));
|
|
2541
|
+
rgba.b = Math.max(0, Math.min(255, Math.round(b)));
|
|
2542
|
+
rgba.a = Math.max(0, Math.min(1, a));
|
|
2543
|
+
return rgba;
|
|
2544
|
+
}
|
|
2545
|
+
/**
|
|
2546
|
+
* Clones an RGBAColor object
|
|
2547
|
+
* @param rgba - RGBAColor object to clone
|
|
2548
|
+
* @returns New RGBAColor object with same values
|
|
2549
|
+
*/
|
|
2550
|
+
function cloneRGBA(rgba) {
|
|
2551
|
+
const clone = new RgbaColorStyle();
|
|
2552
|
+
clone.r = rgba.r;
|
|
2553
|
+
clone.g = rgba.g;
|
|
2554
|
+
clone.b = rgba.b;
|
|
2555
|
+
clone.a = rgba.a;
|
|
2556
|
+
return clone;
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* Checks if two RGBAColor objects are equal
|
|
2560
|
+
* @param rgba1 - First RGBAColor object
|
|
2561
|
+
* @param rgba2 - Second RGBAColor object
|
|
2562
|
+
* @returns True if all values are equal
|
|
2563
|
+
*/
|
|
2564
|
+
function rgbaEquals(rgba1, rgba2) {
|
|
2565
|
+
return rgba1.r === rgba2.r &&
|
|
2566
|
+
rgba1.g === rgba2.g &&
|
|
2567
|
+
rgba1.b === rgba2.b &&
|
|
2568
|
+
rgba1.a === rgba2.a;
|
|
2569
|
+
}
|
|
2570
|
+
/**
|
|
2571
|
+
* Adjusts the alpha channel of an RGBA color
|
|
2572
|
+
* @param rgba - Original RGBAColor object
|
|
2573
|
+
* @param alpha - New alpha value (0-1)
|
|
2574
|
+
* @returns New RGBAColor object with adjusted alpha
|
|
2575
|
+
*/
|
|
2576
|
+
function adjustAlpha(rgba, alpha) {
|
|
2577
|
+
const result = new RgbaColorStyle();
|
|
2578
|
+
result.r = rgba.r;
|
|
2579
|
+
result.g = rgba.g;
|
|
2580
|
+
result.b = rgba.b;
|
|
2581
|
+
result.a = Math.max(0, Math.min(1, alpha));
|
|
2582
|
+
return result;
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* Lightens an RGBA color by a percentage
|
|
2586
|
+
* @param rgba - Original RGBAColor object
|
|
2587
|
+
* @param percentage - Amount to lighten (0-100)
|
|
2588
|
+
* @returns New RGBAColor object that is lighter
|
|
2589
|
+
*/
|
|
2590
|
+
function lightenRGBA(rgba, percentage) {
|
|
2591
|
+
const amount = percentage / 100;
|
|
2592
|
+
const result = new RgbaColorStyle();
|
|
2593
|
+
result.r = Math.min(255, Math.round(rgba.r + (255 - rgba.r) * amount));
|
|
2594
|
+
result.g = Math.min(255, Math.round(rgba.g + (255 - rgba.g) * amount));
|
|
2595
|
+
result.b = Math.min(255, Math.round(rgba.b + (255 - rgba.b) * amount));
|
|
2596
|
+
result.a = rgba.a;
|
|
2597
|
+
return result;
|
|
2598
|
+
}
|
|
2599
|
+
/**
|
|
2600
|
+
* Darkens an RGBA color by a percentage
|
|
2601
|
+
* @param rgba - Original RGBAColor object
|
|
2602
|
+
* @param percentage - Amount to darken (0-100)
|
|
2603
|
+
* @returns New RGBAColor object that is darker
|
|
2604
|
+
*/
|
|
2605
|
+
function darkenRGBA(rgba, percentage) {
|
|
2606
|
+
const amount = percentage / 100;
|
|
2607
|
+
const result = new RgbaColorStyle();
|
|
2608
|
+
result.r = Math.max(0, Math.round(rgba.r * (1 - amount)));
|
|
2609
|
+
result.g = Math.max(0, Math.round(rgba.g * (1 - amount)));
|
|
2610
|
+
result.b = Math.max(0, Math.round(rgba.b * (1 - amount)));
|
|
2611
|
+
result.a = rgba.a;
|
|
2612
|
+
return result;
|
|
2613
|
+
}
|
|
2614
|
+
/**
|
|
2615
|
+
* Converts a CSS named color to hex format
|
|
2616
|
+
* @param colorName - CSS named color (case-insensitive, e.g., 'red', 'cornflowerblue')
|
|
2617
|
+
* @returns Hex color string
|
|
2618
|
+
* @throws Error if the color name is not recognized
|
|
2619
|
+
*/
|
|
2620
|
+
function namedColorToHexColor(colorName) {
|
|
2621
|
+
const hexColor = namedColorToHex(colorName);
|
|
2622
|
+
if (!hexColor) {
|
|
2623
|
+
throw new Error(`Unknown named color: ${colorName}`);
|
|
2624
|
+
}
|
|
2625
|
+
return hexColor;
|
|
2626
|
+
}
|
|
2627
|
+
/**
|
|
2628
|
+
* Converts a CSS named color to RGBA format
|
|
2629
|
+
* @param colorName - CSS named color (case-insensitive)
|
|
2630
|
+
* @returns RGBAColor object
|
|
2631
|
+
* @throws Error if the color name is not recognized
|
|
2632
|
+
*/
|
|
2633
|
+
function namedColorToRGBA(colorName) {
|
|
2634
|
+
const hexColor = namedColorToHexColor(colorName);
|
|
2635
|
+
return hexToRGBA(hexColor);
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* Checks if a string is a valid CSS named color
|
|
2639
|
+
* @param colorName - String to check
|
|
2640
|
+
* @returns True if it's a valid named color
|
|
2641
|
+
*/
|
|
2642
|
+
function isValidNamedColor(colorName) {
|
|
2643
|
+
return isNamedColor(colorName);
|
|
2644
|
+
}
|
|
2645
|
+
/**
|
|
2646
|
+
* Attempts to find the closest named color for a given hex color
|
|
2647
|
+
* @param hexColor - Hex color to match
|
|
2648
|
+
* @returns Named color string or null if no close match found
|
|
2649
|
+
*/
|
|
2650
|
+
function hexToNamedColor(hexColor) {
|
|
2651
|
+
const normalized = hexColor.toLowerCase().replace('#', '');
|
|
2652
|
+
const targetHex = normalized.length === 6 ? `#${normalized}` : null;
|
|
2653
|
+
if (!targetHex) {
|
|
2654
|
+
return null; // Can't match colors with alpha or short format
|
|
2655
|
+
}
|
|
2656
|
+
// Find exact match
|
|
2657
|
+
for (const [name, hex] of Object.entries(NAMED_COLOR_MAP)) {
|
|
2658
|
+
if (hex.toLowerCase() === targetHex.toLowerCase()) {
|
|
2659
|
+
return name;
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
return null;
|
|
2663
|
+
}
|
|
2664
|
+
/**
|
|
2665
|
+
* Attempts to find the closest named color for a given RGBA color
|
|
2666
|
+
* @param rgba - RGBAColor to match
|
|
2667
|
+
* @returns Named color string or null if no close match found
|
|
2668
|
+
*/
|
|
2669
|
+
function rgbaToNamedColor(rgba) {
|
|
2670
|
+
// Only match fully opaque colors
|
|
2671
|
+
if (rgba.a !== 1) {
|
|
2672
|
+
return null;
|
|
2673
|
+
}
|
|
2674
|
+
const hexColor = rgbaObjectToHex(rgba);
|
|
2675
|
+
return hexToNamedColor(hexColor);
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
var Justifications;
|
|
2679
|
+
(function (Justifications) {
|
|
2680
|
+
Justifications["Left"] = "left";
|
|
2681
|
+
Justifications["Right"] = "right";
|
|
2682
|
+
Justifications["Center"] = "center";
|
|
2683
|
+
Justifications["Fully"] = "fully";
|
|
2684
|
+
})(Justifications || (Justifications = {}));
|
|
2685
|
+
|
|
2686
|
+
class SizeStyle {
|
|
2687
|
+
ngOnStyle(ngStyle) {
|
|
2688
|
+
if (this.width) {
|
|
2689
|
+
if (ngStyle) {
|
|
2690
|
+
ngStyle['width'] = typeof this.width === 'number' ? `${this.width}px` : this.width;
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
if (this.height) {
|
|
2694
|
+
if (ngStyle) {
|
|
2695
|
+
ngStyle['height'] = typeof this.height === 'number' ? `${this.height}px` : this.height;
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
return ngStyle;
|
|
2699
|
+
}
|
|
2700
|
+
width;
|
|
2701
|
+
height;
|
|
2702
|
+
}
|
|
2703
|
+
const DEFAULT_SIZE = new SizeStyle();
|
|
2704
|
+
DEFAULT_SIZE.width = 100;
|
|
2705
|
+
DEFAULT_SIZE.height = 100;
|
|
2706
|
+
|
|
2707
|
+
class ImageStyle {
|
|
2708
|
+
href;
|
|
2709
|
+
justification;
|
|
2710
|
+
size;
|
|
2711
|
+
coordinates;
|
|
2712
|
+
ngOnStyle(ngStyle) {
|
|
2713
|
+
if (this.href) {
|
|
2714
|
+
ngStyle['backgroundImage'] = `url(${this.href})`;
|
|
2715
|
+
}
|
|
2716
|
+
if (this.justification) {
|
|
2717
|
+
ngStyle['backgroundPosition'] = this.justification;
|
|
2718
|
+
}
|
|
2719
|
+
if (this.size) {
|
|
2720
|
+
this.size.ngOnStyle(ngStyle);
|
|
2721
|
+
}
|
|
2722
|
+
if (this.coordinates) {
|
|
2723
|
+
this.coordinates.ngOnStyle(ngStyle);
|
|
2724
|
+
}
|
|
2725
|
+
return ngStyle;
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
const DEFAULT_IMAGE = new ImageStyle();
|
|
2729
|
+
DEFAULT_IMAGE.href = "assets/images/default-category.png";
|
|
2730
|
+
DEFAULT_IMAGE.justification = Justifications.Left;
|
|
2731
|
+
DEFAULT_IMAGE.size = DEFAULT_SIZE;
|
|
2732
|
+
DEFAULT_IMAGE.coordinates = DEFAULT_COORDINATES;
|
|
2733
|
+
|
|
2734
|
+
class TextStyle {
|
|
2735
|
+
font;
|
|
2736
|
+
textColor;
|
|
2737
|
+
backgroundColor;
|
|
2738
|
+
watermark;
|
|
2739
|
+
image;
|
|
2740
|
+
value;
|
|
2741
|
+
ngOnStyle(ngStyle) {
|
|
2742
|
+
return {
|
|
2743
|
+
...(ngStyle),
|
|
2744
|
+
...(this.font ? this.font.ngOnStyle(ngStyle) : {}),
|
|
2745
|
+
...(this.textColor ? { color: this.textColor.toCssString() } : {}),
|
|
2746
|
+
...(this.backgroundColor ? { backgroundColor: this.backgroundColor.toCssString() } : {}),
|
|
2747
|
+
...(this.image ? this.image.ngOnStyle(ngStyle) : {}),
|
|
2748
|
+
};
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
const DEFAULT_TEXT_STYLE = new TextStyle();
|
|
2752
|
+
DEFAULT_TEXT_STYLE.value = 'Default Category';
|
|
2753
|
+
DEFAULT_TEXT_STYLE.font = DEFAULT_FONT;
|
|
2754
|
+
DEFAULT_TEXT_STYLE.textColor = DEFAULT_BACKCOLOR;
|
|
2755
|
+
DEFAULT_TEXT_STYLE.backgroundColor = DEFAULT_FORECOLOR;
|
|
2756
|
+
DEFAULT_TEXT_STYLE.watermark = "Category Name";
|
|
2757
|
+
DEFAULT_TEXT_STYLE.image = DEFAULT_IMAGE;
|
|
2758
|
+
|
|
1735
2759
|
const EXAMPLE_CREATE_SUBSCRIPTION_REQUEST = {
|
|
1736
2760
|
"creditCard": {
|
|
1737
2761
|
"firstName": "John",
|
|
@@ -1757,17 +2781,56 @@ class Category {
|
|
|
1757
2781
|
id;
|
|
1758
2782
|
name;
|
|
1759
2783
|
description;
|
|
1760
|
-
|
|
1761
|
-
return
|
|
2784
|
+
toString() {
|
|
2785
|
+
return this.name;
|
|
1762
2786
|
}
|
|
1763
|
-
static
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
return
|
|
2787
|
+
static newCategory(categoryName, categoryDescription = undefined) {
|
|
2788
|
+
const category = new Category();
|
|
2789
|
+
category.name = categoryName;
|
|
2790
|
+
category.description = categoryDescription || categoryName;
|
|
2791
|
+
return category;
|
|
1768
2792
|
}
|
|
1769
2793
|
}
|
|
1770
2794
|
|
|
2795
|
+
const DEFAULT_CATEGORY_SLIDE = {
|
|
2796
|
+
name: (() => {
|
|
2797
|
+
const style = new TextStyle();
|
|
2798
|
+
style.value = 'Default Category';
|
|
2799
|
+
style.font = DEFAULT_FONT;
|
|
2800
|
+
style.textColor = ColorStyle.fromNamedColor("black");
|
|
2801
|
+
style.backgroundColor = ColorStyle.fromNamedColor("white");
|
|
2802
|
+
style.watermark = "Category Name";
|
|
2803
|
+
style.image = undefined;
|
|
2804
|
+
return style;
|
|
2805
|
+
})(),
|
|
2806
|
+
description: (() => {
|
|
2807
|
+
const style = new TextStyle();
|
|
2808
|
+
style.value = 'Default Description';
|
|
2809
|
+
style.font = DEFAULT_FONT;
|
|
2810
|
+
style.textColor = ColorStyle.fromRGB(0, 0, 0, 1);
|
|
2811
|
+
style.backgroundColor = ColorStyle.fromRGB(255, 255, 255, 1);
|
|
2812
|
+
style.watermark = "Category Description";
|
|
2813
|
+
style.image = undefined;
|
|
2814
|
+
return style;
|
|
2815
|
+
})(),
|
|
2816
|
+
picture: (() => {
|
|
2817
|
+
const image = new ImageStyle();
|
|
2818
|
+
image.href = "assets/images/default-category.png";
|
|
2819
|
+
image.justification = Justifications.Left;
|
|
2820
|
+
const coords = new CoordinatesStyle();
|
|
2821
|
+
coords.top = 0;
|
|
2822
|
+
coords.left = 0;
|
|
2823
|
+
image.coordinates = coords;
|
|
2824
|
+
const size = new SizeStyle();
|
|
2825
|
+
size.width = 100;
|
|
2826
|
+
size.height = 100;
|
|
2827
|
+
image.size = size;
|
|
2828
|
+
return image;
|
|
2829
|
+
})(),
|
|
2830
|
+
backgroundColor: ColorStyle.fromHexColor("#FFFFFF"),
|
|
2831
|
+
selected: false
|
|
2832
|
+
};
|
|
2833
|
+
|
|
1771
2834
|
var UserTypes;
|
|
1772
2835
|
(function (UserTypes) {
|
|
1773
2836
|
UserTypes["User"] = "User";
|
|
@@ -1790,43 +2853,45 @@ class Profile {
|
|
|
1790
2853
|
companyName;
|
|
1791
2854
|
promoCode;
|
|
1792
2855
|
employeeType;
|
|
1793
|
-
static
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
return
|
|
2856
|
+
static newProfile(from) {
|
|
2857
|
+
const newProfile = new Profile();
|
|
2858
|
+
newProfile.id = from.id;
|
|
2859
|
+
newProfile.displayName = from.displayName;
|
|
2860
|
+
newProfile.jobTitle = from.jobTitle;
|
|
2861
|
+
newProfile.companyName = from.companyName;
|
|
2862
|
+
newProfile.mail = from.emailAddress;
|
|
2863
|
+
newProfile.businessPhones = [from.phoneNumber];
|
|
2864
|
+
return newProfile;
|
|
1802
2865
|
}
|
|
1803
|
-
|
|
2866
|
+
toCustomer() {
|
|
1804
2867
|
const to = new Customer();
|
|
1805
|
-
to.id =
|
|
1806
|
-
to.displayName =
|
|
1807
|
-
to.jobTitle =
|
|
1808
|
-
to.companyName =
|
|
1809
|
-
to.emailAddress =
|
|
2868
|
+
to.id = this.id || "";
|
|
2869
|
+
to.displayName = this.displayName || "";
|
|
2870
|
+
to.jobTitle = this.jobTitle || "";
|
|
2871
|
+
to.companyName = this.companyName || "";
|
|
2872
|
+
to.emailAddress = this.mail || "";
|
|
1810
2873
|
to.userType = UserTypes.Administrator;
|
|
1811
2874
|
to.apiClientId = "5dd15878-aa4c-4adf-8650-b931f32a7b67";
|
|
1812
2875
|
to.apiLocationId = "10f19fc5-31d0-4d76-bad4-ad593c9803ae";
|
|
1813
2876
|
return to;
|
|
1814
2877
|
}
|
|
1815
2878
|
}
|
|
1816
|
-
const DEFAULT_PROFILE = {
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
2879
|
+
const DEFAULT_PROFILE = (() => {
|
|
2880
|
+
const profile = new Profile();
|
|
2881
|
+
profile.companyName = DEFAULT_COMPANY_NAME;
|
|
2882
|
+
profile.businessPhones = ["503.555.1212"];
|
|
2883
|
+
profile.displayName = "Demo User";
|
|
2884
|
+
profile.givenName = "Demo";
|
|
2885
|
+
profile.id = "1";
|
|
2886
|
+
profile.jobTitle = "Budtender";
|
|
2887
|
+
profile.mail = "demo@app.cheapweedmenu.com";
|
|
2888
|
+
profile.mobilePhone = "503.555.1212";
|
|
2889
|
+
profile.photoUrl = "";
|
|
2890
|
+
profile.preferredLanguage = "en-us";
|
|
2891
|
+
profile.surname = "User";
|
|
2892
|
+
profile.userPrincipalName = "demo@app.cheapweedmenu.com";
|
|
2893
|
+
return profile;
|
|
2894
|
+
})();
|
|
1830
2895
|
|
|
1831
2896
|
class Customer {
|
|
1832
2897
|
id;
|
|
@@ -27641,36 +28706,6 @@ const DEFAULT_INVENTORY_API_RESPONSE = {
|
|
|
27641
28706
|
]
|
|
27642
28707
|
};
|
|
27643
28708
|
|
|
27644
|
-
var Justifications;
|
|
27645
|
-
(function (Justifications) {
|
|
27646
|
-
Justifications["Left"] = "left";
|
|
27647
|
-
Justifications["Right"] = "right";
|
|
27648
|
-
Justifications["Center"] = "center";
|
|
27649
|
-
Justifications["Absolute"] = "absolute";
|
|
27650
|
-
})(Justifications || (Justifications = {}));
|
|
27651
|
-
|
|
27652
|
-
var LoggingVerbosity;
|
|
27653
|
-
(function (LoggingVerbosity) {
|
|
27654
|
-
LoggingVerbosity["Error"] = "Error";
|
|
27655
|
-
LoggingVerbosity["Warning"] = "Warn";
|
|
27656
|
-
LoggingVerbosity["Debug"] = "Debug";
|
|
27657
|
-
LoggingVerbosity["Information"] = "Info";
|
|
27658
|
-
LoggingVerbosity["None"] = "None";
|
|
27659
|
-
})(LoggingVerbosity || (LoggingVerbosity = {}));
|
|
27660
|
-
|
|
27661
|
-
var NamedColors;
|
|
27662
|
-
(function (NamedColors) {
|
|
27663
|
-
NamedColors["Red"] = "red";
|
|
27664
|
-
NamedColors["Green"] = "green";
|
|
27665
|
-
NamedColors["Blue"] = "blue";
|
|
27666
|
-
NamedColors["Yellow"] = "yellow";
|
|
27667
|
-
NamedColors["Black"] = "black";
|
|
27668
|
-
NamedColors["White"] = "white";
|
|
27669
|
-
})(NamedColors || (NamedColors = {}));
|
|
27670
|
-
|
|
27671
|
-
class OnElementStyle {
|
|
27672
|
-
}
|
|
27673
|
-
|
|
27674
28709
|
class Product {
|
|
27675
28710
|
id;
|
|
27676
28711
|
name;
|
|
@@ -27678,22 +28713,23 @@ class Product {
|
|
|
27678
28713
|
brand;
|
|
27679
28714
|
price;
|
|
27680
28715
|
thcPercentage;
|
|
28716
|
+
cbdPercentage;
|
|
27681
28717
|
category;
|
|
27682
28718
|
quantity;
|
|
27683
28719
|
type;
|
|
27684
28720
|
pictureURL;
|
|
27685
28721
|
terpenes;
|
|
27686
|
-
static
|
|
28722
|
+
static newProduct(from) {
|
|
27687
28723
|
const to = new Product();
|
|
27688
28724
|
to.id = from.productId;
|
|
27689
28725
|
to.name = from.productName;
|
|
27690
28726
|
to.description = from.productDescription;
|
|
27691
|
-
to.brand = from.brand;
|
|
28727
|
+
to.brand = from.brand ?? "";
|
|
27692
28728
|
to.price = from.postTaxPriceInPennies;
|
|
27693
28729
|
to.thcPercentage = 30;
|
|
27694
|
-
to.category = from.category;
|
|
28730
|
+
to.category = Category.newCategory(from.category ?? "Uncategorized");
|
|
27695
28731
|
to.quantity = from.quantity;
|
|
27696
|
-
to.pictureURL = from.productPictureURL;
|
|
28732
|
+
to.pictureURL = from.productPictureURL ?? undefined;
|
|
27697
28733
|
to.terpenes = from.terpenes;
|
|
27698
28734
|
return to;
|
|
27699
28735
|
}
|
|
@@ -27707,10 +28743,10 @@ class SafeHtmlPipe {
|
|
|
27707
28743
|
transform(value) {
|
|
27708
28744
|
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
27709
28745
|
}
|
|
27710
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
27711
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
28746
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
28747
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "safeHtml" });
|
|
27712
28748
|
}
|
|
27713
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
28749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
27714
28750
|
type: Pipe,
|
|
27715
28751
|
args: [{
|
|
27716
28752
|
name: 'safeHtml',
|
|
@@ -27719,8 +28755,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
27719
28755
|
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
|
|
27720
28756
|
|
|
27721
28757
|
class CwmSharedModule {
|
|
27722
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
27723
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
|
28758
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CwmSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
28759
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: CwmSharedModule, declarations: [ExternalNavigationComponent,
|
|
27724
28760
|
NavigateToRouteComponent,
|
|
27725
28761
|
PageNotFoundComponent,
|
|
27726
28762
|
SafeHtmlPipe], imports: [CommonModule,
|
|
@@ -27734,7 +28770,7 @@ class CwmSharedModule {
|
|
|
27734
28770
|
NavigateToRouteComponent,
|
|
27735
28771
|
PageNotFoundComponent,
|
|
27736
28772
|
SafeHtmlPipe] });
|
|
27737
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
|
28773
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CwmSharedModule, imports: [CommonModule,
|
|
27738
28774
|
RouterModule,
|
|
27739
28775
|
MsalModule,
|
|
27740
28776
|
BrowserModule,
|
|
@@ -27742,7 +28778,7 @@ class CwmSharedModule {
|
|
|
27742
28778
|
RouterModule,
|
|
27743
28779
|
MsalModule] });
|
|
27744
28780
|
}
|
|
27745
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
28781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CwmSharedModule, decorators: [{
|
|
27746
28782
|
type: NgModule,
|
|
27747
28783
|
args: [{
|
|
27748
28784
|
declarations: [
|
|
@@ -27924,10 +28960,10 @@ class ConfigService {
|
|
|
27924
28960
|
this.logger.info("Saved Configuration to Azure App Configuration");
|
|
27925
28961
|
this.logger.methodName = "";
|
|
27926
28962
|
}
|
|
27927
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
27928
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
28963
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ConfigService, deps: [{ token: AUTH_CONFIG }, { token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
28964
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ConfigService, providedIn: 'root' });
|
|
27929
28965
|
}
|
|
27930
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
28966
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ConfigService, decorators: [{
|
|
27931
28967
|
type: Injectable,
|
|
27932
28968
|
args: [{
|
|
27933
28969
|
providedIn: 'root'
|
|
@@ -27958,10 +28994,10 @@ class BaseApiService {
|
|
|
27958
28994
|
this.httpClient = httpClient;
|
|
27959
28995
|
this.logger = logger;
|
|
27960
28996
|
}
|
|
27961
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
27962
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
28997
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: BaseApiService, deps: [{ token: DOCUMENT }, { token: ConfigService }, { token: i2$1.HttpClient }, { token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
28998
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: BaseApiService, providedIn: 'root' });
|
|
27963
28999
|
}
|
|
27964
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
29000
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: BaseApiService, decorators: [{
|
|
27965
29001
|
type: Injectable,
|
|
27966
29002
|
args: [{
|
|
27967
29003
|
providedIn: 'root'
|
|
@@ -28014,23 +29050,23 @@ class InventoryApiService extends BaseApiService {
|
|
|
28014
29050
|
if (productApiResponse.status != HttpStatusCode.Ok) {
|
|
28015
29051
|
throw new Error(`ProductApiResponse status: ${productApiResponse.status}`);
|
|
28016
29052
|
}
|
|
28017
|
-
const allProducts = productApiResponse.data.map((value) => Product.
|
|
28018
|
-
.sort((a, b) => a.category.localeCompare(b.category));
|
|
29053
|
+
const allProducts = productApiResponse.data.map((value) => Product.newProduct(value))
|
|
29054
|
+
.sort((a, b) => a.category.name.localeCompare(b.category.name));
|
|
28019
29055
|
const allCategories = keys(countBy(allProducts, (product) => product.category))
|
|
28020
|
-
.map((category) => Category.
|
|
29056
|
+
.map((category) => Category.newCategory(category));
|
|
28021
29057
|
const productsByAllCategories = [];
|
|
28022
29058
|
allCategories.sort().forEach(category => productsByAllCategories.push({
|
|
28023
29059
|
key: category.name,
|
|
28024
|
-
value: allProducts.filter((product) => product.category === category.name &&
|
|
29060
|
+
value: allProducts.filter((product) => product.category.name === category.name &&
|
|
28025
29061
|
product.quantity > 0).sort()
|
|
28026
29062
|
}));
|
|
28027
29063
|
return productsByAllCategories;
|
|
28028
29064
|
}
|
|
28029
29065
|
;
|
|
28030
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
28031
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
29066
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: InventoryApiService, deps: [{ token: DOCUMENT }, { token: ConfigService }, { token: i2$1.HttpClient }, { token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29067
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: InventoryApiService, providedIn: 'root' });
|
|
28032
29068
|
}
|
|
28033
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
29069
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: InventoryApiService, decorators: [{
|
|
28034
29070
|
type: Injectable,
|
|
28035
29071
|
args: [{
|
|
28036
29072
|
providedIn: 'root'
|
|
@@ -28311,10 +29347,10 @@ class LocalStorageService {
|
|
|
28311
29347
|
this.initEvent.complete();
|
|
28312
29348
|
});
|
|
28313
29349
|
}
|
|
28314
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
28315
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
29350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29351
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LocalStorageService, providedIn: 'root' });
|
|
28316
29352
|
}
|
|
28317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
29353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LocalStorageService, decorators: [{
|
|
28318
29354
|
type: Injectable,
|
|
28319
29355
|
args: [{
|
|
28320
29356
|
providedIn: 'root'
|
|
@@ -28413,10 +29449,10 @@ class LogService {
|
|
|
28413
29449
|
console.error(this.prefix + " Error: " + message, optionalParams);
|
|
28414
29450
|
}
|
|
28415
29451
|
}
|
|
28416
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
28417
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
29452
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29453
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LogService, providedIn: 'root' });
|
|
28418
29454
|
}
|
|
28419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
29455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LogService, decorators: [{
|
|
28420
29456
|
type: Injectable,
|
|
28421
29457
|
args: [{
|
|
28422
29458
|
providedIn: 'root'
|
|
@@ -28446,10 +29482,10 @@ class SubscriptionApiService extends BaseApiService {
|
|
|
28446
29482
|
this.logger.endOfMethod();
|
|
28447
29483
|
}
|
|
28448
29484
|
}
|
|
28449
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
28450
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
29485
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SubscriptionApiService, deps: [{ token: DOCUMENT }, { token: ConfigService }, { token: i2$1.HttpClient }, { token: ClassLoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29486
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SubscriptionApiService, providedIn: 'root' });
|
|
28451
29487
|
}
|
|
28452
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
29488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SubscriptionApiService, decorators: [{
|
|
28453
29489
|
type: Injectable,
|
|
28454
29490
|
args: [{
|
|
28455
29491
|
providedIn: 'root'
|
|
@@ -28468,5 +29504,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
28468
29504
|
* Generated bundle index. Do not edit.
|
|
28469
29505
|
*/
|
|
28470
29506
|
|
|
28471
|
-
export { API_CONFIG_SCHEMA, AUTH_CONFIG, AUTH_CONFIG_SCHEMA, BaseApiService, CAROUSEL_CONFIG_SCHEMA, CONFIGURATION_SCHEMA, Category, ClassLoggerService, ConfigService, Customer, CwmSharedModule, DEFAULT_API_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CAROUSEL_CONFIG, DEFAULT_COMPANY_NAME, DEFAULT_CONFIGURATION, DEFAULT_CUSTOMER, DEFAULT_INVENTORY_API_RESPONSE, DEFAULT_MENU_BOARD_CONFIG, DEFAULT_PROFILE, DEFAULT_SLIDE, DEFAULT_SUBSCRIPTION_CONFIG, DbKeys, EXAMPLE_CREATE_SUBSCRIPTION_REQUEST, ExternalNavigationComponent, InventoryApiService, Justifications, LocalStorageService, LogService,
|
|
29507
|
+
export { API_CONFIG_SCHEMA, AUTH_CONFIG, AUTH_CONFIG_SCHEMA, BaseApiService, CAROUSEL_CONFIG_SCHEMA, CONFIGURATION_SCHEMA, Category, ClassLoggerService, ColorStyle, ConfigService, CoordinatesStyle, Customer, CwmSharedModule, DEFAULT_API_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_BACKCOLOR, DEFAULT_CAROUSEL_CONFIG, DEFAULT_CATEGORY_SLIDE, DEFAULT_COMPANY_NAME, DEFAULT_CONFIGURATION, DEFAULT_COORDINATES, DEFAULT_CUSTOMER, DEFAULT_FONT, DEFAULT_FORECOLOR, DEFAULT_IMAGE, DEFAULT_INVENTORY_API_RESPONSE, DEFAULT_MENU_BOARD_CONFIG, DEFAULT_PROFILE, DEFAULT_SIZE, DEFAULT_SLIDE, DEFAULT_SUBSCRIPTION_CONFIG, DEFAULT_TEXT_STYLE, DbKeys, EXAMPLE_CREATE_SUBSCRIPTION_REQUEST, ExternalNavigationComponent, FontStyle, ImageStyle, InventoryApiService, Justifications, LocalStorageService, LogService, MENU_BOARD_CONFIG_SCHEMA, MockConfig, MockCustomer, MockInventoryApiResponse, MockProfile, NavigateToRouteComponent, PageNotFoundComponent, Product, Profile, RgbaColorStyle, SLIDE_SCHEMA, SUBSCRIPTION_CONFIG_SCHEMA, SafeHtmlPipe, SizeStyle, Stack, SubscriptionApiService, TextStyle, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, adjustAlpha, cloneRGBA, createRGBA, cssStringToRGBA, darkenRGBA, decodeToken, doWithLock, hexToNamedColor, hexToRGBA, isTokenValid, isValidNamedColor, lightenRGBA, msalGuardConfigFactory, msalInstanceFactory, msalInterceptorConfigFactory, namedColorToHexColor, namedColorToRGBA, rgbaEquals, rgbaObjectToHex, rgbaToCssString, rgbaToHex, rgbaToNamedColor, waitFor };
|
|
28472
29508
|
//# sourceMappingURL=transcommerce-cwm-shared.mjs.map
|