diff --git a/.github/workflows/frontend-build.yml b/.github/workflows/frontend-build.yml index 58b2a247a6..93de0b2dde 100644 --- a/.github/workflows/frontend-build.yml +++ b/.github/workflows/frontend-build.yml @@ -40,7 +40,7 @@ jobs: - name: Clone Deps Repositories uses: dbeaver/github-actions/clone-repositories@devel with: - project_deps_path: './cloudbeaver/project.deps' + project_deps_path: "./cloudbeaver/project.deps" token: ${{ secrets.DEVOPS_ISSUE_RO_TOKEN }} - run: corepack enable @@ -48,7 +48,17 @@ jobs: with: node-version: "lts/*" cache: "yarn" - cache-dependency-path: './cloudbeaver/webapp/yarn.lock' + cache-dependency-path: | + cloudbeaver/common-*/yarn.lock + cloudbeaver/webapp/yarn.lock + + - name: restore cloudbeaver-common typescript cache + uses: actions/cache@v4 + with: + path: "cloudbeaver/common-*/**/*/lib" + key: ${{ runner.os }}-common-dist-${{ hashFiles('cloudbeaver/common-*/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-common-dist- - name: restore typescript cache uses: actions/cache@v4 @@ -61,6 +71,12 @@ jobs: - if: inputs.clean-cache run: yarn clear + # - run: yarn install --immutable + # working-directory: ./cloudbeaver/common-typescript + + # - run: yarn install --immutable + # working-directory: ./cloudbeaver/common-react + - run: yarn install --immutable - run: yarn bundle diff --git a/.github/workflows/frontend-lint.yml b/.github/workflows/frontend-lint.yml index 95b0279c59..4c5ceacd73 100644 --- a/.github/workflows/frontend-lint.yml +++ b/.github/workflows/frontend-lint.yml @@ -29,6 +29,12 @@ jobs: cache: "yarn" cache-dependency-path: "./cloudbeaver/webapp/yarn.lock" + # - run: yarn install --immutable + # working-directory: ./cloudbeaver/common-typescript + + # - run: yarn install --immutable + # working-directory: ./cloudbeaver/common-react + - run: | yarn install --immutable git fetch origin "${{ github.base_ref }}" --depth=1 diff --git a/common-react/.yarn/plugins/@yarnpkg/plugin-ts-project-linker.cjs b/common-react/.yarn/plugins/@yarnpkg/plugin-ts-project-linker.cjs new file mode 100644 index 0000000000..39e5a79818 --- /dev/null +++ b/common-react/.yarn/plugins/@yarnpkg/plugin-ts-project-linker.cjs @@ -0,0 +1,74 @@ +/* eslint-disable */ +//prettier-ignore +module.exports = { +name: "@yarnpkg/plugin-ts-project-linker", +factory: function (require) { +var plugin=(()=>{var vl=Object.create;var kt=Object.defineProperty;var Sl=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Cl=Object.getPrototypeOf,bl=Object.prototype.hasOwnProperty;var O=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fl=(t,e)=>{for(var r in e)kt(t,r,{get:e[r],enumerable:!0})},as=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Al(e))!bl.call(t,a)&&a!==r&&kt(t,a,{get:()=>e[a],enumerable:!(i=Sl(e,a))||i.enumerable});return t};var ne=(t,e,r)=>(r=t!=null?vl(Cl(t)):{},as(e||!t||!t.__esModule?kt(r,"default",{value:t,enumerable:!0}):r,t)),wl=t=>as(kt({},"__esModule",{value:!0}),t);var ls=_((Z0,Fr)=>{var Bt=process||{},us=Bt.argv||[],Tt=Bt.env||{},_l=!(Tt.NO_COLOR||us.includes("--no-color"))&&(!!Tt.FORCE_COLOR||us.includes("--color")||Bt.platform==="win32"||(Bt.stdout||{}).isTTY&&Tt.TERM!=="dumb"||!!Tt.CI),kl=(t,e,r=t)=>i=>{let a=""+i,c=a.indexOf(e,t.length);return~c?t+Tl(a,e,r,c)+e:t+a+e},Tl=(t,e,r,i)=>{let a="",c=0;do a+=t.substring(c,i)+r,c=i+e.length,i=t.indexOf(e,c);while(~i);return a+t.substring(c)},cs=(t=_l)=>{let e=t?kl:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Fr.exports=cs();Fr.exports.createColors=cs});var hs=_((dt,wr)=>{(function(e,r){typeof dt=="object"&&typeof wr=="object"?wr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof dt=="object"?dt.esprima=r():e.esprima=r()})(dt,function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var a=e[i]={exports:{},id:i,loaded:!1};return t[i].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}return r.m=t,r.c=e,r.p="",r(0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=r(3),c=r(8),u=r(15);function x(l,n,s){var o=null,f=function(P,N){s&&s(P,N),o&&o.visit(P,N)},E=typeof s=="function"?f:null,g=!1;if(n){g=typeof n.comment=="boolean"&&n.comment;var v=typeof n.attachComment=="boolean"&&n.attachComment;(g||v)&&(o=new i.CommentHandler,o.attach=v,n.comment=!0,E=f)}var F=!1;n&&typeof n.sourceType=="string"&&(F=n.sourceType==="module");var A;n&&typeof n.jsx=="boolean"&&n.jsx?A=new a.JSXParser(l,n,E):A=new c.Parser(l,n,E);var T=F?A.parseModule():A.parseScript(),k=T;return g&&o&&(k.comments=o.comments),A.config.tokens&&(k.tokens=A.tokens),A.config.tolerant&&(k.errors=A.errorHandler.errors),k}e.parse=x;function d(l,n,s){var o=n||{};return o.sourceType="module",x(l,o,s)}e.parseModule=d;function p(l,n,s){var o=n||{};return o.sourceType="script",x(l,o,s)}e.parseScript=p;function h(l,n,s){var o=new u.Tokenizer(l,n),f;f=[];try{for(;;){var E=o.getNextToken();if(!E)break;s&&(E=s(E)),f.push(E)}}catch(g){o.errorHandler.tolerate(g)}return o.errorHandler.tolerant&&(f.errors=o.errors()),f}e.tokenize=h;var m=r(2);e.Syntax=m.Syntax,e.version="4.0.1"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2),a=function(){function c(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return c.prototype.insertInnerComments=function(u,x){if(u.type===i.Syntax.BlockStatement&&u.body.length===0){for(var d=[],p=this.leading.length-1;p>=0;--p){var h=this.leading[p];x.end.offset>=h.start&&(d.unshift(h.comment),this.leading.splice(p,1),this.trailing.splice(p,1))}d.length&&(u.innerComments=d)}},c.prototype.findTrailingComments=function(u){var x=[];if(this.trailing.length>0){for(var d=this.trailing.length-1;d>=0;--d){var p=this.trailing[d];p.start>=u.end.offset&&x.unshift(p.comment)}return this.trailing.length=0,x}var h=this.stack[this.stack.length-1];if(h&&h.node.trailingComments){var m=h.node.trailingComments[0];m&&m.range[0]>=u.end.offset&&(x=h.node.trailingComments,delete h.node.trailingComments)}return x},c.prototype.findLeadingComments=function(u){for(var x=[],d;this.stack.length>0;){var p=this.stack[this.stack.length-1];if(p&&p.start>=u.start.offset)d=p.node,this.stack.pop();else break}if(d){for(var h=d.leadingComments?d.leadingComments.length:0,m=h-1;m>=0;--m){var l=d.leadingComments[m];l.range[1]<=u.start.offset&&(x.unshift(l),d.leadingComments.splice(m,1))}return d.leadingComments&&d.leadingComments.length===0&&delete d.leadingComments,x}for(var m=this.leading.length-1;m>=0;--m){var p=this.leading[m];p.start<=u.start.offset&&(x.unshift(p.comment),this.leading.splice(m,1))}return x},c.prototype.visitNode=function(u,x){if(!(u.type===i.Syntax.Program&&u.body.length>0)){this.insertInnerComments(u,x);var d=this.findTrailingComments(x),p=this.findLeadingComments(x);p.length>0&&(u.leadingComments=p),d.length>0&&(u.trailingComments=d),this.stack.push({node:u,start:x.start.offset})}},c.prototype.visitComment=function(u,x){var d=u.type[0]==="L"?"Line":"Block",p={type:d,value:u.value};if(u.range&&(p.range=u.range),u.loc&&(p.loc=u.loc),this.comments.push(p),this.attach){var h={comment:{type:d,value:u.value,range:[x.start.offset,x.end.offset]},start:x.start.offset};u.loc&&(h.comment.loc=u.loc),u.type=d,this.leading.push(h),this.trailing.push(h)}},c.prototype.visit=function(u,x){u.type==="LineComment"?this.visitComment(u,x):u.type==="BlockComment"?this.visitComment(u,x):this.attach&&this.visitNode(u,x)},c}();e.CommentHandler=a},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,r){"use strict";var i=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,o){s.__proto__=o}||function(s,o){for(var f in o)o.hasOwnProperty(f)&&(s[f]=o[f])};return function(s,o){n(s,o);function f(){this.constructor=s}s.prototype=o===null?Object.create(o):(f.prototype=o.prototype,new f)}}();Object.defineProperty(e,"__esModule",{value:!0});var a=r(4),c=r(5),u=r(6),x=r(7),d=r(8),p=r(13),h=r(14);p.TokenName[100]="JSXIdentifier",p.TokenName[101]="JSXText";function m(n){var s;switch(n.type){case u.JSXSyntax.JSXIdentifier:var o=n;s=o.name;break;case u.JSXSyntax.JSXNamespacedName:var f=n;s=m(f.namespace)+":"+m(f.name);break;case u.JSXSyntax.JSXMemberExpression:var E=n;s=m(E.object)+"."+m(E.property);break;default:break}return s}var l=function(n){i(s,n);function s(o,f,E){return n.call(this,o,f,E)||this}return s.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():n.prototype.parsePrimaryExpression.call(this)},s.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},s.prototype.finishJSX=function(){this.nextToken()},s.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},s.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},s.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},s.prototype.scanXHTMLEntity=function(o){for(var f="&",E=!0,g=!1,v=!1,F=!1;!this.scanner.eof()&&E&&!g;){var A=this.scanner.source[this.scanner.index];if(A===o)break;if(g=A===";",f+=A,++this.scanner.index,!g)switch(f.length){case 2:v=A==="#";break;case 3:v&&(F=A==="x",E=F||a.Character.isDecimalDigit(A.charCodeAt(0)),v=v&&!F);break;default:E=E&&!(v&&!a.Character.isDecimalDigit(A.charCodeAt(0))),E=E&&!(F&&!a.Character.isHexDigit(A.charCodeAt(0)));break}}if(E&&g&&f.length>2){var T=f.substr(1,f.length-2);v&&T.length>1?f=String.fromCharCode(parseInt(T.substr(1),10)):F&&T.length>2?f=String.fromCharCode(parseInt("0"+T.substr(1),16)):!v&&!F&&h.XHTMLEntities[T]&&(f=h.XHTMLEntities[T])}return f},s.prototype.lexJSX=function(){var o=this.scanner.source.charCodeAt(this.scanner.index);if(o===60||o===62||o===47||o===58||o===61||o===123||o===125){var f=this.scanner.source[this.scanner.index++];return{type:7,value:f,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(o===34||o===39){for(var E=this.scanner.index,g=this.scanner.source[this.scanner.index++],v="";!this.scanner.eof();){var F=this.scanner.source[this.scanner.index++];if(F===g)break;F==="&"?v+=this.scanXHTMLEntity(g):v+=F}return{type:8,value:v,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:E,end:this.scanner.index}}if(o===46){var A=this.scanner.source.charCodeAt(this.scanner.index+1),T=this.scanner.source.charCodeAt(this.scanner.index+2),f=A===46&&T===46?"...":".",E=this.scanner.index;return this.scanner.index+=f.length,{type:7,value:f,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:E,end:this.scanner.index}}if(o===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(a.Character.isIdentifierStart(o)&&o!==92){var E=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var F=this.scanner.source.charCodeAt(this.scanner.index);if(a.Character.isIdentifierPart(F)&&F!==92)++this.scanner.index;else if(F===45)++this.scanner.index;else break}var k=this.scanner.source.slice(E,this.scanner.index);return{type:100,value:k,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:E,end:this.scanner.index}}return this.scanner.lex()},s.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var o=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(o)),o},s.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var o=this.scanner.index,f="";!this.scanner.eof();){var E=this.scanner.source[this.scanner.index];if(E==="{"||E==="<")break;++this.scanner.index,f+=E,a.Character.isLineTerminator(E.charCodeAt(0))&&(++this.scanner.lineNumber,E==="\r"&&this.scanner.source[this.scanner.index]===` +`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var g={type:101,value:f,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:o,end:this.scanner.index};return f.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(g)),g},s.prototype.peekJSXToken=function(){var o=this.scanner.saveState();this.scanner.scanComments();var f=this.lexJSX();return this.scanner.restoreState(o),f},s.prototype.expectJSX=function(o){var f=this.nextJSXToken();(f.type!==7||f.value!==o)&&this.throwUnexpectedToken(f)},s.prototype.matchJSX=function(o){var f=this.peekJSXToken();return f.type===7&&f.value===o},s.prototype.parseJSXIdentifier=function(){var o=this.createJSXNode(),f=this.nextJSXToken();return f.type!==100&&this.throwUnexpectedToken(f),this.finalize(o,new c.JSXIdentifier(f.value))},s.prototype.parseJSXElementName=function(){var o=this.createJSXNode(),f=this.parseJSXIdentifier();if(this.matchJSX(":")){var E=f;this.expectJSX(":");var g=this.parseJSXIdentifier();f=this.finalize(o,new c.JSXNamespacedName(E,g))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var v=f;this.expectJSX(".");var F=this.parseJSXIdentifier();f=this.finalize(o,new c.JSXMemberExpression(v,F))}return f},s.prototype.parseJSXAttributeName=function(){var o=this.createJSXNode(),f,E=this.parseJSXIdentifier();if(this.matchJSX(":")){var g=E;this.expectJSX(":");var v=this.parseJSXIdentifier();f=this.finalize(o,new c.JSXNamespacedName(g,v))}else f=E;return f},s.prototype.parseJSXStringLiteralAttribute=function(){var o=this.createJSXNode(),f=this.nextJSXToken();f.type!==8&&this.throwUnexpectedToken(f);var E=this.getTokenRaw(f);return this.finalize(o,new x.Literal(f.value,E))},s.prototype.parseJSXExpressionAttribute=function(){var o=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var f=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(o,new c.JSXExpressionContainer(f))},s.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},s.prototype.parseJSXNameValueAttribute=function(){var o=this.createJSXNode(),f=this.parseJSXAttributeName(),E=null;return this.matchJSX("=")&&(this.expectJSX("="),E=this.parseJSXAttributeValue()),this.finalize(o,new c.JSXAttribute(f,E))},s.prototype.parseJSXSpreadAttribute=function(){var o=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var f=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(o,new c.JSXSpreadAttribute(f))},s.prototype.parseJSXAttributes=function(){for(var o=[];!this.matchJSX("/")&&!this.matchJSX(">");){var f=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();o.push(f)}return o},s.prototype.parseJSXOpeningElement=function(){var o=this.createJSXNode();this.expectJSX("<");var f=this.parseJSXElementName(),E=this.parseJSXAttributes(),g=this.matchJSX("/");return g&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(o,new c.JSXOpeningElement(f,g,E))},s.prototype.parseJSXBoundaryElement=function(){var o=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var f=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(o,new c.JSXClosingElement(f))}var E=this.parseJSXElementName(),g=this.parseJSXAttributes(),v=this.matchJSX("/");return v&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(o,new c.JSXOpeningElement(E,v,g))},s.prototype.parseJSXEmptyExpression=function(){var o=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(o,new c.JSXEmptyExpression)},s.prototype.parseJSXExpressionContainer=function(){var o=this.createJSXNode();this.expectJSX("{");var f;return this.matchJSX("}")?(f=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),f=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(o,new c.JSXExpressionContainer(f))},s.prototype.parseJSXChildren=function(){for(var o=[];!this.scanner.eof();){var f=this.createJSXChildNode(),E=this.nextJSXText();if(E.start0){var F=this.finalize(o.node,new c.JSXElement(o.opening,o.children,o.closing));o=f[f.length-1],o.children.push(F),f.pop()}else break}}return o},s.prototype.parseJSXElement=function(){var o=this.createJSXNode(),f=this.parseJSXOpeningElement(),E=[],g=null;if(!f.selfClosing){var v=this.parseComplexJSXElement({node:o,opening:f,closing:g,children:E});E=v.children,g=v.closing}return this.finalize(o,new c.JSXElement(f,E,g))},s.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var o=this.parseJSXElement();return this.finishJSX(),o},s.prototype.isStartOfExpression=function(){return n.prototype.isStartOfExpression.call(this)||this.match("<")},s}(d.Parser);e.JSXParser=l},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(i){return i<65536?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10))+String.fromCharCode(56320+(i-65536&1023))},isWhiteSpace:function(i){return i===32||i===9||i===11||i===12||i===160||i>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(i)>=0},isLineTerminator:function(i){return i===10||i===13||i===8232||i===8233},isIdentifierStart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i===92||i>=128&&r.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(i))},isIdentifierPart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===92||i>=128&&r.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(i))},isDecimalDigit:function(i){return i>=48&&i<=57},isHexDigit:function(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102},isOctalDigit:function(i){return i>=48&&i<=55}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(6),a=function(){function o(f){this.type=i.JSXSyntax.JSXClosingElement,this.name=f}return o}();e.JSXClosingElement=a;var c=function(){function o(f,E,g){this.type=i.JSXSyntax.JSXElement,this.openingElement=f,this.children=E,this.closingElement=g}return o}();e.JSXElement=c;var u=function(){function o(){this.type=i.JSXSyntax.JSXEmptyExpression}return o}();e.JSXEmptyExpression=u;var x=function(){function o(f){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=f}return o}();e.JSXExpressionContainer=x;var d=function(){function o(f){this.type=i.JSXSyntax.JSXIdentifier,this.name=f}return o}();e.JSXIdentifier=d;var p=function(){function o(f,E){this.type=i.JSXSyntax.JSXMemberExpression,this.object=f,this.property=E}return o}();e.JSXMemberExpression=p;var h=function(){function o(f,E){this.type=i.JSXSyntax.JSXAttribute,this.name=f,this.value=E}return o}();e.JSXAttribute=h;var m=function(){function o(f,E){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=f,this.name=E}return o}();e.JSXNamespacedName=m;var l=function(){function o(f,E,g){this.type=i.JSXSyntax.JSXOpeningElement,this.name=f,this.selfClosing=E,this.attributes=g}return o}();e.JSXOpeningElement=l;var n=function(){function o(f){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=f}return o}();e.JSXSpreadAttribute=n;var s=function(){function o(f,E){this.type=i.JSXSyntax.JSXText,this.value=f,this.raw=E}return o}();e.JSXText=s},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2),a=function(){function D(y){this.type=i.Syntax.ArrayExpression,this.elements=y}return D}();e.ArrayExpression=a;var c=function(){function D(y){this.type=i.Syntax.ArrayPattern,this.elements=y}return D}();e.ArrayPattern=c;var u=function(){function D(y,w,M){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=y,this.body=w,this.generator=!1,this.expression=M,this.async=!1}return D}();e.ArrowFunctionExpression=u;var x=function(){function D(y,w,M){this.type=i.Syntax.AssignmentExpression,this.operator=y,this.left=w,this.right=M}return D}();e.AssignmentExpression=x;var d=function(){function D(y,w){this.type=i.Syntax.AssignmentPattern,this.left=y,this.right=w}return D}();e.AssignmentPattern=d;var p=function(){function D(y,w,M){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=y,this.body=w,this.generator=!1,this.expression=M,this.async=!0}return D}();e.AsyncArrowFunctionExpression=p;var h=function(){function D(y,w,M){this.type=i.Syntax.FunctionDeclaration,this.id=y,this.params=w,this.body=M,this.generator=!1,this.expression=!1,this.async=!0}return D}();e.AsyncFunctionDeclaration=h;var m=function(){function D(y,w,M){this.type=i.Syntax.FunctionExpression,this.id=y,this.params=w,this.body=M,this.generator=!1,this.expression=!1,this.async=!0}return D}();e.AsyncFunctionExpression=m;var l=function(){function D(y){this.type=i.Syntax.AwaitExpression,this.argument=y}return D}();e.AwaitExpression=l;var n=function(){function D(y,w,M){var ae=y==="||"||y==="&&";this.type=ae?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=y,this.left=w,this.right=M}return D}();e.BinaryExpression=n;var s=function(){function D(y){this.type=i.Syntax.BlockStatement,this.body=y}return D}();e.BlockStatement=s;var o=function(){function D(y){this.type=i.Syntax.BreakStatement,this.label=y}return D}();e.BreakStatement=o;var f=function(){function D(y,w){this.type=i.Syntax.CallExpression,this.callee=y,this.arguments=w}return D}();e.CallExpression=f;var E=function(){function D(y,w){this.type=i.Syntax.CatchClause,this.param=y,this.body=w}return D}();e.CatchClause=E;var g=function(){function D(y){this.type=i.Syntax.ClassBody,this.body=y}return D}();e.ClassBody=g;var v=function(){function D(y,w,M){this.type=i.Syntax.ClassDeclaration,this.id=y,this.superClass=w,this.body=M}return D}();e.ClassDeclaration=v;var F=function(){function D(y,w,M){this.type=i.Syntax.ClassExpression,this.id=y,this.superClass=w,this.body=M}return D}();e.ClassExpression=F;var A=function(){function D(y,w){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=y,this.property=w}return D}();e.ComputedMemberExpression=A;var T=function(){function D(y,w,M){this.type=i.Syntax.ConditionalExpression,this.test=y,this.consequent=w,this.alternate=M}return D}();e.ConditionalExpression=T;var k=function(){function D(y){this.type=i.Syntax.ContinueStatement,this.label=y}return D}();e.ContinueStatement=k;var P=function(){function D(){this.type=i.Syntax.DebuggerStatement}return D}();e.DebuggerStatement=P;var N=function(){function D(y,w){this.type=i.Syntax.ExpressionStatement,this.expression=y,this.directive=w}return D}();e.Directive=N;var U=function(){function D(y,w){this.type=i.Syntax.DoWhileStatement,this.body=y,this.test=w}return D}();e.DoWhileStatement=U;var S=function(){function D(){this.type=i.Syntax.EmptyStatement}return D}();e.EmptyStatement=S;var j=function(){function D(y){this.type=i.Syntax.ExportAllDeclaration,this.source=y}return D}();e.ExportAllDeclaration=j;var J=function(){function D(y){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=y}return D}();e.ExportDefaultDeclaration=J;var ye=function(){function D(y,w,M){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=y,this.specifiers=w,this.source=M}return D}();e.ExportNamedDeclaration=ye;var C=function(){function D(y,w){this.type=i.Syntax.ExportSpecifier,this.exported=w,this.local=y}return D}();e.ExportSpecifier=C;var b=function(){function D(y){this.type=i.Syntax.ExpressionStatement,this.expression=y}return D}();e.ExpressionStatement=b;var Y=function(){function D(y,w,M){this.type=i.Syntax.ForInStatement,this.left=y,this.right=w,this.body=M,this.each=!1}return D}();e.ForInStatement=Y;var $=function(){function D(y,w,M){this.type=i.Syntax.ForOfStatement,this.left=y,this.right=w,this.body=M}return D}();e.ForOfStatement=$;var he=function(){function D(y,w,M,ae){this.type=i.Syntax.ForStatement,this.init=y,this.test=w,this.update=M,this.body=ae}return D}();e.ForStatement=he;var fe=function(){function D(y,w,M,ae){this.type=i.Syntax.FunctionDeclaration,this.id=y,this.params=w,this.body=M,this.generator=ae,this.expression=!1,this.async=!1}return D}();e.FunctionDeclaration=fe;var ie=function(){function D(y,w,M,ae){this.type=i.Syntax.FunctionExpression,this.id=y,this.params=w,this.body=M,this.generator=ae,this.expression=!1,this.async=!1}return D}();e.FunctionExpression=ie;var Ye=function(){function D(y){this.type=i.Syntax.Identifier,this.name=y}return D}();e.Identifier=Ye;var Ar=function(){function D(y,w,M){this.type=i.Syntax.IfStatement,this.test=y,this.consequent=w,this.alternate=M}return D}();e.IfStatement=Ar;var Qe=function(){function D(y,w){this.type=i.Syntax.ImportDeclaration,this.specifiers=y,this.source=w}return D}();e.ImportDeclaration=Qe;var we=function(){function D(y){this.type=i.Syntax.ImportDefaultSpecifier,this.local=y}return D}();e.ImportDefaultSpecifier=we;var X=function(){function D(y){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=y}return D}();e.ImportNamespaceSpecifier=X;var Ze=function(){function D(y,w){this.type=i.Syntax.ImportSpecifier,this.local=y,this.imported=w}return D}();e.ImportSpecifier=Ze;var Cr=function(){function D(y,w){this.type=i.Syntax.LabeledStatement,this.label=y,this.body=w}return D}();e.LabeledStatement=Cr;var R=function(){function D(y,w){this.type=i.Syntax.Literal,this.value=y,this.raw=w}return D}();e.Literal=R;var z=function(){function D(y,w){this.type=i.Syntax.MetaProperty,this.meta=y,this.property=w}return D}();e.MetaProperty=z;var B=function(){function D(y,w,M,ae,br){this.type=i.Syntax.MethodDefinition,this.key=y,this.computed=w,this.value=M,this.kind=ae,this.static=br}return D}();e.MethodDefinition=B;var H=function(){function D(y){this.type=i.Syntax.Program,this.body=y,this.sourceType="module"}return D}();e.Module=H;var q=function(){function D(y,w){this.type=i.Syntax.NewExpression,this.callee=y,this.arguments=w}return D}();e.NewExpression=q;var Q=function(){function D(y){this.type=i.Syntax.ObjectExpression,this.properties=y}return D}();e.ObjectExpression=Q;var K=function(){function D(y){this.type=i.Syntax.ObjectPattern,this.properties=y}return D}();e.ObjectPattern=K;var pt=function(){function D(y,w,M,ae,br,yl){this.type=i.Syntax.Property,this.key=w,this.computed=M,this.value=ae,this.kind=y,this.method=br,this.shorthand=yl}return D}();e.Property=pt;var et=function(){function D(y,w,M,ae){this.type=i.Syntax.Literal,this.value=y,this.raw=w,this.regex={pattern:M,flags:ae}}return D}();e.RegexLiteral=et;var Qc=function(){function D(y){this.type=i.Syntax.RestElement,this.argument=y}return D}();e.RestElement=Qc;var Zc=function(){function D(y){this.type=i.Syntax.ReturnStatement,this.argument=y}return D}();e.ReturnStatement=Zc;var el=function(){function D(y){this.type=i.Syntax.Program,this.body=y,this.sourceType="script"}return D}();e.Script=el;var tl=function(){function D(y){this.type=i.Syntax.SequenceExpression,this.expressions=y}return D}();e.SequenceExpression=tl;var rl=function(){function D(y){this.type=i.Syntax.SpreadElement,this.argument=y}return D}();e.SpreadElement=rl;var il=function(){function D(y,w){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=y,this.property=w}return D}();e.StaticMemberExpression=il;var nl=function(){function D(){this.type=i.Syntax.Super}return D}();e.Super=nl;var sl=function(){function D(y,w){this.type=i.Syntax.SwitchCase,this.test=y,this.consequent=w}return D}();e.SwitchCase=sl;var al=function(){function D(y,w){this.type=i.Syntax.SwitchStatement,this.discriminant=y,this.cases=w}return D}();e.SwitchStatement=al;var ol=function(){function D(y,w){this.type=i.Syntax.TaggedTemplateExpression,this.tag=y,this.quasi=w}return D}();e.TaggedTemplateExpression=ol;var ul=function(){function D(y,w){this.type=i.Syntax.TemplateElement,this.value=y,this.tail=w}return D}();e.TemplateElement=ul;var cl=function(){function D(y,w){this.type=i.Syntax.TemplateLiteral,this.quasis=y,this.expressions=w}return D}();e.TemplateLiteral=cl;var ll=function(){function D(){this.type=i.Syntax.ThisExpression}return D}();e.ThisExpression=ll;var hl=function(){function D(y){this.type=i.Syntax.ThrowStatement,this.argument=y}return D}();e.ThrowStatement=hl;var fl=function(){function D(y,w,M){this.type=i.Syntax.TryStatement,this.block=y,this.handler=w,this.finalizer=M}return D}();e.TryStatement=fl;var pl=function(){function D(y,w){this.type=i.Syntax.UnaryExpression,this.operator=y,this.argument=w,this.prefix=!0}return D}();e.UnaryExpression=pl;var dl=function(){function D(y,w,M){this.type=i.Syntax.UpdateExpression,this.operator=y,this.argument=w,this.prefix=M}return D}();e.UpdateExpression=dl;var ml=function(){function D(y,w){this.type=i.Syntax.VariableDeclaration,this.declarations=y,this.kind=w}return D}();e.VariableDeclaration=ml;var xl=function(){function D(y,w){this.type=i.Syntax.VariableDeclarator,this.id=y,this.init=w}return D}();e.VariableDeclarator=xl;var El=function(){function D(y,w){this.type=i.Syntax.WhileStatement,this.test=y,this.body=w}return D}();e.WhileStatement=El;var gl=function(){function D(y,w){this.type=i.Syntax.WithStatement,this.object=y,this.body=w}return D}();e.WithStatement=gl;var Dl=function(){function D(y,w){this.type=i.Syntax.YieldExpression,this.argument=y,this.delegate=w}return D}();e.YieldExpression=Dl},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(9),a=r(10),c=r(11),u=r(7),x=r(12),d=r(2),p=r(13),h="ArrowParameterPlaceHolder",m=function(){function l(n,s,o){s===void 0&&(s={}),this.config={range:typeof s.range=="boolean"&&s.range,loc:typeof s.loc=="boolean"&&s.loc,source:null,tokens:typeof s.tokens=="boolean"&&s.tokens,comment:typeof s.comment=="boolean"&&s.comment,tolerant:typeof s.tolerant=="boolean"&&s.tolerant},this.config.loc&&s.source&&s.source!==null&&(this.config.source=String(s.source)),this.delegate=o,this.errorHandler=new a.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new x.Scanner(n,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return l.prototype.throwError=function(n){for(var s=[],o=1;o0&&this.delegate)for(var s=0;s>="||n===">>>="||n==="&="||n==="^="||n==="|="},l.prototype.isolateCoverGrammar=function(n){var s=this.context.isBindingElement,o=this.context.isAssignmentTarget,f=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var E=n.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=s,this.context.isAssignmentTarget=o,this.context.firstCoverInitializedNameError=f,E},l.prototype.inheritCoverGrammar=function(n){var s=this.context.isBindingElement,o=this.context.isAssignmentTarget,f=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var E=n.call(this);return this.context.isBindingElement=this.context.isBindingElement&&s,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&o,this.context.firstCoverInitializedNameError=f||this.context.firstCoverInitializedNameError,E},l.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type!==2&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},l.prototype.parsePrimaryExpression=function(){var n=this.createNode(),s,o,f;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),s=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(n,new u.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,c.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),f=this.getTokenRaw(o),s=this.finalize(n,new u.Literal(o.value,f));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),f=this.getTokenRaw(o),s=this.finalize(n,new u.Literal(o.value==="true",f));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),f=this.getTokenRaw(o),s=this.finalize(n,new u.Literal(null,f));break;case 10:s=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,s=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":s=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":s=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,o=this.nextRegexToken(),f=this.getTokenRaw(o),s=this.finalize(n,new u.RegexLiteral(o.regex,f,o.pattern,o.flags));break;default:s=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?s=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?s=this.finalize(n,new u.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?s=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),s=this.finalize(n,new u.ThisExpression)):this.matchKeyword("class")?s=this.parseClassExpression():s=this.throwUnexpectedToken(this.nextToken()));break;default:s=this.throwUnexpectedToken(this.nextToken())}return s},l.prototype.parseSpreadElement=function(){var n=this.createNode();this.expect("...");var s=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(n,new u.SpreadElement(s))},l.prototype.parseArrayInitializer=function(){var n=this.createNode(),s=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),s.push(null);else if(this.match("...")){var o=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),s.push(o)}else s.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(n,new u.ArrayExpression(s))},l.prototype.parsePropertyMethod=function(n){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var s=this.context.strict,o=this.context.allowStrictDirective;this.context.allowStrictDirective=n.simple;var f=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&n.firstRestricted&&this.tolerateUnexpectedToken(n.firstRestricted,n.message),this.context.strict&&n.stricted&&this.tolerateUnexpectedToken(n.stricted,n.message),this.context.strict=s,this.context.allowStrictDirective=o,f},l.prototype.parsePropertyMethodFunction=function(){var n=!1,s=this.createNode(),o=this.context.allowYield;this.context.allowYield=!0;var f=this.parseFormalParameters(),E=this.parsePropertyMethod(f);return this.context.allowYield=o,this.finalize(s,new u.FunctionExpression(null,f.params,E,n))},l.prototype.parsePropertyMethodAsyncFunction=function(){var n=this.createNode(),s=this.context.allowYield,o=this.context.await;this.context.allowYield=!1,this.context.await=!0;var f=this.parseFormalParameters(),E=this.parsePropertyMethod(f);return this.context.allowYield=s,this.context.await=o,this.finalize(n,new u.AsyncFunctionExpression(null,f.params,E))},l.prototype.parseObjectPropertyKey=function(){var n=this.createNode(),s=this.nextToken(),o;switch(s.type){case 8:case 6:this.context.strict&&s.octal&&this.tolerateUnexpectedToken(s,c.Messages.StrictOctalLiteral);var f=this.getTokenRaw(s);o=this.finalize(n,new u.Literal(s.value,f));break;case 3:case 1:case 5:case 4:o=this.finalize(n,new u.Identifier(s.value));break;case 7:s.value==="["?(o=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):o=this.throwUnexpectedToken(s);break;default:o=this.throwUnexpectedToken(s)}return o},l.prototype.isPropertyKey=function(n,s){return n.type===d.Syntax.Identifier&&n.name===s||n.type===d.Syntax.Literal&&n.value===s},l.prototype.parseObjectProperty=function(n){var s=this.createNode(),o=this.lookahead,f,E=null,g=null,v=!1,F=!1,A=!1,T=!1;if(o.type===3){var k=o.value;this.nextToken(),v=this.match("["),T=!this.hasLineTerminator&&k==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),E=T?this.parseObjectPropertyKey():this.finalize(s,new u.Identifier(k))}else this.match("*")?this.nextToken():(v=this.match("["),E=this.parseObjectPropertyKey());var P=this.qualifiedPropertyName(this.lookahead);if(o.type===3&&!T&&o.value==="get"&&P)f="get",v=this.match("["),E=this.parseObjectPropertyKey(),this.context.allowYield=!1,g=this.parseGetterMethod();else if(o.type===3&&!T&&o.value==="set"&&P)f="set",v=this.match("["),E=this.parseObjectPropertyKey(),g=this.parseSetterMethod();else if(o.type===7&&o.value==="*"&&P)f="init",v=this.match("["),E=this.parseObjectPropertyKey(),g=this.parseGeneratorMethod(),F=!0;else if(E||this.throwUnexpectedToken(this.lookahead),f="init",this.match(":")&&!T)!v&&this.isPropertyKey(E,"__proto__")&&(n.value&&this.tolerateError(c.Messages.DuplicateProtoProperty),n.value=!0),this.nextToken(),g=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))g=T?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),F=!0;else if(o.type===3){var k=this.finalize(s,new u.Identifier(o.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),A=!0;var N=this.isolateCoverGrammar(this.parseAssignmentExpression);g=this.finalize(s,new u.AssignmentPattern(k,N))}else A=!0,g=k}else this.throwUnexpectedToken(this.nextToken());return this.finalize(s,new u.Property(f,E,v,g,F,A))},l.prototype.parseObjectInitializer=function(){var n=this.createNode();this.expect("{");for(var s=[],o={value:!1};!this.match("}");)s.push(this.parseObjectProperty(o)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(n,new u.ObjectExpression(s))},l.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var n=this.createNode(),s=this.nextToken(),o=s.value,f=s.cooked;return this.finalize(n,new u.TemplateElement({raw:o,cooked:f},s.tail))},l.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var n=this.createNode(),s=this.nextToken(),o=s.value,f=s.cooked;return this.finalize(n,new u.TemplateElement({raw:o,cooked:f},s.tail))},l.prototype.parseTemplateLiteral=function(){var n=this.createNode(),s=[],o=[],f=this.parseTemplateHead();for(o.push(f);!f.tail;)s.push(this.parseExpression()),f=this.parseTemplateElement(),o.push(f);return this.finalize(n,new u.TemplateLiteral(o,s))},l.prototype.reinterpretExpressionAsPattern=function(n){switch(n.type){case d.Syntax.Identifier:case d.Syntax.MemberExpression:case d.Syntax.RestElement:case d.Syntax.AssignmentPattern:break;case d.Syntax.SpreadElement:n.type=d.Syntax.RestElement,this.reinterpretExpressionAsPattern(n.argument);break;case d.Syntax.ArrayExpression:n.type=d.Syntax.ArrayPattern;for(var s=0;s")||this.expect("=>"),n={type:h,params:[],async:!1};else{var s=this.lookahead,o=[];if(this.match("..."))n=this.parseRestElement(o),this.expect(")"),this.match("=>")||this.expect("=>"),n={type:h,params:[n],async:!1};else{var f=!1;if(this.context.isBindingElement=!0,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var E=[];for(this.context.isAssignmentTarget=!1,E.push(n);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var g=0;g")||this.expect("=>"),this.context.isBindingElement=!1;for(var g=0;g")&&(n.type===d.Syntax.Identifier&&n.name==="yield"&&(f=!0,n={type:h,params:[n],async:!1}),!f)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),n.type===d.Syntax.SequenceExpression)for(var g=0;g")){for(var F=0;F0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var E=[n,this.lookahead],g=s,v=this.isolateCoverGrammar(this.parseExponentiationExpression),F=[g,o.value,v],A=[f];f=this.binaryPrecedence(this.lookahead),!(f<=0);){for(;F.length>2&&f<=A[A.length-1];){v=F.pop();var T=F.pop();A.pop(),g=F.pop(),E.pop();var k=this.startNode(E[E.length-1]);F.push(this.finalize(k,new u.BinaryExpression(T,g,v)))}F.push(this.nextToken().value),A.push(f),E.push(this.lookahead),F.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var P=F.length-1;s=F[P];for(var N=E.pop();P>1;){var U=E.pop(),S=N&&N.lineStart,k=this.startNode(U,S),T=F[P-1];s=this.finalize(k,new u.BinaryExpression(T,F[P-2],s)),P-=2,N=U}}return s},l.prototype.parseConditionalExpression=function(){var n=this.lookahead,s=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var o=this.context.allowIn;this.context.allowIn=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=o,this.expect(":");var E=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(this.startNode(n),new u.ConditionalExpression(s,f,E)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return s},l.prototype.checkPatternParam=function(n,s){switch(s.type){case d.Syntax.Identifier:this.validateParam(n,s,s.name);break;case d.Syntax.RestElement:this.checkPatternParam(n,s.argument);break;case d.Syntax.AssignmentPattern:this.checkPatternParam(n,s.left);break;case d.Syntax.ArrayPattern:for(var o=0;o")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var E=n.async,g=this.reinterpretAsCoverFormalsList(n);if(g){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var v=this.context.strict,F=this.context.allowStrictDirective;this.context.allowStrictDirective=g.simple;var A=this.context.allowYield,T=this.context.await;this.context.allowYield=!0,this.context.await=E;var k=this.startNode(s);this.expect("=>");var P=void 0;if(this.match("{")){var N=this.context.allowIn;this.context.allowIn=!0,P=this.parseFunctionSourceElements(),this.context.allowIn=N}else P=this.isolateCoverGrammar(this.parseAssignmentExpression);var U=P.type!==d.Syntax.BlockStatement;this.context.strict&&g.firstRestricted&&this.throwUnexpectedToken(g.firstRestricted,g.message),this.context.strict&&g.stricted&&this.tolerateUnexpectedToken(g.stricted,g.message),n=E?this.finalize(k,new u.AsyncArrowFunctionExpression(g.params,P,U)):this.finalize(k,new u.ArrowFunctionExpression(g.params,P,U)),this.context.strict=v,this.context.allowStrictDirective=F,this.context.allowYield=A,this.context.await=T}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(c.Messages.InvalidLHSInAssignment),this.context.strict&&n.type===d.Syntax.Identifier){var S=n;this.scanner.isRestrictedWord(S.name)&&this.tolerateUnexpectedToken(o,c.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(S.name)&&this.tolerateUnexpectedToken(o,c.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(n):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),o=this.nextToken();var j=o.value,J=this.isolateCoverGrammar(this.parseAssignmentExpression);n=this.finalize(this.startNode(s),new u.AssignmentExpression(j,n,J)),this.context.firstCoverInitializedNameError=null}}return n},l.prototype.parseExpression=function(){var n=this.lookahead,s=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var o=[];for(o.push(s);this.lookahead.type!==2&&this.match(",");)this.nextToken(),o.push(this.isolateCoverGrammar(this.parseAssignmentExpression));s=this.finalize(this.startNode(n),new u.SequenceExpression(o))}return s},l.prototype.parseStatementListItem=function(){var n;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,c.Messages.IllegalExportDeclaration),n=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,c.Messages.IllegalImportDeclaration),n=this.parseImportDeclaration();break;case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"function":n=this.parseFunctionDeclaration();break;case"class":n=this.parseClassDeclaration();break;case"let":n=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:n=this.parseStatement();break}else n=this.parseStatement();return n},l.prototype.parseBlock=function(){var n=this.createNode();this.expect("{");for(var s=[];!this.match("}");)s.push(this.parseStatementListItem());return this.expect("}"),this.finalize(n,new u.BlockStatement(s))},l.prototype.parseLexicalBinding=function(n,s){var o=this.createNode(),f=[],E=this.parsePattern(f,n);this.context.strict&&E.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(E.name)&&this.tolerateError(c.Messages.StrictVarName);var g=null;return n==="const"?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),g=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(c.Messages.DeclarationMissingInitializer,"const")):(!s.inFor&&E.type!==d.Syntax.Identifier||this.match("="))&&(this.expect("="),g=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(o,new u.VariableDeclarator(E,g))},l.prototype.parseBindingList=function(n,s){for(var o=[this.parseLexicalBinding(n,s)];this.match(",");)this.nextToken(),o.push(this.parseLexicalBinding(n,s));return o},l.prototype.isLexicalDeclaration=function(){var n=this.scanner.saveState();this.scanner.scanComments();var s=this.scanner.lex();return this.scanner.restoreState(n),s.type===3||s.type===7&&s.value==="["||s.type===7&&s.value==="{"||s.type===4&&s.value==="let"||s.type===4&&s.value==="yield"},l.prototype.parseLexicalDeclaration=function(n){var s=this.createNode(),o=this.nextToken().value;i.assert(o==="let"||o==="const","Lexical declaration must be either let or const");var f=this.parseBindingList(o,n);return this.consumeSemicolon(),this.finalize(s,new u.VariableDeclaration(f,o))},l.prototype.parseBindingRestElement=function(n,s){var o=this.createNode();this.expect("...");var f=this.parsePattern(n,s);return this.finalize(o,new u.RestElement(f))},l.prototype.parseArrayPattern=function(n,s){var o=this.createNode();this.expect("[");for(var f=[];!this.match("]");)if(this.match(","))this.nextToken(),f.push(null);else{if(this.match("...")){f.push(this.parseBindingRestElement(n,s));break}else f.push(this.parsePatternWithDefault(n,s));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(o,new u.ArrayPattern(f))},l.prototype.parsePropertyPattern=function(n,s){var o=this.createNode(),f=!1,E=!1,g=!1,v,F;if(this.lookahead.type===3){var A=this.lookahead;v=this.parseVariableIdentifier();var T=this.finalize(o,new u.Identifier(A.value));if(this.match("=")){n.push(A),E=!0,this.nextToken();var k=this.parseAssignmentExpression();F=this.finalize(this.startNode(A),new u.AssignmentPattern(T,k))}else this.match(":")?(this.expect(":"),F=this.parsePatternWithDefault(n,s)):(n.push(A),E=!0,F=T)}else f=this.match("["),v=this.parseObjectPropertyKey(),this.expect(":"),F=this.parsePatternWithDefault(n,s);return this.finalize(o,new u.Property("init",v,f,F,g,E))},l.prototype.parseObjectPattern=function(n,s){var o=this.createNode(),f=[];for(this.expect("{");!this.match("}");)f.push(this.parsePropertyPattern(n,s)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(o,new u.ObjectPattern(f))},l.prototype.parsePattern=function(n,s){var o;return this.match("[")?o=this.parseArrayPattern(n,s):this.match("{")?o=this.parseObjectPattern(n,s):(this.matchKeyword("let")&&(s==="const"||s==="let")&&this.tolerateUnexpectedToken(this.lookahead,c.Messages.LetInLexicalBinding),n.push(this.lookahead),o=this.parseVariableIdentifier(s)),o},l.prototype.parsePatternWithDefault=function(n,s){var o=this.lookahead,f=this.parsePattern(n,s);if(this.match("=")){this.nextToken();var E=this.context.allowYield;this.context.allowYield=!0;var g=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=E,f=this.finalize(this.startNode(o),new u.AssignmentPattern(f,g))}return f},l.prototype.parseVariableIdentifier=function(n){var s=this.createNode(),o=this.nextToken();return o.type===4&&o.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(o,c.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(o):o.type!==3?this.context.strict&&o.type===4&&this.scanner.isStrictModeReservedWord(o.value)?this.tolerateUnexpectedToken(o,c.Messages.StrictReservedWord):(this.context.strict||o.value!=="let"||n!=="var")&&this.throwUnexpectedToken(o):(this.context.isModule||this.context.await)&&o.type===3&&o.value==="await"&&this.tolerateUnexpectedToken(o),this.finalize(s,new u.Identifier(o.value))},l.prototype.parseVariableDeclaration=function(n){var s=this.createNode(),o=[],f=this.parsePattern(o,"var");this.context.strict&&f.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(f.name)&&this.tolerateError(c.Messages.StrictVarName);var E=null;return this.match("=")?(this.nextToken(),E=this.isolateCoverGrammar(this.parseAssignmentExpression)):f.type!==d.Syntax.Identifier&&!n.inFor&&this.expect("="),this.finalize(s,new u.VariableDeclarator(f,E))},l.prototype.parseVariableDeclarationList=function(n){var s={inFor:n.inFor},o=[];for(o.push(this.parseVariableDeclaration(s));this.match(",");)this.nextToken(),o.push(this.parseVariableDeclaration(s));return o},l.prototype.parseVariableStatement=function(){var n=this.createNode();this.expectKeyword("var");var s=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(n,new u.VariableDeclaration(s,"var"))},l.prototype.parseEmptyStatement=function(){var n=this.createNode();return this.expect(";"),this.finalize(n,new u.EmptyStatement)},l.prototype.parseExpressionStatement=function(){var n=this.createNode(),s=this.parseExpression();return this.consumeSemicolon(),this.finalize(n,new u.ExpressionStatement(s))},l.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(c.Messages.StrictFunction),this.parseStatement()},l.prototype.parseIfStatement=function(){var n=this.createNode(),s,o=null;this.expectKeyword("if"),this.expect("(");var f=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),s=this.finalize(this.createNode(),new u.EmptyStatement)):(this.expect(")"),s=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),o=this.parseIfClause())),this.finalize(n,new u.IfStatement(f,s,o))},l.prototype.parseDoWhileStatement=function(){var n=this.createNode();this.expectKeyword("do");var s=this.context.inIteration;this.context.inIteration=!0;var o=this.parseStatement();this.context.inIteration=s,this.expectKeyword("while"),this.expect("(");var f=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(n,new u.DoWhileStatement(o,f))},l.prototype.parseWhileStatement=function(){var n=this.createNode(),s;this.expectKeyword("while"),this.expect("(");var o=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),s=this.finalize(this.createNode(),new u.EmptyStatement);else{this.expect(")");var f=this.context.inIteration;this.context.inIteration=!0,s=this.parseStatement(),this.context.inIteration=f}return this.finalize(n,new u.WhileStatement(o,s))},l.prototype.parseForStatement=function(){var n=null,s=null,o=null,f=!0,E,g,v=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var F=this.context.allowIn;this.context.allowIn=!1;var A=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=F,A.length===1&&this.matchKeyword("in")){var T=A[0];T.init&&(T.id.type===d.Syntax.ArrayPattern||T.id.type===d.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(c.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new u.VariableDeclaration(A,"var")),this.nextToken(),E=n,g=this.parseExpression(),n=null}else A.length===1&&A[0].init===null&&this.matchContextualKeyword("of")?(n=this.finalize(n,new u.VariableDeclaration(A,"var")),this.nextToken(),E=n,g=this.parseAssignmentExpression(),n=null,f=!1):(n=this.finalize(n,new u.VariableDeclaration(A,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var k=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")n=this.finalize(n,new u.Identifier(k)),this.nextToken(),E=n,g=this.parseExpression(),n=null;else{var F=this.context.allowIn;this.context.allowIn=!1;var A=this.parseBindingList(k,{inFor:!0});this.context.allowIn=F,A.length===1&&A[0].init===null&&this.matchKeyword("in")?(n=this.finalize(n,new u.VariableDeclaration(A,k)),this.nextToken(),E=n,g=this.parseExpression(),n=null):A.length===1&&A[0].init===null&&this.matchContextualKeyword("of")?(n=this.finalize(n,new u.VariableDeclaration(A,k)),this.nextToken(),E=n,g=this.parseAssignmentExpression(),n=null,f=!1):(this.consumeSemicolon(),n=this.finalize(n,new u.VariableDeclaration(A,k)))}}else{var P=this.lookahead,F=this.context.allowIn;if(this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=F,this.matchKeyword("in"))(!this.context.isAssignmentTarget||n.type===d.Syntax.AssignmentExpression)&&this.tolerateError(c.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),E=n,g=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))(!this.context.isAssignmentTarget||n.type===d.Syntax.AssignmentExpression)&&this.tolerateError(c.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),E=n,g=this.parseAssignmentExpression(),n=null,f=!1;else{if(this.match(",")){for(var N=[n];this.match(",");)this.nextToken(),N.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(P),new u.SequenceExpression(N))}this.expect(";")}}typeof E>"u"&&(this.match(";")||(s=this.parseExpression()),this.expect(";"),this.match(")")||(o=this.parseExpression()));var U;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),U=this.finalize(this.createNode(),new u.EmptyStatement);else{this.expect(")");var S=this.context.inIteration;this.context.inIteration=!0,U=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=S}return typeof E>"u"?this.finalize(v,new u.ForStatement(n,s,o,U)):f?this.finalize(v,new u.ForInStatement(E,g,U)):this.finalize(v,new u.ForOfStatement(E,g,U))},l.prototype.parseContinueStatement=function(){var n=this.createNode();this.expectKeyword("continue");var s=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var o=this.parseVariableIdentifier();s=o;var f="$"+o.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,f)||this.throwError(c.Messages.UnknownLabel,o.name)}return this.consumeSemicolon(),s===null&&!this.context.inIteration&&this.throwError(c.Messages.IllegalContinue),this.finalize(n,new u.ContinueStatement(s))},l.prototype.parseBreakStatement=function(){var n=this.createNode();this.expectKeyword("break");var s=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var o=this.parseVariableIdentifier(),f="$"+o.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,f)||this.throwError(c.Messages.UnknownLabel,o.name),s=o}return this.consumeSemicolon(),s===null&&!this.context.inIteration&&!this.context.inSwitch&&this.throwError(c.Messages.IllegalBreak),this.finalize(n,new u.BreakStatement(s))},l.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(c.Messages.IllegalReturn);var n=this.createNode();this.expectKeyword("return");var s=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,o=s?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(n,new u.ReturnStatement(o))},l.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(c.Messages.StrictModeWith);var n=this.createNode(),s;this.expectKeyword("with"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),s=this.finalize(this.createNode(),new u.EmptyStatement)):(this.expect(")"),s=this.parseStatement()),this.finalize(n,new u.WithStatement(o,s))},l.prototype.parseSwitchCase=function(){var n=this.createNode(),s;this.matchKeyword("default")?(this.nextToken(),s=null):(this.expectKeyword("case"),s=this.parseExpression()),this.expect(":");for(var o=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)o.push(this.parseStatementListItem());return this.finalize(n,new u.SwitchCase(s,o))},l.prototype.parseSwitchStatement=function(){var n=this.createNode();this.expectKeyword("switch"),this.expect("(");var s=this.parseExpression();this.expect(")");var o=this.context.inSwitch;this.context.inSwitch=!0;var f=[],E=!1;for(this.expect("{");!this.match("}");){var g=this.parseSwitchCase();g.test===null&&(E&&this.throwError(c.Messages.MultipleDefaultsInSwitch),E=!0),f.push(g)}return this.expect("}"),this.context.inSwitch=o,this.finalize(n,new u.SwitchStatement(s,f))},l.prototype.parseLabelledStatement=function(){var n=this.createNode(),s=this.parseExpression(),o;if(s.type===d.Syntax.Identifier&&this.match(":")){this.nextToken();var f=s,E="$"+f.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,E)&&this.throwError(c.Messages.Redeclaration,"Label",f.name),this.context.labelSet[E]=!0;var g=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),g=this.parseClassDeclaration();else if(this.matchKeyword("function")){var v=this.lookahead,F=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(v,c.Messages.StrictFunction):F.generator&&this.tolerateUnexpectedToken(v,c.Messages.GeneratorInLegacyContext),g=F}else g=this.parseStatement();delete this.context.labelSet[E],o=new u.LabeledStatement(f,g)}else this.consumeSemicolon(),o=new u.ExpressionStatement(s);return this.finalize(n,o)},l.prototype.parseThrowStatement=function(){var n=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(c.Messages.NewlineAfterThrow);var s=this.parseExpression();return this.consumeSemicolon(),this.finalize(n,new u.ThrowStatement(s))},l.prototype.parseCatchClause=function(){var n=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var s=[],o=this.parsePattern(s),f={},E=0;E0&&this.tolerateError(c.Messages.BadGetterArity);var E=this.parsePropertyMethod(f);return this.context.allowYield=o,this.finalize(n,new u.FunctionExpression(null,f.params,E,s))},l.prototype.parseSetterMethod=function(){var n=this.createNode(),s=!1,o=this.context.allowYield;this.context.allowYield=!s;var f=this.parseFormalParameters();f.params.length!==1?this.tolerateError(c.Messages.BadSetterArity):f.params[0]instanceof u.RestElement&&this.tolerateError(c.Messages.BadSetterRestParameter);var E=this.parsePropertyMethod(f);return this.context.allowYield=o,this.finalize(n,new u.FunctionExpression(null,f.params,E,s))},l.prototype.parseGeneratorMethod=function(){var n=this.createNode(),s=!0,o=this.context.allowYield;this.context.allowYield=!0;var f=this.parseFormalParameters();this.context.allowYield=!1;var E=this.parsePropertyMethod(f);return this.context.allowYield=o,this.finalize(n,new u.FunctionExpression(null,f.params,E,s))},l.prototype.isStartOfExpression=function(){var n=!0,s=this.lookahead.value;switch(this.lookahead.type){case 7:n=s==="["||s==="("||s==="{"||s==="+"||s==="-"||s==="!"||s==="~"||s==="++"||s==="--"||s==="/"||s==="/=";break;case 4:n=s==="class"||s==="delete"||s==="function"||s==="let"||s==="new"||s==="super"||s==="this"||s==="typeof"||s==="void"||s==="yield";break;default:break}return n},l.prototype.parseYieldExpression=function(){var n=this.createNode();this.expectKeyword("yield");var s=null,o=!1;if(!this.hasLineTerminator){var f=this.context.allowYield;this.context.allowYield=!1,o=this.match("*"),o?(this.nextToken(),s=this.parseAssignmentExpression()):this.isStartOfExpression()&&(s=this.parseAssignmentExpression()),this.context.allowYield=f}return this.finalize(n,new u.YieldExpression(s,o))},l.prototype.parseClassElement=function(n){var s=this.lookahead,o=this.createNode(),f="",E=null,g=null,v=!1,F=!1,A=!1,T=!1;if(this.match("*"))this.nextToken();else{v=this.match("["),E=this.parseObjectPropertyKey();var k=E;if(k.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(s=this.lookahead,A=!0,v=this.match("["),this.match("*")?this.nextToken():E=this.parseObjectPropertyKey()),s.type===3&&!this.hasLineTerminator&&s.value==="async"){var P=this.lookahead.value;P!==":"&&P!=="("&&P!=="*"&&(T=!0,s=this.lookahead,E=this.parseObjectPropertyKey(),s.type===3&&s.value==="constructor"&&this.tolerateUnexpectedToken(s,c.Messages.ConstructorIsAsync))}}var N=this.qualifiedPropertyName(this.lookahead);return s.type===3?s.value==="get"&&N?(f="get",v=this.match("["),E=this.parseObjectPropertyKey(),this.context.allowYield=!1,g=this.parseGetterMethod()):s.value==="set"&&N&&(f="set",v=this.match("["),E=this.parseObjectPropertyKey(),g=this.parseSetterMethod()):s.type===7&&s.value==="*"&&N&&(f="init",v=this.match("["),E=this.parseObjectPropertyKey(),g=this.parseGeneratorMethod(),F=!0),!f&&E&&this.match("(")&&(f="init",g=T?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),F=!0),f||this.throwUnexpectedToken(this.lookahead),f==="init"&&(f="method"),v||(A&&this.isPropertyKey(E,"prototype")&&this.throwUnexpectedToken(s,c.Messages.StaticPrototype),!A&&this.isPropertyKey(E,"constructor")&&((f!=="method"||!F||g&&g.generator)&&this.throwUnexpectedToken(s,c.Messages.ConstructorSpecialMethod),n.value?this.throwUnexpectedToken(s,c.Messages.DuplicateConstructor):n.value=!0,f="constructor")),this.finalize(o,new u.MethodDefinition(E,v,g,f,A))},l.prototype.parseClassElementList=function(){var n=[],s={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():n.push(this.parseClassElement(s));return this.expect("}"),n},l.prototype.parseClassBody=function(){var n=this.createNode(),s=this.parseClassElementList();return this.finalize(n,new u.ClassBody(s))},l.prototype.parseClassDeclaration=function(n){var s=this.createNode(),o=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var f=n&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),E=null;this.matchKeyword("extends")&&(this.nextToken(),E=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var g=this.parseClassBody();return this.context.strict=o,this.finalize(s,new u.ClassDeclaration(f,E,g))},l.prototype.parseClassExpression=function(){var n=this.createNode(),s=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var o=this.lookahead.type===3?this.parseVariableIdentifier():null,f=null;this.matchKeyword("extends")&&(this.nextToken(),f=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var E=this.parseClassBody();return this.context.strict=s,this.finalize(n,new u.ClassExpression(o,f,E))},l.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var n=this.createNode(),s=this.parseDirectivePrologues();this.lookahead.type!==2;)s.push(this.parseStatementListItem());return this.finalize(n,new u.Module(s))},l.prototype.parseScript=function(){for(var n=this.createNode(),s=this.parseDirectivePrologues();this.lookahead.type!==2;)s.push(this.parseStatementListItem());return this.finalize(n,new u.Script(s))},l.prototype.parseModuleSpecifier=function(){var n=this.createNode();this.lookahead.type!==8&&this.throwError(c.Messages.InvalidModuleSpecifier);var s=this.nextToken(),o=this.getTokenRaw(s);return this.finalize(n,new u.Literal(s.value,o))},l.prototype.parseImportSpecifier=function(){var n=this.createNode(),s,o;return this.lookahead.type===3?(s=this.parseVariableIdentifier(),o=s,this.matchContextualKeyword("as")&&(this.nextToken(),o=this.parseVariableIdentifier())):(s=this.parseIdentifierName(),o=s,this.matchContextualKeyword("as")?(this.nextToken(),o=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new u.ImportSpecifier(o,s))},l.prototype.parseNamedImports=function(){this.expect("{");for(var n=[];!this.match("}");)n.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),n},l.prototype.parseImportDefaultSpecifier=function(){var n=this.createNode(),s=this.parseIdentifierName();return this.finalize(n,new u.ImportDefaultSpecifier(s))},l.prototype.parseImportNamespaceSpecifier=function(){var n=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(c.Messages.NoAsAfterImportNamespace),this.nextToken();var s=this.parseIdentifierName();return this.finalize(n,new u.ImportNamespaceSpecifier(s))},l.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(c.Messages.IllegalImportDeclaration);var n=this.createNode();this.expectKeyword("import");var s,o=[];if(this.lookahead.type===8)s=this.parseModuleSpecifier();else{if(this.match("{")?o=o.concat(this.parseNamedImports()):this.match("*")?o.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(o.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?o.push(this.parseImportNamespaceSpecifier()):this.match("{")?o=o.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var f=this.lookahead.value?c.Messages.UnexpectedToken:c.Messages.MissingFromClause;this.throwError(f,this.lookahead.value)}this.nextToken(),s=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(n,new u.ImportDeclaration(o,s))},l.prototype.parseExportSpecifier=function(){var n=this.createNode(),s=this.parseIdentifierName(),o=s;return this.matchContextualKeyword("as")&&(this.nextToken(),o=this.parseIdentifierName()),this.finalize(n,new u.ExportSpecifier(s,o))},l.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(c.Messages.IllegalExportDeclaration);var n=this.createNode();this.expectKeyword("export");var s;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var o=this.parseFunctionDeclaration(!0);s=this.finalize(n,new u.ExportDefaultDeclaration(o))}else if(this.matchKeyword("class")){var o=this.parseClassDeclaration(!0);s=this.finalize(n,new u.ExportDefaultDeclaration(o))}else if(this.matchContextualKeyword("async")){var o=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();s=this.finalize(n,new u.ExportDefaultDeclaration(o))}else{this.matchContextualKeyword("from")&&this.throwError(c.Messages.UnexpectedToken,this.lookahead.value);var o=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),s=this.finalize(n,new u.ExportDefaultDeclaration(o))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var f=this.lookahead.value?c.Messages.UnexpectedToken:c.Messages.MissingFromClause;this.throwError(f,this.lookahead.value)}this.nextToken();var E=this.parseModuleSpecifier();this.consumeSemicolon(),s=this.finalize(n,new u.ExportAllDeclaration(E))}else if(this.lookahead.type===4){var o=void 0;switch(this.lookahead.value){case"let":case"const":o=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":o=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}s=this.finalize(n,new u.ExportNamedDeclaration(o,[],null))}else if(this.matchAsyncFunction()){var o=this.parseFunctionDeclaration();s=this.finalize(n,new u.ExportNamedDeclaration(o,[],null))}else{var g=[],v=null,F=!1;for(this.expect("{");!this.match("}");)F=F||this.matchKeyword("default"),g.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),v=this.parseModuleSpecifier(),this.consumeSemicolon();else if(F){var f=this.lookahead.value?c.Messages.UnexpectedToken:c.Messages.MissingFromClause;this.throwError(f,this.lookahead.value)}else this.consumeSemicolon();s=this.finalize(n,new u.ExportNamedDeclaration(null,g,v))}return s},l}();e.Parser=m},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function r(i,a){if(!i)throw new Error("ASSERT: "+a)}e.assert=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function i(){this.errors=[],this.tolerant=!1}return i.prototype.recordError=function(a){this.errors.push(a)},i.prototype.tolerate=function(a){if(this.tolerant)this.recordError(a);else throw a},i.prototype.constructError=function(a,c){var u=new Error(a);try{throw u}catch(x){Object.create&&Object.defineProperty&&(u=Object.create(x),Object.defineProperty(u,"column",{value:c}))}return u},i.prototype.createError=function(a,c,u,x){var d="Line "+c+": "+x,p=this.constructError(d,u);return p.index=a,p.lineNumber=c,p.description=x,p},i.prototype.throwError=function(a,c,u,x){throw this.createError(a,c,u,x)},i.prototype.tolerateError=function(a,c,u,x){var d=this.createError(a,c,u,x);if(this.tolerant)this.recordError(d);else throw d},i}();e.ErrorHandler=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(9),a=r(4),c=r(11);function u(p){return"0123456789abcdef".indexOf(p.toLowerCase())}function x(p){return"01234567".indexOf(p)}var d=function(){function p(h,m){this.source=h,this.errorHandler=m,this.trackComment=!1,this.isModule=!1,this.length=h.length,this.index=0,this.lineNumber=h.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return p.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},p.prototype.restoreState=function(h){this.index=h.index,this.lineNumber=h.lineNumber,this.lineStart=h.lineStart},p.prototype.eof=function(){return this.index>=this.length},p.prototype.throwUnexpectedToken=function(h){return h===void 0&&(h=c.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,h)},p.prototype.tolerateUnexpectedToken=function(h){h===void 0&&(h=c.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,h)},p.prototype.skipSingleLineComment=function(h){var m=[],l,n;for(this.trackComment&&(m=[],l=this.index-h,n={start:{line:this.lineNumber,column:this.index-this.lineStart-h},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,a.Character.isLineTerminator(s)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[l+h,this.index-1],range:[l,this.index-1],loc:n};m.push(o)}return s===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,m}}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var o={multiLine:!1,slice:[l+h,this.index],range:[l,this.index],loc:n};m.push(o)}return m},p.prototype.skipMultiLineComment=function(){var h=[],m,l;for(this.trackComment&&(h=[],m=this.index-2,l={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var n=this.source.charCodeAt(this.index);if(a.Character.isLineTerminator(n))n===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(n===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){l.end={line:this.lineNumber,column:this.index-this.lineStart};var s={multiLine:!0,slice:[m+2,this.index-2],range:[m,this.index],loc:l};h.push(s)}return h}++this.index}else++this.index}if(this.trackComment){l.end={line:this.lineNumber,column:this.index-this.lineStart};var s={multiLine:!0,slice:[m+2,this.index],range:[m,this.index],loc:l};h.push(s)}return this.tolerateUnexpectedToken(),h},p.prototype.scanComments=function(){var h;this.trackComment&&(h=[]);for(var m=this.index===0;!this.eof();){var l=this.source.charCodeAt(this.index);if(a.Character.isWhiteSpace(l))++this.index;else if(a.Character.isLineTerminator(l))++this.index,l===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,m=!0;else if(l===47)if(l=this.source.charCodeAt(this.index+1),l===47){this.index+=2;var n=this.skipSingleLineComment(2);this.trackComment&&(h=h.concat(n)),m=!0}else if(l===42){this.index+=2;var n=this.skipMultiLineComment();this.trackComment&&(h=h.concat(n))}else break;else if(m&&l===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var n=this.skipSingleLineComment(3);this.trackComment&&(h=h.concat(n))}else break;else if(l===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var n=this.skipSingleLineComment(4);this.trackComment&&(h=h.concat(n))}else break;else break}return h},p.prototype.isFutureReservedWord=function(h){switch(h){case"enum":case"export":case"import":case"super":return!0;default:return!1}},p.prototype.isStrictModeReservedWord=function(h){switch(h){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},p.prototype.isRestrictedWord=function(h){return h==="eval"||h==="arguments"},p.prototype.isKeyword=function(h){switch(h.length){case 2:return h==="if"||h==="in"||h==="do";case 3:return h==="var"||h==="for"||h==="new"||h==="try"||h==="let";case 4:return h==="this"||h==="else"||h==="case"||h==="void"||h==="with"||h==="enum";case 5:return h==="while"||h==="break"||h==="catch"||h==="throw"||h==="const"||h==="yield"||h==="class"||h==="super";case 6:return h==="return"||h==="typeof"||h==="delete"||h==="switch"||h==="export"||h==="import";case 7:return h==="default"||h==="finally"||h==="extends";case 8:return h==="function"||h==="continue"||h==="debugger";case 10:return h==="instanceof";default:return!1}},p.prototype.codePointAt=function(h){var m=this.source.charCodeAt(h);if(m>=55296&&m<=56319){var l=this.source.charCodeAt(h+1);if(l>=56320&&l<=57343){var n=m;m=(n-55296)*1024+l-56320+65536}}return m},p.prototype.scanHexEscape=function(h){for(var m=h==="u"?4:2,l=0,n=0;n1114111||h!=="}")&&this.throwUnexpectedToken(),a.Character.fromCodePoint(m)},p.prototype.getIdentifier=function(){for(var h=this.index++;!this.eof();){var m=this.source.charCodeAt(this.index);if(m===92)return this.index=h,this.getComplexIdentifier();if(m>=55296&&m<57343)return this.index=h,this.getComplexIdentifier();if(a.Character.isIdentifierPart(m))++this.index;else break}return this.source.slice(h,this.index)},p.prototype.getComplexIdentifier=function(){var h=this.codePointAt(this.index),m=a.Character.fromCodePoint(h);this.index+=m.length;var l;for(h===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,l=this.scanUnicodeCodePointEscape()):(l=this.scanHexEscape("u"),(l===null||l==="\\"||!a.Character.isIdentifierStart(l.charCodeAt(0)))&&this.throwUnexpectedToken()),m=l);!this.eof()&&(h=this.codePointAt(this.index),!!a.Character.isIdentifierPart(h));)l=a.Character.fromCodePoint(h),m+=l,this.index+=l.length,h===92&&(m=m.substr(0,m.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,l=this.scanUnicodeCodePointEscape()):(l=this.scanHexEscape("u"),(l===null||l==="\\"||!a.Character.isIdentifierPart(l.charCodeAt(0)))&&this.throwUnexpectedToken()),m+=l);return m},p.prototype.octalToDecimal=function(h){var m=h!=="0",l=x(h);return!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(m=!0,l=l*8+x(this.source[this.index++]),"0123".indexOf(h)>=0&&!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(l=l*8+x(this.source[this.index++]))),{code:l,octal:m}},p.prototype.scanIdentifier=function(){var h,m=this.index,l=this.source.charCodeAt(m)===92?this.getComplexIdentifier():this.getIdentifier();if(l.length===1?h=3:this.isKeyword(l)?h=4:l==="null"?h=5:l==="true"||l==="false"?h=1:h=3,h!==3&&m+l.length!==this.index){var n=this.index;this.index=m,this.tolerateUnexpectedToken(c.Messages.InvalidEscapedReservedWord),this.index=n}return{type:h,value:l,lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},p.prototype.scanPunctuator=function(){var h=this.index,m=this.source[this.index];switch(m){case"(":case"{":m==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,m="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:m=this.source.substr(this.index,4),m===">>>="?this.index+=4:(m=m.substr(0,3),m==="==="||m==="!=="||m===">>>"||m==="<<="||m===">>="||m==="**="?this.index+=3:(m=m.substr(0,2),m==="&&"||m==="||"||m==="=="||m==="!="||m==="+="||m==="-="||m==="*="||m==="/="||m==="++"||m==="--"||m==="<<"||m===">>"||m==="&="||m==="|="||m==="^="||m==="%="||m==="<="||m===">="||m==="=>"||m==="**"?this.index+=2:(m=this.source[this.index],"<>=!+-*%&|^/".indexOf(m)>=0&&++this.index)))}return this.index===h&&this.throwUnexpectedToken(),{type:7,value:m,lineNumber:this.lineNumber,lineStart:this.lineStart,start:h,end:this.index}},p.prototype.scanHexLiteral=function(h){for(var m="";!this.eof()&&a.Character.isHexDigit(this.source.charCodeAt(this.index));)m+=this.source[this.index++];return m.length===0&&this.throwUnexpectedToken(),a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+m,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:h,end:this.index}},p.prototype.scanBinaryLiteral=function(h){for(var m="",l;!this.eof()&&(l=this.source[this.index],!(l!=="0"&&l!=="1"));)m+=this.source[this.index++];return m.length===0&&this.throwUnexpectedToken(),this.eof()||(l=this.source.charCodeAt(this.index),(a.Character.isIdentifierStart(l)||a.Character.isDecimalDigit(l))&&this.throwUnexpectedToken()),{type:6,value:parseInt(m,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:h,end:this.index}},p.prototype.scanOctalLiteral=function(h,m){var l="",n=!1;for(a.Character.isOctalDigit(h.charCodeAt(0))?(n=!0,l="0"+this.source[this.index++]):++this.index;!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index));)l+=this.source[this.index++];return!n&&l.length===0&&this.throwUnexpectedToken(),(a.Character.isIdentifierStart(this.source.charCodeAt(this.index))||a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(l,8),octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},p.prototype.isImplicitOctalLiteral=function(){for(var h=this.index+1;h=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(o,f,E){var g=parseInt(f||E,16);return g>1114111&&s.throwUnexpectedToken(c.Messages.InvalidRegExp),g<=65535?String.fromCharCode(g):l}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l));try{RegExp(n)}catch{this.throwUnexpectedToken(c.Messages.InvalidRegExp)}try{return new RegExp(h,m)}catch{return null}},p.prototype.scanRegExpBody=function(){var h=this.source[this.index];i.assert(h==="/","Regular expression literal must start with a slash");for(var m=this.source[this.index++],l=!1,n=!1;!this.eof();)if(h=this.source[this.index++],m+=h,h==="\\")h=this.source[this.index++],a.Character.isLineTerminator(h.charCodeAt(0))&&this.throwUnexpectedToken(c.Messages.UnterminatedRegExp),m+=h;else if(a.Character.isLineTerminator(h.charCodeAt(0)))this.throwUnexpectedToken(c.Messages.UnterminatedRegExp);else if(l)h==="]"&&(l=!1);else if(h==="/"){n=!0;break}else h==="["&&(l=!0);return n||this.throwUnexpectedToken(c.Messages.UnterminatedRegExp),m.substr(1,m.length-2)},p.prototype.scanRegExpFlags=function(){for(var h="",m="";!this.eof();){var l=this.source[this.index];if(!a.Character.isIdentifierPart(l.charCodeAt(0)))break;if(++this.index,l==="\\"&&!this.eof())if(l=this.source[this.index],l==="u"){++this.index;var n=this.index,s=this.scanHexEscape("u");if(s!==null)for(m+=s,h+="\\u";n=55296&&h<57343&&a.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},p}();e.Scanner=d},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(10),a=r(12),c=r(13),u=function(){function d(){this.values=[],this.curly=this.paren=-1}return d.prototype.beforeFunctionExpression=function(p){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(p)>=0},d.prototype.isRegexStart=function(){var p=this.values[this.values.length-1],h=p!==null;switch(p){case"this":case"]":h=!1;break;case")":var m=this.values[this.paren-1];h=m==="if"||m==="while"||m==="for"||m==="with";break;case"}":if(h=!1,this.values[this.curly-3]==="function"){var l=this.values[this.curly-4];h=l?!this.beforeFunctionExpression(l):!1}else if(this.values[this.curly-4]==="function"){var l=this.values[this.curly-5];h=l?!this.beforeFunctionExpression(l):!0}break;default:break}return h},d.prototype.push=function(p){p.type===7||p.type===4?(p.value==="{"?this.curly=this.values.length:p.value==="("&&(this.paren=this.values.length),this.values.push(p.value)):this.values.push(null)},d}(),x=function(){function d(p,h){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=h?typeof h.tolerant=="boolean"&&h.tolerant:!1,this.scanner=new a.Scanner(p,this.errorHandler),this.scanner.trackComment=h?typeof h.comment=="boolean"&&h.comment:!1,this.trackRange=h?typeof h.range=="boolean"&&h.range:!1,this.trackLoc=h?typeof h.loc=="boolean"&&h.loc:!1,this.buffer=[],this.reader=new u}return d.prototype.errors=function(){return this.errorHandler.errors},d.prototype.getNextToken=function(){if(this.buffer.length===0){var p=this.scanner.scanComments();if(this.scanner.trackComment)for(var h=0;h{function Bl(t){return Array.isArray?Array.isArray(t):Pt(t)==="[object Array]"}Z.isArray=Bl;function Pl(t){return typeof t=="boolean"}Z.isBoolean=Pl;function Rl(t){return t===null}Z.isNull=Rl;function Il(t){return t==null}Z.isNullOrUndefined=Il;function Nl(t){return typeof t=="number"}Z.isNumber=Nl;function Ll(t){return typeof t=="string"}Z.isString=Ll;function Ol(t){return typeof t=="symbol"}Z.isSymbol=Ol;function Ml(t){return t===void 0}Z.isUndefined=Ml;function Hl(t){return Pt(t)==="[object RegExp]"}Z.isRegExp=Hl;function Xl(t){return typeof t=="object"&&t!==null}Z.isObject=Xl;function Ul(t){return Pt(t)==="[object Date]"}Z.isDate=Ul;function $l(t){return Pt(t)==="[object Error]"||t instanceof Error}Z.isError=$l;function jl(t){return typeof t=="function"}Z.isFunction=jl;function Jl(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}Z.isPrimitive=Jl;Z.isBuffer=O("buffer").Buffer.isBuffer;function Pt(t){return Object.prototype.toString.call(t)}});var Ds=_((tx,gs)=>{var fs=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],I,ps=t=>t<1e5?t<100?t<10?0:1:t<1e4?t<1e3?2:3:4:t<1e7?t<1e6?5:6:t<1e9?t<1e8?7:8:9;function ds(t,e){if(t===e)return 0;if(~~t===t&&~~e===e){if(t===0||e===0)return t=0)return-1;if(t>=0)return 1;t=-t,e=-e}let a=ps(t),c=ps(e),u=0;return ac&&(e*=fs[a-c-1],t/=10,u=1),t===e?u:t=32;)e|=t&1,t>>=1;return t+e}function ms(t,e,r,i){let a=e+1;if(a===r)return 1;if(i(t[a++],t[e])<0){for(;a=0;)a++;return a-e}function xs(t,e,r){for(r--;e>>1;a(c,t[h])<0?d=h:x=h+1}let p=i-x;switch(p){case 3:t[x+3]=t[x+2],I[x+3]=I[x+2];case 2:t[x+2]=t[x+1],I[x+2]=I[x+1];case 1:t[x+1]=t[x],I[x+1]=I[x];break;default:for(;p>0;)t[x+p]=t[x+p-1],I[x+p]=I[x+p-1],p--}t[x]=c,I[x]=u}}function _r(t,e,r,i,a,c){let u=0,x=0,d=1;if(c(t,e[r+a])>0){for(x=i-a;d0;)u=d,d=(d<<1)+1,d<=0&&(d=x);d>x&&(d=x),u+=a,d+=a}else{for(x=a+1;dx&&(d=x);let p=u;u=a-d,d=a-p}for(u++;u>>1);c(t,e[r+p])>0?u=p+1:d=p}return d}function kr(t,e,r,i,a,c){let u=0,x=0,d=1;if(c(t,e[r+a])<0){for(x=a+1;dx&&(d=x);let p=u;u=a-d,d=a-p}else{for(x=i-a;d=0;)u=d,d=(d<<1)+1,d<=0&&(d=x);d>x&&(d=x),u+=a,d+=a}for(u++;u>>1);c(t,e[r+p])<0?d=p:u=p+1}return d}var Tr=class{constructor(e,r){this.array=e,this.compare=r;let{length:i}=e;this.length=i,this.minGallop=7,this.tmpStorageLength=i<2*256?i>>>1:256,this.tmp=new Array(this.tmpStorageLength),this.tmpIndex=new Array(this.tmpStorageLength),this.stackLength=i<120?5:i<1542?10:i<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength),this.stackSize=0}pushRun(e,r){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=r,this.stackSize+=1}mergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;if(e>=1&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||e>=2&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]this.runLength[e+1])break;this.mergeAt(e)}}forceMergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;e>0&&this.runLength[e-1]=7||o>=7);if(f)break;n<0&&(n=0),n+=2}if(this.minGallop=n,n<1&&(this.minGallop=1),r===1){for(p=0;p=0;p--)u[s+p]=u[n+p],I[s+p]=I[n+p];u[l]=x[m],I[l]=d[m];return}let{minGallop:o}=this;for(;;){let f=0,E=0,g=!1;do if(c(x[m],u[h])<0){if(u[l]=u[h],I[l]=I[h],l--,h--,f++,E=0,--r===0){g=!0;break}}else if(u[l]=x[m],I[l]=d[m],l--,m--,E++,f=0,--a===1){g=!0;break}while((f|E)=0;p--)u[s+p]=u[n+p],I[s+p]=I[n+p];if(r===0){g=!0;break}}if(u[l]=x[m],I[l]=d[m],l--,m--,--a===1){g=!0;break}if(E=a-_r(u[h],x,0,a,a-1,c),E!==0){for(l-=E,m-=E,a-=E,s=l+1,n=m+1,p=0;p=7||E>=7);if(g)break;o<0&&(o=0),o+=2}if(this.minGallop=o,o<1&&(this.minGallop=1),a===1){for(l-=r,h-=r,s=l+1,n=h+1,p=r-1;p>=0;p--)u[s+p]=u[n+p],I[s+p]=I[n+p];u[l]=x[m],I[l]=d[m]}else{if(a===0)throw new Error("mergeHigh preconditions were not respected");for(n=l-(a-1),p=0;pp&&(h=p),Es(t,r,r+h,r+x,e),x=h}d.pushRun(r,x),d.mergeRuns(),u-=x,r+=x}while(u!==0);return d.forceMergeRuns(),I}gs.exports={sort:ql}});var vs=_((rx,ys)=>{"use strict";var Gl=Object.prototype.hasOwnProperty;ys.exports=(t,e)=>Gl.call(t,e)});var xt=_((ix,Ps)=>{var Rr=vs(),{isObject:Ss,isArray:Kl,isString:Wl,isNumber:Vl}=Rt(),Ir="before",Cs="after-prop",bs="after-colon",Fs="after-value",ws="after",_s="before-all",ks="after-all",Yl="[",Ql="]",Zl="{",eh="}",th=",",rh="",ih="-",Nr=[Ir,Cs,bs,Fs,ws],nh=[Ir,_s,ks].map(Symbol.for),Ts=":",As=void 0,mt=(t,e)=>Symbol.for(t+Ts+e),It=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),Pr=(t,e,r,i,a,c)=>{let u=mt(a,i);if(!Rr(e,u))return;let x=r===i?u:mt(a,r);It(t,x,e[u]),c&&delete e[u]},Bs=(t,e,r,i,a)=>{Nr.forEach(c=>{Pr(t,e,r,i,c,a)})},sh=(t,e,r)=>{e!==r&&Nr.forEach(i=>{let a=mt(i,r);if(!Rr(t,a)){Pr(t,t,r,e,i,!0);return}let c=t[a];delete t[a],Pr(t,t,r,e,i,!0),It(t,mt(i,e),c)})},Br=(t,e)=>{nh.forEach(r=>{let i=e[r];i&&It(t,r,i)})},ah=(t,e,r)=>(r.forEach(i=>{!Wl(i)&&!Vl(i)||Rr(e,i)&&(t[i]=e[i],Bs(t,e,i,i))}),t);Ps.exports={SYMBOL_PREFIXES:Nr,PREFIX_BEFORE:Ir,PREFIX_AFTER_PROP:Cs,PREFIX_AFTER_COLON:bs,PREFIX_AFTER_VALUE:Fs,PREFIX_AFTER:ws,PREFIX_BEFORE_ALL:_s,PREFIX_AFTER_ALL:ks,BRACKET_OPEN:Yl,BRACKET_CLOSE:Ql,CURLY_BRACKET_OPEN:Zl,CURLY_BRACKET_CLOSE:eh,COLON:Ts,COMMA:th,MINUS:ih,EMPTY:rh,UNDEFINED:As,symbol:mt,define:It,copy_comments:Bs,swap_comments:sh,assign_non_prop_comments:Br,assign(t,e,r){if(!Ss(t))throw new TypeError("Cannot convert undefined or null to object");if(!Ss(e))return t;if(r===As)r=Object.keys(e),Br(t,e);else if(Kl(r))r.length===0&&Br(t,e);else throw new TypeError("keys must be array or undefined");return ah(t,e,r)}}});var Or=_((nx,Os)=>{var{isArray:oh}=Rt(),{sort:uh}=Ds(),{SYMBOL_PREFIXES:ch,UNDEFINED:Rs,symbol:lh,copy_comments:hh,swap_comments:Ls}=xt(),fh=t=>{let{length:e}=t,r=0,i=e/2;for(;r{hh(t,e,r+i,r,a)},tt=(t,e,r,i,a,c)=>{if(a>0){let x=i;for(;x-- >0;)Is(t,e,r+x,a,c);return}let u=0;for(;u{ch.forEach(r=>{let i=lh(r,e);delete t[i]})},ph=(t,e)=>{let r=e;for(;r in t;)r=t[r];return r},Lr=class t extends Array{splice(...e){let{length:r}=this,i=super.splice(...e),[a,c,...u]=e;a<0&&(a+=r),arguments.length===1?c=r-a:c=Math.min(r-a,c);let{length:x}=u,d=x-c,p=a+c,h=r-p;return tt(this,this,p,h,d,!0),i}slice(...e){let{length:r}=this,i=super.slice(...e);if(!i.length)return new t;let[a,c]=e;return c===Rs?c=r:c<0&&(c+=r),a<0?a+=r:a===Rs&&(a=0),tt(i,this,a,c-a,-a),i}unshift(...e){let{length:r}=this,i=super.unshift(...e),{length:a}=e;return a>0&&tt(this,this,0,r,a,!0),i}shift(){let e=super.shift(),{length:r}=this;return Ns(this,0),tt(this,this,1,r,-1,!0),e}reverse(){return super.reverse(),fh(this),this}pop(){let e=super.pop();return Ns(this,this.length),e}concat(...e){let{length:r}=this,i=super.concat(...e);return e.length&&(tt(i,this,0,this.length,0),e.forEach(a=>{let c=r;r+=oh(a)?a.length:1,a instanceof t&&tt(i,a,0,a.length,c)})),i}sort(...e){let r=uh(this,...e.slice(0,1)),i=Object.create(null);return r.forEach((a,c)=>{if(a===c)return;let u=ph(i,a);u!==c&&(i[c]=u,Ls(this,c,u))}),this}};Os.exports={CommentArray:Lr}});var ea=_((sx,Zs)=>{var dh=hs(),{CommentArray:mh}=Or(),{PREFIX_BEFORE:Lt,PREFIX_AFTER_PROP:xh,PREFIX_AFTER_COLON:Eh,PREFIX_AFTER_VALUE:Us,PREFIX_AFTER:Hr,PREFIX_BEFORE_ALL:gh,PREFIX_AFTER_ALL:Dh,BRACKET_OPEN:yh,BRACKET_CLOSE:Ms,CURLY_BRACKET_OPEN:vh,CURLY_BRACKET_CLOSE:Hs,COLON:$s,COMMA:js,MINUS:Xs,EMPTY:Sh,UNDEFINED:Ht,define:Xr,assign_non_prop_comments:Ah}=xt(),Js=t=>dh.tokenize(t,{comment:!0,loc:!0}),Ur=[],Re=null,ve=null,$r=[],Ie,zs=!1,qs=!1,Et=null,gt=null,ee=null,Gs,Ot=null,Ks=()=>{$r.length=Ur.length=0,gt=null,Ie=Ht},Ch=()=>{Ks(),Et.length=0,ve=Re=Et=gt=ee=Ot=null},jr=t=>Symbol.for(Ie!==Ht?t+$s+Ie:t),Jr=(t,e)=>Ot?Ot(t,e):e,Ws=()=>{let t=new SyntaxError(`Unexpected token ${ee.value.slice(0,1)}`);throw Object.assign(t,ee.loc.start),t},Vs=()=>{let t=new SyntaxError("Unexpected end of JSON input");throw Object.assign(t,gt?gt.loc.end:{line:1,column:0}),t},pe=()=>{let t=Et[++Gs];qs=ee&&t&&ee.loc.end.line===t.loc.start.line||!1,gt=ee,ee=t},Mr=()=>(ee||Vs(),ee.type==="Punctuator"?ee.value:ee.type),je=t=>Mr()===t,Nt=t=>{je(t)||Ws()},zr=t=>{Ur.push(Re),Re=t},qr=()=>{Re=Ur.pop()},Ys=()=>{if(!ve)return;let t=[];for(let r of ve)if(r.inline)t.push(r);else break;let{length:e}=t;e&&(e===ve.length?ve=null:ve.splice(0,e),Xr(Re,jr(Hr),t))},Pe=t=>{ve&&(Xr(Re,jr(t),ve),ve=null)},Se=t=>{let e=[];for(;ee&&(je("LineComment")||je("BlockComment"));){let r={...ee,inline:qs};e.push(r),pe()}if(!zs&&e.length){if(t){Xr(Re,jr(t),e);return}ve=e}},Mt=(t,e)=>{e&&$r.push(Ie),Ie=t},Qs=()=>{Ie=$r.pop()},bh=()=>{let t={};zr(t),Mt(Ht,!0);let e=!1,r;for(Se();!je(Hs)&&!(e&&(Pe(Us),Nt(js),pe(),Se(),Ys(),je(Hs)));)e=!0,Nt("String"),r=JSON.parse(ee.value),Mt(r),Pe(Lt),pe(),Se(xh),Nt($s),pe(),Se(Eh),t[r]=Jr(r,Gr()),Se();return e&&Pe(Hr),pe(),Ie=void 0,e||Pe(Lt),qr(),Qs(),t},Fh=()=>{let t=new mh;zr(t),Mt(Ht,!0);let e=!1,r=0;for(Se();!je(Ms)&&!(e&&(Pe(Us),Nt(js),pe(),Se(),Ys(),je(Ms)));)e=!0,Mt(r),Pe(Lt),t[r]=Jr(r,Gr()),r++,Se();return e&&Pe(Hr),pe(),Ie=void 0,e||Pe(Lt),qr(),Qs(),t};function Gr(){let t=Mr();if(t===vh)return pe(),bh();if(t===yh)return pe(),Fh();let e=Sh;t===Xs&&(pe(),t=Mr(),e=Xs);let r;switch(t){case"String":case"Boolean":case"Null":case"Numeric":return r=ee.value,pe(),JSON.parse(e+r);default:}}var wh=t=>Object(t)===t,_h=(t,e,r)=>{Ks(),Et=Js(t),Ot=e,zs=r,Et.length||Vs(),Gs=-1,pe(),zr({}),Se(gh);let i=Gr();return Se(Dh),ee&&Ws(),!r&&i!==null&&(wh(i)||(i=new Object(i)),Ah(i,Re)),qr(),i=Jr("",i),Ch(),i};Zs.exports={parse:_h,tokenize:Js}});var ra=_((ax,ta)=>{"use strict";var _e="",Kr;ta.exports=kh;function kh(t,e){if(typeof t!="string")throw new TypeError("expected a string");if(e===1)return t;if(e===2)return t+t;var r=t.length*e;if(Kr!==t||typeof Kr>"u")Kr=t,_e="";else if(_e.length>=r)return _e.substr(0,r);for(;r>_e.length&&e>1;)e&1&&(_e+=t),e>>=1,t+=t;return _e+=t,_e=_e.substr(0,r),_e}});var pa=_((ox,fa)=>{var{isArray:Yr,isObject:ia,isFunction:Vr,isNumber:Th,isString:Bh}=Rt(),Ph=ra(),{PREFIX_BEFORE_ALL:Rh,PREFIX_BEFORE:na,PREFIX_AFTER_PROP:Ih,PREFIX_AFTER_COLON:Nh,PREFIX_AFTER_VALUE:Lh,PREFIX_AFTER:Qr,PREFIX_AFTER_ALL:Oh,BRACKET_OPEN:Mh,BRACKET_CLOSE:Hh,CURLY_BRACKET_OPEN:Xh,CURLY_BRACKET_CLOSE:Uh,COLON:$h,COMMA:sa,EMPTY:ue,UNDEFINED:jh}=xt(),Wr=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Zr=" ",Je=` +`,aa="null",oa=t=>`${na}:${t}`,Jh=t=>`${Ih}:${t}`,zh=t=>`${Nh}:${t}`,ua=t=>`${Lh}:${t}`,ca=t=>`${Qr}:${t}`,qh={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},Gh=t=>(Wr.lastIndex=0,Wr.test(t)?t.replace(Wr,e=>{let r=qh[e];return typeof r=="string"?r:e}):t),la=t=>`"${Gh(t)}"`,Kh=(t,e)=>e?`//${t}`:`/*${t}*/`,oe=(t,e,r,i)=>{let a=t[Symbol.for(e)];if(!a||!a.length)return ue;let c=!1,u=a.reduce((x,{inline:d,type:p,value:h})=>{let m=d?Zr:Je+r;return c=p==="LineComment",x+m+Kh(h,c)},ue);return i||c?u+Je+r:u},rt=null,yt=ue,Wh=()=>{rt=null,yt=ue},Dt=(t,e,r)=>t?e?t+e.trim()+Je+r:t.trimRight()+Je+r:e?e.trimRight()+Je+r:ue,ha=(t,e,r)=>{let i=oe(e,na,r+yt,!0);return Dt(i,t,r)},Vh=(t,e)=>{let r=e+yt,{length:i}=t,a=ue,c=ue;for(let u=0;u{if(!t)return"null";let r=e+yt,i=ue,a=ue,c=!0,u=Yr(rt)?rt:Object.keys(t),x=d=>{let p=ei(d,t,r);if(p===jh)return;c||(i+=sa),c=!1;let h=Dt(a,oe(t,oa(d),r),r);i+=h||Je+r,i+=la(d)+oe(t,Jh(d),r)+$h+oe(t,zh(d),r)+Zr+p+oe(t,ua(d),r),a=oe(t,ca(d),r)};return u.forEach(x),i+=Dt(a,oe(t,Qr,r),r),Xh+ha(i,t,e)+Uh};function ei(t,e,r){let i=e[t];switch(ia(i)&&Vr(i.toJSON)&&(i=i.toJSON(t)),Vr(rt)&&(i=rt.call(e,t,i)),typeof i){case"string":return la(i);case"number":return Number.isFinite(i)?String(i):aa;case"boolean":case"null":return String(i);case"object":return Yr(i)?Vh(i,r):Yh(i,r);default:}}var Qh=t=>Bh(t)?t:Th(t)?Ph(Zr,t):ue,{toString:Zh}=Object.prototype,ef=["[object Number]","[object String]","[object Boolean]"],tf=t=>{if(typeof t!="object")return!1;let e=Zh.call(t);return ef.includes(e)};fa.exports=(t,e,r)=>{let i=Qh(r);if(!i)return JSON.stringify(t,e);!Vr(e)&&!Yr(e)&&(e=null),rt=e,yt=i;let a=tf(t)?JSON.stringify(t):ei("",{"":t},ue);return Wh(),ia(t)?oe(t,Rh,ue).trimLeft()+a+oe(t,Oh,ue).trimRight():a}});var ti=_((ux,da)=>{var{parse:rf,tokenize:nf}=ea(),sf=pa(),{CommentArray:af}=Or(),{assign:of}=xt();da.exports={parse:rf,stringify:sf,tokenize:nf,CommentArray:af,assign:of}});var Sa=_(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.splitWhen=it.flatten=void 0;function Ef(t){return t.reduce((e,r)=>[].concat(e,r),[])}it.flatten=Ef;function gf(t,e){let r=[[]],i=0;for(let a of t)e(a)?(i++,r[i]=[]):r[i].push(a);return r}it.splitWhen=gf});var Aa=_($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.isEnoentCodeError=void 0;function Df(t){return t.code==="ENOENT"}$t.isEnoentCodeError=Df});var Ca=_(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.createDirentFromStats=void 0;var oi=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function yf(t,e){return new oi(t,e)}jt.createDirentFromStats=yf});var _a=_(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.convertPosixPathToPattern=V.convertWindowsPathToPattern=V.convertPathToPattern=V.escapePosixPath=V.escapeWindowsPath=V.escape=V.removeLeadingDotSegment=V.makeAbsolute=V.unixify=void 0;var vf=O("os"),Sf=O("path"),ba=vf.platform()==="win32",Af=2,Cf=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,bf=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Ff=/^\\\\([.?])/,wf=/\\(?![!()+@[\]{}])/g;function _f(t){return t.replace(/\\/g,"/")}V.unixify=_f;function kf(t,e){return Sf.resolve(t,e)}V.makeAbsolute=kf;function Tf(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Af)}return t}V.removeLeadingDotSegment=Tf;V.escape=ba?ui:ci;function ui(t){return t.replace(bf,"\\$2")}V.escapeWindowsPath=ui;function ci(t){return t.replace(Cf,"\\$2")}V.escapePosixPath=ci;V.convertPathToPattern=ba?Fa:wa;function Fa(t){return ui(t).replace(Ff,"//$1").replace(wf,"/")}V.convertWindowsPathToPattern=Fa;function wa(t){return ci(t)}V.convertPosixPathToPattern=wa});var Ta=_((dx,ka)=>{ka.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var Ra=_((mx,Pa)=>{var Bf=Ta(),Ba={"{":"}","(":")","[":"]"},Pf=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,i=-2,a=-2,c=-2,u=-2;ee&&(u===-1||u>i||(u=t.indexOf("\\",e),u===-1||u>i)))||a!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(a=t.indexOf("}",e),a>e&&(u=t.indexOf("\\",e),u===-1||u>a))||c!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(c=t.indexOf(")",e),c>e&&(u=t.indexOf("\\",e),u===-1||u>c))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(u=t.indexOf("\\",r),u===-1||u>c))))return!0;if(t[e]==="\\"){var x=t[e+1];e+=2;var d=Ba[x];if(d){var p=t.indexOf(d,e);p!==-1&&(e=p+1)}if(t[e]==="!")return!0}else e++}return!1},Rf=function(t){if(t[0]==="!")return!0;for(var e=0;e{"use strict";var If=Ra(),Nf=O("path").posix.dirname,Lf=O("os").platform()==="win32",li="/",Of=/\\/g,Mf=/[\{\[].*[\}\]]$/,Hf=/(^|[^\\])([\{\[]|\([^\)]+$)/,Xf=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Ia.exports=function(e,r){var i=Object.assign({flipBackslashes:!0},r);i.flipBackslashes&&Lf&&e.indexOf(li)<0&&(e=e.replace(Of,li)),Mf.test(e)&&(e+=li),e+="a";do e=Nf(e);while(If(e)||Hf.test(e));return e.replace(Xf,"$1")}});var Jt=_(de=>{"use strict";de.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;de.find=(t,e)=>t.nodes.find(r=>r.type===e);de.exceedsLimit=(t,e,r=1,i)=>i===!1||!de.isInteger(t)||!de.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=i;de.escapeNode=(t,e=0,r)=>{let i=t.nodes[e];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};de.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);de.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;de.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;de.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);de.flatten=(...t)=>{let e=[],r=i=>{for(let a=0;a{"use strict";var La=Jt();Oa.exports=(t,e={})=>{let r=(i,a={})=>{let c=e.escapeInvalid&&La.isInvalidBrace(a),u=i.invalid===!0&&e.escapeInvalid===!0,x="";if(i.value)return(c||u)&&La.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let d of i.nodes)x+=r(d);return x};return r(t)}});var Ha=_((Dx,Ma)=>{"use strict";Ma.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Ka=_((yx,Ga)=>{"use strict";var Xa=Ha(),ze=(t,e,r)=>{if(Xa(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Xa(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...r};typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let a=String(i.relaxZeros),c=String(i.shorthand),u=String(i.capture),x=String(i.wrap),d=t+":"+e+"="+a+c+u+x;if(ze.cache.hasOwnProperty(d))return ze.cache[d].result;let p=Math.min(t,e),h=Math.max(t,e);if(Math.abs(p-h)===1){let o=t+"|"+e;return i.capture?`(${o})`:i.wrap===!1?o:`(?:${o})`}let m=qa(t)||qa(e),l={min:t,max:e,a:p,b:h},n=[],s=[];if(m&&(l.isPadded=m,l.maxLen=String(l.max).length),p<0){let o=h<0?Math.abs(h):1;s=Ua(o,Math.abs(p),l,i),p=l.a=0}return h>=0&&(n=Ua(p,h,l,i)),l.negatives=s,l.positives=n,l.result=Uf(s,n,i),i.capture===!0?l.result=`(${l.result})`:i.wrap!==!1&&n.length+s.length>1&&(l.result=`(?:${l.result})`),ze.cache[d]=l,l.result};function Uf(t,e,r){let i=hi(t,e,"-",!1,r)||[],a=hi(e,t,"",!1,r)||[],c=hi(t,e,"-?",!0,r)||[];return i.concat(c).concat(a).join("|")}function $f(t,e){let r=1,i=1,a=ja(t,r),c=new Set([e]);for(;t<=a&&a<=e;)c.add(a),r+=1,a=ja(t,r);for(a=Ja(e+1,i)-1;t1&&x.count.pop(),x.count.push(h.count[0]),x.string=x.pattern+za(x.count),u=p+1;continue}r.isPadded&&(m=Gf(p,r,i)),h.string=m+h.pattern+za(h.count),c.push(h),u=p+1,x=h}return c}function hi(t,e,r,i,a){let c=[];for(let u of t){let{string:x}=u;!i&&!$a(e,"string",x)&&c.push(r+x),i&&$a(e,"string",x)&&c.push(r+x)}return c}function Jf(t,e){let r=[];for(let i=0;ie?1:e>t?-1:0}function $a(t,e,r){return t.some(i=>i[e]===r)}function ja(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Ja(t,e){return t-t%Math.pow(10,e)}function za(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function qf(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function qa(t){return/^-?(0+)\d/.test(t)}function Gf(t,e,r){if(!e.isPadded)return t;let i=Math.abs(e.maxLen-String(t).length),a=r.relaxZeros!==!1;switch(i){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:return a?`0{0,${i}}`:`0{${i}}`}}ze.cache={};ze.clearCache=()=>ze.cache={};Ga.exports=ze});var di=_((vx,to)=>{"use strict";var Kf=O("util"),Va=Ka(),Wa=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Wf=t=>e=>t===!0?Number(e):String(e),fi=t=>typeof t=="number"||typeof t=="string"&&t!=="",vt=t=>Number.isInteger(+t),pi=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},Vf=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Yf=(t,e,r)=>{if(e>0){let i=t[0]==="-"?"-":"";i&&(t=t.slice(1)),t=i+t.padStart(i?e-1:e,"0")}return r===!1?String(t):t},Gt=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((x,d)=>xd?1:0),t.positives.sort((x,d)=>xd?1:0);let i=e.capture?"":"?:",a="",c="",u;return t.positives.length&&(a=t.positives.map(x=>Gt(String(x),r)).join("|")),t.negatives.length&&(c=`-(${i}${t.negatives.map(x=>Gt(String(x),r)).join("|")})`),a&&c?u=`${a}|${c}`:u=a||c,e.wrap?`(${i}${u})`:u},Ya=(t,e,r,i)=>{if(r)return Va(t,e,{wrap:!1,...i});let a=String.fromCharCode(t);if(t===e)return a;let c=String.fromCharCode(e);return`[${a}-${c}]`},Qa=(t,e,r)=>{if(Array.isArray(t)){let i=r.wrap===!0,a=r.capture?"":"?:";return i?`(${a}${t.join("|")})`:t.join("|")}return Va(t,e,r)},Za=(...t)=>new RangeError("Invalid range arguments: "+Kf.inspect(...t)),eo=(t,e,r)=>{if(r.strictRanges===!0)throw Za([t,e]);return[]},Zf=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},ep=(t,e,r=1,i={})=>{let a=Number(t),c=Number(e);if(!Number.isInteger(a)||!Number.isInteger(c)){if(i.strictRanges===!0)throw Za([t,e]);return[]}a===0&&(a=0),c===0&&(c=0);let u=a>c,x=String(t),d=String(e),p=String(r);r=Math.max(Math.abs(r),1);let h=pi(x)||pi(d)||pi(p),m=h?Math.max(x.length,d.length,p.length):0,l=h===!1&&Vf(t,e,i)===!1,n=i.transform||Wf(l);if(i.toRegex&&r===1)return Ya(Gt(t,m),Gt(e,m),!0,i);let s={negatives:[],positives:[]},o=g=>s[g<0?"negatives":"positives"].push(Math.abs(g)),f=[],E=0;for(;u?a>=c:a<=c;)i.toRegex===!0&&r>1?o(a):f.push(Yf(n(a,E),m,l)),a=u?a-r:a+r,E++;return i.toRegex===!0?r>1?Qf(s,i,m):Qa(f,null,{wrap:!1,...i}):f},tp=(t,e,r=1,i={})=>{if(!vt(t)&&t.length>1||!vt(e)&&e.length>1)return eo(t,e,i);let a=i.transform||(l=>String.fromCharCode(l)),c=`${t}`.charCodeAt(0),u=`${e}`.charCodeAt(0),x=c>u,d=Math.min(c,u),p=Math.max(c,u);if(i.toRegex&&r===1)return Ya(d,p,!1,i);let h=[],m=0;for(;x?c>=u:c<=u;)h.push(a(c,m)),c=x?c-r:c+r,m++;return i.toRegex===!0?Qa(h,null,{wrap:!1,options:i}):h},qt=(t,e,r,i={})=>{if(e==null&&fi(t))return[t];if(!fi(t)||!fi(e))return eo(t,e,i);if(typeof r=="function")return qt(t,e,1,{transform:r});if(Wa(r))return qt(t,e,0,r);let a={...i};return a.capture===!0&&(a.wrap=!0),r=r||a.step||1,vt(r)?vt(t)&&vt(e)?ep(t,e,r,a):tp(t,e,Math.max(Math.abs(r),1),a):r!=null&&!Wa(r)?Zf(r,a):qt(t,e,1,r)};to.exports=qt});var no=_((Sx,io)=>{"use strict";var rp=di(),ro=Jt(),ip=(t,e={})=>{let r=(i,a={})=>{let c=ro.isInvalidBrace(a),u=i.invalid===!0&&e.escapeInvalid===!0,x=c===!0||u===!0,d=e.escapeInvalid===!0?"\\":"",p="";if(i.isOpen===!0)return d+i.value;if(i.isClose===!0)return console.log("node.isClose",d,i.value),d+i.value;if(i.type==="open")return x?d+i.value:"(";if(i.type==="close")return x?d+i.value:")";if(i.type==="comma")return i.prev.type==="comma"?"":x?i.value:"|";if(i.value)return i.value;if(i.nodes&&i.ranges>0){let h=ro.reduce(i.nodes),m=rp(...h,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(m.length!==0)return h.length>1&&m.length>1?`(${m})`:m}if(i.nodes)for(let h of i.nodes)p+=r(h,i);return p};return r(t)};io.exports=ip});var oo=_((Ax,ao)=>{"use strict";var np=di(),so=zt(),nt=Jt(),qe=(t="",e="",r=!1)=>{let i=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?nt.flatten(e).map(a=>`{${a}}`):e;for(let a of t)if(Array.isArray(a))for(let c of a)i.push(qe(c,e,r));else for(let c of e)r===!0&&typeof c=="string"&&(c=`{${c}}`),i.push(Array.isArray(c)?qe(a,c,r):a+c);return nt.flatten(i)},sp=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,i=(a,c={})=>{a.queue=[];let u=c,x=c.queue;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,x=u.queue;if(a.invalid||a.dollar){x.push(qe(x.pop(),so(a,e)));return}if(a.type==="brace"&&a.invalid!==!0&&a.nodes.length===2){x.push(qe(x.pop(),["{}"]));return}if(a.nodes&&a.ranges>0){let m=nt.reduce(a.nodes);if(nt.exceedsLimit(...m,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=np(...m,e);l.length===0&&(l=so(a,e)),x.push(qe(x.pop(),l)),a.nodes=[];return}let d=nt.encloseBrace(a),p=a.queue,h=a;for(;h.type!=="brace"&&h.type!=="root"&&h.parent;)h=h.parent,p=h.queue;for(let m=0;m{"use strict";uo.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` +`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var mo=_((bx,po)=>{"use strict";var ap=zt(),{MAX_LENGTH:lo,CHAR_BACKSLASH:mi,CHAR_BACKTICK:op,CHAR_COMMA:up,CHAR_DOT:cp,CHAR_LEFT_PARENTHESES:lp,CHAR_RIGHT_PARENTHESES:hp,CHAR_LEFT_CURLY_BRACE:fp,CHAR_RIGHT_CURLY_BRACE:pp,CHAR_LEFT_SQUARE_BRACKET:ho,CHAR_RIGHT_SQUARE_BRACKET:fo,CHAR_DOUBLE_QUOTE:dp,CHAR_SINGLE_QUOTE:mp,CHAR_NO_BREAK_SPACE:xp,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ep}=co(),gp=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(lo,r.maxLength):lo;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let a={type:"root",input:t,nodes:[]},c=[a],u=a,x=a,d=0,p=t.length,h=0,m=0,l,n=()=>t[h++],s=o=>{if(o.type==="text"&&x.type==="dot"&&(x.type="text"),x&&x.type==="text"&&o.type==="text"){x.value+=o.value;return}return u.nodes.push(o),o.parent=u,o.prev=x,x=o,o};for(s({type:"bos"});h0){if(u.ranges>0){u.ranges=0;let o=u.nodes.shift();u.nodes=[o,{type:"text",value:ap(u)}]}s({type:"comma",value:l}),u.commas++;continue}if(l===cp&&m>0&&u.commas===0){let o=u.nodes;if(m===0||o.length===0){s({type:"text",value:l});continue}if(x.type==="dot"){if(u.range=[],x.value+=l,x.type="range",u.nodes.length!==3&&u.nodes.length!==5){u.invalid=!0,u.ranges=0,x.type="text";continue}u.ranges++,u.args=[];continue}if(x.type==="range"){o.pop();let f=o[o.length-1];f.value+=x.value+l,x=f,u.ranges--;continue}s({type:"dot",value:l});continue}s({type:"text",value:l})}do if(u=c.pop(),u.type!=="root"){u.nodes.forEach(E=>{E.nodes||(E.type==="open"&&(E.isOpen=!0),E.type==="close"&&(E.isClose=!0),E.nodes||(E.type="text"),E.invalid=!0)});let o=c[c.length-1],f=o.nodes.indexOf(u);o.nodes.splice(f,1,...u.nodes)}while(c.length>0);return s({type:"eos"}),a};po.exports=gp});var go=_((Fx,Eo)=>{"use strict";var xo=zt(),Dp=no(),yp=oo(),vp=mo(),ce=(t,e={})=>{let r=[];if(Array.isArray(t))for(let i of t){let a=ce.create(i,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(ce.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ce.parse=(t,e={})=>vp(t,e);ce.stringify=(t,e={})=>xo(typeof t=="string"?ce.parse(t,e):t,e);ce.compile=(t,e={})=>(typeof t=="string"&&(t=ce.parse(t,e)),Dp(t,e));ce.expand=(t,e={})=>{typeof t=="string"&&(t=ce.parse(t,e));let r=yp(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ce.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ce.compile(t,e):ce.expand(t,e);Eo.exports=ce});var St=_((wx,Ao)=>{"use strict";var Sp=O("path"),Ae="\\\\/",Do=`[^${Ae}]`,ke="\\.",Ap="\\+",Cp="\\?",Kt="\\/",bp="(?=.)",yo="[^/]",xi=`(?:${Kt}|$)`,vo=`(?:^|${Kt})`,Ei=`${ke}{1,2}${xi}`,Fp=`(?!${ke})`,wp=`(?!${vo}${Ei})`,_p=`(?!${ke}{0,1}${xi})`,kp=`(?!${Ei})`,Tp=`[^.${Kt}]`,Bp=`${yo}*?`,So={DOT_LITERAL:ke,PLUS_LITERAL:Ap,QMARK_LITERAL:Cp,SLASH_LITERAL:Kt,ONE_CHAR:bp,QMARK:yo,END_ANCHOR:xi,DOTS_SLASH:Ei,NO_DOT:Fp,NO_DOTS:wp,NO_DOT_SLASH:_p,NO_DOTS_SLASH:kp,QMARK_NO_DOT:Tp,STAR:Bp,START_ANCHOR:vo},Pp={...So,SLASH_LITERAL:`[${Ae}]`,QMARK:Do,STAR:`${Do}*?`,DOTS_SLASH:`${ke}{1,2}(?:[${Ae}]|$)`,NO_DOT:`(?!${ke})`,NO_DOTS:`(?!(?:^|[${Ae}])${ke}{1,2}(?:[${Ae}]|$))`,NO_DOT_SLASH:`(?!${ke}{0,1}(?:[${Ae}]|$))`,NO_DOTS_SLASH:`(?!${ke}{1,2}(?:[${Ae}]|$))`,QMARK_NO_DOT:`[^.${Ae}]`,START_ANCHOR:`(?:^|[${Ae}])`,END_ANCHOR:`(?:[${Ae}]|$)`},Rp={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ao.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Rp,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Sp.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Pp:So}}});var At=_(se=>{"use strict";var Ip=O("path"),Np=process.platform==="win32",{REGEX_BACKSLASH:Lp,REGEX_REMOVE_BACKSLASH:Op,REGEX_SPECIAL_CHARS:Mp,REGEX_SPECIAL_CHARS_GLOBAL:Hp}=St();se.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);se.hasRegexChars=t=>Mp.test(t);se.isRegexChar=t=>t.length===1&&se.hasRegexChars(t);se.escapeRegex=t=>t.replace(Hp,"\\$1");se.toPosixSlashes=t=>t.replace(Lp,"/");se.removeBackslashes=t=>t.replace(Op,e=>e==="\\"?"":e);se.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};se.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Np===!0||Ip.sep==="\\";se.escapeLast=(t,e,r)=>{let i=t.lastIndexOf(e,r);return i===-1?t:t[i-1]==="\\"?se.escapeLast(t,e,i-1):`${t.slice(0,i)}\\${t.slice(i)}`};se.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};se.wrapOutput=(t,e={},r={})=>{let i=r.contains?"":"^",a=r.contains?"":"$",c=`${i}(?:${t})${a}`;return e.negated===!0&&(c=`(?:^(?!${c}).*$)`),c}});var Bo=_((kx,To)=>{"use strict";var Co=At(),{CHAR_ASTERISK:gi,CHAR_AT:Xp,CHAR_BACKWARD_SLASH:Ct,CHAR_COMMA:Up,CHAR_DOT:Di,CHAR_EXCLAMATION_MARK:yi,CHAR_FORWARD_SLASH:ko,CHAR_LEFT_CURLY_BRACE:vi,CHAR_LEFT_PARENTHESES:Si,CHAR_LEFT_SQUARE_BRACKET:$p,CHAR_PLUS:jp,CHAR_QUESTION_MARK:bo,CHAR_RIGHT_CURLY_BRACE:Jp,CHAR_RIGHT_PARENTHESES:Fo,CHAR_RIGHT_SQUARE_BRACKET:zp}=St(),wo=t=>t===ko||t===Ct,_o=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},qp=(t,e)=>{let r=e||{},i=t.length-1,a=r.parts===!0||r.scanToEnd===!0,c=[],u=[],x=[],d=t,p=-1,h=0,m=0,l=!1,n=!1,s=!1,o=!1,f=!1,E=!1,g=!1,v=!1,F=!1,A=!1,T=0,k,P,N={value:"",depth:0,isGlob:!1},U=()=>p>=i,S=()=>d.charCodeAt(p+1),j=()=>(k=P,d.charCodeAt(++p));for(;p0&&(ye=d.slice(0,h),d=d.slice(h),m-=h),J&&s===!0&&m>0?(J=d.slice(0,m),C=d.slice(m)):s===!0?(J="",C=d):J=d,J&&J!==""&&J!=="/"&&J!==d&&wo(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),r.unescape===!0&&(C&&(C=Co.removeBackslashes(C)),J&&g===!0&&(J=Co.removeBackslashes(J)));let b={prefix:ye,input:t,start:h,base:J,glob:C,isBrace:l,isBracket:n,isGlob:s,isExtglob:o,isGlobstar:f,negated:v,negatedExtglob:F};if(r.tokens===!0&&(b.maxDepth=0,wo(P)||u.push(N),b.tokens=u),r.parts===!0||r.tokens===!0){let Y;for(let $=0;${"use strict";var Wt=St(),le=At(),{MAX_LENGTH:Vt,POSIX_REGEX_SOURCE:Gp,REGEX_NON_SPECIAL_CHARS:Kp,REGEX_SPECIAL_CHARS_BACKREF:Wp,REPLACEMENTS:Po}=Wt,Vp=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(a=>le.escapeRegex(a)).join("..")}return r},st=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Ai=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Po[t]||t;let r={...e},i=typeof r.maxLength=="number"?Math.min(Vt,r.maxLength):Vt,a=t.length;if(a>i)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);let c={type:"bos",value:"",output:r.prepend||""},u=[c],x=r.capture?"":"?:",d=le.isWindows(e),p=Wt.globChars(d),h=Wt.extglobChars(p),{DOT_LITERAL:m,PLUS_LITERAL:l,SLASH_LITERAL:n,ONE_CHAR:s,DOTS_SLASH:o,NO_DOT:f,NO_DOT_SLASH:E,NO_DOTS_SLASH:g,QMARK:v,QMARK_NO_DOT:F,STAR:A,START_ANCHOR:T}=p,k=R=>`(${x}(?:(?!${T}${R.dot?o:m}).)*?)`,P=r.dot?"":f,N=r.dot?v:F,U=r.bash===!0?k(r):A;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let S={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:u};t=le.removePrefix(t,S),a=t.length;let j=[],J=[],ye=[],C=c,b,Y=()=>S.index===a-1,$=S.peek=(R=1)=>t[S.index+R],he=S.advance=()=>t[++S.index]||"",fe=()=>t.slice(S.index+1),ie=(R="",z=0)=>{S.consumed+=R,S.index+=z},Ye=R=>{S.output+=R.output!=null?R.output:R.value,ie(R.value)},Ar=()=>{let R=1;for(;$()==="!"&&($(2)!=="("||$(3)==="?");)he(),S.start++,R++;return R%2===0?!1:(S.negated=!0,S.start++,!0)},Qe=R=>{S[R]++,ye.push(R)},we=R=>{S[R]--,ye.pop()},X=R=>{if(C.type==="globstar"){let z=S.braces>0&&(R.type==="comma"||R.type==="brace"),B=R.extglob===!0||j.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!z&&!B&&(S.output=S.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=U,S.output+=C.output)}if(j.length&&R.type!=="paren"&&(j[j.length-1].inner+=R.value),(R.value||R.output)&&Ye(R),C&&C.type==="text"&&R.type==="text"){C.value+=R.value,C.output=(C.output||"")+R.value;return}R.prev=C,u.push(R),C=R},Ze=(R,z)=>{let B={...h[z],conditions:1,inner:""};B.prev=C,B.parens=S.parens,B.output=S.output;let H=(r.capture?"(":"")+B.open;Qe("parens"),X({type:R,value:z,output:S.output?"":s}),X({type:"paren",extglob:!0,value:he(),output:H}),j.push(B)},Cr=R=>{let z=R.close+(r.capture?")":""),B;if(R.type==="negate"){let H=U;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(H=k(r)),(H!==U||Y()||/^\)+$/.test(fe()))&&(z=R.close=`)$))${H}`),R.inner.includes("*")&&(B=fe())&&/^\.[^\\/.]+$/.test(B)){let q=Ai(B,{...e,fastpaths:!1}).output;z=R.close=`)${q})${H})`}R.prev.type==="bos"&&(S.negatedExtglob=!0)}X({type:"paren",extglob:!0,value:b,output:z}),we("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let R=!1,z=t.replace(Wp,(B,H,q,Q,K,pt)=>Q==="\\"?(R=!0,B):Q==="?"?H?H+Q+(K?v.repeat(K.length):""):pt===0?N+(K?v.repeat(K.length):""):v.repeat(q.length):Q==="."?m.repeat(q.length):Q==="*"?H?H+Q+(K?U:""):U:H?B:`\\${B}`);return R===!0&&(r.unescape===!0?z=z.replace(/\\/g,""):z=z.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),z===t&&r.contains===!0?(S.output=t,S):(S.output=le.wrapOutput(z,S,e),S)}for(;!Y();){if(b=he(),b==="\0")continue;if(b==="\\"){let B=$();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){b+="\\",X({type:"text",value:b});continue}let H=/^\\+/.exec(fe()),q=0;if(H&&H[0].length>2&&(q=H[0].length,S.index+=q,q%2!==0&&(b+="\\")),r.unescape===!0?b=he():b+=he(),S.brackets===0){X({type:"text",value:b});continue}}if(S.brackets>0&&(b!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&b===":"){let B=C.value.slice(1);if(B.includes("[")&&(C.posix=!0,B.includes(":"))){let H=C.value.lastIndexOf("["),q=C.value.slice(0,H),Q=C.value.slice(H+2),K=Gp[Q];if(K){C.value=q+K,S.backtrack=!0,he(),!c.output&&u.indexOf(C)===1&&(c.output=s);continue}}}(b==="["&&$()!==":"||b==="-"&&$()==="]")&&(b=`\\${b}`),b==="]"&&(C.value==="["||C.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&C.value==="["&&(b="^"),C.value+=b,Ye({value:b});continue}if(S.quotes===1&&b!=='"'){b=le.escapeRegex(b),C.value+=b,Ye({value:b});continue}if(b==='"'){S.quotes=S.quotes===1?0:1,r.keepQuotes===!0&&X({type:"text",value:b});continue}if(b==="("){Qe("parens"),X({type:"paren",value:b});continue}if(b===")"){if(S.parens===0&&r.strictBrackets===!0)throw new SyntaxError(st("opening","("));let B=j[j.length-1];if(B&&S.parens===B.parens+1){Cr(j.pop());continue}X({type:"paren",value:b,output:S.parens?")":"\\)"}),we("parens");continue}if(b==="["){if(r.nobracket===!0||!fe().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(st("closing","]"));b=`\\${b}`}else Qe("brackets");X({type:"bracket",value:b});continue}if(b==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){X({type:"text",value:b,output:`\\${b}`});continue}if(S.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(st("opening","["));X({type:"text",value:b,output:`\\${b}`});continue}we("brackets");let B=C.value.slice(1);if(C.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(b=`/${b}`),C.value+=b,Ye({value:b}),r.literalBrackets===!1||le.hasRegexChars(B))continue;let H=le.escapeRegex(C.value);if(S.output=S.output.slice(0,-C.value.length),r.literalBrackets===!0){S.output+=H,C.value=H;continue}C.value=`(${x}${H}|${C.value})`,S.output+=C.value;continue}if(b==="{"&&r.nobrace!==!0){Qe("braces");let B={type:"brace",value:b,output:"(",outputIndex:S.output.length,tokensIndex:S.tokens.length};J.push(B),X(B);continue}if(b==="}"){let B=J[J.length-1];if(r.nobrace===!0||!B){X({type:"text",value:b,output:b});continue}let H=")";if(B.dots===!0){let q=u.slice(),Q=[];for(let K=q.length-1;K>=0&&(u.pop(),q[K].type!=="brace");K--)q[K].type!=="dots"&&Q.unshift(q[K].value);H=Vp(Q,r),S.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let q=S.output.slice(0,B.outputIndex),Q=S.tokens.slice(B.tokensIndex);B.value=B.output="\\{",b=H="\\}",S.output=q;for(let K of Q)S.output+=K.output||K.value}X({type:"brace",value:b,output:H}),we("braces"),J.pop();continue}if(b==="|"){j.length>0&&j[j.length-1].conditions++,X({type:"text",value:b});continue}if(b===","){let B=b,H=J[J.length-1];H&&ye[ye.length-1]==="braces"&&(H.comma=!0,B="|"),X({type:"comma",value:b,output:B});continue}if(b==="/"){if(C.type==="dot"&&S.index===S.start+1){S.start=S.index+1,S.consumed="",S.output="",u.pop(),C=c;continue}X({type:"slash",value:b,output:n});continue}if(b==="."){if(S.braces>0&&C.type==="dot"){C.value==="."&&(C.output=m);let B=J[J.length-1];C.type="dots",C.output+=b,C.value+=b,B.dots=!0;continue}if(S.braces+S.parens===0&&C.type!=="bos"&&C.type!=="slash"){X({type:"text",value:b,output:m});continue}X({type:"dot",value:b,output:m});continue}if(b==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&$()==="("&&$(2)!=="?"){Ze("qmark",b);continue}if(C&&C.type==="paren"){let H=$(),q=b;if(H==="<"&&!le.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(C.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(fe()))&&(q=`\\${b}`),X({type:"text",value:b,output:q});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){X({type:"qmark",value:b,output:F});continue}X({type:"qmark",value:b,output:v});continue}if(b==="!"){if(r.noextglob!==!0&&$()==="("&&($(2)!=="?"||!/[!=<:]/.test($(3)))){Ze("negate",b);continue}if(r.nonegate!==!0&&S.index===0){Ar();continue}}if(b==="+"){if(r.noextglob!==!0&&$()==="("&&$(2)!=="?"){Ze("plus",b);continue}if(C&&C.value==="("||r.regex===!1){X({type:"plus",value:b,output:l});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||S.parens>0){X({type:"plus",value:b});continue}X({type:"plus",value:l});continue}if(b==="@"){if(r.noextglob!==!0&&$()==="("&&$(2)!=="?"){X({type:"at",extglob:!0,value:b,output:""});continue}X({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);let B=Kp.exec(fe());B&&(b+=B[0],S.index+=B[0].length),X({type:"text",value:b});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=b,C.output=U,S.backtrack=!0,S.globstar=!0,ie(b);continue}let R=fe();if(r.noextglob!==!0&&/^\([^?]/.test(R)){Ze("star",b);continue}if(C.type==="star"){if(r.noglobstar===!0){ie(b);continue}let B=C.prev,H=B.prev,q=B.type==="slash"||B.type==="bos",Q=H&&(H.type==="star"||H.type==="globstar");if(r.bash===!0&&(!q||R[0]&&R[0]!=="/")){X({type:"star",value:b,output:""});continue}let K=S.braces>0&&(B.type==="comma"||B.type==="brace"),pt=j.length&&(B.type==="pipe"||B.type==="paren");if(!q&&B.type!=="paren"&&!K&&!pt){X({type:"star",value:b,output:""});continue}for(;R.slice(0,3)==="/**";){let et=t[S.index+4];if(et&&et!=="/")break;R=R.slice(3),ie("/**",3)}if(B.type==="bos"&&Y()){C.type="globstar",C.value+=b,C.output=k(r),S.output=C.output,S.globstar=!0,ie(b);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!Q&&Y()){S.output=S.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=k(r)+(r.strictSlashes?")":"|$)"),C.value+=b,S.globstar=!0,S.output+=B.output+C.output,ie(b);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&R[0]==="/"){let et=R[1]!==void 0?"|$":"";S.output=S.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=`${k(r)}${n}|${n}${et})`,C.value+=b,S.output+=B.output+C.output,S.globstar=!0,ie(b+he()),X({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&R[0]==="/"){C.type="globstar",C.value+=b,C.output=`(?:^|${n}|${k(r)}${n})`,S.output=C.output,S.globstar=!0,ie(b+he()),X({type:"slash",value:"/",output:""});continue}S.output=S.output.slice(0,-C.output.length),C.type="globstar",C.output=k(r),C.value+=b,S.output+=C.output,S.globstar=!0,ie(b);continue}let z={type:"star",value:b,output:U};if(r.bash===!0){z.output=".*?",(C.type==="bos"||C.type==="slash")&&(z.output=P+z.output),X(z);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){z.output=b,X(z);continue}(S.index===S.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?(S.output+=E,C.output+=E):r.dot===!0?(S.output+=g,C.output+=g):(S.output+=P,C.output+=P),$()!=="*"&&(S.output+=s,C.output+=s)),X(z)}for(;S.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(st("closing","]"));S.output=le.escapeLast(S.output,"["),we("brackets")}for(;S.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(st("closing",")"));S.output=le.escapeLast(S.output,"("),we("parens")}for(;S.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(st("closing","}"));S.output=le.escapeLast(S.output,"{"),we("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&X({type:"maybe_slash",value:"",output:`${n}?`}),S.backtrack===!0){S.output="";for(let R of S.tokens)S.output+=R.output!=null?R.output:R.value,R.suffix&&(S.output+=R.suffix)}return S};Ai.fastpaths=(t,e)=>{let r={...e},i=typeof r.maxLength=="number"?Math.min(Vt,r.maxLength):Vt,a=t.length;if(a>i)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);t=Po[t]||t;let c=le.isWindows(e),{DOT_LITERAL:u,SLASH_LITERAL:x,ONE_CHAR:d,DOTS_SLASH:p,NO_DOT:h,NO_DOTS:m,NO_DOTS_SLASH:l,STAR:n,START_ANCHOR:s}=Wt.globChars(c),o=r.dot?m:h,f=r.dot?l:h,E=r.capture?"":"?:",g={negated:!1,prefix:""},v=r.bash===!0?".*?":n;r.capture&&(v=`(${v})`);let F=P=>P.noglobstar===!0?v:`(${E}(?:(?!${s}${P.dot?p:u}).)*?)`,A=P=>{switch(P){case"*":return`${o}${d}${v}`;case".*":return`${u}${d}${v}`;case"*.*":return`${o}${v}${u}${d}${v}`;case"*/*":return`${o}${v}${x}${d}${f}${v}`;case"**":return o+F(r);case"**/*":return`(?:${o}${F(r)}${x})?${f}${d}${v}`;case"**/*.*":return`(?:${o}${F(r)}${x})?${f}${v}${u}${d}${v}`;case"**/.*":return`(?:${o}${F(r)}${x})?${u}${d}${v}`;default:{let N=/^(.*?)\.(\w+)$/.exec(P);if(!N)return;let U=A(N[1]);return U?U+u+N[2]:void 0}}},T=le.removePrefix(t,g),k=A(T);return k&&r.strictSlashes!==!0&&(k+=`${x}?`),k};Ro.exports=Ai});var Lo=_((Bx,No)=>{"use strict";var Yp=O("path"),Qp=Bo(),Ci=Io(),bi=At(),Zp=St(),ed=t=>t&&typeof t=="object"&&!Array.isArray(t),W=(t,e,r=!1)=>{if(Array.isArray(t)){let h=t.map(l=>W(l,e,r));return l=>{for(let n of h){let s=n(l);if(s)return s}return!1}}let i=ed(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!i)throw new TypeError("Expected pattern to be a non-empty string");let a=e||{},c=bi.isWindows(e),u=i?W.compileRe(t,e):W.makeRe(t,e,!1,!0),x=u.state;delete u.state;let d=()=>!1;if(a.ignore){let h={...e,ignore:null,onMatch:null,onResult:null};d=W(a.ignore,h,r)}let p=(h,m=!1)=>{let{isMatch:l,match:n,output:s}=W.test(h,u,e,{glob:t,posix:c}),o={glob:t,state:x,regex:u,posix:c,input:h,output:s,match:n,isMatch:l};return typeof a.onResult=="function"&&a.onResult(o),l===!1?(o.isMatch=!1,m?o:!1):d(h)?(typeof a.onIgnore=="function"&&a.onIgnore(o),o.isMatch=!1,m?o:!1):(typeof a.onMatch=="function"&&a.onMatch(o),m?o:!0)};return r&&(p.state=x),p};W.test=(t,e,r,{glob:i,posix:a}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let c=r||{},u=c.format||(a?bi.toPosixSlashes:null),x=t===i,d=x&&u?u(t):t;return x===!1&&(d=u?u(t):t,x=d===i),(x===!1||c.capture===!0)&&(c.matchBase===!0||c.basename===!0?x=W.matchBase(t,e,r,a):x=e.exec(d)),{isMatch:!!x,match:x,output:d}};W.matchBase=(t,e,r,i=bi.isWindows(r))=>(e instanceof RegExp?e:W.makeRe(e,r)).test(Yp.basename(t));W.isMatch=(t,e,r)=>W(e,r)(t);W.parse=(t,e)=>Array.isArray(t)?t.map(r=>W.parse(r,e)):Ci(t,{...e,fastpaths:!1});W.scan=(t,e)=>Qp(t,e);W.compileRe=(t,e,r=!1,i=!1)=>{if(r===!0)return t.output;let a=e||{},c=a.contains?"":"^",u=a.contains?"":"$",x=`${c}(?:${t.output})${u}`;t&&t.negated===!0&&(x=`^(?!${x}).*$`);let d=W.toRegex(x,e);return i===!0&&(d.state=t),d};W.makeRe=(t,e={},r=!1,i=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(a.output=Ci.fastpaths(t,e)),a.output||(a=Ci(t,e)),W.compileRe(a,e,r,i)};W.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};W.constants=Zp;No.exports=W});var Mo=_((Px,Oo)=>{"use strict";Oo.exports=Lo()});var Jo=_((Rx,jo)=>{"use strict";var Xo=O("util"),Uo=go(),Ce=Mo(),Fi=At(),Ho=t=>t===""||t==="./",$o=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},G=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let i=new Set,a=new Set,c=new Set,u=0,x=h=>{c.add(h.output),r&&r.onResult&&r.onResult(h)};for(let h=0;h!i.has(h));if(r&&p.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(h=>h.replace(/\\/g,"")):e}return p};G.match=G;G.matcher=(t,e)=>Ce(t,e);G.isMatch=(t,e,r)=>Ce(e,r)(t);G.any=G.isMatch;G.not=(t,e,r={})=>{e=[].concat(e).map(String);let i=new Set,a=[],c=x=>{r.onResult&&r.onResult(x),a.push(x.output)},u=new Set(G(t,e,{...r,onResult:c}));for(let x of a)u.has(x)||i.add(x);return[...i]};G.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Xo.inspect(t)}"`);if(Array.isArray(e))return e.some(i=>G.contains(t,i,r));if(typeof e=="string"){if(Ho(t)||Ho(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return G.isMatch(t,e,{...r,contains:!0})};G.matchKeys=(t,e,r)=>{if(!Fi.isObject(t))throw new TypeError("Expected the first argument to be an object");let i=G(Object.keys(t),e,r),a={};for(let c of i)a[c]=t[c];return a};G.some=(t,e,r)=>{let i=[].concat(t);for(let a of[].concat(e)){let c=Ce(String(a),r);if(i.some(u=>c(u)))return!0}return!1};G.every=(t,e,r)=>{let i=[].concat(t);for(let a of[].concat(e)){let c=Ce(String(a),r);if(!i.every(u=>c(u)))return!1}return!0};G.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Xo.inspect(t)}"`);return[].concat(e).every(i=>Ce(i,r)(t))};G.capture=(t,e,r)=>{let i=Fi.isWindows(r),c=Ce.makeRe(String(t),{...r,capture:!0}).exec(i?Fi.toPosixSlashes(e):e);if(c)return c.slice(1).map(u=>u===void 0?"":u)};G.makeRe=(...t)=>Ce.makeRe(...t);G.scan=(...t)=>Ce.scan(...t);G.parse=(t,e)=>{let r=[];for(let i of[].concat(t||[]))for(let a of Uo(String(i),e))r.push(Ce.parse(a,e));return r};G.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!$o(t)?[t]:Uo(t,e)};G.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return G.braces(t,{...e,expand:!0})};G.hasBraces=$o;jo.exports=G});var Qo=_(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.removeDuplicateSlashes=L.matchAny=L.convertPatternsToRe=L.makeRe=L.getPatternParts=L.expandBraceExpansion=L.expandPatternsWithBraceExpansion=L.isAffectDepthOfReadingPattern=L.endsWithSlashGlobStar=L.hasGlobStar=L.getBaseDirectory=L.isPatternRelatedToParentDirectory=L.getPatternsOutsideCurrentDirectory=L.getPatternsInsideCurrentDirectory=L.getPositivePatterns=L.getNegativePatterns=L.isPositivePattern=L.isNegativePattern=L.convertToNegativePattern=L.convertToPositivePattern=L.isDynamicPattern=L.isStaticPattern=void 0;var td=O("path"),rd=Na(),wi=Jo(),zo="**",id="\\",nd=/[*?]|^!/,sd=/\[[^[]*]/,ad=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,od=/[!*+?@]\([^(]*\)/,ud=/,|\.\./,cd=/(?!^)\/{2,}/g;function qo(t,e={}){return!Go(t,e)}L.isStaticPattern=qo;function Go(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(id)||nd.test(t)||sd.test(t)||ad.test(t)||e.extglob!==!1&&od.test(t)||e.braceExpansion!==!1&&ld(t))}L.isDynamicPattern=Go;function ld(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let i=t.slice(e,r);return ud.test(i)}function hd(t){return Yt(t)?t.slice(1):t}L.convertToPositivePattern=hd;function fd(t){return"!"+t}L.convertToNegativePattern=fd;function Yt(t){return t.startsWith("!")&&t[1]!=="("}L.isNegativePattern=Yt;function Ko(t){return!Yt(t)}L.isPositivePattern=Ko;function pd(t){return t.filter(Yt)}L.getNegativePatterns=pd;function dd(t){return t.filter(Ko)}L.getPositivePatterns=dd;function md(t){return t.filter(e=>!_i(e))}L.getPatternsInsideCurrentDirectory=md;function xd(t){return t.filter(_i)}L.getPatternsOutsideCurrentDirectory=xd;function _i(t){return t.startsWith("..")||t.startsWith("./..")}L.isPatternRelatedToParentDirectory=_i;function Ed(t){return rd(t,{flipBackslashes:!1})}L.getBaseDirectory=Ed;function gd(t){return t.includes(zo)}L.hasGlobStar=gd;function Wo(t){return t.endsWith("/"+zo)}L.endsWithSlashGlobStar=Wo;function Dd(t){let e=td.basename(t);return Wo(t)||qo(e)}L.isAffectDepthOfReadingPattern=Dd;function yd(t){return t.reduce((e,r)=>e.concat(Vo(r)),[])}L.expandPatternsWithBraceExpansion=yd;function Vo(t){let e=wi.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,i)=>r.length-i.length),e.filter(r=>r!=="")}L.expandBraceExpansion=Vo;function vd(t,e){let{parts:r}=wi.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}L.getPatternParts=vd;function Yo(t,e){return wi.makeRe(t,e)}L.makeRe=Yo;function Sd(t,e){return t.map(r=>Yo(r,e))}L.convertPatternsToRe=Sd;function Ad(t,e){return e.some(r=>r.test(t))}L.matchAny=Ad;function Cd(t){return t.replace(cd,"/")}L.removeDuplicateSlashes=Cd});var ru=_((Nx,tu)=>{"use strict";var bd=O("stream"),Zo=bd.PassThrough,Fd=Array.prototype.slice;tu.exports=wd;function wd(){let t=[],e=Fd.call(arguments),r=!1,i=e[e.length-1];i&&!Array.isArray(i)&&i.pipe==null?e.pop():i={};let a=i.end!==!1,c=i.pipeError===!0;i.objectMode==null&&(i.objectMode=!0),i.highWaterMark==null&&(i.highWaterMark=64*1024);let u=Zo(i);function x(){for(let h=0,m=arguments.length;h0||(r=!1,d())}function n(s){function o(){s.removeListener("merge2UnpipeEnd",o),s.removeListener("end",o),c&&s.removeListener("error",f),l()}function f(E){u.emit("error",E)}if(s._readableState.endEmitted)return l();s.on("merge2UnpipeEnd",o),s.on("end",o),c&&s.on("error",f),s.pipe(u,{end:!1}),s.resume()}for(let s=0;s{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.merge=void 0;var _d=ru();function kd(t){let e=_d(t);return t.forEach(r=>{r.once("error",i=>e.emit("error",i))}),e.once("close",()=>iu(t)),e.once("end",()=>iu(t)),e}Qt.merge=kd;function iu(t){t.forEach(e=>e.emit("close"))}});var su=_(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.isEmpty=at.isString=void 0;function Td(t){return typeof t=="string"}at.isString=Td;function Bd(t){return t===""}at.isEmpty=Bd});var Te=_(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.string=te.stream=te.pattern=te.path=te.fs=te.errno=te.array=void 0;var Pd=Sa();te.array=Pd;var Rd=Aa();te.errno=Rd;var Id=Ca();te.fs=Id;var Nd=_a();te.path=Nd;var Ld=Qo();te.pattern=Ld;var Od=nu();te.stream=Od;var Md=su();te.string=Md});var cu=_(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.convertPatternGroupToTask=re.convertPatternGroupsToTasks=re.groupPatternsByBaseDirectory=re.getNegativePatternsAsPositive=re.getPositivePatterns=re.convertPatternsToTasks=re.generate=void 0;var ge=Te();function Hd(t,e){let r=au(t,e),i=au(e.ignore,e),a=ou(r),c=uu(r,i),u=a.filter(h=>ge.pattern.isStaticPattern(h,e)),x=a.filter(h=>ge.pattern.isDynamicPattern(h,e)),d=ki(u,c,!1),p=ki(x,c,!0);return d.concat(p)}re.generate=Hd;function au(t,e){let r=t;return e.braceExpansion&&(r=ge.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(i=>i.includes("/")?i:`**/${i}`)),r.map(i=>ge.pattern.removeDuplicateSlashes(i))}function ki(t,e,r){let i=[],a=ge.pattern.getPatternsOutsideCurrentDirectory(t),c=ge.pattern.getPatternsInsideCurrentDirectory(t),u=Ti(a),x=Ti(c);return i.push(...Bi(u,e,r)),"."in x?i.push(Pi(".",c,e,r)):i.push(...Bi(x,e,r)),i}re.convertPatternsToTasks=ki;function ou(t){return ge.pattern.getPositivePatterns(t)}re.getPositivePatterns=ou;function uu(t,e){return ge.pattern.getNegativePatterns(t).concat(e).map(ge.pattern.convertToPositivePattern)}re.getNegativePatternsAsPositive=uu;function Ti(t){let e={};return t.reduce((r,i)=>{let a=ge.pattern.getBaseDirectory(i);return a in r?r[a].push(i):r[a]=[i],r},e)}re.groupPatternsByBaseDirectory=Ti;function Bi(t,e,r){return Object.keys(t).map(i=>Pi(i,t[i],e,r))}re.convertPatternGroupsToTasks=Bi;function Pi(t,e,r,i){return{dynamic:i,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(ge.pattern.convertToNegativePattern))}}re.convertPatternGroupToTask=Pi});var hu=_(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.read=void 0;function Xd(t,e,r){e.fs.lstat(t,(i,a)=>{if(i!==null){lu(r,i);return}if(!a.isSymbolicLink()||!e.followSymbolicLink){Ri(r,a);return}e.fs.stat(t,(c,u)=>{if(c!==null){if(e.throwErrorOnBrokenSymbolicLink){lu(r,c);return}Ri(r,a);return}e.markSymbolicLink&&(u.isSymbolicLink=()=>!0),Ri(r,u)})})}Zt.read=Xd;function lu(t,e){t(e)}function Ri(t,e){t(null,e)}});var fu=_(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.read=void 0;function Ud(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let i=e.fs.statSync(t);return e.markSymbolicLink&&(i.isSymbolicLink=()=>!0),i}catch(i){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw i}}er.read=Ud});var pu=_(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createFileSystemAdapter=Ne.FILE_SYSTEM_ADAPTER=void 0;var tr=O("fs");Ne.FILE_SYSTEM_ADAPTER={lstat:tr.lstat,stat:tr.stat,lstatSync:tr.lstatSync,statSync:tr.statSync};function $d(t){return t===void 0?Ne.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ne.FILE_SYSTEM_ADAPTER),t)}Ne.createFileSystemAdapter=$d});var du=_(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});var jd=pu(),Ii=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=jd.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Ni.default=Ii});var Ge=_(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.statSync=Le.stat=Le.Settings=void 0;var mu=hu(),Jd=fu(),Li=du();Le.Settings=Li.default;function zd(t,e,r){if(typeof e=="function"){mu.read(t,Oi(),e);return}mu.read(t,Oi(e),r)}Le.stat=zd;function qd(t,e){let r=Oi(e);return Jd.read(t,r)}Le.statSync=qd;function Oi(t={}){return t instanceof Li.default?t:new Li.default(t)}});var gu=_((zx,Eu)=>{var xu;Eu.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(xu||(xu=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var yu=_((qx,Du)=>{Du.exports=Kd;var Gd=gu();function Kd(t,e){let r,i,a,c=!0;Array.isArray(t)?(r=[],i=t.length):(a=Object.keys(t),r={},i=a.length);function u(d){function p(){e&&e(d,r),e=null}c?Gd(p):p()}function x(d,p,h){r[d]=h,(--i===0||p)&&u(p)}i?a?a.forEach(function(d){t[d](function(p,h){x(d,p,h)})}):t.forEach(function(d,p){d(function(h,m){x(p,h,m)})}):u(null),c=!1}});var Mi=_(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var rr=process.versions.node.split(".");if(rr[0]===void 0||rr[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var vu=Number.parseInt(rr[0],10),Wd=Number.parseInt(rr[1],10),Su=10,Vd=10,Yd=vu>Su,Qd=vu===Su&&Wd>=Vd;ir.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Yd||Qd});var Au=_(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.createDirentFromStats=void 0;var Hi=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Zd(t,e){return new Hi(t,e)}nr.createDirentFromStats=Zd});var Xi=_(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.fs=void 0;var em=Au();sr.fs=em});var Ui=_(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.joinPathSegments=void 0;function tm(t,e,r){return t.endsWith(r)?t+e:t+r+e}ar.joinPathSegments=tm});var ku=_(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.readdir=Oe.readdirWithFileTypes=Oe.read=void 0;var rm=Ge(),Cu=yu(),im=Mi(),bu=Xi(),Fu=Ui();function nm(t,e,r){if(!e.stats&&im.IS_SUPPORT_READDIR_WITH_FILE_TYPES){wu(t,e,r);return}_u(t,e,r)}Oe.read=nm;function wu(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(i,a)=>{if(i!==null){or(r,i);return}let c=a.map(x=>({dirent:x,name:x.name,path:Fu.joinPathSegments(t,x.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){$i(r,c);return}let u=c.map(x=>sm(x,e));Cu(u,(x,d)=>{if(x!==null){or(r,x);return}$i(r,d)})})}Oe.readdirWithFileTypes=wu;function sm(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(i,a)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){r(i);return}r(null,t);return}t.dirent=bu.fs.createDirentFromStats(t.name,a),r(null,t)})}}function _u(t,e,r){e.fs.readdir(t,(i,a)=>{if(i!==null){or(r,i);return}let c=a.map(u=>{let x=Fu.joinPathSegments(t,u,e.pathSegmentSeparator);return d=>{rm.stat(x,e.fsStatSettings,(p,h)=>{if(p!==null){d(p);return}let m={name:u,path:x,dirent:bu.fs.createDirentFromStats(u,h)};e.stats&&(m.stats=h),d(null,m)})}});Cu(c,(u,x)=>{if(u!==null){or(r,u);return}$i(r,x)})})}Oe.readdir=_u;function or(t,e){t(e)}function $i(t,e){t(null,e)}});var Iu=_(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.readdir=Me.readdirWithFileTypes=Me.read=void 0;var am=Ge(),om=Mi(),Tu=Xi(),Bu=Ui();function um(t,e){return!e.stats&&om.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Pu(t,e):Ru(t,e)}Me.read=um;function Pu(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(i=>{let a={dirent:i,name:i.name,path:Bu.joinPathSegments(t,i.name,e.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let c=e.fs.statSync(a.path);a.dirent=Tu.fs.createDirentFromStats(a.name,c)}catch(c){if(e.throwErrorOnBrokenSymbolicLink)throw c}return a})}Me.readdirWithFileTypes=Pu;function Ru(t,e){return e.fs.readdirSync(t).map(i=>{let a=Bu.joinPathSegments(t,i,e.pathSegmentSeparator),c=am.statSync(a,e.fsStatSettings),u={name:i,path:a,dirent:Tu.fs.createDirentFromStats(i,c)};return e.stats&&(u.stats=c),u})}Me.readdir=Ru});var Nu=_(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.createFileSystemAdapter=He.FILE_SYSTEM_ADAPTER=void 0;var ot=O("fs");He.FILE_SYSTEM_ADAPTER={lstat:ot.lstat,stat:ot.stat,lstatSync:ot.lstatSync,statSync:ot.statSync,readdir:ot.readdir,readdirSync:ot.readdirSync};function cm(t){return t===void 0?He.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},He.FILE_SYSTEM_ADAPTER),t)}He.createFileSystemAdapter=cm});var Lu=_(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var lm=O("path"),hm=Ge(),fm=Nu(),ji=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=fm.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,lm.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new hm.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Ji.default=ji});var ur=_(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.Settings=Xe.scandirSync=Xe.scandir=void 0;var Ou=ku(),pm=Iu(),zi=Lu();Xe.Settings=zi.default;function dm(t,e,r){if(typeof e=="function"){Ou.read(t,qi(),e);return}Ou.read(t,qi(e),r)}Xe.scandir=dm;function mm(t,e){let r=qi(e);return pm.read(t,r)}Xe.scandirSync=mm;function qi(t={}){return t instanceof zi.default?t:new zi.default(t)}});var Hu=_((rE,Mu)=>{"use strict";function xm(t){var e=new t,r=e;function i(){var c=e;return c.next?e=c.next:(e=new t,r=e),c.next=null,c}function a(c){r.next=c,r=c}return{get:i,release:a}}Mu.exports=xm});var Uu=_((iE,Gi)=>{"use strict";var Em=Hu();function Xu(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var i=Em(gm),a=null,c=null,u=0,x=null,d={push:o,drain:me,saturated:me,pause:h,paused:!1,get concurrency(){return r},set concurrency(A){if(!(A>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=A,!d.paused)for(;a&&u=r||d.paused?c?(c.next=k,c=k):(a=k,c=k,d.saturated()):(u++,e.call(t,k.value,k.worked))}function f(A,T){var k=i.get();k.context=t,k.release=E,k.value=A,k.callback=T||me,k.errorHandler=x,u>=r||d.paused?a?(k.next=a,a=k):(a=k,c=k,d.saturated()):(u++,e.call(t,k.value,k.worked))}function E(A){A&&i.release(A);var T=a;T&&u<=r?d.paused?u--:(c===a&&(c=null),a=T.next,T.next=null,e.call(t,T.value,T.worked),c===null&&d.empty()):--u===0&&d.drain()}function g(){a=null,c=null,d.drain=me}function v(){a=null,c=null,d.drain(),d.drain=me}function F(A){x=A}}function me(){}function gm(){this.value=null,this.callback=me,this.next=null,this.release=me,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,i){var a=t.callback,c=t.errorHandler,u=t.value;t.value=null,t.callback=me,t.errorHandler&&c(r,u),a.call(t.context,r,i),t.release(t)}}function Dm(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function i(h,m){e.call(this,h).then(function(l){m(null,l)},m)}var a=Xu(t,i,r),c=a.push,u=a.unshift;return a.push=x,a.unshift=d,a.drained=p,a;function x(h){var m=new Promise(function(l,n){c(h,function(s,o){if(s){n(s);return}l(o)})});return m.catch(me),m}function d(h){var m=new Promise(function(l,n){u(h,function(s,o){if(s){n(s);return}l(o)})});return m.catch(me),m}function p(){if(a.idle())return new Promise(function(l){l()});var h=a.drain,m=new Promise(function(l){a.drain=function(){h(),l()}});return m}}Gi.exports=Xu;Gi.exports.promise=Dm});var cr=_(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.joinPathSegments=be.replacePathSegmentSeparator=be.isAppliedFilter=be.isFatalError=void 0;function ym(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}be.isFatalError=ym;function vm(t,e){return t===null||t(e)}be.isAppliedFilter=vm;function Sm(t,e){return t.split(/[/\\]/).join(e)}be.replacePathSegmentSeparator=Sm;function Am(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}be.joinPathSegments=Am});var Vi=_(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var Cm=cr(),Ki=class{constructor(e,r){this._root=e,this._settings=r,this._root=Cm.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Wi.default=Ki});var Zi=_(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var bm=O("events"),Fm=ur(),wm=Uu(),lr=cr(),_m=Vi(),Yi=class extends _m.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=Fm.scandir,this._emitter=new bm.EventEmitter,this._queue=wm(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let i={directory:e,base:r};this._queue.push(i,a=>{a!==null&&this._handleError(a)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(i,a)=>{if(i!==null){r(i,void 0);return}for(let c of a)this._handleEntry(c,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!lr.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let i=e.path;r!==void 0&&(e.path=lr.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),lr.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&lr.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(i,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};Qi.default=Yi});var $u=_(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});var km=Zi(),en=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new km.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{Tm(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Bm(e,this._storage)}),this._reader.read()}};tn.default=en;function Tm(t,e){t(e)}function Bm(t,e){t(null,e)}});var ju=_(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});var Pm=O("stream"),Rm=Zi(),rn=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Rm.default(this._root,this._settings),this._stream=new Pm.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};nn.default=rn});var Ju=_(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});var Im=ur(),hr=cr(),Nm=Vi(),sn=class extends Nm.default{constructor(){super(...arguments),this._scandir=Im.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let i=this._scandir(e,this._settings.fsScandirSettings);for(let a of i)this._handleEntry(a,r)}catch(i){this._handleError(i)}}_handleError(e){if(hr.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let i=e.path;r!==void 0&&(e.path=hr.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),hr.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&hr.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(i,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};an.default=sn});var zu=_(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});var Lm=Ju(),on=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Lm.default(this._root,this._settings)}read(){return this._reader.read()}};un.default=on});var qu=_(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});var Om=O("path"),Mm=ur(),cn=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Om.sep),this.fsScandirSettings=new Mm.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};ln.default=cn});var pr=_(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.Settings=Fe.walkStream=Fe.walkSync=Fe.walk=void 0;var Gu=$u(),Hm=ju(),Xm=zu(),hn=qu();Fe.Settings=hn.default;function Um(t,e,r){if(typeof e=="function"){new Gu.default(t,fr()).read(e);return}new Gu.default(t,fr(e)).read(r)}Fe.walk=Um;function $m(t,e){let r=fr(e);return new Xm.default(t,r).read()}Fe.walkSync=$m;function jm(t,e){let r=fr(e);return new Hm.default(t,r).read()}Fe.walkStream=jm;function fr(t={}){return t instanceof hn.default?t:new hn.default(t)}});var dr=_(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});var Jm=O("path"),zm=Ge(),Ku=Te(),fn=class{constructor(e){this._settings=e,this._fsStatSettings=new zm.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return Jm.resolve(this._settings.cwd,e)}_makeEntry(e,r){let i={name:r,path:r,dirent:Ku.fs.createDirentFromStats(r,e)};return this._settings.stats&&(i.stats=e),i}_isFatalError(e){return!Ku.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};pn.default=fn});var xn=_(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});var qm=O("stream"),Gm=Ge(),Km=pr(),Wm=dr(),dn=class extends Wm.default{constructor(){super(...arguments),this._walkStream=Km.walkStream,this._stat=Gm.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let i=e.map(this._getFullEntryPath,this),a=new qm.PassThrough({objectMode:!0});a._write=(c,u,x)=>this._getEntry(i[c],e[c],r).then(d=>{d!==null&&r.entryFilter(d)&&a.push(d),c===i.length-1&&a.end(),x()}).catch(x);for(let c=0;cthis._makeEntry(a,r)).catch(a=>{if(i.errorFilter(a))return null;throw a})}_getStat(e){return new Promise((r,i)=>{this._stat(e,this._fsStatSettings,(a,c)=>a===null?r(c):i(a))})}};mn.default=dn});var Wu=_(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});var Vm=pr(),Ym=dr(),Qm=xn(),En=class extends Ym.default{constructor(){super(...arguments),this._walkAsync=Vm.walk,this._readerStream=new Qm.default(this._settings)}dynamic(e,r){return new Promise((i,a)=>{this._walkAsync(e,r,(c,u)=>{c===null?i(u):a(c)})})}async static(e,r){let i=[],a=this._readerStream.static(e,r);return new Promise((c,u)=>{a.once("error",u),a.on("data",x=>i.push(x)),a.once("end",()=>c(i))})}};gn.default=En});var Vu=_(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});var bt=Te(),Dn=class{constructor(e,r,i){this._patterns=e,this._settings=r,this._micromatchOptions=i,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),i=this._splitSegmentsIntoSections(r);this._storage.push({complete:i.length<=1,pattern:e,segments:r,sections:i})}}_getPatternSegments(e){return bt.pattern.getPatternParts(e,this._micromatchOptions).map(i=>bt.pattern.isDynamicPattern(i,this._settings)?{dynamic:!0,pattern:i,patternRe:bt.pattern.makeRe(i,this._micromatchOptions)}:{dynamic:!1,pattern:i})}_splitSegmentsIntoSections(e){return bt.array.splitWhen(e,r=>r.dynamic&&bt.pattern.hasGlobStar(r.pattern))}};yn.default=Dn});var Yu=_(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var Zm=Vu(),vn=class extends Zm.default{match(e){let r=e.split("/"),i=r.length,a=this._storage.filter(c=>!c.complete||c.segments.length>i);for(let c of a){let u=c.sections[0];if(!c.complete&&i>u.length||r.every((d,p)=>{let h=c.segments[p];return!!(h.dynamic&&h.patternRe.test(d)||!h.dynamic&&h.pattern===d)}))return!0}return!1}};Sn.default=vn});var Qu=_(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});var mr=Te(),e0=Yu(),An=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,i){let a=this._getMatcher(r),c=this._getNegativePatternsRe(i);return u=>this._filter(e,u,a,c)}_getMatcher(e){return new e0.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(mr.pattern.isAffectDepthOfReadingPattern);return mr.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,i,a){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let c=mr.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(c,i)?!1:this._isSkippedByNegativePatterns(c,a)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let i=r.split("/").length;if(e==="")return i;let a=e.split("/").length;return i-a}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!mr.pattern.matchAny(e,r)}};Cn.default=An});var Zu=_(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});var Ke=Te(),bn=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let i=Ke.pattern.convertPatternsToRe(e,this._micromatchOptions),a=Ke.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}));return c=>this._filter(c,i,a)}_filter(e,r,i){let a=Ke.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(a)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(a,i))return!1;let c=e.dirent.isDirectory(),u=this._isMatchToPatterns(a,r,c)&&!this._isMatchToPatterns(a,i,c);return this._settings.unique&&u&&this._createIndexRecord(a),u}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,r){if(!this._settings.absolute)return!1;let i=Ke.path.makeAbsolute(this._settings.cwd,e);return Ke.pattern.matchAny(i,r)}_isMatchToPatterns(e,r,i){let a=Ke.pattern.matchAny(e,r);return!a&&i?Ke.pattern.matchAny(e+"/",r):a}};Fn.default=bn});var ec=_(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});var t0=Te(),wn=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t0.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};_n.default=wn});var rc=_(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});var tc=Te(),kn=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=tc.path.makeAbsolute(this._settings.cwd,r),r=tc.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};Tn.default=kn});var xr=_(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});var r0=O("path"),i0=Qu(),n0=Zu(),s0=ec(),a0=rc(),Bn=class{constructor(e){this._settings=e,this.errorFilter=new s0.default(this._settings),this.entryFilter=new n0.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new i0.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a0.default(this._settings)}_getRootDirectory(e){return r0.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};Pn.default=Bn});var ic=_(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});var o0=Wu(),u0=xr(),Rn=class extends u0.default{constructor(){super(...arguments),this._reader=new o0.default(this._settings)}async read(e){let r=this._getRootDirectory(e),i=this._getReaderOptions(e);return(await this.api(r,e,i)).map(c=>i.transform(c))}api(e,r,i){return r.dynamic?this._reader.dynamic(e,i):this._reader.static(r.patterns,i)}};In.default=Rn});var nc=_(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});var c0=O("stream"),l0=xn(),h0=xr(),Nn=class extends h0.default{constructor(){super(...arguments),this._reader=new l0.default(this._settings)}read(e){let r=this._getRootDirectory(e),i=this._getReaderOptions(e),a=this.api(r,e,i),c=new c0.Readable({objectMode:!0,read:()=>{}});return a.once("error",u=>c.emit("error",u)).on("data",u=>c.emit("data",i.transform(u))).once("end",()=>c.emit("end")),c.once("close",()=>a.destroy()),c}api(e,r,i){return r.dynamic?this._reader.dynamic(e,i):this._reader.static(r.patterns,i)}};Ln.default=Nn});var sc=_(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});var f0=Ge(),p0=pr(),d0=dr(),On=class extends d0.default{constructor(){super(...arguments),this._walkSync=p0.walkSync,this._statSync=f0.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let i=[];for(let a of e){let c=this._getFullEntryPath(a),u=this._getEntry(c,a,r);u===null||!r.entryFilter(u)||i.push(u)}return i}_getEntry(e,r,i){try{let a=this._getStat(e);return this._makeEntry(a,r)}catch(a){if(i.errorFilter(a))return null;throw a}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};Mn.default=On});var ac=_(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var m0=sc(),x0=xr(),Hn=class extends x0.default{constructor(){super(...arguments),this._reader=new m0.default(this._settings)}read(e){let r=this._getRootDirectory(e),i=this._getReaderOptions(e);return this.api(r,e,i).map(i.transform)}api(e,r,i){return r.dynamic?this._reader.dynamic(e,i):this._reader.static(r.patterns,i)}};Xn.default=Hn});var oc=_(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var ut=O("fs"),E0=O("os"),g0=Math.max(E0.cpus().length,1);ct.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:ut.lstat,lstatSync:ut.lstatSync,stat:ut.stat,statSync:ut.statSync,readdir:ut.readdir,readdirSync:ut.readdirSync};var Un=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,g0),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},ct.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};ct.default=Un});var zn=_((_E,cc)=>{"use strict";var uc=cu(),D0=ic(),y0=nc(),v0=ac(),$n=oc(),xe=Te();async function jn(t,e){De(t);let r=Jn(t,D0.default,e),i=await Promise.all(r);return xe.array.flatten(i)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(p,h){De(p);let m=Jn(p,v0.default,h);return xe.array.flatten(m)}t.sync=e;function r(p,h){De(p);let m=Jn(p,y0.default,h);return xe.stream.merge(m)}t.stream=r;function i(p,h){De(p);let m=[].concat(p),l=new $n.default(h);return uc.generate(m,l)}t.generateTasks=i;function a(p,h){De(p);let m=new $n.default(h);return xe.pattern.isDynamicPattern(p,m)}t.isDynamicPattern=a;function c(p){return De(p),xe.path.escape(p)}t.escapePath=c;function u(p){return De(p),xe.path.convertPathToPattern(p)}t.convertPathToPattern=u;let x;(function(p){function h(l){return De(l),xe.path.escapePosixPath(l)}p.escapePath=h;function m(l){return De(l),xe.path.convertPosixPathToPattern(l)}p.convertPathToPattern=m})(x=t.posix||(t.posix={}));let d;(function(p){function h(l){return De(l),xe.path.escapeWindowsPath(l)}p.escapePath=h;function m(l){return De(l),xe.path.convertWindowsPathToPattern(l)}p.convertPathToPattern=m})(d=t.win32||(t.win32={}))})(jn||(jn={}));function Jn(t,e,r){let i=[].concat(t),a=new $n.default(r),c=uc.generate(i,a),u=new e(a);return c.map(u.read,u)}function De(t){if(![].concat(t).every(i=>xe.string.isString(i)&&!xe.string.isEmpty(i)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}cc.exports=jn});var vc=_((LE,yc)=>{function pc(t){return Array.isArray(t)?t:[t]}var Vn="",dc=" ",Kn="\\",S0=/^\s+$/,A0=/(?:[^\\]|^)\\$/,C0=/^\\!/,b0=/^\\#/,F0=/\r?\n/g,w0=/^\.*\/|^\.+$/,Wn="/",Ec="node-ignore";typeof Symbol<"u"&&(Ec=Symbol.for("node-ignore"));var mc=Ec,_0=(t,e,r)=>Object.defineProperty(t,e,{value:r}),k0=/([0-z])-([0-z])/g,gc=()=>!1,T0=t=>t.replace(k0,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Vn),B0=t=>{let{length:e}=t;return t.slice(0,e-e%2)},P0=[[/^\uFEFF/,()=>Vn],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?dc:Vn)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+dc}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Kn],[/\\\\/g,()=>Kn],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,a)=>e===Kn?`\\[${r}${B0(i)}${a}`:a==="]"&&i.length%2===0?`[${T0(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],xc=Object.create(null),R0=(t,e)=>{let r=xc[t];return r||(r=P0.reduce((i,[a,c])=>i.replace(a,c.bind(t)),t),xc[t]=r),e?new RegExp(r,"i"):new RegExp(r)},Zn=t=>typeof t=="string",I0=t=>t&&Zn(t)&&!S0.test(t)&&!A0.test(t)&&t.indexOf("#")!==0,N0=t=>t.split(F0),Yn=class{constructor(e,r,i,a){this.origin=e,this.pattern=r,this.negative=i,this.regex=a}},L0=(t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(C0,"!").replace(b0,"#");let a=R0(t,e);return new Yn(r,t,i,a)},O0=(t,e)=>{throw new e(t)},Be=(t,e,r)=>Zn(t)?t?Be.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),Dc=t=>w0.test(t);Be.isNotRelative=Dc;Be.convert=t=>t;var Qn=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){_0(this,mc,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[mc]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(I0(e)){let r=L0(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,pc(Zn(e)?N0(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,a=!1;return this._rules.forEach(c=>{let{negative:u}=c;if(a===u&&i!==a||u&&!i&&!a&&!r)return;c.regex.test(e)&&(i=!u,a=u)}),{ignored:i,unignored:a}}_test(e,r,i,a){let c=e&&Be.convert(e);return Be(c,e,this._allowRelativePaths?gc:O0),this._t(c,r,i,a)}_t(e,r,i,a){if(e in r)return r[e];if(a||(a=e.split(Wn)),a.pop(),!a.length)return r[e]=this._testOne(e,i);let c=this._t(a.join(Wn)+Wn,r,i,a);return r[e]=c.ignored?c:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return pc(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},gr=t=>new Qn(t),M0=t=>Be(t&&Be.convert(t),t,gc);gr.isPathValid=M0;gr.default=gr;yc.exports=gr;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Be.convert=t;let e=/^[a-z]:\//i;Be.isNotRelative=r=>e.test(r)||Dc(r)}});var V0={};Fl(V0,{default:()=>W0});var Ue=O("path");var $e=O("path");function os(t){t=t.replace(/\\/g,"/");let e=t,r=[t];return t.endsWith(".json")?(r=[t],e=$e.posix.join(t,"..","package.json"),t=$e.posix.join(t,"..")):(r=[$e.posix.join(t,"tsconfig.json"),$e.posix.join(t,"tsconfig.*.json")],e=$e.posix.join(t,"package.json")),{directory:$e.posix.resolve(t),packageJsonPath:e,tsConfigPatterns:r}}var _t=O("fs/promises"),Ee=ne(ls(),1),ft=ne(ti(),1);var ts=ne(O("process"),1),Ic=ne(O("fs"),1),Ve=ne(O("path"),1);var Ut=O("events"),Ea=O("stream"),si=O("stream/promises");function ai(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let a of t)ii(a);let e=t.some(({readableObjectMode:a})=>a),r=uf(t,e),i=new ri({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let a of t)i.add(a);return t.length===0&&ya(i),i}var uf=(t,e)=>{if(t.length===0)return 16384;let r=t.filter(({readableObjectMode:i})=>i===e).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ri=class extends Ea.PassThrough{#e=new Set([]);#r=new Set([]);#i=new Set([]);#t;add(e){ii(e),!this.#e.has(e)&&(this.#e.add(e),this.#t??=cf(this,this.#e),ff({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#i,onFinished:this.#t}),e.pipe(this,{end:!1}))}remove(e){return ii(e),this.#e.has(e)?(e.unpipe(this),!0):!1}},cf=async(t,e)=>{Xt(t,ma);let r=new AbortController;try{await Promise.race([lf(t,r),hf(t,e,r)])}finally{r.abort(),Xt(t,-ma)}},lf=async(t,{signal:e})=>{await(0,si.finished)(t,{signal:e,cleanup:!0})},hf=async(t,e,{signal:r})=>{for await(let[i]of(0,Ut.on)(t,"unpipe",{signal:r}))e.has(i)&&i.emit(Da)},ii=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},ff=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:a,onFinished:c})=>{Xt(t,xa);let u=new AbortController;try{await Promise.race([pf(c,e),df({passThroughStream:t,stream:e,streams:r,ended:i,aborted:a,controller:u}),mf({stream:e,streams:r,ended:i,aborted:a,controller:u})])}finally{u.abort(),Xt(t,-xa)}r.size===i.size+a.size&&(i.size===0&&a.size>0?ni(t):ya(t))},ga=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",pf=async(t,e)=>{try{await t,ni(e)}catch(r){ga(r)?ni(e):va(e,r)}},df=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:a,controller:{signal:c}})=>{try{await(0,si.finished)(e,{signal:c,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&i.add(e)}catch(u){if(c.aborted||!r.has(e))return;ga(u)?a.add(e):va(t,u)}},mf=async({stream:t,streams:e,ended:r,aborted:i,controller:{signal:a}})=>{await(0,Ut.once)(t,Da,{signal:a}),e.delete(t),r.delete(t),i.delete(t)},Da=Symbol("unpipe"),ya=t=>{t.writable&&t.end()},ni=t=>{(t.readable||t.writable)&&t.destroy()},va=(t,e)=>{t.destroyed||(t.once("error",xf),t.destroy(e))},xf=()=>{},Xt=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},ma=2,xa=1;var ht=ne(zn(),1);var Er=ne(O("fs"),1);async function qn(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await Er.promises[t](r))[e]()}catch(i){if(i.code==="ENOENT")return!1;throw i}}function Gn(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return Er.default[t](r)[e]()}catch(i){if(i.code==="ENOENT")return!1;throw i}}var kE=qn.bind(null,"stat","isFile"),lc=qn.bind(null,"stat","isDirectory"),TE=qn.bind(null,"lstat","isSymbolicLink"),BE=Gn.bind(null,"statSync","isFile"),hc=Gn.bind(null,"statSync","isDirectory"),PE=Gn.bind(null,"lstatSync","isSymbolicLink");var fc=O("url");function Ft(t){return t instanceof URL?(0,fc.fileURLToPath)(t):t}var Sc=ne(O("process"),1),Ac=ne(O("fs"),1),Cc=ne(O("fs/promises"),1),We=ne(O("path"),1),es=ne(zn(),1),bc=ne(vc(),1);function lt(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}var wt=t=>t[0]==="!";var H0=["**/node_modules","**/flow-typed","**/coverage","**/.git"],Fc={absolute:!0,dot:!0},wc="**/.gitignore",X0=(t,e)=>wt(t)?"!"+We.default.posix.join(e,t.slice(1)):We.default.posix.join(e,t),U0=(t,e)=>{let r=lt(We.default.relative(e,We.default.dirname(t.filePath)));return t.content.split(/\r?\n/).filter(i=>i&&!i.startsWith("#")).map(i=>X0(i,r))},$0=(t,e)=>{if(e=lt(e),We.default.isAbsolute(t)){if(lt(t).startsWith(e))return We.default.relative(e,t);throw new Error(`Path ${t} is not in cwd ${e}`)}return t},_c=(t,e)=>{let r=t.flatMap(a=>U0(a,e)),i=(0,bc.default)().add(r);return a=>(a=Ft(a),a=$0(a,e),a?i.ignores(lt(a)):!1)},kc=(t={})=>({cwd:Ft(t.cwd)??Sc.default.cwd(),suppressErrors:!!t.suppressErrors,deep:typeof t.deep=="number"?t.deep:Number.POSITIVE_INFINITY,ignore:[...t.ignore??[],...H0]}),Tc=async(t,e)=>{let{cwd:r,suppressErrors:i,deep:a,ignore:c}=kc(e),u=await(0,es.default)(t,{cwd:r,suppressErrors:i,deep:a,ignore:c,...Fc}),x=await Promise.all(u.map(async d=>({filePath:d,content:await Cc.default.readFile(d,"utf8")})));return _c(x,r)},Bc=(t,e)=>{let{cwd:r,suppressErrors:i,deep:a,ignore:c}=kc(e),x=es.default.sync(t,{cwd:r,suppressErrors:i,deep:a,ignore:c,...Fc}).map(d=>({filePath:d,content:Ac.default.readFileSync(d,"utf8")}));return _c(x,r)};var j0=t=>{if(t.some(e=>typeof e!="string"))throw new TypeError("Patterns must be a string or an array of strings")},Nc=(t,e)=>{let r=wt(t)?t.slice(1):t;return Ve.default.isAbsolute(r)?r:Ve.default.join(e,r)},Lc=({directoryPath:t,files:e,extensions:r})=>{let i=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return e?e.map(a=>Ve.default.posix.join(t,`**/${Ve.default.extname(a)?a:`${a}${i}`}`)):[Ve.default.posix.join(t,`**${i?`/*${i}`:""}`)]},Pc=async(t,{cwd:e=ts.default.cwd(),files:r,extensions:i}={})=>(await Promise.all(t.map(async c=>await lc(Nc(c,e))?Lc({directoryPath:c,files:r,extensions:i}):c))).flat(),Rc=(t,{cwd:e=ts.default.cwd(),files:r,extensions:i}={})=>t.flatMap(a=>hc(Nc(a,e))?Lc({directoryPath:a,files:r,extensions:i}):a),rs=t=>(t=[...new Set([t].flat())],j0(t),t),J0=t=>{if(!t)return;let e;try{e=Ic.default.statSync(t)}catch{return}if(!e.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},Oc=(t={})=>(t={...t,ignore:t.ignore??[],expandDirectories:t.expandDirectories??!0,cwd:Ft(t.cwd)},J0(t.cwd),t),Mc=t=>async(e,r)=>t(rs(e),Oc(r)),Dr=t=>(e,r)=>t(rs(e),Oc(r)),Hc=t=>{let{ignoreFiles:e,gitignore:r}=t,i=e?rs(e):[];return r&&i.push(wc),i},z0=async t=>{let e=Hc(t);return Uc(e.length>0&&await Tc(e,t))},Xc=t=>{let e=Hc(t);return Uc(e.length>0&&Bc(e,t))},Uc=t=>{let e=new Set;return r=>{let i=Ve.default.normalize(r.path??r);return e.has(i)||t&&t(i)?!1:(e.add(i),!0)}},$c=(t,e)=>t.flat().filter(r=>e(r)),jc=(t,e)=>{let r=[];for(;t.length>0;){let i=t.findIndex(c=>wt(c));if(i===-1){r.push({patterns:t,options:e});break}let a=t[i].slice(1);for(let c of r)c.options.ignore.push(a);i!==0&&r.push({patterns:t.slice(0,i),options:{...e,ignore:[...e.ignore,a]}}),t=t.slice(i+1)}return r},Jc=(t,e)=>({...e?{cwd:e}:{},...Array.isArray(t)?{files:t}:t}),zc=async(t,e)=>{let r=jc(t,e),{cwd:i,expandDirectories:a}=e;if(!a)return r;let c=Jc(a,i);return Promise.all(r.map(async u=>{let{patterns:x,options:d}=u;return[x,d.ignore]=await Promise.all([Pc(x,c),Pc(d.ignore,{cwd:i})]),{patterns:x,options:d}}))},is=(t,e)=>{let r=jc(t,e),{cwd:i,expandDirectories:a}=e;if(!a)return r;let c=Jc(a,i);return r.map(u=>{let{patterns:x,options:d}=u;return x=Rc(x,c),d.ignore=Rc(d.ignore,{cwd:i}),{patterns:x,options:d}})},qc=Mc(async(t,e)=>{let[r,i]=await Promise.all([zc(t,e),z0(e)]),a=await Promise.all(r.map(c=>(0,ht.default)(c.patterns,c.options)));return $c(a,i)}),KE=Dr((t,e)=>{let r=is(t,e),i=Xc(e),a=r.map(c=>ht.default.sync(c.patterns,c.options));return $c(a,i)}),WE=Dr((t,e)=>{let r=is(t,e),i=Xc(e),a=r.map(u=>ht.default.stream(u.patterns,u.options));return ai(a).filter(u=>i(u))}),VE=Dr((t,e)=>t.some(r=>ht.default.isDynamicPattern(r,e))),YE=Mc(zc),QE=Dr(is),{convertPathToPattern:ZE}=ht.default;var ss=ne(O("os"),1);var Gc=O("fs/promises"),Sr=ne(ti(),1),ns=O("path");function yr(t){return t.endsWith("tsconfig.json")}var vr=class{cache;constructor(){this.cache=new Map}async resolve(e){if(this.cache.has(e))return this.cache.get(e);let r=await(0,Gc.readFile)(e,"utf-8").then(i=>Sr.default.parse(i));for(let i of r.references||[])(0,Sr.assign)(i,{path:ns.posix.join(e,"..",i.path)});return this.cache.set(e,r),r}async isReferencedInRootConfig(e){return yr(e)?!1:(await this.resolve(ns.posix.join(e,"..","tsconfig.json"))).references?.some(i=>i.path===e)||!1}};var Wc=O("fs");function Kc(t){return t.replace(/\\/g,"/")}async function Vc(t={},...e){let r=new vr,i=new Map,a=new Map;for(let u of e){let{directory:x,packageJsonPath:d,tsConfigPatterns:p}=os(u);try{let h=await(0,_t.readFile)(d,"utf-8").then(n=>JSON.parse(n));if(!h.name){console.warn(`No name found in package.json at ${d}, skipping`);continue}let m=await qc(p);if(m.length===0)continue;let l={directory:x,tsConfigPaths:m,packageInfo:{name:h.name,dependencies:{...h.dependencies||{},...h.devDependencies||{}}}};a.set(h.name,l),i.set(x,l);for(let n of m)i.set(n,l)}catch{console.warn(`Error reading package.json at ${d}, skipping`)}}let c=!1;for(let[,{directory:u,tsConfigPaths:x,packageInfo:d}]of a)for(let p of x)try{let h=await r.resolve(p),m=new Set,l=new Set,n=[],s=new Set;for(let E of h.references||[]){let g=E.path.endsWith(".json")?E.path:Ue.posix.join(E.path,"tsconfig.json"),v=i.get(g);if(v){if(await r.isReferencedInRootConfig(g)&&!yr(p)){n.push({name:Ue.posix.relative(u,E.path),referencedInRoot:!0});continue}let A=await r.resolve(g),T=!A?.compilerOptions?.composite,k=A?.compilerOptions?.noEmit;if(!(v.packageInfo.name in d.dependencies||v.directory===u)||T||k){n.push({name:v.packageInfo.name,notComposite:T,noEmit:k});continue}}else if((0,Wc.existsSync)(g))m.add(Ue.posix.relative(u,E.path));else{n.push({name:Ue.posix.relative(u,E.path),notFound:!0});continue}s.add(Ue.posix.relative(u,E.path))}for(let E of Object.keys(d.dependencies)){let g=a.get(E);if(g)for(let v of g.tsConfigPaths){if(await r.isReferencedInRootConfig(v))continue;let A=await r.resolve(v);if(!A.compilerOptions?.composite||A.compilerOptions?.noEmit)continue;let T=Ue.posix.relative(u,v.replace("tsconfig.json",""));s.has(T)||(s.add(T),l.add(E))}}if((l.size||m.size||n.length)&&console.log(q0(d.name)+Ee.default.dim(" \xB7"),Ee.default.dim(Ue.posix.relative(Kc(process.cwd()),p))),l.size)for(let E of l)console.log(Ee.default.greenBright(" + ")+Ee.default.dim(`${E}`));if(n.length)for(let E of n){let g="";t.verbose&&(E.noEmit&&(g+=" (noEmit: true)"),E.notComposite&&(g+=" (composite: false)"),E.notFound&&(g+=" (not found)"),E.referencedInRoot&&(g+=" (referenced in root tsconfig.json)")),console.log(Ee.default.redBright(" - ")+Ee.default.dim(`${E.name}${g}`))}if(m.size)for(let E of m)console.log(Ee.default.yellowBright(" ? ")+Ee.default.dim(`${E}`));if(t.immutable){(l.size||n.length)&&(c=!0);continue}let o=await(0,_t.readFile)(p,"utf-8").then(E=>ft.default.parse(E)),f=o.references?.filter(E=>s.has(E.path))||[];for(let E of s)f.some(g=>g.path===E)||f.push({path:E});(0,ft.assign)(o,{references:f.sort((E,g)=>E.path.localeCompare(g.path))}),o.references?.length===0&&delete o.references,await(0,_t.writeFile)(p,G0((0,ft.stringify)(o,null,2))+ss.default.EOL)}catch(h){console.warn(`Error reading tsconfig.json at ${p}, skipping`,h);continue}if(t.verbose){let u=a.size;console.log(Ee.default.dim(Ee.default.greenBright(`Linked ${u} package${u===1?"":"s"}`)))}c&&(console.error("Immutable mode is enabled, please fix the issues manually"),process.exit(1))}function q0(t){let e="\x1B[38;2;200;85;15m",r="\x1B[38;2;200;130;90m";return t.replace(/^(@[^\/]+\/)?(.*?)$/,(i,a,c)=>`${e}${a||""}${r}${c}${e}`+Ee.default.reset(""))}function G0(t){let e=/\r\n|\n|\r/g;return t.replace(e,ss.default.EOL)}var Yc=O("@yarnpkg/fslib"),K0={hooks:{afterAllInstalled:async(t,e)=>{await Vc({immutable:e.immutable},...t.workspaces.map(r=>Yc.npath.fromPortablePath(r.cwd)))}}},W0=K0;return wl(V0);})(); +/*! Bundled license information: + +repeat-string/index.js: + (*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + *) + +is-extglob/index.js: + (*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + *) + +is-glob/index.js: + (*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + *) + +is-number/index.js: + (*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + *) + +to-regex-range/index.js: + (*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + *) + +fill-range/index.js: + (*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + *) + +queue-microtask/index.js: + (*! queue-microtask. MIT License. Feross Aboukhadijeh *) + +run-parallel/index.js: + (*! run-parallel. MIT License. Feross Aboukhadijeh *) +*/ +return plugin; +} +}; diff --git a/common-react/.yarn/sdks/prettier/package.json b/common-react/.yarn/sdks/prettier/package.json index b9ab57f09d..a71a3b74a0 100644 --- a/common-react/.yarn/sdks/prettier/package.json +++ b/common-react/.yarn/sdks/prettier/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "3.4.2-sdk", + "version": "3.5.1-sdk", "main": "./index.cjs", "type": "commonjs", "bin": "./bin/prettier.cjs" diff --git a/common-react/.yarnrc.yml b/common-react/.yarnrc.yml index 134dfe022c..b54b6eeb89 100644 --- a/common-react/.yarnrc.yml +++ b/common-react/.yarnrc.yml @@ -1,3 +1,10 @@ enableTelemetry: false - preferReuse: true + +# pnpIgnorePatterns: +# - "**/cloudbeaver/common-typescript/**" + +plugins: + - checksum: 50414773926286d8c0fc32e9936a799ad23296281046f03674bc33517b597e1ff7856092c3fcf8d5460a29549ef8b3dca3f59a1732b650a02bf523b255d726e7 + path: .yarn/plugins/@yarnpkg/plugin-ts-project-linker.cjs + spec: "https://raw.githubusercontent.com/Wroud/foundation/refs/heads/main/packages/yarn-plugin-ts-project-linker/bundles/%40yarnpkg/plugin-ts-project-linker.js" diff --git a/common-react/@dbeaver/react-data-grid/artifacts/.gitignore b/common-react/@dbeaver/react-data-grid/artifacts/.gitignore new file mode 100644 index 0000000000..ebf4281dc0 --- /dev/null +++ b/common-react/@dbeaver/react-data-grid/artifacts/.gitignore @@ -0,0 +1 @@ +!lib diff --git a/common-react/@dbeaver/react-data-grid/artifacts/lib/bundle.cjs b/common-react/@dbeaver/react-data-grid/artifacts/lib/bundle.cjs new file mode 100644 index 0000000000..79f34d7490 --- /dev/null +++ b/common-react/@dbeaver/react-data-grid/artifacts/lib/bundle.cjs @@ -0,0 +1,2886 @@ +"use strict"; +Object.defineProperty(exports, '__esModule', { value: true }); +//#region rolldown:runtime +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); + +//#endregion +const react = __toESM(require("react")); +const react_dom = __toESM(require("react-dom")); +const clsx = __toESM(require("clsx")); +const react_jsx_runtime = __toESM(require("react/jsx-runtime")); + +//#region src/utils/colSpanUtils.ts +function getColSpan(column, lastFrozenColumnIndex, args) { + const colSpan = typeof column.colSpan === "function" ? column.colSpan(args) : 1; + if (Number.isInteger(colSpan) && colSpan > 1 && (!column.frozen || column.idx + colSpan - 1 <= lastFrozenColumnIndex)) return colSpan; + return undefined; +} + +//#endregion +//#region src/utils/domUtils.ts +function stopPropagation(event) { + event.stopPropagation(); +} +function scrollIntoView(element) { + element?.scrollIntoView({ + inline: "nearest", + block: "nearest" + }); +} + +//#endregion +//#region src/utils/eventUtils.ts +function createCellEvent(event) { + let defaultPrevented = false; + const cellEvent = { + ...event, + preventGridDefault() { + defaultPrevented = true; + }, + isGridDefaultPrevented() { + return defaultPrevented; + } + }; + Object.setPrototypeOf(cellEvent, Object.getPrototypeOf(event)); + return cellEvent; +} + +//#endregion +//#region src/utils/keyboardUtils.ts +const nonInputKeys = new Set([ + "Unidentified", + "Alt", + "AltGraph", + "CapsLock", + "Control", + "Fn", + "FnLock", + "Meta", + "NumLock", + "ScrollLock", + "Shift", + "Tab", + "ArrowDown", + "ArrowLeft", + "ArrowRight", + "ArrowUp", + "End", + "Home", + "PageDown", + "PageUp", + "Insert", + "ContextMenu", + "Escape", + "Pause", + "Play", + "PrintScreen", + "F1", + "F3", + "F4", + "F5", + "F6", + "F7", + "F8", + "F9", + "F10", + "F11", + "F12" +]); +function isCtrlKeyHeldDown(e) { + return (e.ctrlKey || e.metaKey) && e.key !== "Control"; +} +function isDefaultCellInput(event) { + const vKey = 86; + if (isCtrlKeyHeldDown(event) && event.keyCode !== vKey) return false; + return !nonInputKeys.has(event.key); +} +function onEditorNavigation({ key, target }) { + if (key === "Tab" && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement)) return target.closest(".rdg-editor-container")?.querySelectorAll("input, textarea, select").length === 1; + return false; +} + +//#endregion +//#region src/utils/renderMeasuringCells.tsx +const measuringCellClassname = "mlln6zg7-0-0-beta-47"; +function renderMeasuringCells(viewportColumns) { + return viewportColumns.map(({ key, idx, minWidth, maxWidth }) => (0, react_jsx_runtime.jsx)("div", { + className: measuringCellClassname, + style: { + gridColumnStart: idx + 1, + minWidth, + maxWidth + }, + "data-measuring-cell-key": key + }, key)); +} + +//#endregion +//#region src/utils/selectedCellUtils.ts +function isSelectedCellEditable({ selectedPosition, columns, rows }) { + const column = columns[selectedPosition.idx]; + const row$1 = rows[selectedPosition.rowIdx]; + return isCellEditableUtil(column, row$1); +} +function isCellEditableUtil(column, row$1) { + return column.renderEditCell != null && (typeof column.editable === "function" ? column.editable(row$1) : column.editable) !== false; +} +function getSelectedCellColSpan({ rows, topSummaryRows, bottomSummaryRows, rowIdx, mainHeaderRowIdx, lastFrozenColumnIndex, column }) { + const topSummaryRowsCount = topSummaryRows?.length ?? 0; + if (rowIdx === mainHeaderRowIdx) return getColSpan(column, lastFrozenColumnIndex, { type: "HEADER" }); + if (topSummaryRows && rowIdx > mainHeaderRowIdx && rowIdx <= topSummaryRowsCount + mainHeaderRowIdx) return getColSpan(column, lastFrozenColumnIndex, { + type: "SUMMARY", + row: topSummaryRows[rowIdx + topSummaryRowsCount] + }); + if (rowIdx >= 0 && rowIdx < rows.length) { + const row$1 = rows[rowIdx]; + return getColSpan(column, lastFrozenColumnIndex, { + type: "ROW", + row: row$1 + }); + } + if (bottomSummaryRows) return getColSpan(column, lastFrozenColumnIndex, { + type: "SUMMARY", + row: bottomSummaryRows[rowIdx - rows.length] + }); + return undefined; +} +function getNextSelectedCellPosition({ moveUp, moveNext, cellNavigationMode, columns, colSpanColumns, rows, topSummaryRows, bottomSummaryRows, minRowIdx, mainHeaderRowIdx, maxRowIdx, currentPosition: { idx: currentIdx, rowIdx: currentRowIdx }, nextPosition, lastFrozenColumnIndex, isCellWithinBounds }) { + let { idx: nextIdx, rowIdx: nextRowIdx } = nextPosition; + const columnsCount = columns.length; + const setColSpan = (moveNext$1) => { + for (const column of colSpanColumns) { + const colIdx = column.idx; + if (colIdx > nextIdx) break; + const colSpan = getSelectedCellColSpan({ + rows, + topSummaryRows, + bottomSummaryRows, + rowIdx: nextRowIdx, + mainHeaderRowIdx, + lastFrozenColumnIndex, + column + }); + if (colSpan && nextIdx > colIdx && nextIdx < colSpan + colIdx) { + nextIdx = colIdx + (moveNext$1 ? colSpan : 0); + break; + } + } + }; + const getParentRowIdx = (parent) => { + return parent.level + mainHeaderRowIdx; + }; + const setHeaderGroupColAndRowSpan = () => { + if (moveNext) { + const nextColumn = columns[nextIdx]; + let parent = nextColumn.parent; + while (parent !== undefined) { + const parentRowIdx = getParentRowIdx(parent); + if (nextRowIdx === parentRowIdx) { + nextIdx = parent.idx + parent.colSpan; + break; + } + parent = parent.parent; + } + } else if (moveUp) { + const nextColumn = columns[nextIdx]; + let parent = nextColumn.parent; + let found = false; + while (parent !== undefined) { + const parentRowIdx = getParentRowIdx(parent); + if (nextRowIdx >= parentRowIdx) { + nextIdx = parent.idx; + nextRowIdx = parentRowIdx; + found = true; + break; + } + parent = parent.parent; + } + if (!found) { + nextIdx = currentIdx; + nextRowIdx = currentRowIdx; + } + } + }; + if (isCellWithinBounds(nextPosition)) { + setColSpan(moveNext); + if (nextRowIdx < mainHeaderRowIdx) setHeaderGroupColAndRowSpan(); + } + if (cellNavigationMode === "CHANGE_ROW") { + const isAfterLastColumn = nextIdx === columnsCount; + const isBeforeFirstColumn = nextIdx === -1; + if (isAfterLastColumn) { + const isLastRow = nextRowIdx === maxRowIdx; + if (!isLastRow) { + nextIdx = 0; + nextRowIdx += 1; + } + } else if (isBeforeFirstColumn) { + const isFirstRow = nextRowIdx === minRowIdx; + if (!isFirstRow) { + nextRowIdx -= 1; + nextIdx = columnsCount - 1; + } + setColSpan(false); + } + } + if (nextRowIdx < mainHeaderRowIdx) { + const nextColumn = columns[nextIdx]; + let parent = nextColumn.parent; + const nextParentRowIdx = nextRowIdx; + nextRowIdx = mainHeaderRowIdx; + while (parent !== undefined) { + const parentRowIdx = getParentRowIdx(parent); + if (parentRowIdx >= nextParentRowIdx) { + nextRowIdx = parentRowIdx; + nextIdx = parent.idx; + } + parent = parent.parent; + } + } + return { + idx: nextIdx, + rowIdx: nextRowIdx + }; +} +function canExitGrid({ maxColIdx, minRowIdx, maxRowIdx, selectedPosition: { rowIdx, idx }, shiftKey }) { + const atLastCellInRow = idx === maxColIdx; + const atFirstCellInRow = idx === 0; + const atLastRow = rowIdx === maxRowIdx; + const atFirstRow = rowIdx === minRowIdx; + return shiftKey ? atFirstCellInRow && atFirstRow : atLastCellInRow && atLastRow; +} + +//#endregion +//#region src/style/cell.ts +const cell = "cj343x07-0-0-beta-47"; +const cellClassname = `rdg-cell ${cell}`; +const cellFrozen = "csofj7r7-0-0-beta-47"; +const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`; + +//#endregion +//#region src/utils/styleUtils.ts +function getRowStyle(rowIdx) { + return { "--rdg-grid-row-start": rowIdx }; +} +function getHeaderCellStyle(column, rowIdx, rowSpan) { + const gridRowEnd = rowIdx + 1; + const paddingBlockStart = `calc(${rowSpan - 1} * var(--rdg-header-row-height))`; + if (column.parent === undefined) return { + insetBlockStart: 0, + gridRowStart: 1, + gridRowEnd, + paddingBlockStart + }; + return { + insetBlockStart: `calc(${rowIdx - rowSpan} * var(--rdg-header-row-height))`, + gridRowStart: gridRowEnd - rowSpan, + gridRowEnd, + paddingBlockStart + }; +} +function getCellStyle(column, colSpan = 1) { + const index = column.idx + 1; + return { + gridColumnStart: index, + gridColumnEnd: index + colSpan, + insetInlineStart: column.frozen ? `var(--rdg-frozen-left-${column.idx})` : undefined + }; +} +function getCellClassname(column, ...extraClasses) { + return (0, clsx.default)(cellClassname, { [cellFrozenClassname]: column.frozen }, ...extraClasses); +} + +//#endregion +//#region src/utils/index.ts +const { min, max, floor, sign, abs } = Math; +function assertIsValidKeyGetter(keyGetter) { + if (typeof keyGetter !== "function") throw new Error("Please specify the rowKeyGetter prop to use selection"); +} +function clampColumnWidth(width, { minWidth, maxWidth }) { + width = max(width, minWidth); + if (typeof maxWidth === "number" && maxWidth >= minWidth) return min(width, maxWidth); + return width; +} +function getHeaderCellRowSpan(column, rowIdx) { + return column.parent === undefined ? rowIdx : column.level - column.parent.level; +} + +//#endregion +//#region src/cellRenderers/renderCheckbox.tsx +const checkbox = "c1bn88vv7-0-0-beta-47"; +const checkboxClassname = `rdg-checkbox-input ${checkbox}`; +function renderCheckbox({ onChange, indeterminate,...props }) { + function handleChange(e) { + onChange(e.target.checked, e.nativeEvent.shiftKey); + } + return (0, react_jsx_runtime.jsx)("input", { + ref: (el) => { + if (el) el.indeterminate = indeterminate === true; + }, + type: "checkbox", + className: checkboxClassname, + onChange: handleChange, + ...props + }); +} + +//#endregion +//#region src/cellRenderers/renderToggleGroup.tsx +const groupCellContent = "g1s9ylgp7-0-0-beta-47"; +const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`; +const caret = "cz54e4y7-0-0-beta-47"; +const caretClassname = `rdg-caret ${caret}`; +function renderToggleGroup(props) { + return (0, react_jsx_runtime.jsx)(ToggleGroup, { ...props }); +} +function ToggleGroup({ groupKey, isExpanded, tabIndex, toggleGroup }) { + function handleKeyDown({ key }) { + if (key === "Enter") toggleGroup(); + } + const d = isExpanded ? "M1 1 L 7 7 L 13 1" : "M1 7 L 7 1 L 13 7"; + return (0, react_jsx_runtime.jsxs)("span", { + className: groupCellContentClassname, + tabIndex, + onKeyDown: handleKeyDown, + children: [groupKey, (0, react_jsx_runtime.jsx)("svg", { + viewBox: "0 0 14 8", + width: "14", + height: "8", + className: caretClassname, + "aria-hidden": true, + children: (0, react_jsx_runtime.jsx)("path", { d }) + })] + }); +} + +//#endregion +//#region src/cellRenderers/renderValue.tsx +function renderValue(props) { + try { + return props.row[props.column.key]; + } catch { + return null; + } +} + +//#endregion +//#region src/DataGridDefaultRenderersProvider.ts +const DataGridDefaultRenderersContext = (0, react.createContext)(undefined); +const DataGridDefaultRenderersProvider = DataGridDefaultRenderersContext.Provider; +function useDefaultRenderers() { + return (0, react.useContext)(DataGridDefaultRenderersContext); +} + +//#endregion +//#region src/cellRenderers/SelectCellFormatter.tsx +function SelectCellFormatter({ value, tabIndex, indeterminate, disabled, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }) { + const renderCheckbox$1 = useDefaultRenderers().renderCheckbox; + return renderCheckbox$1({ + "aria-label": ariaLabel, + "aria-labelledby": ariaLabelledBy, + tabIndex, + indeterminate, + disabled, + checked: value, + onChange + }); +} + +//#endregion +//#region src/hooks/useRowSelection.ts +const RowSelectionContext = (0, react.createContext)(undefined); +const RowSelectionProvider = RowSelectionContext.Provider; +const RowSelectionChangeContext = (0, react.createContext)(undefined); +const RowSelectionChangeProvider = RowSelectionChangeContext.Provider; +function useRowSelection() { + const rowSelectionContext = (0, react.useContext)(RowSelectionContext); + const rowSelectionChangeContext = (0, react.useContext)(RowSelectionChangeContext); + if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) throw new Error("useRowSelection must be used within renderCell"); + return { + isRowSelectionDisabled: rowSelectionContext.isRowSelectionDisabled, + isRowSelected: rowSelectionContext.isRowSelected, + onRowSelectionChange: rowSelectionChangeContext + }; +} +const HeaderRowSelectionContext = (0, react.createContext)(undefined); +const HeaderRowSelectionProvider = HeaderRowSelectionContext.Provider; +const HeaderRowSelectionChangeContext = (0, react.createContext)(undefined); +const HeaderRowSelectionChangeProvider = HeaderRowSelectionChangeContext.Provider; +function useHeaderRowSelection() { + const headerRowSelectionContext = (0, react.useContext)(HeaderRowSelectionContext); + const headerRowSelectionChangeContext = (0, react.useContext)(HeaderRowSelectionChangeContext); + if (headerRowSelectionContext === undefined || headerRowSelectionChangeContext === undefined) throw new Error("useHeaderRowSelection must be used within renderHeaderCell"); + return { + isIndeterminate: headerRowSelectionContext.isIndeterminate, + isRowSelected: headerRowSelectionContext.isRowSelected, + onRowSelectionChange: headerRowSelectionChangeContext + }; +} + +//#endregion +//#region src/Columns.tsx +const SELECT_COLUMN_KEY = "rdg-select-column"; +function HeaderRenderer(props) { + const { isIndeterminate, isRowSelected, onRowSelectionChange } = useHeaderRowSelection(); + return (0, react_jsx_runtime.jsx)(SelectCellFormatter, { + "aria-label": "Select All", + tabIndex: props.tabIndex, + indeterminate: isIndeterminate, + value: isRowSelected, + onChange: (checked) => { + onRowSelectionChange({ checked: isIndeterminate ? false : checked }); + } + }); +} +function SelectFormatter(props) { + const { isRowSelectionDisabled, isRowSelected, onRowSelectionChange } = useRowSelection(); + return (0, react_jsx_runtime.jsx)(SelectCellFormatter, { + "aria-label": "Select", + tabIndex: props.tabIndex, + disabled: isRowSelectionDisabled, + value: isRowSelected, + onChange: (checked, isShiftClick) => { + onRowSelectionChange({ + row: props.row, + checked, + isShiftClick + }); + } + }); +} +function SelectGroupFormatter(props) { + const { isRowSelected, onRowSelectionChange } = useRowSelection(); + return (0, react_jsx_runtime.jsx)(SelectCellFormatter, { + "aria-label": "Select Group", + tabIndex: props.tabIndex, + value: isRowSelected, + onChange: (checked) => { + onRowSelectionChange({ + row: props.row, + checked, + isShiftClick: false + }); + } + }); +} +const SelectColumn = { + key: SELECT_COLUMN_KEY, + name: "", + width: 35, + minWidth: 35, + maxWidth: 35, + resizable: false, + sortable: false, + frozen: true, + renderHeaderCell(props) { + return (0, react_jsx_runtime.jsx)(HeaderRenderer, { ...props }); + }, + renderCell(props) { + return (0, react_jsx_runtime.jsx)(SelectFormatter, { ...props }); + }, + renderGroupCell(props) { + return (0, react_jsx_runtime.jsx)(SelectGroupFormatter, { ...props }); + } +}; + +//#endregion +//#region src/hooks/useCalculatedColumns.ts +const DEFAULT_COLUMN_WIDTH = "auto"; +const DEFAULT_COLUMN_MIN_WIDTH = 50; +function useCalculatedColumns({ rawColumns, defaultColumnOptions, getColumnWidth, viewportWidth, scrollLeft, enableVirtualization }) { + const defaultWidth = defaultColumnOptions?.width ?? DEFAULT_COLUMN_WIDTH; + const defaultMinWidth = defaultColumnOptions?.minWidth ?? DEFAULT_COLUMN_MIN_WIDTH; + const defaultMaxWidth = defaultColumnOptions?.maxWidth ?? undefined; + const defaultCellRenderer = defaultColumnOptions?.renderCell ?? renderValue; + const defaultSortable = defaultColumnOptions?.sortable ?? false; + const defaultResizable = defaultColumnOptions?.resizable ?? false; + const defaultDraggable = defaultColumnOptions?.draggable ?? false; + const { columns, colSpanColumns, lastFrozenColumnIndex, headerRowsCount } = (0, react.useMemo)(() => { + let lastFrozenColumnIndex$1 = -1; + let headerRowsCount$1 = 1; + const columns$1 = []; + collectColumns(rawColumns, 1); + function collectColumns(rawColumns$1, level, parent) { + for (const rawColumn of rawColumns$1) { + if ("children" in rawColumn) { + const calculatedColumnParent = { + name: rawColumn.name, + parent, + idx: -1, + colSpan: 0, + level: 0, + headerCellClass: rawColumn.headerCellClass + }; + collectColumns(rawColumn.children, level + 1, calculatedColumnParent); + continue; + } + const frozen = rawColumn.frozen ?? false; + const column = { + ...rawColumn, + parent, + idx: 0, + level: 0, + frozen, + width: rawColumn.width ?? defaultWidth, + minWidth: rawColumn.minWidth ?? defaultMinWidth, + maxWidth: rawColumn.maxWidth ?? defaultMaxWidth, + sortable: rawColumn.sortable ?? defaultSortable, + resizable: rawColumn.resizable ?? defaultResizable, + draggable: rawColumn.draggable ?? defaultDraggable, + renderCell: rawColumn.renderCell ?? defaultCellRenderer + }; + columns$1.push(column); + if (frozen) lastFrozenColumnIndex$1++; + if (level > headerRowsCount$1) headerRowsCount$1 = level; + } + } + columns$1.sort(({ key: aKey, frozen: frozenA }, { key: bKey, frozen: frozenB }) => { + if (aKey === SELECT_COLUMN_KEY) return -1; + if (bKey === SELECT_COLUMN_KEY) return 1; + if (frozenA) { + if (frozenB) return 0; + return -1; + } + if (frozenB) return 1; + return 0; + }); + const colSpanColumns$1 = []; + columns$1.forEach((column, idx) => { + column.idx = idx; + updateColumnParent(column, idx, 0); + if (column.colSpan != null) colSpanColumns$1.push(column); + }); + return { + columns: columns$1, + colSpanColumns: colSpanColumns$1, + lastFrozenColumnIndex: lastFrozenColumnIndex$1, + headerRowsCount: headerRowsCount$1 + }; + }, [ + rawColumns, + defaultWidth, + defaultMinWidth, + defaultMaxWidth, + defaultCellRenderer, + defaultResizable, + defaultSortable, + defaultDraggable + ]); + const { templateColumns, layoutCssVars, totalFrozenColumnWidth, columnMetrics } = (0, react.useMemo)(() => { + const columnMetrics$1 = new Map(); + let left = 0; + let totalFrozenColumnWidth$1 = 0; + const templateColumns$1 = []; + for (const column of columns) { + let width = getColumnWidth(column); + if (typeof width === "number") width = clampColumnWidth(width, column); + else width = column.minWidth; + templateColumns$1.push(`${width}px`); + columnMetrics$1.set(column, { + width, + left + }); + left += width; + } + if (lastFrozenColumnIndex !== -1) { + const columnMetric = columnMetrics$1.get(columns[lastFrozenColumnIndex]); + totalFrozenColumnWidth$1 = columnMetric.left + columnMetric.width; + } + const layoutCssVars$1 = {}; + for (let i = 0; i <= lastFrozenColumnIndex; i++) { + const column = columns[i]; + layoutCssVars$1[`--rdg-frozen-left-${column.idx}`] = `${columnMetrics$1.get(column).left}px`; + } + return { + templateColumns: templateColumns$1, + layoutCssVars: layoutCssVars$1, + totalFrozenColumnWidth: totalFrozenColumnWidth$1, + columnMetrics: columnMetrics$1 + }; + }, [ + getColumnWidth, + columns, + lastFrozenColumnIndex + ]); + const [colOverscanStartIdx, colOverscanEndIdx] = (0, react.useMemo)(() => { + if (!enableVirtualization) return [0, columns.length - 1]; + const viewportLeft = scrollLeft + totalFrozenColumnWidth; + const viewportRight = scrollLeft + viewportWidth; + const lastColIdx = columns.length - 1; + const firstUnfrozenColumnIdx = min(lastFrozenColumnIndex + 1, lastColIdx); + if (viewportLeft >= viewportRight) return [firstUnfrozenColumnIdx, firstUnfrozenColumnIdx]; + let colVisibleStartIdx = firstUnfrozenColumnIdx; + while (colVisibleStartIdx < lastColIdx) { + const { left, width } = columnMetrics.get(columns[colVisibleStartIdx]); + if (left + width > viewportLeft) break; + colVisibleStartIdx++; + } + let colVisibleEndIdx = colVisibleStartIdx; + while (colVisibleEndIdx < lastColIdx) { + const { left, width } = columnMetrics.get(columns[colVisibleEndIdx]); + if (left + width >= viewportRight) break; + colVisibleEndIdx++; + } + const colOverscanStartIdx$1 = max(firstUnfrozenColumnIdx, colVisibleStartIdx - 1); + const colOverscanEndIdx$1 = min(lastColIdx, colVisibleEndIdx + 1); + return [colOverscanStartIdx$1, colOverscanEndIdx$1]; + }, [ + columnMetrics, + columns, + lastFrozenColumnIndex, + scrollLeft, + totalFrozenColumnWidth, + viewportWidth, + enableVirtualization + ]); + return { + columns, + colSpanColumns, + colOverscanStartIdx, + colOverscanEndIdx, + templateColumns, + layoutCssVars, + headerRowsCount, + lastFrozenColumnIndex, + totalFrozenColumnWidth + }; +} +function updateColumnParent(column, index, level) { + if (level < column.level) column.level = level; + if (column.parent !== undefined) { + const { parent } = column; + if (parent.idx === -1) parent.idx = index; + parent.colSpan += 1; + updateColumnParent(parent, index, level - 1); + } +} + +//#endregion +//#region src/hooks/useLayoutEffect.ts +const useLayoutEffect = typeof window === "undefined" ? react.useEffect : react.useLayoutEffect; + +//#endregion +//#region src/hooks/useColumnWidths.ts +function useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize) { + const prevGridWidthRef = (0, react.useRef)(gridWidth); + const columnsCanFlex = columns.length === viewportColumns.length; + const ignorePreviouslyMeasuredColumns = columnsCanFlex && gridWidth !== prevGridWidthRef.current; + const newTemplateColumns = [...templateColumns]; + const columnsToMeasure = []; + for (const { key, idx, width } of viewportColumns) if (typeof width === "string" && (ignorePreviouslyMeasuredColumns || !measuredColumnWidths.has(key)) && !resizedColumnWidths.has(key)) { + newTemplateColumns[idx] = width; + columnsToMeasure.push(key); + } + const gridTemplateColumns = newTemplateColumns.join(" "); + useLayoutEffect(() => { + prevGridWidthRef.current = gridWidth; + updateMeasuredWidths(columnsToMeasure); + }); + function updateMeasuredWidths(columnsToMeasure$1) { + if (columnsToMeasure$1.length === 0) return; + setMeasuredColumnWidths((measuredColumnWidths$1) => { + const newMeasuredColumnWidths = new Map(measuredColumnWidths$1); + let hasChanges = false; + for (const key of columnsToMeasure$1) { + const measuredWidth = measureColumnWidth(gridRef, key); + hasChanges ||= measuredWidth !== measuredColumnWidths$1.get(key); + if (measuredWidth === undefined) newMeasuredColumnWidths.delete(key); + else newMeasuredColumnWidths.set(key, measuredWidth); + } + return hasChanges ? newMeasuredColumnWidths : measuredColumnWidths$1; + }); + } + function handleColumnResize(column, nextWidth) { + const { key: resizingKey } = column; + const newTemplateColumns$1 = [...templateColumns]; + const columnsToMeasure$1 = []; + for (const { key, idx, width } of viewportColumns) if (resizingKey === key) { + const width$1 = typeof nextWidth === "number" ? `${nextWidth}px` : nextWidth; + newTemplateColumns$1[idx] = width$1; + } else if (columnsCanFlex && typeof width === "string" && !resizedColumnWidths.has(key)) { + newTemplateColumns$1[idx] = width; + columnsToMeasure$1.push(key); + } + gridRef.current.style.gridTemplateColumns = newTemplateColumns$1.join(" "); + const measuredWidth = typeof nextWidth === "number" ? nextWidth : measureColumnWidth(gridRef, resizingKey); + (0, react_dom.flushSync)(() => { + setResizedColumnWidths((resizedColumnWidths$1) => { + const newResizedColumnWidths = new Map(resizedColumnWidths$1); + newResizedColumnWidths.set(resizingKey, measuredWidth); + return newResizedColumnWidths; + }); + updateMeasuredWidths(columnsToMeasure$1); + }); + onColumnResize?.(column, measuredWidth); + } + return { + gridTemplateColumns, + handleColumnResize + }; +} +function measureColumnWidth(gridRef, key) { + const selector = `[data-measuring-cell-key="${CSS.escape(key)}"]`; + const measuringCell = gridRef.current?.querySelector(selector); + return measuringCell?.getBoundingClientRect().width; +} + +//#endregion +//#region src/hooks/useGridDimensions.ts +function useGridDimensions() { + const gridRef = (0, react.useRef)(null); + const [inlineSize, setInlineSize] = (0, react.useState)(1); + const [blockSize, setBlockSize] = (0, react.useState)(1); + const [horizontalScrollbarHeight, setHorizontalScrollbarHeight] = (0, react.useState)(0); + useLayoutEffect(() => { + const { ResizeObserver } = window; + if (ResizeObserver == null) return; + const { clientWidth, clientHeight, offsetWidth, offsetHeight } = gridRef.current; + const { width, height } = gridRef.current.getBoundingClientRect(); + const initialHorizontalScrollbarHeight = offsetHeight - clientHeight; + const initialWidth = width - offsetWidth + clientWidth; + const initialHeight = height - initialHorizontalScrollbarHeight; + setInlineSize(initialWidth); + setBlockSize(initialHeight); + setHorizontalScrollbarHeight(initialHorizontalScrollbarHeight); + const resizeObserver = new ResizeObserver((entries) => { + const size = entries[0].contentBoxSize[0]; + const { clientHeight: clientHeight$1, offsetHeight: offsetHeight$1 } = gridRef.current; + (0, react_dom.flushSync)(() => { + setInlineSize(size.inlineSize); + setBlockSize(size.blockSize); + setHorizontalScrollbarHeight(offsetHeight$1 - clientHeight$1); + }); + }); + resizeObserver.observe(gridRef.current); + return () => { + resizeObserver.disconnect(); + }; + }, []); + return [ + gridRef, + inlineSize, + blockSize, + horizontalScrollbarHeight + ]; +} + +//#endregion +//#region src/hooks/useLatestFunc.ts +function useLatestFunc(fn) { + const ref = (0, react.useRef)(fn); + (0, react.useEffect)(() => { + ref.current = fn; + }); + const callbackFn = (0, react.useCallback)((...args) => { + ref.current(...args); + }, []); + return fn ? callbackFn : fn; +} + +//#endregion +//#region src/hooks/useRovingTabIndex.ts +function useRovingTabIndex(isSelected) { + const [isChildFocused, setIsChildFocused] = (0, react.useState)(false); + if (isChildFocused && !isSelected) setIsChildFocused(false); + function onFocus(event) { + if (event.target !== event.currentTarget) setIsChildFocused(true); + } + const isFocusable = isSelected && !isChildFocused; + return { + tabIndex: isFocusable ? 0 : -1, + childTabIndex: isSelected ? 0 : -1, + onFocus: isSelected ? onFocus : undefined + }; +} + +//#endregion +//#region src/hooks/useViewportColumns.ts +function useViewportColumns({ columns, colSpanColumns, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, colOverscanEndIdx, lastFrozenColumnIndex, rowOverscanStartIdx, rowOverscanEndIdx }) { + const startIdx = (0, react.useMemo)(() => { + if (colOverscanStartIdx === 0) return 0; + let startIdx$1 = colOverscanStartIdx; + const updateStartIdx = (colIdx, colSpan) => { + if (colSpan !== undefined && colIdx + colSpan > colOverscanStartIdx) { + startIdx$1 = colIdx; + return true; + } + return false; + }; + for (const column of colSpanColumns) { + const colIdx = column.idx; + if (colIdx >= startIdx$1) break; + if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { type: "HEADER" }))) break; + for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) { + const row$1 = rows[rowIdx]; + if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { + type: "ROW", + row: row$1 + }))) break; + } + if (topSummaryRows != null) { + for (const row$1 of topSummaryRows) if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { + type: "SUMMARY", + row: row$1 + }))) break; + } + if (bottomSummaryRows != null) { + for (const row$1 of bottomSummaryRows) if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, { + type: "SUMMARY", + row: row$1 + }))) break; + } + } + return startIdx$1; + }, [ + rowOverscanStartIdx, + rowOverscanEndIdx, + rows, + topSummaryRows, + bottomSummaryRows, + colOverscanStartIdx, + lastFrozenColumnIndex, + colSpanColumns + ]); + return (0, react.useMemo)(() => { + const viewportColumns = []; + for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) { + const column = columns[colIdx]; + if (colIdx < startIdx && !column.frozen) continue; + viewportColumns.push(column); + } + return viewportColumns; + }, [ + startIdx, + colOverscanEndIdx, + columns + ]); +} + +//#endregion +//#region src/hooks/useViewportRows.ts +function useViewportRows({ rows, rowHeight, clientHeight, scrollTop, enableVirtualization }) { + const { totalRowHeight, gridTemplateRows, getRowTop, getRowHeight, findRowIdx } = (0, react.useMemo)(() => { + if (typeof rowHeight === "number") return { + totalRowHeight: rowHeight * rows.length, + gridTemplateRows: ` repeat(${rows.length}, ${rowHeight}px)`, + getRowTop: (rowIdx) => rowIdx * rowHeight, + getRowHeight: () => rowHeight, + findRowIdx: (offset) => floor(offset / rowHeight) + }; + let totalRowHeight$1 = 0; + let gridTemplateRows$1 = " "; + const rowPositions = rows.map((row$1) => { + const currentRowHeight = rowHeight(row$1); + const position = { + top: totalRowHeight$1, + height: currentRowHeight + }; + gridTemplateRows$1 += `${currentRowHeight}px `; + totalRowHeight$1 += currentRowHeight; + return position; + }); + const validateRowIdx = (rowIdx) => { + return max(0, min(rows.length - 1, rowIdx)); + }; + return { + totalRowHeight: totalRowHeight$1, + gridTemplateRows: gridTemplateRows$1, + getRowTop: (rowIdx) => rowPositions[validateRowIdx(rowIdx)].top, + getRowHeight: (rowIdx) => rowPositions[validateRowIdx(rowIdx)].height, + findRowIdx(offset) { + let start = 0; + let end = rowPositions.length - 1; + while (start <= end) { + const middle = start + floor((end - start) / 2); + const currentOffset = rowPositions[middle].top; + if (currentOffset === offset) return middle; + if (currentOffset < offset) start = middle + 1; + else if (currentOffset > offset) end = middle - 1; + if (start > end) return end; + } + return 0; + } + }; + }, [rowHeight, rows]); + let rowOverscanStartIdx = 0; + let rowOverscanEndIdx = rows.length - 1; + if (enableVirtualization) { + const overscanThreshold = 4; + const rowVisibleStartIdx = findRowIdx(scrollTop); + const rowVisibleEndIdx = findRowIdx(scrollTop + clientHeight); + rowOverscanStartIdx = max(0, rowVisibleStartIdx - overscanThreshold); + rowOverscanEndIdx = min(rows.length - 1, rowVisibleEndIdx + overscanThreshold); + } + return { + rowOverscanStartIdx, + rowOverscanEndIdx, + totalRowHeight, + gridTemplateRows, + getRowTop, + getRowHeight, + findRowIdx + }; +} + +//#endregion +//#region src/Cell.tsx +const cellCopied = "c6ra8a37-0-0-beta-47"; +const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`; +const cellDraggedOver = "cq910m07-0-0-beta-47"; +const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`; +function Cell({ column, colSpan, isCellSelected, isCopied, isDraggedOver, row: row$1, rowIdx, className, onClick, onDoubleClick, onContextMenu, onRowChange, selectCell, style,...props }, ref) { + const { tabIndex, childTabIndex, onFocus } = useRovingTabIndex(isCellSelected); + const { cellClass } = column; + className = getCellClassname(column, { + [cellCopiedClassname]: isCopied, + [cellDraggedOverClassname]: isDraggedOver + }, typeof cellClass === "function" ? cellClass(row$1) : cellClass, className); + const isEditable = isCellEditableUtil(column, row$1); + function selectCellWrapper(openEditor) { + selectCell({ + rowIdx, + idx: column.idx + }, openEditor); + } + function handleClick(event) { + if (onClick) { + const cellEvent = createCellEvent(event); + onClick({ + rowIdx, + row: row$1, + column, + selectCell: selectCellWrapper + }, cellEvent); + if (cellEvent.isGridDefaultPrevented()) return; + } + selectCellWrapper(); + } + function handleContextMenu(event) { + if (onContextMenu) { + const cellEvent = createCellEvent(event); + onContextMenu({ + rowIdx, + row: row$1, + column, + selectCell: selectCellWrapper + }, cellEvent); + if (cellEvent.isGridDefaultPrevented()) return; + } + selectCellWrapper(); + } + function handleDoubleClick(event) { + if (onDoubleClick) { + const cellEvent = createCellEvent(event); + onDoubleClick({ + rowIdx, + row: row$1, + column, + selectCell: selectCellWrapper + }, cellEvent); + if (cellEvent.isGridDefaultPrevented()) return; + } + selectCellWrapper(true); + } + function handleRowChange(newRow) { + onRowChange(column, newRow); + } + return (0, react_jsx_runtime.jsx)( + "div", + // aria-colindex is 1-based + { + role: "gridcell", + "aria-colindex": column.idx + 1, + "aria-colspan": colSpan, + "aria-selected": isCellSelected, + "aria-readonly": !isEditable || undefined, + ref, + tabIndex, + className, + style: { + ...getCellStyle(column, colSpan), + ...style + }, + onClick: handleClick, + onDoubleClick: handleDoubleClick, + onContextMenu: handleContextMenu, + onFocus, + ...props, + children: column.renderCell({ + column, + row: row$1, + rowIdx, + isCellEditable: isEditable, + tabIndex: childTabIndex, + onRowChange: handleRowChange + }) + } +); +} +const CellComponent = (0, react.memo)((0, react.forwardRef)(Cell)); +var Cell_default = CellComponent; +function defaultRenderCell(key, props) { + return (0, react_jsx_runtime.jsx)(CellComponent, { ...props }, key); +} + +//#endregion +//#region src/DragHandle.tsx +const cellDragHandle = "c1w9bbhr7-0-0-beta-47"; +const cellDragHandleFrozenClassname = "c1creorc7-0-0-beta-47"; +const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`; +function DragHandle({ gridRowStart, rows, column, columnWidth, maxColIdx, isLastRow, selectedPosition, latestDraggedOverRowIdx, isCellEditable, onRowsChange, onFill, onClick, setDragging, setDraggedOverRowIdx }) { + const { idx, rowIdx } = selectedPosition; + function handleMouseDown(event) { + event.preventDefault(); + if (event.buttons !== 1) return; + setDragging(true); + window.addEventListener("mouseover", onMouseOver); + window.addEventListener("mouseup", onMouseUp); + function onMouseOver(event$1) { + if (event$1.buttons !== 1) onMouseUp(); + } + function onMouseUp() { + window.removeEventListener("mouseover", onMouseOver); + window.removeEventListener("mouseup", onMouseUp); + setDragging(false); + handleDragEnd(); + } + } + function handleDragEnd() { + const overRowIdx = latestDraggedOverRowIdx.current; + if (overRowIdx === undefined) return; + const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx; + const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx; + updateRows(startRowIndex, endRowIndex); + setDraggedOverRowIdx(undefined); + } + function handleDoubleClick(event) { + event.stopPropagation(); + updateRows(rowIdx + 1, rows.length); + } + function updateRows(startRowIdx, endRowIdx) { + const sourceRow = rows[rowIdx]; + const updatedRows = [...rows]; + const indexes = []; + for (let i = startRowIdx; i < endRowIdx; i++) if (isCellEditable({ + rowIdx: i, + idx + })) { + const updatedRow = onFill({ + columnKey: column.key, + sourceRow, + targetRow: rows[i] + }); + if (updatedRow !== rows[i]) { + updatedRows[i] = updatedRow; + indexes.push(i); + } + } + if (indexes.length > 0) onRowsChange?.(updatedRows, { + indexes, + column + }); + } + function getStyle() { + const colSpan = column.colSpan?.({ + type: "ROW", + row: rows[rowIdx] + }) ?? 1; + const { insetInlineStart,...style } = getCellStyle(column, colSpan); + const marginEnd = "calc(var(--rdg-drag-handle-size) * -0.5 + 1px)"; + const isLastColumn = column.idx + colSpan - 1 === maxColIdx; + return { + ...style, + gridRowStart, + marginInlineEnd: isLastColumn ? undefined : marginEnd, + marginBlockEnd: isLastRow ? undefined : marginEnd, + insetInlineStart: insetInlineStart ? `calc(${insetInlineStart} + ${columnWidth}px + var(--rdg-drag-handle-size) * -0.5 - 1px)` : undefined + }; + } + return (0, react_jsx_runtime.jsx)("div", { + style: getStyle(), + className: (0, clsx.default)(cellDragHandleClassname, column.frozen && cellDragHandleFrozenClassname), + onClick, + onMouseDown: handleMouseDown, + onDoubleClick: handleDoubleClick + }); +} + +//#endregion +//#region src/EditCell.tsx +const cellEditing = "cis5rrm7-0-0-beta-47"; +function EditCell({ column, colSpan, row: row$1, rowIdx, onRowChange, closeEditor, onKeyDown, navigate }) { + const frameRequestRef = (0, react.useRef)(undefined); + const commitOnOutsideClick = column.editorOptions?.commitOnOutsideClick !== false; + const commitOnOutsideMouseDown = useLatestFunc(() => { + onClose(true, false); + }); + (0, react.useEffect)(() => { + if (!commitOnOutsideClick) return; + function onWindowCaptureMouseDown() { + frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown); + } + addEventListener("mousedown", onWindowCaptureMouseDown, { capture: true }); + return () => { + removeEventListener("mousedown", onWindowCaptureMouseDown, { capture: true }); + cancelFrameRequest(); + }; + }, [commitOnOutsideClick, commitOnOutsideMouseDown]); + function cancelFrameRequest() { + cancelAnimationFrame(frameRequestRef.current); + } + function handleKeyDown(event) { + if (onKeyDown) { + const cellEvent = createCellEvent(event); + onKeyDown({ + mode: "EDIT", + row: row$1, + column, + rowIdx, + navigate() { + navigate(event); + }, + onClose + }, cellEvent); + if (cellEvent.isGridDefaultPrevented()) return; + } + if (event.key === "Escape") onClose(); + else if (event.key === "Enter") onClose(true); + else if (onEditorNavigation(event)) navigate(event); + } + function onClose(commitChanges = false, shouldFocusCell = true) { + if (commitChanges) onRowChange(row$1, true, shouldFocusCell); + else closeEditor(shouldFocusCell); + } + function onEditorRowChange(row$2, commitChangesAndFocus = false) { + onRowChange(row$2, commitChangesAndFocus, commitChangesAndFocus); + } + const { cellClass } = column; + const className = getCellClassname(column, "rdg-editor-container", !column.editorOptions?.displayCellContent && cellEditing, typeof cellClass === "function" ? cellClass(row$1) : cellClass); + return (0, react_jsx_runtime.jsx)( + "div", + // aria-colindex is 1-based + { + role: "gridcell", + "aria-colindex": column.idx + 1, + "aria-colspan": colSpan, + "aria-selected": true, + className, + style: getCellStyle(column, colSpan), + onKeyDown: handleKeyDown, + onMouseDownCapture: cancelFrameRequest, + children: column.renderEditCell != null && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [column.renderEditCell({ + column, + row: row$1, + rowIdx, + onRowChange: onEditorRowChange, + onClose + }), column.editorOptions?.displayCellContent && column.renderCell({ + column, + row: row$1, + rowIdx, + isCellEditable: true, + tabIndex: -1, + onRowChange: onEditorRowChange + })] }) + } +); +} + +//#endregion +//#region src/GroupedColumnHeaderCell.tsx +function GroupedColumnHeaderCell({ column, rowIdx, isCellSelected, selectCell }) { + const { tabIndex, onFocus } = useRovingTabIndex(isCellSelected); + const { colSpan } = column; + const rowSpan = getHeaderCellRowSpan(column, rowIdx); + const index = column.idx + 1; + function onClick() { + selectCell({ + idx: column.idx, + rowIdx + }); + } + return (0, react_jsx_runtime.jsx)("div", { + role: "columnheader", + "aria-colindex": index, + "aria-colspan": colSpan, + "aria-rowspan": rowSpan, + "aria-selected": isCellSelected, + tabIndex, + className: (0, clsx.default)(cellClassname, column.headerCellClass), + style: { + ...getHeaderCellStyle(column, rowIdx, rowSpan), + gridColumnStart: index, + gridColumnEnd: index + colSpan + }, + onFocus, + onClick, + children: column.name + }); +} + +//#endregion +//#region src/renderHeaderCell.tsx +const headerSortCellClassname = "h44jtk67-0-0-beta-47"; +const headerSortName = "hcgkhxz7-0-0-beta-47"; +const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`; +function renderHeaderCell({ column, sortDirection, priority }) { + if (!column.sortable) return column.name; + return (0, react_jsx_runtime.jsx)(SortableHeaderCell, { + sortDirection, + priority, + children: column.name + }); +} +function SortableHeaderCell({ sortDirection, priority, children }) { + const renderSortStatus$1 = useDefaultRenderers().renderSortStatus; + return (0, react_jsx_runtime.jsxs)("span", { + className: headerSortCellClassname, + children: [(0, react_jsx_runtime.jsx)("span", { + className: headerSortNameClassname, + children + }), (0, react_jsx_runtime.jsx)("span", { children: renderSortStatus$1({ + sortDirection, + priority + }) })] + }); +} + +//#endregion +//#region src/HeaderCell.tsx +const cellSortableClassname = "c6l2wv17-0-0-beta-47"; +const cellResizable = "c1kqdw7y7-0-0-beta-47"; +const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`; +const resizeHandleClassname = "r1y6ywlx7-0-0-beta-47"; +const cellDraggableClassname = "rdg-cell-draggable"; +const cellDragging = "c1bezg5o7-0-0-beta-47"; +const cellDraggingClassname = `rdg-cell-dragging ${cellDragging}`; +const cellOver = "c1vc96037-0-0-beta-47"; +const cellOverClassname = `rdg-cell-drag-over ${cellOver}`; +function HeaderCell({ column, colSpan, rowIdx, isCellSelected, onColumnResize, onColumnsReorder, sortColumns, onSortColumnsChange, selectCell, shouldFocusGrid, direction, dragDropKey }) { + const [isDragging, setIsDragging] = (0, react.useState)(false); + const [isOver, setIsOver] = (0, react.useState)(false); + const isRtl = direction === "rtl"; + const rowSpan = getHeaderCellRowSpan(column, rowIdx); + const { tabIndex, childTabIndex, onFocus } = useRovingTabIndex(isCellSelected); + const sortIndex = sortColumns?.findIndex((sort) => sort.columnKey === column.key); + const sortColumn = sortIndex !== undefined && sortIndex > -1 ? sortColumns[sortIndex] : undefined; + const sortDirection = sortColumn?.direction; + const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined; + const ariaSort = sortDirection && !priority ? sortDirection === "ASC" ? "ascending" : "descending" : undefined; + const { sortable, resizable, draggable } = column; + const className = getCellClassname(column, column.headerCellClass, { + [cellSortableClassname]: sortable, + [cellResizableClassname]: resizable, + [cellDraggableClassname]: draggable, + [cellDraggingClassname]: isDragging, + [cellOverClassname]: isOver + }); + const renderHeaderCell$1 = column.renderHeaderCell ?? renderHeaderCell; + function onPointerDown(event) { + if (event.pointerType === "mouse" && event.buttons !== 1) return; + event.preventDefault(); + const { currentTarget, pointerId } = event; + const headerCell = currentTarget.parentElement; + const { right, left } = headerCell.getBoundingClientRect(); + const offset = isRtl ? event.clientX - left : right - event.clientX; + let hasDoubleClicked = false; + function onPointerMove(event$1) { + const { width, right: right$1, left: left$1 } = headerCell.getBoundingClientRect(); + let newWidth = isRtl ? right$1 + offset - event$1.clientX : event$1.clientX + offset - left$1; + newWidth = clampColumnWidth(newWidth, column); + if (width > 0 && newWidth !== width) onColumnResize(column, newWidth); + } + function onDoubleClick() { + hasDoubleClicked = true; + onColumnResize(column, "max-content"); + } + function onLostPointerCapture(event$1) { + if (!hasDoubleClicked) onPointerMove(event$1); + currentTarget.removeEventListener("pointermove", onPointerMove); + currentTarget.removeEventListener("dblclick", onDoubleClick); + currentTarget.removeEventListener("lostpointercapture", onLostPointerCapture); + } + currentTarget.setPointerCapture(pointerId); + currentTarget.addEventListener("pointermove", onPointerMove); + currentTarget.addEventListener("dblclick", onDoubleClick); + currentTarget.addEventListener("lostpointercapture", onLostPointerCapture); + } + function onSort(ctrlClick) { + if (onSortColumnsChange == null) return; + const { sortDescendingFirst } = column; + if (sortColumn === undefined) { + const nextSort = { + columnKey: column.key, + direction: sortDescendingFirst ? "DESC" : "ASC" + }; + onSortColumnsChange(sortColumns && ctrlClick ? [...sortColumns, nextSort] : [nextSort]); + } else { + let nextSortColumn; + if (sortDescendingFirst === true && sortDirection === "DESC" || sortDescendingFirst !== true && sortDirection === "ASC") nextSortColumn = { + columnKey: column.key, + direction: sortDirection === "ASC" ? "DESC" : "ASC" + }; + if (ctrlClick) { + const nextSortColumns = [...sortColumns]; + if (nextSortColumn) nextSortColumns[sortIndex] = nextSortColumn; + else nextSortColumns.splice(sortIndex, 1); + onSortColumnsChange(nextSortColumns); + } else onSortColumnsChange(nextSortColumn ? [nextSortColumn] : []); + } + } + function onClick(event) { + selectCell({ + idx: column.idx, + rowIdx + }); + if (sortable) onSort(event.ctrlKey || event.metaKey); + } + function handleFocus(event) { + onFocus?.(event); + if (shouldFocusGrid) selectCell({ + idx: 0, + rowIdx + }); + } + function onKeyDown(event) { + if (event.key === " " || event.key === "Enter") { + event.preventDefault(); + onSort(event.ctrlKey || event.metaKey); + } + } + function onDragStart(event) { + event.dataTransfer.setData(dragDropKey, column.key); + event.dataTransfer.dropEffect = "move"; + setIsDragging(true); + } + function onDragEnd() { + setIsDragging(false); + } + function onDragOver(event) { + event.preventDefault(); + event.dataTransfer.dropEffect = "move"; + } + function onDrop(event) { + setIsOver(false); + if (event.dataTransfer.types.includes(dragDropKey.toLowerCase())) { + const sourceKey = event.dataTransfer.getData(dragDropKey.toLowerCase()); + if (sourceKey !== column.key) { + event.preventDefault(); + onColumnsReorder?.(sourceKey, column.key); + } + } + } + function onDragEnter(event) { + if (isEventPertinent(event)) setIsOver(true); + } + function onDragLeave(event) { + if (isEventPertinent(event)) setIsOver(false); + } + let draggableProps; + if (draggable) draggableProps = { + draggable: true, + onDragStart, + onDragEnd, + onDragOver, + onDragEnter, + onDragLeave, + onDrop + }; + return (0, react_jsx_runtime.jsxs)("div", { + role: "columnheader", + "aria-colindex": column.idx + 1, + "aria-colspan": colSpan, + "aria-rowspan": rowSpan, + "aria-selected": isCellSelected, + "aria-sort": ariaSort, + tabIndex: shouldFocusGrid ? 0 : tabIndex, + className, + style: { + ...getHeaderCellStyle(column, rowIdx, rowSpan), + ...getCellStyle(column, colSpan) + }, + onFocus: handleFocus, + onClick, + onKeyDown: sortable ? onKeyDown : undefined, + ...draggableProps, + children: [renderHeaderCell$1({ + column, + sortDirection, + priority, + tabIndex: childTabIndex + }), resizable && (0, react_jsx_runtime.jsx)("div", { + className: resizeHandleClassname, + onClick: stopPropagation, + onPointerDown + })] + }); +} +function isEventPertinent(event) { + const relatedTarget = event.relatedTarget; + return !event.currentTarget.contains(relatedTarget); +} + +//#endregion +//#region src/style/row.ts +const row = "r1upfr807-0-0-beta-47"; +const rowClassname = `rdg-row ${row}`; +const rowSelected = "r190mhd37-0-0-beta-47"; +const rowSelectedClassname = "rdg-row-selected"; +const rowSelectedWithFrozenCell = "r139qu9m7-0-0-beta-47"; +const topSummaryRowClassname = "rdg-top-summary-row"; +const bottomSummaryRowClassname = "rdg-bottom-summary-row"; + +//#endregion +//#region src/HeaderRow.tsx +const headerRow = "h10tskcx7-0-0-beta-47"; +const headerRowClassname = `rdg-header-row ${headerRow}`; +function HeaderRow({ rowIdx, columns, onColumnResize, onColumnsReorder, sortColumns, onSortColumnsChange, lastFrozenColumnIndex, selectedCellIdx, selectCell, shouldFocusGrid, direction }) { + const dragDropKey = (0, react.useId)(); + const cells = []; + for (let index = 0; index < columns.length; index++) { + const column = columns[index]; + const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: "HEADER" }); + if (colSpan !== undefined) index += colSpan - 1; + cells.push((0, react_jsx_runtime.jsx)( + HeaderCell, + // aria-rowindex is 1 based + { + column, + colSpan, + rowIdx, + isCellSelected: selectedCellIdx === column.idx, + onColumnResize, + onColumnsReorder, + onSortColumnsChange, + sortColumns, + selectCell, + shouldFocusGrid: shouldFocusGrid && index === 0, + direction, + dragDropKey + }, + column.key +)); + } + return (0, react_jsx_runtime.jsx)("div", { + role: "row", + "aria-rowindex": rowIdx, + className: (0, clsx.default)(headerRowClassname, { [rowSelectedClassname]: selectedCellIdx === -1 }), + children: cells + }); +} +var HeaderRow_default = (0, react.memo)(HeaderRow); + +//#endregion +//#region src/GroupedColumnHeaderRow.tsx +function GroupedColumnHeaderRow({ rowIdx, level, columns, selectedCellIdx, selectCell }) { + const cells = []; + const renderedParents = new Set(); + for (const column of columns) { + let { parent } = column; + if (parent === undefined) continue; + while (parent.level > level) { + if (parent.parent === undefined) break; + parent = parent.parent; + } + if (parent.level === level && !renderedParents.has(parent)) { + renderedParents.add(parent); + const { idx } = parent; + cells.push((0, react_jsx_runtime.jsx)( + GroupedColumnHeaderCell, + // aria-rowindex is 1 based + { + column: parent, + rowIdx, + isCellSelected: selectedCellIdx === idx, + selectCell + }, + idx +)); + } + } + return (0, react_jsx_runtime.jsx)("div", { + role: "row", + "aria-rowindex": rowIdx, + className: headerRowClassname, + children: cells + }); +} +var GroupedColumnHeaderRow_default = (0, react.memo)(GroupedColumnHeaderRow); + +//#endregion +//#region src/Row.tsx +function Row({ className, rowIdx, gridRowStart, selectedCellIdx, isRowSelectionDisabled, isRowSelected, copiedCellIdx, draggedOverCellIdx, lastFrozenColumnIndex, row: row$1, viewportColumns, selectedCellEditor, onCellClick, onCellDoubleClick, onCellContextMenu, rowClass, setDraggedOverRowIdx, onMouseEnter, onRowChange, selectCell,...props }, ref) { + const renderCell = useDefaultRenderers().renderCell; + const handleRowChange = useLatestFunc((column, newRow) => { + onRowChange(column, rowIdx, newRow); + }); + function handleDragEnter(event) { + setDraggedOverRowIdx?.(rowIdx); + onMouseEnter?.(event); + } + className = (0, clsx.default)(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? "even" : "odd"}`, { [rowSelectedClassname]: selectedCellIdx === -1 }, rowClass?.(row$1, rowIdx), className); + const cells = []; + for (let index = 0; index < viewportColumns.length; index++) { + const column = viewportColumns[index]; + const { idx } = column; + const colSpan = getColSpan(column, lastFrozenColumnIndex, { + type: "ROW", + row: row$1 + }); + if (colSpan !== undefined) index += colSpan - 1; + const isCellSelected = selectedCellIdx === idx; + if (isCellSelected && selectedCellEditor) cells.push(selectedCellEditor); + else cells.push(renderCell(column.key, { + column, + colSpan, + row: row$1, + rowIdx, + isCopied: copiedCellIdx === idx, + isDraggedOver: draggedOverCellIdx === idx, + isCellSelected, + onClick: onCellClick, + onDoubleClick: onCellDoubleClick, + onContextMenu: onCellContextMenu, + onRowChange: handleRowChange, + selectCell + })); + } + const selectionValue = (0, react.useMemo)(() => ({ + isRowSelected, + isRowSelectionDisabled + }), [isRowSelectionDisabled, isRowSelected]); + return (0, react_jsx_runtime.jsx)(RowSelectionProvider, { + value: selectionValue, + children: (0, react_jsx_runtime.jsx)("div", { + role: "row", + ref, + className, + onMouseEnter: handleDragEnter, + style: getRowStyle(gridRowStart), + ...props, + children: cells + }) + }); +} +const RowComponent = (0, react.memo)((0, react.forwardRef)(Row)); +var Row_default = RowComponent; +function defaultRenderRow(key, props) { + return (0, react_jsx_runtime.jsx)(RowComponent, { ...props }, key); +} + +//#endregion +//#region src/ScrollToCell.tsx +function ScrollToCell({ scrollToPosition: { idx, rowIdx }, gridRef, setScrollToCellPosition }) { + const ref = (0, react.useRef)(null); + useLayoutEffect(() => { + scrollIntoView(ref.current); + }); + useLayoutEffect(() => { + function removeScrollToCell() { + setScrollToCellPosition(null); + } + const observer = new IntersectionObserver(removeScrollToCell, { + root: gridRef.current, + threshold: 1 + }); + observer.observe(ref.current); + return () => { + observer.disconnect(); + }; + }, [gridRef, setScrollToCellPosition]); + return (0, react_jsx_runtime.jsx)("div", { + ref, + style: { + gridColumn: idx === undefined ? "1/-1" : idx + 1, + gridRow: rowIdx === undefined ? "1/-1" : rowIdx + 2 + } + }); +} + +//#endregion +//#region src/sortStatus.tsx +const arrow = "a3ejtar7-0-0-beta-47"; +const arrowClassname = `rdg-sort-arrow ${arrow}`; +function renderSortStatus({ sortDirection, priority }) { + return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderSortIcon({ sortDirection }), renderSortPriority({ priority })] }); +} +function renderSortIcon({ sortDirection }) { + if (sortDirection === undefined) return null; + return (0, react_jsx_runtime.jsx)("svg", { + viewBox: "0 0 12 8", + width: "12", + height: "8", + className: arrowClassname, + "aria-hidden": true, + children: (0, react_jsx_runtime.jsx)("path", { d: sortDirection === "ASC" ? "M0 8 6 0 12 8" : "M0 0 6 8 12 0" }) + }); +} +function renderSortPriority({ priority }) { + return priority; +} + +//#endregion +//#region src/style/core.ts +const root = "rnvodz57-0-0-beta-47"; +const rootClassname = `rdg ${root}`; +const viewportDragging = "vlqv91k7-0-0-beta-47"; +const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`; +const focusSinkClassname = "f1lsfrzw7-0-0-beta-47"; +const focusSinkHeaderAndSummaryClassname = "f1cte0lg7-0-0-beta-47"; + +//#endregion +//#region src/SummaryCell.tsx +const summaryCellClassname = "s8wc6fl7-0-0-beta-47"; +function SummaryCell({ column, colSpan, row: row$1, rowIdx, isCellSelected, selectCell }) { + const { tabIndex, childTabIndex, onFocus } = useRovingTabIndex(isCellSelected); + const { summaryCellClass } = column; + const className = getCellClassname(column, summaryCellClassname, typeof summaryCellClass === "function" ? summaryCellClass(row$1) : summaryCellClass); + function onClick() { + selectCell({ + rowIdx, + idx: column.idx + }); + } + return (0, react_jsx_runtime.jsx)("div", { + role: "gridcell", + "aria-colindex": column.idx + 1, + "aria-colspan": colSpan, + "aria-selected": isCellSelected, + tabIndex, + className, + style: getCellStyle(column, colSpan), + onClick, + onFocus, + children: column.renderSummaryCell?.({ + column, + row: row$1, + tabIndex: childTabIndex + }) + }); +} +var SummaryCell_default = (0, react.memo)(SummaryCell); + +//#endregion +//#region src/SummaryRow.tsx +const summaryRow = "skuhp557-0-0-beta-47"; +const topSummaryRow = "tf8l5ub7-0-0-beta-47"; +const summaryRowClassname = `rdg-summary-row ${summaryRow}`; +function SummaryRow({ rowIdx, gridRowStart, row: row$1, viewportColumns, top, bottom, lastFrozenColumnIndex, selectedCellIdx, isTop, selectCell, "aria-rowindex": ariaRowIndex }) { + const cells = []; + for (let index = 0; index < viewportColumns.length; index++) { + const column = viewportColumns[index]; + const colSpan = getColSpan(column, lastFrozenColumnIndex, { + type: "SUMMARY", + row: row$1 + }); + if (colSpan !== undefined) index += colSpan - 1; + const isCellSelected = selectedCellIdx === column.idx; + cells.push((0, react_jsx_runtime.jsx)(SummaryCell_default, { + column, + colSpan, + row: row$1, + rowIdx, + isCellSelected, + selectCell + }, column.key)); + } + return (0, react_jsx_runtime.jsx)("div", { + role: "row", + "aria-rowindex": ariaRowIndex, + className: (0, clsx.default)(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? "even" : "odd"}`, summaryRowClassname, { + [rowSelectedClassname]: selectedCellIdx === -1, + [`${topSummaryRowClassname} ${topSummaryRow}`]: isTop, + [bottomSummaryRowClassname]: !isTop + }), + style: { + ...getRowStyle(gridRowStart), + "--rdg-summary-row-top": top !== undefined ? `${top}px` : undefined, + "--rdg-summary-row-bottom": bottom !== undefined ? `${bottom}px` : undefined + }, + children: cells + }); +} +var SummaryRow_default = (0, react.memo)(SummaryRow); + +//#endregion +//#region src/DataGrid.tsx +/** +* Main API Component to render a data grid of rows and columns +* +* @example +* +* +*/ +function DataGrid(props, ref) { + const { columns: rawColumns, rows, topSummaryRows, bottomSummaryRows, rowKeyGetter, onRowsChange, rowHeight: rawRowHeight, headerRowHeight: rawHeaderRowHeight, summaryRowHeight: rawSummaryRowHeight, selectedRows, isRowSelectionDisabled, onSelectedRowsChange, sortColumns, onSortColumnsChange, defaultColumnOptions, onCellClick, onCellDoubleClick, onCellContextMenu, onCellKeyDown, onSelectedCellChange, onScroll, onColumnResize, onColumnsReorder, onFill, onCopy, onPaste, enableVirtualization: rawEnableVirtualization, renderers, className, style, rowClass, direction: rawDirection, role: rawRole, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-description": ariaDescription, "aria-describedby": ariaDescribedBy, "aria-rowcount": rawAriaRowCount, "data-testid": testId, "data-cy": dataCy } = props; + /** + * defaults + */ + const defaultRenderers = useDefaultRenderers(); + const role = rawRole ?? "grid"; + const rowHeight = rawRowHeight ?? 35; + const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === "number" ? rowHeight : 35); + const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === "number" ? rowHeight : 35); + const renderRow = renderers?.renderRow ?? defaultRenderers?.renderRow ?? defaultRenderRow; + const renderCell = renderers?.renderCell ?? defaultRenderers?.renderCell ?? defaultRenderCell; + const renderSortStatus$1 = renderers?.renderSortStatus ?? defaultRenderers?.renderSortStatus ?? renderSortStatus; + const renderCheckbox$1 = renderers?.renderCheckbox ?? defaultRenderers?.renderCheckbox ?? renderCheckbox; + const noRowsFallback = renderers?.noRowsFallback ?? defaultRenderers?.noRowsFallback; + const enableVirtualization = rawEnableVirtualization ?? true; + const direction = rawDirection ?? "ltr"; + /** + * states + */ + const [scrollTop, setScrollTop] = (0, react.useState)(0); + const [scrollLeft, setScrollLeft] = (0, react.useState)(0); + const [resizedColumnWidths, setResizedColumnWidths] = (0, react.useState)(() => new Map()); + const [measuredColumnWidths, setMeasuredColumnWidths] = (0, react.useState)(() => new Map()); + const [copiedCell, setCopiedCell] = (0, react.useState)(null); + const [isDragging, setDragging] = (0, react.useState)(false); + const [draggedOverRowIdx, setOverRowIdx] = (0, react.useState)(undefined); + const [scrollToPosition, setScrollToPosition] = (0, react.useState)(null); + const [shouldFocusCell, setShouldFocusCell] = (0, react.useState)(false); + const [previousRowIdx, setPreviousRowIdx] = (0, react.useState)(-1); + const getColumnWidth = (0, react.useCallback)((column) => { + return resizedColumnWidths.get(column.key) ?? measuredColumnWidths.get(column.key) ?? column.width; + }, [measuredColumnWidths, resizedColumnWidths]); + const [gridRef, gridWidth, gridHeight, horizontalScrollbarHeight] = useGridDimensions(); + const { columns, colSpanColumns, lastFrozenColumnIndex, headerRowsCount, colOverscanStartIdx, colOverscanEndIdx, templateColumns, layoutCssVars, totalFrozenColumnWidth } = useCalculatedColumns({ + rawColumns, + defaultColumnOptions, + getColumnWidth, + scrollLeft, + viewportWidth: gridWidth, + enableVirtualization + }); + const topSummaryRowsCount = topSummaryRows?.length ?? 0; + const bottomSummaryRowsCount = bottomSummaryRows?.length ?? 0; + const summaryRowsCount = topSummaryRowsCount + bottomSummaryRowsCount; + const headerAndTopSummaryRowsCount = headerRowsCount + topSummaryRowsCount; + const groupedColumnHeaderRowsCount = headerRowsCount - 1; + const minRowIdx = -headerAndTopSummaryRowsCount; + const mainHeaderRowIdx = minRowIdx + groupedColumnHeaderRowsCount; + const maxRowIdx = rows.length + bottomSummaryRowsCount - 1; + const [selectedPosition, setSelectedPosition] = (0, react.useState)(() => ({ + idx: -1, + rowIdx: minRowIdx - 1, + mode: "SELECT" + })); + /** + * refs + */ + const latestDraggedOverRowIdx = (0, react.useRef)(draggedOverRowIdx); + const focusSinkRef = (0, react.useRef)(null); + /** + * computed values + */ + const isTreeGrid = role === "treegrid"; + const headerRowsHeight = headerRowsCount * headerRowHeight; + const summaryRowsHeight = summaryRowsCount * summaryRowHeight; + const clientHeight = gridHeight - headerRowsHeight - summaryRowsHeight; + const isSelectable = selectedRows != null && onSelectedRowsChange != null; + const isRtl = direction === "rtl"; + const leftKey = isRtl ? "ArrowRight" : "ArrowLeft"; + const rightKey = isRtl ? "ArrowLeft" : "ArrowRight"; + const ariaRowCount = rawAriaRowCount ?? headerRowsCount + rows.length + summaryRowsCount; + const defaultGridComponents = (0, react.useMemo)(() => ({ + renderCheckbox: renderCheckbox$1, + renderSortStatus: renderSortStatus$1, + renderCell + }), [ + renderCheckbox$1, + renderSortStatus$1, + renderCell + ]); + const headerSelectionValue = (0, react.useMemo)(() => { + let hasSelectedRow = false; + let hasUnselectedRow = false; + if (rowKeyGetter != null && selectedRows != null && selectedRows.size > 0) for (const row$1 of rows) { + if (selectedRows.has(rowKeyGetter(row$1))) hasSelectedRow = true; + else hasUnselectedRow = true; + if (hasSelectedRow && hasUnselectedRow) break; + } + return { + isRowSelected: hasSelectedRow && !hasUnselectedRow, + isIndeterminate: hasSelectedRow && hasUnselectedRow + }; + }, [ + rows, + selectedRows, + rowKeyGetter + ]); + const { rowOverscanStartIdx, rowOverscanEndIdx, totalRowHeight, gridTemplateRows, getRowTop, getRowHeight, findRowIdx } = useViewportRows({ + rows, + rowHeight, + clientHeight, + scrollTop, + enableVirtualization + }); + const viewportColumns = useViewportColumns({ + columns, + colSpanColumns, + colOverscanStartIdx, + colOverscanEndIdx, + lastFrozenColumnIndex, + rowOverscanStartIdx, + rowOverscanEndIdx, + rows, + topSummaryRows, + bottomSummaryRows + }); + const { gridTemplateColumns, handleColumnResize } = useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize); + const minColIdx = isTreeGrid ? -1 : 0; + const maxColIdx = columns.length - 1; + const selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition); + const selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition); + const scrollHeight = headerRowHeight + totalRowHeight + summaryRowsHeight + horizontalScrollbarHeight; + /** + * The identity of the wrapper function is stable so it won't break memoization + */ + const handleColumnResizeLatest = useLatestFunc(handleColumnResize); + const onColumnsReorderLastest = useLatestFunc(onColumnsReorder); + const onSortColumnsChangeLatest = useLatestFunc(onSortColumnsChange); + const onCellClickLatest = useLatestFunc(onCellClick); + const onCellDoubleClickLatest = useLatestFunc(onCellDoubleClick); + const onCellContextMenuLatest = useLatestFunc(onCellContextMenu); + const selectHeaderRowLatest = useLatestFunc(selectHeaderRow); + const selectRowLatest = useLatestFunc(selectRow); + const handleFormatterRowChangeLatest = useLatestFunc(updateRow); + const selectCellLatest = useLatestFunc(selectCell); + const selectHeaderCellLatest = useLatestFunc(({ idx, rowIdx }) => { + selectCell({ + rowIdx: minRowIdx + rowIdx - 1, + idx + }); + }); + /** + * callbacks + */ + const setDraggedOverRowIdx = (0, react.useCallback)((rowIdx) => { + setOverRowIdx(rowIdx); + latestDraggedOverRowIdx.current = rowIdx; + }, []); + const focusCellOrCellContent = (0, react.useCallback)(() => { + const cell$1 = getCellToScroll(gridRef.current); + if (cell$1 === null) return; + scrollIntoView(cell$1); + const elementToFocus = cell$1.querySelector("[tabindex=\"0\"]") ?? cell$1; + elementToFocus.focus({ preventScroll: true }); + }, [gridRef]); + /** + * effects + */ + useLayoutEffect(() => { + if (focusSinkRef.current !== null && selectedCellIsWithinSelectionBounds && selectedPosition.idx === -1) { + focusSinkRef.current.focus({ preventScroll: true }); + scrollIntoView(focusSinkRef.current); + } + }, [selectedCellIsWithinSelectionBounds, selectedPosition]); + useLayoutEffect(() => { + if (shouldFocusCell) { + setShouldFocusCell(false); + focusCellOrCellContent(); + } + }, [shouldFocusCell, focusCellOrCellContent]); + (0, react.useImperativeHandle)(ref, () => ({ + element: gridRef.current, + scrollToCell({ idx, rowIdx }) { + const scrollToIdx = idx !== undefined && idx > lastFrozenColumnIndex && idx < columns.length ? idx : undefined; + const scrollToRowIdx = rowIdx !== undefined && isRowIdxWithinViewportBounds(rowIdx) ? rowIdx : undefined; + if (scrollToIdx !== undefined || scrollToRowIdx !== undefined) setScrollToPosition({ + idx: scrollToIdx, + rowIdx: scrollToRowIdx + }); + }, + selectCell + })); + /** + * event handlers + */ + function selectHeaderRow(args) { + if (!onSelectedRowsChange) return; + assertIsValidKeyGetter(rowKeyGetter); + const newSelectedRows = new Set(selectedRows); + for (const row$1 of rows) { + if (isRowSelectionDisabled?.(row$1) === true) continue; + const rowKey = rowKeyGetter(row$1); + if (args.checked) newSelectedRows.add(rowKey); + else newSelectedRows.delete(rowKey); + } + onSelectedRowsChange(newSelectedRows); + } + function selectRow(args) { + if (!onSelectedRowsChange) return; + assertIsValidKeyGetter(rowKeyGetter); + const { row: row$1, checked, isShiftClick } = args; + if (isRowSelectionDisabled?.(row$1) === true) return; + const newSelectedRows = new Set(selectedRows); + const rowKey = rowKeyGetter(row$1); + const rowIdx = rows.indexOf(row$1); + setPreviousRowIdx(rowIdx); + if (checked) newSelectedRows.add(rowKey); + else newSelectedRows.delete(rowKey); + if (isShiftClick && previousRowIdx !== -1 && previousRowIdx !== rowIdx && previousRowIdx < rows.length) { + const step = sign(rowIdx - previousRowIdx); + for (let i = previousRowIdx + step; i !== rowIdx; i += step) { + const row$2 = rows[i]; + if (isRowSelectionDisabled?.(row$2) === true) continue; + if (checked) newSelectedRows.add(rowKeyGetter(row$2)); + else newSelectedRows.delete(rowKeyGetter(row$2)); + } + } + onSelectedRowsChange(newSelectedRows); + } + function handleKeyDown(event) { + const { idx, rowIdx, mode } = selectedPosition; + if (mode === "EDIT") return; + if (onCellKeyDown && isRowIdxWithinViewportBounds(rowIdx)) { + const row$1 = rows[rowIdx]; + const cellEvent = createCellEvent(event); + onCellKeyDown({ + mode: "SELECT", + row: row$1, + column: columns[idx], + rowIdx, + selectCell + }, cellEvent); + if (cellEvent.isGridDefaultPrevented()) return; + } + if (!(event.target instanceof Element)) return; + const isCellEvent = event.target.closest(".rdg-cell") !== null; + const isRowEvent = isTreeGrid && event.target === focusSinkRef.current; + if (!isCellEvent && !isRowEvent) return; + const { keyCode } = event; + if (selectedCellIsWithinViewportBounds && (onPaste != null || onCopy != null) && isCtrlKeyHeldDown(event)) { + const cKey = 67; + const vKey = 86; + if (keyCode === cKey) { + if (window.getSelection()?.isCollapsed === false) return; + handleCopy(); + return; + } + if (keyCode === vKey) { + handlePaste(); + return; + } + } + switch (event.key) { + case "Escape": + setCopiedCell(null); + return; + case "ArrowUp": + case "ArrowDown": + case "ArrowLeft": + case "ArrowRight": + case "Tab": + case "Home": + case "End": + case "PageUp": + case "PageDown": + navigate(event); + break; + default: + handleCellInput(event); + break; + } + } + function handleScroll(event) { + const { scrollTop: scrollTop$1, scrollLeft: scrollLeft$1 } = event.currentTarget; + (0, react_dom.flushSync)(() => { + setScrollTop(scrollTop$1); + setScrollLeft(abs(scrollLeft$1)); + }); + onScroll?.(event); + } + function updateRow(column, rowIdx, row$1) { + if (typeof onRowsChange !== "function") return; + if (row$1 === rows[rowIdx]) return; + const updatedRows = [...rows]; + updatedRows[rowIdx] = row$1; + onRowsChange(updatedRows, { + indexes: [rowIdx], + column + }); + } + function commitEditorChanges() { + if (selectedPosition.mode !== "EDIT") return; + updateRow(columns[selectedPosition.idx], selectedPosition.rowIdx, selectedPosition.row); + } + function handleCopy() { + const { idx, rowIdx } = selectedPosition; + const sourceRow = rows[rowIdx]; + const sourceColumnKey = columns[idx].key; + setCopiedCell({ + row: sourceRow, + columnKey: sourceColumnKey + }); + onCopy?.({ + sourceRow, + sourceColumnKey + }); + } + function handlePaste() { + if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition)) return; + const { idx, rowIdx } = selectedPosition; + const targetColumn = columns[idx]; + const targetRow = rows[rowIdx]; + const updatedTargetRow = onPaste({ + sourceRow: copiedCell.row, + sourceColumnKey: copiedCell.columnKey, + targetRow, + targetColumnKey: targetColumn.key + }); + updateRow(targetColumn, rowIdx, updatedTargetRow); + } + function handleCellInput(event) { + if (!selectedCellIsWithinViewportBounds) return; + const row$1 = rows[selectedPosition.rowIdx]; + const { key, shiftKey } = event; + if (isSelectable && shiftKey && key === " ") { + assertIsValidKeyGetter(rowKeyGetter); + const rowKey = rowKeyGetter(row$1); + selectRow({ + row: row$1, + checked: !selectedRows.has(rowKey), + isShiftClick: false + }); + event.preventDefault(); + return; + } + if (isCellEditable(selectedPosition) && isDefaultCellInput(event)) setSelectedPosition(({ idx, rowIdx }) => ({ + idx, + rowIdx, + mode: "EDIT", + row: row$1, + originalRow: row$1 + })); + } + /** + * utils + */ + function isColIdxWithinSelectionBounds(idx) { + return idx >= minColIdx && idx <= maxColIdx; + } + function isRowIdxWithinViewportBounds(rowIdx) { + return rowIdx >= 0 && rowIdx < rows.length; + } + function isCellWithinSelectionBounds({ idx, rowIdx }) { + return rowIdx >= minRowIdx && rowIdx <= maxRowIdx && isColIdxWithinSelectionBounds(idx); + } + function isCellWithinEditBounds({ idx, rowIdx }) { + return isRowIdxWithinViewportBounds(rowIdx) && idx >= 0 && idx <= maxColIdx; + } + function isCellWithinViewportBounds({ idx, rowIdx }) { + return isRowIdxWithinViewportBounds(rowIdx) && isColIdxWithinSelectionBounds(idx); + } + function isCellEditable(position) { + return isCellWithinEditBounds(position) && isSelectedCellEditable({ + columns, + rows, + selectedPosition: position + }); + } + function selectCell(position, enableEditor) { + if (!isCellWithinSelectionBounds(position)) return; + commitEditorChanges(); + const samePosition = isSamePosition(selectedPosition, position); + if (enableEditor && isCellEditable(position)) { + const row$1 = rows[position.rowIdx]; + setSelectedPosition({ + ...position, + mode: "EDIT", + row: row$1, + originalRow: row$1 + }); + } else if (samePosition) scrollIntoView(getCellToScroll(gridRef.current)); + else { + setShouldFocusCell(true); + setSelectedPosition({ + ...position, + mode: "SELECT" + }); + } + if (onSelectedCellChange && !samePosition) onSelectedCellChange({ + rowIdx: position.rowIdx, + row: isRowIdxWithinViewportBounds(position.rowIdx) ? rows[position.rowIdx] : undefined, + column: columns[position.idx] + }); + } + function getNextPosition(key, ctrlKey, shiftKey) { + const { idx, rowIdx } = selectedPosition; + const isRowSelected = selectedCellIsWithinSelectionBounds && idx === -1; + switch (key) { + case "ArrowUp": return { + idx, + rowIdx: rowIdx - 1 + }; + case "ArrowDown": return { + idx, + rowIdx: rowIdx + 1 + }; + case leftKey: return { + idx: idx - 1, + rowIdx + }; + case rightKey: return { + idx: idx + 1, + rowIdx + }; + case "Tab": return { + idx: idx + (shiftKey ? -1 : 1), + rowIdx + }; + case "Home": + if (isRowSelected) return { + idx, + rowIdx: minRowIdx + }; + return { + idx: 0, + rowIdx: ctrlKey ? minRowIdx : rowIdx + }; + case "End": + if (isRowSelected) return { + idx, + rowIdx: maxRowIdx + }; + return { + idx: maxColIdx, + rowIdx: ctrlKey ? maxRowIdx : rowIdx + }; + case "PageUp": { + if (selectedPosition.rowIdx === minRowIdx) return selectedPosition; + const nextRowY = getRowTop(rowIdx) + getRowHeight(rowIdx) - clientHeight; + return { + idx, + rowIdx: nextRowY > 0 ? findRowIdx(nextRowY) : 0 + }; + } + case "PageDown": { + if (selectedPosition.rowIdx >= rows.length) return selectedPosition; + const nextRowY = getRowTop(rowIdx) + clientHeight; + return { + idx, + rowIdx: nextRowY < totalRowHeight ? findRowIdx(nextRowY) : rows.length - 1 + }; + } + default: return selectedPosition; + } + } + function navigate(event) { + const { key, shiftKey } = event; + let cellNavigationMode = "NONE"; + if (key === "Tab") { + if (canExitGrid({ + shiftKey, + maxColIdx, + minRowIdx, + maxRowIdx, + selectedPosition + })) { + commitEditorChanges(); + return; + } + cellNavigationMode = "CHANGE_ROW"; + } + event.preventDefault(); + const ctrlKey = isCtrlKeyHeldDown(event); + const nextPosition = getNextPosition(key, ctrlKey, shiftKey); + if (isSamePosition(selectedPosition, nextPosition)) return; + const nextSelectedCellPosition = getNextSelectedCellPosition({ + moveUp: key === "ArrowUp", + moveNext: key === rightKey || key === "Tab" && !shiftKey, + columns, + colSpanColumns, + rows, + topSummaryRows, + bottomSummaryRows, + minRowIdx, + mainHeaderRowIdx, + maxRowIdx, + lastFrozenColumnIndex, + cellNavigationMode, + currentPosition: selectedPosition, + nextPosition, + isCellWithinBounds: isCellWithinSelectionBounds + }); + selectCell(nextSelectedCellPosition); + } + function getDraggedOverCellIdx(currentRowIdx) { + if (draggedOverRowIdx === undefined) return; + const { rowIdx } = selectedPosition; + const isDraggedOver = rowIdx < draggedOverRowIdx ? rowIdx < currentRowIdx && currentRowIdx <= draggedOverRowIdx : rowIdx > currentRowIdx && currentRowIdx >= draggedOverRowIdx; + return isDraggedOver ? selectedPosition.idx : undefined; + } + function renderDragHandle() { + if (onFill == null || selectedPosition.mode === "EDIT" || !isCellWithinViewportBounds(selectedPosition)) return; + const { idx, rowIdx } = selectedPosition; + const column = columns[idx]; + if (column.renderEditCell == null || column.editable === false) return; + const columnWidth = getColumnWidth(column); + return (0, react_jsx_runtime.jsx)(DragHandle, { + gridRowStart: headerAndTopSummaryRowsCount + rowIdx + 1, + rows, + column, + columnWidth, + maxColIdx, + isLastRow: rowIdx === maxRowIdx, + selectedPosition, + isCellEditable, + latestDraggedOverRowIdx, + onRowsChange, + onClick: focusCellOrCellContent, + onFill, + setDragging, + setDraggedOverRowIdx + }); + } + function getCellEditor(rowIdx) { + if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === "SELECT") return; + const { idx, row: row$1 } = selectedPosition; + const column = columns[idx]; + const colSpan = getColSpan(column, lastFrozenColumnIndex, { + type: "ROW", + row: row$1 + }); + const closeEditor = (shouldFocusCell$1) => { + setShouldFocusCell(shouldFocusCell$1); + setSelectedPosition(({ idx: idx$1, rowIdx: rowIdx$1 }) => ({ + idx: idx$1, + rowIdx: rowIdx$1, + mode: "SELECT" + })); + }; + const onRowChange = (row$2, commitChanges, shouldFocusCell$1) => { + if (commitChanges) (0, react_dom.flushSync)(() => { + updateRow(column, selectedPosition.rowIdx, row$2); + closeEditor(shouldFocusCell$1); + }); + else setSelectedPosition((position) => ({ + ...position, + row: row$2 + })); + }; + if (rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) closeEditor(false); + return (0, react_jsx_runtime.jsx)(EditCell, { + column, + colSpan, + row: row$1, + rowIdx, + onRowChange, + closeEditor, + onKeyDown: onCellKeyDown, + navigate + }, column.key); + } + function getRowViewportColumns(rowIdx) { + const selectedColumn = selectedPosition.idx === -1 ? undefined : columns[selectedPosition.idx]; + if (selectedColumn !== undefined && selectedPosition.rowIdx === rowIdx && !viewportColumns.includes(selectedColumn)) return selectedPosition.idx > colOverscanEndIdx ? [...viewportColumns, selectedColumn] : [ + ...viewportColumns.slice(0, lastFrozenColumnIndex + 1), + selectedColumn, + ...viewportColumns.slice(lastFrozenColumnIndex + 1) + ]; + return viewportColumns; + } + function getViewportRows() { + const rowElements = []; + const { idx: selectedIdx, rowIdx: selectedRowIdx } = selectedPosition; + const startRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx < rowOverscanStartIdx ? rowOverscanStartIdx - 1 : rowOverscanStartIdx; + const endRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx > rowOverscanEndIdx ? rowOverscanEndIdx + 1 : rowOverscanEndIdx; + for (let viewportRowIdx = startRowIdx; viewportRowIdx <= endRowIdx; viewportRowIdx++) { + const isRowOutsideViewport = viewportRowIdx === rowOverscanStartIdx - 1 || viewportRowIdx === rowOverscanEndIdx + 1; + const rowIdx = isRowOutsideViewport ? selectedRowIdx : viewportRowIdx; + let rowColumns = viewportColumns; + const selectedColumn = selectedIdx === -1 ? undefined : columns[selectedIdx]; + if (selectedColumn !== undefined) if (isRowOutsideViewport) rowColumns = [selectedColumn]; + else rowColumns = getRowViewportColumns(rowIdx); + const row$1 = rows[rowIdx]; + const gridRowStart = headerAndTopSummaryRowsCount + rowIdx + 1; + let key = rowIdx; + let isRowSelected = false; + if (typeof rowKeyGetter === "function") { + key = rowKeyGetter(row$1); + isRowSelected = selectedRows?.has(key) ?? false; + } + rowElements.push(renderRow(key, { + "aria-rowindex": headerAndTopSummaryRowsCount + rowIdx + 1, + "aria-selected": isSelectable ? isRowSelected : undefined, + rowIdx, + row: row$1, + viewportColumns: rowColumns, + isRowSelectionDisabled: isRowSelectionDisabled?.(row$1) ?? false, + isRowSelected, + onCellClick: onCellClickLatest, + onCellDoubleClick: onCellDoubleClickLatest, + onCellContextMenu: onCellContextMenuLatest, + rowClass, + gridRowStart, + copiedCellIdx: copiedCell !== null && copiedCell.row === row$1 ? columns.findIndex((c) => c.key === copiedCell.columnKey) : undefined, + selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined, + draggedOverCellIdx: getDraggedOverCellIdx(rowIdx), + setDraggedOverRowIdx: isDragging ? setDraggedOverRowIdx : undefined, + lastFrozenColumnIndex, + onRowChange: handleFormatterRowChangeLatest, + selectCell: selectCellLatest, + selectedCellEditor: getCellEditor(rowIdx) + })); + } + return rowElements; + } + if (selectedPosition.idx > maxColIdx || selectedPosition.rowIdx > maxRowIdx) { + setSelectedPosition({ + idx: -1, + rowIdx: minRowIdx - 1, + mode: "SELECT" + }); + setDraggedOverRowIdx(undefined); + } + let templateRows = `repeat(${headerRowsCount}, ${headerRowHeight}px)`; + if (topSummaryRowsCount > 0) templateRows += ` repeat(${topSummaryRowsCount}, ${summaryRowHeight}px)`; + if (rows.length > 0) templateRows += gridTemplateRows; + if (bottomSummaryRowsCount > 0) templateRows += ` repeat(${bottomSummaryRowsCount}, ${summaryRowHeight}px)`; + const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== minRowIdx - 1; + return (0, react_jsx_runtime.jsxs)("div", { + role, + "aria-label": ariaLabel, + "aria-labelledby": ariaLabelledBy, + "aria-description": ariaDescription, + "aria-describedby": ariaDescribedBy, + "aria-multiselectable": isSelectable ? true : undefined, + "aria-colcount": columns.length, + "aria-rowcount": ariaRowCount, + className: (0, clsx.default)(rootClassname, { [viewportDraggingClassname]: isDragging }, className), + style: { + ...style, + scrollPaddingInlineStart: selectedPosition.idx > lastFrozenColumnIndex || scrollToPosition?.idx !== undefined ? `${totalFrozenColumnWidth}px` : undefined, + scrollPaddingBlock: isRowIdxWithinViewportBounds(selectedPosition.rowIdx) || scrollToPosition?.rowIdx !== undefined ? `${headerRowsHeight + topSummaryRowsCount * summaryRowHeight}px ${bottomSummaryRowsCount * summaryRowHeight}px` : undefined, + gridTemplateColumns, + gridTemplateRows: templateRows, + "--rdg-header-row-height": `${headerRowHeight}px`, + "--rdg-scroll-height": `${scrollHeight}px`, + ...layoutCssVars + }, + dir: direction, + ref: gridRef, + onScroll: handleScroll, + onKeyDown: handleKeyDown, + "data-testid": testId, + "data-cy": dataCy, + children: [ + (0, react_jsx_runtime.jsxs)(DataGridDefaultRenderersProvider, { + value: defaultGridComponents, + children: [(0, react_jsx_runtime.jsx)(HeaderRowSelectionChangeProvider, { + value: selectHeaderRowLatest, + children: (0, react_jsx_runtime.jsxs)(HeaderRowSelectionProvider, { + value: headerSelectionValue, + children: [Array.from({ length: groupedColumnHeaderRowsCount }, (_, index) => (0, react_jsx_runtime.jsx)(GroupedColumnHeaderRow_default, { + rowIdx: index + 1, + level: -groupedColumnHeaderRowsCount + index, + columns: getRowViewportColumns(minRowIdx + index), + selectedCellIdx: selectedPosition.rowIdx === minRowIdx + index ? selectedPosition.idx : undefined, + selectCell: selectHeaderCellLatest + }, index)), (0, react_jsx_runtime.jsx)(HeaderRow_default, { + rowIdx: headerRowsCount, + columns: getRowViewportColumns(mainHeaderRowIdx), + onColumnResize: handleColumnResizeLatest, + onColumnsReorder: onColumnsReorderLastest, + sortColumns, + onSortColumnsChange: onSortColumnsChangeLatest, + lastFrozenColumnIndex, + selectedCellIdx: selectedPosition.rowIdx === mainHeaderRowIdx ? selectedPosition.idx : undefined, + selectCell: selectHeaderCellLatest, + shouldFocusGrid: !selectedCellIsWithinSelectionBounds, + direction + })] + }) + }), rows.length === 0 && noRowsFallback ? noRowsFallback : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ + topSummaryRows?.map((row$1, rowIdx) => { + const gridRowStart = headerRowsCount + 1 + rowIdx; + const summaryRowIdx = mainHeaderRowIdx + 1 + rowIdx; + const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx; + const top = headerRowsHeight + summaryRowHeight * rowIdx; + return (0, react_jsx_runtime.jsx)(SummaryRow_default, { + "aria-rowindex": gridRowStart, + rowIdx: summaryRowIdx, + gridRowStart, + row: row$1, + top, + bottom: undefined, + viewportColumns: getRowViewportColumns(summaryRowIdx), + lastFrozenColumnIndex, + selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined, + isTop: true, + selectCell: selectCellLatest + }, rowIdx); + }), + (0, react_jsx_runtime.jsx)(RowSelectionChangeProvider, { + value: selectRowLatest, + children: getViewportRows() + }), + bottomSummaryRows?.map((row$1, rowIdx) => { + const gridRowStart = headerAndTopSummaryRowsCount + rows.length + rowIdx + 1; + const summaryRowIdx = rows.length + rowIdx; + const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx; + const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (bottomSummaryRows.length - rowIdx) : undefined; + const bottom = top === undefined ? summaryRowHeight * (bottomSummaryRows.length - 1 - rowIdx) : undefined; + return (0, react_jsx_runtime.jsx)(SummaryRow_default, { + "aria-rowindex": ariaRowCount - bottomSummaryRowsCount + rowIdx + 1, + rowIdx: summaryRowIdx, + gridRowStart, + row: row$1, + top, + bottom, + viewportColumns: getRowViewportColumns(summaryRowIdx), + lastFrozenColumnIndex, + selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined, + isTop: false, + selectCell: selectCellLatest + }, rowIdx); + }) + ] })] + }), + renderDragHandle(), + renderMeasuringCells(viewportColumns), + isTreeGrid && (0, react_jsx_runtime.jsx)("div", { + ref: focusSinkRef, + tabIndex: isGroupRowFocused ? 0 : -1, + className: (0, clsx.default)(focusSinkClassname, { + [focusSinkHeaderAndSummaryClassname]: !isRowIdxWithinViewportBounds(selectedPosition.rowIdx), + [rowSelected]: isGroupRowFocused, + [rowSelectedWithFrozenCell]: isGroupRowFocused && lastFrozenColumnIndex !== -1 + }), + style: { gridRowStart: selectedPosition.rowIdx + headerAndTopSummaryRowsCount + 1 } + }), + scrollToPosition !== null && (0, react_jsx_runtime.jsx)(ScrollToCell, { + scrollToPosition, + setScrollToCellPosition: setScrollToPosition, + gridRef + }) + ] + }); +} +function getCellToScroll(gridEl) { + return gridEl.querySelector(":scope > [role=\"row\"] > [tabindex=\"0\"]"); +} +function isSamePosition(p1, p2) { + return p1.idx === p2.idx && p1.rowIdx === p2.rowIdx; +} +var DataGrid_default = (0, react.forwardRef)(DataGrid); + +//#endregion +//#region src/GroupCell.tsx +function GroupCell({ id, groupKey, childRows, isExpanded, isCellSelected, column, row: row$1, groupColumnIndex, isGroupByColumn, toggleGroup: toggleGroupWrapper }) { + const { tabIndex, childTabIndex, onFocus } = useRovingTabIndex(isCellSelected); + function toggleGroup() { + toggleGroupWrapper(id); + } + const isLevelMatching = isGroupByColumn && groupColumnIndex === column.idx; + return (0, react_jsx_runtime.jsx)("div", { + role: "gridcell", + "aria-colindex": column.idx + 1, + "aria-selected": isCellSelected, + tabIndex, + className: getCellClassname(column), + style: { + ...getCellStyle(column), + cursor: isLevelMatching ? "pointer" : "default" + }, + onClick: isLevelMatching ? toggleGroup : undefined, + onFocus, + children: (!isGroupByColumn || isLevelMatching) && column.renderGroupCell?.({ + groupKey, + childRows, + column, + row: row$1, + isExpanded, + tabIndex: childTabIndex, + toggleGroup + }) + }, column.key); +} +var GroupCell_default = (0, react.memo)(GroupCell); + +//#endregion +//#region src/GroupRow.tsx +const groupRow = "g1yxluv37-0-0-beta-47"; +const groupRowClassname = `rdg-group-row ${groupRow}`; +function GroupedRow({ className, row: row$1, rowIdx, viewportColumns, selectedCellIdx, isRowSelected, selectCell, gridRowStart, groupBy, toggleGroup, isRowSelectionDisabled,...props }) { + const idx = viewportColumns[0].key === SELECT_COLUMN_KEY ? row$1.level + 1 : row$1.level; + function handleSelectGroup() { + selectCell({ + rowIdx, + idx: -1 + }); + } + const selectionValue = (0, react.useMemo)(() => ({ + isRowSelectionDisabled: false, + isRowSelected + }), [isRowSelected]); + return (0, react_jsx_runtime.jsx)( + RowSelectionProvider, + // aria-level is 1-based + // aria-posinset is 1-based + { + value: selectionValue, + children: (0, react_jsx_runtime.jsx)("div", { + role: "row", + "aria-level": row$1.level + 1, + "aria-setsize": row$1.setSize, + "aria-posinset": row$1.posInSet + 1, + "aria-expanded": row$1.isExpanded, + className: (0, clsx.default)(rowClassname, groupRowClassname, `rdg-row-${rowIdx % 2 === 0 ? "even" : "odd"}`, selectedCellIdx === -1 && rowSelectedClassname, className), + onClick: handleSelectGroup, + style: getRowStyle(gridRowStart), + ...props, + children: viewportColumns.map((column) => (0, react_jsx_runtime.jsx)(GroupCell_default, { + id: row$1.id, + groupKey: row$1.groupKey, + childRows: row$1.childRows, + isExpanded: row$1.isExpanded, + isCellSelected: selectedCellIdx === column.idx, + column, + row: row$1, + groupColumnIndex: idx, + toggleGroup, + isGroupByColumn: groupBy.includes(column.key) + }, column.key)) + }) + } +); +} +var GroupRow_default = (0, react.memo)(GroupedRow); + +//#endregion +//#region src/TreeDataGrid.tsx +function TreeDataGrid({ columns: rawColumns, rows: rawRows, rowHeight: rawRowHeight, rowKeyGetter: rawRowKeyGetter, onCellKeyDown: rawOnCellKeyDown, onRowsChange, selectedRows: rawSelectedRows, onSelectedRowsChange: rawOnSelectedRowsChange, renderers, groupBy: rawGroupBy, rowGrouper, expandedGroupIds, onExpandedGroupIdsChange,...props }, ref) { + const defaultRenderers = useDefaultRenderers(); + const rawRenderRow = renderers?.renderRow ?? defaultRenderers?.renderRow ?? defaultRenderRow; + const headerAndTopSummaryRowsCount = 1 + (props.topSummaryRows?.length ?? 0); + const isRtl = props.direction === "rtl"; + const leftKey = isRtl ? "ArrowRight" : "ArrowLeft"; + const rightKey = isRtl ? "ArrowLeft" : "ArrowRight"; + const toggleGroupLatest = useLatestFunc(toggleGroup); + const { columns, groupBy } = (0, react.useMemo)(() => { + const columns$1 = [...rawColumns].sort(({ key: aKey }, { key: bKey }) => { + if (aKey === SELECT_COLUMN_KEY) return -1; + if (bKey === SELECT_COLUMN_KEY) return 1; + if (rawGroupBy.includes(aKey)) { + if (rawGroupBy.includes(bKey)) return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey); + return -1; + } + if (rawGroupBy.includes(bKey)) return 1; + return 0; + }); + const groupBy$1 = []; + for (const [index, column] of columns$1.entries()) if (rawGroupBy.includes(column.key)) { + groupBy$1.push(column.key); + columns$1[index] = { + ...column, + frozen: true, + renderCell: () => null, + renderGroupCell: column.renderGroupCell ?? renderToggleGroup, + editable: false + }; + } + return { + columns: columns$1, + groupBy: groupBy$1 + }; + }, [rawColumns, rawGroupBy]); + const [groupedRows, rowsCount] = (0, react.useMemo)(() => { + if (groupBy.length === 0) return [undefined, rawRows.length]; + const groupRows = (rows$1, [groupByKey, ...remainingGroupByKeys], startRowIndex) => { + let groupRowsCount = 0; + const groups = {}; + for (const [key, childRows] of Object.entries(rowGrouper(rows$1, groupByKey))) { + const [childGroups, childRowsCount] = remainingGroupByKeys.length === 0 ? [childRows, childRows.length] : groupRows(childRows, remainingGroupByKeys, startRowIndex + groupRowsCount + 1); + groups[key] = { + childRows, + childGroups, + startRowIndex: startRowIndex + groupRowsCount + }; + groupRowsCount += childRowsCount + 1; + } + return [groups, groupRowsCount]; + }; + return groupRows(rawRows, groupBy, 0); + }, [ + groupBy, + rowGrouper, + rawRows + ]); + const [rows, isGroupRow] = (0, react.useMemo)(() => { + const allGroupRows = new Set(); + if (!groupedRows) return [rawRows, isGroupRow$1]; + const flattenedRows = []; + const expandGroup = (rows$1, parentId, level) => { + if (isReadonlyArray(rows$1)) { + flattenedRows.push(...rows$1); + return; + } + Object.keys(rows$1).forEach((groupKey, posInSet, keys) => { + const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey; + const isExpanded = expandedGroupIds.has(id); + const { childRows, childGroups, startRowIndex } = rows$1[groupKey]; + const groupRow$1 = { + id, + parentId, + groupKey, + isExpanded, + childRows, + level, + posInSet, + startRowIndex, + setSize: keys.length + }; + flattenedRows.push(groupRow$1); + allGroupRows.add(groupRow$1); + if (isExpanded) expandGroup(childGroups, id, level + 1); + }); + }; + expandGroup(groupedRows, undefined, 0); + return [flattenedRows, isGroupRow$1]; + function isGroupRow$1(row$1) { + return allGroupRows.has(row$1); + } + }, [ + expandedGroupIds, + groupedRows, + rawRows + ]); + const rowHeight = (0, react.useMemo)(() => { + if (typeof rawRowHeight === "function") return (row$1) => { + if (isGroupRow(row$1)) return rawRowHeight({ + type: "GROUP", + row: row$1 + }); + return rawRowHeight({ + type: "ROW", + row: row$1 + }); + }; + return rawRowHeight; + }, [isGroupRow, rawRowHeight]); + const getParentRowAndIndex = (0, react.useCallback)((row$1) => { + const rowIdx = rows.indexOf(row$1); + for (let i = rowIdx - 1; i >= 0; i--) { + const parentRow = rows[i]; + if (isGroupRow(parentRow) && (!isGroupRow(row$1) || row$1.parentId === parentRow.id)) return [parentRow, i]; + } + return undefined; + }, [isGroupRow, rows]); + const rowKeyGetter = (0, react.useCallback)((row$1) => { + if (isGroupRow(row$1)) return row$1.id; + if (typeof rawRowKeyGetter === "function") return rawRowKeyGetter(row$1); + const parentRowAndIndex = getParentRowAndIndex(row$1); + if (parentRowAndIndex !== undefined) { + const { startRowIndex, childRows } = parentRowAndIndex[0]; + const groupIndex = childRows.indexOf(row$1); + return startRowIndex + groupIndex + 1; + } + return rows.indexOf(row$1); + }, [ + getParentRowAndIndex, + isGroupRow, + rawRowKeyGetter, + rows + ]); + const selectedRows = (0, react.useMemo)(() => { + if (rawSelectedRows == null) return null; + assertIsValidKeyGetter(rawRowKeyGetter); + const selectedRows$1 = new Set(rawSelectedRows); + for (const row$1 of rows) if (isGroupRow(row$1)) { + const isGroupRowSelected = row$1.childRows.every((cr) => rawSelectedRows.has(rawRowKeyGetter(cr))); + if (isGroupRowSelected) selectedRows$1.add(row$1.id); + } + return selectedRows$1; + }, [ + isGroupRow, + rawRowKeyGetter, + rawSelectedRows, + rows + ]); + function onSelectedRowsChange(newSelectedRows) { + if (!rawOnSelectedRowsChange) return; + assertIsValidKeyGetter(rawRowKeyGetter); + const newRawSelectedRows = new Set(rawSelectedRows); + for (const row$1 of rows) { + const key = rowKeyGetter(row$1); + if (selectedRows?.has(key) && !newSelectedRows.has(key)) if (isGroupRow(row$1)) for (const cr of row$1.childRows) newRawSelectedRows.delete(rawRowKeyGetter(cr)); + else newRawSelectedRows.delete(key); + else if (!selectedRows?.has(key) && newSelectedRows.has(key)) if (isGroupRow(row$1)) for (const cr of row$1.childRows) newRawSelectedRows.add(rawRowKeyGetter(cr)); + else newRawSelectedRows.add(key); + } + rawOnSelectedRowsChange(newRawSelectedRows); + } + function handleKeyDown(args, event) { + rawOnCellKeyDown?.(args, event); + if (event.isGridDefaultPrevented()) return; + if (args.mode === "EDIT") return; + const { column, rowIdx, selectCell } = args; + const idx = column?.idx ?? -1; + const row$1 = rows[rowIdx]; + if (!isGroupRow(row$1)) return; + if (idx === -1 && (event.key === leftKey && row$1.isExpanded || event.key === rightKey && !row$1.isExpanded)) { + event.preventDefault(); + event.preventGridDefault(); + toggleGroup(row$1.id); + } + if (idx === -1 && event.key === leftKey && !row$1.isExpanded && row$1.level !== 0) { + const parentRowAndIndex = getParentRowAndIndex(row$1); + if (parentRowAndIndex !== undefined) { + event.preventGridDefault(); + selectCell({ + idx, + rowIdx: parentRowAndIndex[1] + }); + } + } + if (isCtrlKeyHeldDown(event) && (event.keyCode === 67 || event.keyCode === 86)) event.preventGridDefault(); + } + function handleRowsChange(updatedRows, { indexes, column }) { + if (!onRowsChange) return; + const updatedRawRows = [...rawRows]; + const rawIndexes = []; + for (const index of indexes) { + const rawIndex = rawRows.indexOf(rows[index]); + updatedRawRows[rawIndex] = updatedRows[index]; + rawIndexes.push(rawIndex); + } + onRowsChange(updatedRawRows, { + indexes: rawIndexes, + column + }); + } + function toggleGroup(groupId) { + const newExpandedGroupIds = new Set(expandedGroupIds); + if (newExpandedGroupIds.has(groupId)) newExpandedGroupIds.delete(groupId); + else newExpandedGroupIds.add(groupId); + onExpandedGroupIdsChange(newExpandedGroupIds); + } + function renderRow(key, { row: row$1, rowClass, onCellClick, onCellDoubleClick, onCellContextMenu, onRowChange, lastFrozenColumnIndex, copiedCellIdx, draggedOverCellIdx, setDraggedOverRowIdx, selectedCellEditor,...rowProps }) { + if (isGroupRow(row$1)) { + const { startRowIndex } = row$1; + return (0, react_jsx_runtime.jsx)( + GroupRow_default, + // 1 for parent row + // 1 for parent row + // Prevents scrolling + // TODO: check types + { + ...rowProps, + "aria-rowindex": headerAndTopSummaryRowsCount + startRowIndex + 1, + row: row$1, + groupBy, + toggleGroup: toggleGroupLatest + }, + key +); + } + let ariaRowIndex = rowProps["aria-rowindex"]; + const parentRowAndIndex = getParentRowAndIndex(row$1); + if (parentRowAndIndex !== undefined) { + const { startRowIndex, childRows } = parentRowAndIndex[0]; + const groupIndex = childRows.indexOf(row$1); + ariaRowIndex = startRowIndex + headerAndTopSummaryRowsCount + groupIndex + 2; + } + return rawRenderRow(key, { + ...rowProps, + "aria-rowindex": ariaRowIndex, + row: row$1, + rowClass, + onCellClick, + onCellDoubleClick, + onCellContextMenu, + onRowChange, + lastFrozenColumnIndex, + copiedCellIdx, + draggedOverCellIdx, + setDraggedOverRowIdx, + selectedCellEditor + }); + } + return (0, react_jsx_runtime.jsx)(DataGrid_default, { + ...props, + role: "treegrid", + "aria-rowcount": rowsCount + 1 + (props.topSummaryRows?.length ?? 0) + (props.bottomSummaryRows?.length ?? 0), + ref, + columns, + rows, + rowHeight, + rowKeyGetter, + onRowsChange: handleRowsChange, + selectedRows, + onSelectedRowsChange, + onCellKeyDown: handleKeyDown, + renderers: { + ...renderers, + renderRow + } + }); +} +function isReadonlyArray(arr) { + return Array.isArray(arr); +} +var TreeDataGrid_default = (0, react.forwardRef)(TreeDataGrid); + +//#endregion +//#region src/editors/textEditor.tsx +const textEditorInternalClassname = "t7vyx3i7-0-0-beta-47"; +const textEditorClassname = `rdg-text-editor ${textEditorInternalClassname}`; +function autoFocusAndSelect(input) { + input?.focus(); + input?.select(); +} +function textEditor({ row: row$1, column, onRowChange, onClose }) { + return (0, react_jsx_runtime.jsx)("input", { + className: textEditorClassname, + ref: autoFocusAndSelect, + value: row$1[column.key], + onChange: (event) => onRowChange({ + ...row$1, + [column.key]: event.target.value + }), + onBlur: () => onClose(true, false) + }); +} + +//#endregion +exports.Cell = Cell_default +exports.DataGridDefaultRenderersProvider = DataGridDefaultRenderersProvider +exports.Row = Row_default +exports.SELECT_COLUMN_KEY = SELECT_COLUMN_KEY +exports.SelectCellFormatter = SelectCellFormatter +exports.SelectColumn = SelectColumn +exports.ToggleGroup = ToggleGroup +exports.TreeDataGrid = TreeDataGrid_default +exports.default = DataGrid_default +exports.renderCheckbox = renderCheckbox +exports.renderHeaderCell = renderHeaderCell +exports.renderSortIcon = renderSortIcon +exports.renderSortPriority = renderSortPriority +exports.renderToggleGroup = renderToggleGroup +exports.renderValue = renderValue +exports.textEditor = textEditor +exports.useHeaderRowSelection = useHeaderRowSelection +exports.useRowSelection = useRowSelection +//# sourceMappingURL=bundle.cjs.map \ No newline at end of file diff --git a/common-react/@dbeaver/react-data-grid/artifacts/lib/bundle.cjs.map b/common-react/@dbeaver/react-data-grid/artifacts/lib/bundle.cjs.map new file mode 100644 index 0000000000..beaf7c9108 --- /dev/null +++ b/common-react/@dbeaver/react-data-grid/artifacts/lib/bundle.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.cjs","names":["column: CalculatedColumn","lastFrozenColumnIndex: number","args: ColSpanArgs","event: React.SyntheticEvent","element: Maybe","event: E","e: React.KeyboardEvent","event: React.KeyboardEvent","CalculatedColumn","measuringCellClassname","renderMeasuringCells","viewportColumns","R","SR","map","key","idx","minWidth","maxWidth","gridColumnStart","row","column: CalculatedColumn","row: R","moveNext: boolean","moveNext","parent: CalculatedColumnParent","cell","cellClassname","cellFrozen","cellFrozenClassname","rowIdx: number","column: CalculatedColumnOrColumnGroup","rowSpan: number","column: CalculatedColumn","keyGetter: Maybe<(row: NoInfer) => K>","width: number","column: CalculatedColumnOrColumnGroup","rowIdx: number","RenderCheckboxProps","checkbox","checkboxClassname","renderCheckbox","onChange","indeterminate","props","handleChange","e","React","ChangeEvent","HTMLInputElement","target","checked","nativeEvent","MouseEvent","shiftKey","el","RenderGroupCellProps","groupCellContent","groupCellContentClassname","caret","caretClassname","renderToggleGroup","props","R","SR","ToggleGroup","groupKey","isExpanded","tabIndex","toggleGroup","handleKeyDown","key","React","KeyboardEvent","HTMLSpanElement","d","props: RenderCellProps","renderCheckbox","props: RenderHeaderCellProps","props: RenderCellProps","props: RenderGroupCellProps","SelectColumn: Column","lastFrozenColumnIndex","headerRowsCount","columns: MutableCalculatedColumn[]","rawColumns: readonly ColumnOrColumnGroup[]","level: number","parent?: MutableCalculatedColumnParent","rawColumns","calculatedColumnParent: MutableCalculatedColumnParent","column: MutableCalculatedColumn","colSpanColumns: CalculatedColumn[]","columnMetrics","totalFrozenColumnWidth","templateColumns: string[]","layoutCssVars: Record","colOverscanStartIdx","colOverscanEndIdx","column: MutableCalculatedColumn | MutableCalculatedColumnParent","index: number","useEffect","useOriginalLayoutEffect","columns: readonly CalculatedColumn[]","viewportColumns: readonly CalculatedColumn[]","templateColumns: readonly string[]","gridRef: React.RefObject","gridWidth: number","resizedColumnWidths: ReadonlyMap","measuredColumnWidths: ReadonlyMap","setResizedColumnWidths: StateSetter>","setMeasuredColumnWidths: StateSetter>","onColumnResize: DataGridProps['onColumnResize']","columnsCanFlex: boolean","ignorePreviouslyMeasuredColumns: boolean","columnsToMeasure: string[]","columnsToMeasure: readonly string[]","columnsToMeasure","measuredColumnWidths","column: CalculatedColumn","nextWidth: number | 'max-content'","newTemplateColumns","width","resizedColumnWidths","key: string","offsetHeight","clientHeight","fn: T","isSelected: boolean","event: React.FocusEvent","startIdx","colIdx: number","colSpan: number | undefined","row","viewportColumns: CalculatedColumn[]","rowIdx: number","offset: number","totalRowHeight","gridTemplateRows","row","forwardRef","memo","RefAttributes","useRovingTabIndex","createCellEvent","getCellClassname","getCellStyle","isCellEditableUtil","CellRendererProps","cellCopied","cellCopiedClassname","cellDraggedOver","cellDraggedOverClassname","Cell","column","colSpan","isCellSelected","isCopied","isDraggedOver","row","rowIdx","className","onClick","onDoubleClick","onContextMenu","onRowChange","selectCell","style","props","R","SR","ref","React","Ref","HTMLDivElement","tabIndex","childTabIndex","onFocus","cellClass","isEditable","selectCellWrapper","openEditor","idx","handleClick","event","MouseEvent","cellEvent","isGridDefaultPrevented","handleContextMenu","handleDoubleClick","handleRowChange","newRow","undefined","renderCell","isCellEditable","CellComponent","JSX","Element","defaultRenderCell","key","Key","clsx","getCellStyle","CalculatedColumn","FillEvent","Position","DataGridProps","SelectCellState","cellDragHandle","cellDragHandleFrozenClassname","cellDragHandleClassname","LatestDraggedOverRowIdxRef","current","Props","Pick","R","SR","gridRowStart","column","columnWidth","maxColIdx","isLastRow","selectedPosition","latestDraggedOverRowIdx","isCellEditable","position","onClick","onFill","event","setDragging","isDragging","setDraggedOverRowIdx","overRowIdx","DragHandle","rows","onRowsChange","idx","rowIdx","handleMouseDown","React","MouseEvent","HTMLDivElement","preventDefault","buttons","window","addEventListener","onMouseOver","onMouseUp","removeEventListener","handleDragEnd","undefined","startRowIndex","endRowIndex","updateRows","handleDoubleClick","stopPropagation","length","startRowIdx","endRowIdx","sourceRow","updatedRows","indexes","i","updatedRow","columnKey","key","targetRow","push","getStyle","CSSProperties","colSpan","type","row","insetInlineStart","style","marginEnd","isLastColumn","marginInlineEnd","marginBlockEnd","frozen","useEffect","useRef","useLatestFunc","createCellEvent","getCellClassname","getCellStyle","onEditorNavigation","CellKeyboardEvent","CellRendererProps","EditCellKeyDownArgs","Maybe","Omit","RenderEditCellProps","cellEditing","SharedCellRendererProps","Pick","R","SR","EditCellProps","rowIdx","onRowChange","row","commitChanges","shouldFocusCell","closeEditor","navigate","event","React","KeyboardEvent","HTMLDivElement","onKeyDown","args","EditCell","column","colSpan","frameRequestRef","undefined","commitOnOutsideClick","editorOptions","commitOnOutsideMouseDown","onClose","onWindowCaptureMouseDown","current","requestAnimationFrame","addEventListener","capture","removeEventListener","cancelFrameRequest","cancelAnimationFrame","handleKeyDown","cellEvent","mode","isGridDefaultPrevented","key","onEditorRowChange","commitChangesAndFocus","cellClass","className","displayCellContent","idx","renderEditCell","renderCell","isCellEditable","tabIndex","RenderHeaderCellProps","useDefaultRenderers","headerSortCellClassname","headerSortName","headerSortNameClassname","renderHeaderCell","column","sortDirection","priority","R","SR","sortable","name","SharedHeaderCellProps","Pick","SortableHeaderCellProps","children","React","ReactNode","SortableHeaderCell","renderSortStatus","useState","useRovingTabIndex","clampColumnWidth","getCellClassname","getCellStyle","getHeaderCellRowSpan","getHeaderCellStyle","stopPropagation","CalculatedColumn","SortColumn","HeaderRowProps","defaultRenderHeaderCell","cellSortableClassname","cellResizable","cellResizableClassname","resizeHandleClassname","cellDraggableClassname","cellDragging","cellDraggingClassname","cellOver","cellOverClassname","SharedHeaderRowProps","Pick","R","SR","React","Key","HeaderCellProps","column","colSpan","rowIdx","isCellSelected","dragDropKey","HeaderCell","onColumnResize","onColumnsReorder","sortColumns","onSortColumnsChange","selectCell","shouldFocusGrid","direction","isDragging","setIsDragging","isOver","setIsOver","isRtl","rowSpan","tabIndex","childTabIndex","onFocus","sortIndex","findIndex","sort","columnKey","key","sortColumn","undefined","sortDirection","priority","length","ariaSort","sortable","resizable","draggable","className","headerCellClass","renderHeaderCell","onPointerDown","event","PointerEvent","HTMLDivElement","pointerType","buttons","preventDefault","currentTarget","pointerId","headerCell","parentElement","right","left","getBoundingClientRect","offset","clientX","hasDoubleClicked","onPointerMove","width","newWidth","onDoubleClick","onLostPointerCapture","removeEventListener","setPointerCapture","addEventListener","onSort","ctrlClick","sortDescendingFirst","nextSort","nextSortColumn","nextSortColumns","splice","onClick","MouseEvent","HTMLSpanElement","idx","ctrlKey","metaKey","handleFocus","FocusEvent","onKeyDown","KeyboardEvent","onDragStart","DragEvent","dataTransfer","setData","dropEffect","onDragEnd","onDragOver","onDrop","types","includes","toLowerCase","sourceKey","getData","onDragEnter","isEventPertinent","onDragLeave","draggableProps","HTMLAttributes","relatedTarget","HTMLElement","contains","row","rowClassname","rowSelected","rowSelectedClassname","rowSelectedWithFrozenCell","topSummaryRowClassname","bottomSummaryRowClassname","memo","useId","clsx","getColSpan","CalculatedColumn","Direction","Position","DataGridProps","HeaderCell","rowSelectedClassname","SharedDataGridProps","React","Key","Pick","R","SR","K","HeaderRowProps","rowIdx","columns","onColumnResize","column","width","selectCell","position","lastFrozenColumnIndex","selectedCellIdx","shouldFocusGrid","direction","headerRow","headerRowClassname","HeaderRow","onColumnsReorder","sortColumns","onSortColumnsChange","dragDropKey","cells","index","length","colSpan","type","undefined","push","key","idx","props","JSX","Element","ref: React.Ref","column: CalculatedColumn","newRow: R","event: React.MouseEvent","row","key: React.Key","props: RenderRowProps","RenderSortIconProps","RenderSortPriorityProps","RenderSortStatusProps","arrow","arrowClassname","renderSortStatus","sortDirection","priority","renderSortIcon","renderSortPriority","undefined","root","rootClassname","viewportDragging","viewportDraggingClassname","focusSinkClassname","focusSinkHeaderAndSummaryClassname","memo","useRovingTabIndex","getCellClassname","getCellStyle","CellRendererProps","summaryCellClassname","SharedCellRendererProps","Pick","R","SR","SummaryCellProps","row","SummaryCell","column","colSpan","rowIdx","isCellSelected","selectCell","tabIndex","childTabIndex","onFocus","summaryCellClass","className","onClick","idx","renderSummaryCell","props","React","JSX","Element","memo","clsx","getColSpan","getRowStyle","RenderRowProps","bottomSummaryRowClassname","rowClassname","rowSelectedClassname","topSummaryRowClassname","SummaryCell","SharedRenderRowProps","Pick","R","SR","SummaryRowProps","row","top","bottom","lastFrozenColumnIndex","selectedCellIdx","isTop","summaryRow","topSummaryRow","summaryRowClassname","SummaryRow","rowIdx","gridRowStart","viewportColumns","selectCell","ariaRowIndex","cells","index","length","column","colSpan","type","undefined","isCellSelected","idx","push","key","React","CSSProperties","props","JSX","Element","props: DataGridProps","ref: React.Ref","renderSortStatus","defaultRenderSortStatus","renderCheckbox","defaultRenderCheckbox","column: CalculatedColumn","row","rowIdx?: number","cell","args: SelectHeaderRowEvent","args: SelectRowEvent","event: KeyboardEvent","event: React.UIEvent","scrollTop","scrollLeft","rowIdx: number","row: R","idx: number","position: Position","enableEditor?: Maybe","key: string","ctrlKey: boolean","shiftKey: boolean","cellNavigationMode: CellNavigationMode","currentRowIdx: number","shouldFocusCell: boolean","shouldFocusCell","commitChanges: boolean","rowElements: React.ReactNode[]","key: K | number","GroupedColumnHeaderRow","HeaderRow","SummaryRow","gridEl: HTMLDivElement","p1: Position","p2: Position","memo","useMemo","clsx","RowSelectionProvider","RowSelectionContextValue","getRowStyle","BaseRenderRowProps","GroupRow","SELECT_COLUMN_KEY","GroupCell","rowClassname","rowSelectedClassname","groupRow","groupRowClassname","GroupRowRendererProps","R","SR","row","groupBy","toggleGroup","expandedGroupId","GroupedRow","className","rowIdx","viewportColumns","selectedCellIdx","isRowSelected","selectCell","gridRowStart","isRowSelectionDisabled","props","idx","key","level","handleSelectGroup","selectionValue","setSize","posInSet","isExpanded","map","column","id","groupKey","childRows","includes","React","JSX","Element","ref: React.Ref","columns","groupBy: string[]","rows: readonly R[]","startRowIndex: number","groups: GroupByDictionary","rows","isGroupRow","flattenedRows: Array>","rows: GroupByDictionary | readonly R[]","parentId: string | undefined","level: number","groupRow: GroupRow","groupRow","row: R | GroupRow","row","selectedRows","newSelectedRows: Set","args: CellKeyDownArgs","event: CellKeyboardEvent","updatedRows: R[]","rawIndexes: number[]","groupId: unknown","key: Key","GroupedRow","DataGrid","arr: unknown","RenderEditCellProps","textEditorInternalClassname","textEditorClassname","autoFocusAndSelect","input","HTMLInputElement","focus","select","textEditor","row","column","onRowChange","onClose","TRow","TSummaryRow","key","event","target","value"],"sources":["../src/utils/colSpanUtils.ts","../src/utils/domUtils.ts","../src/utils/eventUtils.ts","../src/utils/keyboardUtils.ts","../src/utils/renderMeasuringCells.tsx","../src/utils/selectedCellUtils.ts","../src/style/cell.ts","../src/utils/styleUtils.ts","../src/utils/index.ts","../src/cellRenderers/renderCheckbox.tsx","../src/cellRenderers/renderToggleGroup.tsx","../src/cellRenderers/renderValue.tsx","../src/DataGridDefaultRenderersProvider.ts","../src/cellRenderers/SelectCellFormatter.tsx","../src/hooks/useRowSelection.ts","../src/Columns.tsx","../src/hooks/useCalculatedColumns.ts","../src/hooks/useLayoutEffect.ts","../src/hooks/useColumnWidths.ts","../src/hooks/useGridDimensions.ts","../src/hooks/useLatestFunc.ts","../src/hooks/useRovingTabIndex.ts","../src/hooks/useViewportColumns.ts","../src/hooks/useViewportRows.ts","../src/Cell.tsx","../src/DragHandle.tsx","../src/EditCell.tsx","../src/GroupedColumnHeaderCell.tsx","../src/renderHeaderCell.tsx","../src/HeaderCell.tsx","../src/style/row.ts","../src/HeaderRow.tsx","../src/GroupedColumnHeaderRow.tsx","../src/Row.tsx","../src/ScrollToCell.tsx","../src/sortStatus.tsx","../src/style/core.ts","../src/SummaryCell.tsx","../src/SummaryRow.tsx","../src/DataGrid.tsx","../src/GroupCell.tsx","../src/GroupRow.tsx","../src/TreeDataGrid.tsx","../src/editors/textEditor.tsx"],"sourcesContent":["import type { CalculatedColumn, ColSpanArgs } from '../types';\n\nexport function getColSpan(\n column: CalculatedColumn,\n lastFrozenColumnIndex: number,\n args: ColSpanArgs\n): number | undefined {\n const colSpan = typeof column.colSpan === 'function' ? column.colSpan(args) : 1;\n if (\n Number.isInteger(colSpan) &&\n colSpan! > 1 &&\n // ignore colSpan if it spans over both frozen and regular columns\n (!column.frozen || column.idx + colSpan! - 1 <= lastFrozenColumnIndex)\n ) {\n return colSpan!;\n }\n return undefined;\n}\n","import type { Maybe } from '../types';\n\nexport function stopPropagation(event: React.SyntheticEvent) {\n event.stopPropagation();\n}\n\nexport function scrollIntoView(element: Maybe) {\n element?.scrollIntoView({ inline: 'nearest', block: 'nearest' });\n}\n","import type { CellEvent } from '../types';\n\nexport function createCellEvent>(\n event: E\n): CellEvent {\n let defaultPrevented = false;\n const cellEvent = {\n ...event,\n preventGridDefault() {\n defaultPrevented = true;\n },\n isGridDefaultPrevented() {\n return defaultPrevented;\n }\n };\n\n Object.setPrototypeOf(cellEvent, Object.getPrototypeOf(event));\n\n return cellEvent;\n}\n","// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\nconst nonInputKeys = new Set([\n // Special keys\n 'Unidentified',\n // Modifier keys\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'Fn',\n 'FnLock',\n 'Meta',\n 'NumLock',\n 'ScrollLock',\n 'Shift',\n // Whitespace keys\n 'Tab',\n // Navigation keys\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n // Editing\n 'Insert',\n // UI keys\n 'ContextMenu',\n 'Escape',\n 'Pause',\n 'Play',\n // Device keys\n 'PrintScreen',\n // Function keys\n 'F1',\n // 'F2', /!\\ specifically allowed, do not edit\n 'F3',\n 'F4',\n 'F5',\n 'F6',\n 'F7',\n 'F8',\n 'F9',\n 'F10',\n 'F11',\n 'F12'\n]);\n\nexport function isCtrlKeyHeldDown(e: React.KeyboardEvent): boolean {\n return (e.ctrlKey || e.metaKey) && e.key !== 'Control';\n}\n\nexport function isDefaultCellInput(event: React.KeyboardEvent): boolean {\n const vKey = 86;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (isCtrlKeyHeldDown(event) && event.keyCode !== vKey) return false;\n return !nonInputKeys.has(event.key);\n}\n\n/**\n * By default, the following navigation keys are enabled while an editor is open, under specific conditions:\n * - Tab:\n * - The editor must be an , a