(function () { 'use strict'; var globalWindow = window; var window$1 = globalWindow; var navigator$1 = globalWindow.navigator; var document$1 = globalWindow.document; var history = globalWindow.history; var location$1 = globalWindow.location; var $$1 = window$1['jQuery']; var msDocs = window$1['msDocs']; var contentLoaded = new Promise(function (resolve) { return $$1(resolve); }); if (typeof CustomEvent !== 'function') { window$1.CustomEvent = function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; }; window$1.CustomEvent.prototype = Event.prototype; } if (typeof fetch !== 'function') { window.fetch = function (url, options) { options = options || {}; return new Promise(function (resolve, reject) { var request = new XMLHttpRequest(); request.open(options.method || 'get', url); for (var i in options.headers) { request.setRequestHeader(i, options.headers[i]); } request.withCredentials = options.credentials == 'include'; request.onload = function () { resolve(response()); }; request.onerror = reject; request.send(options.body); function response() { var keys = [], all = [], headers = {}, header; request.getAllResponseHeaders().replace(/^(.*?):\s*([\s\S]*?)$/gm, (function (m, key, value) { keys.push(key = key.toLowerCase()); all.push([key, value]); header = headers[key]; headers[key] = header ? header + "," + value : value; })); return { ok: (request.status / 200 | 0) == 1, status: request.status, statusText: request.statusText, url: request.responseURL, clone: response, text: function () { return Promise.resolve(request.responseText); }, json: function () { return Promise.resolve(request.responseText).then(JSON.parse); }, xml: function () { return Promise.resolve(request.responseXML); }, blob: function () { return Promise.resolve(new Blob([request.response])); }, headers: { keys: function () { return keys; }, entries: function () { return all; }, get: function (n) { return headers[n.toLowerCase()]; }, has: function (n) { return n.toLowerCase() in headers; } } }; } }); }; } var fetchWithTimeout = function (url, init) { var timeout = 30 * 1000; return new Promise(function (resolve, reject) { fetch(url, init).then(resolve, reject); setTimeout(function () { return reject('timeout'); }, timeout); }); }; if (!Array.prototype.find) { Object.defineProperty(Array.prototype, 'find', { value: function (predicate) { if (this == null) { throw new TypeError('"this" is null or not defined'); } var o = Object(this); var len = o.length >>> 0; if (typeof predicate !== 'function') { throw new TypeError('predicate must be a function'); } var thisArg = arguments[1]; var k = 0; while (k < len) { var kValue = o[k]; if (predicate.call(thisArg, kValue, k, o)) { return kValue; } k++; } return undefined; } }); } if (Array.from === undefined) { Array.from = function (x) { return Array.prototype.slice.call(x); }; } var loc = { "africa": "Africa", "all": "all", "allapis": "All APIs", "allPackages": "All Packages", "americas": "Americas", "apiReference": "{0} API Reference", "apiSearchIsUnavailable": "API search is unavailable. Please try again later.", "applies.to": "Applies to:", "asia": "Asia", "askAQuestion": "Ask a question", "author.name": "Author Name", "azureDisclaimer": "Azure Cloud Shell uses your existing Azure subscriptions. Using Cloud Shell and executing commands will incur associated costs.", "back.to.top": "Back to top", "change.page.locale": "Change Page Language", "clearfilter": "Clear Filter", "clearterm": "Clear Term", "close": "Close", "cloudShell.accountError": "There was an error accessing your Azure account.", "cloudShell.chooseAccount": "Choose one of your Azure accounts.", "cloudShell.loggingIn": "Logging into Azure Cloud Shell...", "cloudShell.pleaseLogin": "To use the Azure Cloud Shell, please login with your Azure account.", "code": "Code", "comments": "Comments", "continueHere": "Continue Here", "contributorGuide": "How to contribute", "contributors": "Contributors", "cookie.consent.europe": "By using this site you agree to the use of cookies for analytics, personalized content and ads.", "copy": "Copy", "currentSelection": "Current Selection:", "dark": "Dark", "description": "Description", "disable": "Disable", "disclaimer.archive": "This documentation is archived and is not being maintained.", "disclaimer.moniker": "This API is not supported in the currently selected framework.", "disclaimer.sxs.human": "You can display the English text in a popup window by moving the mouse pointer over the text.", "disclaimer.sxs.machine": "This article was translated by machine. You can display the English text in a popup window by moving the mouse pointer over the text.", "disclaimer.text": "This content is not available in your language. Here is the English version.", "dotnetEditor": ".NET Editor", "downloadPdf": "Download PDF", "edit": "Edit", "editdesc": "Edit This Document", "email": "Email", "enable": "Enable", "error": "Error", "europe": "Europe", "facebook": "Facebook", "feedback": "Feedback", "feedbackProduct": "Product Feedback", "filter.placeholder": "Filter", "filter.text": "Filter", "findALanguage": "Find a language", "footer.blog": "Blog", "getHelp": "Get help", "helpMeChoose": "Help me choose", "impressum.text": "Impressum", "in.this.article": "In this article", "intuneFeedback": "Intune Feedback", "language": "Language", "last.updated": "updated", "learnmore": "Learn more", "light": "Light", "linkedin": "LinkedIn", "loading": "Loading...", "loadMoreResults": "Load more results", "login": "Login", "maximize": "Maximize", "middleEast": "Middle East", "minimize": "Minimize", "minuteToRead": "{0} minutes to read", "moduleReference": "{0} Module Reference", "monikerFallback": "The requested page is not available for {0}. You have been redirected to the closest available version.", "more": "More", "msdn.redirection.message": "You were redirected to this page from MSDN. We are in the process of migrating all technical content to docs.microsoft.com.", "name": "Name", "next": "Next", "no.date": "date not available", "no.description": "description not available", "no.results": "No results", "no.search.term": "No search term", "noOutput": "No output", "null.option.description": "-- Select Value --", "options": "Options", "output": "Output", "pacific": "Pacific", "platform": "Platform", "previous": "Previous", "privacy.statement": "Privacy & Cookies", "privacystatement": "Privacy Statement", "product": "Product", "product.feedback": "To submit product feedback, please visit", "quickfilters": "Quick Filters", "reportAProductIssue": "Report a product issue", "resourcesFooter.startups": "Startups", "resourcesFooter.students": "Students", "resourcesFooter.title": "Resources", "resourcesFooter.videoLearning": "Video Learning", "response.code": "Response Code", "response.header": "Response Header", "restart": "Restart", "results.title": "Search results for", "rss": "RSS", "run": "Run", "sample.request": "Sample Request", "sample.response": "Sample Response", "search": "Search", "searchScopeTitle": "Search filter is \"{0}\". Tap to remove.", "selectLocaleInstructions": "Filter the list of languages by selecting a region or by typing the language name or locale code.", "selectVersion": "Select Version", "serviceUnavailable": "The service is temporarily unavailable. We are working on it.", "share": "Share", "sharedArticleSubject": "[Shared Article] {0}", "sharedesc": "Share This Document", "slack": "Slack", "startHere": "Start Here", "terms.of.use": "Terms of Use", "test.request": "Test Request", "theme": "Theme", "trademarks": "Trademarks", "try.it": "Try It", "twitter": "Twitter", "type": "Type", "version": "Version", "view.source": "View Code", "worldwide": "Worldwide" }; var rtlDictionary = { 'ar-sa': true, 'he-il': true }; function detectFeatures() { var html = document$1.documentElement; var className = html.className.replace('no-js', 'js'); if (('ontouchstart' in window$1) || window$1.DocumentTouch && document$1 instanceof window$1.DocumentTouch) { className += ' hasTouch'; } else { className += ' noTouch'; } html.className = className; } function detectHighContrast() { var div = document$1.createElement('div'); div.style.cssText = 'position:absolute;top:0;left:-2300px;background-color:#878787'; div.textContent = 'hc'; document$1.body.appendChild(div); var color = window$1.getComputedStyle(div).backgroundColor.toLowerCase(); document$1.body.removeChild(div); if (color !== '#878787' && color !== 'rgb(135, 135, 135)') { document$1.documentElement.className += ' highContrast'; } } function ie10MobileFix() { if (navigator$1.userAgent.match(/IEMobile\/10\.0/)) { var msViewportStyle = document$1.createElement("style"); msViewportStyle.appendChild(document$1.createTextNode("@-ms-viewport{width:auto!important}")); document$1.getElementsByTagName("head")[0]. appendChild(msViewportStyle); } } function fixDate() { $$1('time[datetime]').each(function () { var dateVal = new Date($$1(this).attr('datetime')); $$1(this).text(dateVal.toLocaleDateString(msDocs.data.userLocale, { year: 'numeric', month: '2-digit', day: '2-digit' })); }); $$1(".metadata").removeClass("loading"); } function pluginDomReadyShield() { $$1.fn.oldReady = $$1.fn.ready; $$1.fn.ready = function (fn) { return $$1.fn.oldReady(function () { try { if (fn) fn.apply($$1, arguments); } catch (e) { console.error(e); } }); }; } function pluginLALD() { var domReady = false; var $document = $$1(document$1); var handleAttachment = function (selector, event, arg1, arg2, namespace) { var namespacedEvent = event + '.' + namespace; var data = arg2 ? arg1 : null; var handler = arg2 ? arg2 : arg1; if (!domReady) { if (data) { $document.on(namespacedEvent, selector, data, handler); } else { $document.on(namespacedEvent, selector, handler); } } $$1(function () { domReady = true; $document.off(namespacedEvent, selector, handler); if (namespace === 'lald') { if (data) { $$1(selector).on(namespacedEvent, data, handler); } else { $$1(selector).on(namespacedEvent, handler); } } }); }; $$1.lald = function (selector, event, arg1, arg2) { handleAttachment(selector, event, arg1, arg2, 'lald'); }; $$1.lad = function (selector, event, arg1, arg2) { handleAttachment(selector, event, arg1, arg2, 'lad'); }; } function pluginAddState() { $$1.fn.removeState = function (namespace) { $$1(this).each(function () { var $this = $$1(this); if ($this.attr("class") && $this.attr("class").indexOf(namespace) >= 0) { var otherClasses = $$1.grep($this.attr("class").split(" "), function (aClass) { return aClass.lastIndexOf(namespace, 0) !== 0; }); $this.attr("class", otherClasses.join(" ")); } }); return this; }; $$1.fn.addState = function (namespace, state) { this.removeState(namespace); this.addClass(namespace + state); return this; }; $$1.fn.toggleState = function (namespace, state, switchVal) { var $this = $$1(this); if (typeof switchVal === "boolean") { if (switchVal) { $this.addState(namespace, state); } else { $this.removeClass(namespace + state); } return this; } if ($this.hasClass(namespace + state)) { $this.removeClass(namespace + state); } else { $this.addState(namespace, state); } return this; }; } function pluginIfThen() { $$1.fn.extend({ ifThen: function () { var args = arguments; if (args.length < 2) { return this; } for (var i = 0; i < args.length; i = i + 2) { if (args[i] && jQuery.isFunction(args[i + 1])) { args[i + 1].call(this); return this; } } if (args.length % 2 && (typeof args[args.length - 1] === "function")) { args[args.length - 1].call(this); } return this; } }); } var ProtectedLocalStorage = (function () { function ProtectedLocalStorage() { } ProtectedLocalStorage.prototype.setItem = function (key, data) { try { return window$1.localStorage.setItem(key, data); } catch (e) { return undefined; } }; ProtectedLocalStorage.prototype.setJsonItem = function (key, json) { try { return window$1.localStorage.setItem(key, JSON.stringify(json)); } catch (e) { return undefined; } }; ProtectedLocalStorage.prototype.getItem = function (key) { try { return window$1.localStorage.getItem(key); } catch (e) { return null; } }; ProtectedLocalStorage.prototype.getJsonItem = function (key) { try { return JSON.parse(window$1.localStorage.getItem(key)); } catch (e) { return null; } }; ProtectedLocalStorage.prototype.clear = function () { try { return window$1.localStorage.clear(); } catch (e) { return undefined; } }; ProtectedLocalStorage.prototype.removeItem = function (key) { try { return window$1.localStorage.removeItem(key); } catch (e) { return undefined; } }; Object.defineProperty(ProtectedLocalStorage.prototype, "length", { get: function () { try { return window$1.localStorage.length; } catch (e) { return 0; } }, enumerable: true, configurable: true }); ProtectedLocalStorage.prototype.key = function (index) { try { return window$1.localStorage.key(index); } catch (e) { return null; } }; return ProtectedLocalStorage; }()); var localStorage$1 = new ProtectedLocalStorage(); var ProtectedSessionStorage = (function () { function ProtectedSessionStorage() { } ProtectedSessionStorage.prototype.setItem = function (key, data) { try { return window$1.sessionStorage.setItem(key, data); } catch (e) { return undefined; } }; ProtectedSessionStorage.prototype.getItem = function (key) { try { return window$1.sessionStorage.getItem(key); } catch (e) { return null; } }; ProtectedSessionStorage.prototype.clear = function () { try { return window$1.sessionStorage.clear(); } catch (e) { return undefined; } }; ProtectedSessionStorage.prototype.removeItem = function (key) { try { return window$1.sessionStorage.removeItem(key); } catch (e) { return undefined; } }; Object.defineProperty(ProtectedSessionStorage.prototype, "length", { get: function () { try { return window$1.sessionStorage.length; } catch (e) { return 0; } }, enumerable: true, configurable: true }); ProtectedSessionStorage.prototype.key = function (index) { try { return window$1.sessionStorage.key(index); } catch (e) { return null; } }; return ProtectedSessionStorage; }()); var sessionStorage = new ProtectedSessionStorage(); function installProtecedStorage() { msDocs.functions.localStorage = localStorage$1; } function themeSwitcher() { var selectorId = 'theme-selector'; var storageName = 'theme'; var classNamespace = 'theme'; var placeholderClass = 'removedOnload'; var updateThemeClass = function (currentValue) { var wasDark = document$1.documentElement.classList.contains('theme_night'); var currentTheme = currentValue || localStorage$1.getItem(storageName); if (currentTheme && currentTheme.length) { currentTheme = currentTheme.replace(classNamespace, ''); $$1('html').addState(classNamespace, currentTheme); if (currentTheme === '_night') { currentTheme = 'dark'; } msDocs.data.currentTheme = currentTheme; } else { $$1('html').removeState(classNamespace); msDocs.data.currentTheme = 'light'; } var isDark = document$1.documentElement.classList.contains('theme_night'); if (isDark !== wasDark) { document$1.documentElement.dispatchEvent(new CustomEvent('theme-changed', { bubbles: true, detail: { isDark: isDark } })); } }; $$1.lald('#' + selectorId, 'change', function (e) { var currentValue = $$1(this).val(); if (currentValue && currentValue.length) { localStorage$1.setItem(storageName, currentValue); } else { localStorage$1.removeItem(storageName); } updateThemeClass(currentValue); }); updateThemeClass(); $$1(function () { var $selector = $$1('#' + selectorId); $selector.find('.' + placeholderClass).remove(); var currentTheme = localStorage$1.getItem(storageName); if (currentTheme && currentTheme.length) { $selector.val(currentTheme); } }); } function sharing() { var appendCampaignId = function (shareLink, campaignId) { if (shareLink.indexOf('?') === -1) { return shareLink + "?WT.mc_id=" + campaignId; } else { return shareLink + "&WT.mc_id=" + campaignId; } }; var buildTwitterShareUrl = function (shareLink, message) { shareLink = encodeURIComponent(appendCampaignId(shareLink, "docs-twitter")); return "https://twitter.com/intent/tweet?original_referer=" + shareLink + "&text=" + encodeURIComponent(message) + "&tw_p=tweetbutton&url=" + shareLink; }; var buildLinkedInShareUrl = function (shareLink) { shareLink = encodeURIComponent(appendCampaignId(shareLink, "docs-linkedin")); return "https://www.linkedin.com/cws/share?url=" + shareLink; }; var buildEmailShareUrl = function (shareLink) { var subject = encodeURIComponent(loc.sharedArticleSubject.replace('{0}', document$1.title)); var body = encodeURIComponent(document$1.title + "\n\n" + appendCampaignId(shareLink, "docs-email")); return "mailto:?subject=" + subject + "&body=" + body; }; var buildFacebookShareUrl = function (shareLink) { shareLink = encodeURIComponent(appendCampaignId(shareLink, "docs-facebook")); return "https://www.facebook.com/sharer/sharer.php?u=" + shareLink; }; var buildWeChatShareUrl = function (shareLink) { return appendCampaignId(shareLink, "docs-wechat"); }; var buildWeiboShareUrl = function (shareLink, message) { shareLink = encodeURIComponent(appendCampaignId(shareLink, "docs-weibo")); return "http://service.weibo.com/share/share.php?title=" + encodeURIComponent(message) + "&url=" + shareLink; }; var shareLink = location.origin + location.pathname + location.search; var facebookShareUrl = buildFacebookShareUrl(shareLink); var twitterShareUrl = buildTwitterShareUrl(shareLink, document$1.title); var linkedinShareUrl = buildLinkedInShareUrl(shareLink); var emailShareUrl = buildEmailShareUrl(shareLink); $$1(".share-facebook").attr("href", facebookShareUrl); $$1(".share-twitter").attr("href", twitterShareUrl); $$1(".share-linkedin").attr("href", linkedinShareUrl); $$1(".share-email").attr("href", emailShareUrl); var weiboShareUrl = buildWeiboShareUrl(shareLink, document$1.title); $$1(".share-weibo").attr("href", weiboShareUrl); $$1('body').not('.share-container').click(function () { $$1('.share-container').hide(); }); $$1('.sharebutton').click(function () { var pos = $$1('.sharebutton').position(); if ($$1('.mainContainer').attr('dir') !== 'rtl') { $$1('.share-container').css('left', pos.left); } $$1('.share-container').css('top', pos.top + 36); $$1('.share-container').toggle(); return false; }); $$1('.share-container > li > a').click(function () { window$1.open(this.href, '', 'width=600,height=650'); return false; }); } function showDisclaimer(message) { var disclaimer = document$1.createElement('div'); disclaimer.classList.add('disclaimer'); disclaimer.appendChild(document$1.createElement('span')); disclaimer.firstElementChild.classList.add('disclaimertext'); disclaimer.firstElementChild.textContent = message; var main = document$1.querySelector('main'); main.insertBefore(disclaimer, main.firstElementChild); return disclaimer; } var cookieApi; (function (factory) { cookieApi = factory(); }(function () { var extend = function () { var i = 0; var result = {}; for (; i < arguments.length; i++) { var attributes = arguments[i]; for (var key in attributes) { result[key] = attributes[key]; } } return result; }; function init(converter) { var api = function (key, value, attributes) { var result; if (typeof document === 'undefined') { return; } if (arguments.length > 1) { attributes = extend({ path: '/' }, api.defaults, attributes); if (typeof attributes.expires === 'number') { var expires = new Date(); expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); attributes.expires = expires; } attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; try { result = JSON.stringify(value); if (/^[\{\[]/.test(result)) { value = result; } } catch (e) { } if (!converter.write) { value = encodeURIComponent(String(value)) .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); } else { value = converter.write(value, key); } key = encodeURIComponent(String(key)); key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); key = key.replace(/[\(\)]/g, escape); var stringifiedAttributes = ''; for (var attributeName in attributes) { if (!attributes[attributeName]) { continue; } stringifiedAttributes += '; ' + attributeName; if (attributes[attributeName] === true) { continue; } stringifiedAttributes += '=' + attributes[attributeName]; } return (document.cookie = key + '=' + value + stringifiedAttributes); } if (!key) { result = {}; } var cookies = document.cookie ? document.cookie.split('; ') : []; var rdecode = /(%[0-9A-Z]{2})+/g; var i = 0; for (; i < cookies.length; i++) { var parts = cookies[i].split('='); var cookie = parts.slice(1).join('='); if (cookie.charAt(0) === '"') { cookie = cookie.slice(1, -1); } try { var name = parts[0].replace(rdecode, decodeURIComponent); cookie = converter.read ? converter.read(cookie, name) : converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent); if (this.json) { try { cookie = JSON.parse(cookie); } catch (e) { } } if (key === name) { result = cookie; break; } if (!key) { result[name] = cookie; } } catch (e) { } } return result; }; api.set = api; api.get = function (key) { return api.call(api, key); }; api.getJSON = function () { return api.apply({ json: true }, [].slice.call(arguments)); }; api.defaults = {}; api.remove = function (key, attributes) { api(key, '', extend(attributes, { expires: -1 })); }; api.withConverter = init; return api; } return init(function () { }); })); var cookies = cookieApi; var localeNames = { "id-id": "Bahasa Indonesia", "ms-my": "Bahasa Malaysia", "ca-es": "Català", "cs-cz": "Čeština", "da-dk": "Dansk", "de-de": "Deutsch", "de-at": "Deutsch (Österreich)", "de-ch": "Deutsch (Schweiz)", "et-ee": "Eesti", "en-au": "English (Australia)", "en-ca": "English (Canada)", "en-in": "English (India)", "en-ie": "English (Ireland)", "en-my": "English (Malaysia)", "en-nz": "English (New Zealand)", "en-sg": "English (Singapore)", "en-za": "English (South Africa)", "en-gb": "English (United Kingdom)", "en-us": "English (United States)", "es-es": "Español (España)", "es-mx": "Español (México)", "eu-es": "Euskara", "fr-fr": "Français", "fr-be": "Français (Belgique)", "fr-ca": "Français (Canada)", "fr-ch": "Français (Suisse)", "gl-es": "Galego", "hr-hr": "Hrvatski", "is-is": "Íslenska", "it-it": "Italiano", "it-ch": "italiano (Svizzera)", "lv-lv": "Latviešu", "lt-lt": "Lietuvių", "hu-hu": "Magyar", "nl-nl": "Nederlands", "nl-be": "Nederlands (België)", "nb-no": "Norsk", "pl-pl": "Polski", "pt-br": "Português (Brasil)", "pt-pt": "Português (Portugal)", "ro-ro": "Română", "sk-sk": "Slovenčina", "sl-si": "Slovenski", "fi-fi": "Suomi", "sv-se": "Svenska", "vi-vn": "Tiếng Việt", "tr-tr": "Türkçe", "el-gr": "Ελληνικά", "bg-bg": "Български", "kk-kz": "Қазақ", "ru-ru": "Русский", "sr-cyrl-rs": "Српски (Србија и Црна Гора)", "sr-latn-rs": "Srpski (Srbija i Crna Gora)", "uk-ua": "Україньска", "he-il": "עברית‏", "ar-sa": "العربية", "hi-in": "हिंदी", "th-th": "ไทย", "ko-kr": "한국어", "zh-tw": "中文 (台灣)", "zh-cn": "中文 (中华人民共和国)", "zh-hk": "中文 (香港特別行政區)", "ja-jp": "日本語" }; var pathLocaleRegex = /^\/([a-z]{2}-(?:[a-z]{4}-)?[a-z]{2})(\/|$)/i; var localeCookieName = 'MarketplaceSelectedLocale'; function getLocaleFromPath(path) { var match = pathLocaleRegex.exec(path); return match === null ? 'en-us' : match[1]; } function removeLocaleFromPath(path) { return path.replace(pathLocaleRegex, '/'); } function replaceLocaleInPath(path, locale) { return path.replace(pathLocaleRegex, "/" + locale + "$2"); } function setDocumentLocale() { var userLocale = msDocs.data.userLocale; msDocs.data.userLocaleName = localeNames[userLocale]; var contentLocale = msDocs.data.contentLocale; var contentDir = msDocs.data.contentDir; var userDir = 'ltr'; if (msDocs.data.rtl[userLocale]) { userDir = 'rtl'; } $$1('html').attr('lang', userLocale).attr('dir', userDir); $$1(function () { $$1('html').attr('lang', contentLocale).attr('dir', contentDir); $$1('body').attr('lang', userLocale).attr('dir', userDir); if (userDir === 'rtl') { $$1('.az_h').attr({ 'lang': 'en-us', 'dir': 'ltr' }); } if (contentLocale !== userLocale && /^en/.test(contentLocale) && !/^en/.test(userLocale) && (msDocs.data.pageTemplate === 'ContentPage' || msDocs.data.pageTemplate === 'Conceptual')) { showDisclaimer(loc['disclaimer.text']); } setupLocaleLink(userLocale); }); } function setLocaleCookie(locale) { cookies.set(localeCookieName, locale, { expires: 365 * 10 }); } function setupLocaleLink(userLocale) { var localeSelector = document.getElementById('locale-selector-link'); if (!localeSelector) { return; } localeSelector.textContent = localeNames[userLocale]; var path = "/" + userLocale + "/locale"; localeSelector.href = path + "?target=" + encodeURIComponent(location.pathname + location.search + location.hash); } var metaDictionary; function readMetaTags() { metaDictionary = {}; var metaTags = document$1.head.querySelectorAll('meta'); for (var i = 0; i < metaTags.length; i++) { var meta = metaTags.item(i); if (metaDictionary[meta.name]) { metaDictionary[meta.name].push(meta.content); } else { metaDictionary[meta.name] = [meta.content]; } } } function getMeta(name) { if (metaDictionary === undefined) { readMetaTags(); } return metaDictionary[name] === undefined ? undefined : metaDictionary[name][0]; } function getMetas(name) { if (metaDictionary === undefined) { readMetaTags(); } return metaDictionary[name] ? metaDictionary[name] : []; } function installGetMeta() { msDocs.functions.getMeta = getMeta; msDocs.functions.getMetas = getMetas; } function getParam(name, type) { var frag = type === 'hash' ? window$1.location.hash : window$1.location.search; if (frag.length > 1) { frag = frag.substring(1); var cmpstring = name + "="; var cmplen = cmpstring.length; var temp = frag.split("&"); for (var i = 0; i < temp.length; i++) { if (temp[i].substr(0, cmplen) == cmpstring) { return temp[i].substr(cmplen); } } } return undefined; } function installGetParam() { msDocs.functions.getParam = getParam; } function parseQueryString(queryString) { var match; var pl = /\+/g; var search = /([^&=]+)=?([^&]*)/g; var decode = function (s) { return decodeURIComponent(s.replace(pl, ' ')); }; if (queryString === undefined) { queryString = location$1.search; } queryString = queryString.substring(1); var urlParams = {}; while (match = search.exec(queryString)) { urlParams[decode(match[1])] = decode(match[2]); } return urlParams; } function toQueryString(args) { var parts = []; for (var name_1 in args) { if (args.hasOwnProperty(name_1) && args[name_1] !== '' && args[name_1] !== null && args[name_1] !== undefined) { parts.push(encodeURIComponent(name_1) + '=' + encodeURIComponent(args[name_1])); } } return parts.join('&'); } function updateQueryString(args, usePushState) { var current = parseQueryString(); var changed = false; for (var name_2 in args) { if (args.hasOwnProperty(name_2) && current[name_2] !== args[name_2]) { current[name_2] = args[name_2]; changed = true; } } if (!changed) { return; } var queryString = toQueryString(current); if (queryString.length > 0) { queryString = '?' + queryString; } var url = location$1.protocol + "//" + location$1.host + location$1.pathname + queryString + location$1.hash; if (usePushState) { history.pushState(current, document$1.title, url); } else { location$1.href = url; } } function load() { var cookieCompliance = getMeta('cookieCompliance') === 'true'; var isAzure = msDocs.data.brand === 'azure'; var method = isAzure ? 'GetConsentBanner' : 'GetUHF'; var args = isAzure ? { locale: msDocs.data.userLocale } : { locale: msDocs.data.userLocale, headerId: getMeta('uhfHeaderId') || 'MSDocsHeader-DocsL1', footerId: getMeta('uhfFooterId') || 'MSDocsFooter', partnerId: getMeta('uhfPartnerId'), cookieCompliance: cookieCompliance }; var url = "https://docs.microsoft.com/api/" + method + "?" + toQueryString(args); var uhf; return fetch(url).then(function (response) { return response.json(); }) .then(function (u) { normalizeUhf(u); uhf = u; var htmlPrerequisites = [contentLoaded]; var _loop_1 = function (url_1) { var link = document$1.createElement('link'); link.rel = 'stylesheet'; link.href = url_1; htmlPrerequisites.push(new Promise(function (resolve) { link.onload = resolve; })); document$1.head.appendChild(link); }; for (var _i = 0, _a = uhf.cssIncludes; _i < _a.length; _i++) { var url_1 = _a[_i]; _loop_1(url_1); } return Promise.all(htmlPrerequisites); }) .then(function () { var placeholderId = isAzure ? 'lca-cookie-notification' : 'headerAreaHolder'; var placeholder = document$1.getElementById(placeholderId); placeholder.innerHTML = uhf.headerHTML; placeholder.hidden = false; placeholder.classList.remove('container'); placeholder.classList.remove('shell-notification-holder'); var scriptPromises = []; var _loop_2 = function (url_2) { var script = document$1.createElement('script'); script.src = url_2; script.defer = true; scriptPromises.push(new Promise(function (resolve) { script.onload = resolve; })); document$1.head.appendChild(script); }; for (var _i = 0, _a = uhf.javascriptIncludes; _i < _a.length; _i++) { var url_2 = _a[_i]; _loop_2(url_2); } return Promise.all(scriptPromises); }); } function normalizeUhf(uhf) { if (Array.isArray(uhf.javascriptIncludes)) { return; } var html = uhf.javascriptIncludes; uhf.javascriptIncludes = []; var regex = /src="([^"]+)"/g; var match; do { match = regex.exec(html); if (match !== null) { uhf.javascriptIncludes.push(match[1]); } } while (match); } function disableSearchSuggestions() { var shellOptions = { as: { callback: function () { } } }; if (window$1.msCommonShell) { window$1.msCommonShell.load(shellOptions); } else { window$1.onShellReadyToLoad = function () { delete window$1.onShellReadyToLoad; window$1.msCommonShell.load(shellOptions); }; } } var setHeaderLoaded; var headerLoaded = new Promise(function (resolve) { return setHeaderLoaded = resolve; }); function initUhf() { var cookieCompliance = getMeta('cookieCompliance') === 'true'; var brand = msDocs.data.brand; if (brand === 'mooncake' || brand === 'azure' && !cookieCompliance) { setHeaderLoaded(); return; } if (brand !== 'azure') { disableSearchSuggestions(); } load().then(function () { return setHeaderLoaded(); }); } function loadLibrary(url, globalName) { return new Promise(function (resolve, reject) { var script = document.createElement('script'); script.src = url; script.async = true; script.defer = true; script.onload = resolve; script.onerror = function () { reject("Failed to load " + url); }; (document.body || document.head).appendChild(script); }).then(function () { if (globalName === undefined) { return undefined; } if (window[globalName] === undefined) { throw new Error(url + " loaded successfully but " + globalName + " is undefined."); } return window[globalName]; }); } var consentGranted; var cookieConsent = new Promise(function (resolve) { return consentGranted = resolve; }); function initCookieConsent() { if (getMeta('cookieCompliance') !== 'true' || msDocs.data.brand === 'mooncake') { consentGranted(); return; } headerLoaded.then(function () { var mscc = window$1.mscc; if (mscc.hasConsent()) { consentGranted(); return; } mscc.on('consent', consentGranted); }); } var contentTags = { id: 'id', name: 'name', type: 'type', scenario: 'scn', scenarioStep: 'scnstp', scenarioStepNumber: 'subnm' }; var contentAttrs = { id: 'data-bi-id', name: 'data-bi-name', type: 'data-bi-type', scenario: 'data-bi-scn', scenarioStep: 'data-bi-scnstp', scenarioStepNumber: 'data-bi-subnm' }; var jsllUrl = 'https://az725175.vo.msecnd.net/scripts/jsll-4.2.1.js'; var tagMapping = { 'audience': 'aud', 'author': 'author', 'manager': 'manager', 'ms.assetid': 'asst', 'ms.author': 'pgauth', 'ms.contentsource': 'pgpubl', 'ms.custom': 'custom', 'ms.date': 'date', 'depot_name': 'depotname', 'ms.devlang': 'pgdevlng', 'gitcommit': 'gitcommit', 'original_content_git_url': 'giturl', 'updated_at': 'publishtime', 'ms.prod': 'product', 'ms.reviewer': 'reviewer', 'ms.service': 'pgsrvcs', 'ms.suite': 'suite', 'ms.technology': 'technology', 'ms.tgt_pltfrm': 'pgtrgtplf', 'ms.topic': 'pgtop', 'ms.workload': 'workload', 'ms.search.region': 'searchregion', 'experimental': 'experimental', 'experiment_id': 'experiment_id', 'ms.assigned_experiments': 'assigned_experiments', 'translationtype': 'translationtype' }; var notifyJsllReady; function track() { return cookieConsent.then(function () { return loadLibrary(jsllUrl, 'awa'); }) .then(function (awa) { configureJsll(awa); trackUnhandledExceptionsUsingWedcs(awa); trackSelectElementChange(awa); trackPageFocus(awa); trackPageVisibility(awa); trackPrint(awa); trackSecondaryContentScroll(awa); trackUnload(awa); trackUHFSearch(awa); trackCtrlF(awa); notifyJsllReady(awa); }); } function configureJsll(awa) { var jsllConfig = { syncMuid: true, isLoggedIn: false, shareAuthStatus: true, authMethod: 1, autoCapture: { pageView: true, onLoad: true, click: true, scroll: true, resize: true, jsError: true, addin: true, msTags: false, perf: true, assets: false, lineage: true }, coreData: { appId: { 'docs.microsoft.com': 'Docs', 'review.docs.microsoft.com': 'DocsReview', 'docs.azure.cn': 'DocsCN' }[location.hostname] || 'JsllTest', pageName: getMeta('document_id') || 'missing document_id', market: msDocs.data.userLocale, pageType: getMeta('pagetype'), pageTags: {} } }; var metas = document$1.querySelectorAll('meta'); for (var i = 0; i < metas.length; i++) { var meta = metas.item(i); var awaTag = tagMapping[meta.name]; if (awaTag) { jsllConfig.coreData.pageTags[awaTag] = meta.content; } } jsllConfig.coreData.pageTags.contentlocale = msDocs.data.contentLocale; jsllConfig.coreData.pageTags.theme = msDocs.data.currentTheme; awa.consoleVerbosity = awa.verbosityLevels.WARNING; awa.init(jsllConfig); } var jsllReady = new Promise(function (resolve) { return notifyJsllReady = resolve; }); function wedcs() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (typeof window$1.MscomCustomEvent === 'function') { window$1.MscomCustomEvent.apply(window$1, args); } } function getName(element) { while (element && element.hasAttribute && !element.hasAttribute(contentAttrs.name)) { element = element.parentElement; } if (!element) { return ''; } return element.getAttribute(contentAttrs.name); } function trackSelectElementChange(awa) { function handleChange(event) { if (!event.isTrusted || !(event.target instanceof HTMLSelectElement) || !event.target.hasAttribute(contentAttrs.name)) { return; } awa.ct.capturePageAction(event.target, { actionType: awa.actionType.OTHER, behavior: awa.behavior.OTHER, content: { event: 'select-value-changed', name: getName(event.target), value: event.target.value } }); wedcs('ms.switcheventtime', new Date().getTime().toString(), 'ms.switcher', event.target.getAttribute(contentAttrs.name).replace(/^select-/, ''), 'ms.switchervalue', event.target.value); } document$1.addEventListener('change', handleChange, { passive: true }); } function trackPageFocus(awa) { var previousType = ''; function reportFocusChanged(event) { if (!event.isTrusted || previousType === event.type) { return; } previousType = event.type; awa.ct.captureContentPageAction({ actionType: awa.actionType.OTHER, behavior: awa.behavior.OTHER, content: { event: 'page-focus-changed', value: event.type } }); wedcs('ms.focuseventtime', new Date().getTime().toString(), 'ms.focusorblue', event.type === 'focus' ? 'Focused' : 'Blured'); } var timeout = 0; function handleFocusedChanged(event) { clearTimeout(timeout); timeout = setTimeout(function () { return reportFocusChanged(event); }, 50); } window$1.addEventListener('focus', handleFocusedChanged, { passive: true }); window$1.addEventListener('blur', handleFocusedChanged, { passive: true }); } function trackPageVisibility(awa) { function visibilityChanged(event) { awa.ct.captureContentPageAction({ actionType: awa.actionType.OTHER, behavior: awa.behavior.OTHER, content: { event: 'page-visibility-changed', value: document$1.hidden ? 'hidden' : 'visible' } }); wedcs('ms.page-visibility-changed', document$1.hidden ? 'hidden' : 'visible'); } function attach() { document$1.addEventListener('visibilitychange', visibilityChanged, { passive: true }); } document$1.readyState === 'interactive' || document$1.readyState === 'complete' ? attach() : document$1.addEventListener('DOMContentLoaded', attach); } function trackPrint(awa) { if (!window$1.matchMedia) { return; } window$1.matchMedia('print').addListener(function (m) { if (!m.matches) { return; } awa.ct.captureContentPageAction({ actionType: awa.actionType.OTHER, behavior: awa.behavior.PRINT, content: { event: 'print' } }); wedcs('ms.print', 'print'); }); } function trackSecondaryContentScroll(awa) { function reportScroll(event) { if (!event.isTrusted || !(event.target instanceof HTMLElement)) { return; } var _a = event.target.getBoundingClientRect(), width = _a.width, height = _a.height; var _b = event.target, scrollLeft = _b.scrollLeft, scrollTop = _b.scrollTop, scrollWidth = _b.scrollWidth, scrollHeight = _b.scrollHeight; awa.ct.capturePageAction(event.target, { actionType: awa.actionType.OTHER, behavior: awa.behavior.OTHER, content: { event: 'secondary-content-scroll', name: getName(event.target), viewPortWidth: Math.floor(width), viewPortHeight: Math.floor(height), contentWidth: Math.floor(scrollWidth), contentHeight: Math.floor(scrollHeight), horizontalOffset: Math.floor(scrollLeft), verticalOffset: Math.floor(scrollTop) } }); } function handleScroll(event) { if (event.target === document$1) { return; } var target = event.target; clearTimeout(target.reportScrollTimeout); target.reportScrollTimeout = setTimeout(function () { return reportScroll(event); }, 100); } window$1.addEventListener('scroll', handleScroll, { passive: true, capture: true }); } function trackUnload(awa) { var anchor = false; function handleUnload(event) { awa.ct.captureContentPageAction({ actionType: awa.actionType.OTHER, behavior: awa.behavior.OTHER, content: { event: 'unload', anchor: anchor } }); wedcs('ms.pageclosuretime', new Date().getTime().toString(), 'ms.pageclosure', anchor ? 'redirection' : 'closure'); } function handleClick(event) { if (event.target instanceof HTMLAnchorElement) { anchor = true; setTimeout(function () { return anchor = false; }); } } function handleKeyDown(event) { if (event.target instanceof HTMLAnchorElement) { anchor = true; setTimeout(function () { return anchor = false; }); } } window$1.addEventListener('keydown', handleKeyDown, { capture: true, passive: true }); window$1.addEventListener('click', handleClick, { capture: true, passive: true }); window$1.addEventListener('beforeunload', handleUnload, { passive: true }); } function trackUHFSearch(awa) { function handleSubmit(event) { var form = event.target; if (form.id !== 'searchForm') { return; } var term = form.querySelector('input[name="search"]').value; var submitButtonIsFocused = form.querySelector('#search:focus') !== null; awa.ct.capturePageAction(form, { actionType: awa.actionType.OTHER, behavior: awa.behavior.SEARCH, content: { event: 'uhf-search', value: term, submitButton: submitButtonIsFocused } }); wedcs('ms.search.term', term, 'ms.search.formSubmitType', submitButtonIsFocused ? '1' : '0'); } window$1.addEventListener('submit', handleSubmit, { passive: true, capture: true }); } function trackUnhandledExceptionsUsingWedcs(awa) { function handleError(event) { var args = []; if (event.filename === undefined || event.message === undefined) { return; } if (event.error !== null && event.error !== undefined) { args.push('ms.error', event.error.toString().substring(0, 100)); } args.push("ms.errormsg", event.message.substring(0, 30)); args.push("ms.errorsrc", event.filename); args.push("ms.errorlineno", event.lineno.toString(10)); args.push("ms.errorcolno", event.colno.toString(10)); wedcs.apply(void 0, args); } window$1.addEventListener('error', handleError, { passive: true }); } function trackCtrlF(awa) { function handleKeyDown(event) { if (event.isTrusted && event.keyCode === 70 && event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { awa.ct.captureContentPageAction({ actionType: awa.actionType.OTHER, behavior: awa.behavior.OTHER, content: { event: 'ctrl-f' } }); wedcs('ms.ctrl-f', 'ctrl+f'); } } window$1.addEventListener('keydown', handleKeyDown, { passive: true }); } function addScopeButton() { var form = document$1.getElementById('searchForm'); form.action = "https://docs.microsoft.com/" + msDocs.data.userLocale + "/search/index"; form.querySelector('button#search').removeAttribute('name'); var searchInput = form.querySelector('input[name="search"]'); var rawScope = getMeta('scope'); var isSearchPage = getMeta('ms.pagetype') === 'search'; if (isSearchPage) { var queryString = parseQueryString(); rawScope = queryString.scope; var searchValue = queryString.search; if (searchValue !== undefined && searchValue.length > 0) { searchInput.value = searchValue; } } var hideScope = getMeta('hideScope'); if (hideScope === 'true' || rawScope === undefined || rawScope.length === 0) { return; } var scopes = rawScope.split(',').map(function (s) { return s.trim(); }).filter(function (s) { return s.length; }); if (scopes.length === 0) { return; } var scope = scopes[scopes.length - 1]; var scopeInput = document$1.createElement('input'); scopeInput.name = 'scope'; scopeInput.value = scope; scopeInput.hidden = true; var scopeAnchor = document$1.createElement('a'); scopeAnchor.classList.add('searchScope'); scopeAnchor.href = '#'; scopeAnchor.setAttribute('role', 'button'); scopeAnchor.textContent = scope; scopeAnchor.title = loc.searchScopeTitle.replace('{0}', scope); scopeAnchor.onclick = function (event) { event.stopPropagation(); event.preventDefault(); scopeAnchor.parentElement.removeChild(scopeAnchor); scopeInput.parentElement.removeChild(scopeInput); searchInput.style.transition = 'padding-left ease .5s'; searchInput.style.paddingLeft = ''; jsllReady.then(function (awa) { return awa.ct.capturePageAction(event.target, { actionType: awa.actionType.CLICKLEFT, behavior: awa.behavior.OTHER, content: { event: 'uhf-search-scope-removed', name: 'uhf-search-scope-link', value: scope } }); }); wedcs('ms.uhf-search-scope-removed', scope); }; form.appendChild(scopeAnchor); form.appendChild(scopeInput); searchInput.style.paddingLeft = Math.floor(scopeAnchor.getBoundingClientRect().width + 12).toString() + 'px'; } if (msDocs.data.brand !== 'mooncake' && msDocs.data.brand !== 'azure') { headerLoaded.then(addScopeButton); } var monikerChangedEvent = 'moniker-changed'; var readMonikerFromQuery = function () { var view = parseQueryString().view; return view === undefined ? '' : view; }; var moniker = readMonikerFromQuery(); function getMoniker() { return moniker; } function setMoniker(newMoniker) { if (newMoniker === moniker) { return; } moniker = newMoniker; window$1.dispatchEvent(new CustomEvent(monikerChangedEvent, { detail: { moniker: moniker } })); } window$1.addEventListener('popstate', function () { return setMoniker(readMonikerFromQuery()); }); var breakTextRegexDots = /([A-Z]\.|[a-z]\.)([A-Z]|[a-z])/g; var breakTextRegexCase = /([a-z])([A-Z]+[a-z])/g; var breakTextReplace = '$1$2'; var unbreakTextRegex = /\u200B/g; function breakText(str, dotsOnly) { if (dotsOnly === void 0) { dotsOnly = false; } if (!str || str.length === 0) { return str; } str = str.replace(breakTextRegexDots, breakTextReplace); if (dotsOnly) { return str; } return str.replace(breakTextRegexCase, breakTextReplace); } function unbreakText(str) { return str.replace(unbreakTextRegex, ''); } function supportsWbrElement() { var testDiv = document.createElement('div'); testDiv.style.cssText = "position:fixed;width:1px;line-height:16px;word-wrap:normal;word-break:normal;white-space:normal;border: 1px solid red;top:-1000px"; testDiv.innerHTML = "xx"; document.body.appendChild(testDiv); var supportsWbr = testDiv.clientHeight > 16; document.body.removeChild(testDiv); return supportsWbr; } function polyfillWbrElement() { var style = document.createElement('style'); style.textContent = "wbr::after { content: \"\u200B\"}"; document.head.appendChild(style); } function ensureWbr() { if (!supportsWbrElement()) { polyfillWbrElement(); } } function cleanText(value) { if (value && value.length) { return value .replace(/&/g, '&') .replace(/"/g, '"') .replace(/'/g, ''') .replace(//g, '>') .replace(/&lrm;/g, '‎'); } return value; } var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; var reUnescapedHtml = /[&<>"']/g; var reHasUnescapedHtml = RegExp(reUnescapedHtml.source); function escape$1(string) { return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, function (chr) { return htmlEscapes[chr]; }) : string; } function getPdfUrl(pdfName) { var urlTemplate = getMeta('pdf_url_template'); if (urlTemplate !== undefined) { var branchName = cookies.get('CONTENT_BRANCH'); if (branchName === undefined) { branchName = 'live'; } var url = urlTemplate.replace(/\{branchName\}/, branchName); url = url.replace(/\{pdfName\}/, pdfName); return url; } return null; } function renderPdfLink(pdfName) { var url = getPdfUrl(pdfName); if (url === null) { return; } var holder = document$1.querySelector('.pdfDownloadHolder'); if (!holder) { return; } var a = document$1.createElement('a'); a.href = url; a.textContent = loc.downloadPdf; a.setAttribute('ms.cmpnm', 'downloadPdf'); a.setAttribute(contentAttrs.name, 'downloadPdf'); holder.style.display = 'block'; holder.appendChild(a); } var apiBase = 'https://docs.microsoft.com/api/'; function fetchPlatform(platformId) { return fetchWithTimeout(apiBase + "monikers/platforms/" + encodeURIComponent(platformId)) .then(function (response) { return response.json(); }); } function search(platform, moniker, term) { var url = apiBase + "apibrowser/" + platform + "/search?api-version=0.2&search=" + encodeURIComponent(term); if (moniker !== '') { url += "&$filter=monikers/any(t: t eq '" + encodeURIComponent(moniker) + "')"; } return fetchWithTimeout(url).then(function (response) { return response.json(); }); } function fetchNamespaces(platform, moniker) { var namespacesPath = platform === 'dotnet' ? 'namespaces' : 'modules'; return fetchWithTimeout(apiBase + "apibrowser/" + encodeURIComponent(platform) + "/" + namespacesPath + "?moniker=" + encodeURIComponent(moniker) + "&api-version=0.2") .then(function (response) { return response.json(); }); } function fetchFamilyByMoniker(moniker) { return fetchWithTimeout(apiBase + "monikers/families/getfamilybymoniker?moniker=" + encodeURIComponent(moniker) + "&api-version=0.2") .then(function (response) { if (response.ok) { return response.json(); } return Promise.reject(null); }) .then(function (_a) { var family = _a.family; if (family && family.products) { return family; } return createFamilyFromMoniker(moniker); }) .catch(function () { return createFamilyFromMoniker(moniker); }); } function createFamilyFromMoniker(moniker) { return { displayName: moniker, platform: moniker, products: [ { displayName: moniker, packages: [ { displayName: moniker, isDefault: true, moniker: moniker, versionDisplayName: moniker } ] } ] }; } var platformId = getMeta('platform') || getMeta('apiPlatform') || null; var platformPromise = undefined; function getPlatform() { if (platformPromise === undefined) { platformPromise = fetchPlatform(platformId).then(flattenPlatform); } return platformPromise; } function flattenPlatform(platform) { var platformId = platform.platformId, displayName = platform.displayName, families = platform.families; var packages = []; var packagesByMoniker = {}; var products = []; for (var i = 0; i < families.length; i++) { var family = families[i]; for (var j = 0; j < family.products.length; j++) { var product = family.products[j]; products.push(product); for (var k = 0; k < product.packages.length; k++) { var _a = product.packages[k], moniker = _a.moniker, displayName_1 = _a.displayName, versionDisplayName = _a.versionDisplayName, isDefault = _a.isDefault; var pkg = { platform: platform, family: family, product: product, moniker: moniker, displayName: displayName_1, versionDisplayName: versionDisplayName, isDefault: isDefault }; packages.push(pkg); packagesByMoniker[pkg.moniker] = pkg; } } } return { platformId: platformId, displayName: displayName, families: families, products: products, packages: packages, packagesByMoniker: packagesByMoniker }; } var pageMonikers = { any: false }; function readPageMonikers() { var tags = getMetas('monikers'); pageMonikers.any = tags.length > 0; for (var i = 0; i < tags.length; i++) { pageMonikers[tags[i]] = true; } } readPageMonikers(); function pageSupportsMoniker(moniker) { return moniker !== '' && pageMonikers[moniker] !== undefined; } var familyPromise = undefined; function getFamily() { if (familyPromise === undefined) { var moniker = getMoniker(); familyPromise = fetchFamilyByMoniker(moniker); } return familyPromise; } function findPackageInFamily(family, moniker) { for (var _i = 0, _a = family.products; _i < _a.length; _i++) { var product = _a[_i]; for (var _b = 0, _c = product.packages; _b < _c.length; _b++) { var pkg = _c[_b]; if (pkg.moniker === moniker) { return pkg; } } } return null; } var platformConfig = { dotnet: { validSearchTerm: /^[A-Za-z][A-Za-z0-9.<>,]{2,255}$/, namespaceIcon: 'Namespace', allApisLabel: loc.allapis, resultsHeadingTemplate: loc.apiReference, quickFilters: [ ['netframework-4.7', 'netcore-2.0', 'netstandard-2.0'], ['xamarinios-10.8', 'xamarinandroid-7.1', 'xamarinmac-3.0'], ['azuremgmtresourcemanager-1.5.0-preview', 'appinsights-2.3.0-beta3', 'aspnetcore-2.0'] ] }, powershell: { validSearchTerm: /^[A-Za-z][A-Za-z0-9.-]{2,255}$/, namespaceIcon: 'Module', allApisLabel: loc.allPackages, resultsHeadingTemplate: loc.moduleReference, quickFilters: [ ['powershell-5.1'], ['azurermps-4.3.1'], ['sqlserver-ps'] ] } }; var keyCodes = { left: 37, up: 38, right: 39, down: 40, home: 36, end: 35, escape: 27 }; var isMobileDimensions = false; var singleProduct = false; function createMonikerPicker(allApis) { var _a = initialRender(), element = _a.element, button = _a.button, buttonCaption = _a.buttonCaption, productList = _a.productList; var checkEventTarget = function (event) { if (event.target instanceof Element && !element.contains(event.target)) { collapse(); } }; var expand = function () { document$1.body.removeAttribute('style'); document$1.documentElement.classList.add('moniker-picker-expanded'); element.classList.add('expanded'); button.setAttribute('aria-expanded', 'true'); window$1.addEventListener('focus', checkEventTarget, { capture: true }); window$1.addEventListener('click', checkEventTarget); window$1.addEventListener('resize', collapse); }; var collapse = function () { document$1.documentElement.classList.remove('moniker-picker-expanded'); element.classList.remove('expanded'); button.setAttribute('aria-expanded', 'false'); window$1.removeEventListener('focus', checkEventTarget, { capture: true }); window$1.removeEventListener('click', checkEventTarget); window$1.removeEventListener('resize', collapse); }; var collapseAndFocusButton = function () { collapse(); button.focus(); }; finishRenderingAsync(allApis, button, buttonCaption, productList); handleMainMenuButtonInteraction(button, productList, expand, collapseAndFocusButton); handleKeyboardInteractionInMenu(productList, collapseAndFocusButton); handleMenuItemClick(button, productList, collapseAndFocusButton); observeScreenDimensions(); return element; } function initialRender() { var element = document$1.createElement('div'); element.classList.add('moniker-picker'); var buttonId = generateElementId(); var menuId = generateElementId(); element.innerHTML = "\n\t\t\n\t\t\n\t\t\t" + escape$1(loc.product) + "\n\t\t\t\n\t\t"; return { element: element, button: element.firstElementChild, buttonCaption: element.firstElementChild.lastElementChild, productList: element.lastElementChild.lastElementChild }; } function finishRenderingAsync(allApis, button, buttonCaption, productList) { if (allApis) { return getPlatform().then(function (platform) { if (platform.packagesByMoniker[getMoniker()] === undefined) { setMoniker(''); } var updateCaption = function () { var moniker = getMoniker(); if (moniker === '') { buttonCaption.textContent = platformConfig[platformId].allApisLabel; } else { buttonCaption.innerHTML = breakText(platform.packagesByMoniker[moniker].displayName); } }; window$1.addEventListener(monikerChangedEvent, updateCaption); updateCaption(); renderAllApis(productList); for (var _i = 0, _a = platform.families; _i < _a.length; _i++) { var family = _a[_i]; renderProducts(family.products, productList); } }); } return getFamily().then(function (family) { singleProduct = family.products.length === 1; if (singleProduct && family.products[0].packages.length === 1) { button.disabled = true; } var updateCaption = function () { var moniker = getMoniker(); buttonCaption.innerHTML = breakText(findPackageInFamily(family, moniker).displayName); }; window$1.addEventListener(monikerChangedEvent, updateCaption); updateCaption(); renderProducts(family.products, productList); }); } function renderAllApis(productList) { var displayName = platformConfig[platformId].allApisLabel; productList.insertAdjacentHTML('afterbegin', "
  • " + displayName + "
  • "); } function renderProducts(products, productList) { if (singleProduct) { productList.previousElementSibling.textContent = loc.version; renderPackages(products[0].packages, productList); return; } for (var _i = 0, products_1 = products; _i < products_1.length; _i++) { var _a = products_1[_i], displayName = _a.displayName, packages = _a.packages; var buttonId = generateElementId(); var menuId = generateElementId(); var dotsOnly = true; productList.insertAdjacentHTML('beforeend', "
  • \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t" + escape$1(loc.version) + "\n\t\t\t\t\t
      \n\t\t\t\t\n\t\t\t
    • "); var versionsMenu = productList.lastElementChild.lastElementChild; var packageList = versionsMenu.lastElementChild; renderPackages(packages, packageList); if (packages.find(function (pkg) { return /^azurermps/.test(pkg.moniker); })) { versionsMenu.insertAdjacentHTML('beforeend', "

      " + escape$1(loc.helpMeChoose) + "

      "); } } } function renderPackages(packages, packageList) { for (var _i = 0, packages_1 = packages; _i < packages_1.length; _i++) { var _a = packages_1[_i], moniker = _a.moniker, isDefault = _a.isDefault, versionDisplayName = _a.versionDisplayName, displayName = _a.displayName; packageList.insertAdjacentHTML('beforeend', "
    • " + escape$1(versionDisplayName) + "
    • "); } } function expandProduct(productList, productButton) { var current = productList.querySelector('button[aria-expanded="true"]'); if (current === productButton) { return; } if (current !== null) { current.setAttribute('aria-expanded', 'false'); } if (productButton !== null) { productButton.setAttribute('aria-expanded', 'true'); } } var nextId = 0; function generateElementId() { return "ax-" + nextId++; } function findAnchorByMoniker(container, moniker) { return container.querySelector("a[href=\"?view=" + moniker + "\"]"); } function findAnchorToSelect(productButton) { var versionsMenu = productButton.nextElementSibling; var current = findAnchorByMoniker(versionsMenu, getMoniker()); var productDefault = versionsMenu.querySelector('a[href^="?view="][data-default="true"]'); var first = versionsMenu.querySelector("a[href^=\"?view=\"]"); return current || productDefault || first; } function getProductButton(monikerAnchor) { if (monikerAnchor.search === '?view=' || singleProduct) { return null; } return monikerAnchor.parentElement.parentElement.parentElement.previousElementSibling; } function handleMainMenuButtonInteraction(button, productList, expand, collapse) { var expandAndSelectCurrent = function () { expand(); var moniker = getMoniker(); var anchor = findAnchorByMoniker(productList, moniker); var productButton = getProductButton(anchor); expandProduct(productList, productButton); setTimeout(function () { if (productButton !== null) { productButton.scrollIntoView(false); } anchor.scrollIntoView(false); anchor.focus(); }); }; button.addEventListener('click', function (event) { var expand = button.getAttribute('aria-expanded') === 'false'; if (expand) { expandAndSelectCurrent(); } else { collapse(); } }); button.addEventListener('keydown', function (event) { var expanded = button.getAttribute('aria-expanded') === 'true'; if (expanded && event.keyCode === keyCodes.up) { event.preventDefault(); collapse(); } else if (!expanded && event.keyCode === keyCodes.down) { event.preventDefault(); expandAndSelectCurrent(); } }); } function handleKeyboardInteractionInMenu(productList, collapse) { productList.addEventListener('keydown', function (event) { if (isMobileDimensions) { return; } var target = event.target; if (target.getAttribute('role') !== 'menuitem') { return; } var keyCode = event.keyCode; var el; switch (keyCode) { case keyCodes.left: if (target instanceof HTMLAnchorElement && target.search !== '?view=') { event.preventDefault(); getProductButton(target).focus(); } break; case keyCodes.right: if (target instanceof HTMLButtonElement && target.hasAttribute('aria-controls')) { event.preventDefault(); findAnchorToSelect(target).focus(); } break; case keyCodes.up: case keyCodes.down: event.preventDefault(); var nextFn = keyCode === keyCodes.up ? 'previousElementSibling' : 'nextElementSibling'; var firstFn = keyCode === keyCodes.up ? 'lastElementChild' : 'firstElementChild'; if (target.parentElement[nextFn] === null) { el = target.parentElement.parentElement[firstFn].firstElementChild; } else { el = target.parentElement[nextFn].firstElementChild; } el.focus(); if (el.parentElement.parentElement === productList) { expandProduct(productList, el instanceof HTMLButtonElement ? el : null); } break; case keyCodes.home: case keyCodes.end: event.preventDefault(); var fn = keyCode === keyCodes.home ? 'firstElementChild' : 'lastElementChild'; el = target.parentElement.parentElement[fn].firstElementChild; el.focus(); if (el.parentElement.parentElement === productList) { expandProduct(productList, el instanceof HTMLButtonElement ? el : null); } break; case keyCodes.escape: event.preventDefault(); collapse(); break; } }); } function handleMenuItemClick(button, productList, collapse) { productList.addEventListener('click', function (event) { var target = event.target; if (target.getAttribute('role') !== 'menuitem') { return; } if (target instanceof HTMLAnchorElement) { event.preventDefault(); var moniker = parseQueryString(target.search).view; setMoniker(moniker); collapse(); return; } if (target instanceof HTMLButtonElement) { if (isMobileDimensions && target.getAttribute('aria-expanded') === 'true') { target.setAttribute('aria-expanded', 'false'); } else { expandProduct(productList, target); } target.focus(); } }); } function observeScreenDimensions() { var mql = window$1.matchMedia('screen and (min-width: 768px), screen and (min-height: 1024px)'); isMobileDimensions = !mql.matches; mql.addListener(function () { return isMobileDimensions = !mql.matches; }); } function affix() { var main = document$1.querySelector('main'); var left = document$1.getElementById('sidebarContent'); var right = document$1.getElementById('page-actions-content'); var footer = document$1.querySelector('.footerContainer'); var isFixedHeight = document$1.documentElement.classList.contains('isFixedHeight'); if (isFixedHeight) { var header = document$1.querySelector('#headerAreaHolder'); var mainContainer = document$1.querySelector('.mainContainer'); var pageActions = document$1.querySelector('.pageActions'); var sidebar = document$1.querySelector('.sidebar'); } if (left === null && right === null && !isFixedHeight) { return; } function update() { var footerContainerMarginTop = 24; var viewportHeight = document$1.documentElement.offsetHeight; var top = Math.max(0, main.getBoundingClientRect().top); var bottom = Math.max(0, viewportHeight - footer.getBoundingClientRect().top) + footerContainerMarginTop; if (!isFixedHeight) { if (left !== null) { left.style.position = ''; left.style.top = top + "px"; left.style.bottom = bottom + "px"; } if (right !== null) { right.style.position = ''; right.style.top = top + "px"; right.style.bottom = bottom + "px"; right.style.overflowY = ''; } } else if (window$1.matchMedia("(min-width: 767px)").matches) { var breadcrumbs = document$1.querySelector('.breadcrumbs'); var hasTerminal = document$1.querySelector('html').classList.contains('hasTerminal'); var footerHeight = footer ? footer.getBoundingClientRect().height : 0; var headerHeight = header ? header.getBoundingClientRect().height : 0; var breadcrumbsHeight = breadcrumbs ? breadcrumbs.getBoundingClientRect().height : 0; var mainTopMargin = main ? parseInt(window$1.getComputedStyle(main).marginTop.replace(/[^-\d\.]/g, '')) : 0; var mainContainerHeight = Math.floor(viewportHeight - footerHeight - headerHeight); var columnHeightStr = '100%'; if (hasTerminal) { columnHeightStr = mainContainerHeight - breadcrumbsHeight - mainTopMargin + "px"; pageActions.style.height = null; } else if (window$1.matchMedia("(min-width: 1200px)").matches || hasTerminal) { columnHeightStr = mainContainerHeight - breadcrumbsHeight + "px"; pageActions.style.height = columnHeightStr; } else { columnHeightStr = mainContainerHeight - breadcrumbsHeight - (pageActions ? pageActions.getBoundingClientRect().height : 0) - mainTopMargin + "px"; pageActions.style.height = null; } mainContainer.style.height = mainContainerHeight + "px"; main.style.height = columnHeightStr; sidebar.style.height = columnHeightStr; } else { pageActions.style.height = null; mainContainer.style.height = null; main.style.height = null; sidebar.style.height = null; } } var animationFrame = 0; function scheduleUpdate() { cancelAnimationFrame(animationFrame); animationFrame = requestAnimationFrame(update); } window$1.addEventListener('scroll', scheduleUpdate, { passive: true }); window$1.addEventListener('resize', scheduleUpdate, { passive: true }); window$1.addEventListener('content-update', scheduleUpdate); update(); window$1.addEventListener('load', update, false); window$1.addEventListener('DOMContentLoaded', update, false); } function notifyContentUpdated() { window$1.dispatchEvent(new CustomEvent('content-update')); } function renderInTopicTOC() { var containers = Array.from(document$1.querySelectorAll('.doc-outline')); if (containers.length === 0) { return; } var headings = Array.from(document$1.querySelectorAll('#main h2')) .filter(function (h) { return h.offsetParent !== null; }); var minHeadings = msDocs.data.pageTemplate === 'NamespaceListPage' ? 2 : 1; var hide = headings.length < minHeadings; containers.forEach(function (container) { container.hidden = hide; if (container.lastElementChild.nodeName === 'OL') { container.removeChild(container.lastElementChild); } }); if (hide) { return; } var ol = document$1.createElement('ol'); for (var _i = 0, headings_1 = headings; _i < headings_1.length; _i++) { var heading = headings_1[_i]; var text = heading.innerText; if (heading.id.length === 0) { heading.id = text.replace(/\s+/g, '_'); } var a = document$1.createElement('a'); a.href = '#' + heading.id; a.textContent = text; var li = document$1.createElement('li'); li.appendChild(a); ol.appendChild(li); } containers.forEach(function (container, index) { return container.appendChild(index === 0 ? ol : ol.cloneNode(true)); }); } function filterContentByMoniker() { var moniker = getMoniker(); if (!pageSupportsMoniker(moniker)) { return false; } processDataMoniker(moniker); processLinks(moniker); renderInTopicTOC(); notifyContentUpdated(); return true; } var monikerStyle = document.createElement('style'); document.head.appendChild(monikerStyle); function processDataMoniker(moniker) { monikerStyle.textContent = "\n\t\t[data-moniker]:not([data-moniker~='" + moniker + "']) {\n\t\t\tdisplay: none !important;\n\t\t}\n\t"; var addId = document.querySelectorAll("[data-moniker~='" + moniker + "'] [data-id]"); for (var i = 0; i < addId.length; i++) { var element = addId.item(i); element.id = element.getAttribute('data-id'); } var removeId = document.querySelectorAll("[data-moniker]:not([data-moniker~='" + moniker + "']) [id]"); for (var i = 0; i < removeId.length; i++) { var element = removeId.item(i); element.setAttribute('data-id', element.id); element.removeAttribute('id'); } } function processLinks(moniker) { var links = document.querySelectorAll('a[href*="view="]:not([role="menuitem"])'); var i = links.length; while (i--) { var a = links.item(i); if (a.search === '') { continue; } var query = parseQueryString(a.search); if (query.view === undefined) { continue; } query.view = moniker; a.search = toQueryString(query); } } var fallbackDisclaimer; function displayMonikerFallbackMessage() { removeMonikerFallbackMessage(); var fallbackFromMoniker = parseQueryString().viewFallbackFrom; if (fallbackFromMoniker === undefined) { return Promise.resolve(); } return getFamily().then(function (family) { var pkg = findPackageInFamily(family, fallbackFromMoniker); return pkg ? pkg.displayName : fallbackFromMoniker; }, function () { return fallbackFromMoniker; }).then(function (displayName) { fallbackDisclaimer = showDisclaimer(loc.monikerFallback.replace('{0}', displayName)); }); } function removeMonikerFallbackMessage() { if (fallbackDisclaimer) { fallbackDisclaimer.parentElement.removeChild(fallbackDisclaimer); fallbackDisclaimer = null; } } function canHandleClientSide(moniker) { return pageMonikers[moniker] !== undefined || msDocs.data.pageTemplate === 'ApiBrowserPage'; } function monikerChangedHandler() { var moniker = getMoniker(); var isClientSide = canHandleClientSide(moniker); updateQueryString({ view: moniker, viewFallbackFrom: null }, isClientSide); if (isClientSide) { removeMonikerFallbackMessage(); filterContentByMoniker(); } } function handleMonikerChange() { window$1.addEventListener(monikerChangedEvent, monikerChangedHandler); } var apiSearchTermChangedEvent = 'api-search-term-changed'; var term = ''; function getTerm() { return term; } function setTerm(newTerm) { if (newTerm === term) { return; } term = newTerm; if (msDocs.data.pageTemplate === 'ApiBrowserPage') { var usePushState = true; updateQueryString({ term: term }, usePushState); } window.dispatchEvent(new CustomEvent(apiSearchTermChangedEvent, { detail: { term: term } })); } function readTermFromQueryString() { var term = parseQueryString().term; return term === undefined ? '' : term.trim(); } if (msDocs.data.pageTemplate === 'ApiBrowserPage') { term = readTermFromQueryString(); window.addEventListener('popstate', function () { return setTerm(readTermFromQueryString()); }); } var blockName = 'api-search-field'; function createSearchField() { var form = document$1.createElement('form'); form.classList.add(blockName); form.setAttribute('ms.cmpnm', blockName); form.setAttribute(contentAttrs.name, blockName); form.action = 'javascript:'; form.addEventListener('submit', function (event) { return event.preventDefault(); }); var label = document$1.createElement('label'); var labelSpan = document$1.createElement('span'); labelSpan.classList.add('visually-hidden'); labelSpan.textContent = loc.search; label.appendChild(labelSpan); form.appendChild(label); var input = document$1.createElement('input'); input.type = 'search'; input.value = getTerm(); input.placeholder = loc.search; label.appendChild(input); var clearAnchor = document$1.createElement('a'); clearAnchor.href = '#'; clearAnchor.title = loc.clearterm; clearAnchor.classList.add('clear'); clearAnchor.addEventListener('click', function (event) { event.preventDefault(); input.value = ''; input.dispatchEvent(new CustomEvent('change', { bubbles: true })); }); label.appendChild(clearAnchor); var updateEmpty = function () { if (input.value === '') { input.classList.add('empty'); } else { input.classList.remove('empty'); } }; updateEmpty(); var timeout = 0; var handleInput = function (event) { updateEmpty(); clearTimeout(timeout); timeout = setTimeout(function () { return setTerm(input.value); }, 500); }; input.addEventListener('change', handleInput); input.addEventListener('input', handleInput); window$1.addEventListener(apiSearchTermChangedEvent, function () { var term = getTerm(); if (input.value === term) { return; } input.value = term; updateEmpty(); }); return form; } var config = platformConfig[platformId]; var containers = []; function addResultsContainer(container, renderHeading) { containers.push({ container: container, renderHeading: renderHeading }); } function renderResults(platform, results, moreUrl) { document$1.documentElement.classList.add('api-search-has-results'); var _loop_1 = function (container, renderHeading) { container.innerHTML = ''; if (results.length === 0) { container.textContent = loc['no.results']; return { value: void 0 }; } if (renderHeading) { renderResultsHeading(container, platform); } var table = document$1.createElement('table'); table.classList.add('api-search-results'); table.setAttribute('ms.cmpnm', 'api-search-results'); table.setAttribute(contentAttrs.name, 'api-search-results'); var thead = document$1.createElement('thead'); table.appendChild(thead); var theadrow = document$1.createElement('tr'); thead.appendChild(theadrow); var th = document$1.createElement('th'); th.textContent = loc.type; theadrow.appendChild(th); th = document$1.createElement('th'); th.textContent = loc.name; theadrow.appendChild(th); th = document$1.createElement('th'); th.textContent = loc.description; theadrow.appendChild(th); var tbody = document$1.createElement('tbody'); table.appendChild(tbody); appendResultsToTable(tbody, results); container.appendChild(table); if (moreUrl && renderHeading) { var moreButton_1 = document$1.createElement('button'); moreButton_1.classList.add('more-button'); moreButton_1.classList.add('secondary-action'); moreButton_1.textContent = loc.loadMoreResults; moreButton_1.setAttribute(contentAttrs.name, 'api-browser-load-more-results'); moreButton_1.addEventListener('click', function () { fetchWithTimeout(moreUrl).then(function (response) { return response.json(); }) .then(function (result) { moreUrl = result['@nextLink']; if (moreUrl === undefined) { container.removeChild(moreButton_1); } appendResultsToTable(tbody, result.results); }); wedcs('ms.api-browser-load-more-results'); }); container.appendChild(moreButton_1); } }; for (var _i = 0, containers_1 = containers; _i < containers_1.length; _i++) { var _a = containers_1[_i], container = _a.container, renderHeading = _a.renderHeading; var state_1 = _loop_1(container, renderHeading); if (typeof state_1 === "object") return state_1.value; } } function appendResultsToTable(tbody, results) { var moniker = getMoniker(); for (var i = 0; i < results.length; i++) { var result = results[i]; var resultType = result.itemType || result.itemKind || config.namespaceIcon; var tr = document$1.createElement('tr'); tbody.appendChild(tr); var td = document$1.createElement('td'); var icon = document$1.createElement('img'); icon.src = resultIcons[resultType]; icon.alt = resultType; icon.title = resultType; icon.width = 18; icon.height = 18; td.appendChild(icon); tr.appendChild(td); td = document$1.createElement('td'); var a = document$1.createElement('a'); a.setAttribute('ms.title', result.displayName); a.href = processUrl(result.url, moniker); a.innerHTML = breakText(result.displayName); td.appendChild(a); tr.appendChild(td); td = document$1.createElement('td'); td.textContent = result.description; tr.appendChild(td); tr.appendChild(td); } } function displayLoadingIndicator() { document$1.documentElement.classList.add('api-search-has-results'); for (var _i = 0, containers_2 = containers; _i < containers_2.length; _i++) { var container = containers_2[_i].container; container.innerHTML = "\n\t\t\t
      \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
      "; } } function renderText(text) { document$1.documentElement.classList.add('api-search-has-results'); for (var _i = 0, containers_3 = containers; _i < containers_3.length; _i++) { var container = containers_3[_i].container; container.textContent = text; } } function clearResults() { document$1.documentElement.classList.remove('api-search-has-results'); for (var _i = 0, containers_4 = containers; _i < containers_4.length; _i++) { var container = containers_4[_i].container; container.innerHTML = ''; } } function renderResultsHeading(container, platform) { var moniker = getMoniker(); var displayName; var versionDisplayName; if (moniker === '') { displayName = platform.displayName; versionDisplayName = null; } else { var pkg = platform.packagesByMoniker[moniker]; displayName = pkg.product.displayName; versionDisplayName = pkg.versionDisplayName; } var heading = document$1.createElement('h2'); heading.classList.add('api-search-results-heading'); heading.innerHTML = config.resultsHeadingTemplate.replace('{0}', displayName); if (versionDisplayName !== null) { heading.innerHTML += " version " + escape$1(versionDisplayName) + ""; } container.appendChild(heading); } var resultIcons = { Namespace: 'https://docs.microsoft.com/en-us/media/toolbars/namespace.svg', Member: 'https://docs.microsoft.com/en-us/media/toolbars/member.svg', Type: 'https://docs.microsoft.com/en-us/media/toolbars/type.svg', Module: 'https://docs.microsoft.com/en-us/media/toolbars/module.svg', Cmdlet: 'https://docs.microsoft.com/en-us/media/toolbars/cmdlet.svg', }; function processUrl(url, moniker) { if (moniker !== '' && !/[?&]view=/i.test(url)) { var _a = url.split('#'), path = _a[0], hash = _a[1]; hash = hash === undefined ? '' : '#' + hash; url = path + "?view=" + encodeURIComponent(moniker) + hash; } if (/^https:\/\/docs.microsoft.com/.test(url)) { url = url.substr('https://docs.microsoft.com'.length); } return url; } function initApiSearch() { window$1.addEventListener(apiSearchTermChangedEvent, doApiSearch); window$1.addEventListener(monikerChangedEvent, doApiSearch); if (msDocs.data.pageTemplate === 'ApiBrowserPage') { doApiSearch(); } } var previousSearch = ''; function doApiSearch() { var term = getTerm(); var moniker = getMoniker(); var currentSearch = term + "/" + moniker; if (currentSearch === previousSearch) { return; } previousSearch = currentSearch; if (msDocs.data.pageTemplate === 'ApiBrowserPage' && moniker !== '' && term === '') { displayLoadingIndicator(); return Promise.all([fetchNamespaces(platformId, moniker), getPlatform()]) .then(function (_a) { var result = _a[0], platform = _a[1]; if (currentSearch !== previousSearch) { return; } if (result.apiItems.length === 0) { renderText('No namespaces'); return; } renderResults(platform, result.apiItems, null); }, function (error) { renderText(loc.apiSearchIsUnavailable); }); } if (term.length < 3) { clearResults(); return Promise.resolve(); } if (!platformConfig[platformId].validSearchTerm.test(term)) { return getPlatform().then(function (platform) { return renderResults(platform, [], null); }); } displayLoadingIndicator(); return Promise.all([search(platformId, moniker, term), getPlatform()]) .then(function (_a) { var result = _a[0], platform = _a[1]; if (currentSearch !== previousSearch) { return; } bi(moniker, term, result.results.length); renderResults(platform, result.results, result['@nextLink']); }, function (error) { renderText(loc.apiSearchIsUnavailable); }); } function bi(moniker, term, results) { jsllReady.then(function (awa) { return awa.ct.captureContentPageAction({ actionType: awa.actionType.OTHER, behavior: awa.behavior.SEARCH, content: { event: 'api-browser-search', moniker: moniker, term: term, results: results } }); }); wedcs('ms.apisearch.moniker', moniker, 'ms.apisearch.term', term, 'ms.apisearch.results', results.toString(10)); } var pageTemplate = msDocs.data.pageTemplate; var pageType = getMeta('pagetype'); var useMonikerPicker = pageMonikers.any && msDocs.data.pageTemplate !== 'HubPage' || pageTemplate === 'Conceptual' && pageType === 'Reference' && platformId !== null || pageTemplate === 'Conceptual' && pageType === 'Conceptual' && platformId === 'powershell'; var useApiSearch = pageTemplate === 'Reference' && platformId !== null || pageTemplate === 'Conceptual' && pageType === 'Reference' && platformId !== null; function setupToc() { var useStaticMonikerPicker = !useMonikerPicker && document.querySelector('details.versionPicker') !== null; if (useMonikerPicker || useStaticMonikerPicker) { handleMonikerChange(); } if (!useMonikerPicker && !useApiSearch) { return; } var filterHolder = document.querySelector('.filterHolder'); var menuNavDiv = document.getElementById('menu-nav'); if (filterHolder === null || menuNavDiv === null) { return; } if (useMonikerPicker) { var powershellVersionPicker = filterHolder.querySelector('.versionPicker'); if (powershellVersionPicker) { powershellVersionPicker.parentElement.removeChild(powershellVersionPicker); } var picker = createMonikerPicker(false); filterHolder.appendChild(picker); var picker2 = createMonikerPicker(false); menuNavDiv.appendChild(picker2); } if (useApiSearch) { initApiSearch(); var renderHeading = false; var searchField = createSearchField(); filterHolder.appendChild(searchField); var toc = document.querySelector('.toc'); var resultsContainer = document.createElement('div'); toc.appendChild(resultsContainer); addResultsContainer(resultsContainer, renderHeading); var searchField2 = createSearchField(); menuNavDiv.appendChild(searchField2); var resultsContainer2 = document.createElement('div'); menuNavDiv.appendChild(resultsContainer2); addResultsContainer(resultsContainer2, renderHeading); } } function normalizeToc(toc) { if (Array.isArray(toc)) { return toc; } if (Array.isArray(toc.items)) { return toc.items; } return []; } function createToc() { var urlTocQueryName = 'toc'; var urlTocMetaName = 'toc_rel'; var urlBcQueryName = 'bc'; var urlBcMetaName = 'breadcrumb_path'; var pagetypeMetaName = 'pagetype'; var selectedClass = 'selected'; var selectedHolderClass = 'selectedHolder'; var rotateClass = 'rotate'; var noSubsClass = 'noSubs'; var noSibsClass = 'noSibs'; var filterClassName = 'tocFilter'; var emptyFilterClassName = 'emptyFilter'; var emptyFilterMessageClassName = 'emptyFilterMessage'; var hideFocusClass = 'hideFocus'; var groupClass = 'group'; var tocHolderSelector = '.toc'; var filterHolderSelector = '.filterHolder'; var breadcrumbClass = 'breadcrumbs'; var eventNamespace = 'msDocs'; var mTocSubNodeIndent = '   '; var noLinkClass = 'noLink'; var mTocDropdownSelector = '#menu-nav > .mobilenavi > select'; var isTouchEvent = false; var timeout = 10000; var otherTocDelay = 510; var relativeCanonicalUrl = ''; var relativeCanonicalUrlNoQuery = ''; var relativeCanonicalUrlNoQueryWithHash; var relativeCanonicalUrlUniformIndexWithHash; var relativeCanonicalUrlUniformIndex = ''; var tocUrl = ''; var tocFolder = ''; var bcUrl = ''; var bcFolder = ''; var locale = ''; var locationFolder = ''; var $savedToc; var tocJson = []; var nodes_to_expand = []; var hasNodesToExpand = false; var tocQueryUrl = msDocs.functions.getParam(urlTocQueryName); var tocMetaUrl = msDocs.functions.getMeta(urlTocMetaName); var hasMoniker = false; var view = msDocs.functions.getParam('view'); var monikerParams = ''; if (view && view.length) { hasMoniker = true; view = view.toLowerCase(); view = view.replace(/[^\w.|-]+/g, ''); monikerParams = 'view=' + view; } var bcQueryUrl = msDocs.functions.getParam(urlBcQueryName); if (bcQueryUrl) { bcQueryUrl = decodeURIComponent(bcQueryUrl); } var bcMetaUrl = msDocs.functions.getMeta(urlBcMetaName); var pagetype = msDocs.functions.getMeta(pagetypeMetaName); var tocBestMatch = []; var tocFinished = $$1.Deferred(); var bcFinished = $$1.Deferred(); function scrollSelectedNodeIntoView() { var selectedNode = document$1.querySelector(".toc ." + selectedClass); if (selectedNode === null) { return; } var alignToTop = true; selectedNode.scrollIntoView(alignToTop); } tocFinished.then(function () { return setTimeout(scrollSelectedNodeIntoView); }); var resolveRelativePath = function (path, folder) { if (!path || !path.length) { return path; } if (typeof folder !== 'string') { folder = locationFolder; } var firstChar = path.charAt(0); if (firstChar === '/') { if ((path.charAt(6) === '/') && (path.charAt(3) === '-')) { return path; } return '/' + locale + path; } if ((path.substr(0, 7) === 'http://') || (path.substr(0, 8) === 'https://')) { return path; } if (firstChar !== '.') { return '/' + locale + folder + '/' + path; } if (path.substr(0, 3) === '../') { return resolveRelativePath(path.substr(3), getFolder(folder)); } if (path.substr(0, 2) === './') { return '/' + locale + folder + '/' + path.substr(2); } return path; }; var removeQueryString = function (path) { if (path && path.length) { var index = path.indexOf('?'); if (index > 0) { var hashIndex = path.indexOf('#'); if (hashIndex === -1) { path = path.substring(0, index); } else { path = path.substring(0, index) + path.substring(hashIndex); } } } return path; }; var getUniformIndex = function (path) { if (path && path.length) { path = removeQueryString(path); if ((path.charAt(path.length - 1) == '/') || (path.indexOf('/#') > 0)) { return path; } var whackIndex = path.lastIndexOf('/'); var indexIndex = path.indexOf('index', whackIndex); if (indexIndex > 0) { var hashIndex = path.indexOf('#'); if (hashIndex === -1) { if (indexIndex == path.length - 5) { return path.substring(0, indexIndex); } var dotIndex = path.indexOf('.', whackIndex); if (dotIndex > 0) { path = path.substring(0, dotIndex); if (path.substring(path.length - 6) == '/index') { return path.substring(0, path.length - 5); } } } else { var hash = path.substring(hashIndex); path = path.substring(0, hashIndex); if (indexIndex == path.length - 5) { return path.substring(0, indexIndex) + hash; } var dotIndex = path.indexOf('.', whackIndex); if (dotIndex > 0) { path = path.substring(0, dotIndex); if (path.substring(path.length - 6) == '/index') { return path.substring(0, path.length - 5) + hash; } } } } } return ''; }; var getRelativeCanonicalUrl = function (removeTheQueryString) { var canonicalUrl = $$1('link[rel="canonical"]').attr('href'); if (canonicalUrl && canonicalUrl.length) { if ((canonicalUrl.substr(0, 7) === 'http://') || (canonicalUrl.substr(0, 8) === 'https://')) { canonicalUrl = canonicalUrl.substring(canonicalUrl.indexOf('//') + 2); canonicalUrl = canonicalUrl.substring(canonicalUrl.indexOf('/')); } } else { canonicalUrl = document$1.location.pathname; } canonicalUrl = removeLocaleFromPath(canonicalUrl); if (removeTheQueryString) { canonicalUrl = removeQueryString(canonicalUrl); } return canonicalUrl; }; var getFolder = function (path) { return path.substring(0, path.lastIndexOf('/')); }; var thisIsMe = function (href) { if (href && href.length) { var hrefNoQuery = removeQueryString(removeLocaleFromPath(href.toLowerCase())); if (relativeCanonicalUrlNoQuery === hrefNoQuery) { return true; } if (relativeCanonicalUrlNoQueryWithHash && (relativeCanonicalUrlNoQueryWithHash === hrefNoQuery)) { return true; } if (relativeCanonicalUrlUniformIndex) { var hrefUniformIndex = getUniformIndex(hrefNoQuery); if (hrefUniformIndex.length > 0) { if (relativeCanonicalUrlUniformIndex === hrefUniformIndex) { return true; } if (relativeCanonicalUrlUniformIndexWithHash && (relativeCanonicalUrlUniformIndexWithHash === hrefUniformIndex)) { return true; } } } } return false; }; msDocs.functions.toggleAriaExpanded = function (el) { var $el = $$1(el); var $tempEl; var tempHeight; var hasGrandKids = false; var $ulKids = $el.children('ul'); if ($el.attr('aria-expanded') == 'true') { $el.addClass(rotateClass).children('ul').each(function (i, el) { var $tempEl = $$1(el); $tempEl.css({ 'height': $tempEl.height() }).animate({ 'height': 0 }, 200, function () { $$1(this).css('height', ''); $el.attr('aria-expanded', 'false').removeClass(rotateClass); }); }); $ulKids.find('li').css('display', 'none'); } else { $el.attr('aria-expanded', 'true'); $ulKids.find('li').css('display', ''); $ulKids.each(function (i, el) { var $tempEl = $$1(el); tempHeight = $tempEl.height(); $tempEl.css({ 'height': '0' }).animate({ 'height': tempHeight }, 200, function () { $$1(this).css('height', ''); }); }); } }; msDocs.functions.stopSomePropagation = function (e, direction) { switch (direction) { case 'top': if (isTouchEvent) { if (e.offsetY > 20) { e.stopPropagation(); } } else { e.stopPropagation(); } break; case 'left': if (isTouchEvent) { if (e.offsetX > 15) { e.stopPropagation(); } } else { e.stopPropagation(); } break; } }; var drawToc = function (json) { var createTocNode = function (node, ul, nodeMap, isRoot) { var aNode; var href; var pieces; var aCleanTitle; var displayName; nodeMap.push(-1); ul.setAttribute('aria-treegrid', 'true'); ul.setAttribute('onclick', 'msDocs.functions.stopSomePropagation(event, "top")'); for (var i = 0; i < node.length; i++) { aNode = node[i]; aCleanTitle = cleanText(aNode.toc_title); if (aNode.displayName && aNode.displayName.length) { displayName = cleanText(aNode.displayName); } else { displayName = ""; } nodeMap[nodeMap.length - 1] = i; var nextNode = document$1.createElement('li'); var titleHolder; if (aNode.href && aNode.href.length) { href = aNode.href; titleHolder = document$1.createElement('a'); if (i == 0) { titleHolder.setAttribute('onclick', 'msDocs.functions.stopSomePropagation(event, "left")'); } titleHolder.setAttribute('tabindex', '0'); if (aNode.thisIsMe) { titleHolder.classList.add(selectedClass); titleHolder.setAttribute('data-showme', 'true'); if (!nodeMap.length || (tocBestMatch.length < nodeMap.length)) { tocBestMatch = nodeMap.slice(0); } } if (hasMoniker || aNode.maintainContext) { pieces = href.split('#'); titleHolder.setAttribute('href', pieces[0] + ((pieces[0].indexOf('?') > -1) ? '&' : '?') + (aNode.maintainContext ? maintainContextParams + (hasMoniker ? '&' : '') : '') + (hasMoniker ? monikerParams : '') + (pieces[1] ? '#' + pieces[1] : '')); } else { titleHolder.setAttribute('href', href); } } else { titleHolder = document$1.createElement('span'); } if (aNode.expanded) { titleHolder.setAttribute('data-showme', 'true'); } titleHolder.setAttribute('data-text', aCleanTitle.toLowerCase() + " " + displayName.toLowerCase()); titleHolder.innerHTML = breakText(aCleanTitle); nextNode.appendChild(titleHolder); if (aNode.newGroup) { nextNode.classList.add(groupClass); } if (aNode.monikers !== undefined && aNode.monikers.length) { nextNode.setAttribute('data-moniker', aNode.monikers.join(' ')); } if (aNode.children && aNode.children.length) { nextNode.setAttribute('aria-expanded', 'false'); nextNode.setAttribute('tabindex', '0'); nextNode.setAttribute('aria-treeitem', 'true'); nextNode.setAttribute('onclick', 'event.stopPropagation();msDocs.functions.toggleAriaExpanded(this)'); var hasGrandKids = false; for (var j = 0; j < aNode.children.length; j++) { if (aNode.children[j].children && aNode.children[j].children.length) { hasGrandKids = true; break; } } if (!hasGrandKids) { nextNode.classList.add(noSubsClass); } var nextUL = document$1.createElement('ul'); createTocNode(aNode.children, nextUL, nodeMap.slice(0), false); nextNode.appendChild(nextUL); } ul.appendChild(nextNode); } }; var createFilter = function () { var $filter = $$1('
      ') .addClass(filterClassName) .submit(function (e) { e.preventDefault(); }) .append($$1('') .attr('placeholder', loc['filter.placeholder']) .attr('aria-label', loc['filter.text']) .attr('type', 'search') .keypress(function (e) { if (e.which === 13) { e.preventDefault(); return; } }) .keyup(function () { filterToc(this); })) .append($$1('') .attr('href', '#') .attr('title', loc.clearfilter) .addClass('clearInput') .html('' + loc.clearfilter + '') .on('click', function (e) { e.stopPropagation(); e.preventDefault(); var ipt = $$1('.' + filterClassName + ' input[type=search]'); ipt.val(''); filterToc(ipt); })); var $noResults = $$1('
      ') .addClass(emptyFilterMessageClassName) .html(loc['no.results']); return [$filter, $noResults]; }; var maintainContextParams = urlTocQueryName + '=' + encodeURIComponent(resolveRelativePath(tocUrl)) + '&' + urlBcQueryName + '=' + encodeURIComponent(resolveRelativePath(bcUrl)); var toc = document$1.createElement('ul'); createTocNode(json, toc, [], true); var $toc = $$1(toc); $toc.find('.' + selectedClass).parent().addClass(selectedHolderClass); $toc.find('[data-showme]').parents('li[aria-expanded="false"]').attr('aria-expanded', 'true'); $toc.on('touchstart pointerdown MSPointerDown', function (e) { if (e.type == 'touchstart' || (((e.type == 'pointerdown') || (e.type == 'MSPointerDown')) && (e.originalEvent.pointerType == 'touch'))) { isTouchEvent = true; setTimeout(function () { isTouchEvent = false; }, 700); } }) .on('mousedown', function (e) { $$1(this).addClass(hideFocusClass); }) .on('mouseup', function (e) { $$1(e.target).blur().parent().blur(); $$1(this).removeClass(hideFocusClass); }) .on('keydown', 'a', function (e) { if (e.which === 13) { document$1.location.href = $$1(e.target).attr('href'); e.stopPropagation(); return false; } }) .on('keydown', 'li', function (e) { if (e.which === 13 && !$toc.hasClass(noSibsClass)) { e.stopPropagation(); msDocs.functions.toggleAriaExpanded($$1(this)); } }); if (json.length == 1) { $toc.addClass(noSibsClass); $toc.children('li').attr('aria-expanded', 'true').off('click.' + eventNamespace).removeAttr('tabindex'); } var arrfilter; if (!useApiSearch) { arrfilter = createFilter(); } $$1(function () { $$1(tocHolderSelector).attr('role', 'application')[0].appendChild(toc); if (!useApiSearch) { $$1(filterHolderSelector).append(arrfilter); } tocFinished.resolve(); }); }; var drawMToc = function (json) { var createMTocNode = function (node, indent, $mToc) { var aNode; var href; var pieces; for (var i = 0; i < node.length; i++) { aNode = node[i]; $mToc .append($$1('