@scvzerng/element-plus-search-vue2 0.0.3 → 0.0.4

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.
@@ -0,0 +1,4949 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
8
+ <title>Rollup Visualizer</title>
9
+ <style>
10
+ :root {
11
+ --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
12
+ "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
13
+ "Noto Color Emoji";
14
+ --background-color: #2b2d42;
15
+ --text-color: #edf2f4;
16
+ }
17
+
18
+ html {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ *,
23
+ *:before,
24
+ *:after {
25
+ box-sizing: inherit;
26
+ }
27
+
28
+ html {
29
+ background-color: var(--background-color);
30
+ color: var(--text-color);
31
+ font-family: var(--font-family);
32
+ }
33
+
34
+ body {
35
+ padding: 0;
36
+ margin: 0;
37
+ }
38
+
39
+ html,
40
+ body {
41
+ height: 100%;
42
+ width: 100%;
43
+ overflow: hidden;
44
+ }
45
+
46
+ body {
47
+ display: flex;
48
+ flex-direction: column;
49
+ }
50
+
51
+ svg {
52
+ vertical-align: middle;
53
+ width: 100%;
54
+ height: 100%;
55
+ max-height: 100vh;
56
+ }
57
+
58
+ main {
59
+ flex-grow: 1;
60
+ height: 100vh;
61
+ padding: 20px;
62
+ }
63
+
64
+ .tooltip {
65
+ position: absolute;
66
+ z-index: 1070;
67
+ border: 2px solid;
68
+ border-radius: 5px;
69
+ padding: 5px;
70
+ font-size: 0.875rem;
71
+ background-color: var(--background-color);
72
+ color: var(--text-color);
73
+ }
74
+
75
+ .tooltip-hidden {
76
+ visibility: hidden;
77
+ opacity: 0;
78
+ }
79
+
80
+ .sidebar {
81
+ position: fixed;
82
+ top: 0;
83
+ left: 0;
84
+ right: 0;
85
+ display: flex;
86
+ flex-direction: row;
87
+ font-size: 0.7rem;
88
+ align-items: center;
89
+ margin: 0 50px;
90
+ height: 20px;
91
+ }
92
+
93
+ .size-selectors {
94
+ display: flex;
95
+ flex-direction: row;
96
+ align-items: center;
97
+ }
98
+
99
+ .size-selector {
100
+ display: flex;
101
+ flex-direction: row;
102
+ align-items: center;
103
+ justify-content: center;
104
+ margin-right: 1rem;
105
+ }
106
+ .size-selector input {
107
+ margin: 0 0.3rem 0 0;
108
+ }
109
+
110
+ .filters {
111
+ flex: 1;
112
+ display: flex;
113
+ flex-direction: row;
114
+ align-items: center;
115
+ }
116
+
117
+ .module-filters {
118
+ display: flex;
119
+ flex-grow: 1;
120
+ }
121
+
122
+ .module-filter {
123
+ display: flex;
124
+ flex-direction: row;
125
+ align-items: center;
126
+ justify-content: center;
127
+ flex: 1;
128
+ }
129
+ .module-filter input {
130
+ flex: 1;
131
+ height: 1rem;
132
+ padding: 0.01rem;
133
+ font-size: 0.7rem;
134
+ margin-left: 0.3rem;
135
+ }
136
+ .module-filter + .module-filter {
137
+ margin-left: 0.5rem;
138
+ }
139
+
140
+ .node {
141
+ cursor: pointer;
142
+ }
143
+ </style>
144
+ </head>
145
+ <body>
146
+ <main></main>
147
+ <script>
148
+ /*<!--*/
149
+ var drawChart = (function (exports) {
150
+ 'use strict';
151
+
152
+ var n,l$1,u$2,i$1,r$1,o$1,e$1,f$2,c$1,s$1,a$1,h$1,p$1={},v$1=[],y$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w$1=Array.isArray;function d$1(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m$1(l,e,i,r,null)}function m$1(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$2:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function k$1(n){return n.children}function x$1(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$1(n)}}function M(n){(!n.__d&&(n.__d=true)&&i$1.push(n)&&!$.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d$1({},r)).__v=r.__v+1,l$1.vnode&&l$1.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,z$1(f,t,c),t.__e!=o&&C$1(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_=t&&t.__k||v$1,m=l.length;for(f=P(u,l,_,f,m),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:_[y.__i]||p$1,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&q$1(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),4&y.__u||h.__k===y.__k?f=A$1(y,f,n):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m$1(null,o,null,null,null):w$1(o)?m$1(k$1,{children:o},null,null,null):null==o.constructor&&o.__b>0?m$1(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),B$1(e,e));return t}function A$1(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=A$1(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=S(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function L(n,l,u,t){var i,r,o=n.key,e=n.type,f=l[u];if(null===f&&null==n.key||f&&o==f.key&&e==f.type&&0==(2&f.__u))return u;if(t>(null!=f&&0==(2&f.__u)?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;){if(i>=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e==f.type)return i;i--;}if(r<l.length){if((f=l[r])&&0==(2&f.__u)&&o==f.key&&e==f.type)return r;r++;}}return -1}function T$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y$1.test(l)?u:u+"px";}function j$1(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f$2,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,r?a$1:s$1,r)):n.removeEventListener(l,r?a$1:s$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x$1(b,M),h.constructor=j,h.render=D$1),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d$1({},h.__s)),d$1(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d$1(d$1({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$1&&null==a.key&&(L=N(a.props.children)),f=I(n,w$1(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else for(T=o.length;T--;)g(o[T]);else u.__e=t.__e,u.__k=t.__k;l$1.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=V(t.__e,u,t,i,r,o,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$1(n,u,t){for(var i=0;i<t.length;i++)q$1(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function N(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w$1(n)?n.map(N):d$1({},n)}function V(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p$1,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$1(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j$1(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w$1(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$1(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j$1(u,a,m,b[a],o));}return u}function q$1(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function B$1(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||q$1(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&B$1(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0;}function D$1(n,l,u){return this.constructor(n,u)}function E(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_$1(k$1,null,[u]),o||p$1,p$1,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),z$1(e,u,f);}function K(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null;},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=true,M(n);});},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n);};}),n.children}return l.__c="__cC"+h$1++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$2=0,x$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d$1({},this.state),"function"==typeof n&&(n=n(d$1({},u),this.props)),n&&d$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x$1.prototype.render=k$1,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f$2=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F(false),a$1=F(true),h$1=0;
153
+
154
+ var f$1=0;function u$1(e,t,n,o,i,u){t||(t={});var a,c,p=t;if("ref"in p)for(c in p={},t)"ref"==c?a=t[c]:p[c]=t[c];var l={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f$1,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(a=e.defaultProps))for(c in a) void 0===p[c]&&(p[c]=a[c]);return l$1.vnode&&l$1.vnode(l),l}
155
+
156
+ function count$1(node) {
157
+ var sum = 0,
158
+ children = node.children,
159
+ i = children && children.length;
160
+ if (!i) sum = 1;
161
+ else while (--i >= 0) sum += children[i].value;
162
+ node.value = sum;
163
+ }
164
+
165
+ function node_count() {
166
+ return this.eachAfter(count$1);
167
+ }
168
+
169
+ function node_each(callback, that) {
170
+ let index = -1;
171
+ for (const node of this) {
172
+ callback.call(that, node, ++index, this);
173
+ }
174
+ return this;
175
+ }
176
+
177
+ function node_eachBefore(callback, that) {
178
+ var node = this, nodes = [node], children, i, index = -1;
179
+ while (node = nodes.pop()) {
180
+ callback.call(that, node, ++index, this);
181
+ if (children = node.children) {
182
+ for (i = children.length - 1; i >= 0; --i) {
183
+ nodes.push(children[i]);
184
+ }
185
+ }
186
+ }
187
+ return this;
188
+ }
189
+
190
+ function node_eachAfter(callback, that) {
191
+ var node = this, nodes = [node], next = [], children, i, n, index = -1;
192
+ while (node = nodes.pop()) {
193
+ next.push(node);
194
+ if (children = node.children) {
195
+ for (i = 0, n = children.length; i < n; ++i) {
196
+ nodes.push(children[i]);
197
+ }
198
+ }
199
+ }
200
+ while (node = next.pop()) {
201
+ callback.call(that, node, ++index, this);
202
+ }
203
+ return this;
204
+ }
205
+
206
+ function node_find(callback, that) {
207
+ let index = -1;
208
+ for (const node of this) {
209
+ if (callback.call(that, node, ++index, this)) {
210
+ return node;
211
+ }
212
+ }
213
+ }
214
+
215
+ function node_sum(value) {
216
+ return this.eachAfter(function(node) {
217
+ var sum = +value(node.data) || 0,
218
+ children = node.children,
219
+ i = children && children.length;
220
+ while (--i >= 0) sum += children[i].value;
221
+ node.value = sum;
222
+ });
223
+ }
224
+
225
+ function node_sort(compare) {
226
+ return this.eachBefore(function(node) {
227
+ if (node.children) {
228
+ node.children.sort(compare);
229
+ }
230
+ });
231
+ }
232
+
233
+ function node_path(end) {
234
+ var start = this,
235
+ ancestor = leastCommonAncestor(start, end),
236
+ nodes = [start];
237
+ while (start !== ancestor) {
238
+ start = start.parent;
239
+ nodes.push(start);
240
+ }
241
+ var k = nodes.length;
242
+ while (end !== ancestor) {
243
+ nodes.splice(k, 0, end);
244
+ end = end.parent;
245
+ }
246
+ return nodes;
247
+ }
248
+
249
+ function leastCommonAncestor(a, b) {
250
+ if (a === b) return a;
251
+ var aNodes = a.ancestors(),
252
+ bNodes = b.ancestors(),
253
+ c = null;
254
+ a = aNodes.pop();
255
+ b = bNodes.pop();
256
+ while (a === b) {
257
+ c = a;
258
+ a = aNodes.pop();
259
+ b = bNodes.pop();
260
+ }
261
+ return c;
262
+ }
263
+
264
+ function node_ancestors() {
265
+ var node = this, nodes = [node];
266
+ while (node = node.parent) {
267
+ nodes.push(node);
268
+ }
269
+ return nodes;
270
+ }
271
+
272
+ function node_descendants() {
273
+ return Array.from(this);
274
+ }
275
+
276
+ function node_leaves() {
277
+ var leaves = [];
278
+ this.eachBefore(function(node) {
279
+ if (!node.children) {
280
+ leaves.push(node);
281
+ }
282
+ });
283
+ return leaves;
284
+ }
285
+
286
+ function node_links() {
287
+ var root = this, links = [];
288
+ root.each(function(node) {
289
+ if (node !== root) { // Don’t include the root’s parent, if any.
290
+ links.push({source: node.parent, target: node});
291
+ }
292
+ });
293
+ return links;
294
+ }
295
+
296
+ function* node_iterator() {
297
+ var node = this, current, next = [node], children, i, n;
298
+ do {
299
+ current = next.reverse(), next = [];
300
+ while (node = current.pop()) {
301
+ yield node;
302
+ if (children = node.children) {
303
+ for (i = 0, n = children.length; i < n; ++i) {
304
+ next.push(children[i]);
305
+ }
306
+ }
307
+ }
308
+ } while (next.length);
309
+ }
310
+
311
+ function hierarchy(data, children) {
312
+ if (data instanceof Map) {
313
+ data = [undefined, data];
314
+ if (children === undefined) children = mapChildren;
315
+ } else if (children === undefined) {
316
+ children = objectChildren;
317
+ }
318
+
319
+ var root = new Node$1(data),
320
+ node,
321
+ nodes = [root],
322
+ child,
323
+ childs,
324
+ i,
325
+ n;
326
+
327
+ while (node = nodes.pop()) {
328
+ if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {
329
+ node.children = childs;
330
+ for (i = n - 1; i >= 0; --i) {
331
+ nodes.push(child = childs[i] = new Node$1(childs[i]));
332
+ child.parent = node;
333
+ child.depth = node.depth + 1;
334
+ }
335
+ }
336
+ }
337
+
338
+ return root.eachBefore(computeHeight);
339
+ }
340
+
341
+ function node_copy() {
342
+ return hierarchy(this).eachBefore(copyData);
343
+ }
344
+
345
+ function objectChildren(d) {
346
+ return d.children;
347
+ }
348
+
349
+ function mapChildren(d) {
350
+ return Array.isArray(d) ? d[1] : null;
351
+ }
352
+
353
+ function copyData(node) {
354
+ if (node.data.value !== undefined) node.value = node.data.value;
355
+ node.data = node.data.data;
356
+ }
357
+
358
+ function computeHeight(node) {
359
+ var height = 0;
360
+ do node.height = height;
361
+ while ((node = node.parent) && (node.height < ++height));
362
+ }
363
+
364
+ function Node$1(data) {
365
+ this.data = data;
366
+ this.depth =
367
+ this.height = 0;
368
+ this.parent = null;
369
+ }
370
+
371
+ Node$1.prototype = hierarchy.prototype = {
372
+ constructor: Node$1,
373
+ count: node_count,
374
+ each: node_each,
375
+ eachAfter: node_eachAfter,
376
+ eachBefore: node_eachBefore,
377
+ find: node_find,
378
+ sum: node_sum,
379
+ sort: node_sort,
380
+ path: node_path,
381
+ ancestors: node_ancestors,
382
+ descendants: node_descendants,
383
+ leaves: node_leaves,
384
+ links: node_links,
385
+ copy: node_copy,
386
+ [Symbol.iterator]: node_iterator
387
+ };
388
+
389
+ function required(f) {
390
+ if (typeof f !== "function") throw new Error;
391
+ return f;
392
+ }
393
+
394
+ function constantZero() {
395
+ return 0;
396
+ }
397
+
398
+ function constant$1(x) {
399
+ return function() {
400
+ return x;
401
+ };
402
+ }
403
+
404
+ function roundNode(node) {
405
+ node.x0 = Math.round(node.x0);
406
+ node.y0 = Math.round(node.y0);
407
+ node.x1 = Math.round(node.x1);
408
+ node.y1 = Math.round(node.y1);
409
+ }
410
+
411
+ function treemapDice(parent, x0, y0, x1, y1) {
412
+ var nodes = parent.children,
413
+ node,
414
+ i = -1,
415
+ n = nodes.length,
416
+ k = parent.value && (x1 - x0) / parent.value;
417
+
418
+ while (++i < n) {
419
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
420
+ node.x0 = x0, node.x1 = x0 += node.value * k;
421
+ }
422
+ }
423
+
424
+ function treemapSlice(parent, x0, y0, x1, y1) {
425
+ var nodes = parent.children,
426
+ node,
427
+ i = -1,
428
+ n = nodes.length,
429
+ k = parent.value && (y1 - y0) / parent.value;
430
+
431
+ while (++i < n) {
432
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
433
+ node.y0 = y0, node.y1 = y0 += node.value * k;
434
+ }
435
+ }
436
+
437
+ var phi = (1 + Math.sqrt(5)) / 2;
438
+
439
+ function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
440
+ var rows = [],
441
+ nodes = parent.children,
442
+ row,
443
+ nodeValue,
444
+ i0 = 0,
445
+ i1 = 0,
446
+ n = nodes.length,
447
+ dx, dy,
448
+ value = parent.value,
449
+ sumValue,
450
+ minValue,
451
+ maxValue,
452
+ newRatio,
453
+ minRatio,
454
+ alpha,
455
+ beta;
456
+
457
+ while (i0 < n) {
458
+ dx = x1 - x0, dy = y1 - y0;
459
+
460
+ // Find the next non-empty node.
461
+ do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);
462
+ minValue = maxValue = sumValue;
463
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
464
+ beta = sumValue * sumValue * alpha;
465
+ minRatio = Math.max(maxValue / beta, beta / minValue);
466
+
467
+ // Keep adding nodes while the aspect ratio maintains or improves.
468
+ for (; i1 < n; ++i1) {
469
+ sumValue += nodeValue = nodes[i1].value;
470
+ if (nodeValue < minValue) minValue = nodeValue;
471
+ if (nodeValue > maxValue) maxValue = nodeValue;
472
+ beta = sumValue * sumValue * alpha;
473
+ newRatio = Math.max(maxValue / beta, beta / minValue);
474
+ if (newRatio > minRatio) { sumValue -= nodeValue; break; }
475
+ minRatio = newRatio;
476
+ }
477
+
478
+ // Position and record the row orientation.
479
+ rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});
480
+ if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
481
+ else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
482
+ value -= sumValue, i0 = i1;
483
+ }
484
+
485
+ return rows;
486
+ }
487
+
488
+ var squarify = (function custom(ratio) {
489
+
490
+ function squarify(parent, x0, y0, x1, y1) {
491
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
492
+ }
493
+
494
+ squarify.ratio = function(x) {
495
+ return custom((x = +x) > 1 ? x : 1);
496
+ };
497
+
498
+ return squarify;
499
+ })(phi);
500
+
501
+ function treemap() {
502
+ var tile = squarify,
503
+ round = false,
504
+ dx = 1,
505
+ dy = 1,
506
+ paddingStack = [0],
507
+ paddingInner = constantZero,
508
+ paddingTop = constantZero,
509
+ paddingRight = constantZero,
510
+ paddingBottom = constantZero,
511
+ paddingLeft = constantZero;
512
+
513
+ function treemap(root) {
514
+ root.x0 =
515
+ root.y0 = 0;
516
+ root.x1 = dx;
517
+ root.y1 = dy;
518
+ root.eachBefore(positionNode);
519
+ paddingStack = [0];
520
+ if (round) root.eachBefore(roundNode);
521
+ return root;
522
+ }
523
+
524
+ function positionNode(node) {
525
+ var p = paddingStack[node.depth],
526
+ x0 = node.x0 + p,
527
+ y0 = node.y0 + p,
528
+ x1 = node.x1 - p,
529
+ y1 = node.y1 - p;
530
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
531
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
532
+ node.x0 = x0;
533
+ node.y0 = y0;
534
+ node.x1 = x1;
535
+ node.y1 = y1;
536
+ if (node.children) {
537
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
538
+ x0 += paddingLeft(node) - p;
539
+ y0 += paddingTop(node) - p;
540
+ x1 -= paddingRight(node) - p;
541
+ y1 -= paddingBottom(node) - p;
542
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
543
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
544
+ tile(node, x0, y0, x1, y1);
545
+ }
546
+ }
547
+
548
+ treemap.round = function(x) {
549
+ return arguments.length ? (round = !!x, treemap) : round;
550
+ };
551
+
552
+ treemap.size = function(x) {
553
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
554
+ };
555
+
556
+ treemap.tile = function(x) {
557
+ return arguments.length ? (tile = required(x), treemap) : tile;
558
+ };
559
+
560
+ treemap.padding = function(x) {
561
+ return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
562
+ };
563
+
564
+ treemap.paddingInner = function(x) {
565
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : constant$1(+x), treemap) : paddingInner;
566
+ };
567
+
568
+ treemap.paddingOuter = function(x) {
569
+ return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
570
+ };
571
+
572
+ treemap.paddingTop = function(x) {
573
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : constant$1(+x), treemap) : paddingTop;
574
+ };
575
+
576
+ treemap.paddingRight = function(x) {
577
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : constant$1(+x), treemap) : paddingRight;
578
+ };
579
+
580
+ treemap.paddingBottom = function(x) {
581
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant$1(+x), treemap) : paddingBottom;
582
+ };
583
+
584
+ treemap.paddingLeft = function(x) {
585
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant$1(+x), treemap) : paddingLeft;
586
+ };
587
+
588
+ return treemap;
589
+ }
590
+
591
+ var treemapResquarify = (function custom(ratio) {
592
+
593
+ function resquarify(parent, x0, y0, x1, y1) {
594
+ if ((rows = parent._squarify) && (rows.ratio === ratio)) {
595
+ var rows,
596
+ row,
597
+ nodes,
598
+ i,
599
+ j = -1,
600
+ n,
601
+ m = rows.length,
602
+ value = parent.value;
603
+
604
+ while (++j < m) {
605
+ row = rows[j], nodes = row.children;
606
+ for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
607
+ if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);
608
+ else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);
609
+ value -= row.value;
610
+ }
611
+ } else {
612
+ parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
613
+ rows.ratio = ratio;
614
+ }
615
+ }
616
+
617
+ resquarify.ratio = function(x) {
618
+ return custom((x = +x) > 1 ? x : 1);
619
+ };
620
+
621
+ return resquarify;
622
+ })(phi);
623
+
624
+ const isModuleTree = (mod) => "children" in mod;
625
+
626
+ let count = 0;
627
+ class Id {
628
+ constructor(id) {
629
+ this._id = id;
630
+ const url = new URL(window.location.href);
631
+ url.hash = id;
632
+ this._href = url.toString();
633
+ }
634
+ get id() {
635
+ return this._id;
636
+ }
637
+ get href() {
638
+ return this._href;
639
+ }
640
+ toString() {
641
+ return `url(${this.href})`;
642
+ }
643
+ }
644
+ function generateUniqueId(name) {
645
+ count += 1;
646
+ const id = ["O", name, count].filter(Boolean).join("-");
647
+ return new Id(id);
648
+ }
649
+
650
+ const LABELS = {
651
+ renderedLength: "Rendered",
652
+ gzipLength: "Gzip",
653
+ brotliLength: "Brotli",
654
+ };
655
+ const getAvailableSizeOptions = (options) => {
656
+ const availableSizeProperties = ["renderedLength"];
657
+ if (options.gzip) {
658
+ availableSizeProperties.push("gzipLength");
659
+ }
660
+ if (options.brotli) {
661
+ availableSizeProperties.push("brotliLength");
662
+ }
663
+ return availableSizeProperties;
664
+ };
665
+
666
+ var t,r,u,i,o=0,f=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(n){return !!n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c&&c.call(this,n,t,r)||i};r.__f=true;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i));}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i));}function A(n){return o=5,T(function(){return {current:n}},[])}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(t++,9);return i.c=n,u?(null==i.__&&(i.__=true,u.sub(r)),u.props.value):n.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[];}catch(t){n.__H.__h=[],c.__e(t,n.__v);}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),u=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return !n.__||B(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B(n){var t=r;n.__c=n.__(),r=t;}function C(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return "function"==typeof t?t(n):t}
667
+
668
+ const PLACEHOLDER = "*/**/file.js";
669
+ const SideBar = ({ availableSizeProperties, sizeProperty, setSizeProperty, onExcludeChange, onIncludeChange, }) => {
670
+ const [includeValue, setIncludeValue] = d("");
671
+ const [excludeValue, setExcludeValue] = d("");
672
+ const handleSizePropertyChange = (sizeProp) => () => {
673
+ if (sizeProp !== sizeProperty) {
674
+ setSizeProperty(sizeProp);
675
+ }
676
+ };
677
+ const handleIncludeChange = (event) => {
678
+ const value = event.currentTarget.value;
679
+ setIncludeValue(value);
680
+ onIncludeChange(value);
681
+ };
682
+ const handleExcludeChange = (event) => {
683
+ const value = event.currentTarget.value;
684
+ setExcludeValue(value);
685
+ onExcludeChange(value);
686
+ };
687
+ return (u$1("aside", { className: "sidebar", children: [u$1("div", { className: "size-selectors", children: availableSizeProperties.length > 1 &&
688
+ availableSizeProperties.map((sizeProp) => {
689
+ const id = `selector-${sizeProp}`;
690
+ return (u$1("div", { className: "size-selector", children: [u$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }), u$1("label", { htmlFor: id, children: LABELS[sizeProp] })] }, sizeProp));
691
+ }) }), u$1("div", { className: "module-filters", children: [u$1("div", { className: "module-filter", children: [u$1("label", { htmlFor: "module-filter-exclude", children: "Exclude" }), u$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange, placeholder: PLACEHOLDER })] }), u$1("div", { className: "module-filter", children: [u$1("label", { htmlFor: "module-filter-include", children: "Include" }), u$1("input", { type: "text", id: "module-filter-include", value: includeValue, onInput: handleIncludeChange, placeholder: PLACEHOLDER })] })] })] }));
692
+ };
693
+
694
+ function getDefaultExportFromCjs (x) {
695
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
696
+ }
697
+
698
+ var utils = {};
699
+
700
+ var constants$1;
701
+ var hasRequiredConstants;
702
+
703
+ function requireConstants () {
704
+ if (hasRequiredConstants) return constants$1;
705
+ hasRequiredConstants = 1;
706
+
707
+ const WIN_SLASH = '\\\\/';
708
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
709
+
710
+ /**
711
+ * Posix glob regex
712
+ */
713
+
714
+ const DOT_LITERAL = '\\.';
715
+ const PLUS_LITERAL = '\\+';
716
+ const QMARK_LITERAL = '\\?';
717
+ const SLASH_LITERAL = '\\/';
718
+ const ONE_CHAR = '(?=.)';
719
+ const QMARK = '[^/]';
720
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
721
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
722
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
723
+ const NO_DOT = `(?!${DOT_LITERAL})`;
724
+ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
725
+ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
726
+ const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
727
+ const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
728
+ const STAR = `${QMARK}*?`;
729
+ const SEP = '/';
730
+
731
+ const POSIX_CHARS = {
732
+ DOT_LITERAL,
733
+ PLUS_LITERAL,
734
+ QMARK_LITERAL,
735
+ SLASH_LITERAL,
736
+ ONE_CHAR,
737
+ QMARK,
738
+ END_ANCHOR,
739
+ DOTS_SLASH,
740
+ NO_DOT,
741
+ NO_DOTS,
742
+ NO_DOT_SLASH,
743
+ NO_DOTS_SLASH,
744
+ QMARK_NO_DOT,
745
+ STAR,
746
+ START_ANCHOR,
747
+ SEP
748
+ };
749
+
750
+ /**
751
+ * Windows glob regex
752
+ */
753
+
754
+ const WINDOWS_CHARS = {
755
+ ...POSIX_CHARS,
756
+
757
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
758
+ QMARK: WIN_NO_SLASH,
759
+ STAR: `${WIN_NO_SLASH}*?`,
760
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
761
+ NO_DOT: `(?!${DOT_LITERAL})`,
762
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
763
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
764
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
765
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
766
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
767
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
768
+ SEP: '\\'
769
+ };
770
+
771
+ /**
772
+ * POSIX Bracket Regex
773
+ */
774
+
775
+ const POSIX_REGEX_SOURCE = {
776
+ alnum: 'a-zA-Z0-9',
777
+ alpha: 'a-zA-Z',
778
+ ascii: '\\x00-\\x7F',
779
+ blank: ' \\t',
780
+ cntrl: '\\x00-\\x1F\\x7F',
781
+ digit: '0-9',
782
+ graph: '\\x21-\\x7E',
783
+ lower: 'a-z',
784
+ print: '\\x20-\\x7E ',
785
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
786
+ space: ' \\t\\r\\n\\v\\f',
787
+ upper: 'A-Z',
788
+ word: 'A-Za-z0-9_',
789
+ xdigit: 'A-Fa-f0-9'
790
+ };
791
+
792
+ constants$1 = {
793
+ MAX_LENGTH: 1024 * 64,
794
+ POSIX_REGEX_SOURCE,
795
+
796
+ // regular expressions
797
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
798
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
799
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
800
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
801
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
802
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
803
+
804
+ // Replace globs with equivalent patterns to reduce parsing time.
805
+ REPLACEMENTS: {
806
+ '***': '*',
807
+ '**/**': '**',
808
+ '**/**/**': '**'
809
+ },
810
+
811
+ // Digits
812
+ CHAR_0: 48, /* 0 */
813
+ CHAR_9: 57, /* 9 */
814
+
815
+ // Alphabet chars.
816
+ CHAR_UPPERCASE_A: 65, /* A */
817
+ CHAR_LOWERCASE_A: 97, /* a */
818
+ CHAR_UPPERCASE_Z: 90, /* Z */
819
+ CHAR_LOWERCASE_Z: 122, /* z */
820
+
821
+ CHAR_LEFT_PARENTHESES: 40, /* ( */
822
+ CHAR_RIGHT_PARENTHESES: 41, /* ) */
823
+
824
+ CHAR_ASTERISK: 42, /* * */
825
+
826
+ // Non-alphabetic chars.
827
+ CHAR_AMPERSAND: 38, /* & */
828
+ CHAR_AT: 64, /* @ */
829
+ CHAR_BACKWARD_SLASH: 92, /* \ */
830
+ CHAR_CARRIAGE_RETURN: 13, /* \r */
831
+ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
832
+ CHAR_COLON: 58, /* : */
833
+ CHAR_COMMA: 44, /* , */
834
+ CHAR_DOT: 46, /* . */
835
+ CHAR_DOUBLE_QUOTE: 34, /* " */
836
+ CHAR_EQUAL: 61, /* = */
837
+ CHAR_EXCLAMATION_MARK: 33, /* ! */
838
+ CHAR_FORM_FEED: 12, /* \f */
839
+ CHAR_FORWARD_SLASH: 47, /* / */
840
+ CHAR_GRAVE_ACCENT: 96, /* ` */
841
+ CHAR_HASH: 35, /* # */
842
+ CHAR_HYPHEN_MINUS: 45, /* - */
843
+ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
844
+ CHAR_LEFT_CURLY_BRACE: 123, /* { */
845
+ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
846
+ CHAR_LINE_FEED: 10, /* \n */
847
+ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
848
+ CHAR_PERCENT: 37, /* % */
849
+ CHAR_PLUS: 43, /* + */
850
+ CHAR_QUESTION_MARK: 63, /* ? */
851
+ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
852
+ CHAR_RIGHT_CURLY_BRACE: 125, /* } */
853
+ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
854
+ CHAR_SEMICOLON: 59, /* ; */
855
+ CHAR_SINGLE_QUOTE: 39, /* ' */
856
+ CHAR_SPACE: 32, /* */
857
+ CHAR_TAB: 9, /* \t */
858
+ CHAR_UNDERSCORE: 95, /* _ */
859
+ CHAR_VERTICAL_LINE: 124, /* | */
860
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
861
+
862
+ /**
863
+ * Create EXTGLOB_CHARS
864
+ */
865
+
866
+ extglobChars(chars) {
867
+ return {
868
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
869
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
870
+ '+': { type: 'plus', open: '(?:', close: ')+' },
871
+ '*': { type: 'star', open: '(?:', close: ')*' },
872
+ '@': { type: 'at', open: '(?:', close: ')' }
873
+ };
874
+ },
875
+
876
+ /**
877
+ * Create GLOB_CHARS
878
+ */
879
+
880
+ globChars(win32) {
881
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
882
+ }
883
+ };
884
+ return constants$1;
885
+ }
886
+
887
+ /*global navigator*/
888
+
889
+ var hasRequiredUtils;
890
+
891
+ function requireUtils () {
892
+ if (hasRequiredUtils) return utils;
893
+ hasRequiredUtils = 1;
894
+ (function (exports) {
895
+
896
+ const {
897
+ REGEX_BACKSLASH,
898
+ REGEX_REMOVE_BACKSLASH,
899
+ REGEX_SPECIAL_CHARS,
900
+ REGEX_SPECIAL_CHARS_GLOBAL
901
+ } = /*@__PURE__*/ requireConstants();
902
+
903
+ exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
904
+ exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
905
+ exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
906
+ exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
907
+ exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
908
+
909
+ exports.isWindows = () => {
910
+ if (typeof navigator !== 'undefined' && navigator.platform) {
911
+ const platform = navigator.platform.toLowerCase();
912
+ return platform === 'win32' || platform === 'windows';
913
+ }
914
+
915
+ if (typeof process !== 'undefined' && process.platform) {
916
+ return process.platform === 'win32';
917
+ }
918
+
919
+ return false;
920
+ };
921
+
922
+ exports.removeBackslashes = str => {
923
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
924
+ return match === '\\' ? '' : match;
925
+ });
926
+ };
927
+
928
+ exports.escapeLast = (input, char, lastIdx) => {
929
+ const idx = input.lastIndexOf(char, lastIdx);
930
+ if (idx === -1) return input;
931
+ if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
932
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
933
+ };
934
+
935
+ exports.removePrefix = (input, state = {}) => {
936
+ let output = input;
937
+ if (output.startsWith('./')) {
938
+ output = output.slice(2);
939
+ state.prefix = './';
940
+ }
941
+ return output;
942
+ };
943
+
944
+ exports.wrapOutput = (input, state = {}, options = {}) => {
945
+ const prepend = options.contains ? '' : '^';
946
+ const append = options.contains ? '' : '$';
947
+
948
+ let output = `${prepend}(?:${input})${append}`;
949
+ if (state.negated === true) {
950
+ output = `(?:^(?!${output}).*$)`;
951
+ }
952
+ return output;
953
+ };
954
+
955
+ exports.basename = (path, { windows } = {}) => {
956
+ const segs = path.split(windows ? /[\\/]/ : '/');
957
+ const last = segs[segs.length - 1];
958
+
959
+ if (last === '') {
960
+ return segs[segs.length - 2];
961
+ }
962
+
963
+ return last;
964
+ };
965
+ } (utils));
966
+ return utils;
967
+ }
968
+
969
+ var scan_1;
970
+ var hasRequiredScan;
971
+
972
+ function requireScan () {
973
+ if (hasRequiredScan) return scan_1;
974
+ hasRequiredScan = 1;
975
+
976
+ const utils = /*@__PURE__*/ requireUtils();
977
+ const {
978
+ CHAR_ASTERISK, /* * */
979
+ CHAR_AT, /* @ */
980
+ CHAR_BACKWARD_SLASH, /* \ */
981
+ CHAR_COMMA, /* , */
982
+ CHAR_DOT, /* . */
983
+ CHAR_EXCLAMATION_MARK, /* ! */
984
+ CHAR_FORWARD_SLASH, /* / */
985
+ CHAR_LEFT_CURLY_BRACE, /* { */
986
+ CHAR_LEFT_PARENTHESES, /* ( */
987
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
988
+ CHAR_PLUS, /* + */
989
+ CHAR_QUESTION_MARK, /* ? */
990
+ CHAR_RIGHT_CURLY_BRACE, /* } */
991
+ CHAR_RIGHT_PARENTHESES, /* ) */
992
+ CHAR_RIGHT_SQUARE_BRACKET /* ] */
993
+ } = /*@__PURE__*/ requireConstants();
994
+
995
+ const isPathSeparator = code => {
996
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
997
+ };
998
+
999
+ const depth = token => {
1000
+ if (token.isPrefix !== true) {
1001
+ token.depth = token.isGlobstar ? Infinity : 1;
1002
+ }
1003
+ };
1004
+
1005
+ /**
1006
+ * Quickly scans a glob pattern and returns an object with a handful of
1007
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
1008
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
1009
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
1010
+ *
1011
+ * ```js
1012
+ * const pm = require('picomatch');
1013
+ * console.log(pm.scan('foo/bar/*.js'));
1014
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
1015
+ * ```
1016
+ * @param {String} `str`
1017
+ * @param {Object} `options`
1018
+ * @return {Object} Returns an object with tokens and regex source string.
1019
+ * @api public
1020
+ */
1021
+
1022
+ const scan = (input, options) => {
1023
+ const opts = options || {};
1024
+
1025
+ const length = input.length - 1;
1026
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
1027
+ const slashes = [];
1028
+ const tokens = [];
1029
+ const parts = [];
1030
+
1031
+ let str = input;
1032
+ let index = -1;
1033
+ let start = 0;
1034
+ let lastIndex = 0;
1035
+ let isBrace = false;
1036
+ let isBracket = false;
1037
+ let isGlob = false;
1038
+ let isExtglob = false;
1039
+ let isGlobstar = false;
1040
+ let braceEscaped = false;
1041
+ let backslashes = false;
1042
+ let negated = false;
1043
+ let negatedExtglob = false;
1044
+ let finished = false;
1045
+ let braces = 0;
1046
+ let prev;
1047
+ let code;
1048
+ let token = { value: '', depth: 0, isGlob: false };
1049
+
1050
+ const eos = () => index >= length;
1051
+ const peek = () => str.charCodeAt(index + 1);
1052
+ const advance = () => {
1053
+ prev = code;
1054
+ return str.charCodeAt(++index);
1055
+ };
1056
+
1057
+ while (index < length) {
1058
+ code = advance();
1059
+ let next;
1060
+
1061
+ if (code === CHAR_BACKWARD_SLASH) {
1062
+ backslashes = token.backslashes = true;
1063
+ code = advance();
1064
+
1065
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1066
+ braceEscaped = true;
1067
+ }
1068
+ continue;
1069
+ }
1070
+
1071
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
1072
+ braces++;
1073
+
1074
+ while (eos() !== true && (code = advance())) {
1075
+ if (code === CHAR_BACKWARD_SLASH) {
1076
+ backslashes = token.backslashes = true;
1077
+ advance();
1078
+ continue;
1079
+ }
1080
+
1081
+ if (code === CHAR_LEFT_CURLY_BRACE) {
1082
+ braces++;
1083
+ continue;
1084
+ }
1085
+
1086
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
1087
+ isBrace = token.isBrace = true;
1088
+ isGlob = token.isGlob = true;
1089
+ finished = true;
1090
+
1091
+ if (scanToEnd === true) {
1092
+ continue;
1093
+ }
1094
+
1095
+ break;
1096
+ }
1097
+
1098
+ if (braceEscaped !== true && code === CHAR_COMMA) {
1099
+ isBrace = token.isBrace = true;
1100
+ isGlob = token.isGlob = true;
1101
+ finished = true;
1102
+
1103
+ if (scanToEnd === true) {
1104
+ continue;
1105
+ }
1106
+
1107
+ break;
1108
+ }
1109
+
1110
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
1111
+ braces--;
1112
+
1113
+ if (braces === 0) {
1114
+ braceEscaped = false;
1115
+ isBrace = token.isBrace = true;
1116
+ finished = true;
1117
+ break;
1118
+ }
1119
+ }
1120
+ }
1121
+
1122
+ if (scanToEnd === true) {
1123
+ continue;
1124
+ }
1125
+
1126
+ break;
1127
+ }
1128
+
1129
+ if (code === CHAR_FORWARD_SLASH) {
1130
+ slashes.push(index);
1131
+ tokens.push(token);
1132
+ token = { value: '', depth: 0, isGlob: false };
1133
+
1134
+ if (finished === true) continue;
1135
+ if (prev === CHAR_DOT && index === (start + 1)) {
1136
+ start += 2;
1137
+ continue;
1138
+ }
1139
+
1140
+ lastIndex = index + 1;
1141
+ continue;
1142
+ }
1143
+
1144
+ if (opts.noext !== true) {
1145
+ const isExtglobChar = code === CHAR_PLUS
1146
+ || code === CHAR_AT
1147
+ || code === CHAR_ASTERISK
1148
+ || code === CHAR_QUESTION_MARK
1149
+ || code === CHAR_EXCLAMATION_MARK;
1150
+
1151
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
1152
+ isGlob = token.isGlob = true;
1153
+ isExtglob = token.isExtglob = true;
1154
+ finished = true;
1155
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
1156
+ negatedExtglob = true;
1157
+ }
1158
+
1159
+ if (scanToEnd === true) {
1160
+ while (eos() !== true && (code = advance())) {
1161
+ if (code === CHAR_BACKWARD_SLASH) {
1162
+ backslashes = token.backslashes = true;
1163
+ code = advance();
1164
+ continue;
1165
+ }
1166
+
1167
+ if (code === CHAR_RIGHT_PARENTHESES) {
1168
+ isGlob = token.isGlob = true;
1169
+ finished = true;
1170
+ break;
1171
+ }
1172
+ }
1173
+ continue;
1174
+ }
1175
+ break;
1176
+ }
1177
+ }
1178
+
1179
+ if (code === CHAR_ASTERISK) {
1180
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
1181
+ isGlob = token.isGlob = true;
1182
+ finished = true;
1183
+
1184
+ if (scanToEnd === true) {
1185
+ continue;
1186
+ }
1187
+ break;
1188
+ }
1189
+
1190
+ if (code === CHAR_QUESTION_MARK) {
1191
+ isGlob = token.isGlob = true;
1192
+ finished = true;
1193
+
1194
+ if (scanToEnd === true) {
1195
+ continue;
1196
+ }
1197
+ break;
1198
+ }
1199
+
1200
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
1201
+ while (eos() !== true && (next = advance())) {
1202
+ if (next === CHAR_BACKWARD_SLASH) {
1203
+ backslashes = token.backslashes = true;
1204
+ advance();
1205
+ continue;
1206
+ }
1207
+
1208
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
1209
+ isBracket = token.isBracket = true;
1210
+ isGlob = token.isGlob = true;
1211
+ finished = true;
1212
+ break;
1213
+ }
1214
+ }
1215
+
1216
+ if (scanToEnd === true) {
1217
+ continue;
1218
+ }
1219
+
1220
+ break;
1221
+ }
1222
+
1223
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
1224
+ negated = token.negated = true;
1225
+ start++;
1226
+ continue;
1227
+ }
1228
+
1229
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
1230
+ isGlob = token.isGlob = true;
1231
+
1232
+ if (scanToEnd === true) {
1233
+ while (eos() !== true && (code = advance())) {
1234
+ if (code === CHAR_LEFT_PARENTHESES) {
1235
+ backslashes = token.backslashes = true;
1236
+ code = advance();
1237
+ continue;
1238
+ }
1239
+
1240
+ if (code === CHAR_RIGHT_PARENTHESES) {
1241
+ finished = true;
1242
+ break;
1243
+ }
1244
+ }
1245
+ continue;
1246
+ }
1247
+ break;
1248
+ }
1249
+
1250
+ if (isGlob === true) {
1251
+ finished = true;
1252
+
1253
+ if (scanToEnd === true) {
1254
+ continue;
1255
+ }
1256
+
1257
+ break;
1258
+ }
1259
+ }
1260
+
1261
+ if (opts.noext === true) {
1262
+ isExtglob = false;
1263
+ isGlob = false;
1264
+ }
1265
+
1266
+ let base = str;
1267
+ let prefix = '';
1268
+ let glob = '';
1269
+
1270
+ if (start > 0) {
1271
+ prefix = str.slice(0, start);
1272
+ str = str.slice(start);
1273
+ lastIndex -= start;
1274
+ }
1275
+
1276
+ if (base && isGlob === true && lastIndex > 0) {
1277
+ base = str.slice(0, lastIndex);
1278
+ glob = str.slice(lastIndex);
1279
+ } else if (isGlob === true) {
1280
+ base = '';
1281
+ glob = str;
1282
+ } else {
1283
+ base = str;
1284
+ }
1285
+
1286
+ if (base && base !== '' && base !== '/' && base !== str) {
1287
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
1288
+ base = base.slice(0, -1);
1289
+ }
1290
+ }
1291
+
1292
+ if (opts.unescape === true) {
1293
+ if (glob) glob = utils.removeBackslashes(glob);
1294
+
1295
+ if (base && backslashes === true) {
1296
+ base = utils.removeBackslashes(base);
1297
+ }
1298
+ }
1299
+
1300
+ const state = {
1301
+ prefix,
1302
+ input,
1303
+ start,
1304
+ base,
1305
+ glob,
1306
+ isBrace,
1307
+ isBracket,
1308
+ isGlob,
1309
+ isExtglob,
1310
+ isGlobstar,
1311
+ negated,
1312
+ negatedExtglob
1313
+ };
1314
+
1315
+ if (opts.tokens === true) {
1316
+ state.maxDepth = 0;
1317
+ if (!isPathSeparator(code)) {
1318
+ tokens.push(token);
1319
+ }
1320
+ state.tokens = tokens;
1321
+ }
1322
+
1323
+ if (opts.parts === true || opts.tokens === true) {
1324
+ let prevIndex;
1325
+
1326
+ for (let idx = 0; idx < slashes.length; idx++) {
1327
+ const n = prevIndex ? prevIndex + 1 : start;
1328
+ const i = slashes[idx];
1329
+ const value = input.slice(n, i);
1330
+ if (opts.tokens) {
1331
+ if (idx === 0 && start !== 0) {
1332
+ tokens[idx].isPrefix = true;
1333
+ tokens[idx].value = prefix;
1334
+ } else {
1335
+ tokens[idx].value = value;
1336
+ }
1337
+ depth(tokens[idx]);
1338
+ state.maxDepth += tokens[idx].depth;
1339
+ }
1340
+ if (idx !== 0 || value !== '') {
1341
+ parts.push(value);
1342
+ }
1343
+ prevIndex = i;
1344
+ }
1345
+
1346
+ if (prevIndex && prevIndex + 1 < input.length) {
1347
+ const value = input.slice(prevIndex + 1);
1348
+ parts.push(value);
1349
+
1350
+ if (opts.tokens) {
1351
+ tokens[tokens.length - 1].value = value;
1352
+ depth(tokens[tokens.length - 1]);
1353
+ state.maxDepth += tokens[tokens.length - 1].depth;
1354
+ }
1355
+ }
1356
+
1357
+ state.slashes = slashes;
1358
+ state.parts = parts;
1359
+ }
1360
+
1361
+ return state;
1362
+ };
1363
+
1364
+ scan_1 = scan;
1365
+ return scan_1;
1366
+ }
1367
+
1368
+ var parse_1;
1369
+ var hasRequiredParse;
1370
+
1371
+ function requireParse () {
1372
+ if (hasRequiredParse) return parse_1;
1373
+ hasRequiredParse = 1;
1374
+
1375
+ const constants = /*@__PURE__*/ requireConstants();
1376
+ const utils = /*@__PURE__*/ requireUtils();
1377
+
1378
+ /**
1379
+ * Constants
1380
+ */
1381
+
1382
+ const {
1383
+ MAX_LENGTH,
1384
+ POSIX_REGEX_SOURCE,
1385
+ REGEX_NON_SPECIAL_CHARS,
1386
+ REGEX_SPECIAL_CHARS_BACKREF,
1387
+ REPLACEMENTS
1388
+ } = constants;
1389
+
1390
+ /**
1391
+ * Helpers
1392
+ */
1393
+
1394
+ const expandRange = (args, options) => {
1395
+ if (typeof options.expandRange === 'function') {
1396
+ return options.expandRange(...args, options);
1397
+ }
1398
+
1399
+ args.sort();
1400
+ const value = `[${args.join('-')}]`;
1401
+
1402
+ try {
1403
+ /* eslint-disable-next-line no-new */
1404
+ new RegExp(value);
1405
+ } catch (ex) {
1406
+ return args.map(v => utils.escapeRegex(v)).join('..');
1407
+ }
1408
+
1409
+ return value;
1410
+ };
1411
+
1412
+ /**
1413
+ * Create the message for a syntax error
1414
+ */
1415
+
1416
+ const syntaxError = (type, char) => {
1417
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
1418
+ };
1419
+
1420
+ /**
1421
+ * Parse the given input string.
1422
+ * @param {String} input
1423
+ * @param {Object} options
1424
+ * @return {Object}
1425
+ */
1426
+
1427
+ const parse = (input, options) => {
1428
+ if (typeof input !== 'string') {
1429
+ throw new TypeError('Expected a string');
1430
+ }
1431
+
1432
+ input = REPLACEMENTS[input] || input;
1433
+
1434
+ const opts = { ...options };
1435
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1436
+
1437
+ let len = input.length;
1438
+ if (len > max) {
1439
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1440
+ }
1441
+
1442
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
1443
+ const tokens = [bos];
1444
+
1445
+ const capture = opts.capture ? '' : '?:';
1446
+
1447
+ // create constants based on platform, for windows or posix
1448
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
1449
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
1450
+
1451
+ const {
1452
+ DOT_LITERAL,
1453
+ PLUS_LITERAL,
1454
+ SLASH_LITERAL,
1455
+ ONE_CHAR,
1456
+ DOTS_SLASH,
1457
+ NO_DOT,
1458
+ NO_DOT_SLASH,
1459
+ NO_DOTS_SLASH,
1460
+ QMARK,
1461
+ QMARK_NO_DOT,
1462
+ STAR,
1463
+ START_ANCHOR
1464
+ } = PLATFORM_CHARS;
1465
+
1466
+ const globstar = opts => {
1467
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1468
+ };
1469
+
1470
+ const nodot = opts.dot ? '' : NO_DOT;
1471
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
1472
+ let star = opts.bash === true ? globstar(opts) : STAR;
1473
+
1474
+ if (opts.capture) {
1475
+ star = `(${star})`;
1476
+ }
1477
+
1478
+ // minimatch options support
1479
+ if (typeof opts.noext === 'boolean') {
1480
+ opts.noextglob = opts.noext;
1481
+ }
1482
+
1483
+ const state = {
1484
+ input,
1485
+ index: -1,
1486
+ start: 0,
1487
+ dot: opts.dot === true,
1488
+ consumed: '',
1489
+ output: '',
1490
+ prefix: '',
1491
+ backtrack: false,
1492
+ negated: false,
1493
+ brackets: 0,
1494
+ braces: 0,
1495
+ parens: 0,
1496
+ quotes: 0,
1497
+ globstar: false,
1498
+ tokens
1499
+ };
1500
+
1501
+ input = utils.removePrefix(input, state);
1502
+ len = input.length;
1503
+
1504
+ const extglobs = [];
1505
+ const braces = [];
1506
+ const stack = [];
1507
+ let prev = bos;
1508
+ let value;
1509
+
1510
+ /**
1511
+ * Tokenizing helpers
1512
+ */
1513
+
1514
+ const eos = () => state.index === len - 1;
1515
+ const peek = state.peek = (n = 1) => input[state.index + n];
1516
+ const advance = state.advance = () => input[++state.index] || '';
1517
+ const remaining = () => input.slice(state.index + 1);
1518
+ const consume = (value = '', num = 0) => {
1519
+ state.consumed += value;
1520
+ state.index += num;
1521
+ };
1522
+
1523
+ const append = token => {
1524
+ state.output += token.output != null ? token.output : token.value;
1525
+ consume(token.value);
1526
+ };
1527
+
1528
+ const negate = () => {
1529
+ let count = 1;
1530
+
1531
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
1532
+ advance();
1533
+ state.start++;
1534
+ count++;
1535
+ }
1536
+
1537
+ if (count % 2 === 0) {
1538
+ return false;
1539
+ }
1540
+
1541
+ state.negated = true;
1542
+ state.start++;
1543
+ return true;
1544
+ };
1545
+
1546
+ const increment = type => {
1547
+ state[type]++;
1548
+ stack.push(type);
1549
+ };
1550
+
1551
+ const decrement = type => {
1552
+ state[type]--;
1553
+ stack.pop();
1554
+ };
1555
+
1556
+ /**
1557
+ * Push tokens onto the tokens array. This helper speeds up
1558
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
1559
+ * and 2) helping us avoid creating extra tokens when consecutive
1560
+ * characters are plain text. This improves performance and simplifies
1561
+ * lookbehinds.
1562
+ */
1563
+
1564
+ const push = tok => {
1565
+ if (prev.type === 'globstar') {
1566
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
1567
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
1568
+
1569
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
1570
+ state.output = state.output.slice(0, -prev.output.length);
1571
+ prev.type = 'star';
1572
+ prev.value = '*';
1573
+ prev.output = star;
1574
+ state.output += prev.output;
1575
+ }
1576
+ }
1577
+
1578
+ if (extglobs.length && tok.type !== 'paren') {
1579
+ extglobs[extglobs.length - 1].inner += tok.value;
1580
+ }
1581
+
1582
+ if (tok.value || tok.output) append(tok);
1583
+ if (prev && prev.type === 'text' && tok.type === 'text') {
1584
+ prev.output = (prev.output || prev.value) + tok.value;
1585
+ prev.value += tok.value;
1586
+ return;
1587
+ }
1588
+
1589
+ tok.prev = prev;
1590
+ tokens.push(tok);
1591
+ prev = tok;
1592
+ };
1593
+
1594
+ const extglobOpen = (type, value) => {
1595
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
1596
+
1597
+ token.prev = prev;
1598
+ token.parens = state.parens;
1599
+ token.output = state.output;
1600
+ const output = (opts.capture ? '(' : '') + token.open;
1601
+
1602
+ increment('parens');
1603
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
1604
+ push({ type: 'paren', extglob: true, value: advance(), output });
1605
+ extglobs.push(token);
1606
+ };
1607
+
1608
+ const extglobClose = token => {
1609
+ let output = token.close + (opts.capture ? ')' : '');
1610
+ let rest;
1611
+
1612
+ if (token.type === 'negate') {
1613
+ let extglobStar = star;
1614
+
1615
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
1616
+ extglobStar = globstar(opts);
1617
+ }
1618
+
1619
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
1620
+ output = token.close = `)$))${extglobStar}`;
1621
+ }
1622
+
1623
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
1624
+ // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
1625
+ // In this case, we need to parse the string and use it in the output of the original pattern.
1626
+ // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
1627
+ //
1628
+ // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
1629
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
1630
+
1631
+ output = token.close = `)${expression})${extglobStar})`;
1632
+ }
1633
+
1634
+ if (token.prev.type === 'bos') {
1635
+ state.negatedExtglob = true;
1636
+ }
1637
+ }
1638
+
1639
+ push({ type: 'paren', extglob: true, value, output });
1640
+ decrement('parens');
1641
+ };
1642
+
1643
+ /**
1644
+ * Fast paths
1645
+ */
1646
+
1647
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
1648
+ let backslashes = false;
1649
+
1650
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
1651
+ if (first === '\\') {
1652
+ backslashes = true;
1653
+ return m;
1654
+ }
1655
+
1656
+ if (first === '?') {
1657
+ if (esc) {
1658
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
1659
+ }
1660
+ if (index === 0) {
1661
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
1662
+ }
1663
+ return QMARK.repeat(chars.length);
1664
+ }
1665
+
1666
+ if (first === '.') {
1667
+ return DOT_LITERAL.repeat(chars.length);
1668
+ }
1669
+
1670
+ if (first === '*') {
1671
+ if (esc) {
1672
+ return esc + first + (rest ? star : '');
1673
+ }
1674
+ return star;
1675
+ }
1676
+ return esc ? m : `\\${m}`;
1677
+ });
1678
+
1679
+ if (backslashes === true) {
1680
+ if (opts.unescape === true) {
1681
+ output = output.replace(/\\/g, '');
1682
+ } else {
1683
+ output = output.replace(/\\+/g, m => {
1684
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
1685
+ });
1686
+ }
1687
+ }
1688
+
1689
+ if (output === input && opts.contains === true) {
1690
+ state.output = input;
1691
+ return state;
1692
+ }
1693
+
1694
+ state.output = utils.wrapOutput(output, state, options);
1695
+ return state;
1696
+ }
1697
+
1698
+ /**
1699
+ * Tokenize input until we reach end-of-string
1700
+ */
1701
+
1702
+ while (!eos()) {
1703
+ value = advance();
1704
+
1705
+ if (value === '\u0000') {
1706
+ continue;
1707
+ }
1708
+
1709
+ /**
1710
+ * Escaped characters
1711
+ */
1712
+
1713
+ if (value === '\\') {
1714
+ const next = peek();
1715
+
1716
+ if (next === '/' && opts.bash !== true) {
1717
+ continue;
1718
+ }
1719
+
1720
+ if (next === '.' || next === ';') {
1721
+ continue;
1722
+ }
1723
+
1724
+ if (!next) {
1725
+ value += '\\';
1726
+ push({ type: 'text', value });
1727
+ continue;
1728
+ }
1729
+
1730
+ // collapse slashes to reduce potential for exploits
1731
+ const match = /^\\+/.exec(remaining());
1732
+ let slashes = 0;
1733
+
1734
+ if (match && match[0].length > 2) {
1735
+ slashes = match[0].length;
1736
+ state.index += slashes;
1737
+ if (slashes % 2 !== 0) {
1738
+ value += '\\';
1739
+ }
1740
+ }
1741
+
1742
+ if (opts.unescape === true) {
1743
+ value = advance();
1744
+ } else {
1745
+ value += advance();
1746
+ }
1747
+
1748
+ if (state.brackets === 0) {
1749
+ push({ type: 'text', value });
1750
+ continue;
1751
+ }
1752
+ }
1753
+
1754
+ /**
1755
+ * If we're inside a regex character class, continue
1756
+ * until we reach the closing bracket.
1757
+ */
1758
+
1759
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
1760
+ if (opts.posix !== false && value === ':') {
1761
+ const inner = prev.value.slice(1);
1762
+ if (inner.includes('[')) {
1763
+ prev.posix = true;
1764
+
1765
+ if (inner.includes(':')) {
1766
+ const idx = prev.value.lastIndexOf('[');
1767
+ const pre = prev.value.slice(0, idx);
1768
+ const rest = prev.value.slice(idx + 2);
1769
+ const posix = POSIX_REGEX_SOURCE[rest];
1770
+ if (posix) {
1771
+ prev.value = pre + posix;
1772
+ state.backtrack = true;
1773
+ advance();
1774
+
1775
+ if (!bos.output && tokens.indexOf(prev) === 1) {
1776
+ bos.output = ONE_CHAR;
1777
+ }
1778
+ continue;
1779
+ }
1780
+ }
1781
+ }
1782
+ }
1783
+
1784
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
1785
+ value = `\\${value}`;
1786
+ }
1787
+
1788
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
1789
+ value = `\\${value}`;
1790
+ }
1791
+
1792
+ if (opts.posix === true && value === '!' && prev.value === '[') {
1793
+ value = '^';
1794
+ }
1795
+
1796
+ prev.value += value;
1797
+ append({ value });
1798
+ continue;
1799
+ }
1800
+
1801
+ /**
1802
+ * If we're inside a quoted string, continue
1803
+ * until we reach the closing double quote.
1804
+ */
1805
+
1806
+ if (state.quotes === 1 && value !== '"') {
1807
+ value = utils.escapeRegex(value);
1808
+ prev.value += value;
1809
+ append({ value });
1810
+ continue;
1811
+ }
1812
+
1813
+ /**
1814
+ * Double quotes
1815
+ */
1816
+
1817
+ if (value === '"') {
1818
+ state.quotes = state.quotes === 1 ? 0 : 1;
1819
+ if (opts.keepQuotes === true) {
1820
+ push({ type: 'text', value });
1821
+ }
1822
+ continue;
1823
+ }
1824
+
1825
+ /**
1826
+ * Parentheses
1827
+ */
1828
+
1829
+ if (value === '(') {
1830
+ increment('parens');
1831
+ push({ type: 'paren', value });
1832
+ continue;
1833
+ }
1834
+
1835
+ if (value === ')') {
1836
+ if (state.parens === 0 && opts.strictBrackets === true) {
1837
+ throw new SyntaxError(syntaxError('opening', '('));
1838
+ }
1839
+
1840
+ const extglob = extglobs[extglobs.length - 1];
1841
+ if (extglob && state.parens === extglob.parens + 1) {
1842
+ extglobClose(extglobs.pop());
1843
+ continue;
1844
+ }
1845
+
1846
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
1847
+ decrement('parens');
1848
+ continue;
1849
+ }
1850
+
1851
+ /**
1852
+ * Square brackets
1853
+ */
1854
+
1855
+ if (value === '[') {
1856
+ if (opts.nobracket === true || !remaining().includes(']')) {
1857
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
1858
+ throw new SyntaxError(syntaxError('closing', ']'));
1859
+ }
1860
+
1861
+ value = `\\${value}`;
1862
+ } else {
1863
+ increment('brackets');
1864
+ }
1865
+
1866
+ push({ type: 'bracket', value });
1867
+ continue;
1868
+ }
1869
+
1870
+ if (value === ']') {
1871
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
1872
+ push({ type: 'text', value, output: `\\${value}` });
1873
+ continue;
1874
+ }
1875
+
1876
+ if (state.brackets === 0) {
1877
+ if (opts.strictBrackets === true) {
1878
+ throw new SyntaxError(syntaxError('opening', '['));
1879
+ }
1880
+
1881
+ push({ type: 'text', value, output: `\\${value}` });
1882
+ continue;
1883
+ }
1884
+
1885
+ decrement('brackets');
1886
+
1887
+ const prevValue = prev.value.slice(1);
1888
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
1889
+ value = `/${value}`;
1890
+ }
1891
+
1892
+ prev.value += value;
1893
+ append({ value });
1894
+
1895
+ // when literal brackets are explicitly disabled
1896
+ // assume we should match with a regex character class
1897
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
1898
+ continue;
1899
+ }
1900
+
1901
+ const escaped = utils.escapeRegex(prev.value);
1902
+ state.output = state.output.slice(0, -prev.value.length);
1903
+
1904
+ // when literal brackets are explicitly enabled
1905
+ // assume we should escape the brackets to match literal characters
1906
+ if (opts.literalBrackets === true) {
1907
+ state.output += escaped;
1908
+ prev.value = escaped;
1909
+ continue;
1910
+ }
1911
+
1912
+ // when the user specifies nothing, try to match both
1913
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1914
+ state.output += prev.value;
1915
+ continue;
1916
+ }
1917
+
1918
+ /**
1919
+ * Braces
1920
+ */
1921
+
1922
+ if (value === '{' && opts.nobrace !== true) {
1923
+ increment('braces');
1924
+
1925
+ const open = {
1926
+ type: 'brace',
1927
+ value,
1928
+ output: '(',
1929
+ outputIndex: state.output.length,
1930
+ tokensIndex: state.tokens.length
1931
+ };
1932
+
1933
+ braces.push(open);
1934
+ push(open);
1935
+ continue;
1936
+ }
1937
+
1938
+ if (value === '}') {
1939
+ const brace = braces[braces.length - 1];
1940
+
1941
+ if (opts.nobrace === true || !brace) {
1942
+ push({ type: 'text', value, output: value });
1943
+ continue;
1944
+ }
1945
+
1946
+ let output = ')';
1947
+
1948
+ if (brace.dots === true) {
1949
+ const arr = tokens.slice();
1950
+ const range = [];
1951
+
1952
+ for (let i = arr.length - 1; i >= 0; i--) {
1953
+ tokens.pop();
1954
+ if (arr[i].type === 'brace') {
1955
+ break;
1956
+ }
1957
+ if (arr[i].type !== 'dots') {
1958
+ range.unshift(arr[i].value);
1959
+ }
1960
+ }
1961
+
1962
+ output = expandRange(range, opts);
1963
+ state.backtrack = true;
1964
+ }
1965
+
1966
+ if (brace.comma !== true && brace.dots !== true) {
1967
+ const out = state.output.slice(0, brace.outputIndex);
1968
+ const toks = state.tokens.slice(brace.tokensIndex);
1969
+ brace.value = brace.output = '\\{';
1970
+ value = output = '\\}';
1971
+ state.output = out;
1972
+ for (const t of toks) {
1973
+ state.output += (t.output || t.value);
1974
+ }
1975
+ }
1976
+
1977
+ push({ type: 'brace', value, output });
1978
+ decrement('braces');
1979
+ braces.pop();
1980
+ continue;
1981
+ }
1982
+
1983
+ /**
1984
+ * Pipes
1985
+ */
1986
+
1987
+ if (value === '|') {
1988
+ if (extglobs.length > 0) {
1989
+ extglobs[extglobs.length - 1].conditions++;
1990
+ }
1991
+ push({ type: 'text', value });
1992
+ continue;
1993
+ }
1994
+
1995
+ /**
1996
+ * Commas
1997
+ */
1998
+
1999
+ if (value === ',') {
2000
+ let output = value;
2001
+
2002
+ const brace = braces[braces.length - 1];
2003
+ if (brace && stack[stack.length - 1] === 'braces') {
2004
+ brace.comma = true;
2005
+ output = '|';
2006
+ }
2007
+
2008
+ push({ type: 'comma', value, output });
2009
+ continue;
2010
+ }
2011
+
2012
+ /**
2013
+ * Slashes
2014
+ */
2015
+
2016
+ if (value === '/') {
2017
+ // if the beginning of the glob is "./", advance the start
2018
+ // to the current index, and don't add the "./" characters
2019
+ // to the state. This greatly simplifies lookbehinds when
2020
+ // checking for BOS characters like "!" and "." (not "./")
2021
+ if (prev.type === 'dot' && state.index === state.start + 1) {
2022
+ state.start = state.index + 1;
2023
+ state.consumed = '';
2024
+ state.output = '';
2025
+ tokens.pop();
2026
+ prev = bos; // reset "prev" to the first token
2027
+ continue;
2028
+ }
2029
+
2030
+ push({ type: 'slash', value, output: SLASH_LITERAL });
2031
+ continue;
2032
+ }
2033
+
2034
+ /**
2035
+ * Dots
2036
+ */
2037
+
2038
+ if (value === '.') {
2039
+ if (state.braces > 0 && prev.type === 'dot') {
2040
+ if (prev.value === '.') prev.output = DOT_LITERAL;
2041
+ const brace = braces[braces.length - 1];
2042
+ prev.type = 'dots';
2043
+ prev.output += value;
2044
+ prev.value += value;
2045
+ brace.dots = true;
2046
+ continue;
2047
+ }
2048
+
2049
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
2050
+ push({ type: 'text', value, output: DOT_LITERAL });
2051
+ continue;
2052
+ }
2053
+
2054
+ push({ type: 'dot', value, output: DOT_LITERAL });
2055
+ continue;
2056
+ }
2057
+
2058
+ /**
2059
+ * Question marks
2060
+ */
2061
+
2062
+ if (value === '?') {
2063
+ const isGroup = prev && prev.value === '(';
2064
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
2065
+ extglobOpen('qmark', value);
2066
+ continue;
2067
+ }
2068
+
2069
+ if (prev && prev.type === 'paren') {
2070
+ const next = peek();
2071
+ let output = value;
2072
+
2073
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
2074
+ output = `\\${value}`;
2075
+ }
2076
+
2077
+ push({ type: 'text', value, output });
2078
+ continue;
2079
+ }
2080
+
2081
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
2082
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
2083
+ continue;
2084
+ }
2085
+
2086
+ push({ type: 'qmark', value, output: QMARK });
2087
+ continue;
2088
+ }
2089
+
2090
+ /**
2091
+ * Exclamation
2092
+ */
2093
+
2094
+ if (value === '!') {
2095
+ if (opts.noextglob !== true && peek() === '(') {
2096
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
2097
+ extglobOpen('negate', value);
2098
+ continue;
2099
+ }
2100
+ }
2101
+
2102
+ if (opts.nonegate !== true && state.index === 0) {
2103
+ negate();
2104
+ continue;
2105
+ }
2106
+ }
2107
+
2108
+ /**
2109
+ * Plus
2110
+ */
2111
+
2112
+ if (value === '+') {
2113
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
2114
+ extglobOpen('plus', value);
2115
+ continue;
2116
+ }
2117
+
2118
+ if ((prev && prev.value === '(') || opts.regex === false) {
2119
+ push({ type: 'plus', value, output: PLUS_LITERAL });
2120
+ continue;
2121
+ }
2122
+
2123
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
2124
+ push({ type: 'plus', value });
2125
+ continue;
2126
+ }
2127
+
2128
+ push({ type: 'plus', value: PLUS_LITERAL });
2129
+ continue;
2130
+ }
2131
+
2132
+ /**
2133
+ * Plain text
2134
+ */
2135
+
2136
+ if (value === '@') {
2137
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
2138
+ push({ type: 'at', extglob: true, value, output: '' });
2139
+ continue;
2140
+ }
2141
+
2142
+ push({ type: 'text', value });
2143
+ continue;
2144
+ }
2145
+
2146
+ /**
2147
+ * Plain text
2148
+ */
2149
+
2150
+ if (value !== '*') {
2151
+ if (value === '$' || value === '^') {
2152
+ value = `\\${value}`;
2153
+ }
2154
+
2155
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
2156
+ if (match) {
2157
+ value += match[0];
2158
+ state.index += match[0].length;
2159
+ }
2160
+
2161
+ push({ type: 'text', value });
2162
+ continue;
2163
+ }
2164
+
2165
+ /**
2166
+ * Stars
2167
+ */
2168
+
2169
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
2170
+ prev.type = 'star';
2171
+ prev.star = true;
2172
+ prev.value += value;
2173
+ prev.output = star;
2174
+ state.backtrack = true;
2175
+ state.globstar = true;
2176
+ consume(value);
2177
+ continue;
2178
+ }
2179
+
2180
+ let rest = remaining();
2181
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
2182
+ extglobOpen('star', value);
2183
+ continue;
2184
+ }
2185
+
2186
+ if (prev.type === 'star') {
2187
+ if (opts.noglobstar === true) {
2188
+ consume(value);
2189
+ continue;
2190
+ }
2191
+
2192
+ const prior = prev.prev;
2193
+ const before = prior.prev;
2194
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
2195
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
2196
+
2197
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
2198
+ push({ type: 'star', value, output: '' });
2199
+ continue;
2200
+ }
2201
+
2202
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
2203
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
2204
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
2205
+ push({ type: 'star', value, output: '' });
2206
+ continue;
2207
+ }
2208
+
2209
+ // strip consecutive `/**/`
2210
+ while (rest.slice(0, 3) === '/**') {
2211
+ const after = input[state.index + 4];
2212
+ if (after && after !== '/') {
2213
+ break;
2214
+ }
2215
+ rest = rest.slice(3);
2216
+ consume('/**', 3);
2217
+ }
2218
+
2219
+ if (prior.type === 'bos' && eos()) {
2220
+ prev.type = 'globstar';
2221
+ prev.value += value;
2222
+ prev.output = globstar(opts);
2223
+ state.output = prev.output;
2224
+ state.globstar = true;
2225
+ consume(value);
2226
+ continue;
2227
+ }
2228
+
2229
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
2230
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
2231
+ prior.output = `(?:${prior.output}`;
2232
+
2233
+ prev.type = 'globstar';
2234
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
2235
+ prev.value += value;
2236
+ state.globstar = true;
2237
+ state.output += prior.output + prev.output;
2238
+ consume(value);
2239
+ continue;
2240
+ }
2241
+
2242
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
2243
+ const end = rest[1] !== void 0 ? '|$' : '';
2244
+
2245
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
2246
+ prior.output = `(?:${prior.output}`;
2247
+
2248
+ prev.type = 'globstar';
2249
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
2250
+ prev.value += value;
2251
+
2252
+ state.output += prior.output + prev.output;
2253
+ state.globstar = true;
2254
+
2255
+ consume(value + advance());
2256
+
2257
+ push({ type: 'slash', value: '/', output: '' });
2258
+ continue;
2259
+ }
2260
+
2261
+ if (prior.type === 'bos' && rest[0] === '/') {
2262
+ prev.type = 'globstar';
2263
+ prev.value += value;
2264
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
2265
+ state.output = prev.output;
2266
+ state.globstar = true;
2267
+ consume(value + advance());
2268
+ push({ type: 'slash', value: '/', output: '' });
2269
+ continue;
2270
+ }
2271
+
2272
+ // remove single star from output
2273
+ state.output = state.output.slice(0, -prev.output.length);
2274
+
2275
+ // reset previous token to globstar
2276
+ prev.type = 'globstar';
2277
+ prev.output = globstar(opts);
2278
+ prev.value += value;
2279
+
2280
+ // reset output with globstar
2281
+ state.output += prev.output;
2282
+ state.globstar = true;
2283
+ consume(value);
2284
+ continue;
2285
+ }
2286
+
2287
+ const token = { type: 'star', value, output: star };
2288
+
2289
+ if (opts.bash === true) {
2290
+ token.output = '.*?';
2291
+ if (prev.type === 'bos' || prev.type === 'slash') {
2292
+ token.output = nodot + token.output;
2293
+ }
2294
+ push(token);
2295
+ continue;
2296
+ }
2297
+
2298
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
2299
+ token.output = value;
2300
+ push(token);
2301
+ continue;
2302
+ }
2303
+
2304
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
2305
+ if (prev.type === 'dot') {
2306
+ state.output += NO_DOT_SLASH;
2307
+ prev.output += NO_DOT_SLASH;
2308
+
2309
+ } else if (opts.dot === true) {
2310
+ state.output += NO_DOTS_SLASH;
2311
+ prev.output += NO_DOTS_SLASH;
2312
+
2313
+ } else {
2314
+ state.output += nodot;
2315
+ prev.output += nodot;
2316
+ }
2317
+
2318
+ if (peek() !== '*') {
2319
+ state.output += ONE_CHAR;
2320
+ prev.output += ONE_CHAR;
2321
+ }
2322
+ }
2323
+
2324
+ push(token);
2325
+ }
2326
+
2327
+ while (state.brackets > 0) {
2328
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
2329
+ state.output = utils.escapeLast(state.output, '[');
2330
+ decrement('brackets');
2331
+ }
2332
+
2333
+ while (state.parens > 0) {
2334
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
2335
+ state.output = utils.escapeLast(state.output, '(');
2336
+ decrement('parens');
2337
+ }
2338
+
2339
+ while (state.braces > 0) {
2340
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
2341
+ state.output = utils.escapeLast(state.output, '{');
2342
+ decrement('braces');
2343
+ }
2344
+
2345
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
2346
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
2347
+ }
2348
+
2349
+ // rebuild the output if we had to backtrack at any point
2350
+ if (state.backtrack === true) {
2351
+ state.output = '';
2352
+
2353
+ for (const token of state.tokens) {
2354
+ state.output += token.output != null ? token.output : token.value;
2355
+
2356
+ if (token.suffix) {
2357
+ state.output += token.suffix;
2358
+ }
2359
+ }
2360
+ }
2361
+
2362
+ return state;
2363
+ };
2364
+
2365
+ /**
2366
+ * Fast paths for creating regular expressions for common glob patterns.
2367
+ * This can significantly speed up processing and has very little downside
2368
+ * impact when none of the fast paths match.
2369
+ */
2370
+
2371
+ parse.fastpaths = (input, options) => {
2372
+ const opts = { ...options };
2373
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2374
+ const len = input.length;
2375
+ if (len > max) {
2376
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
2377
+ }
2378
+
2379
+ input = REPLACEMENTS[input] || input;
2380
+
2381
+ // create constants based on platform, for windows or posix
2382
+ const {
2383
+ DOT_LITERAL,
2384
+ SLASH_LITERAL,
2385
+ ONE_CHAR,
2386
+ DOTS_SLASH,
2387
+ NO_DOT,
2388
+ NO_DOTS,
2389
+ NO_DOTS_SLASH,
2390
+ STAR,
2391
+ START_ANCHOR
2392
+ } = constants.globChars(opts.windows);
2393
+
2394
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
2395
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
2396
+ const capture = opts.capture ? '' : '?:';
2397
+ const state = { negated: false, prefix: '' };
2398
+ let star = opts.bash === true ? '.*?' : STAR;
2399
+
2400
+ if (opts.capture) {
2401
+ star = `(${star})`;
2402
+ }
2403
+
2404
+ const globstar = opts => {
2405
+ if (opts.noglobstar === true) return star;
2406
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
2407
+ };
2408
+
2409
+ const create = str => {
2410
+ switch (str) {
2411
+ case '*':
2412
+ return `${nodot}${ONE_CHAR}${star}`;
2413
+
2414
+ case '.*':
2415
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
2416
+
2417
+ case '*.*':
2418
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2419
+
2420
+ case '*/*':
2421
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
2422
+
2423
+ case '**':
2424
+ return nodot + globstar(opts);
2425
+
2426
+ case '**/*':
2427
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
2428
+
2429
+ case '**/*.*':
2430
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
2431
+
2432
+ case '**/.*':
2433
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
2434
+
2435
+ default: {
2436
+ const match = /^(.*?)\.(\w+)$/.exec(str);
2437
+ if (!match) return;
2438
+
2439
+ const source = create(match[1]);
2440
+ if (!source) return;
2441
+
2442
+ return source + DOT_LITERAL + match[2];
2443
+ }
2444
+ }
2445
+ };
2446
+
2447
+ const output = utils.removePrefix(input, state);
2448
+ let source = create(output);
2449
+
2450
+ if (source && opts.strictSlashes !== true) {
2451
+ source += `${SLASH_LITERAL}?`;
2452
+ }
2453
+
2454
+ return source;
2455
+ };
2456
+
2457
+ parse_1 = parse;
2458
+ return parse_1;
2459
+ }
2460
+
2461
+ var picomatch_1$1;
2462
+ var hasRequiredPicomatch$1;
2463
+
2464
+ function requirePicomatch$1 () {
2465
+ if (hasRequiredPicomatch$1) return picomatch_1$1;
2466
+ hasRequiredPicomatch$1 = 1;
2467
+
2468
+ const scan = /*@__PURE__*/ requireScan();
2469
+ const parse = /*@__PURE__*/ requireParse();
2470
+ const utils = /*@__PURE__*/ requireUtils();
2471
+ const constants = /*@__PURE__*/ requireConstants();
2472
+ const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
2473
+
2474
+ /**
2475
+ * Creates a matcher function from one or more glob patterns. The
2476
+ * returned function takes a string to match as its first argument,
2477
+ * and returns true if the string is a match. The returned matcher
2478
+ * function also takes a boolean as the second argument that, when true,
2479
+ * returns an object with additional information.
2480
+ *
2481
+ * ```js
2482
+ * const picomatch = require('picomatch');
2483
+ * // picomatch(glob[, options]);
2484
+ *
2485
+ * const isMatch = picomatch('*.!(*a)');
2486
+ * console.log(isMatch('a.a')); //=> false
2487
+ * console.log(isMatch('a.b')); //=> true
2488
+ * ```
2489
+ * @name picomatch
2490
+ * @param {String|Array} `globs` One or more glob patterns.
2491
+ * @param {Object=} `options`
2492
+ * @return {Function=} Returns a matcher function.
2493
+ * @api public
2494
+ */
2495
+
2496
+ const picomatch = (glob, options, returnState = false) => {
2497
+ if (Array.isArray(glob)) {
2498
+ const fns = glob.map(input => picomatch(input, options, returnState));
2499
+ const arrayMatcher = str => {
2500
+ for (const isMatch of fns) {
2501
+ const state = isMatch(str);
2502
+ if (state) return state;
2503
+ }
2504
+ return false;
2505
+ };
2506
+ return arrayMatcher;
2507
+ }
2508
+
2509
+ const isState = isObject(glob) && glob.tokens && glob.input;
2510
+
2511
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
2512
+ throw new TypeError('Expected pattern to be a non-empty string');
2513
+ }
2514
+
2515
+ const opts = options || {};
2516
+ const posix = opts.windows;
2517
+ const regex = isState
2518
+ ? picomatch.compileRe(glob, options)
2519
+ : picomatch.makeRe(glob, options, false, true);
2520
+
2521
+ const state = regex.state;
2522
+ delete regex.state;
2523
+
2524
+ let isIgnored = () => false;
2525
+ if (opts.ignore) {
2526
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
2527
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
2528
+ }
2529
+
2530
+ const matcher = (input, returnObject = false) => {
2531
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
2532
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
2533
+
2534
+ if (typeof opts.onResult === 'function') {
2535
+ opts.onResult(result);
2536
+ }
2537
+
2538
+ if (isMatch === false) {
2539
+ result.isMatch = false;
2540
+ return returnObject ? result : false;
2541
+ }
2542
+
2543
+ if (isIgnored(input)) {
2544
+ if (typeof opts.onIgnore === 'function') {
2545
+ opts.onIgnore(result);
2546
+ }
2547
+ result.isMatch = false;
2548
+ return returnObject ? result : false;
2549
+ }
2550
+
2551
+ if (typeof opts.onMatch === 'function') {
2552
+ opts.onMatch(result);
2553
+ }
2554
+ return returnObject ? result : true;
2555
+ };
2556
+
2557
+ if (returnState) {
2558
+ matcher.state = state;
2559
+ }
2560
+
2561
+ return matcher;
2562
+ };
2563
+
2564
+ /**
2565
+ * Test `input` with the given `regex`. This is used by the main
2566
+ * `picomatch()` function to test the input string.
2567
+ *
2568
+ * ```js
2569
+ * const picomatch = require('picomatch');
2570
+ * // picomatch.test(input, regex[, options]);
2571
+ *
2572
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
2573
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
2574
+ * ```
2575
+ * @param {String} `input` String to test.
2576
+ * @param {RegExp} `regex`
2577
+ * @return {Object} Returns an object with matching info.
2578
+ * @api public
2579
+ */
2580
+
2581
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
2582
+ if (typeof input !== 'string') {
2583
+ throw new TypeError('Expected input to be a string');
2584
+ }
2585
+
2586
+ if (input === '') {
2587
+ return { isMatch: false, output: '' };
2588
+ }
2589
+
2590
+ const opts = options || {};
2591
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
2592
+ let match = input === glob;
2593
+ let output = (match && format) ? format(input) : input;
2594
+
2595
+ if (match === false) {
2596
+ output = format ? format(input) : input;
2597
+ match = output === glob;
2598
+ }
2599
+
2600
+ if (match === false || opts.capture === true) {
2601
+ if (opts.matchBase === true || opts.basename === true) {
2602
+ match = picomatch.matchBase(input, regex, options, posix);
2603
+ } else {
2604
+ match = regex.exec(output);
2605
+ }
2606
+ }
2607
+
2608
+ return { isMatch: Boolean(match), match, output };
2609
+ };
2610
+
2611
+ /**
2612
+ * Match the basename of a filepath.
2613
+ *
2614
+ * ```js
2615
+ * const picomatch = require('picomatch');
2616
+ * // picomatch.matchBase(input, glob[, options]);
2617
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
2618
+ * ```
2619
+ * @param {String} `input` String to test.
2620
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
2621
+ * @return {Boolean}
2622
+ * @api public
2623
+ */
2624
+
2625
+ picomatch.matchBase = (input, glob, options) => {
2626
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
2627
+ return regex.test(utils.basename(input));
2628
+ };
2629
+
2630
+ /**
2631
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
2632
+ *
2633
+ * ```js
2634
+ * const picomatch = require('picomatch');
2635
+ * // picomatch.isMatch(string, patterns[, options]);
2636
+ *
2637
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
2638
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
2639
+ * ```
2640
+ * @param {String|Array} str The string to test.
2641
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
2642
+ * @param {Object} [options] See available [options](#options).
2643
+ * @return {Boolean} Returns true if any patterns match `str`
2644
+ * @api public
2645
+ */
2646
+
2647
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
2648
+
2649
+ /**
2650
+ * Parse a glob pattern to create the source string for a regular
2651
+ * expression.
2652
+ *
2653
+ * ```js
2654
+ * const picomatch = require('picomatch');
2655
+ * const result = picomatch.parse(pattern[, options]);
2656
+ * ```
2657
+ * @param {String} `pattern`
2658
+ * @param {Object} `options`
2659
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
2660
+ * @api public
2661
+ */
2662
+
2663
+ picomatch.parse = (pattern, options) => {
2664
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
2665
+ return parse(pattern, { ...options, fastpaths: false });
2666
+ };
2667
+
2668
+ /**
2669
+ * Scan a glob pattern to separate the pattern into segments.
2670
+ *
2671
+ * ```js
2672
+ * const picomatch = require('picomatch');
2673
+ * // picomatch.scan(input[, options]);
2674
+ *
2675
+ * const result = picomatch.scan('!./foo/*.js');
2676
+ * console.log(result);
2677
+ * { prefix: '!./',
2678
+ * input: '!./foo/*.js',
2679
+ * start: 3,
2680
+ * base: 'foo',
2681
+ * glob: '*.js',
2682
+ * isBrace: false,
2683
+ * isBracket: false,
2684
+ * isGlob: true,
2685
+ * isExtglob: false,
2686
+ * isGlobstar: false,
2687
+ * negated: true }
2688
+ * ```
2689
+ * @param {String} `input` Glob pattern to scan.
2690
+ * @param {Object} `options`
2691
+ * @return {Object} Returns an object with
2692
+ * @api public
2693
+ */
2694
+
2695
+ picomatch.scan = (input, options) => scan(input, options);
2696
+
2697
+ /**
2698
+ * Compile a regular expression from the `state` object returned by the
2699
+ * [parse()](#parse) method.
2700
+ *
2701
+ * @param {Object} `state`
2702
+ * @param {Object} `options`
2703
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
2704
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
2705
+ * @return {RegExp}
2706
+ * @api public
2707
+ */
2708
+
2709
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
2710
+ if (returnOutput === true) {
2711
+ return state.output;
2712
+ }
2713
+
2714
+ const opts = options || {};
2715
+ const prepend = opts.contains ? '' : '^';
2716
+ const append = opts.contains ? '' : '$';
2717
+
2718
+ let source = `${prepend}(?:${state.output})${append}`;
2719
+ if (state && state.negated === true) {
2720
+ source = `^(?!${source}).*$`;
2721
+ }
2722
+
2723
+ const regex = picomatch.toRegex(source, options);
2724
+ if (returnState === true) {
2725
+ regex.state = state;
2726
+ }
2727
+
2728
+ return regex;
2729
+ };
2730
+
2731
+ /**
2732
+ * Create a regular expression from a parsed glob pattern.
2733
+ *
2734
+ * ```js
2735
+ * const picomatch = require('picomatch');
2736
+ * const state = picomatch.parse('*.js');
2737
+ * // picomatch.compileRe(state[, options]);
2738
+ *
2739
+ * console.log(picomatch.compileRe(state));
2740
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
2741
+ * ```
2742
+ * @param {String} `state` The object returned from the `.parse` method.
2743
+ * @param {Object} `options`
2744
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
2745
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
2746
+ * @return {RegExp} Returns a regex created from the given pattern.
2747
+ * @api public
2748
+ */
2749
+
2750
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2751
+ if (!input || typeof input !== 'string') {
2752
+ throw new TypeError('Expected a non-empty string');
2753
+ }
2754
+
2755
+ let parsed = { negated: false, fastpaths: true };
2756
+
2757
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
2758
+ parsed.output = parse.fastpaths(input, options);
2759
+ }
2760
+
2761
+ if (!parsed.output) {
2762
+ parsed = parse(input, options);
2763
+ }
2764
+
2765
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
2766
+ };
2767
+
2768
+ /**
2769
+ * Create a regular expression from the given regex source string.
2770
+ *
2771
+ * ```js
2772
+ * const picomatch = require('picomatch');
2773
+ * // picomatch.toRegex(source[, options]);
2774
+ *
2775
+ * const { output } = picomatch.parse('*.js');
2776
+ * console.log(picomatch.toRegex(output));
2777
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
2778
+ * ```
2779
+ * @param {String} `source` Regular expression source string.
2780
+ * @param {Object} `options`
2781
+ * @return {RegExp}
2782
+ * @api public
2783
+ */
2784
+
2785
+ picomatch.toRegex = (source, options) => {
2786
+ try {
2787
+ const opts = options || {};
2788
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
2789
+ } catch (err) {
2790
+ if (options && options.debug === true) throw err;
2791
+ return /$^/;
2792
+ }
2793
+ };
2794
+
2795
+ /**
2796
+ * Picomatch constants.
2797
+ * @return {Object}
2798
+ */
2799
+
2800
+ picomatch.constants = constants;
2801
+
2802
+ /**
2803
+ * Expose "picomatch"
2804
+ */
2805
+
2806
+ picomatch_1$1 = picomatch;
2807
+ return picomatch_1$1;
2808
+ }
2809
+
2810
+ var picomatch_1;
2811
+ var hasRequiredPicomatch;
2812
+
2813
+ function requirePicomatch () {
2814
+ if (hasRequiredPicomatch) return picomatch_1;
2815
+ hasRequiredPicomatch = 1;
2816
+
2817
+ const pico = /*@__PURE__*/ requirePicomatch$1();
2818
+ const utils = /*@__PURE__*/ requireUtils();
2819
+
2820
+ function picomatch(glob, options, returnState = false) {
2821
+ // default to os.platform()
2822
+ if (options && (options.windows === null || options.windows === undefined)) {
2823
+ // don't mutate the original options object
2824
+ options = { ...options, windows: utils.isWindows() };
2825
+ }
2826
+
2827
+ return pico(glob, options, returnState);
2828
+ }
2829
+
2830
+ Object.assign(picomatch, pico);
2831
+ picomatch_1 = picomatch;
2832
+ return picomatch_1;
2833
+ }
2834
+
2835
+ var picomatchExports = /*@__PURE__*/ requirePicomatch();
2836
+ var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports);
2837
+
2838
+ function isArray(arg) {
2839
+ return Array.isArray(arg);
2840
+ }
2841
+ function ensureArray(thing) {
2842
+ if (isArray(thing))
2843
+ return thing;
2844
+ if (thing == null)
2845
+ return [];
2846
+ return [thing];
2847
+ }
2848
+ const globToTest = (glob) => {
2849
+ const pattern = glob;
2850
+ const fn = pm(pattern, { dot: true });
2851
+ return {
2852
+ test: (what) => {
2853
+ const result = fn(what);
2854
+ return result;
2855
+ },
2856
+ };
2857
+ };
2858
+ const testTrue = {
2859
+ test: () => true,
2860
+ };
2861
+ const getMatcher = (filter) => {
2862
+ const bundleTest = "bundle" in filter && filter.bundle != null ? globToTest(filter.bundle) : testTrue;
2863
+ const fileTest = "file" in filter && filter.file != null ? globToTest(filter.file) : testTrue;
2864
+ return { bundleTest, fileTest };
2865
+ };
2866
+ const createFilter = (include, exclude) => {
2867
+ const includeMatchers = ensureArray(include).map(getMatcher);
2868
+ const excludeMatchers = ensureArray(exclude).map(getMatcher);
2869
+ return (bundleId, id) => {
2870
+ for (let i = 0; i < excludeMatchers.length; ++i) {
2871
+ const { bundleTest, fileTest } = excludeMatchers[i];
2872
+ if (bundleTest.test(bundleId) && fileTest.test(id))
2873
+ return false;
2874
+ }
2875
+ for (let i = 0; i < includeMatchers.length; ++i) {
2876
+ const { bundleTest, fileTest } = includeMatchers[i];
2877
+ if (bundleTest.test(bundleId) && fileTest.test(id))
2878
+ return true;
2879
+ }
2880
+ return !includeMatchers.length;
2881
+ };
2882
+ };
2883
+
2884
+ const throttleFilter = (callback, limit) => {
2885
+ let waiting = false;
2886
+ return (val) => {
2887
+ if (!waiting) {
2888
+ callback(val);
2889
+ waiting = true;
2890
+ setTimeout(() => {
2891
+ waiting = false;
2892
+ }, limit);
2893
+ }
2894
+ };
2895
+ };
2896
+ const prepareFilter = (filt) => {
2897
+ if (filt === "")
2898
+ return [];
2899
+ return (filt
2900
+ .split(",")
2901
+ // remove spaces before and after
2902
+ .map((entry) => entry.trim())
2903
+ // unquote "
2904
+ .map((entry) => entry.startsWith('"') && entry.endsWith('"') ? entry.substring(1, entry.length - 1) : entry)
2905
+ // unquote '
2906
+ .map((entry) => entry.startsWith("'") && entry.endsWith("'") ? entry.substring(1, entry.length - 1) : entry)
2907
+ // remove empty strings
2908
+ .filter((entry) => entry)
2909
+ // parse bundle:file
2910
+ .map((entry) => entry.split(":"))
2911
+ // normalize entry just in case
2912
+ .flatMap((entry) => {
2913
+ if (entry.length === 0)
2914
+ return [];
2915
+ let bundle = null;
2916
+ let file = null;
2917
+ if (entry.length === 1 && entry[0]) {
2918
+ file = entry[0];
2919
+ return [{ file, bundle }];
2920
+ }
2921
+ bundle = entry[0] || null;
2922
+ file = entry.slice(1).join(":") || null;
2923
+ return [{ bundle, file }];
2924
+ }));
2925
+ };
2926
+ const useFilter = () => {
2927
+ const [includeFilter, setIncludeFilter] = d("");
2928
+ const [excludeFilter, setExcludeFilter] = d("");
2929
+ const setIncludeFilterTrottled = T(() => throttleFilter(setIncludeFilter, 200), []);
2930
+ const setExcludeFilterTrottled = T(() => throttleFilter(setExcludeFilter, 200), []);
2931
+ const isIncluded = T(() => createFilter(prepareFilter(includeFilter), prepareFilter(excludeFilter)), [includeFilter, excludeFilter]);
2932
+ const getModuleFilterMultiplier = q((bundleId, data) => {
2933
+ return isIncluded(bundleId, data.id) ? 1 : 0;
2934
+ }, [isIncluded]);
2935
+ return {
2936
+ getModuleFilterMultiplier,
2937
+ includeFilter,
2938
+ excludeFilter,
2939
+ setExcludeFilter: setExcludeFilterTrottled,
2940
+ setIncludeFilter: setIncludeFilterTrottled,
2941
+ };
2942
+ };
2943
+
2944
+ function ascending(a, b) {
2945
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
2946
+ }
2947
+
2948
+ function descending(a, b) {
2949
+ return a == null || b == null ? NaN
2950
+ : b < a ? -1
2951
+ : b > a ? 1
2952
+ : b >= a ? 0
2953
+ : NaN;
2954
+ }
2955
+
2956
+ function bisector(f) {
2957
+ let compare1, compare2, delta;
2958
+
2959
+ // If an accessor is specified, promote it to a comparator. In this case we
2960
+ // can test whether the search value is (self-) comparable. We can’t do this
2961
+ // for a comparator (except for specific, known comparators) because we can’t
2962
+ // tell if the comparator is symmetric, and an asymmetric comparator can’t be
2963
+ // used to test whether a single value is comparable.
2964
+ if (f.length !== 2) {
2965
+ compare1 = ascending;
2966
+ compare2 = (d, x) => ascending(f(d), x);
2967
+ delta = (d, x) => f(d) - x;
2968
+ } else {
2969
+ compare1 = f === ascending || f === descending ? f : zero$1;
2970
+ compare2 = f;
2971
+ delta = f;
2972
+ }
2973
+
2974
+ function left(a, x, lo = 0, hi = a.length) {
2975
+ if (lo < hi) {
2976
+ if (compare1(x, x) !== 0) return hi;
2977
+ do {
2978
+ const mid = (lo + hi) >>> 1;
2979
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
2980
+ else hi = mid;
2981
+ } while (lo < hi);
2982
+ }
2983
+ return lo;
2984
+ }
2985
+
2986
+ function right(a, x, lo = 0, hi = a.length) {
2987
+ if (lo < hi) {
2988
+ if (compare1(x, x) !== 0) return hi;
2989
+ do {
2990
+ const mid = (lo + hi) >>> 1;
2991
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
2992
+ else hi = mid;
2993
+ } while (lo < hi);
2994
+ }
2995
+ return lo;
2996
+ }
2997
+
2998
+ function center(a, x, lo = 0, hi = a.length) {
2999
+ const i = left(a, x, lo, hi - 1);
3000
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
3001
+ }
3002
+
3003
+ return {left, center, right};
3004
+ }
3005
+
3006
+ function zero$1() {
3007
+ return 0;
3008
+ }
3009
+
3010
+ function number$1(x) {
3011
+ return x === null ? NaN : +x;
3012
+ }
3013
+
3014
+ const ascendingBisect = bisector(ascending);
3015
+ const bisectRight = ascendingBisect.right;
3016
+ bisector(number$1).center;
3017
+
3018
+ class InternMap extends Map {
3019
+ constructor(entries, key = keyof) {
3020
+ super();
3021
+ Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
3022
+ if (entries != null) for (const [key, value] of entries) this.set(key, value);
3023
+ }
3024
+ get(key) {
3025
+ return super.get(intern_get(this, key));
3026
+ }
3027
+ has(key) {
3028
+ return super.has(intern_get(this, key));
3029
+ }
3030
+ set(key, value) {
3031
+ return super.set(intern_set(this, key), value);
3032
+ }
3033
+ delete(key) {
3034
+ return super.delete(intern_delete(this, key));
3035
+ }
3036
+ }
3037
+
3038
+ function intern_get({_intern, _key}, value) {
3039
+ const key = _key(value);
3040
+ return _intern.has(key) ? _intern.get(key) : value;
3041
+ }
3042
+
3043
+ function intern_set({_intern, _key}, value) {
3044
+ const key = _key(value);
3045
+ if (_intern.has(key)) return _intern.get(key);
3046
+ _intern.set(key, value);
3047
+ return value;
3048
+ }
3049
+
3050
+ function intern_delete({_intern, _key}, value) {
3051
+ const key = _key(value);
3052
+ if (_intern.has(key)) {
3053
+ value = _intern.get(key);
3054
+ _intern.delete(key);
3055
+ }
3056
+ return value;
3057
+ }
3058
+
3059
+ function keyof(value) {
3060
+ return value !== null && typeof value === "object" ? value.valueOf() : value;
3061
+ }
3062
+
3063
+ function identity$2(x) {
3064
+ return x;
3065
+ }
3066
+
3067
+ function group(values, ...keys) {
3068
+ return nest(values, identity$2, identity$2, keys);
3069
+ }
3070
+
3071
+ function nest(values, map, reduce, keys) {
3072
+ return (function regroup(values, i) {
3073
+ if (i >= keys.length) return reduce(values);
3074
+ const groups = new InternMap();
3075
+ const keyof = keys[i++];
3076
+ let index = -1;
3077
+ for (const value of values) {
3078
+ const key = keyof(value, ++index, values);
3079
+ const group = groups.get(key);
3080
+ if (group) group.push(value);
3081
+ else groups.set(key, [value]);
3082
+ }
3083
+ for (const [key, values] of groups) {
3084
+ groups.set(key, regroup(values, i));
3085
+ }
3086
+ return map(groups);
3087
+ })(values, 0);
3088
+ }
3089
+
3090
+ const e10 = Math.sqrt(50),
3091
+ e5 = Math.sqrt(10),
3092
+ e2 = Math.sqrt(2);
3093
+
3094
+ function tickSpec(start, stop, count) {
3095
+ const step = (stop - start) / Math.max(0, count),
3096
+ power = Math.floor(Math.log10(step)),
3097
+ error = step / Math.pow(10, power),
3098
+ factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
3099
+ let i1, i2, inc;
3100
+ if (power < 0) {
3101
+ inc = Math.pow(10, -power) / factor;
3102
+ i1 = Math.round(start * inc);
3103
+ i2 = Math.round(stop * inc);
3104
+ if (i1 / inc < start) ++i1;
3105
+ if (i2 / inc > stop) --i2;
3106
+ inc = -inc;
3107
+ } else {
3108
+ inc = Math.pow(10, power) * factor;
3109
+ i1 = Math.round(start / inc);
3110
+ i2 = Math.round(stop / inc);
3111
+ if (i1 * inc < start) ++i1;
3112
+ if (i2 * inc > stop) --i2;
3113
+ }
3114
+ if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
3115
+ return [i1, i2, inc];
3116
+ }
3117
+
3118
+ function ticks(start, stop, count) {
3119
+ stop = +stop, start = +start, count = +count;
3120
+ if (!(count > 0)) return [];
3121
+ if (start === stop) return [start];
3122
+ const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
3123
+ if (!(i2 >= i1)) return [];
3124
+ const n = i2 - i1 + 1, ticks = new Array(n);
3125
+ if (reverse) {
3126
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
3127
+ else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
3128
+ } else {
3129
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
3130
+ else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
3131
+ }
3132
+ return ticks;
3133
+ }
3134
+
3135
+ function tickIncrement(start, stop, count) {
3136
+ stop = +stop, start = +start, count = +count;
3137
+ return tickSpec(start, stop, count)[2];
3138
+ }
3139
+
3140
+ function tickStep(start, stop, count) {
3141
+ stop = +stop, start = +start, count = +count;
3142
+ const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
3143
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
3144
+ }
3145
+
3146
+ const TOP_PADDING = 20;
3147
+ const PADDING = 2;
3148
+
3149
+ const Node = ({ node, onMouseOver, onClick, selected }) => {
3150
+ const { getModuleColor } = x(StaticContext);
3151
+ const { backgroundColor, fontColor } = getModuleColor(node);
3152
+ const { x0, x1, y1, y0, data, children = null } = node;
3153
+ const textRef = A(null);
3154
+ const textRectRef = A();
3155
+ const width = x1 - x0;
3156
+ const height = y1 - y0;
3157
+ const textProps = {
3158
+ "font-size": "0.7em",
3159
+ "dominant-baseline": "middle",
3160
+ "text-anchor": "middle",
3161
+ x: width / 2,
3162
+ };
3163
+ if (children != null) {
3164
+ textProps.y = (TOP_PADDING + PADDING) / 2;
3165
+ }
3166
+ else {
3167
+ textProps.y = height / 2;
3168
+ }
3169
+ _(() => {
3170
+ if (width == 0 || height == 0 || !textRef.current) {
3171
+ return;
3172
+ }
3173
+ if (textRectRef.current == null) {
3174
+ textRectRef.current = textRef.current.getBoundingClientRect();
3175
+ }
3176
+ let scale = 1;
3177
+ if (children != null) {
3178
+ scale = Math.min((width * 0.9) / textRectRef.current.width, Math.min(height, TOP_PADDING + PADDING) / textRectRef.current.height);
3179
+ scale = Math.min(1, scale);
3180
+ textRef.current.setAttribute("y", String(Math.min(TOP_PADDING + PADDING, height) / 2 / scale));
3181
+ textRef.current.setAttribute("x", String(width / 2 / scale));
3182
+ }
3183
+ else {
3184
+ scale = Math.min((width * 0.9) / textRectRef.current.width, (height * 0.9) / textRectRef.current.height);
3185
+ scale = Math.min(1, scale);
3186
+ textRef.current.setAttribute("y", String(height / 2 / scale));
3187
+ textRef.current.setAttribute("x", String(width / 2 / scale));
3188
+ }
3189
+ textRef.current.setAttribute("transform", `scale(${scale.toFixed(2)})`);
3190
+ }, [children, height, width]);
3191
+ if (width == 0 || height == 0) {
3192
+ return null;
3193
+ }
3194
+ return (u$1("g", { className: "node", transform: `translate(${x0},${y0})`, onClick: (event) => {
3195
+ event.stopPropagation();
3196
+ onClick(node);
3197
+ }, onMouseOver: (event) => {
3198
+ event.stopPropagation();
3199
+ onMouseOver(node);
3200
+ }, children: [u$1("rect", { fill: backgroundColor, rx: 2, ry: 2, width: x1 - x0, height: y1 - y0, stroke: selected ? "#fff" : undefined, "stroke-width": selected ? 2 : undefined }), u$1("text", Object.assign({ ref: textRef, fill: fontColor, onClick: (event) => {
3201
+ var _a;
3202
+ if (((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) !== "") {
3203
+ event.stopPropagation();
3204
+ }
3205
+ } }, textProps, { children: data.name }))] }));
3206
+ };
3207
+
3208
+ const TreeMap = ({ root, onNodeHover, selectedNode, onNodeClick, }) => {
3209
+ const { width, height, getModuleIds } = x(StaticContext);
3210
+ console.time("layering");
3211
+ // this will make groups by height
3212
+ const nestedData = T(() => {
3213
+ const nestedDataMap = group(root.descendants(), (d) => d.height);
3214
+ const nestedData = Array.from(nestedDataMap, ([key, values]) => ({
3215
+ key,
3216
+ values,
3217
+ }));
3218
+ nestedData.sort((a, b) => b.key - a.key);
3219
+ return nestedData;
3220
+ }, [root]);
3221
+ console.timeEnd("layering");
3222
+ return (u$1("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}`, children: nestedData.map(({ key, values }) => {
3223
+ return (u$1("g", { className: "layer", children: values.map((node) => {
3224
+ return (u$1(Node, { node: node, onMouseOver: onNodeHover, selected: selectedNode === node, onClick: onNodeClick }, getModuleIds(node.data).nodeUid.id));
3225
+ }) }, key));
3226
+ }) }));
3227
+ };
3228
+
3229
+ var bytes = {exports: {}};
3230
+
3231
+ /*!
3232
+ * bytes
3233
+ * Copyright(c) 2012-2014 TJ Holowaychuk
3234
+ * Copyright(c) 2015 Jed Watson
3235
+ * MIT Licensed
3236
+ */
3237
+
3238
+ var hasRequiredBytes;
3239
+
3240
+ function requireBytes () {
3241
+ if (hasRequiredBytes) return bytes.exports;
3242
+ hasRequiredBytes = 1;
3243
+
3244
+ /**
3245
+ * Module exports.
3246
+ * @public
3247
+ */
3248
+
3249
+ bytes.exports = bytes$1;
3250
+ bytes.exports.format = format;
3251
+ bytes.exports.parse = parse;
3252
+
3253
+ /**
3254
+ * Module variables.
3255
+ * @private
3256
+ */
3257
+
3258
+ var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
3259
+
3260
+ var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
3261
+
3262
+ var map = {
3263
+ b: 1,
3264
+ kb: 1 << 10,
3265
+ mb: 1 << 20,
3266
+ gb: 1 << 30,
3267
+ tb: Math.pow(1024, 4),
3268
+ pb: Math.pow(1024, 5),
3269
+ };
3270
+
3271
+ var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
3272
+
3273
+ /**
3274
+ * Convert the given value in bytes into a string or parse to string to an integer in bytes.
3275
+ *
3276
+ * @param {string|number} value
3277
+ * @param {{
3278
+ * case: [string],
3279
+ * decimalPlaces: [number]
3280
+ * fixedDecimals: [boolean]
3281
+ * thousandsSeparator: [string]
3282
+ * unitSeparator: [string]
3283
+ * }} [options] bytes options.
3284
+ *
3285
+ * @returns {string|number|null}
3286
+ */
3287
+
3288
+ function bytes$1(value, options) {
3289
+ if (typeof value === 'string') {
3290
+ return parse(value);
3291
+ }
3292
+
3293
+ if (typeof value === 'number') {
3294
+ return format(value, options);
3295
+ }
3296
+
3297
+ return null;
3298
+ }
3299
+
3300
+ /**
3301
+ * Format the given value in bytes into a string.
3302
+ *
3303
+ * If the value is negative, it is kept as such. If it is a float,
3304
+ * it is rounded.
3305
+ *
3306
+ * @param {number} value
3307
+ * @param {object} [options]
3308
+ * @param {number} [options.decimalPlaces=2]
3309
+ * @param {number} [options.fixedDecimals=false]
3310
+ * @param {string} [options.thousandsSeparator=]
3311
+ * @param {string} [options.unit=]
3312
+ * @param {string} [options.unitSeparator=]
3313
+ *
3314
+ * @returns {string|null}
3315
+ * @public
3316
+ */
3317
+
3318
+ function format(value, options) {
3319
+ if (!Number.isFinite(value)) {
3320
+ return null;
3321
+ }
3322
+
3323
+ var mag = Math.abs(value);
3324
+ var thousandsSeparator = (options && options.thousandsSeparator) || '';
3325
+ var unitSeparator = (options && options.unitSeparator) || '';
3326
+ var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
3327
+ var fixedDecimals = Boolean(options && options.fixedDecimals);
3328
+ var unit = (options && options.unit) || '';
3329
+
3330
+ if (!unit || !map[unit.toLowerCase()]) {
3331
+ if (mag >= map.pb) {
3332
+ unit = 'PB';
3333
+ } else if (mag >= map.tb) {
3334
+ unit = 'TB';
3335
+ } else if (mag >= map.gb) {
3336
+ unit = 'GB';
3337
+ } else if (mag >= map.mb) {
3338
+ unit = 'MB';
3339
+ } else if (mag >= map.kb) {
3340
+ unit = 'KB';
3341
+ } else {
3342
+ unit = 'B';
3343
+ }
3344
+ }
3345
+
3346
+ var val = value / map[unit.toLowerCase()];
3347
+ var str = val.toFixed(decimalPlaces);
3348
+
3349
+ if (!fixedDecimals) {
3350
+ str = str.replace(formatDecimalsRegExp, '$1');
3351
+ }
3352
+
3353
+ if (thousandsSeparator) {
3354
+ str = str.split('.').map(function (s, i) {
3355
+ return i === 0
3356
+ ? s.replace(formatThousandsRegExp, thousandsSeparator)
3357
+ : s
3358
+ }).join('.');
3359
+ }
3360
+
3361
+ return str + unitSeparator + unit;
3362
+ }
3363
+
3364
+ /**
3365
+ * Parse the string value into an integer in bytes.
3366
+ *
3367
+ * If no unit is given, it is assumed the value is in bytes.
3368
+ *
3369
+ * @param {number|string} val
3370
+ *
3371
+ * @returns {number|null}
3372
+ * @public
3373
+ */
3374
+
3375
+ function parse(val) {
3376
+ if (typeof val === 'number' && !isNaN(val)) {
3377
+ return val;
3378
+ }
3379
+
3380
+ if (typeof val !== 'string') {
3381
+ return null;
3382
+ }
3383
+
3384
+ // Test if the string passed is valid
3385
+ var results = parseRegExp.exec(val);
3386
+ var floatValue;
3387
+ var unit = 'b';
3388
+
3389
+ if (!results) {
3390
+ // Nothing could be extracted from the given string
3391
+ floatValue = parseInt(val, 10);
3392
+ unit = 'b';
3393
+ } else {
3394
+ // Retrieve the value and the unit
3395
+ floatValue = parseFloat(results[1]);
3396
+ unit = results[4].toLowerCase();
3397
+ }
3398
+
3399
+ if (isNaN(floatValue)) {
3400
+ return null;
3401
+ }
3402
+
3403
+ return Math.floor(map[unit] * floatValue);
3404
+ }
3405
+ return bytes.exports;
3406
+ }
3407
+
3408
+ var bytesExports = requireBytes();
3409
+
3410
+ const Tooltip_marginX = 10;
3411
+ const Tooltip_marginY = 30;
3412
+ const SOURCEMAP_RENDERED = (u$1("span", { children: [" ", u$1("b", { children: LABELS.renderedLength }), " is a number of characters in the file after individual and ", u$1("br", {}), " ", "whole bundle transformations according to sourcemap."] }));
3413
+ const RENDRED = (u$1("span", { children: [u$1("b", { children: LABELS.renderedLength }), " is a byte size of individual file after transformations and treeshake."] }));
3414
+ const COMPRESSED = (u$1("span", { children: [u$1("b", { children: LABELS.gzipLength }), " and ", u$1("b", { children: LABELS.brotliLength }), " is a byte size of individual file after individual transformations,", u$1("br", {}), " treeshake and compression."] }));
3415
+ const Tooltip = ({ node, visible, root, sizeProperty, }) => {
3416
+ const { availableSizeProperties, getModuleSize, data } = x(StaticContext);
3417
+ const ref = A(null);
3418
+ const [style, setStyle] = d({});
3419
+ const content = T(() => {
3420
+ if (!node)
3421
+ return null;
3422
+ const mainSize = getModuleSize(node.data, sizeProperty);
3423
+ const percentageNum = (100 * mainSize) / getModuleSize(root.data, sizeProperty);
3424
+ const percentage = percentageNum.toFixed(2);
3425
+ const percentageString = percentage + "%";
3426
+ const path = node
3427
+ .ancestors()
3428
+ .reverse()
3429
+ .map((d) => d.data.name)
3430
+ .join("/");
3431
+ let dataNode = null;
3432
+ if (!isModuleTree(node.data)) {
3433
+ const mainUid = data.nodeParts[node.data.uid].metaUid;
3434
+ dataNode = data.nodeMetas[mainUid];
3435
+ }
3436
+ return (u$1(k$1, { children: [u$1("div", { children: path }), availableSizeProperties.map((sizeProp) => {
3437
+ if (sizeProp === sizeProperty) {
3438
+ return (u$1("div", { children: [u$1("b", { children: [LABELS[sizeProp], ": ", bytesExports.format(mainSize)] }), " ", "(", percentageString, ")"] }, sizeProp));
3439
+ }
3440
+ else {
3441
+ return (u$1("div", { children: [LABELS[sizeProp], ": ", bytesExports.format(getModuleSize(node.data, sizeProp))] }, sizeProp));
3442
+ }
3443
+ }), u$1("br", {}), dataNode && dataNode.importedBy.length > 0 && (u$1("div", { children: [u$1("div", { children: [u$1("b", { children: "Imported By" }), ":"] }), dataNode.importedBy.map(({ uid }) => {
3444
+ const id = data.nodeMetas[uid].id;
3445
+ return u$1("div", { children: id }, id);
3446
+ })] })), u$1("br", {}), u$1("small", { children: data.options.sourcemap ? SOURCEMAP_RENDERED : RENDRED }), (data.options.gzip || data.options.brotli) && (u$1(k$1, { children: [u$1("br", {}), u$1("small", { children: COMPRESSED })] }))] }));
3447
+ }, [availableSizeProperties, data, getModuleSize, node, root.data, sizeProperty]);
3448
+ const updatePosition = (mouseCoords) => {
3449
+ if (!ref.current)
3450
+ return;
3451
+ const pos = {
3452
+ left: mouseCoords.x + Tooltip_marginX,
3453
+ top: mouseCoords.y + Tooltip_marginY,
3454
+ };
3455
+ const boundingRect = ref.current.getBoundingClientRect();
3456
+ if (pos.left + boundingRect.width > window.innerWidth) {
3457
+ // Shifting horizontally
3458
+ pos.left = Math.max(0, window.innerWidth - boundingRect.width);
3459
+ }
3460
+ if (pos.top + boundingRect.height > window.innerHeight) {
3461
+ // Flipping vertically
3462
+ pos.top = Math.max(0, mouseCoords.y - Tooltip_marginY - boundingRect.height);
3463
+ }
3464
+ setStyle(pos);
3465
+ };
3466
+ y(() => {
3467
+ const handleMouseMove = (event) => {
3468
+ updatePosition({
3469
+ x: event.pageX,
3470
+ y: event.pageY,
3471
+ });
3472
+ };
3473
+ document.addEventListener("mousemove", handleMouseMove, true);
3474
+ return () => {
3475
+ document.removeEventListener("mousemove", handleMouseMove, true);
3476
+ };
3477
+ }, []);
3478
+ return (u$1("div", { className: `tooltip ${visible ? "" : "tooltip-hidden"}`, ref: ref, style: style, children: content }));
3479
+ };
3480
+
3481
+ const Chart = ({ root, sizeProperty, selectedNode, setSelectedNode, }) => {
3482
+ const [showTooltip, setShowTooltip] = d(false);
3483
+ const [tooltipNode, setTooltipNode] = d(undefined);
3484
+ y(() => {
3485
+ const handleMouseOut = () => {
3486
+ setShowTooltip(false);
3487
+ };
3488
+ document.addEventListener("mouseover", handleMouseOut);
3489
+ return () => {
3490
+ document.removeEventListener("mouseover", handleMouseOut);
3491
+ };
3492
+ }, []);
3493
+ return (u$1(k$1, { children: [u$1(TreeMap, { root: root, onNodeHover: (node) => {
3494
+ setTooltipNode(node);
3495
+ setShowTooltip(true);
3496
+ }, selectedNode: selectedNode, onNodeClick: (node) => {
3497
+ setSelectedNode(selectedNode === node ? undefined : node);
3498
+ } }), u$1(Tooltip, { visible: showTooltip, node: tooltipNode, root: root, sizeProperty: sizeProperty })] }));
3499
+ };
3500
+
3501
+ const Main = () => {
3502
+ const { availableSizeProperties, rawHierarchy, getModuleSize, layout, data } = x(StaticContext);
3503
+ const [sizeProperty, setSizeProperty] = d(availableSizeProperties[0]);
3504
+ const [selectedNode, setSelectedNode] = d(undefined);
3505
+ const { getModuleFilterMultiplier, setExcludeFilter, setIncludeFilter } = useFilter();
3506
+ console.time("getNodeSizeMultiplier");
3507
+ const getNodeSizeMultiplier = T(() => {
3508
+ const selectedMultiplier = 1; // selectedSize < rootSize * increaseFactor ? (rootSize * increaseFactor) / selectedSize : rootSize / selectedSize;
3509
+ const nonSelectedMultiplier = 0; // 1 / selectedMultiplier
3510
+ if (selectedNode === undefined) {
3511
+ return () => 1;
3512
+ }
3513
+ else if (isModuleTree(selectedNode.data)) {
3514
+ const leaves = new Set(selectedNode.leaves().map((d) => d.data));
3515
+ return (node) => {
3516
+ if (leaves.has(node)) {
3517
+ return selectedMultiplier;
3518
+ }
3519
+ return nonSelectedMultiplier;
3520
+ };
3521
+ }
3522
+ else {
3523
+ return (node) => {
3524
+ if (node === selectedNode.data) {
3525
+ return selectedMultiplier;
3526
+ }
3527
+ return nonSelectedMultiplier;
3528
+ };
3529
+ }
3530
+ }, [getModuleSize, rawHierarchy.data, selectedNode, sizeProperty]);
3531
+ console.timeEnd("getNodeSizeMultiplier");
3532
+ console.time("root hierarchy compute");
3533
+ // root here always be the same as rawHierarchy even after layouting
3534
+ const root = T(() => {
3535
+ const rootWithSizesAndSorted = rawHierarchy
3536
+ .sum((node) => {
3537
+ var _a;
3538
+ if (isModuleTree(node))
3539
+ return 0;
3540
+ const meta = data.nodeMetas[data.nodeParts[node.uid].metaUid];
3541
+ /* eslint-disable typescript/no-non-null-asserted-optional-chain typescript/no-extra-non-null-assertion */
3542
+ const bundleId = (_a = Object.entries(meta.moduleParts).find(([, uid]) => uid == node.uid)) === null || _a === void 0 ? void 0 : _a[0];
3543
+ const ownSize = getModuleSize(node, sizeProperty);
3544
+ const zoomMultiplier = getNodeSizeMultiplier(node);
3545
+ const filterMultiplier = getModuleFilterMultiplier(bundleId, meta);
3546
+ return ownSize * zoomMultiplier * filterMultiplier;
3547
+ })
3548
+ .sort((a, b) => getModuleSize(a.data, sizeProperty) - getModuleSize(b.data, sizeProperty));
3549
+ return layout(rootWithSizesAndSorted);
3550
+ }, [
3551
+ data,
3552
+ getModuleFilterMultiplier,
3553
+ getModuleSize,
3554
+ getNodeSizeMultiplier,
3555
+ layout,
3556
+ rawHierarchy,
3557
+ sizeProperty,
3558
+ ]);
3559
+ console.timeEnd("root hierarchy compute");
3560
+ return (u$1(k$1, { children: [u$1(SideBar, { sizeProperty: sizeProperty, availableSizeProperties: availableSizeProperties, setSizeProperty: setSizeProperty, onExcludeChange: setExcludeFilter, onIncludeChange: setIncludeFilter }), u$1(Chart, { root: root, sizeProperty: sizeProperty, selectedNode: selectedNode, setSelectedNode: setSelectedNode })] }));
3561
+ };
3562
+
3563
+ function initRange(domain, range) {
3564
+ switch (arguments.length) {
3565
+ case 0: break;
3566
+ case 1: this.range(domain); break;
3567
+ default: this.range(range).domain(domain); break;
3568
+ }
3569
+ return this;
3570
+ }
3571
+
3572
+ function initInterpolator(domain, interpolator) {
3573
+ switch (arguments.length) {
3574
+ case 0: break;
3575
+ case 1: {
3576
+ if (typeof domain === "function") this.interpolator(domain);
3577
+ else this.range(domain);
3578
+ break;
3579
+ }
3580
+ default: {
3581
+ this.domain(domain);
3582
+ if (typeof interpolator === "function") this.interpolator(interpolator);
3583
+ else this.range(interpolator);
3584
+ break;
3585
+ }
3586
+ }
3587
+ return this;
3588
+ }
3589
+
3590
+ function define(constructor, factory, prototype) {
3591
+ constructor.prototype = factory.prototype = prototype;
3592
+ prototype.constructor = constructor;
3593
+ }
3594
+
3595
+ function extend(parent, definition) {
3596
+ var prototype = Object.create(parent.prototype);
3597
+ for (var key in definition) prototype[key] = definition[key];
3598
+ return prototype;
3599
+ }
3600
+
3601
+ function Color() {}
3602
+
3603
+ var darker = 0.7;
3604
+ var brighter = 1 / darker;
3605
+
3606
+ var reI = "\\s*([+-]?\\d+)\\s*",
3607
+ reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
3608
+ reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
3609
+ reHex = /^#([0-9a-f]{3,8})$/,
3610
+ reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
3611
+ reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
3612
+ reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
3613
+ reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
3614
+ reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
3615
+ reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
3616
+
3617
+ var named = {
3618
+ aliceblue: 0xf0f8ff,
3619
+ antiquewhite: 0xfaebd7,
3620
+ aqua: 0x00ffff,
3621
+ aquamarine: 0x7fffd4,
3622
+ azure: 0xf0ffff,
3623
+ beige: 0xf5f5dc,
3624
+ bisque: 0xffe4c4,
3625
+ black: 0x000000,
3626
+ blanchedalmond: 0xffebcd,
3627
+ blue: 0x0000ff,
3628
+ blueviolet: 0x8a2be2,
3629
+ brown: 0xa52a2a,
3630
+ burlywood: 0xdeb887,
3631
+ cadetblue: 0x5f9ea0,
3632
+ chartreuse: 0x7fff00,
3633
+ chocolate: 0xd2691e,
3634
+ coral: 0xff7f50,
3635
+ cornflowerblue: 0x6495ed,
3636
+ cornsilk: 0xfff8dc,
3637
+ crimson: 0xdc143c,
3638
+ cyan: 0x00ffff,
3639
+ darkblue: 0x00008b,
3640
+ darkcyan: 0x008b8b,
3641
+ darkgoldenrod: 0xb8860b,
3642
+ darkgray: 0xa9a9a9,
3643
+ darkgreen: 0x006400,
3644
+ darkgrey: 0xa9a9a9,
3645
+ darkkhaki: 0xbdb76b,
3646
+ darkmagenta: 0x8b008b,
3647
+ darkolivegreen: 0x556b2f,
3648
+ darkorange: 0xff8c00,
3649
+ darkorchid: 0x9932cc,
3650
+ darkred: 0x8b0000,
3651
+ darksalmon: 0xe9967a,
3652
+ darkseagreen: 0x8fbc8f,
3653
+ darkslateblue: 0x483d8b,
3654
+ darkslategray: 0x2f4f4f,
3655
+ darkslategrey: 0x2f4f4f,
3656
+ darkturquoise: 0x00ced1,
3657
+ darkviolet: 0x9400d3,
3658
+ deeppink: 0xff1493,
3659
+ deepskyblue: 0x00bfff,
3660
+ dimgray: 0x696969,
3661
+ dimgrey: 0x696969,
3662
+ dodgerblue: 0x1e90ff,
3663
+ firebrick: 0xb22222,
3664
+ floralwhite: 0xfffaf0,
3665
+ forestgreen: 0x228b22,
3666
+ fuchsia: 0xff00ff,
3667
+ gainsboro: 0xdcdcdc,
3668
+ ghostwhite: 0xf8f8ff,
3669
+ gold: 0xffd700,
3670
+ goldenrod: 0xdaa520,
3671
+ gray: 0x808080,
3672
+ green: 0x008000,
3673
+ greenyellow: 0xadff2f,
3674
+ grey: 0x808080,
3675
+ honeydew: 0xf0fff0,
3676
+ hotpink: 0xff69b4,
3677
+ indianred: 0xcd5c5c,
3678
+ indigo: 0x4b0082,
3679
+ ivory: 0xfffff0,
3680
+ khaki: 0xf0e68c,
3681
+ lavender: 0xe6e6fa,
3682
+ lavenderblush: 0xfff0f5,
3683
+ lawngreen: 0x7cfc00,
3684
+ lemonchiffon: 0xfffacd,
3685
+ lightblue: 0xadd8e6,
3686
+ lightcoral: 0xf08080,
3687
+ lightcyan: 0xe0ffff,
3688
+ lightgoldenrodyellow: 0xfafad2,
3689
+ lightgray: 0xd3d3d3,
3690
+ lightgreen: 0x90ee90,
3691
+ lightgrey: 0xd3d3d3,
3692
+ lightpink: 0xffb6c1,
3693
+ lightsalmon: 0xffa07a,
3694
+ lightseagreen: 0x20b2aa,
3695
+ lightskyblue: 0x87cefa,
3696
+ lightslategray: 0x778899,
3697
+ lightslategrey: 0x778899,
3698
+ lightsteelblue: 0xb0c4de,
3699
+ lightyellow: 0xffffe0,
3700
+ lime: 0x00ff00,
3701
+ limegreen: 0x32cd32,
3702
+ linen: 0xfaf0e6,
3703
+ magenta: 0xff00ff,
3704
+ maroon: 0x800000,
3705
+ mediumaquamarine: 0x66cdaa,
3706
+ mediumblue: 0x0000cd,
3707
+ mediumorchid: 0xba55d3,
3708
+ mediumpurple: 0x9370db,
3709
+ mediumseagreen: 0x3cb371,
3710
+ mediumslateblue: 0x7b68ee,
3711
+ mediumspringgreen: 0x00fa9a,
3712
+ mediumturquoise: 0x48d1cc,
3713
+ mediumvioletred: 0xc71585,
3714
+ midnightblue: 0x191970,
3715
+ mintcream: 0xf5fffa,
3716
+ mistyrose: 0xffe4e1,
3717
+ moccasin: 0xffe4b5,
3718
+ navajowhite: 0xffdead,
3719
+ navy: 0x000080,
3720
+ oldlace: 0xfdf5e6,
3721
+ olive: 0x808000,
3722
+ olivedrab: 0x6b8e23,
3723
+ orange: 0xffa500,
3724
+ orangered: 0xff4500,
3725
+ orchid: 0xda70d6,
3726
+ palegoldenrod: 0xeee8aa,
3727
+ palegreen: 0x98fb98,
3728
+ paleturquoise: 0xafeeee,
3729
+ palevioletred: 0xdb7093,
3730
+ papayawhip: 0xffefd5,
3731
+ peachpuff: 0xffdab9,
3732
+ peru: 0xcd853f,
3733
+ pink: 0xffc0cb,
3734
+ plum: 0xdda0dd,
3735
+ powderblue: 0xb0e0e6,
3736
+ purple: 0x800080,
3737
+ rebeccapurple: 0x663399,
3738
+ red: 0xff0000,
3739
+ rosybrown: 0xbc8f8f,
3740
+ royalblue: 0x4169e1,
3741
+ saddlebrown: 0x8b4513,
3742
+ salmon: 0xfa8072,
3743
+ sandybrown: 0xf4a460,
3744
+ seagreen: 0x2e8b57,
3745
+ seashell: 0xfff5ee,
3746
+ sienna: 0xa0522d,
3747
+ silver: 0xc0c0c0,
3748
+ skyblue: 0x87ceeb,
3749
+ slateblue: 0x6a5acd,
3750
+ slategray: 0x708090,
3751
+ slategrey: 0x708090,
3752
+ snow: 0xfffafa,
3753
+ springgreen: 0x00ff7f,
3754
+ steelblue: 0x4682b4,
3755
+ tan: 0xd2b48c,
3756
+ teal: 0x008080,
3757
+ thistle: 0xd8bfd8,
3758
+ tomato: 0xff6347,
3759
+ turquoise: 0x40e0d0,
3760
+ violet: 0xee82ee,
3761
+ wheat: 0xf5deb3,
3762
+ white: 0xffffff,
3763
+ whitesmoke: 0xf5f5f5,
3764
+ yellow: 0xffff00,
3765
+ yellowgreen: 0x9acd32
3766
+ };
3767
+
3768
+ define(Color, color, {
3769
+ copy(channels) {
3770
+ return Object.assign(new this.constructor, this, channels);
3771
+ },
3772
+ displayable() {
3773
+ return this.rgb().displayable();
3774
+ },
3775
+ hex: color_formatHex, // Deprecated! Use color.formatHex.
3776
+ formatHex: color_formatHex,
3777
+ formatHex8: color_formatHex8,
3778
+ formatHsl: color_formatHsl,
3779
+ formatRgb: color_formatRgb,
3780
+ toString: color_formatRgb
3781
+ });
3782
+
3783
+ function color_formatHex() {
3784
+ return this.rgb().formatHex();
3785
+ }
3786
+
3787
+ function color_formatHex8() {
3788
+ return this.rgb().formatHex8();
3789
+ }
3790
+
3791
+ function color_formatHsl() {
3792
+ return hslConvert(this).formatHsl();
3793
+ }
3794
+
3795
+ function color_formatRgb() {
3796
+ return this.rgb().formatRgb();
3797
+ }
3798
+
3799
+ function color(format) {
3800
+ var m, l;
3801
+ format = (format + "").trim().toLowerCase();
3802
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
3803
+ : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
3804
+ : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
3805
+ : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
3806
+ : null) // invalid hex
3807
+ : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
3808
+ : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
3809
+ : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
3810
+ : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
3811
+ : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
3812
+ : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
3813
+ : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
3814
+ : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
3815
+ : null;
3816
+ }
3817
+
3818
+ function rgbn(n) {
3819
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
3820
+ }
3821
+
3822
+ function rgba(r, g, b, a) {
3823
+ if (a <= 0) r = g = b = NaN;
3824
+ return new Rgb(r, g, b, a);
3825
+ }
3826
+
3827
+ function rgbConvert(o) {
3828
+ if (!(o instanceof Color)) o = color(o);
3829
+ if (!o) return new Rgb;
3830
+ o = o.rgb();
3831
+ return new Rgb(o.r, o.g, o.b, o.opacity);
3832
+ }
3833
+
3834
+ function rgb$1(r, g, b, opacity) {
3835
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
3836
+ }
3837
+
3838
+ function Rgb(r, g, b, opacity) {
3839
+ this.r = +r;
3840
+ this.g = +g;
3841
+ this.b = +b;
3842
+ this.opacity = +opacity;
3843
+ }
3844
+
3845
+ define(Rgb, rgb$1, extend(Color, {
3846
+ brighter(k) {
3847
+ k = k == null ? brighter : Math.pow(brighter, k);
3848
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
3849
+ },
3850
+ darker(k) {
3851
+ k = k == null ? darker : Math.pow(darker, k);
3852
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
3853
+ },
3854
+ rgb() {
3855
+ return this;
3856
+ },
3857
+ clamp() {
3858
+ return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
3859
+ },
3860
+ displayable() {
3861
+ return (-0.5 <= this.r && this.r < 255.5)
3862
+ && (-0.5 <= this.g && this.g < 255.5)
3863
+ && (-0.5 <= this.b && this.b < 255.5)
3864
+ && (0 <= this.opacity && this.opacity <= 1);
3865
+ },
3866
+ hex: rgb_formatHex, // Deprecated! Use color.formatHex.
3867
+ formatHex: rgb_formatHex,
3868
+ formatHex8: rgb_formatHex8,
3869
+ formatRgb: rgb_formatRgb,
3870
+ toString: rgb_formatRgb
3871
+ }));
3872
+
3873
+ function rgb_formatHex() {
3874
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
3875
+ }
3876
+
3877
+ function rgb_formatHex8() {
3878
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
3879
+ }
3880
+
3881
+ function rgb_formatRgb() {
3882
+ const a = clampa(this.opacity);
3883
+ return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
3884
+ }
3885
+
3886
+ function clampa(opacity) {
3887
+ return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
3888
+ }
3889
+
3890
+ function clampi(value) {
3891
+ return Math.max(0, Math.min(255, Math.round(value) || 0));
3892
+ }
3893
+
3894
+ function hex(value) {
3895
+ value = clampi(value);
3896
+ return (value < 16 ? "0" : "") + value.toString(16);
3897
+ }
3898
+
3899
+ function hsla(h, s, l, a) {
3900
+ if (a <= 0) h = s = l = NaN;
3901
+ else if (l <= 0 || l >= 1) h = s = NaN;
3902
+ else if (s <= 0) h = NaN;
3903
+ return new Hsl(h, s, l, a);
3904
+ }
3905
+
3906
+ function hslConvert(o) {
3907
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
3908
+ if (!(o instanceof Color)) o = color(o);
3909
+ if (!o) return new Hsl;
3910
+ if (o instanceof Hsl) return o;
3911
+ o = o.rgb();
3912
+ var r = o.r / 255,
3913
+ g = o.g / 255,
3914
+ b = o.b / 255,
3915
+ min = Math.min(r, g, b),
3916
+ max = Math.max(r, g, b),
3917
+ h = NaN,
3918
+ s = max - min,
3919
+ l = (max + min) / 2;
3920
+ if (s) {
3921
+ if (r === max) h = (g - b) / s + (g < b) * 6;
3922
+ else if (g === max) h = (b - r) / s + 2;
3923
+ else h = (r - g) / s + 4;
3924
+ s /= l < 0.5 ? max + min : 2 - max - min;
3925
+ h *= 60;
3926
+ } else {
3927
+ s = l > 0 && l < 1 ? 0 : h;
3928
+ }
3929
+ return new Hsl(h, s, l, o.opacity);
3930
+ }
3931
+
3932
+ function hsl(h, s, l, opacity) {
3933
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
3934
+ }
3935
+
3936
+ function Hsl(h, s, l, opacity) {
3937
+ this.h = +h;
3938
+ this.s = +s;
3939
+ this.l = +l;
3940
+ this.opacity = +opacity;
3941
+ }
3942
+
3943
+ define(Hsl, hsl, extend(Color, {
3944
+ brighter(k) {
3945
+ k = k == null ? brighter : Math.pow(brighter, k);
3946
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
3947
+ },
3948
+ darker(k) {
3949
+ k = k == null ? darker : Math.pow(darker, k);
3950
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
3951
+ },
3952
+ rgb() {
3953
+ var h = this.h % 360 + (this.h < 0) * 360,
3954
+ s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
3955
+ l = this.l,
3956
+ m2 = l + (l < 0.5 ? l : 1 - l) * s,
3957
+ m1 = 2 * l - m2;
3958
+ return new Rgb(
3959
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
3960
+ hsl2rgb(h, m1, m2),
3961
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
3962
+ this.opacity
3963
+ );
3964
+ },
3965
+ clamp() {
3966
+ return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
3967
+ },
3968
+ displayable() {
3969
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s))
3970
+ && (0 <= this.l && this.l <= 1)
3971
+ && (0 <= this.opacity && this.opacity <= 1);
3972
+ },
3973
+ formatHsl() {
3974
+ const a = clampa(this.opacity);
3975
+ return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
3976
+ }
3977
+ }));
3978
+
3979
+ function clamph(value) {
3980
+ value = (value || 0) % 360;
3981
+ return value < 0 ? value + 360 : value;
3982
+ }
3983
+
3984
+ function clampt(value) {
3985
+ return Math.max(0, Math.min(1, value || 0));
3986
+ }
3987
+
3988
+ /* From FvD 13.37, CSS Color Module Level 3 */
3989
+ function hsl2rgb(h, m1, m2) {
3990
+ return (h < 60 ? m1 + (m2 - m1) * h / 60
3991
+ : h < 180 ? m2
3992
+ : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
3993
+ : m1) * 255;
3994
+ }
3995
+
3996
+ var constant = x => () => x;
3997
+
3998
+ function linear$1(a, d) {
3999
+ return function(t) {
4000
+ return a + t * d;
4001
+ };
4002
+ }
4003
+
4004
+ function exponential(a, b, y) {
4005
+ return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
4006
+ return Math.pow(a + t * b, y);
4007
+ };
4008
+ }
4009
+
4010
+ function gamma(y) {
4011
+ return (y = +y) === 1 ? nogamma : function(a, b) {
4012
+ return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
4013
+ };
4014
+ }
4015
+
4016
+ function nogamma(a, b) {
4017
+ var d = b - a;
4018
+ return d ? linear$1(a, d) : constant(isNaN(a) ? b : a);
4019
+ }
4020
+
4021
+ var rgb = (function rgbGamma(y) {
4022
+ var color = gamma(y);
4023
+
4024
+ function rgb(start, end) {
4025
+ var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
4026
+ g = color(start.g, end.g),
4027
+ b = color(start.b, end.b),
4028
+ opacity = nogamma(start.opacity, end.opacity);
4029
+ return function(t) {
4030
+ start.r = r(t);
4031
+ start.g = g(t);
4032
+ start.b = b(t);
4033
+ start.opacity = opacity(t);
4034
+ return start + "";
4035
+ };
4036
+ }
4037
+
4038
+ rgb.gamma = rgbGamma;
4039
+
4040
+ return rgb;
4041
+ })(1);
4042
+
4043
+ function numberArray(a, b) {
4044
+ if (!b) b = [];
4045
+ var n = a ? Math.min(b.length, a.length) : 0,
4046
+ c = b.slice(),
4047
+ i;
4048
+ return function(t) {
4049
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
4050
+ return c;
4051
+ };
4052
+ }
4053
+
4054
+ function isNumberArray(x) {
4055
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
4056
+ }
4057
+
4058
+ function genericArray(a, b) {
4059
+ var nb = b ? b.length : 0,
4060
+ na = a ? Math.min(nb, a.length) : 0,
4061
+ x = new Array(na),
4062
+ c = new Array(nb),
4063
+ i;
4064
+
4065
+ for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
4066
+ for (; i < nb; ++i) c[i] = b[i];
4067
+
4068
+ return function(t) {
4069
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
4070
+ return c;
4071
+ };
4072
+ }
4073
+
4074
+ function date(a, b) {
4075
+ var d = new Date;
4076
+ return a = +a, b = +b, function(t) {
4077
+ return d.setTime(a * (1 - t) + b * t), d;
4078
+ };
4079
+ }
4080
+
4081
+ function interpolateNumber(a, b) {
4082
+ return a = +a, b = +b, function(t) {
4083
+ return a * (1 - t) + b * t;
4084
+ };
4085
+ }
4086
+
4087
+ function object(a, b) {
4088
+ var i = {},
4089
+ c = {},
4090
+ k;
4091
+
4092
+ if (a === null || typeof a !== "object") a = {};
4093
+ if (b === null || typeof b !== "object") b = {};
4094
+
4095
+ for (k in b) {
4096
+ if (k in a) {
4097
+ i[k] = interpolate(a[k], b[k]);
4098
+ } else {
4099
+ c[k] = b[k];
4100
+ }
4101
+ }
4102
+
4103
+ return function(t) {
4104
+ for (k in i) c[k] = i[k](t);
4105
+ return c;
4106
+ };
4107
+ }
4108
+
4109
+ var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
4110
+ reB = new RegExp(reA.source, "g");
4111
+
4112
+ function zero(b) {
4113
+ return function() {
4114
+ return b;
4115
+ };
4116
+ }
4117
+
4118
+ function one(b) {
4119
+ return function(t) {
4120
+ return b(t) + "";
4121
+ };
4122
+ }
4123
+
4124
+ function string(a, b) {
4125
+ var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
4126
+ am, // current match in a
4127
+ bm, // current match in b
4128
+ bs, // string preceding current number in b, if any
4129
+ i = -1, // index in s
4130
+ s = [], // string constants and placeholders
4131
+ q = []; // number interpolators
4132
+
4133
+ // Coerce inputs to strings.
4134
+ a = a + "", b = b + "";
4135
+
4136
+ // Interpolate pairs of numbers in a & b.
4137
+ while ((am = reA.exec(a))
4138
+ && (bm = reB.exec(b))) {
4139
+ if ((bs = bm.index) > bi) { // a string precedes the next number in b
4140
+ bs = b.slice(bi, bs);
4141
+ if (s[i]) s[i] += bs; // coalesce with previous string
4142
+ else s[++i] = bs;
4143
+ }
4144
+ if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
4145
+ if (s[i]) s[i] += bm; // coalesce with previous string
4146
+ else s[++i] = bm;
4147
+ } else { // interpolate non-matching numbers
4148
+ s[++i] = null;
4149
+ q.push({i: i, x: interpolateNumber(am, bm)});
4150
+ }
4151
+ bi = reB.lastIndex;
4152
+ }
4153
+
4154
+ // Add remains of b.
4155
+ if (bi < b.length) {
4156
+ bs = b.slice(bi);
4157
+ if (s[i]) s[i] += bs; // coalesce with previous string
4158
+ else s[++i] = bs;
4159
+ }
4160
+
4161
+ // Special optimization for only a single match.
4162
+ // Otherwise, interpolate each of the numbers and rejoin the string.
4163
+ return s.length < 2 ? (q[0]
4164
+ ? one(q[0].x)
4165
+ : zero(b))
4166
+ : (b = q.length, function(t) {
4167
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
4168
+ return s.join("");
4169
+ });
4170
+ }
4171
+
4172
+ function interpolate(a, b) {
4173
+ var t = typeof b, c;
4174
+ return b == null || t === "boolean" ? constant(b)
4175
+ : (t === "number" ? interpolateNumber
4176
+ : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
4177
+ : b instanceof color ? rgb
4178
+ : b instanceof Date ? date
4179
+ : isNumberArray(b) ? numberArray
4180
+ : Array.isArray(b) ? genericArray
4181
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
4182
+ : interpolateNumber)(a, b);
4183
+ }
4184
+
4185
+ function interpolateRound(a, b) {
4186
+ return a = +a, b = +b, function(t) {
4187
+ return Math.round(a * (1 - t) + b * t);
4188
+ };
4189
+ }
4190
+
4191
+ function constants(x) {
4192
+ return function() {
4193
+ return x;
4194
+ };
4195
+ }
4196
+
4197
+ function number(x) {
4198
+ return +x;
4199
+ }
4200
+
4201
+ var unit = [0, 1];
4202
+
4203
+ function identity$1(x) {
4204
+ return x;
4205
+ }
4206
+
4207
+ function normalize(a, b) {
4208
+ return (b -= (a = +a))
4209
+ ? function(x) { return (x - a) / b; }
4210
+ : constants(isNaN(b) ? NaN : 0.5);
4211
+ }
4212
+
4213
+ function clamper(a, b) {
4214
+ var t;
4215
+ if (a > b) t = a, a = b, b = t;
4216
+ return function(x) { return Math.max(a, Math.min(b, x)); };
4217
+ }
4218
+
4219
+ // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
4220
+ // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
4221
+ function bimap(domain, range, interpolate) {
4222
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
4223
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
4224
+ else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
4225
+ return function(x) { return r0(d0(x)); };
4226
+ }
4227
+
4228
+ function polymap(domain, range, interpolate) {
4229
+ var j = Math.min(domain.length, range.length) - 1,
4230
+ d = new Array(j),
4231
+ r = new Array(j),
4232
+ i = -1;
4233
+
4234
+ // Reverse descending domains.
4235
+ if (domain[j] < domain[0]) {
4236
+ domain = domain.slice().reverse();
4237
+ range = range.slice().reverse();
4238
+ }
4239
+
4240
+ while (++i < j) {
4241
+ d[i] = normalize(domain[i], domain[i + 1]);
4242
+ r[i] = interpolate(range[i], range[i + 1]);
4243
+ }
4244
+
4245
+ return function(x) {
4246
+ var i = bisectRight(domain, x, 1, j) - 1;
4247
+ return r[i](d[i](x));
4248
+ };
4249
+ }
4250
+
4251
+ function copy$1(source, target) {
4252
+ return target
4253
+ .domain(source.domain())
4254
+ .range(source.range())
4255
+ .interpolate(source.interpolate())
4256
+ .clamp(source.clamp())
4257
+ .unknown(source.unknown());
4258
+ }
4259
+
4260
+ function transformer$1() {
4261
+ var domain = unit,
4262
+ range = unit,
4263
+ interpolate$1 = interpolate,
4264
+ transform,
4265
+ untransform,
4266
+ unknown,
4267
+ clamp = identity$1,
4268
+ piecewise,
4269
+ output,
4270
+ input;
4271
+
4272
+ function rescale() {
4273
+ var n = Math.min(domain.length, range.length);
4274
+ if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);
4275
+ piecewise = n > 2 ? polymap : bimap;
4276
+ output = input = null;
4277
+ return scale;
4278
+ }
4279
+
4280
+ function scale(x) {
4281
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
4282
+ }
4283
+
4284
+ scale.invert = function(y) {
4285
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
4286
+ };
4287
+
4288
+ scale.domain = function(_) {
4289
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
4290
+ };
4291
+
4292
+ scale.range = function(_) {
4293
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
4294
+ };
4295
+
4296
+ scale.rangeRound = function(_) {
4297
+ return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
4298
+ };
4299
+
4300
+ scale.clamp = function(_) {
4301
+ return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;
4302
+ };
4303
+
4304
+ scale.interpolate = function(_) {
4305
+ return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
4306
+ };
4307
+
4308
+ scale.unknown = function(_) {
4309
+ return arguments.length ? (unknown = _, scale) : unknown;
4310
+ };
4311
+
4312
+ return function(t, u) {
4313
+ transform = t, untransform = u;
4314
+ return rescale();
4315
+ };
4316
+ }
4317
+
4318
+ function continuous() {
4319
+ return transformer$1()(identity$1, identity$1);
4320
+ }
4321
+
4322
+ function formatDecimal(x) {
4323
+ return Math.abs(x = Math.round(x)) >= 1e21
4324
+ ? x.toLocaleString("en").replace(/,/g, "")
4325
+ : x.toString(10);
4326
+ }
4327
+
4328
+ // Computes the decimal coefficient and exponent of the specified number x with
4329
+ // significant digits p, where x is positive and p is in [1, 21] or undefined.
4330
+ // For example, formatDecimalParts(1.23) returns ["123", 0].
4331
+ function formatDecimalParts(x, p) {
4332
+ if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
4333
+ var i, coefficient = x.slice(0, i);
4334
+
4335
+ // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
4336
+ // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
4337
+ return [
4338
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
4339
+ +x.slice(i + 1)
4340
+ ];
4341
+ }
4342
+
4343
+ function exponent(x) {
4344
+ return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
4345
+ }
4346
+
4347
+ function formatGroup(grouping, thousands) {
4348
+ return function(value, width) {
4349
+ var i = value.length,
4350
+ t = [],
4351
+ j = 0,
4352
+ g = grouping[0],
4353
+ length = 0;
4354
+
4355
+ while (i > 0 && g > 0) {
4356
+ if (length + g + 1 > width) g = Math.max(1, width - length);
4357
+ t.push(value.substring(i -= g, i + g));
4358
+ if ((length += g + 1) > width) break;
4359
+ g = grouping[j = (j + 1) % grouping.length];
4360
+ }
4361
+
4362
+ return t.reverse().join(thousands);
4363
+ };
4364
+ }
4365
+
4366
+ function formatNumerals(numerals) {
4367
+ return function(value) {
4368
+ return value.replace(/[0-9]/g, function(i) {
4369
+ return numerals[+i];
4370
+ });
4371
+ };
4372
+ }
4373
+
4374
+ // [[fill]align][sign][symbol][0][width][,][.precision][~][type]
4375
+ var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
4376
+
4377
+ function formatSpecifier(specifier) {
4378
+ if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
4379
+ var match;
4380
+ return new FormatSpecifier({
4381
+ fill: match[1],
4382
+ align: match[2],
4383
+ sign: match[3],
4384
+ symbol: match[4],
4385
+ zero: match[5],
4386
+ width: match[6],
4387
+ comma: match[7],
4388
+ precision: match[8] && match[8].slice(1),
4389
+ trim: match[9],
4390
+ type: match[10]
4391
+ });
4392
+ }
4393
+
4394
+ formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
4395
+
4396
+ function FormatSpecifier(specifier) {
4397
+ this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
4398
+ this.align = specifier.align === undefined ? ">" : specifier.align + "";
4399
+ this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
4400
+ this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
4401
+ this.zero = !!specifier.zero;
4402
+ this.width = specifier.width === undefined ? undefined : +specifier.width;
4403
+ this.comma = !!specifier.comma;
4404
+ this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
4405
+ this.trim = !!specifier.trim;
4406
+ this.type = specifier.type === undefined ? "" : specifier.type + "";
4407
+ }
4408
+
4409
+ FormatSpecifier.prototype.toString = function() {
4410
+ return this.fill
4411
+ + this.align
4412
+ + this.sign
4413
+ + this.symbol
4414
+ + (this.zero ? "0" : "")
4415
+ + (this.width === undefined ? "" : Math.max(1, this.width | 0))
4416
+ + (this.comma ? "," : "")
4417
+ + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
4418
+ + (this.trim ? "~" : "")
4419
+ + this.type;
4420
+ };
4421
+
4422
+ // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
4423
+ function formatTrim(s) {
4424
+ out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
4425
+ switch (s[i]) {
4426
+ case ".": i0 = i1 = i; break;
4427
+ case "0": if (i0 === 0) i0 = i; i1 = i; break;
4428
+ default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
4429
+ }
4430
+ }
4431
+ return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
4432
+ }
4433
+
4434
+ var prefixExponent;
4435
+
4436
+ function formatPrefixAuto(x, p) {
4437
+ var d = formatDecimalParts(x, p);
4438
+ if (!d) return x + "";
4439
+ var coefficient = d[0],
4440
+ exponent = d[1],
4441
+ i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
4442
+ n = coefficient.length;
4443
+ return i === n ? coefficient
4444
+ : i > n ? coefficient + new Array(i - n + 1).join("0")
4445
+ : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
4446
+ : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
4447
+ }
4448
+
4449
+ function formatRounded(x, p) {
4450
+ var d = formatDecimalParts(x, p);
4451
+ if (!d) return x + "";
4452
+ var coefficient = d[0],
4453
+ exponent = d[1];
4454
+ return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
4455
+ : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
4456
+ : coefficient + new Array(exponent - coefficient.length + 2).join("0");
4457
+ }
4458
+
4459
+ var formatTypes = {
4460
+ "%": (x, p) => (x * 100).toFixed(p),
4461
+ "b": (x) => Math.round(x).toString(2),
4462
+ "c": (x) => x + "",
4463
+ "d": formatDecimal,
4464
+ "e": (x, p) => x.toExponential(p),
4465
+ "f": (x, p) => x.toFixed(p),
4466
+ "g": (x, p) => x.toPrecision(p),
4467
+ "o": (x) => Math.round(x).toString(8),
4468
+ "p": (x, p) => formatRounded(x * 100, p),
4469
+ "r": formatRounded,
4470
+ "s": formatPrefixAuto,
4471
+ "X": (x) => Math.round(x).toString(16).toUpperCase(),
4472
+ "x": (x) => Math.round(x).toString(16)
4473
+ };
4474
+
4475
+ function identity(x) {
4476
+ return x;
4477
+ }
4478
+
4479
+ var map = Array.prototype.map,
4480
+ prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
4481
+
4482
+ function formatLocale(locale) {
4483
+ var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
4484
+ currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
4485
+ currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
4486
+ decimal = locale.decimal === undefined ? "." : locale.decimal + "",
4487
+ numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),
4488
+ percent = locale.percent === undefined ? "%" : locale.percent + "",
4489
+ minus = locale.minus === undefined ? "−" : locale.minus + "",
4490
+ nan = locale.nan === undefined ? "NaN" : locale.nan + "";
4491
+
4492
+ function newFormat(specifier) {
4493
+ specifier = formatSpecifier(specifier);
4494
+
4495
+ var fill = specifier.fill,
4496
+ align = specifier.align,
4497
+ sign = specifier.sign,
4498
+ symbol = specifier.symbol,
4499
+ zero = specifier.zero,
4500
+ width = specifier.width,
4501
+ comma = specifier.comma,
4502
+ precision = specifier.precision,
4503
+ trim = specifier.trim,
4504
+ type = specifier.type;
4505
+
4506
+ // The "n" type is an alias for ",g".
4507
+ if (type === "n") comma = true, type = "g";
4508
+
4509
+ // The "" type, and any invalid type, is an alias for ".12~g".
4510
+ else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
4511
+
4512
+ // If zero fill is specified, padding goes after sign and before digits.
4513
+ if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
4514
+
4515
+ // Compute the prefix and suffix.
4516
+ // For SI-prefix, the suffix is lazily computed.
4517
+ var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
4518
+ suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
4519
+
4520
+ // What format function should we use?
4521
+ // Is this an integer type?
4522
+ // Can this type generate exponential notation?
4523
+ var formatType = formatTypes[type],
4524
+ maybeSuffix = /[defgprs%]/.test(type);
4525
+
4526
+ // Set the default precision if not specified,
4527
+ // or clamp the specified precision to the supported range.
4528
+ // For significant precision, it must be in [1, 21].
4529
+ // For fixed precision, it must be in [0, 20].
4530
+ precision = precision === undefined ? 6
4531
+ : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
4532
+ : Math.max(0, Math.min(20, precision));
4533
+
4534
+ function format(value) {
4535
+ var valuePrefix = prefix,
4536
+ valueSuffix = suffix,
4537
+ i, n, c;
4538
+
4539
+ if (type === "c") {
4540
+ valueSuffix = formatType(value) + valueSuffix;
4541
+ value = "";
4542
+ } else {
4543
+ value = +value;
4544
+
4545
+ // Determine the sign. -0 is not less than 0, but 1 / -0 is!
4546
+ var valueNegative = value < 0 || 1 / value < 0;
4547
+
4548
+ // Perform the initial formatting.
4549
+ value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
4550
+
4551
+ // Trim insignificant zeros.
4552
+ if (trim) value = formatTrim(value);
4553
+
4554
+ // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
4555
+ if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
4556
+
4557
+ // Compute the prefix and suffix.
4558
+ valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
4559
+ valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
4560
+
4561
+ // Break the formatted value into the integer “value” part that can be
4562
+ // grouped, and fractional or exponential “suffix” part that is not.
4563
+ if (maybeSuffix) {
4564
+ i = -1, n = value.length;
4565
+ while (++i < n) {
4566
+ if (c = value.charCodeAt(i), 48 > c || c > 57) {
4567
+ valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
4568
+ value = value.slice(0, i);
4569
+ break;
4570
+ }
4571
+ }
4572
+ }
4573
+ }
4574
+
4575
+ // If the fill character is not "0", grouping is applied before padding.
4576
+ if (comma && !zero) value = group(value, Infinity);
4577
+
4578
+ // Compute the padding.
4579
+ var length = valuePrefix.length + value.length + valueSuffix.length,
4580
+ padding = length < width ? new Array(width - length + 1).join(fill) : "";
4581
+
4582
+ // If the fill character is "0", grouping is applied after padding.
4583
+ if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
4584
+
4585
+ // Reconstruct the final output based on the desired alignment.
4586
+ switch (align) {
4587
+ case "<": value = valuePrefix + value + valueSuffix + padding; break;
4588
+ case "=": value = valuePrefix + padding + value + valueSuffix; break;
4589
+ case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
4590
+ default: value = padding + valuePrefix + value + valueSuffix; break;
4591
+ }
4592
+
4593
+ return numerals(value);
4594
+ }
4595
+
4596
+ format.toString = function() {
4597
+ return specifier + "";
4598
+ };
4599
+
4600
+ return format;
4601
+ }
4602
+
4603
+ function formatPrefix(specifier, value) {
4604
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
4605
+ e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
4606
+ k = Math.pow(10, -e),
4607
+ prefix = prefixes[8 + e / 3];
4608
+ return function(value) {
4609
+ return f(k * value) + prefix;
4610
+ };
4611
+ }
4612
+
4613
+ return {
4614
+ format: newFormat,
4615
+ formatPrefix: formatPrefix
4616
+ };
4617
+ }
4618
+
4619
+ var locale;
4620
+ var format;
4621
+ var formatPrefix;
4622
+
4623
+ defaultLocale({
4624
+ thousands: ",",
4625
+ grouping: [3],
4626
+ currency: ["$", ""]
4627
+ });
4628
+
4629
+ function defaultLocale(definition) {
4630
+ locale = formatLocale(definition);
4631
+ format = locale.format;
4632
+ formatPrefix = locale.formatPrefix;
4633
+ return locale;
4634
+ }
4635
+
4636
+ function precisionFixed(step) {
4637
+ return Math.max(0, -exponent(Math.abs(step)));
4638
+ }
4639
+
4640
+ function precisionPrefix(step, value) {
4641
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
4642
+ }
4643
+
4644
+ function precisionRound(step, max) {
4645
+ step = Math.abs(step), max = Math.abs(max) - step;
4646
+ return Math.max(0, exponent(max) - exponent(step)) + 1;
4647
+ }
4648
+
4649
+ function tickFormat(start, stop, count, specifier) {
4650
+ var step = tickStep(start, stop, count),
4651
+ precision;
4652
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
4653
+ switch (specifier.type) {
4654
+ case "s": {
4655
+ var value = Math.max(Math.abs(start), Math.abs(stop));
4656
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
4657
+ return formatPrefix(specifier, value);
4658
+ }
4659
+ case "":
4660
+ case "e":
4661
+ case "g":
4662
+ case "p":
4663
+ case "r": {
4664
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
4665
+ break;
4666
+ }
4667
+ case "f":
4668
+ case "%": {
4669
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
4670
+ break;
4671
+ }
4672
+ }
4673
+ return format(specifier);
4674
+ }
4675
+
4676
+ function linearish(scale) {
4677
+ var domain = scale.domain;
4678
+
4679
+ scale.ticks = function(count) {
4680
+ var d = domain();
4681
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
4682
+ };
4683
+
4684
+ scale.tickFormat = function(count, specifier) {
4685
+ var d = domain();
4686
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
4687
+ };
4688
+
4689
+ scale.nice = function(count) {
4690
+ if (count == null) count = 10;
4691
+
4692
+ var d = domain();
4693
+ var i0 = 0;
4694
+ var i1 = d.length - 1;
4695
+ var start = d[i0];
4696
+ var stop = d[i1];
4697
+ var prestep;
4698
+ var step;
4699
+ var maxIter = 10;
4700
+
4701
+ if (stop < start) {
4702
+ step = start, start = stop, stop = step;
4703
+ step = i0, i0 = i1, i1 = step;
4704
+ }
4705
+
4706
+ while (maxIter-- > 0) {
4707
+ step = tickIncrement(start, stop, count);
4708
+ if (step === prestep) {
4709
+ d[i0] = start;
4710
+ d[i1] = stop;
4711
+ return domain(d);
4712
+ } else if (step > 0) {
4713
+ start = Math.floor(start / step) * step;
4714
+ stop = Math.ceil(stop / step) * step;
4715
+ } else if (step < 0) {
4716
+ start = Math.ceil(start * step) / step;
4717
+ stop = Math.floor(stop * step) / step;
4718
+ } else {
4719
+ break;
4720
+ }
4721
+ prestep = step;
4722
+ }
4723
+
4724
+ return scale;
4725
+ };
4726
+
4727
+ return scale;
4728
+ }
4729
+
4730
+ function linear() {
4731
+ var scale = continuous();
4732
+
4733
+ scale.copy = function() {
4734
+ return copy$1(scale, linear());
4735
+ };
4736
+
4737
+ initRange.apply(scale, arguments);
4738
+
4739
+ return linearish(scale);
4740
+ }
4741
+
4742
+ function transformer() {
4743
+ var x0 = 0,
4744
+ x1 = 1,
4745
+ t0,
4746
+ t1,
4747
+ k10,
4748
+ transform,
4749
+ interpolator = identity$1,
4750
+ clamp = false,
4751
+ unknown;
4752
+
4753
+ function scale(x) {
4754
+ return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
4755
+ }
4756
+
4757
+ scale.domain = function(_) {
4758
+ return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];
4759
+ };
4760
+
4761
+ scale.clamp = function(_) {
4762
+ return arguments.length ? (clamp = !!_, scale) : clamp;
4763
+ };
4764
+
4765
+ scale.interpolator = function(_) {
4766
+ return arguments.length ? (interpolator = _, scale) : interpolator;
4767
+ };
4768
+
4769
+ function range(interpolate) {
4770
+ return function(_) {
4771
+ var r0, r1;
4772
+ return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
4773
+ };
4774
+ }
4775
+
4776
+ scale.range = range(interpolate);
4777
+
4778
+ scale.rangeRound = range(interpolateRound);
4779
+
4780
+ scale.unknown = function(_) {
4781
+ return arguments.length ? (unknown = _, scale) : unknown;
4782
+ };
4783
+
4784
+ return function(t) {
4785
+ transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);
4786
+ return scale;
4787
+ };
4788
+ }
4789
+
4790
+ function copy(source, target) {
4791
+ return target
4792
+ .domain(source.domain())
4793
+ .interpolator(source.interpolator())
4794
+ .clamp(source.clamp())
4795
+ .unknown(source.unknown());
4796
+ }
4797
+
4798
+ function sequential() {
4799
+ var scale = linearish(transformer()(identity$1));
4800
+
4801
+ scale.copy = function() {
4802
+ return copy(scale, sequential());
4803
+ };
4804
+
4805
+ return initInterpolator.apply(scale, arguments);
4806
+ }
4807
+
4808
+ const COLOR_BASE = "#cecece";
4809
+
4810
+ // https://www.w3.org/TR/WCAG20/#relativeluminancedef
4811
+ const rc = 0.2126;
4812
+ const gc = 0.7152;
4813
+ const bc = 0.0722;
4814
+ // low-gamma adjust coefficient
4815
+ const lowc = 1 / 12.92;
4816
+ function adjustGamma(p) {
4817
+ return Math.pow((p + 0.055) / 1.055, 2.4);
4818
+ }
4819
+ function relativeLuminance(o) {
4820
+ const rsrgb = o.r / 255;
4821
+ const gsrgb = o.g / 255;
4822
+ const bsrgb = o.b / 255;
4823
+ const r = rsrgb <= 0.03928 ? rsrgb * lowc : adjustGamma(rsrgb);
4824
+ const g = gsrgb <= 0.03928 ? gsrgb * lowc : adjustGamma(gsrgb);
4825
+ const b = bsrgb <= 0.03928 ? bsrgb * lowc : adjustGamma(bsrgb);
4826
+ return r * rc + g * gc + b * bc;
4827
+ }
4828
+ const createRainbowColor = (root) => {
4829
+ const colorParentMap = new Map();
4830
+ colorParentMap.set(root, COLOR_BASE);
4831
+ if (root.children != null) {
4832
+ const colorScale = sequential([0, root.children.length], (n) => hsl(360 * n, 0.3, 0.85));
4833
+ root.children.forEach((c, id) => {
4834
+ colorParentMap.set(c, colorScale(id).toString());
4835
+ });
4836
+ }
4837
+ const colorMap = new Map();
4838
+ const lightScale = linear().domain([0, root.height]).range([0.9, 0.3]);
4839
+ const getBackgroundColor = (node) => {
4840
+ const parents = node.ancestors();
4841
+ const colorStr = parents.length === 1
4842
+ ? colorParentMap.get(parents[0])
4843
+ : colorParentMap.get(parents[parents.length - 2]);
4844
+ const hslColor = hsl(colorStr);
4845
+ hslColor.l = lightScale(node.depth);
4846
+ return hslColor;
4847
+ };
4848
+ return (node) => {
4849
+ if (!colorMap.has(node)) {
4850
+ const backgroundColor = getBackgroundColor(node);
4851
+ const l = relativeLuminance(backgroundColor.rgb());
4852
+ const fontColor = l > 0.19 ? "#000" : "#fff";
4853
+ colorMap.set(node, {
4854
+ backgroundColor: backgroundColor.toString(),
4855
+ fontColor,
4856
+ });
4857
+ }
4858
+ return colorMap.get(node);
4859
+ };
4860
+ };
4861
+
4862
+ const StaticContext = K({});
4863
+ const drawChart = (parentNode, data, width, height) => {
4864
+ const availableSizeProperties = getAvailableSizeOptions(data.options);
4865
+ console.time("layout create");
4866
+ const layout = treemap()
4867
+ .size([width, height])
4868
+ .paddingOuter(PADDING)
4869
+ .paddingTop(TOP_PADDING)
4870
+ .paddingInner(PADDING)
4871
+ .round(true)
4872
+ .tile(treemapResquarify);
4873
+ console.timeEnd("layout create");
4874
+ console.time("rawHierarchy create");
4875
+ const rawHierarchy = hierarchy(data.tree);
4876
+ console.timeEnd("rawHierarchy create");
4877
+ const nodeSizesCache = new Map();
4878
+ const nodeIdsCache = new Map();
4879
+ const getModuleSize = (node, sizeKey) => { var _a, _b; return (_b = (_a = nodeSizesCache.get(node)) === null || _a === void 0 ? void 0 : _a[sizeKey]) !== null && _b !== void 0 ? _b : 0; };
4880
+ console.time("rawHierarchy eachAfter cache");
4881
+ rawHierarchy.eachAfter((node) => {
4882
+ var _a;
4883
+ const nodeData = node.data;
4884
+ nodeIdsCache.set(nodeData, {
4885
+ nodeUid: generateUniqueId("node"),
4886
+ clipUid: generateUniqueId("clip"),
4887
+ });
4888
+ const sizes = { renderedLength: 0, gzipLength: 0, brotliLength: 0 };
4889
+ if (isModuleTree(nodeData)) {
4890
+ for (const sizeKey of availableSizeProperties) {
4891
+ sizes[sizeKey] = nodeData.children.reduce((acc, child) => getModuleSize(child, sizeKey) + acc, 0);
4892
+ }
4893
+ }
4894
+ else {
4895
+ for (const sizeKey of availableSizeProperties) {
4896
+ sizes[sizeKey] = (_a = data.nodeParts[nodeData.uid][sizeKey]) !== null && _a !== void 0 ? _a : 0;
4897
+ }
4898
+ }
4899
+ nodeSizesCache.set(nodeData, sizes);
4900
+ });
4901
+ console.timeEnd("rawHierarchy eachAfter cache");
4902
+ const getModuleIds = (node) => nodeIdsCache.get(node);
4903
+ console.time("color");
4904
+ const getModuleColor = createRainbowColor(rawHierarchy);
4905
+ console.timeEnd("color");
4906
+ E(u$1(StaticContext.Provider, { value: {
4907
+ data,
4908
+ availableSizeProperties,
4909
+ width,
4910
+ height,
4911
+ getModuleSize,
4912
+ getModuleIds,
4913
+ getModuleColor,
4914
+ rawHierarchy,
4915
+ layout,
4916
+ }, children: u$1(Main, {}) }), parentNode);
4917
+ };
4918
+
4919
+ exports.StaticContext = StaticContext;
4920
+ exports.default = drawChart;
4921
+
4922
+ Object.defineProperty(exports, '__esModule', { value: true });
4923
+
4924
+ return exports;
4925
+
4926
+ })({});
4927
+
4928
+ /*-->*/
4929
+ </script>
4930
+ <script>
4931
+ /*<!--*/
4932
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"ElementPlusSearch.umd.js","children":[{"name":"D:/gitee/element-plus-search/src","children":[{"uid":"f8a336ce-1","name":"SearchTagsRender.vue?vue&type=script&setup=true&lang.ts"},{"uid":"f8a336ce-3","name":"SearchTagsRender.vue?vue&type=style&index=0&lang.scss"},{"uid":"f8a336ce-5","name":"SearchTagsRender.vue"},{"name":"model","children":[{"uid":"f8a336ce-7","name":"SearchItem.ts"},{"uid":"f8a336ce-9","name":"SearchConfig.ts"},{"uid":"f8a336ce-11","name":"SearchTag.ts"}]},{"uid":"f8a336ce-13","name":"SearchBarState.ts"},{"uid":"f8a336ce-15","name":"SearchItemRender.ts"},{"name":"setting","children":[{"uid":"f8a336ce-17","name":"use-setting.ts"},{"uid":"f8a336ce-19","name":"SearchSettingsDrawer.vue?vue&type=script&setup=true&lang.ts"},{"uid":"f8a336ce-21","name":"SearchSettingsDrawer.vue?vue&type=style&index=0&lang.scss"},{"uid":"f8a336ce-23","name":"SearchSettingsDrawer.vue"},{"uid":"f8a336ce-25","name":"SettingButton.vue?vue&type=script&setup=true&lang.ts"},{"uid":"f8a336ce-27","name":"SettingButton.vue"}]},{"uid":"f8a336ce-29","name":"SearchBar.vue?vue&type=script&setup=true&lang.ts"},{"uid":"f8a336ce-31","name":"SearchBar.vue?vue&type=style&index=0&lang.scss"},{"uid":"f8a336ce-33","name":"SearchBar.vue"},{"uid":"f8a336ce-35","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"f8a336ce-1":{"renderedLength":3005,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-0"},"f8a336ce-3":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-2"},"f8a336ce-5":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-4"},"f8a336ce-7":{"renderedLength":1359,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-6"},"f8a336ce-9":{"renderedLength":2807,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-8"},"f8a336ce-11":{"renderedLength":3377,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-10"},"f8a336ce-13":{"renderedLength":1977,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-12"},"f8a336ce-15":{"renderedLength":242,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-14"},"f8a336ce-17":{"renderedLength":1981,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-16"},"f8a336ce-19":{"renderedLength":2564,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-18"},"f8a336ce-21":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-20"},"f8a336ce-23":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-22"},"f8a336ce-25":{"renderedLength":1135,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-24"},"f8a336ce-27":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-26"},"f8a336ce-29":{"renderedLength":6019,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-28"},"f8a336ce-31":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-30"},"f8a336ce-33":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-32"},"f8a336ce-35":{"renderedLength":1004,"gzipLength":0,"brotliLength":0,"metaUid":"f8a336ce-34"}},"nodeMetas":{"f8a336ce-0":{"id":"D:/gitee/element-plus-search/src/SearchTagsRender.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-1"},"imported":[{"uid":"f8a336ce-38"},{"uid":"f8a336ce-39"}],"importedBy":[{"uid":"f8a336ce-4"}]},"f8a336ce-2":{"id":"D:/gitee/element-plus-search/src/SearchTagsRender.vue?vue&type=style&index=0&lang.scss","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-3"},"imported":[],"importedBy":[{"uid":"f8a336ce-4"}]},"f8a336ce-4":{"id":"D:/gitee/element-plus-search/src/SearchTagsRender.vue","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-5"},"imported":[{"uid":"f8a336ce-0"},{"uid":"f8a336ce-2"}],"importedBy":[{"uid":"f8a336ce-28"}]},"f8a336ce-6":{"id":"D:/gitee/element-plus-search/src/model/SearchItem.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-7"},"imported":[{"uid":"f8a336ce-36"}],"importedBy":[{"uid":"f8a336ce-12"},{"uid":"f8a336ce-8"}]},"f8a336ce-8":{"id":"D:/gitee/element-plus-search/src/model/SearchConfig.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-9"},"imported":[{"uid":"f8a336ce-6"},{"uid":"f8a336ce-36"}],"importedBy":[{"uid":"f8a336ce-12"}]},"f8a336ce-10":{"id":"D:/gitee/element-plus-search/src/model/SearchTag.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-11"},"imported":[{"uid":"f8a336ce-36"}],"importedBy":[{"uid":"f8a336ce-12"}]},"f8a336ce-12":{"id":"D:/gitee/element-plus-search/src/SearchBarState.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-13"},"imported":[{"uid":"f8a336ce-6"},{"uid":"f8a336ce-8"},{"uid":"f8a336ce-10"},{"uid":"f8a336ce-38"},{"uid":"f8a336ce-34"}],"importedBy":[{"uid":"f8a336ce-28"}]},"f8a336ce-14":{"id":"D:/gitee/element-plus-search/src/SearchItemRender.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-15"},"imported":[],"importedBy":[{"uid":"f8a336ce-28"}]},"f8a336ce-16":{"id":"D:/gitee/element-plus-search/src/setting/use-setting.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-17"},"imported":[{"uid":"f8a336ce-38"},{"uid":"f8a336ce-36"}],"importedBy":[{"uid":"f8a336ce-18"}]},"f8a336ce-18":{"id":"D:/gitee/element-plus-search/src/setting/SearchSettingsDrawer.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-19"},"imported":[{"uid":"f8a336ce-38"},{"uid":"f8a336ce-16"}],"importedBy":[{"uid":"f8a336ce-22"}]},"f8a336ce-20":{"id":"D:/gitee/element-plus-search/src/setting/SearchSettingsDrawer.vue?vue&type=style&index=0&lang.scss","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-21"},"imported":[],"importedBy":[{"uid":"f8a336ce-22"}]},"f8a336ce-22":{"id":"D:/gitee/element-plus-search/src/setting/SearchSettingsDrawer.vue","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-23"},"imported":[{"uid":"f8a336ce-18"},{"uid":"f8a336ce-20"}],"importedBy":[{"uid":"f8a336ce-24"}]},"f8a336ce-24":{"id":"D:/gitee/element-plus-search/src/setting/SettingButton.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-25"},"imported":[{"uid":"f8a336ce-38"},{"uid":"f8a336ce-41"},{"uid":"f8a336ce-22"}],"importedBy":[{"uid":"f8a336ce-26"}]},"f8a336ce-26":{"id":"D:/gitee/element-plus-search/src/setting/SettingButton.vue","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-27"},"imported":[{"uid":"f8a336ce-24"}],"importedBy":[{"uid":"f8a336ce-28"}]},"f8a336ce-28":{"id":"D:/gitee/element-plus-search/src/SearchBar.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-29"},"imported":[{"uid":"f8a336ce-38"},{"uid":"f8a336ce-36"},{"uid":"f8a336ce-4"},{"uid":"f8a336ce-12"},{"uid":"f8a336ce-14"},{"uid":"f8a336ce-39"},{"uid":"f8a336ce-26"},{"uid":"f8a336ce-40"}],"importedBy":[{"uid":"f8a336ce-32"}]},"f8a336ce-30":{"id":"D:/gitee/element-plus-search/src/SearchBar.vue?vue&type=style&index=0&lang.scss","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-31"},"imported":[],"importedBy":[{"uid":"f8a336ce-32"}]},"f8a336ce-32":{"id":"D:/gitee/element-plus-search/src/SearchBar.vue","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-33"},"imported":[{"uid":"f8a336ce-28"},{"uid":"f8a336ce-30"}],"importedBy":[{"uid":"f8a336ce-34"}]},"f8a336ce-34":{"id":"D:/gitee/element-plus-search/src/index.ts","moduleParts":{"ElementPlusSearch.umd.js":"f8a336ce-35"},"imported":[{"uid":"f8a336ce-36"},{"uid":"f8a336ce-37"},{"uid":"f8a336ce-32"}],"importedBy":[{"uid":"f8a336ce-12"}],"isEntry":true},"f8a336ce-36":{"id":"lodash-unified","moduleParts":{},"imported":[],"importedBy":[{"uid":"f8a336ce-34"},{"uid":"f8a336ce-28"},{"uid":"f8a336ce-6"},{"uid":"f8a336ce-8"},{"uid":"f8a336ce-10"},{"uid":"f8a336ce-16"}],"isExternal":true},"f8a336ce-37":{"id":"D:/gitee/element-plus-search/src/types/Searchable.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"f8a336ce-34"}]},"f8a336ce-38":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"f8a336ce-28"},{"uid":"f8a336ce-12"},{"uid":"f8a336ce-0"},{"uid":"f8a336ce-24"},{"uid":"f8a336ce-18"},{"uid":"f8a336ce-16"}],"isExternal":true},"f8a336ce-39":{"id":"@element-plus/icons-vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"f8a336ce-28"},{"uid":"f8a336ce-0"}],"isExternal":true},"f8a336ce-40":{"id":"@vueuse/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"f8a336ce-28"}],"isExternal":true},"f8a336ce-41":{"id":"@scvzerng/icons","moduleParts":{},"imported":[],"importedBy":[{"uid":"f8a336ce-24"}],"isExternal":true}},"env":{"rollup":"4.52.4"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4933
+
4934
+ const run = () => {
4935
+ const width = window.innerWidth;
4936
+ const height = window.innerHeight;
4937
+
4938
+ const chartNode = document.querySelector("main");
4939
+ drawChart.default(chartNode, data, width, height);
4940
+ };
4941
+
4942
+ window.addEventListener('resize', run);
4943
+
4944
+ document.addEventListener('DOMContentLoaded', run);
4945
+ /*-->*/
4946
+ </script>
4947
+ </body>
4948
+ </html>
4949
+