Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/core

Package Overview
Dependencies
1
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 30.2.1 to 31.0.0

32

dist/cjs/es5/license/gridLicenseManager.d.ts

@@ -8,6 +8,32 @@ import { BeanStub } from '@ag-grid-community/core';

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -14,0 +40,0 @@ isDisplayWatermark(): boolean;

2

dist/cjs/es5/license/gridLicenseManager.js

@@ -52,3 +52,3 @@ "use strict";

GridLicenseManager = __decorate([
core_1.Bean('licenseManager')
(0, core_1.Bean)('licenseManager')
], GridLicenseManager);

@@ -55,0 +55,0 @@ return GridLicenseManager;

@@ -14,6 +14,32 @@ export declare class LicenseManager {

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -32,5 +58,2 @@ isDisplayWatermark(): boolean;

private static extractBracketedInformation;
private validateLicenseKeyForVersion;
private validateLegacyKey;
private validateForTrial;
private outputInvalidLicenseKey;

@@ -37,0 +60,0 @@ private outputExpiredTrialKey;

@@ -29,2 +29,7 @@ "use strict";

}
var LICENSE_TYPES = {
'01': 'GRID',
'02': 'CHARTS',
'0102': 'BOTH'
};
var LicenseManager = /** @class */ (function () {

@@ -38,3 +43,4 @@ function LicenseManager(document) {

LicenseManager.prototype.validateLicense = function () {
if (missingOrEmpty(LicenseManager.licenseKey)) {
var licenseDetails = this.getLicenseDetails(LicenseManager.licenseKey);
if (licenseDetails.missing) {
if (!this.isWebsiteUrl() || this.isForceWatermark()) {

@@ -44,24 +50,13 @@ this.outputMissingLicenseKey();

}
else if (LicenseManager.licenseKey.length > 32) {
if (LicenseManager.licenseKey.indexOf("For_Trialing_ag-Grid_Only") !== -1) {
this.outputInvalidLicenseKey();
}
else {
var _a = LicenseManager.extractLicenseComponents(LicenseManager.licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;
if (md5 === this.md5.md5(license)) {
if (exists(version) && version) {
this.validateLicenseKeyForVersion(version, !!isTrial, license);
}
else {
this.validateLegacyKey(license);
}
}
else {
this.outputInvalidLicenseKey();
}
}
else if (!licenseDetails.valid) {
this.outputInvalidLicenseKey(licenseDetails.incorrectLicenseType, licenseDetails.licenseType);
}
else {
this.outputInvalidLicenseKey();
else if (licenseDetails.isTrial && licenseDetails.trialExpired) {
this.outputExpiredTrialKey(licenseDetails.expiry);
}
else if (licenseDetails.expired) {
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(licenseDetails.expiry, formattedReleaseDate);
}
};

@@ -78,26 +73,78 @@ LicenseManager.extractExpiry = function (license) {

cleanedLicenseKey = cleanedLicenseKey.replace(/\r?\n|\r/g, '');
// the hash that follows the key is 32 chars long
if (licenseKey.length <= 32) {
return { md5: null, license: licenseKey, version: null, isTrial: null };
}
var hashStart = cleanedLicenseKey.length - 32;
var md5 = cleanedLicenseKey.substring(hashStart);
var license = cleanedLicenseKey.substring(0, hashStart);
var _a = __read(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 2), version = _a[0], isTrial = _a[1];
return { md5: md5, license: license, version: version, isTrial: isTrial };
var _a = __read(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 3), version = _a[0], isTrial = _a[1], type = _a[2];
return { md5: md5, license: license, version: version, isTrial: isTrial, type: type };
};
LicenseManager.prototype.getLicenseDetails = function (licenseKey) {
var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;
if (missingOrEmpty(licenseKey)) {
return {
licenseKey: licenseKey,
valid: false,
missing: true
};
}
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial, type = _a.type;
var valid = (md5 === this.md5.md5(license)) && licenseKey.indexOf("For_Trialing_ag-Grid_Only") === -1;
var trialExpired = null;
var trialExpired = undefined;
var expired = undefined;
var expiry = null;
var incorrectLicenseType = undefined;
var licenseType = undefined;
function handleTrial() {
var now = new Date();
trialExpired = (expiry < now);
expired = undefined;
}
if (valid) {
expiry = LicenseManager.extractExpiry(license);
valid = !isNaN(expiry.getTime());
if (isTrial) {
var now = new Date();
trialExpired = (expiry < now);
if (valid) {
expired = (gridReleaseDate > expiry);
switch (version) {
case "legacy":
case "2": {
if (isTrial) {
handleTrial();
}
break;
}
case "3": {
if (missingOrEmpty(type)) {
valid = false;
}
else {
if (type !== LICENSE_TYPES['01'] && type !== LICENSE_TYPES['0102']) {
valid = false;
incorrectLicenseType = true;
licenseType = type;
}
else if (isTrial) {
handleTrial();
}
}
}
}
}
}
if (!valid) {
return {
licenseKey: licenseKey,
valid: valid,
incorrectLicenseType: incorrectLicenseType,
licenseType: licenseType
};
}
return {
licenseKey: licenseKey,
valid: valid,
expiry: valid ? LicenseManager.formatDate(expiry) : null,
version: version ? version : 'legacy',
expiry: LicenseManager.formatDate(expiry),
expired: expired,
version: version,
isTrial: isTrial,

@@ -198,66 +245,23 @@ trialExpired: trialExpired

LicenseManager.extractBracketedInformation = function (licenseKey) {
var matches = licenseKey.split('[')
.filter(function (v) {
return v.indexOf(']') > -1;
})
.map(function (value) {
return value.split(']')[0];
});
// legacy no trial key
if (!licenseKey.includes("[")) {
return ["legacy", false, undefined];
}
var matches = licenseKey.match(/\[(.*?)\]/g).map(function (match) { return match.replace("[", "").replace("]", ""); });
if (!matches || matches.length === 0) {
return [null, null];
return ["legacy", false, undefined];
}
var isTrial = matches.filter(function (match) { return match === 'TRIAL'; }).length === 1;
var version = matches.filter(function (match) { return match.indexOf("v") === 0; }).map(function (match) { return match.replace(/^v/, ""); })[0];
return [version, isTrial];
var rawVersion = matches.filter(function (match) { return match.indexOf("v") === 0; })[0];
var version = rawVersion ? rawVersion.replace('v', '') : 'legacy';
var type = LICENSE_TYPES[matches.filter(function (match) { return LICENSE_TYPES[match]; })[0]];
return [version, isTrial, type];
};
LicenseManager.prototype.validateLicenseKeyForVersion = function (version, isTrial, license) {
if (version !== '2') {
return;
}
if (isTrial) {
this.validateForTrial(license);
}
else {
this.validateLegacyKey(license);
}
};
LicenseManager.prototype.validateLegacyKey = function (license) {
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var expiry = LicenseManager.extractExpiry(license);
var valid = false;
var current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (gridReleaseDate < expiry);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
var formattedExpiryDate = LicenseManager.formatDate(expiry);
var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(formattedExpiryDate, formattedReleaseDate);
}
};
LicenseManager.prototype.validateForTrial = function (license) {
var expiry = LicenseManager.extractExpiry(license);
var now = new Date();
var valid = false;
var current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (expiry > now);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
var formattedExpiryDate = LicenseManager.formatDate(expiry);
this.outputExpiredTrialKey(formattedExpiryDate);
}
};
LicenseManager.prototype.outputInvalidLicenseKey = function () {
LicenseManager.prototype.outputInvalidLicenseKey = function (incorrectLicenseType, licenseType) {
console.error('*****************************************************************************************************************');
console.error('***************************************** AG Grid Enterprise License ********************************************');
console.error('********************************************* Invalid License ***************************************************');
if (exists(incorrectLicenseType) && incorrectLicenseType && licenseType === 'CHARTS') {
console.error('* The license supplied is for AG Charts Enterprise Only and does not cover AG Grid Enterprise *');
}
console.error('* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *');

@@ -272,3 +276,3 @@ console.error('*****************************************************************************************************************');

console.error('***************************************** Trial Period Expired. *******************************************');
console.error("* Your license for AG Grid Enterprise expired on " + formattedExpiryDate + ". *");
console.error("* Your license for AG Grid Enterprise expired on ".concat(formattedExpiryDate, ". *"));
console.error('* Please email info@ag-grid.com to purchase a license. *');

@@ -299,4 +303,4 @@ console.error('****************************************************************************************************************');

console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *");
console.error("* license end date. The license key that you have expires on " + formattedExpiryDate + ", however the version of AG Grid you *");
console.error("* are trying to use was released on " + formattedReleaseDate + ". *");
console.error("* license end date. The license key that you have expires on ".concat(formattedExpiryDate, ", however the version of AG Grid you *"));
console.error("* are trying to use was released on ".concat(formattedReleaseDate, ". *"));
console.error('* *');

@@ -309,5 +313,5 @@ console.error('* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *');

};
LicenseManager.RELEASE_INFORMATION = 'MTY5ODkxNzc1MzgxNA==';
LicenseManager.RELEASE_INFORMATION = 'MTcwMTA3MzA3NTIwOQ==';
return LicenseManager;
}());
exports.LicenseManager = LicenseManager;

@@ -45,6 +45,6 @@ "use strict";

__decorate([
core_1.Autowired('licenseManager')
(0, core_1.Autowired)('licenseManager')
], WatermarkComp.prototype, "licenseManager", void 0);
__decorate([
core_1.RefSelector('eLicenseTextRef')
(0, core_1.RefSelector)('eLicenseTextRef')
], WatermarkComp.prototype, "eLicenseTextRef", void 0);

@@ -51,0 +51,0 @@ __decorate([

@@ -1,1 +0,1 @@

export declare const VERSION = "30.2.1";
export declare const VERSION = "31.0.0";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '30.2.1';
exports.VERSION = '31.0.0';

@@ -8,6 +8,32 @@ import { BeanStub } from '@ag-grid-community/core';

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -14,0 +40,0 @@ isDisplayWatermark(): boolean;

@@ -34,4 +34,4 @@ "use strict";

GridLicenseManager = __decorate([
core_1.Bean('licenseManager')
(0, core_1.Bean)('licenseManager')
], GridLicenseManager);
exports.GridLicenseManager = GridLicenseManager;

@@ -14,6 +14,32 @@ export declare class LicenseManager {

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -32,5 +58,2 @@ isDisplayWatermark(): boolean;

private static extractBracketedInformation;
private validateLicenseKeyForVersion;
private validateLegacyKey;
private validateForTrial;
private outputInvalidLicenseKey;

@@ -37,0 +60,0 @@ private outputExpiredTrialKey;

@@ -12,2 +12,7 @@ "use strict";

}
const LICENSE_TYPES = {
'01': 'GRID',
'02': 'CHARTS',
'0102': 'BOTH'
};
class LicenseManager {

@@ -21,3 +26,4 @@ constructor(document) {

validateLicense() {
if (missingOrEmpty(LicenseManager.licenseKey)) {
const licenseDetails = this.getLicenseDetails(LicenseManager.licenseKey);
if (licenseDetails.missing) {
if (!this.isWebsiteUrl() || this.isForceWatermark()) {

@@ -27,24 +33,13 @@ this.outputMissingLicenseKey();

}
else if (LicenseManager.licenseKey.length > 32) {
if (LicenseManager.licenseKey.indexOf("For_Trialing_ag-Grid_Only") !== -1) {
this.outputInvalidLicenseKey();
}
else {
const { md5, license, version, isTrial } = LicenseManager.extractLicenseComponents(LicenseManager.licenseKey);
if (md5 === this.md5.md5(license)) {
if (exists(version) && version) {
this.validateLicenseKeyForVersion(version, !!isTrial, license);
}
else {
this.validateLegacyKey(license);
}
}
else {
this.outputInvalidLicenseKey();
}
}
else if (!licenseDetails.valid) {
this.outputInvalidLicenseKey(licenseDetails.incorrectLicenseType, licenseDetails.licenseType);
}
else {
this.outputInvalidLicenseKey();
else if (licenseDetails.isTrial && licenseDetails.trialExpired) {
this.outputExpiredTrialKey(licenseDetails.expiry);
}
else if (licenseDetails.expired) {
const gridReleaseDate = LicenseManager.getGridReleaseDate();
const formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(licenseDetails.expiry, formattedReleaseDate);
}
}

@@ -61,26 +56,78 @@ static extractExpiry(license) {

cleanedLicenseKey = cleanedLicenseKey.replace(/\r?\n|\r/g, '');
// the hash that follows the key is 32 chars long
if (licenseKey.length <= 32) {
return { md5: null, license: licenseKey, version: null, isTrial: null };
}
const hashStart = cleanedLicenseKey.length - 32;
const md5 = cleanedLicenseKey.substring(hashStart);
const license = cleanedLicenseKey.substring(0, hashStart);
const [version, isTrial] = LicenseManager.extractBracketedInformation(cleanedLicenseKey);
return { md5, license, version, isTrial };
const [version, isTrial, type] = LicenseManager.extractBracketedInformation(cleanedLicenseKey);
return { md5, license, version, isTrial, type };
}
getLicenseDetails(licenseKey) {
const { md5, license, version, isTrial } = LicenseManager.extractLicenseComponents(licenseKey);
if (missingOrEmpty(licenseKey)) {
return {
licenseKey,
valid: false,
missing: true
};
}
const gridReleaseDate = LicenseManager.getGridReleaseDate();
const { md5, license, version, isTrial, type } = LicenseManager.extractLicenseComponents(licenseKey);
let valid = (md5 === this.md5.md5(license)) && licenseKey.indexOf("For_Trialing_ag-Grid_Only") === -1;
let trialExpired = null;
let trialExpired = undefined;
let expired = undefined;
let expiry = null;
let incorrectLicenseType = undefined;
let licenseType = undefined;
function handleTrial() {
const now = new Date();
trialExpired = (expiry < now);
expired = undefined;
}
if (valid) {
expiry = LicenseManager.extractExpiry(license);
valid = !isNaN(expiry.getTime());
if (isTrial) {
const now = new Date();
trialExpired = (expiry < now);
if (valid) {
expired = (gridReleaseDate > expiry);
switch (version) {
case "legacy":
case "2": {
if (isTrial) {
handleTrial();
}
break;
}
case "3": {
if (missingOrEmpty(type)) {
valid = false;
}
else {
if (type !== LICENSE_TYPES['01'] && type !== LICENSE_TYPES['0102']) {
valid = false;
incorrectLicenseType = true;
licenseType = type;
}
else if (isTrial) {
handleTrial();
}
}
}
}
}
}
if (!valid) {
return {
licenseKey,
valid,
incorrectLicenseType,
licenseType
};
}
return {
licenseKey,
valid,
expiry: valid ? LicenseManager.formatDate(expiry) : null,
version: version ? version : 'legacy',
expiry: LicenseManager.formatDate(expiry),
expired,
version,
isTrial,

@@ -181,66 +228,23 @@ trialExpired

static extractBracketedInformation(licenseKey) {
const matches = licenseKey.split('[')
.filter(function (v) {
return v.indexOf(']') > -1;
})
.map(function (value) {
return value.split(']')[0];
});
// legacy no trial key
if (!licenseKey.includes("[")) {
return ["legacy", false, undefined];
}
const matches = licenseKey.match(/\[(.*?)\]/g).map(match => match.replace("[", "").replace("]", ""));
if (!matches || matches.length === 0) {
return [null, null];
return ["legacy", false, undefined];
}
const isTrial = matches.filter(match => match === 'TRIAL').length === 1;
const version = matches.filter(match => match.indexOf("v") === 0).map(match => match.replace(/^v/, ""))[0];
return [version, isTrial];
const rawVersion = matches.filter(match => match.indexOf("v") === 0)[0];
const version = rawVersion ? rawVersion.replace('v', '') : 'legacy';
const type = LICENSE_TYPES[matches.filter(match => LICENSE_TYPES[match])[0]];
return [version, isTrial, type];
}
validateLicenseKeyForVersion(version, isTrial, license) {
if (version !== '2') {
return;
}
if (isTrial) {
this.validateForTrial(license);
}
else {
this.validateLegacyKey(license);
}
}
validateLegacyKey(license) {
const gridReleaseDate = LicenseManager.getGridReleaseDate();
const expiry = LicenseManager.extractExpiry(license);
let valid = false;
let current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (gridReleaseDate < expiry);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
const formattedExpiryDate = LicenseManager.formatDate(expiry);
const formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(formattedExpiryDate, formattedReleaseDate);
}
}
validateForTrial(license) {
const expiry = LicenseManager.extractExpiry(license);
const now = new Date();
let valid = false;
let current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (expiry > now);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
const formattedExpiryDate = LicenseManager.formatDate(expiry);
this.outputExpiredTrialKey(formattedExpiryDate);
}
}
outputInvalidLicenseKey() {
outputInvalidLicenseKey(incorrectLicenseType, licenseType) {
console.error('*****************************************************************************************************************');
console.error('***************************************** AG Grid Enterprise License ********************************************');
console.error('********************************************* Invalid License ***************************************************');
if (exists(incorrectLicenseType) && incorrectLicenseType && licenseType === 'CHARTS') {
console.error('* The license supplied is for AG Charts Enterprise Only and does not cover AG Grid Enterprise *');
}
console.error('* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *');

@@ -292,2 +296,2 @@ console.error('*****************************************************************************************************************');

exports.LicenseManager = LicenseManager;
LicenseManager.RELEASE_INFORMATION = 'MTY5ODkxNzc1MzgxNA==';
LicenseManager.RELEASE_INFORMATION = 'MTcwMTA3MzA3NTIwOQ==';

@@ -31,6 +31,6 @@ "use strict";

__decorate([
core_1.Autowired('licenseManager')
(0, core_1.Autowired)('licenseManager')
], WatermarkComp.prototype, "licenseManager", void 0);
__decorate([
core_1.RefSelector('eLicenseTextRef')
(0, core_1.RefSelector)('eLicenseTextRef')
], WatermarkComp.prototype, "eLicenseTextRef", void 0);

@@ -37,0 +37,0 @@ __decorate([

@@ -1,1 +0,1 @@

export declare const VERSION = "30.2.1";
export declare const VERSION = "31.0.0";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '30.2.1';
exports.VERSION = '31.0.0';
/**
* @ag-grid-enterprise/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1
* @ag-grid-enterprise/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.0
* @link https://www.ag-grid.com/

@@ -205,2 +205,7 @@ * @license Commercial

}
var LICENSE_TYPES = {
'01': 'GRID',
'02': 'CHARTS',
'0102': 'BOTH'
};
var LicenseManager = /** @class */ (function () {

@@ -214,3 +219,4 @@ function LicenseManager(document) {

LicenseManager.prototype.validateLicense = function () {
if (missingOrEmpty(LicenseManager.licenseKey)) {
var licenseDetails = this.getLicenseDetails(LicenseManager.licenseKey);
if (licenseDetails.missing) {
if (!this.isWebsiteUrl() || this.isForceWatermark()) {

@@ -220,24 +226,13 @@ this.outputMissingLicenseKey();

}
else if (LicenseManager.licenseKey.length > 32) {
if (LicenseManager.licenseKey.indexOf("For_Trialing_ag-Grid_Only") !== -1) {
this.outputInvalidLicenseKey();
}
else {
var _a = LicenseManager.extractLicenseComponents(LicenseManager.licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;
if (md5 === this.md5.md5(license)) {
if (exists(version) && version) {
this.validateLicenseKeyForVersion(version, !!isTrial, license);
}
else {
this.validateLegacyKey(license);
}
}
else {
this.outputInvalidLicenseKey();
}
}
else if (!licenseDetails.valid) {
this.outputInvalidLicenseKey(licenseDetails.incorrectLicenseType, licenseDetails.licenseType);
}
else {
this.outputInvalidLicenseKey();
else if (licenseDetails.isTrial && licenseDetails.trialExpired) {
this.outputExpiredTrialKey(licenseDetails.expiry);
}
else if (licenseDetails.expired) {
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(licenseDetails.expiry, formattedReleaseDate);
}
};

@@ -254,26 +249,78 @@ LicenseManager.extractExpiry = function (license) {

cleanedLicenseKey = cleanedLicenseKey.replace(/\r?\n|\r/g, '');
// the hash that follows the key is 32 chars long
if (licenseKey.length <= 32) {
return { md5: null, license: licenseKey, version: null, isTrial: null };
}
var hashStart = cleanedLicenseKey.length - 32;
var md5 = cleanedLicenseKey.substring(hashStart);
var license = cleanedLicenseKey.substring(0, hashStart);
var _a = __read(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 2), version = _a[0], isTrial = _a[1];
return { md5: md5, license: license, version: version, isTrial: isTrial };
var _a = __read(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 3), version = _a[0], isTrial = _a[1], type = _a[2];
return { md5: md5, license: license, version: version, isTrial: isTrial, type: type };
};
LicenseManager.prototype.getLicenseDetails = function (licenseKey) {
var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;
if (missingOrEmpty(licenseKey)) {
return {
licenseKey: licenseKey,
valid: false,
missing: true
};
}
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial, type = _a.type;
var valid = (md5 === this.md5.md5(license)) && licenseKey.indexOf("For_Trialing_ag-Grid_Only") === -1;
var trialExpired = null;
var trialExpired = undefined;
var expired = undefined;
var expiry = null;
var incorrectLicenseType = undefined;
var licenseType = undefined;
function handleTrial() {
var now = new Date();
trialExpired = (expiry < now);
expired = undefined;
}
if (valid) {
expiry = LicenseManager.extractExpiry(license);
valid = !isNaN(expiry.getTime());
if (isTrial) {
var now = new Date();
trialExpired = (expiry < now);
if (valid) {
expired = (gridReleaseDate > expiry);
switch (version) {
case "legacy":
case "2": {
if (isTrial) {
handleTrial();
}
break;
}
case "3": {
if (missingOrEmpty(type)) {
valid = false;
}
else {
if (type !== LICENSE_TYPES['01'] && type !== LICENSE_TYPES['0102']) {
valid = false;
incorrectLicenseType = true;
licenseType = type;
}
else if (isTrial) {
handleTrial();
}
}
}
}
}
}
if (!valid) {
return {
licenseKey: licenseKey,
valid: valid,
incorrectLicenseType: incorrectLicenseType,
licenseType: licenseType
};
}
return {
licenseKey: licenseKey,
valid: valid,
expiry: valid ? LicenseManager.formatDate(expiry) : null,
version: version ? version : 'legacy',
expiry: LicenseManager.formatDate(expiry),
expired: expired,
version: version,
isTrial: isTrial,

@@ -374,66 +421,23 @@ trialExpired: trialExpired

LicenseManager.extractBracketedInformation = function (licenseKey) {
var matches = licenseKey.split('[')
.filter(function (v) {
return v.indexOf(']') > -1;
})
.map(function (value) {
return value.split(']')[0];
});
// legacy no trial key
if (!licenseKey.includes("[")) {
return ["legacy", false, undefined];
}
var matches = licenseKey.match(/\[(.*?)\]/g).map(function (match) { return match.replace("[", "").replace("]", ""); });
if (!matches || matches.length === 0) {
return [null, null];
return ["legacy", false, undefined];
}
var isTrial = matches.filter(function (match) { return match === 'TRIAL'; }).length === 1;
var version = matches.filter(function (match) { return match.indexOf("v") === 0; }).map(function (match) { return match.replace(/^v/, ""); })[0];
return [version, isTrial];
var rawVersion = matches.filter(function (match) { return match.indexOf("v") === 0; })[0];
var version = rawVersion ? rawVersion.replace('v', '') : 'legacy';
var type = LICENSE_TYPES[matches.filter(function (match) { return LICENSE_TYPES[match]; })[0]];
return [version, isTrial, type];
};
LicenseManager.prototype.validateLicenseKeyForVersion = function (version, isTrial, license) {
if (version !== '2') {
return;
}
if (isTrial) {
this.validateForTrial(license);
}
else {
this.validateLegacyKey(license);
}
};
LicenseManager.prototype.validateLegacyKey = function (license) {
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var expiry = LicenseManager.extractExpiry(license);
var valid = false;
var current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (gridReleaseDate < expiry);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
var formattedExpiryDate = LicenseManager.formatDate(expiry);
var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(formattedExpiryDate, formattedReleaseDate);
}
};
LicenseManager.prototype.validateForTrial = function (license) {
var expiry = LicenseManager.extractExpiry(license);
var now = new Date();
var valid = false;
var current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (expiry > now);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
var formattedExpiryDate = LicenseManager.formatDate(expiry);
this.outputExpiredTrialKey(formattedExpiryDate);
}
};
LicenseManager.prototype.outputInvalidLicenseKey = function () {
LicenseManager.prototype.outputInvalidLicenseKey = function (incorrectLicenseType, licenseType) {
console.error('*****************************************************************************************************************');
console.error('***************************************** AG Grid Enterprise License ********************************************');
console.error('********************************************* Invalid License ***************************************************');
if (exists(incorrectLicenseType) && incorrectLicenseType && licenseType === 'CHARTS') {
console.error('* The license supplied is for AG Charts Enterprise Only and does not cover AG Grid Enterprise *');
}
console.error('* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *');

@@ -448,3 +452,3 @@ console.error('*****************************************************************************************************************');

console.error('***************************************** Trial Period Expired. *******************************************');
console.error("* Your license for AG Grid Enterprise expired on " + formattedExpiryDate + ". *");
console.error("* Your license for AG Grid Enterprise expired on ".concat(formattedExpiryDate, ". *"));
console.error('* Please email info@ag-grid.com to purchase a license. *');

@@ -475,4 +479,4 @@ console.error('****************************************************************************************************************');

console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *");
console.error("* license end date. The license key that you have expires on " + formattedExpiryDate + ", however the version of AG Grid you *");
console.error("* are trying to use was released on " + formattedReleaseDate + ". *");
console.error("* license end date. The license key that you have expires on ".concat(formattedExpiryDate, ", however the version of AG Grid you *"));
console.error("* are trying to use was released on ".concat(formattedReleaseDate, ". *"));
console.error('* *');

@@ -485,3 +489,3 @@ console.error('* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *');

};
LicenseManager.RELEASE_INFORMATION = 'MTY5ODkxNzc1MzgxNA==';
LicenseManager.RELEASE_INFORMATION = 'MTcwMTA3MzA3NTIwOQ==';
return LicenseManager;

@@ -593,3 +597,3 @@ }());

// DO NOT UPDATE MANUALLY: Generated from script during build time
var VERSION = '30.2.1';
var VERSION = '31.0.0';

@@ -596,0 +600,0 @@ var EnterpriseCoreModule = {

/**
* @ag-grid-enterprise/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1
* @ag-grid-enterprise/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.0
* @link https://www.ag-grid.com/

@@ -7,6 +7,6 @@ * @license Commercial

/**
* @ag-grid-enterprise/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1
* @ag-grid-enterprise/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@ag-grid-community/core"),t=function(){function e(){this.ieCompatibility=!1}return e.prototype.init=function(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")},e.prototype.md5cycle=function(e,t){var r=e[0],i=e[1],o=e[2],n=e[3];r=this.ff(r,i,o,n,t[0],7,-680876936),n=this.ff(n,r,i,o,t[1],12,-389564586),o=this.ff(o,n,r,i,t[2],17,606105819),i=this.ff(i,o,n,r,t[3],22,-1044525330),r=this.ff(r,i,o,n,t[4],7,-176418897),n=this.ff(n,r,i,o,t[5],12,1200080426),o=this.ff(o,n,r,i,t[6],17,-1473231341),i=this.ff(i,o,n,r,t[7],22,-45705983),r=this.ff(r,i,o,n,t[8],7,1770035416),n=this.ff(n,r,i,o,t[9],12,-1958414417),o=this.ff(o,n,r,i,t[10],17,-42063),i=this.ff(i,o,n,r,t[11],22,-1990404162),r=this.ff(r,i,o,n,t[12],7,1804603682),n=this.ff(n,r,i,o,t[13],12,-40341101),o=this.ff(o,n,r,i,t[14],17,-1502002290),i=this.ff(i,o,n,r,t[15],22,1236535329),r=this.gg(r,i,o,n,t[1],5,-165796510),n=this.gg(n,r,i,o,t[6],9,-1069501632),o=this.gg(o,n,r,i,t[11],14,643717713),i=this.gg(i,o,n,r,t[0],20,-373897302),r=this.gg(r,i,o,n,t[5],5,-701558691),n=this.gg(n,r,i,o,t[10],9,38016083),o=this.gg(o,n,r,i,t[15],14,-660478335),i=this.gg(i,o,n,r,t[4],20,-405537848),r=this.gg(r,i,o,n,t[9],5,568446438),n=this.gg(n,r,i,o,t[14],9,-1019803690),o=this.gg(o,n,r,i,t[3],14,-187363961),i=this.gg(i,o,n,r,t[8],20,1163531501),r=this.gg(r,i,o,n,t[13],5,-1444681467),n=this.gg(n,r,i,o,t[2],9,-51403784),o=this.gg(o,n,r,i,t[7],14,1735328473),i=this.gg(i,o,n,r,t[12],20,-1926607734),r=this.hh(r,i,o,n,t[5],4,-378558),n=this.hh(n,r,i,o,t[8],11,-2022574463),o=this.hh(o,n,r,i,t[11],16,1839030562),i=this.hh(i,o,n,r,t[14],23,-35309556),r=this.hh(r,i,o,n,t[1],4,-1530992060),n=this.hh(n,r,i,o,t[4],11,1272893353),o=this.hh(o,n,r,i,t[7],16,-155497632),i=this.hh(i,o,n,r,t[10],23,-1094730640),r=this.hh(r,i,o,n,t[13],4,681279174),n=this.hh(n,r,i,o,t[0],11,-358537222),o=this.hh(o,n,r,i,t[3],16,-722521979),i=this.hh(i,o,n,r,t[6],23,76029189),r=this.hh(r,i,o,n,t[9],4,-640364487),n=this.hh(n,r,i,o,t[12],11,-421815835),o=this.hh(o,n,r,i,t[15],16,530742520),i=this.hh(i,o,n,r,t[2],23,-995338651),r=this.ii(r,i,o,n,t[0],6,-198630844),n=this.ii(n,r,i,o,t[7],10,1126891415),o=this.ii(o,n,r,i,t[14],15,-1416354905),i=this.ii(i,o,n,r,t[5],21,-57434055),r=this.ii(r,i,o,n,t[12],6,1700485571),n=this.ii(n,r,i,o,t[3],10,-1894986606),o=this.ii(o,n,r,i,t[10],15,-1051523),i=this.ii(i,o,n,r,t[1],21,-2054922799),r=this.ii(r,i,o,n,t[8],6,1873313359),n=this.ii(n,r,i,o,t[15],10,-30611744),o=this.ii(o,n,r,i,t[6],15,-1560198380),i=this.ii(i,o,n,r,t[13],21,1309151649),r=this.ii(r,i,o,n,t[4],6,-145523070),n=this.ii(n,r,i,o,t[11],10,-1120210379),o=this.ii(o,n,r,i,t[2],15,718787259),i=this.ii(i,o,n,r,t[9],21,-343485551),e[0]=this.add32(r,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(o,e[2]),e[3]=this.add32(n,e[3])},e.prototype.cmn=function(e,t,r,i,o,n){return t=this.add32(this.add32(t,e),this.add32(i,n)),this.add32(t<<o|t>>>32-o,r)},e.prototype.ff=function(e,t,r,i,o,n,s){return this.cmn(t&r|~t&i,e,t,o,n,s)},e.prototype.gg=function(e,t,r,i,o,n,s){return this.cmn(t&i|r&~i,e,t,o,n,s)},e.prototype.hh=function(e,t,r,i,o,n,s){return this.cmn(t^r^i,e,t,o,n,s)},e.prototype.ii=function(e,t,r,i,o,n,s){return this.cmn(r^(t|~i),e,t,o,n,s)},e.prototype.md51=function(e){var t,r=e.length,i=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)this.md5cycle(i,this.md5blk(e.substring(t-64,t)));e=e.substring(t-64);var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)o[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(this.md5cycle(i,o),t=0;t<16;t++)o[t]=0;return o[14]=8*r,this.md5cycle(i,o),i},e.prototype.md5blk=function(e){for(var t=[],r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t},e.prototype.rhex=function(e){for(var t="0123456789abcdef".split(""),r="",i=0;i<4;i++)r+=t[e>>8*i+4&15]+t[e>>8*i&15];return r},e.prototype.hex=function(e){for(var t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")},e.prototype.md5=function(e){return this.hex(this.md51(e))},e.prototype.add32=function(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)},e.prototype.add32Std=function(e,t){return e+t&4294967295},e.prototype.add32Compat=function(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r},e}(),r=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,o,n=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function i(e){return null==e||0===e.length}var o,n=function(){function e(e){this.watermarkMessage=void 0,this.document=e,this.md5=new t,this.md5.init()}return e.prototype.validateLicense=function(){if(i(e.licenseKey))this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey();else if(e.licenseKey.length>32)if(-1!==e.licenseKey.indexOf("For_Trialing_ag-Grid_Only"))this.outputInvalidLicenseKey();else{var t=e.extractLicenseComponents(e.licenseKey),r=t.md5,o=t.license,n=t.version,s=t.isTrial;r===this.md5.md5(o)?(void 0===c&&(c=!1),null!=(a=n)&&(""!==a||c)&&n?this.validateLicenseKeyForVersion(n,!!s,o):this.validateLegacyKey(o)):this.outputInvalidLicenseKey()}else this.outputInvalidLicenseKey();var a,c},e.extractExpiry=function(t){var r=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(r),10))},e.extractLicenseComponents=function(t){var i=t.replace(/[\u200B-\u200D\uFEFF]/g,""),o=(i=i.replace(/\r?\n|\r/g,"")).length-32,n=i.substring(o),s=i.substring(0,o),a=r(e.extractBracketedInformation(i),2);return{md5:n,license:s,version:a[0],isTrial:a[1]}},e.prototype.getLicenseDetails=function(t){var r=e.extractLicenseComponents(t),i=r.md5,o=r.license,n=r.version,s=r.isTrial,a=i===this.md5.md5(o)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),c=null,l=null;a&&(l=e.extractExpiry(o),a=!isNaN(l.getTime()),s&&(c=l<new Date));return{licenseKey:t,valid:a,expiry:a?e.formatDate(l):null,version:n||"legacy",isTrial:s,trialExpired:c}},e.prototype.isDisplayWatermark=function(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!i(this.watermarkMessage)},e.prototype.getWatermarkMessage=function(){return this.watermarkMessage||""},e.prototype.getHostname=function(){var e=(this.document.defaultView||window).location.hostname;return void 0===e?"":e},e.prototype.isForceWatermark=function(){var e=(this.document.defaultView||window).location.pathname;return!!e&&-1!==e.indexOf("forceWatermark")},e.prototype.isWebsiteUrl=function(){return null!==this.getHostname().match(/^((?:\w+\.)?ag-grid\.com)$/)},e.prototype.isLocalhost=function(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)},e.formatDate=function(e){var t=e.getDate(),r=e.getMonth(),i=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][r]+" "+i},e.getGridReleaseDate=function(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))},e.decode=function(t){for(var r,i,o,n,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",h=0,u=t.replace(/[^A-Za-z0-9+/=]/g,"");h<u.length;)r=c.indexOf(u.charAt(h++))<<2|(n=c.indexOf(u.charAt(h++)))>>4,i=(15&n)<<4|(s=c.indexOf(u.charAt(h++)))>>2,o=(3&s)<<6|(a=c.indexOf(u.charAt(h++))),l+=String.fromCharCode(r),64!=s&&(l+=String.fromCharCode(i)),64!=a&&(l+=String.fromCharCode(o));return l=e.utf8_decode(l)},e.utf8_decode=function(e){e=e.replace(/rn/g,"n");for(var t="",r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t},e.setLicenseKey=function(e){this.licenseKey=e},e.extractBracketedInformation=function(e){var t=e.split("[").filter((function(e){return e.indexOf("]")>-1})).map((function(e){return e.split("]")[0]}));if(!t||0===t.length)return[null,null];var r=1===t.filter((function(e){return"TRIAL"===e})).length;return[t.filter((function(e){return 0===e.indexOf("v")})).map((function(e){return e.replace(/^v/,"")}))[0],r]},e.prototype.validateLicenseKeyForVersion=function(e,t,r){"2"===e&&(t?this.validateForTrial(r):this.validateLegacyKey(r))},e.prototype.validateLegacyKey=function(t){var r=e.getGridReleaseDate(),i=e.extractExpiry(t),o=!1,n=!1;if(isNaN(i.getTime())||(o=!0,n=r<i),o){if(!n){var s=e.formatDate(i),a=e.formatDate(r);this.outputIncompatibleVersion(s,a)}}else this.outputInvalidLicenseKey()},e.prototype.validateForTrial=function(t){var r=e.extractExpiry(t),i=new Date,o=!1,n=!1;if(isNaN(r.getTime())||(o=!0,n=r>i),o){if(!n){var s=e.formatDate(r);this.outputExpiredTrialKey(s)}}else this.outputInvalidLicenseKey()},e.prototype.outputInvalidLicenseKey=function(){console.error("*****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License ********************************************"),console.error("********************************************* Invalid License ***************************************************"),console.error("* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *"),console.error("*****************************************************************************************************************"),console.error("*****************************************************************************************************************"),this.watermarkMessage="Invalid License"},e.prototype.outputExpiredTrialKey=function(e){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("***************************************** Trial Period Expired. *******************************************"),console.error("* Your license for AG Grid Enterprise expired on "+e+". *"),console.error("* Please email info@ag-grid.com to purchase a license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="Trial Period Expired"},e.prototype.outputMissingLicenseKey=function(){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("****************************************** License Key Not Found ***********************************************"),console.error("* All AG Grid Enterprise features are unlocked. *"),console.error("* This is an evaluation only version, it is not licensed for development projects intended for production. *"),console.error("* If you want to hide the watermark, please email info@ag-grid.com for a trial license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="For Trial Use Only"},e.prototype.outputIncompatibleVersion=function(e,t){console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),console.error("* AG Grid Enterprise License *"),console.error("* License not compatible with installed version of AG Grid Enterprise. *"),console.error("* *"),console.error("* Your AG Grid License entitles you to all versions of AG Grid that we release within the time covered by your license *"),console.error("* - typically we provide one year licenses which entitles you to all releases / updates of AG Grid within that year. *"),console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *"),console.error("* license end date. The license key that you have expires on "+e+", however the version of AG Grid you *"),console.error("* are trying to use was released on "+t+". *"),console.error("* *"),console.error("* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *"),console.error("* version of AG Grid. *"),console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),this.watermarkMessage="License Expired"},e.RELEASE_INFORMATION="MTY5ODkxNzc1MzgxNA==",e}(),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},c=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return s(r,t),r.prototype.validateLicense=function(){this.licenseManager=new n(this.gridOptionsService.getDocument()),this.licenseManager.validateLicense()},r.getLicenseDetails=function(e){return new n(null).getLicenseDetails(e)},r.prototype.isDisplayWatermark=function(){return this.licenseManager.isDisplayWatermark()},r.prototype.getWatermarkMessage=function(){return this.licenseManager.getWatermarkMessage()},r.setLicenseKey=function(e){n.setLicenseKey(e)},a([e.PreConstruct],r.prototype,"validateLicense",null),r=a([e.Bean("licenseManager")],r)}(e.BeanStub),l=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),h=function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},u=function(t){function r(){return t.call(this,'<div class="ag-watermark">\n <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n </div>')||this}return l(r,t),r.prototype.postConstruct=function(){var e=this,t=this.shouldDisplayWatermark();this.setDisplayed(t),t&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout((function(){return e.addCssClass("ag-opacity-zero")}),0),window.setTimeout((function(){return e.setDisplayed(!1)}),5e3))},r.prototype.shouldDisplayWatermark=function(){return this.licenseManager.isDisplayWatermark()},h([e.Autowired("licenseManager")],r.prototype,"licenseManager",void 0),h([e.RefSelector("eLicenseTextRef")],r.prototype,"eLicenseTextRef",void 0),h([e.PostConstruct],r.prototype,"postConstruct",null),r}(e.Component),f={version:"30.2.1",moduleName:e.ModuleNames.EnterpriseCoreModule,beans:[c],agStackComponents:[{componentName:"AgWatermark",componentClass:u}]};exports.EnterpriseCoreModule=f,exports.LicenseManager=c;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@ag-grid-community/core"),t=function(){function e(){this.ieCompatibility=!1}return e.prototype.init=function(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")},e.prototype.md5cycle=function(e,t){var r=e[0],i=e[1],o=e[2],n=e[3];r=this.ff(r,i,o,n,t[0],7,-680876936),n=this.ff(n,r,i,o,t[1],12,-389564586),o=this.ff(o,n,r,i,t[2],17,606105819),i=this.ff(i,o,n,r,t[3],22,-1044525330),r=this.ff(r,i,o,n,t[4],7,-176418897),n=this.ff(n,r,i,o,t[5],12,1200080426),o=this.ff(o,n,r,i,t[6],17,-1473231341),i=this.ff(i,o,n,r,t[7],22,-45705983),r=this.ff(r,i,o,n,t[8],7,1770035416),n=this.ff(n,r,i,o,t[9],12,-1958414417),o=this.ff(o,n,r,i,t[10],17,-42063),i=this.ff(i,o,n,r,t[11],22,-1990404162),r=this.ff(r,i,o,n,t[12],7,1804603682),n=this.ff(n,r,i,o,t[13],12,-40341101),o=this.ff(o,n,r,i,t[14],17,-1502002290),i=this.ff(i,o,n,r,t[15],22,1236535329),r=this.gg(r,i,o,n,t[1],5,-165796510),n=this.gg(n,r,i,o,t[6],9,-1069501632),o=this.gg(o,n,r,i,t[11],14,643717713),i=this.gg(i,o,n,r,t[0],20,-373897302),r=this.gg(r,i,o,n,t[5],5,-701558691),n=this.gg(n,r,i,o,t[10],9,38016083),o=this.gg(o,n,r,i,t[15],14,-660478335),i=this.gg(i,o,n,r,t[4],20,-405537848),r=this.gg(r,i,o,n,t[9],5,568446438),n=this.gg(n,r,i,o,t[14],9,-1019803690),o=this.gg(o,n,r,i,t[3],14,-187363961),i=this.gg(i,o,n,r,t[8],20,1163531501),r=this.gg(r,i,o,n,t[13],5,-1444681467),n=this.gg(n,r,i,o,t[2],9,-51403784),o=this.gg(o,n,r,i,t[7],14,1735328473),i=this.gg(i,o,n,r,t[12],20,-1926607734),r=this.hh(r,i,o,n,t[5],4,-378558),n=this.hh(n,r,i,o,t[8],11,-2022574463),o=this.hh(o,n,r,i,t[11],16,1839030562),i=this.hh(i,o,n,r,t[14],23,-35309556),r=this.hh(r,i,o,n,t[1],4,-1530992060),n=this.hh(n,r,i,o,t[4],11,1272893353),o=this.hh(o,n,r,i,t[7],16,-155497632),i=this.hh(i,o,n,r,t[10],23,-1094730640),r=this.hh(r,i,o,n,t[13],4,681279174),n=this.hh(n,r,i,o,t[0],11,-358537222),o=this.hh(o,n,r,i,t[3],16,-722521979),i=this.hh(i,o,n,r,t[6],23,76029189),r=this.hh(r,i,o,n,t[9],4,-640364487),n=this.hh(n,r,i,o,t[12],11,-421815835),o=this.hh(o,n,r,i,t[15],16,530742520),i=this.hh(i,o,n,r,t[2],23,-995338651),r=this.ii(r,i,o,n,t[0],6,-198630844),n=this.ii(n,r,i,o,t[7],10,1126891415),o=this.ii(o,n,r,i,t[14],15,-1416354905),i=this.ii(i,o,n,r,t[5],21,-57434055),r=this.ii(r,i,o,n,t[12],6,1700485571),n=this.ii(n,r,i,o,t[3],10,-1894986606),o=this.ii(o,n,r,i,t[10],15,-1051523),i=this.ii(i,o,n,r,t[1],21,-2054922799),r=this.ii(r,i,o,n,t[8],6,1873313359),n=this.ii(n,r,i,o,t[15],10,-30611744),o=this.ii(o,n,r,i,t[6],15,-1560198380),i=this.ii(i,o,n,r,t[13],21,1309151649),r=this.ii(r,i,o,n,t[4],6,-145523070),n=this.ii(n,r,i,o,t[11],10,-1120210379),o=this.ii(o,n,r,i,t[2],15,718787259),i=this.ii(i,o,n,r,t[9],21,-343485551),e[0]=this.add32(r,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(o,e[2]),e[3]=this.add32(n,e[3])},e.prototype.cmn=function(e,t,r,i,o,n){return t=this.add32(this.add32(t,e),this.add32(i,n)),this.add32(t<<o|t>>>32-o,r)},e.prototype.ff=function(e,t,r,i,o,n,s){return this.cmn(t&r|~t&i,e,t,o,n,s)},e.prototype.gg=function(e,t,r,i,o,n,s){return this.cmn(t&i|r&~i,e,t,o,n,s)},e.prototype.hh=function(e,t,r,i,o,n,s){return this.cmn(t^r^i,e,t,o,n,s)},e.prototype.ii=function(e,t,r,i,o,n,s){return this.cmn(r^(t|~i),e,t,o,n,s)},e.prototype.md51=function(e){var t,r=e.length,i=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)this.md5cycle(i,this.md5blk(e.substring(t-64,t)));e=e.substring(t-64);var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)o[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(this.md5cycle(i,o),t=0;t<16;t++)o[t]=0;return o[14]=8*r,this.md5cycle(i,o),i},e.prototype.md5blk=function(e){for(var t=[],r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t},e.prototype.rhex=function(e){for(var t="0123456789abcdef".split(""),r="",i=0;i<4;i++)r+=t[e>>8*i+4&15]+t[e>>8*i&15];return r},e.prototype.hex=function(e){for(var t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")},e.prototype.md5=function(e){return this.hex(this.md51(e))},e.prototype.add32=function(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)},e.prototype.add32Std=function(e,t){return e+t&4294967295},e.prototype.add32Compat=function(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r},e}(),r=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,o,n=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function i(e){return null==e||0===e.length}var o,n={"01":"GRID","02":"CHARTS","0102":"BOTH"},s=function(){function e(e){this.watermarkMessage=void 0,this.document=e,this.md5=new t,this.md5.init()}return e.prototype.validateLicense=function(){var t=this.getLicenseDetails(e.licenseKey);if(t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey();else if(t.valid){if(t.isTrial&&t.trialExpired)this.outputExpiredTrialKey(t.expiry);else if(t.expired){var r=e.getGridReleaseDate(),i=e.formatDate(r);this.outputIncompatibleVersion(t.expiry,i)}}else this.outputInvalidLicenseKey(t.incorrectLicenseType,t.licenseType)},e.extractExpiry=function(t){var r=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(r),10))},e.extractLicenseComponents=function(t){var i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};var o=i.length-32,n=i.substring(o),s=i.substring(0,o),a=r(e.extractBracketedInformation(i),3);return{md5:n,license:s,version:a[0],isTrial:a[1],type:a[2]}},e.prototype.getLicenseDetails=function(t){if(i(t))return{licenseKey:t,valid:!1,missing:!0};var r=e.getGridReleaseDate(),o=e.extractLicenseComponents(t),s=o.md5,a=o.license,c=o.version,l=o.isTrial,h=o.type,u=s===this.md5.md5(a)&&-1===t.indexOf("For_Trialing_ag-Grid_Only"),f=void 0,p=void 0,d=null,g=void 0,y=void 0;function m(){var e=new Date;f=d<e,p=void 0}if(u&&(d=e.extractExpiry(a),u=!isNaN(d.getTime())))switch(p=r>d,c){case"legacy":case"2":l&&m();break;case"3":i(h)?u=!1:h!==n["01"]&&h!==n["0102"]?(u=!1,g=!0,y=h):l&&m()}return u?{licenseKey:t,valid:u,expiry:e.formatDate(d),expired:p,version:c,isTrial:l,trialExpired:f}:{licenseKey:t,valid:u,incorrectLicenseType:g,licenseType:y}},e.prototype.isDisplayWatermark=function(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!i(this.watermarkMessage)},e.prototype.getWatermarkMessage=function(){return this.watermarkMessage||""},e.prototype.getHostname=function(){var e=(this.document.defaultView||window).location.hostname;return void 0===e?"":e},e.prototype.isForceWatermark=function(){var e=(this.document.defaultView||window).location.pathname;return!!e&&-1!==e.indexOf("forceWatermark")},e.prototype.isWebsiteUrl=function(){return null!==this.getHostname().match(/^((?:\w+\.)?ag-grid\.com)$/)},e.prototype.isLocalhost=function(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)},e.formatDate=function(e){var t=e.getDate(),r=e.getMonth(),i=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][r]+" "+i},e.getGridReleaseDate=function(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))},e.decode=function(t){for(var r,i,o,n,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",h=0,u=t.replace(/[^A-Za-z0-9+/=]/g,"");h<u.length;)r=c.indexOf(u.charAt(h++))<<2|(n=c.indexOf(u.charAt(h++)))>>4,i=(15&n)<<4|(s=c.indexOf(u.charAt(h++)))>>2,o=(3&s)<<6|(a=c.indexOf(u.charAt(h++))),l+=String.fromCharCode(r),64!=s&&(l+=String.fromCharCode(i)),64!=a&&(l+=String.fromCharCode(o));return l=e.utf8_decode(l)},e.utf8_decode=function(e){e=e.replace(/rn/g,"n");for(var t="",r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t},e.setLicenseKey=function(e){this.licenseKey=e},e.extractBracketedInformation=function(e){if(!e.includes("["))return["legacy",!1,void 0];var t=e.match(/\[(.*?)\]/g).map((function(e){return e.replace("[","").replace("]","")}));if(!t||0===t.length)return["legacy",!1,void 0];var r=1===t.filter((function(e){return"TRIAL"===e})).length,i=t.filter((function(e){return 0===e.indexOf("v")}))[0];return[i?i.replace("v",""):"legacy",r,n[t.filter((function(e){return n[e]}))[0]]]},e.prototype.outputInvalidLicenseKey=function(e,t){var r,i;console.error("*****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License ********************************************"),console.error("********************************************* Invalid License ***************************************************"),void 0===i&&(i=!1),null!=(r=e)&&(""!==r||i)&&e&&"CHARTS"===t&&console.error("* The license supplied is for AG Charts Enterprise Only and does not cover AG Grid Enterprise *"),console.error("* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *"),console.error("*****************************************************************************************************************"),console.error("*****************************************************************************************************************"),this.watermarkMessage="Invalid License"},e.prototype.outputExpiredTrialKey=function(e){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("***************************************** Trial Period Expired. *******************************************"),console.error("* Your license for AG Grid Enterprise expired on ".concat(e,". *")),console.error("* Please email info@ag-grid.com to purchase a license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="Trial Period Expired"},e.prototype.outputMissingLicenseKey=function(){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("****************************************** License Key Not Found ***********************************************"),console.error("* All AG Grid Enterprise features are unlocked. *"),console.error("* This is an evaluation only version, it is not licensed for development projects intended for production. *"),console.error("* If you want to hide the watermark, please email info@ag-grid.com for a trial license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="For Trial Use Only"},e.prototype.outputIncompatibleVersion=function(e,t){console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),console.error("* AG Grid Enterprise License *"),console.error("* License not compatible with installed version of AG Grid Enterprise. *"),console.error("* *"),console.error("* Your AG Grid License entitles you to all versions of AG Grid that we release within the time covered by your license *"),console.error("* - typically we provide one year licenses which entitles you to all releases / updates of AG Grid within that year. *"),console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *"),console.error("* license end date. The license key that you have expires on ".concat(e,", however the version of AG Grid you *")),console.error("* are trying to use was released on ".concat(t,". *")),console.error("* *"),console.error("* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *"),console.error("* version of AG Grid. *"),console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),this.watermarkMessage="License Expired"},e.RELEASE_INFORMATION="MTcwMTA3MzA3NTIwOQ==",e}(),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},l=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return a(r,t),r.prototype.validateLicense=function(){this.licenseManager=new s(this.gridOptionsService.getDocument()),this.licenseManager.validateLicense()},r.getLicenseDetails=function(e){return new s(null).getLicenseDetails(e)},r.prototype.isDisplayWatermark=function(){return this.licenseManager.isDisplayWatermark()},r.prototype.getWatermarkMessage=function(){return this.licenseManager.getWatermarkMessage()},r.setLicenseKey=function(e){s.setLicenseKey(e)},c([e.PreConstruct],r.prototype,"validateLicense",null),r=c([e.Bean("licenseManager")],r)}(e.BeanStub),h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),u=function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},f=function(t){function r(){return t.call(this,'<div class="ag-watermark">\n <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n </div>')||this}return h(r,t),r.prototype.postConstruct=function(){var e=this,t=this.shouldDisplayWatermark();this.setDisplayed(t),t&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout((function(){return e.addCssClass("ag-opacity-zero")}),0),window.setTimeout((function(){return e.setDisplayed(!1)}),5e3))},r.prototype.shouldDisplayWatermark=function(){return this.licenseManager.isDisplayWatermark()},u([e.Autowired("licenseManager")],r.prototype,"licenseManager",void 0),u([e.RefSelector("eLicenseTextRef")],r.prototype,"eLicenseTextRef",void 0),u([e.PostConstruct],r.prototype,"postConstruct",null),r}(e.Component),p={version:"31.0.0",moduleName:e.ModuleNames.EnterpriseCoreModule,beans:[l],agStackComponents:[{componentName:"AgWatermark",componentClass:f}]};exports.EnterpriseCoreModule=p,exports.LicenseManager=l;

@@ -8,6 +8,32 @@ import { BeanStub } from '@ag-grid-community/core';

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -14,0 +40,0 @@ isDisplayWatermark(): boolean;

@@ -14,6 +14,32 @@ export declare class LicenseManager {

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -32,5 +58,2 @@ isDisplayWatermark(): boolean;

private static extractBracketedInformation;
private validateLicenseKeyForVersion;
private validateLegacyKey;
private validateForTrial;
private outputInvalidLicenseKey;

@@ -37,0 +60,0 @@ private outputExpiredTrialKey;

@@ -26,2 +26,7 @@ var __read = (this && this.__read) || function (o, n) {

}
var LICENSE_TYPES = {
'01': 'GRID',
'02': 'CHARTS',
'0102': 'BOTH'
};
var LicenseManager = /** @class */ (function () {

@@ -35,3 +40,4 @@ function LicenseManager(document) {

LicenseManager.prototype.validateLicense = function () {
if (missingOrEmpty(LicenseManager.licenseKey)) {
var licenseDetails = this.getLicenseDetails(LicenseManager.licenseKey);
if (licenseDetails.missing) {
if (!this.isWebsiteUrl() || this.isForceWatermark()) {

@@ -41,24 +47,13 @@ this.outputMissingLicenseKey();

}
else if (LicenseManager.licenseKey.length > 32) {
if (LicenseManager.licenseKey.indexOf("For_Trialing_ag-Grid_Only") !== -1) {
this.outputInvalidLicenseKey();
}
else {
var _a = LicenseManager.extractLicenseComponents(LicenseManager.licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;
if (md5 === this.md5.md5(license)) {
if (exists(version) && version) {
this.validateLicenseKeyForVersion(version, !!isTrial, license);
}
else {
this.validateLegacyKey(license);
}
}
else {
this.outputInvalidLicenseKey();
}
}
else if (!licenseDetails.valid) {
this.outputInvalidLicenseKey(licenseDetails.incorrectLicenseType, licenseDetails.licenseType);
}
else {
this.outputInvalidLicenseKey();
else if (licenseDetails.isTrial && licenseDetails.trialExpired) {
this.outputExpiredTrialKey(licenseDetails.expiry);
}
else if (licenseDetails.expired) {
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(licenseDetails.expiry, formattedReleaseDate);
}
};

@@ -75,26 +70,78 @@ LicenseManager.extractExpiry = function (license) {

cleanedLicenseKey = cleanedLicenseKey.replace(/\r?\n|\r/g, '');
// the hash that follows the key is 32 chars long
if (licenseKey.length <= 32) {
return { md5: null, license: licenseKey, version: null, isTrial: null };
}
var hashStart = cleanedLicenseKey.length - 32;
var md5 = cleanedLicenseKey.substring(hashStart);
var license = cleanedLicenseKey.substring(0, hashStart);
var _a = __read(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 2), version = _a[0], isTrial = _a[1];
return { md5: md5, license: license, version: version, isTrial: isTrial };
var _a = __read(LicenseManager.extractBracketedInformation(cleanedLicenseKey), 3), version = _a[0], isTrial = _a[1], type = _a[2];
return { md5: md5, license: license, version: version, isTrial: isTrial, type: type };
};
LicenseManager.prototype.getLicenseDetails = function (licenseKey) {
var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial;
if (missingOrEmpty(licenseKey)) {
return {
licenseKey: licenseKey,
valid: false,
missing: true
};
}
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var _a = LicenseManager.extractLicenseComponents(licenseKey), md5 = _a.md5, license = _a.license, version = _a.version, isTrial = _a.isTrial, type = _a.type;
var valid = (md5 === this.md5.md5(license)) && licenseKey.indexOf("For_Trialing_ag-Grid_Only") === -1;
var trialExpired = null;
var trialExpired = undefined;
var expired = undefined;
var expiry = null;
var incorrectLicenseType = undefined;
var licenseType = undefined;
function handleTrial() {
var now = new Date();
trialExpired = (expiry < now);
expired = undefined;
}
if (valid) {
expiry = LicenseManager.extractExpiry(license);
valid = !isNaN(expiry.getTime());
if (isTrial) {
var now = new Date();
trialExpired = (expiry < now);
if (valid) {
expired = (gridReleaseDate > expiry);
switch (version) {
case "legacy":
case "2": {
if (isTrial) {
handleTrial();
}
break;
}
case "3": {
if (missingOrEmpty(type)) {
valid = false;
}
else {
if (type !== LICENSE_TYPES['01'] && type !== LICENSE_TYPES['0102']) {
valid = false;
incorrectLicenseType = true;
licenseType = type;
}
else if (isTrial) {
handleTrial();
}
}
}
}
}
}
if (!valid) {
return {
licenseKey: licenseKey,
valid: valid,
incorrectLicenseType: incorrectLicenseType,
licenseType: licenseType
};
}
return {
licenseKey: licenseKey,
valid: valid,
expiry: valid ? LicenseManager.formatDate(expiry) : null,
version: version ? version : 'legacy',
expiry: LicenseManager.formatDate(expiry),
expired: expired,
version: version,
isTrial: isTrial,

@@ -195,66 +242,23 @@ trialExpired: trialExpired

LicenseManager.extractBracketedInformation = function (licenseKey) {
var matches = licenseKey.split('[')
.filter(function (v) {
return v.indexOf(']') > -1;
})
.map(function (value) {
return value.split(']')[0];
});
// legacy no trial key
if (!licenseKey.includes("[")) {
return ["legacy", false, undefined];
}
var matches = licenseKey.match(/\[(.*?)\]/g).map(function (match) { return match.replace("[", "").replace("]", ""); });
if (!matches || matches.length === 0) {
return [null, null];
return ["legacy", false, undefined];
}
var isTrial = matches.filter(function (match) { return match === 'TRIAL'; }).length === 1;
var version = matches.filter(function (match) { return match.indexOf("v") === 0; }).map(function (match) { return match.replace(/^v/, ""); })[0];
return [version, isTrial];
var rawVersion = matches.filter(function (match) { return match.indexOf("v") === 0; })[0];
var version = rawVersion ? rawVersion.replace('v', '') : 'legacy';
var type = LICENSE_TYPES[matches.filter(function (match) { return LICENSE_TYPES[match]; })[0]];
return [version, isTrial, type];
};
LicenseManager.prototype.validateLicenseKeyForVersion = function (version, isTrial, license) {
if (version !== '2') {
return;
}
if (isTrial) {
this.validateForTrial(license);
}
else {
this.validateLegacyKey(license);
}
};
LicenseManager.prototype.validateLegacyKey = function (license) {
var gridReleaseDate = LicenseManager.getGridReleaseDate();
var expiry = LicenseManager.extractExpiry(license);
var valid = false;
var current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (gridReleaseDate < expiry);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
var formattedExpiryDate = LicenseManager.formatDate(expiry);
var formattedReleaseDate = LicenseManager.formatDate(gridReleaseDate);
this.outputIncompatibleVersion(formattedExpiryDate, formattedReleaseDate);
}
};
LicenseManager.prototype.validateForTrial = function (license) {
var expiry = LicenseManager.extractExpiry(license);
var now = new Date();
var valid = false;
var current = false;
if (!isNaN(expiry.getTime())) {
valid = true;
current = (expiry > now);
}
if (!valid) {
this.outputInvalidLicenseKey();
}
else if (!current) {
var formattedExpiryDate = LicenseManager.formatDate(expiry);
this.outputExpiredTrialKey(formattedExpiryDate);
}
};
LicenseManager.prototype.outputInvalidLicenseKey = function () {
LicenseManager.prototype.outputInvalidLicenseKey = function (incorrectLicenseType, licenseType) {
console.error('*****************************************************************************************************************');
console.error('***************************************** AG Grid Enterprise License ********************************************');
console.error('********************************************* Invalid License ***************************************************');
if (exists(incorrectLicenseType) && incorrectLicenseType && licenseType === 'CHARTS') {
console.error('* The license supplied is for AG Charts Enterprise Only and does not cover AG Grid Enterprise *');
}
console.error('* Your license for AG Grid Enterprise is not valid - please contact info@ag-grid.com to obtain a valid license. *');

@@ -269,3 +273,3 @@ console.error('*****************************************************************************************************************');

console.error('***************************************** Trial Period Expired. *******************************************');
console.error("* Your license for AG Grid Enterprise expired on " + formattedExpiryDate + ". *");
console.error("* Your license for AG Grid Enterprise expired on ".concat(formattedExpiryDate, ". *"));
console.error('* Please email info@ag-grid.com to purchase a license. *');

@@ -296,4 +300,4 @@ console.error('****************************************************************************************************************');

console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *");
console.error("* license end date. The license key that you have expires on " + formattedExpiryDate + ", however the version of AG Grid you *");
console.error("* are trying to use was released on " + formattedReleaseDate + ". *");
console.error("* license end date. The license key that you have expires on ".concat(formattedExpiryDate, ", however the version of AG Grid you *"));
console.error("* are trying to use was released on ".concat(formattedReleaseDate, ". *"));
console.error('* *');

@@ -306,5 +310,5 @@ console.error('* Please contact info@ag-grid.com to renew your subscription to new versions and get a new license key to work with this *');

};
LicenseManager.RELEASE_INFORMATION = 'MTY5ODkxNzc1MzgxNA==';
LicenseManager.RELEASE_INFORMATION = 'MTcwMTA3MzA3NTIwOQ==';
return LicenseManager;
}());
export { LicenseManager };

@@ -1,1 +0,1 @@

export declare const VERSION = "30.2.1";
export declare const VERSION = "31.0.0";
// DO NOT UPDATE MANUALLY: Generated from script during build time
export var VERSION = '30.2.1';
export var VERSION = '31.0.0';

@@ -8,6 +8,32 @@ import { BeanStub } from '@ag-grid-community/core';

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -14,0 +40,0 @@ isDisplayWatermark(): boolean;

@@ -14,6 +14,32 @@ export declare class LicenseManager {

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -32,5 +58,2 @@ isDisplayWatermark(): boolean;

private static extractBracketedInformation;
private validateLicenseKeyForVersion;
private validateLegacyKey;
private validateForTrial;
private outputInvalidLicenseKey;

@@ -37,0 +60,0 @@ private outputExpiredTrialKey;

@@ -1,1 +0,1 @@

export declare const VERSION = "30.2.1";
export declare const VERSION = "31.0.0";
{
"name": "@ag-grid-enterprise/core",
"version": "30.2.1",
"version": "31.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -9,3 +9,3 @@ "main": "./dist/esm/es6/main.mjs",

"scripts": {
"clean": "rimraf dist .hash",
"clean": "rimraf dist",
"build-cjs": "rimraf dist/tsconfig.cjs.es5.docs.tsbuildinfo && npx tsc -p tsconfig.cjs.es5.json && npx tsc -p tsconfig.cjs.es6.json",

@@ -51,3 +51,3 @@ "build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json",

"dependencies": {
"@ag-grid-community/core": "~30.2.1"
"@ag-grid-community/core": "~31.0.0"
},

@@ -60,3 +60,3 @@ "devDependencies": {

"ts-jest": "^29.1.0",
"typescript": "~4.3.5",
"typescript": "~4.7.4",
"rimraf": "3.0.2",

@@ -63,0 +63,0 @@ "gulp": "^4.0.2",

@@ -7,3 +7,3 @@ ![AG Grid HTML5 Grid trusted by the community, built for enterprise](./github-banner.png "AG Grid")

| --------------------|------------------:|
| @ag-grid-enterprise/core | [![npm](https://img.shields.io/npm/dm/@ag-grid-enterprise/core)](https://www.npmjs.com/package/@ag-grid-enterprise/core) <br> [![Bundle Phobia](https://badgen.net/bundlephobia/minzip/@ag-grid-enterprise/core)](https://bundlephobia.com/result?p=@ag-grid-enterprise/core) <br> [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ag-grid-enterprise&metric=alert_status)](https://sonarcloud.io/dashboard?id=ag-grid-enterprise) |
| @ag-grid-enterprise/core | [![npm](https://img.shields.io/npm/dm/@ag-grid-enterprise/core)](https://www.npmjs.com/package/@ag-grid-enterprise/core) <br> [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ag-grid-enterprise&metric=alert_status)](https://sonarcloud.io/dashboard?id=ag-grid-enterprise) |

@@ -10,0 +10,0 @@ # AG Grid Enterprise

@@ -8,6 +8,32 @@ import { BeanStub } from '@ag-grid-community/core';

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -14,0 +40,0 @@ isDisplayWatermark(): boolean;

@@ -14,6 +14,32 @@ export declare class LicenseManager {

valid: boolean;
expiry: string | null;
version: string;
missing: boolean;
incorrectLicenseType?: undefined;
licenseType?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: false;
incorrectLicenseType: boolean | undefined;
licenseType: string | undefined;
missing?: undefined;
expiry?: undefined;
expired?: undefined;
version?: undefined;
isTrial?: undefined;
trialExpired?: undefined;
} | {
licenseKey: string;
valid: true;
expiry: string;
expired: boolean | undefined;
version: string | null;
isTrial: boolean | null;
trialExpired: boolean | null;
trialExpired: undefined;
missing?: undefined;
incorrectLicenseType?: undefined;
licenseType?: undefined;
};

@@ -32,5 +58,2 @@ isDisplayWatermark(): boolean;

private static extractBracketedInformation;
private validateLicenseKeyForVersion;
private validateLegacyKey;
private validateForTrial;
private outputInvalidLicenseKey;

@@ -37,0 +60,0 @@ private outputExpiredTrialKey;

@@ -1,1 +0,1 @@

export declare const VERSION = "30.2.1";
export declare const VERSION = "31.0.0";

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc