` which is always rendered, and ensure that the MessageBar is\n * rendered either conditionally or with a delay.\n * @default true\n */\n delayedRender?: boolean;\n}\n\n/**\n * {@docCategory MessageBar}\n */\nexport interface IMessageBarStyleProps {\n /**\n * Theme (provided through customization).\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es).\n */\n className?: string;\n\n /**\n * Type of the MessageBar.\n */\n messageBarType?: MessageBarType;\n\n /**\n * Whether the MessageBar contains a dismiss button.\n */\n onDismiss?: boolean;\n\n /**\n * Whether the text is truncated.\n */\n truncated?: boolean;\n\n /**\n * Whether the MessageBar is rendered in multi line (as opposed to single line) mode.\n */\n isMultiline?: boolean;\n\n /**\n * Whether the single line MessageBar is being expanded.\n */\n expandSingleLine?: boolean;\n\n /**\n * Whether the MessageBar contains any action elements.\n */\n actions?: boolean;\n}\n\n/**\n * {@docCategory MessageBar}\n */\nexport interface IMessageBarStyles {\n /**\n * Style set for the root element.\n */\n root?: IStyle;\n\n /**\n * Style set for the element containing the icon, text, and optional dismiss button.\n */\n content?: IStyle;\n\n /**\n * Style set for the element containing the icon.\n */\n iconContainer?: IStyle;\n\n /**\n * Style set for the icon.\n */\n icon?: IStyle;\n\n /**\n * Style set for the element containing the text.\n */\n text?: IStyle;\n\n /**\n * Style set for the text.\n */\n innerText?: IStyle;\n\n /**\n * Style set for the optional dismiss button.\n */\n dismissal?: IStyle;\n\n /**\n * Style set for the icon used to expand and collapse the MessageBar.\n */\n expand?: IStyle;\n\n /**\n * Style set for the element containing the dismiss button.\n */\n dismissSingleLine?: IStyle;\n\n /**\n * Style set for the element containing the expand icon.\n */\n expandSingleLine?: IStyle;\n\n /**\n * Style set for the optional element containing the action elements.\n */\n actions?: IStyle;\n}\n\n/**\n * {@docCategory MessageBar}\n */\nexport enum MessageBarType {\n /** Info styled MessageBar */\n info = 0,\n /** Error styled MessageBar */\n error = 1,\n /** Blocked styled MessageBar */\n blocked = 2,\n /** SevereWarning styled MessageBar */\n severeWarning = 3,\n /** Success styled MessageBar */\n success = 4,\n /** Warning styled MessageBar */\n warning = 5,\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"../utils/Constants\";\n\n/**\n * AuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const AuthErrorMessage = {\n unexpectedError: {\n code: \"unexpected_error\",\n desc: \"Unexpected error in authentication.\"\n }\n};\n\n/**\n * General error class thrown by the MSAL.js library.\n */\nexport class AuthError extends Error {\n\n /**\n * Short string denoting error\n */\n errorCode: string;\n\n /**\n * Detailed description of error\n */\n errorMessage: string;\n\n /**\n * Describes the subclass of an error\n */\n subError: string;\n\n /**\n * CorrelationId associated with the error\n */\n correlationId: string;\n\n constructor(errorCode?: string, errorMessage?: string, suberror?: string) {\n const errorString = errorMessage ? `${errorCode}: ${errorMessage}` : errorCode;\n super(errorString);\n Object.setPrototypeOf(this, AuthError.prototype);\n\n this.errorCode = errorCode || Constants.EMPTY_STRING;\n this.errorMessage = errorMessage || \"\";\n this.subError = suberror || \"\";\n this.name = \"AuthError\";\n }\n\n setCorrelationId(correlationId: string): void {\n this.correlationId = correlationId;\n }\n\n /**\n * Creates an error that is thrown when something unexpected happens in the library.\n * @param errDesc\n */\n static createUnexpectedError(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Constants } from \"./constants\";\nimport { HttpOperationResponse } from \"../httpOperationResponse\";\nimport { RestError } from \"../restError\";\nimport { WebResourceLike } from \"../webResource\";\nimport { XML_ATTRKEY } from \"./serializer.common\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nconst validUuidRegex =\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;\n\n/**\n * A constant that indicates whether the environment is node.js or browser based.\n */\nexport const isNode =\n typeof process !== \"undefined\" &&\n !!process.version &&\n !!process.versions &&\n !!process.versions.node;\n\n/**\n * Checks if a parsed URL is HTTPS\n *\n * @param urlToCheck - The url to check\n * @returns True if the URL is HTTPS; false otherwise.\n */\nexport function urlIsHTTPS(urlToCheck: { protocol: string }): boolean {\n return urlToCheck.protocol.toLowerCase() === Constants.HTTPS;\n}\n\n/**\n * Encodes an URI.\n *\n * @param uri - The URI to be encoded.\n * @returns The encoded URI.\n */\nexport function encodeUri(uri: string): string {\n return encodeURIComponent(uri)\n .replace(/!/g, \"%21\")\n .replace(/\"/g, \"%27\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\*/g, \"%2A\");\n}\n\n/**\n * Returns a stripped version of the Http Response which only contains body,\n * headers and the status.\n *\n * @param response - The Http Response\n * @returns The stripped version of Http Response.\n */\nexport function stripResponse(response: HttpOperationResponse): any {\n const strippedResponse: any = {};\n strippedResponse.body = response.bodyAsText;\n strippedResponse.headers = response.headers;\n strippedResponse.status = response.status;\n return strippedResponse;\n}\n\n/**\n * Returns a stripped version of the Http Request that does not contain the\n * Authorization header.\n *\n * @param request - The Http Request object\n * @returns The stripped version of Http Request.\n */\nexport function stripRequest(request: WebResourceLike): WebResourceLike {\n const strippedRequest = request.clone();\n if (strippedRequest.headers) {\n strippedRequest.headers.remove(\"authorization\");\n }\n return strippedRequest;\n}\n\n/**\n * Validates the given uuid as a string\n *\n * @param uuid - The uuid as a string that needs to be validated\n * @returns True if the uuid is valid; false otherwise.\n */\nexport function isValidUuid(uuid: string): boolean {\n return validUuidRegex.test(uuid);\n}\n\n/**\n * Generated UUID\n *\n * @returns RFC4122 v4 UUID.\n */\nexport function generateUuid(): string {\n return uuidv4();\n}\n\n/**\n * Executes an array of promises sequentially. Inspiration of this method is here:\n * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises!\n *\n * @param promiseFactories - An array of promise factories(A function that return a promise)\n * @param kickstart - Input to the first promise that is used to kickstart the promise chain.\n * If not provided then the promise chain starts with undefined.\n * @returns A chain of resolved or rejected promises\n */\nexport function executePromisesSequentially(\n promiseFactories: Array
,\n kickstart: unknown\n): Promise {\n let result = Promise.resolve(kickstart);\n promiseFactories.forEach((promiseFactory) => {\n result = result.then(promiseFactory);\n });\n return result;\n}\n\n/**\n * Service callback that is returned for REST requests initiated by the service client.\n */\nexport interface ServiceCallback {\n /**\n * A method that will be invoked as a callback to a service function.\n * @param err - The error occurred if any, while executing the request; otherwise null.\n * @param result - The deserialized response body if an error did not occur.\n * @param request - The raw/actual request sent to the server if an error did not occur.\n * @param response - The raw/actual response from the server if an error did not occur.\n */\n (\n err: Error | RestError | null,\n result?: TResult,\n request?: WebResourceLike,\n response?: HttpOperationResponse\n ): void;\n}\n\n/**\n * Converts a Promise to a callback.\n * @param promise - The Promise to be converted to a callback\n * @returns A function that takes the callback `(cb: Function) => void`\n * @deprecated generated code should instead depend on responseToBody\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function promiseToCallback(promise: Promise): (cb: Function) => void {\n if (typeof promise.then !== \"function\") {\n throw new Error(\"The provided input is not a Promise.\");\n }\n // eslint-disable-next-line @typescript-eslint/ban-types\n return (cb: Function): void => {\n promise\n .then((data: any) => {\n // eslint-disable-next-line promise/no-callback-in-promise\n return cb(undefined, data);\n })\n .catch((err: Error) => {\n // eslint-disable-next-line promise/no-callback-in-promise\n cb(err);\n });\n };\n}\n\n/**\n * Converts a Promise to a service callback.\n * @param promise - The Promise of HttpOperationResponse to be converted to a service callback\n * @returns A function that takes the service callback (cb: ServiceCallback): void\n */\nexport function promiseToServiceCallback(\n promise: Promise\n): (cb: ServiceCallback) => void {\n if (typeof promise.then !== \"function\") {\n throw new Error(\"The provided input is not a Promise.\");\n }\n return (cb: ServiceCallback): void => {\n promise\n .then((data: HttpOperationResponse) => {\n return process.nextTick(cb, undefined, data.parsedBody as T, data.request, data);\n })\n .catch((err: Error) => {\n process.nextTick(cb, err);\n });\n };\n}\n\nexport function prepareXMLRootList(\n obj: unknown,\n elementName: string,\n xmlNamespaceKey?: string,\n xmlNamespace?: string\n): { [s: string]: any } {\n if (!Array.isArray(obj)) {\n obj = [obj];\n }\n\n if (!xmlNamespaceKey || !xmlNamespace) {\n return { [elementName]: obj };\n }\n\n const result = { [elementName]: obj };\n result[XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace };\n return result;\n}\n\n/**\n * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor\n * @param targetCtor - The target object on which the properties need to be applied.\n * @param sourceCtors - An array of source objects from which the properties need to be taken.\n */\nexport function applyMixins(targetCtorParam: unknown, sourceCtors: any[]): void {\n const castTargetCtorParam = targetCtorParam as {\n prototype: Record;\n };\n sourceCtors.forEach((sourceCtor) => {\n Object.getOwnPropertyNames(sourceCtor.prototype).forEach((name) => {\n castTargetCtorParam.prototype[name] = sourceCtor.prototype[name];\n });\n });\n}\n\nconst validateISODuration =\n /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n/**\n * Indicates whether the given string is in ISO 8601 format.\n * @param value - The value to be validated for ISO 8601 duration format.\n * @returns `true` if valid, `false` otherwise.\n */\nexport function isDuration(value: string): boolean {\n return validateISODuration.test(value);\n}\n\n/**\n * Replace all of the instances of searchValue in value with the provided replaceValue.\n * @param value - The value to search and replace in.\n * @param searchValue - The value to search for in the value argument.\n * @param replaceValue - The value to replace searchValue with in the value argument.\n * @returns The value where each instance of searchValue was replaced with replacedValue.\n */\nexport function replaceAll(\n value: string | undefined,\n searchValue: string,\n replaceValue: string\n): string | undefined {\n return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || \"\");\n}\n\n/**\n * Determines whether the given entity is a basic/primitive type\n * (string, number, boolean, null, undefined).\n * @param value - Any entity\n * @returns true is it is primitive type, false otherwise.\n */\nexport function isPrimitiveType(value: unknown): boolean {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}\n\nexport function getEnvironmentValue(name: string): string | undefined {\n if (process.env[name]) {\n return process.env[name];\n } else if (process.env[name.toLowerCase()]) {\n return process.env[name.toLowerCase()];\n }\n return undefined;\n}\n\n/**\n * @internal\n */\nexport type UnknownObject = { [s: string]: unknown };\n\n/**\n * @internal\n * @returns true when input is an object type that is not null, Array, RegExp, or Date.\n */\nexport function isObject(input: unknown): input is UnknownObject {\n return (\n typeof input === \"object\" &&\n input !== null &&\n !Array.isArray(input) &&\n !(input instanceof RegExp) &&\n !(input instanceof Date)\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestOptionsBase, TransferProgressEvent } from \"./webResource\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { HttpOperationResponse } from \"./httpOperationResponse\";\nimport { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n}\n\n/**\n * Options that allow configuring the handling of HTTP requests made by an SDK operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that will be applied before the request is sent.\n */\n customHeaders?: { [key: string]: string };\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Whether or not the HttpOperationResponse should be deserialized. If this is undefined, then the\n * HttpOperationResponse should be deserialized.\n */\n shouldDeserialize?: boolean | ((response: HttpOperationResponse) => boolean);\n}\n\n/**\n * Converts an OperationOptions to a RequestOptionsBase\n *\n * @param opts - OperationOptions object to convert to RequestOptionsBase\n */\nexport function operationOptionsToRequestOptionsBase(\n opts: T\n): RequestOptionsBase {\n const { requestOptions, tracingOptions, ...additionalOptions } = opts;\n\n let result: RequestOptionsBase = additionalOptions;\n\n if (requestOptions) {\n result = { ...result, ...requestOptions };\n }\n\n if (tracingOptions) {\n result.tracingContext = tracingOptions.tracingContext;\n // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.\n result.spanOptions = (tracingOptions as any)?.spanOptions;\n }\n\n return result;\n}\n","import * as React from 'react';\nimport { DetailsListBase } from './DetailsList.base';\nimport { SelectionMode } from '../../Selection';\nimport { ScrollToMode } from '../../List';\nimport type { ISelection, ISelectionZoneProps } from '../../Selection';\nimport type { IRefObject, IBaseProps, IRenderFunction, IStyleFunctionOrObject, IComponentAs } from '../../Utilities';\nimport type { IDragDropEvents, IDragDropContext, IDragDropHelper, IDragDropOptions } from '../../DragDrop';\nimport type { IGroup, IGroupRenderProps, IGroupDividerProps, IGroupedListProps } from '../GroupedList/index';\nimport type { IDetailsRowProps, IDetailsRowBaseProps } from '../DetailsList/DetailsRow';\nimport type { IDetailsHeaderProps, IDetailsHeaderBaseProps } from './DetailsHeader';\nimport type { IDetailsFooterProps, IDetailsFooterBaseProps } from './DetailsFooter.types';\nimport type { IWithViewportProps, IViewport } from '../../utilities/decorators/withViewport';\nimport type { IList, IListProps } from '../../List';\nimport type { ITheme, IStyle } from '../../Styling';\nimport type { ICellStyleProps, IDetailsItemProps } from './DetailsRow.types';\nimport type { IDetailsCheckboxProps } from './DetailsRowCheck.types';\nimport type {\n IDetailsColumnStyleProps,\n IDetailsColumnProps,\n IDetailsColumnStyles,\n IDetailsColumnFilterIconProps,\n IDetailsColumnFieldProps,\n} from './DetailsColumn.types';\nimport { IFocusZoneProps } from '../../FocusZone';\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsList extends IList {\n /**\n * Ensures that the list content is updated. Call this in cases where the list prop updates don't change, but the list\n * still needs to be re-evaluated. For example, if a sizer bar is adjusted and causes the list width to change,\n * you can call this to force a re-evaluation. Be aware that this can be an expensive operation and should be\n * done sparingly.\n */\n forceUpdate: () => void;\n\n /**\n * Scroll to and focus the item at the given index. focusIndex will call scrollToIndex on the specified index.\n *\n * @param index - Index of item to scroll to\n * @param forceIntoFirstElement - If true, focus will be set to the first focusable child element of the item rather\n * than the item itself.\n * @param measureItem - Optional callback to measure the height of an individual item\n * @param scrollToMode - Optional setting to determine where in the window the item should be scrolled to\n * when focused.\n */\n focusIndex: (\n index: number,\n forceIntoFirstElement?: boolean,\n measureItem?: (itemIndex: number) => number,\n scrollToMode?: ScrollToMode,\n ) => void;\n\n /**\n * Get the start index of the page that is currently in view\n */\n getStartItemIndexInView: () => number;\n\n /**\n * Use to programatically resize and/or reorder columns in the DetailsList.\n * @param column - column to resize/reorder.\n * @param options - includes width which is desired width in pixels the column should be resized\n * to and newColumnIndex which is desired index position where the column should be moved to.\n */\n updateColumn: (column: IColumn, options: { width?: number; newColumnIndex?: number }) => void;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsListProps extends IBaseProps, IWithViewportProps {\n /** Theme provided by a higher-order component. */\n theme?: ITheme;\n\n /** Custom overrides to the themed or default styles. */\n styles?: IStyleFunctionOrObject;\n\n /**\n * Callback to access the IDetailsList interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject;\n\n /** A key that uniquely identifies the given items. If provided, the selection will be reset when the key changes. */\n setKey?: string;\n\n /** The items to render. */\n items: any[];\n\n /** Set this to true to indicate that the items being displayed are placeholder data. */\n isPlaceholderData?: boolean;\n\n /** Properties to pass through to the List components being rendered. */\n listProps?: IListProps;\n\n /** Default index to set focus to once the items have rendered and the index exists. */\n initialFocusedIndex?: number;\n\n /** Class name to add to the root element. */\n className?: string;\n\n /** Grouping instructions. */\n groups?: IGroup[];\n\n /** Override properties to render groups. */\n groupProps?: IDetailsGroupRenderProps;\n\n /** Override for the indent width used for group nesting. */\n indentWidth?: number;\n\n /** Selection model to track selection state. */\n selection?: ISelection;\n\n /** Controls how/if the details list manages selection. Options include none, single, multiple */\n selectionMode?: SelectionMode;\n\n /**\n * By default, selection is cleared when clicking on an empty (non-focusable) section of the screen.\n * Setting this value to true overrides that behavior and maintains selection.\n * @defaultvalue false\n **/\n selectionPreservedOnEmptyClick?: boolean;\n\n /**\n * Additional props to pass through to the SelectionZone created by default.\n */\n selectionZoneProps?: Partial;\n\n /** Controls how the columns are adjusted. */\n layoutMode?: DetailsListLayoutMode;\n\n /**\n * Controls the visibility of selection check box.\n * @defaultvalue CheckboxVisibility.onHover\n */\n checkboxVisibility?: CheckboxVisibility;\n\n /**\n * Controls the visibility of the header.\n * @defaultvalue true\n */\n isHeaderVisible?: boolean;\n\n /** Column definitions. If none are provided, default columns will be created based on the items' properties. */\n columns?: IColumn[];\n\n /** Controls how the list constrains overflow. */\n constrainMode?: ConstrainMode;\n\n /** Event names and corresponding callbacks that will be registered to rendered row elements. */\n rowElementEventMap?: { eventName: string; callback: (context: IDragDropContext, event?: any) => void }[];\n\n /** Callback for when the list has been updated. Useful for telemetry tracking externally. */\n onDidUpdate?: (detailsList?: DetailsListBase) => void;\n\n /**\n * Callback for when a given row has been mounted. Useful for identifying when a row has been rendered on the page.\n */\n onRowDidMount?: (item?: any, index?: number) => void;\n\n /**\n * Callback for when a given row has been unmounted.\n * Useful for identifying when a row has been removed from the page.\n */\n onRowWillUnmount?: (item?: any, index?: number) => void;\n\n /** Callback for when the user clicks on the column header. */\n onColumnHeaderClick?: (ev?: React.MouseEvent, column?: IColumn) => void;\n\n /** Callback for when the user asks for a contextual menu (usually via right click) from a column header. */\n onColumnHeaderContextMenu?: (column?: IColumn, ev?: React.MouseEvent) => void;\n\n /** Callback fired on column resize */\n onColumnResize?: (column?: IColumn, newWidth?: number, columnIndex?: number) => void;\n\n /** Callback for when a given row has been invoked (by pressing enter while it is selected.) */\n onItemInvoked?: (item?: any, index?: number, ev?: Event) => void;\n\n /**\n * Callback for when the context menu of an item has been accessed.\n * If undefined or false is returned, `ev.preventDefault()` will be called.\n */\n onItemContextMenu?: (item?: any, index?: number, ev?: Event) => void | boolean;\n\n /**\n * Callback to override the default row rendering.\n */\n onRenderRow?: IRenderFunction;\n\n /**\n * If provided, will be the \"default\" item column renderer method.\n * This affects cells within the rows, not the rows themselves.\n * If a column definition provides its own `onRender` method, that will be used instead of this.\n */\n onRenderItemColumn?: (item?: any, index?: number, column?: IColumn) => React.ReactNode;\n\n /**\n * Render function which is composed around rendering every cell.\n */\n onRenderField?: IRenderFunction;\n\n /**\n * If provided, will be the \"default\" item column cell value return.\n * A column's `getValueKey` can override `getCellValueKey`.\n */\n getCellValueKey?: (item?: any, index?: number, column?: IColumn) => string;\n\n /** Map of callback functions related to row drag and drop functionality. */\n dragDropEvents?: IDragDropEvents;\n\n /** Callback for what to render when the item is missing. */\n onRenderMissingItem?: (index?: number, rowProps?: IDetailsRowProps) => React.ReactNode;\n\n /** An override to render the details header. */\n onRenderDetailsHeader?: IRenderFunction;\n\n /** An override to render the details footer. */\n onRenderDetailsFooter?: IRenderFunction;\n\n /** If provided, can be used to render a custom checkbox. */\n onRenderCheckbox?: IRenderFunction;\n\n /** Viewport info, provided by the `withViewport` decorator. */\n viewport?: IViewport;\n\n /**\n * Callback for when an item in the list becomes active by clicking anywhere inside the row or navigating to it\n * with the keyboard.\n */\n onActiveItemChanged?: (item?: any, index?: number, ev?: React.FocusEvent) => void;\n\n /** Accessible label for the list header. */\n ariaLabelForListHeader?: string;\n\n /** Accessible label for the select all checkbox. */\n ariaLabelForSelectAllCheckbox?: string;\n\n /** Accessible label for the name of the selection column. */\n ariaLabelForSelectionColumn?: string;\n\n /** Callback to get the aria-label string for a given item. */\n getRowAriaLabel?: (item: any) => string;\n\n /** Callback to get the aria-describedby IDs (space-separated strings) of elements that describe the item. */\n getRowAriaDescribedBy?: (item: any) => string;\n\n /**\n * Callback to get the item key, to be used in the selection and on render.\n * Must be provided if sorting or filtering is enabled.\n */\n getKey?: (item: any, index?: number) => string;\n\n /**\n * Accessible label describing or summarizing the list.\n * @deprecated use `ariaLabelForGrid`\n */\n ariaLabel?: string;\n\n /** Accessible label for the row check button, e.g. \"select row\". */\n checkButtonAriaLabel?: string;\n\n /** Accessible label for the group header check button, e.g. \"select section\". */\n checkButtonGroupAriaLabel?: string;\n\n /** Accessible label for the grid within the list. */\n ariaLabelForGrid?: string;\n\n /** An optional margin for proportional columns, to e.g. account for scrollbars when laying out width. */\n flexMargin?: number;\n\n /**\n * Whether the role `application` should be applied to the list.\n * @defaultvalue false\n * @deprecated using the application role in this case is an antipattern, and heavily discouraged.\n */\n shouldApplyApplicationRole?: boolean;\n\n /**\n * The minimum mouse move distance to interpret the action as drag event.\n * @defaultvalue 5\n */\n minimumPixelsForDrag?: number;\n\n /**\n * Whether to render in compact mode.\n * @defaultvalue false\n */\n compact?: boolean;\n\n /**\n * Whether to enable render page caching. This is an experimental performance optimization that is off by default.\n * @defaultvalue false\n */\n usePageCache?: boolean;\n\n /**\n * Callback to determine whether the list should be rendered in full, or virtualized.\n *\n * Virtualization will add and remove pages of items as the user scrolls them into the visible range.\n * This benefits larger list scenarios by reducing the DOM on the screen, but can negatively affect performance\n * for smaller lists.\n *\n * The default implementation will virtualize when this callback is not provided.\n */\n onShouldVirtualize?: (props: IListProps) => boolean;\n\n /** Class name to add to the cell of a checkbox. */\n checkboxCellClassName?: string;\n\n /** Whether the selection zone should enter modal state on touch. */\n enterModalSelectionOnTouch?: boolean;\n\n /** Options for column reordering using drag and drop. */\n columnReorderOptions?: IColumnReorderOptions;\n\n /** Callback to override default group height calculation used by list virtualization. */\n getGroupHeight?: IGroupedListProps['getGroupHeight'];\n\n /**\n * Whether to re-render a row only when props changed. Might cause regression when depending on external updates.\n * @defaultvalue false\n */\n useReducedRowRenderer?: boolean;\n\n /**\n * Props impacting the render style of cells. Since these have an impact on calculated column widths, they are\n * handled separately from normal theme styling, but they are passed to the styling system.\n */\n cellStyleProps?: ICellStyleProps;\n\n /** Whether to disable the built-in SelectionZone, so the host component can provide its own. */\n disableSelectionZone?: boolean;\n\n /**\n * Determines if an item is selected on focus.\n *\n * @defaultvalue true\n */\n isSelectedOnFocus?: boolean;\n\n /** Whether to animate updates */\n enableUpdateAnimations?: boolean;\n\n /**\n * Whether to use fast icon and check components. The icons can't be targeted by customization\n * but are still customizable via class names.\n * @defaultvalue true\n */\n useFastIcons?: boolean;\n\n /** Role for the list. */\n role?: string;\n\n /**\n * Properties to pass through to the FocusZone.\n */\n focusZoneProps?: IFocusZoneProps;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IColumn {\n /** A unique key for identifying the column. */\n key: string;\n\n /** Name to render on the column header. */\n name: string;\n\n /**\n * The field to pull the text value from for the column.\n * Can be unset if a custom `onRender` method is provided.\n */\n fieldName?: string;\n\n /**\n * If specified, the width of the column is a portion of the available space equal to this value divided by the sum\n * of all proportional column widths in the list. For example, if there is a list with two proportional columns that\n * have widths of 1 and 3, they will respectively occupy (1/4) = 25% and (3/4) = 75% of the remaining space. Note that\n * this relies on viewport measures and will not work well with skipViewportMeasures.\n */\n flexGrow?: number;\n\n /** Class name to apply to the column cell within each row. */\n className?: string;\n\n /** Custom overrides to the themed or default styles. */\n styles?: IStyleFunctionOrObject;\n\n /** Minimum width for the column. */\n minWidth: number;\n\n /**\n * If specified, the width of the column is a portion of the available space equal to this value divided by the sum\n * of all proportional column widths in the list. For example, if there is a list with two proportional columns that\n * have widths of 1 and 3, they will respectively occupy (1/4) = 25% and (2/4) = 75% of the remaining space. Note that\n * this relies on viewport measures and will not work well with skipViewportMeasures.\n */\n targetWidthProportion?: number;\n\n /**\n * Accessible label for the column. The column name will still be used as the primary label,\n * but this text (if specified) will be used as the column description.\n * WARNING: grid column descriptions are often ignored by screen readers, so any necessary information\n * should go directly in the column content\n */\n ariaLabel?: string;\n\n /** Whether the column is a header for the given row. There should be only one column with this set to true. */\n isRowHeader?: boolean;\n\n /** Maximum width for the column, if stretching is allowed in justified scenarios. */\n maxWidth?: number;\n\n /**\n * Defines how the column's header should render.\n * @defaultvalue ColumnActionsMode.clickable\n */\n columnActionsMode?: ColumnActionsMode;\n\n /** Custom icon to use in the column header. */\n iconName?: string;\n\n /**\n * Whether only the icon should be displayed in the column header.\n * If true, the column name and dropdown chevron will not be displayed.\n */\n isIconOnly?: boolean;\n\n /** Class name for the icon within the header. */\n iconClassName?: string;\n\n /**\n * If true, allow the column to be collapsed when rendered in justified layout.\n * @deprecated Use `isCollapsible`\n */\n isCollapsable?: boolean;\n\n /** If true, allow the column to be collapsed when rendered in justified layout. */\n isCollapsible?: boolean;\n\n /** If true, column header will render an icon indicating column is sortable while unsorted */\n showSortIconWhenUnsorted?: boolean;\n\n /** Determines if the column is currently sorted. Renders a sort arrow in the column header. */\n isSorted?: boolean;\n\n /** Determines if the sort arrow is pointed down (descending) or up. */\n isSortedDescending?: boolean;\n\n /** Determines if the column can be resized. */\n isResizable?: boolean;\n\n /** Determines if the column can render multi-line text. */\n isMultiline?: boolean;\n\n /** Custom renderer for cell content, instead of the default text rendering. */\n onRender?: (item?: any, index?: number, column?: IColumn) => any;\n\n /** Custom override for the parent list's `getCellValueKey`. */\n getValueKey?: (item?: any, index?: number, column?: IColumn) => string;\n\n onRenderField?: IRenderFunction;\n\n /** Custom renderer for column header divider. */\n onRenderDivider?: IRenderFunction;\n\n /** Custom renderer for filter icon. */\n onRenderFilterIcon?: IRenderFunction;\n\n /** Custom renderer for column header content, instead of the default text rendering. */\n onRenderHeader?: IRenderFunction;\n\n /** Whether the list is filtered by this column. If true, shows a filter icon next to this column's name. */\n isFiltered?: boolean;\n\n /** Callback for when the user clicks on the column header. */\n onColumnClick?: (ev: React.MouseEvent, column: IColumn) => void;\n\n /** Callback for when the user opens the column header context menu. */\n onColumnContextMenu?: (column?: IColumn, ev?: React.MouseEvent) => void;\n\n /**\n * Callback for when the column is resized (`width` is the current width).\n *\n * Prefer this over `DetailsList`'s `onColumnResize` if you require the `IColumn` to report its width\n * after every resize event. Consider debouncing the callback if resize events occur frequently.\n */\n onColumnResize?: (width?: number) => void;\n\n /** Whether the list is grouped by this column. If true, shows a grouped icon next to this column's name. */\n isGrouped?: boolean;\n\n /** Arbitrary data passthrough which can be used by the caller. */\n data?: any;\n\n /** Internal only value. */\n calculatedWidth?: number;\n\n /**\n * Internal only value.\n * Remembers the actual width of the column in any case.\n * `calculatedWidth` is only saved when it's defined by user, not for justified calculations.\n */\n currentWidth?: number;\n\n /** Class name to apply to the column header cell. */\n headerClassName?: string;\n\n /** If true, add additional LTR padding-right to column and cells. */\n isPadded?: boolean;\n\n /**\n * Accessible label for indicating that the list is sorted by this column in ascending order.\n * This will be read after the main column header label.\n */\n sortAscendingAriaLabel?: string;\n\n /**\n * Accessible label for indicating that the list is sorted by this column in descending order.\n * This will be read after the main column header label.\n */\n sortDescendingAriaLabel?: string;\n\n /**\n * Accessible label for indicating that the list could be sorted by this column but isn't currently.\n * This will be read after the main column header label.\n */\n sortableAriaLabel?: string;\n\n /** Accessible label for the status of this column when grouped. */\n groupAriaLabel?: string;\n\n /** Accessible label for the status of this column when filtered. */\n filterAriaLabel?: string;\n\n /** Whether a dropdown menu is open so that the appropriate ARIA attributes are rendered. */\n isMenuOpen?: boolean;\n}\n\n/**\n * Enum to describe how a particular column header behaves.\n * This is used to to specify the property `IColumn.columnActionsMode`.\n * If `IColumn.columnActionsMode` is undefined, it's equivalent to `ColumnActionsMode.clickable`.\n * {@docCategory DetailsList}\n */\nexport enum ColumnActionsMode {\n /** Renders the column header as disabled. */\n disabled = 0,\n\n /** Renders the column header as clickable. Default value. */\n clickable = 1,\n\n /** Renders the column header as clickable and displays the dropdown chevron. */\n hasDropdown = 2,\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport enum ConstrainMode {\n /** Lets the content grow which allows the page to manage scrolling. */\n unconstrained = 0,\n\n /** Constrains the list to the given layout space. */\n horizontalConstrained = 1,\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IColumnReorderOptions {\n /**\n * Specifies the number fixed columns from left\n * @defaultvalue 0\n */\n frozenColumnCountFromStart?: number;\n\n /**\n * Specifies the number fixed columns from right\n * @defaultvalue 0\n */\n frozenColumnCountFromEnd?: number;\n\n /**\n * Callback to handle when dragging on this column's DetailsHeader has started.\n */\n onColumnDragStart?: (dragStarted: boolean) => void;\n\n /**\n * Callback to handle column reordering.\n * `draggedIndex` is the source column index, which should be placed at `targetIndex`.\n * @deprecated Use `onColumnDrop` instead.\n */\n handleColumnReorder?: (draggedIndex: number, targetIndex: number) => void;\n\n /**\n * Callback to handle column reordering.\n * `draggedIndex` is the source column index, which should be placed at `targetIndex`.\n */\n onColumnDrop?: (dragDropDetails: IColumnDragDropDetails) => void;\n\n /**\n * Callback to handle when dragging on this column's DetailsHeader has finished.\n */\n onDragEnd?: (columnDropLocationDetails: ColumnDragEndLocation) => void;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IColumnDragDropDetails {\n /**\n * Specifies the source column index\n * @defaultvalue -1\n */\n draggedIndex: number;\n\n /**\n * Specifies the target column index\n * @defaultvalue -1\n */\n targetIndex: number;\n}\n\n/**\n * Enum to describe where the column has been dropped, after starting the drag\n * {@docCategory DetailsList}\n */\nexport enum ColumnDragEndLocation {\n /** Drag ended outside of current list */\n outside = 0,\n\n /** Drag ended within current list */\n surface = 1,\n\n /** Drag ended on header */\n header = 2,\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport enum DetailsListLayoutMode {\n /**\n * Lets the user resize columns and makes not attempt to fit them.\n */\n fixedColumns = 0,\n\n /**\n * Manages which columns are visible, tries to size them according to their min/max rules and drops\n * off columns that can't fit and have isCollapsible set.\n */\n justified = 1,\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport enum CheckboxVisibility {\n /** Visible on hover. */\n onHover = 0,\n\n /** Visible always. */\n always = 1,\n\n /** Hide checkboxes. */\n hidden = 2,\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport type IDetailsListStyleProps = Required> &\n Pick & {\n /** Whether the list is horizontally constrained */\n isHorizontalConstrained?: boolean;\n\n /** Whether the list is in compact mode */\n compact?: boolean;\n\n /** Whether the list is fixed in size */\n isFixed?: boolean;\n };\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsListStyles {\n root: IStyle;\n focusZone: IStyle;\n headerWrapper: IStyle;\n contentWrapper: IStyle;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsGroupRenderProps extends IGroupRenderProps {\n onRenderFooter?: IRenderFunction;\n onRenderHeader?: IRenderFunction;\n groupedListAs?: IComponentAs;\n}\n\n/**\n * {@docCategory DetailsList}\n */\nexport interface IDetailsGroupDividerProps extends IGroupDividerProps, IDetailsItemProps {}\n\nexport interface IDetailsListCheckboxProps extends IDetailsCheckboxProps {}\n\nexport type {\n IDetailsHeaderProps,\n IDetailsRowBaseProps,\n IDetailsHeaderBaseProps,\n IDetailsFooterBaseProps,\n IDragDropContext,\n IDragDropEvents,\n IDragDropHelper,\n IDragDropOptions,\n IViewport,\n IWithViewportProps,\n};\n","export const DirectionalHint = {\n /**\n * Appear above the target element, with the left edges of the callout and target aligning.\n */\n topLeftEdge: 0 as 0,\n\n /**\n * Appear above the target element, with the centers of the callout and target aligning.\n */\n topCenter: 1 as 1,\n\n /**\n * Appear above the target element, with the right edges of the callout and target aligning.\n */\n topRightEdge: 2 as 2,\n\n /**\n * Appear above the target element, aligning with the target element such that the callout tends toward\n * the center of the screen.\n */\n topAutoEdge: 3 as 3,\n\n /**\n * Appear below the target element, with the left edges of the callout and target aligning.\n */\n bottomLeftEdge: 4 as 4,\n\n /**\n * Appear below the target element, with the centers of the callout and target aligning.\n */\n bottomCenter: 5 as 5,\n\n /**\n * Appear below the target element, with the right edges of the callout and target aligning.\n */\n bottomRightEdge: 6 as 6,\n\n /**\n * Appear below the target element, aligning with the target element such that the callout tends toward\n * the center of the screen.\n */\n bottomAutoEdge: 7 as 7,\n\n /**\n * Appear to the left of the target element, with the top edges of the callout and target aligning.\n */\n leftTopEdge: 8 as 8,\n\n /**\n * Appear to the left of the target element, with the centers of the callout and target aligning.\n */\n leftCenter: 9 as 9,\n\n /**\n * Appear to the left of the target element, with the bottom edges of the callout and target aligning.\n */\n leftBottomEdge: 10 as 10,\n\n /**\n * Appear to the right of the target element, with the top edges of the callout and target aligning.\n */\n rightTopEdge: 11 as 11,\n\n /**\n * Appear to the right of the target element, with the centers of the callout and target aligning.\n */\n rightCenter: 12 as 12,\n\n /**\n * Appear to the right of the target element, with the bottom edges of the callout and target aligning.\n */\n rightBottomEdge: 13 as 13,\n};\n\nexport type DirectionalHint = (typeof DirectionalHint)[keyof typeof DirectionalHint];\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\r\n * @ignore\r\n */\r\nvar DynInstChkTag = '_dynInstChk';\r\n/**\r\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same\r\n * tag name as the function level but a different const name for readability only.\r\n */\r\nvar DynAllowInstChkTag = DynInstChkTag;\r\n/**\r\n * The global (imported) instances where the global performance options are stored\r\n */\r\nvar DynProtoDefaultOptions = '_dfOpts';\r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */\r\nvar UnknownValue = '_unknown_';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar str__Proto = \"__proto__\";\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strUseBaseInst = 'useBaseInst';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strSetInstFuncs = 'setInstFuncs';\r\nvar Obj = Object;\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\r\n/**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */\r\nvar _dynamicNames = 0;\r\n/**\r\n * Helper to check if the object contains a property of the name\r\n * @ignore\r\n */\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */\r\nfunction _isObjectOrArrayPrototype(target) {\r\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n if (target) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n // target[Constructor] May break if the constructor has been changed or removed\r\n var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\r\n if (newProto) {\r\n return newProto;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\r\n * are not enumerable.\r\n * @param target\r\n */\r\nfunction _forEachProp(target, func) {\r\n var props = [];\r\n var getOwnProps = Obj[\"getOwnPropertyNames\"];\r\n if (getOwnProps) {\r\n props = getOwnProps(target);\r\n }\r\n else {\r\n for (var name_1 in target) {\r\n if (typeof name_1 === \"string\" && _hasOwnProperty(target, name_1)) {\r\n props.push(name_1);\r\n }\r\n }\r\n }\r\n if (props && props.length > 0) {\r\n for (var lp = 0; lp < props.length; lp++) {\r\n func(props[lp]);\r\n }\r\n }\r\n}\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototype or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target, funcName, skipOwn) {\r\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throw new TypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n _forEachProp(thisTarget, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for passing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n });\r\n return instFuncs;\r\n}\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values, value) {\r\n for (var lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {\r\n function _instFuncProxy(target, funcHost, funcName) {\r\n var theFunc = funcHost[funcName];\r\n if (theFunc[DynProxyTag] && useBaseInst) {\r\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\r\n }\r\n }\r\n return function () {\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n _forEachProp(instFuncs, function (name) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\r\n });\r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n var visited = [];\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n _forEachProp(baseProto, function (name) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for passing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\r\n }\r\n });\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n return baseFuncs;\r\n}\r\nfunction _getInstFunc(target, funcName, proto, currentDynProtoProxy) {\r\n var instFunc = null;\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (target && _hasOwnProperty(proto, DynClassName)) {\r\n var instFuncTable = target[DynInstFuncTable] || {};\r\n instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];\r\n if (!instFunc) {\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n // We have the instance function, lets check it we can speed up further calls\r\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\r\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\r\n // If the instance already has an instance function we can't replace it\r\n var canAddInst = !_hasOwnProperty(target, funcName);\r\n // Get current prototype\r\n var objProto = _getObjProto(target);\r\n var visited = [];\r\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\r\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\r\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\r\n var protoFunc = objProto[funcName];\r\n if (protoFunc) {\r\n canAddInst = (protoFunc === currentDynProtoProxy);\r\n break;\r\n }\r\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\r\n visited.push(objProto);\r\n objProto = _getObjProto(objProto);\r\n }\r\n try {\r\n if (canAddInst) {\r\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\r\n // so it's safe to directly assign for any subsequent calls (for better performance)\r\n target[funcName] = instFunc;\r\n }\r\n // Block further attempts to set the instance function for any\r\n instFunc[DynInstChkTag] = 1;\r\n }\r\n catch (e) {\r\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\r\n // And set a flag so we don't try again for any function\r\n instFuncTable[DynAllowInstChkTag] = false;\r\n }\r\n }\r\n }\r\n return instFunc;\r\n}\r\nfunction _getProtoFunc(funcName, proto, currentDynProtoProxy) {\r\n var protoFunc = proto[funcName];\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === currentDynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (typeof protoFunc !== strFunction) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc;\r\n}\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto - The class prototype\r\n * @param className - The instance classname\r\n * @param target - The target instance\r\n * @param baseInstFuncs - The base instance functions\r\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n // Use the instance or prototype function\r\n var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\r\n return instFunc.apply(this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\r\n if (instFuncTable[DynAllowInstChkTag] !== false) {\r\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\r\n }\r\n _forEachProp(target, function (name) {\r\n // Only add overridden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs_1[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\r\n var visited = [];\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(thisProto);\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (_hasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass - This is the current class instance which contains the prototype for the current class\r\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\r\n * @param options - Additional options to configure how the dynamic prototype operates\r\n */\r\nexport default function dynamicProto(theClass, target, delegateFunc, options) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!_hasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] is not in class hierarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (_hasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _dynamicNames;\r\n _dynamicNames++;\r\n classProto[DynClassName] = className;\r\n }\r\n var perfOptions = dynamicProto[DynProtoDefaultOptions];\r\n var useBaseInst = !!perfOptions[strUseBaseInst];\r\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\r\n useBaseInst = !!options[strUseBaseInst];\r\n }\r\n // Get the current instance functions\r\n var instFuncs = _getInstanceFuncs(target);\r\n // Get all of the functions for any base instance (before they are potentially overridden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs);\r\n // Don't allow setting instance functions for older IE instances\r\n var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];\r\n if (setInstanceFunc && options) {\r\n setInstanceFunc = !!options[strSetInstFuncs];\r\n }\r\n // Populate the Prototype for any overridden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\r\n}\r\n/**\r\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\r\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\r\n * their internal usage of dynamic proto.\r\n */\r\nvar perfDefaults = {\r\n setInstFuncs: true,\r\n useBaseInst: true\r\n};\r\n// And expose for testing\r\ndynamicProto[DynProtoDefaultOptions] = perfDefaults;\r\n//# sourceMappingURL=DynamicProto.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * The different levels of logs that can be used with the HttpPipelineLogger.\n */\nexport enum HttpPipelineLogLevel {\n /**\n * A log level that indicates that no logs will be logged.\n */\n OFF,\n\n /**\n * An error log.\n */\n ERROR,\n\n /**\n * A warning log.\n */\n WARNING,\n\n /**\n * An information log.\n */\n INFO,\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { HttpOperationResponse } from \"../httpOperationResponse\";\nimport { HttpPipelineLogLevel } from \"../httpPipelineLogLevel\";\nimport { HttpPipelineLogger } from \"../httpPipelineLogger\";\nimport { WebResourceLike } from \"../webResource\";\n\n/**\n * Creates a new RequestPolicy per-request that uses the provided nextPolicy.\n */\nexport type RequestPolicyFactory = {\n create(nextPolicy: RequestPolicy, options: RequestPolicyOptionsLike): RequestPolicy;\n};\n\n/**\n * The underlying structure of a request policy.\n */\nexport interface RequestPolicy {\n /**\n * A method that retrieves an {@link HttpOperationResponse} given a {@link WebResourceLike} describing the request to be made.\n * @param httpRequest - {@link WebResourceLike} describing the request to be made.\n */\n sendRequest(httpRequest: WebResourceLike): Promise;\n}\n\n/**\n * The base class from which all request policies derive.\n */\nexport abstract class BaseRequestPolicy implements RequestPolicy {\n /**\n * The main method to implement that manipulates a request/response.\n */\n protected constructor(\n /**\n * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.\n */\n readonly _nextPolicy: RequestPolicy,\n /**\n * The options that can be passed to a given request policy.\n */\n readonly _options: RequestPolicyOptionsLike\n ) {}\n\n /**\n * Sends a network request based on the given web resource.\n * @param webResource - A {@link WebResourceLike} that describes a HTTP request to be made.\n */\n public abstract sendRequest(webResource: WebResourceLike): Promise;\n\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n public shouldLog(logLevel: HttpPipelineLogLevel): boolean {\n return this._options.shouldLog(logLevel);\n }\n\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meat the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n public log(logLevel: HttpPipelineLogLevel, message: string): void {\n this._options.log(logLevel, message);\n }\n}\n\n/**\n * Optional properties that can be used when creating a RequestPolicy.\n */\nexport interface RequestPolicyOptionsLike {\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n shouldLog(logLevel: HttpPipelineLogLevel): boolean;\n\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meet the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n log(logLevel: HttpPipelineLogLevel, message: string): void;\n}\n\n/**\n * Optional properties that can be used when creating a RequestPolicy.\n */\nexport class RequestPolicyOptions {\n constructor(private _logger?: HttpPipelineLogger) {}\n\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n public shouldLog(logLevel: HttpPipelineLogLevel): boolean {\n return (\n !!this._logger &&\n logLevel !== HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel\n );\n }\n\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meet the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n public log(logLevel: HttpPipelineLogLevel, message: string): void {\n if (this._logger && this.shouldLog(logLevel)) {\n this._logger.log(logLevel, message);\n }\n }\n}\n","/**\n * Simulated enum for keycodes. These will get inlined by uglify when used much like an enum\n *\n * @public\n * {@docCategory KeyCodes}\n */\nexport const KeyCodes = {\n backspace: 8 as 8,\n tab: 9 as 9,\n enter: 13 as 13,\n shift: 16 as 16,\n ctrl: 17 as 17,\n alt: 18 as 18,\n pauseBreak: 19 as 19,\n capslock: 20 as 20,\n escape: 27 as 27,\n space: 32 as 32,\n pageUp: 33 as 33,\n pageDown: 34 as 34,\n end: 35 as 35,\n home: 36 as 36,\n left: 37 as 37,\n up: 38 as 38,\n right: 39 as 39,\n down: 40 as 40,\n insert: 45 as 45,\n del: 46 as 46,\n zero: 48 as 48,\n one: 49 as 49,\n two: 50 as 50,\n three: 51 as 51,\n four: 52 as 52,\n five: 53 as 53,\n six: 54 as 54,\n seven: 55 as 55,\n eight: 56 as 56,\n nine: 57 as 57,\n colon: 58 as 58,\n a: 65 as 65,\n b: 66 as 66,\n c: 67 as 67,\n d: 68 as 68,\n e: 69 as 69,\n f: 70 as 70,\n g: 71 as 71,\n h: 72 as 72,\n i: 73 as 73,\n j: 74 as 74,\n k: 75 as 75,\n l: 76 as 76,\n m: 77 as 77,\n n: 78 as 78,\n o: 79 as 79,\n p: 80 as 80,\n q: 81 as 81,\n r: 82 as 82,\n s: 83 as 83,\n t: 84 as 84,\n u: 85 as 85,\n v: 86 as 86,\n w: 87 as 87,\n x: 88 as 88,\n y: 89 as 89,\n z: 90 as 90,\n leftWindow: 91 as 91,\n rightWindow: 92 as 92,\n select: 93 as 93,\n /* eslint-disable @typescript-eslint/naming-convention */\n zero_numpad: 96 as 96,\n one_numpad: 97 as 97,\n two_numpad: 98 as 98,\n three_numpad: 99 as 99,\n four_numpad: 100 as 100,\n five_numpad: 101 as 101,\n six_numpad: 102 as 102,\n seven_numpad: 103 as 103,\n eight_numpad: 104 as 104,\n nine_numpad: 105 as 105,\n /* eslint-enable @typescript-eslint/naming-convention */\n multiply: 106 as 106,\n add: 107 as 107,\n subtract: 109 as 109,\n decimalPoint: 110 as 110,\n divide: 111 as 111,\n f1: 112 as 112,\n f2: 113 as 113,\n f3: 114 as 114,\n f4: 115 as 115,\n f5: 116 as 116,\n f6: 117 as 117,\n f7: 118 as 118,\n f8: 119 as 119,\n f9: 120 as 120,\n f10: 121 as 121,\n f11: 122 as 122,\n f12: 123 as 123,\n numlock: 144 as 144,\n scrollLock: 145 as 145,\n semicolon: 186 as 186,\n equalSign: 187 as 187,\n comma: 188 as 188,\n dash: 189 as 189,\n period: 190 as 190,\n forwardSlash: 191 as 191,\n graveAccent: 192 as 192,\n openBracket: 219 as 219,\n backSlash: 220 as 220,\n closeBracket: 221 as 221,\n singleQuote: 222 as 222,\n};\nexport type KeyCodes = number;\n","import { canUseDOM } from './canUseDOM';\n\nlet _window: Window | undefined = undefined;\n\n// Note: Accessing \"window\" in IE11 is somewhat expensive, and calling \"typeof window\"\n// hits a memory leak, whereas aliasing it and calling \"typeof _window\" does not.\n// Caching the window value at the file scope lets us minimize the impact.\ntry {\n _window = window;\n} catch (e) {\n /* no-op */\n}\n\n/**\n * Helper to get the window object. The helper will make sure to use a cached variable\n * of \"window\", to avoid overhead and memory leaks in IE11. Note that in popup scenarios the\n * window object won't match the \"global\" window object, and for these scenarios, you should\n * pass in an element hosted within the popup.\n *\n * @public\n */\nexport function getWindow(rootElement?: Element | null): Window | undefined {\n if (!canUseDOM() || typeof _window === 'undefined') {\n return undefined;\n } else {\n const el = rootElement as Element;\n\n return el && el.ownerDocument && el.ownerDocument.defaultView ? el.ownerDocument.defaultView : _window;\n }\n}\n","/**\n * {@docCategory Selection}\n */\nexport interface IObjectWithKey {\n key?: string | number;\n}\n\nexport const SELECTION_CHANGE = 'change';\nexport const SELECTION_ITEMS_CHANGE = 'items-change';\n\n/**\n * {@docCategory Selection}\n */\nexport enum SelectionMode {\n none = 0,\n single = 1,\n multiple = 2,\n}\n\n/**\n * {@docCategory Selection}\n */\nexport interface ISelection {\n count: number;\n mode: SelectionMode;\n\n canSelectItem: (item: TItem, index?: number) => boolean;\n\n // Obesrvable methods.\n setChangeEvents(isEnabled: boolean, suppressChange?: boolean): void;\n\n // Initialization methods.\n\n setItems(items: TItem[], shouldClear: boolean): void;\n getItems(): TItem[];\n\n // Item utility methods.\n getItemIndex?(key: string): number;\n\n // Read selection methods.\n\n getSelection(): TItem[];\n getSelectedIndices(): number[];\n getSelectedCount(): number;\n isRangeSelected(fromIndex: number, count: number): boolean;\n\n isAllSelected(): boolean;\n isKeySelected(key: string): boolean;\n isIndexSelected(index: number): boolean;\n\n isModal?(): boolean;\n\n // Write selection methods.\n\n setAllSelected(isAllSelected: boolean): void;\n setKeySelected(key: string, isSelected: boolean, shouldAnchor: boolean): void;\n setIndexSelected(index: number, isSelected: boolean, shouldAnchor: boolean): void;\n setRangeSelected?(fromIndex: number, count: number, isSelected: boolean, shouldAnchor: boolean): void;\n\n setModal?(isModal: boolean): void; // TODO make non-optional on next breaking change\n\n // Write range selection methods.\n\n selectToKey(key: string, clearSelection?: boolean): void;\n selectToIndex(index: number, clearSelection?: boolean): void;\n selectToRange?(index: number, count: number, clearSelection?: boolean): void;\n\n // Toggle helpers.\n\n toggleAllSelected(): void;\n toggleKeySelected(key: string): void;\n toggleIndexSelected(index: number): void;\n toggleRangeSelected(fromIndex: number, count: number): void;\n}\n\n/**\n * {@docCategory Selection}\n */\nexport enum SelectionDirection {\n horizontal = 0,\n vertical = 1,\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import { elementContainsAttribute } from './dom/elementContainsAttribute';\nimport { elementContains } from './dom/elementContains';\nimport { getParent } from './dom/getParent';\nimport { getWindow } from './dom/getWindow';\nimport { getDocument } from './dom/getDocument';\n\nconst IS_FOCUSABLE_ATTRIBUTE = 'data-is-focusable';\nconst IS_VISIBLE_ATTRIBUTE = 'data-is-visible';\nconst FOCUSZONE_ID_ATTRIBUTE = 'data-focuszone-id';\nconst FOCUSZONE_SUB_ATTRIBUTE = 'data-is-sub-focuszone';\n\n/**\n * Gets the first focusable element.\n *\n * @public\n */\nexport function getFirstFocusable(\n rootElement: HTMLElement,\n currentElement: HTMLElement,\n includeElementsInFocusZones?: boolean,\n): HTMLElement | null {\n return getNextElement(\n rootElement,\n currentElement,\n true /*checkNode*/,\n false /*suppressParentTraversal*/,\n false /*suppressChildTraversal*/,\n includeElementsInFocusZones,\n );\n}\n\n/**\n * Gets the last focusable element.\n *\n * @public\n */\nexport function getLastFocusable(\n rootElement: HTMLElement,\n currentElement: HTMLElement,\n includeElementsInFocusZones?: boolean,\n): HTMLElement | null {\n return getPreviousElement(\n rootElement,\n currentElement,\n true /*checkNode*/,\n false /*suppressParentTraversal*/,\n true /*traverseChildren*/,\n includeElementsInFocusZones,\n );\n}\n\n/**\n * Gets the first tabbable element. (The difference between focusable and tabbable is that tabbable elements are\n * focusable elements that also have tabIndex != -1.)\n * @param rootElement - The parent element to search beneath.\n * @param currentElement - The descendant of rootElement to start the search at. This element is the first one checked,\n * and iteration continues forward. Typical use passes rootElement.firstChild.\n * @param includeElementsInFocusZones - true if traversal should go into FocusZone descendants.\n * @param checkNode - Include currentElement in search when true. Defaults to true.\n * @public\n */\nexport function getFirstTabbable(\n rootElement: HTMLElement,\n currentElement: HTMLElement,\n includeElementsInFocusZones?: boolean,\n checkNode: boolean = true,\n): HTMLElement | null {\n return getNextElement(\n rootElement,\n currentElement,\n checkNode,\n false /*suppressParentTraversal*/,\n false /*suppressChildTraversal*/,\n includeElementsInFocusZones,\n false /*allowFocusRoot*/,\n true /*tabbable*/,\n );\n}\n\n/**\n * Gets the last tabbable element. (The difference between focusable and tabbable is that tabbable elements are\n * focusable elements that also have tabIndex != -1.)\n * @param rootElement - The parent element to search beneath.\n * @param currentElement - The descendant of rootElement to start the search at. This element is the first one checked,\n * and iteration continues in reverse. Typical use passes rootElement.lastChild.\n * @param includeElementsInFocusZones - true if traversal should go into FocusZone descendants.\n * @param checkNode - Include currentElement in search when true. Defaults to true.\n * @public\n */\nexport function getLastTabbable(\n rootElement: HTMLElement,\n currentElement: HTMLElement,\n includeElementsInFocusZones?: boolean,\n checkNode: boolean = true,\n): HTMLElement | null {\n return getPreviousElement(\n rootElement,\n currentElement,\n checkNode,\n false /*suppressParentTraversal*/,\n true /*traverseChildren*/,\n includeElementsInFocusZones,\n false /*allowFocusRoot*/,\n true /*tabbable*/,\n );\n}\n\n/**\n * Attempts to focus the first focusable element that is a child or child's child of the rootElement.\n *\n * @public\n * @param rootElement - Element to start the search for a focusable child.\n * @param bypassHiddenElements - If true, focus will be not be set on hidden elements.\n * @returns True if focus was set, false if it was not.\n */\nexport function focusFirstChild(rootElement: HTMLElement, bypassHiddenElements?: boolean): boolean {\n let element: HTMLElement | null = getNextElement(\n rootElement,\n rootElement,\n true,\n false,\n false,\n true,\n undefined,\n undefined,\n bypassHiddenElements,\n );\n\n if (element) {\n focusAsync(element);\n return true;\n }\n return false;\n}\n\n/**\n * Traverse to find the previous element.\n * If tabbable is true, the element must have tabIndex != -1.\n *\n * @public\n */\nexport function getPreviousElement(\n rootElement: HTMLElement,\n currentElement: HTMLElement | null,\n checkNode?: boolean,\n suppressParentTraversal?: boolean,\n traverseChildren?: boolean,\n includeElementsInFocusZones?: boolean,\n allowFocusRoot?: boolean,\n tabbable?: boolean,\n): HTMLElement | null {\n if (!currentElement || (!allowFocusRoot && currentElement === rootElement)) {\n return null;\n }\n\n let isCurrentElementVisible = isElementVisible(currentElement);\n\n // Check its children.\n if (\n traverseChildren &&\n isCurrentElementVisible &&\n (includeElementsInFocusZones || !(isElementFocusZone(currentElement) || isElementFocusSubZone(currentElement)))\n ) {\n const childMatch = getPreviousElement(\n rootElement,\n currentElement.lastElementChild as HTMLElement,\n true,\n true,\n true,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n );\n\n if (childMatch) {\n if ((tabbable && isElementTabbable(childMatch, true)) || !tabbable) {\n return childMatch;\n }\n\n const childMatchSiblingMatch = getPreviousElement(\n rootElement,\n childMatch.previousElementSibling as HTMLElement,\n true,\n true,\n true,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n );\n if (childMatchSiblingMatch) {\n return childMatchSiblingMatch;\n }\n\n let childMatchParent = childMatch.parentElement;\n\n // At this point if we have not found any potential matches\n // start looking at the rest of the subtree under the currentParent.\n // NOTE: We do not want to recurse here because doing so could\n // cause elements to get skipped.\n while (childMatchParent && childMatchParent !== currentElement) {\n const childMatchParentMatch = getPreviousElement(\n rootElement,\n childMatchParent.previousElementSibling as HTMLElement,\n true,\n true,\n true,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n );\n\n if (childMatchParentMatch) {\n return childMatchParentMatch;\n }\n\n childMatchParent = childMatchParent.parentElement;\n }\n }\n }\n\n // Check the current node, if it's not the first traversal.\n if (checkNode && isCurrentElementVisible && isElementTabbable(currentElement, tabbable)) {\n return currentElement;\n }\n\n // Check its previous sibling.\n const siblingMatch = getPreviousElement(\n rootElement,\n currentElement.previousElementSibling as HTMLElement,\n true,\n true,\n true,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n );\n\n if (siblingMatch) {\n return siblingMatch;\n }\n\n // Check its parent.\n if (!suppressParentTraversal) {\n return getPreviousElement(\n rootElement,\n currentElement.parentElement,\n true,\n false,\n false,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n );\n }\n\n return null;\n}\n\n/**\n * Traverse to find the next focusable element.\n * If tabbable is true, the element must have tabIndex != -1.\n *\n * @public\n * @param checkNode - Include currentElement in search when true.\n */\nexport function getNextElement(\n rootElement: HTMLElement,\n currentElement: HTMLElement | null,\n checkNode?: boolean,\n suppressParentTraversal?: boolean,\n suppressChildTraversal?: boolean,\n includeElementsInFocusZones?: boolean,\n allowFocusRoot?: boolean,\n tabbable?: boolean,\n bypassHiddenElements?: boolean,\n): HTMLElement | null {\n if (!currentElement || (currentElement === rootElement && suppressChildTraversal && !allowFocusRoot)) {\n return null;\n }\n\n const checkElementVisibility = bypassHiddenElements ? isElementVisibleAndNotHidden : isElementVisible;\n\n let isCurrentElementVisible = checkElementVisibility(currentElement);\n\n // Check the current node, if it's not the first traversal.\n if (checkNode && isCurrentElementVisible && isElementTabbable(currentElement, tabbable)) {\n return currentElement;\n }\n\n // Check its children.\n if (\n !suppressChildTraversal &&\n isCurrentElementVisible &&\n (includeElementsInFocusZones || !(isElementFocusZone(currentElement) || isElementFocusSubZone(currentElement)))\n ) {\n const childMatch = getNextElement(\n rootElement,\n currentElement.firstElementChild as HTMLElement,\n true,\n true,\n false,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n bypassHiddenElements,\n );\n\n if (childMatch) {\n return childMatch;\n }\n }\n\n if (currentElement === rootElement) {\n return null;\n }\n\n // Check its sibling.\n const siblingMatch = getNextElement(\n rootElement,\n currentElement.nextElementSibling as HTMLElement,\n true,\n true,\n false,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n bypassHiddenElements,\n );\n\n if (siblingMatch) {\n return siblingMatch;\n }\n\n if (!suppressParentTraversal) {\n return getNextElement(\n rootElement,\n currentElement.parentElement,\n false,\n false,\n true,\n includeElementsInFocusZones,\n allowFocusRoot,\n tabbable,\n bypassHiddenElements,\n );\n }\n\n return null;\n}\n\n/**\n * Determines if an element is visible.\n *\n * @public\n */\nexport function isElementVisible(element: HTMLElement | undefined | null): boolean {\n // If the element is not valid, return false.\n if (!element || !element.getAttribute) {\n return false;\n }\n\n const visibilityAttribute = element.getAttribute(IS_VISIBLE_ATTRIBUTE);\n\n // If the element is explicitly marked with the visibility attribute, return that value as boolean.\n if (visibilityAttribute !== null && visibilityAttribute !== undefined) {\n return visibilityAttribute === 'true';\n }\n\n // Fallback to other methods of determining actual visibility.\n return (\n element.offsetHeight !== 0 ||\n element.offsetParent !== null ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (element as any).isVisible === true\n ); // used as a workaround for testing.\n}\n\n/**\n * Determines if an element is visible and not hidden\n * @param element - Element to check\n * @returns Returns true if the given element is visible and not hidden\n *\n * @public\n */\nexport function isElementVisibleAndNotHidden(element: HTMLElement | undefined | null): boolean {\n return (\n !!element &&\n isElementVisible(element) &&\n !element.hidden &&\n window.getComputedStyle(element).visibility !== 'hidden'\n );\n}\n\n/**\n * Determines if an element can receive focus programmatically or via a mouse click.\n * If checkTabIndex is true, additionally checks to ensure the element can be focused with the tab key,\n * meaning tabIndex != -1.\n *\n * @public\n */\nexport function isElementTabbable(element: HTMLElement, checkTabIndex?: boolean): boolean {\n // If this element is null or is disabled, it is not considered tabbable.\n if (!element || (element as HTMLButtonElement).disabled) {\n return false;\n }\n\n let tabIndex = 0;\n let tabIndexAttributeValue = null;\n\n if (element && element.getAttribute) {\n tabIndexAttributeValue = element.getAttribute('tabIndex');\n\n if (tabIndexAttributeValue) {\n tabIndex = parseInt(tabIndexAttributeValue, 10);\n }\n }\n\n let isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null;\n let isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0;\n\n const result =\n !!element &&\n isFocusableAttribute !== 'false' &&\n (element.tagName === 'A' ||\n element.tagName === 'BUTTON' ||\n element.tagName === 'INPUT' ||\n element.tagName === 'TEXTAREA' ||\n element.tagName === 'SELECT' ||\n isFocusableAttribute === 'true' ||\n isTabIndexSet);\n\n return checkTabIndex ? tabIndex !== -1 && result : result;\n}\n\n/**\n * Determines if a given element is a focus zone.\n *\n * @public\n */\nexport function isElementFocusZone(element?: HTMLElement): boolean {\n return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE));\n}\n\n/**\n * Determines if a given element is a focus sub zone.\n *\n * @public\n */\nexport function isElementFocusSubZone(element?: HTMLElement): boolean {\n return !!(element && element.getAttribute && element.getAttribute(FOCUSZONE_SUB_ATTRIBUTE) === 'true');\n}\n\n/**\n * Determines if an element, or any of its children, contain focus.\n *\n * @public\n */\nexport function doesElementContainFocus(element: HTMLElement): boolean {\n let document = getDocument(element);\n let currentActiveElement: HTMLElement | undefined = document && (document.activeElement as HTMLElement);\n if (currentActiveElement && elementContains(element, currentActiveElement)) {\n return true;\n }\n return false;\n}\n\n/**\n * Determines if an, or any of its ancestors, sepcificies that it doesn't want focus to wrap\n * @param element - element to start searching from\n * @param noWrapDataAttribute - the no wrap data attribute to match (either)\n * @returns true if focus should wrap, false otherwise\n */\nexport function shouldWrapFocus(\n element: HTMLElement,\n noWrapDataAttribute: 'data-no-vertical-wrap' | 'data-no-horizontal-wrap',\n): boolean {\n return elementContainsAttribute(element, noWrapDataAttribute) === 'true' ? false : true;\n}\n\nlet animationId: number | undefined = undefined;\n\n/**\n * Sets focus to an element asynchronously. The focus will be set at the next browser repaint,\n * meaning it won't cause any extra recalculations. If more than one focusAsync is called during one frame,\n * only the latest called focusAsync element will actually be focused\n * @param element - The element to focus\n */\nexport function focusAsync(element: HTMLElement | { focus: () => void } | undefined | null): void {\n if (element) {\n const win = getWindow(element as Element);\n\n if (win) {\n // cancel any previous focus queues\n if (animationId !== undefined) {\n win.cancelAnimationFrame(animationId);\n }\n\n // element.focus() is a no-op if the element is no longer in the DOM, meaning this is always safe\n animationId = win.requestAnimationFrame(() => {\n element && element.focus();\n\n // We are done focusing for this frame, so reset the queued focus element\n animationId = undefined;\n });\n }\n }\n}\n\n/**\n * Finds the closest focusable element via an index path from a parent. See\n * `getElementIndexPath` for getting an index path from an element to a child.\n */\nexport function getFocusableByIndexPath(parent: HTMLElement, path: number[]): HTMLElement | undefined {\n let element = parent;\n\n for (const index of path) {\n const nextChild = element.children[Math.min(index, element.children.length - 1)] as HTMLElement;\n\n if (!nextChild) {\n break;\n }\n element = nextChild;\n }\n\n element =\n isElementTabbable(element) && isElementVisible(element)\n ? element\n : getNextElement(parent, element, true) || getPreviousElement(parent, element)!;\n\n return element as HTMLElement;\n}\n\n/**\n * Finds the element index path from a parent element to a child element.\n *\n * If you had this node structure: \"A has children [B, C] and C has child D\",\n * the index path from A to D would be [1, 0], or `parent.chidren[1].children[0]`.\n */\nexport function getElementIndexPath(fromElement: HTMLElement, toElement: HTMLElement): number[] {\n const path: number[] = [];\n\n while (toElement && fromElement && toElement !== fromElement) {\n const parent = getParent(toElement, true);\n\n if (parent === null) {\n return [];\n }\n\n path.unshift(Array.prototype.indexOf.call(parent.children, toElement));\n toElement = parent;\n }\n\n return path;\n}\n","import { findElementRecursive } from './findElementRecursive';\n\n/**\n * Determines if an element, or any of its ancestors, contain the given attribute\n * @param element - element to start searching at\n * @param attribute - the attribute to search for\n * @returns the value of the first instance found\n */\nexport function elementContainsAttribute(element: HTMLElement, attribute: string): string | null {\n const elementMatch = findElementRecursive(element, (testElement: HTMLElement) => testElement.hasAttribute(attribute));\n\n return elementMatch && elementMatch.getAttribute(attribute);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Default key used to access the XML attributes.\n */\nexport const XML_ATTRKEY = \"$\";\n/**\n * Default key used to access the XML value content.\n */\nexport const XML_CHARKEY = \"_\";\n\n/**\n * Options to govern behavior of xml parser and builder.\n */\nexport interface SerializerOptions {\n /**\n * indicates the name of the root element in the resulting XML when building XML.\n */\n rootName?: string;\n /**\n * indicates whether the root element is to be included or not in the output when parsing XML.\n */\n includeRoot?: boolean;\n /**\n * key used to access the XML value content when parsing XML.\n */\n xmlCharKey?: string;\n}\n","const toObjectMap = (...items: (string[] | Record)[]) => {\n const result: Record = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'minLength', // input, textarea\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'minLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * @deprecated Use imgProperties for img elements.\n */\nexport const imageProperties = imgProperties;\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropsNames - The array or record of allowed prop names.\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record,\n allowedPropNames: string[] | Record,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n","import * as React from 'react';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory Image}\n */\nexport interface IImage {}\n\n/**\n * {@docCategory Image}\n */\nexport interface IImageProps extends React.ImgHTMLAttributes, React.RefAttributes {\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: IStyleFunctionOrObject;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Component\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * If true, fades the image in when loaded.\n * @defaultvalue true\n */\n shouldFadeIn?: boolean;\n\n /**\n * If true, the image starts as visible and is hidden on error. Otherwise, the image is hidden until\n * it is successfully loaded. This disables shouldFadeIn.\n * @defaultvalue false;\n */\n shouldStartVisible?: boolean;\n\n /**\n * Used to determine how the image is scaled and cropped to fit the frame.\n *\n * @defaultvalue If both dimensions are provided, then the image is fit using `ImageFit.scale`.\n * Otherwise, the image won't be scaled or cropped.\n */\n imageFit?: ImageFit;\n\n /**\n * @deprecated Not used. Use `onLoadingStateChange` and re-render the Image with a different src.\n */\n errorSrc?: string;\n\n /**\n * If true, the image frame will expand to fill its parent container.\n */\n maximizeFrame?: boolean;\n\n /**\n * Optional callback method for when the image load state has changed.\n * The 'loadState' parameter indicates the current state of the Image.\n */\n onLoadingStateChange?: (loadState: ImageLoadState) => void;\n\n /**\n * Specifies the cover style to be used for this image. If not\n * specified, this will be dynamically calculated based on the\n * aspect ratio for the image.\n */\n coverStyle?: ImageCoverStyle;\n\n /**\n * Allows for browser-level image lazy-loading.\n */\n loading?: 'lazy' | 'eager';\n}\n\n/**\n * The possible methods that can be used to fit the image.\n * {@docCategory Image}\n */\nexport enum ImageFit {\n /**\n * The image is not scaled. The image is centered and cropped within the content box.\n */\n center = 0,\n\n /**\n * The image is scaled to maintain its aspect ratio while being fully contained within the frame. The image will\n * be centered horizontally and vertically within the frame. The space in the top and bottom or in the sides of\n * the frame will be empty depending on the difference in aspect ratio between the image and the frame.\n */\n contain = 1,\n\n /**\n * The image is scaled to maintain its aspect ratio while filling the frame. Portions of the image will be cropped\n * from the top and bottom, or the sides, depending on the difference in aspect ratio between the image and the frame.\n */\n cover = 2,\n\n /**\n * Neither the image nor the frame are scaled. If their sizes do not match, the image will either be cropped or the\n * frame will have empty space.\n */\n none = 3,\n\n /**\n * The image will be centered horizontally and vertically within the frame and maintains its aspect ratio. It will\n * behave as ImageFit.center if the image's natural height or width is less than the Image frame's height or width,\n * but if both natural height and width are larger than the frame it will behave as ImageFit.cover.\n */\n centerCover = 4,\n\n /**\n * The image will be centered horizontally and vertically within the frame and maintains its aspect ratio. It will\n * behave as ImageFit.center if the image's natural height and width is less than the Image frame's height and width,\n * but if either natural height or width are larger than the frame it will behave as ImageFit.contain.\n */\n centerContain = 5,\n}\n\n/**\n * The cover style to be used on the image\n * {@docCategory Image}\n */\nexport enum ImageCoverStyle {\n /**\n * The image will be shown at 100% height of container and the width will be scaled accordingly\n */\n landscape = 0,\n\n /**\n * The image will be shown at 100% width of container and the height will be scaled accordingly\n */\n portrait = 1,\n}\n\n/**\n * {@docCategory Image}\n */\nexport enum ImageLoadState {\n /**\n * The image has not yet been loaded, and there is no error yet.\n */\n notLoaded = 0,\n\n /**\n * The image has been loaded successfully.\n */\n loaded = 1,\n\n /**\n * An error has been encountered while loading the image.\n */\n error = 2,\n\n /**\n * @deprecated Not used. Use `onLoadingStateChange` and re-render the Image with a different src.\n */\n errorLoaded = 3,\n}\n\n/**\n * {@docCategory Image}\n */\nexport interface IImageStyleProps {\n /**\n * Accept theme prop.\n */\n theme: ITheme;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * If true, the image frame will expand to fill its parent container.\n */\n maximizeFrame?: boolean;\n\n /**\n * If true, the image is loaded\n */\n isLoaded?: boolean;\n\n /**\n * If true, fades the image in when loaded.\n * @defaultvalue true\n */\n shouldFadeIn?: boolean;\n\n /**\n * If true, the image starts as visible and is hidden on error. Otherwise, the image is hidden until\n * it is successfully loaded. This disables shouldFadeIn.\n * @defaultvalue false;\n */\n shouldStartVisible?: boolean;\n\n /**\n * If true the image is coverStyle landscape instead of portrait\n */\n isLandscape?: boolean;\n\n /**\n * ImageFit booleans for center, cover, contain, centerContain, centerCover, none\n */\n isCenter?: boolean;\n isContain?: boolean;\n isCover?: boolean;\n isCenterContain?: boolean;\n isCenterCover?: boolean;\n isNone?: boolean;\n\n /**\n * if true image load is in error\n */\n isError?: boolean;\n\n /**\n * if true, imageFit is undefined\n */\n isNotImageFit?: boolean;\n\n /**\n * Image width value\n */\n width?: number | string;\n\n /**\n * Image height value\n */\n height?: number | string;\n}\n\n/**\n * {@docCategory Image}\n */\nexport interface IImageStyles {\n /**\n * Style set for the root div element.\n */\n root: IStyle;\n /**\n * Style set for the img element.\n */\n image: IStyle;\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { getGlobal, strShimUndefined, strShimObject, strShimPrototype } from \"@microsoft/applicationinsights-shims\";\r\nimport { isString, isUndefined, strContains } from \"./HelperFuncs\";\r\n/**\r\n * This file exists to hold environment utilities that are required to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only use defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strDocumentMode = \"documentMode\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strConsole = \"console\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\r\nvar strCrypto = \"crypto\";\r\nvar strMsCrypto = \"msCrypto\";\r\nvar strReactNative = \"ReactNative\";\r\nvar strMsie = \"msie\";\r\nvar strTrident = \"trident/\";\r\nvar _isTrident = null;\r\nvar _navUserAgentCheck = null;\r\nvar _enableMocks = false;\r\nvar _useXDomainRequest = null;\r\nvar _beaconsSupported = null;\r\nfunction _hasProperty(theClass, property) {\r\n var supported = false;\r\n if (theClass) {\r\n try {\r\n supported = property in theClass;\r\n if (!supported) {\r\n var proto = theClass[strShimPrototype];\r\n if (proto) {\r\n supported = property in proto;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n if (!supported) {\r\n try {\r\n var tmp = new theClass();\r\n supported = !isUndefined(tmp[property]);\r\n }\r\n catch (e) {\r\n // Do Nothing\r\n }\r\n }\r\n }\r\n return supported;\r\n}\r\n/**\r\n * Enable the lookup of test mock objects if requested\r\n * @param enabled\r\n */\r\nexport function setEnableEnvMocks(enabled) {\r\n _enableMocks = enabled;\r\n}\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where .window (when global == window) doesn't return the base window\r\n if (name === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasWindow() {\r\n return Boolean(typeof window === strShimObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasDocument() {\r\n return Boolean(typeof document === strShimObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasNavigator() {\r\n return Boolean(typeof navigator === strShimObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasHistory() {\r\n return Boolean(typeof history === strShimObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation(checkForMock) {\r\n if (checkForMock && _enableMocks) {\r\n var mockLocation = getGlobalInst(\"__mockLocation\");\r\n if (mockLocation) {\r\n return mockLocation;\r\n }\r\n }\r\n if (typeof location === strShimObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the global console object\r\n */\r\nexport function getConsole() {\r\n if (typeof console !== strShimUndefined) {\r\n return console;\r\n }\r\n return getGlobalInst(strConsole);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getCrypto() {\r\n return getGlobalInst(strCrypto);\r\n}\r\n/**\r\n * Returns the crypto object if it is present otherwise null.\r\n * This helper is used to access the crypto object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getMsCrypto() {\r\n return getGlobalInst(strMsCrypto);\r\n}\r\n/**\r\n * Returns whether the environment is reporting that we are running in a React Native Environment\r\n */\r\nexport function isReactNative() {\r\n // If running in React Native, navigator.product will be populated\r\n var nav = getNavigator();\r\n if (nav && nav.product) {\r\n return nav.product === strReactNative;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Identifies whether the current environment appears to be IE\r\n */\r\nexport function isIE() {\r\n var nav = getNavigator();\r\n if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {\r\n // Added to support test mocking of the user agent\r\n _navUserAgentCheck = nav.userAgent;\r\n var userAgent = (_navUserAgentCheck || \"\").toLowerCase();\r\n _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));\r\n }\r\n return _isTrident;\r\n}\r\n/**\r\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\r\n */\r\nexport function getIEVersion(userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n if (!userAgentStr) {\r\n var navigator_1 = getNavigator() || {};\r\n userAgentStr = navigator_1 ? (navigator_1.userAgent || \"\").toLowerCase() : \"\";\r\n }\r\n var ua = (userAgentStr || \"\").toLowerCase();\r\n // Also check for documentMode in case X-UA-Compatible meta tag was included in HTML.\r\n if (strContains(ua, strMsie)) {\r\n var doc = getDocument() || {};\r\n return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));\r\n }\r\n else if (strContains(ua, strTrident)) {\r\n var tridentVer = parseInt(ua.split(strTrident)[1]);\r\n if (tridentVer) {\r\n return tridentVer + 4;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n */\r\nexport function dumpObj(object) {\r\n var objectTypeDump = Object[strShimPrototype].toString.call(object);\r\n var propertyValueDump = \"\";\r\n if (objectTypeDump === \"[object Error]\") {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else if (hasJSON()) {\r\n propertyValueDump = getJSON().stringify(object);\r\n }\r\n return objectTypeDump + propertyValueDump;\r\n}\r\nexport function isSafari(userAgentStr) {\r\n if (!userAgentStr || !isString(userAgentStr)) {\r\n var navigator_2 = getNavigator() || {};\r\n userAgentStr = navigator_2 ? (navigator_2.userAgent || \"\").toLowerCase() : \"\";\r\n }\r\n var ua = (userAgentStr || \"\").toLowerCase();\r\n return (ua.indexOf(\"safari\") >= 0);\r\n}\r\n/**\r\n * Checks if HTML5 Beacons are supported in the current environment.\r\n * @returns True if supported, false otherwise.\r\n */\r\nexport function isBeaconsSupported() {\r\n if (_beaconsSupported === null) {\r\n _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);\r\n }\r\n return _beaconsSupported;\r\n}\r\n/**\r\n * Checks if the Fetch API is supported in the current environment.\r\n * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isFetchSupported(withKeepAlive) {\r\n var isSupported = false;\r\n try {\r\n var fetchApi = getGlobalInst(\"fetch\");\r\n isSupported = !!fetchApi;\r\n var request = getGlobalInst(\"Request\");\r\n if (isSupported && withKeepAlive && request) {\r\n isSupported = _hasProperty(request, \"keepalive\");\r\n }\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\nexport function useXDomainRequest() {\r\n if (_useXDomainRequest === null) {\r\n _useXDomainRequest = (typeof XDomainRequest !== \"undefined\");\r\n if (_useXDomainRequest && isXhrSupported()) {\r\n _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(\"XMLHttpRequest\"), \"withCredentials\");\r\n }\r\n }\r\n return _useXDomainRequest;\r\n}\r\n/**\r\n * Checks if XMLHttpRequest is supported\r\n * @returns True if supported, otherwise false\r\n */\r\nexport function isXhrSupported() {\r\n var isSupported = false;\r\n try {\r\n var xmlHttpRequest = getGlobalInst(\"XMLHttpRequest\");\r\n isSupported = !!xmlHttpRequest;\r\n }\r\n catch (e) {\r\n // Just Swallow any failure during availability checks\r\n }\r\n return isSupported;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { BlobImmutabilityPolicyMode } from \"./generatedModels\";\nimport {\n LeaseAccessConditions,\n SequenceNumberAccessConditions,\n AppendPositionAccessConditions,\n AccessTier,\n CpkInfo,\n BlobDownloadResponseModel,\n} from \"./generatedModels\";\nimport { EncryptionAlgorithmAES25 } from \"./utils/constants\";\n\n/**\n * Blob tags.\n */\nexport type Tags = Record;\n\n/**\n * A map of name-value pairs to associate with the resource.\n */\nexport interface Metadata {\n /**\n * A name-value pair.\n */\n [propertyName: string]: string;\n}\n\n/**\n * standard HTTP conditional headers and tags condition.\n */\nexport interface ModifiedAccessConditions\n extends MatchConditions,\n ModificationConditions,\n TagConditions {}\n\n/**\n * standard HTTP conditional headers, tags condition and lease condition\n */\nexport interface BlobRequestConditions extends ModifiedAccessConditions, LeaseAccessConditions {}\n\n/**\n * Conditions to add to the creation of this page blob.\n */\nexport interface PageBlobRequestConditions\n extends BlobRequestConditions,\n SequenceNumberAccessConditions {}\n\n/**\n * Conditions to add to the creation of this append blob.\n */\nexport interface AppendBlobRequestConditions\n extends BlobRequestConditions,\n AppendPositionAccessConditions {}\n\n/**\n * Specifies HTTP options for conditional requests based on modification time.\n */\nexport interface ModificationConditions {\n /**\n * Specify this header value to operate only on a blob if it has been modified since the\n * specified date/time.\n */\n ifModifiedSince?: Date;\n /**\n * Specify this header value to operate only on a blob if it has not been modified since the\n * specified date/time.\n */\n ifUnmodifiedSince?: Date;\n}\n\n/**\n * Specifies HTTP options for conditional requests based on ETag matching.\n */\nexport interface MatchConditions {\n /**\n * Specify an ETag value to operate only on blobs with a matching value.\n */\n ifMatch?: string;\n /**\n * Specify an ETag value to operate only on blobs without a matching value.\n */\n ifNoneMatch?: string;\n}\n\n/**\n * Specifies HTTP options for conditional requests based on blob tags.\n */\nexport interface TagConditions {\n /**\n * Optional SQL statement to apply to the tags of the blob.\n */\n tagConditions?: string;\n}\n\n/**\n * Conditions to meet for the container.\n */\nexport interface ContainerRequestConditions extends LeaseAccessConditions, ModificationConditions {}\n\n/**\n * Represents the access tier on a blob.\n * For detailed information about block blob level tiering see {@link https://docs.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}\n */\nexport enum BlockBlobTier {\n /**\n * Optimized for storing data that is accessed frequently.\n */\n Hot = \"Hot\",\n /**\n * Optimized for storing data that is infrequently accessed and stored for at least 30 days.\n */\n Cool = \"Cool\",\n /**\n * Optimized for storing data that is rarely accessed and stored for at least 180 days\n * with flexible latency requirements (on the order of hours).\n */\n Archive = \"Archive\",\n}\n\n/**\n * Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.\n * Please see {@link https://docs.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}\n * for detailed information on the corresponding IOPS and throughput per PageBlobTier.\n */\nexport enum PremiumPageBlobTier {\n /**\n * P4 Tier.\n */\n P4 = \"P4\",\n /**\n * P6 Tier.\n */\n P6 = \"P6\",\n /**\n * P10 Tier.\n */\n P10 = \"P10\",\n /**\n * P15 Tier.\n */\n P15 = \"P15\",\n /**\n * P20 Tier.\n */\n P20 = \"P20\",\n /**\n * P30 Tier.\n */\n P30 = \"P30\",\n /**\n * P40 Tier.\n */\n P40 = \"P40\",\n /**\n * P50 Tier.\n */\n P50 = \"P50\",\n /**\n * P60 Tier.\n */\n P60 = \"P60\",\n /**\n * P70 Tier.\n */\n P70 = \"P70\",\n /**\n * P80 Tier.\n */\n P80 = \"P80\",\n}\n\nexport function toAccessTier(\n tier: BlockBlobTier | PremiumPageBlobTier | string | undefined\n): AccessTier | undefined {\n if (tier === undefined) {\n return undefined;\n }\n\n return tier as AccessTier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).\n}\n\nexport function ensureCpkIfSpecified(cpk: CpkInfo | undefined, isHttps: boolean): void {\n if (cpk && !isHttps) {\n throw new RangeError(\"Customer-provided encryption key must be used over HTTPS.\");\n }\n\n if (cpk && !cpk.encryptionAlgorithm) {\n cpk.encryptionAlgorithm = EncryptionAlgorithmAES25;\n }\n}\n\n/**\n * Specifies the Replication Status of a blob. This is used when a storage account has\n * Object Replication Policy(s) applied. See {@link ObjectReplicationPolicy} and {@link ObjectReplicationRule}.\n */\nexport type ObjectReplicationStatus = \"complete\" | \"failed\";\n\n/**\n * Contains the Object Replication Rule ID and {@link ObjectReplicationStatus} of a blob.\n * There can be more than one {@link ObjectReplicationRule} under a {@link ObjectReplicationPolicy}.\n */\nexport interface ObjectReplicationRule {\n /**\n * The Object Replication Rule ID.\n */\n ruleId: string;\n\n /**\n * The Replication Status\n */\n replicationStatus: ObjectReplicationStatus;\n}\n\n/**\n * Contains Object Replication Policy ID and the respective list of {@link ObjectReplicationRule}.\n * This is used when retrieving the Object Replication Properties on the source blob. The policy id for the\n * destination blob is set in ObjectReplicationDestinationPolicyId of the respective method responses\n * (e.g. {@link BlobProperties.ObjectReplicationDestinationPolicyId}.\n */\nexport interface ObjectReplicationPolicy {\n /**\n * The Object Replication Policy ID.\n */\n policyId: string;\n\n /**\n * The Rule ID(s) and respective Replication Status(s) that are under the Policy ID.\n */\n rules: ObjectReplicationRule[];\n}\n\n/**\n * Contains response data for the {@link BlobClient.download} operation.\n */\nexport interface BlobDownloadResponseParsed extends BlobDownloadResponseModel {\n /**\n * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob.\n */\n objectReplicationSourceProperties?: ObjectReplicationPolicy[];\n\n /**\n * Object Replication Policy Id of the destination blob.\n */\n objectReplicationDestinationPolicyId?: string;\n}\n\n/**\n * The type of a {@link BlobQueryArrowField}.\n */\nexport type BlobQueryArrowFieldType =\n | \"int64\"\n | \"bool\"\n | \"timestamp[ms]\"\n | \"string\"\n | \"double\"\n | \"decimal\";\n\n/**\n * Describe a field in {@link BlobQueryArrowConfiguration}.\n */\nexport interface BlobQueryArrowField {\n /**\n * The type of the field.\n */\n type: BlobQueryArrowFieldType;\n\n /**\n * The name of the field.\n */\n name?: string;\n\n /**\n * The precision of the field. Required if type is \"decimal\".\n */\n precision?: number;\n\n /**\n * The scale of the field. Required if type is is \"decimal\".\n */\n scale?: number;\n}\n\n/**\n * Describe immutable policy for blob.\n */\nexport interface BlobImmutabilityPolicy {\n /**\n * Specifies the date time when the blobs immutability policy is set to expire.\n */\n expiriesOn?: Date;\n /**\n * Specifies the immutability policy mode to set on the blob.\n */\n policyMode?: BlobImmutabilityPolicyMode;\n}\n\n/**\n * Represents authentication information in Authorization, ProxyAuthorization,\n * WWW-Authenticate, and Proxy-Authenticate header values.\n */\nexport interface HttpAuthorization {\n /**\n * The scheme to use for authorization.\n */\n scheme: string;\n\n /**\n * the credentials containing the authentication information of the user agent for the resource being requested.\n */\n value: string;\n}\n\n/**\n * Defines the known cloud audiences for Storage.\n */\nexport enum StorageBlobAudience {\n /**\n * The OAuth scope to use to retrieve an AAD token for Azure Storage.\n */\n StorageOAuthScopes = \"https://storage.azure.com/.default\",\n /**\n * The OAuth scope to use to retrieve an AAD token for Azure Disk.\n */\n DiskComputeOAuthScopes = \"https://disk.compute.azure.com/.default\",\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73,\r\n NotificationException: 74,\r\n SnippetScriptLoadFailure: 99,\r\n InvalidInstrumentationKey: 100,\r\n CannotParseAiBlobValue: 101,\r\n InvalidContentBlob: 102,\r\n TrackPageActionEventFailed: 103,\r\n FailedAddingCustomDefinedRequestContext: 104,\r\n InMemoryStorageBufferFull: 105\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import * as React from 'react';\nimport { PanelBase } from './Panel.base';\nimport type { IFocusTrapZoneProps } from '../../FocusTrapZone';\nimport type { ILayerProps } from '../../Layer';\nimport type { IOverlayProps } from '../../Overlay';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '../../Utilities';\nimport type { IButtonStyles } from '../../Button';\nimport type { IPopupProps } from '../../Popup';\n\n/**\n * {@docCategory Panel}\n */\nexport interface IPanel {\n /**\n * Forces the panel to open.\n */\n open: () => void;\n\n /**\n * Forces the panel to dismiss.\n */\n dismiss: (ev?: React.KeyboardEvent | KeyboardEvent) => void;\n}\n\n/**\n * {@docCategory Panel}\n */\nexport interface IPanelProps extends React.HTMLAttributes {\n /**\n * Optional callback to access the IPanel interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject;\n\n /**\n * Whether the panel is displayed.\n * If true, will cause panel to stay open even if dismissed.\n * If false, will cause panel to stay hidden.\n * If undefined, will allow the panel to control its own visibility through open/dismiss methods.\n * @defaultvalue undefined\n */\n isOpen?: boolean;\n\n /**\n * Has the close button visible.\n * @defaultvalue true\n */\n hasCloseButton?: boolean;\n\n /**\n * Whether the panel can be light dismissed.\n * @defaultvalue false\n */\n isLightDismiss?: boolean;\n\n /**\n * Whether the panel is hidden on dismiss, instead of destroyed in the DOM.\n * Protects the contents from being destroyed when the panel is dismissed.\n * @defaultvalue false\n */\n isHiddenOnDismiss?: boolean;\n\n /**\n * Whether the panel uses a modal overlay or not\n * @defaultvalue true\n */\n isBlocking?: boolean;\n\n /**\n * Determines if content should stretch to fill available space putting footer at the bottom of the page\n * @defaultvalue false\n */\n isFooterAtBottom?: boolean;\n\n /**\n * Header text for the Panel.\n * @defaultvalue \"\"\n */\n headerText?: string;\n\n /**\n * The props for header text container.\n */\n headerTextProps?: React.HTMLAttributes;\n\n /**\n * A callback function for when the Panel is opened, before the animation completes.\n */\n onOpen?: () => void;\n\n /**\n * A callback function for when the Panel is opened, after the animation completes.\n */\n onOpened?: () => void;\n\n /**\n * A callback function for when the panel is closed, before the animation completes.\n * If the panel should NOT be dismissed based on some keyboard event, then simply call ev.preventDefault() on it\n */\n onDismiss?: (ev?: React.SyntheticEvent | KeyboardEvent) => void;\n\n /**\n * A callback function which is called **after** the Panel is dismissed and the animation is complete.\n * (If you need to update the Panel's `isOpen` prop in response to a dismiss event, use `onDismiss` instead.)\n */\n onDismissed?: () => void;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject;\n\n /**\n * Theme provided by High-Order Component.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Panel\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Type of the panel.\n * @defaultvalue PanelType.smallFixedFar\n */\n type?: PanelType;\n\n /**\n * Custom panel width, used only when `type` is set to `PanelType.custom`.\n */\n customWidth?: string;\n\n /**\n * Aria label on close button\n */\n closeButtonAriaLabel?: string;\n\n /**\n * Optional parameter to provider the class name for header text\n */\n headerClassName?: string;\n\n /**\n * Sets the HTMLElement to focus on when exiting the FocusTrapZone.\n * @defaultvalue The `element.target` that triggered the Panel.\n */\n elementToFocusOnDismiss?: HTMLElement;\n\n /**\n * Indicates if this Panel will ignore keeping track of HTMLElement that activated the Zone.\n * @defaultvalue false\n * @deprecated Use `focusTrapZoneProps`.\n */\n ignoreExternalFocusing?: boolean;\n\n /**\n * Indicates whether Panel should force focus inside the focus trap zone.\n * If not explicitly specified, behavior aligns with FocusTrapZone's default behavior.\n * @deprecated Use `focusTrapZoneProps`.\n */\n forceFocusInsideTrap?: boolean;\n\n /**\n * Indicates the selector for first focusable item.\n * @deprecated Use `focusTrapZoneProps`.\n */\n firstFocusableSelector?: string;\n\n /**\n * Optional props to pass to the FocusTrapZone component to manage focus in the panel.\n */\n focusTrapZoneProps?: IFocusTrapZoneProps;\n\n /**\n * Optional props to pass to the Layer component hosting the panel.\n */\n layerProps?: ILayerProps;\n\n /**\n * Optional props to pass to the Overlay component that the panel uses.\n */\n overlayProps?: IOverlayProps;\n\n /**\n * Optional props to pass the Popup component that the panel uses.\n */\n popupProps?: IPopupProps;\n\n /**\n * Optional custom function to handle clicks outside the panel in lightdismiss mode\n */\n onLightDismissClick?: () => void;\n\n /**\n * Optional custom function to handle clicks outside this component\n */\n onOuterClick?: (ev?: React.MouseEvent) => void;\n\n /**\n * Optional custom renderer navigation region. Replaces the region that contains the close button.\n */\n onRenderNavigation?: IRenderFunction;\n\n /**\n * Optional custom renderer for content in the navigation region. Replaces current close button.\n */\n onRenderNavigationContent?: IRenderFunction;\n\n /**\n * Optional custom renderer for header region. Replaces current title\n */\n onRenderHeader?: IPanelHeaderRenderer;\n\n /**\n * Optional custom renderer for body region. Replaces any children passed into the component.\n */\n onRenderBody?: IRenderFunction;\n\n /**\n * Optional custom renderer for footer region. Replaces sticky footer.\n */\n onRenderFooter?: IRenderFunction;\n\n /**\n * Custom renderer for content in the sticky footer\n */\n onRenderFooterContent?: IRenderFunction;\n\n /**\n * @deprecated Not used.\n */\n componentId?: string;\n\n /**\n * Allow body scroll on content and overlay on touch devices. Changing after mounting has no effect.\n * @defaultvalue false\n */\n allowTouchBodyScroll?: boolean;\n}\n\n/**\n * Renderer function which takes an additional parameter, the ID to use for the element containing\n * the panel's title. This allows the `aria-labelledby` for the panel popup to work correctly.\n * Note that if `headerTextId` is provided, it **must** be used on an element, or screen readers\n * will be confused by the reference to a nonexistent ID.\n * {@docCategory Panel}\n */\nexport interface IPanelHeaderRenderer extends IRenderFunction {\n /**\n * @param props - Props given to the panel\n * @param defaultRender - Default header renderer. If using this renderer in code that does not\n * assign `headerTextId` to an element elsewhere, it **must** be passed to this function.\n * @param headerTextId - If provided, this **must** be used as the ID of an element containing the\n * panel's title, because the panel popup uses this ID as its aria-labelledby.\n */\n (props?: IPanelProps, defaultRender?: IPanelHeaderRenderer, headerTextId?: string | undefined): JSX.Element | null;\n}\n\n/**\n * {@docCategory Panel}\n */\nexport enum PanelType {\n /**\n * Renders the Panel with a `fluid` (full screen) width.\n * Recommended for use on small screen breakpoints.\n * - Small (320-479): full screen width, 16px left/right padding\n * - Medium (480-639): full screen width, 16px left/right padding\n * - Large (640-1023): full screen width, 32px left/right padding\n * - XLarge (1024-1365): full screen width, 32px left/right padding\n * - XXLarge (1366-up): full screen width, 40px left/right padding\n */\n smallFluid = 0,\n\n /**\n * Renders the Panel in fixed-width `small` size, anchored to the far side (right in LTR mode).\n * - Small (320-479): adapts to `PanelType.smallFluid` at this breakpoint\n * - Medium (480-639): 340px width, 16px left/right padding\n * - Large (640-1023): 340px width, 32px left/right padding\n * - XLarge (1024-1365): 340px width, 32px left/right padding\n * - XXLarge (1366-up): 340px width, 40px left/right padding\n */\n smallFixedFar = 1,\n\n /**\n * Renders the Panel in fixed-width `small` size, anchored to the near side (left in LTR mode).\n * - Small (320-479): 272px width, 16px left/right padding\n * - Medium (480-639): 272px width, 16px left/right padding\n * - Large (640-1023): 272px width, 32px left/right padding\n * - XLarge (1024-1365): 272px width, 32px left/right padding\n * - XXLarge (1366-up): 272px width, 40px left/right padding\n */\n smallFixedNear = 2,\n\n /**\n * Renders the Panel in `medium` size, anchored to the far side (right in LTR mode).\n * - Small (320-479): adapts to `PanelType.smallFluid` at this breakpoint\n * - Medium (480-639): adapts to `PanelType.smallFixedFar` at this breakpoint\n * - Large (640-1023): 592px width, 32px left/right padding\n * - XLarge (1024-1365): 644px width, 32px left/right padding\n * - XXLarge (1366-up): 644px width, 40px left/right padding\n */\n medium = 3,\n\n /**\n * Renders the Panel in `large` size, anchored to the far side (right in LTR mode).\n * - Small (320-479): adapts to `PanelType.smallFluid` at this breakpoint\n * - Medium (480-639): adapts to `PanelType.smallFixedFar` at this breakpoint\n * - Large (640-1023): adapts to `PanelType.medium` at this breakpoint\n * - XLarge (1024-1365): 48px fixed left margin, fluid width, 32px left/right padding\n * - XXLarge (1366-up): 428px fixed left margin, fluid width, 40px left/right padding\n */\n large = 4,\n\n /**\n * Renders the Panel in `large` size, anchored to the far side (right in LTR mode), with a fixed width at\n * XX-Large breakpoint.\n * - Small (320-479): adapts to `PanelType.smallFluid` at this breakpoint\n * - Medium (480-639): adapts to `PanelType.smallFixedFar` at this breakpoint\n * - Large (640-1023): adapts to `PanelType.medium` at this breakpoint\n * - XLarge (1024-1365): 48px fixed left margin, fluid width, 32px left/right padding\n * - XXLarge (1366-up): 940px width, 40px left/right padding\n */\n largeFixed = 5,\n\n /**\n * Renders the Panel in `extra large` size, anchored to the far side (right in LTR mode).\n * - Small (320-479): adapts to `PanelType.smallFluid` at this breakpoint\n * - Medium (480-639): adapts to `PanelType.smallFixedFar` at this breakpoint\n * - Large (640-1023): adapts to `PanelType.medium` at this breakpoint\n * - XLarge (1024-1365): adapts to `PanelType.large` at this breakpoint\n * - XXLarge (1366-1919): 176px fixed left margin, fluid width, 40px left/right padding\n * - XXXLarge (1920-up): 176px fixed left margin, fluid width, 40px left/right padding\n */\n extraLarge = 6,\n\n /**\n * Renders the Panel in `custom` size using `customWidth`, anchored to the far side (right in LTR mode).\n * - Has a fixed width provided by the `customWidth` prop\n * - When screen width reaches the `customWidth` value it will behave like a fluid width Panel\n * taking up 100% of the viewport width\n */\n custom = 7,\n\n /**\n * Renders the Panel in `custom` size using `customWidth`, anchored to the near side (left in LTR mode).\n * - Has a fixed width provided by the `customWidth` prop\n * - When screen width reaches the `customWidth` value it will behave like a fluid width Panel\n * taking up 100% of the viewport width\n */\n customNear = 8,\n}\n\n/**\n * {@docCategory Panel}\n */\nexport interface IPanelStyleProps {\n /**\n * Theme provided by High-Order Component.\n */\n theme: ITheme;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * Is Panel open\n */\n isOpen?: boolean;\n\n /**\n * Is animation currently running\n */\n isAnimating?: boolean;\n\n /**\n * Is panel on right side\n */\n isOnRightSide?: boolean;\n\n /**\n * Is panel hidden on dismiss\n */\n isHiddenOnDismiss?: boolean;\n\n /**\n * Classname for FocusTrapZone element\n */\n focusTrapZoneClassName?: string;\n\n /**\n * Determines if content should stretch to fill available space putting footer at the bottom of the page\n */\n isFooterAtBottom?: boolean;\n\n /**\n * Based on state value setting footer to sticky or not\n */\n isFooterSticky?: boolean;\n\n /**\n * Panel has close button\n */\n hasCloseButton?: boolean;\n\n /**\n * Type of the panel.\n */\n type?: PanelType;\n\n /**\n * Optional parameter to provider the class name for header text\n */\n headerClassName?: string;\n\n /**\n * Determines where the header is rendered based on whether the user\n * has passed in a custom onRenderNavigation or onRenderNavigationContent render callback\n */\n hasCustomNavigation?: boolean;\n}\n\nexport interface IPanelSubComponentStyles {\n /**\n * Styling for close button child component.\n */\n closeButton: Partial;\n}\n\n/**\n * {@docCategory Panel}\n */\nexport interface IPanelStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n\n /**\n * Style for the overlay element.\n */\n overlay: IStyle;\n\n /**\n * Style for the hidden element.\n */\n hiddenPanel: IStyle;\n\n /**\n * Style for the main section element.\n */\n main: IStyle;\n\n /**\n * Style for the navigation container element.\n */\n commands: IStyle;\n\n /**\n * Style for the Body and Footer container element.\n */\n contentInner: IStyle;\n\n /**\n * Style for the scrollable content area container element.\n */\n scrollableContent: IStyle;\n\n /**\n * Style for the close button container element.\n */\n navigation: IStyle;\n\n /**\n * Style for the close button IconButton element.\n * @deprecated Use `subComponentStyles.closeButton` instead.\n */\n closeButton?: IStyle;\n\n /**\n * Style for the header container div element.\n */\n header: IStyle;\n\n /**\n * Style for the header text div element.\n */\n headerText: IStyle;\n\n /**\n * Style for the body div element.\n */\n content: IStyle;\n\n /**\n * Style for the footer div element.\n */\n footer: IStyle;\n\n /**\n * Style for the inner footer div element.\n */\n footerInner: IStyle;\n\n /**\n * Styling for subcomponents.\n */\n subComponentStyles: IPanelSubComponentStyles;\n}\n","import {\n AnimationClassNames,\n AnimationStyles,\n HighContrastSelector,\n getFocusStyle,\n getGlobalClassNames,\n FontWeights,\n getHighContrastNoAdjustStyle,\n} from '../../Styling';\nimport { IsFocusVisibleClassName } from '../../Utilities';\nimport { GlobalClassNames as LinkGlobalClassNames } from '../../components/Link/Link.styles';\nimport type { IDetailsRowStyleProps, IDetailsRowStyles, ICellStyleProps } from './DetailsRow.types';\nimport type { IStyle } from '../../Styling';\n\nexport const DetailsRowGlobalClassNames = {\n root: 'ms-DetailsRow',\n // TODO: in Fabric 7.0 lowercase the 'Compact' for consistency across other components.\n compact: 'ms-DetailsList--Compact',\n cell: 'ms-DetailsRow-cell',\n cellAnimation: 'ms-DetailsRow-cellAnimation',\n cellCheck: 'ms-DetailsRow-cellCheck',\n check: 'ms-DetailsRow-check',\n cellMeasurer: 'ms-DetailsRow-cellMeasurer',\n listCellFirstChild: 'ms-List-cell:first-child',\n isContentUnselectable: 'is-contentUnselectable',\n isSelected: 'is-selected',\n isCheckVisible: 'is-check-visible',\n isRowHeader: 'is-row-header',\n fields: 'ms-DetailsRow-fields',\n};\nconst IsFocusableSelector = \"[data-is-focusable='true']\";\n\nexport const DEFAULT_CELL_STYLE_PROPS: ICellStyleProps = {\n cellLeftPadding: 12,\n cellRightPadding: 8,\n cellExtraRightPadding: 24,\n};\n\n// Source of default row heights to share.\nexport const DEFAULT_ROW_HEIGHTS = {\n rowHeight: 42,\n compactRowHeight: 32,\n};\n\n// Constant values\nconst values = {\n ...DEFAULT_ROW_HEIGHTS,\n rowVerticalPadding: 11,\n compactRowVerticalPadding: 6,\n};\n\nexport const getDetailsRowStyles = (props: IDetailsRowStyleProps): IDetailsRowStyles => {\n const {\n theme,\n isSelected,\n canSelect,\n droppingClassName,\n isCheckVisible,\n checkboxCellClassName,\n compact,\n className,\n cellStyleProps = DEFAULT_CELL_STYLE_PROPS,\n enableUpdateAnimations,\n disabled,\n } = props;\n\n const { palette, fonts } = theme;\n const { neutralPrimary, white, neutralSecondary, neutralLighter, neutralLight, neutralDark, neutralQuaternaryAlt } =\n palette;\n const { focusBorder, linkHovered: focusedLinkColor } = theme.semanticColors;\n\n const classNames = getGlobalClassNames(DetailsRowGlobalClassNames, theme);\n\n const colors = {\n // Default\n defaultHeaderText: neutralPrimary,\n defaultMetaText: neutralSecondary,\n defaultBackground: white,\n\n // Default Hover\n defaultHoverHeaderText: neutralDark,\n defaultHoverMetaText: neutralPrimary,\n defaultHoverBackground: neutralLighter,\n\n // Selected\n selectedHeaderText: neutralDark,\n selectedMetaText: neutralPrimary,\n selectedBackground: neutralLight,\n\n // Selected Hover\n selectedHoverHeaderText: neutralDark,\n selectedHoverMetaText: neutralPrimary,\n selectedHoverBackground: neutralQuaternaryAlt,\n\n // Focus\n focusHeaderText: neutralDark,\n focusMetaText: neutralPrimary,\n focusBackground: neutralLight,\n focusHoverBackground: neutralQuaternaryAlt,\n };\n\n const rowHighContrastFocus = {\n top: 2,\n right: 2,\n bottom: 2,\n left: 2,\n };\n\n // Selected row styles\n const selectedStyles: IStyle = [\n getFocusStyle(theme, {\n inset: -1,\n borderColor: focusBorder,\n outlineColor: white,\n highContrastStyle: rowHighContrastFocus,\n pointerEvents: 'none',\n }),\n classNames.isSelected,\n {\n color: colors.selectedMetaText,\n background: colors.selectedBackground,\n borderBottom: `1px solid ${white}`,\n selectors: {\n '&:before': {\n position: 'absolute',\n display: 'block',\n top: -1,\n height: 1,\n bottom: 0,\n left: 0,\n right: 0,\n content: '',\n borderTop: `1px solid ${white}`,\n },\n\n [`.${classNames.cell} > .${LinkGlobalClassNames.root}`]: {\n color: focusedLinkColor,\n selectors: {\n [HighContrastSelector]: {\n color: 'HighlightText',\n },\n },\n },\n\n // Selected State hover\n '&:hover': {\n background: colors.selectedHoverBackground,\n color: colors.selectedHoverMetaText,\n selectors: {\n // Selected State hover meta cell\n [HighContrastSelector]: {\n background: 'Highlight',\n selectors: {\n [`.${classNames.cell}`]: {\n color: 'HighlightText',\n },\n [`.${classNames.cell} > .${LinkGlobalClassNames.root}`]: {\n forcedColorAdjust: 'none',\n color: 'HighlightText',\n },\n },\n },\n\n // Selected State hover Header cell\n [`.${classNames.isRowHeader}`]: {\n color: colors.selectedHoverHeaderText,\n selectors: {\n [HighContrastSelector]: {\n color: 'HighlightText',\n },\n },\n },\n },\n },\n\n // Focus state\n '&:focus': {\n background: colors.focusBackground,\n selectors: {\n // Selected State hover meta cell\n [`.${classNames.cell}`]: {\n color: colors.focusMetaText,\n selectors: {\n [HighContrastSelector]: {\n color: 'HighlightText',\n selectors: {\n '> a': {\n color: 'HighlightText',\n },\n },\n },\n },\n },\n\n // Row header cell\n [`.${classNames.isRowHeader}`]: {\n color: colors.focusHeaderText,\n selectors: {\n [HighContrastSelector]: {\n color: 'HighlightText',\n },\n },\n },\n\n // Ensure high-contrast mode overrides default focus background\n [HighContrastSelector]: {\n background: 'Highlight',\n },\n },\n },\n\n [HighContrastSelector]: {\n background: 'Highlight',\n color: 'HighlightText',\n ...getHighContrastNoAdjustStyle(),\n selectors: {\n a: {\n color: 'HighlightText',\n },\n },\n },\n\n // Focus and hover state\n '&:focus:hover': {\n background: colors.focusHoverBackground,\n },\n },\n },\n ];\n\n const cannotSelectStyles: IStyle = [\n classNames.isContentUnselectable,\n {\n userSelect: 'none',\n cursor: 'default',\n },\n ];\n\n const rootCompactStyles: IStyle = {\n minHeight: values.compactRowHeight,\n border: 0,\n };\n\n const cellCompactStyles: IStyle = {\n minHeight: values.compactRowHeight,\n paddingTop: values.compactRowVerticalPadding,\n paddingBottom: values.compactRowVerticalPadding,\n paddingLeft: `${cellStyleProps.cellLeftPadding}px`,\n };\n\n const defaultCellStyles: IStyle = [\n getFocusStyle(theme, { inset: -1 }),\n classNames.cell,\n {\n display: 'inline-block',\n position: 'relative',\n boxSizing: 'border-box',\n minHeight: values.rowHeight,\n verticalAlign: 'top',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n paddingTop: values.rowVerticalPadding,\n paddingBottom: values.rowVerticalPadding,\n paddingLeft: `${cellStyleProps.cellLeftPadding}px`,\n selectors: {\n '& > button': {\n maxWidth: '100%',\n },\n\n [IsFocusableSelector]: getFocusStyle(theme, { inset: -1, borderColor: neutralSecondary, outlineColor: white }),\n },\n },\n\n isSelected && {\n selectors: {\n [HighContrastSelector]: {\n background: 'Highlight',\n color: 'HighlightText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n\n compact && cellCompactStyles,\n disabled && { opacity: 0.5 },\n ];\n\n return {\n root: [\n classNames.root,\n AnimationClassNames.fadeIn400,\n droppingClassName,\n theme.fonts.small,\n isCheckVisible && classNames.isCheckVisible,\n getFocusStyle(theme, { borderColor: focusBorder, outlineColor: white }),\n {\n borderBottom: `1px solid ${neutralLighter}`,\n background: colors.defaultBackground,\n color: colors.defaultMetaText,\n // This ensures that the row always tries to consume is minimum width and does not compress.\n display: 'inline-flex',\n minWidth: '100%',\n minHeight: values.rowHeight,\n whiteSpace: 'nowrap',\n padding: 0,\n boxSizing: 'border-box',\n verticalAlign: 'top',\n textAlign: 'left',\n selectors: {\n [`.${classNames.listCellFirstChild} &:before`]: {\n display: 'none',\n },\n\n '&:hover': {\n background: colors.defaultHoverBackground,\n color: colors.defaultHoverMetaText,\n selectors: {\n [`.${classNames.isRowHeader}`]: {\n color: colors.defaultHoverHeaderText,\n },\n\n [`.${classNames.cell} > .${LinkGlobalClassNames.root}`]: {\n color: focusedLinkColor,\n },\n },\n },\n\n [`&:hover .${classNames.check}`]: {\n opacity: 1,\n },\n\n [`.${IsFocusVisibleClassName} &:focus .${classNames.check}`]: {\n opacity: 1,\n },\n\n '.ms-GroupSpacer': {\n flexShrink: 0,\n flexGrow: 0,\n },\n },\n },\n isSelected && selectedStyles,\n !canSelect && cannotSelectStyles,\n compact && rootCompactStyles,\n className,\n ],\n\n cellUnpadded: {\n paddingRight: `${cellStyleProps.cellRightPadding}px`,\n },\n\n cellPadded: {\n paddingRight: `${cellStyleProps.cellExtraRightPadding + cellStyleProps.cellRightPadding}px`,\n selectors: {\n [`&.${classNames.cellCheck}`]: {\n paddingRight: 0,\n },\n },\n },\n\n cell: defaultCellStyles,\n cellAnimation: enableUpdateAnimations && AnimationStyles.slideLeftIn40,\n cellMeasurer: [\n classNames.cellMeasurer,\n {\n overflow: 'visible',\n whiteSpace: 'nowrap',\n },\n ],\n checkCell: [\n defaultCellStyles,\n classNames.cellCheck,\n checkboxCellClassName,\n {\n padding: 0,\n // Ensure that the check cell covers the top border of the cell.\n // This ensures the click target does not leave a spot which would\n // cause other items to be deselected.\n paddingTop: 1,\n marginTop: -1,\n flexShrink: 0,\n },\n ],\n fields: [\n classNames.fields,\n {\n display: 'flex',\n alignItems: 'stretch',\n },\n ],\n isRowHeader: [\n classNames.isRowHeader,\n {\n color: colors.defaultHeaderText,\n fontSize: fonts.medium.fontSize,\n },\n isSelected && {\n color: colors.selectedHeaderText,\n fontWeight: FontWeights.semibold,\n selectors: {\n [HighContrastSelector]: {\n color: 'HighlightText',\n },\n },\n },\n ],\n isMultiline: [\n defaultCellStyles,\n {\n whiteSpace: 'normal',\n wordBreak: 'break-word',\n textOverflow: 'clip',\n },\n ],\n check: [classNames.check],\n };\n};\n","import { canUseDOM } from './canUseDOM';\n\n/**\n * Helper to get the document object. Note that in popup window cases, document\n * might be the wrong document, which is why we look at ownerDocument for the\n * truth.\n *\n * @public\n */\nexport function getDocument(rootElement?: HTMLElement | null): Document | undefined {\n if (!canUseDOM() || typeof document === 'undefined') {\n return undefined;\n } else {\n const el = rootElement as Element;\n\n return el && el.ownerDocument ? el.ownerDocument : document;\n }\n}\n","import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n return (\n child &&\n ((allowVirtualParents && getVirtualParent(child)) || (child.parentNode && (child.parentNode as HTMLElement)))\n );\n}\n","import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n *\n * @public\n */\nexport function getVirtualParent(child: HTMLElement): HTMLElement | undefined {\n let parent: HTMLElement | undefined;\n if (child && isVirtualElement(child)) {\n parent = child._virtual.parent;\n }\n return parent;\n}\n","import { IVirtualElement } from './IVirtualElement';\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n *\n * @public\n */\nexport function isVirtualElement(element: HTMLElement | IVirtualElement): element is IVirtualElement {\n return element && !!(element)._virtual;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortError } from \"@azure/abort-controller\";\n\nimport {\n AbortSignalLike,\n BaseRequestPolicy,\n HttpOperationResponse,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptions,\n RestError,\n WebResource,\n} from \"@azure/core-http\";\n\nimport { StorageRetryOptions } from \"../StorageRetryPolicyFactory\";\nimport { URLConstants } from \"../utils/constants\";\nimport { delay, setURLHost, setURLParameter } from \"../utils/utils.common\";\nimport { logger } from \"../log\";\n\n/**\n * A factory method used to generated a RetryPolicy factory.\n *\n * @param retryOptions -\n */\nexport function NewRetryPolicyFactory(retryOptions?: StorageRetryOptions): RequestPolicyFactory {\n return {\n create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy => {\n return new StorageRetryPolicy(nextPolicy, options, retryOptions);\n },\n };\n}\n\n/**\n * RetryPolicy types.\n */\nexport enum StorageRetryPolicyType {\n /**\n * Exponential retry. Retry time delay grows exponentially.\n */\n EXPONENTIAL,\n /**\n * Linear retry. Retry time delay grows linearly.\n */\n FIXED,\n}\n\n// Default values of StorageRetryOptions\nconst DEFAULT_RETRY_OPTIONS: StorageRetryOptions = {\n maxRetryDelayInMs: 120 * 1000,\n maxTries: 4,\n retryDelayInMs: 4 * 1000,\n retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,\n secondaryHost: \"\",\n tryTimeoutInMs: undefined, // Use server side default timeout strategy\n};\n\nconst RETRY_ABORT_ERROR = new AbortError(\"The operation was aborted.\");\n\n/**\n * Retry policy with exponential retry and linear retry implemented.\n */\nexport class StorageRetryPolicy extends BaseRequestPolicy {\n /**\n * RetryOptions.\n */\n private readonly retryOptions: StorageRetryOptions;\n\n /**\n * Creates an instance of RetryPolicy.\n *\n * @param nextPolicy -\n * @param options -\n * @param retryOptions -\n */\n constructor(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n retryOptions: StorageRetryOptions = DEFAULT_RETRY_OPTIONS\n ) {\n super(nextPolicy, options);\n\n // Initialize retry options\n this.retryOptions = {\n retryPolicyType: retryOptions.retryPolicyType\n ? retryOptions.retryPolicyType\n : DEFAULT_RETRY_OPTIONS.retryPolicyType,\n\n maxTries:\n retryOptions.maxTries && retryOptions.maxTries >= 1\n ? Math.floor(retryOptions.maxTries)\n : DEFAULT_RETRY_OPTIONS.maxTries,\n\n tryTimeoutInMs:\n retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0\n ? retryOptions.tryTimeoutInMs\n : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,\n\n retryDelayInMs:\n retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0\n ? Math.min(\n retryOptions.retryDelayInMs,\n retryOptions.maxRetryDelayInMs\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs!\n )\n : DEFAULT_RETRY_OPTIONS.retryDelayInMs,\n\n maxRetryDelayInMs:\n retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,\n\n secondaryHost: retryOptions.secondaryHost\n ? retryOptions.secondaryHost\n : DEFAULT_RETRY_OPTIONS.secondaryHost,\n };\n }\n\n /**\n * Sends request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise {\n return this.attemptSendRequest(request, false, 1);\n }\n\n /**\n * Decide and perform next retry. Won't mutate request parameter.\n *\n * @param request -\n * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then\n * the resource was not found. This may be due to replication delay. So, in this\n * case, we'll never try the secondary again for this operation.\n * @param attempt - How many retries has been attempted to performed, starting from 1, which includes\n * the attempt will be performed by this method call.\n */\n protected async attemptSendRequest(\n request: WebResource,\n secondaryHas404: boolean,\n attempt: number\n ): Promise {\n const newRequest: WebResource = request.clone();\n\n const isPrimaryRetry =\n secondaryHas404 ||\n !this.retryOptions.secondaryHost ||\n !(request.method === \"GET\" || request.method === \"HEAD\" || request.method === \"OPTIONS\") ||\n attempt % 2 === 1;\n\n if (!isPrimaryRetry) {\n newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost!);\n }\n\n // Set the server-side timeout query parameter \"timeout=[seconds]\"\n if (this.retryOptions.tryTimeoutInMs) {\n newRequest.url = setURLParameter(\n newRequest.url,\n URLConstants.Parameters.TIMEOUT,\n Math.floor(this.retryOptions.tryTimeoutInMs! / 1000).toString()\n );\n }\n\n let response: HttpOperationResponse | undefined;\n try {\n logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? \"Primary\" : \"Secondary\"}`);\n response = await this._nextPolicy.sendRequest(newRequest);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {\n return response;\n }\n\n secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);\n } catch (err) {\n logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {\n throw err;\n }\n }\n\n await this.delay(isPrimaryRetry, attempt, request.abortSignal);\n return this.attemptSendRequest(request, secondaryHas404, ++attempt);\n }\n\n /**\n * Decide whether to retry according to last HTTP response and retry counters.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param response -\n * @param err -\n */\n protected shouldRetry(\n isPrimaryRetry: boolean,\n attempt: number,\n response?: HttpOperationResponse,\n err?: RestError\n ): boolean {\n if (attempt >= this.retryOptions.maxTries!) {\n logger.info(\n `RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions\n .maxTries!}, no further try.`\n );\n return false;\n }\n\n // Handle network failures, you may need to customize the list when you implement\n // your own http client\n const retriableErrors = [\n \"ETIMEDOUT\",\n \"ESOCKETTIMEDOUT\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"ENOENT\",\n \"ENOTFOUND\",\n \"TIMEOUT\",\n \"EPIPE\",\n \"REQUEST_SEND_ERROR\", // For default xhr based http client provided in ms-rest-js\n ];\n if (err) {\n for (const retriableError of retriableErrors) {\n if (\n err.name.toUpperCase().includes(retriableError) ||\n err.message.toUpperCase().includes(retriableError) ||\n (err.code && err.code.toString().toUpperCase() === retriableError)\n ) {\n logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);\n return true;\n }\n }\n }\n\n // If attempt was against the secondary & it returned a StatusNotFound (404), then\n // the resource was not found. This may be due to replication delay. So, in this\n // case, we'll never try the secondary again for this operation.\n if (response || err) {\n const statusCode = response ? response.status : err ? err.statusCode : 0;\n if (!isPrimaryRetry && statusCode === 404) {\n logger.info(`RetryPolicy: Secondary access with 404, will retry.`);\n return true;\n }\n\n // Server internal error or server timeout\n if (statusCode === 503 || statusCode === 500) {\n logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);\n return true;\n }\n }\n\n if (err?.code === \"PARSE_ERROR\" && err?.message.startsWith(`Error \"Error: Unclosed root tag`)) {\n logger.info(\n \"RetryPolicy: Incomplete XML response likely due to service timeout, will retry.\"\n );\n return true;\n }\n\n return false;\n }\n\n /**\n * Delay a calculated time between retries.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param abortSignal -\n */\n private async delay(isPrimaryRetry: boolean, attempt: number, abortSignal?: AbortSignalLike) {\n let delayTimeInMs: number = 0;\n\n if (isPrimaryRetry) {\n switch (this.retryOptions.retryPolicyType) {\n case StorageRetryPolicyType.EXPONENTIAL:\n delayTimeInMs = Math.min(\n (Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs!,\n this.retryOptions.maxRetryDelayInMs!\n );\n break;\n case StorageRetryPolicyType.FIXED:\n delayTimeInMs = this.retryOptions.retryDelayInMs!;\n break;\n }\n } else {\n delayTimeInMs = Math.random() * 1000;\n }\n\n logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);\n return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The `@azure/logger` configuration for this package.\n */\nexport const logger = createClientLogger(\"storage-blob\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n BaseRequestPolicy,\n HttpOperationResponse,\n isNode,\n RequestPolicy,\n RequestPolicyOptions,\n WebResource,\n} from \"@azure/core-http\";\n\nimport { HeaderConstants, URLConstants } from \"../utils/constants\";\nimport { setURLParameter } from \"../utils/utils.common\";\n\n/**\n * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:\n *\n * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.\n * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL\n * thus avoid the browser cache.\n *\n * 2. Remove cookie header for security\n *\n * 3. Remove content-length header to avoid browsers warning\n */\nexport class StorageBrowserPolicy extends BaseRequestPolicy {\n /**\n * Creates an instance of StorageBrowserPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) {\n super(nextPolicy, options);\n }\n\n /**\n * Sends out request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise {\n if (isNode) {\n return this._nextPolicy.sendRequest(request);\n }\n\n if (request.method.toUpperCase() === \"GET\" || request.method.toUpperCase() === \"HEAD\") {\n request.url = setURLParameter(\n request.url,\n URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,\n new Date().getTime().toString()\n );\n }\n\n request.headers.remove(HeaderConstants.COOKIE);\n\n // According to XHR standards, content-length should be fully controlled by browsers\n request.headers.remove(HeaderConstants.CONTENT_LENGTH);\n\n return this._nextPolicy.sendRequest(request);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from \"@azure/core-http\";\nimport { StorageBrowserPolicy } from \"./policies/StorageBrowserPolicy\";\nexport { StorageBrowserPolicy };\n\n/**\n * StorageBrowserPolicyFactory is a factory class helping generating StorageBrowserPolicy objects.\n */\nexport class StorageBrowserPolicyFactory implements RequestPolicyFactory {\n /**\n * Creates a StorageBrowserPolicyFactory object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageBrowserPolicy {\n return new StorageBrowserPolicy(nextPolicy, options);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from \"@azure/core-http\";\nimport { StorageRetryPolicy, StorageRetryPolicyType } from \"./policies/StorageRetryPolicy\";\n\nexport { StorageRetryPolicyType, StorageRetryPolicy };\n\n/**\n * Storage Blob retry options interface.\n */\nexport interface StorageRetryOptions {\n /**\n * Optional. StorageRetryPolicyType, default is exponential retry policy.\n */\n readonly retryPolicyType?: StorageRetryPolicyType;\n\n /**\n * Optional. Max try number of attempts, default is 4.\n * A value of 1 means 1 try and no retries.\n * A value smaller than 1 means default retry number of attempts.\n */\n readonly maxTries?: number;\n\n /**\n * Optional. Indicates the maximum time in ms allowed for any single try of an HTTP request.\n * A value of zero or undefined means no default timeout on SDK client, Azure\n * Storage server's default timeout policy will be used.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations\n */\n readonly tryTimeoutInMs?: number;\n\n /**\n * Optional. Specifies the amount of delay to use before retrying an operation (default is 4s or 4 * 1000ms).\n * The delay increases (exponentially or linearly) with each retry up to a maximum specified by\n * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs.\n */\n readonly retryDelayInMs?: number;\n\n /**\n * Optional. Specifies the maximum delay allowed before retrying an operation (default is 120s or 120 * 1000ms).\n * If you specify 0, then you must also specify 0 for retryDelayInMs.\n */\n readonly maxRetryDelayInMs?: number;\n\n /**\n * If a secondaryHost is specified, retries will be tried against this host. If secondaryHost is undefined\n * (the default) then operations are not retried against another host.\n *\n * NOTE: Before setting this field, make sure you understand the issues around\n * reading stale and potentially-inconsistent data at\n * {@link https://docs.microsoft.com/en-us/azure/storage/common/storage-designing-ha-apps-with-ragrs}\n */\n readonly secondaryHost?: string;\n}\n\n/**\n * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.\n */\nexport class StorageRetryPolicyFactory implements RequestPolicyFactory {\n private retryOptions?: StorageRetryOptions;\n\n /**\n * Creates an instance of StorageRetryPolicyFactory.\n * @param retryOptions -\n */\n constructor(retryOptions?: StorageRetryOptions) {\n this.retryOptions = retryOptions;\n }\n\n /**\n * Creates a StorageRetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy {\n return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DefaultHttpClient } from \"@azure/core-http\";\nimport { IHttpClient } from \"../Pipeline\";\n\nconst _defaultHttpClient = new DefaultHttpClient();\n\nexport function getCachedDefaultHttpClient(): IHttpClient {\n return _defaultHttpClient;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccessToken, GetTokenOptions, TokenCredential, URLBuilder } from \"@azure/core-http\";\nimport {\n BaseRequestPolicy,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptions,\n} from \"@azure/core-http\";\nimport { HttpOperationResponse } from \"@azure/core-http\";\nimport { WebResourceLike } from \"@azure/core-http\";\nimport { delay } from \"@azure/core-http\";\n\n/**\n * A set of constants used internally when processing requests.\n */\nconst Constants = {\n DefaultScope: \"/.default\",\n /**\n * Defines constants for use with HTTP headers.\n */\n HeaderConstants: {\n /**\n * The Authorization header.\n */\n AUTHORIZATION: \"authorization\",\n },\n};\n\n// #region Access Token Cycler\n\n/**\n * A function that gets a promise of an access token and allows providing\n * options.\n *\n * @param options - the options to pass to the underlying token provider\n */\ntype AccessTokenGetter = (options: GetTokenOptions) => Promise;\n\ninterface TokenCyclerOptions {\n /**\n * The window of time before token expiration during which the token will be\n * considered unusable due to risk of the token expiring before sending the\n * request.\n *\n * This will only become meaningful if the refresh fails for over\n * (refreshWindow - forcedRefreshWindow) milliseconds.\n */\n forcedRefreshWindowInMs: number;\n /**\n * Interval in milliseconds to retry failed token refreshes.\n */\n retryIntervalInMs: number;\n /**\n * The window of time before token expiration during which\n * we will attempt to refresh the token.\n */\n refreshWindowInMs: number;\n}\n\n// Default options for the cycler if none are provided\nconst DEFAULT_CYCLER_OPTIONS: TokenCyclerOptions = {\n forcedRefreshWindowInMs: 1000, // Force waiting for a refresh 1s before the token expires\n retryIntervalInMs: 3000, // Allow refresh attempts every 3s\n refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry\n};\n\n/**\n * Converts an an unreliable access token getter (which may resolve with null)\n * into an AccessTokenGetter by retrying the unreliable getter in a regular\n * interval.\n *\n * @param getAccessToken - a function that produces a promise of an access\n * token that may fail by returning null\n * @param retryIntervalInMs - the time (in milliseconds) to wait between retry\n * attempts\n * @param timeoutInMs - the timestamp after which the refresh attempt will fail,\n * throwing an exception\n * @returns - a promise that, if it resolves, will resolve with an access token\n */\nasync function beginRefresh(\n getAccessToken: () => Promise,\n retryIntervalInMs: number,\n timeoutInMs: number\n): Promise {\n // This wrapper handles exceptions gracefully as long as we haven't exceeded\n // the timeout.\n async function tryGetAccessToken(): Promise {\n if (Date.now() < timeoutInMs) {\n try {\n return await getAccessToken();\n } catch {\n return null;\n }\n } else {\n const finalToken = await getAccessToken();\n\n // Timeout is up, so throw if it's still null\n if (finalToken === null) {\n throw new Error(\"Failed to refresh access token.\");\n }\n\n return finalToken;\n }\n }\n\n let token: AccessToken | null = await tryGetAccessToken();\n\n while (token === null) {\n await delay(retryIntervalInMs);\n\n token = await tryGetAccessToken();\n }\n\n return token;\n}\n\n/**\n * Creates a token cycler from a credential, scopes, and optional settings.\n *\n * A token cycler represents a way to reliably retrieve a valid access token\n * from a TokenCredential. It will handle initializing the token, refreshing it\n * when it nears expiration, and synchronizes refresh attempts to avoid\n * concurrency hazards.\n *\n * @param credential - the underlying TokenCredential that provides the access\n * token\n * @param scopes - the scopes to request authorization for\n * @param tokenCyclerOptions - optionally override default settings for the cycler\n *\n * @returns - a function that reliably produces a valid access token\n */\nfunction createTokenCycler(\n credential: TokenCredential,\n scopes: string | string[],\n tokenCyclerOptions?: Partial\n): AccessTokenGetter {\n let refreshWorker: Promise | null = null;\n let token: AccessToken | null = null;\n\n const options = {\n ...DEFAULT_CYCLER_OPTIONS,\n ...tokenCyclerOptions,\n };\n\n /**\n * This little holder defines several predicates that we use to construct\n * the rules of refreshing the token.\n */\n const cycler = {\n /**\n * Produces true if a refresh job is currently in progress.\n */\n get isRefreshing(): boolean {\n return refreshWorker !== null;\n },\n /**\n * Produces true if the cycler SHOULD refresh (we are within the refresh\n * window and not already refreshing)\n */\n get shouldRefresh(): boolean {\n return (\n !cycler.isRefreshing &&\n (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now()\n );\n },\n /**\n * Produces true if the cycler MUST refresh (null or nearly-expired\n * token).\n */\n get mustRefresh(): boolean {\n return (\n token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()\n );\n },\n };\n\n /**\n * Starts a refresh job or returns the existing job if one is already\n * running.\n */\n function refresh(getTokenOptions: GetTokenOptions): Promise {\n if (!cycler.isRefreshing) {\n // We bind `scopes` here to avoid passing it around a lot\n const tryGetAccessToken = (): Promise =>\n credential.getToken(scopes, getTokenOptions);\n\n // Take advantage of promise chaining to insert an assignment to `token`\n // before the refresh can be considered done.\n refreshWorker = beginRefresh(\n tryGetAccessToken,\n options.retryIntervalInMs,\n // If we don't have a token, then we should timeout immediately\n token?.expiresOnTimestamp ?? Date.now()\n )\n .then((_token) => {\n refreshWorker = null;\n token = _token;\n return token;\n })\n .catch((reason) => {\n // We also should reset the refresher if we enter a failed state. All\n // existing awaiters will throw, but subsequent requests will start a\n // new retry chain.\n refreshWorker = null;\n token = null;\n throw reason;\n });\n }\n\n return refreshWorker as Promise;\n }\n\n return async (tokenOptions: GetTokenOptions): Promise => {\n //\n // Simple rules:\n // - If we MUST refresh, then return the refresh task, blocking\n // the pipeline until a token is available.\n // - If we SHOULD refresh, then run refresh but don't return it\n // (we can still use the cached token).\n // - Return the token, since it's fine if we didn't return in\n // step 1.\n //\n\n if (cycler.mustRefresh) return refresh(tokenOptions);\n\n if (cycler.shouldRefresh) {\n refresh(tokenOptions);\n }\n\n return token as AccessToken;\n };\n}\n/**\n * We will retrieve the challenge only if the response status code was 401,\n * and if the response contained the header \"WWW-Authenticate\" with a non-empty value.\n */\nfunction getChallenge(response: HttpOperationResponse): string | undefined {\n const challenge = response.headers.get(\"WWW-Authenticate\");\n if (response.status === 401 && challenge) {\n return challenge;\n }\n return;\n}\n\n/**\n * Challenge structure\n */\ninterface Challenge {\n authorization_uri: string;\n resource_id: string;\n}\n\n/**\n * Converts: `Bearer a=\"b\" c=\"d\"`.\n * Into: `[ { a: 'b', c: 'd' }]`.\n *\n * @internal\n */\nfunction parseChallenge(challenge: string): any {\n const bearerChallenge = challenge.slice(\"Bearer \".length);\n const challengeParts = `${bearerChallenge.trim()} `.split(\" \").filter((x) => x);\n const keyValuePairs = challengeParts.map((keyValue) =>\n (([key, value]) => ({ [key]: value }))(keyValue.trim().split(\"=\"))\n );\n // Key-value pairs to plain object:\n return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {});\n}\n\n// #endregion\n\n/**\n * Creates a new factory for a RequestPolicy that applies a bearer token to\n * the requests' `Authorization` headers.\n *\n * @param credential - The TokenCredential implementation that can supply the bearer token.\n * @param scopes - The scopes for which the bearer token applies.\n */\n\nexport function storageBearerTokenChallengeAuthenticationPolicy(\n credential: TokenCredential,\n scopes: string | string[]\n): RequestPolicyFactory {\n // This simple function encapsulates the entire process of reliably retrieving the token\n let getToken = createTokenCycler(credential, scopes);\n\n class StorageBearerTokenChallengeAuthenticationPolicy extends BaseRequestPolicy {\n public constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) {\n super(nextPolicy, options);\n }\n\n public async sendRequest(webResource: WebResourceLike): Promise {\n if (!webResource.url.toLowerCase().startsWith(\"https://\")) {\n throw new Error(\n \"Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.\"\n );\n }\n\n const getTokenInternal = getToken;\n const token = (\n await getTokenInternal({\n abortSignal: webResource.abortSignal,\n tracingOptions: {\n tracingContext: webResource.tracingContext,\n },\n })\n ).token;\n webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`);\n\n const response = await this._nextPolicy.sendRequest(webResource);\n\n if (response?.status === 401) {\n const challenge = getChallenge(response);\n if (challenge) {\n const challengeInfo: Challenge = parseChallenge(challenge);\n const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope;\n const parsedAuthUri = URLBuilder.parse(challengeInfo.authorization_uri);\n const pathSegments = parsedAuthUri.getPath()!.split(\"/\");\n const tenantId = pathSegments[1];\n const getTokenForChallenge = createTokenCycler(credential, challengeScopes);\n\n const tokenForChallenge = (\n await getTokenForChallenge({\n abortSignal: webResource.abortSignal,\n tracingOptions: {\n tracingContext: webResource.tracingContext,\n },\n tenantId: tenantId,\n })\n ).token;\n\n getToken = getTokenForChallenge;\n webResource.headers.set(\n Constants.HeaderConstants.AUTHORIZATION,\n `Bearer ${tokenForChallenge}`\n );\n return this._nextPolicy.sendRequest(webResource);\n }\n }\n\n return response;\n }\n }\n\n return {\n create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions) => {\n return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options);\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n BaseRequestPolicy,\n deserializationPolicy,\n disableResponseDecompressionPolicy,\n HttpClient as IHttpClient,\n HttpHeaders,\n HttpOperationResponse,\n HttpRequestBody,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptions,\n ServiceClientOptions,\n WebResource,\n proxyPolicy,\n isNode,\n TokenCredential,\n isTokenCredential,\n tracingPolicy,\n logPolicy,\n ProxyOptions,\n keepAlivePolicy,\n KeepAliveOptions,\n generateClientRequestIdPolicy,\n UserAgentOptions,\n} from \"@azure/core-http\";\n\nimport { logger } from \"./log\";\nimport { StorageBrowserPolicyFactory } from \"./StorageBrowserPolicyFactory\";\nimport { StorageRetryOptions, StorageRetryPolicyFactory } from \"./StorageRetryPolicyFactory\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential\";\nimport {\n StorageOAuthScopes,\n StorageBlobLoggingAllowedHeaderNames,\n StorageBlobLoggingAllowedQueryParameters,\n} from \"./utils/constants\";\nimport { TelemetryPolicyFactory } from \"./TelemetryPolicyFactory\";\nimport { getCachedDefaultHttpClient } from \"./utils/cache\";\nimport { attachCredential } from \"./utils/utils.common\";\nimport { storageBearerTokenChallengeAuthenticationPolicy } from \"./policies/StorageBearerTokenChallengeAuthenticationPolicy\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n BaseRequestPolicy,\n StorageOAuthScopes,\n deserializationPolicy,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n};\n\n/**\n * Option interface for Pipeline constructor.\n */\nexport interface PipelineOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n}\n\n/**\n * An interface for the {@link Pipeline} class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport interface PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n readonly options: PipelineOptions;\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n toServiceClientOptions(): ServiceClientOptions;\n}\n\n/**\n * A helper to decide if a given argument satisfies the Pipeline contract\n * @param pipeline - An argument that may be a Pipeline\n * @returns true when the argument satisfies the Pipeline contract\n */\nexport function isPipelineLike(pipeline: unknown): pipeline is PipelineLike {\n if (!pipeline || typeof pipeline !== \"object\") {\n return false;\n }\n\n const castPipeline = pipeline as PipelineLike;\n\n return (\n Array.isArray(castPipeline.factories) &&\n typeof castPipeline.options === \"object\" &&\n typeof castPipeline.toServiceClientOptions === \"function\"\n );\n}\n\n/**\n * A Pipeline class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport class Pipeline implements PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n public readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n public readonly options: PipelineOptions;\n\n /**\n * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.\n *\n * @param factories -\n * @param options -\n */\n constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) {\n this.factories = factories;\n // when options.httpClient is not specified, passing in a DefaultHttpClient instance to\n // avoid each client creating its own http client.\n this.options = {\n ...options,\n httpClient: options.httpClient || getCachedDefaultHttpClient(),\n };\n }\n\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n public toServiceClientOptions(): ServiceClientOptions {\n return {\n httpClient: this.options.httpClient,\n requestPolicyFactories: this.factories,\n };\n }\n}\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n */\n audience?: string | string[];\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {}\n): Pipeline {\n if (credential === undefined) {\n credential = new AnonymousCredential();\n }\n\n // Order is important. Closer to the API at the top & closer to the network at the bottom.\n // The credential's policy factory must appear close to the wire so it can sign any\n // changes made by other factories (like UniqueRequestIDPolicyFactory)\n\n const telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions);\n const factories: RequestPolicyFactory[] = [\n tracingPolicy({ userAgent: telemetryPolicy.telemetryString }),\n keepAlivePolicy(pipelineOptions.keepAliveOptions),\n telemetryPolicy,\n generateClientRequestIdPolicy(),\n new StorageBrowserPolicyFactory(),\n new StorageRetryPolicyFactory(pipelineOptions.retryOptions), // Retry policy should be above any policy that throws retryable errors\n // Default deserializationPolicy is provided by protocol layer\n // Use customized XML char key of \"#\" so we could deserialize metadata\n // with \"_\" key\n deserializationPolicy(undefined, { xmlCharKey: \"#\" }),\n logPolicy({\n logger: logger.info,\n allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,\n allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,\n }),\n ];\n\n if (isNode) {\n // policies only available in Node.js runtime, not in browsers\n factories.push(proxyPolicy(pipelineOptions.proxyOptions));\n factories.push(disableResponseDecompressionPolicy());\n }\n factories.push(\n isTokenCredential(credential)\n ? attachCredential(\n storageBearerTokenChallengeAuthenticationPolicy(\n credential,\n pipelineOptions.audience ?? StorageOAuthScopes\n ),\n credential\n )\n : credential\n );\n\n return new Pipeline(factories, pipelineOptions);\n}\n","import { memoizeFunction } from '../../Utilities';\nimport { getGlobalClassNames, mergeStyleSets } from '../../Styling';\nimport type { ITheme } from '../../Styling';\nimport type { IButtonStyles } from './Button.types';\n\nexport interface IButtonClassNames {\n root?: string;\n flexContainer?: string;\n textContainer?: string;\n icon?: string;\n label?: string;\n menuIcon?: string;\n description?: string;\n screenReaderText?: string;\n}\n\nexport const ButtonGlobalClassNames = {\n msButton: 'ms-Button',\n msButtonHasMenu: 'ms-Button--hasMenu',\n msButtonIcon: 'ms-Button-icon',\n msButtonMenuIcon: 'ms-Button-menuIcon',\n msButtonLabel: 'ms-Button-label',\n msButtonDescription: 'ms-Button-description',\n msButtonScreenReaderText: 'ms-Button-screenReaderText',\n msButtonFlexContainer: 'ms-Button-flexContainer',\n msButtonTextContainer: 'ms-Button-textContainer',\n};\n\nexport const getBaseButtonClassNames = memoizeFunction(\n (\n theme: ITheme,\n styles: IButtonStyles,\n className: string,\n variantClassName: string,\n iconClassName: string | undefined,\n menuIconClassName: string | undefined,\n disabled: boolean,\n hasMenu: boolean,\n checked: boolean,\n expanded: boolean,\n isSplit: boolean | undefined,\n ): IButtonClassNames => {\n const classNames = getGlobalClassNames(ButtonGlobalClassNames, theme || {});\n\n const isExpanded = expanded && !isSplit;\n return mergeStyleSets({\n root: [\n classNames.msButton,\n styles.root,\n variantClassName,\n checked && ['is-checked', styles.rootChecked],\n isExpanded && [\n 'is-expanded',\n styles.rootExpanded,\n {\n selectors: {\n [`:hover .${classNames.msButtonIcon}`]: styles.iconExpandedHovered,\n // menuIcon falls back to rootExpandedHovered to support original behavior\n [`:hover .${classNames.msButtonMenuIcon}`]: styles.menuIconExpandedHovered || styles.rootExpandedHovered,\n ':hover': styles.rootExpandedHovered,\n },\n },\n ],\n hasMenu && [ButtonGlobalClassNames.msButtonHasMenu, styles.rootHasMenu],\n disabled && ['is-disabled', styles.rootDisabled],\n !disabled &&\n !isExpanded &&\n !checked && {\n selectors: {\n ':hover': styles.rootHovered,\n [`:hover .${classNames.msButtonLabel}`]: styles.labelHovered,\n [`:hover .${classNames.msButtonIcon}`]: styles.iconHovered,\n [`:hover .${classNames.msButtonDescription}`]: styles.descriptionHovered,\n [`:hover .${classNames.msButtonMenuIcon}`]: styles.menuIconHovered,\n ':focus': styles.rootFocused,\n ':active': styles.rootPressed,\n [`:active .${classNames.msButtonIcon}`]: styles.iconPressed,\n [`:active .${classNames.msButtonDescription}`]: styles.descriptionPressed,\n [`:active .${classNames.msButtonMenuIcon}`]: styles.menuIconPressed,\n },\n },\n disabled && checked && [styles.rootCheckedDisabled],\n !disabled &&\n checked && {\n selectors: {\n ':hover': styles.rootCheckedHovered,\n ':active': styles.rootCheckedPressed,\n },\n },\n className,\n ],\n flexContainer: [classNames.msButtonFlexContainer, styles.flexContainer],\n textContainer: [classNames.msButtonTextContainer, styles.textContainer],\n icon: [\n classNames.msButtonIcon,\n iconClassName,\n styles.icon,\n isExpanded && styles.iconExpanded,\n checked && styles.iconChecked,\n disabled && styles.iconDisabled,\n ],\n label: [classNames.msButtonLabel, styles.label, checked && styles.labelChecked, disabled && styles.labelDisabled],\n menuIcon: [\n classNames.msButtonMenuIcon,\n menuIconClassName,\n styles.menuIcon,\n checked && styles.menuIconChecked,\n disabled && !isSplit && styles.menuIconDisabled,\n !disabled &&\n !isExpanded &&\n !checked && {\n selectors: {\n ':hover': styles.menuIconHovered,\n ':active': styles.menuIconPressed,\n },\n },\n isExpanded && ['is-expanded', styles.menuIconExpanded],\n ],\n description: [\n classNames.msButtonDescription,\n styles.description,\n checked && styles.descriptionChecked,\n disabled && styles.descriptionDisabled,\n ],\n screenReaderText: [classNames.msButtonScreenReaderText, styles.screenReaderText],\n });\n },\n);\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { replaceAll } from \"./util/utils\";\n\nexport { URL } from \"./util/url\";\n\ntype URLQueryParseState = \"ParameterName\" | \"ParameterValue\";\n\n/**\n * A class that handles the query portion of a URLBuilder.\n */\nexport class URLQuery {\n private readonly _rawQuery: { [queryParameterName: string]: string | string[] } = {};\n\n /**\n * Get whether or not there any query parameters in this URLQuery.\n */\n public any(): boolean {\n return Object.keys(this._rawQuery).length > 0;\n }\n\n /**\n * Get the keys of the query string.\n */\n public keys(): string[] {\n return Object.keys(this._rawQuery);\n }\n\n /**\n * Set a query parameter with the provided name and value. If the parameterValue is undefined or\n * empty, then this will attempt to remove an existing query parameter with the provided\n * parameterName.\n */\n public set(parameterName: string, parameterValue: unknown): void {\n const caseParameterValue = parameterValue as {\n toString: () => string;\n };\n if (parameterName) {\n if (caseParameterValue !== undefined && caseParameterValue !== null) {\n const newValue = Array.isArray(caseParameterValue)\n ? caseParameterValue\n : caseParameterValue.toString();\n this._rawQuery[parameterName] = newValue;\n } else {\n delete this._rawQuery[parameterName];\n }\n }\n }\n\n /**\n * Get the value of the query parameter with the provided name. If no parameter exists with the\n * provided parameter name, then undefined will be returned.\n */\n public get(parameterName: string): string | string[] | undefined {\n return parameterName ? this._rawQuery[parameterName] : undefined;\n }\n\n /**\n * Get the string representation of this query. The return value will not start with a \"?\".\n */\n public toString(): string {\n let result = \"\";\n for (const parameterName in this._rawQuery) {\n if (result) {\n result += \"&\";\n }\n const parameterValue = this._rawQuery[parameterName];\n if (Array.isArray(parameterValue)) {\n const parameterStrings = [];\n for (const parameterValueElement of parameterValue) {\n parameterStrings.push(`${parameterName}=${parameterValueElement}`);\n }\n result += parameterStrings.join(\"&\");\n } else {\n result += `${parameterName}=${parameterValue}`;\n }\n }\n return result;\n }\n\n /**\n * Parse a URLQuery from the provided text.\n */\n public static parse(text: string): URLQuery {\n const result = new URLQuery();\n\n if (text) {\n if (text.startsWith(\"?\")) {\n text = text.substring(1);\n }\n\n let currentState: URLQueryParseState = \"ParameterName\";\n\n let parameterName = \"\";\n let parameterValue = \"\";\n for (let i = 0; i < text.length; ++i) {\n const currentCharacter: string = text[i];\n switch (currentState) {\n case \"ParameterName\":\n switch (currentCharacter) {\n case \"=\":\n currentState = \"ParameterValue\";\n break;\n\n case \"&\":\n parameterName = \"\";\n parameterValue = \"\";\n break;\n\n default:\n parameterName += currentCharacter;\n break;\n }\n break;\n\n case \"ParameterValue\":\n switch (currentCharacter) {\n case \"&\":\n result.set(parameterName, parameterValue);\n parameterName = \"\";\n parameterValue = \"\";\n currentState = \"ParameterName\";\n break;\n\n default:\n parameterValue += currentCharacter;\n break;\n }\n break;\n\n default:\n throw new Error(\"Unrecognized URLQuery parse state: \" + currentState);\n }\n }\n if (currentState === \"ParameterValue\") {\n result.set(parameterName, parameterValue);\n }\n }\n\n return result;\n }\n}\n\n/**\n * A class that handles creating, modifying, and parsing URLs.\n */\nexport class URLBuilder {\n private _scheme: string | undefined;\n private _host: string | undefined;\n private _port: string | undefined;\n private _path: string | undefined;\n private _query: URLQuery | undefined;\n\n /**\n * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL\n * (such as a host, port, path, or query), those parts will be added to this URL as well.\n */\n public setScheme(scheme: string | undefined): void {\n if (!scheme) {\n this._scheme = undefined;\n } else {\n this.set(scheme, \"SCHEME\");\n }\n }\n\n /**\n * Get the scheme that has been set in this URL.\n */\n public getScheme(): string | undefined {\n return this._scheme;\n }\n\n /**\n * Set the host for this URL. If the provided host contains other parts of a URL (such as a\n * port, path, or query), those parts will be added to this URL as well.\n */\n public setHost(host: string | undefined): void {\n if (!host) {\n this._host = undefined;\n } else {\n this.set(host, \"SCHEME_OR_HOST\");\n }\n }\n\n /**\n * Get the host that has been set in this URL.\n */\n public getHost(): string | undefined {\n return this._host;\n }\n\n /**\n * Set the port for this URL. If the provided port contains other parts of a URL (such as a\n * path or query), those parts will be added to this URL as well.\n */\n public setPort(port: number | string | undefined): void {\n if (port === undefined || port === null || port === \"\") {\n this._port = undefined;\n } else {\n this.set(port.toString(), \"PORT\");\n }\n }\n\n /**\n * Get the port that has been set in this URL.\n */\n public getPort(): string | undefined {\n return this._port;\n }\n\n /**\n * Set the path for this URL. If the provided path contains a query, then it will be added to\n * this URL as well.\n */\n public setPath(path: string | undefined): void {\n if (!path) {\n this._path = undefined;\n } else {\n const schemeIndex = path.indexOf(\"://\");\n if (schemeIndex !== -1) {\n const schemeStart = path.lastIndexOf(\"/\", schemeIndex);\n // Make sure to only grab the URL part of the path before setting the state back to SCHEME\n // this will handle cases such as \"/a/b/c/https://microsoft.com\" => \"https://microsoft.com\"\n this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), \"SCHEME\");\n } else {\n this.set(path, \"PATH\");\n }\n }\n }\n\n /**\n * Append the provided path to this URL's existing path. If the provided path contains a query,\n * then it will be added to this URL as well.\n */\n public appendPath(path: string | undefined): void {\n if (path) {\n let currentPath: string | undefined = this.getPath();\n if (currentPath) {\n if (!currentPath.endsWith(\"/\")) {\n currentPath += \"/\";\n }\n\n if (path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n\n path = currentPath + path;\n }\n this.set(path, \"PATH\");\n }\n }\n\n /**\n * Get the path that has been set in this URL.\n */\n public getPath(): string | undefined {\n return this._path;\n }\n\n /**\n * Set the query in this URL.\n */\n public setQuery(query: string | undefined): void {\n if (!query) {\n this._query = undefined;\n } else {\n this._query = URLQuery.parse(query);\n }\n }\n\n /**\n * Set a query parameter with the provided name and value in this URL's query. If the provided\n * query parameter value is undefined or empty, then the query parameter will be removed if it\n * existed.\n */\n public setQueryParameter(queryParameterName: string, queryParameterValue: unknown): void {\n if (queryParameterName) {\n if (!this._query) {\n this._query = new URLQuery();\n }\n this._query.set(queryParameterName, queryParameterValue);\n }\n }\n\n /**\n * Get the value of the query parameter with the provided query parameter name. If no query\n * parameter exists with the provided name, then undefined will be returned.\n */\n public getQueryParameterValue(queryParameterName: string): string | string[] | undefined {\n return this._query ? this._query.get(queryParameterName) : undefined;\n }\n\n /**\n * Get the query in this URL.\n */\n public getQuery(): string | undefined {\n return this._query ? this._query.toString() : undefined;\n }\n\n /**\n * Set the parts of this URL by parsing the provided text using the provided startState.\n */\n private set(text: string, startState: URLTokenizerState): void {\n const tokenizer = new URLTokenizer(text, startState);\n\n while (tokenizer.next()) {\n const token: URLToken | undefined = tokenizer.current();\n let tokenPath: string | undefined;\n if (token) {\n switch (token.type) {\n case \"SCHEME\":\n this._scheme = token.text || undefined;\n break;\n\n case \"HOST\":\n this._host = token.text || undefined;\n break;\n\n case \"PORT\":\n this._port = token.text || undefined;\n break;\n\n case \"PATH\":\n tokenPath = token.text || undefined;\n if (!this._path || this._path === \"/\" || tokenPath !== \"/\") {\n this._path = tokenPath;\n }\n break;\n\n case \"QUERY\":\n this._query = URLQuery.parse(token.text);\n break;\n\n default:\n throw new Error(`Unrecognized URLTokenType: ${token.type}`);\n }\n }\n }\n }\n\n /**\n * Serializes the URL as a string.\n * @returns the URL as a string.\n */\n public toString(): string {\n let result = \"\";\n\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n\n if (this._host) {\n result += this._host;\n }\n\n if (this._port) {\n result += `:${this._port}`;\n }\n\n if (this._path) {\n if (!this._path.startsWith(\"/\")) {\n result += \"/\";\n }\n result += this._path;\n }\n\n if (this._query && this._query.any()) {\n result += `?${this._query.toString()}`;\n }\n\n return result;\n }\n\n /**\n * If the provided searchValue is found in this URLBuilder, then replace it with the provided\n * replaceValue.\n */\n public replaceAll(searchValue: string, replaceValue: string): void {\n if (searchValue) {\n this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue));\n this.setHost(replaceAll(this.getHost(), searchValue, replaceValue));\n this.setPort(replaceAll(this.getPort(), searchValue, replaceValue));\n this.setPath(replaceAll(this.getPath(), searchValue, replaceValue));\n this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue));\n }\n }\n\n /**\n * Parses a given string URL into a new {@link URLBuilder}.\n */\n public static parse(text: string): URLBuilder {\n const result = new URLBuilder();\n result.set(text, \"SCHEME_OR_HOST\");\n return result;\n }\n}\n\ntype URLTokenizerState = \"SCHEME\" | \"SCHEME_OR_HOST\" | \"HOST\" | \"PORT\" | \"PATH\" | \"QUERY\" | \"DONE\";\n\ntype URLTokenType = \"SCHEME\" | \"HOST\" | \"PORT\" | \"PATH\" | \"QUERY\";\n\nexport class URLToken {\n public constructor(public readonly text: string, public readonly type: URLTokenType) {}\n\n public static scheme(text: string): URLToken {\n return new URLToken(text, \"SCHEME\");\n }\n\n public static host(text: string): URLToken {\n return new URLToken(text, \"HOST\");\n }\n\n public static port(text: string): URLToken {\n return new URLToken(text, \"PORT\");\n }\n\n public static path(text: string): URLToken {\n return new URLToken(text, \"PATH\");\n }\n\n public static query(text: string): URLToken {\n return new URLToken(text, \"QUERY\");\n }\n}\n\n/**\n * Get whether or not the provided character (single character string) is an alphanumeric (letter or\n * digit) character.\n */\nexport function isAlphaNumericCharacter(character: string): boolean {\n const characterCode: number = character.charCodeAt(0);\n return (\n (48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */\n );\n}\n\n/**\n * A class that tokenizes URL strings.\n */\nexport class URLTokenizer {\n readonly _textLength: number;\n _currentState: URLTokenizerState;\n _currentIndex: number;\n _currentToken: URLToken | undefined;\n\n public constructor(readonly _text: string, state?: URLTokenizerState) {\n this._textLength = _text ? _text.length : 0;\n this._currentState = state !== undefined && state !== null ? state : \"SCHEME_OR_HOST\";\n this._currentIndex = 0;\n }\n\n /**\n * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer\n * hasn't started or has finished tokenizing.\n */\n public current(): URLToken | undefined {\n return this._currentToken;\n }\n\n /**\n * Advance to the next URLToken and return whether or not a URLToken was found.\n */\n public next(): boolean {\n if (!hasCurrentCharacter(this)) {\n this._currentToken = undefined;\n } else {\n switch (this._currentState) {\n case \"SCHEME\":\n nextScheme(this);\n break;\n\n case \"SCHEME_OR_HOST\":\n nextSchemeOrHost(this);\n break;\n\n case \"HOST\":\n nextHost(this);\n break;\n\n case \"PORT\":\n nextPort(this);\n break;\n\n case \"PATH\":\n nextPath(this);\n break;\n\n case \"QUERY\":\n nextQuery(this);\n break;\n\n default:\n throw new Error(`Unrecognized URLTokenizerState: ${this._currentState}`);\n }\n }\n return !!this._currentToken;\n }\n}\n\n/**\n * Read the remaining characters from this Tokenizer's character stream.\n */\nfunction readRemaining(tokenizer: URLTokenizer): string {\n let result = \"\";\n if (tokenizer._currentIndex < tokenizer._textLength) {\n result = tokenizer._text.substring(tokenizer._currentIndex);\n tokenizer._currentIndex = tokenizer._textLength;\n }\n return result;\n}\n\n/**\n * Whether or not this URLTokenizer has a current character.\n */\nfunction hasCurrentCharacter(tokenizer: URLTokenizer): boolean {\n return tokenizer._currentIndex < tokenizer._textLength;\n}\n\n/**\n * Get the character in the text string at the current index.\n */\nfunction getCurrentCharacter(tokenizer: URLTokenizer): string {\n return tokenizer._text[tokenizer._currentIndex];\n}\n\n/**\n * Advance to the character in text that is \"step\" characters ahead. If no step value is provided,\n * then step will default to 1.\n */\nfunction nextCharacter(tokenizer: URLTokenizer, step?: number): void {\n if (hasCurrentCharacter(tokenizer)) {\n if (!step) {\n step = 1;\n }\n tokenizer._currentIndex += step;\n }\n}\n\n/**\n * Starting with the current character, peek \"charactersToPeek\" number of characters ahead in this\n * Tokenizer's stream of characters.\n */\nfunction peekCharacters(tokenizer: URLTokenizer, charactersToPeek: number): string {\n let endIndex: number = tokenizer._currentIndex + charactersToPeek;\n if (tokenizer._textLength < endIndex) {\n endIndex = tokenizer._textLength;\n }\n return tokenizer._text.substring(tokenizer._currentIndex, endIndex);\n}\n\n/**\n * Read characters from this Tokenizer until the end of the stream or until the provided condition\n * is false when provided the current character.\n */\nfunction readWhile(tokenizer: URLTokenizer, condition: (character: string) => boolean): string {\n let result = \"\";\n\n while (hasCurrentCharacter(tokenizer)) {\n const currentCharacter: string = getCurrentCharacter(tokenizer);\n if (!condition(currentCharacter)) {\n break;\n } else {\n result += currentCharacter;\n nextCharacter(tokenizer);\n }\n }\n\n return result;\n}\n\n/**\n * Read characters from this Tokenizer until a non-alphanumeric character or the end of the\n * character stream is reached.\n */\nfunction readWhileLetterOrDigit(tokenizer: URLTokenizer): string {\n return readWhile(tokenizer, (character: string) => isAlphaNumericCharacter(character));\n}\n\n/**\n * Read characters from this Tokenizer until one of the provided terminating characters is read or\n * the end of the character stream is reached.\n */\nfunction readUntilCharacter(tokenizer: URLTokenizer, ...terminatingCharacters: string[]): string {\n return readWhile(\n tokenizer,\n (character: string) => terminatingCharacters.indexOf(character) === -1\n );\n}\n\nfunction nextScheme(tokenizer: URLTokenizer): void {\n const scheme: string = readWhileLetterOrDigit(tokenizer);\n tokenizer._currentToken = URLToken.scheme(scheme);\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n } else {\n tokenizer._currentState = \"HOST\";\n }\n}\n\nfunction nextSchemeOrHost(tokenizer: URLTokenizer): void {\n const schemeOrHost: string = readUntilCharacter(tokenizer, \":\", \"/\", \"?\");\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentToken = URLToken.host(schemeOrHost);\n tokenizer._currentState = \"DONE\";\n } else if (getCurrentCharacter(tokenizer) === \":\") {\n if (peekCharacters(tokenizer, 3) === \"://\") {\n tokenizer._currentToken = URLToken.scheme(schemeOrHost);\n tokenizer._currentState = \"HOST\";\n } else {\n tokenizer._currentToken = URLToken.host(schemeOrHost);\n tokenizer._currentState = \"PORT\";\n }\n } else {\n tokenizer._currentToken = URLToken.host(schemeOrHost);\n if (getCurrentCharacter(tokenizer) === \"/\") {\n tokenizer._currentState = \"PATH\";\n } else {\n tokenizer._currentState = \"QUERY\";\n }\n }\n}\n\nfunction nextHost(tokenizer: URLTokenizer): void {\n if (peekCharacters(tokenizer, 3) === \"://\") {\n nextCharacter(tokenizer, 3);\n }\n\n const host: string = readUntilCharacter(tokenizer, \":\", \"/\", \"?\");\n tokenizer._currentToken = URLToken.host(host);\n\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n } else if (getCurrentCharacter(tokenizer) === \":\") {\n tokenizer._currentState = \"PORT\";\n } else if (getCurrentCharacter(tokenizer) === \"/\") {\n tokenizer._currentState = \"PATH\";\n } else {\n tokenizer._currentState = \"QUERY\";\n }\n}\n\nfunction nextPort(tokenizer: URLTokenizer): void {\n if (getCurrentCharacter(tokenizer) === \":\") {\n nextCharacter(tokenizer);\n }\n\n const port: string = readUntilCharacter(tokenizer, \"/\", \"?\");\n tokenizer._currentToken = URLToken.port(port);\n\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n } else if (getCurrentCharacter(tokenizer) === \"/\") {\n tokenizer._currentState = \"PATH\";\n } else {\n tokenizer._currentState = \"QUERY\";\n }\n}\n\nfunction nextPath(tokenizer: URLTokenizer): void {\n const path: string = readUntilCharacter(tokenizer, \"?\");\n tokenizer._currentToken = URLToken.path(path);\n\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n } else {\n tokenizer._currentState = \"QUERY\";\n }\n}\n\nfunction nextQuery(tokenizer: URLTokenizer): void {\n if (getCurrentCharacter(tokenizer) === \"?\") {\n nextCharacter(tokenizer);\n }\n\n const query: string = readRemaining(tokenizer);\n tokenizer._currentToken = URLToken.query(query);\n tokenizer._currentState = \"DONE\";\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"@azure/msal-common\";\n\n/**\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const BrowserConfigurationAuthErrorMessage = {\n redirectUriNotSet: {\n code: \"redirect_uri_empty\",\n desc: \"A redirect URI is required for all calls, and none has been set.\"\n },\n postLogoutUriNotSet: {\n code: \"post_logout_uri_empty\",\n desc: \"A post logout redirect has not been set.\"\n },\n storageNotSupportedError: {\n code: \"storage_not_supported\",\n desc: \"Given storage configuration option was not supported.\"\n },\n noRedirectCallbacksSet: {\n code: \"no_redirect_callbacks\",\n desc: \"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. \" +\n \"More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics.\"\n },\n invalidCallbackObject: {\n code: \"invalid_callback_object\",\n desc: \"The object passed for the callback was invalid. \" +\n \"More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics.\"\n },\n stubPcaInstanceCalled: {\n code: \"stubbed_public_client_application_called\",\n desc: \"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors\"\n },\n inMemRedirectUnavailable: {\n code: \"in_mem_redirect_unavailable\",\n desc: \"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true.\"\n }\n};\n\n/**\n * Browser library error class thrown by the MSAL.js library for SPAs\n */\nexport class BrowserConfigurationAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"BrowserConfigurationAuthError\";\n\n Object.setPrototypeOf(this, BrowserConfigurationAuthError.prototype);\n }\n\n /**\n * Creates an error thrown when the redirect uri is empty (not set by caller)\n */\n static createRedirectUriEmptyError(): BrowserConfigurationAuthError {\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.redirectUriNotSet.code,\n BrowserConfigurationAuthErrorMessage.redirectUriNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)\n */\n static createPostLogoutRedirectUriEmptyError(): BrowserConfigurationAuthError {\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.postLogoutUriNotSet.code,\n BrowserConfigurationAuthErrorMessage.postLogoutUriNotSet.desc);\n }\n\n /**\n * Creates error thrown when given storage location is not supported.\n * @param givenStorageLocation \n */\n static createStorageNotSupportedError(givenStorageLocation: string): BrowserConfigurationAuthError {\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.storageNotSupportedError.code, `${BrowserConfigurationAuthErrorMessage.storageNotSupportedError.desc} Given Location: ${givenStorageLocation}`);\n }\n\n /**\n * Creates error thrown when redirect callbacks are not set before calling loginRedirect() or acquireTokenRedirect().\n */\n static createRedirectCallbacksNotSetError(): BrowserConfigurationAuthError {\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.noRedirectCallbacksSet.code, \n BrowserConfigurationAuthErrorMessage.noRedirectCallbacksSet.desc);\n }\n\n /**\n * Creates error thrown when the stub instance of PublicClientApplication is called.\n */\n static createStubPcaInstanceCalledError(): BrowserConfigurationAuthError {\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.stubPcaInstanceCalled.code,\n BrowserConfigurationAuthErrorMessage.stubPcaInstanceCalled.desc);\n }\n\n /*\n * Create an error thrown when in-memory storage is used and storeAuthStateInCookie=false.\n */\n static createInMemoryRedirectUnavailableError(): BrowserConfigurationAuthError {\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.inMemRedirectUnavailable.code, BrowserConfigurationAuthErrorMessage.inMemRedirectUnavailable.desc);\n }\n}\n","import { assign } from './object';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * @internal\n */\nexport interface IEventRecord {\n target: any;\n eventName: string;\n parent: any;\n callback: (args?: any) => void;\n elementCallback?: (...args: any[]) => void;\n objectCallback?: (args?: any) => void;\n options?: boolean | AddEventListenerOptions;\n}\n\n/**\n * @internal\n */\nexport interface IEventRecordsByName {\n [eventName: string]: IEventRecordList;\n}\n\n/**\n * @internal\n */\nexport interface IEventRecordList {\n [id: string]: IEventRecord[] | number;\n count: number;\n}\n\n/**\n * @internal\n */\nexport interface IDeclaredEventsByName {\n [eventName: string]: boolean;\n}\n\n/** An instance of EventGroup allows anything with a handle to it to trigger events on it.\n * If the target is an HTMLElement, the event will be attached to the element and can be\n * triggered as usual (like clicking for onClick).\n * The event can be triggered by calling EventGroup.raise() here. If the target is an\n * HTMLElement, the event gets raised and is handled by the browser. Otherwise, it gets\n * handled here in EventGroup, and the handler is called in the context of the parent\n * (which is passed in in the constructor).\n *\n * @public\n * {@docCategory EventGroup}\n */\nexport class EventGroup {\n private static _uniqueId: number = 0;\n private _parent: any;\n private _eventRecords: IEventRecord[];\n private _id: number = EventGroup._uniqueId++;\n private _isDisposed!: boolean;\n\n /** For IE8, bubbleEvent is ignored here and must be dealt with by the handler.\n * Events raised here by default have bubbling set to false and cancelable set to true.\n * This applies also to built-in events being raised manually here on HTMLElements,\n * which may lead to unexpected behavior if it differs from the defaults.\n *\n */\n public static raise(target: any, eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined {\n let retVal;\n\n if (EventGroup._isElement(target)) {\n if (typeof document !== 'undefined' && document.createEvent) {\n let ev = document.createEvent('HTMLEvents');\n\n // eslint-disable-next-line deprecation/deprecation\n ev.initEvent(eventName, bubbleEvent || false, true);\n\n assign(ev, eventArgs);\n\n retVal = target.dispatchEvent(ev);\n } else if (typeof document !== 'undefined' && (document as any).createEventObject) {\n // IE8\n let evObj = (document as any).createEventObject(eventArgs);\n // cannot set cancelBubble on evObj, fireEvent will overwrite it\n target.fireEvent('on' + eventName, evObj);\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore -- FIXME: strictBindCallApply error - https://github.com/microsoft/fluentui/issues/17331\n while (target && retVal !== false) {\n let events = target.__events__;\n let eventRecords = events ? events[eventName] : null;\n\n if (eventRecords) {\n for (let id in eventRecords) {\n if (eventRecords.hasOwnProperty(id)) {\n let eventRecordList = eventRecords[id];\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore -- FIXME: strictBindCallApply error - https://github.com/microsoft/fluentui/issues/17331\n for (let listIndex = 0; retVal !== false && listIndex < eventRecordList.length; listIndex++) {\n let record = eventRecordList[listIndex];\n\n if (record.objectCallback) {\n retVal = record.objectCallback.call(record.parent, eventArgs);\n }\n }\n }\n }\n }\n\n // If the target has a parent, bubble the event up.\n target = bubbleEvent ? target.parent : null;\n }\n }\n\n return retVal;\n }\n\n public static isObserved(target: any, eventName: string): boolean {\n let events = target && target.__events__;\n\n return !!events && !!events[eventName];\n }\n\n /** Check to see if the target has declared support of the given event. */\n public static isDeclared(target: any, eventName: string): boolean {\n let declaredEvents = target && target.__declaredEvents;\n\n return !!declaredEvents && !!declaredEvents[eventName];\n }\n\n public static stopPropagation(event: any): void {\n if (event.stopPropagation) {\n event.stopPropagation();\n } else {\n // IE8\n event.cancelBubble = true;\n }\n }\n\n private static _isElement(target: HTMLElement): boolean {\n return (\n !!target && (!!target.addEventListener || (typeof HTMLElement !== 'undefined' && target instanceof HTMLElement))\n );\n }\n\n /** parent: the context in which events attached to non-HTMLElements are called */\n public constructor(parent: any) {\n this._parent = parent;\n this._eventRecords = [];\n }\n\n public dispose(): void {\n if (!this._isDisposed) {\n this._isDisposed = true;\n\n this.off();\n this._parent = null;\n }\n }\n\n /** On the target, attach a set of events, where the events object is a name to function mapping. */\n public onAll(target: any, events: { [key: string]: (args?: any) => void }, useCapture?: boolean): void {\n for (let eventName in events) {\n if (events.hasOwnProperty(eventName)) {\n this.on(target, eventName, events[eventName], useCapture);\n }\n }\n }\n\n /**\n * On the target, attach an event whose handler will be called in the context of the parent\n * of this instance of EventGroup.\n */\n public on(\n target: any,\n eventName: string,\n callback: (args?: any) => void,\n options?: boolean | AddEventListenerOptions,\n ): void {\n if (eventName.indexOf(',') > -1) {\n let events = eventName.split(/[ ,]+/);\n\n for (let i = 0; i < events.length; i++) {\n this.on(target, events[i], callback, options);\n }\n } else {\n let parent = this._parent;\n let eventRecord: IEventRecord = {\n target,\n eventName,\n parent,\n callback,\n options,\n };\n\n // Initialize and wire up the record on the target, so that it can call the callback if the event fires.\n let events = (target.__events__ = target.__events__ || {});\n events[eventName] =\n events[eventName] ||\n {\n count: 0,\n };\n events[eventName][this._id] = events[eventName][this._id] || [];\n (events[eventName][this._id]).push(eventRecord);\n events[eventName].count++;\n\n if (EventGroup._isElement(target)) {\n let processElementEvent = (...args: any[]) => {\n if (this._isDisposed) {\n return;\n }\n\n let result;\n try {\n result = callback.apply(parent, args);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore -- FIXME: strictBindCallApply error - https://github.com/microsoft/fluentui/issues/17331\n if (result === false && args[0]) {\n let e = args[0];\n\n if (e.preventDefault) {\n e.preventDefault();\n }\n\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n\n e.cancelBubble = true;\n }\n } catch (e) {\n // ignore\n }\n\n return result;\n };\n\n eventRecord.elementCallback = processElementEvent;\n\n if (target.addEventListener) {\n (target).addEventListener(eventName, processElementEvent, options);\n } else if (target.attachEvent) {\n // IE8\n target.attachEvent('on' + eventName, processElementEvent);\n }\n } else {\n let processObjectEvent = (...args: any[]) => {\n if (this._isDisposed) {\n return;\n }\n\n return callback.apply(parent, args);\n };\n\n eventRecord.objectCallback = processObjectEvent;\n }\n\n // Remember the record locally, so that it can be removed.\n this._eventRecords.push(eventRecord);\n }\n }\n\n public off(\n target?: any,\n eventName?: string,\n callback?: (args?: any) => void,\n options?: boolean | AddEventListenerOptions,\n ): void {\n for (let i = 0; i < this._eventRecords.length; i++) {\n let eventRecord = this._eventRecords[i];\n if (\n (!target || target === eventRecord.target) &&\n (!eventName || eventName === eventRecord.eventName) &&\n (!callback || callback === eventRecord.callback) &&\n (typeof options !== 'boolean' || options === eventRecord.options)\n ) {\n let events = eventRecord.target.__events__;\n let targetArrayLookup = events[eventRecord.eventName];\n let targetArray = targetArrayLookup ? targetArrayLookup[this._id] : null;\n\n // We may have already target's entries, so check for null.\n if (targetArray) {\n if (targetArray.length === 1 || !callback) {\n targetArrayLookup.count -= targetArray.length;\n delete events[eventRecord.eventName][this._id];\n } else {\n targetArrayLookup.count--;\n targetArray.splice(targetArray.indexOf(eventRecord), 1);\n }\n\n if (!targetArrayLookup.count) {\n delete events[eventRecord.eventName];\n }\n }\n\n if (eventRecord.elementCallback) {\n if (eventRecord.target.removeEventListener) {\n eventRecord.target.removeEventListener(\n eventRecord.eventName,\n eventRecord.elementCallback,\n eventRecord.options,\n );\n } else if (eventRecord.target.detachEvent) {\n // IE8\n eventRecord.target.detachEvent('on' + eventRecord.eventName, eventRecord.elementCallback);\n }\n }\n\n this._eventRecords.splice(i--, 1);\n }\n }\n }\n\n /** Trigger the given event in the context of this instance of EventGroup. */\n public raise(eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined {\n return EventGroup.raise(this._parent, eventName, eventArgs, bubbleEvent);\n }\n\n /** Declare an event as being supported by this instance of EventGroup. */\n public declare(event: string | string[]): void {\n let declaredEvents = (this._parent.__declaredEvents = this._parent.__declaredEvents || {});\n\n if (typeof event === 'string') {\n declaredEvents[event] = true;\n } else {\n for (let i = 0; i < event.length; i++) {\n declaredEvents[event[i]] = true;\n }\n }\n }\n}\n","import { useContext } from 'react';\nimport { useCustomizationSettings } from '@fluentui/utilities';\nimport { createTheme } from '@fluentui/theme';\nimport { ThemeContext } from './ThemeContext';\nimport type { ITheme, Theme } from '@fluentui/theme';\n\n/**\n * Get theme from CustomizerContext or Customizations singleton.\n */\nfunction useCompatTheme(): ITheme | undefined {\n return useCustomizationSettings(['theme']).theme;\n}\n\n/**\n * React hook for programmatically accessing the theme.\n */\nexport const useTheme = (): Theme => {\n const theme = useContext(ThemeContext);\n const legacyTheme = useCompatTheme();\n\n return theme || legacyTheme || createTheme({});\n};\n","import * as React from 'react';\nimport type { IGroupSpacerProps } from './GroupSpacer.types';\n\nexport const SPACER_WIDTH = 36;\n\nexport const GroupSpacer: React.FunctionComponent = props => {\n const { count, indentWidth = SPACER_WIDTH, role = 'presentation' } = props;\n const width = count * indentWidth;\n\n return count > 0 ? (\n \n ) : null;\n};\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Encodes a string in base64 format.\n * @param value - The string to encode\n */\nexport function encodeString(value: string): string {\n return btoa(value);\n}\n\n/**\n * Encodes a byte array in base64 format.\n * @param value - The Uint8Aray to encode\n */\nexport function encodeByteArray(value: Uint8Array): string {\n let str = \"\";\n for (let i = 0; i < value.length; i++) {\n str += String.fromCharCode(value[i]);\n }\n return btoa(str);\n}\n\n/**\n * Decodes a base64 string into a byte array.\n * @param value - The base64 string to decode\n */\nexport function decodeString(value: string): Uint8Array {\n const byteString = atob(value);\n const arr = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/* eslint-disable eqeqeq */\n\nimport * as base64 from \"./util/base64\";\nimport * as utils from \"./util/utils\";\nimport { SerializerOptions, XML_ATTRKEY, XML_CHARKEY } from \"./util/serializer.common\";\n\n// This file contains utility code to serialize and deserialize network operations according to `OperationSpec` objects generated by AutoRest.TypeScript from OpenAPI specifications.\n\n/**\n * Used to map raw response objects to final shapes.\n * Helps packing and unpacking Dates and other encoded types that are not intrinsic to JSON.\n * Also allows pulling values from headers, as well as inserting default values and constants.\n */\nexport class Serializer {\n constructor(\n /**\n * The provided model mapper.\n */\n public readonly modelMappers: { [key: string]: any } = {},\n /**\n * Whether the contents are XML or not.\n */\n public readonly isXML?: boolean\n ) {}\n\n /**\n * Validates constraints, if any. This function will throw if the provided value does not respect those constraints.\n * @param mapper - The definition of data models.\n * @param value - The value.\n * @param objectName - Name of the object. Used in the error messages.\n */\n validateConstraints(mapper: Mapper, value: unknown, objectName: string): void {\n const failValidation = (\n constraintName: keyof MapperConstraints,\n constraintValue: any\n ): Error => {\n throw new Error(\n `\"${objectName}\" with value \"${value}\" should satisfy the constraint \"${constraintName}\": ${constraintValue}.`\n );\n };\n if (mapper.constraints && value != undefined) {\n const valueAsNumber = value as number;\n const {\n ExclusiveMaximum,\n ExclusiveMinimum,\n InclusiveMaximum,\n InclusiveMinimum,\n MaxItems,\n MaxLength,\n MinItems,\n MinLength,\n MultipleOf,\n Pattern,\n UniqueItems,\n } = mapper.constraints;\n if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) {\n failValidation(\"ExclusiveMaximum\", ExclusiveMaximum);\n }\n if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) {\n failValidation(\"ExclusiveMinimum\", ExclusiveMinimum);\n }\n if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) {\n failValidation(\"InclusiveMaximum\", InclusiveMaximum);\n }\n if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) {\n failValidation(\"InclusiveMinimum\", InclusiveMinimum);\n }\n const valueAsArray = value as any[];\n if (MaxItems != undefined && valueAsArray.length > MaxItems) {\n failValidation(\"MaxItems\", MaxItems);\n }\n if (MaxLength != undefined && valueAsArray.length > MaxLength) {\n failValidation(\"MaxLength\", MaxLength);\n }\n if (MinItems != undefined && valueAsArray.length < MinItems) {\n failValidation(\"MinItems\", MinItems);\n }\n if (MinLength != undefined && valueAsArray.length < MinLength) {\n failValidation(\"MinLength\", MinLength);\n }\n if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) {\n failValidation(\"MultipleOf\", MultipleOf);\n }\n if (Pattern) {\n const pattern: RegExp = typeof Pattern === \"string\" ? new RegExp(Pattern) : Pattern;\n if (typeof value !== \"string\" || value.match(pattern) === null) {\n failValidation(\"Pattern\", Pattern);\n }\n }\n if (\n UniqueItems &&\n valueAsArray.some((item: any, i: number, ar: Array) => ar.indexOf(item) !== i)\n ) {\n failValidation(\"UniqueItems\", UniqueItems);\n }\n }\n }\n\n /**\n * Serialize the given object based on its metadata defined in the mapper.\n *\n * @param mapper - The mapper which defines the metadata of the serializable object.\n * @param object - A valid Javascript object to be serialized.\n * @param objectName - Name of the serialized object.\n * @param options - additional options to deserialization.\n * @returns A valid serialized Javascript object.\n */\n serialize(\n mapper: Mapper,\n object: unknown,\n objectName?: string,\n options: SerializerOptions = {}\n ): any {\n const updatedOptions: Required = {\n rootName: options.rootName ?? \"\",\n includeRoot: options.includeRoot ?? false,\n xmlCharKey: options.xmlCharKey ?? XML_CHARKEY,\n };\n let payload: any = {};\n const mapperType = mapper.type.name as string;\n if (!objectName) {\n objectName = mapper.serializedName!;\n }\n if (mapperType.match(/^Sequence$/i) !== null) {\n payload = [];\n }\n\n if (mapper.isConstant) {\n object = mapper.defaultValue;\n }\n\n // This table of allowed values should help explain\n // the mapper.required and mapper.nullable properties.\n // X means \"neither undefined or null are allowed\".\n // || required\n // || true | false\n // nullable || ==========================\n // true || null | undefined/null\n // false || X | undefined\n // undefined || X | undefined/null\n\n const { required, nullable } = mapper;\n\n if (required && nullable && object === undefined) {\n throw new Error(`${objectName} cannot be undefined.`);\n }\n if (required && !nullable && object == undefined) {\n throw new Error(`${objectName} cannot be null or undefined.`);\n }\n if (!required && nullable === false && object === null) {\n throw new Error(`${objectName} cannot be null.`);\n }\n\n if (object == undefined) {\n payload = object;\n } else {\n // Validate Constraints if any\n this.validateConstraints(mapper, object, objectName);\n if (mapperType.match(/^any$/i) !== null) {\n payload = object;\n } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) {\n payload = serializeBasicTypes(mapperType, objectName, object);\n } else if (mapperType.match(/^Enum$/i) !== null) {\n const enumMapper: EnumMapper = mapper as EnumMapper;\n payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object);\n } else if (\n mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null\n ) {\n payload = serializeDateTypes(mapperType, object, objectName);\n } else if (mapperType.match(/^ByteArray$/i) !== null) {\n payload = serializeByteArrayType(objectName, object as Uint8Array);\n } else if (mapperType.match(/^Base64Url$/i) !== null) {\n payload = serializeBase64UrlType(objectName, object as Uint8Array);\n } else if (mapperType.match(/^Sequence$/i) !== null) {\n payload = serializeSequenceType(\n this,\n mapper as SequenceMapper,\n object,\n objectName,\n Boolean(this.isXML),\n updatedOptions\n );\n } else if (mapperType.match(/^Dictionary$/i) !== null) {\n payload = serializeDictionaryType(\n this,\n mapper as DictionaryMapper,\n object,\n objectName,\n Boolean(this.isXML),\n updatedOptions\n );\n } else if (mapperType.match(/^Composite$/i) !== null) {\n payload = serializeCompositeType(\n this,\n mapper as CompositeMapper,\n object,\n objectName,\n Boolean(this.isXML),\n updatedOptions\n );\n }\n }\n return payload;\n }\n\n /**\n * Deserialize the given object based on its metadata defined in the mapper.\n *\n * @param mapper - The mapper which defines the metadata of the serializable object.\n * @param responseBody - A valid Javascript entity to be deserialized.\n * @param objectName - Name of the deserialized object.\n * @param options - Controls behavior of XML parser and builder.\n * @returns A valid deserialized Javascript object.\n */\n deserialize(\n mapper: Mapper,\n responseBody: unknown,\n objectName: string,\n options: SerializerOptions = {}\n ): any {\n const updatedOptions: Required = {\n rootName: options.rootName ?? \"\",\n includeRoot: options.includeRoot ?? false,\n xmlCharKey: options.xmlCharKey ?? XML_CHARKEY,\n };\n if (responseBody == undefined) {\n if (this.isXML && mapper.type.name === \"Sequence\" && !mapper.xmlIsWrapped) {\n // Edge case for empty XML non-wrapped lists. xml2js can't distinguish\n // between the list being empty versus being missing,\n // so let's do the more user-friendly thing and return an empty list.\n responseBody = [];\n }\n // specifically check for undefined as default value can be a falsey value `0, \"\", false, null`\n if (mapper.defaultValue !== undefined) {\n responseBody = mapper.defaultValue;\n }\n return responseBody;\n }\n\n let payload: any;\n const mapperType = mapper.type.name;\n if (!objectName) {\n objectName = mapper.serializedName!;\n }\n\n if (mapperType.match(/^Composite$/i) !== null) {\n payload = deserializeCompositeType(\n this,\n mapper as CompositeMapper,\n responseBody,\n objectName,\n updatedOptions\n );\n } else {\n if (this.isXML) {\n const xmlCharKey = updatedOptions.xmlCharKey;\n const castResponseBody = responseBody as Record;\n /**\n * If the mapper specifies this as a non-composite type value but the responseBody contains\n * both header (\"$\" i.e., XML_ATTRKEY) and body (\"#\" i.e., XML_CHARKEY) properties,\n * then just reduce the responseBody value to the body (\"#\" i.e., XML_CHARKEY) property.\n */\n if (\n castResponseBody[XML_ATTRKEY] != undefined &&\n castResponseBody[xmlCharKey] != undefined\n ) {\n responseBody = castResponseBody[xmlCharKey];\n }\n }\n\n if (mapperType.match(/^Number$/i) !== null) {\n payload = parseFloat(responseBody as string);\n if (isNaN(payload)) {\n payload = responseBody;\n }\n } else if (mapperType.match(/^Boolean$/i) !== null) {\n if (responseBody === \"true\") {\n payload = true;\n } else if (responseBody === \"false\") {\n payload = false;\n } else {\n payload = responseBody;\n }\n } else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) {\n payload = responseBody;\n } else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) {\n payload = new Date(responseBody as string);\n } else if (mapperType.match(/^UnixTime$/i) !== null) {\n payload = unixTimeToDate(responseBody as number);\n } else if (mapperType.match(/^ByteArray$/i) !== null) {\n payload = base64.decodeString(responseBody as string);\n } else if (mapperType.match(/^Base64Url$/i) !== null) {\n payload = base64UrlToByteArray(responseBody as string);\n } else if (mapperType.match(/^Sequence$/i) !== null) {\n payload = deserializeSequenceType(\n this,\n mapper as SequenceMapper,\n responseBody,\n objectName,\n updatedOptions\n );\n } else if (mapperType.match(/^Dictionary$/i) !== null) {\n payload = deserializeDictionaryType(\n this,\n mapper as DictionaryMapper,\n responseBody,\n objectName,\n updatedOptions\n );\n }\n }\n\n if (mapper.isConstant) {\n payload = mapper.defaultValue;\n }\n\n return payload;\n }\n}\n\nfunction trimEnd(str: string, ch: string): string {\n let len = str.length;\n while (len - 1 >= 0 && str[len - 1] === ch) {\n --len;\n }\n return str.substr(0, len);\n}\n\nfunction bufferToBase64Url(buffer: any): string | undefined {\n if (!buffer) {\n return undefined;\n }\n if (!(buffer instanceof Uint8Array)) {\n throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);\n }\n // Uint8Array to Base64.\n const str = base64.encodeByteArray(buffer);\n // Base64 to Base64Url.\n return trimEnd(str, \"=\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n}\n\nfunction base64UrlToByteArray(str: string): Uint8Array | undefined {\n if (!str) {\n return undefined;\n }\n if (str && typeof str.valueOf() !== \"string\") {\n throw new Error(\"Please provide an input of type string for converting to Uint8Array\");\n }\n // Base64Url to Base64.\n str = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Base64 to Uint8Array.\n return base64.decodeString(str);\n}\n\nfunction splitSerializeName(prop: string | undefined): string[] {\n const classes: string[] = [];\n let partialclass = \"\";\n if (prop) {\n const subwords = prop.split(\".\");\n\n for (const item of subwords) {\n if (item.charAt(item.length - 1) === \"\\\\\") {\n partialclass += item.substr(0, item.length - 1) + \".\";\n } else {\n partialclass += item;\n classes.push(partialclass);\n partialclass = \"\";\n }\n }\n }\n\n return classes;\n}\n\nfunction dateToUnixTime(d: string | Date): number | undefined {\n if (!d) {\n return undefined;\n }\n\n if (typeof d.valueOf() === \"string\") {\n d = new Date(d as string);\n }\n return Math.floor((d as Date).getTime() / 1000);\n}\n\nfunction unixTimeToDate(n: number): Date | undefined {\n if (!n) {\n return undefined;\n }\n return new Date(n * 1000);\n}\n\nfunction serializeBasicTypes(typeName: string, objectName: string, value: any): any {\n if (value !== null && value !== undefined) {\n if (typeName.match(/^Number$/i) !== null) {\n if (typeof value !== \"number\") {\n throw new Error(`${objectName} with value ${value} must be of type number.`);\n }\n } else if (typeName.match(/^String$/i) !== null) {\n if (typeof value.valueOf() !== \"string\") {\n throw new Error(`${objectName} with value \"${value}\" must be of type string.`);\n }\n } else if (typeName.match(/^Uuid$/i) !== null) {\n if (!(typeof value.valueOf() === \"string\" && utils.isValidUuid(value))) {\n throw new Error(\n `${objectName} with value \"${value}\" must be of type string and a valid uuid.`\n );\n }\n } else if (typeName.match(/^Boolean$/i) !== null) {\n if (typeof value !== \"boolean\") {\n throw new Error(`${objectName} with value ${value} must be of type boolean.`);\n }\n } else if (typeName.match(/^Stream$/i) !== null) {\n const objectType = typeof value;\n if (\n objectType !== \"string\" &&\n objectType !== \"function\" &&\n !(value instanceof ArrayBuffer) &&\n !ArrayBuffer.isView(value) &&\n !((typeof Blob === \"function\" || typeof Blob === \"object\") && value instanceof Blob)\n ) {\n throw new Error(\n `${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`\n );\n }\n }\n }\n\n return value;\n}\n\nfunction serializeEnumType(objectName: string, allowedValues: Array, value: any): any {\n if (!allowedValues) {\n throw new Error(\n `Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`\n );\n }\n const isPresent = allowedValues.some((item) => {\n if (typeof item.valueOf() === \"string\") {\n return item.toLowerCase() === value.toLowerCase();\n }\n return item === value;\n });\n if (!isPresent) {\n throw new Error(\n `${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(\n allowedValues\n )}.`\n );\n }\n return value;\n}\n\nfunction serializeByteArrayType(objectName: string, value: Uint8Array): string {\n let returnValue: string = \"\";\n if (value != undefined) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`${objectName} must be of type Uint8Array.`);\n }\n returnValue = base64.encodeByteArray(value);\n }\n return returnValue;\n}\n\nfunction serializeBase64UrlType(objectName: string, value: Uint8Array): string {\n let returnValue: string = \"\";\n if (value != undefined) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`${objectName} must be of type Uint8Array.`);\n }\n returnValue = bufferToBase64Url(value) || \"\";\n }\n return returnValue;\n}\n\nfunction serializeDateTypes(typeName: string, value: any, objectName: string): any {\n if (value != undefined) {\n if (typeName.match(/^Date$/i) !== null) {\n if (\n !(\n value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value)))\n )\n ) {\n throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`);\n }\n value =\n value instanceof Date\n ? value.toISOString().substring(0, 10)\n : new Date(value).toISOString().substring(0, 10);\n } else if (typeName.match(/^DateTime$/i) !== null) {\n if (\n !(\n value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value)))\n )\n ) {\n throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`);\n }\n value = value instanceof Date ? value.toISOString() : new Date(value).toISOString();\n } else if (typeName.match(/^DateTimeRfc1123$/i) !== null) {\n if (\n !(\n value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value)))\n )\n ) {\n throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`);\n }\n value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString();\n } else if (typeName.match(/^UnixTime$/i) !== null) {\n if (\n !(\n value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value)))\n )\n ) {\n throw new Error(\n `${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format ` +\n `for it to be serialized in UnixTime/Epoch format.`\n );\n }\n value = dateToUnixTime(value);\n } else if (typeName.match(/^TimeSpan$/i) !== null) {\n if (!utils.isDuration(value)) {\n throw new Error(\n `${objectName} must be a string in ISO 8601 format. Instead was \"${value}\".`\n );\n }\n }\n }\n return value;\n}\n\nfunction serializeSequenceType(\n serializer: Serializer,\n mapper: SequenceMapper,\n object: any,\n objectName: string,\n isXml: boolean,\n options: Required\n): any[] {\n if (!Array.isArray(object)) {\n throw new Error(`${objectName} must be of type Array.`);\n }\n const elementType = mapper.type.element;\n if (!elementType || typeof elementType !== \"object\") {\n throw new Error(\n `element\" metadata for an Array must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}.`\n );\n }\n const tempArray = [];\n for (let i = 0; i < object.length; i++) {\n const serializedValue = serializer.serialize(elementType, object[i], objectName, options);\n\n if (isXml && elementType.xmlNamespace) {\n const xmlnsKey = elementType.xmlNamespacePrefix\n ? `xmlns:${elementType.xmlNamespacePrefix}`\n : \"xmlns\";\n if (elementType.type.name === \"Composite\") {\n tempArray[i] = { ...serializedValue };\n tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace };\n } else {\n tempArray[i] = {};\n tempArray[i][options.xmlCharKey] = serializedValue;\n tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace };\n }\n } else {\n tempArray[i] = serializedValue;\n }\n }\n return tempArray;\n}\n\nfunction serializeDictionaryType(\n serializer: Serializer,\n mapper: DictionaryMapper,\n object: any,\n objectName: string,\n isXml: boolean,\n options: Required\n): { [key: string]: any } {\n if (typeof object !== \"object\") {\n throw new Error(`${objectName} must be of type object.`);\n }\n const valueType = mapper.type.value;\n if (!valueType || typeof valueType !== \"object\") {\n throw new Error(\n `\"value\" metadata for a Dictionary must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}.`\n );\n }\n const tempDictionary: { [key: string]: any } = {};\n for (const key of Object.keys(object)) {\n const serializedValue = serializer.serialize(valueType, object[key], objectName, options);\n // If the element needs an XML namespace we need to add it within the $ property\n tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options);\n }\n\n // Add the namespace to the root element if needed\n if (isXml && mapper.xmlNamespace) {\n const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : \"xmlns\";\n\n const result = tempDictionary;\n result[XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace };\n return result;\n }\n\n return tempDictionary;\n}\n\n/**\n * Resolves the additionalProperties property from a referenced mapper.\n * @param serializer - The serializer containing the entire set of mappers.\n * @param mapper - The composite mapper to resolve.\n * @param objectName - Name of the object being serialized.\n */\nfunction resolveAdditionalProperties(\n serializer: Serializer,\n mapper: CompositeMapper,\n objectName: string\n): SequenceMapper | BaseMapper | CompositeMapper | DictionaryMapper | EnumMapper | undefined {\n const additionalProperties = mapper.type.additionalProperties;\n\n if (!additionalProperties && mapper.type.className) {\n const modelMapper = resolveReferencedMapper(serializer, mapper, objectName);\n return modelMapper?.type.additionalProperties;\n }\n\n return additionalProperties;\n}\n\n/**\n * Finds the mapper referenced by `className`.\n * @param serializer - The serializer containing the entire set of mappers\n * @param mapper - The composite mapper to resolve\n * @param objectName - Name of the object being serialized\n */\nfunction resolveReferencedMapper(\n serializer: Serializer,\n mapper: CompositeMapper,\n objectName: string\n): CompositeMapper | undefined {\n const className = mapper.type.className;\n if (!className) {\n throw new Error(\n `Class name for model \"${objectName}\" is not provided in the mapper \"${JSON.stringify(\n mapper,\n undefined,\n 2\n )}\".`\n );\n }\n\n return serializer.modelMappers[className];\n}\n\n/**\n * Resolves a composite mapper's modelProperties.\n * @param serializer - The serializer containing the entire set of mappers\n * @param mapper - The composite mapper to resolve\n */\nfunction resolveModelProperties(\n serializer: Serializer,\n mapper: CompositeMapper,\n objectName: string\n): { [propertyName: string]: Mapper } {\n let modelProps = mapper.type.modelProperties;\n if (!modelProps) {\n const modelMapper = resolveReferencedMapper(serializer, mapper, objectName);\n if (!modelMapper) {\n throw new Error(`mapper() cannot be null or undefined for model \"${mapper.type.className}\".`);\n }\n modelProps = modelMapper?.type.modelProperties;\n if (!modelProps) {\n throw new Error(\n `modelProperties cannot be null or undefined in the ` +\n `mapper \"${JSON.stringify(modelMapper)}\" of type \"${\n mapper.type.className\n }\" for object \"${objectName}\".`\n );\n }\n }\n\n return modelProps;\n}\n\nfunction serializeCompositeType(\n serializer: Serializer,\n mapper: CompositeMapper,\n object: any,\n objectName: string,\n isXml: boolean,\n options: Required\n): any {\n if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {\n mapper = getPolymorphicMapper(serializer, mapper, object, \"clientName\");\n }\n\n if (object != undefined) {\n const payload: any = {};\n const modelProps = resolveModelProperties(serializer, mapper, objectName);\n for (const key of Object.keys(modelProps)) {\n const propertyMapper = modelProps[key];\n if (propertyMapper.readOnly) {\n continue;\n }\n\n let propName: string | undefined;\n let parentObject: any = payload;\n if (serializer.isXML) {\n if (propertyMapper.xmlIsWrapped) {\n propName = propertyMapper.xmlName;\n } else {\n propName = propertyMapper.xmlElementName || propertyMapper.xmlName;\n }\n } else {\n const paths = splitSerializeName(propertyMapper.serializedName!);\n propName = paths.pop();\n\n for (const pathName of paths) {\n const childObject = parentObject[pathName];\n if (\n childObject == undefined &&\n (object[key] != undefined || propertyMapper.defaultValue !== undefined)\n ) {\n parentObject[pathName] = {};\n }\n parentObject = parentObject[pathName];\n }\n }\n\n if (parentObject != undefined) {\n if (isXml && mapper.xmlNamespace) {\n const xmlnsKey = mapper.xmlNamespacePrefix\n ? `xmlns:${mapper.xmlNamespacePrefix}`\n : \"xmlns\";\n parentObject[XML_ATTRKEY] = {\n ...parentObject[XML_ATTRKEY],\n [xmlnsKey]: mapper.xmlNamespace,\n };\n }\n const propertyObjectName =\n propertyMapper.serializedName !== \"\"\n ? objectName + \".\" + propertyMapper.serializedName\n : objectName;\n\n let toSerialize = object[key];\n const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper);\n if (\n polymorphicDiscriminator &&\n polymorphicDiscriminator.clientName === key &&\n toSerialize == undefined\n ) {\n toSerialize = mapper.serializedName;\n }\n\n const serializedValue = serializer.serialize(\n propertyMapper,\n toSerialize,\n propertyObjectName,\n options\n );\n\n if (serializedValue !== undefined && propName != undefined) {\n const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options);\n if (isXml && propertyMapper.xmlIsAttribute) {\n // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js.\n // This keeps things simple while preventing name collision\n // with names in user documents.\n parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {};\n parentObject[XML_ATTRKEY][propName] = serializedValue;\n } else if (isXml && propertyMapper.xmlIsWrapped) {\n parentObject[propName] = { [propertyMapper.xmlElementName!]: value };\n } else {\n parentObject[propName] = value;\n }\n }\n }\n }\n\n const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName);\n if (additionalPropertiesMapper) {\n const propNames = Object.keys(modelProps);\n for (const clientPropName in object) {\n const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName);\n if (isAdditionalProperty) {\n payload[clientPropName] = serializer.serialize(\n additionalPropertiesMapper,\n object[clientPropName],\n objectName + '[\"' + clientPropName + '\"]',\n options\n );\n }\n }\n }\n\n return payload;\n }\n return object;\n}\n\nfunction getXmlObjectValue(\n propertyMapper: Mapper,\n serializedValue: any,\n isXml: boolean,\n options: Required\n): any {\n if (!isXml || !propertyMapper.xmlNamespace) {\n return serializedValue;\n }\n\n const xmlnsKey = propertyMapper.xmlNamespacePrefix\n ? `xmlns:${propertyMapper.xmlNamespacePrefix}`\n : \"xmlns\";\n const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace };\n\n if ([\"Composite\"].includes(propertyMapper.type.name)) {\n if (serializedValue[XML_ATTRKEY]) {\n return serializedValue;\n } else {\n const result: any = { ...serializedValue };\n result[XML_ATTRKEY] = xmlNamespace;\n return result;\n }\n }\n const result: any = {};\n result[options.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = xmlNamespace;\n return result;\n}\n\nfunction isSpecialXmlProperty(propertyName: string, options: Required): boolean {\n return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName);\n}\n\nfunction deserializeCompositeType(\n serializer: Serializer,\n mapper: CompositeMapper,\n responseBody: any,\n objectName: string,\n options: Required\n): any {\n if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {\n mapper = getPolymorphicMapper(serializer, mapper, responseBody, \"serializedName\");\n }\n\n const modelProps = resolveModelProperties(serializer, mapper, objectName);\n let instance: { [key: string]: any } = {};\n const handledPropertyNames: string[] = [];\n\n for (const key of Object.keys(modelProps)) {\n const propertyMapper = modelProps[key];\n const paths = splitSerializeName(modelProps[key].serializedName!);\n handledPropertyNames.push(paths[0]);\n const { serializedName, xmlName, xmlElementName } = propertyMapper;\n let propertyObjectName = objectName;\n if (serializedName !== \"\" && serializedName !== undefined) {\n propertyObjectName = objectName + \".\" + serializedName;\n }\n\n const headerCollectionPrefix = (propertyMapper as DictionaryMapper).headerCollectionPrefix;\n if (headerCollectionPrefix) {\n const dictionary: any = {};\n for (const headerKey of Object.keys(responseBody)) {\n if (headerKey.startsWith(headerCollectionPrefix)) {\n dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(\n (propertyMapper as DictionaryMapper).type.value,\n responseBody[headerKey],\n propertyObjectName,\n options\n );\n }\n\n handledPropertyNames.push(headerKey);\n }\n instance[key] = dictionary;\n } else if (serializer.isXML) {\n if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {\n instance[key] = serializer.deserialize(\n propertyMapper,\n responseBody[XML_ATTRKEY][xmlName!],\n propertyObjectName,\n options\n );\n } else {\n const propertyName = xmlElementName || xmlName || serializedName;\n if (propertyMapper.xmlIsWrapped) {\n /* a list of wrapped by \n For the xml example below\n \n ...\n ...\n \n the responseBody has\n {\n Cors: {\n CorsRule: [{...}, {...}]\n }\n }\n xmlName is \"Cors\" and xmlElementName is\"CorsRule\".\n */\n const wrapped = responseBody[xmlName!];\n const elementList = wrapped?.[xmlElementName!] ?? [];\n instance[key] = serializer.deserialize(\n propertyMapper,\n elementList,\n propertyObjectName,\n options\n );\n } else {\n const property = responseBody[propertyName!];\n instance[key] = serializer.deserialize(\n propertyMapper,\n property,\n propertyObjectName,\n options\n );\n }\n }\n } else {\n // deserialize the property if it is present in the provided responseBody instance\n let propertyInstance;\n let res = responseBody;\n // traversing the object step by step.\n for (const item of paths) {\n if (!res) break;\n res = res[item];\n }\n propertyInstance = res;\n const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator;\n // checking that the model property name (key)(ex: \"fishtype\") and the\n // clientName of the polymorphicDiscriminator {metadata} (ex: \"fishtype\")\n // instead of the serializedName of the polymorphicDiscriminator (ex: \"fish.type\")\n // is a better approach. The generator is not consistent with escaping '\\.' in the\n // serializedName of the property (ex: \"fish\\.type\") that is marked as polymorphic discriminator\n // and the serializedName of the metadata polymorphicDiscriminator (ex: \"fish.type\"). However,\n // the clientName transformation of the polymorphicDiscriminator (ex: \"fishtype\") and\n // the transformation of model property name (ex: \"fishtype\") is done consistently.\n // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator.\n if (\n polymorphicDiscriminator &&\n key === polymorphicDiscriminator.clientName &&\n propertyInstance == undefined\n ) {\n propertyInstance = mapper.serializedName;\n }\n\n let serializedValue;\n // paging\n if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === \"\") {\n propertyInstance = responseBody[key];\n const arrayInstance = serializer.deserialize(\n propertyMapper,\n propertyInstance,\n propertyObjectName,\n options\n );\n // Copy over any properties that have already been added into the instance, where they do\n // not exist on the newly de-serialized array\n for (const [k, v] of Object.entries(instance)) {\n if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) {\n arrayInstance[k] = v;\n }\n }\n instance = arrayInstance;\n } else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) {\n serializedValue = serializer.deserialize(\n propertyMapper,\n propertyInstance,\n propertyObjectName,\n options\n );\n instance[key] = serializedValue;\n }\n }\n }\n\n const additionalPropertiesMapper = mapper.type.additionalProperties;\n if (additionalPropertiesMapper) {\n const isAdditionalProperty = (responsePropName: string): boolean => {\n for (const clientPropName in modelProps) {\n const paths = splitSerializeName(modelProps[clientPropName].serializedName);\n if (paths[0] === responsePropName) {\n return false;\n }\n }\n return true;\n };\n\n for (const responsePropName in responseBody) {\n if (isAdditionalProperty(responsePropName)) {\n instance[responsePropName] = serializer.deserialize(\n additionalPropertiesMapper,\n responseBody[responsePropName],\n objectName + '[\"' + responsePropName + '\"]',\n options\n );\n }\n }\n } else if (responseBody) {\n for (const key of Object.keys(responseBody)) {\n if (\n instance[key] === undefined &&\n !handledPropertyNames.includes(key) &&\n !isSpecialXmlProperty(key, options)\n ) {\n instance[key] = responseBody[key];\n }\n }\n }\n\n return instance;\n}\n\nfunction deserializeDictionaryType(\n serializer: Serializer,\n mapper: DictionaryMapper,\n responseBody: any,\n objectName: string,\n options: Required\n): { [key: string]: any } {\n const value = mapper.type.value;\n if (!value || typeof value !== \"object\") {\n throw new Error(\n `\"value\" metadata for a Dictionary must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}`\n );\n }\n if (responseBody) {\n const tempDictionary: { [key: string]: any } = {};\n for (const key of Object.keys(responseBody)) {\n tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options);\n }\n return tempDictionary;\n }\n return responseBody;\n}\n\nfunction deserializeSequenceType(\n serializer: Serializer,\n mapper: SequenceMapper,\n responseBody: any,\n objectName: string,\n options: Required\n): any[] {\n const element = mapper.type.element;\n if (!element || typeof element !== \"object\") {\n throw new Error(\n `element\" metadata for an Array must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}`\n );\n }\n if (responseBody) {\n if (!Array.isArray(responseBody)) {\n // xml2js will interpret a single element array as just the element, so force it to be an array\n responseBody = [responseBody];\n }\n\n const tempArray = [];\n for (let i = 0; i < responseBody.length; i++) {\n tempArray[i] = serializer.deserialize(\n element,\n responseBody[i],\n `${objectName}[${i}]`,\n options\n );\n }\n return tempArray;\n }\n return responseBody;\n}\n\nfunction getPolymorphicMapper(\n serializer: Serializer,\n mapper: CompositeMapper,\n object: any,\n polymorphicPropertyName: \"clientName\" | \"serializedName\"\n): CompositeMapper {\n const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper);\n if (polymorphicDiscriminator) {\n const discriminatorName = polymorphicDiscriminator[polymorphicPropertyName];\n if (discriminatorName != undefined) {\n const discriminatorValue = object[discriminatorName];\n if (discriminatorValue != undefined) {\n const typeName = mapper.type.uberParent || mapper.type.className;\n const indexDiscriminator =\n discriminatorValue === typeName\n ? discriminatorValue\n : typeName + \".\" + discriminatorValue;\n const polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator];\n if (polymorphicMapper) {\n mapper = polymorphicMapper;\n }\n }\n }\n }\n return mapper;\n}\n\nfunction getPolymorphicDiscriminatorRecursively(\n serializer: Serializer,\n mapper: CompositeMapper\n): PolymorphicDiscriminator | undefined {\n return (\n mapper.type.polymorphicDiscriminator ||\n getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) ||\n getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)\n );\n}\n\nfunction getPolymorphicDiscriminatorSafely(serializer: Serializer, typeName?: string): any {\n return (\n typeName &&\n serializer.modelMappers[typeName] &&\n serializer.modelMappers[typeName].type.polymorphicDiscriminator\n );\n}\n\n/**\n * Description of various value constraints such as integer ranges and string regex.\n */\nexport interface MapperConstraints {\n /**\n * The value should be less than or equal to the `InclusiveMaximum` value.\n */\n InclusiveMaximum?: number;\n /**\n * The value should be less than the `ExclusiveMaximum` value.\n */\n ExclusiveMaximum?: number;\n /**\n * The value should be greater than or equal to the `InclusiveMinimum` value.\n */\n InclusiveMinimum?: number;\n /**\n * The value should be greater than the `InclusiveMinimum` value.\n */\n ExclusiveMinimum?: number;\n /**\n * The length should be smaller than the `MaxLength`.\n */\n MaxLength?: number;\n /**\n * The length should be bigger than the `MinLength`.\n */\n MinLength?: number;\n /**\n * The value must match the pattern.\n */\n Pattern?: RegExp;\n /**\n * The value must contain fewer items than the MaxItems value.\n */\n MaxItems?: number;\n /**\n * The value must contain more items than the `MinItems` value.\n */\n MinItems?: number;\n /**\n * The value must contain only unique items.\n */\n UniqueItems?: true;\n /**\n * The value should be exactly divisible by the `MultipleOf` value.\n */\n MultipleOf?: number;\n}\n\n/**\n * Type of the mapper. Includes known mappers.\n */\nexport type MapperType =\n | SimpleMapperType\n | CompositeMapperType\n | SequenceMapperType\n | DictionaryMapperType\n | EnumMapperType;\n\n/**\n * The type of a simple mapper.\n */\nexport interface SimpleMapperType {\n /**\n * Name of the type of the property.\n */\n name:\n | \"Base64Url\"\n | \"Boolean\"\n | \"ByteArray\"\n | \"Date\"\n | \"DateTime\"\n | \"DateTimeRfc1123\"\n | \"Object\"\n | \"Stream\"\n | \"String\"\n | \"TimeSpan\"\n | \"UnixTime\"\n | \"Uuid\"\n | \"Number\"\n | \"any\";\n}\n\n/**\n * Helps build a mapper that describes how to map a set of properties of an object based on other mappers.\n *\n * Only one of the following properties should be present: `className`, `modelProperties` and `additionalProperties`.\n */\nexport interface CompositeMapperType {\n /**\n * Name of the composite mapper type.\n */\n name: \"Composite\";\n\n /**\n * Use `className` to reference another type definition.\n */\n className?: string;\n\n /**\n * Use `modelProperties` when the reference to the other type has been resolved.\n */\n modelProperties?: { [propertyName: string]: Mapper };\n\n /**\n * Used when a model has `additionalProperties: true`. Allows the generic processing of unnamed model properties on the response object.\n */\n additionalProperties?: Mapper;\n\n /**\n * The name of the top-most parent scheme, the one that has no parents.\n */\n uberParent?: string;\n\n /**\n * A polymorphic discriminator.\n */\n polymorphicDiscriminator?: PolymorphicDiscriminator;\n}\n\n/**\n * Helps build a mapper that describes how to parse a sequence of mapped values.\n */\nexport interface SequenceMapperType {\n /**\n * Name of the sequence type mapper.\n */\n name: \"Sequence\";\n /**\n * The mapper to use to map each one of the properties of the sequence.\n */\n element: Mapper;\n}\n\n/**\n * Helps build a mapper that describes how to parse a dictionary of mapped values.\n */\nexport interface DictionaryMapperType {\n /**\n * Name of the sequence type mapper.\n */\n name: \"Dictionary\";\n /**\n * The mapper to use to map the value of each property in the dictionary.\n */\n value: Mapper;\n}\n\n/**\n * Helps build a mapper that describes how to parse an enum value.\n */\nexport interface EnumMapperType {\n /**\n * Name of the enum type mapper.\n */\n name: \"Enum\";\n /**\n * Values allowed by this mapper.\n */\n allowedValues: any[];\n}\n\n/**\n * The base definition of a mapper. Can be used for XML and plain JavaScript objects.\n */\nexport interface BaseMapper {\n /**\n * Name for the xml element\n */\n xmlName?: string;\n /**\n * Xml element namespace\n */\n xmlNamespace?: string;\n /**\n * Xml element namespace prefix\n */\n xmlNamespacePrefix?: string;\n /**\n * Determines if the current property should be serialized as an attribute of the parent xml element\n */\n xmlIsAttribute?: boolean;\n /**\n * Name for the xml elements when serializing an array\n */\n xmlElementName?: string;\n /**\n * Whether or not the current property should have a wrapping XML element\n */\n xmlIsWrapped?: boolean;\n /**\n * Whether or not the current property is readonly\n */\n readOnly?: boolean;\n /**\n * Whether or not the current property is a constant\n */\n isConstant?: boolean;\n /**\n * Whether or not the current property is required\n */\n required?: boolean;\n /**\n * Whether or not the current property allows mull as a value\n */\n nullable?: boolean;\n /**\n * The name to use when serializing\n */\n serializedName?: string;\n /**\n * Type of the mapper\n */\n type: MapperType;\n /**\n * Default value when one is not explicitly provided\n */\n defaultValue?: any;\n /**\n * Constraints to test the current value against\n */\n constraints?: MapperConstraints;\n}\n\n/**\n * Mappers are definitions of the data models used in the library.\n * These data models are part of the Operation or Client definitions in the responses or parameters.\n */\nexport type Mapper = BaseMapper | CompositeMapper | SequenceMapper | DictionaryMapper | EnumMapper;\n\n/**\n * Used to disambiguate discriminated type unions.\n * For example, if response can have many shapes but also includes a 'kind' field (or similar),\n * that field can be used to determine how to deserialize the response to the correct type.\n */\nexport interface PolymorphicDiscriminator {\n /**\n * Name of the discriminant property in the original JSON payload, e.g. `@odata.kind`.\n */\n serializedName: string;\n /**\n * Name to use on the resulting object instead of the original property name.\n * Useful since the JSON property could be difficult to work with.\n * For example: For a field received as `@odata.kind`, the final object could instead include a property simply named `kind`.\n */\n clientName: string;\n /**\n * It may contain any other property.\n */\n [key: string]: string;\n}\n\n/**\n * A mapper composed of other mappers.\n */\nexport interface CompositeMapper extends BaseMapper {\n /**\n * The type descriptor of the `CompositeMapper`.\n */\n type: CompositeMapperType;\n}\n\n/**\n * A mapper describing arrays.\n */\nexport interface SequenceMapper extends BaseMapper {\n /**\n * The type descriptor of the `SequenceMapper`.\n */\n type: SequenceMapperType;\n}\n\n/**\n * A mapper describing plain JavaScript objects used as key/value pairs.\n */\nexport interface DictionaryMapper extends BaseMapper {\n /**\n * The type descriptor of the `DictionaryMapper`.\n */\n type: DictionaryMapperType;\n /**\n * Optionally, a prefix to add to the header collection.\n */\n headerCollectionPrefix?: string;\n}\n\n/**\n * A mapper describing an enum value.\n */\nexport interface EnumMapper extends BaseMapper {\n /**\n * The type descriptor of the `EnumMapper`.\n */\n type: EnumMapperType;\n}\n\n/**\n * An interface representing an URL parameter value.\n */\nexport interface UrlParameterValue {\n /**\n * The URL value.\n */\n value: string;\n /**\n * Whether to keep or skip URL encoding.\n */\n skipUrlEncoding: boolean;\n}\n\n/**\n * Utility function that serializes an object that might contain binary information into a plain object, array or a string.\n */\nexport function serializeObject(toSerialize: unknown): any {\n const castToSerialize = toSerialize as Record;\n if (toSerialize == undefined) return undefined;\n if (toSerialize instanceof Uint8Array) {\n toSerialize = base64.encodeByteArray(toSerialize);\n return toSerialize;\n } else if (toSerialize instanceof Date) {\n return toSerialize.toISOString();\n } else if (Array.isArray(toSerialize)) {\n const array = [];\n for (let i = 0; i < toSerialize.length; i++) {\n array.push(serializeObject(toSerialize[i]));\n }\n return array;\n } else if (typeof toSerialize === \"object\") {\n const dictionary: { [key: string]: any } = {};\n for (const property in toSerialize) {\n dictionary[property] = serializeObject(castToSerialize[property]);\n }\n return dictionary;\n }\n return toSerialize;\n}\n\n/**\n * Utility function to create a K:V from a list of strings\n */\nfunction strEnum(o: Array): { [K in T]: K } {\n const result: any = {};\n for (const key of o) {\n result[key] = key;\n }\n return result;\n}\n\n/**\n * String enum containing the string types of property mappers.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MapperType = strEnum([\n \"Base64Url\",\n \"Boolean\",\n \"ByteArray\",\n \"Composite\",\n \"Date\",\n \"DateTime\",\n \"DateTimeRfc1123\",\n \"Dictionary\",\n \"Enum\",\n \"Number\",\n \"Object\",\n \"Sequence\",\n \"String\",\n \"Stream\",\n \"TimeSpan\",\n \"UnixTime\",\n]);\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { BaseRequestPolicy, HttpOperationResponse, WebResource } from \"@azure/core-http\";\n\n/**\n * Credential policy used to sign HTTP(S) requests before sending. This is an\n * abstract class.\n */\nexport abstract class CredentialPolicy extends BaseRequestPolicy {\n /**\n * Sends out request.\n *\n * @param request -\n */\n public sendRequest(request: WebResource): Promise {\n return this._nextPolicy.sendRequest(this.signRequest(request));\n }\n\n /**\n * Child classes must implement this method with request signing. This method\n * will be executed in {@link sendRequest}.\n *\n * @param request -\n */\n protected signRequest(request: WebResource): WebResource {\n // Child classes must override this method with request signing. This method\n // will be executed in sendRequest().\n return request;\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestPolicy, RequestPolicyOptions } from \"@azure/core-http\";\n\nimport { CredentialPolicy } from \"./CredentialPolicy\";\n\n/**\n * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources\n * or for use with Shared Access Signatures (SAS).\n */\nexport class AnonymousCredentialPolicy extends CredentialPolicy {\n /**\n * Creates an instance of AnonymousCredentialPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) {\n super(nextPolicy, options);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestPolicy, RequestPolicyOptions } from \"@azure/core-http\";\n\nimport { AnonymousCredentialPolicy } from \"../policies/AnonymousCredentialPolicy\";\nimport { Credential } from \"./Credential\";\n\n/**\n * AnonymousCredential provides a credentialPolicyCreator member used to create\n * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with\n * HTTP(S) requests that read public resources or for use with Shared Access\n * Signatures (SAS).\n */\nexport class AnonymousCredential extends Credential {\n /**\n * Creates an {@link AnonymousCredentialPolicy} object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions\n ): AnonymousCredentialPolicy {\n return new AnonymousCredentialPolicy(nextPolicy, options);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from \"@azure/core-http\";\nimport { CredentialPolicy } from \"../policies/CredentialPolicy\";\n\n/**\n * Credential is an abstract class for Azure Storage HTTP requests signing. This\n * class will host an credentialPolicyCreator factory which generates CredentialPolicy.\n */\nexport abstract class Credential implements RequestPolicyFactory {\n /**\n * Creates a RequestPolicy object.\n *\n * @param _nextPolicy -\n * @param _options -\n */\n public create(_nextPolicy: RequestPolicy, _options: RequestPolicyOptions): RequestPolicy {\n throw new Error(\"Method should be implemented in children classes.\");\n }\n}\n\n/**\n * A factory function that creates a new CredentialPolicy that uses the provided nextPolicy.\n */\nexport type CredentialPolicyCreator = (\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions\n) => CredentialPolicy;\n","import * as React from 'react';\nimport { divProperties, getNativeProps } from '../../Utilities';\nimport { classNamesFunction } from '../../Utilities';\nimport type { ILabelProps, ILabelStyleProps, ILabelStyles } from './Label.types';\n\nconst getClassNames = classNamesFunction({\n // Label is used a lot by other components.\n // It's likely to see expected cases which pass different className to the Label.\n // Therefore setting a larger cache size.\n cacheSize: 100,\n});\n\nexport class LabelBase extends React.Component {\n public render(): JSX.Element {\n const { as: RootType = 'label', children, className, disabled, styles, required, theme } = this.props;\n const classNames = getClassNames(styles, {\n className,\n disabled,\n required,\n theme: theme!,\n });\n return (\n \n {children}\n \n );\n }\n}\n","import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { LabelBase } from './Label.base';\nimport { getStyles } from './Label.styles';\nimport type { ILabelProps, ILabelStyleProps, ILabelStyles } from './Label.types';\n\nexport const Label: React.FunctionComponent = styled(\n LabelBase,\n getStyles,\n undefined,\n {\n scope: 'Label',\n },\n);\n","import { HighContrastSelector, FontWeights, getHighContrastNoAdjustStyle } from '../../Styling';\nimport type { ILabelStyleProps, ILabelStyles } from './Label.types';\n\nexport const getStyles = (props: ILabelStyleProps): ILabelStyles => {\n const { theme, className, disabled, required } = props;\n const { semanticColors } = theme;\n\n // Tokens\n const labelFontWeight = FontWeights.semibold;\n const labelColor = semanticColors.bodyText;\n const labelDisabledColor = semanticColors.disabledBodyText;\n const labelRequiredStarColor = semanticColors.errorText;\n\n return {\n root: [\n 'ms-Label',\n theme.fonts.medium,\n {\n fontWeight: labelFontWeight,\n color: labelColor,\n boxSizing: 'border-box',\n boxShadow: 'none',\n margin: 0,\n display: 'block',\n padding: '5px 0',\n wordWrap: 'break-word',\n overflowWrap: 'break-word',\n },\n disabled && {\n color: labelDisabledColor,\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n required && {\n selectors: {\n '::after': {\n content: `' *'`,\n color: labelRequiredStarColor,\n paddingRight: 12,\n },\n },\n },\n className,\n ],\n };\n};\n","/* eslint-disable */\nimport { loadStyles } from '@microsoft/load-themed-styles';\nloadStyles([{\"rawString\":\".root_dd790ee3{display:inline-block;vertical-align:middle;speak:none;width:1em;height:1em}.svg_dd790ee3{height:100%;fill:currentColor;vertical-align:top;forced-color-adjust:auto}\"}]);\nexport const root = \"root_dd790ee3\";\nexport const svg = \"svg_dd790ee3\";","import * as React from 'react';\nimport type { IIconSubset } from '@fluentui/style-utilities';\nimport type { IconProviderProps } from './IconProvider.types';\n\n/**\n * Context for providing the IconSubset.\n */\nexport const IconContext = React.createContext(undefined);\n\n/**\n * Hook to access the Icon subset. Returns the icons that will override the default.\n * This can be overridden contextually using the `IconProvider`.\n */\nexport const useIconSubset = (): IIconSubset | undefined => React.useContext(IconContext);\n\n/**\n * Component to contextually override one or more of the default SVG icons\n */\nexport const IconProvider: React.FunctionComponent = props => {\n return {props.children};\n};\n","import * as React from 'react';\nimport { css, getNativeProps, htmlElementProperties } from '@fluentui/utilities';\nimport * as classes from './SvgIcon.scss';\nimport { useIconSubset } from '@fluentui/react-icon-provider';\nimport type { ISvgIconProps } from './SvgIcon.types';\nimport type { SvgIconCreateFnParams } from './types';\n\nconst createSvgIcon = ({ svg, displayName }: SvgIconCreateFnParams) => {\n const Component: React.FC & TProps & ISvgIconProps> = props => {\n const { className, style = {} } = props;\n const icons = useIconSubset(); // TODO: handle fontFace and styles\n\n const nativeProps = getNativeProps>(props, htmlElementProperties);\n const containerProps =\n props['aria-label'] || props['aria-labelledby'] || props.title\n ? {\n role: 'img',\n }\n : {\n ['aria-hidden']: true,\n };\n\n return React.createElement(\n 'span',\n {\n ...containerProps,\n ...nativeProps,\n className: css(classes.root, className),\n style,\n },\n icons?.icons?.[displayName] ? icons.icons[displayName] : svg({ classes, props }),\n );\n };\n\n Component.displayName = displayName;\n\n return Component;\n};\n\nexport default createSvgIcon;\n","import * as React from 'react';\nimport { DirectionalHint } from '../../common/DirectionalHint';\nimport type { IFocusZoneProps } from '../../FocusZone';\nimport type { IIconProps } from '../../Icon';\nimport type { ICalloutProps, ICalloutContentStyleProps } from '../../Callout';\nimport type { ITheme, IStyle } from '../../Styling';\nimport type { IButtonStyles } from '../../Button';\nimport type {\n IRefObject,\n IBaseProps,\n IRectangle,\n IRenderFunction,\n IStyleFunctionOrObject,\n IComponentAs,\n} from '../../Utilities';\nimport type { IWithResponsiveModeState } from '../../ResponsiveMode';\nimport type { IContextualMenuClassNames, IMenuItemClassNames } from './ContextualMenu.classNames';\nimport type { IVerticalDividerClassNames } from '../Divider/VerticalDivider.types';\nimport type {\n IContextualMenuItemProps,\n IContextualMenuRenderItem,\n IContextualMenuItemStyleProps,\n IContextualMenuItemRenderFunctions,\n} from './ContextualMenuItem.types';\nimport type { IKeytipProps } from '../../Keytip';\nimport type { Target } from '@fluentui/react-hooks';\nimport type { IPopupRestoreFocusParams } from '../../Popup';\nimport { IContextualMenuItemWrapperProps } from './ContextualMenuItemWrapper/ContextualMenuItemWrapper.types';\n\nexport { DirectionalHint } from '../../common/DirectionalHint';\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport enum ContextualMenuItemType {\n Normal = 0,\n Divider = 1,\n Header = 2,\n Section = 3,\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenu {}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuProps\n extends IBaseProps,\n React.RefAttributes,\n // eslint-disable-next-line deprecation/deprecation\n IWithResponsiveModeState {\n /**\n * Optional callback to access the IContextualMenu interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n * @deprecated ContextualMenu has no imperative methods, so componentRef no longer returns a ref\n */\n componentRef?: IRefObject;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject;\n\n /**\n * Theme provided by higher-order component.\n */\n theme?: ITheme;\n\n /**\n * Additional CSS class to apply to the ContextualMenu.\n */\n className?: string;\n\n /**\n * The target that the ContextualMenu should try to position itself based on.\n * It can be either an element, a query selector string resolving to a valid element,\n * or a MouseEvent. If a MouseEvent is given, the origin point of the event will be used.\n */\n target?: Target;\n\n /**\n * How the menu should be positioned\n * @defaultvalue DirectionalHint.bottomAutoEdge\n */\n directionalHint?: DirectionalHint;\n\n /**\n * How the menu should be positioned in RTL layouts.\n * If not specified, a mirror of `directionalHint` will be used.\n */\n directionalHintForRTL?: DirectionalHint;\n\n /**\n * The gap between the ContextualMenu and the target\n * @defaultvalue 0\n */\n gapSpace?: number;\n\n /**\n * The width of the beak.\n * @defaultvalue 16\n */\n beakWidth?: number;\n\n /**\n * If true the context menu will render as the same width as the target element\n * @defaultvalue false\n */\n useTargetWidth?: boolean;\n\n /**\n * If true the context menu will have a minimum width equal to the width of the target element\n * @defaultvalue false\n */\n useTargetAsMinWidth?: boolean;\n\n /**\n * The bounding rectangle (or callback that returns a rectangle) which the contextual menu can appear in.\n */\n bounds?: IRectangle | ((target?: Target, targetWindow?: Window) => IRectangle | undefined);\n\n /**\n * If true then the beak is visible. If false it will not be shown.\n */\n isBeakVisible?: boolean;\n\n /**\n * If true, the menu will be positioned to cover the target.\n * If false, it will be positioned next to the target.\n * @defaultvalue false\n */\n coverTarget?: boolean;\n\n /**\n * If true the positioning logic will prefer to flip edges rather than to nudge the rectangle to fit within bounds,\n * thus making sure the element aligns perfectly with target's alignment edge\n */\n alignTargetEdge?: boolean;\n\n /**\n * Menu items to display.\n */\n items: IContextualMenuItem[];\n\n /**\n * Used as `aria-labelledby` for the menu element inside the callout.\n */\n labelElementId?: string;\n\n /**\n * Whether to focus on the menu when mounted.\n * @defaultvalue true\n */\n shouldFocusOnMount?: boolean;\n\n /**\n * Whether to focus on the contextual menu container (as opposed to the first menu item).\n *\n * Avoid using as it breaks the default focus behaviour when using assistive technologies.\n */\n shouldFocusOnContainer?: boolean;\n\n /**\n * Callback when the ContextualMenu tries to close. If `dismissAll` is true then all\n * submenus will be dismissed.\n */\n onDismiss?: (ev?: Event | React.MouseEvent | React.KeyboardEvent, dismissAll?: boolean) => void;\n\n /**\n * Click handler which is invoked if `onClick` is not passed for individual contextual\n * menu item.\n * Returning true will dismiss the menu even if `ev.preventDefault()` was called.\n */\n onItemClick?: (\n ev?: React.MouseEvent | React.KeyboardEvent,\n item?: IContextualMenuItem,\n ) => boolean | void;\n\n /**\n * Whether this menu is a submenu of another menu.\n */\n isSubMenu?: boolean;\n\n /**\n * ID for the ContextualMenu's root element (inside the callout).\n * Should be used for `aria-owns` and other such uses, rather than direct reference for programmatic purposes.\n */\n id?: string;\n\n /**\n * Accessible label for the ContextualMenu's root element (inside the callout).\n */\n ariaLabel?: string;\n\n /**\n * If true do not render on a new layer. If false render on a new layer.\n * @defaultvalue false\n */\n doNotLayer?: boolean;\n\n /**\n * If true the position will not change sides in an attempt to fit the ContextualMenu within bounds.\n * It will still attempt to align it to whatever bounds are given.\n * @defaultvalue false\n */\n directionalHintFixed?: boolean;\n\n /**\n * Callback for when the menu has been opened.\n */\n onMenuOpened?: (contextualMenu?: IContextualMenuProps) => void;\n\n /**\n * Callback for when the menu is being closed (removing from the DOM).\n */\n onMenuDismissed?: (contextualMenu?: IContextualMenuProps) => void;\n\n /**\n * Additional custom props for the Callout.\n */\n calloutProps?: ICalloutProps;\n\n /**\n * Title to be displayed at the top of the menu, above the items.\n */\n title?: string;\n\n /**\n * Method to provide the classnames to style the contextual menu.\n * @deprecated Use `styles` instead to leverage mergeStyles API.\n */\n // eslint-disable-next-line deprecation/deprecation\n getMenuClassNames?: (theme: ITheme, className?: string) => IContextualMenuClassNames;\n\n /** Custom render function for a submenu. */\n onRenderSubMenu?: IRenderFunction;\n\n /**\n * Method to override the render of the list of menu items.\n */\n onRenderMenuList?: IRenderFunction;\n\n /**\n * Method to wrap menu items. Gives the ability to wrap a custom\n * tooltip to each menu item button.\n */\n onRenderContextualMenuItem?: IRenderFunction;\n\n /**\n * Delay (in milliseconds) to wait before expanding / dismissing a submenu on mouseEnter or mouseLeave\n */\n subMenuHoverDelay?: number;\n\n /**\n * Custom component to use for rendering individual menu items.\n * @defaultvalue ContextualMenuItem\n */\n contextualMenuItemAs?: IComponentAs;\n\n /**\n * Props to pass down to the FocusZone.\n * NOTE: the default FocusZoneDirection will be used unless a direction\n * is specified in the focusZoneProps (even if other focusZoneProps are defined)\n * @defaultvalue \\{ direction: FocusZoneDirection.vertical \\}\n */\n focusZoneProps?: IFocusZoneProps;\n\n /**\n * Custom component to use for rendering the focus zone (the root).\n * @defaultValue FocusZone\n */\n focusZoneAs?: IComponentAs;\n\n /**\n * If true, renders the ContextualMenu in a hidden state.\n * Use this flag, rather than rendering a ContextualMenu conditionally based on visibility,\n * to improve rendering performance when it becomes visible.\n * Note: When ContextualMenu is hidden its content will not be rendered. It will only render\n * once the ContextualMenu is visible.\n */\n hidden?: boolean;\n\n /**\n * If true, the menu will be updated even when `hidden=true`. Note that this will consume\n * resources to update even when nothing is being shown to the user. This might be helpful if\n * your updates are small and you want the menu to display quickly when `hidden` is set to false.\n */\n shouldUpdateWhenHidden?: boolean;\n\n /**\n * If true, the contextual menu will not be updated until focus enters the menu via other means.\n * This will only result in different behavior when `shouldFocusOnMount = false`.\n */\n delayUpdateFocusOnHover?: boolean;\n\n /**\n * Called when the component is unmounting, and focus needs to be restored. If this is provided,\n * focus will not be restored automatically, and you'll need to call `params.originalElement.focus()`.\n */\n onRestoreFocus?: (params: IPopupRestoreFocusParams) => void;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuItemRenderProps extends IContextualMenuItem {\n index: number;\n focusableElementIndex: number;\n totalItemCount: number;\n hasCheckmarks: boolean;\n hasIcons: boolean;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuListProps {\n items: IContextualMenuItem[];\n totalItemCount: number;\n hasCheckmarks: boolean;\n hasIcons: boolean;\n defaultMenuItemRenderer: (item: IContextualMenuItemRenderProps) => React.ReactNode;\n ariaLabel?: string;\n labelElementId?: string;\n role?: string;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuItem {\n /**\n * Optional callback to access the IContextualMenuRenderItem interface.\n * This will get passed down to ContextualMenuItem.\n */\n componentRef?: IRefObject;\n\n /**\n * Unique id to identify the item\n */\n key: string;\n\n /**\n * Text of the menu item.\n * If a standard hyphen (-) is passed in, then the item will be rendered as a divider.\n * If a dash must appear as text, use an emdash (—), figuredash (‒), or minus symbol (−) instead.\n */\n text?: string;\n\n /**\n * Secondary description for the menu item to display\n */\n secondaryText?: string;\n\n itemType?: ContextualMenuItemType;\n\n /**\n * Props for an icon to display next to the item.\n */\n iconProps?: IIconProps;\n\n /**\n * Custom render function for the menu item icon.\n * iconProps must be present on at least one item for onRenderIcon to be called.\n */\n onRenderIcon?: IRenderFunction;\n\n /**\n * Props for the Icon used for the chevron.\n */\n submenuIconProps?: IIconProps;\n\n /**\n * Whether the menu item is disabled\n * @defaultvalue false\n */\n disabled?: boolean;\n\n /**\n * If the menu item is a split button, this prop disables purely the primary action of the button.\n * @defaultvalue false\n */\n primaryDisabled?: boolean;\n\n /**\n * @deprecated Not used\n */\n shortCut?: string;\n\n /**\n * Whether or not this menu item can be checked\n * @defaultvalue false\n */\n canCheck?: boolean;\n\n /**\n * Whether or not this menu item is currently checked.\n * @defaultvalue false\n */\n checked?: boolean;\n\n /**\n * Whether or not this menu item is a splitButton.\n * @defaultvalue false\n */\n split?: boolean;\n\n /**\n * Any custom data the developer wishes to associate with the menu item.\n */\n data?: any;\n\n /**\n * Callback for when the menu item is invoked. If `ev.preventDefault()` is called in `onClick`,\n * the click will not close the menu.\n *\n * Only for ContextualMenu items, returning true will dismiss the menu even if `ev.preventDefault()`\n * was called (does not apply for button or CommandBar sub-menu items).\n */\n onClick?: (\n ev?: React.MouseEvent | React.KeyboardEvent,\n item?: IContextualMenuItem,\n ) => boolean | void;\n\n /**\n * Navigate to this URL when the menu item is clicked.\n */\n href?: string;\n\n /**\n * Target window when using `href`.\n */\n target?: string;\n\n /**\n * Link relation setting when using `href`.\n * If `target` is `_blank`, `rel` is defaulted to a value to prevent clickjacking.\n */\n rel?: string;\n\n /**\n * Properties to apply to a submenu to this item.\n *\n * The ContextualMenu will provide default values for `target`, `onDismiss`, `isSubMenu`,\n * `id`, `shouldFocusOnMount`, `directionalHint`, `className`, and `gapSpace`, all of which\n * can be overridden.\n */\n subMenuProps?: IContextualMenuProps;\n\n /**\n * Method to provide the classnames to style the individual items inside a menu.\n * @deprecated Use `styles` prop of `IContextualMenuItemProps` to leverage mergeStyles API.\n */\n getItemClassNames?: (\n theme: ITheme,\n disabled: boolean,\n expanded: boolean,\n checked: boolean,\n isAnchorLink: boolean,\n knownIcon: boolean,\n itemClassName?: string,\n dividerClassName?: string,\n iconClassName?: string,\n subMenuClassName?: string,\n primaryDisabled?: boolean,\n ) => // eslint-disable-next-line deprecation/deprecation\n IMenuItemClassNames;\n\n /**\n * Optional IContextualMenuItemProps overrides to customize behaviors such as item styling via `styles`.\n */\n itemProps?: Partial;\n\n /**\n * Method to provide the classnames to style the Vertical Divider of a split button inside a menu.\n * Default value is the `getSplitButtonVerticalDividerClassNames` func defined in `ContextualMenu.classnames.ts`.\n * @defaultvalue getSplitButtonVerticalDividerClassNames\n */\n // eslint-disable-next-line deprecation/deprecation\n getSplitButtonVerticalDividerClassNames?: (theme: ITheme) => IVerticalDividerClassNames;\n\n /**\n * Properties to apply to render this item as a section.\n * This prop is mutually exclusive with `subMenuProps`.\n */\n sectionProps?: IContextualMenuSection;\n\n /**\n * Additional CSS class to apply to the menu item.\n */\n className?: string;\n\n /**\n * Additional styles to apply to the menu item\n * @deprecated Use `styles` instead to leverage mergeStyles API.\n */\n style?: React.CSSProperties;\n\n /**\n * Custom accessible label for the element.\n * If no override is specified, the `aria-label` attribute will contain the item name.\n */\n ariaLabel?: string;\n\n /**\n * Title (tooltip) text displayed when hovering over an item.\n */\n title?: string;\n\n /**\n * Method to custom render this menu item.\n * For keyboard accessibility, the top-level rendered item should be a focusable element\n * (like an anchor or a button) or have the `data-is-focusable` property set to true.\n *\n * @param item - Item to render. Will typically be of type `IContextualMenuItem`.\n * (When rendering a command bar item, will be `ICommandBarItemProps`.)\n * @param dismissMenu - Function to dismiss the menu. Can be used to ensure that a custom menu\n * item click dismisses the menu. (Will be undefined if rendering a command bar item.)\n */\n onRender?: (item: any, dismissMenu: (ev?: any, dismissAll?: boolean) => void) => React.ReactNode;\n\n /**\n * An override for the child content of the contextual menu item.\n */\n contextualMenuItemAs?: IComponentAs;\n\n /**\n * An override for the entire component used to render the contextal menu item.\n */\n contextualMenuItemWrapperAs?: IComponentAs;\n\n /**\n * Method to customize sub-components rendering of this menu item.\n *\n * @param props - Props used to pass into render functions\n * @param defaultRenders - Default render functions that renders default sub-components\n */\n onRenderContent?: (\n props: IContextualMenuItemProps,\n defaultRenders: IContextualMenuItemRenderFunctions,\n ) => React.ReactNode;\n\n /**\n * A function to be executed on mouse down. This is executed before an `onClick` event and can\n * be used to interrupt native on click events as well. The click event should still handle\n * the commands. This should only be used in special cases when react and non-react are mixed.\n */\n onMouseDown?: (item: IContextualMenuItem, event: React.MouseEvent) => void;\n\n /**\n * Optional override for the menu button's role.\n * @default `menuitem` or `menuitemcheckbox`\n */\n role?: string;\n\n /**\n * When rendering a custom menu component that is passed in, the component might also be a list of\n * elements. We want to keep track of the correct index our menu is using based off of\n * the length of the custom list. It is up to the user to increment the count for their list.\n */\n customOnRenderListLength?: number;\n\n /**\n * Keytip for this contextual menu item\n */\n keytipProps?: IKeytipProps;\n\n /**\n * @deprecated Use subMenuProps.items instead.\n */\n items?: IContextualMenuItem[];\n\n /**\n * Any additional properties to use when custom rendering menu items.\n */\n [propertyName: string]: any;\n\n /**\n * Detailed description of the menu item for the benefit of screen readers.\n */\n ariaDescription?: string;\n\n /**\n * ID of the element that contains additional detailed descriptive information for screen readers\n */\n ariaDescribedBy?: string;\n\n /**\n * @deprecated No longer used. All contextual menu items are now focusable when disabled.\n */\n inactive?: boolean;\n\n /**\n * Text of the menu item.\n * @deprecated Use `text` instead.\n */\n name?: string;\n\n /**\n * Flag which indicates that, when the item is clicked, the 'target' for the click event should be\n * overridden to reflect the launch target from the root menu.\n * This avoids a situation where the 'target' of the event may wind up detached from the DOM\n * when the menu is dismissed in response to the click.\n */\n preferMenuTargetAsEventTarget?: boolean;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuSection extends React.ClassAttributes {\n /**\n * The items to include inside the section.\n */\n items: IContextualMenuItem[];\n\n /**\n * The optional section title.\n */\n title?: string | IContextualMenuItem;\n\n /**\n * If set to true, the section will display a divider at the top of the section.\n */\n topDivider?: boolean;\n\n /**\n * If set to true, the section will display a divider at the bottom of the section.\n */\n bottomDivider?: boolean;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IMenuItemStyles extends IButtonStyles {\n /**\n * Styles for a menu item that is an anchor link.\n */\n item?: IStyle;\n\n /**\n * Styles for the content inside the button/link of the menuItem.\n */\n linkContent?: IStyle;\n\n /**\n * Styles for a menu item that is an anchor link.\n */\n anchorLink?: IStyle;\n\n /**\n * Default icon color style for known icons.\n */\n iconColor?: IStyle;\n\n /**\n * Default style for checkmark icons.\n */\n checkmarkIcon?: IStyle;\n\n /**\n * Styles for the submenu icon of a menu item.\n */\n subMenuIcon?: IStyle;\n\n /**\n * Styles for a divider item of a ContextualMenu.\n */\n divider?: IStyle;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuStyleProps {\n theme: ITheme;\n\n className?: string;\n\n // Insert ContextualMenu style props below\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuStyles {\n /**\n * Style override for the contextual menu title.\n */\n title: IStyle;\n\n /**\n * Style for the container which parents all menu items.\n */\n container: IStyle;\n\n /**\n * Base styles for the root element of all ContextualMenus.\n */\n root: IStyle;\n\n /**\n * Styles for the header item of a ContextualMenu\n */\n header: IStyle;\n\n /**\n * Styles for the list that contains all menuItems.\n */\n list: IStyle;\n\n /**\n * SubComponent styles.\n */\n subComponentStyles: IContextualMenuSubComponentStyles;\n}\n\n/**\n * {@docCategory ContextualMenu}\n */\nexport interface IContextualMenuSubComponentStyles {\n /** Styles for the callout that hosts the ContextualMenu options. */\n callout: IStyleFunctionOrObject;\n\n /** Styles for each menu item. */\n menuItem: IStyleFunctionOrObject;\n}\n","export const KTP_PREFIX = 'ktp';\nexport const KTP_SEPARATOR = '-';\nexport const KTP_FULL_PREFIX = KTP_PREFIX + KTP_SEPARATOR;\nexport const DATAKTP_TARGET = 'data-ktp-target';\nexport const DATAKTP_EXECUTE_TARGET = 'data-ktp-execute-target';\nexport const DATAKTP_ARIA_TARGET = 'data-ktp-aria-target';\nexport const KTP_LAYER_ID = 'ktp-layer-id';\nexport const KTP_ARIA_SEPARATOR = ', ';\n\n// Events\nexport namespace KeytipEvents {\n export const KEYTIP_ADDED = 'keytipAdded';\n export const KEYTIP_REMOVED = 'keytipRemoved';\n export const KEYTIP_UPDATED = 'keytipUpdated';\n export const PERSISTED_KEYTIP_ADDED = 'persistedKeytipAdded';\n export const PERSISTED_KEYTIP_REMOVED = 'persistedKeytipRemoved';\n export const PERSISTED_KEYTIP_EXECUTE = 'persistedKeytipExecute';\n export const ENTER_KEYTIP_MODE = 'enterKeytipMode';\n export const EXIT_KEYTIP_MODE = 'exitKeytipMode';\n}\n","import * as React from 'react';\nimport type { IStyle, ITheme } from '../../Styling';\nimport type { IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * Shimmer component props.\n * {@docCategory Shimmer}\n */\nexport interface IShimmerProps extends React.AllHTMLAttributes, React.RefAttributes {\n /**\n * Sets the width value of the shimmer wave wrapper.\n * @defaultvalue 100%\n */\n width?: number | string;\n\n /**\n * Controls when the shimmer is swapped with actual data through an animated transition.\n * @defaultvalue false\n */\n isDataLoaded?: boolean;\n\n /**\n * Elements to render in one line of the Shimmer.\n */\n shimmerElements?: IShimmerElement[];\n\n /**\n * Custom elements when necessary to build complex placeholder skeletons.\n */\n customElementsGroup?: React.ReactNode;\n\n /**\n * Localized string of the status label for screen reader\n */\n ariaLabel?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject;\n\n /**\n * Additional CSS class(es) to apply to the Shimmer container.\n */\n className?: string;\n\n /**\n * Theme provided by High-Order Component.\n */\n theme?: ITheme;\n\n /**\n * Defines an object with possible colors to pass for Shimmer customization used on different backgrounds.\n */\n shimmerColors?: IShimmerColors;\n\n /**\n * Only use if `customElementsGroup` has a single parent `div`. If a custom element is not provided, defaults to true.\n */\n improveCSSPerformance?: boolean;\n}\n\n/**\n * Shimmer Elements Interface representing all common properties between Gap, Circle and Line.\n * {@docCategory Shimmer}\n */\nexport interface IShimmerElement {\n /**\n * Represents the possible type of the shimmer elements: Gap, Circle, Line.\n * Required for every element you intend to use.\n */\n type: ShimmerElementType;\n\n /**\n * Sets the height of the element (ICircle, ILine, IGap) in pixels.\n * Read more details for each specific element.\n */\n height?: number;\n\n /**\n * Sets the width value of the element (ILine, IGap) in pixels.\n * Read more details for each specific element.\n */\n width?: number | string;\n\n /**\n * Sets vertical alignment of the element (ICircle, ILine).\n * @defaultvalue center\n */\n verticalAlign?: 'top' | 'center' | 'bottom';\n}\n\n/**\n * Line element interface\n * {@docCategory Shimmer}\n */\nexport interface ILine extends IShimmerElement {\n /**\n * Sets the height of the shimmer line in pixels.\n * @defaultvalue 16px\n */\n height?: number;\n\n /**\n * Line width value.\n * @defaultvalue 100%\n */\n width?: number | string;\n}\n\n/**\n * Circle element interface\n * {@docCategory Shimmer}\n */\nexport interface ICircle extends IShimmerElement {\n /**\n * Sets the height of the shimmer circle in pixels.\n * Minimum supported 10px.\n * @defaultvalue 24px\n */\n height?: number;\n}\n\n/**\n * Gap element interface\n * {@docCategory Shimmer}\n */\nexport interface IGap extends IShimmerElement {\n /**\n * Sets the height of the shimmer gap in pixels.\n * @defaultvalue 16px\n */\n height?: number;\n\n /**\n * Gap width value.\n * @defaultvalue 10px\n */\n width?: number | string;\n}\n\n/**\n * Defines props needed to construct styles.\n * This represents the simplified set of immutable things which control the class names.\n * {@docCategory Shimmer}\n */\nexport interface IShimmerStyleProps {\n /** Boolean flag to trigger fadeIn/fadeOut transition animation when content is loaded. */\n isDataLoaded?: boolean;\n\n /** Optional CSS class name for the component attached to the root stylable area. */\n className?: string;\n\n /** Theme provided by High-Order Component. */\n theme: ITheme;\n\n /** Interval in milliseconds for the adeIn/fadeOut transition animation. */\n transitionAnimationInterval?: number;\n\n /** Color to be used as the main background color of Shimmer when not animating. */\n shimmerColor?: string;\n\n /** Tip color of the shimmer wave which gradually gets from and to `shimmerColor`. */\n shimmerWaveColor?: string;\n\n /** Boolean flag to apply a more efficient CSS selector */\n improveCSSPerformance?: boolean;\n}\n\n/**\n * Represents the stylable areas of the control.\n * {@docCategory Shimmer}\n */\nexport interface IShimmerStyles {\n /** Refers to the root wrapper element. */\n root?: IStyle;\n\n /** Refers to wrapper element of the shimmer only. */\n shimmerWrapper?: IStyle;\n\n /** Refers to gradient element of the shimmer animation only. */\n shimmerGradient?: IStyle;\n\n /** Refers to wrapper element of the children only. */\n dataWrapper?: IStyle;\n\n /** Styles for the hidden helper element to aid with screen readers. */\n screenReaderText?: IStyle;\n}\n\n/**\n * Describes the possible types for shimmer elements used.\n * {@docCategory Shimmer}\n */\nexport enum ShimmerElementType {\n /**\n * Line element type\n */\n line = 1,\n\n /**\n * Circle element type\n */\n circle = 2,\n\n /**\n * Gap element type\n */\n gap = 3,\n}\n\n/**\n * Describes the default heights for shimmer elements when omitted in implementation.\n * {@docCategory Shimmer}\n */\nexport enum ShimmerElementsDefaultHeights {\n /**\n * Default height of the line element when not provided by user: 16px\n */\n line = 16,\n\n /**\n * Default height of the gap element when not provided by user: 16px\n */\n gap = 16,\n\n /**\n * Default height of the circle element when not provided by user: 24px\n */\n circle = 24,\n}\n\n/**\n * Interface describing the possible color customizations of Shimmer.\n * {@docCategory Shimmer}\n */\nexport interface IShimmerColors {\n /**\n * Defines the main background color which is the color you see when the wave is not animating.\n * @defaultvalue theme.palette.neutralLight\n */\n shimmer?: string;\n\n /**\n * Defines the tip color of the shimmer wave which gradually gets from and to `shimmer` color.\n * @defaultvalue theme.palette.neutralLighter\n */\n shimmerWave?: string;\n\n /**\n * Defines the background color of the space in between and around shimmer elements (borders, gaps and\n * rounded corners).\n * @defaultvalue theme.palette.white\n */\n background?: string;\n}\n","import * as React from 'react';\nimport { useControllableValue, useId, useMergedRefs, useWarnings } from '@fluentui/react-hooks';\nimport { useFocusRects, classNamesFunction } from '@fluentui/utilities';\nimport { Icon } from '../Icon/Icon';\nimport type { ICheckboxProps, ICheckboxStyleProps, ICheckboxStyles } from './Checkbox.types';\n\nconst getClassNames = classNamesFunction();\n\nexport const CheckboxBase: React.FunctionComponent = React.forwardRef