vite-plugin-vue-devtools 0.0.1-alpha.9 → 0.0.2

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 (26) hide show
  1. package/README.md +85 -2
  2. package/dist/client/assets/{VCard-2c64c235.js → VCard-bd163775.js} +1 -1
  3. package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-8f4aa88f.js → VIcon.vue_vue_type_script_setup_true_lang-ace21790.js} +1 -1
  4. package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-7396a93b.js → VIconTitle.vue_vue_type_script_setup_true_lang-158277be.js} +1 -1
  5. package/dist/client/assets/{VPanelGrids-258e71bf.js → VPanelGrids-aa63351b.js} +1 -1
  6. package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-bf165828.js → VTextInput.vue_vue_type_script_setup_true_lang-f891cb2d.js} +3 -3
  7. package/dist/client/assets/{__inspecting-ac0f47cd.js → __inspecting-286ae191.js} +2 -2
  8. package/dist/client/assets/{assets-16670a42.js → assets-cd4715cf.js} +7 -7
  9. package/dist/client/assets/{components-d61f66d3.js → components-9972c4c4.js} +38 -8
  10. package/dist/client/assets/{graph-06e5c153.js → graph-57712452.js} +3 -2
  11. package/dist/client/assets/{index-ecdbdbf3.js → index-46e82560.js} +121 -37
  12. package/dist/client/assets/{inspect-debc5551.js → inspect-78d7aad4.js} +2 -2
  13. package/dist/client/assets/{overview-8074b6b6.js → overview-b595f4c8.js} +4 -4
  14. package/dist/client/assets/{pages-8bbcb7f6.js → pages-d2cd252f.js} +4 -4
  15. package/dist/client/assets/{pinia-704b2690.js → pinia-663071c7.js} +9 -8
  16. package/dist/client/assets/{routes-2f7ef553.js → routes-4ac43e84.js} +5 -5
  17. package/dist/client/assets/{rpc-ff946cbe.js → rpc-b3f8e657.js} +1 -1
  18. package/dist/client/assets/{settings-0b0be9f6.js → settings-56399403.js} +3 -3
  19. package/dist/client/assets/{splitpanes.es-aae37be3.js → splitpanes.es-39cc6ffd.js} +8 -9
  20. package/dist/client/assets/timeline-3b917d7d.js +1500 -0
  21. package/dist/client/assets/timeline-b315b2e0.css +1 -0
  22. package/dist/client/index.html +1 -1
  23. package/dist/index.d.ts +2 -2
  24. package/package.json +19 -14
  25. package/src/node/Container.vue +1 -0
  26. package/dist/client/assets/timeline-32808aaa.js +0 -209
@@ -0,0 +1,1500 @@
1
+ import { g, M, _ as _sfc_main$2 } from './splitpanes.es-39cc6ffd.js';
2
+ import { _ as __unplugin_components_0 } from './VPanelGrids-aa63351b.js';
3
+ import { _ as __unplugin_components_7 } from './VCard-bd163775.js';
4
+ import { p as pushScopeId, a as popScopeId, n as nextTick, o as openBlock, c as createBlock, w as withScopeId, m as markRaw, s as shallowReactive, r as resolveComponent, b as resolveDirective, d as withDirectives, e as createElementBlock, f as renderSlot, g as createCommentVNode, h as withCtx, F as Fragment, i as renderList, j as resolveDynamicComponent, k as mergeProps, t as toHandlers, l as normalizeStyle, q as normalizeClass, u as createVNode, v as defineComponent, x as createBaseVNode, y as toDisplayString, z as unref, A as onMounted, B as onUnmounted, C as timelineLayer, D as activeTimelineEvents, E as activeTimelineEventIndex, G as toggleTimelineEventIndex, H as timelineEventDetails, I as activeLayerId, J as toggleTimelineLayer } from './index-46e82560.js';
5
+ import './VIcon.vue_vue_type_script_setup_true_lang-ace21790.js';
6
+
7
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
+
9
+ function getDefaultExportFromCjs (x) {
10
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
11
+ }
12
+
13
+ /* Injected with object hook! */
14
+
15
+ var dayjs_min = {exports: {}};/* Injected with object hook! */
16
+
17
+ (function (module, exports) {
18
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){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}));
19
+ } (dayjs_min));
20
+
21
+ var dayjs_minExports = dayjs_min.exports;
22
+ const dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
23
+ /* Injected with object hook! */
24
+
25
+ function getInternetExplorerVersion() {
26
+ var ua = window.navigator.userAgent;
27
+ var msie = ua.indexOf('MSIE ');
28
+
29
+ if (msie > 0) {
30
+ // IE 10 or older => return version number
31
+ return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
32
+ }
33
+
34
+ var trident = ua.indexOf('Trident/');
35
+
36
+ if (trident > 0) {
37
+ // IE 11 => return version number
38
+ var rv = ua.indexOf('rv:');
39
+ return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
40
+ }
41
+
42
+ var edge = ua.indexOf('Edge/');
43
+
44
+ if (edge > 0) {
45
+ // Edge (IE 12+) => return version number
46
+ return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
47
+ } // other browser
48
+
49
+
50
+ return -1;
51
+ }
52
+
53
+ let isIE;
54
+
55
+ function initCompat () {
56
+ if (!initCompat.init) {
57
+ initCompat.init = true;
58
+ isIE = getInternetExplorerVersion() !== -1;
59
+ }
60
+ }
61
+
62
+ var script = {
63
+ name: 'ResizeObserver',
64
+
65
+ props: {
66
+ emitOnMount: {
67
+ type: Boolean,
68
+ default: false,
69
+ },
70
+
71
+ ignoreWidth: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
75
+
76
+ ignoreHeight: {
77
+ type: Boolean,
78
+ default: false,
79
+ },
80
+ },
81
+
82
+ emits: [
83
+ 'notify',
84
+ ],
85
+
86
+ mounted () {
87
+ initCompat();
88
+ nextTick(() => {
89
+ this._w = this.$el.offsetWidth;
90
+ this._h = this.$el.offsetHeight;
91
+ if (this.emitOnMount) {
92
+ this.emitSize();
93
+ }
94
+ });
95
+ const object = document.createElement('object');
96
+ this._resizeObject = object;
97
+ object.setAttribute('aria-hidden', 'true');
98
+ object.setAttribute('tabindex', -1);
99
+ object.onload = this.addResizeHandlers;
100
+ object.type = 'text/html';
101
+ if (isIE) {
102
+ this.$el.appendChild(object);
103
+ }
104
+ object.data = 'about:blank';
105
+ if (!isIE) {
106
+ this.$el.appendChild(object);
107
+ }
108
+ },
109
+
110
+ beforeUnmount () {
111
+ this.removeResizeHandlers();
112
+ },
113
+
114
+ methods: {
115
+ compareAndNotify () {
116
+ if ((!this.ignoreWidth && this._w !== this.$el.offsetWidth) || (!this.ignoreHeight && this._h !== this.$el.offsetHeight)) {
117
+ this._w = this.$el.offsetWidth;
118
+ this._h = this.$el.offsetHeight;
119
+ this.emitSize();
120
+ }
121
+ },
122
+
123
+ emitSize () {
124
+ this.$emit('notify', {
125
+ width: this._w,
126
+ height: this._h,
127
+ });
128
+ },
129
+
130
+ addResizeHandlers () {
131
+ this._resizeObject.contentDocument.defaultView.addEventListener('resize', this.compareAndNotify);
132
+ this.compareAndNotify();
133
+ },
134
+
135
+ removeResizeHandlers () {
136
+ if (this._resizeObject && this._resizeObject.onload) {
137
+ if (!isIE && this._resizeObject.contentDocument) {
138
+ this._resizeObject.contentDocument.defaultView.removeEventListener('resize', this.compareAndNotify);
139
+ }
140
+ this.$el.removeChild(this._resizeObject);
141
+ this._resizeObject.onload = null;
142
+ this._resizeObject = null;
143
+ }
144
+ },
145
+ },
146
+ };
147
+
148
+ const _withId = /*#__PURE__*/withScopeId();
149
+
150
+ pushScopeId("data-v-b329ee4c");
151
+ const _hoisted_1$3 = {
152
+ class: "resize-observer",
153
+ tabindex: "-1"
154
+ };
155
+ popScopeId();
156
+
157
+ const render = /*#__PURE__*/_withId((_ctx, _cache, $props, $setup, $data, $options) => {
158
+ return (openBlock(), createBlock("div", _hoisted_1$3))
159
+ });
160
+
161
+ script.render = render;
162
+ script.__scopeId = "data-v-b329ee4c";
163
+ script.__file = "src/components/ResizeObserver.vue";
164
+
165
+
166
+ /* Injected with object hook! */
167
+
168
+ function _typeof$1(obj) {
169
+ "@babel/helpers - typeof";
170
+
171
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
172
+ _typeof$1 = function (obj) {
173
+ return typeof obj;
174
+ };
175
+ } else {
176
+ _typeof$1 = function (obj) {
177
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
178
+ };
179
+ }
180
+
181
+ return _typeof$1(obj);
182
+ }
183
+
184
+ function _classCallCheck(instance, Constructor) {
185
+ if (!(instance instanceof Constructor)) {
186
+ throw new TypeError("Cannot call a class as a function");
187
+ }
188
+ }
189
+
190
+ function _defineProperties(target, props) {
191
+ for (var i = 0; i < props.length; i++) {
192
+ var descriptor = props[i];
193
+ descriptor.enumerable = descriptor.enumerable || false;
194
+ descriptor.configurable = true;
195
+ if ("value" in descriptor) descriptor.writable = true;
196
+ Object.defineProperty(target, descriptor.key, descriptor);
197
+ }
198
+ }
199
+
200
+ function _createClass(Constructor, protoProps, staticProps) {
201
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
202
+ if (staticProps) _defineProperties(Constructor, staticProps);
203
+ return Constructor;
204
+ }
205
+
206
+ function _toConsumableArray(arr) {
207
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
208
+ }
209
+
210
+ function _arrayWithoutHoles(arr) {
211
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
212
+ }
213
+
214
+ function _iterableToArray(iter) {
215
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
216
+ }
217
+
218
+ function _unsupportedIterableToArray(o, minLen) {
219
+ if (!o) return;
220
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
221
+ var n = Object.prototype.toString.call(o).slice(8, -1);
222
+ if (n === "Object" && o.constructor) n = o.constructor.name;
223
+ if (n === "Map" || n === "Set") return Array.from(o);
224
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
225
+ }
226
+
227
+ function _arrayLikeToArray(arr, len) {
228
+ if (len == null || len > arr.length) len = arr.length;
229
+
230
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
231
+
232
+ return arr2;
233
+ }
234
+
235
+ function _nonIterableSpread() {
236
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
237
+ }
238
+
239
+ function processOptions(value) {
240
+ var options;
241
+
242
+ if (typeof value === 'function') {
243
+ // Simple options (callback-only)
244
+ options = {
245
+ callback: value
246
+ };
247
+ } else {
248
+ // Options object
249
+ options = value;
250
+ }
251
+
252
+ return options;
253
+ }
254
+ function throttle(callback, delay) {
255
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
256
+ var timeout;
257
+ var lastState;
258
+ var currentArgs;
259
+
260
+ var throttled = function throttled(state) {
261
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
262
+ args[_key - 1] = arguments[_key];
263
+ }
264
+
265
+ currentArgs = args;
266
+ if (timeout && state === lastState) return;
267
+ var leading = options.leading;
268
+
269
+ if (typeof leading === 'function') {
270
+ leading = leading(state, lastState);
271
+ }
272
+
273
+ if ((!timeout || state !== lastState) && leading) {
274
+ callback.apply(void 0, [state].concat(_toConsumableArray(currentArgs)));
275
+ }
276
+
277
+ lastState = state;
278
+ clearTimeout(timeout);
279
+ timeout = setTimeout(function () {
280
+ callback.apply(void 0, [state].concat(_toConsumableArray(currentArgs)));
281
+ timeout = 0;
282
+ }, delay);
283
+ };
284
+
285
+ throttled._clear = function () {
286
+ clearTimeout(timeout);
287
+ timeout = null;
288
+ };
289
+
290
+ return throttled;
291
+ }
292
+ function deepEqual(val1, val2) {
293
+ if (val1 === val2) return true;
294
+
295
+ if (_typeof$1(val1) === 'object') {
296
+ for (var key in val1) {
297
+ if (!deepEqual(val1[key], val2[key])) {
298
+ return false;
299
+ }
300
+ }
301
+
302
+ return true;
303
+ }
304
+
305
+ return false;
306
+ }
307
+
308
+ var VisibilityState = /*#__PURE__*/function () {
309
+ function VisibilityState(el, options, vnode) {
310
+ _classCallCheck(this, VisibilityState);
311
+
312
+ this.el = el;
313
+ this.observer = null;
314
+ this.frozen = false;
315
+ this.createObserver(options, vnode);
316
+ }
317
+
318
+ _createClass(VisibilityState, [{
319
+ key: "createObserver",
320
+ value: function createObserver(options, vnode) {
321
+ var _this = this;
322
+
323
+ if (this.observer) {
324
+ this.destroyObserver();
325
+ }
326
+
327
+ if (this.frozen) return;
328
+ this.options = processOptions(options);
329
+
330
+ this.callback = function (result, entry) {
331
+ _this.options.callback(result, entry);
332
+
333
+ if (result && _this.options.once) {
334
+ _this.frozen = true;
335
+
336
+ _this.destroyObserver();
337
+ }
338
+ }; // Throttle
339
+
340
+
341
+ if (this.callback && this.options.throttle) {
342
+ var _ref = this.options.throttleOptions || {},
343
+ _leading = _ref.leading;
344
+
345
+ this.callback = throttle(this.callback, this.options.throttle, {
346
+ leading: function leading(state) {
347
+ return _leading === 'both' || _leading === 'visible' && state || _leading === 'hidden' && !state;
348
+ }
349
+ });
350
+ }
351
+
352
+ this.oldResult = undefined;
353
+ this.observer = new IntersectionObserver(function (entries) {
354
+ var entry = entries[0];
355
+
356
+ if (entries.length > 1) {
357
+ var intersectingEntry = entries.find(function (e) {
358
+ return e.isIntersecting;
359
+ });
360
+
361
+ if (intersectingEntry) {
362
+ entry = intersectingEntry;
363
+ }
364
+ }
365
+
366
+ if (_this.callback) {
367
+ // Use isIntersecting if possible because browsers can report isIntersecting as true, but intersectionRatio as 0, when something very slowly enters the viewport.
368
+ var result = entry.isIntersecting && entry.intersectionRatio >= _this.threshold;
369
+ if (result === _this.oldResult) return;
370
+ _this.oldResult = result;
371
+
372
+ _this.callback(result, entry);
373
+ }
374
+ }, this.options.intersection); // Wait for the element to be in document
375
+
376
+ nextTick(function () {
377
+ if (_this.observer) {
378
+ _this.observer.observe(_this.el);
379
+ }
380
+ });
381
+ }
382
+ }, {
383
+ key: "destroyObserver",
384
+ value: function destroyObserver() {
385
+ if (this.observer) {
386
+ this.observer.disconnect();
387
+ this.observer = null;
388
+ } // Cancel throttled call
389
+
390
+
391
+ if (this.callback && this.callback._clear) {
392
+ this.callback._clear();
393
+
394
+ this.callback = null;
395
+ }
396
+ }
397
+ }, {
398
+ key: "threshold",
399
+ get: function get() {
400
+ return this.options.intersection && typeof this.options.intersection.threshold === 'number' ? this.options.intersection.threshold : 0;
401
+ }
402
+ }]);
403
+
404
+ return VisibilityState;
405
+ }();
406
+
407
+ function beforeMount(el, _ref2, vnode) {
408
+ var value = _ref2.value;
409
+ if (!value) return;
410
+
411
+ if (typeof IntersectionObserver === 'undefined') {
412
+ console.warn('[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill');
413
+ } else {
414
+ var state = new VisibilityState(el, value, vnode);
415
+ el._vue_visibilityState = state;
416
+ }
417
+ }
418
+
419
+ function updated(el, _ref3, vnode) {
420
+ var value = _ref3.value,
421
+ oldValue = _ref3.oldValue;
422
+ if (deepEqual(value, oldValue)) return;
423
+ var state = el._vue_visibilityState;
424
+
425
+ if (!value) {
426
+ unmounted(el);
427
+ return;
428
+ }
429
+
430
+ if (state) {
431
+ state.createObserver(value, vnode);
432
+ } else {
433
+ beforeMount(el, {
434
+ value: value
435
+ }, vnode);
436
+ }
437
+ }
438
+
439
+ function unmounted(el) {
440
+ var state = el._vue_visibilityState;
441
+
442
+ if (state) {
443
+ state.destroyObserver();
444
+ delete el._vue_visibilityState;
445
+ }
446
+ }
447
+
448
+ var ObserveVisibility = {
449
+ beforeMount: beforeMount,
450
+ updated: updated,
451
+ unmounted: unmounted
452
+ };
453
+
454
+ /* Injected with object hook! */
455
+
456
+ var config = {
457
+ itemsLimit: 1000
458
+ };
459
+
460
+ // Fork of https://github.com/olahol/scrollparent.js to be able to build with Rollup
461
+
462
+ var regex = /(auto|scroll)/;
463
+ function parents(node, ps) {
464
+ if (node.parentNode === null) {
465
+ return ps;
466
+ }
467
+ return parents(node.parentNode, ps.concat([node]));
468
+ }
469
+ var style = function style(node, prop) {
470
+ return getComputedStyle(node, null).getPropertyValue(prop);
471
+ };
472
+ var overflow = function overflow(node) {
473
+ return style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x');
474
+ };
475
+ var scroll = function scroll(node) {
476
+ return regex.test(overflow(node));
477
+ };
478
+ function getScrollParent(node) {
479
+ if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
480
+ return;
481
+ }
482
+ var ps = parents(node.parentNode, []);
483
+ for (var i = 0; i < ps.length; i += 1) {
484
+ if (scroll(ps[i])) {
485
+ return ps[i];
486
+ }
487
+ }
488
+ return document.scrollingElement || document.documentElement;
489
+ }
490
+
491
+ function _typeof(obj) {
492
+ "@babel/helpers - typeof";
493
+
494
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
495
+ return typeof obj;
496
+ } : function (obj) {
497
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
498
+ }, _typeof(obj);
499
+ }
500
+
501
+ var props = {
502
+ items: {
503
+ type: Array,
504
+ required: true
505
+ },
506
+ keyField: {
507
+ type: String,
508
+ default: 'id'
509
+ },
510
+ direction: {
511
+ type: String,
512
+ default: 'vertical',
513
+ validator: function validator(value) {
514
+ return ['vertical', 'horizontal'].includes(value);
515
+ }
516
+ },
517
+ listTag: {
518
+ type: String,
519
+ default: 'div'
520
+ },
521
+ itemTag: {
522
+ type: String,
523
+ default: 'div'
524
+ }
525
+ };
526
+ function simpleArray() {
527
+ return this.items.length && _typeof(this.items[0]) !== 'object';
528
+ }
529
+
530
+ var supportsPassive = false;
531
+ if (typeof window !== 'undefined') {
532
+ supportsPassive = false;
533
+ try {
534
+ var opts = Object.defineProperty({}, 'passive', {
535
+ get: function get() {
536
+ supportsPassive = true;
537
+ }
538
+ });
539
+ window.addEventListener('test', null, opts);
540
+ } catch (e) {}
541
+ }
542
+
543
+ let uid = 0;
544
+
545
+ var script$2 = {
546
+ name: 'RecycleScroller',
547
+
548
+ components: {
549
+ ResizeObserver: script,
550
+ },
551
+
552
+ directives: {
553
+ ObserveVisibility,
554
+ },
555
+
556
+ props: {
557
+ ...props,
558
+
559
+ itemSize: {
560
+ type: Number,
561
+ default: null,
562
+ },
563
+
564
+ gridItems: {
565
+ type: Number,
566
+ default: undefined,
567
+ },
568
+
569
+ itemSecondarySize: {
570
+ type: Number,
571
+ default: undefined,
572
+ },
573
+
574
+ minItemSize: {
575
+ type: [Number, String],
576
+ default: null,
577
+ },
578
+
579
+ sizeField: {
580
+ type: String,
581
+ default: 'size',
582
+ },
583
+
584
+ typeField: {
585
+ type: String,
586
+ default: 'type',
587
+ },
588
+
589
+ buffer: {
590
+ type: Number,
591
+ default: 200,
592
+ },
593
+
594
+ pageMode: {
595
+ type: Boolean,
596
+ default: false,
597
+ },
598
+
599
+ prerender: {
600
+ type: Number,
601
+ default: 0,
602
+ },
603
+
604
+ emitUpdate: {
605
+ type: Boolean,
606
+ default: false,
607
+ },
608
+
609
+ updateInterval: {
610
+ type: Number,
611
+ default: 0,
612
+ },
613
+
614
+ skipHover: {
615
+ type: Boolean,
616
+ default: false,
617
+ },
618
+
619
+ listTag: {
620
+ type: String,
621
+ default: 'div',
622
+ },
623
+
624
+ itemTag: {
625
+ type: String,
626
+ default: 'div',
627
+ },
628
+
629
+ listClass: {
630
+ type: [String, Object, Array],
631
+ default: '',
632
+ },
633
+
634
+ itemClass: {
635
+ type: [String, Object, Array],
636
+ default: '',
637
+ },
638
+ },
639
+
640
+ emits: [
641
+ 'resize',
642
+ 'visible',
643
+ 'hidden',
644
+ 'update',
645
+ 'scroll-start',
646
+ 'scroll-end',
647
+ ],
648
+
649
+ data () {
650
+ return {
651
+ pool: [],
652
+ totalSize: 0,
653
+ ready: false,
654
+ hoverKey: null,
655
+ }
656
+ },
657
+
658
+ computed: {
659
+ sizes () {
660
+ if (this.itemSize === null) {
661
+ const sizes = {
662
+ '-1': { accumulator: 0 },
663
+ };
664
+ const items = this.items;
665
+ const field = this.sizeField;
666
+ const minItemSize = this.minItemSize;
667
+ let computedMinSize = 10000;
668
+ let accumulator = 0;
669
+ let current;
670
+ for (let i = 0, l = items.length; i < l; i++) {
671
+ current = items[i][field] || minItemSize;
672
+ if (current < computedMinSize) {
673
+ computedMinSize = current;
674
+ }
675
+ accumulator += current;
676
+ sizes[i] = { accumulator, size: current };
677
+ }
678
+ // eslint-disable-next-line
679
+ this.$_computedMinItemSize = computedMinSize;
680
+ return sizes
681
+ }
682
+ return []
683
+ },
684
+
685
+ simpleArray,
686
+
687
+ itemIndexByKey () {
688
+ const { keyField, items } = this;
689
+ const result = {};
690
+ for (let i = 0, l = items.length; i < l; i++) {
691
+ result[items[i][keyField]] = i;
692
+ }
693
+ return result
694
+ },
695
+ },
696
+
697
+ watch: {
698
+ items () {
699
+ this.updateVisibleItems(true);
700
+ },
701
+
702
+ pageMode () {
703
+ this.applyPageMode();
704
+ this.updateVisibleItems(false);
705
+ },
706
+
707
+ sizes: {
708
+ handler () {
709
+ this.updateVisibleItems(false);
710
+ },
711
+ deep: true,
712
+ },
713
+
714
+ gridItems () {
715
+ this.updateVisibleItems(true);
716
+ },
717
+
718
+ itemSecondarySize () {
719
+ this.updateVisibleItems(true);
720
+ },
721
+ },
722
+
723
+ created () {
724
+ this.$_startIndex = 0;
725
+ this.$_endIndex = 0;
726
+ this.$_views = new Map();
727
+ this.$_unusedViews = new Map();
728
+ this.$_scrollDirty = false;
729
+ this.$_lastUpdateScrollPosition = 0;
730
+
731
+ // In SSR mode, we also prerender the same number of item for the first render
732
+ // to avoir mismatch between server and client templates
733
+ if (this.prerender) {
734
+ this.$_prerender = true;
735
+ this.updateVisibleItems(false);
736
+ }
737
+
738
+ if (this.gridItems && !this.itemSize) {
739
+ console.error('[vue-recycle-scroller] You must provide an itemSize when using gridItems');
740
+ }
741
+ },
742
+
743
+ mounted () {
744
+ this.applyPageMode();
745
+ this.$nextTick(() => {
746
+ // In SSR mode, render the real number of visible items
747
+ this.$_prerender = false;
748
+ this.updateVisibleItems(true);
749
+ this.ready = true;
750
+ });
751
+ },
752
+
753
+ activated () {
754
+ const lastPosition = this.$_lastUpdateScrollPosition;
755
+ if (typeof lastPosition === 'number') {
756
+ this.$nextTick(() => {
757
+ this.scrollToPosition(lastPosition);
758
+ });
759
+ }
760
+ },
761
+
762
+ beforeUnmount () {
763
+ this.removeListeners();
764
+ },
765
+
766
+ methods: {
767
+ addView (pool, index, item, key, type) {
768
+ const nr = markRaw({
769
+ id: uid++,
770
+ index,
771
+ used: true,
772
+ key,
773
+ type,
774
+ });
775
+ const view = shallowReactive({
776
+ item,
777
+ position: 0,
778
+ nr,
779
+ });
780
+ pool.push(view);
781
+ return view
782
+ },
783
+
784
+ unuseView (view, fake = false) {
785
+ const unusedViews = this.$_unusedViews;
786
+ const type = view.nr.type;
787
+ let unusedPool = unusedViews.get(type);
788
+ if (!unusedPool) {
789
+ unusedPool = [];
790
+ unusedViews.set(type, unusedPool);
791
+ }
792
+ unusedPool.push(view);
793
+ if (!fake) {
794
+ view.nr.used = false;
795
+ view.position = -9999;
796
+ }
797
+ },
798
+
799
+ handleResize () {
800
+ this.$emit('resize');
801
+ if (this.ready) this.updateVisibleItems(false);
802
+ },
803
+
804
+ handleScroll (event) {
805
+ if (!this.$_scrollDirty) {
806
+ this.$_scrollDirty = true;
807
+ if (this.$_updateTimeout) return
808
+
809
+ const requestUpdate = () => requestAnimationFrame(() => {
810
+ this.$_scrollDirty = false;
811
+ const { continuous } = this.updateVisibleItems(false, true);
812
+
813
+ // It seems sometimes chrome doesn't fire scroll event :/
814
+ // When non continous scrolling is ending, we force a refresh
815
+ if (!continuous) {
816
+ clearTimeout(this.$_refreshTimout);
817
+ this.$_refreshTimout = setTimeout(this.handleScroll, this.updateInterval + 100);
818
+ }
819
+ });
820
+
821
+ requestUpdate();
822
+
823
+ // Schedule the next update with throttling
824
+ if (this.updateInterval) {
825
+ this.$_updateTimeout = setTimeout(() => {
826
+ this.$_updateTimeout = 0;
827
+ if (this.$_scrollDirty) requestUpdate();
828
+ }, this.updateInterval);
829
+ }
830
+ }
831
+ },
832
+
833
+ handleVisibilityChange (isVisible, entry) {
834
+ if (this.ready) {
835
+ if (isVisible || entry.boundingClientRect.width !== 0 || entry.boundingClientRect.height !== 0) {
836
+ this.$emit('visible');
837
+ requestAnimationFrame(() => {
838
+ this.updateVisibleItems(false);
839
+ });
840
+ } else {
841
+ this.$emit('hidden');
842
+ }
843
+ }
844
+ },
845
+
846
+ updateVisibleItems (checkItem, checkPositionDiff = false) {
847
+ const itemSize = this.itemSize;
848
+ const gridItems = this.gridItems || 1;
849
+ const itemSecondarySize = this.itemSecondarySize || itemSize;
850
+ const minItemSize = this.$_computedMinItemSize;
851
+ const typeField = this.typeField;
852
+ const keyField = this.simpleArray ? null : this.keyField;
853
+ const items = this.items;
854
+ const count = items.length;
855
+ const sizes = this.sizes;
856
+ const views = this.$_views;
857
+ const unusedViews = this.$_unusedViews;
858
+ const pool = this.pool;
859
+ const itemIndexByKey = this.itemIndexByKey;
860
+ let startIndex, endIndex;
861
+ let totalSize;
862
+ let visibleStartIndex, visibleEndIndex;
863
+
864
+ if (!count) {
865
+ startIndex = endIndex = visibleStartIndex = visibleEndIndex = totalSize = 0;
866
+ } else if (this.$_prerender) {
867
+ startIndex = visibleStartIndex = 0;
868
+ endIndex = visibleEndIndex = Math.min(this.prerender, items.length);
869
+ totalSize = null;
870
+ } else {
871
+ const scroll = this.getScroll();
872
+
873
+ // Skip update if use hasn't scrolled enough
874
+ if (checkPositionDiff) {
875
+ let positionDiff = scroll.start - this.$_lastUpdateScrollPosition;
876
+ if (positionDiff < 0) positionDiff = -positionDiff;
877
+ if ((itemSize === null && positionDiff < minItemSize) || positionDiff < itemSize) {
878
+ return {
879
+ continuous: true,
880
+ }
881
+ }
882
+ }
883
+ this.$_lastUpdateScrollPosition = scroll.start;
884
+
885
+ const buffer = this.buffer;
886
+ scroll.start -= buffer;
887
+ scroll.end += buffer;
888
+
889
+ // account for leading slot
890
+ let beforeSize = 0;
891
+ if (this.$refs.before) {
892
+ beforeSize = this.$refs.before.scrollHeight;
893
+ scroll.start -= beforeSize;
894
+ }
895
+
896
+ // account for trailing slot
897
+ if (this.$refs.after) {
898
+ const afterSize = this.$refs.after.scrollHeight;
899
+ scroll.end += afterSize;
900
+ }
901
+
902
+ // Variable size mode
903
+ if (itemSize === null) {
904
+ let h;
905
+ let a = 0;
906
+ let b = count - 1;
907
+ let i = ~~(count / 2);
908
+ let oldI;
909
+
910
+ // Searching for startIndex
911
+ do {
912
+ oldI = i;
913
+ h = sizes[i].accumulator;
914
+ if (h < scroll.start) {
915
+ a = i;
916
+ } else if (i < count - 1 && sizes[i + 1].accumulator > scroll.start) {
917
+ b = i;
918
+ }
919
+ i = ~~((a + b) / 2);
920
+ } while (i !== oldI)
921
+ i < 0 && (i = 0);
922
+ startIndex = i;
923
+
924
+ // For container style
925
+ totalSize = sizes[count - 1].accumulator;
926
+
927
+ // Searching for endIndex
928
+ for (endIndex = i; endIndex < count && sizes[endIndex].accumulator < scroll.end; endIndex++);
929
+ if (endIndex === -1) {
930
+ endIndex = items.length - 1;
931
+ } else {
932
+ endIndex++;
933
+ // Bounds
934
+ endIndex > count && (endIndex = count);
935
+ }
936
+
937
+ // search visible startIndex
938
+ for (visibleStartIndex = startIndex; visibleStartIndex < count && (beforeSize + sizes[visibleStartIndex].accumulator) < scroll.start; visibleStartIndex++);
939
+
940
+ // search visible endIndex
941
+ for (visibleEndIndex = visibleStartIndex; visibleEndIndex < count && (beforeSize + sizes[visibleEndIndex].accumulator) < scroll.end; visibleEndIndex++);
942
+ } else {
943
+ // Fixed size mode
944
+ startIndex = ~~(scroll.start / itemSize * gridItems);
945
+ const remainer = startIndex % gridItems;
946
+ startIndex -= remainer;
947
+ endIndex = Math.ceil(scroll.end / itemSize * gridItems);
948
+ visibleStartIndex = Math.max(0, Math.floor((scroll.start - beforeSize) / itemSize * gridItems));
949
+ visibleEndIndex = Math.floor((scroll.end - beforeSize) / itemSize * gridItems);
950
+
951
+ // Bounds
952
+ startIndex < 0 && (startIndex = 0);
953
+ endIndex > count && (endIndex = count);
954
+ visibleStartIndex < 0 && (visibleStartIndex = 0);
955
+ visibleEndIndex > count && (visibleEndIndex = count);
956
+
957
+ totalSize = Math.ceil(count / gridItems) * itemSize;
958
+ }
959
+ }
960
+
961
+ if (endIndex - startIndex > config.itemsLimit) {
962
+ this.itemsLimitError();
963
+ }
964
+
965
+ this.totalSize = totalSize;
966
+
967
+ let view;
968
+
969
+ const continuous = startIndex <= this.$_endIndex && endIndex >= this.$_startIndex;
970
+
971
+ // Unuse views that are no longer visible
972
+ if (continuous) {
973
+ for (let i = 0, l = pool.length; i < l; i++) {
974
+ view = pool[i];
975
+ if (view.nr.used) {
976
+ // Update view item index
977
+ if (checkItem) {
978
+ view.nr.index = itemIndexByKey[view.item[keyField]];
979
+ }
980
+
981
+ // Check if index is still in visible range
982
+ if (
983
+ view.nr.index == null ||
984
+ view.nr.index < startIndex ||
985
+ view.nr.index >= endIndex
986
+ ) {
987
+ this.unuseView(view);
988
+ }
989
+ }
990
+ }
991
+ }
992
+
993
+ const unusedIndex = continuous ? null : new Map();
994
+
995
+ let item, type;
996
+ let v;
997
+ for (let i = startIndex; i < endIndex; i++) {
998
+ item = items[i];
999
+ const key = keyField ? item[keyField] : item;
1000
+ if (key == null) {
1001
+ throw new Error(`Key is ${key} on item (keyField is '${keyField}')`)
1002
+ }
1003
+ view = views.get(key);
1004
+
1005
+ if (!itemSize && !sizes[i].size) {
1006
+ if (view) this.unuseView(view);
1007
+ continue
1008
+ }
1009
+
1010
+ type = item[typeField];
1011
+
1012
+ let unusedPool = unusedViews.get(type);
1013
+ let newlyUsedView = false;
1014
+
1015
+ // No view assigned to item
1016
+ if (!view) {
1017
+ if (continuous) {
1018
+ // Reuse existing view
1019
+ if (unusedPool && unusedPool.length) {
1020
+ view = unusedPool.pop();
1021
+ } else {
1022
+ view = this.addView(pool, i, item, key, type);
1023
+ }
1024
+ } else {
1025
+ // Use existing view
1026
+ // We don't care if they are already used
1027
+ // because we are not in continous scrolling
1028
+ v = unusedIndex.get(type) || 0;
1029
+
1030
+ if (!unusedPool || v >= unusedPool.length) {
1031
+ view = this.addView(pool, i, item, key, type);
1032
+ this.unuseView(view, true);
1033
+ unusedPool = unusedViews.get(type);
1034
+ }
1035
+
1036
+ view = unusedPool[v];
1037
+ unusedIndex.set(type, v + 1);
1038
+ }
1039
+
1040
+ // Assign view to item
1041
+ views.delete(view.nr.key);
1042
+ view.nr.used = true;
1043
+ view.nr.index = i;
1044
+ view.nr.key = key;
1045
+ view.nr.type = type;
1046
+ views.set(key, view);
1047
+
1048
+ newlyUsedView = true;
1049
+ } else {
1050
+ // View already assigned to item
1051
+ if (!view.nr.used) {
1052
+ view.nr.used = true;
1053
+ newlyUsedView = true;
1054
+ if (unusedPool) {
1055
+ const index = unusedPool.indexOf(view);
1056
+ if (index !== -1) unusedPool.splice(index, 1);
1057
+ }
1058
+ }
1059
+ }
1060
+
1061
+ // Always set item in case it's a new object with the same key
1062
+ view.item = item;
1063
+
1064
+ if (newlyUsedView) {
1065
+ if (i === items.length - 1) this.$emit('scroll-end');
1066
+ if (i === 0) this.$emit('scroll-start');
1067
+ }
1068
+
1069
+ // Update position
1070
+ if (itemSize === null) {
1071
+ view.position = sizes[i - 1].accumulator;
1072
+ view.offset = 0;
1073
+ } else {
1074
+ view.position = Math.floor(i / gridItems) * itemSize;
1075
+ view.offset = (i % gridItems) * itemSecondarySize;
1076
+ }
1077
+ }
1078
+
1079
+ this.$_startIndex = startIndex;
1080
+ this.$_endIndex = endIndex;
1081
+
1082
+ if (this.emitUpdate) this.$emit('update', startIndex, endIndex, visibleStartIndex, visibleEndIndex);
1083
+
1084
+ // After the user has finished scrolling
1085
+ // Sort views so text selection is correct
1086
+ clearTimeout(this.$_sortTimer);
1087
+ this.$_sortTimer = setTimeout(this.sortViews, this.updateInterval + 300);
1088
+
1089
+ return {
1090
+ continuous,
1091
+ }
1092
+ },
1093
+
1094
+ getListenerTarget () {
1095
+ let target = getScrollParent(this.$el);
1096
+ // Fix global scroll target for Chrome and Safari
1097
+ if (window.document && (target === window.document.documentElement || target === window.document.body)) {
1098
+ target = window;
1099
+ }
1100
+ return target
1101
+ },
1102
+
1103
+ getScroll () {
1104
+ const { $el: el, direction } = this;
1105
+ const isVertical = direction === 'vertical';
1106
+ let scrollState;
1107
+
1108
+ if (this.pageMode) {
1109
+ const bounds = el.getBoundingClientRect();
1110
+ const boundsSize = isVertical ? bounds.height : bounds.width;
1111
+ let start = -(isVertical ? bounds.top : bounds.left);
1112
+ let size = isVertical ? window.innerHeight : window.innerWidth;
1113
+ if (start < 0) {
1114
+ size += start;
1115
+ start = 0;
1116
+ }
1117
+ if (start + size > boundsSize) {
1118
+ size = boundsSize - start;
1119
+ }
1120
+ scrollState = {
1121
+ start,
1122
+ end: start + size,
1123
+ };
1124
+ } else if (isVertical) {
1125
+ scrollState = {
1126
+ start: el.scrollTop,
1127
+ end: el.scrollTop + el.clientHeight,
1128
+ };
1129
+ } else {
1130
+ scrollState = {
1131
+ start: el.scrollLeft,
1132
+ end: el.scrollLeft + el.clientWidth,
1133
+ };
1134
+ }
1135
+
1136
+ return scrollState
1137
+ },
1138
+
1139
+ applyPageMode () {
1140
+ if (this.pageMode) {
1141
+ this.addListeners();
1142
+ } else {
1143
+ this.removeListeners();
1144
+ }
1145
+ },
1146
+
1147
+ addListeners () {
1148
+ this.listenerTarget = this.getListenerTarget();
1149
+ this.listenerTarget.addEventListener('scroll', this.handleScroll, supportsPassive
1150
+ ? {
1151
+ passive: true,
1152
+ }
1153
+ : false);
1154
+ this.listenerTarget.addEventListener('resize', this.handleResize);
1155
+ },
1156
+
1157
+ removeListeners () {
1158
+ if (!this.listenerTarget) {
1159
+ return
1160
+ }
1161
+
1162
+ this.listenerTarget.removeEventListener('scroll', this.handleScroll);
1163
+ this.listenerTarget.removeEventListener('resize', this.handleResize);
1164
+
1165
+ this.listenerTarget = null;
1166
+ },
1167
+
1168
+ scrollToItem (index) {
1169
+ let scroll;
1170
+ const gridItems = this.gridItems || 1;
1171
+ if (this.itemSize === null) {
1172
+ scroll = index > 0 ? this.sizes[index - 1].accumulator : 0;
1173
+ } else {
1174
+ scroll = Math.floor(index / gridItems) * this.itemSize;
1175
+ }
1176
+ this.scrollToPosition(scroll);
1177
+ },
1178
+
1179
+ scrollToPosition (position) {
1180
+ const direction = this.direction === 'vertical'
1181
+ ? { scroll: 'scrollTop', start: 'top' }
1182
+ : { scroll: 'scrollLeft', start: 'left' };
1183
+
1184
+ let viewport;
1185
+ let scrollDirection;
1186
+ let scrollDistance;
1187
+
1188
+ if (this.pageMode) {
1189
+ const viewportEl = getScrollParent(this.$el);
1190
+ // HTML doesn't overflow like other elements
1191
+ const scrollTop = viewportEl.tagName === 'HTML' ? 0 : viewportEl[direction.scroll];
1192
+ const bounds = viewportEl.getBoundingClientRect();
1193
+
1194
+ const scroller = this.$el.getBoundingClientRect();
1195
+ const scrollerPosition = scroller[direction.start] - bounds[direction.start];
1196
+
1197
+ viewport = viewportEl;
1198
+ scrollDirection = direction.scroll;
1199
+ scrollDistance = position + scrollTop + scrollerPosition;
1200
+ } else {
1201
+ viewport = this.$el;
1202
+ scrollDirection = direction.scroll;
1203
+ scrollDistance = position;
1204
+ }
1205
+
1206
+ viewport[scrollDirection] = scrollDistance;
1207
+ },
1208
+
1209
+ itemsLimitError () {
1210
+ setTimeout(() => {
1211
+ console.log('It seems the scroller element isn\'t scrolling, so it tries to render all the items at once.', 'Scroller:', this.$el);
1212
+ console.log('Make sure the scroller has a fixed height (or width) and \'overflow-y\' (or \'overflow-x\') set to \'auto\' so it can scroll correctly and only render the items visible in the scroll viewport.');
1213
+ });
1214
+ throw new Error('Rendered items limit reached')
1215
+ },
1216
+
1217
+ sortViews () {
1218
+ this.pool.sort((viewA, viewB) => viewA.nr.index - viewB.nr.index);
1219
+ },
1220
+ },
1221
+ };
1222
+
1223
+ const _hoisted_1$2 = {
1224
+ key: 0,
1225
+ ref: "before",
1226
+ class: "vue-recycle-scroller__slot"
1227
+ };
1228
+ const _hoisted_2$2 = {
1229
+ key: 1,
1230
+ ref: "after",
1231
+ class: "vue-recycle-scroller__slot"
1232
+ };
1233
+
1234
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1235
+ const _component_ResizeObserver = resolveComponent("ResizeObserver");
1236
+ const _directive_observe_visibility = resolveDirective("observe-visibility");
1237
+
1238
+ return withDirectives((openBlock(), createElementBlock("div", {
1239
+ class: normalizeClass(["vue-recycle-scroller", {
1240
+ ready: $data.ready,
1241
+ 'page-mode': $props.pageMode,
1242
+ [`direction-${_ctx.direction}`]: true,
1243
+ }]),
1244
+ onScrollPassive: _cache[0] || (_cache[0] = (...args) => ($options.handleScroll && $options.handleScroll(...args)))
1245
+ }, [
1246
+ (_ctx.$slots.before)
1247
+ ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
1248
+ renderSlot(_ctx.$slots, "before")
1249
+ ], 512 /* NEED_PATCH */))
1250
+ : createCommentVNode("v-if", true),
1251
+ (openBlock(), createBlock(resolveDynamicComponent($props.listTag), {
1252
+ ref: "wrapper",
1253
+ style: normalizeStyle({ [_ctx.direction === 'vertical' ? 'minHeight' : 'minWidth']: $data.totalSize + 'px' }),
1254
+ class: normalizeClass(["vue-recycle-scroller__item-wrapper", $props.listClass])
1255
+ }, {
1256
+ default: withCtx(() => [
1257
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.pool, (view) => {
1258
+ return (openBlock(), createBlock(resolveDynamicComponent($props.itemTag), mergeProps({
1259
+ key: view.nr.id,
1260
+ style: $data.ready ? {
1261
+ transform: `translate${_ctx.direction === 'vertical' ? 'Y' : 'X'}(${view.position}px) translate${_ctx.direction === 'vertical' ? 'X' : 'Y'}(${view.offset}px)`,
1262
+ width: $props.gridItems ? `${_ctx.direction === 'vertical' ? $props.itemSecondarySize || $props.itemSize : $props.itemSize}px` : undefined,
1263
+ height: $props.gridItems ? `${_ctx.direction === 'horizontal' ? $props.itemSecondarySize || $props.itemSize : $props.itemSize}px` : undefined,
1264
+ } : null,
1265
+ class: ["vue-recycle-scroller__item-view", [
1266
+ $props.itemClass,
1267
+ {
1268
+ hover: !$props.skipHover && $data.hoverKey === view.nr.key
1269
+ },
1270
+ ]]
1271
+ }, toHandlers($props.skipHover ? {} : {
1272
+ mouseenter: () => { $data.hoverKey = view.nr.key; },
1273
+ mouseleave: () => { $data.hoverKey = null; },
1274
+ })), {
1275
+ default: withCtx(() => [
1276
+ renderSlot(_ctx.$slots, "default", {
1277
+ item: view.item,
1278
+ index: view.nr.index,
1279
+ active: view.nr.used
1280
+ })
1281
+ ]),
1282
+ _: 2 /* DYNAMIC */
1283
+ }, 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["style", "class"]))
1284
+ }), 128 /* KEYED_FRAGMENT */)),
1285
+ renderSlot(_ctx.$slots, "empty")
1286
+ ]),
1287
+ _: 3 /* FORWARDED */
1288
+ }, 8 /* PROPS */, ["style", "class"])),
1289
+ (_ctx.$slots.after)
1290
+ ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
1291
+ renderSlot(_ctx.$slots, "after")
1292
+ ], 512 /* NEED_PATCH */))
1293
+ : createCommentVNode("v-if", true),
1294
+ createVNode(_component_ResizeObserver, { onNotify: $options.handleResize }, null, 8 /* PROPS */, ["onNotify"])
1295
+ ], 34 /* CLASS, HYDRATE_EVENTS */)), [
1296
+ [_directive_observe_visibility, $options.handleVisibilityChange]
1297
+ ])
1298
+ }
1299
+
1300
+ script$2.render = render$1;
1301
+ script$2.__file = "src/components/RecycleScroller.vue";
1302
+
1303
+
1304
+ /* Injected with object hook! */
1305
+
1306
+ const vueVirtualScroller = '';
1307
+ /* Injected with object hook! */
1308
+
1309
+ const _hoisted_1$1 = { key: 0 };
1310
+ const _hoisted_2$1 = ["onClick"];
1311
+ const _hoisted_3$1 = {
1312
+ "flex-1": "",
1313
+ truncate: "",
1314
+ "font-mono": "",
1315
+ "space-x-1": ""
1316
+ };
1317
+ const _hoisted_4$1 = { "opacity-75": "" };
1318
+ const _hoisted_5$1 = {
1319
+ "flex-none": "",
1320
+ "font-mono": "",
1321
+ "opacity-50": ""
1322
+ };
1323
+ const _hoisted_6$1 = /* @__PURE__ */ createBaseVNode("h1", {
1324
+ "text-sm": "",
1325
+ italic: "",
1326
+ op50: ""
1327
+ }, " No Events ", -1);
1328
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1329
+ __name: "TimelineEvent",
1330
+ props: {
1331
+ data: null,
1332
+ selected: null
1333
+ },
1334
+ emits: ["update-selected"],
1335
+ setup(__props, { emit: emits }) {
1336
+ return (_ctx, _cache) => {
1337
+ const _component_VCard = __unplugin_components_7;
1338
+ const _component_VPanelGrids = __unplugin_components_0;
1339
+ return __props.data.length ? (openBlock(), createElementBlock("ul", _hoisted_1$1, [
1340
+ createVNode(unref(script$2), {
1341
+ items: __props.data,
1342
+ "min-item-size": 40,
1343
+ "key-field": "id",
1344
+ "page-mode": ""
1345
+ }, {
1346
+ default: withCtx(({ item, index }) => [
1347
+ createBaseVNode("li", {
1348
+ border: "b base",
1349
+ "h-10": "",
1350
+ flex: "",
1351
+ "cursor-pointer": "",
1352
+ "select-none": "",
1353
+ "items-center": "",
1354
+ "pl-3": "",
1355
+ "pr-2": "",
1356
+ "text-xs": "",
1357
+ "space-x-2": "",
1358
+ class: normalizeClass([index === __props.selected ? "vue-block-active" : "vue-block-hover"]),
1359
+ onClick: ($event) => emits("update-selected", index)
1360
+ }, [
1361
+ createBaseVNode("span", _hoisted_3$1, [
1362
+ createBaseVNode("span", {
1363
+ "font-medium": "",
1364
+ class: normalizeClass([index === __props.selected ? "text-white" : "text-purple-600 dark:text-purple-400"])
1365
+ }, toDisplayString(item.event.title), 3),
1366
+ createBaseVNode("span", _hoisted_4$1, toDisplayString(item.event.subtitle), 1)
1367
+ ]),
1368
+ createBaseVNode("span", _hoisted_5$1, toDisplayString(unref(dayjs)(item.event.now).format("HH:mm:ss")), 1)
1369
+ ], 10, _hoisted_2$1)
1370
+ ]),
1371
+ _: 1
1372
+ }, 8, ["items"])
1373
+ ])) : (openBlock(), createBlock(_component_VPanelGrids, {
1374
+ key: 1,
1375
+ px5: ""
1376
+ }, {
1377
+ default: withCtx(() => [
1378
+ createVNode(_component_VCard, {
1379
+ flex: "~ col gap2",
1380
+ "min-w-30": "",
1381
+ "items-center": "",
1382
+ p3: ""
1383
+ }, {
1384
+ default: withCtx(() => [
1385
+ _hoisted_6$1
1386
+ ]),
1387
+ _: 1
1388
+ })
1389
+ ]),
1390
+ _: 1
1391
+ }));
1392
+ };
1393
+ }
1394
+ });
1395
+
1396
+ /* Injected with object hook! */
1397
+
1398
+ const _hoisted_1 = {
1399
+ "h-screen": "",
1400
+ "n-panel-grids": ""
1401
+ };
1402
+ const _hoisted_2 = {
1403
+ "h-screen": "",
1404
+ "select-none": "",
1405
+ "overflow-scroll": "",
1406
+ "p-2": "",
1407
+ class: "no-scrollbar"
1408
+ };
1409
+ const _hoisted_3 = ["onClick"];
1410
+ const _hoisted_4 = { "vue-block-title": "" };
1411
+ const _hoisted_5 = {
1412
+ "h-screen": "",
1413
+ "select-none": "",
1414
+ "overflow-scroll": "",
1415
+ class: "no-scrollbar"
1416
+ };
1417
+ const _hoisted_6 = {
1418
+ "h-screen": "",
1419
+ "select-none": "",
1420
+ "overflow-scroll": "",
1421
+ "p-2": "",
1422
+ class: "no-scrollbar"
1423
+ };
1424
+ const _sfc_main = /* @__PURE__ */ defineComponent({
1425
+ __name: "timeline",
1426
+ setup(__props) {
1427
+ onMounted(() => {
1428
+ });
1429
+ onUnmounted(() => {
1430
+ });
1431
+ return (_ctx, _cache) => {
1432
+ const _component_TimelineEvent = _sfc_main$1;
1433
+ const _component_StateFields = _sfc_main$2;
1434
+ return openBlock(), createElementBlock("div", _hoisted_1, [
1435
+ createVNode(unref(M), null, {
1436
+ default: withCtx(() => [
1437
+ createVNode(unref(g), {
1438
+ border: "r base",
1439
+ size: "20"
1440
+ }, {
1441
+ default: withCtx(() => [
1442
+ createBaseVNode("div", _hoisted_2, [
1443
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(timelineLayer), (item) => {
1444
+ return openBlock(), createElementBlock("div", {
1445
+ key: item.id,
1446
+ "vue-block": "",
1447
+ class: normalizeClass([unref(activeLayerId) === item.id ? "vue-block-active" : "vue-block-hover"]),
1448
+ onClick: ($event) => unref(toggleTimelineLayer)(item.id)
1449
+ }, [
1450
+ createBaseVNode("h3", _hoisted_4, [
1451
+ createBaseVNode("span", {
1452
+ truncate: "",
1453
+ class: normalizeClass([unref(activeLayerId) === item.id ? "text-white" : "vue-block-text"])
1454
+ }, toDisplayString(item.label), 3)
1455
+ ])
1456
+ ], 10, _hoisted_3);
1457
+ }), 128))
1458
+ ])
1459
+ ]),
1460
+ _: 1
1461
+ }),
1462
+ createVNode(unref(g), {
1463
+ border: "r base",
1464
+ size: "45"
1465
+ }, {
1466
+ default: withCtx(() => [
1467
+ createBaseVNode("div", _hoisted_5, [
1468
+ createVNode(_component_TimelineEvent, {
1469
+ data: unref(activeTimelineEvents),
1470
+ selected: unref(activeTimelineEventIndex),
1471
+ onUpdateSelected: unref(toggleTimelineEventIndex)
1472
+ }, null, 8, ["data", "selected", "onUpdateSelected"])
1473
+ ])
1474
+ ]),
1475
+ _: 1
1476
+ }),
1477
+ unref(timelineEventDetails).value ? (openBlock(), createBlock(unref(g), {
1478
+ key: 0,
1479
+ size: "35"
1480
+ }, {
1481
+ default: withCtx(() => [
1482
+ createBaseVNode("div", _hoisted_6, [
1483
+ createVNode(_component_StateFields, { data: unref(timelineEventDetails) }, null, 8, ["data"])
1484
+ ])
1485
+ ]),
1486
+ _: 1
1487
+ })) : createCommentVNode("", true)
1488
+ ]),
1489
+ _: 1
1490
+ })
1491
+ ]);
1492
+ };
1493
+ }
1494
+ });
1495
+
1496
+ /* Injected with object hook! */
1497
+
1498
+ /* Injected with object hook! */
1499
+
1500
+ export { _sfc_main as default };