@pine-ds/icons 9.5.1 → 9.6.1

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.
Files changed (34) hide show
  1. package/components/pds-icon.js +118 -108
  2. package/components/pds-icon.js.map +1 -1
  3. package/dist/cheatsheet.html +7 -5
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/pds-icon.cjs.entry.js +117 -107
  6. package/dist/cjs/pds-icon.cjs.entry.js.map +1 -1
  7. package/dist/cjs/pds-icon.entry.cjs.js.map +1 -1
  8. package/dist/cjs/pds-icons.cjs.js +1 -1
  9. package/dist/collection/components/pds-icon/pds-icon.js +104 -71
  10. package/dist/collection/components/pds-icon/pds-icon.js.map +1 -1
  11. package/dist/collection/components/pds-icon/request.js +16 -39
  12. package/dist/collection/components/pds-icon/request.js.map +1 -1
  13. package/dist/docs.json +5 -5
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/pds-icon.entry.js +117 -107
  16. package/dist/esm/pds-icon.entry.js.map +1 -1
  17. package/dist/esm/pds-icons.js +1 -1
  18. package/dist/pds-icons/p-23a00a5a.entry.js +2 -0
  19. package/dist/pds-icons/p-23a00a5a.entry.js.map +1 -0
  20. package/dist/pds-icons/pds-icon.entry.esm.js.map +1 -1
  21. package/dist/pds-icons/pds-icons.esm.js +1 -1
  22. package/dist/pds-icons.json +11 -1
  23. package/dist/pds-icons.symbols.svg +2 -1
  24. package/dist/svg/switch-vertical.svg +1 -0
  25. package/dist/types/components/pds-icon/pds-icon.d.ts +7 -2
  26. package/dist/types/components/pds-icon/request.d.ts +1 -1
  27. package/dist/types/components.d.ts +2 -2
  28. package/icons/index.d.ts +2 -1
  29. package/icons/index.js +2 -1
  30. package/icons/index.mjs +2 -1
  31. package/icons/package.json +1 -1
  32. package/package.json +1 -1
  33. package/dist/pds-icons/p-560fb565.entry.js +0 -2
  34. package/dist/pds-icons/p-560fb565.entry.js.map +0 -1
@@ -49,7 +49,7 @@ const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;
49
49
  const pdsIconContent = new Map();
50
50
  const requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any
51
51
  let parser;
52
- const getSvgContent = (url, sanitize = false, retryCount = 0) => {
52
+ const getSvgContent = (url, sanitize = false) => {
53
53
  let req = requests.get(url);
54
54
  if (!req) {
55
55
  if (typeof fetch != 'undefined' && typeof document !== 'undefined') {
@@ -64,67 +64,44 @@ const getSvgContent = (url, sanitize = false, retryCount = 0) => {
64
64
  pdsIconContent.set(url, svg.outerHTML);
65
65
  }
66
66
  else {
67
- console.warn(`No SVG found in data URL: ${url}`);
68
67
  pdsIconContent.set(url, '');
69
68
  }
70
69
  }
71
70
  catch (error) {
72
- console.error(`Failed to parse SVG data URL: ${url}`, error);
73
71
  pdsIconContent.set(url, '');
74
72
  }
75
73
  return Promise.resolve();
76
74
  }
77
75
  else {
78
- // Add retry logic and better error handling
79
- req = fetch(url, {
80
- method: 'GET',
81
- headers: {
82
- 'Accept': 'image/svg+xml,text/plain,*/*'
83
- },
84
- cache: 'force-cache' // Aggressive caching for icons
85
- }).then((rsp) => {
76
+ // we don't have a request
77
+ req = fetch(url).then((rsp) => {
86
78
  if (rsp.ok) {
87
79
  return rsp.text().then((svgContent) => {
88
80
  if (svgContent && sanitize !== false) {
89
- svgContent = validateContent(svgContent);
90
- }
91
- if (svgContent) {
92
- pdsIconContent.set(url, svgContent);
93
- }
94
- else {
95
- console.warn(`Empty SVG content received for: ${url}`);
96
- pdsIconContent.set(url, '');
81
+ try {
82
+ svgContent = validateContent(svgContent);
83
+ }
84
+ catch (validationError) {
85
+ svgContent = '';
86
+ }
97
87
  }
88
+ pdsIconContent.set(url, svgContent || '');
98
89
  });
99
90
  }
100
91
  else {
101
- throw new Error(`HTTP ${rsp.status}: ${rsp.statusText}`);
92
+ // Handle HTTP errors
93
+ throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);
102
94
  }
103
95
  }).catch((error) => {
104
- console.error(`Failed to fetch icon ${url}:`, error);
105
- // Retry logic - attempt up to 3 times with exponential backoff
106
- if (retryCount < 3) {
107
- const delay = Math.pow(2, retryCount) * 1000; // 1s, 2s, 4s
108
- console.log(`Retrying icon load in ${delay}ms (attempt ${retryCount + 1}/3): ${url}`);
109
- return new Promise((resolve) => {
110
- setTimeout(() => {
111
- // Clear the failed request from cache to allow retry
112
- requests.delete(url);
113
- resolve(getSvgContent(url, sanitize, retryCount + 1));
114
- }, delay);
115
- });
116
- }
117
- else {
118
- // Final failure - set empty content to prevent infinite loading
119
- pdsIconContent.set(url, '');
120
- throw error;
121
- }
96
+ // Handle all fetch errors gracefully
97
+ console.warn('Failed to load SVG:', url, error);
98
+ pdsIconContent.set(url, '');
99
+ // Don't re-throw to prevent unhandled promise rejections
122
100
  });
123
101
  requests.set(url, req);
124
102
  }
125
103
  }
126
104
  else {
127
- console.warn('Fetch or document not available, setting empty icon content');
128
105
  pdsIconContent.set(url, '');
129
106
  return Promise.resolve();
130
107
  }
@@ -170,14 +147,24 @@ const PdsIcon = class {
170
147
  }
171
148
  componentDidLoad() {
172
149
  this.setCSSVariables();
173
- // Always attempt to load icon, but add delay for IntersectionObserver to complete
150
+ if (!this.didLoadIcon) {
151
+ this.loadIcon();
152
+ }
153
+ // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire
174
154
  setTimeout(() => {
175
- if (!this.didLoadIcon || !this.svgContent) {
176
- console.warn('Icon not loaded after component mount, forcing load attempt');
177
- this.isVisible = true; // Force visibility for fallback loading
155
+ if (!this.svgContent && !this.isVisible) {
156
+ this.isVisible = true;
157
+ this.loadIcon();
158
+ }
159
+ }, 100);
160
+ // Additional fallback for client-side navigation (React Router, etc.)
161
+ // React's useLayoutEffect and rendering cycles can delay visibility detection
162
+ setTimeout(() => {
163
+ if (!this.svgContent && !this.isVisible) {
164
+ this.isVisible = true;
178
165
  this.loadIcon();
179
166
  }
180
- }, 50);
167
+ }, 500);
181
168
  }
182
169
  componentWillLoad() {
183
170
  this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
@@ -189,20 +176,18 @@ const PdsIcon = class {
189
176
  this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');
190
177
  }
191
178
  connectedCallback() {
192
- // Set a fallback timeout in case IntersectionObserver never fires
193
- // This prevents icons from never loading due to intersection issues
194
- const fallbackTimeout = setTimeout(() => {
195
- if (!this.isVisible) {
196
- console.warn('IntersectionObserver timeout, forcing icon visibility');
179
+ // Handle re-connection during client-side navigation
180
+ if (!this.isVisible && !this.svgContent) {
181
+ this.waitUntilVisible(this.el, '50px', () => {
197
182
  this.isVisible = true;
198
183
  this.loadIcon();
199
- }
200
- }, 100); // 100ms fallback
201
- this.waitUntilVisible(this.el, '50px', () => {
202
- clearTimeout(fallbackTimeout);
184
+ });
185
+ }
186
+ // Immediate load attempt if already visible (e.g., during React navigation)
187
+ if (this.isElementInViewport(this.el)) {
203
188
  this.isVisible = true;
204
189
  this.loadIcon();
205
- });
190
+ }
206
191
  }
207
192
  disconnectedCallback() {
208
193
  if (this.io) {
@@ -214,29 +199,27 @@ const PdsIcon = class {
214
199
  this.setCSSVariables();
215
200
  }
216
201
  loadIcon() {
217
- {
202
+ // Reset load state when URL changes
203
+ this.didLoadIcon = false;
204
+ // Clear existing content to prevent stale content when switching icons
205
+ this.svgContent = undefined;
206
+ if (this.isVisible) {
218
207
  const url = getUrl(this);
219
208
  if (url) {
220
209
  if (pdsIconContent.has(url)) {
221
210
  this.svgContent = pdsIconContent.get(url);
222
211
  }
223
212
  else {
224
- // Add comprehensive error handling and timeout
225
- const timeoutPromise = new Promise((_, reject) => {
226
- setTimeout(() => reject(new Error('Icon loading timeout')), 10000); // 10 second timeout
227
- });
228
- Promise.race([getSvgContent(url), timeoutPromise])
213
+ // Fix: Ensure promise callback triggers re-render and handle errors
214
+ getSvgContent(url)
229
215
  .then(() => {
230
- this.svgContent = pdsIconContent.get(url);
231
- // Force re-render if content was loaded after initial render
232
- if (!this.svgContent) {
233
- console.warn(`Icon content not found after successful load: ${url}`);
234
- }
216
+ // Force re-render by setting state in next tick
217
+ setTimeout(() => {
218
+ this.svgContent = pdsIconContent.get(url);
219
+ }, 0);
235
220
  })
236
- .catch((error) => {
237
- console.error(`Failed to load icon: ${url}`, error);
238
- // Set empty content to prevent infinite loading state
239
- pdsIconContent.set(url, '');
221
+ .catch(() => {
222
+ // Handle fetch errors gracefully
240
223
  this.svgContent = '';
241
224
  });
242
225
  }
@@ -254,54 +237,33 @@ const PdsIcon = class {
254
237
  ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false
255
238
  : false;
256
239
  const shouldFlip = flipRtl || shouldIconAutoFlip;
257
- // Debug information when enabled
258
- this.debugIconState();
259
- return (h(Host, Object.assign({ key: '82420f9d474c932c9ed82bbf61b075cbbc67b6db', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && isRTL(this.el) }) }, inheritedAttributes), this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
240
+ return (h(Host, Object.assign({ key: '48056743bf1a60bbf905a0779702fd366b86659d', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && isRTL(this.el) }) }, inheritedAttributes), this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
260
241
  }
261
242
  /*****
262
243
  * Private Methods
263
244
  ****/
264
- debugIconState() {
265
- if (typeof window !== 'undefined' && window.__PDS_ICON_DEBUG__) {
266
- console.log('PDS Icon Debug:', {
267
- name: this.name,
268
- src: this.src,
269
- icon: this.icon,
270
- isVisible: this.isVisible,
271
- didLoadIcon: this.didLoadIcon,
272
- svgContent: this.svgContent ? 'loaded' : 'empty',
273
- url: getUrl(this),
274
- hasIntersectionObserver: !!this.io,
275
- element: this.el
276
- });
277
- }
278
- }
279
245
  waitUntilVisible(el, rootMargin, cb) {
280
246
  if (typeof window !== 'undefined' && (window).IntersectionObserver) {
281
- try {
282
- const io = (this.io = new (window).IntersectionObserver((data) => {
283
- if (data[0].isIntersecting) {
284
- io.disconnect();
285
- this.io = undefined;
286
- cb();
287
- }
288
- }, { rootMargin }));
289
- io.observe(el);
290
- // Add a safety timeout for IntersectionObserver
291
- setTimeout(() => {
292
- if (this.io) {
293
- console.warn('IntersectionObserver did not trigger within 5 seconds, forcing callback');
247
+ const io = (this.io = new (window).IntersectionObserver((data) => {
248
+ if (data[0].isIntersecting) {
249
+ io.disconnect();
250
+ this.io = undefined;
251
+ cb();
252
+ }
253
+ }, { rootMargin }));
254
+ io.observe(el);
255
+ // Safety timeout for client-side navigation scenarios
256
+ // Sometimes IntersectionObserver doesn't fire during React navigation
257
+ setTimeout(() => {
258
+ if (this.io && !this.isVisible) {
259
+ // Check if element is actually visible in viewport
260
+ if (this.isElementInViewport(el)) {
294
261
  this.io.disconnect();
295
262
  this.io = undefined;
296
263
  cb();
297
264
  }
298
- }, 5000);
299
- }
300
- catch (error) {
301
- console.error('IntersectionObserver initialization failed:', error);
302
- // Fall back to immediate execution
303
- cb();
304
- }
265
+ }
266
+ }, 1000);
305
267
  }
306
268
  else {
307
269
  // browser doesn't support IntersectionObserver
@@ -309,6 +271,54 @@ const PdsIcon = class {
309
271
  cb();
310
272
  }
311
273
  }
274
+ isElementInViewport(el) {
275
+ if (!el || !el.isConnected)
276
+ return false;
277
+ const rect = el.getBoundingClientRect();
278
+ const windowHeight = window.innerHeight || document.documentElement.clientHeight;
279
+ const windowWidth = window.innerWidth || document.documentElement.clientWidth;
280
+ return (rect.top >= 0 &&
281
+ rect.left >= 0 &&
282
+ rect.bottom <= windowHeight &&
283
+ rect.right <= windowWidth) || (
284
+ // Also consider partially visible elements
285
+ rect.top < windowHeight &&
286
+ rect.bottom > 0 &&
287
+ rect.left < windowWidth &&
288
+ rect.right > 0);
289
+ }
290
+ /**
291
+ * Debug method to help diagnose loading issues
292
+ * Call from browser console: document.querySelector('pds-icon').debugIconState()
293
+ */
294
+ debugIconState() {
295
+ var _a;
296
+ const url = getUrl(this);
297
+ const rect = this.el.getBoundingClientRect();
298
+ console.log('PdsIcon Debug State:', {
299
+ name: this.name,
300
+ src: this.src,
301
+ icon: this.icon,
302
+ iconName: this.iconName,
303
+ url,
304
+ isVisible: this.isVisible,
305
+ didLoadIcon: this.didLoadIcon,
306
+ hasSvgContent: !!this.svgContent,
307
+ svgContentLength: ((_a = this.svgContent) === null || _a === void 0 ? void 0 : _a.length) || 0,
308
+ isInCache: url ? pdsIconContent.has(url) : false,
309
+ cachedContent: url ? pdsIconContent.get(url) : null,
310
+ element: this.el,
311
+ // Client-side navigation specific debug info
312
+ isConnected: this.el.isConnected,
313
+ isInViewport: this.isElementInViewport(this.el),
314
+ hasIntersectionObserver: !!this.io,
315
+ boundingClientRect: rect,
316
+ windowDimensions: {
317
+ width: window.innerWidth || document.documentElement.clientWidth,
318
+ height: window.innerHeight || document.documentElement.clientHeight
319
+ }
320
+ });
321
+ }
312
322
  static get assetsDirs() { return ["svg"]; }
313
323
  get el() { return getElement(this); }
314
324
  static get watchers() { return {
@@ -1 +1 @@
1
- {"version":3,"file":"pds-icon.entry.js","sources":["src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false, retryCount = 0) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n console.warn(`No SVG found in data URL: ${url}`);\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n console.error(`Failed to parse SVG data URL: ${url}`, error);\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // Add retry logic and better error handling\n req = fetch(url, {\n method: 'GET',\n headers: {\n 'Accept': 'image/svg+xml,text/plain,*/*'\n },\n cache: 'force-cache' // Aggressive caching for icons\n }).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n svgContent = validateContent(svgContent);\n }\n if (svgContent) {\n pdsIconContent.set(url, svgContent);\n } else {\n console.warn(`Empty SVG content received for: ${url}`);\n pdsIconContent.set(url, '');\n }\n });\n } else {\n throw new Error(`HTTP ${rsp.status}: ${rsp.statusText}`);\n }\n }).catch((error) => {\n console.error(`Failed to fetch icon ${url}:`, error);\n\n // Retry logic - attempt up to 3 times with exponential backoff\n if (retryCount < 3) {\n const delay = Math.pow(2, retryCount) * 1000; // 1s, 2s, 4s\n console.log(`Retrying icon load in ${delay}ms (attempt ${retryCount + 1}/3): ${url}`);\n\n return new Promise((resolve) => {\n setTimeout(() => {\n // Clear the failed request from cache to allow retry\n requests.delete(url);\n resolve(getSvgContent(url, sanitize, retryCount + 1));\n }, delay);\n });\n } else {\n // Final failure - set empty content to prevent infinite loading\n pdsIconContent.set(url, '');\n throw error;\n }\n });\n\n requests.set(url, req);\n }\n } else {\n console.warn('Fetch or document not available, setting empty icon content');\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: string;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n // Always attempt to load icon, but add delay for IntersectionObserver to complete\n setTimeout(() => {\n if (!this.didLoadIcon || !this.svgContent) {\n console.warn('Icon not loaded after component mount, forcing load attempt');\n this.isVisible = true; // Force visibility for fallback loading\n this.loadIcon();\n }\n }, 50);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Set a fallback timeout in case IntersectionObserver never fires\n // This prevents icons from never loading due to intersection issues\n const fallbackTimeout = setTimeout(() => {\n if (!this.isVisible) {\n console.warn('IntersectionObserver timeout, forcing icon visibility');\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100); // 100ms fallback\n\n this.waitUntilVisible(this.el, '50px', () => {\n clearTimeout(fallbackTimeout);\n this.isVisible = true;\n this.loadIcon();\n })\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n if (Build.isBrowser) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Add comprehensive error handling and timeout\n const timeoutPromise = new Promise((_, reject) => {\n setTimeout(() => reject(new Error('Icon loading timeout')), 10000); // 10 second timeout\n });\n\n Promise.race([getSvgContent(url), timeoutPromise])\n .then(() => {\n this.svgContent = pdsIconContent.get(url);\n // Force re-render if content was loaded after initial render\n if (!this.svgContent) {\n console.warn(`Icon content not found after successful load: ${url}`);\n }\n })\n .catch((error) => {\n console.error(`Failed to load icon: ${url}`, error);\n // Set empty content to prevent infinite loading state\n pdsIconContent.set(url, '');\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n\n if (this.iconName) {\n this.ariaLabel = this.iconName.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n // Debug information when enabled\n this.debugIconState();\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private debugIconState() {\n if (typeof window !== 'undefined' && (window as Window & { __PDS_ICON_DEBUG__?: boolean }).__PDS_ICON_DEBUG__) {\n console.log('PDS Icon Debug:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n svgContent: this.svgContent ? 'loaded' : 'empty',\n url: getUrl(this),\n hasIntersectionObserver: !!this.io,\n element: this.el\n });\n }\n }\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n try {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Add a safety timeout for IntersectionObserver\n setTimeout(() => {\n if (this.io) {\n console.warn('IntersectionObserver did not trigger within 5 seconds, forcing callback');\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }, 5000);\n } catch (error) {\n console.error('IntersectionObserver initialization failed:', error);\n // Fall back to immediate execution\n cb();\n }\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"names":[],"mappings":";;;AAEO,MAAM,eAAe,GAAG,CAAC,UAAkB,KAAI;IACpD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,IAAA,GAAG,CAAC,SAAS,GAAG,UAAU;;AAG1B,IAAA,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AACnD,QAAA,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YACtD,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;;;;AAKtC,IAAA,MAAM,MAAM,GAAG,GAAG,CAAC,iBAAiB;IACpC,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;QACrD,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;AACnD,QAAA,MAAM,CAAC,YAAY,CAAC,OA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E,GAAG,SAAS;AACnB,wBAAA,EAAE,EAAE;;AAER,iBAAC,EACD,EAAE,UAAU,EAAE,CACf,CAAC;AAEF,gBAAA,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;gBAGd,UAAU,CAAC,MAAK;AACd,oBAAA,IAAI,IAAI,CAAC,EAAE,EAAE;AACX,wBAAA,OAAO,CAAC,IAAI,CAAC,yEAAyE,CAAC;AACvF,wBAAA,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE;AACpB,wBAAA,IAAI,CAAC,EAAE,GAAG,SAAS;AACnB,wBAAA,EAAE,EAAE;;iBAEP,EAAE,IAAI,CAAC;;YACR,OAAO,KAAK,EAAE;AACd,gBAAA,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC;;AAEnE,gBAAA,EAAE,EAAE;;;aAED;;;AAGL,YAAA,EAAE,EAAE;;;;;;;;;;;;;AAWV,MAAM,kBAAkB,GAAG,CAAC,KAAyB,KAAI;AACvD,IAAA,OAAO;AACN,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC7B;UACD,IAAI;AACR,CAAC;;;;;"}
1
+ {"version":3,"file":"pds-icon.entry.js","sources":["src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n try {\n svgContent = validateContent(svgContent);\n } catch (validationError) {\n svgContent = '';\n }\n }\n pdsIconContent.set(url, svgContent || '');\n });\n } else {\n // Handle HTTP errors\n throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);\n }\n }).catch((error) => {\n // Handle all fetch errors gracefully\n console.warn('Failed to load SVG:', url, error);\n pdsIconContent.set(url, '');\n // Don't re-throw to prevent unhandled promise rejections\n });\n\n requests.set(url, req);\n }\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n\n // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100);\n\n // Additional fallback for client-side navigation (React Router, etc.)\n // React's useLayoutEffect and rendering cycles can delay visibility detection\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 500);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Handle re-connection during client-side navigation\n if (!this.isVisible && !this.svgContent) {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n // Immediate load attempt if already visible (e.g., during React navigation)\n if (this.isElementInViewport(this.el)) {\n this.isVisible = true;\n this.loadIcon();\n }\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n // Reset load state when URL changes\n this.didLoadIcon = false;\n\n // Clear existing content to prevent stale content when switching icons\n this.svgContent = undefined;\n\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Fix: Ensure promise callback triggers re-render and handle errors\n getSvgContent(url)\n .then(() => {\n // Force re-render by setting state in next tick\n setTimeout(() => {\n this.svgContent = pdsIconContent.get(url);\n }, 0);\n })\n .catch(() => {\n // Handle fetch errors gracefully\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n\n if (this.iconName) {\n this.ariaLabel = this.iconName.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Safety timeout for client-side navigation scenarios\n // Sometimes IntersectionObserver doesn't fire during React navigation\n setTimeout(() => {\n if (this.io && !this.isVisible) {\n // Check if element is actually visible in viewport\n if (this.isElementInViewport(el)) {\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }\n }, 1000);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private isElementInViewport(el: HTMLElement): boolean {\n if (!el || !el.isConnected) return false;\n\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= windowHeight &&\n rect.right <= windowWidth\n ) || (\n // Also consider partially visible elements\n rect.top < windowHeight &&\n rect.bottom > 0 &&\n rect.left < windowWidth &&\n rect.right > 0\n );\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n\n /**\n * Debug method to help diagnose loading issues\n * Call from browser console: document.querySelector('pds-icon').debugIconState()\n */\n debugIconState() {\n const url = getUrl(this);\n const rect = this.el.getBoundingClientRect();\n\n console.log('PdsIcon Debug State:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n iconName: this.iconName,\n url,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n hasSvgContent: !!this.svgContent,\n svgContentLength: this.svgContent?.length || 0,\n isInCache: url ? pdsIconContent.has(url) : false,\n cachedContent: url ? pdsIconContent.get(url) : null,\n element: this.el,\n // Client-side navigation specific debug info\n isConnected: this.el.isConnected,\n isInViewport: this.isElementInViewport(this.el),\n hasIntersectionObserver: !!this.io,\n boundingClientRect: rect,\n windowDimensions: {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight\n }\n });\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"names":[],"mappings":";;;AAEO,MAAM,eAAe,GAAG,CAAC,UAAkB,KAAI;IACpD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,IAAA,GAAG,CAAC,SAAS,GAAG,UAAU;;AAG1B,IAAA,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AACnD,QAAA,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YACtD,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;;;;AAKtC,IAAA,MAAM,MAAM,GAAG,GAAG,CAAC,iBAAiB;IACpC,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;QACrD,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;AACnD,QAAA,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,QAAQ,GAAG,aAAa,EAAE,IAAI,EAAE,CAAC;;;;AAK/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AC,EAAE;;AAEhB,YAAA,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,WAAW;YAChC,YAAY,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/C,YAAA,uBAAuB,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE;AAClC,YAAA,kBAAkB,EAAE,IAAI;AACxB,YAAA,gBAAgB,EAAE;gBAChB,KAAK,EAAE,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW;gBAChE,MAAM,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC;AACxD;AACF,SAAA,CAAC;;;;;;;;;;;;AAIN,MAAM,kBAAkB,GAAG,CAAC,KAAyB,KAAI;AACvD,IAAA,OAAO;AACN,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC7B;UACD,IAAI;AACR,CAAC;;;;;"}
@@ -17,7 +17,7 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy([["pds-icon",[[1,"pds-icon",{"color":[1],"flipRtl":[4,"flip-rtl"],"icon":[1],"name":[513],"size":[513],"src":[1],"ariaLabel":[32],"isVisible":[32],"svgContent":[32]},null,{"size":["updateStyles"],"color":["updateStyles"],"name":["loadIcon"],"src":["loadIcon"],"icon":["loadIcon"]}]]]], options);
20
+ return bootstrapLazy([["pds-icon",[[1,"pds-icon",{"color":[1],"flipRtl":[4,"flip-rtl"],"icon":[8],"name":[513],"size":[513],"src":[1],"ariaLabel":[32],"isVisible":[32],"svgContent":[32]},null,{"size":["updateStyles"],"color":["updateStyles"],"name":["loadIcon"],"src":["loadIcon"],"icon":["loadIcon"]}]]]], options);
21
21
  });
22
22
  //# sourceMappingURL=pds-icons.js.map
23
23
 
@@ -0,0 +1,2 @@
1
+ import{r as t,h as i,H as s,g as e}from"./p-BtVkVfWm.js";import{i as n,a as o,g as r,b as l,s as h,c}from"./p-6DkR999u.js";const a=t=>{const i=document.createElement("div");i.innerHTML=t;for(let t=i.childNodes.length-1;t>=0;t--){if(i.childNodes[t].nodeName.toLowerCase()!=="svg"){i.removeChild(i.childNodes[t])}}const s=i.firstElementChild;if(s&&s.nodeName.toLowerCase()==="svg"){const t=s.getAttribute("class")||"";s.setAttribute("class",(t+" s-pds-icon").trim());if(d(s)){return i.innerHTML}}return""};const d=t=>{if(t.nodeType===1){if(t.nodeName.toLowerCase()==="script"){return false}for(let i=0;i<t.attributes.length;i++){const s=t.attributes[i].name;if(n(s)&&s.toLowerCase().indexOf("on")===0){return false}}for(let i=0;i<t.childNodes.length;i++){if(!d(t.childNodes[i])){return false}}}return true};const f=t=>t.startsWith("data:image/svg+xml");const u=t=>t.indexOf(";utf8,")!==-1;const m=new Map;const p=new Map;let w;const g=(t,i=false)=>{let s=p.get(t);if(!s){if(typeof fetch!="undefined"&&typeof document!=="undefined"){if(f(t)&&u(t)){if(!w){w=new DOMParser}try{const i=w.parseFromString(t,"text/html");const s=i.querySelector("svg");if(s){m.set(t,s.outerHTML)}else{m.set(t,"")}}catch(i){m.set(t,"")}return Promise.resolve()}else{s=fetch(t).then((s=>{if(s.ok){return s.text().then((s=>{if(s&&i!==false){try{s=a(s)}catch(t){s=""}}m.set(t,s||"")}))}else{throw new Error(`Failed to load SVG: ${s.status} ${s.statusText}`)}})).catch((i=>{console.warn("Failed to load SVG:",t,i);m.set(t,"")}));p.set(t,s)}}else{m.set(t,"");return Promise.resolve()}}return s};const b=":host{--dimension-icon-height:16px;--dimension-icon-width:16px;--color-icon-fill:currentColor;contain:strict;display:inline-block;fill:var(--color-icon-fill);flex-shrink:0;height:var(--dimension-icon-height);width:var(--dimension-icon-width)}:host .pdsicon{fill:var(--color-icon-fill)}.pds-icon-fill-none{fill:none}.icon-inner,.pds-icon,svg{display:block;height:100%;width:100%}:host(.flip-rtl):host-context([dir=rtl]) .icon-inner{transform:scaleX(-1)}:host(.flip-rtl:dir(rtl)) .icon-inner{transform:scaleX(-1)}:host(.flip-rtl:dir(ltr)) .icon-inner{transform:scaleX(1)}";const v=class{constructor(i){t(this,i);this.didLoadIcon=false;this.iconName=null;this.inheritedAttributes={};this.isVisible=false;this.size="regular";this.hasAriaHidden=()=>{const{el:t}=this;return t.hasAttribute("aria-hidden")&&t.getAttribute("aria-hidden")==="true"}}iconSize(){const t={small:"12px",regular:"16px",medium:"20px",large:"24px"};if(t[this.size]){return t[this.size]}else{return this.size}}componentDidLoad(){this.setCSSVariables();if(!this.didLoadIcon){this.loadIcon()}setTimeout((()=>{if(!this.svgContent&&!this.isVisible){this.isVisible=true;this.loadIcon()}}),100);setTimeout((()=>{if(!this.svgContent&&!this.isVisible){this.isVisible=true;this.loadIcon()}}),500)}componentWillLoad(){this.inheritedAttributes=o(this.el,["aria-label"]);this.setCSSVariables()}setCSSVariables(){this.el.style.setProperty(`--dimension-icon-height`,this.iconSize());this.el.style.setProperty(`--dimension-icon-width`,this.iconSize());this.el.style.setProperty(`--color-icon-fill`,typeof this.color!=="undefined"?this.color:"currentColor")}connectedCallback(){if(!this.isVisible&&!this.svgContent){this.waitUntilVisible(this.el,"50px",(()=>{this.isVisible=true;this.loadIcon()}))}if(this.isElementInViewport(this.el)){this.isVisible=true;this.loadIcon()}}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}}updateStyles(){this.setCSSVariables()}loadIcon(){this.didLoadIcon=false;this.svgContent=undefined;if(this.isVisible){const t=r(this);if(t){if(m.has(t)){this.svgContent=m.get(t)}else{g(t).then((()=>{setTimeout((()=>{this.svgContent=m.get(t)}),0)})).catch((()=>{this.svgContent=""}))}this.didLoadIcon=true}}this.iconName=l(this.name,this.icon);if(this.iconName){this.ariaLabel=this.iconName.replace(/\-/g," ")}}render(){const{ariaLabel:t,flipRtl:e,iconName:n,inheritedAttributes:o}=this;const r=n?h(n,this.el)&&e!==false:false;const l=e||r;return i(s,Object.assign({key:"48056743bf1a60bbf905a0779702fd366b86659d","aria-label":t!==undefined&&!this.hasAriaHidden()?t:null,alt:"",role:"img",class:Object.assign(Object.assign({},x(this.color)),{"flip-rtl":l,"icon-rtl":l&&c(this.el)})},o),this.svgContent?i("div",{class:"icon-inner",innerHTML:this.svgContent}):i("div",{class:"icon-inner"}))}waitUntilVisible(t,i,s){if(typeof window!=="undefined"&&window.IntersectionObserver){const e=this.io=new window.IntersectionObserver((t=>{if(t[0].isIntersecting){e.disconnect();this.io=undefined;s()}}),{rootMargin:i});e.observe(t);setTimeout((()=>{if(this.io&&!this.isVisible){if(this.isElementInViewport(t)){this.io.disconnect();this.io=undefined;s()}}}),1e3)}else{s()}}isElementInViewport(t){if(!t||!t.isConnected)return false;const i=t.getBoundingClientRect();const s=window.innerHeight||document.documentElement.clientHeight;const e=window.innerWidth||document.documentElement.clientWidth;return i.top>=0&&i.left>=0&&i.bottom<=s&&i.right<=e||i.top<s&&i.bottom>0&&i.left<e&&i.right>0}debugIconState(){var t;const i=r(this);const s=this.el.getBoundingClientRect();console.log("PdsIcon Debug State:",{name:this.name,src:this.src,icon:this.icon,iconName:this.iconName,url:i,isVisible:this.isVisible,didLoadIcon:this.didLoadIcon,hasSvgContent:!!this.svgContent,svgContentLength:((t=this.svgContent)===null||t===void 0?void 0:t.length)||0,isInCache:i?m.has(i):false,cachedContent:i?m.get(i):null,element:this.el,isConnected:this.el.isConnected,isInViewport:this.isElementInViewport(this.el),hasIntersectionObserver:!!this.io,boundingClientRect:s,windowDimensions:{width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}})}static get assetsDirs(){return["svg"]}get el(){return e(this)}static get watchers(){return{size:["updateStyles"],color:["updateStyles"],name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"]}}};const x=t=>t?{"pds-color":true,[`pds-color-${t}`]:true}:null;v.style=b;export{v as pds_icon};
2
+ //# sourceMappingURL=p-23a00a5a.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["validateContent","svgContent","div","document","createElement","innerHTML","i","childNodes","length","nodeName","toLowerCase","removeChild","svgElm","firstElementChild","svgClass","getAttribute","setAttribute","trim","isValid","elm","nodeType","attributes","name","isStr","indexOf","isSvgDataUrl","url","startsWith","isEncodedDataUrl","pdsIconContent","Map","requests","parser","getSvgContent","sanitize","req","get","fetch","DOMParser","doc","parseFromString","svg","querySelector","set","outerHTML","error","Promise","resolve","then","rsp","ok","text","validationError","Error","status","statusText","catch","console","warn","pdsIconCss","PdsIcon","constructor","hostRef","this","didLoadIcon","iconName","inheritedAttributes","isVisible","size","hasAriaHidden","el","hasAttribute","iconSize","sizes","small","regular","medium","large","componentDidLoad","setCSSVariables","loadIcon","setTimeout","componentWillLoad","inheritAttributes","style","setProperty","color","connectedCallback","waitUntilVisible","isElementInViewport","disconnectedCallback","io","disconnect","undefined","updateStyles","getUrl","has","getName","icon","ariaLabel","replace","render","flipRtl","shouldIconAutoFlip","shouldRtlFlipIcon","shouldFlip","h","Host","Object","assign","key","alt","role","class","createColorClasses","isRTL","rootMargin","cb","window","IntersectionObserver","data","isIntersecting","observe","isConnected","rect","getBoundingClientRect","windowHeight","innerHeight","documentElement","clientHeight","windowWidth","innerWidth","clientWidth","top","left","bottom","right","debugIconState","log","src","hasSvgContent","svgContentLength","_a","isInCache","cachedContent","element","isInViewport","hasIntersectionObserver","boundingClientRect","windowDimensions","width","height"],"sources":["src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n try {\n svgContent = validateContent(svgContent);\n } catch (validationError) {\n svgContent = '';\n }\n }\n pdsIconContent.set(url, svgContent || '');\n });\n } else {\n // Handle HTTP errors\n throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);\n }\n }).catch((error) => {\n // Handle all fetch errors gracefully\n console.warn('Failed to load SVG:', url, error);\n pdsIconContent.set(url, '');\n // Don't re-throw to prevent unhandled promise rejections\n });\n\n requests.set(url, req);\n }\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n\n // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100);\n\n // Additional fallback for client-side navigation (React Router, etc.)\n // React's useLayoutEffect and rendering cycles can delay visibility detection\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 500);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Handle re-connection during client-side navigation\n if (!this.isVisible && !this.svgContent) {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n // Immediate load attempt if already visible (e.g., during React navigation)\n if (this.isElementInViewport(this.el)) {\n this.isVisible = true;\n this.loadIcon();\n }\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n // Reset load state when URL changes\n this.didLoadIcon = false;\n\n // Clear existing content to prevent stale content when switching icons\n this.svgContent = undefined;\n\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Fix: Ensure promise callback triggers re-render and handle errors\n getSvgContent(url)\n .then(() => {\n // Force re-render by setting state in next tick\n setTimeout(() => {\n this.svgContent = pdsIconContent.get(url);\n }, 0);\n })\n .catch(() => {\n // Handle fetch errors gracefully\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n\n if (this.iconName) {\n this.ariaLabel = this.iconName.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Safety timeout for client-side navigation scenarios\n // Sometimes IntersectionObserver doesn't fire during React navigation\n setTimeout(() => {\n if (this.io && !this.isVisible) {\n // Check if element is actually visible in viewport\n if (this.isElementInViewport(el)) {\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }\n }, 1000);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private isElementInViewport(el: HTMLElement): boolean {\n if (!el || !el.isConnected) return false;\n\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= windowHeight &&\n rect.right <= windowWidth\n ) || (\n // Also consider partially visible elements\n rect.top < windowHeight &&\n rect.bottom > 0 &&\n rect.left < windowWidth &&\n rect.right > 0\n );\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n\n /**\n * Debug method to help diagnose loading issues\n * Call from browser console: document.querySelector('pds-icon').debugIconState()\n */\n debugIconState() {\n const url = getUrl(this);\n const rect = this.el.getBoundingClientRect();\n\n console.log('PdsIcon Debug State:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n iconName: this.iconName,\n url,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n hasSvgContent: !!this.svgContent,\n svgContentLength: this.svgContent?.length || 0,\n isInCache: url ? pdsIconContent.has(url) : false,\n cachedContent: url ? pdsIconContent.get(url) : null,\n element: this.el,\n // Client-side navigation specific debug info\n isConnected: this.el.isConnected,\n isInViewport: this.isElementInViewport(this.el),\n hasIntersectionObserver: !!this.io,\n boundingClientRect: rect,\n windowDimensions: {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight\n }\n });\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"mappings":"2HAEO,MAAMA,EAAmBC,IAC9B,MAAMC,EAAMC,SAASC,cAAc,OACnCF,EAAIG,UAAYJ,EAGhB,IAAK,IAAIK,EAAIJ,EAAIK,WAAWC,OAAS,EAAGF,GAAK,EAAGA,IAAK,CACnD,GAAIJ,EAAIK,WAAWD,GAAGG,SAASC,gBAAkB,MAAO,CACtDR,EAAIS,YAAYT,EAAIK,WAAWD,G,EAKnC,MAAMM,EAASV,EAAIW,kBACnB,GAAID,GAAUA,EAAOH,SAASC,gBAAkB,MAAO,CACrD,MAAMI,EAAWF,EAAOG,aAAa,UAAY,GACjDH,EAAOI,aAAa,SAAUF,EAAW,eAAeG,QAKxD,GAAIC,EAAQN,GAAwB,CAClC,OAAOV,EAAIG,S,EAGf,MAAO,EAAE,EAGJ,MAAMa,EAAWC,IACtB,GAAIA,EAAIC,WAAa,EAAG,CACtB,GAAID,EAAIV,SAASC,gBAAkB,SAAU,CAC3C,OAAO,K,CAGT,IAAK,IAAIJ,EAAI,EAAGA,EAAIa,EAAIE,WAAWb,OAAQF,IAAK,CAC9C,MAAMgB,EAAOH,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