stripe-pwa-elements 4.0.1 → 4.0.3

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 (107) hide show
  1. package/dist/cjs/factory-Cm6zUD7R.js +1206 -0
  2. package/dist/cjs/{factory-Cd2VI_N2.js → i18n-lBbOeQt4.js} +12 -1149
  3. package/dist/cjs/ion-icon_2.cjs.entry.js +725 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/stripe-address-element.cjs.entry.js +5 -4
  6. package/dist/cjs/stripe-card-element-modal.cjs.entry.js +3 -2
  7. package/dist/cjs/{stripe-card-element_2.cjs.entry.js → stripe-card-element.cjs.entry.js} +8 -93
  8. package/dist/cjs/stripe-currency-selector.cjs.entry.js +4 -3
  9. package/dist/cjs/stripe-elements.cjs.js +1 -1
  10. package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +24 -5
  11. package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +4 -3
  12. package/dist/cjs/stripe-payment-element.cjs.entry.js +12 -124
  13. package/dist/cjs/stripe-payment-element.helpers-CvAhIqLt.js +119 -0
  14. package/dist/cjs/stripe-payment-request-button.cjs.entry.js +2 -2
  15. package/dist/cjs/stripe-payment-sheet.cjs.entry.js +987 -0
  16. package/dist/collection/collection-manifest.json +2 -1
  17. package/dist/collection/components/stripe-address-element/stripe-address-element.js +2 -2
  18. package/dist/collection/components/stripe-card-element/stripe-card-element.js +3 -2
  19. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +4 -3
  20. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +18 -0
  21. package/dist/collection/components/stripe-modal/stripe-modal.css +27 -1
  22. package/dist/collection/components/stripe-modal/stripe-modal.js +132 -1
  23. package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +4 -7
  24. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +4 -4
  25. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +3 -3
  26. package/dist/collection/components/stripe-payment-sheet/payment-sheet-state.js +193 -0
  27. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.checkout.js +94 -0
  28. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.css +68 -0
  29. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.helpers.js +274 -0
  30. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +763 -0
  31. package/dist/collection/services/express-checkout-element-manager.js +36 -2
  32. package/dist/collection/services/link-authentication-element-manager.js +5 -0
  33. package/dist/collection/services/stripe-service.js +20 -6
  34. package/dist/collection/utils/focus.js +76 -0
  35. package/dist/collection/utils/i18n.js +12 -0
  36. package/dist/components/factory.js +1 -1
  37. package/dist/components/i18n.js +1 -0
  38. package/dist/components/stripe-address-element.js +1 -1
  39. package/dist/components/stripe-card-element-modal.js +1 -1
  40. package/dist/components/stripe-card-element2.js +1 -1
  41. package/dist/components/stripe-currency-selector.js +1 -1
  42. package/dist/components/stripe-express-checkout-element.js +1 -1
  43. package/dist/components/stripe-link-authentication-element.js +1 -1
  44. package/dist/components/stripe-modal2.js +1 -1
  45. package/dist/components/stripe-payment-element.helpers.js +1 -0
  46. package/dist/components/stripe-payment-element.js +1 -1
  47. package/dist/components/stripe-payment-request-button2.js +1 -1
  48. package/dist/components/stripe-payment-sheet.d.ts +11 -0
  49. package/dist/components/stripe-payment-sheet.js +1 -0
  50. package/dist/esm/factory-BaGv8K_i.js +1203 -0
  51. package/dist/esm/{factory-VTa1Gc94.js → i18n-CL5n3bOb.js} +13 -1149
  52. package/dist/esm/ion-icon_2.entry.js +722 -0
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/esm/stripe-address-element.entry.js +2 -1
  55. package/dist/esm/stripe-card-element-modal.entry.js +3 -2
  56. package/dist/esm/{stripe-card-element_2.entry.js → stripe-card-element.entry.js} +6 -90
  57. package/dist/esm/stripe-currency-selector.entry.js +2 -1
  58. package/dist/esm/stripe-elements.js +1 -1
  59. package/dist/esm/stripe-express-checkout-element.entry.js +20 -1
  60. package/dist/esm/stripe-link-authentication-element.entry.js +2 -1
  61. package/dist/esm/stripe-payment-element.entry.js +4 -116
  62. package/dist/esm/stripe-payment-element.helpers-Bu9RfxS4.js +114 -0
  63. package/dist/esm/stripe-payment-request-button.entry.js +2 -2
  64. package/dist/esm/stripe-payment-sheet.entry.js +985 -0
  65. package/dist/stripe-elements/p-2e41699e.entry.js +1 -0
  66. package/dist/stripe-elements/p-3fc4583a.entry.js +1 -0
  67. package/dist/stripe-elements/{p-ae0c336e.entry.js → p-4891edf0.entry.js} +1 -1
  68. package/dist/stripe-elements/p-7e826964.entry.js +1 -0
  69. package/dist/stripe-elements/p-BhKXGROE.js +1 -0
  70. package/dist/stripe-elements/p-CL5n3bOb.js +1 -0
  71. package/dist/stripe-elements/p-DlMEZwSe.js +1 -0
  72. package/dist/stripe-elements/p-a395a5d1.entry.js +1 -0
  73. package/dist/stripe-elements/p-b62c9dae.entry.js +1 -0
  74. package/dist/stripe-elements/p-b7c20e8e.entry.js +1 -0
  75. package/dist/stripe-elements/p-ba791c8f.entry.js +1 -0
  76. package/dist/stripe-elements/p-bec62526.entry.js +1 -0
  77. package/dist/stripe-elements/p-f5552c81.entry.js +1 -0
  78. package/dist/stripe-elements/stripe-elements.esm.js +1 -1
  79. package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +2 -1
  80. package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +2 -1
  81. package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +5 -0
  82. package/dist/types/components/stripe-modal/stripe-modal.d.ts +43 -0
  83. package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +7 -2
  84. package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +1 -1
  85. package/dist/types/components/stripe-payment-sheet/payment-sheet-state.d.ts +121 -0
  86. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.checkout.d.ts +39 -0
  87. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +157 -0
  88. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.helpers.d.ts +153 -0
  89. package/dist/types/components.d.ts +182 -10
  90. package/dist/types/index.d.ts +2 -0
  91. package/dist/types/services/interfaces.d.ts +3 -0
  92. package/dist/types/services/stripe-service.d.ts +7 -2
  93. package/dist/types/utils/focus.d.ts +15 -0
  94. package/package.json +7 -3
  95. package/readme.md +59 -6
  96. package/dist/cjs/ion-icon.cjs.entry.js +0 -431
  97. package/dist/components/utils.js +0 -1
  98. package/dist/esm/ion-icon.entry.js +0 -429
  99. package/dist/stripe-elements/p-1bd46766.entry.js +0 -1
  100. package/dist/stripe-elements/p-1c6e0a45.entry.js +0 -1
  101. package/dist/stripe-elements/p-3f42ca0c.entry.js +0 -1
  102. package/dist/stripe-elements/p-5cf62945.entry.js +0 -1
  103. package/dist/stripe-elements/p-74de1556.entry.js +0 -1
  104. package/dist/stripe-elements/p-76e57d78.entry.js +0 -1
  105. package/dist/stripe-elements/p-840d499f.entry.js +0 -1
  106. package/dist/stripe-elements/p-CrjrbGJ3.js +0 -1
  107. package/dist/stripe-elements/p-cfd8e081.entry.js +0 -1
@@ -1,431 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Dkb0SxZc.js');
4
-
5
- let CACHED_MAP;
6
- const getIconMap = () => {
7
- if (typeof window === 'undefined') {
8
- return new Map();
9
- }
10
- else {
11
- if (!CACHED_MAP) {
12
- const win = window;
13
- win.Ionicons = win.Ionicons || {};
14
- CACHED_MAP = win.Ionicons.map = win.Ionicons.map || new Map();
15
- }
16
- return CACHED_MAP;
17
- }
18
- };
19
- const getUrl = (i) => {
20
- let url = getSrc(i.src);
21
- if (url) {
22
- return url;
23
- }
24
- url = getName(i.name, i.icon, i.mode, i.ios, i.md);
25
- if (url) {
26
- return getNamedUrl(url, i);
27
- }
28
- if (i.icon) {
29
- url = getSrc(i.icon);
30
- if (url) {
31
- return url;
32
- }
33
- url = getSrc(i.icon[i.mode]);
34
- if (url) {
35
- return url;
36
- }
37
- }
38
- return null;
39
- };
40
- const getNamedUrl = (iconName, iconEl) => {
41
- const url = getIconMap().get(iconName);
42
- if (url) {
43
- return url;
44
- }
45
- try {
46
- return index.getAssetPath(`svg/${iconName}.svg`);
47
- }
48
- catch (e) {
49
- console.log('e', e);
50
- /**
51
- * In the custom elements build version of ionicons, referencing an icon
52
- * by name will throw an invalid URL error because the asset path is not defined.
53
- * This catches that error and logs something that is more developer-friendly.
54
- * We also include a reference to the ion-icon element so developers can
55
- * figure out which instance of ion-icon needs to be updated.
56
- */
57
- console.warn(`[Ionicons Warning]: Could not load icon with name "${iconName}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`, iconEl);
58
- }
59
- };
60
- const getName = (iconName, icon, mode, ios, md) => {
61
- // default to "md" if somehow the mode wasn't set
62
- mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
63
- // if an icon was passed in using the ios or md attributes
64
- // set the iconName to whatever was passed in
65
- if (ios && mode === 'ios') {
66
- iconName = toLower(ios);
67
- }
68
- else if (md && mode === 'md') {
69
- iconName = toLower(md);
70
- }
71
- else {
72
- if (!iconName && icon && !isSrc(icon)) {
73
- iconName = icon;
74
- }
75
- if (isStr(iconName)) {
76
- iconName = toLower(iconName);
77
- }
78
- }
79
- if (!isStr(iconName) || iconName.trim() === '') {
80
- return null;
81
- }
82
- // only allow alpha characters and dash
83
- const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
84
- if (invalidChars !== '') {
85
- return null;
86
- }
87
- return iconName;
88
- };
89
- const getSrc = (src) => {
90
- if (isStr(src)) {
91
- src = src.trim();
92
- if (isSrc(src)) {
93
- return src;
94
- }
95
- }
96
- return null;
97
- };
98
- const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
99
- const isStr = (val) => typeof val === 'string';
100
- const toLower = (val) => val.toLowerCase();
101
- /**
102
- * Elements inside of web components sometimes need to inherit global attributes
103
- * set on the host. For example, the inner input in `ion-input` should inherit
104
- * the `title` attribute that developers set directly on `ion-input`. This
105
- * helper function should be called in componentWillLoad and assigned to a variable
106
- * that is later used in the render function.
107
- *
108
- * This does not need to be reactive as changing attributes on the host element
109
- * does not trigger a re-render.
110
- */
111
- const inheritAttributes = (el, attributes = []) => {
112
- const attributeObject = {};
113
- attributes.forEach((attr) => {
114
- if (el.hasAttribute(attr)) {
115
- const value = el.getAttribute(attr);
116
- if (value !== null) {
117
- attributeObject[attr] = el.getAttribute(attr);
118
- }
119
- el.removeAttribute(attr);
120
- }
121
- });
122
- return attributeObject;
123
- };
124
- /**
125
- * Returns `true` if the document or host element
126
- * has a `dir` set to `rtl`. The host value will always
127
- * take priority over the root document value.
128
- */
129
- const isRTL = (hostEl) => {
130
- if (hostEl) {
131
- if (hostEl.dir !== '') {
132
- return hostEl.dir.toLowerCase() === 'rtl';
133
- }
134
- }
135
- return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
136
- };
137
-
138
- const validateContent = (svgContent) => {
139
- const div = document.createElement('div');
140
- div.innerHTML = svgContent;
141
- // setup this way to ensure it works on our buddy IE
142
- for (let i = div.childNodes.length - 1; i >= 0; i--) {
143
- if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
144
- div.removeChild(div.childNodes[i]);
145
- }
146
- }
147
- // must only have 1 root element
148
- const svgElm = div.firstElementChild;
149
- if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
150
- const svgClass = svgElm.getAttribute('class') || '';
151
- svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
152
- // root element must be an svg
153
- // lets double check we've got valid elements
154
- // do not allow scripts
155
- if (isValid(svgElm)) {
156
- return div.innerHTML;
157
- }
158
- }
159
- return '';
160
- };
161
- const isValid = (elm) => {
162
- if (elm.nodeType === 1) {
163
- if (elm.nodeName.toLowerCase() === 'script') {
164
- return false;
165
- }
166
- for (let i = 0; i < elm.attributes.length; i++) {
167
- const name = elm.attributes[i].name;
168
- if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {
169
- return false;
170
- }
171
- }
172
- for (let i = 0; i < elm.childNodes.length; i++) {
173
- if (!isValid(elm.childNodes[i])) {
174
- return false;
175
- }
176
- }
177
- }
178
- return true;
179
- };
180
- const isSvgDataUrl = (url) => url.startsWith('data:image/svg+xml');
181
- const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;
182
-
183
- const ioniconContent = new Map();
184
- const requests = new Map();
185
- let parser;
186
- /**
187
- * Safely fallback to an empty svg
188
- */
189
- function safeFallback(url) {
190
- const svg = '';
191
- ioniconContent.set(url, svg);
192
- return svg;
193
- }
194
- const getSvgContent = (url, sanitize) => {
195
- /**
196
- * See if we already have a request for this url
197
- */
198
- const req = requests.get(url);
199
- if (req) {
200
- return req;
201
- }
202
- if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
203
- /**
204
- * If the url is a data url of an svg, then try to parse it
205
- * with the DOMParser. This works with content security policies enabled.
206
- */
207
- if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
208
- return Promise.resolve(getSvgByUrl(url));
209
- }
210
- return fetchSvg(url, sanitize);
211
- }
212
- return Promise.resolve(safeFallback(url));
213
- };
214
- function getSvgByUrl(url) {
215
- if (!parser) {
216
- /**
217
- * Create an instance of the DOM parser. This creates a single
218
- * parser instance for the entire app, which is more efficient.
219
- */
220
- parser = new DOMParser();
221
- }
222
- const doc = parser.parseFromString(url, 'text/html');
223
- const svg = doc.querySelector('svg');
224
- if (svg) {
225
- ioniconContent.set(url, svg.outerHTML);
226
- return svg.outerHTML;
227
- }
228
- throw new Error(`Could not parse svg from ${url}`);
229
- }
230
- function fetchSvg(url, sanitize) {
231
- /**
232
- * We don't already have a request
233
- */
234
- const req = fetch(url)
235
- .then((rsp) => {
236
- /**
237
- * When fetching from a file:// URL, some browsers return
238
- * a 0 status code even when the request succeeds so don't
239
- * rely on rsp.ok as the only signal of success.
240
- */
241
- return rsp
242
- .text()
243
- .then((svgContent) => {
244
- if (svgContent && sanitize !== false) {
245
- svgContent = validateContent(svgContent);
246
- }
247
- const svg = svgContent || '';
248
- ioniconContent.set(url, svg);
249
- return svg;
250
- })
251
- .catch(() => safeFallback(url));
252
- })
253
- .catch(() => safeFallback(url));
254
- /**
255
- * Cache for the same requests
256
- */
257
- requests.set(url, req);
258
- return req;
259
- }
260
-
261
- const iconCss = () => `:host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}@supports (background: -webkit-named-image(i)){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}:host(.flip-rtl):host-context([dir='rtl']) .icon-inner{transform:scaleX(-1)}@supports selector(:dir(rtl)){:host(.flip-rtl:dir(rtl)) .icon-inner{transform:scaleX(-1)}:host(.flip-rtl:dir(ltr)) .icon-inner{transform:scaleX(1)}}:host(.icon-small){font-size:1.125rem !important}:host(.icon-large){font-size:2rem !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}`;
262
-
263
- const Icon = class {
264
- constructor(hostRef) {
265
- index.registerInstance(this, hostRef);
266
- this.iconName = null;
267
- this.inheritedAttributes = {};
268
- this.didLoadIcon = false;
269
- this.isVisible = false;
270
- /**
271
- * The mode determines which platform styles to use.
272
- */
273
- this.mode = getIonMode();
274
- /**
275
- * If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
276
- * Default, `false`.
277
- */
278
- this.lazy = false;
279
- /**
280
- * When set to `false`, SVG content that is HTTP fetched will not be checked
281
- * if the response SVG content has any `<script>` elements, or any attributes
282
- * that start with `on`, such as `onclick`.
283
- * @default true
284
- */
285
- this.sanitize = true;
286
- }
287
- componentWillLoad() {
288
- this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
289
- }
290
- connectedCallback() {
291
- /**
292
- * purposely do not return the promise here because loading
293
- * the svg file should not hold up loading the app
294
- * only load the svg if it's visible
295
- */
296
- this.waitUntilVisible(this.el, '50px', () => {
297
- this.isVisible = true;
298
- this.loadIcon();
299
- });
300
- }
301
- /**
302
- * Loads the icon after the component has finished rendering.
303
- */
304
- componentDidLoad() {
305
- /**
306
- * Addresses an Angular issue where property values are assigned after the 'connectedCallback' but prior to the registration of watchers.
307
- * This enhancement ensures the loading of an icon when the component has finished rendering and the icon has yet to apply the SVG data.
308
- * This modification pertains to the usage of Angular's binding syntax:
309
- * `<ion-icon [name]="myIconName"></ion-icon>`
310
- */
311
- if (!this.didLoadIcon) {
312
- this.loadIcon();
313
- }
314
- }
315
- /**
316
- * Disconnect the IntersectionObserver.
317
- */
318
- disconnectedCallback() {
319
- if (this.io) {
320
- this.io.disconnect();
321
- this.io = undefined;
322
- }
323
- }
324
- /**
325
- * Wait until the icon is visible in the viewport.
326
- * @param el - The element to observe.
327
- * @param rootMargin - The root margin of the observer.
328
- * @param cb - The callback to call when the element is visible.
329
- */
330
- waitUntilVisible(el, rootMargin, cb) {
331
- /**
332
- * IntersectionObserver is a browser API that allows you to observe
333
- * the visibility of an element relative to a root element. It is
334
- * supported in all modern browsers, except IE and when server-side
335
- * rendering.
336
- */
337
- const hasIntersectionObserverSupport = Boolean(index.Build.isBrowser && this.lazy && typeof window !== 'undefined' && window.IntersectionObserver);
338
- /**
339
- * browser doesn't support IntersectionObserver
340
- * so just fallback to always show it
341
- */
342
- if (!hasIntersectionObserverSupport) {
343
- return cb();
344
- }
345
- const io = (this.io = new window.IntersectionObserver((data) => {
346
- if (data[0].isIntersecting) {
347
- io.disconnect();
348
- this.io = undefined;
349
- cb();
350
- }
351
- }, { rootMargin }));
352
- io.observe(el);
353
- }
354
- /**
355
- * Watch for changes to the icon name, src, icon, ios, or md properties.
356
- * When a change is detected, the icon will be loaded.
357
- */
358
- loadIcon() {
359
- if (index.Build.isBrowser && this.isVisible) {
360
- const url = getUrl(this);
361
- if (url) {
362
- if (ioniconContent.has(url)) {
363
- // sync if it's already loaded
364
- this.svgContent = ioniconContent.get(url);
365
- }
366
- else {
367
- // async if it hasn't been loaded
368
- getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(url)));
369
- }
370
- this.didLoadIcon = true;
371
- }
372
- }
373
- this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
374
- }
375
- render() {
376
- const { flipRtl, iconName, inheritedAttributes, el } = this;
377
- const mode = this.mode || 'md';
378
- /**
379
- * we have designated that arrows & chevrons should automatically flip (unless flip-rtl
380
- * is set to false) because "back" is left in ltr and right in rtl, and "forward" is the opposite
381
- */
382
- const shouldAutoFlip = iconName
383
- ? (iconName.includes('arrow') || iconName.includes('chevron')) && flipRtl !== false
384
- : false;
385
- /**
386
- * if shouldBeFlippable is true, the icon should change direction when `dir` changes
387
- */
388
- const shouldBeFlippable = flipRtl || shouldAutoFlip;
389
- return (index.h(index.Host, Object.assign({ key: '0578c899781ca145dd8205acd9670af39b57cf2e', role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': shouldBeFlippable, 'icon-rtl': shouldBeFlippable && isRTL(el) }) }, inheritedAttributes), index.Build.isBrowser && this.svgContent ? (index.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (index.h("div", { class: "icon-inner" }))));
390
- }
391
- static get assetsDirs() { return ["svg"]; }
392
- get el() { return index.getElement(this); }
393
- static get watchers() { return {
394
- "name": [{
395
- "loadIcon": 0
396
- }],
397
- "src": [{
398
- "loadIcon": 0
399
- }],
400
- "icon": [{
401
- "loadIcon": 0
402
- }],
403
- "ios": [{
404
- "loadIcon": 0
405
- }],
406
- "md": [{
407
- "loadIcon": 0
408
- }]
409
- }; }
410
- };
411
- /**
412
- * Get the mode of the document.
413
- * @returns The mode of the document.
414
- */
415
- const getIonMode = () => (index.Build.isBrowser && typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
416
- /**
417
- * Create color classes for the icon.
418
- * @param color - The color of the icon.
419
- * @returns The color classes for the icon.
420
- */
421
- const createColorClasses = (color) => {
422
- return color
423
- ? {
424
- 'ion-color': true,
425
- [`ion-color-${color}`]: true,
426
- }
427
- : null;
428
- };
429
- Icon.style = iconCss();
430
-
431
- exports.ion_icon = Icon;
@@ -1 +0,0 @@
1
- const i=i=>Object.keys(c).filter((o=>c[o](i))),o=i=>!!d(i,/iPad/i)||!(!d(i,/Macintosh/i)||!e(i)),n=i=>d(i,/android|sink/i),e=i=>s(i,"(any-pointer:coarse)"),t=i=>r(i)||a(i),r=i=>!!(i.cordova||i.phonegap||i.PhoneGap),a=i=>{const o=i.Capacitor;return!(!o||!o.isNative)},d=(i,o)=>o.test(i.navigator.userAgent),s=(i,o)=>i.matchMedia(o).matches,c={ipad:o,iphone:i=>d(i,/iPhone/i),ios:i=>d(i,/iPhone|iPod/i)||o(i),android:n,phablet:i=>{const o=i.innerWidth,n=i.innerHeight,e=Math.min(o,n),t=Math.max(o,n);return e>390&&e<520&&t>620&&t<800},tablet:i=>{const e=i.innerWidth,t=i.innerHeight,r=Math.min(e,t),a=Math.max(e,t);return o(i)||(i=>n(i)&&!d(i,/mobile/i))(i)||r>460&&r<820&&a>780&&a<1400},cordova:r,capacitor:a,electron:i=>d(i,/electron/i),pwa:i=>!(!i.matchMedia("(display-mode: standalone)").matches&&!i.navigator.standalone),mobile:e,mobileweb:i=>e(i)&&!t(i),desktop:i=>!e(i),hybrid:t},l=()=>{const o=((o=window)=>{if(void 0===o)return[];o.Ionic=o.Ionic||{};let n=o.Ionic.platforms;return null==n&&(n=o.Ionic.platforms=i(o),n.forEach((i=>o.document.documentElement.classList.add(`plt-${i}`)))),n})(undefined);return o.includes("ios")?"ios":o.includes("android")?"android":void 0};export{l as c}