willba-component-library 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3,552 +3,173 @@
3
3
  var React__default = require('react');
4
4
 
5
5
  function _interopNamespaceDefault(e) {
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- }
18
- n.default = e;
19
- return Object.freeze(n);
6
+ var n = Object.create(null);
7
+ if (e) {
8
+ Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default') {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
14
+ });
15
+ }
16
+ });
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
20
  }
21
21
 
22
22
  var React__default__namespace = /*#__PURE__*/_interopNamespaceDefault(React__default);
23
23
 
24
- function getDefaultExportFromCjs (x) {
25
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
24
+ function ownKeys$1(object, enumerableOnly) {
25
+ var keys = Object.keys(object);
26
+
27
+ if (Object.getOwnPropertySymbols) {
28
+ var symbols = Object.getOwnPropertySymbols(object);
29
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
30
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
31
+ })), keys.push.apply(keys, symbols);
32
+ }
33
+
34
+ return keys;
26
35
  }
27
36
 
28
- var classnames = {exports: {}};
37
+ function _objectSpread2$1(target) {
38
+ for (var i = 1; i < arguments.length; i++) {
39
+ var source = null != arguments[i] ? arguments[i] : {};
40
+ i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
41
+ _defineProperty$1(target, key, source[key]);
42
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
43
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
44
+ });
45
+ }
29
46
 
30
- /*!
31
- Copyright (c) 2018 Jed Watson.
32
- Licensed under the MIT License (MIT), see
33
- http://jedwatson.github.io/classnames
34
- */
47
+ return target;
48
+ }
35
49
 
36
- (function (module) {
37
- /* global define */
50
+ function _typeof$2(obj) {
51
+ "@babel/helpers - typeof";
38
52
 
39
- (function () {
53
+ return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
54
+ return typeof obj;
55
+ } : function (obj) {
56
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
57
+ }, _typeof$2(obj);
58
+ }
40
59
 
41
- var hasOwn = {}.hasOwnProperty;
60
+ function _classCallCheck(instance, Constructor) {
61
+ if (!(instance instanceof Constructor)) {
62
+ throw new TypeError("Cannot call a class as a function");
63
+ }
64
+ }
42
65
 
43
- function classNames() {
44
- var classes = [];
66
+ function _defineProperties(target, props) {
67
+ for (var i = 0; i < props.length; i++) {
68
+ var descriptor = props[i];
69
+ descriptor.enumerable = descriptor.enumerable || false;
70
+ descriptor.configurable = true;
71
+ if ("value" in descriptor) descriptor.writable = true;
72
+ Object.defineProperty(target, descriptor.key, descriptor);
73
+ }
74
+ }
45
75
 
46
- for (var i = 0; i < arguments.length; i++) {
47
- var arg = arguments[i];
48
- if (!arg) continue;
76
+ function _createClass(Constructor, protoProps, staticProps) {
77
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
78
+ if (staticProps) _defineProperties(Constructor, staticProps);
79
+ Object.defineProperty(Constructor, "prototype", {
80
+ writable: false
81
+ });
82
+ return Constructor;
83
+ }
49
84
 
50
- var argType = typeof arg;
85
+ function _defineProperty$1(obj, key, value) {
86
+ if (key in obj) {
87
+ Object.defineProperty(obj, key, {
88
+ value: value,
89
+ enumerable: true,
90
+ configurable: true,
91
+ writable: true
92
+ });
93
+ } else {
94
+ obj[key] = value;
95
+ }
51
96
 
52
- if (argType === 'string' || argType === 'number') {
53
- classes.push(arg);
54
- } else if (Array.isArray(arg)) {
55
- if (arg.length) {
56
- var inner = classNames.apply(null, arg);
57
- if (inner) {
58
- classes.push(inner);
59
- }
60
- }
61
- } else if (argType === 'object') {
62
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
63
- classes.push(arg.toString());
64
- continue;
65
- }
97
+ return obj;
98
+ }
66
99
 
67
- for (var key in arg) {
68
- if (hasOwn.call(arg, key) && arg[key]) {
69
- classes.push(key);
70
- }
71
- }
72
- }
73
- }
100
+ function _slicedToArray(arr, i) {
101
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
102
+ }
74
103
 
75
- return classes.join(' ');
76
- }
104
+ function _toConsumableArray$1(arr) {
105
+ return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
106
+ }
77
107
 
78
- if (module.exports) {
79
- classNames.default = classNames;
80
- module.exports = classNames;
81
- } else {
82
- window.classNames = classNames;
83
- }
84
- }());
85
- } (classnames));
108
+ function _arrayWithoutHoles$1(arr) {
109
+ if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
110
+ }
86
111
 
87
- var classnamesExports = classnames.exports;
88
- var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
112
+ function _arrayWithHoles(arr) {
113
+ if (Array.isArray(arr)) return arr;
114
+ }
89
115
 
90
- function styleInject(css, ref) {
91
- if ( ref === void 0 ) ref = {};
92
- var insertAt = ref.insertAt;
116
+ function _iterableToArray$1(iter) {
117
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
118
+ }
93
119
 
94
- if (!css || typeof document === 'undefined') { return; }
120
+ function _iterableToArrayLimit(arr, i) {
121
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
95
122
 
96
- var head = document.head || document.getElementsByTagName('head')[0];
97
- var style = document.createElement('style');
98
- style.type = 'text/css';
123
+ if (_i == null) return;
124
+ var _arr = [];
125
+ var _n = true;
126
+ var _d = false;
99
127
 
100
- if (insertAt === 'top') {
101
- if (head.firstChild) {
102
- head.insertBefore(style, head.firstChild);
103
- } else {
104
- head.appendChild(style);
128
+ var _s, _e;
129
+
130
+ try {
131
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
132
+ _arr.push(_s.value);
133
+
134
+ if (i && _arr.length === i) break;
135
+ }
136
+ } catch (err) {
137
+ _d = true;
138
+ _e = err;
139
+ } finally {
140
+ try {
141
+ if (!_n && _i["return"] != null) _i["return"]();
142
+ } finally {
143
+ if (_d) throw _e;
105
144
  }
106
- } else {
107
- head.appendChild(style);
108
145
  }
109
146
 
110
- if (style.styleSheet) {
111
- style.styleSheet.cssText = css;
112
- } else {
113
- style.appendChild(document.createTextNode(css));
114
- }
147
+ return _arr;
115
148
  }
116
149
 
117
- var css_248z$9 = ".storybook-button {\r\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\r\n font-weight: 700;\r\n border: 0;\r\n border-radius: 3em;\r\n cursor: pointer;\r\n display: inline-block;\r\n line-height: 1;\r\n}\r\n.storybook-button--primary {\r\n color: white;\r\n background-color: #1ea7fd;\r\n}\r\n.storybook-button--secondary {\r\n color: #333;\r\n background-color: transparent;\r\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\r\n}\r\n.storybook-button--small {\r\n font-size: 12px;\r\n padding: 10px 16px;\r\n}\r\n.storybook-button--medium {\r\n font-size: 14px;\r\n padding: 11px 20px;\r\n}\r\n.storybook-button--large {\r\n font-size: 16px;\r\n padding: 12px 24px;\r\n}";
118
- styleInject(css_248z$9);
150
+ function _unsupportedIterableToArray$1(o, minLen) {
151
+ if (!o) return;
152
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
153
+ var n = Object.prototype.toString.call(o).slice(8, -1);
154
+ if (n === "Object" && o.constructor) n = o.constructor.name;
155
+ if (n === "Map" || n === "Set") return Array.from(o);
156
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
157
+ }
119
158
 
120
- /**
121
- * Primary UI component for user interaction
122
- */
123
- var Button$1 = function (_a) {
124
- var _b = _a.type, type = _b === void 0 ? "primary" : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? "medium" : _c, onClick = _a.onClick, label = _a.label;
125
- var _d = React__default.useState(4), theState = _d[0]; _d[1];
126
- return (React__default.createElement("button", { type: "button", className: classNames("storybook-button", "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick }, "".concat(label, " ").concat(theState)));
127
- };
159
+ function _arrayLikeToArray$1(arr, len) {
160
+ if (len == null || len > arr.length) len = arr.length;
128
161
 
129
- function warn() {
130
- if (console && console.warn) {
131
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
132
- args[_key] = arguments[_key];
133
- }
134
- if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
135
- console.warn(...args);
136
- }
137
- }
138
- const alreadyWarned = {};
139
- function warnOnce() {
140
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
141
- args[_key2] = arguments[_key2];
142
- }
143
- if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
144
- if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
145
- warn(...args);
162
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
163
+
164
+ return arr2;
146
165
  }
147
- const loadedClb = (i18n, cb) => () => {
148
- if (i18n.isInitialized) {
149
- cb();
150
- } else {
151
- const initialized = () => {
152
- setTimeout(() => {
153
- i18n.off('initialized', initialized);
154
- }, 0);
155
- cb();
156
- };
157
- i18n.on('initialized', initialized);
158
- }
159
- };
160
- function loadNamespaces(i18n, ns, cb) {
161
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
166
+
167
+ function _nonIterableSpread$1() {
168
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
162
169
  }
163
- function loadLanguages(i18n, lng, ns, cb) {
164
- if (typeof ns === 'string') ns = [ns];
165
- ns.forEach(n => {
166
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
167
- });
168
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
169
- }
170
- function oldI18nextHasLoadedNamespace(ns, i18n) {
171
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
172
- const lng = i18n.languages[0];
173
- const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
174
- const lastLng = i18n.languages[i18n.languages.length - 1];
175
- if (lng.toLowerCase() === 'cimode') return true;
176
- const loadNotPending = (l, n) => {
177
- const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
178
- return loadState === -1 || loadState === 2;
179
- };
180
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
181
- if (i18n.hasResourceBundle(lng, ns)) return true;
182
- if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
183
- if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
184
- return false;
185
- }
186
- function hasLoadedNamespace(ns, i18n) {
187
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
188
- if (!i18n.languages || !i18n.languages.length) {
189
- warnOnce('i18n.languages were undefined or empty', i18n.languages);
190
- return true;
191
- }
192
- const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
193
- if (!isNewerI18next) {
194
- return oldI18nextHasLoadedNamespace(ns, i18n, options);
195
- }
196
- return i18n.hasLoadedNamespace(ns, {
197
- lng: options.lng,
198
- precheck: (i18nInstance, loadNotPending) => {
199
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
200
- }
201
- });
202
- }
203
-
204
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
205
- const htmlEntities = {
206
- '&amp;': '&',
207
- '&#38;': '&',
208
- '&lt;': '<',
209
- '&#60;': '<',
210
- '&gt;': '>',
211
- '&#62;': '>',
212
- '&apos;': "'",
213
- '&#39;': "'",
214
- '&quot;': '"',
215
- '&#34;': '"',
216
- '&nbsp;': ' ',
217
- '&#160;': ' ',
218
- '&copy;': '©',
219
- '&#169;': '©',
220
- '&reg;': '®',
221
- '&#174;': '®',
222
- '&hellip;': '…',
223
- '&#8230;': '…',
224
- '&#x2F;': '/',
225
- '&#47;': '/'
226
- };
227
- const unescapeHtmlEntity = m => htmlEntities[m];
228
- const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);
229
-
230
- let defaultOptions$1 = {
231
- bindI18n: 'languageChanged',
232
- bindI18nStore: '',
233
- transEmptyNodeValue: '',
234
- transSupportBasicHtmlNodes: true,
235
- transWrapTextNodes: '',
236
- transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
237
- useSuspense: true,
238
- unescape
239
- };
240
- function setDefaults() {
241
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
242
- defaultOptions$1 = {
243
- ...defaultOptions$1,
244
- ...options
245
- };
246
- }
247
- function getDefaults() {
248
- return defaultOptions$1;
249
- }
250
-
251
- let i18nInstance;
252
- function setI18n(instance) {
253
- i18nInstance = instance;
254
- }
255
- function getI18n() {
256
- return i18nInstance;
257
- }
258
-
259
- const initReactI18next = {
260
- type: '3rdParty',
261
- init(instance) {
262
- setDefaults(instance.options.react);
263
- setI18n(instance);
264
- }
265
- };
266
-
267
- const I18nContext = React__default.createContext();
268
- class ReportNamespaces {
269
- constructor() {
270
- this.usedNamespaces = {};
271
- }
272
- addUsedNamespaces(namespaces) {
273
- namespaces.forEach(ns => {
274
- if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
275
- });
276
- }
277
- getUsedNamespaces() {
278
- return Object.keys(this.usedNamespaces);
279
- }
280
- }
281
-
282
- const usePrevious = (value, ignore) => {
283
- const ref = React__default.useRef();
284
- React__default.useEffect(() => {
285
- ref.current = ignore ? ref.current : value;
286
- }, [value, ignore]);
287
- return ref.current;
288
- };
289
- function useTranslation(ns) {
290
- let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
291
- const {
292
- i18n: i18nFromProps
293
- } = props;
294
- const {
295
- i18n: i18nFromContext,
296
- defaultNS: defaultNSFromContext
297
- } = React__default.useContext(I18nContext) || {};
298
- const i18n = i18nFromProps || i18nFromContext || getI18n();
299
- if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
300
- if (!i18n) {
301
- warnOnce('You will need to pass in an i18next instance by using initReactI18next');
302
- const notReadyT = (k, optsOrDefaultValue) => {
303
- if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
304
- if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
305
- return Array.isArray(k) ? k[k.length - 1] : k;
306
- };
307
- const retNotReady = [notReadyT, {}, false];
308
- retNotReady.t = notReadyT;
309
- retNotReady.i18n = {};
310
- retNotReady.ready = false;
311
- return retNotReady;
312
- }
313
- if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
314
- const i18nOptions = {
315
- ...getDefaults(),
316
- ...i18n.options.react,
317
- ...props
318
- };
319
- const {
320
- useSuspense,
321
- keyPrefix
322
- } = i18nOptions;
323
- let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
324
- namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
325
- if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
326
- const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
327
- function getT() {
328
- return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
329
- }
330
- const [t, setT] = React__default.useState(getT);
331
- let joinedNS = namespaces.join();
332
- if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
333
- const previousJoinedNS = usePrevious(joinedNS);
334
- const isMounted = React__default.useRef(true);
335
- React__default.useEffect(() => {
336
- const {
337
- bindI18n,
338
- bindI18nStore
339
- } = i18nOptions;
340
- isMounted.current = true;
341
- if (!ready && !useSuspense) {
342
- if (props.lng) {
343
- loadLanguages(i18n, props.lng, namespaces, () => {
344
- if (isMounted.current) setT(getT);
345
- });
346
- } else {
347
- loadNamespaces(i18n, namespaces, () => {
348
- if (isMounted.current) setT(getT);
349
- });
350
- }
351
- }
352
- if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
353
- setT(getT);
354
- }
355
- function boundReset() {
356
- if (isMounted.current) setT(getT);
357
- }
358
- if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
359
- if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
360
- return () => {
361
- isMounted.current = false;
362
- if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
363
- if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
364
- };
365
- }, [i18n, joinedNS]);
366
- const isInitial = React__default.useRef(true);
367
- React__default.useEffect(() => {
368
- if (isMounted.current && !isInitial.current) {
369
- setT(getT);
370
- }
371
- isInitial.current = false;
372
- }, [i18n, keyPrefix]);
373
- const ret = [t, i18n, ready];
374
- ret.t = t;
375
- ret.i18n = i18n;
376
- ret.ready = ready;
377
- if (ready) return ret;
378
- if (!ready && !useSuspense) return ret;
379
- throw new Promise(resolve => {
380
- if (props.lng) {
381
- loadLanguages(i18n, props.lng, namespaces, () => resolve());
382
- } else {
383
- loadNamespaces(i18n, namespaces, () => resolve());
384
- }
385
- });
386
- }
387
-
388
- var css_248z$8 = ".will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n height: 35px;\n background-color: #384265;\n}";
389
- styleInject(css_248z$8);
390
-
391
- function Divider() {
392
- return React__default.createElement("div", { className: "will-filter-bar-divider" });
393
- }
394
-
395
- var css_248z$7 = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 15px;\n text-align: initial;\n}\n";
396
- styleInject(css_248z$7);
397
-
398
- function SelectButton(_a) {
399
- var label = _a.label, onClick = _a.onClick, style = _a.style;
400
- return (React__default.createElement("button", { className: "will-filter-bar-select-button", onClick: onClick, style: style }, label));
401
- }
402
-
403
- function ownKeys$1(object, enumerableOnly) {
404
- var keys = Object.keys(object);
405
-
406
- if (Object.getOwnPropertySymbols) {
407
- var symbols = Object.getOwnPropertySymbols(object);
408
- enumerableOnly && (symbols = symbols.filter(function (sym) {
409
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
410
- })), keys.push.apply(keys, symbols);
411
- }
412
-
413
- return keys;
414
- }
415
-
416
- function _objectSpread2$1(target) {
417
- for (var i = 1; i < arguments.length; i++) {
418
- var source = null != arguments[i] ? arguments[i] : {};
419
- i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
420
- _defineProperty$1(target, key, source[key]);
421
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
422
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
423
- });
424
- }
425
-
426
- return target;
427
- }
428
-
429
- function _typeof$2(obj) {
430
- "@babel/helpers - typeof";
431
-
432
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
433
- return typeof obj;
434
- } : function (obj) {
435
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
436
- }, _typeof$2(obj);
437
- }
438
-
439
- function _classCallCheck(instance, Constructor) {
440
- if (!(instance instanceof Constructor)) {
441
- throw new TypeError("Cannot call a class as a function");
442
- }
443
- }
444
-
445
- function _defineProperties(target, props) {
446
- for (var i = 0; i < props.length; i++) {
447
- var descriptor = props[i];
448
- descriptor.enumerable = descriptor.enumerable || false;
449
- descriptor.configurable = true;
450
- if ("value" in descriptor) descriptor.writable = true;
451
- Object.defineProperty(target, descriptor.key, descriptor);
452
- }
453
- }
454
-
455
- function _createClass(Constructor, protoProps, staticProps) {
456
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
457
- if (staticProps) _defineProperties(Constructor, staticProps);
458
- Object.defineProperty(Constructor, "prototype", {
459
- writable: false
460
- });
461
- return Constructor;
462
- }
463
-
464
- function _defineProperty$1(obj, key, value) {
465
- if (key in obj) {
466
- Object.defineProperty(obj, key, {
467
- value: value,
468
- enumerable: true,
469
- configurable: true,
470
- writable: true
471
- });
472
- } else {
473
- obj[key] = value;
474
- }
475
-
476
- return obj;
477
- }
478
-
479
- function _slicedToArray(arr, i) {
480
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
481
- }
482
-
483
- function _toConsumableArray$1(arr) {
484
- return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
485
- }
486
-
487
- function _arrayWithoutHoles$1(arr) {
488
- if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
489
- }
490
-
491
- function _arrayWithHoles(arr) {
492
- if (Array.isArray(arr)) return arr;
493
- }
494
-
495
- function _iterableToArray$1(iter) {
496
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
497
- }
498
-
499
- function _iterableToArrayLimit(arr, i) {
500
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
501
-
502
- if (_i == null) return;
503
- var _arr = [];
504
- var _n = true;
505
- var _d = false;
506
-
507
- var _s, _e;
508
-
509
- try {
510
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
511
- _arr.push(_s.value);
512
-
513
- if (i && _arr.length === i) break;
514
- }
515
- } catch (err) {
516
- _d = true;
517
- _e = err;
518
- } finally {
519
- try {
520
- if (!_n && _i["return"] != null) _i["return"]();
521
- } finally {
522
- if (_d) throw _e;
523
- }
524
- }
525
-
526
- return _arr;
527
- }
528
-
529
- function _unsupportedIterableToArray$1(o, minLen) {
530
- if (!o) return;
531
- if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
532
- var n = Object.prototype.toString.call(o).slice(8, -1);
533
- if (n === "Object" && o.constructor) n = o.constructor.name;
534
- if (n === "Map" || n === "Set") return Array.from(o);
535
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
536
- }
537
-
538
- function _arrayLikeToArray$1(arr, len) {
539
- if (len == null || len > arr.length) len = arr.length;
540
-
541
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
542
-
543
- return arr2;
544
- }
545
-
546
- function _nonIterableSpread$1() {
547
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
548
- }
549
-
550
- function _nonIterableRest() {
551
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
170
+
171
+ function _nonIterableRest() {
172
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
552
173
  }
553
174
 
554
175
  var noop$1 = function noop() {};
@@ -2754,637 +2375,1023 @@ var LayersCounter = {
2754
2375
  }
2755
2376
  };
2756
2377
 
2757
- var LayersText = {
2378
+ var LayersText = {
2379
+ mixout: function mixout() {
2380
+ return {
2381
+ text: function text(content) {
2382
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2383
+ var _params$transform = params.transform,
2384
+ transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2385
+ _params$title = params.title,
2386
+ title = _params$title === void 0 ? null : _params$title,
2387
+ _params$classes = params.classes,
2388
+ classes = _params$classes === void 0 ? [] : _params$classes,
2389
+ _params$attributes = params.attributes,
2390
+ attributes = _params$attributes === void 0 ? {} : _params$attributes,
2391
+ _params$styles = params.styles,
2392
+ styles = _params$styles === void 0 ? {} : _params$styles;
2393
+ return domVariants({
2394
+ type: 'text',
2395
+ content: content
2396
+ }, function () {
2397
+ callHooks('beforeDOMElementCreation', {
2398
+ content: content,
2399
+ params: params
2400
+ });
2401
+ return makeLayersTextAbstract({
2402
+ content: content,
2403
+ transform: _objectSpread2$1(_objectSpread2$1({}, meaninglessTransform), transform),
2404
+ title: title,
2405
+ extra: {
2406
+ attributes: attributes,
2407
+ styles: styles,
2408
+ classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray$1(classes))
2409
+ }
2410
+ });
2411
+ });
2412
+ }
2413
+ };
2414
+ },
2415
+ provides: function provides(providers$$1) {
2416
+ providers$$1.generateLayersText = function (node, nodeMeta) {
2417
+ var title = nodeMeta.title,
2418
+ transform = nodeMeta.transform,
2419
+ extra = nodeMeta.extra;
2420
+ var width = null;
2421
+ var height = null;
2422
+
2423
+ if (IS_IE) {
2424
+ var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
2425
+ var boundingClientRect = node.getBoundingClientRect();
2426
+ width = boundingClientRect.width / computedFontSize;
2427
+ height = boundingClientRect.height / computedFontSize;
2428
+ }
2429
+
2430
+ if (config.autoA11y && !title) {
2431
+ extra.attributes['aria-hidden'] = 'true';
2432
+ }
2433
+
2434
+ return Promise.resolve([node, makeLayersTextAbstract({
2435
+ content: node.innerHTML,
2436
+ width: width,
2437
+ height: height,
2438
+ transform: transform,
2439
+ title: title,
2440
+ extra: extra,
2441
+ watchable: true
2442
+ })]);
2443
+ };
2444
+ }
2445
+ };
2446
+
2447
+ var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
2448
+ var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
2449
+ function hexValueFromContent(content) {
2450
+ var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
2451
+ var codePoint = codePointAt(cleaned, 0);
2452
+ var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
2453
+ var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
2454
+ return {
2455
+ value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
2456
+ isSecondary: isPrependTen || isDoubled
2457
+ };
2458
+ }
2459
+
2460
+ function replaceForPosition(node, position) {
2461
+ var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
2462
+ return new Promise(function (resolve, reject) {
2463
+ if (node.getAttribute(pendingAttribute) !== null) {
2464
+ // This node is already being processed
2465
+ return resolve();
2466
+ }
2467
+
2468
+ var children = toArray(node.children);
2469
+ var alreadyProcessedPseudoElement = children.filter(function (c) {
2470
+ return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
2471
+ })[0];
2472
+ var styles = WINDOW.getComputedStyle(node, position);
2473
+ var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
2474
+ var fontWeight = styles.getPropertyValue('font-weight');
2475
+ var content = styles.getPropertyValue('content');
2476
+
2477
+ if (alreadyProcessedPseudoElement && !fontFamily) {
2478
+ // If we've already processed it but the current computed style does not result in a font-family,
2479
+ // that probably means that a class name that was previously present to make the icon has been
2480
+ // removed. So we now should delete the icon.
2481
+ node.removeChild(alreadyProcessedPseudoElement);
2482
+ return resolve();
2483
+ } else if (fontFamily && content !== 'none' && content !== '') {
2484
+ var _content = styles.getPropertyValue('content');
2485
+
2486
+ var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
2487
+ var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
2488
+
2489
+ var _hexValueFromContent = hexValueFromContent(_content),
2490
+ hexValue = _hexValueFromContent.value,
2491
+ isSecondary = _hexValueFromContent.isSecondary;
2492
+
2493
+ var isV4 = fontFamily[0].startsWith('FontAwesome');
2494
+ var iconName = byUnicode(prefix, hexValue);
2495
+ var iconIdentifier = iconName;
2496
+
2497
+ if (isV4) {
2498
+ var iconName4 = byOldUnicode(hexValue);
2499
+
2500
+ if (iconName4.iconName && iconName4.prefix) {
2501
+ iconName = iconName4.iconName;
2502
+ prefix = iconName4.prefix;
2503
+ }
2504
+ } // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
2505
+ // already done so with the same prefix and iconName
2506
+
2507
+
2508
+ if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
2509
+ node.setAttribute(pendingAttribute, iconIdentifier);
2510
+
2511
+ if (alreadyProcessedPseudoElement) {
2512
+ // Delete the old one, since we're replacing it with a new one
2513
+ node.removeChild(alreadyProcessedPseudoElement);
2514
+ }
2515
+
2516
+ var meta = blankMeta();
2517
+ var extra = meta.extra;
2518
+ extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
2519
+ findIcon(iconName, prefix).then(function (main) {
2520
+ var _abstract = makeInlineSvgAbstract(_objectSpread2$1(_objectSpread2$1({}, meta), {}, {
2521
+ icons: {
2522
+ main: main,
2523
+ mask: emptyCanonicalIcon()
2524
+ },
2525
+ prefix: prefix,
2526
+ iconName: iconIdentifier,
2527
+ extra: extra,
2528
+ watchable: true
2529
+ }));
2530
+
2531
+ var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
2532
+
2533
+ if (position === '::before') {
2534
+ node.insertBefore(element, node.firstChild);
2535
+ } else {
2536
+ node.appendChild(element);
2537
+ }
2538
+
2539
+ element.outerHTML = _abstract.map(function (a) {
2540
+ return toHtml(a);
2541
+ }).join('\n');
2542
+ node.removeAttribute(pendingAttribute);
2543
+ resolve();
2544
+ }).catch(reject);
2545
+ } else {
2546
+ resolve();
2547
+ }
2548
+ } else {
2549
+ resolve();
2550
+ }
2551
+ });
2552
+ }
2553
+
2554
+ function replace(node) {
2555
+ return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
2556
+ }
2557
+
2558
+ function processable(node) {
2559
+ return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
2560
+ }
2561
+
2562
+ function searchPseudoElements(root) {
2563
+ if (!IS_DOM) return;
2564
+ return new Promise(function (resolve, reject) {
2565
+ var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
2566
+ var end = perf.begin('searchPseudoElements');
2567
+ disableObservation();
2568
+ Promise.all(operations).then(function () {
2569
+ end();
2570
+ enableObservation();
2571
+ resolve();
2572
+ }).catch(function () {
2573
+ end();
2574
+ enableObservation();
2575
+ reject();
2576
+ });
2577
+ });
2578
+ }
2579
+
2580
+ var PseudoElements = {
2581
+ hooks: function hooks() {
2582
+ return {
2583
+ mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
2584
+ accumulator.pseudoElementsCallback = searchPseudoElements;
2585
+ return accumulator;
2586
+ }
2587
+ };
2588
+ },
2589
+ provides: function provides(providers$$1) {
2590
+ providers$$1.pseudoElements2svg = function (params) {
2591
+ var _params$node = params.node,
2592
+ node = _params$node === void 0 ? DOCUMENT : _params$node;
2593
+
2594
+ if (config.searchPseudoElements) {
2595
+ searchPseudoElements(node);
2596
+ }
2597
+ };
2598
+ }
2599
+ };
2600
+
2601
+ var _unwatched = false;
2602
+ var MutationObserver$1 = {
2758
2603
  mixout: function mixout() {
2759
2604
  return {
2760
- text: function text(content) {
2761
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2762
- var _params$transform = params.transform,
2763
- transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2764
- _params$title = params.title,
2765
- title = _params$title === void 0 ? null : _params$title,
2766
- _params$classes = params.classes,
2767
- classes = _params$classes === void 0 ? [] : _params$classes,
2768
- _params$attributes = params.attributes,
2769
- attributes = _params$attributes === void 0 ? {} : _params$attributes,
2770
- _params$styles = params.styles,
2771
- styles = _params$styles === void 0 ? {} : _params$styles;
2772
- return domVariants({
2773
- type: 'text',
2774
- content: content
2775
- }, function () {
2776
- callHooks('beforeDOMElementCreation', {
2777
- content: content,
2778
- params: params
2779
- });
2780
- return makeLayersTextAbstract({
2781
- content: content,
2782
- transform: _objectSpread2$1(_objectSpread2$1({}, meaninglessTransform), transform),
2783
- title: title,
2784
- extra: {
2785
- attributes: attributes,
2786
- styles: styles,
2787
- classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray$1(classes))
2788
- }
2789
- });
2790
- });
2605
+ dom: {
2606
+ unwatch: function unwatch() {
2607
+ disableObservation();
2608
+ _unwatched = true;
2609
+ }
2791
2610
  }
2792
2611
  };
2793
2612
  },
2794
- provides: function provides(providers$$1) {
2795
- providers$$1.generateLayersText = function (node, nodeMeta) {
2796
- var title = nodeMeta.title,
2797
- transform = nodeMeta.transform,
2798
- extra = nodeMeta.extra;
2799
- var width = null;
2800
- var height = null;
2801
-
2802
- if (IS_IE) {
2803
- var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
2804
- var boundingClientRect = node.getBoundingClientRect();
2805
- width = boundingClientRect.width / computedFontSize;
2806
- height = boundingClientRect.height / computedFontSize;
2807
- }
2613
+ hooks: function hooks() {
2614
+ return {
2615
+ bootstrap: function bootstrap() {
2616
+ observe(chainHooks('mutationObserverCallbacks', {}));
2617
+ },
2618
+ noAuto: function noAuto() {
2619
+ disconnect();
2620
+ },
2621
+ watch: function watch(params) {
2622
+ var observeMutationsRoot = params.observeMutationsRoot;
2808
2623
 
2809
- if (config.autoA11y && !title) {
2810
- extra.attributes['aria-hidden'] = 'true';
2624
+ if (_unwatched) {
2625
+ enableObservation();
2626
+ } else {
2627
+ observe(chainHooks('mutationObserverCallbacks', {
2628
+ observeMutationsRoot: observeMutationsRoot
2629
+ }));
2630
+ }
2811
2631
  }
2812
-
2813
- return Promise.resolve([node, makeLayersTextAbstract({
2814
- content: node.innerHTML,
2815
- width: width,
2816
- height: height,
2817
- transform: transform,
2818
- title: title,
2819
- extra: extra,
2820
- watchable: true
2821
- })]);
2822
2632
  };
2823
2633
  }
2824
2634
  };
2825
2635
 
2826
- var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
2827
- var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
2828
- function hexValueFromContent(content) {
2829
- var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
2830
- var codePoint = codePointAt(cleaned, 0);
2831
- var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
2832
- var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
2833
- return {
2834
- value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
2835
- isSecondary: isPrependTen || isDoubled
2636
+ var parseTransformString = function parseTransformString(transformString) {
2637
+ var transform = {
2638
+ size: 16,
2639
+ x: 0,
2640
+ y: 0,
2641
+ flipX: false,
2642
+ flipY: false,
2643
+ rotate: 0
2836
2644
  };
2837
- }
2645
+ return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
2646
+ var parts = n.toLowerCase().split('-');
2647
+ var first = parts[0];
2648
+ var rest = parts.slice(1).join('-');
2838
2649
 
2839
- function replaceForPosition(node, position) {
2840
- var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
2841
- return new Promise(function (resolve, reject) {
2842
- if (node.getAttribute(pendingAttribute) !== null) {
2843
- // This node is already being processed
2844
- return resolve();
2650
+ if (first && rest === 'h') {
2651
+ acc.flipX = true;
2652
+ return acc;
2845
2653
  }
2846
2654
 
2847
- var children = toArray(node.children);
2848
- var alreadyProcessedPseudoElement = children.filter(function (c) {
2849
- return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
2850
- })[0];
2851
- var styles = WINDOW.getComputedStyle(node, position);
2852
- var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
2853
- var fontWeight = styles.getPropertyValue('font-weight');
2854
- var content = styles.getPropertyValue('content');
2655
+ if (first && rest === 'v') {
2656
+ acc.flipY = true;
2657
+ return acc;
2658
+ }
2855
2659
 
2856
- if (alreadyProcessedPseudoElement && !fontFamily) {
2857
- // If we've already processed it but the current computed style does not result in a font-family,
2858
- // that probably means that a class name that was previously present to make the icon has been
2859
- // removed. So we now should delete the icon.
2860
- node.removeChild(alreadyProcessedPseudoElement);
2861
- return resolve();
2862
- } else if (fontFamily && content !== 'none' && content !== '') {
2863
- var _content = styles.getPropertyValue('content');
2660
+ rest = parseFloat(rest);
2864
2661
 
2865
- var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
2866
- var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
2662
+ if (isNaN(rest)) {
2663
+ return acc;
2664
+ }
2665
+
2666
+ switch (first) {
2667
+ case 'grow':
2668
+ acc.size = acc.size + rest;
2669
+ break;
2670
+
2671
+ case 'shrink':
2672
+ acc.size = acc.size - rest;
2673
+ break;
2674
+
2675
+ case 'left':
2676
+ acc.x = acc.x - rest;
2677
+ break;
2678
+
2679
+ case 'right':
2680
+ acc.x = acc.x + rest;
2681
+ break;
2682
+
2683
+ case 'up':
2684
+ acc.y = acc.y - rest;
2685
+ break;
2686
+
2687
+ case 'down':
2688
+ acc.y = acc.y + rest;
2689
+ break;
2690
+
2691
+ case 'rotate':
2692
+ acc.rotate = acc.rotate + rest;
2693
+ break;
2694
+ }
2695
+
2696
+ return acc;
2697
+ }, transform);
2698
+ };
2699
+ var PowerTransforms = {
2700
+ mixout: function mixout() {
2701
+ return {
2702
+ parse: {
2703
+ transform: function transform(transformString) {
2704
+ return parseTransformString(transformString);
2705
+ }
2706
+ }
2707
+ };
2708
+ },
2709
+ hooks: function hooks() {
2710
+ return {
2711
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
2712
+ var transformString = node.getAttribute('data-fa-transform');
2713
+
2714
+ if (transformString) {
2715
+ accumulator.transform = parseTransformString(transformString);
2716
+ }
2717
+
2718
+ return accumulator;
2719
+ }
2720
+ };
2721
+ },
2722
+ provides: function provides(providers) {
2723
+ providers.generateAbstractTransformGrouping = function (_ref) {
2724
+ var main = _ref.main,
2725
+ transform = _ref.transform,
2726
+ containerWidth = _ref.containerWidth,
2727
+ iconWidth = _ref.iconWidth;
2728
+ var outer = {
2729
+ transform: "translate(".concat(containerWidth / 2, " 256)")
2730
+ };
2731
+ var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
2732
+ var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
2733
+ var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
2734
+ var inner = {
2735
+ transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
2736
+ };
2737
+ var path = {
2738
+ transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
2739
+ };
2740
+ var operations = {
2741
+ outer: outer,
2742
+ inner: inner,
2743
+ path: path
2744
+ };
2745
+ return {
2746
+ tag: 'g',
2747
+ attributes: _objectSpread2$1({}, operations.outer),
2748
+ children: [{
2749
+ tag: 'g',
2750
+ attributes: _objectSpread2$1({}, operations.inner),
2751
+ children: [{
2752
+ tag: main.icon.tag,
2753
+ children: main.icon.children,
2754
+ attributes: _objectSpread2$1(_objectSpread2$1({}, main.icon.attributes), operations.path)
2755
+ }]
2756
+ }]
2757
+ };
2758
+ };
2759
+ }
2760
+ };
2867
2761
 
2868
- var _hexValueFromContent = hexValueFromContent(_content),
2869
- hexValue = _hexValueFromContent.value,
2870
- isSecondary = _hexValueFromContent.isSecondary;
2762
+ var ALL_SPACE = {
2763
+ x: 0,
2764
+ y: 0,
2765
+ width: '100%',
2766
+ height: '100%'
2767
+ };
2871
2768
 
2872
- var isV4 = fontFamily[0].startsWith('FontAwesome');
2873
- var iconName = byUnicode(prefix, hexValue);
2874
- var iconIdentifier = iconName;
2769
+ function fillBlack(_abstract) {
2770
+ var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2875
2771
 
2876
- if (isV4) {
2877
- var iconName4 = byOldUnicode(hexValue);
2772
+ if (_abstract.attributes && (_abstract.attributes.fill || force)) {
2773
+ _abstract.attributes.fill = 'black';
2774
+ }
2878
2775
 
2879
- if (iconName4.iconName && iconName4.prefix) {
2880
- iconName = iconName4.iconName;
2881
- prefix = iconName4.prefix;
2882
- }
2883
- } // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
2884
- // already done so with the same prefix and iconName
2776
+ return _abstract;
2777
+ }
2885
2778
 
2779
+ function deGroup(_abstract2) {
2780
+ if (_abstract2.tag === 'g') {
2781
+ return _abstract2.children;
2782
+ } else {
2783
+ return [_abstract2];
2784
+ }
2785
+ }
2886
2786
 
2887
- if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
2888
- node.setAttribute(pendingAttribute, iconIdentifier);
2787
+ var Masks = {
2788
+ hooks: function hooks() {
2789
+ return {
2790
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
2791
+ var maskData = node.getAttribute('data-fa-mask');
2792
+ var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
2793
+ return i.trim();
2794
+ }));
2889
2795
 
2890
- if (alreadyProcessedPseudoElement) {
2891
- // Delete the old one, since we're replacing it with a new one
2892
- node.removeChild(alreadyProcessedPseudoElement);
2796
+ if (!mask.prefix) {
2797
+ mask.prefix = getDefaultUsablePrefix();
2893
2798
  }
2894
2799
 
2895
- var meta = blankMeta();
2896
- var extra = meta.extra;
2897
- extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
2898
- findIcon(iconName, prefix).then(function (main) {
2899
- var _abstract = makeInlineSvgAbstract(_objectSpread2$1(_objectSpread2$1({}, meta), {}, {
2900
- icons: {
2901
- main: main,
2902
- mask: emptyCanonicalIcon()
2903
- },
2904
- prefix: prefix,
2905
- iconName: iconIdentifier,
2906
- extra: extra,
2907
- watchable: true
2908
- }));
2909
-
2910
- var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
2800
+ accumulator.mask = mask;
2801
+ accumulator.maskId = node.getAttribute('data-fa-mask-id');
2802
+ return accumulator;
2803
+ }
2804
+ };
2805
+ },
2806
+ provides: function provides(providers) {
2807
+ providers.generateAbstractMask = function (_ref) {
2808
+ var children = _ref.children,
2809
+ attributes = _ref.attributes,
2810
+ main = _ref.main,
2811
+ mask = _ref.mask,
2812
+ explicitMaskId = _ref.maskId,
2813
+ transform = _ref.transform;
2814
+ var mainWidth = main.width,
2815
+ mainPath = main.icon;
2816
+ var maskWidth = mask.width,
2817
+ maskPath = mask.icon;
2818
+ var trans = transformForSvg({
2819
+ transform: transform,
2820
+ containerWidth: maskWidth,
2821
+ iconWidth: mainWidth
2822
+ });
2823
+ var maskRect = {
2824
+ tag: 'rect',
2825
+ attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
2826
+ fill: 'white'
2827
+ })
2828
+ };
2829
+ var maskInnerGroupChildrenMixin = mainPath.children ? {
2830
+ children: mainPath.children.map(fillBlack)
2831
+ } : {};
2832
+ var maskInnerGroup = {
2833
+ tag: 'g',
2834
+ attributes: _objectSpread2$1({}, trans.inner),
2835
+ children: [fillBlack(_objectSpread2$1({
2836
+ tag: mainPath.tag,
2837
+ attributes: _objectSpread2$1(_objectSpread2$1({}, mainPath.attributes), trans.path)
2838
+ }, maskInnerGroupChildrenMixin))]
2839
+ };
2840
+ var maskOuterGroup = {
2841
+ tag: 'g',
2842
+ attributes: _objectSpread2$1({}, trans.outer),
2843
+ children: [maskInnerGroup]
2844
+ };
2845
+ var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
2846
+ var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
2847
+ var maskTag = {
2848
+ tag: 'mask',
2849
+ attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
2850
+ id: maskId,
2851
+ maskUnits: 'userSpaceOnUse',
2852
+ maskContentUnits: 'userSpaceOnUse'
2853
+ }),
2854
+ children: [maskRect, maskOuterGroup]
2855
+ };
2856
+ var defs = {
2857
+ tag: 'defs',
2858
+ children: [{
2859
+ tag: 'clipPath',
2860
+ attributes: {
2861
+ id: clipId
2862
+ },
2863
+ children: deGroup(maskPath)
2864
+ }, maskTag]
2865
+ };
2866
+ children.push(defs, {
2867
+ tag: 'rect',
2868
+ attributes: _objectSpread2$1({
2869
+ fill: 'currentColor',
2870
+ 'clip-path': "url(#".concat(clipId, ")"),
2871
+ mask: "url(#".concat(maskId, ")")
2872
+ }, ALL_SPACE)
2873
+ });
2874
+ return {
2875
+ children: children,
2876
+ attributes: attributes
2877
+ };
2878
+ };
2879
+ }
2880
+ };
2911
2881
 
2912
- if (position === '::before') {
2913
- node.insertBefore(element, node.firstChild);
2914
- } else {
2915
- node.appendChild(element);
2916
- }
2882
+ var MissingIconIndicator = {
2883
+ provides: function provides(providers) {
2884
+ var reduceMotion = false;
2917
2885
 
2918
- element.outerHTML = _abstract.map(function (a) {
2919
- return toHtml(a);
2920
- }).join('\n');
2921
- node.removeAttribute(pendingAttribute);
2922
- resolve();
2923
- }).catch(reject);
2924
- } else {
2925
- resolve();
2926
- }
2927
- } else {
2928
- resolve();
2886
+ if (WINDOW.matchMedia) {
2887
+ reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
2929
2888
  }
2930
- });
2931
- }
2932
2889
 
2933
- function replace(node) {
2934
- return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
2935
- }
2890
+ providers.missingIconAbstract = function () {
2891
+ var gChildren = [];
2892
+ var FILL = {
2893
+ fill: 'currentColor'
2894
+ };
2895
+ var ANIMATION_BASE = {
2896
+ attributeType: 'XML',
2897
+ repeatCount: 'indefinite',
2898
+ dur: '2s'
2899
+ }; // Ring
2936
2900
 
2937
- function processable(node) {
2938
- return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
2939
- }
2901
+ gChildren.push({
2902
+ tag: 'path',
2903
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2904
+ d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
2905
+ })
2906
+ });
2940
2907
 
2941
- function searchPseudoElements(root) {
2942
- if (!IS_DOM) return;
2943
- return new Promise(function (resolve, reject) {
2944
- var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
2945
- var end = perf.begin('searchPseudoElements');
2946
- disableObservation();
2947
- Promise.all(operations).then(function () {
2948
- end();
2949
- enableObservation();
2950
- resolve();
2951
- }).catch(function () {
2952
- end();
2953
- enableObservation();
2954
- reject();
2955
- });
2956
- });
2957
- }
2908
+ var OPACITY_ANIMATE = _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
2909
+ attributeName: 'opacity'
2910
+ });
2958
2911
 
2959
- var PseudoElements = {
2960
- hooks: function hooks() {
2961
- return {
2962
- mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
2963
- accumulator.pseudoElementsCallback = searchPseudoElements;
2964
- return accumulator;
2912
+ var dot = {
2913
+ tag: 'circle',
2914
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2915
+ cx: '256',
2916
+ cy: '364',
2917
+ r: '28'
2918
+ }),
2919
+ children: []
2920
+ };
2921
+
2922
+ if (!reduceMotion) {
2923
+ dot.children.push({
2924
+ tag: 'animate',
2925
+ attributes: _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
2926
+ attributeName: 'r',
2927
+ values: '28;14;28;28;14;28;'
2928
+ })
2929
+ }, {
2930
+ tag: 'animate',
2931
+ attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
2932
+ values: '1;0;1;1;0;1;'
2933
+ })
2934
+ });
2965
2935
  }
2966
- };
2967
- },
2968
- provides: function provides(providers$$1) {
2969
- providers$$1.pseudoElements2svg = function (params) {
2970
- var _params$node = params.node,
2971
- node = _params$node === void 0 ? DOCUMENT : _params$node;
2972
2936
 
2973
- if (config.searchPseudoElements) {
2974
- searchPseudoElements(node);
2937
+ gChildren.push(dot);
2938
+ gChildren.push({
2939
+ tag: 'path',
2940
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2941
+ opacity: '1',
2942
+ d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
2943
+ }),
2944
+ children: reduceMotion ? [] : [{
2945
+ tag: 'animate',
2946
+ attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
2947
+ values: '1;0;0;0;0;1;'
2948
+ })
2949
+ }]
2950
+ });
2951
+
2952
+ if (!reduceMotion) {
2953
+ // Exclamation
2954
+ gChildren.push({
2955
+ tag: 'path',
2956
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2957
+ opacity: '0',
2958
+ d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
2959
+ }),
2960
+ children: [{
2961
+ tag: 'animate',
2962
+ attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
2963
+ values: '0;0;1;1;0;0;'
2964
+ })
2965
+ }]
2966
+ });
2975
2967
  }
2968
+
2969
+ return {
2970
+ tag: 'g',
2971
+ attributes: {
2972
+ 'class': 'missing'
2973
+ },
2974
+ children: gChildren
2975
+ };
2976
2976
  };
2977
2977
  }
2978
2978
  };
2979
2979
 
2980
- var _unwatched = false;
2981
- var MutationObserver$1 = {
2982
- mixout: function mixout() {
2983
- return {
2984
- dom: {
2985
- unwatch: function unwatch() {
2986
- disableObservation();
2987
- _unwatched = true;
2988
- }
2989
- }
2990
- };
2991
- },
2980
+ var SvgSymbols = {
2992
2981
  hooks: function hooks() {
2993
2982
  return {
2994
- bootstrap: function bootstrap() {
2995
- observe(chainHooks('mutationObserverCallbacks', {}));
2996
- },
2997
- noAuto: function noAuto() {
2998
- disconnect();
2999
- },
3000
- watch: function watch(params) {
3001
- var observeMutationsRoot = params.observeMutationsRoot;
3002
-
3003
- if (_unwatched) {
3004
- enableObservation();
3005
- } else {
3006
- observe(chainHooks('mutationObserverCallbacks', {
3007
- observeMutationsRoot: observeMutationsRoot
3008
- }));
3009
- }
2983
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
2984
+ var symbolData = node.getAttribute('data-fa-symbol');
2985
+ var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
2986
+ accumulator['symbol'] = symbol;
2987
+ return accumulator;
3010
2988
  }
3011
2989
  };
3012
2990
  }
3013
2991
  };
3014
2992
 
3015
- var parseTransformString = function parseTransformString(transformString) {
3016
- var transform = {
3017
- size: 16,
3018
- x: 0,
3019
- y: 0,
3020
- flipX: false,
3021
- flipY: false,
3022
- rotate: 0
3023
- };
3024
- return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
3025
- var parts = n.toLowerCase().split('-');
3026
- var first = parts[0];
3027
- var rest = parts.slice(1).join('-');
2993
+ var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];
3028
2994
 
3029
- if (first && rest === 'h') {
3030
- acc.flipX = true;
3031
- return acc;
3032
- }
2995
+ registerPlugins(plugins, {
2996
+ mixoutsTo: api
2997
+ });
2998
+ api.noAuto;
2999
+ api.config;
3000
+ var library$1 = api.library;
3001
+ api.dom;
3002
+ var parse$1 = api.parse;
3003
+ api.findIconDefinition;
3004
+ api.toHtml;
3005
+ var icon = api.icon;
3006
+ api.layer;
3007
+ api.text;
3008
+ api.counter;
3033
3009
 
3034
- if (first && rest === 'v') {
3035
- acc.flipY = true;
3036
- return acc;
3037
- }
3010
+ var faMagnifyingGlass = {
3011
+ prefix: 'fas',
3012
+ iconName: 'magnifying-glass',
3013
+ icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
3014
+ };
3015
+ var faSearch = faMagnifyingGlass;
3038
3016
 
3039
- rest = parseFloat(rest);
3017
+ function getDefaultExportFromCjs (x) {
3018
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3019
+ }
3040
3020
 
3041
- if (isNaN(rest)) {
3042
- return acc;
3043
- }
3021
+ var classnames = {exports: {}};
3044
3022
 
3045
- switch (first) {
3046
- case 'grow':
3047
- acc.size = acc.size + rest;
3048
- break;
3023
+ /*!
3024
+ Copyright (c) 2018 Jed Watson.
3025
+ Licensed under the MIT License (MIT), see
3026
+ http://jedwatson.github.io/classnames
3027
+ */
3049
3028
 
3050
- case 'shrink':
3051
- acc.size = acc.size - rest;
3052
- break;
3029
+ (function (module) {
3030
+ /* global define */
3053
3031
 
3054
- case 'left':
3055
- acc.x = acc.x - rest;
3056
- break;
3032
+ (function () {
3057
3033
 
3058
- case 'right':
3059
- acc.x = acc.x + rest;
3060
- break;
3034
+ var hasOwn = {}.hasOwnProperty;
3061
3035
 
3062
- case 'up':
3063
- acc.y = acc.y - rest;
3064
- break;
3036
+ function classNames() {
3037
+ var classes = [];
3065
3038
 
3066
- case 'down':
3067
- acc.y = acc.y + rest;
3068
- break;
3039
+ for (var i = 0; i < arguments.length; i++) {
3040
+ var arg = arguments[i];
3041
+ if (!arg) continue;
3069
3042
 
3070
- case 'rotate':
3071
- acc.rotate = acc.rotate + rest;
3072
- break;
3073
- }
3043
+ var argType = typeof arg;
3074
3044
 
3075
- return acc;
3076
- }, transform);
3077
- };
3078
- var PowerTransforms = {
3079
- mixout: function mixout() {
3080
- return {
3081
- parse: {
3082
- transform: function transform(transformString) {
3083
- return parseTransformString(transformString);
3084
- }
3085
- }
3086
- };
3087
- },
3088
- hooks: function hooks() {
3089
- return {
3090
- parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3091
- var transformString = node.getAttribute('data-fa-transform');
3045
+ if (argType === 'string' || argType === 'number') {
3046
+ classes.push(arg);
3047
+ } else if (Array.isArray(arg)) {
3048
+ if (arg.length) {
3049
+ var inner = classNames.apply(null, arg);
3050
+ if (inner) {
3051
+ classes.push(inner);
3052
+ }
3053
+ }
3054
+ } else if (argType === 'object') {
3055
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
3056
+ classes.push(arg.toString());
3057
+ continue;
3058
+ }
3092
3059
 
3093
- if (transformString) {
3094
- accumulator.transform = parseTransformString(transformString);
3095
- }
3060
+ for (var key in arg) {
3061
+ if (hasOwn.call(arg, key) && arg[key]) {
3062
+ classes.push(key);
3063
+ }
3064
+ }
3065
+ }
3066
+ }
3096
3067
 
3097
- return accumulator;
3098
- }
3099
- };
3100
- },
3101
- provides: function provides(providers) {
3102
- providers.generateAbstractTransformGrouping = function (_ref) {
3103
- var main = _ref.main,
3104
- transform = _ref.transform,
3105
- containerWidth = _ref.containerWidth,
3106
- iconWidth = _ref.iconWidth;
3107
- var outer = {
3108
- transform: "translate(".concat(containerWidth / 2, " 256)")
3109
- };
3110
- var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
3111
- var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
3112
- var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
3113
- var inner = {
3114
- transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
3115
- };
3116
- var path = {
3117
- transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
3118
- };
3119
- var operations = {
3120
- outer: outer,
3121
- inner: inner,
3122
- path: path
3123
- };
3124
- return {
3125
- tag: 'g',
3126
- attributes: _objectSpread2$1({}, operations.outer),
3127
- children: [{
3128
- tag: 'g',
3129
- attributes: _objectSpread2$1({}, operations.inner),
3130
- children: [{
3131
- tag: main.icon.tag,
3132
- children: main.icon.children,
3133
- attributes: _objectSpread2$1(_objectSpread2$1({}, main.icon.attributes), operations.path)
3134
- }]
3135
- }]
3136
- };
3137
- };
3138
- }
3139
- };
3068
+ return classes.join(' ');
3069
+ }
3070
+
3071
+ if (module.exports) {
3072
+ classNames.default = classNames;
3073
+ module.exports = classNames;
3074
+ } else {
3075
+ window.classNames = classNames;
3076
+ }
3077
+ }());
3078
+ } (classnames));
3079
+
3080
+ var classnamesExports = classnames.exports;
3081
+ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
3082
+
3083
+ function styleInject(css, ref) {
3084
+ if ( ref === void 0 ) ref = {};
3085
+ var insertAt = ref.insertAt;
3140
3086
 
3141
- var ALL_SPACE = {
3142
- x: 0,
3143
- y: 0,
3144
- width: '100%',
3145
- height: '100%'
3146
- };
3087
+ if (!css || typeof document === 'undefined') { return; }
3147
3088
 
3148
- function fillBlack(_abstract) {
3149
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
3089
+ var head = document.head || document.getElementsByTagName('head')[0];
3090
+ var style = document.createElement('style');
3091
+ style.type = 'text/css';
3150
3092
 
3151
- if (_abstract.attributes && (_abstract.attributes.fill || force)) {
3152
- _abstract.attributes.fill = 'black';
3093
+ if (insertAt === 'top') {
3094
+ if (head.firstChild) {
3095
+ head.insertBefore(style, head.firstChild);
3096
+ } else {
3097
+ head.appendChild(style);
3098
+ }
3099
+ } else {
3100
+ head.appendChild(style);
3153
3101
  }
3154
3102
 
3155
- return _abstract;
3156
- }
3157
-
3158
- function deGroup(_abstract2) {
3159
- if (_abstract2.tag === 'g') {
3160
- return _abstract2.children;
3103
+ if (style.styleSheet) {
3104
+ style.styleSheet.cssText = css;
3161
3105
  } else {
3162
- return [_abstract2];
3106
+ style.appendChild(document.createTextNode(css));
3163
3107
  }
3164
3108
  }
3165
3109
 
3166
- var Masks = {
3167
- hooks: function hooks() {
3168
- return {
3169
- parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3170
- var maskData = node.getAttribute('data-fa-mask');
3171
- var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
3172
- return i.trim();
3173
- }));
3110
+ var css_248z$9 = ".storybook-button {\r\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\r\n font-weight: 700;\r\n border: 0;\r\n border-radius: 3em;\r\n cursor: pointer;\r\n display: inline-block;\r\n line-height: 1;\r\n}\r\n.storybook-button--primary {\r\n color: white;\r\n background-color: #1ea7fd;\r\n}\r\n.storybook-button--secondary {\r\n color: #333;\r\n background-color: transparent;\r\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\r\n}\r\n.storybook-button--small {\r\n font-size: 12px;\r\n padding: 10px 16px;\r\n}\r\n.storybook-button--medium {\r\n font-size: 14px;\r\n padding: 11px 20px;\r\n}\r\n.storybook-button--large {\r\n font-size: 16px;\r\n padding: 12px 24px;\r\n}";
3111
+ styleInject(css_248z$9);
3174
3112
 
3175
- if (!mask.prefix) {
3176
- mask.prefix = getDefaultUsablePrefix();
3177
- }
3113
+ /**
3114
+ * Primary UI component for user interaction
3115
+ */
3116
+ var Button$1 = function (_a) {
3117
+ var _b = _a.type, type = _b === void 0 ? "primary" : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? "medium" : _c, onClick = _a.onClick, label = _a.label;
3118
+ var _d = React__default.useState(4), theState = _d[0]; _d[1];
3119
+ return (React__default.createElement("button", { type: "button", className: classNames("storybook-button", "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick }, "".concat(label, " ").concat(theState)));
3120
+ };
3178
3121
 
3179
- accumulator.mask = mask;
3180
- accumulator.maskId = node.getAttribute('data-fa-mask-id');
3181
- return accumulator;
3182
- }
3183
- };
3184
- },
3185
- provides: function provides(providers) {
3186
- providers.generateAbstractMask = function (_ref) {
3187
- var children = _ref.children,
3188
- attributes = _ref.attributes,
3189
- main = _ref.main,
3190
- mask = _ref.mask,
3191
- explicitMaskId = _ref.maskId,
3192
- transform = _ref.transform;
3193
- var mainWidth = main.width,
3194
- mainPath = main.icon;
3195
- var maskWidth = mask.width,
3196
- maskPath = mask.icon;
3197
- var trans = transformForSvg({
3198
- transform: transform,
3199
- containerWidth: maskWidth,
3200
- iconWidth: mainWidth
3201
- });
3202
- var maskRect = {
3203
- tag: 'rect',
3204
- attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
3205
- fill: 'white'
3206
- })
3207
- };
3208
- var maskInnerGroupChildrenMixin = mainPath.children ? {
3209
- children: mainPath.children.map(fillBlack)
3210
- } : {};
3211
- var maskInnerGroup = {
3212
- tag: 'g',
3213
- attributes: _objectSpread2$1({}, trans.inner),
3214
- children: [fillBlack(_objectSpread2$1({
3215
- tag: mainPath.tag,
3216
- attributes: _objectSpread2$1(_objectSpread2$1({}, mainPath.attributes), trans.path)
3217
- }, maskInnerGroupChildrenMixin))]
3218
- };
3219
- var maskOuterGroup = {
3220
- tag: 'g',
3221
- attributes: _objectSpread2$1({}, trans.outer),
3222
- children: [maskInnerGroup]
3223
- };
3224
- var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
3225
- var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
3226
- var maskTag = {
3227
- tag: 'mask',
3228
- attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
3229
- id: maskId,
3230
- maskUnits: 'userSpaceOnUse',
3231
- maskContentUnits: 'userSpaceOnUse'
3232
- }),
3233
- children: [maskRect, maskOuterGroup]
3234
- };
3235
- var defs = {
3236
- tag: 'defs',
3237
- children: [{
3238
- tag: 'clipPath',
3239
- attributes: {
3240
- id: clipId
3241
- },
3242
- children: deGroup(maskPath)
3243
- }, maskTag]
3244
- };
3245
- children.push(defs, {
3246
- tag: 'rect',
3247
- attributes: _objectSpread2$1({
3248
- fill: 'currentColor',
3249
- 'clip-path': "url(#".concat(clipId, ")"),
3250
- mask: "url(#".concat(maskId, ")")
3251
- }, ALL_SPACE)
3252
- });
3253
- return {
3254
- children: children,
3255
- attributes: attributes
3256
- };
3122
+ function warn() {
3123
+ if (console && console.warn) {
3124
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3125
+ args[_key] = arguments[_key];
3126
+ }
3127
+ if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
3128
+ console.warn(...args);
3129
+ }
3130
+ }
3131
+ const alreadyWarned = {};
3132
+ function warnOnce() {
3133
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3134
+ args[_key2] = arguments[_key2];
3135
+ }
3136
+ if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
3137
+ if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
3138
+ warn(...args);
3139
+ }
3140
+ const loadedClb = (i18n, cb) => () => {
3141
+ if (i18n.isInitialized) {
3142
+ cb();
3143
+ } else {
3144
+ const initialized = () => {
3145
+ setTimeout(() => {
3146
+ i18n.off('initialized', initialized);
3147
+ }, 0);
3148
+ cb();
3257
3149
  };
3150
+ i18n.on('initialized', initialized);
3258
3151
  }
3259
3152
  };
3260
-
3261
- var MissingIconIndicator = {
3262
- provides: function provides(providers) {
3263
- var reduceMotion = false;
3264
-
3265
- if (WINDOW.matchMedia) {
3266
- reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
3153
+ function loadNamespaces(i18n, ns, cb) {
3154
+ i18n.loadNamespaces(ns, loadedClb(i18n, cb));
3155
+ }
3156
+ function loadLanguages(i18n, lng, ns, cb) {
3157
+ if (typeof ns === 'string') ns = [ns];
3158
+ ns.forEach(n => {
3159
+ if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
3160
+ });
3161
+ i18n.loadLanguages(lng, loadedClb(i18n, cb));
3162
+ }
3163
+ function oldI18nextHasLoadedNamespace(ns, i18n) {
3164
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3165
+ const lng = i18n.languages[0];
3166
+ const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
3167
+ const lastLng = i18n.languages[i18n.languages.length - 1];
3168
+ if (lng.toLowerCase() === 'cimode') return true;
3169
+ const loadNotPending = (l, n) => {
3170
+ const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
3171
+ return loadState === -1 || loadState === 2;
3172
+ };
3173
+ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
3174
+ if (i18n.hasResourceBundle(lng, ns)) return true;
3175
+ if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
3176
+ if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
3177
+ return false;
3178
+ }
3179
+ function hasLoadedNamespace(ns, i18n) {
3180
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3181
+ if (!i18n.languages || !i18n.languages.length) {
3182
+ warnOnce('i18n.languages were undefined or empty', i18n.languages);
3183
+ return true;
3184
+ }
3185
+ const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
3186
+ if (!isNewerI18next) {
3187
+ return oldI18nextHasLoadedNamespace(ns, i18n, options);
3188
+ }
3189
+ return i18n.hasLoadedNamespace(ns, {
3190
+ lng: options.lng,
3191
+ precheck: (i18nInstance, loadNotPending) => {
3192
+ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
3267
3193
  }
3194
+ });
3195
+ }
3268
3196
 
3269
- providers.missingIconAbstract = function () {
3270
- var gChildren = [];
3271
- var FILL = {
3272
- fill: 'currentColor'
3273
- };
3274
- var ANIMATION_BASE = {
3275
- attributeType: 'XML',
3276
- repeatCount: 'indefinite',
3277
- dur: '2s'
3278
- }; // Ring
3279
-
3280
- gChildren.push({
3281
- tag: 'path',
3282
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3283
- d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
3284
- })
3285
- });
3286
-
3287
- var OPACITY_ANIMATE = _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
3288
- attributeName: 'opacity'
3289
- });
3197
+ const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
3198
+ const htmlEntities = {
3199
+ '&amp;': '&',
3200
+ '&#38;': '&',
3201
+ '&lt;': '<',
3202
+ '&#60;': '<',
3203
+ '&gt;': '>',
3204
+ '&#62;': '>',
3205
+ '&apos;': "'",
3206
+ '&#39;': "'",
3207
+ '&quot;': '"',
3208
+ '&#34;': '"',
3209
+ '&nbsp;': ' ',
3210
+ '&#160;': ' ',
3211
+ '&copy;': '©',
3212
+ '&#169;': '©',
3213
+ '&reg;': '®',
3214
+ '&#174;': '®',
3215
+ '&hellip;': '…',
3216
+ '&#8230;': '',
3217
+ '&#x2F;': '/',
3218
+ '&#47;': '/'
3219
+ };
3220
+ const unescapeHtmlEntity = m => htmlEntities[m];
3221
+ const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);
3290
3222
 
3291
- var dot = {
3292
- tag: 'circle',
3293
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3294
- cx: '256',
3295
- cy: '364',
3296
- r: '28'
3297
- }),
3298
- children: []
3299
- };
3223
+ let defaultOptions$1 = {
3224
+ bindI18n: 'languageChanged',
3225
+ bindI18nStore: '',
3226
+ transEmptyNodeValue: '',
3227
+ transSupportBasicHtmlNodes: true,
3228
+ transWrapTextNodes: '',
3229
+ transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
3230
+ useSuspense: true,
3231
+ unescape
3232
+ };
3233
+ function setDefaults() {
3234
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3235
+ defaultOptions$1 = {
3236
+ ...defaultOptions$1,
3237
+ ...options
3238
+ };
3239
+ }
3240
+ function getDefaults() {
3241
+ return defaultOptions$1;
3242
+ }
3300
3243
 
3301
- if (!reduceMotion) {
3302
- dot.children.push({
3303
- tag: 'animate',
3304
- attributes: _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
3305
- attributeName: 'r',
3306
- values: '28;14;28;28;14;28;'
3307
- })
3308
- }, {
3309
- tag: 'animate',
3310
- attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
3311
- values: '1;0;1;1;0;1;'
3312
- })
3313
- });
3314
- }
3244
+ let i18nInstance;
3245
+ function setI18n(instance) {
3246
+ i18nInstance = instance;
3247
+ }
3248
+ function getI18n() {
3249
+ return i18nInstance;
3250
+ }
3315
3251
 
3316
- gChildren.push(dot);
3317
- gChildren.push({
3318
- tag: 'path',
3319
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3320
- opacity: '1',
3321
- d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
3322
- }),
3323
- children: reduceMotion ? [] : [{
3324
- tag: 'animate',
3325
- attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
3326
- values: '1;0;0;0;0;1;'
3327
- })
3328
- }]
3329
- });
3252
+ const initReactI18next = {
3253
+ type: '3rdParty',
3254
+ init(instance) {
3255
+ setDefaults(instance.options.react);
3256
+ setI18n(instance);
3257
+ }
3258
+ };
3330
3259
 
3331
- if (!reduceMotion) {
3332
- // Exclamation
3333
- gChildren.push({
3334
- tag: 'path',
3335
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3336
- opacity: '0',
3337
- d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
3338
- }),
3339
- children: [{
3340
- tag: 'animate',
3341
- attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
3342
- values: '0;0;1;1;0;0;'
3343
- })
3344
- }]
3345
- });
3346
- }
3260
+ const I18nContext = React__default.createContext();
3261
+ class ReportNamespaces {
3262
+ constructor() {
3263
+ this.usedNamespaces = {};
3264
+ }
3265
+ addUsedNamespaces(namespaces) {
3266
+ namespaces.forEach(ns => {
3267
+ if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
3268
+ });
3269
+ }
3270
+ getUsedNamespaces() {
3271
+ return Object.keys(this.usedNamespaces);
3272
+ }
3273
+ }
3347
3274
 
3348
- return {
3349
- tag: 'g',
3350
- attributes: {
3351
- 'class': 'missing'
3352
- },
3353
- children: gChildren
3354
- };
3275
+ const usePrevious = (value, ignore) => {
3276
+ const ref = React__default.useRef();
3277
+ React__default.useEffect(() => {
3278
+ ref.current = ignore ? ref.current : value;
3279
+ }, [value, ignore]);
3280
+ return ref.current;
3281
+ };
3282
+ function useTranslation(ns) {
3283
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3284
+ const {
3285
+ i18n: i18nFromProps
3286
+ } = props;
3287
+ const {
3288
+ i18n: i18nFromContext,
3289
+ defaultNS: defaultNSFromContext
3290
+ } = React__default.useContext(I18nContext) || {};
3291
+ const i18n = i18nFromProps || i18nFromContext || getI18n();
3292
+ if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
3293
+ if (!i18n) {
3294
+ warnOnce('You will need to pass in an i18next instance by using initReactI18next');
3295
+ const notReadyT = (k, optsOrDefaultValue) => {
3296
+ if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
3297
+ if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
3298
+ return Array.isArray(k) ? k[k.length - 1] : k;
3355
3299
  };
3300
+ const retNotReady = [notReadyT, {}, false];
3301
+ retNotReady.t = notReadyT;
3302
+ retNotReady.i18n = {};
3303
+ retNotReady.ready = false;
3304
+ return retNotReady;
3356
3305
  }
3357
- };
3358
-
3359
- var SvgSymbols = {
3360
- hooks: function hooks() {
3361
- return {
3362
- parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3363
- var symbolData = node.getAttribute('data-fa-symbol');
3364
- var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
3365
- accumulator['symbol'] = symbol;
3366
- return accumulator;
3306
+ if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
3307
+ const i18nOptions = {
3308
+ ...getDefaults(),
3309
+ ...i18n.options.react,
3310
+ ...props
3311
+ };
3312
+ const {
3313
+ useSuspense,
3314
+ keyPrefix
3315
+ } = i18nOptions;
3316
+ let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
3317
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
3318
+ if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
3319
+ const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
3320
+ function getT() {
3321
+ return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
3322
+ }
3323
+ const [t, setT] = React__default.useState(getT);
3324
+ let joinedNS = namespaces.join();
3325
+ if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
3326
+ const previousJoinedNS = usePrevious(joinedNS);
3327
+ const isMounted = React__default.useRef(true);
3328
+ React__default.useEffect(() => {
3329
+ const {
3330
+ bindI18n,
3331
+ bindI18nStore
3332
+ } = i18nOptions;
3333
+ isMounted.current = true;
3334
+ if (!ready && !useSuspense) {
3335
+ if (props.lng) {
3336
+ loadLanguages(i18n, props.lng, namespaces, () => {
3337
+ if (isMounted.current) setT(getT);
3338
+ });
3339
+ } else {
3340
+ loadNamespaces(i18n, namespaces, () => {
3341
+ if (isMounted.current) setT(getT);
3342
+ });
3367
3343
  }
3344
+ }
3345
+ if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
3346
+ setT(getT);
3347
+ }
3348
+ function boundReset() {
3349
+ if (isMounted.current) setT(getT);
3350
+ }
3351
+ if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
3352
+ if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
3353
+ return () => {
3354
+ isMounted.current = false;
3355
+ if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
3356
+ if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
3368
3357
  };
3369
- }
3370
- };
3358
+ }, [i18n, joinedNS]);
3359
+ const isInitial = React__default.useRef(true);
3360
+ React__default.useEffect(() => {
3361
+ if (isMounted.current && !isInitial.current) {
3362
+ setT(getT);
3363
+ }
3364
+ isInitial.current = false;
3365
+ }, [i18n, keyPrefix]);
3366
+ const ret = [t, i18n, ready];
3367
+ ret.t = t;
3368
+ ret.i18n = i18n;
3369
+ ret.ready = ready;
3370
+ if (ready) return ret;
3371
+ if (!ready && !useSuspense) return ret;
3372
+ throw new Promise(resolve => {
3373
+ if (props.lng) {
3374
+ loadLanguages(i18n, props.lng, namespaces, () => resolve());
3375
+ } else {
3376
+ loadNamespaces(i18n, namespaces, () => resolve());
3377
+ }
3378
+ });
3379
+ }
3371
3380
 
3372
- var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];
3381
+ var css_248z$8 = ".will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n height: 35px;\n background-color: #384265;\n}";
3382
+ styleInject(css_248z$8);
3373
3383
 
3374
- registerPlugins(plugins, {
3375
- mixoutsTo: api
3376
- });
3377
- api.noAuto;
3378
- api.config;
3379
- api.library;
3380
- api.dom;
3381
- var parse$1 = api.parse;
3382
- api.findIconDefinition;
3383
- api.toHtml;
3384
- var icon = api.icon;
3385
- api.layer;
3386
- api.text;
3387
- api.counter;
3384
+ function Divider() {
3385
+ return React__default.createElement("div", { className: "will-filter-bar-divider" });
3386
+ }
3387
+
3388
+ var css_248z$7 = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 15px;\n text-align: initial;\n}\n";
3389
+ styleInject(css_248z$7);
3390
+
3391
+ function SelectButton(_a) {
3392
+ var label = _a.label, onClick = _a.onClick, style = _a.style;
3393
+ return (React__default.createElement("button", { className: "will-filter-bar-select-button", onClick: onClick, style: style }, label));
3394
+ }
3388
3395
 
3389
3396
  var propTypes = {exports: {}};
3390
3397
 
@@ -4992,13 +4999,6 @@ FontAwesomeIcon.defaultProps = {
4992
4999
  };
4993
5000
  var convertCurry = convert.bind(null, React__default.createElement);
4994
5001
 
4995
- var faMagnifyingGlass = {
4996
- prefix: 'fas',
4997
- iconName: 'magnifying-glass',
4998
- icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
4999
- };
5000
- var faSearch = faMagnifyingGlass;
5001
-
5002
5002
  var css_248z$6 = ".will-filter-bar-submit-button {\n width: auto;\n height: auto;\n background-color: var(--will-primary);\n color: var(--will-white);\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n text-transform: uppercase;\n font-size: 12px;\n display: flex;\n align-items: center;\n}\n\n.will-filter-bar-submit-button span {\n margin-right: 10px;\n}";
5003
5003
  styleInject(css_248z$6);
5004
5004
 
@@ -13074,6 +13074,8 @@ var fontWigthBold = function (input) {
13074
13074
  return { fontWeight: input ? 'bold' : 'initial' };
13075
13075
  };
13076
13076
 
13077
+ library$1.add(faSearch);
13078
+
13077
13079
  exports.Button = Button$1;
13078
13080
  exports.FilterBar = FilterBar;
13079
13081
  //# sourceMappingURL=index.js.map