{"version":3,"file":"common.es5.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../node_modules/rollup-plugin-node-globals/src/global.js","../../../../packages/common/src/util.ts","../../../../packages/common/src/netutil.ts","../../../../packages/common/src/adalclient.ts","../../../../packages/common/src/collections.ts","../../../../packages/common/src/libconfig.ts","../../../../packages/common/src/storage.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});\n","import { TypedHash } from \"./collections\";\n\n/**\n * Gets a callback function which will maintain context across async calls.\n * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)\n *\n * @param context The object that will be the 'this' value in the callback\n * @param method The method to which we will apply the context and parameters\n * @param params Optional, additional arguments to supply to the wrapped method when it is invoked\n */\nexport function getCtxCallback(context: any, method: Function, ...params: any[]): Function {\n return function () {\n method.apply(context, params);\n };\n}\n\nexport type DateAddInterval = \"year\" | \"quarter\" | \"month\" | \"week\" | \"day\" | \"hour\" | \"minute\" | \"second\";\n\n/**\n * Adds a value to a date\n *\n * @param date The date to which we will add units, done in local time\n * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']\n * @param units The amount to add to date of the given interval\n *\n * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object\n */\nexport function dateAdd(date: Date, interval: DateAddInterval, units: number): Date | undefined {\n let ret: Date | undefined = new Date(date); // don't change original date\n switch (interval.toLowerCase()) {\n case \"year\": ret.setFullYear(ret.getFullYear() + units); break;\n case \"quarter\": ret.setMonth(ret.getMonth() + 3 * units); break;\n case \"month\": ret.setMonth(ret.getMonth() + units); break;\n case \"week\": ret.setDate(ret.getDate() + 7 * units); break;\n case \"day\": ret.setDate(ret.getDate() + units); break;\n case \"hour\": ret.setTime(ret.getTime() + units * 3600000); break;\n case \"minute\": ret.setTime(ret.getTime() + units * 60000); break;\n case \"second\": ret.setTime(ret.getTime() + units * 1000); break;\n default: ret = undefined; break;\n }\n return ret;\n}\n\n/**\n * Combines an arbitrary set of paths ensuring and normalizes the slashes\n *\n * @param paths 0 to n path parts to combine\n */\nexport function combine(...paths: string[]): string {\n\n return paths\n .filter(path => !stringIsNullOrEmpty(path))\n .map(path => path.replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"))\n .join(\"/\")\n .replace(/\\\\/g, \"/\");\n}\n\n/**\n * Gets a random string of chars length\n * \n * https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript\n *\n * @param chars The length of the random string to generate\n */\nexport function getRandomString(chars: number): string {\n const text = new Array(chars);\n const possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < chars; i++) {\n text[i] = possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text.join(\"\");\n}\n\n/**\n * Gets a random GUID value\n *\n * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n */\n/* tslint:disable no-bitwise */\nexport function getGUID(): string {\n let d = new Date().getTime();\n const guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n}\n/* tslint:enable */\n\n/**\n * Determines if a given value is a function\n *\n * @param cf The thing to test for functionness\n */\nexport function isFunc(cf: any): boolean {\n return typeof cf === \"function\";\n}\n\n/**\n * Determines if an object is both defined and not null\n * @param obj Object to test\n */\nexport function objectDefinedNotNull(obj: any): boolean {\n return typeof obj !== \"undefined\" && obj !== null;\n}\n\n/**\n * @returns whether the provided parameter is a JavaScript Array or not.\n*/\nexport function isArray(array: any): boolean {\n\n if (Array.isArray) {\n return Array.isArray(array);\n }\n\n return array && typeof array.length === \"number\" && array.constructor === Array;\n}\n\n/**\n * Provides functionality to extend the given object by doing a shallow copy\n *\n * @param target The object to which properties will be copied\n * @param source The source object from which properties will be copied\n * @param noOverwrite If true existing properties on the target are not overwritten from the source\n * @param filter If provided allows additional filtering on what properties are copied (propName: string) => boolean\n *\n */\nexport function extend = any, S extends TypedHash = any>(target: T, source: S, noOverwrite = false,\n filter: (propName: string) => boolean = () => true): T & S {\n\n if (!objectDefinedNotNull(source)) {\n return target;\n }\n\n // ensure we don't overwrite things we don't want overwritten\n const check: (o: any, i: string) => Boolean = noOverwrite ? (o, i) => !(i in o) : () => true;\n\n // final filter we will use\n const f = (v: string) => check(target, v) && filter(v);\n\n return Object.getOwnPropertyNames(source)\n .filter(f)\n .reduce((t: any, v: string) => {\n t[v] = source[v];\n return t;\n }, target);\n}\n\n/**\n * Determines if a given url is absolute\n *\n * @param url The url to check to see if it is absolute\n */\nexport function isUrlAbsolute(url: string): boolean {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n}\n\n/**\n * Determines if a string is null or empty or undefined\n *\n * @param s The string to test\n */\nexport function stringIsNullOrEmpty(s: string): boolean {\n return s === undefined || s === null || s.length < 1;\n}\n\n/**\n * Gets an attribute value from an html/xml string block. NOTE: if the input attribute value has\n * RegEx special characters they will be escaped in the returned string\n * \n * @param html HTML to search\n * @param attrName The name of the attribute to find\n */\nexport function getAttrValueFromString(html: string, attrName: string): string | null {\n\n // make the input safe for regex\n html = html.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const reg = new RegExp(`${attrName}\\\\s*?=\\\\s*?(\"|')([^\\\\1]*?)\\\\1`, \"i\");\n const match = reg.exec(html);\n return match !== null && match.length > 0 ? match[2] : null;\n}\n\n/**\n * Ensures guid values are represented consistently as \"ea123463-137d-4ae3-89b8-cf3fc578ca05\"\n * \n * @param guid The candidate guid\n */\nexport function sanitizeGuid(guid: string): string {\n\n if (stringIsNullOrEmpty(guid)) {\n return guid;\n }\n\n const matches = /([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})/i.exec(guid);\n\n return matches === null ? guid : matches[1];\n}\n\n/**\n * Shorthand for JSON.stringify\n * \n * @param o Any type of object\n */\nexport function jsS(o: any): string {\n return JSON.stringify(o);\n}\n\n/**\n * Shorthand for Object.hasOwnProperty\n * \n * @param o Object to check for\n * @param p Name of the property\n */\nexport function hOP(o: any, p: string): boolean {\n return Object.hasOwnProperty.call(o, p);\n}\n\n/**\n * Generates a ~unique hash code\n * \n * From: https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript\n */\n// tslint:disable:no-bitwise\nexport function getHashCode(s: string): number {\n let hash = 0;\n if (s.length === 0) {\n return hash;\n }\n\n for (let i = 0; i < s.length; i++) {\n const chr = s.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n}\n// tslint:enable:no-bitwise\n","import { extend, objectDefinedNotNull } from \"./util\";\n\ndeclare var global: { fetch(url: string, options: any): Promise };\n\nexport interface ConfigOptions {\n headers?: string[][] | { [key: string]: string } | Headers;\n mode?: \"navigate\" | \"same-origin\" | \"no-cors\" | \"cors\";\n credentials?: \"omit\" | \"same-origin\" | \"include\";\n cache?: \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\" | \"only-if-cached\";\n}\n\nexport interface FetchOptions extends ConfigOptions {\n method?: string;\n body?: any;\n}\n\nexport interface HttpClientImpl {\n fetch(url: string, options: FetchOptions): Promise;\n}\n\nexport interface RequestClient {\n fetch(url: string, options?: FetchOptions): Promise;\n fetchRaw(url: string, options?: FetchOptions): Promise;\n get(url: string, options?: FetchOptions): Promise;\n post(url: string, options?: FetchOptions): Promise;\n patch(url: string, options?: FetchOptions): Promise;\n delete(url: string, options?: FetchOptions): Promise;\n}\n\nexport function mergeHeaders(target: Headers, source: any): void {\n if (source !== undefined && source !== null) {\n const temp = new Request(\"\", { headers: source });\n temp.headers.forEach((value: string, name: string) => {\n target.append(name, value);\n });\n }\n}\n\nexport function mergeOptions(target: ConfigOptions, source: ConfigOptions): void {\n\n if (objectDefinedNotNull(source)) {\n const headers = extend(target.headers || {}, source.headers!);\n target = extend(target, source);\n target.headers = headers;\n }\n}\n\n/**\n * Makes requests using the global/window fetch API\n */\nexport class FetchClient implements HttpClientImpl {\n public fetch(url: string, options: FetchOptions): Promise {\n return global.fetch(url, options);\n }\n}\n\n/**\n * Makes requests using the fetch API adding the supplied token to the Authorization header\n */\nexport class BearerTokenFetchClient extends FetchClient {\n\n constructor(private _token: string | null) {\n super();\n }\n\n public get token() {\n return this._token || \"\";\n }\n\n public set token(token: string) {\n this._token = token;\n }\n\n public fetch(url: string, options: FetchOptions = {}): Promise {\n\n const headers = new Headers();\n\n mergeHeaders(headers, options.headers);\n\n headers.set(\"Authorization\", `Bearer ${this._token}`);\n\n options.headers = headers;\n\n return super.fetch(url, options);\n }\n}\n","import { BearerTokenFetchClient, FetchOptions } from \"./netutil\";\nimport { ISPFXContext } from \"./spfxcontextinterface\";\nimport { isUrlAbsolute } from \"./util\";\n// @ts-ignore\nimport * as adal from \"adal-angular/dist/adal.min.js\";\n\n/**\n * Parses out the root of the request url to use as the resource when getting the token\n * \n * After: https://gist.github.com/jlong/2428561\n * @param url The url to parse\n */\nfunction getResource(url: string): string {\n const parser = document.createElement(\"a\");\n parser.href = url;\n return `${parser.protocol}//${parser.hostname}`;\n}\n\n/**\n * Azure AD Client for use in the browser\n */\nexport class AdalClient extends BearerTokenFetchClient {\n\n /**\n * Our auth context\n */\n private static _authContext: adal.AuthenticationContext | null = null;\n\n /**\n * Callback used by the adal auth system\n */\n private _displayCallback: ((url: string) => void) | null;\n\n /**\n * Promise used to ensure the user is logged in\n */\n private _loginPromise: Promise | null;\n\n /**\n * Creates a new instance of AdalClient\n * @param clientId Azure App Id\n * @param tenant Office 365 tenant (Ex: {tenant}.onmicrosoft.com)\n * @param redirectUri The redirect url used to authenticate the \n */\n constructor(public clientId: string, public tenant: string, public redirectUri: string) {\n super(null);\n this._displayCallback = null;\n this._loginPromise = null;\n }\n\n /**\n * Creates a new AdalClient using the values of the supplied SPFx context (requires SPFx >= 1.6)\n * \n * @param spfxContext Current SPFx context\n * @description Using this method requires that the features described in this article\n * https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient are activated in the tenant.\n */\n public static fromSPFxContext(spfxContext: ISPFXContext | any): SPFxAdalClient {\n\n return new SPFxAdalClient(spfxContext);\n }\n\n /**\n * Conducts the fetch opertation against the AAD secured resource\n * \n * @param url Absolute URL for the request\n * @param options Any fetch options passed to the underlying fetch implementation\n */\n public fetch(url: string, options: FetchOptions): Promise {\n\n if (!isUrlAbsolute(url)) {\n throw Error(\"You must supply absolute urls to AdalClient.fetch.\");\n }\n\n // the url we are calling is the resource\n return this.getToken(getResource(url)).then(token => {\n this.token = token;\n return super.fetch(url, options);\n });\n }\n\n /**\n * Gets a token based on the current user\n * \n * @param resource The resource for which we are requesting a token\n */\n public getToken(resource: string): Promise {\n\n return new Promise((resolve, reject) => {\n\n this.ensureAuthContext().then(_ => this.login()).then(_ => {\n\n AdalClient._authContext.acquireToken(resource, (message: string, token: string) => {\n\n if (message) {\n return reject(Error(message));\n }\n\n resolve(token);\n });\n\n }).catch(reject);\n });\n }\n\n /**\n * Ensures we have created and setup the adal AuthenticationContext instance\n */\n private ensureAuthContext(): Promise {\n\n return new Promise(resolve => {\n\n if (AdalClient._authContext === null) {\n AdalClient._authContext = adal.inject({\n clientId: this.clientId,\n displayCall: (url: string) => {\n if (this._displayCallback) {\n this._displayCallback(url);\n }\n },\n navigateToLoginRequestUrl: false,\n redirectUri: this.redirectUri,\n tenant: this.tenant,\n });\n }\n\n resolve();\n });\n }\n\n /**\n * Ensures the current user is logged in\n */\n private login(): Promise {\n\n if (this._loginPromise) {\n return this._loginPromise;\n }\n\n this._loginPromise = new Promise((resolve, reject) => {\n\n if (AdalClient._authContext.getCachedUser()) {\n return resolve();\n }\n\n this._displayCallback = (url: string) => {\n\n const popupWindow = window.open(url, \"login\", \"width=483, height=600\");\n\n if (!popupWindow) {\n return reject(Error(\"Could not open pop-up window for auth. Likely pop-ups are blocked by the browser.\"));\n }\n\n if (popupWindow && popupWindow.focus) {\n popupWindow.focus();\n }\n\n const pollTimer = window.setInterval(() => {\n\n if (!popupWindow || popupWindow.closed || popupWindow.closed === undefined) {\n window.clearInterval(pollTimer);\n }\n\n try {\n if (popupWindow.document.URL.indexOf(this.redirectUri) !== -1) {\n window.clearInterval(pollTimer);\n AdalClient._authContext.handleWindowCallback(popupWindow.location.hash);\n popupWindow.close();\n resolve();\n }\n } catch (e) {\n reject(e);\n }\n }, 30);\n };\n\n // this triggers the login process\n this.ensureAuthContext().then(_ => {\n (AdalClient._authContext)._loginInProgress = false;\n AdalClient._authContext.login();\n this._displayCallback = null;\n });\n });\n\n return this._loginPromise;\n }\n}\n\n/**\n * Client wrapping the aadTokenProvider available from SPFx >= 1.6\n */\nexport class SPFxAdalClient extends BearerTokenFetchClient {\n\n /**\n * \n * @param context provide the appropriate SPFx Context object\n */\n constructor(private context: ISPFXContext) {\n super(null);\n }\n\n /**\n * Executes a fetch request using the supplied url and options\n * \n * @param url Absolute url of the request\n * @param options Any options\n */\n public fetch(url: string, options: FetchOptions): Promise {\n\n return this.getToken(getResource(url)).then(token => {\n this.token = token;\n return super.fetch(url, options);\n });\n }\n\n /**\n * Gets an AAD token for the provided resource using the SPFx AADTokenProvider\n * \n * @param resource Resource for which a token is to be requested (ex: https://graph.microsoft.com)\n */\n public getToken(resource: string): Promise {\n\n return this.context.aadTokenProviderFactory.getTokenProvider().then(provider => {\n\n return provider.getToken(resource);\n });\n }\n}\n","import { isFunc } from \"./util\";\n\ndeclare var Object: {\n entries?: any;\n keys(o: any): any;\n};\n\n/**\n * Interface defining an object with a known property type\n */\nexport interface TypedHash {\n [key: string]: T;\n}\n\n/**\n * Used to calculate the object properties, with polyfill if needed\n */\nconst objectEntries: any = isFunc(Object.entries) ? Object.entries : (o: any): [any, any][] => Object.keys(o).map((k: any) => [k, o[k]]);\n\n/**\n * Converts the supplied object to a map\n * \n * @param o The object to map\n */\nexport function objectToMap(o: any): Map {\n if (o !== undefined && o !== null) {\n return new Map(objectEntries(o));\n }\n return new Map();\n}\n\n/**\n * Merges to Map instances together, overwriting values in target with matching keys, last in wins\n * \n * @param target map into which the other maps are merged\n * @param maps One or more maps to merge into the target \n */\nexport function mergeMaps(target: Map, ...maps: Map[]): Map {\n for (let i = 0; i < maps.length; i++) {\n maps[i].forEach((v: V, k: K) => {\n target.set(k, v);\n });\n }\n\n return target;\n}\n","import { TypedHash, mergeMaps, objectToMap } from \"./collections\";\nimport { ISPFXContext } from \"./spfxcontextinterface\";\n\nexport interface LibraryConfiguration {\n\n /**\n * Allows caching to be global disabled, default: false\n */\n globalCacheDisable?: boolean;\n\n /**\n * Defines the default store used by the usingCaching method, default: session\n */\n defaultCachingStore?: \"session\" | \"local\";\n\n /**\n * Defines the default timeout in seconds used by the usingCaching method, default 30\n */\n defaultCachingTimeoutSeconds?: number;\n\n /**\n * If true a timeout expired items will be removed from the cache in intervals determined by cacheTimeoutInterval\n */\n enableCacheExpiration?: boolean;\n\n /**\n * Determines the interval in milliseconds at which the cache is checked to see if items have expired (min: 100)\n */\n cacheExpirationIntervalMilliseconds?: number;\n\n /**\n * Used to supply the current context from an SPFx webpart to the library\n */\n spfxContext?: any;\n}\n\nexport function setup(config: LibraryConfiguration): void {\n RuntimeConfig.extend(config);\n}\n\n// lable mapping for known config values\nconst s = [\n \"defaultCachingStore\",\n \"defaultCachingTimeoutSeconds\",\n \"globalCacheDisable\",\n \"enableCacheExpiration\",\n \"cacheExpirationIntervalMilliseconds\",\n \"spfxContext\",\n];\n\nexport class RuntimeConfigImpl {\n\n constructor(private _v = new Map()) {\n\n // setup defaults\n this._v.set(s[0], \"session\");\n this._v.set(s[1], 60);\n this._v.set(s[2], false);\n this._v.set(s[3], false);\n this._v.set(s[4], 750);\n this._v.set(s[5], null);\n }\n\n /**\n * \n * @param config The set of properties to add to the globa configuration instance\n */\n public extend(config: TypedHash): void {\n this._v = mergeMaps(this._v, objectToMap(config));\n }\n\n public get(key: string): any {\n return this._v.get(key);\n }\n\n public get defaultCachingStore(): \"session\" | \"local\" {\n return this.get(s[0]);\n }\n\n public get defaultCachingTimeoutSeconds(): number {\n return this.get(s[1]);\n }\n\n public get globalCacheDisable(): boolean {\n return this.get(s[2]);\n }\n\n public get enableCacheExpiration(): boolean {\n return this.get(s[3]);\n }\n\n public get cacheExpirationIntervalMilliseconds(): number {\n return this.get(s[4]);\n }\n\n public get spfxContext(): ISPFXContext {\n return this.get(s[5]);\n }\n}\n\nconst _runtimeConfig = new RuntimeConfigImpl();\n\nexport let RuntimeConfig = _runtimeConfig;\n","import { dateAdd, getCtxCallback, jsS, objectDefinedNotNull } from \"./util\";\nimport { RuntimeConfig } from \"./libconfig\";\n\n/**\n * A wrapper class to provide a consistent interface to browser based storage\n *\n */\nexport class PnPClientStorageWrapper implements PnPClientStore {\n\n /**\n * True if the wrapped storage is available; otherwise, false\n */\n public enabled: boolean;\n\n /**\n * Creates a new instance of the PnPClientStorageWrapper class\n *\n * @constructor\n */\n constructor(private store: Storage, public defaultTimeoutMinutes = -1) {\n this.enabled = this.test();\n // if the cache timeout is enabled call the handler\n // this will clear any expired items and set the timeout function\n if (RuntimeConfig.enableCacheExpiration) {\n this.cacheExpirationHandler();\n }\n }\n\n /**\n * Get a value from storage, or null if that value does not exist\n *\n * @param key The key whose value we want to retrieve\n */\n public get(key: string): T | null {\n\n if (!this.enabled) {\n return null;\n }\n\n const o = this.store.getItem(key);\n\n if (!objectDefinedNotNull(o)) {\n return null;\n }\n\n const persistable = JSON.parse(o!);\n\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n\n } else {\n\n return persistable.value as T;\n }\n }\n\n /**\n * Adds a value to the underlying storage\n *\n * @param key The key to use when storing the provided value\n * @param o The value to store\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n public put(key: string, o: any, expire?: Date): void {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n }\n\n /**\n * Deletes a value from the underlying storage\n *\n * @param key The key of the pair we want to remove from storage\n */\n public delete(key: string): void {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n }\n\n /**\n * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function\n *\n * @param key The key to use when storing the provided value\n * @param getter A function which will upon execution provide the desired value\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n public getOrPut(key: string, getter: () => Promise, expire?: Date): Promise {\n if (!this.enabled) {\n return getter();\n }\n\n return new Promise((resolve) => {\n\n const o = this.get(key);\n\n if (o == null) {\n getter().then((d) => {\n this.put(key, d, expire);\n resolve(d);\n });\n } else {\n resolve(o);\n }\n });\n }\n\n /**\n * Deletes any expired items placed in the store by the pnp library, leaves other items untouched\n */\n public deleteExpired(): Promise {\n\n return new Promise((resolve, reject) => {\n\n if (!this.enabled) {\n resolve();\n }\n\n try {\n\n for (let i = 0; i < this.store.length; i++) {\n const key = this.store.key(i);\n if (key !== null) {\n // test the stored item to see if we stored it\n if (/[\"|']?pnp[\"|']? ?: ?1/i.test(this.store.getItem(key))) {\n // get those items as get will delete from cache if they are expired\n this.get(key);\n }\n }\n }\n\n resolve();\n\n } catch (e) { reject(e); }\n });\n }\n\n /**\n * Used to determine if the wrapped storage is available currently\n */\n private test(): boolean {\n const str = \"t\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Creates the persistable to store\n */\n private createPersistable(o: any, expire?: Date): string {\n if (expire === undefined) {\n\n // ensure we are by default inline with the global library setting\n let defaultTimeout = RuntimeConfig.defaultCachingTimeoutSeconds;\n if (this.defaultTimeoutMinutes > 0) {\n defaultTimeout = this.defaultTimeoutMinutes * 60;\n }\n expire = dateAdd(new Date(), \"second\", defaultTimeout);\n }\n\n return jsS({ pnp: 1, expiration: expire, value: o });\n }\n\n /**\n * Deletes expired items added by this library in this.store and sets a timeout to call itself\n */\n private cacheExpirationHandler(): void {\n this.deleteExpired().then(_ => {\n\n // call ourself in the future\n setTimeout(getCtxCallback(this, this.cacheExpirationHandler), RuntimeConfig.cacheExpirationIntervalMilliseconds);\n }).catch(e => {\n console.error(e);\n });\n }\n}\n\n/**\n * Interface which defines the operations provided by a client storage object\n */\nexport interface PnPClientStore {\n /**\n * True if the wrapped storage is available; otherwise, false\n */\n enabled: boolean;\n\n /**\n * Get a value from storage, or null if that value does not exist\n *\n * @param key The key whose value we want to retrieve\n */\n get(key: string): any;\n\n /**\n * Adds a value to the underlying storage\n *\n * @param key The key to use when storing the provided value\n * @param o The value to store\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n put(key: string, o: any, expire?: Date): void;\n\n /**\n * Deletes a value from the underlying storage\n *\n * @param key The key of the pair we want to remove from storage\n */\n delete(key: string): void;\n\n /**\n * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function\n *\n * @param key The key to use when storing the provided value\n * @param getter A function which will upon execution provide the desired value\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n getOrPut(key: string, getter: () => Promise, expire?: Date): Promise;\n\n /**\n * Removes any expired items placed in the store by the pnp library, leaves other items untouched\n */\n deleteExpired(): Promise;\n}\n\n/**\n * A thin implementation of in-memory storage for use in nodejs\n */\nclass MemoryStorage {\n\n constructor(private _store = new Map()) { }\n\n public get length(): number {\n return this._store.size;\n }\n\n public clear(): void {\n this._store.clear();\n }\n\n public getItem(key: string): any {\n return this._store.get(key);\n }\n\n public key(index: number): string {\n return Array.from(this._store)[index][0];\n }\n\n public removeItem(key: string): void {\n this._store.delete(key);\n }\n\n public setItem(key: string, data: string): void {\n this._store.set(key, data);\n }\n\n [key: string]: any;\n [index: number]: string;\n}\n\n/**\n * A class that will establish wrappers for both local and session storage\n */\nexport class PnPClientStorage {\n\n /**\n * Creates a new instance of the PnPClientStorage class\n *\n * @constructor\n */\n constructor(private _local: PnPClientStore | null = null, private _session: PnPClientStore | null = null) { }\n\n /**\n * Provides access to the local storage of the browser\n */\n public get local(): PnPClientStore {\n\n if (this._local === null) {\n this._local = this.getStore(\"local\");\n }\n\n return this._local;\n }\n\n /**\n * Provides access to the session storage of the browser\n */\n public get session(): PnPClientStore {\n\n if (this._session === null) {\n this._session = this.getStore(\"session\");\n }\n\n return this._session;\n }\n\n private getStore(name: string): PnPClientStorageWrapper {\n\n if (name === \"local\") {\n return new PnPClientStorageWrapper(typeof(localStorage) === \"undefined\" ? new MemoryStorage() : localStorage);\n }\n\n return new PnPClientStorageWrapper(typeof(sessionStorage) === \"undefined\" ? new MemoryStorage() : sessionStorage);\n }\n}\n"],"names":["global","tslib_1.__extends","adal.inject"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IAC/B,aAAa,GAAG,MAAM,CAAC,cAAc;SAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,OAAO,aAAa,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