xianniu-ui 0.5.1 → 0.5.2-beta.0

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 (38) hide show
  1. package/lib/static/css/xianniu-ui.umd.5be6bd50.css +1 -0
  2. package/lib/static/css/xianniu-ui.umd.min.5be6bd50.css +1 -0
  3. package/lib/xianniu-ui.common.chunk-elementUI.js +69440 -0
  4. package/lib/xianniu-ui.common.chunk-libs~253ae210.js +3816 -0
  5. package/lib/xianniu-ui.common.chunk-libs~31ecd969.js +1267 -0
  6. package/lib/xianniu-ui.common.chunk-libs~6cb95173.js +1594 -0
  7. package/lib/xianniu-ui.common.chunk-libs~93acefaf.js +3328 -0
  8. package/lib/xianniu-ui.common.chunk-libs~af0f4b76.js +17212 -0
  9. package/lib/xianniu-ui.common.chunk-libs~b58f7129.js +1723 -0
  10. package/lib/xianniu-ui.common.chunk-libs~d939e436.js +2356 -0
  11. package/lib/xianniu-ui.common.chunk-libs~dfe5688e.js +4924 -0
  12. package/lib/xianniu-ui.common.js +55 -122634
  13. package/lib/xianniu-ui.common.xianniu-ui.common.js +17165 -0
  14. package/lib/xianniu-ui.umd.chunk-elementUI.js +69440 -0
  15. package/lib/xianniu-ui.umd.chunk-libs~253ae210.js +3816 -0
  16. package/lib/xianniu-ui.umd.chunk-libs~31ecd969.js +1267 -0
  17. package/lib/xianniu-ui.umd.chunk-libs~6cb95173.js +1594 -0
  18. package/lib/xianniu-ui.umd.chunk-libs~93acefaf.js +3328 -0
  19. package/lib/xianniu-ui.umd.chunk-libs~af0f4b76.js +17212 -0
  20. package/lib/xianniu-ui.umd.chunk-libs~b58f7129.js +1723 -0
  21. package/lib/xianniu-ui.umd.chunk-libs~d939e436.js +2356 -0
  22. package/lib/xianniu-ui.umd.chunk-libs~dfe5688e.js +4924 -0
  23. package/lib/xianniu-ui.umd.js +56 -122645
  24. package/lib/xianniu-ui.umd.min.chunk-elementUI.js +9 -0
  25. package/lib/xianniu-ui.umd.min.chunk-libs~253ae210.js +1 -0
  26. package/lib/xianniu-ui.umd.min.chunk-libs~31ecd969.js +1 -0
  27. package/lib/xianniu-ui.umd.min.chunk-libs~6cb95173.js +1 -0
  28. package/lib/xianniu-ui.umd.min.chunk-libs~93acefaf.js +1 -0
  29. package/lib/xianniu-ui.umd.min.chunk-libs~af0f4b76.js +9 -0
  30. package/lib/xianniu-ui.umd.min.chunk-libs~b58f7129.js +16 -0
  31. package/lib/xianniu-ui.umd.min.chunk-libs~d939e436.js +1 -0
  32. package/lib/xianniu-ui.umd.min.chunk-libs~dfe5688e.js +8 -0
  33. package/lib/xianniu-ui.umd.min.js +1 -39
  34. package/lib/xianniu-ui.umd.min.xianniu-ui.umd.min.js +1 -0
  35. package/lib/xianniu-ui.umd.xianniu-ui.umd.js +17175 -0
  36. package/package.json +1 -1
  37. package/packages/search/main.vue +1 -1
  38. /package/lib/{xianniu-ui.css → static/css/xianniu-ui.common.5be6bd50.css} +0 -0
@@ -0,0 +1,1267 @@
1
+ ((typeof self !== 'undefined' ? self : this)["webpackJsonpxianniu_ui"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpxianniu_ui"] || []).push([[2],{
2
+
3
+ /***/ "0e15":
4
+ /***/ (function(module, exports, __webpack_require__) {
5
+
6
+ /* eslint-disable no-undefined */
7
+
8
+ var throttle = __webpack_require__("597f");
9
+
10
+ /**
11
+ * Debounce execution of a function. Debouncing, unlike throttling,
12
+ * guarantees that a function is only executed a single time, either at the
13
+ * very beginning of a series of calls, or at the very end.
14
+ *
15
+ * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
16
+ * @param {Boolean} [atBegin] Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
17
+ * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
18
+ * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
19
+ * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
20
+ * to `callback` when the debounced-function is executed.
21
+ *
22
+ * @return {Function} A new, debounced function.
23
+ */
24
+ module.exports = function ( delay, atBegin, callback ) {
25
+ return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
26
+ };
27
+
28
+
29
+ /***/ }),
30
+
31
+ /***/ "3c35":
32
+ /***/ (function(module, exports) {
33
+
34
+ /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
35
+ module.exports = __webpack_amd_options__;
36
+
37
+ /* WEBPACK VAR INJECTION */}.call(this, {}))
38
+
39
+ /***/ }),
40
+
41
+ /***/ "3dd2":
42
+ /***/ (function(module, exports, __webpack_require__) {
43
+
44
+ !function(t,e){ true?module.exports=e():undefined}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w}));
45
+
46
+ /***/ }),
47
+
48
+ /***/ "597f":
49
+ /***/ (function(module, exports) {
50
+
51
+ /* eslint-disable no-undefined,no-param-reassign,no-shadow */
52
+
53
+ /**
54
+ * Throttle execution of a function. Especially useful for rate limiting
55
+ * execution of handlers on events like resize and scroll.
56
+ *
57
+ * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
58
+ * @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
59
+ * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
60
+ * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
61
+ * the internal counter is reset)
62
+ * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
63
+ * to `callback` when the throttled-function is executed.
64
+ * @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
65
+ * schedule `callback` to execute after `delay` ms.
66
+ *
67
+ * @return {Function} A new, throttled, function.
68
+ */
69
+ module.exports = function ( delay, noTrailing, callback, debounceMode ) {
70
+
71
+ // After wrapper has stopped being called, this timeout ensures that
72
+ // `callback` is executed at the proper times in `throttle` and `end`
73
+ // debounce modes.
74
+ var timeoutID;
75
+
76
+ // Keep track of the last time `callback` was executed.
77
+ var lastExec = 0;
78
+
79
+ // `noTrailing` defaults to falsy.
80
+ if ( typeof noTrailing !== 'boolean' ) {
81
+ debounceMode = callback;
82
+ callback = noTrailing;
83
+ noTrailing = undefined;
84
+ }
85
+
86
+ // The `wrapper` function encapsulates all of the throttling / debouncing
87
+ // functionality and when executed will limit the rate at which `callback`
88
+ // is executed.
89
+ function wrapper () {
90
+
91
+ var self = this;
92
+ var elapsed = Number(new Date()) - lastExec;
93
+ var args = arguments;
94
+
95
+ // Execute `callback` and update the `lastExec` timestamp.
96
+ function exec () {
97
+ lastExec = Number(new Date());
98
+ callback.apply(self, args);
99
+ }
100
+
101
+ // If `debounceMode` is true (at begin) this is used to clear the flag
102
+ // to allow future `callback` executions.
103
+ function clear () {
104
+ timeoutID = undefined;
105
+ }
106
+
107
+ if ( debounceMode && !timeoutID ) {
108
+ // Since `wrapper` is being called for the first time and
109
+ // `debounceMode` is true (at begin), execute `callback`.
110
+ exec();
111
+ }
112
+
113
+ // Clear any existing timeout.
114
+ if ( timeoutID ) {
115
+ clearTimeout(timeoutID);
116
+ }
117
+
118
+ if ( debounceMode === undefined && elapsed > delay ) {
119
+ // In throttle mode, if `delay` time has been exceeded, execute
120
+ // `callback`.
121
+ exec();
122
+
123
+ } else if ( noTrailing !== true ) {
124
+ // In trailing throttle mode, since `delay` time has not been
125
+ // exceeded, schedule `callback` to execute `delay` ms after most
126
+ // recent execution.
127
+ //
128
+ // If `debounceMode` is true (at begin), schedule `clear` to execute
129
+ // after `delay` ms.
130
+ //
131
+ // If `debounceMode` is false (at end), schedule `callback` to
132
+ // execute after `delay` ms.
133
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
134
+ }
135
+
136
+ }
137
+
138
+ // Return the wrapper function.
139
+ return wrapper;
140
+
141
+ };
142
+
143
+
144
+ /***/ }),
145
+
146
+ /***/ "62e4":
147
+ /***/ (function(module, exports) {
148
+
149
+ module.exports = function(module) {
150
+ if (!module.webpackPolyfill) {
151
+ module.deprecate = function() {};
152
+ module.paths = [];
153
+ // module.parent = undefined by default
154
+ if (!module.children) module.children = [];
155
+ Object.defineProperty(module, "loaded", {
156
+ enumerable: true,
157
+ get: function() {
158
+ return module.l;
159
+ }
160
+ });
161
+ Object.defineProperty(module, "id", {
162
+ enumerable: true,
163
+ get: function() {
164
+ return module.i;
165
+ }
166
+ });
167
+ module.webpackPolyfill = 1;
168
+ }
169
+ return module;
170
+ };
171
+
172
+
173
+ /***/ }),
174
+
175
+ /***/ "6dd8":
176
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
177
+
178
+ "use strict";
179
+ __webpack_require__.r(__webpack_exports__);
180
+ /* WEBPACK VAR INJECTION */(function(global) {/**
181
+ * A collection of shims that provide minimal functionality of the ES6 collections.
182
+ *
183
+ * These implementations are not meant to be used outside of the ResizeObserver
184
+ * modules as they cover only a limited range of use cases.
185
+ */
186
+ /* eslint-disable require-jsdoc, valid-jsdoc */
187
+ var MapShim = (function () {
188
+ if (typeof Map !== 'undefined') {
189
+ return Map;
190
+ }
191
+ /**
192
+ * Returns index in provided array that matches the specified key.
193
+ *
194
+ * @param {Array<Array>} arr
195
+ * @param {*} key
196
+ * @returns {number}
197
+ */
198
+ function getIndex(arr, key) {
199
+ var result = -1;
200
+ arr.some(function (entry, index) {
201
+ if (entry[0] === key) {
202
+ result = index;
203
+ return true;
204
+ }
205
+ return false;
206
+ });
207
+ return result;
208
+ }
209
+ return /** @class */ (function () {
210
+ function class_1() {
211
+ this.__entries__ = [];
212
+ }
213
+ Object.defineProperty(class_1.prototype, "size", {
214
+ /**
215
+ * @returns {boolean}
216
+ */
217
+ get: function () {
218
+ return this.__entries__.length;
219
+ },
220
+ enumerable: true,
221
+ configurable: true
222
+ });
223
+ /**
224
+ * @param {*} key
225
+ * @returns {*}
226
+ */
227
+ class_1.prototype.get = function (key) {
228
+ var index = getIndex(this.__entries__, key);
229
+ var entry = this.__entries__[index];
230
+ return entry && entry[1];
231
+ };
232
+ /**
233
+ * @param {*} key
234
+ * @param {*} value
235
+ * @returns {void}
236
+ */
237
+ class_1.prototype.set = function (key, value) {
238
+ var index = getIndex(this.__entries__, key);
239
+ if (~index) {
240
+ this.__entries__[index][1] = value;
241
+ }
242
+ else {
243
+ this.__entries__.push([key, value]);
244
+ }
245
+ };
246
+ /**
247
+ * @param {*} key
248
+ * @returns {void}
249
+ */
250
+ class_1.prototype.delete = function (key) {
251
+ var entries = this.__entries__;
252
+ var index = getIndex(entries, key);
253
+ if (~index) {
254
+ entries.splice(index, 1);
255
+ }
256
+ };
257
+ /**
258
+ * @param {*} key
259
+ * @returns {void}
260
+ */
261
+ class_1.prototype.has = function (key) {
262
+ return !!~getIndex(this.__entries__, key);
263
+ };
264
+ /**
265
+ * @returns {void}
266
+ */
267
+ class_1.prototype.clear = function () {
268
+ this.__entries__.splice(0);
269
+ };
270
+ /**
271
+ * @param {Function} callback
272
+ * @param {*} [ctx=null]
273
+ * @returns {void}
274
+ */
275
+ class_1.prototype.forEach = function (callback, ctx) {
276
+ if (ctx === void 0) { ctx = null; }
277
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
278
+ var entry = _a[_i];
279
+ callback.call(ctx, entry[1], entry[0]);
280
+ }
281
+ };
282
+ return class_1;
283
+ }());
284
+ })();
285
+
286
+ /**
287
+ * Detects whether window and document objects are available in current environment.
288
+ */
289
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
290
+
291
+ // Returns global object of a current environment.
292
+ var global$1 = (function () {
293
+ if (typeof global !== 'undefined' && global.Math === Math) {
294
+ return global;
295
+ }
296
+ if (typeof self !== 'undefined' && self.Math === Math) {
297
+ return self;
298
+ }
299
+ if (typeof window !== 'undefined' && window.Math === Math) {
300
+ return window;
301
+ }
302
+ // eslint-disable-next-line no-new-func
303
+ return Function('return this')();
304
+ })();
305
+
306
+ /**
307
+ * A shim for the requestAnimationFrame which falls back to the setTimeout if
308
+ * first one is not supported.
309
+ *
310
+ * @returns {number} Requests' identifier.
311
+ */
312
+ var requestAnimationFrame$1 = (function () {
313
+ if (typeof requestAnimationFrame === 'function') {
314
+ // It's required to use a bounded function because IE sometimes throws
315
+ // an "Invalid calling object" error if rAF is invoked without the global
316
+ // object on the left hand side.
317
+ return requestAnimationFrame.bind(global$1);
318
+ }
319
+ return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
320
+ })();
321
+
322
+ // Defines minimum timeout before adding a trailing call.
323
+ var trailingTimeout = 2;
324
+ /**
325
+ * Creates a wrapper function which ensures that provided callback will be
326
+ * invoked only once during the specified delay period.
327
+ *
328
+ * @param {Function} callback - Function to be invoked after the delay period.
329
+ * @param {number} delay - Delay after which to invoke callback.
330
+ * @returns {Function}
331
+ */
332
+ function throttle (callback, delay) {
333
+ var leadingCall = false, trailingCall = false, lastCallTime = 0;
334
+ /**
335
+ * Invokes the original callback function and schedules new invocation if
336
+ * the "proxy" was called during current request.
337
+ *
338
+ * @returns {void}
339
+ */
340
+ function resolvePending() {
341
+ if (leadingCall) {
342
+ leadingCall = false;
343
+ callback();
344
+ }
345
+ if (trailingCall) {
346
+ proxy();
347
+ }
348
+ }
349
+ /**
350
+ * Callback invoked after the specified delay. It will further postpone
351
+ * invocation of the original function delegating it to the
352
+ * requestAnimationFrame.
353
+ *
354
+ * @returns {void}
355
+ */
356
+ function timeoutCallback() {
357
+ requestAnimationFrame$1(resolvePending);
358
+ }
359
+ /**
360
+ * Schedules invocation of the original function.
361
+ *
362
+ * @returns {void}
363
+ */
364
+ function proxy() {
365
+ var timeStamp = Date.now();
366
+ if (leadingCall) {
367
+ // Reject immediately following calls.
368
+ if (timeStamp - lastCallTime < trailingTimeout) {
369
+ return;
370
+ }
371
+ // Schedule new call to be in invoked when the pending one is resolved.
372
+ // This is important for "transitions" which never actually start
373
+ // immediately so there is a chance that we might miss one if change
374
+ // happens amids the pending invocation.
375
+ trailingCall = true;
376
+ }
377
+ else {
378
+ leadingCall = true;
379
+ trailingCall = false;
380
+ setTimeout(timeoutCallback, delay);
381
+ }
382
+ lastCallTime = timeStamp;
383
+ }
384
+ return proxy;
385
+ }
386
+
387
+ // Minimum delay before invoking the update of observers.
388
+ var REFRESH_DELAY = 20;
389
+ // A list of substrings of CSS properties used to find transition events that
390
+ // might affect dimensions of observed elements.
391
+ var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
392
+ // Check if MutationObserver is available.
393
+ var mutationObserverSupported = typeof MutationObserver !== 'undefined';
394
+ /**
395
+ * Singleton controller class which handles updates of ResizeObserver instances.
396
+ */
397
+ var ResizeObserverController = /** @class */ (function () {
398
+ /**
399
+ * Creates a new instance of ResizeObserverController.
400
+ *
401
+ * @private
402
+ */
403
+ function ResizeObserverController() {
404
+ /**
405
+ * Indicates whether DOM listeners have been added.
406
+ *
407
+ * @private {boolean}
408
+ */
409
+ this.connected_ = false;
410
+ /**
411
+ * Tells that controller has subscribed for Mutation Events.
412
+ *
413
+ * @private {boolean}
414
+ */
415
+ this.mutationEventsAdded_ = false;
416
+ /**
417
+ * Keeps reference to the instance of MutationObserver.
418
+ *
419
+ * @private {MutationObserver}
420
+ */
421
+ this.mutationsObserver_ = null;
422
+ /**
423
+ * A list of connected observers.
424
+ *
425
+ * @private {Array<ResizeObserverSPI>}
426
+ */
427
+ this.observers_ = [];
428
+ this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
429
+ this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
430
+ }
431
+ /**
432
+ * Adds observer to observers list.
433
+ *
434
+ * @param {ResizeObserverSPI} observer - Observer to be added.
435
+ * @returns {void}
436
+ */
437
+ ResizeObserverController.prototype.addObserver = function (observer) {
438
+ if (!~this.observers_.indexOf(observer)) {
439
+ this.observers_.push(observer);
440
+ }
441
+ // Add listeners if they haven't been added yet.
442
+ if (!this.connected_) {
443
+ this.connect_();
444
+ }
445
+ };
446
+ /**
447
+ * Removes observer from observers list.
448
+ *
449
+ * @param {ResizeObserverSPI} observer - Observer to be removed.
450
+ * @returns {void}
451
+ */
452
+ ResizeObserverController.prototype.removeObserver = function (observer) {
453
+ var observers = this.observers_;
454
+ var index = observers.indexOf(observer);
455
+ // Remove observer if it's present in registry.
456
+ if (~index) {
457
+ observers.splice(index, 1);
458
+ }
459
+ // Remove listeners if controller has no connected observers.
460
+ if (!observers.length && this.connected_) {
461
+ this.disconnect_();
462
+ }
463
+ };
464
+ /**
465
+ * Invokes the update of observers. It will continue running updates insofar
466
+ * it detects changes.
467
+ *
468
+ * @returns {void}
469
+ */
470
+ ResizeObserverController.prototype.refresh = function () {
471
+ var changesDetected = this.updateObservers_();
472
+ // Continue running updates if changes have been detected as there might
473
+ // be future ones caused by CSS transitions.
474
+ if (changesDetected) {
475
+ this.refresh();
476
+ }
477
+ };
478
+ /**
479
+ * Updates every observer from observers list and notifies them of queued
480
+ * entries.
481
+ *
482
+ * @private
483
+ * @returns {boolean} Returns "true" if any observer has detected changes in
484
+ * dimensions of it's elements.
485
+ */
486
+ ResizeObserverController.prototype.updateObservers_ = function () {
487
+ // Collect observers that have active observations.
488
+ var activeObservers = this.observers_.filter(function (observer) {
489
+ return observer.gatherActive(), observer.hasActive();
490
+ });
491
+ // Deliver notifications in a separate cycle in order to avoid any
492
+ // collisions between observers, e.g. when multiple instances of
493
+ // ResizeObserver are tracking the same element and the callback of one
494
+ // of them changes content dimensions of the observed target. Sometimes
495
+ // this may result in notifications being blocked for the rest of observers.
496
+ activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
497
+ return activeObservers.length > 0;
498
+ };
499
+ /**
500
+ * Initializes DOM listeners.
501
+ *
502
+ * @private
503
+ * @returns {void}
504
+ */
505
+ ResizeObserverController.prototype.connect_ = function () {
506
+ // Do nothing if running in a non-browser environment or if listeners
507
+ // have been already added.
508
+ if (!isBrowser || this.connected_) {
509
+ return;
510
+ }
511
+ // Subscription to the "Transitionend" event is used as a workaround for
512
+ // delayed transitions. This way it's possible to capture at least the
513
+ // final state of an element.
514
+ document.addEventListener('transitionend', this.onTransitionEnd_);
515
+ window.addEventListener('resize', this.refresh);
516
+ if (mutationObserverSupported) {
517
+ this.mutationsObserver_ = new MutationObserver(this.refresh);
518
+ this.mutationsObserver_.observe(document, {
519
+ attributes: true,
520
+ childList: true,
521
+ characterData: true,
522
+ subtree: true
523
+ });
524
+ }
525
+ else {
526
+ document.addEventListener('DOMSubtreeModified', this.refresh);
527
+ this.mutationEventsAdded_ = true;
528
+ }
529
+ this.connected_ = true;
530
+ };
531
+ /**
532
+ * Removes DOM listeners.
533
+ *
534
+ * @private
535
+ * @returns {void}
536
+ */
537
+ ResizeObserverController.prototype.disconnect_ = function () {
538
+ // Do nothing if running in a non-browser environment or if listeners
539
+ // have been already removed.
540
+ if (!isBrowser || !this.connected_) {
541
+ return;
542
+ }
543
+ document.removeEventListener('transitionend', this.onTransitionEnd_);
544
+ window.removeEventListener('resize', this.refresh);
545
+ if (this.mutationsObserver_) {
546
+ this.mutationsObserver_.disconnect();
547
+ }
548
+ if (this.mutationEventsAdded_) {
549
+ document.removeEventListener('DOMSubtreeModified', this.refresh);
550
+ }
551
+ this.mutationsObserver_ = null;
552
+ this.mutationEventsAdded_ = false;
553
+ this.connected_ = false;
554
+ };
555
+ /**
556
+ * "Transitionend" event handler.
557
+ *
558
+ * @private
559
+ * @param {TransitionEvent} event
560
+ * @returns {void}
561
+ */
562
+ ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
563
+ var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
564
+ // Detect whether transition may affect dimensions of an element.
565
+ var isReflowProperty = transitionKeys.some(function (key) {
566
+ return !!~propertyName.indexOf(key);
567
+ });
568
+ if (isReflowProperty) {
569
+ this.refresh();
570
+ }
571
+ };
572
+ /**
573
+ * Returns instance of the ResizeObserverController.
574
+ *
575
+ * @returns {ResizeObserverController}
576
+ */
577
+ ResizeObserverController.getInstance = function () {
578
+ if (!this.instance_) {
579
+ this.instance_ = new ResizeObserverController();
580
+ }
581
+ return this.instance_;
582
+ };
583
+ /**
584
+ * Holds reference to the controller's instance.
585
+ *
586
+ * @private {ResizeObserverController}
587
+ */
588
+ ResizeObserverController.instance_ = null;
589
+ return ResizeObserverController;
590
+ }());
591
+
592
+ /**
593
+ * Defines non-writable/enumerable properties of the provided target object.
594
+ *
595
+ * @param {Object} target - Object for which to define properties.
596
+ * @param {Object} props - Properties to be defined.
597
+ * @returns {Object} Target object.
598
+ */
599
+ var defineConfigurable = (function (target, props) {
600
+ for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
601
+ var key = _a[_i];
602
+ Object.defineProperty(target, key, {
603
+ value: props[key],
604
+ enumerable: false,
605
+ writable: false,
606
+ configurable: true
607
+ });
608
+ }
609
+ return target;
610
+ });
611
+
612
+ /**
613
+ * Returns the global object associated with provided element.
614
+ *
615
+ * @param {Object} target
616
+ * @returns {Object}
617
+ */
618
+ var getWindowOf = (function (target) {
619
+ // Assume that the element is an instance of Node, which means that it
620
+ // has the "ownerDocument" property from which we can retrieve a
621
+ // corresponding global object.
622
+ var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
623
+ // Return the local global object if it's not possible extract one from
624
+ // provided element.
625
+ return ownerGlobal || global$1;
626
+ });
627
+
628
+ // Placeholder of an empty content rectangle.
629
+ var emptyRect = createRectInit(0, 0, 0, 0);
630
+ /**
631
+ * Converts provided string to a number.
632
+ *
633
+ * @param {number|string} value
634
+ * @returns {number}
635
+ */
636
+ function toFloat(value) {
637
+ return parseFloat(value) || 0;
638
+ }
639
+ /**
640
+ * Extracts borders size from provided styles.
641
+ *
642
+ * @param {CSSStyleDeclaration} styles
643
+ * @param {...string} positions - Borders positions (top, right, ...)
644
+ * @returns {number}
645
+ */
646
+ function getBordersSize(styles) {
647
+ var positions = [];
648
+ for (var _i = 1; _i < arguments.length; _i++) {
649
+ positions[_i - 1] = arguments[_i];
650
+ }
651
+ return positions.reduce(function (size, position) {
652
+ var value = styles['border-' + position + '-width'];
653
+ return size + toFloat(value);
654
+ }, 0);
655
+ }
656
+ /**
657
+ * Extracts paddings sizes from provided styles.
658
+ *
659
+ * @param {CSSStyleDeclaration} styles
660
+ * @returns {Object} Paddings box.
661
+ */
662
+ function getPaddings(styles) {
663
+ var positions = ['top', 'right', 'bottom', 'left'];
664
+ var paddings = {};
665
+ for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
666
+ var position = positions_1[_i];
667
+ var value = styles['padding-' + position];
668
+ paddings[position] = toFloat(value);
669
+ }
670
+ return paddings;
671
+ }
672
+ /**
673
+ * Calculates content rectangle of provided SVG element.
674
+ *
675
+ * @param {SVGGraphicsElement} target - Element content rectangle of which needs
676
+ * to be calculated.
677
+ * @returns {DOMRectInit}
678
+ */
679
+ function getSVGContentRect(target) {
680
+ var bbox = target.getBBox();
681
+ return createRectInit(0, 0, bbox.width, bbox.height);
682
+ }
683
+ /**
684
+ * Calculates content rectangle of provided HTMLElement.
685
+ *
686
+ * @param {HTMLElement} target - Element for which to calculate the content rectangle.
687
+ * @returns {DOMRectInit}
688
+ */
689
+ function getHTMLElementContentRect(target) {
690
+ // Client width & height properties can't be
691
+ // used exclusively as they provide rounded values.
692
+ var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
693
+ // By this condition we can catch all non-replaced inline, hidden and
694
+ // detached elements. Though elements with width & height properties less
695
+ // than 0.5 will be discarded as well.
696
+ //
697
+ // Without it we would need to implement separate methods for each of
698
+ // those cases and it's not possible to perform a precise and performance
699
+ // effective test for hidden elements. E.g. even jQuery's ':visible' filter
700
+ // gives wrong results for elements with width & height less than 0.5.
701
+ if (!clientWidth && !clientHeight) {
702
+ return emptyRect;
703
+ }
704
+ var styles = getWindowOf(target).getComputedStyle(target);
705
+ var paddings = getPaddings(styles);
706
+ var horizPad = paddings.left + paddings.right;
707
+ var vertPad = paddings.top + paddings.bottom;
708
+ // Computed styles of width & height are being used because they are the
709
+ // only dimensions available to JS that contain non-rounded values. It could
710
+ // be possible to utilize the getBoundingClientRect if only it's data wasn't
711
+ // affected by CSS transformations let alone paddings, borders and scroll bars.
712
+ var width = toFloat(styles.width), height = toFloat(styles.height);
713
+ // Width & height include paddings and borders when the 'border-box' box
714
+ // model is applied (except for IE).
715
+ if (styles.boxSizing === 'border-box') {
716
+ // Following conditions are required to handle Internet Explorer which
717
+ // doesn't include paddings and borders to computed CSS dimensions.
718
+ //
719
+ // We can say that if CSS dimensions + paddings are equal to the "client"
720
+ // properties then it's either IE, and thus we don't need to subtract
721
+ // anything, or an element merely doesn't have paddings/borders styles.
722
+ if (Math.round(width + horizPad) !== clientWidth) {
723
+ width -= getBordersSize(styles, 'left', 'right') + horizPad;
724
+ }
725
+ if (Math.round(height + vertPad) !== clientHeight) {
726
+ height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
727
+ }
728
+ }
729
+ // Following steps can't be applied to the document's root element as its
730
+ // client[Width/Height] properties represent viewport area of the window.
731
+ // Besides, it's as well not necessary as the <html> itself neither has
732
+ // rendered scroll bars nor it can be clipped.
733
+ if (!isDocumentElement(target)) {
734
+ // In some browsers (only in Firefox, actually) CSS width & height
735
+ // include scroll bars size which can be removed at this step as scroll
736
+ // bars are the only difference between rounded dimensions + paddings
737
+ // and "client" properties, though that is not always true in Chrome.
738
+ var vertScrollbar = Math.round(width + horizPad) - clientWidth;
739
+ var horizScrollbar = Math.round(height + vertPad) - clientHeight;
740
+ // Chrome has a rather weird rounding of "client" properties.
741
+ // E.g. for an element with content width of 314.2px it sometimes gives
742
+ // the client width of 315px and for the width of 314.7px it may give
743
+ // 314px. And it doesn't happen all the time. So just ignore this delta
744
+ // as a non-relevant.
745
+ if (Math.abs(vertScrollbar) !== 1) {
746
+ width -= vertScrollbar;
747
+ }
748
+ if (Math.abs(horizScrollbar) !== 1) {
749
+ height -= horizScrollbar;
750
+ }
751
+ }
752
+ return createRectInit(paddings.left, paddings.top, width, height);
753
+ }
754
+ /**
755
+ * Checks whether provided element is an instance of the SVGGraphicsElement.
756
+ *
757
+ * @param {Element} target - Element to be checked.
758
+ * @returns {boolean}
759
+ */
760
+ var isSVGGraphicsElement = (function () {
761
+ // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
762
+ // interface.
763
+ if (typeof SVGGraphicsElement !== 'undefined') {
764
+ return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
765
+ }
766
+ // If it's so, then check that element is at least an instance of the
767
+ // SVGElement and that it has the "getBBox" method.
768
+ // eslint-disable-next-line no-extra-parens
769
+ return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
770
+ typeof target.getBBox === 'function'); };
771
+ })();
772
+ /**
773
+ * Checks whether provided element is a document element (<html>).
774
+ *
775
+ * @param {Element} target - Element to be checked.
776
+ * @returns {boolean}
777
+ */
778
+ function isDocumentElement(target) {
779
+ return target === getWindowOf(target).document.documentElement;
780
+ }
781
+ /**
782
+ * Calculates an appropriate content rectangle for provided html or svg element.
783
+ *
784
+ * @param {Element} target - Element content rectangle of which needs to be calculated.
785
+ * @returns {DOMRectInit}
786
+ */
787
+ function getContentRect(target) {
788
+ if (!isBrowser) {
789
+ return emptyRect;
790
+ }
791
+ if (isSVGGraphicsElement(target)) {
792
+ return getSVGContentRect(target);
793
+ }
794
+ return getHTMLElementContentRect(target);
795
+ }
796
+ /**
797
+ * Creates rectangle with an interface of the DOMRectReadOnly.
798
+ * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
799
+ *
800
+ * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
801
+ * @returns {DOMRectReadOnly}
802
+ */
803
+ function createReadOnlyRect(_a) {
804
+ var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
805
+ // If DOMRectReadOnly is available use it as a prototype for the rectangle.
806
+ var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
807
+ var rect = Object.create(Constr.prototype);
808
+ // Rectangle's properties are not writable and non-enumerable.
809
+ defineConfigurable(rect, {
810
+ x: x, y: y, width: width, height: height,
811
+ top: y,
812
+ right: x + width,
813
+ bottom: height + y,
814
+ left: x
815
+ });
816
+ return rect;
817
+ }
818
+ /**
819
+ * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
820
+ * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
821
+ *
822
+ * @param {number} x - X coordinate.
823
+ * @param {number} y - Y coordinate.
824
+ * @param {number} width - Rectangle's width.
825
+ * @param {number} height - Rectangle's height.
826
+ * @returns {DOMRectInit}
827
+ */
828
+ function createRectInit(x, y, width, height) {
829
+ return { x: x, y: y, width: width, height: height };
830
+ }
831
+
832
+ /**
833
+ * Class that is responsible for computations of the content rectangle of
834
+ * provided DOM element and for keeping track of it's changes.
835
+ */
836
+ var ResizeObservation = /** @class */ (function () {
837
+ /**
838
+ * Creates an instance of ResizeObservation.
839
+ *
840
+ * @param {Element} target - Element to be observed.
841
+ */
842
+ function ResizeObservation(target) {
843
+ /**
844
+ * Broadcasted width of content rectangle.
845
+ *
846
+ * @type {number}
847
+ */
848
+ this.broadcastWidth = 0;
849
+ /**
850
+ * Broadcasted height of content rectangle.
851
+ *
852
+ * @type {number}
853
+ */
854
+ this.broadcastHeight = 0;
855
+ /**
856
+ * Reference to the last observed content rectangle.
857
+ *
858
+ * @private {DOMRectInit}
859
+ */
860
+ this.contentRect_ = createRectInit(0, 0, 0, 0);
861
+ this.target = target;
862
+ }
863
+ /**
864
+ * Updates content rectangle and tells whether it's width or height properties
865
+ * have changed since the last broadcast.
866
+ *
867
+ * @returns {boolean}
868
+ */
869
+ ResizeObservation.prototype.isActive = function () {
870
+ var rect = getContentRect(this.target);
871
+ this.contentRect_ = rect;
872
+ return (rect.width !== this.broadcastWidth ||
873
+ rect.height !== this.broadcastHeight);
874
+ };
875
+ /**
876
+ * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
877
+ * from the corresponding properties of the last observed content rectangle.
878
+ *
879
+ * @returns {DOMRectInit} Last observed content rectangle.
880
+ */
881
+ ResizeObservation.prototype.broadcastRect = function () {
882
+ var rect = this.contentRect_;
883
+ this.broadcastWidth = rect.width;
884
+ this.broadcastHeight = rect.height;
885
+ return rect;
886
+ };
887
+ return ResizeObservation;
888
+ }());
889
+
890
+ var ResizeObserverEntry = /** @class */ (function () {
891
+ /**
892
+ * Creates an instance of ResizeObserverEntry.
893
+ *
894
+ * @param {Element} target - Element that is being observed.
895
+ * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
896
+ */
897
+ function ResizeObserverEntry(target, rectInit) {
898
+ var contentRect = createReadOnlyRect(rectInit);
899
+ // According to the specification following properties are not writable
900
+ // and are also not enumerable in the native implementation.
901
+ //
902
+ // Property accessors are not being used as they'd require to define a
903
+ // private WeakMap storage which may cause memory leaks in browsers that
904
+ // don't support this type of collections.
905
+ defineConfigurable(this, { target: target, contentRect: contentRect });
906
+ }
907
+ return ResizeObserverEntry;
908
+ }());
909
+
910
+ var ResizeObserverSPI = /** @class */ (function () {
911
+ /**
912
+ * Creates a new instance of ResizeObserver.
913
+ *
914
+ * @param {ResizeObserverCallback} callback - Callback function that is invoked
915
+ * when one of the observed elements changes it's content dimensions.
916
+ * @param {ResizeObserverController} controller - Controller instance which
917
+ * is responsible for the updates of observer.
918
+ * @param {ResizeObserver} callbackCtx - Reference to the public
919
+ * ResizeObserver instance which will be passed to callback function.
920
+ */
921
+ function ResizeObserverSPI(callback, controller, callbackCtx) {
922
+ /**
923
+ * Collection of resize observations that have detected changes in dimensions
924
+ * of elements.
925
+ *
926
+ * @private {Array<ResizeObservation>}
927
+ */
928
+ this.activeObservations_ = [];
929
+ /**
930
+ * Registry of the ResizeObservation instances.
931
+ *
932
+ * @private {Map<Element, ResizeObservation>}
933
+ */
934
+ this.observations_ = new MapShim();
935
+ if (typeof callback !== 'function') {
936
+ throw new TypeError('The callback provided as parameter 1 is not a function.');
937
+ }
938
+ this.callback_ = callback;
939
+ this.controller_ = controller;
940
+ this.callbackCtx_ = callbackCtx;
941
+ }
942
+ /**
943
+ * Starts observing provided element.
944
+ *
945
+ * @param {Element} target - Element to be observed.
946
+ * @returns {void}
947
+ */
948
+ ResizeObserverSPI.prototype.observe = function (target) {
949
+ if (!arguments.length) {
950
+ throw new TypeError('1 argument required, but only 0 present.');
951
+ }
952
+ // Do nothing if current environment doesn't have the Element interface.
953
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
954
+ return;
955
+ }
956
+ if (!(target instanceof getWindowOf(target).Element)) {
957
+ throw new TypeError('parameter 1 is not of type "Element".');
958
+ }
959
+ var observations = this.observations_;
960
+ // Do nothing if element is already being observed.
961
+ if (observations.has(target)) {
962
+ return;
963
+ }
964
+ observations.set(target, new ResizeObservation(target));
965
+ this.controller_.addObserver(this);
966
+ // Force the update of observations.
967
+ this.controller_.refresh();
968
+ };
969
+ /**
970
+ * Stops observing provided element.
971
+ *
972
+ * @param {Element} target - Element to stop observing.
973
+ * @returns {void}
974
+ */
975
+ ResizeObserverSPI.prototype.unobserve = function (target) {
976
+ if (!arguments.length) {
977
+ throw new TypeError('1 argument required, but only 0 present.');
978
+ }
979
+ // Do nothing if current environment doesn't have the Element interface.
980
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
981
+ return;
982
+ }
983
+ if (!(target instanceof getWindowOf(target).Element)) {
984
+ throw new TypeError('parameter 1 is not of type "Element".');
985
+ }
986
+ var observations = this.observations_;
987
+ // Do nothing if element is not being observed.
988
+ if (!observations.has(target)) {
989
+ return;
990
+ }
991
+ observations.delete(target);
992
+ if (!observations.size) {
993
+ this.controller_.removeObserver(this);
994
+ }
995
+ };
996
+ /**
997
+ * Stops observing all elements.
998
+ *
999
+ * @returns {void}
1000
+ */
1001
+ ResizeObserverSPI.prototype.disconnect = function () {
1002
+ this.clearActive();
1003
+ this.observations_.clear();
1004
+ this.controller_.removeObserver(this);
1005
+ };
1006
+ /**
1007
+ * Collects observation instances the associated element of which has changed
1008
+ * it's content rectangle.
1009
+ *
1010
+ * @returns {void}
1011
+ */
1012
+ ResizeObserverSPI.prototype.gatherActive = function () {
1013
+ var _this = this;
1014
+ this.clearActive();
1015
+ this.observations_.forEach(function (observation) {
1016
+ if (observation.isActive()) {
1017
+ _this.activeObservations_.push(observation);
1018
+ }
1019
+ });
1020
+ };
1021
+ /**
1022
+ * Invokes initial callback function with a list of ResizeObserverEntry
1023
+ * instances collected from active resize observations.
1024
+ *
1025
+ * @returns {void}
1026
+ */
1027
+ ResizeObserverSPI.prototype.broadcastActive = function () {
1028
+ // Do nothing if observer doesn't have active observations.
1029
+ if (!this.hasActive()) {
1030
+ return;
1031
+ }
1032
+ var ctx = this.callbackCtx_;
1033
+ // Create ResizeObserverEntry instance for every active observation.
1034
+ var entries = this.activeObservations_.map(function (observation) {
1035
+ return new ResizeObserverEntry(observation.target, observation.broadcastRect());
1036
+ });
1037
+ this.callback_.call(ctx, entries, ctx);
1038
+ this.clearActive();
1039
+ };
1040
+ /**
1041
+ * Clears the collection of active observations.
1042
+ *
1043
+ * @returns {void}
1044
+ */
1045
+ ResizeObserverSPI.prototype.clearActive = function () {
1046
+ this.activeObservations_.splice(0);
1047
+ };
1048
+ /**
1049
+ * Tells whether observer has active observations.
1050
+ *
1051
+ * @returns {boolean}
1052
+ */
1053
+ ResizeObserverSPI.prototype.hasActive = function () {
1054
+ return this.activeObservations_.length > 0;
1055
+ };
1056
+ return ResizeObserverSPI;
1057
+ }());
1058
+
1059
+ // Registry of internal observers. If WeakMap is not available use current shim
1060
+ // for the Map collection as it has all required methods and because WeakMap
1061
+ // can't be fully polyfilled anyway.
1062
+ var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
1063
+ /**
1064
+ * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
1065
+ * exposing only those methods and properties that are defined in the spec.
1066
+ */
1067
+ var ResizeObserver = /** @class */ (function () {
1068
+ /**
1069
+ * Creates a new instance of ResizeObserver.
1070
+ *
1071
+ * @param {ResizeObserverCallback} callback - Callback that is invoked when
1072
+ * dimensions of the observed elements change.
1073
+ */
1074
+ function ResizeObserver(callback) {
1075
+ if (!(this instanceof ResizeObserver)) {
1076
+ throw new TypeError('Cannot call a class as a function.');
1077
+ }
1078
+ if (!arguments.length) {
1079
+ throw new TypeError('1 argument required, but only 0 present.');
1080
+ }
1081
+ var controller = ResizeObserverController.getInstance();
1082
+ var observer = new ResizeObserverSPI(callback, controller, this);
1083
+ observers.set(this, observer);
1084
+ }
1085
+ return ResizeObserver;
1086
+ }());
1087
+ // Expose public methods of ResizeObserver.
1088
+ [
1089
+ 'observe',
1090
+ 'unobserve',
1091
+ 'disconnect'
1092
+ ].forEach(function (method) {
1093
+ ResizeObserver.prototype[method] = function () {
1094
+ var _a;
1095
+ return (_a = observers.get(this))[method].apply(_a, arguments);
1096
+ };
1097
+ });
1098
+
1099
+ var index = (function () {
1100
+ // Export existing implementation if available.
1101
+ if (typeof global$1.ResizeObserver !== 'undefined') {
1102
+ return global$1.ResizeObserver;
1103
+ }
1104
+ return ResizeObserver;
1105
+ })();
1106
+
1107
+ /* harmony default export */ __webpack_exports__["default"] = (index);
1108
+
1109
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
1110
+
1111
+ /***/ }),
1112
+
1113
+ /***/ "9619":
1114
+ /***/ (function(module, exports, __webpack_require__) {
1115
+
1116
+ var throttle = __webpack_require__("597f");
1117
+ var debounce = __webpack_require__("0e15");
1118
+
1119
+ module.exports = {
1120
+ throttle: throttle,
1121
+ debounce: debounce
1122
+ };
1123
+
1124
+
1125
+ /***/ }),
1126
+
1127
+ /***/ "aaa0":
1128
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1129
+
1130
+ "use strict";
1131
+ /**
1132
+ * good-storage v1.1.1
1133
+ * (c) 2020 ustbhuangyi
1134
+ */
1135
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1136
+
1137
+ /**
1138
+ * 本地存储实现,封装localStorage和sessionStorage
1139
+ */
1140
+ var isServer = typeof window === 'undefined';
1141
+
1142
+ var store = {
1143
+ /* eslint-disable no-undef */
1144
+ version: '1.1.1',
1145
+ storage: !isServer ? window.localStorage : null,
1146
+ session: {
1147
+ storage: !isServer ? window.sessionStorage : null
1148
+ }
1149
+ };
1150
+
1151
+ var api = {
1152
+ set: function set(key, val) {
1153
+ if (this.disabled) {
1154
+ return;
1155
+ }
1156
+ if (val === undefined) {
1157
+ return this.remove(key);
1158
+ }
1159
+ this.storage.setItem(key, serialize(val));
1160
+ return val;
1161
+ },
1162
+ get: function get(key, def) {
1163
+ if (this.disabled) {
1164
+ return def;
1165
+ }
1166
+ var val = deserialize(this.storage.getItem(key));
1167
+ return val === undefined ? def : val;
1168
+ },
1169
+ has: function has(key) {
1170
+ return this.get(key) !== undefined;
1171
+ },
1172
+ remove: function remove(key) {
1173
+ if (this.disabled) {
1174
+ return;
1175
+ }
1176
+ this.storage.removeItem(key);
1177
+ },
1178
+ clear: function clear() {
1179
+ if (this.disabled) {
1180
+ return;
1181
+ }
1182
+ this.storage.clear();
1183
+ },
1184
+ getAll: function getAll() {
1185
+ if (this.disabled) {
1186
+ return null;
1187
+ }
1188
+ var ret = {};
1189
+ this.forEach(function (key, val) {
1190
+ ret[key] = val;
1191
+ });
1192
+ return ret;
1193
+ },
1194
+ forEach: function forEach(callback) {
1195
+ if (this.disabled) {
1196
+ return;
1197
+ }
1198
+ for (var i = 0; i < this.storage.length; i++) {
1199
+ var key = this.storage.key(i);
1200
+ callback(key, this.get(key));
1201
+ }
1202
+ }
1203
+ };
1204
+
1205
+ _extends(store, api);
1206
+
1207
+ _extends(store.session, api);
1208
+
1209
+ function serialize(val) {
1210
+ return JSON.stringify(val);
1211
+ }
1212
+
1213
+ function deserialize(val) {
1214
+ if (typeof val !== 'string') {
1215
+ return undefined;
1216
+ }
1217
+ try {
1218
+ return JSON.parse(val);
1219
+ } catch (e) {
1220
+ return val || undefined;
1221
+ }
1222
+ }
1223
+
1224
+ try {
1225
+ var testKey = '__storejs__';
1226
+ store.set(testKey, testKey);
1227
+ if (store.get(testKey) !== testKey) {
1228
+ store.disabled = true;
1229
+ }
1230
+ store.remove(testKey);
1231
+ } catch (e) {
1232
+ store.disabled = true;
1233
+ }
1234
+
1235
+ /* harmony default export */ __webpack_exports__["a"] = (store);
1236
+
1237
+
1238
+ /***/ }),
1239
+
1240
+ /***/ "c8ba":
1241
+ /***/ (function(module, exports) {
1242
+
1243
+ var g;
1244
+
1245
+ // This works in non-strict mode
1246
+ g = (function() {
1247
+ return this;
1248
+ })();
1249
+
1250
+ try {
1251
+ // This works if eval is allowed (see CSP)
1252
+ g = g || new Function("return this")();
1253
+ } catch (e) {
1254
+ // This works if the window reference is available
1255
+ if (typeof window === "object") g = window;
1256
+ }
1257
+
1258
+ // g can still be undefined, but nothing to do about it...
1259
+ // We return undefined, instead of nothing here, so it's
1260
+ // easier to handle this case. if(!global) { ...}
1261
+
1262
+ module.exports = g;
1263
+
1264
+
1265
+ /***/ })
1266
+
1267
+ }]);