@nuxt/devtools-nightly 0.0.0 → 2.0.0-28980754.13f6fd0

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 (146) hide show
  1. package/.discoveryrc.cjs +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +129 -0
  4. package/cli.mjs +2 -0
  5. package/dist/chunks/analyze-build.mjs +58 -0
  6. package/dist/chunks/module-main.mjs +18277 -0
  7. package/dist/chunks/plugin-metrics.mjs +68 -0
  8. package/dist/chunks/timeline.mjs +73 -0
  9. package/dist/chunks/vite-inspect.mjs +61 -0
  10. package/dist/chunks/vscode.mjs +202 -0
  11. package/dist/chunks/vue-devtools.mjs +18 -0
  12. package/dist/chunks/vue-inspector.mjs +15 -0
  13. package/dist/client/200.html +29 -0
  14. package/dist/client/404.html +29 -0
  15. package/dist/client/_nuxt/__blank-lg13rweu.js +1 -0
  16. package/dist/client/_nuxt/analyze-build-iq7xh3z1.js +1 -0
  17. package/dist/client/_nuxt/assets-gh0s06d1.js +16 -0
  18. package/dist/client/_nuxt/assets.css-hmxl533k.css +1 -0
  19. package/dist/client/_nuxt/builds/latest.json +1 -0
  20. package/dist/client/_nuxt/builds/meta/49cca9aa-555f-4765-adf5-305615694a06.json +1 -0
  21. package/dist/client/_nuxt/client-kpmlv67d.js +1 -0
  22. package/dist/client/_nuxt/code-diff.vue-n76oqanv.js +8 -0
  23. package/dist/client/_nuxt/code-snippets.vue-mo56dnf7.js +1 -0
  24. package/dist/client/_nuxt/components-lsb65kqi.js +1 -0
  25. package/dist/client/_nuxt/composable-item.vue-ou7mghhp.js +1 -0
  26. package/dist/client/_nuxt/constants-b32h69zq.js +1 -0
  27. package/dist/client/_nuxt/custom-_name_-jtqok9n0.js +1 -0
  28. package/dist/client/_nuxt/data-schema-button.vue-c1grymka.js +1 -0
  29. package/dist/client/_nuxt/data-schema-drawer-d4rpskxd.js +2 -0
  30. package/dist/client/_nuxt/default-g4qh1jek.js +1 -0
  31. package/dist/client/_nuxt/duration-display.vue-dzttyi5n.js +1 -0
  32. package/dist/client/_nuxt/e6dj4v2s.js +17 -0
  33. package/dist/client/_nuxt/entry.css-mj1nvcy6.css +1 -0
  34. package/dist/client/_nuxt/error-404-kkixf30c.js +1 -0
  35. package/dist/client/_nuxt/error-404.css-fwe7gpvk.css +1 -0
  36. package/dist/client/_nuxt/error-500-m1ccut5u.js +1 -0
  37. package/dist/client/_nuxt/error-500.css-djemplc9.css +1 -0
  38. package/dist/client/_nuxt/error-ow5xdwzf.js +9 -0
  39. package/dist/client/_nuxt/filepath-item.vue-emq61mdv.js +1 -0
  40. package/dist/client/_nuxt/full-nu44fgoz.js +1 -0
  41. package/dist/client/_nuxt/help-fab.css-ms50khsu.css +1 -0
  42. package/dist/client/_nuxt/help-fab.vue-pnejmv3y.js +1 -0
  43. package/dist/client/_nuxt/hooks-mgy9fbq4.js +1 -0
  44. package/dist/client/_nuxt/imports-hjuvh4if.js +1 -0
  45. package/dist/client/_nuxt/index-g2a9x4et.js +1 -0
  46. package/dist/client/_nuxt/index-ioxrnncp.js +2 -0
  47. package/dist/client/_nuxt/index-obsucz0g.js +1 -0
  48. package/dist/client/_nuxt/launch-page.vue-kdqfy3so.js +1 -0
  49. package/dist/client/_nuxt/modules-k3t829jl.js +1 -0
  50. package/dist/client/_nuxt/nbadge-drglxech.js +1 -0
  51. package/dist/client/_nuxt/ncheckbox.vue-n4yvgmy3.js +1 -0
  52. package/dist/client/_nuxt/ncode-block.css-lvdc77tw.css +1 -0
  53. package/dist/client/_nuxt/ncode-block.vue-dt6krs6h.js +2 -0
  54. package/dist/client/_nuxt/ndrawer.vue-dekxbytt.js +1 -0
  55. package/dist/client/_nuxt/ndropdown.vue-ftpt7kxg.js +1 -0
  56. package/dist/client/_nuxt/nicon-title.vue-hzhi6u0u.js +1 -0
  57. package/dist/client/_nuxt/nlink.vue-mgfv3kxu.js +1 -0
  58. package/dist/client/_nuxt/nmarkdown.vue-jpbjhala.js +1 -0
  59. package/dist/client/_nuxt/nnavbar.vue-ifbz2rxx.js +1 -0
  60. package/dist/client/_nuxt/none-vukmnfqm.js +1 -0
  61. package/dist/client/_nuxt/nsection-block-c3li7360.js +1 -0
  62. package/dist/client/_nuxt/nsection-block.css-e7kbjm7k.css +1 -0
  63. package/dist/client/_nuxt/nselect-tabs.vue-7ode1s40.js +1 -0
  64. package/dist/client/_nuxt/nselect.vue-g1dfz7uv.js +1 -0
  65. package/dist/client/_nuxt/nswitch.vue-iu20lc9i.js +1 -0
  66. package/dist/client/_nuxt/open-graph-fqsf6nxz.js +3 -0
  67. package/dist/client/_nuxt/open-graph.css-e21qzmvj.css +1 -0
  68. package/dist/client/_nuxt/overview-fu25jfez.js +1 -0
  69. package/dist/client/_nuxt/pages-krmwwon2.js +1 -0
  70. package/dist/client/_nuxt/payload-brwibidn.js +1 -0
  71. package/dist/client/_nuxt/pinia-jwh05bbu.js +1 -0
  72. package/dist/client/_nuxt/plugins-ct1odttb.js +1 -0
  73. package/dist/client/_nuxt/render-tree-btmc22jz.js +1 -0
  74. package/dist/client/_nuxt/runtime-configs-n2sp6jan.js +1 -0
  75. package/dist/client/_nuxt/server-discovery-jimy0pfh.js +1 -0
  76. package/dist/client/_nuxt/server-route-inputs.vue-ldyagniy.js +1 -0
  77. package/dist/client/_nuxt/server-routes-hly5t016.js +9 -0
  78. package/dist/client/_nuxt/server-tasks-morkovw5.js +1 -0
  79. package/dist/client/_nuxt/settings-ic9nbnp8.js +1 -0
  80. package/dist/client/_nuxt/stacktrace-list.vue-nqi994si.js +1 -0
  81. package/dist/client/_nuxt/state-components-ka9yswzm.js +1 -0
  82. package/dist/client/_nuxt/state-editor.vue-nbrmuzl0.js +1 -0
  83. package/dist/client/_nuxt/state-modules-fi6koj0q.js +1 -0
  84. package/dist/client/_nuxt/storage-kce0wh6l.js +1 -0
  85. package/dist/client/_nuxt/terminals-bz0knva4.js +1 -0
  86. package/dist/client/_nuxt/terminals.css-mejv43xm.css +1 -0
  87. package/dist/client/_nuxt/timeline-eie3snk2.js +31 -0
  88. package/dist/client/_nuxt/timeline.css-lhkpu01p.css +1 -0
  89. package/dist/client/_nuxt/unocss-runtime-cb61k1ql.js +1 -0
  90. package/dist/client/_nuxt/vendor/json-editor-vue-kcahofzr.js +3818 -0
  91. package/dist/client/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css +1 -0
  92. package/dist/client/_nuxt/vendor/markdown-it-fvu08dbs.js +16 -0
  93. package/dist/client/_nuxt/vendor/quicktype-core-lnbp3n5r.js +1006 -0
  94. package/dist/client/_nuxt/vendor/shiki-bpva4tco.js +282 -0
  95. package/dist/client/_nuxt/vendor/unocss-mstcul8h.js +2 -0
  96. package/dist/client/_nuxt/vendor/unocss.css-mhvipxpl.css +1 -0
  97. package/dist/client/_nuxt/vendor/vis-fzckz0r6.js +98 -0
  98. package/dist/client/_nuxt/vendor/xterm-b1jefe3j.js +9 -0
  99. package/dist/client/_nuxt/vendor/xterm.css-egmhki83.css +32 -0
  100. package/dist/client/_nuxt/virtual-files-ffma32j9.js +1 -0
  101. package/dist/client/_nuxt/virtual-files.css-gqpg2wnb.css +1 -0
  102. package/dist/client/_nuxt/vue-virtual-scroller.esm-ryb7s73q.js +2 -0
  103. package/dist/client/discovery/index.html +611 -0
  104. package/dist/client/index.html +29 -0
  105. package/dist/client/nuxt.svg +3 -0
  106. package/dist/dirs.d.mts +7 -0
  107. package/dist/dirs.d.ts +7 -0
  108. package/dist/dirs.mjs +28 -0
  109. package/dist/module.cjs +5 -0
  110. package/dist/module.d.mts +9 -0
  111. package/dist/module.d.ts +9 -0
  112. package/dist/module.json +9 -0
  113. package/dist/module.mjs +6 -0
  114. package/dist/runtime/auth/index.html +76 -0
  115. package/dist/runtime/function-metrics-helpers.d.ts +3 -0
  116. package/dist/runtime/function-metrics-helpers.js +69 -0
  117. package/dist/runtime/nitro/inline.d.ts +3 -0
  118. package/dist/runtime/nitro/inline.js +6 -0
  119. package/dist/runtime/plugins/devtools.client.d.ts +2 -0
  120. package/dist/runtime/plugins/devtools.client.js +56 -0
  121. package/dist/runtime/plugins/devtools.server.d.ts +2 -0
  122. package/dist/runtime/plugins/devtools.server.js +7 -0
  123. package/dist/runtime/plugins/view/FrameBox.vue +167 -0
  124. package/dist/runtime/plugins/view/Main.vue +415 -0
  125. package/dist/runtime/plugins/view/client.d.ts +12 -0
  126. package/dist/runtime/plugins/view/client.js +332 -0
  127. package/dist/runtime/plugins/view/state.d.ts +5 -0
  128. package/dist/runtime/plugins/view/state.js +17 -0
  129. package/dist/runtime/plugins/view/utils.d.ts +31 -0
  130. package/dist/runtime/plugins/view/utils.js +156 -0
  131. package/dist/runtime/settings.d.ts +4 -0
  132. package/dist/runtime/settings.js +2 -0
  133. package/dist/runtime/shared/hooks.d.ts +2 -0
  134. package/dist/runtime/shared/hooks.js +33 -0
  135. package/dist/runtime/use-nuxt-devtools.d.ts +8 -0
  136. package/dist/runtime/use-nuxt-devtools.js +23 -0
  137. package/dist/runtime/vue-devtools-client.d.ts +2 -0
  138. package/dist/runtime/vue-devtools-client.js +8 -0
  139. package/dist/shared/devtools-nightly.2a48a9e5.d.mts +62 -0
  140. package/dist/shared/devtools-nightly.2a48a9e5.d.ts +62 -0
  141. package/dist/shared/devtools-nightly.60b2ba4d.mjs +122 -0
  142. package/dist/types.d.mts +42 -0
  143. package/dist/types.d.ts +42 -0
  144. package/dist/types.mjs +1 -0
  145. package/package.json +128 -2
  146. package/types.d.ts +1 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{border:0;height:0;left:-9999em;margin:0;opacity:0;overflow:hidden;padding:0;position:absolute;resize:none;top:0;white-space:nowrap;width:0;z-index:-5}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;cursor:default;inset:0;overflow-y:scroll;position:absolute}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{left:0;position:absolute;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;left:-9999em;line-height:normal;position:absolute;top:0;visibility:hidden}.xterm.enable-mouse-events{cursor:default}.xterm .xterm-cursor-pointer,.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{color:transparent;inset:0;pointer-events:none;position:absolute;z-index:10}.xterm .xterm-accessibility-tree:not(.debug) ::-moz-selection{color:transparent}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre}.xterm .live-region{height:1px;left:-9999px;overflow:hidden;position:absolute;width:1px}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{position:absolute;z-index:6}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{pointer-events:none;position:absolute;right:0;top:0;z-index:8}.xterm-decoration-top{position:relative;z-index:2}
@@ -0,0 +1 @@
1
+ import{_ as V}from"./nnavbar.vue-ifbz2rxx.js";import{_ as D}from"./ncode-block.vue-dt6krs6h.js";import{bm as B,bn as S,O as P,w as j,V as U,h as W}from"./e6dj4v2s.js";import{U as i,W as c,X as a,p as E,f as m,w as I,q as _,a3 as l,a2 as u,F as d,ae as q,a8 as v,a0 as z,P as G}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as H}from"./help-fab.vue-pnejmv3y.js";import"./client-kpmlv67d.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-bpva4tco.js";const L={class:"markdown-body"},O={__name:"virtual-files",setup(h,{expose:r}){return r({frontmatter:{}}),(p,o)=>(i(),c("div",L,o[0]||(o[0]=[a("h1",null,"Virtual Files",-1),a("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.",-1)])))}},R=["onClick"],X={key:0,"h-full":"","of-hidden":"",flex:"~ col"},A={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},oe=E({__name:"virtual-files",setup(h){const r=m(""),n=B(),p=S(),o=m();I(()=>{if(!p.value)return;const e=`/_vfs.json/${encodeURIComponent(p.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>o.value=t.current)});function x(e){if(n.value?.rootDir)return e.startsWith(n.value?.rootDir)?e.slice(n.value.rootDir.length):e}const f=_(()=>n.value?n.value.entries.filter(e=>!e.id.startsWith(`${n.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),b=_(()=>new P(f.value,{keys:["id","path"]})),k=_(()=>r.value?b.value.search(r.value).map(e=>e.item):f.value);return(e,t)=>{const y=V,g=D,C=U,F=W,$=j,w=O,N=H;return i(),c(d,null,[l($,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[l(y,{search:r.value,"onUpdate:search":t[0]||(t[0]=s=>r.value=s),"no-padding":"",p3:""},null,8,["search"]),(i(!0),c(d,null,q(k.value,s=>(i(),c(d,{key:s.id},[a("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:z(s.id===o.value?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:J=>p.value=s.id},v(x(s.id)),11,R),t[1]||(t[1]=a("div",{"x-divider":""},null,-1))],64))),128))]),right:u(()=>[o.value?.content?(i(),c("div",X,[a("div",A,[a("code",null,v(o.value.id),1)]),l(g,{"h-full":"","of-auto":"","text-sm":"",code:o.value.content,lang:"typescript"},null,8,["code"])])):(i(),G(F,{key:1},{default:u(()=>[l(C,{px6:"",py2:""},{default:u(()=>t[2]||(t[2]=[a("span",{op75:""},"Select a file to start",-1)])),_:1})]),_:1}))]),_:1}),l(N,null,{default:u(()=>[l(w)]),_:1})],64)}}});export{oe as default};
@@ -0,0 +1 @@
1
+ .virtual-files .shiki{background:none!important;padding:10px}
@@ -0,0 +1,2 @@
1
+ import{R as re,S as ne,n as Q,U as $,P as L,Q as oe,av as le,s as ae,V as ue,ag as ce,ab as de,W as M,Y as A,Z as W,a2 as K,F as fe,ae as he,aa as q,a4 as me,aw as pe,$ as ye,a0 as Y,a3 as ve}from"./vendor/json-editor-vue-kcahofzr.js";function be(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var s=e.indexOf("rv:");return parseInt(e.substring(s+3,e.indexOf(".",s)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}let R;function H(){H.init||(H.init=!0,R=be()!==-1)}var E={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){H(),Q(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",R&&this.$el.appendChild(e),e.data="about:blank",R||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!R&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ge=oe();re("data-v-b329ee4c");const Se={class:"resize-observer",tabindex:"-1"};ne();const ze=ge((e,t,i,s,r,a)=>($(),L("div",Se)));E.render=ze;E.__scopeId="data-v-b329ee4c";E.__file="src/components/ResizeObserver.vue";function C(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(t){return typeof t}:C=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}function we(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _e(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function Ie(e,t,i){return _e(e.prototype,t),e}function X(e){return $e(e)||Te(e)||Oe(e)||Ve()}function $e(e){if(Array.isArray(e))return N(e)}function Te(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Oe(e,t){if(e){if(typeof e=="string")return N(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return N(e,t)}}function N(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}function Ve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function ke(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,a,u=function(n){for(var d=arguments.length,p=new Array(d>1?d-1:0),S=1;S<d;S++)p[S-1]=arguments[S];if(a=p,!(s&&n===r)){var _=i.leading;typeof _=="function"&&(_=_(n,r)),(!s||n!==r)&&_&&e.apply(void 0,[n].concat(X(a))),r=n,clearTimeout(s),s=setTimeout(function(){e.apply(void 0,[n].concat(X(a))),s=0},t)}};return u._clear=function(){clearTimeout(s),s=null},u}function Z(e,t){if(e===t)return!0;if(C(e)==="object"){for(var i in e)if(!Z(e[i],t[i]))return!1;return!0}return!1}var Me=function(){function e(t,i,s){we(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,s)}return Ie(e,[{key:"createObserver",value:function(i,s){var r=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=xe(i),this.callback=function(c,n){r.options.callback(c,n),c&&r.options.once&&(r.frozen=!0,r.destroyObserver())},this.callback&&this.options.throttle){var a=this.options.throttleOptions||{},u=a.leading;this.callback=ke(this.callback,this.options.throttle,{leading:function(n){return u==="both"||u==="visible"&&n||u==="hidden"&&!n}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(c){var n=c[0];if(c.length>1){var d=c.find(function(S){return S.isIntersecting});d&&(n=d)}if(r.callback){var p=n.isIntersecting&&n.intersectionRatio>=r.threshold;if(p===r.oldResult)return;r.oldResult=p,r.callback(p,n)}},this.options.intersection),Q(function(){r.observer&&r.observer.observe(r.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function J(e,t,i){var s=t.value;if(s)if(typeof IntersectionObserver>"u")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");else{var r=new Me(e,s,i);e._vue_visibilityState=r}}function Ae(e,t,i){var s=t.value,r=t.oldValue;if(!Z(s,r)){var a=e._vue_visibilityState;if(!s){ee(e);return}a?a.createObserver(s,i):J(e,{value:s},i)}}function ee(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Re={beforeMount:J,updated:Ae,unmounted:ee},Ce={itemsLimit:1e3},Ee=/(auto|scroll)/;function te(e,t){return e.parentNode===null?t:te(e.parentNode,t.concat([e]))}var P=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},Pe=function(t){return P(t,"overflow")+P(t,"overflow-y")+P(t,"overflow-x")},Le=function(t){return Ee.test(Pe(t))};function G(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=te(e.parentNode,[]),i=0;i<t.length;i+=1)if(Le(t[i]))return t[i];return document.scrollingElement||document.documentElement}}function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}var He={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function Ne(){return this.items.length&&j(this.items[0])!=="object"}var B=!1;if(typeof window<"u"){B=!1;try{var je=Object.defineProperty({},"passive",{get:function(){B=!0}});window.addEventListener("test",null,je)}catch{}}let Be=0;var ie={name:"RecycleScroller",components:{ResizeObserver:E},directives:{ObserveVisibility:Re},props:{...He,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,i=this.sizeField,s=this.minItemSize;let r=1e4,a=0,u;for(let c=0,n=t.length;c<n;c++)u=t[c][i]||s,u<r&&(r=u),a+=u,e[c]={accumulator:a,size:u};return this.$_computedMinItemSize=r,e}return[]},simpleArray:Ne,itemIndexByKey(){const{keyField:e,items:t}=this,i={};for(let s=0,r=t.length;s<r;s++)i[t[s][e]]=s;return i}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,i,s,r){const a=le({id:Be++,index:t,used:!0,key:s,type:r}),u=ae({item:i,position:0,nr:a});return e.push(u),u},unuseView(e,t=!1){const i=this.$_unusedViews,s=e.nr.type;let r=i.get(s);r||(r=[],i.set(s,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:i}=this.updateVisibleItems(!1,!0);i||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const i=this.itemSize,s=this.gridItems||1,r=this.itemSecondarySize||i,a=this.$_computedMinItemSize,u=this.typeField,c=this.simpleArray?null:this.keyField,n=this.items,d=n.length,p=this.sizes,S=this.$_views,_=this.$_unusedViews,V=this.pool,se=this.itemIndexByKey;let y,f,T,g,z;if(!d)y=f=g=z=T=0;else if(this.$_prerender)y=g=0,f=z=Math.min(this.prerender,n.length),T=null;else{const o=this.getScroll();if(t){let m=o.start-this.$_lastUpdateScrollPosition;if(m<0&&(m=-m),i===null&&m<a||m<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=o.start;const v=this.buffer;o.start-=v,o.end+=v;let h=0;if(this.$refs.before&&(h=this.$refs.before.scrollHeight,o.start-=h),this.$refs.after){const m=this.$refs.after.scrollHeight;o.end+=m}if(i===null){let m,O=0,F=d-1,b=~~(d/2),U;do U=b,m=p[b].accumulator,m<o.start?O=b:b<d-1&&p[b+1].accumulator>o.start&&(F=b),b=~~((O+F)/2);while(b!==U);for(b<0&&(b=0),y=b,T=p[d-1].accumulator,f=b;f<d&&p[f].accumulator<o.end;f++);for(f===-1?f=n.length-1:(f++,f>d&&(f=d)),g=y;g<d&&h+p[g].accumulator<o.start;g++);for(z=g;z<d&&h+p[z].accumulator<o.end;z++);}else{y=~~(o.start/i*s);const m=y%s;y-=m,f=Math.ceil(o.end/i*s),g=Math.max(0,Math.floor((o.start-h)/i*s)),z=Math.floor((o.end-h)/i*s),y<0&&(y=0),f>d&&(f=d),g<0&&(g=0),z>d&&(z=d),T=Math.ceil(d/s)*i}}f-y>Ce.itemsLimit&&this.itemsLimitError(),this.totalSize=T;let l;const x=y<=this.$_endIndex&&f>=this.$_startIndex;if(x)for(let o=0,v=V.length;o<v;o++)l=V[o],l.nr.used&&(e&&(l.nr.index=se[l.item[c]]),(l.nr.index==null||l.nr.index<y||l.nr.index>=f)&&this.unuseView(l));const D=x?null:new Map;let I,w,k;for(let o=y;o<f;o++){I=n[o];const v=c?I[c]:I;if(v==null)throw new Error(`Key is ${v} on item (keyField is '${c}')`);if(l=S.get(v),!i&&!p[o].size){l&&this.unuseView(l);continue}w=I[u];let h=_.get(w),m=!1;if(!l)x?h&&h.length?l=h.pop():l=this.addView(V,o,I,v,w):(k=D.get(w)||0,(!h||k>=h.length)&&(l=this.addView(V,o,I,v,w),this.unuseView(l,!0),h=_.get(w)),l=h[k],D.set(w,k+1)),S.delete(l.nr.key),l.nr.used=!0,l.nr.index=o,l.nr.key=v,l.nr.type=w,S.set(v,l),m=!0;else if(!l.nr.used&&(l.nr.used=!0,m=!0,h)){const O=h.indexOf(l);O!==-1&&h.splice(O,1)}l.item=I,m&&(o===n.length-1&&this.$emit("scroll-end"),o===0&&this.$emit("scroll-start")),i===null?(l.position=p[o-1].accumulator,l.offset=0):(l.position=Math.floor(o/s)*i,l.offset=o%s*r)}return this.$_startIndex=y,this.$_endIndex=f,this.emitUpdate&&this.$emit("update",y,f,g,z),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let e=G(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,i=t==="vertical";let s;if(this.pageMode){const r=e.getBoundingClientRect(),a=i?r.height:r.width;let u=-(i?r.top:r.left),c=i?window.innerHeight:window.innerWidth;u<0&&(c+=u,u=0),u+c>a&&(c=a-u),s={start:u,end:u+c}}else i?s={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:s={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return s},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,B?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const i=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/i)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let i,s,r;if(this.pageMode){const a=G(this.$el),u=a.tagName==="HTML"?0:a[t.scroll],c=a.getBoundingClientRect(),d=this.$el.getBoundingClientRect()[t.start]-c[t.start];i=a,s=t.scroll,r=e+u+d}else i=this.$el,s=t.scroll,r=e;i[s]=r},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),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.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const De={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Fe={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function Ue(e,t,i,s,r,a){const u=ue("ResizeObserver"),c=ce("observe-visibility");return de(($(),M("div",{class:Y(["vue-recycle-scroller",{ready:r.ready,"page-mode":i.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...n)=>a.handleScroll&&a.handleScroll(...n))},[e.$slots.before?($(),M("div",De,[A(e.$slots,"before")],512)):W("v-if",!0),($(),L(q(i.listTag),{ref:"wrapper",style:ye({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:Y(["vue-recycle-scroller__item-wrapper",i.listClass])},{default:K(()=>[($(!0),M(fe,null,he(r.pool,n=>($(),L(q(i.itemTag),me({key:n.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${n.position}px) translate${e.direction==="vertical"?"X":"Y"}(${n.offset}px)`,width:i.gridItems?`${e.direction==="vertical"&&i.itemSecondarySize||i.itemSize}px`:void 0,height:i.gridItems?`${e.direction==="horizontal"&&i.itemSecondarySize||i.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[i.itemClass,{hover:!i.skipHover&&r.hoverKey===n.nr.key}]]},pe(i.skipHover?{}:{mouseenter:()=>{r.hoverKey=n.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:K(()=>[A(e.$slots,"default",{item:n.item,index:n.nr.index,active:n.nr.used})]),_:2},1040,["style","class"]))),128)),A(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?($(),M("div",Fe,[A(e.$slots,"after")],512)):W("v-if",!0),ve(u,{onNotify:a.handleResize},null,8,["onNotify"])],34)),[[c,a.handleVisibilityChange]])}ie.render=Ue;ie.__file="src/components/RecycleScroller.vue";export{ie as s};