@posiwise/utils 0.0.144 → 0.0.145

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.
@@ -1,1029 +1,1345 @@
1
- import Quill from 'quill';
2
- import * as ImageResize from 'quill-resize-image';
3
- import 'reflect-metadata';
4
- import * as i3 from '@angular/common';
5
- import { CommonModule } from '@angular/common';
6
- import * as i0 from '@angular/core';
7
- import { EventEmitter, Input, Output, Component, DOCUMENT, Inject, NgModule, HostListener, ViewChild } from '@angular/core';
8
- import { FormsModule } from '@angular/forms';
9
- import * as i4 from '@angular/router';
10
- import { RouterModule } from '@angular/router';
11
- import * as i1$2 from '@posiwise/admin-module-utils';
12
- import { AdminModuleUtilsModule } from '@posiwise/admin-module-utils';
13
- import { CoreTranslocoModule } from '@posiwise/core-transloco';
14
- import * as i2 from '@posiwise/directives';
15
- import { DirectivesModule } from '@posiwise/directives';
16
- import { PipesModule } from '@posiwise/pipes';
17
- import * as i1$1 from '@ng-bootstrap/ng-bootstrap';
18
- import { NgbModalModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
19
- import * as i1 from 'ngx-image-cropper';
20
- import { ImageCropperModule } from 'ngx-image-cropper';
21
- import { ButtonModule } from 'primeng/button';
22
- import * as i2$1 from 'primeng/tooltip';
23
- import { TooltipModule } from 'primeng/tooltip';
24
- import { AppBaseComponent } from '@posiwise/app-base-component';
25
- import { HelperService } from '@posiwise/helper-service';
26
- import * as i5 from '@jsverse/transloco';
27
-
28
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
- const BlockEmbed = Quill.import('formats/image');
30
- class NoDragImage extends BlockEmbed {
31
- static create(value) {
32
- const node = super.create();
33
- node.setAttribute('src', value.url);
34
- node.setAttribute('alt', value.alt || '');
35
- node.setAttribute('class', 'no-drag-image');
36
- node.setAttribute('draggable', 'false');
37
- node.style.width = value.width || '300px'; // Default width
38
- node.style.height = value.height || 'auto';
39
- if (value.align) {
40
- switch (value.align) {
41
- case 'left':
42
- node.style.float = 'left';
43
- node.style.marginRight = '1em';
44
- break;
45
- case 'right':
46
- node.style.float = 'right';
47
- node.style.marginLeft = '1em';
48
- break;
49
- case 'center':
50
- node.style.display = 'block';
51
- node.style.marginLeft = 'auto';
52
- node.style.marginRight = 'auto';
53
- break;
54
- default:
55
- node.style.float = 'none';
56
- }
57
- }
58
- return node;
59
- }
60
- static value(node) {
61
- return {
62
- url: node.getAttribute('src'),
63
- alt: node.getAttribute('alt'),
64
- width: node.getAttribute('data-width') || node.style.width,
65
- height: node.getAttribute('data-height') || node.style.height,
66
- align: node.style.float || 'center'
67
- };
68
- }
1
+ import Quill from "quill";
2
+ import * as ImageResize from "quill-resize-image";
3
+ import "reflect-metadata";
4
+ import * as i3 from "@angular/common";
5
+ import { CommonModule } from "@angular/common";
6
+ import * as i0 from "@angular/core";
7
+ import { Component, DOCUMENT, EventEmitter, HostListener, Inject, Input, NgModule, Output, ViewChild } from "@angular/core";
8
+ import { FormsModule } from "@angular/forms";
9
+ import * as i4 from "@angular/router";
10
+ import { RouterModule } from "@angular/router";
11
+ import * as i1 from "@posiwise/admin-module-utils";
12
+ import { AdminModuleUtilsModule } from "@posiwise/admin-module-utils";
13
+ import { CoreTranslocoModule } from "@posiwise/core-transloco";
14
+ import * as i2$1 from "@posiwise/directives";
15
+ import { DirectivesModule } from "@posiwise/directives";
16
+ import { PipesModule } from "@posiwise/pipes";
17
+ import * as i1$1 from "@ng-bootstrap/ng-bootstrap";
18
+ import { NgbModalModule, NgbTooltipModule } from "@ng-bootstrap/ng-bootstrap";
19
+ import * as i1$2 from "ngx-image-cropper";
20
+ import { ImageCropperComponent } from "ngx-image-cropper";
21
+ import { ButtonModule } from "primeng/button";
22
+ import * as i2 from "primeng/tooltip";
23
+ import { TooltipModule } from "primeng/tooltip";
24
+ import { AppBaseComponent } from "@posiwise/app-base-component";
25
+ import { HelperService } from "@posiwise/helper-service";
26
+ import * as i5 from "@jsverse/transloco";
27
+ const DATA_URI_IMAGE = /^data:image\//i;
28
+ const PASTED_IMAGE_MESSAGE = "That image was pasted, so it would be stored inside the article itself rather than on the image host — which makes the page much heavier for every reader. Upload the image somewhere first, then use the image button in the toolbar to add it by URL.";
29
+ function clipboardHasImageFile(clipboardData) {
30
+ if (!clipboardData) return false;
31
+ if (Array.from(clipboardData.items ?? []).some((item) => item.kind === "file" && item.type?.startsWith("image/"))) return true;
32
+ return Array.from(clipboardData.files ?? []).some((file) => file.type?.startsWith("image/"));
69
33
  }
70
- class NoDragDrop {
71
- constructor(quill, _options) {
72
- quill.root.addEventListener('drop', this.handleDrop.bind(this, quill));
73
- quill.root.addEventListener('dragover', this.preventDefault);
74
- }
75
- preventDefault(e) {
76
- e.preventDefault();
77
- e.stopPropagation();
78
- }
79
- handleDrop(quill, e) {
80
- this.preventDefault(e);
81
- // Create a MutationObserver to detect inserted images
82
- const observer = new MutationObserver(mutations => {
83
- this.removeInsertedImages(quill, mutations);
84
- });
85
- // Start observing for added nodes
86
- observer.observe(quill.root, { childList: true, subtree: true });
87
- // Stop observing after a short delay
88
- setTimeout(() => {
89
- observer.disconnect();
90
- }, 1000); // Adjust the timeout as needed
91
- }
92
- removeInsertedImages(quill, mutations) {
93
- mutations.forEach(mutation => {
94
- mutation.addedNodes.forEach(node => {
95
- if (node instanceof HTMLImageElement) {
96
- node.remove();
97
- }
98
- else if (node.nodeType === Node.ELEMENT_NODE) {
99
- node.querySelectorAll('img').forEach(img => img.remove());
100
- }
101
- });
102
- });
103
- }
34
+ function isEmbeddedImageSrc(src) {
35
+ return DATA_URI_IMAGE.test((src ?? "").trim());
104
36
  }
105
- NoDragImage['blotName'] = 'no-drag-image';
106
- NoDragImage['tagName'] = 'img';
37
+ var PasteGuard = class {
38
+ constructor(quill, options) {
39
+ this.notify = options?.onBlocked ?? ((message) => globalThis.alert?.(message));
40
+ quill.root.addEventListener("paste", (event) => this.handlePaste(event), true);
41
+ const Delta = Quill.import("delta");
42
+ quill.clipboard.addMatcher("IMG", (node, delta) => {
43
+ if (!isEmbeddedImageSrc(node instanceof Element ? node.getAttribute("src") : null)) return delta;
44
+ this.notify(PASTED_IMAGE_MESSAGE);
45
+ return new Delta();
46
+ });
47
+ }
48
+ handlePaste(event) {
49
+ if (!clipboardHasImageFile(event.clipboardData)) return;
50
+ event.preventDefault();
51
+ event.stopPropagation();
52
+ this.notify(PASTED_IMAGE_MESSAGE);
53
+ }
54
+ };
55
+ const BlockEmbed = Quill.import("formats/image");
56
+ var NoDragImage = class extends BlockEmbed {
57
+ static create(value) {
58
+ const node = super.create();
59
+ node.setAttribute("src", value.url);
60
+ node.setAttribute("alt", value.alt || "");
61
+ node.setAttribute("class", "no-drag-image");
62
+ node.setAttribute("draggable", "false");
63
+ node.style.width = value.width || "300px";
64
+ node.style.height = value.height || "auto";
65
+ if (value.align) switch (value.align) {
66
+ case "left":
67
+ node.style.float = "left";
68
+ node.style.marginRight = "1em";
69
+ break;
70
+ case "right":
71
+ node.style.float = "right";
72
+ node.style.marginLeft = "1em";
73
+ break;
74
+ case "center":
75
+ node.style.display = "block";
76
+ node.style.marginLeft = "auto";
77
+ node.style.marginRight = "auto";
78
+ break;
79
+ default: node.style.float = "none";
80
+ }
81
+ return node;
82
+ }
83
+ static value(node) {
84
+ return {
85
+ url: node.getAttribute("src"),
86
+ alt: node.getAttribute("alt"),
87
+ width: node.getAttribute("data-width") || node.style.width,
88
+ height: node.getAttribute("data-height") || node.style.height,
89
+ align: node.style.float || "center"
90
+ };
91
+ }
92
+ };
93
+ var NoDragDrop = class {
94
+ constructor(quill, _options) {
95
+ quill.root.addEventListener("drop", this.handleDrop.bind(this, quill));
96
+ quill.root.addEventListener("dragover", this.preventDefault);
97
+ }
98
+ preventDefault(e) {
99
+ e.preventDefault();
100
+ e.stopPropagation();
101
+ }
102
+ handleDrop(quill, e) {
103
+ this.preventDefault(e);
104
+ const observer = new MutationObserver((mutations) => {
105
+ this.removeInsertedImages(quill, mutations);
106
+ });
107
+ observer.observe(quill.root, {
108
+ childList: true,
109
+ subtree: true
110
+ });
111
+ setTimeout(() => {
112
+ observer.disconnect();
113
+ }, 1e3);
114
+ }
115
+ removeInsertedImages(quill, mutations) {
116
+ mutations.forEach((mutation) => {
117
+ mutation.addedNodes.forEach((node) => {
118
+ if (node instanceof HTMLImageElement) node.remove();
119
+ else if (node.nodeType === Node.ELEMENT_NODE) node.querySelectorAll("img").forEach((img) => img.remove());
120
+ });
121
+ });
122
+ }
123
+ };
124
+ NoDragImage["blotName"] = "no-drag-image";
125
+ NoDragImage["tagName"] = "img";
107
126
  Quill.register(NoDragImage);
108
- Quill.register('modules/noDragDrop', NoDragDrop);
109
- Quill.register('modules/imageResize', ImageResize.default || ImageResize);
110
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
- const BlockEmbedVideo = Quill.import('blots/block/embed');
112
- class NoDragVideo extends BlockEmbedVideo {
113
- static create(value) {
114
- const node = document.createElement('iframe');
115
- node.setAttribute('src', value.url);
116
- node.setAttribute('frameborder', '0');
117
- node.setAttribute('allowfullscreen', 'true');
118
- node.setAttribute('width', value.width || '100%'); // Default width
119
- node.setAttribute('height', value.height || '200px'); // Default height
120
- node.setAttribute('class', 'no-drag-media');
121
- node.setAttribute('contenteditable', 'false'); // Prevent content from being editable
122
- // Add proper allow attribute for YouTube and other video embeds
123
- if (value.url && (value.url.includes('youtube.com') || value.url.includes('youtu.be'))) {
124
- node.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share');
125
- // Ensure YouTube embed URL format is correct
126
- if (value.url &&
127
- !value.url.includes('youtube-nocookie.com') &&
128
- !value.url.includes('enablejsapi=1')) {
129
- try {
130
- const url = new URL(value.url);
131
- url.searchParams.set('enablejsapi', '1');
132
- if (typeof window !== 'undefined' && window.location) {
133
- url.searchParams.set('origin', window.location.origin);
134
- }
135
- node.setAttribute('src', url.toString());
136
- }
137
- catch {
138
- // If URL parsing fails, keep original src and just add query params manually
139
- const separator = value.url.includes('?') ? '&' : '?';
140
- node.setAttribute('src', `${value.url}${separator}enablejsapi=1`);
141
- }
142
- }
143
- }
144
- else if (value.url && value.url.includes('loom.com')) {
145
- node.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture');
146
- }
147
- else {
148
- // Default allow for other iframes
149
- node.setAttribute('allow', 'fullscreen');
150
- }
151
- // Create a container for both video/iframe and buttons
152
- const container = document.createElement('div');
153
- container.setAttribute('class', 'media-container');
154
- container.style.position = 'relative';
155
- container.style.width = '100%';
156
- container.style.height = 'auto';
157
- container.appendChild(node); // Append video/iframe to the container
158
- // Append remove button so video can be deleted after save/update (backspace often doesn't work on reloaded content)
159
- if (!container.querySelector('.media-remove-button')) {
160
- const removeButton = this.createRemoveButton(container);
161
- removeButton.setAttribute('contenteditable', 'false');
162
- container.appendChild(removeButton);
163
- }
164
- // Append align buttons if not already present
165
- if (!container.querySelector('.media-align-buttons')) {
166
- const alignButtons = this.createAlignButtons(container);
167
- alignButtons.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable
168
- container.appendChild(alignButtons);
169
- }
170
- // Append resize buttons if not already present
171
- if (!container.querySelector('.media-resize-buttons')) {
172
- const resizeButtons = this.createResizeButtons(container);
173
- resizeButtons.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable
174
- container.appendChild(resizeButtons);
175
- }
176
- container.setAttribute('contenteditable', 'false'); // Prevent the entire container from being editable
177
- return container;
178
- }
179
- static createAlignButtons(container) {
180
- const buttonContainer = document.createElement('div');
181
- buttonContainer.setAttribute('class', 'media-align-buttons');
182
- buttonContainer.style.position = 'absolute';
183
- buttonContainer.style.top = '0';
184
- buttonContainer.style.right = '0';
185
- buttonContainer.style.display = 'flex';
186
- buttonContainer.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable
187
- const leftButton = this.createButton('Left', () => {
188
- container.style.textAlign = 'left';
189
- container.setAttribute('data-align', 'left'); // Save alignment
190
- });
191
- const centerButton = this.createButton('Center', () => {
192
- container.style.textAlign = 'center';
193
- container.setAttribute('data-align', 'center'); // Save alignment
194
- });
195
- const rightButton = this.createButton('Right', () => {
196
- container.style.textAlign = 'right';
197
- container.setAttribute('data-align', 'right'); // Save alignment
198
- });
199
- buttonContainer.appendChild(leftButton);
200
- buttonContainer.appendChild(centerButton);
201
- buttonContainer.appendChild(rightButton);
202
- return buttonContainer;
203
- }
204
- static createRemoveButton(container) {
205
- const wrapper = document.createElement('div');
206
- wrapper.setAttribute('class', 'media-remove-button');
207
- wrapper.style.position = 'absolute';
208
- wrapper.style.top = '0';
209
- wrapper.style.left = '0';
210
- wrapper.style.display = 'flex';
211
- wrapper.setAttribute('contenteditable', 'false');
212
- const removeButton = this.createButton('Remove', () => {
213
- const mediaContainer = container.classList.contains('media-container')
214
- ? container
215
- : container.closest('.media-container');
216
- if (mediaContainer) {
217
- const blot = Quill.find(mediaContainer);
218
- if (blot && 'remove' in blot && typeof blot.remove === 'function') {
219
- blot.remove();
220
- }
221
- else {
222
- // Content loaded from saved HTML may not be a Quill blot; remove from DOM so save persists the change
223
- mediaContainer.remove();
224
- }
225
- }
226
- });
227
- removeButton.style.background = 'rgb(243, 67, 67)';
228
- removeButton.style.color = 'white';
229
- removeButton.style.border = 'none';
230
- removeButton.style.padding = '2px 8px';
231
- removeButton.style.marginTop = '2px';
232
- removeButton.style.borderRadius = '4px';
233
- removeButton.title = 'Remove video';
234
- wrapper.appendChild(removeButton);
235
- return wrapper;
236
- }
237
- static createResizeButtons(container) {
238
- const buttonContainer = document.createElement('div');
239
- buttonContainer.setAttribute('class', 'media-resize-buttons');
240
- buttonContainer.style.position = 'absolute';
241
- buttonContainer.style.bottom = '5px'; // Adjust position above the bottom edge
242
- buttonContainer.style.right = '5px';
243
- buttonContainer.style.display = 'flex';
244
- buttonContainer.setAttribute('contenteditable', 'false'); // Prevent buttons from being editable
245
- const updateWidthAndHeight = (mediaElement, width, height) => {
246
- mediaElement.style.width = width;
247
- mediaElement.style.height = height;
248
- container.setAttribute('data-width', width); // Save width
249
- container.setAttribute('data-height', height); // Save height
250
- };
251
- const increaseWidthButton = this.createButton('Increase Width', () => {
252
- const mediaElement = container.querySelector('.no-drag-media');
253
- const currentWidth = parseInt(mediaElement.style.width || '100%');
254
- updateWidthAndHeight(mediaElement, `${currentWidth + 20}px`, mediaElement.style.height);
255
- });
256
- const decreaseWidthButton = this.createButton('Decrease Width', () => {
257
- const mediaElement = container.querySelector('.no-drag-media');
258
- const currentWidth = parseInt(mediaElement.style.width || '100%');
259
- updateWidthAndHeight(mediaElement, `${Math.max(100, currentWidth - 20)}px`, mediaElement.style.height);
260
- });
261
- const increaseHeightButton = this.createButton('Increase Height', () => {
262
- const mediaElement = container.querySelector('.no-drag-media');
263
- const currentHeight = parseInt(mediaElement.style.height || '200px'); // Default height
264
- updateWidthAndHeight(mediaElement, mediaElement.style.width, `${currentHeight + 20}px`);
265
- });
266
- const decreaseHeightButton = this.createButton('Decrease Height', () => {
267
- const mediaElement = container.querySelector('.no-drag-media');
268
- const currentHeight = parseInt(mediaElement.style.height || '200px'); // Default height
269
- updateWidthAndHeight(mediaElement, mediaElement.style.width, `${Math.max(100, currentHeight - 20)}px`);
270
- });
271
- buttonContainer.appendChild(increaseWidthButton);
272
- buttonContainer.appendChild(decreaseWidthButton);
273
- buttonContainer.appendChild(increaseHeightButton);
274
- buttonContainer.appendChild(decreaseHeightButton);
275
- return buttonContainer;
276
- }
277
- static createButton(label, onClick) {
278
- const button = document.createElement('button');
279
- button.innerHTML = label;
280
- button.style.margin = '0 5px';
281
- button.style.cursor = 'pointer';
282
- // Prevent Quill from treating this as part of the content
283
- button.setAttribute('contenteditable', 'false');
284
- button.style.pointerEvents = 'auto'; // Allow button clicks but don't let Quill interact with them
285
- button.onclick = event => {
286
- event.preventDefault(); // Prevent default action
287
- event.stopPropagation(); // Prevent the event from bubbling up and being interpreted by Quill
288
- onClick(); // Execute the button's action
289
- };
290
- return button;
291
- }
292
- static value(container) {
293
- const iframe = container.querySelector('iframe');
294
- return {
295
- url: iframe?.getAttribute('src'),
296
- width: container.getAttribute('data-width') || iframe?.getAttribute('width'),
297
- height: container.getAttribute('data-height') || iframe?.getAttribute('height'),
298
- align: container.getAttribute('data-align') || 'center' // Default to center if no alignment
299
- };
300
- }
301
- }
302
- NoDragVideo['blotName'] = 'no-drag-video';
303
- NoDragVideo['tagName'] = 'div'; // TagName is set to div to hold buttons
127
+ Quill.register("modules/noDragDrop", NoDragDrop);
128
+ Quill.register("modules/imageResize", ImageResize.default || ImageResize);
129
+ const BlockEmbedVideo = Quill.import("blots/block/embed");
130
+ var NoDragVideo = class extends BlockEmbedVideo {
131
+ static create(value) {
132
+ const node = document.createElement("iframe");
133
+ node.setAttribute("src", value.url);
134
+ node.setAttribute("frameborder", "0");
135
+ node.setAttribute("allowfullscreen", "true");
136
+ node.setAttribute("width", value.width || "100%");
137
+ node.setAttribute("height", value.height || "200px");
138
+ node.setAttribute("class", "no-drag-media");
139
+ node.setAttribute("contenteditable", "false");
140
+ if (value.url && (value.url.includes("youtube.com") || value.url.includes("youtu.be"))) {
141
+ node.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");
142
+ if (value.url && !value.url.includes("youtube-nocookie.com") && !value.url.includes("enablejsapi=1")) try {
143
+ const url = new URL(value.url);
144
+ url.searchParams.set("enablejsapi", "1");
145
+ if (typeof window !== "undefined" && window.location) url.searchParams.set("origin", window.location.origin);
146
+ node.setAttribute("src", url.toString());
147
+ } catch {
148
+ const separator = value.url.includes("?") ? "&" : "?";
149
+ node.setAttribute("src", `${value.url}${separator}enablejsapi=1`);
150
+ }
151
+ } else if (value.url && value.url.includes("loom.com")) node.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");
152
+ else node.setAttribute("allow", "fullscreen");
153
+ const container = document.createElement("div");
154
+ container.setAttribute("class", "media-container");
155
+ container.style.position = "relative";
156
+ container.style.width = "100%";
157
+ container.style.height = "auto";
158
+ container.appendChild(node);
159
+ if (!container.querySelector(".media-remove-button")) {
160
+ const removeButton = this.createRemoveButton(container);
161
+ removeButton.setAttribute("contenteditable", "false");
162
+ container.appendChild(removeButton);
163
+ }
164
+ if (!container.querySelector(".media-align-buttons")) {
165
+ const alignButtons = this.createAlignButtons(container);
166
+ alignButtons.setAttribute("contenteditable", "false");
167
+ container.appendChild(alignButtons);
168
+ }
169
+ if (!container.querySelector(".media-resize-buttons")) {
170
+ const resizeButtons = this.createResizeButtons(container);
171
+ resizeButtons.setAttribute("contenteditable", "false");
172
+ container.appendChild(resizeButtons);
173
+ }
174
+ container.setAttribute("contenteditable", "false");
175
+ return container;
176
+ }
177
+ static createAlignButtons(container) {
178
+ const buttonContainer = document.createElement("div");
179
+ buttonContainer.setAttribute("class", "media-align-buttons");
180
+ buttonContainer.style.position = "absolute";
181
+ buttonContainer.style.top = "0";
182
+ buttonContainer.style.right = "0";
183
+ buttonContainer.style.display = "flex";
184
+ buttonContainer.setAttribute("contenteditable", "false");
185
+ const leftButton = this.createButton("Left", () => {
186
+ container.style.textAlign = "left";
187
+ container.setAttribute("data-align", "left");
188
+ });
189
+ const centerButton = this.createButton("Center", () => {
190
+ container.style.textAlign = "center";
191
+ container.setAttribute("data-align", "center");
192
+ });
193
+ const rightButton = this.createButton("Right", () => {
194
+ container.style.textAlign = "right";
195
+ container.setAttribute("data-align", "right");
196
+ });
197
+ buttonContainer.appendChild(leftButton);
198
+ buttonContainer.appendChild(centerButton);
199
+ buttonContainer.appendChild(rightButton);
200
+ return buttonContainer;
201
+ }
202
+ static createRemoveButton(container) {
203
+ const wrapper = document.createElement("div");
204
+ wrapper.setAttribute("class", "media-remove-button");
205
+ wrapper.style.position = "absolute";
206
+ wrapper.style.top = "0";
207
+ wrapper.style.left = "0";
208
+ wrapper.style.display = "flex";
209
+ wrapper.setAttribute("contenteditable", "false");
210
+ const removeButton = this.createButton("Remove", () => {
211
+ const mediaContainer = container.classList.contains("media-container") ? container : container.closest(".media-container");
212
+ if (mediaContainer) {
213
+ const blot = Quill.find(mediaContainer);
214
+ if (blot && "remove" in blot && typeof blot.remove === "function") blot.remove();
215
+ else mediaContainer.remove();
216
+ }
217
+ });
218
+ removeButton.style.background = "rgb(243, 67, 67)";
219
+ removeButton.style.color = "white";
220
+ removeButton.style.border = "none";
221
+ removeButton.style.padding = "2px 8px";
222
+ removeButton.style.marginTop = "2px";
223
+ removeButton.style.borderRadius = "4px";
224
+ removeButton.title = "Remove video";
225
+ wrapper.appendChild(removeButton);
226
+ return wrapper;
227
+ }
228
+ static createResizeButtons(container) {
229
+ const buttonContainer = document.createElement("div");
230
+ buttonContainer.setAttribute("class", "media-resize-buttons");
231
+ buttonContainer.style.position = "absolute";
232
+ buttonContainer.style.bottom = "5px";
233
+ buttonContainer.style.right = "5px";
234
+ buttonContainer.style.display = "flex";
235
+ buttonContainer.setAttribute("contenteditable", "false");
236
+ const updateWidthAndHeight = (mediaElement, width, height) => {
237
+ mediaElement.style.width = width;
238
+ mediaElement.style.height = height;
239
+ container.setAttribute("data-width", width);
240
+ container.setAttribute("data-height", height);
241
+ };
242
+ const increaseWidthButton = this.createButton("Increase Width", () => {
243
+ const mediaElement = container.querySelector(".no-drag-media");
244
+ const currentWidth = parseInt(mediaElement.style.width || "100%");
245
+ updateWidthAndHeight(mediaElement, `${currentWidth + 20}px`, mediaElement.style.height);
246
+ });
247
+ const decreaseWidthButton = this.createButton("Decrease Width", () => {
248
+ const mediaElement = container.querySelector(".no-drag-media");
249
+ const currentWidth = parseInt(mediaElement.style.width || "100%");
250
+ updateWidthAndHeight(mediaElement, `${Math.max(100, currentWidth - 20)}px`, mediaElement.style.height);
251
+ });
252
+ const increaseHeightButton = this.createButton("Increase Height", () => {
253
+ const mediaElement = container.querySelector(".no-drag-media");
254
+ const currentHeight = parseInt(mediaElement.style.height || "200px");
255
+ updateWidthAndHeight(mediaElement, mediaElement.style.width, `${currentHeight + 20}px`);
256
+ });
257
+ const decreaseHeightButton = this.createButton("Decrease Height", () => {
258
+ const mediaElement = container.querySelector(".no-drag-media");
259
+ const currentHeight = parseInt(mediaElement.style.height || "200px");
260
+ updateWidthAndHeight(mediaElement, mediaElement.style.width, `${Math.max(100, currentHeight - 20)}px`);
261
+ });
262
+ buttonContainer.appendChild(increaseWidthButton);
263
+ buttonContainer.appendChild(decreaseWidthButton);
264
+ buttonContainer.appendChild(increaseHeightButton);
265
+ buttonContainer.appendChild(decreaseHeightButton);
266
+ return buttonContainer;
267
+ }
268
+ static createButton(label, onClick) {
269
+ const button = document.createElement("button");
270
+ button.innerHTML = label;
271
+ button.style.margin = "0 5px";
272
+ button.style.cursor = "pointer";
273
+ button.setAttribute("contenteditable", "false");
274
+ button.style.pointerEvents = "auto";
275
+ button.onclick = (event) => {
276
+ event.preventDefault();
277
+ event.stopPropagation();
278
+ onClick();
279
+ };
280
+ return button;
281
+ }
282
+ static value(container) {
283
+ const iframe = container.querySelector("iframe");
284
+ return {
285
+ url: iframe?.getAttribute("src"),
286
+ width: container.getAttribute("data-width") || iframe?.getAttribute("width"),
287
+ height: container.getAttribute("data-height") || iframe?.getAttribute("height"),
288
+ align: container.getAttribute("data-align") || "center"
289
+ };
290
+ }
291
+ };
292
+ NoDragVideo["blotName"] = "no-drag-video";
293
+ NoDragVideo["tagName"] = "div";
304
294
  Quill.register(NoDragVideo);
305
- class QuillHelper {
306
- static init() {
307
- if (!Quill.imports['formats/no-drag-image']) {
308
- Quill.register(NoDragImage);
309
- }
310
- if (!Quill.imports['formats/no-drag-video']) {
311
- Quill.register(NoDragVideo);
312
- }
313
- if (!Quill.imports['modules/imageResize']) {
314
- Quill.register('modules/imageResize', ImageResize.default || ImageResize);
315
- }
316
- if (!Quill.imports['modules/noDragDrop']) {
317
- Quill.register('modules/noDragDrop', NoDragDrop);
318
- }
319
- }
320
- static getEditorConfig(additionalToolbarConfig = []) {
321
- const defaultToolbarConfig = [
322
- ['bold', 'italic', 'underline', 'strike'], // toggled buttons
323
- ['blockquote', 'code-block'],
324
- [{ header: 1 }, { header: 2 }], // custom button values
325
- [{ list: 'ordered' }, { list: 'bullet' }],
326
- [{ script: 'sub' }, { script: 'super' }], // superscript/subscript
327
- [{ indent: '-1' }, { indent: '+1' }], // outdent/indent
328
- [{ direction: 'rtl' }], // text direction
329
- [{ header: [1, 2, 3, 4, 5, 6, false] }],
330
- [{ color: [] }, { background: [] }], // dropdown with defaults from theme
331
- [{ align: [] }],
332
- ['link', 'image', 'video'],
333
- ['clean'], // remove formatting button
334
- ['table'] // table button
335
- ];
336
- const mergedToolbarConfig = [...defaultToolbarConfig, ...additionalToolbarConfig];
337
- return {
338
- toolbar: {
339
- container: mergedToolbarConfig,
340
- handlers: {
341
- image: function () {
342
- const range = this.quill.getSelection();
343
- const value = prompt('Enter image URL:');
344
- if (value) {
345
- this.quill.insertEmbed(range.index, 'no-drag-image', { url: value });
346
- this.quill.insertText(range.index + 1, '\n', Quill.sources.USER);
347
- }
348
- },
349
- video: function () {
350
- const range = this.quill.getSelection();
351
- let value = prompt('Enter video URL:');
352
- if (value?.includes('youtube.com/watch?v=')) {
353
- const videoId = value.split('v=')[1];
354
- value = `https://www.youtube.com/embed/${videoId}`;
355
- }
356
- else if (value?.includes('youtu.be/')) {
357
- const videoId = value.split('.be/')[1];
358
- value = `https://www.youtube.com/embed/${videoId}`;
359
- }
360
- else if (value?.includes('loom.com/share/')) {
361
- const videoId = value.split('share/')[1];
362
- value = `https://www.loom.com/embed/${videoId}`;
363
- }
364
- else if (value?.includes('capture.dropbox.com/')) {
365
- const videoId = value.split('capture.dropbox.com/')[1];
366
- if (videoId.includes('embed')) {
367
- value = `https://capture.dropbox.com/${videoId}`;
368
- }
369
- else {
370
- value = `https://capture.dropbox.com/embed/${videoId}`;
371
- }
372
- }
373
- if (value) {
374
- const useIframe = value.includes('youtube.com') ||
375
- value.includes('youtu.be') ||
376
- value.includes('loom.com') ||
377
- value.includes('drop');
378
- this.quill.insertEmbed(range.index, 'no-drag-video', {
379
- url: value,
380
- isEdit: true,
381
- width: useIframe ? '560px' : '640px', // Different width for iframe vs video
382
- height: useIframe ? '315px' : '360px' // Different height for iframe vs video
383
- });
384
- this.quill.insertText(range.index + 1, '\n', Quill.sources.USER);
385
- }
386
- }
387
- }
388
- },
389
- imageResize: {
390
- displaySize: true
391
- },
392
- noDragDrop: true
393
- };
394
- }
395
- }
396
-
295
+ var QuillHelper = class {
296
+ static init() {
297
+ if (!Quill.imports["formats/no-drag-image"]) Quill.register(NoDragImage);
298
+ if (!Quill.imports["formats/no-drag-video"]) Quill.register(NoDragVideo);
299
+ if (!Quill.imports["modules/imageResize"]) Quill.register("modules/imageResize", ImageResize.default || ImageResize);
300
+ if (!Quill.imports["modules/noDragDrop"]) Quill.register("modules/noDragDrop", NoDragDrop);
301
+ if (!Quill.imports["modules/pasteGuard"]) Quill.register("modules/pasteGuard", PasteGuard);
302
+ }
303
+ static getEditorConfig(additionalToolbarConfig = []) {
304
+ return {
305
+ toolbar: {
306
+ container: [...[
307
+ [
308
+ "bold",
309
+ "italic",
310
+ "underline",
311
+ "strike"
312
+ ],
313
+ ["blockquote", "code-block"],
314
+ [{ header: 1 }, { header: 2 }],
315
+ [{ list: "ordered" }, { list: "bullet" }],
316
+ [{ script: "sub" }, { script: "super" }],
317
+ [{ indent: "-1" }, { indent: "+1" }],
318
+ [{ direction: "rtl" }],
319
+ [{ header: [
320
+ 1,
321
+ 2,
322
+ 3,
323
+ 4,
324
+ 5,
325
+ 6,
326
+ false
327
+ ] }],
328
+ [{ color: [] }, { background: [] }],
329
+ [{ align: [] }],
330
+ [
331
+ "link",
332
+ "image",
333
+ "video"
334
+ ],
335
+ ["clean"],
336
+ ["table"]
337
+ ], ...additionalToolbarConfig],
338
+ handlers: {
339
+ image: function() {
340
+ const range = this.quill.getSelection();
341
+ const value = prompt("Enter image URL:");
342
+ if (value) {
343
+ this.quill.insertEmbed(range.index, "no-drag-image", { url: value });
344
+ this.quill.insertText(range.index + 1, "\n", Quill.sources.USER);
345
+ }
346
+ },
347
+ video: function() {
348
+ const range = this.quill.getSelection();
349
+ let value = prompt("Enter video URL:");
350
+ if (value?.includes("youtube.com/watch?v=")) value = `https://www.youtube.com/embed/${value.split("v=")[1]}`;
351
+ else if (value?.includes("youtu.be/")) value = `https://www.youtube.com/embed/${value.split(".be/")[1]}`;
352
+ else if (value?.includes("loom.com/share/")) value = `https://www.loom.com/embed/${value.split("share/")[1]}`;
353
+ else if (value?.includes("capture.dropbox.com/")) {
354
+ const videoId = value.split("capture.dropbox.com/")[1];
355
+ if (videoId.includes("embed")) value = `https://capture.dropbox.com/${videoId}`;
356
+ else value = `https://capture.dropbox.com/embed/${videoId}`;
357
+ }
358
+ if (value) {
359
+ const useIframe = value.includes("youtube.com") || value.includes("youtu.be") || value.includes("loom.com") || value.includes("drop");
360
+ this.quill.insertEmbed(range.index, "no-drag-video", {
361
+ url: value,
362
+ isEdit: true,
363
+ width: useIframe ? "560px" : "640px",
364
+ height: useIframe ? "315px" : "360px"
365
+ });
366
+ this.quill.insertText(range.index + 1, "\n", Quill.sources.USER);
367
+ }
368
+ }
369
+ }
370
+ },
371
+ imageResize: { displaySize: true },
372
+ noDragDrop: true,
373
+ pasteGuard: true
374
+ };
375
+ }
376
+ };
397
377
  function checkFormValidation(form) {
398
- if (!form.valid) {
399
- form.markAllAsTouched();
400
- return false;
401
- }
402
- return true;
378
+ if (!form.valid) {
379
+ form.markAllAsTouched();
380
+ return false;
381
+ }
382
+ return true;
403
383
  }
404
384
  function ValidateForm(formName) {
405
- return function (_target, _methodName, descriptor) {
406
- const originalMethod = descriptor.value;
407
- descriptor.value = function (...args) {
408
- const formGroup = this[formName];
409
- if (checkFormValidation(formGroup)) {
410
- originalMethod.apply(this, args);
411
- }
412
- };
413
- return descriptor;
414
- };
385
+ return function(_target, _methodName, descriptor) {
386
+ const originalMethod = descriptor.value;
387
+ descriptor.value = function(...args) {
388
+ const formGroup = this[formName];
389
+ if (checkFormValidation(formGroup)) originalMethod.apply(this, args);
390
+ };
391
+ return descriptor;
392
+ };
415
393
  }
416
394
  function MatchPassword(abstractControl) {
417
- const password = abstractControl.get('password').value;
418
- const confirmPassword = abstractControl.get('confirmPassword').value;
419
- if (password !== confirmPassword) {
420
- abstractControl.get('confirmPassword').setErrors({ MatchPassword: true });
421
- }
422
- else {
423
- return null;
424
- }
395
+ if (abstractControl.get("password").value !== abstractControl.get("confirmPassword").value) abstractControl.get("confirmPassword").setErrors({ MatchPassword: true });
396
+ else return null;
425
397
  }
426
-
427
398
  function appendQueryParam(router, activatedRoute, queryParams) {
428
- router.navigate([], {
429
- relativeTo: activatedRoute,
430
- queryParams
431
- });
399
+ router.navigate([], {
400
+ relativeTo: activatedRoute,
401
+ queryParams
402
+ });
432
403
  }
433
404
  function clearQueryParams(router, activatedRoute) {
434
- router.navigate([], {
435
- relativeTo: activatedRoute,
436
- queryParams: {}
437
- });
405
+ router.navigate([], {
406
+ relativeTo: activatedRoute,
407
+ queryParams: {}
408
+ });
438
409
  }
439
-
440
410
  function handleDateRangeSelection(event, selectedDateRange) {
441
- if (event?.startDate && event?.endDate) {
442
- selectedDateRange = event;
443
- }
444
- else {
445
- selectedDateRange = null;
446
- }
447
- return selectedDateRange;
411
+ if (event?.startDate && event?.endDate) selectedDateRange = event;
412
+ else selectedDateRange = null;
413
+ return selectedDateRange;
448
414
  }
415
+ var ProfileImageCropperComponent = class ProfileImageCropperComponent {
416
+ constructor(cdr) {
417
+ this.cdr = cdr;
418
+ this.imageChangedEvent = null;
419
+ this.croppedImage = "";
420
+ this.imageSelectionEvent = new EventEmitter();
421
+ this.closeEvent = new EventEmitter();
422
+ this.fileChangeEvent = new EventEmitter();
423
+ this.aspectRatio = "auto";
424
+ this.transform = {};
425
+ this.canvasRotation = 0;
426
+ this.showCropper = false;
427
+ }
428
+ onFileChange(event) {
429
+ const input = event.target;
430
+ if (input.files && input.files.length > 0) {
431
+ this.imageChangedEvent = event;
432
+ this.fileChangeEvent.emit(input.files[0].name);
433
+ }
434
+ }
435
+ imageCropped(event) {
436
+ const reader = new FileReader();
437
+ reader.onloadend = () => {
438
+ this.croppedImage = reader.result;
439
+ this.cdr.detectChanges();
440
+ };
441
+ reader.readAsDataURL(event.blob);
442
+ }
443
+ imageLoaded() {
444
+ this.showCropper = true;
445
+ }
446
+ rotateLeft() {
447
+ this.canvasRotation--;
448
+ this.flipAfterRotate();
449
+ }
450
+ rotateRight() {
451
+ this.canvasRotation++;
452
+ this.flipAfterRotate();
453
+ }
454
+ flipAfterRotate() {
455
+ const flippedH = this.transform.flipH;
456
+ const flippedV = this.transform.flipV;
457
+ this.transform = {
458
+ ...this.transform,
459
+ flipH: flippedV,
460
+ flipV: flippedH
461
+ };
462
+ }
463
+ flipHorizontal() {
464
+ this.transform = {
465
+ ...this.transform,
466
+ flipH: !this.transform.flipH
467
+ };
468
+ }
469
+ flipVertical() {
470
+ this.transform = {
471
+ ...this.transform,
472
+ flipV: !this.transform.flipV
473
+ };
474
+ }
475
+ saveProfilePicture() {
476
+ if (this.croppedImage) {
477
+ this.imageSelectionEvent.emit(this.croppedImage);
478
+ this.busy = true;
479
+ }
480
+ }
481
+ onCloseModal() {
482
+ this.closeEvent.emit();
483
+ }
484
+ static {
485
+ this.ɵfac = i0.ɵɵngDeclareFactory({
486
+ minVersion: "12.0.0",
487
+ version: "22.2.0",
488
+ ngImport: i0,
489
+ type: ProfileImageCropperComponent,
490
+ deps: [{ token: i0.ChangeDetectorRef }],
491
+ target: i0.ɵɵFactoryTarget.Component
492
+ });
493
+ }
494
+ static {
495
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
496
+ minVersion: "17.0.0",
497
+ version: "22.2.0",
498
+ type: ProfileImageCropperComponent,
499
+ isStandalone: false,
500
+ selector: "pw-image-cropper",
501
+ inputs: {
502
+ aspectRatio: "aspectRatio",
503
+ dynamicData: "dynamicData"
504
+ },
505
+ outputs: {
506
+ imageSelectionEvent: "imageSelectionEvent",
507
+ closeEvent: "closeEvent",
508
+ fileChangeEvent: "fileChangeEvent"
509
+ },
510
+ ngImport: i0,
511
+ template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n Upload Pic\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" name=\"input_field_1\"\n aria-label=\"Input Field 1\"/>\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Left\">\n <i\n class=\"fa fa-undo-alt\"\n (click)=\"rotateLeft()\"\n (keydown.enter)=\"rotateLeft()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Right\">\n <i\n class=\"fa fa-redo-alt\"\n (click)=\"rotateRight()\"\n (keydown.enter)=\"rotateRight()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Horizontal\">\n <i\n class=\"fa fa-arrows-alt-h\"\n (click)=\"flipHorizontal()\"\n (keydown.enter)=\"flipHorizontal()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Vertical\">\n <i\n class=\"fa fa-arrows-alt-v\"\n (click)=\"flipVertical()\"\n (keydown.enter)=\"flipVertical()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-8\">\n @if (aspectRatio === 'auto') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [aspectRatio]=\"4 / 4\"\n [onlyScaleDown]=\"true\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'fullLogo') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"5 / 1.1\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'rectangular') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"3 / 1\"\n [onlyScaleDown]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'dynamic') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"false\"\n [resizeToWidth]=\"0\"\n [cropperStaticWidth]=\"0\"\n [cropperStaticHeight]=\"0\"\n [cropperMinWidth]=\"10\"\n [cropperMinHeight]=\"10\"\n [onlyScaleDown]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n [imageQuality]=\"100\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [style.display]=\"showCropper ? null : 'none'\">\n </image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'custom') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [aspectRatio]=\"4 / 3\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n </div>\n @if (croppedImage) {\n <div class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n alt=\"cropped.png\"\n width=\"128\" />\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <div class=\"float-end mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCloseModal()\">\n Close\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n Save\n </button>\n </div>\n </div>\n</section>\n",
512
+ styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"],
513
+ dependencies: [
514
+ {
515
+ kind: "component",
516
+ type: i1$2.ImageCropperComponent,
517
+ selector: "image-cropper",
518
+ inputs: [
519
+ "imageChangedEvent",
520
+ "imageURL",
521
+ "imageBase64",
522
+ "imageFile",
523
+ "imageAltText",
524
+ "options",
525
+ "cropperFrameAriaLabel",
526
+ "output",
527
+ "format",
528
+ "autoCrop",
529
+ "cropper",
530
+ "transform",
531
+ "maintainAspectRatio",
532
+ "aspectRatio",
533
+ "resetCropOnAspectRatioChange",
534
+ "resizeToWidth",
535
+ "resizeToHeight",
536
+ "cropperMinWidth",
537
+ "cropperMinHeight",
538
+ "cropperMaxHeight",
539
+ "cropperMaxWidth",
540
+ "cropperStaticWidth",
541
+ "cropperStaticHeight",
542
+ "canvasRotation",
543
+ "initialStepSize",
544
+ "roundCropper",
545
+ "onlyScaleDown",
546
+ "imageQuality",
547
+ "backgroundColor",
548
+ "containWithinAspectRatio",
549
+ "hideResizeSquares",
550
+ "allowMoveImage",
551
+ "checkImageType",
552
+ "alignImage",
553
+ "disabled",
554
+ "hidden"
555
+ ],
556
+ outputs: [
557
+ "imageCropped",
558
+ "startCropImage",
559
+ "imageLoaded",
560
+ "cropperReady",
561
+ "loadImageFailed",
562
+ "transformChange",
563
+ "cropperChange"
564
+ ]
565
+ },
566
+ {
567
+ kind: "directive",
568
+ type: i2$1.ButtonBusyDirective,
569
+ selector: "[buttonBusy]",
570
+ inputs: ["buttonBusy", "busyText"]
571
+ },
572
+ {
573
+ kind: "directive",
574
+ type: i2$1.LazyImgDirective,
575
+ selector: "img"
576
+ }
577
+ ]
578
+ });
579
+ }
580
+ };
581
+ i0.ɵɵngDeclareClassMetadata({
582
+ minVersion: "12.0.0",
583
+ version: "22.2.0",
584
+ ngImport: i0,
585
+ type: ProfileImageCropperComponent,
586
+ decorators: [{
587
+ type: Component,
588
+ args: [{
589
+ selector: "pw-image-cropper",
590
+ standalone: false,
591
+ template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n Upload Pic\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" name=\"input_field_1\"\n aria-label=\"Input Field 1\"/>\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Left\">\n <i\n class=\"fa fa-undo-alt\"\n (click)=\"rotateLeft()\"\n (keydown.enter)=\"rotateLeft()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Right\">\n <i\n class=\"fa fa-redo-alt\"\n (click)=\"rotateRight()\"\n (keydown.enter)=\"rotateRight()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Horizontal\">\n <i\n class=\"fa fa-arrows-alt-h\"\n (click)=\"flipHorizontal()\"\n (keydown.enter)=\"flipHorizontal()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Vertical\">\n <i\n class=\"fa fa-arrows-alt-v\"\n (click)=\"flipVertical()\"\n (keydown.enter)=\"flipVertical()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-8\">\n @if (aspectRatio === 'auto') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [aspectRatio]=\"4 / 4\"\n [onlyScaleDown]=\"true\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'fullLogo') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"5 / 1.1\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'rectangular') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"3 / 1\"\n [onlyScaleDown]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'dynamic') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"false\"\n [resizeToWidth]=\"0\"\n [cropperStaticWidth]=\"0\"\n [cropperStaticHeight]=\"0\"\n [cropperMinWidth]=\"10\"\n [cropperMinHeight]=\"10\"\n [onlyScaleDown]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n [imageQuality]=\"100\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [style.display]=\"showCropper ? null : 'none'\">\n </image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'custom') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [aspectRatio]=\"4 / 3\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n </div>\n @if (croppedImage) {\n <div class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n alt=\"cropped.png\"\n width=\"128\" />\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <div class=\"float-end mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCloseModal()\">\n Close\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n Save\n </button>\n </div>\n </div>\n</section>\n",
592
+ styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"]
593
+ }]
594
+ }],
595
+ ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
596
+ propDecorators: {
597
+ imageSelectionEvent: [{ type: Output }],
598
+ closeEvent: [{ type: Output }],
599
+ fileChangeEvent: [{ type: Output }],
600
+ aspectRatio: [{ type: Input }],
601
+ dynamicData: [{ type: Input }]
602
+ }
603
+ });
604
+ var CustomUploaderComponent = class CustomUploaderComponent extends AppBaseComponent {
605
+ set previewData(value) {
606
+ this._previewData = value;
607
+ this.previewBroken = false;
608
+ this.cacheBust = Date.now();
609
+ }
610
+ get previewData() {
611
+ return this._previewData;
612
+ }
613
+ get previewSrc() {
614
+ const url = this._previewData?.url;
615
+ if (!url) return url;
616
+ if (url.startsWith("blob:") || url.startsWith("data:")) return url;
617
+ return `${url}${url.includes("?") ? "&" : "?"}v=${this.cacheBust}`;
618
+ }
619
+ constructor(injector, modalService, document) {
620
+ super(injector);
621
+ this.modalService = modalService;
622
+ this.document = document;
623
+ this.saveEvent = new EventEmitter();
624
+ this.cacheBust = Date.now();
625
+ this.previewBroken = false;
626
+ this.aspectRatio = "auto";
627
+ this.uploadedFile = null;
628
+ }
629
+ deleteExistingFile() {
630
+ HelperService.raiseDeletePopup().then((rep) => {
631
+ if (rep.value) {
632
+ this.previewData = null;
633
+ this.uploadedFile = null;
634
+ this.onSaveFile();
635
+ }
636
+ });
637
+ }
638
+ onSaveFile() {
639
+ this.buttonBusy = true;
640
+ this.saveEvent.emit({
641
+ file: this.uploadedFile,
642
+ name: this.controlName
643
+ });
644
+ }
645
+ onFileChange(value) {
646
+ this.selectedFileName = value;
647
+ }
648
+ dataURLtoBlob(dataUrl) {
649
+ const arr = dataUrl?.split(",");
650
+ const mime = /^[A-Z]*[a-z]*:(.*?);[A-Z]*/.exec(arr[0])?.[1];
651
+ const bStr = atob(arr[1]);
652
+ let n = bStr.length;
653
+ const u8arr = new Uint8Array(n);
654
+ while (n--) u8arr[n] = bStr.charCodeAt(n);
655
+ return new Blob([u8arr], { type: mime });
656
+ }
657
+ onImageSelection(event) {
658
+ const blob = this.dataURLtoBlob(event);
659
+ const file = new File([blob], this.selectedFileName);
660
+ this.uploadedFile = file;
661
+ this.onSaveFile();
662
+ }
663
+ openModal(content) {
664
+ this.modalService.open(content, {
665
+ centered: true,
666
+ windowClass: "modal-holder"
667
+ });
668
+ }
669
+ clearValues() {
670
+ this.uploadedFile = null;
671
+ this.selectedFileName = null;
672
+ this.updateHeight();
673
+ }
674
+ onClose() {
675
+ this.modalService.dismissAll();
676
+ }
677
+ updateHeight() {
678
+ setTimeout(() => {
679
+ this.onImgChange();
680
+ });
681
+ }
682
+ onImgError() {
683
+ this.previewBroken = true;
684
+ this.matchTileHeights();
685
+ }
686
+ onImgChange() {
687
+ this.matchTileHeights();
688
+ }
689
+ matchTileHeights() {
690
+ this.document.querySelectorAll("pw-domain-config-interface,pw-domain-config-build div[matchheight=\"card\"]").forEach((item) => {
691
+ HelperService.matchHeights(item, "card");
692
+ });
693
+ }
694
+ static {
695
+ this.ɵfac = i0.ɵɵngDeclareFactory({
696
+ minVersion: "12.0.0",
697
+ version: "22.2.0",
698
+ ngImport: i0,
699
+ type: CustomUploaderComponent,
700
+ deps: [
701
+ { token: i0.Injector },
702
+ { token: i1$1.NgbModal },
703
+ { token: DOCUMENT }
704
+ ],
705
+ target: i0.ɵɵFactoryTarget.Component
706
+ });
707
+ }
708
+ static {
709
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
710
+ minVersion: "17.0.0",
711
+ version: "22.2.0",
712
+ type: CustomUploaderComponent,
713
+ isStandalone: false,
714
+ selector: "pw-custom-uploader",
715
+ inputs: {
716
+ controlName: "controlName",
717
+ previewData: "previewData",
718
+ aspectRatio: "aspectRatio",
719
+ title: "title"
720
+ },
721
+ outputs: { saveEvent: "saveEvent" },
722
+ usesInheritance: true,
723
+ ngImport: i0,
724
+ template: "<div class=\"pw-uploader-card\">\n <!-- empty state — dashed dropzone (admin-edit-form.md § 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('Upload ' + title) : 'Upload an image'\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n <i class=\"fas fa-upload\" aria-hidden=\"true\"></i>\n <span class=\"dropzone-title\">Upload an image</span>\n <span class=\"dropzone-hint\">PNG or JPG</span>\n </div>\n }\n <!-- populated — framed image + Change / Delete affordances -->\n @if (previewData?.url && !previewBroken) {\n <div class=\"pw-uploader-preview\">\n <a [href]=\"previewData?.url\"\n target=\"_blank\"\n class=\"pw-uploader-thumb\">\n <img [src]=\"previewSrc\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgError()\"\n class=\"img-fluid pw-uploader-img\" />\n </a>\n <div class=\"pw-uploader-actions\">\n <a class=\"pw-uploader-change\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n <i\n appendTo=\"body\"\n pTooltip=\"Delete\"\n tooltipPosition=\"top\"\n (click)=\"deleteExistingFile()\"\n (keydown.enter)=\"deleteExistingFile()\"\n (keydown.space)=\"deleteExistingFile()\"\n class=\"fa fa-trash delete-icon\"\n aria-hidden=\"true\"\n ></i>\n </div>\n </div>\n }\n</div>\n<!-- image cropper -->\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ title }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n [aspectRatio]=\"aspectRatio\"\n (fileChangeEvent)=\"onFileChange($event)\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
725
+ styles: ["@charset \"UTF-8\";.pw-uploader-card{border:0;background:transparent;min-height:180px;padding:0}.pw-uploader-dropzone{width:100%;min-height:180px;padding:1rem}.pw-uploader-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:180px;padding:1rem;border:1px solid #e2e5ea;border-radius:8px;background:#fff}.pw-uploader-thumb{display:flex;align-items:center;justify-content:center;max-width:100%}.pw-uploader-img{max-height:120px;object-fit:contain}.pw-uploader-actions{display:flex;align-items:center;gap:1rem}.pw-uploader-change{color:var(--first, #1769e1);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none}.pw-uploader-change:hover{text-decoration:underline}.delete-icon{cursor:pointer}\n"],
726
+ dependencies: [
727
+ {
728
+ kind: "directive",
729
+ type: i2.Tooltip,
730
+ selector: "[pTooltip]",
731
+ inputs: [
732
+ "tooltipPosition",
733
+ "tooltipEvent",
734
+ "positionStyle",
735
+ "tooltipStyleClass",
736
+ "tooltipZIndex",
737
+ "escape",
738
+ "showDelay",
739
+ "hideDelay",
740
+ "life",
741
+ "positionTop",
742
+ "positionLeft",
743
+ "autoHide",
744
+ "fitContent",
745
+ "hideOnEscape",
746
+ "showOnEllipsis",
747
+ "pTooltip",
748
+ "tooltipDisabled",
749
+ "tooltipOptions",
750
+ "appendTo",
751
+ "pTooltipPT",
752
+ "pTooltipUnstyled"
753
+ ]
754
+ },
755
+ {
756
+ kind: "directive",
757
+ type: i2$1.LazyImgDirective,
758
+ selector: "img"
759
+ },
760
+ {
761
+ kind: "component",
762
+ type: ProfileImageCropperComponent,
763
+ selector: "pw-image-cropper",
764
+ inputs: ["aspectRatio", "dynamicData"],
765
+ outputs: [
766
+ "imageSelectionEvent",
767
+ "closeEvent",
768
+ "fileChangeEvent"
769
+ ]
770
+ },
771
+ {
772
+ kind: "pipe",
773
+ type: i5.TranslocoPipe,
774
+ name: "transloco"
775
+ }
776
+ ]
777
+ });
778
+ }
779
+ };
780
+ i0.ɵɵngDeclareClassMetadata({
781
+ minVersion: "12.0.0",
782
+ version: "22.2.0",
783
+ ngImport: i0,
784
+ type: CustomUploaderComponent,
785
+ decorators: [{
786
+ type: Component,
787
+ args: [{
788
+ selector: "pw-custom-uploader",
789
+ standalone: false,
790
+ template: "<div class=\"pw-uploader-card\">\n <!-- empty state — dashed dropzone (admin-edit-form.md § 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('Upload ' + title) : 'Upload an image'\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n <i class=\"fas fa-upload\" aria-hidden=\"true\"></i>\n <span class=\"dropzone-title\">Upload an image</span>\n <span class=\"dropzone-hint\">PNG or JPG</span>\n </div>\n }\n <!-- populated — framed image + Change / Delete affordances -->\n @if (previewData?.url && !previewBroken) {\n <div class=\"pw-uploader-preview\">\n <a [href]=\"previewData?.url\"\n target=\"_blank\"\n class=\"pw-uploader-thumb\">\n <img [src]=\"previewSrc\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgError()\"\n class=\"img-fluid pw-uploader-img\" />\n </a>\n <div class=\"pw-uploader-actions\">\n <a class=\"pw-uploader-change\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n <i\n appendTo=\"body\"\n pTooltip=\"Delete\"\n tooltipPosition=\"top\"\n (click)=\"deleteExistingFile()\"\n (keydown.enter)=\"deleteExistingFile()\"\n (keydown.space)=\"deleteExistingFile()\"\n class=\"fa fa-trash delete-icon\"\n aria-hidden=\"true\"\n ></i>\n </div>\n </div>\n }\n</div>\n<!-- image cropper -->\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ title }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n [aspectRatio]=\"aspectRatio\"\n (fileChangeEvent)=\"onFileChange($event)\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
791
+ styles: ["@charset \"UTF-8\";.pw-uploader-card{border:0;background:transparent;min-height:180px;padding:0}.pw-uploader-dropzone{width:100%;min-height:180px;padding:1rem}.pw-uploader-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:180px;padding:1rem;border:1px solid #e2e5ea;border-radius:8px;background:#fff}.pw-uploader-thumb{display:flex;align-items:center;justify-content:center;max-width:100%}.pw-uploader-img{max-height:120px;object-fit:contain}.pw-uploader-actions{display:flex;align-items:center;gap:1rem}.pw-uploader-change{color:var(--first, #1769e1);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none}.pw-uploader-change:hover{text-decoration:underline}.delete-icon{cursor:pointer}\n"]
792
+ }]
793
+ }],
794
+ ctorParameters: () => [
795
+ { type: i0.Injector },
796
+ { type: i1$1.NgbModal },
797
+ {
798
+ type: Document,
799
+ decorators: [{
800
+ type: Inject,
801
+ args: [DOCUMENT]
802
+ }]
803
+ }
804
+ ],
805
+ propDecorators: {
806
+ saveEvent: [{ type: Output }],
807
+ controlName: [{ type: Input }],
808
+ previewData: [{ type: Input }],
809
+ aspectRatio: [{ type: Input }],
810
+ title: [{ type: Input }]
811
+ }
812
+ });
813
+ var ProfileImageCropperModule = class ProfileImageCropperModule {
814
+ static {
815
+ this.ɵfac = i0.ɵɵngDeclareFactory({
816
+ minVersion: "12.0.0",
817
+ version: "22.2.0",
818
+ ngImport: i0,
819
+ type: ProfileImageCropperModule,
820
+ deps: [],
821
+ target: i0.ɵɵFactoryTarget.NgModule
822
+ });
823
+ }
824
+ static {
825
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
826
+ minVersion: "14.0.0",
827
+ version: "22.2.0",
828
+ ngImport: i0,
829
+ type: ProfileImageCropperModule,
830
+ declarations: [ProfileImageCropperComponent, CustomUploaderComponent],
831
+ imports: [
832
+ CommonModule,
833
+ CoreTranslocoModule,
834
+ ButtonModule,
835
+ TooltipModule,
836
+ ImageCropperComponent,
837
+ DirectivesModule
838
+ ],
839
+ exports: [ProfileImageCropperComponent, CustomUploaderComponent]
840
+ });
841
+ }
842
+ static {
843
+ this.ɵinj = i0.ɵɵngDeclareInjector({
844
+ minVersion: "12.0.0",
845
+ version: "22.2.0",
846
+ ngImport: i0,
847
+ type: ProfileImageCropperModule,
848
+ imports: [
849
+ CommonModule,
850
+ CoreTranslocoModule,
851
+ ButtonModule,
852
+ TooltipModule,
853
+ ImageCropperComponent,
854
+ DirectivesModule
855
+ ]
856
+ });
857
+ }
858
+ };
859
+ i0.ɵɵngDeclareClassMetadata({
860
+ minVersion: "12.0.0",
861
+ version: "22.2.0",
862
+ ngImport: i0,
863
+ type: ProfileImageCropperModule,
864
+ decorators: [{
865
+ type: NgModule,
866
+ args: [{
867
+ declarations: [ProfileImageCropperComponent, CustomUploaderComponent],
868
+ imports: [
869
+ CommonModule,
870
+ CoreTranslocoModule,
871
+ ButtonModule,
872
+ TooltipModule,
873
+ ImageCropperComponent,
874
+ DirectivesModule
875
+ ],
876
+ exports: [ProfileImageCropperComponent, CustomUploaderComponent]
877
+ }]
878
+ }]
879
+ });
880
+ var ResourceHeaderComponent = class ResourceHeaderComponent extends AppBaseComponent {
881
+ constructor(injector, document, adminService, modalService, cdr) {
882
+ super(injector);
883
+ this.document = document;
884
+ this.adminService = adminService;
885
+ this.modalService = modalService;
886
+ this.cdr = cdr;
887
+ this.isScrolled = false;
888
+ this.open = false;
889
+ this.logo = "/assets/img/landing-page/site-logo.png";
890
+ this.navbarItems = this.appConfig?.pages_config?.navbar?.items;
891
+ this.domainId = this.appConfig?.domain_id;
892
+ this.contrastImageUrl = this.appConfig?.company?.logos?.main_contrast?.url;
893
+ this.darkImageUrl = this.appConfig?.company?.logos?.main_dark?.url;
894
+ this.editingNavbar = { items: [] };
895
+ this.canEditResourcesValue = false;
896
+ }
897
+ ngOnInit() {
898
+ this.appConfigService.appConfig$.subscribe((config) => {
899
+ if (config?.company?.logos) {
900
+ const isAboutUs = this.router.url?.includes("/about-us");
901
+ const logos = config.company.logos;
902
+ this.logo = isAboutUs ? logos.main_contrast?.url || "/assets/img/landing-page/site-logo.png" : logos.main_dark?.url || "/assets/img/landing-page/site-logo.png";
903
+ }
904
+ this.cdr.markForCheck();
905
+ });
906
+ if (this.userLoggedIn) this.localStorage.getItem$("product").subscribe((res) => {
907
+ const data = res ? JSON.parse(res) : null;
908
+ this.id = data?.subscriptionId;
909
+ this.cdr.markForCheck();
910
+ });
911
+ }
912
+ ngOnChanges(changes) {
913
+ if (changes["user"] || changes["userLoggedIn"]) {
914
+ if (this.userLoggedIn && this.user) this.updateCanEditResourcesValue();
915
+ }
916
+ }
917
+ openLogoEditModal() {
918
+ this.modalService.open(this.logoEditModal, {
919
+ centered: true,
920
+ size: "md"
921
+ });
922
+ }
923
+ onSaveLogo(event) {
924
+ const formData = new FormData();
925
+ formData.append("subscription_id", this.id);
926
+ if (event.file instanceof File) formData.append(this.isScrolled ? "logo_main_contrast" : "logo_main_dark", event.file);
927
+ else formData.append(this.isScrolled ? "remove_logo_main_contrast" : "remove_logo_main_dark", "true");
928
+ this.adminService.updateDomainConfig(this.domainId, formData).subscribe(() => {
929
+ if (event.file) {
930
+ this.logo = URL.createObjectURL(event.file);
931
+ if (this.isScrolled) this.contrastImageUrl = URL.createObjectURL(event.file);
932
+ else this.darkImageUrl = URL.createObjectURL(event.file);
933
+ this.modalService.dismissAll();
934
+ }
935
+ this.toast.success(event.file ? "Logo updated" : "Logo removed");
936
+ this.cdr.markForCheck();
937
+ });
938
+ }
939
+ onScroll() {
940
+ clearTimeout(this.scrollTimeout);
941
+ this.scrollTimeout = setTimeout(() => {
942
+ requestAnimationFrame(() => {
943
+ const isAboutUs = this.router?.url?.includes("/about-us");
944
+ const shouldScroll = window.scrollY > 150;
945
+ this.isScrolled = shouldScroll;
946
+ if (!isAboutUs) {
947
+ const logos = this.appConfig?.company?.logos;
948
+ const newLogo = shouldScroll ? logos?.main_contrast?.url ?? this.contrastImageUrl ?? "/assets/img/landing-page/site-logo.png" : logos?.main_dark?.url ?? this.darkImageUrl ?? "/assets/img/landing-page/site-logo.png";
949
+ if (this.logo !== newLogo) this.logo = newLogo;
950
+ }
951
+ if (window.innerWidth < 768) {
952
+ this.open = false;
953
+ const collapseElement = this.navbarCollapse?.nativeElement;
954
+ if (collapseElement?.classList.contains("show")) collapseElement.classList.remove("show");
955
+ }
956
+ this.closeAllDropdowns();
957
+ });
958
+ }, 50);
959
+ }
960
+ onDocumentClick(event) {
961
+ const target = event.target;
962
+ if (!target.closest(".nav-item") && !target.closest(".popup") && !target.closest(".sign-btn")) this.closeAllDropdowns();
963
+ }
964
+ closeAllDropdowns() {
965
+ if (this.navbarItems) this.navbarItems.forEach((item) => {
966
+ if (item.open) item.open = false;
967
+ });
968
+ }
969
+ openDropdown(item) {
970
+ this.navbarItems.forEach((navItem) => {
971
+ if (navItem !== item) navItem.open = false;
972
+ });
973
+ item.open = true;
974
+ }
975
+ onNavbarItemClick(item, event) {
976
+ if (item?.subtitles?.length) {
977
+ event.preventDefault();
978
+ item.open = !item.open;
979
+ }
980
+ }
981
+ onDropdownItemClick(item) {
982
+ item.open = false;
983
+ }
984
+ async openEditNavbarModal() {
985
+ const navbarConfig = this.appConfig.pages_config?.navbar ?? {};
986
+ navbarConfig.items = navbarConfig.items ?? [];
987
+ this.editingNavbar = JSON.parse(JSON.stringify(navbarConfig));
988
+ try {
989
+ const { EditNavbarModalComponent } = await import("./posiwise-utils-edit-navbar-modal.component-BD9hKcnO.mjs");
990
+ const modalRef = this.modalService.open(EditNavbarModalComponent, {
991
+ size: "lg",
992
+ centered: true,
993
+ windowClass: "modal-holder"
994
+ });
995
+ modalRef.componentInstance.editingNavbar = this.editingNavbar;
996
+ modalRef.componentInstance.save.subscribe((updatedNavbar) => {
997
+ this.saveNavbarLinks(modalRef, updatedNavbar);
998
+ });
999
+ modalRef.componentInstance.closeEvent.subscribe(() => {
1000
+ modalRef.close();
1001
+ });
1002
+ } catch (error) {
1003
+ console.error("Failed to load edit navbar modal:", error);
1004
+ this.toast.error("Failed to open edit modal. Please try again.");
1005
+ }
1006
+ }
1007
+ saveNavbarLinks(modal, updatedNavbar) {
1008
+ const navbarToSave = updatedNavbar || this.editingNavbar;
1009
+ const updatedConfig = {
1010
+ navbar: navbarToSave,
1011
+ subscription_id: this.id
1012
+ };
1013
+ this.adminService.updateDomainConfig(this.appConfig?.domain_id, updatedConfig).subscribe(() => {
1014
+ this.toast.success("Navbar links updated");
1015
+ this.navbarItems = [...navbarToSave.items];
1016
+ this.appConfig.pages_config = this.appConfig.pages_config ?? {};
1017
+ this.appConfig.pages_config.navbar = { ...navbarToSave };
1018
+ modal.close();
1019
+ this.cdr.markForCheck();
1020
+ });
1021
+ }
1022
+ updateCanEditResourcesValue() {
1023
+ this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
1024
+ }
1025
+ canEditResources() {
1026
+ return this.canEditResourcesValue;
1027
+ }
1028
+ navigateToLogin() {
1029
+ window.location.href = "/login";
1030
+ }
1031
+ static {
1032
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1033
+ minVersion: "12.0.0",
1034
+ version: "22.2.0",
1035
+ ngImport: i0,
1036
+ type: ResourceHeaderComponent,
1037
+ deps: [
1038
+ { token: i0.Injector },
1039
+ { token: DOCUMENT },
1040
+ { token: i1.AdminService },
1041
+ { token: i1$1.NgbModal },
1042
+ { token: i0.ChangeDetectorRef }
1043
+ ],
1044
+ target: i0.ɵɵFactoryTarget.Component
1045
+ });
1046
+ }
1047
+ static {
1048
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1049
+ minVersion: "17.0.0",
1050
+ version: "22.2.0",
1051
+ type: ResourceHeaderComponent,
1052
+ isStandalone: false,
1053
+ selector: "pw-resource-header",
1054
+ inputs: {
1055
+ user: "user",
1056
+ userLoggedIn: "userLoggedIn"
1057
+ },
1058
+ host: { listeners: {
1059
+ "window:scroll": "onScroll()",
1060
+ "document:click": "onDocumentClick($event)"
1061
+ } },
1062
+ viewQueries: [{
1063
+ propertyName: "navbarCollapse",
1064
+ first: true,
1065
+ predicate: ["collapsibleNavbar"],
1066
+ descendants: true
1067
+ }, {
1068
+ propertyName: "logoEditModal",
1069
+ first: true,
1070
+ predicate: ["logoEditModal"],
1071
+ descendants: true
1072
+ }],
1073
+ usesInheritance: true,
1074
+ usesOnChanges: true,
1075
+ ngImport: i0,
1076
+ template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </li>\n </ul>\n </div>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-2 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>",
1077
+ styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}@media(min-width:500px){.navbar-nav .nav-item button{margin-top:10px}}@media(min-width:1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media(max-width:1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media(max-width:500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdown-container{position:relative;display:inline-block}}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important;background:var(--first)!important;color:#fff!important;border-radius:var(--public-btn-radius)!important;border:0!important;height:40px!important;padding:0 20px!important;font-size:14px!important;font-weight:600!important;text-transform:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease!important}.resource-header .sign-btn:hover,.resource-header .sign-header-btn:hover{background:color-mix(in srgb,var(--first) 88%,#000 12%)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px -12px var(--first)!important}\n"],
1078
+ dependencies: [
1079
+ {
1080
+ kind: "directive",
1081
+ type: i3.NgClass,
1082
+ selector: "[ngClass]",
1083
+ inputs: ["class", "ngClass"]
1084
+ },
1085
+ {
1086
+ kind: "directive",
1087
+ type: i4.RouterLink,
1088
+ selector: "[routerLink]",
1089
+ inputs: [
1090
+ "target",
1091
+ "queryParams",
1092
+ "fragment",
1093
+ "queryParamsHandling",
1094
+ "state",
1095
+ "info",
1096
+ "relativeTo",
1097
+ "preserveFragment",
1098
+ "skipLocationChange",
1099
+ "replaceUrl",
1100
+ "browserUrl",
1101
+ "routerLink"
1102
+ ]
1103
+ },
1104
+ {
1105
+ kind: "directive",
1106
+ type: i2$1.LazyImgDirective,
1107
+ selector: "img"
1108
+ },
1109
+ {
1110
+ kind: "component",
1111
+ type: CustomUploaderComponent,
1112
+ selector: "pw-custom-uploader",
1113
+ inputs: [
1114
+ "controlName",
1115
+ "previewData",
1116
+ "aspectRatio",
1117
+ "title"
1118
+ ],
1119
+ outputs: ["saveEvent"]
1120
+ }
1121
+ ]
1122
+ });
1123
+ }
1124
+ };
1125
+ i0.ɵɵngDeclareClassMetadata({
1126
+ minVersion: "12.0.0",
1127
+ version: "22.2.0",
1128
+ ngImport: i0,
1129
+ type: ResourceHeaderComponent,
1130
+ decorators: [{
1131
+ type: Component,
1132
+ args: [{
1133
+ selector: "pw-resource-header",
1134
+ standalone: false,
1135
+ template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </li>\n </ul>\n </div>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-2 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>",
1136
+ styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}@media(min-width:500px){.navbar-nav .nav-item button{margin-top:10px}}@media(min-width:1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media(max-width:1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media(max-width:500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdown-container{position:relative;display:inline-block}}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important;background:var(--first)!important;color:#fff!important;border-radius:var(--public-btn-radius)!important;border:0!important;height:40px!important;padding:0 20px!important;font-size:14px!important;font-weight:600!important;text-transform:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease!important}.resource-header .sign-btn:hover,.resource-header .sign-header-btn:hover{background:color-mix(in srgb,var(--first) 88%,#000 12%)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px -12px var(--first)!important}\n"]
1137
+ }]
1138
+ }],
1139
+ ctorParameters: () => [
1140
+ { type: i0.Injector },
1141
+ {
1142
+ type: Document,
1143
+ decorators: [{
1144
+ type: Inject,
1145
+ args: [DOCUMENT]
1146
+ }]
1147
+ },
1148
+ { type: i1.AdminService },
1149
+ { type: i1$1.NgbModal },
1150
+ { type: i0.ChangeDetectorRef }
1151
+ ],
1152
+ propDecorators: {
1153
+ navbarCollapse: [{
1154
+ type: ViewChild,
1155
+ args: ["collapsibleNavbar"]
1156
+ }],
1157
+ logoEditModal: [{
1158
+ type: ViewChild,
1159
+ args: ["logoEditModal"]
1160
+ }],
1161
+ user: [{ type: Input }],
1162
+ userLoggedIn: [{ type: Input }],
1163
+ onScroll: [{
1164
+ type: HostListener,
1165
+ args: ["window:scroll", []]
1166
+ }],
1167
+ onDocumentClick: [{
1168
+ type: HostListener,
1169
+ args: ["document:click", ["$event"]]
1170
+ }]
1171
+ }
1172
+ });
1173
+ var ResourceHeaderModule = class ResourceHeaderModule {
1174
+ static {
1175
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1176
+ minVersion: "12.0.0",
1177
+ version: "22.2.0",
1178
+ ngImport: i0,
1179
+ type: ResourceHeaderModule,
1180
+ deps: [],
1181
+ target: i0.ɵɵFactoryTarget.NgModule
1182
+ });
1183
+ }
1184
+ static {
1185
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
1186
+ minVersion: "14.0.0",
1187
+ version: "22.2.0",
1188
+ ngImport: i0,
1189
+ type: ResourceHeaderModule,
1190
+ declarations: [ResourceHeaderComponent],
1191
+ imports: [
1192
+ CommonModule,
1193
+ FormsModule,
1194
+ RouterModule,
1195
+ NgbModalModule,
1196
+ NgbTooltipModule,
1197
+ CoreTranslocoModule,
1198
+ DirectivesModule,
1199
+ PipesModule,
1200
+ AdminModuleUtilsModule,
1201
+ ProfileImageCropperModule
1202
+ ],
1203
+ exports: [ResourceHeaderComponent]
1204
+ });
1205
+ }
1206
+ static {
1207
+ this.ɵinj = i0.ɵɵngDeclareInjector({
1208
+ minVersion: "12.0.0",
1209
+ version: "22.2.0",
1210
+ ngImport: i0,
1211
+ type: ResourceHeaderModule,
1212
+ imports: [
1213
+ CommonModule,
1214
+ FormsModule,
1215
+ RouterModule,
1216
+ NgbModalModule,
1217
+ NgbTooltipModule,
1218
+ CoreTranslocoModule,
1219
+ DirectivesModule,
1220
+ PipesModule,
1221
+ AdminModuleUtilsModule,
1222
+ ProfileImageCropperModule
1223
+ ]
1224
+ });
1225
+ }
1226
+ };
1227
+ i0.ɵɵngDeclareClassMetadata({
1228
+ minVersion: "12.0.0",
1229
+ version: "22.2.0",
1230
+ ngImport: i0,
1231
+ type: ResourceHeaderModule,
1232
+ decorators: [{
1233
+ type: NgModule,
1234
+ args: [{
1235
+ declarations: [ResourceHeaderComponent],
1236
+ imports: [
1237
+ CommonModule,
1238
+ FormsModule,
1239
+ RouterModule,
1240
+ NgbModalModule,
1241
+ NgbTooltipModule,
1242
+ CoreTranslocoModule,
1243
+ DirectivesModule,
1244
+ PipesModule,
1245
+ AdminModuleUtilsModule,
1246
+ ProfileImageCropperModule
1247
+ ],
1248
+ exports: [ResourceHeaderComponent]
1249
+ }]
1250
+ }]
1251
+ });
1252
+ var FieldErrorDisplayComponent = class FieldErrorDisplayComponent {
1253
+ static {
1254
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1255
+ minVersion: "12.0.0",
1256
+ version: "22.2.0",
1257
+ ngImport: i0,
1258
+ type: FieldErrorDisplayComponent,
1259
+ deps: [],
1260
+ target: i0.ɵɵFactoryTarget.Component
1261
+ });
1262
+ }
1263
+ static {
1264
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1265
+ minVersion: "17.0.0",
1266
+ version: "22.2.0",
1267
+ type: FieldErrorDisplayComponent,
1268
+ isStandalone: false,
1269
+ selector: "pw-field-error-display",
1270
+ inputs: {
1271
+ errorMsg: "errorMsg",
1272
+ displayError: "displayError"
1273
+ },
1274
+ ngImport: i0,
1275
+ template: "@if (displayError) {\n <div>\n <div class=\"text-danger\">\n {{ errorMsg }}\n </div>\n </div>\n}\n\n"
1276
+ });
1277
+ }
1278
+ };
1279
+ i0.ɵɵngDeclareClassMetadata({
1280
+ minVersion: "12.0.0",
1281
+ version: "22.2.0",
1282
+ ngImport: i0,
1283
+ type: FieldErrorDisplayComponent,
1284
+ decorators: [{
1285
+ type: Component,
1286
+ args: [{
1287
+ selector: "pw-field-error-display",
1288
+ standalone: false,
1289
+ template: "@if (displayError) {\n <div>\n <div class=\"text-danger\">\n {{ errorMsg }}\n </div>\n </div>\n}\n\n"
1290
+ }]
1291
+ }],
1292
+ propDecorators: {
1293
+ errorMsg: [{ type: Input }],
1294
+ displayError: [{ type: Input }]
1295
+ }
1296
+ });
1297
+ var FieldErrorDisplayModule = class FieldErrorDisplayModule {
1298
+ static {
1299
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1300
+ minVersion: "12.0.0",
1301
+ version: "22.2.0",
1302
+ ngImport: i0,
1303
+ type: FieldErrorDisplayModule,
1304
+ deps: [],
1305
+ target: i0.ɵɵFactoryTarget.NgModule
1306
+ });
1307
+ }
1308
+ static {
1309
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
1310
+ minVersion: "14.0.0",
1311
+ version: "22.2.0",
1312
+ ngImport: i0,
1313
+ type: FieldErrorDisplayModule,
1314
+ declarations: [FieldErrorDisplayComponent],
1315
+ imports: [CommonModule],
1316
+ exports: [FieldErrorDisplayComponent]
1317
+ });
1318
+ }
1319
+ static {
1320
+ this.ɵinj = i0.ɵɵngDeclareInjector({
1321
+ minVersion: "12.0.0",
1322
+ version: "22.2.0",
1323
+ ngImport: i0,
1324
+ type: FieldErrorDisplayModule,
1325
+ imports: [CommonModule]
1326
+ });
1327
+ }
1328
+ };
1329
+ i0.ɵɵngDeclareClassMetadata({
1330
+ minVersion: "12.0.0",
1331
+ version: "22.2.0",
1332
+ ngImport: i0,
1333
+ type: FieldErrorDisplayModule,
1334
+ decorators: [{
1335
+ type: NgModule,
1336
+ args: [{
1337
+ declarations: [FieldErrorDisplayComponent],
1338
+ imports: [CommonModule],
1339
+ exports: [FieldErrorDisplayComponent]
1340
+ }]
1341
+ }]
1342
+ });
1343
+ export { CustomUploaderComponent, FieldErrorDisplayComponent, FieldErrorDisplayModule, MatchPassword, PASTED_IMAGE_MESSAGE, PasteGuard, ProfileImageCropperComponent, ProfileImageCropperModule, QuillHelper, ResourceHeaderComponent, ResourceHeaderModule, ValidateForm, appendQueryParam, clearQueryParams, clipboardHasImageFile, handleDateRangeSelection, isEmbeddedImageSrc };
449
1344
 
450
- class ProfileImageCropperComponent {
451
- constructor(cdr) {
452
- this.cdr = cdr;
453
- this.imageChangedEvent = '';
454
- this.croppedImage = '';
455
- this.imageSelectionEvent = new EventEmitter();
456
- this.closeEvent = new EventEmitter();
457
- this.fileChangeEvent = new EventEmitter();
458
- this.aspectRatio = 'auto';
459
- this.transform = {};
460
- this.canvasRotation = 0;
461
- this.showCropper = false;
462
- }
463
- onFileChange(event) {
464
- const input = event.target;
465
- if (input.files && input.files.length > 0) {
466
- this.imageChangedEvent = event;
467
- this.fileChangeEvent.emit(input.files[0].name);
468
- }
469
- }
470
- imageCropped(event) {
471
- const reader = new FileReader();
472
- reader.onloadend = () => {
473
- this.croppedImage = reader.result;
474
- this.cdr.detectChanges();
475
- };
476
- reader.readAsDataURL(event.blob);
477
- }
478
- imageLoaded() {
479
- this.showCropper = true;
480
- }
481
- rotateLeft() {
482
- this.canvasRotation--;
483
- this.flipAfterRotate();
484
- }
485
- rotateRight() {
486
- this.canvasRotation++;
487
- this.flipAfterRotate();
488
- }
489
- flipAfterRotate() {
490
- const flippedH = this.transform.flipH;
491
- const flippedV = this.transform.flipV;
492
- this.transform = {
493
- ...this.transform,
494
- flipH: flippedV,
495
- flipV: flippedH
496
- };
497
- }
498
- flipHorizontal() {
499
- this.transform = {
500
- ...this.transform,
501
- flipH: !this.transform.flipH
502
- };
503
- }
504
- flipVertical() {
505
- this.transform = {
506
- ...this.transform,
507
- flipV: !this.transform.flipV
508
- };
509
- }
510
- saveProfilePicture() {
511
- if (this.croppedImage) {
512
- this.imageSelectionEvent.emit(this.croppedImage);
513
- this.busy = true;
514
- }
515
- }
516
- onCloseModal() {
517
- this.closeEvent.emit();
518
- }
519
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfileImageCropperComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
520
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: ProfileImageCropperComponent, isStandalone: false, selector: "pw-image-cropper", inputs: { aspectRatio: "aspectRatio", dynamicData: "dynamicData" }, outputs: { imageSelectionEvent: "imageSelectionEvent", closeEvent: "closeEvent", fileChangeEvent: "fileChangeEvent" }, ngImport: i0, template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n Upload Pic\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" name=\"input_field_1\"\n aria-label=\"Input Field 1\"/>\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Left\">\n <i\n class=\"fa fa-undo-alt\"\n (click)=\"rotateLeft()\"\n (keydown.enter)=\"rotateLeft()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Right\">\n <i\n class=\"fa fa-redo-alt\"\n (click)=\"rotateRight()\"\n (keydown.enter)=\"rotateRight()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Horizontal\">\n <i\n class=\"fa fa-arrows-alt-h\"\n (click)=\"flipHorizontal()\"\n (keydown.enter)=\"flipHorizontal()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Vertical\">\n <i\n class=\"fa fa-arrows-alt-v\"\n (click)=\"flipVertical()\"\n (keydown.enter)=\"flipVertical()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-8\">\n @if (aspectRatio === 'auto') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [aspectRatio]=\"4 / 4\"\n [onlyScaleDown]=\"true\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'fullLogo') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"5 / 1.1\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'rectangular') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"3 / 1\"\n [onlyScaleDown]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'dynamic') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"false\"\n [resizeToWidth]=\"0\"\n [cropperStaticWidth]=\"0\"\n [cropperStaticHeight]=\"0\"\n [cropperMinWidth]=\"10\"\n [cropperMinHeight]=\"10\"\n [onlyScaleDown]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n [imageQuality]=\"100\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [style.display]=\"showCropper ? null : 'none'\">\n </image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'custom') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [aspectRatio]=\"4 / 3\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n </div>\n @if (croppedImage) {\n <div class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n alt=\"cropped.png\"\n width=\"128\" />\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <div class=\"float-end mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCloseModal()\">\n Close\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n Save\n </button>\n </div>\n </div>\n</section>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"], dependencies: [{ kind: "component", type: i1.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "cropperFrameAriaLabel", "output", "format", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "directive", type: i2.ButtonBusyDirective, selector: "[buttonBusy]", inputs: ["buttonBusy", "busyText"] }, { kind: "directive", type: i2.LazyImgDirective, selector: "img" }] }); }
521
- }
522
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfileImageCropperComponent, decorators: [{
523
- type: Component,
524
- args: [{ selector: 'pw-image-cropper', standalone: false, template: "<section class=\"image-cropper\">\n <div class=\"row text-start\">\n <div class=\"col-12\">\n <div class=\"card-block pb-0\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"file-upload my-2 float-start\">\n <label for=\"custom-input\">\n Upload Pic\n <input id=\"custom-input\"\n type=\"file\"\n (change)=\"onFileChange($event)\" name=\"input_field_1\"\n aria-label=\"Input Field 1\"/>\n </label>\n </div>\n\n <div class=\"float-end m-2\">\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Left\">\n <i\n class=\"fa fa-undo-alt\"\n (click)=\"rotateLeft()\"\n (keydown.enter)=\"rotateLeft()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Rotate Right\">\n <i\n class=\"fa fa-redo-alt\"\n (click)=\"rotateRight()\"\n (keydown.enter)=\"rotateRight()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Horizontal\">\n <i\n class=\"fa fa-arrows-alt-h\"\n (click)=\"flipHorizontal()\"\n (keydown.enter)=\"flipHorizontal()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn btn-primary btn-sm mx-2\"\n title=\"Flip Vertical\">\n <i\n class=\"fa fa-arrows-alt-v\"\n (click)=\"flipVertical()\"\n (keydown.enter)=\"flipVertical()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-8\">\n @if (aspectRatio === 'auto') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [aspectRatio]=\"4 / 4\"\n [onlyScaleDown]=\"true\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'fullLogo') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"5 / 1.1\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'rectangular') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [aspectRatio]=\"3 / 1\"\n [onlyScaleDown]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'dynamic') {\n <div>\n <image-cropper\n [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"false\"\n [resizeToWidth]=\"0\"\n [cropperStaticWidth]=\"0\"\n [cropperStaticHeight]=\"0\"\n [cropperMinWidth]=\"10\"\n [cropperMinHeight]=\"10\"\n [onlyScaleDown]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n [imageQuality]=\"100\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [style.display]=\"showCropper ? null : 'none'\">\n </image-cropper>\n </div>\n }\n\n @if (aspectRatio === 'custom') {\n <div>\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\"\n [maintainAspectRatio]=\"true\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [aspectRatio]=\"4 / 3\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n alignImage=\"center\"\n outputType=\"base64\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n [imageQuality]=\"100\"\n [style.display]=\"showCropper ? null : 'none'\"></image-cropper>\n </div>\n }\n </div>\n @if (croppedImage) {\n <div class=\"col-4 mt-2\">\n <img [src]=\"croppedImage\"\n class=\"cropped-image\"\n alt=\"cropped.png\"\n width=\"128\" />\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <div class=\"float-end mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCloseModal()\">\n Close\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"saveProfilePicture()\"\n [buttonBusy]=\"busy\">\n Save\n </button>\n </div>\n </div>\n</section>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.image-cropper label{background:var(--first);border-radius:5px;color:#fff;display:table;font-size:13px;font-weight:500;padding:7px}.image-cropper input[type=file]{display:none}.cropped-image{max-height:390px!important}.card-footer{background-color:transparent;left:0}\n"] }]
525
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { imageSelectionEvent: [{
526
- type: Output
527
- }], closeEvent: [{
528
- type: Output
529
- }], fileChangeEvent: [{
530
- type: Output
531
- }], aspectRatio: [{
532
- type: Input
533
- }], dynamicData: [{
534
- type: Input
535
- }] } });
536
-
537
- class CustomUploaderComponent extends AppBaseComponent {
538
- set previewData(value) {
539
- this._previewData = value;
540
- this.previewBroken = false;
541
- // Re-uploading a field reuses the same deterministic filename
542
- // (logo_main-<shard>_<date>.webp), so the URL is identical and the browser
543
- // would keep showing the cached old image. Bump a cache-buster on every
544
- // (re)bind so the <img> re-fetches the new file without a page refresh.
545
- this.cacheBust = Date.now();
546
- }
547
- get previewData() {
548
- return this._previewData;
549
- }
550
- // Display URL with a cache-buster (see setter). The href/preview link uses the
551
- // clean url; only the rendered <img src> needs busting.
552
- get previewSrc() {
553
- const url = this._previewData?.url;
554
- if (!url) {
555
- return url;
556
- }
557
- // Blob URLs (`blob:https://…`) don't support query strings — appending
558
- // a cache-buster makes the browser fail to load them and onImgError
559
- // flips previewBroken so the modal silently falls back to the empty
560
- // dropzone after every upload. Only bust real HTTP(S) URLs.
561
- if (url.startsWith('blob:') || url.startsWith('data:')) {
562
- return url;
563
- }
564
- return `${url}${url.includes('?') ? '&' : '?'}v=${this.cacheBust}`;
565
- }
566
- constructor(injector, modalService, document) {
567
- super(injector);
568
- this.modalService = modalService;
569
- this.document = document;
570
- this.saveEvent = new EventEmitter();
571
- this.cacheBust = Date.now();
572
- this.previewBroken = false;
573
- this.aspectRatio = 'auto';
574
- this.uploadedFile = null;
575
- }
576
- deleteExistingFile() {
577
- HelperService.raiseDeletePopup().then(rep => {
578
- if (rep.value) {
579
- this.previewData = null;
580
- // Clear any in-flight File the cropper may have set so the
581
- // delete save emits file: null (which the parent maps to a
582
- // remove_<field> flag). Without this, the parent kept reusing
583
- // the prior uploadedFile and the page stayed stale until
584
- // a manual refresh.
585
- this.uploadedFile = null;
586
- this.onSaveFile();
587
- }
588
- });
589
- }
590
- onSaveFile() {
591
- this.buttonBusy = true;
592
- // Always emit the freshly-cropped File (set by onImageSelection); on delete
593
- // it is null, which the parent maps to a remove_<field> flag. The previous
594
- // `previewData?.url ? previewData : ...` branch re-sent the existing
595
- // {url,...} object on a re-upload — which the API rejects as not a
596
- // Rack::Multipart::UploadedFile ("<field> is invalid"). Re-upload was only
597
- // reachable once the Change affordance + broken-image fallback were added.
598
- this.saveEvent.emit({
599
- file: this.uploadedFile,
600
- name: this.controlName
601
- });
602
- }
603
- // modal image cropper
604
- onFileChange(value) {
605
- this.selectedFileName = value;
606
- }
607
- dataURLtoBlob(dataUrl) {
608
- const arr = dataUrl?.split(',');
609
- // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
610
- const mime = /^[A-Z]*[a-z]*:(.*?);[A-Z]*/.exec(arr[0])?.[1];
611
- const bStr = atob(arr[1]);
612
- let n = bStr.length;
613
- const u8arr = new Uint8Array(n);
614
- // eslint-disable-next-line no-plusplus
615
- while (n--) {
616
- u8arr[n] = bStr.charCodeAt(n);
617
- }
618
- return new Blob([u8arr], { type: mime });
619
- }
620
- onImageSelection(event) {
621
- const blob = this.dataURLtoBlob(event);
622
- const file = new File([blob], this.selectedFileName);
623
- this.uploadedFile = file;
624
- this.onSaveFile();
625
- }
626
- openModal(content) {
627
- this.modalService.open(content, { centered: true, windowClass: 'modal-holder' });
628
- }
629
- clearValues() {
630
- this.uploadedFile = null;
631
- this.selectedFileName = null;
632
- this.updateHeight();
633
- }
634
- onClose() {
635
- this.modalService.dismissAll();
636
- }
637
- updateHeight() {
638
- // wait for update card height
639
- setTimeout(() => {
640
- this.onImgChange();
641
- });
642
- }
643
- // A preview image that fails to load (404, ORB-blocked CDN response, or a
644
- // backend-computed URL for a variant that was never uploaded) must NOT render
645
- // as an "image not available" placeholder — fall back to the empty dropzone so
646
- // the tile reads as "ready to upload" (same behaviour as product-details).
647
- onImgError() {
648
- this.previewBroken = true;
649
- this.matchTileHeights();
650
- }
651
- onImgChange() {
652
- this.matchTileHeights();
653
- }
654
- matchTileHeights() {
655
- const el = this.document.querySelectorAll('pw-domain-config-interface,pw-domain-config-build div[matchheight="card"]');
656
- el.forEach((item) => {
657
- HelperService.matchHeights(item, 'card');
658
- });
659
- }
660
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: CustomUploaderComponent, deps: [{ token: i0.Injector }, { token: i1$1.NgbModal }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
661
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: CustomUploaderComponent, isStandalone: false, selector: "pw-custom-uploader", inputs: { controlName: "controlName", previewData: "previewData", aspectRatio: "aspectRatio", title: "title" }, outputs: { saveEvent: "saveEvent" }, usesInheritance: true, ngImport: i0, template: "<div class=\"pw-uploader-card\">\n <!-- empty state \u2014 dashed dropzone (admin-edit-form.md \u00A7 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('Upload ' + title) : 'Upload an image'\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n <i class=\"fas fa-upload\" aria-hidden=\"true\"></i>\n <span class=\"dropzone-title\">Upload an image</span>\n <span class=\"dropzone-hint\">PNG or JPG</span>\n </div>\n }\n <!-- populated \u2014 framed image + Change / Delete affordances -->\n @if (previewData?.url && !previewBroken) {\n <div class=\"pw-uploader-preview\">\n <a [href]=\"previewData?.url\"\n target=\"_blank\"\n class=\"pw-uploader-thumb\">\n <img [src]=\"previewSrc\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgError()\"\n class=\"img-fluid pw-uploader-img\" />\n </a>\n <div class=\"pw-uploader-actions\">\n <a class=\"pw-uploader-change\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n <i\n appendTo=\"body\"\n pTooltip=\"Delete\"\n tooltipPosition=\"top\"\n (click)=\"deleteExistingFile()\"\n (keydown.enter)=\"deleteExistingFile()\"\n (keydown.space)=\"deleteExistingFile()\"\n class=\"fa fa-trash delete-icon\"\n aria-hidden=\"true\"\n ></i>\n </div>\n </div>\n }\n</div>\n<!-- image cropper -->\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ title }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n [aspectRatio]=\"aspectRatio\"\n (fileChangeEvent)=\"onFileChange($event)\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.pw-uploader-card{border:0;background:transparent;min-height:180px;padding:0}.pw-uploader-dropzone{width:100%;min-height:180px;padding:1rem}.pw-uploader-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:180px;padding:1rem;border:1px solid #e2e5ea;border-radius:8px;background:#fff}.pw-uploader-thumb{display:flex;align-items:center;justify-content:center;max-width:100%}.pw-uploader-img{max-height:120px;object-fit:contain}.pw-uploader-actions{display:flex;align-items:center;gap:1rem}.pw-uploader-change{color:var(--first, #1769e1);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none}.pw-uploader-change:hover{text-decoration:underline}.delete-icon{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i2$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "directive", type: i2.LazyImgDirective, selector: "img" }, { kind: "component", type: ProfileImageCropperComponent, selector: "pw-image-cropper", inputs: ["aspectRatio", "dynamicData"], outputs: ["imageSelectionEvent", "closeEvent", "fileChangeEvent"] }, { kind: "pipe", type: i5.TranslocoPipe, name: "transloco" }] }); }
662
- }
663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: CustomUploaderComponent, decorators: [{
664
- type: Component,
665
- args: [{ selector: 'pw-custom-uploader', standalone: false, template: "<div class=\"pw-uploader-card\">\n <!-- empty state \u2014 dashed dropzone (admin-edit-form.md \u00A7 2). Also shown when a\n preview URL fails to load (404 / ORB-blocked / phantom variant) so a broken\n logo reads as \"ready to upload\" instead of an image-not-available placeholder. -->\n @if (!previewData?.url || previewBroken) {\n <div class=\"logo-dropzone pw-uploader-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"title ? ('Upload ' + title) : 'Upload an image'\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n <i class=\"fas fa-upload\" aria-hidden=\"true\"></i>\n <span class=\"dropzone-title\">Upload an image</span>\n <span class=\"dropzone-hint\">PNG or JPG</span>\n </div>\n }\n <!-- populated \u2014 framed image + Change / Delete affordances -->\n @if (previewData?.url && !previewBroken) {\n <div class=\"pw-uploader-preview\">\n <a [href]=\"previewData?.url\"\n target=\"_blank\"\n class=\"pw-uploader-thumb\">\n <img [src]=\"previewSrc\"\n alt=\"\"\n (load)=\"onImgChange()\"\n (error)=\"onImgError()\"\n class=\"img-fluid pw-uploader-img\" />\n </a>\n <div class=\"pw-uploader-actions\">\n <a class=\"pw-uploader-change\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"openModal(content)\"\n (keydown.enter)=\"openModal(content)\">\n {{ 'User.Profile.Change' | transloco }}\n </a>\n <i\n appendTo=\"body\"\n pTooltip=\"Delete\"\n tooltipPosition=\"top\"\n (click)=\"deleteExistingFile()\"\n (keydown.enter)=\"deleteExistingFile()\"\n (keydown.space)=\"deleteExistingFile()\"\n class=\"fa fa-trash delete-icon\"\n aria-hidden=\"true\"\n ></i>\n </div>\n </div>\n }\n</div>\n<!-- image cropper -->\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ title }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n [aspectRatio]=\"aspectRatio\"\n (fileChangeEvent)=\"onFileChange($event)\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.pw-uploader-card{border:0;background:transparent;min-height:180px;padding:0}.pw-uploader-dropzone{width:100%;min-height:180px;padding:1rem}.pw-uploader-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:180px;padding:1rem;border:1px solid #e2e5ea;border-radius:8px;background:#fff}.pw-uploader-thumb{display:flex;align-items:center;justify-content:center;max-width:100%}.pw-uploader-img{max-height:120px;object-fit:contain}.pw-uploader-actions{display:flex;align-items:center;gap:1rem}.pw-uploader-change{color:var(--first, #1769e1);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none}.pw-uploader-change:hover{text-decoration:underline}.delete-icon{cursor:pointer}\n"] }]
666
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i1$1.NgbModal }, { type: Document, decorators: [{
667
- type: Inject,
668
- args: [DOCUMENT]
669
- }] }], propDecorators: { saveEvent: [{
670
- type: Output
671
- }], controlName: [{
672
- type: Input
673
- }], previewData: [{
674
- type: Input
675
- }], aspectRatio: [{
676
- type: Input
677
- }], title: [{
678
- type: Input
679
- }] } });
680
-
681
- /**
682
- * Lightweight module for pw-image-cropper component
683
- *
684
- * Minimal dependencies - only CommonModule, ImageCropperModule, DirectivesModule
685
- * Use this instead of ResourceSharedComponentsModule when you only need image cropping
686
- */
687
- class ProfileImageCropperModule {
688
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfileImageCropperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
689
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: ProfileImageCropperModule, declarations: [ProfileImageCropperComponent, CustomUploaderComponent], imports: [CommonModule,
690
- CoreTranslocoModule,
691
- ButtonModule,
692
- TooltipModule,
693
- ImageCropperModule, // for <image-cropper>
694
- DirectivesModule // for [buttonBusy] directive
695
- ], exports: [ProfileImageCropperComponent, CustomUploaderComponent] }); }
696
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfileImageCropperModule, imports: [CommonModule,
697
- CoreTranslocoModule,
698
- ButtonModule,
699
- TooltipModule,
700
- ImageCropperModule, // for <image-cropper>
701
- DirectivesModule // for [buttonBusy] directive
702
- ] }); }
703
- }
704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfileImageCropperModule, decorators: [{
705
- type: NgModule,
706
- args: [{
707
- declarations: [ProfileImageCropperComponent, CustomUploaderComponent],
708
- imports: [
709
- CommonModule,
710
- CoreTranslocoModule,
711
- ButtonModule,
712
- TooltipModule,
713
- ImageCropperModule, // for <image-cropper>
714
- DirectivesModule // for [buttonBusy] directive
715
- ],
716
- exports: [ProfileImageCropperComponent, CustomUploaderComponent]
717
- }]
718
- }] });
719
-
720
- class ResourceHeaderComponent extends AppBaseComponent {
721
- constructor(injector, document, adminService, modalService, cdr) {
722
- super(injector);
723
- this.document = document;
724
- this.adminService = adminService;
725
- this.modalService = modalService;
726
- this.cdr = cdr;
727
- this.isScrolled = false;
728
- this.open = false;
729
- this.logo = '/assets/img/landing-page/site-logo.png'; // Static fallback for LCP optimization
730
- this.navbarItems = this.appConfig?.pages_config?.navbar?.items;
731
- this.domainId = this.appConfig?.domain_id;
732
- this.contrastImageUrl = this.appConfig?.company?.logos?.main_contrast?.url;
733
- this.darkImageUrl = this.appConfig?.company?.logos?.main_dark?.url;
734
- this.editingNavbar = {
735
- items: []
736
- };
737
- this.canEditResourcesValue = false;
738
- }
739
- ngOnInit() {
740
- // Subscribe to appConfig changes to update logo dynamically
741
- this.appConfigService.appConfig$.subscribe(config => {
742
- if (config?.company?.logos) {
743
- const isAboutUs = this.router.url?.includes('/about-us');
744
- const logos = config.company.logos;
745
- // Use smaller version for better performance (100x100 instead of 1200x264)
746
- this.logo = isAboutUs
747
- ? logos.main_contrast?.url || '/assets/img/landing-page/site-logo.png'
748
- : logos.main_dark?.url || '/assets/img/landing-page/site-logo.png';
749
- }
750
- this.cdr.markForCheck();
751
- });
752
- if (this.userLoggedIn) {
753
- this.localStorage.getItem$('product').subscribe(res => {
754
- const data = res ? JSON.parse(res) : null;
755
- this.id = data?.subscriptionId;
756
- this.cdr.markForCheck();
757
- });
758
- }
759
- }
760
- ngOnChanges(changes) {
761
- if (changes['user'] || changes['userLoggedIn']) {
762
- if (this.userLoggedIn && this.user) {
763
- this.updateCanEditResourcesValue();
764
- }
765
- }
766
- }
767
- openLogoEditModal() {
768
- this.modalService.open(this.logoEditModal, { centered: true, size: 'md' });
769
- }
770
- onSaveLogo(event) {
771
- const formData = new FormData();
772
- formData.append('subscription_id', this.id);
773
- if (event.file instanceof File) {
774
- formData.append(this.isScrolled ? 'logo_main_contrast' : 'logo_main_dark', event.file);
775
- }
776
- else {
777
- formData.append(this.isScrolled ? 'remove_logo_main_contrast' : 'remove_logo_main_dark', 'true');
778
- }
779
- this.adminService.updateDomainConfig(this.domainId, formData).subscribe(() => {
780
- if (event.file) {
781
- this.logo = URL.createObjectURL(event.file);
782
- if (this.isScrolled) {
783
- this.contrastImageUrl = URL.createObjectURL(event.file);
784
- }
785
- else {
786
- this.darkImageUrl = URL.createObjectURL(event.file);
787
- }
788
- this.modalService.dismissAll();
789
- }
790
- this.toast.success(event.file ? 'Logo updated' : 'Logo removed');
791
- this.cdr.markForCheck();
792
- });
793
- }
794
- onScroll() {
795
- clearTimeout(this.scrollTimeout);
796
- this.scrollTimeout = setTimeout(() => {
797
- requestAnimationFrame(() => {
798
- const isAboutUs = this.router?.url?.includes('/about-us');
799
- const shouldScroll = window.scrollY > 150;
800
- this.isScrolled = shouldScroll;
801
- if (!isAboutUs) {
802
- // Use smaller versions for better performance
803
- const logos = this.appConfig?.company?.logos;
804
- const newLogo = shouldScroll
805
- ? (logos?.main_contrast?.url ??
806
- this.contrastImageUrl ??
807
- '/assets/img/landing-page/site-logo.png')
808
- : (logos?.main_dark?.url ??
809
- this.darkImageUrl ??
810
- '/assets/img/landing-page/site-logo.png');
811
- if (this.logo !== newLogo) {
812
- this.logo = newLogo;
813
- }
814
- }
815
- if (window.innerWidth < 768) {
816
- this.open = false;
817
- const collapseElement = this.navbarCollapse?.nativeElement;
818
- if (collapseElement?.classList.contains('show')) {
819
- collapseElement.classList.remove('show');
820
- }
821
- }
822
- // Close all dropdowns when scrolling
823
- this.closeAllDropdowns();
824
- });
825
- }, 50);
826
- }
827
- onDocumentClick(event) {
828
- // Close all dropdowns when clicking outside
829
- const target = event.target;
830
- if (!target.closest('.nav-item') &&
831
- !target.closest('.popup') &&
832
- !target.closest('.sign-btn')) {
833
- this.closeAllDropdowns();
834
- }
835
- }
836
- closeAllDropdowns() {
837
- if (this.navbarItems) {
838
- this.navbarItems.forEach(item => {
839
- if (item.open) {
840
- item.open = false;
841
- }
842
- });
843
- }
844
- }
845
- openDropdown(item) {
846
- // Close other dropdowns first
847
- this.navbarItems.forEach(navItem => {
848
- if (navItem !== item) {
849
- navItem.open = false;
850
- }
851
- });
852
- item.open = true;
853
- }
854
- onNavbarItemClick(item, event) {
855
- if (item?.subtitles?.length) {
856
- event.preventDefault();
857
- item.open = !item.open;
858
- }
859
- }
860
- onDropdownItemClick(item) {
861
- item.open = false;
862
- }
863
- async openEditNavbarModal() {
864
- const navbarConfig = this.appConfig.pages_config?.navbar ?? {};
865
- navbarConfig.items = navbarConfig.items ?? [];
866
- this.editingNavbar = JSON.parse(JSON.stringify(navbarConfig));
867
- try {
868
- // Dynamically import EditNavbarModalComponent (includes DragDropModule)
869
- // This only loads when the edit modal is opened (user is logged in with edit permissions)
870
- // Reduces bundle size for landing pages where users aren't logged in
871
- const { EditNavbarModalComponent } = await import('./posiwise-utils-edit-navbar-modal.component-DC6PY39N.mjs');
872
- const modalRef = this.modalService.open(EditNavbarModalComponent, {
873
- size: 'lg',
874
- centered: true,
875
- windowClass: 'modal-holder'
876
- });
877
- modalRef.componentInstance.editingNavbar = this.editingNavbar;
878
- modalRef.componentInstance.save.subscribe(updatedNavbar => {
879
- this.saveNavbarLinks(modalRef, updatedNavbar);
880
- });
881
- modalRef.componentInstance.closeEvent.subscribe(() => {
882
- modalRef.close();
883
- });
884
- }
885
- catch (error) {
886
- console.error('Failed to load edit navbar modal:', error);
887
- this.toast.error('Failed to open edit modal. Please try again.');
888
- }
889
- }
890
- saveNavbarLinks(modal, updatedNavbar) {
891
- const navbarToSave = updatedNavbar || this.editingNavbar;
892
- const updatedConfig = {
893
- navbar: navbarToSave,
894
- subscription_id: this.id
895
- };
896
- this.adminService
897
- .updateDomainConfig(this.appConfig?.domain_id, updatedConfig)
898
- .subscribe(() => {
899
- this.toast.success('Navbar links updated');
900
- this.navbarItems = [...navbarToSave.items];
901
- // Update the appConfig to reflect the saved changes
902
- this.appConfig.pages_config = this.appConfig.pages_config ?? {};
903
- this.appConfig.pages_config.navbar = { ...navbarToSave };
904
- modal.close();
905
- this.cdr.markForCheck();
906
- });
907
- }
908
- updateCanEditResourcesValue() {
909
- this.canEditResourcesValue = HelperService.canEditResources(this.user, this.userLoggedIn, this.permissionService);
910
- }
911
- canEditResources() {
912
- return this.canEditResourcesValue;
913
- }
914
- navigateToLogin() {
915
- window.location.href = '/login';
916
- }
917
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ResourceHeaderComponent, deps: [{ token: i0.Injector }, { token: DOCUMENT }, { token: i1$2.AdminService }, { token: i1$1.NgbModal }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
918
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: ResourceHeaderComponent, isStandalone: false, selector: "pw-resource-header", inputs: { user: "user", userLoggedIn: "userLoggedIn" }, host: { listeners: { "window:scroll": "onScroll()", "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "navbarCollapse", first: true, predicate: ["collapsibleNavbar"], descendants: true }, { propertyName: "logoEditModal", first: true, predicate: ["logoEditModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </li>\n </ul>\n </div>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-2 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>", styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}@media(min-width:500px){.navbar-nav .nav-item button{margin-top:10px}}@media(min-width:1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media(max-width:1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media(max-width:500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdown-container{position:relative;display:inline-block}}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important;background:var(--first)!important;color:#fff!important;border-radius:var(--public-btn-radius)!important;border:0!important;height:40px!important;padding:0 20px!important;font-size:14px!important;font-weight:600!important;text-transform:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease!important}.resource-header .sign-btn:hover,.resource-header .sign-header-btn:hover{background:color-mix(in srgb,var(--first) 88%,#000 12%)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px -12px var(--first)!important}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.LazyImgDirective, selector: "img" }, { kind: "component", type: CustomUploaderComponent, selector: "pw-custom-uploader", inputs: ["controlName", "previewData", "aspectRatio", "title"], outputs: ["saveEvent"] }] }); }
919
- }
920
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ResourceHeaderComponent, decorators: [{
921
- type: Component,
922
- args: [{ selector: 'pw-resource-header', standalone: false, template: "<nav class=\"navbar navbar-expand-md navbar-dark fixed-top primary-nav-bg-color resource-header\"\n id=\"banner\">\n <div class=\"container container-wrapper banner-section\">\n\n <!-- Toggler/collapsibe Button -->\n <button class=\"navbar-toggler header-menu-bar\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n data-bs-toggle=\"collapse\"\n data-bs-target=\"#collapsibleNavbar\">\n <img src=\"/assets/img/products/trial/navbar-toggle-icon.png\"\n class=\"img-fluid navbar-toggle-icon\"\n alt=\"\" />\n </button>\n\n <!-- Mobile Logo -->\n <div class=\"d-md-none mb-icon\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openLogoEditModal()\"\n (keydown.enter)=\"openLogoEditModal()\"\n (keydown.space)=\"openLogoEditModal()\"\n title=\"Edit Logo\"></i>\n }\n\n\n <!-- Navbar links -->\n <div class=\"collapse navbar-collapse mt-3 mt-md-0\"\n id=\"collapsibleNavbar\"\n #collapsibleNavbar>\n <div class=\"row align-items-center w-100\">\n\n <!-- Always occupy 3 columns for logo -->\n <div class=\"col-md-2 d-none d-md-flex align-items-center\">\n <div>\n <img src=\"/assets/img/landing-page/site-logo.png\"\n [src]=\"logo || '/assets/img/landing-page/site-logo.png'\"\n routerLink=\"/\"\n alt=\"logo\"\n class=\"img-fluid logo_img\"\n width=\"100\"\n height=\"100\"\n loading=\"eager\"\n fetchpriority=\"high\"\n sizes=\"100px\" />\n </div>\n </div>\n\n\n <div class=\"col-md-8 d-flex align-items-md-center\">\n @if (canEditResourcesValue) {\n <i\n class=\"fa fa-edit in-page-edit-icon cursor-pointer text-black me-3\"\n (click)=\"openEditNavbarModal()\"\n (keydown.enter)=\"openEditNavbarModal()\"\n (keydown.space)=\"openEditNavbarModal()\"\n title=\"Edit Navbar Links\"></i>\n }\n <div class=\"flex-grow-1 d-flex justify-content-md-center\">\n <ul #anchorLinks\n class=\"navbar-nav flex gap-4 me-0 wow fadeInUp position-relative\"\n data-wow-duration=\"2s\">\n @for (item of navbarItems; track item) {\n <li class=\"nav-item\">\n <div class=\"dropdown-container\"\n (mouseenter)=\"openDropdown(item)\">\n <a\n class=\"nav-link\"\n [attr.href]=\"item.subtitles?.length ? '#' : item.path\"\n [ngClass]=\"{ 'scrolled-nav-link': isScrolled }\"\n (click)=\"onNavbarItemClick(item, $event)\"\n >\n {{ item?.title }}\n @if (item.subtitles.length > 0 && item.open) {\n <i class=\"fa-solid fa-caret-down\"></i>\n }\n </a>\n @if (item.subtitles.length > 0 && item.open) {\n <div class=\"popup position-absolute\"\n >\n <ul>\n @for (sub of item.subtitles; track sub) {\n <li\n [routerLink]=\"sub.path\"\n class=\"dropdownItem\"\n (click)=\"onDropdownItemClick(item)\"\n (keydown.enter)=\"onDropdownItemClick(item)\"\n (keydown.space)=\"onDropdownItemClick(item)\"\n >\n {{ sub.title }}\n </li>\n }\n </ul>\n </div>\n }\n </div>\n </li>\n }\n\n <li class=\"nav-item ms-2 mb-3 d-flex d-md-none\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </li>\n </ul>\n </div>\n </div>\n\n <!-- Always 3 columns for login -->\n <div class=\"col-md-2 d-none d-md-flex justify-content-end\">\n <a class=\"sign-btn sign-header-btn\"\n (click)=\"navigateToLogin()\">Log In</a>\n </div>\n\n </div>\n </div>\n </div>\n</nav>\n\n<ng-template #logoEditModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Logo</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <pw-custom-uploader\n [title]=\"'Main Logo'\"\n [controlName]=\"'logo_main'\"\n [aspectRatio]=\"'fullLogo'\"\n [previewData]=\"{ url: logo, name: 'logo_main.png' }\"\n (saveEvent)=\"onSaveLogo($event)\">\n </pw-custom-uploader>\n </div>\n</ng-template>", styles: [".navbar-custom-background{background-color:#00000080;box-shadow:2px 2px 15px 2px #0000001f;transition:width 2s,height 2s,transform 2s background-color .5s ease;z-index:9999}.fixed-top{position:fixed!important}.primary-button{background-color:#000;border-radius:50px;color:#fff;font: 600 16.3px Montserrat-Regular,sans-serif;padding:5px 16px!important;width:auto;display:flex;gap:15px;align-items:center;justify-content:space-between}.logo_img{width:60%!important;min-width:159px!important}.navbar-toggle-icon{width:25px}.navbar-nav .nav-link{display:inline-flex!important;white-space:nowrap;gap:4px}.fa-caret-down{font-family:\"Font Awesome 6 Pro\",sans-serif;font-weight:900}.popup{top:90%;background-color:transparent;padding:10px;z-index:1000}.popup ul{list-style-type:none;padding:0;margin:0}.popup ul li{padding:5px 10px;font: 500 14px Montserrat-Regular,sans-serif}.dropdownItem{cursor:pointer}.rotate{transform:rotate(180deg)}.dropdown-container{position:relative;display:inline-block}.navbar-nav{visibility:visible!important;display:flex!important}.nav-link{text-transform:uppercase}@media(min-width:500px){.navbar-nav .nav-item button{margin-top:10px}}@media(min-width:1200px){.navbar-nav .nav-item .nav-link{padding-bottom:0!important;padding-top:0!important}.popup{top:3.4rem!important;background-color:transparent;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.router-link-active{color:#000!important}}@media(max-width:1200px){.navbar-nav .nav-item .nav-link{font-size:15px!important}.popup ul li{color:#fff;font: 500 14px Montserrat-Regular,sans-serif;cursor:pointer;border-bottom:1px solid #eee}.popup ul li:last-child{border-bottom:none}.popup ul li:hover{background-color:#f1f1f1}.mb-icon{width:200px}.container-wrapper{padding:10px 20px!important}.dropdown-container{position:relative;display:inline-block}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}}@media(max-width:500px){.logo_img{width:60%!important;margin-left:auto;margin-right:0;display:block;transition:margin .5s ease,width .5s ease}.navbar-nav{background-color:var(--first);border-top:3px solid rgb(254,209,54);color:#fff;margin-top:5px;z-index:1}.navbar-nav .nav-item .nav-link{font-size:100%;font-weight:500;padding:.7em 1em!important}.popup{top:0%!important;background-color:var(--first)!important;left:10rem;padding:10px;z-index:1000;transition:opacity .3s ease-in-out}.popup ul{list-style-type:none;padding:0;margin:0}.dropdown-container{position:relative;display:inline-block}}.resource-header .nav-link.scrolled-nav-link{color:#fff!important}.resource-header .sign-btn,.resource-header .sign-header-btn{text-decoration:none!important;background:var(--first)!important;color:#fff!important;border-radius:var(--public-btn-radius)!important;border:0!important;height:40px!important;padding:0 20px!important;font-size:14px!important;font-weight:600!important;text-transform:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease!important}.resource-header .sign-btn:hover,.resource-header .sign-header-btn:hover{background:color-mix(in srgb,var(--first) 88%,#000 12%)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px -12px var(--first)!important}\n"] }]
923
- }], ctorParameters: () => [{ type: i0.Injector }, { type: Document, decorators: [{
924
- type: Inject,
925
- args: [DOCUMENT]
926
- }] }, { type: i1$2.AdminService }, { type: i1$1.NgbModal }, { type: i0.ChangeDetectorRef }], propDecorators: { navbarCollapse: [{
927
- type: ViewChild,
928
- args: ['collapsibleNavbar']
929
- }], logoEditModal: [{
930
- type: ViewChild,
931
- args: ['logoEditModal']
932
- }], user: [{
933
- type: Input
934
- }], userLoggedIn: [{
935
- type: Input
936
- }], onScroll: [{
937
- type: HostListener,
938
- args: ['window:scroll', []]
939
- }], onDocumentClick: [{
940
- type: HostListener,
941
- args: ['document:click', ['$event']]
942
- }] } });
943
-
944
- /**
945
- * ResourceHeaderModule - Optimized
946
- * DragDropModule removed - now lazy-loaded only when edit modal opens
947
- * This reduces bundle size for landing pages where users aren't logged in
948
- */
949
- class ResourceHeaderModule {
950
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ResourceHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
951
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: ResourceHeaderModule, declarations: [ResourceHeaderComponent], imports: [CommonModule,
952
- FormsModule,
953
- RouterModule,
954
- NgbModalModule,
955
- NgbTooltipModule,
956
- CoreTranslocoModule,
957
- DirectivesModule,
958
- PipesModule,
959
- AdminModuleUtilsModule,
960
- ProfileImageCropperModule], exports: [ResourceHeaderComponent] }); }
961
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ResourceHeaderModule, imports: [CommonModule,
962
- FormsModule,
963
- RouterModule,
964
- NgbModalModule,
965
- NgbTooltipModule,
966
- CoreTranslocoModule,
967
- DirectivesModule,
968
- PipesModule,
969
- AdminModuleUtilsModule,
970
- ProfileImageCropperModule] }); }
971
- }
972
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ResourceHeaderModule, decorators: [{
973
- type: NgModule,
974
- args: [{
975
- declarations: [ResourceHeaderComponent],
976
- imports: [
977
- CommonModule,
978
- FormsModule,
979
- RouterModule,
980
- NgbModalModule,
981
- NgbTooltipModule,
982
- CoreTranslocoModule,
983
- DirectivesModule,
984
- PipesModule,
985
- AdminModuleUtilsModule,
986
- ProfileImageCropperModule
987
- ],
988
- exports: [ResourceHeaderComponent]
989
- }]
990
- }] });
991
-
992
- class FieldErrorDisplayComponent {
993
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FieldErrorDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
994
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: FieldErrorDisplayComponent, isStandalone: false, selector: "pw-field-error-display", inputs: { errorMsg: "errorMsg", displayError: "displayError" }, ngImport: i0, template: "@if (displayError) {\n <div>\n <div class=\"text-danger\">\n {{ errorMsg }}\n </div>\n </div>\n}\n\n" }); }
995
- }
996
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FieldErrorDisplayComponent, decorators: [{
997
- type: Component,
998
- args: [{ selector: 'pw-field-error-display', standalone: false, template: "@if (displayError) {\n <div>\n <div class=\"text-danger\">\n {{ errorMsg }}\n </div>\n </div>\n}\n\n" }]
999
- }], propDecorators: { errorMsg: [{
1000
- type: Input
1001
- }], displayError: [{
1002
- type: Input
1003
- }] } });
1004
-
1005
- /**
1006
- * Standalone module for FieldErrorDisplayComponent.
1007
- * Import this lightweight module instead of SharedComponentsModule
1008
- * when you only need field error display functionality.
1009
- */
1010
- class FieldErrorDisplayModule {
1011
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FieldErrorDisplayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1012
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: FieldErrorDisplayModule, declarations: [FieldErrorDisplayComponent], imports: [CommonModule], exports: [FieldErrorDisplayComponent] }); }
1013
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FieldErrorDisplayModule, imports: [CommonModule] }); }
1014
- }
1015
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FieldErrorDisplayModule, decorators: [{
1016
- type: NgModule,
1017
- args: [{
1018
- declarations: [FieldErrorDisplayComponent],
1019
- imports: [CommonModule],
1020
- exports: [FieldErrorDisplayComponent]
1021
- }]
1022
- }] });
1023
-
1024
- /**
1025
- * Generated bundle index. Do not edit.
1026
- */
1027
-
1028
- export { CustomUploaderComponent, FieldErrorDisplayComponent, FieldErrorDisplayModule, MatchPassword, ProfileImageCropperComponent, ProfileImageCropperModule, QuillHelper, ResourceHeaderComponent, ResourceHeaderModule, ValidateForm, appendQueryParam, clearQueryParams, handleDateRangeSelection };
1029
- //# sourceMappingURL=posiwise-utils.mjs.map
1345
+ //# sourceMappingURL=posiwise-utils.mjs.map