- Albert Einstein':e===m?a='"Failure is simply the opportunity to begin again, this time more intelligently."
- Henry Ford':e===h?a='"The peoples who want to live comfortably without producing and fatigue; they are doomed to lose their dignity, then liberty, and then independence and destiny."
- Mustafa Kemal Ataturk':e===g&&(a='"Knowledge rests not upon truth alone, but upon error also."
- Carl Gustav Jung')),"string"!=typeof o&&(o="Okay"),n.plainText&&(i=X(i),a=X(a),o=X(o)),n.plainText||(i.length>n.titleMaxLength&&(i="Possible HTML Tags Error",a='The "plainText" option is "false" and the title content length is more than the "titleMaxLength" option.',o="Okay"),a.length>n.messageMaxLength&&(i="Possible HTML Tags Error",a='The "plainText" option is "false" and the message content length is more than the "messageMaxLength" option.',o="Okay"),o.length>n.buttonMaxLength&&(i="Possible HTML Tags Error",a='The "plainText" option is "false" and the button content length is more than the "buttonMaxLength" option.',o="Okay")),i.length>n.titleMaxLength&&(i=i.substring(0,n.titleMaxLength)+"..."),a.length>n.messageMaxLength&&(a=a.substring(0,n.messageMaxLength)+"..."),o.length>n.buttonMaxLength&&(o=o.substring(0,n.buttonMaxLength)+"..."),n.cssAnimation||(n.cssAnimationDuration=0);var d=t.document.createElement("div");d.id=y.ID,d.className=n.className,d.style.zIndex=n.zindex,d.style.borderRadius=n.borderRadius,d.style.fontFamily='"'+n.fontFamily+'", '+s,n.rtl&&(d.setAttribute("dir","rtl"),d.classList.add("nx-rtl-on")),d.style.display="flex",d.style.flexWrap="wrap",d.style.flexDirection="column",d.style.alignItems="center",d.style.justifyContent="center";var v="",b=!0===n.backOverlayClickToClose;n.backOverlay&&(v='');var x="";if(e===p?x=function(t,e){return t||(t="110px"),e||(e="#32c682"),''}(n.svgSize,u.svgColor):e===m?x=function(t,e){return t||(t="110px"),e||(e="#ff5549"),''}(n.svgSize,u.svgColor):e===h?x=function(t,e){return t||(t="110px"),e||(e="#eebf31"),''}(n.svgSize,u.svgColor):e===g&&(x=function(t,e){return t||(t="110px"),e||(e="#26c0d3"),''}(n.svgSize,u.svgColor)),d.innerHTML=v+'
"),a.cssAnimation||(a.cssAnimationDuration=0);var d="";if(e===k)d=H(a.svgSize,a.svgColor);else if(e===N)d=V(a.svgSize,a.svgColor);else if(e===C)d=q(a.svgSize,a.svgColor);else if(e===S)d=J(a.svgSize,a.svgColor);else if(e===E)d=Q(a.svgSize,a.svgColor);else if(e===A)d=G(a.svgSize,a.svgColor);else if(e===L&&null!==a.customSvgCode&&null===a.customSvgUrl)d=a.customSvgCode||"";else if(e===L&&null!==a.customSvgUrl&&null===a.customSvgCode)d='';else{if(e===L&&(null===a.customSvgUrl||null===a.customSvgCode))return P('You have to set a static SVG url to "customSvgUrl" option to use Loading Custom.'),!1;d=function(t,e,n){return t||(t="60px"),e||(e="#f8f8f8"),n||(n="#32c682"),''}(a.svgSize,"#f8f8f8","#32c682")}var p=parseInt((a.svgSize||"").replace(/[^0-9]/g,"")),m=t.innerWidth,h=p>=m?m-40+"px":p+"px",g='
\"),n.cssAnimation||(n.cssAnimationDuration=0);var f=\"\";if(e===x.Standard)f=W(n.svgSize,n.svgColor);else if(e===x.Hourglass)f=I(n.svgSize,n.svgColor);else if(e===x.Circle)f=R(n.svgSize,n.svgColor);else if(e===x.Arrows)f=A(n.svgSize,n.svgColor);else if(e===x.Dots)f=M(n.svgSize,n.svgColor);else if(e===x.Pulse)f=B(n.svgSize,n.svgColor);else if(e===x.Custom&&null!==n.customSvgCode&&null===n.customSvgUrl)f=n.customSvgCode||\"\";else if(e===x.Custom&&null!==n.customSvgUrl&&null===n.customSvgCode)f=\"\";else{if(e===x.Custom&&(null===n.customSvgUrl||null===n.customSvgCode))return y(\"You have to set a static SVG url to \\\"customSvgUrl\\\" option to use Loading Custom.\"),!1;f=X(n.svgSize,\"#f8f8f8\",\"#32c682\")}var d=parseInt((n.svgSize||\"\").replace(/[^0-9]/g,\"\")),b=t.innerWidth,u=d>=b?b-40+\"px\":d+\"px\",k=\"
\"+f+\"
\",h=t.document.createElement(\"div\");if(h.id=g.ID,h.className=n.className+(n.cssAnimation?\" nx-with-animation\":\"\")+(n.clickToClose?\" nx-loading-click-to-close\":\"\"),h.style.zIndex=n.zindex,h.style.background=n.backgroundColor,h.style.animationDuration=n.cssAnimationDuration+\"ms\",h.style.fontFamily=\"\\\"\"+n.fontFamily+\"\\\", \"+s,h.style.display=\"flex\",h.style.flexWrap=\"wrap\",h.style.flexDirection=\"column\",h.style.alignItems=\"center\",h.style.justifyContent=\"center\",n.rtl&&(h.setAttribute(\"dir\",\"rtl\"),h.classList.add(\"nx-rtl-on\")),h.innerHTML=k+p,!t.document.getElementById(h.id)&&(t.document.body.appendChild(h),n.clickToClose)){var C=t.document.getElementById(h.id);C.addEventListener(\"click\",function(){h.classList.add(\"nx-remove\");var t=setTimeout(function(){null!==h.parentNode&&(h.parentNode.removeChild(h),clearTimeout(t))},n.cssAnimationDuration)})}}else if(t.document.getElementById(g.ID))var z=t.document.getElementById(g.ID),S=setTimeout(function(){z.classList.add(\"nx-remove\");var t=setTimeout(function(){null!==z.parentNode&&(z.parentNode.removeChild(z),clearTimeout(t))},n.cssAnimationDuration);clearTimeout(S)},r);n=v(!0,n,l)},V=function(e){\"string\"!=typeof e&&(e=\"\");var i=t.document.getElementById(g.ID);if(i)if(0n.messageMaxLength?N(e).substring(0,n.messageMaxLength)+\"...\":N(e);var a=i.getElementsByTagName(\"p\")[0];if(a)a.innerHTML=e;else{var o=t.document.createElement(\"p\");o.id=n.messageID,o.className=\"nx-loading-message nx-loading-message-new\",o.style.color=n.messageColor,o.style.fontSize=n.messageFontSize,o.innerHTML=e,i.appendChild(o)}}else y(\"Where is the new message?\")},q=function(){return\"[id^=NotiflixBlockWrap]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1000;font-family:\\\"Quicksand\\\",-apple-system,BlinkMacSystemFont,\\\"Segoe UI\\\",Roboto,\\\"Helvetica Neue\\\",Arial,sans-serif;background:rgba(255,255,255,.9);text-align:center;animation-duration:.4s;width:100%;height:100%;left:0;top:0;border-radius:inherit;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}[id^=NotiflixBlockWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixBlockWrap]>span[class*=\\\"-icon\\\"]{display:block;width:45px;height:45px;position:relative;margin:0 auto}[id^=NotiflixBlockWrap]>span[class*=\\\"-icon\\\"] svg{width:inherit;height:inherit}[id^=NotiflixBlockWrap]>span[class*=\\\"-message\\\"]{position:relative;display:block;width:100%;margin:10px auto 0;padding:0 10px;font-family:inherit!important;font-weight:normal;font-size:14px;line-height:1.4}[id^=NotiflixBlockWrap].nx-with-animation{-webkit-animation:block-animation-fade .3s ease-in-out 0s normal;animation:block-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixBlockWrap].nx-with-animation.nx-remove{opacity:0;-webkit-animation:block-animation-fade-remove .3s ease-in-out 0s normal;animation:block-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}\"},Q=0,Y=function(e,i,a,n,r,l){var m;if(Array.isArray(a)){if(1>a.length)return y(\"Array of HTMLElements should contains at least one HTMLElement.\"),!1;m=a}else if(Object.prototype.isPrototypeOf.call(NodeList.prototype,a)){if(1>a.length)return y(\"NodeListOf should contains at least one HTMLElement.\"),!1;m=Array.prototype.slice.call(a)}else{var c=\"string\"!=typeof a||1>(a||\"\").length||1===(a||\"\").length&&(\"#\"===(a||\"\")[0]||\".\"===(a||\"\")[0]);if(c)return y(\"The selector parameter must be a string and matches a specified CSS selector(s).\"),!1;var p=t.document.querySelectorAll(a);if(1>p.length)return y(\"You called the \\\"Notiflix.Block...\\\" function with \\\"\"+a+\"\\\" selector, but there is no such element(s) in the document.\"),!1;m=p}o||G.Block.init({});var f=v(!0,o,{});if(\"object\"==typeof n&&!Array.isArray(n)||\"object\"==typeof r&&!Array.isArray(r)){var d={};\"object\"==typeof n?d=n:\"object\"==typeof r&&(d=r),o=v(!0,o,d)}var x=\"\";\"string\"==typeof n&&0=h?h:m.length,z=\"nx-block-temporary-position\";if(e){for(var S,L=[\"area\",\"base\",\"br\",\"col\",\"command\",\"embed\",\"hr\",\"img\",\"input\",\"keygen\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\",\"html\",\"head\",\"title\",\"script\",\"style\",\"iframe\"],X=0;XD.length){var T=\"\";i&&(i===b.Hourglass?T=I(o.svgSize,o.svgColor):i===b.Circle?T=R(o.svgSize,o.svgColor):i===b.Arrows?T=A(o.svgSize,o.svgColor):i===b.Dots?T=M(o.svgSize,o.svgColor):i===b.Pulse?T=B(o.svgSize,o.svgColor):T=W(o.svgSize,o.svgColor));var F=\"\"+T+\"\",E=\"\";0o.messageMaxLength?N(x).substring(0,o.messageMaxLength)+\"...\":N(x),E=\"\"+x+\"\"),Q++;var j=t.document.createElement(\"div\");j.id=u.ID+\"-\"+Q,j.className=g+(o.cssAnimation?\" nx-with-animation\":\"\"),j.style.position=o.position,j.style.zIndex=o.zindex,j.style.background=o.backgroundColor,j.style.animationDuration=o.cssAnimationDuration+\"ms\",j.style.fontFamily=\"\\\"\"+o.fontFamily+\"\\\", \"+s,j.style.display=\"flex\",j.style.flexWrap=\"wrap\",j.style.flexDirection=\"column\",j.style.alignItems=\"center\",j.style.justifyContent=\"center\",o.rtl&&(j.setAttribute(\"dir\",\"rtl\"),j.classList.add(\"nx-rtl-on\")),j.innerHTML=F+E;var O=t.getComputedStyle(S).getPropertyValue(\"position\"),H=\"string\"==typeof O?O.toLocaleLowerCase(\"en\"):\"relative\",P=Math.round(1.25*parseInt(o.svgSize))+40,U=S.offsetHeight||0,V=\"\";P>U&&(V=\"min-height:\"+P+\"px;\");var q=\"\";q=S.getAttribute(\"id\")?\"#\"+S.getAttribute(\"id\"):S.classList[0]?\".\"+S.classList[0]:(S.tagName||\"\").toLocaleLowerCase(\"en\");var Y=\"\",K=-1>=[\"absolute\",\"relative\",\"fixed\",\"sticky\"].indexOf(H);if(K||0\"+q+\".\"+z+\"{\"+Y+V+\"}\",J=t.document.createRange();J.selectNode(t.document.head);var Z=J.createContextualFragment($);t.document.head.appendChild(Z),S.classList.add(z)}S.appendChild(j)}}}else var _=function(e){var i=setTimeout(function(){null!==e.parentNode&&e.parentNode.removeChild(e);var a=e.getAttribute(\"id\"),n=t.document.getElementById(\"Style-\"+a);n&&null!==n.parentNode&&n.parentNode.removeChild(n),clearTimeout(i)},o.cssAnimationDuration)},tt=function(t){if(t&&0\\\" or \\\"NodeListOf\\\" does not have a \\\"Block\\\" element to remove.\")},et=function(t){var e=setTimeout(function(){t.classList.remove(z),clearTimeout(e)},o.cssAnimationDuration+300)},it=setTimeout(function(){for(var t,e=0;e {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n function isEqual(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n }\n function kebabCase(str) {\n const result = str.replace(/[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g, (match) => '-' + match.toLowerCase());\n return str[0] === str[0].toUpperCase() ? result.substring(1) : result;\n }\n\n class Settings {\n constructor(settings) {\n this.id = '';\n this.style = '';\n this.class = [];\n this.isMultiple = false;\n this.isOpen = false;\n this.isFullOpen = false;\n this.intervalMove = null;\n if (!settings) {\n settings = {};\n }\n this.id = 'ss-' + generateID();\n this.style = settings.style || '';\n this.class = settings.class || [];\n this.disabled = settings.disabled !== undefined ? settings.disabled : false;\n this.alwaysOpen = settings.alwaysOpen !== undefined ? settings.alwaysOpen : false;\n this.showSearch = settings.showSearch !== undefined ? settings.showSearch : true;\n this.searchPlaceholder = settings.searchPlaceholder || 'Search';\n this.searchText = settings.searchText || 'No Results';\n this.searchingText = settings.searchingText || 'Searching...';\n this.searchHighlight = settings.searchHighlight !== undefined ? settings.searchHighlight : false;\n this.closeOnSelect = settings.closeOnSelect !== undefined ? settings.closeOnSelect : true;\n this.contentLocation = settings.contentLocation || document.body;\n this.contentPosition = settings.contentPosition || 'absolute';\n this.openPosition = settings.openPosition || 'auto';\n this.placeholderText = settings.placeholderText !== undefined ? settings.placeholderText : 'Select Value';\n this.allowDeselect = settings.allowDeselect !== undefined ? settings.allowDeselect : false;\n this.hideSelected = settings.hideSelected !== undefined ? settings.hideSelected : false;\n this.showOptionTooltips = settings.showOptionTooltips !== undefined ? settings.showOptionTooltips : false;\n this.minSelected = settings.minSelected || 0;\n this.maxSelected = settings.maxSelected || 1000;\n this.timeoutDelay = settings.timeoutDelay || 200;\n this.maxValuesShown = settings.maxValuesShown || 20;\n this.maxValuesMessage = settings.maxValuesMessage || '{number} selected';\n }\n }\n\n class Optgroup {\n constructor(optgroup) {\n this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;\n this.label = optgroup.label || '';\n this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;\n this.selectAllText = optgroup.selectAllText || 'Select All';\n this.closable = optgroup.closable || 'off';\n this.options = [];\n if (optgroup.options) {\n for (const o of optgroup.options) {\n this.options.push(new Option(o));\n }\n }\n }\n }\n class Option {\n constructor(option) {\n this.id = !option.id || option.id === '' ? generateID() : option.id;\n this.value = option.value === undefined ? option.text : option.value;\n this.text = option.text || '';\n this.html = option.html || '';\n this.selected = option.selected !== undefined ? option.selected : false;\n this.display = option.display !== undefined ? option.display : true;\n this.disabled = option.disabled !== undefined ? option.disabled : false;\n this.mandatory = option.mandatory !== undefined ? option.mandatory : false;\n this.placeholder = option.placeholder !== undefined ? option.placeholder : false;\n this.class = option.class || '';\n this.style = option.style || '';\n this.data = option.data || {};\n }\n }\n class Store {\n constructor(type, data) {\n this.selectType = 'single';\n this.data = [];\n this.selectType = type;\n this.setData(data);\n }\n validateDataArray(data) {\n if (!Array.isArray(data)) {\n return new Error('Data must be an array');\n }\n for (let dataObj of data) {\n if (dataObj instanceof Optgroup || 'label' in dataObj) {\n if (!('label' in dataObj)) {\n return new Error('Optgroup must have a label');\n }\n if ('options' in dataObj && dataObj.options) {\n for (let option of dataObj.options) {\n return this.validateOption(option);\n }\n }\n }\n else if (dataObj instanceof Option || 'text' in dataObj) {\n return this.validateOption(dataObj);\n }\n else {\n return new Error('Data object must be a valid optgroup or option');\n }\n }\n return null;\n }\n validateOption(option) {\n if (!('text' in option)) {\n return new Error('Option must have a text');\n }\n return null;\n }\n partialToFullData(data) {\n let dataFinal = [];\n data.forEach((dataObj) => {\n if (dataObj instanceof Optgroup || 'label' in dataObj) {\n let optOptions = [];\n if ('options' in dataObj && dataObj.options) {\n dataObj.options.forEach((option) => {\n optOptions.push(new Option(option));\n });\n }\n if (optOptions.length > 0) {\n dataFinal.push(new Optgroup(dataObj));\n }\n }\n if (dataObj instanceof Option || 'text' in dataObj) {\n dataFinal.push(new Option(dataObj));\n }\n });\n return dataFinal;\n }\n setData(data) {\n this.data = this.partialToFullData(data);\n if (this.selectType === 'single') {\n this.setSelectedBy('value', this.getSelected());\n }\n }\n getData() {\n return this.filter(null, true);\n }\n getDataOptions() {\n return this.filter(null, false);\n }\n addOption(option) {\n this.setData(this.getData().concat(new Option(option)));\n }\n setSelectedBy(selectedType, selectedValues) {\n let firstOption = null;\n let hasSelected = false;\n for (let dataObj of this.data) {\n if (dataObj instanceof Optgroup) {\n for (let option of dataObj.options) {\n if (!firstOption) {\n firstOption = option;\n }\n option.selected = hasSelected ? false : selectedValues.includes(option[selectedType]);\n if (option.selected && this.selectType === 'single') {\n hasSelected = true;\n }\n }\n }\n if (dataObj instanceof Option) {\n if (!firstOption) {\n firstOption = dataObj;\n }\n dataObj.selected = hasSelected ? false : selectedValues.includes(dataObj[selectedType]);\n if (dataObj.selected && this.selectType === 'single') {\n hasSelected = true;\n }\n }\n }\n if (this.selectType === 'single' && firstOption && !hasSelected) {\n firstOption.selected = true;\n }\n }\n getSelected() {\n let selectedOptions = this.getSelectedOptions();\n let selectedValues = [];\n selectedOptions.forEach((option) => {\n selectedValues.push(option.value);\n });\n return selectedValues;\n }\n getSelectedOptions() {\n return this.filter((opt) => {\n return opt.selected;\n }, false);\n }\n getSelectedIDs() {\n let selectedOptions = this.getSelectedOptions();\n let selectedIDs = [];\n selectedOptions.forEach((op) => {\n selectedIDs.push(op.id);\n });\n return selectedIDs;\n }\n getOptgroupByID(id) {\n for (let dataObj of this.data) {\n if (dataObj instanceof Optgroup && dataObj.id === id) {\n return dataObj;\n }\n }\n return null;\n }\n getOptionByID(id) {\n let options = this.filter((opt) => {\n return opt.id === id;\n }, false);\n return options.length ? options[0] : null;\n }\n search(search, searchFilter) {\n search = search.trim();\n if (search === '') {\n return this.getData();\n }\n return this.filter((opt) => {\n return searchFilter(opt, search);\n }, true);\n }\n filter(filter, includeOptgroup) {\n const dataSearch = [];\n this.data.forEach((dataObj) => {\n if (dataObj instanceof Optgroup) {\n let optOptions = [];\n dataObj.options.forEach((option) => {\n if (!filter || filter(option)) {\n if (!includeOptgroup) {\n dataSearch.push(new Option(option));\n }\n else {\n optOptions.push(new Option(option));\n }\n }\n });\n if (optOptions.length > 0) {\n let optgroup = new Optgroup(dataObj);\n optgroup.options = optOptions;\n dataSearch.push(optgroup);\n }\n }\n if (dataObj instanceof Option) {\n if (!filter || filter(dataObj)) {\n dataSearch.push(new Option(dataObj));\n }\n }\n });\n return dataSearch;\n }\n getSelectType() {\n return this.selectType;\n }\n }\n\n class Render {\n constructor(settings, store, callbacks) {\n this.classes = {\n main: 'ss-main',\n placeholder: 'ss-placeholder',\n values: 'ss-values',\n single: 'ss-single',\n max: 'ss-max',\n value: 'ss-value',\n valueText: 'ss-value-text',\n valueDelete: 'ss-value-delete',\n valueOut: 'ss-value-out',\n deselect: 'ss-deselect',\n deselectPath: 'M10,10 L90,90 M10,90 L90,10',\n arrow: 'ss-arrow',\n arrowClose: 'M10,30 L50,70 L90,30',\n arrowOpen: 'M10,70 L50,30 L90,70',\n content: 'ss-content',\n openAbove: 'ss-open-above',\n openBelow: 'ss-open-below',\n search: 'ss-search',\n searchHighlighter: 'ss-search-highlight',\n searching: 'ss-searching',\n addable: 'ss-addable',\n addablePath: 'M50,10 L50,90 M10,50 L90,50',\n list: 'ss-list',\n optgroup: 'ss-optgroup',\n optgroupLabel: 'ss-optgroup-label',\n optgroupLabelText: 'ss-optgroup-label-text',\n optgroupActions: 'ss-optgroup-actions',\n optgroupSelectAll: 'ss-selectall',\n optgroupSelectAllBox: 'M60,10 L10,10 L10,90 L90,90 L90,50',\n optgroupSelectAllCheck: 'M30,45 L50,70 L90,10',\n optgroupClosable: 'ss-closable',\n option: 'ss-option',\n optionDelete: 'M10,10 L90,90 M10,90 L90,10',\n highlighted: 'ss-highlighted',\n open: 'ss-open',\n close: 'ss-close',\n selected: 'ss-selected',\n error: 'ss-error',\n disabled: 'ss-disabled',\n hide: 'ss-hide',\n };\n this.store = store;\n this.settings = settings;\n this.callbacks = callbacks;\n this.main = this.mainDiv();\n this.content = this.contentDiv();\n this.updateClassStyles();\n this.updateAriaAttributes();\n this.settings.contentLocation.appendChild(this.content.main);\n }\n enable() {\n this.main.main.classList.remove(this.classes.disabled);\n this.content.search.input.disabled = false;\n }\n disable() {\n this.main.main.classList.add(this.classes.disabled);\n this.content.search.input.disabled = true;\n }\n open() {\n this.main.arrow.path.setAttribute('d', this.classes.arrowOpen);\n this.main.main.classList.add(this.settings.openPosition === 'up' ? this.classes.openAbove : this.classes.openBelow);\n this.main.main.setAttribute('aria-expanded', 'true');\n this.moveContent();\n const selectedOptions = this.store.getSelectedOptions();\n if (selectedOptions.length) {\n const selectedId = selectedOptions[selectedOptions.length - 1].id;\n const selectedOption = this.content.list.querySelector('[data-id=\"' + selectedId + '\"]');\n if (selectedOption) {\n this.ensureElementInView(this.content.list, selectedOption);\n }\n }\n }\n close() {\n this.main.main.classList.remove(this.classes.openAbove);\n this.main.main.classList.remove(this.classes.openBelow);\n this.main.main.setAttribute('aria-expanded', 'false');\n this.content.main.classList.remove(this.classes.openAbove);\n this.content.main.classList.remove(this.classes.openBelow);\n this.main.arrow.path.setAttribute('d', this.classes.arrowClose);\n }\n updateClassStyles() {\n this.main.main.className = '';\n this.main.main.removeAttribute('style');\n this.content.main.className = '';\n this.content.main.removeAttribute('style');\n this.main.main.classList.add(this.classes.main);\n this.content.main.classList.add(this.classes.content);\n if (this.settings.style !== '') {\n this.main.main.style.cssText = this.settings.style;\n this.content.main.style.cssText = this.settings.style;\n }\n if (this.settings.class.length) {\n for (const c of this.settings.class) {\n if (c.trim() !== '') {\n this.main.main.classList.add(c.trim());\n this.content.main.classList.add(c.trim());\n }\n }\n }\n if (this.settings.contentPosition === 'relative') {\n this.content.main.classList.add('ss-' + this.settings.contentPosition);\n }\n }\n updateAriaAttributes() {\n this.main.main.role = 'combobox';\n this.main.main.setAttribute('aria-haspopup', 'listbox');\n this.main.main.setAttribute('aria-controls', this.content.main.id);\n this.main.main.setAttribute('aria-expanded', 'false');\n this.content.main.setAttribute('role', 'listbox');\n }\n mainDiv() {\n var _a;\n const main = document.createElement('div');\n main.dataset.id = this.settings.id;\n main.id = this.settings.id;\n main.tabIndex = 0;\n main.onkeydown = (e) => {\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowDown':\n this.callbacks.open();\n e.key === 'ArrowDown' ? this.highlight('down') : this.highlight('up');\n return false;\n case 'Tab':\n this.callbacks.close();\n return true;\n case 'Enter':\n case ' ':\n this.callbacks.open();\n const highlighted = this.content.list.querySelector('.' + this.classes.highlighted);\n if (highlighted) {\n highlighted.click();\n }\n return false;\n case 'Escape':\n this.callbacks.close();\n return false;\n }\n };\n main.onclick = (e) => {\n if (this.settings.disabled) {\n return;\n }\n this.settings.isOpen ? this.callbacks.close() : this.callbacks.open();\n };\n const values = document.createElement('div');\n values.classList.add(this.classes.values);\n main.appendChild(values);\n const deselect = document.createElement('div');\n deselect.classList.add(this.classes.deselect);\n const selectedOptions = (_a = this.store) === null || _a === void 0 ? void 0 : _a.getSelectedOptions();\n if (!this.settings.allowDeselect || (this.settings.isMultiple && selectedOptions && selectedOptions.length <= 0)) {\n deselect.classList.add(this.classes.hide);\n }\n else {\n deselect.classList.remove(this.classes.hide);\n }\n deselect.onclick = (e) => {\n e.stopPropagation();\n if (this.settings.disabled) {\n return;\n }\n let shouldDelete = true;\n const before = this.store.getSelectedOptions();\n const after = [];\n if (this.callbacks.beforeChange) {\n shouldDelete = this.callbacks.beforeChange(after, before) === true;\n }\n if (shouldDelete) {\n if (this.settings.isMultiple) {\n this.callbacks.setSelected([], false);\n this.updateDeselectAll();\n }\n else {\n this.callbacks.setSelected([''], false);\n }\n if (this.settings.closeOnSelect) {\n this.callbacks.close();\n }\n if (this.callbacks.afterChange) {\n this.callbacks.afterChange(after);\n }\n }\n };\n const deselectSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n deselectSvg.setAttribute('viewBox', '0 0 100 100');\n const deselectPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n deselectPath.setAttribute('d', this.classes.deselectPath);\n deselectSvg.appendChild(deselectPath);\n deselect.appendChild(deselectSvg);\n main.appendChild(deselect);\n const arrow = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n arrow.classList.add(this.classes.arrow);\n arrow.setAttribute('viewBox', '0 0 100 100');\n const arrowPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n arrowPath.setAttribute('d', this.classes.arrowClose);\n if (this.settings.alwaysOpen) {\n arrow.classList.add(this.classes.hide);\n }\n arrow.appendChild(arrowPath);\n main.appendChild(arrow);\n return {\n main: main,\n values: values,\n deselect: {\n main: deselect,\n svg: deselectSvg,\n path: deselectPath,\n },\n arrow: {\n main: arrow,\n path: arrowPath,\n },\n };\n }\n mainFocus(eventType) {\n if (eventType !== 'click') {\n this.main.main.focus({ preventScroll: true });\n }\n }\n placeholder() {\n const placeholderOption = this.store.filter((o) => o.placeholder, false);\n let placeholderText = this.settings.placeholderText;\n if (placeholderOption.length) {\n if (placeholderOption[0].html !== '') {\n placeholderText = placeholderOption[0].html;\n }\n else if (placeholderOption[0].text !== '') {\n placeholderText = placeholderOption[0].text;\n }\n }\n const placeholder = document.createElement('div');\n placeholder.classList.add(this.classes.placeholder);\n placeholder.innerHTML = placeholderText;\n return placeholder;\n }\n renderValues() {\n if (!this.settings.isMultiple) {\n this.renderSingleValue();\n return;\n }\n this.renderMultipleValues();\n }\n renderSingleValue() {\n const selected = this.store.filter((o) => {\n return o.selected && !o.placeholder;\n }, false);\n const selectedSingle = selected.length > 0 ? selected[0] : null;\n if (!selectedSingle) {\n this.main.values.innerHTML = this.placeholder().outerHTML;\n }\n else {\n const singleValue = document.createElement('div');\n singleValue.classList.add(this.classes.single);\n if (selectedSingle.html) {\n singleValue.innerHTML = selectedSingle.html;\n }\n else {\n singleValue.innerText = selectedSingle.text;\n }\n this.main.values.innerHTML = singleValue.outerHTML;\n }\n if (!this.settings.allowDeselect || !selected.length) {\n this.main.deselect.main.classList.add(this.classes.hide);\n }\n else {\n this.main.deselect.main.classList.remove(this.classes.hide);\n }\n }\n renderMultipleValues() {\n let currentNodes = this.main.values.childNodes;\n let selectedOptions = this.store.filter((opt) => {\n return opt.selected && opt.display;\n }, false);\n if (selectedOptions.length === 0) {\n this.main.values.innerHTML = this.placeholder().outerHTML;\n return;\n }\n else {\n const placeholder = this.main.values.querySelector('.' + this.classes.placeholder);\n if (placeholder) {\n placeholder.remove();\n }\n }\n if (selectedOptions.length > this.settings.maxValuesShown) {\n const singleValue = document.createElement('div');\n singleValue.classList.add(this.classes.max);\n singleValue.textContent = this.settings.maxValuesMessage.replace('{number}', selectedOptions.length.toString());\n this.main.values.innerHTML = singleValue.outerHTML;\n return;\n }\n else {\n const maxValuesMessage = this.main.values.querySelector('.' + this.classes.max);\n if (maxValuesMessage) {\n maxValuesMessage.remove();\n }\n }\n let removeNodes = [];\n for (let i = 0; i < currentNodes.length; i++) {\n const node = currentNodes[i];\n const id = node.getAttribute('data-id');\n if (id) {\n const found = selectedOptions.filter((opt) => {\n return opt.id === id;\n }, false);\n if (!found.length) {\n removeNodes.push(node);\n }\n }\n }\n for (const n of removeNodes) {\n n.classList.add(this.classes.valueOut);\n setTimeout(() => {\n if (this.main.values.hasChildNodes() && this.main.values.contains(n)) {\n this.main.values.removeChild(n);\n }\n }, 100);\n }\n currentNodes = this.main.values.childNodes;\n for (let d = 0; d < selectedOptions.length; d++) {\n let shouldAdd = true;\n for (let i = 0; i < currentNodes.length; i++) {\n if (selectedOptions[d].id === String(currentNodes[i].dataset.id)) {\n shouldAdd = false;\n }\n }\n if (shouldAdd) {\n if (currentNodes.length === 0) {\n this.main.values.appendChild(this.multipleValue(selectedOptions[d]));\n }\n else if (d === 0) {\n this.main.values.insertBefore(this.multipleValue(selectedOptions[d]), currentNodes[d]);\n }\n else {\n currentNodes[d - 1].insertAdjacentElement('afterend', this.multipleValue(selectedOptions[d]));\n }\n }\n }\n this.updateDeselectAll();\n }\n multipleValue(option) {\n const value = document.createElement('div');\n value.classList.add(this.classes.value);\n value.dataset.id = option.id;\n const text = document.createElement('div');\n text.classList.add(this.classes.valueText);\n text.innerText = option.text;\n value.appendChild(text);\n if (!option.mandatory) {\n const deleteDiv = document.createElement('div');\n deleteDiv.classList.add(this.classes.valueDelete);\n deleteDiv.onclick = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (this.settings.disabled) {\n return;\n }\n let shouldDelete = true;\n const before = this.store.getSelectedOptions();\n const after = before.filter((o) => {\n return o.selected && o.id !== option.id;\n }, true);\n if (this.settings.minSelected && after.length < this.settings.minSelected) {\n return;\n }\n if (this.callbacks.beforeChange) {\n shouldDelete = this.callbacks.beforeChange(after, before) === true;\n }\n if (shouldDelete) {\n let selectedValues = [];\n for (const o of after) {\n if (o instanceof Optgroup) {\n for (const c of o.options) {\n selectedValues.push(c.value);\n }\n }\n if (o instanceof Option) {\n selectedValues.push(o.value);\n }\n }\n this.callbacks.setSelected(selectedValues, false);\n if (this.settings.closeOnSelect) {\n this.callbacks.close();\n }\n if (this.callbacks.afterChange) {\n this.callbacks.afterChange(after);\n }\n this.updateDeselectAll();\n }\n };\n const deleteSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n deleteSvg.setAttribute('viewBox', '0 0 100 100');\n const deletePath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n deletePath.setAttribute('d', this.classes.optionDelete);\n deleteSvg.appendChild(deletePath);\n deleteDiv.appendChild(deleteSvg);\n value.appendChild(deleteDiv);\n }\n return value;\n }\n contentDiv() {\n const main = document.createElement('div');\n main.dataset.id = this.settings.id;\n main.id = this.settings.id;\n const search = this.searchDiv();\n main.appendChild(search.main);\n const list = this.listDiv();\n main.appendChild(list);\n return {\n main: main,\n search: search,\n list: list,\n };\n }\n moveContent() {\n if (this.settings.contentPosition === 'relative') {\n this.moveContentBelow();\n return;\n }\n if (this.settings.openPosition === 'down') {\n this.moveContentBelow();\n return;\n }\n else if (this.settings.openPosition === 'up') {\n this.moveContentAbove();\n return;\n }\n if (this.putContent() === 'up') {\n this.moveContentAbove();\n }\n else {\n this.moveContentBelow();\n }\n }\n searchDiv() {\n const main = document.createElement('div');\n const input = document.createElement('input');\n const addable = document.createElement('div');\n main.classList.add(this.classes.search);\n const searchReturn = {\n main,\n input,\n };\n if (!this.settings.showSearch) {\n main.classList.add(this.classes.hide);\n input.readOnly = true;\n }\n input.type = 'search';\n input.placeholder = this.settings.searchPlaceholder;\n input.tabIndex = -1;\n input.setAttribute('aria-label', this.settings.searchPlaceholder);\n input.setAttribute('autocapitalize', 'off');\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('autocorrect', 'off');\n input.oninput = debounce((e) => {\n this.callbacks.search(e.target.value);\n }, 100);\n input.onkeydown = (e) => {\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowDown':\n e.key === 'ArrowDown' ? this.highlight('down') : this.highlight('up');\n return false;\n case 'Tab':\n this.callbacks.close();\n return true;\n case 'Escape':\n this.callbacks.close();\n return false;\n case 'Enter':\n case ' ':\n if (this.callbacks.addable && e.ctrlKey) {\n addable.click();\n return false;\n }\n else {\n const highlighted = this.content.list.querySelector('.' + this.classes.highlighted);\n if (highlighted) {\n highlighted.click();\n return false;\n }\n }\n return true;\n }\n };\n main.appendChild(input);\n if (this.callbacks.addable) {\n addable.classList.add(this.classes.addable);\n const plus = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n plus.setAttribute('viewBox', '0 0 100 100');\n const plusPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n plusPath.setAttribute('d', this.classes.addablePath);\n plus.appendChild(plusPath);\n addable.appendChild(plus);\n addable.onclick = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (!this.callbacks.addable) {\n return;\n }\n const inputValue = this.content.search.input.value.trim();\n if (inputValue === '') {\n this.content.search.input.focus();\n return;\n }\n const runFinish = (oo) => {\n let newOption = new Option(oo);\n this.callbacks.addOption(newOption);\n if (this.settings.isMultiple) {\n let values = this.store.getSelected();\n values.push(newOption.value);\n this.callbacks.setSelected(values, true);\n }\n else {\n this.callbacks.setSelected([newOption.value], true);\n }\n this.callbacks.search('');\n if (this.settings.closeOnSelect) {\n setTimeout(() => {\n this.callbacks.close();\n }, 100);\n }\n };\n const addableValue = this.callbacks.addable(inputValue);\n if (addableValue === false || addableValue === undefined || addableValue === null) {\n return;\n }\n if (addableValue instanceof Promise) {\n addableValue.then((value) => {\n if (typeof value === 'string') {\n runFinish({\n text: value,\n value: value,\n });\n }\n else {\n runFinish(value);\n }\n });\n }\n else if (typeof addableValue === 'string') {\n runFinish({\n text: addableValue,\n value: addableValue,\n });\n }\n else {\n runFinish(addableValue);\n }\n return;\n };\n main.appendChild(addable);\n searchReturn.addable = {\n main: addable,\n svg: plus,\n path: plusPath,\n };\n }\n return searchReturn;\n }\n searchFocus() {\n this.content.search.input.focus();\n }\n getOptions(notPlaceholder = false, notDisabled = false, notHidden = false) {\n let query = '.' + this.classes.option;\n if (notPlaceholder) {\n query += ':not(.' + this.classes.placeholder + ')';\n }\n if (notDisabled) {\n query += ':not(.' + this.classes.disabled + ')';\n }\n if (notHidden) {\n query += ':not(.' + this.classes.hide + ')';\n }\n return Array.from(this.content.list.querySelectorAll(query));\n }\n highlight(dir) {\n const options = this.getOptions(true, true, true);\n if (options.length === 0) {\n return;\n }\n if (options.length === 1) {\n if (!options[0].classList.contains(this.classes.highlighted)) {\n options[0].classList.add(this.classes.highlighted);\n return;\n }\n }\n for (let i = 0; i < options.length; i++) {\n if (options[i].classList.contains(this.classes.highlighted)) {\n const prevOption = options[i];\n prevOption.classList.remove(this.classes.highlighted);\n const prevParent = prevOption.parentElement;\n if (prevParent && prevParent.classList.contains(this.classes.open)) {\n const optgroupLabel = prevParent.querySelector('.' + this.classes.optgroupLabel);\n if (optgroupLabel) {\n optgroupLabel.click();\n }\n }\n let selectOption = options[dir === 'down' ? (i + 1 < options.length ? i + 1 : 0) : i - 1 >= 0 ? i - 1 : options.length - 1];\n selectOption.classList.add(this.classes.highlighted);\n this.ensureElementInView(this.content.list, selectOption);\n const selectParent = selectOption.parentElement;\n if (selectParent && selectParent.classList.contains(this.classes.close)) {\n const optgroupLabel = selectParent.querySelector('.' + this.classes.optgroupLabel);\n if (optgroupLabel) {\n optgroupLabel.click();\n }\n }\n return;\n }\n }\n options[dir === 'down' ? 0 : options.length - 1].classList.add(this.classes.highlighted);\n this.ensureElementInView(this.content.list, options[dir === 'down' ? 0 : options.length - 1]);\n }\n listDiv() {\n const options = document.createElement('div');\n options.classList.add(this.classes.list);\n return options;\n }\n renderError(error) {\n this.content.list.innerHTML = '';\n const errorDiv = document.createElement('div');\n errorDiv.classList.add(this.classes.error);\n errorDiv.textContent = error;\n this.content.list.appendChild(errorDiv);\n }\n renderSearching() {\n this.content.list.innerHTML = '';\n const searchingDiv = document.createElement('div');\n searchingDiv.classList.add(this.classes.searching);\n searchingDiv.textContent = this.settings.searchingText;\n this.content.list.appendChild(searchingDiv);\n }\n renderOptions(data) {\n this.content.list.innerHTML = '';\n if (data.length === 0) {\n const noResults = document.createElement('div');\n noResults.classList.add(this.classes.search);\n noResults.innerHTML = this.settings.searchText;\n this.content.list.appendChild(noResults);\n return;\n }\n for (const d of data) {\n if (d instanceof Optgroup) {\n const optgroupEl = document.createElement('div');\n optgroupEl.classList.add(this.classes.optgroup);\n const optgroupLabel = document.createElement('div');\n optgroupLabel.classList.add(this.classes.optgroupLabel);\n optgroupEl.appendChild(optgroupLabel);\n const optgroupLabelText = document.createElement('div');\n optgroupLabelText.classList.add(this.classes.optgroupLabelText);\n optgroupLabelText.textContent = d.label;\n optgroupLabel.appendChild(optgroupLabelText);\n const optgroupActions = document.createElement('div');\n optgroupActions.classList.add(this.classes.optgroupActions);\n optgroupLabel.appendChild(optgroupActions);\n if (this.settings.isMultiple && d.selectAll) {\n const selectAll = document.createElement('div');\n selectAll.classList.add(this.classes.optgroupSelectAll);\n let allSelected = true;\n for (const o of d.options) {\n if (!o.selected) {\n allSelected = false;\n break;\n }\n }\n if (allSelected) {\n selectAll.classList.add(this.classes.selected);\n }\n const selectAllText = document.createElement('span');\n selectAllText.textContent = d.selectAllText;\n selectAll.appendChild(selectAllText);\n const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n selectAllSvg.setAttribute('viewBox', '0 0 100 100');\n selectAll.appendChild(selectAllSvg);\n const selectAllBox = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n selectAllBox.setAttribute('d', this.classes.optgroupSelectAllBox);\n selectAllSvg.appendChild(selectAllBox);\n const selectAllCheck = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n selectAllCheck.setAttribute('d', this.classes.optgroupSelectAllCheck);\n selectAllSvg.appendChild(selectAllCheck);\n selectAll.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n const currentSelected = this.store.getSelected();\n if (allSelected) {\n const newSelected = currentSelected.filter((s) => {\n for (const o of d.options) {\n if (s === o.value) {\n return false;\n }\n }\n return true;\n });\n this.callbacks.setSelected(newSelected, true);\n return;\n }\n else {\n const newSelected = currentSelected.concat(d.options.map((o) => o.value));\n for (const o of d.options) {\n if (!this.store.getOptionByID(o.id)) {\n this.callbacks.addOption(o);\n }\n }\n this.callbacks.setSelected(newSelected, true);\n return;\n }\n });\n optgroupActions.appendChild(selectAll);\n }\n if (d.closable !== 'off') {\n const optgroupClosable = document.createElement('div');\n optgroupClosable.classList.add(this.classes.optgroupClosable);\n const optgroupClosableSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n optgroupClosableSvg.setAttribute('viewBox', '0 0 100 100');\n optgroupClosableSvg.classList.add(this.classes.arrow);\n optgroupClosable.appendChild(optgroupClosableSvg);\n const optgroupClosableArrow = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n optgroupClosableSvg.appendChild(optgroupClosableArrow);\n if (d.options.some((o) => o.selected) || this.content.search.input.value.trim() !== '') {\n optgroupClosable.classList.add(this.classes.open);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n }\n else if (d.closable === 'open') {\n optgroupEl.classList.add(this.classes.open);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n }\n else if (d.closable === 'close') {\n optgroupEl.classList.add(this.classes.close);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);\n }\n optgroupLabel.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (optgroupEl.classList.contains(this.classes.close)) {\n optgroupEl.classList.remove(this.classes.close);\n optgroupEl.classList.add(this.classes.open);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n }\n else {\n optgroupEl.classList.remove(this.classes.open);\n optgroupEl.classList.add(this.classes.close);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);\n }\n });\n optgroupActions.appendChild(optgroupClosable);\n }\n optgroupEl.appendChild(optgroupLabel);\n for (const o of d.options) {\n optgroupEl.appendChild(this.option(o));\n }\n this.content.list.appendChild(optgroupEl);\n }\n if (d instanceof Option) {\n this.content.list.appendChild(this.option(d));\n }\n }\n }\n option(option) {\n if (option.placeholder) {\n const placeholder = document.createElement('div');\n placeholder.classList.add(this.classes.option);\n placeholder.classList.add(this.classes.hide);\n return placeholder;\n }\n const optionEl = document.createElement('div');\n optionEl.dataset.id = option.id;\n optionEl.id = option.id;\n optionEl.classList.add(this.classes.option);\n optionEl.setAttribute('role', 'option');\n if (option.class) {\n option.class.split(' ').forEach((dataClass) => {\n optionEl.classList.add(dataClass);\n });\n }\n if (option.style) {\n optionEl.style.cssText = option.style;\n }\n if (this.settings.searchHighlight && this.content.search.input.value.trim() !== '') {\n optionEl.innerHTML = this.highlightText(option.html !== '' ? option.html : option.text, this.content.search.input.value, this.classes.searchHighlighter);\n }\n else if (option.html !== '') {\n optionEl.innerHTML = option.html;\n }\n else {\n optionEl.textContent = option.text;\n }\n if (this.settings.showOptionTooltips && optionEl.textContent) {\n optionEl.setAttribute('title', optionEl.textContent);\n }\n if (!option.display) {\n optionEl.classList.add(this.classes.hide);\n }\n if (option.disabled) {\n optionEl.classList.add(this.classes.disabled);\n }\n if (option.selected && this.settings.hideSelected) {\n optionEl.classList.add(this.classes.hide);\n }\n if (option.selected) {\n optionEl.classList.add(this.classes.selected);\n optionEl.setAttribute('aria-selected', 'true');\n this.main.main.setAttribute('aria-activedescendant', optionEl.id);\n }\n else {\n optionEl.classList.remove(this.classes.selected);\n optionEl.setAttribute('aria-selected', 'false');\n }\n optionEl.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n const selectedOptions = this.store.getSelected();\n const element = e.currentTarget;\n const elementID = String(element.dataset.id);\n if (option.disabled || (option.selected && !this.settings.allowDeselect)) {\n return;\n }\n if ((this.settings.isMultiple && this.settings.maxSelected <= selectedOptions.length && !option.selected) ||\n (this.settings.isMultiple && this.settings.minSelected >= selectedOptions.length && option.selected)) {\n return;\n }\n let shouldUpdate = false;\n const before = this.store.getSelectedOptions();\n let after = [];\n if (this.settings.isMultiple) {\n if (option.selected) {\n after = before.filter((o) => o.id !== elementID);\n }\n else {\n after = before.concat(option);\n }\n }\n if (!this.settings.isMultiple) {\n if (option.selected) {\n after = [];\n }\n else {\n after = [option];\n }\n }\n if (!this.callbacks.beforeChange) {\n shouldUpdate = true;\n }\n if (this.callbacks.beforeChange) {\n if (this.callbacks.beforeChange(after, before) === false) {\n shouldUpdate = false;\n }\n else {\n shouldUpdate = true;\n }\n }\n if (shouldUpdate) {\n if (!this.store.getOptionByID(elementID)) {\n this.callbacks.addOption(option);\n }\n this.callbacks.setSelected(after.map((o) => o.value), false);\n if (this.settings.closeOnSelect) {\n this.callbacks.close();\n }\n if (this.callbacks.afterChange) {\n this.callbacks.afterChange(after);\n }\n }\n });\n return optionEl;\n }\n destroy() {\n this.main.main.remove();\n this.content.main.remove();\n }\n highlightText(str, search, className) {\n let completedString = str;\n const regex = new RegExp('(' + search.trim() + ')(?![^<]*>[^<>]*)', 'i');\n if (!str.match(regex)) {\n return str;\n }\n const matchStartPosition = str.match(regex).index;\n const matchEndPosition = matchStartPosition + str.match(regex)[0].toString().length;\n const originalTextFoundByRegex = str.substring(matchStartPosition, matchEndPosition);\n completedString = completedString.replace(regex, `${originalTextFoundByRegex}`);\n return completedString;\n }\n moveContentAbove() {\n const mainHeight = this.main.main.offsetHeight;\n const contentHeight = this.content.main.offsetHeight;\n this.main.main.classList.remove(this.classes.openBelow);\n this.main.main.classList.add(this.classes.openAbove);\n this.content.main.classList.remove(this.classes.openBelow);\n this.content.main.classList.add(this.classes.openAbove);\n const containerRect = this.main.main.getBoundingClientRect();\n this.content.main.style.margin = '-' + (mainHeight + contentHeight - 1) + 'px 0px 0px 0px';\n this.content.main.style.top = containerRect.top + containerRect.height + window.scrollY + 'px';\n this.content.main.style.left = containerRect.left + window.scrollX + 'px';\n this.content.main.style.width = containerRect.width + 'px';\n }\n moveContentBelow() {\n this.main.main.classList.remove(this.classes.openAbove);\n this.main.main.classList.add(this.classes.openBelow);\n this.content.main.classList.remove(this.classes.openAbove);\n this.content.main.classList.add(this.classes.openBelow);\n const containerRect = this.main.main.getBoundingClientRect();\n this.content.main.style.margin = '-1px 0px 0px 0px';\n if (this.settings.contentPosition !== 'relative') {\n this.content.main.style.top = containerRect.top + containerRect.height + window.scrollY + 'px';\n this.content.main.style.left = containerRect.left + window.scrollX + 'px';\n this.content.main.style.width = containerRect.width + 'px';\n }\n }\n ensureElementInView(container, element) {\n const cTop = container.scrollTop + container.offsetTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n if (eTop < cTop) {\n container.scrollTop -= cTop - eTop;\n }\n else if (eBottom > cBottom) {\n container.scrollTop += eBottom - cBottom;\n }\n }\n putContent() {\n const mainHeight = this.main.main.offsetHeight;\n const mainRect = this.main.main.getBoundingClientRect();\n const contentHeight = this.content.main.offsetHeight;\n const spaceBelow = window.innerHeight - (mainRect.top + mainHeight);\n if (spaceBelow <= contentHeight) {\n if (mainRect.top > contentHeight) {\n return 'up';\n }\n else {\n return 'down';\n }\n }\n return 'down';\n }\n updateDeselectAll() {\n if (!this.store || !this.settings) {\n return;\n }\n const selected = this.store.getSelectedOptions();\n const hasSelectedItems = selected && selected.length > 0;\n const isMultiple = this.settings.isMultiple;\n const allowDeselect = this.settings.allowDeselect;\n const deselectButton = this.main.deselect.main;\n const hideClass = this.classes.hide;\n if (allowDeselect && !(isMultiple && !hasSelectedItems)) {\n deselectButton.classList.remove(hideClass);\n }\n else {\n deselectButton.classList.add(hideClass);\n }\n }\n }\n\n class Select {\n constructor(select) {\n this.listen = false;\n this.observer = null;\n this.select = select;\n this.select.addEventListener('change', this.valueChange.bind(this), {\n passive: true,\n });\n this.observer = new MutationObserver(this.observeCall.bind(this));\n this.changeListen(true);\n }\n enable() {\n this.select.disabled = false;\n }\n disable() {\n this.select.disabled = true;\n }\n hideUI() {\n this.select.tabIndex = -1;\n this.select.style.display = 'none';\n this.select.setAttribute('aria-hidden', 'true');\n }\n showUI() {\n this.select.removeAttribute('tabindex');\n this.select.style.display = '';\n this.select.removeAttribute('aria-hidden');\n }\n changeListen(listen) {\n this.listen = listen;\n if (listen) {\n if (this.observer) {\n this.observer.observe(this.select, {\n subtree: true,\n childList: true,\n attributes: true,\n });\n }\n }\n if (!listen) {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n }\n valueChange(ev) {\n if (this.listen && this.onValueChange) {\n this.onValueChange(this.getSelectedValues());\n }\n return true;\n }\n observeCall(mutations) {\n if (!this.listen) {\n return;\n }\n let classChanged = false;\n let disabledChanged = false;\n let optgroupOptionChanged = false;\n for (const m of mutations) {\n if (m.target === this.select) {\n if (m.attributeName === 'disabled') {\n disabledChanged = true;\n }\n if (m.attributeName === 'class') {\n classChanged = true;\n }\n }\n if (m.target.nodeName === 'OPTGROUP' || m.target.nodeName === 'OPTION') {\n optgroupOptionChanged = true;\n }\n }\n if (classChanged && this.onClassChange) {\n this.onClassChange(this.select.className.split(' '));\n }\n if (disabledChanged && this.onDisabledChange) {\n this.changeListen(false);\n this.onDisabledChange(this.select.disabled);\n this.changeListen(true);\n }\n if (optgroupOptionChanged && this.onOptionsChange) {\n this.changeListen(false);\n this.onOptionsChange(this.getData());\n this.changeListen(true);\n }\n }\n getData() {\n let data = [];\n const nodes = this.select.childNodes;\n for (const n of nodes) {\n if (n.nodeName === 'OPTGROUP') {\n data.push(this.getDataFromOptgroup(n));\n }\n if (n.nodeName === 'OPTION') {\n data.push(this.getDataFromOption(n));\n }\n }\n return data;\n }\n getDataFromOptgroup(optgroup) {\n let data = {\n id: optgroup.id,\n label: optgroup.label,\n selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,\n selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',\n closable: optgroup.dataset ? optgroup.dataset.closable : 'off',\n options: [],\n };\n const options = optgroup.childNodes;\n for (const o of options) {\n if (o.nodeName === 'OPTION') {\n data.options.push(this.getDataFromOption(o));\n }\n }\n return data;\n }\n getDataFromOption(option) {\n return {\n id: option.id,\n value: option.value,\n text: option.text,\n html: option.dataset && option.dataset.html ? option.dataset.html : '',\n selected: option.selected,\n display: option.style.display === 'none' ? false : true,\n disabled: option.disabled,\n mandatory: option.dataset ? option.dataset.mandatory === 'true' : false,\n placeholder: option.dataset.placeholder === 'true',\n class: option.className,\n style: option.style.cssText,\n data: option.dataset,\n };\n }\n getSelectedValues() {\n let values = [];\n const options = this.select.childNodes;\n for (const o of options) {\n if (o.nodeName === 'OPTGROUP') {\n const optgroupOptions = o.childNodes;\n for (const oo of optgroupOptions) {\n if (oo.nodeName === 'OPTION') {\n const option = oo;\n if (option.selected) {\n values.push(option.value);\n }\n }\n }\n }\n if (o.nodeName === 'OPTION') {\n const option = o;\n if (option.selected) {\n values.push(option.value);\n }\n }\n }\n return values;\n }\n setSelected(value) {\n this.changeListen(false);\n const options = this.select.childNodes;\n for (const o of options) {\n if (o.nodeName === 'OPTGROUP') {\n const optgroup = o;\n const optgroupOptions = optgroup.childNodes;\n for (const oo of optgroupOptions) {\n if (oo.nodeName === 'OPTION') {\n const option = oo;\n option.selected = value.includes(option.value);\n }\n }\n }\n if (o.nodeName === 'OPTION') {\n const option = o;\n option.selected = value.includes(option.value);\n }\n }\n this.changeListen(true);\n }\n updateSelect(id, style, classes) {\n this.changeListen(false);\n if (id) {\n this.select.dataset.id = id;\n }\n if (style) {\n this.select.style.cssText = style;\n }\n if (classes) {\n this.select.className = '';\n classes.forEach((c) => {\n if (c.trim() !== '') {\n this.select.classList.add(c.trim());\n }\n });\n }\n this.changeListen(true);\n }\n updateOptions(data) {\n this.changeListen(false);\n this.select.innerHTML = '';\n for (const d of data) {\n if (d instanceof Optgroup) {\n this.select.appendChild(this.createOptgroup(d));\n }\n if (d instanceof Option) {\n this.select.appendChild(this.createOption(d));\n }\n }\n this.select.dispatchEvent(new Event('change'));\n this.changeListen(true);\n }\n createOptgroup(optgroup) {\n const optgroupEl = document.createElement('optgroup');\n optgroupEl.id = optgroup.id;\n optgroupEl.label = optgroup.label;\n if (optgroup.selectAll) {\n optgroupEl.dataset.selectAll = 'true';\n }\n if (optgroup.closable !== 'off') {\n optgroupEl.dataset.closable = optgroup.closable;\n }\n if (optgroup.options) {\n for (const o of optgroup.options) {\n optgroupEl.appendChild(this.createOption(o));\n }\n }\n return optgroupEl;\n }\n createOption(info) {\n const optionEl = document.createElement('option');\n optionEl.id = info.id;\n optionEl.value = info.value;\n optionEl.innerHTML = info.text;\n if (info.html !== '') {\n optionEl.setAttribute('data-html', info.html);\n }\n if (info.selected) {\n optionEl.selected = info.selected;\n }\n if (info.disabled) {\n optionEl.disabled = true;\n }\n if (info.display === false) {\n optionEl.style.display = 'none';\n }\n if (info.placeholder) {\n optionEl.setAttribute('data-placeholder', 'true');\n }\n if (info.mandatory) {\n optionEl.setAttribute('data-mandatory', 'true');\n }\n if (info.class) {\n info.class.split(' ').forEach((optionClass) => {\n optionEl.classList.add(optionClass);\n });\n }\n if (info.data && typeof info.data === 'object') {\n Object.keys(info.data).forEach((key) => {\n optionEl.setAttribute('data-' + kebabCase(key), info.data[key]);\n });\n }\n return optionEl;\n }\n destroy() {\n this.changeListen(false);\n this.select.removeEventListener('change', this.valueChange.bind(this));\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n delete this.select.dataset.id;\n this.showUI();\n }\n }\n\n class SlimSelect {\n constructor(config) {\n var _a;\n this.events = {\n search: undefined,\n searchFilter: (opt, search) => {\n return opt.text.toLowerCase().indexOf(search.toLowerCase()) !== -1;\n },\n addable: undefined,\n beforeChange: undefined,\n afterChange: undefined,\n beforeOpen: undefined,\n afterOpen: undefined,\n beforeClose: undefined,\n afterClose: undefined,\n };\n this.windowResize = debounce(() => {\n if (!this.settings.isOpen && !this.settings.isFullOpen) {\n return;\n }\n this.render.moveContent();\n });\n this.windowScroll = debounce(() => {\n if (!this.settings.isOpen && !this.settings.isFullOpen) {\n return;\n }\n this.render.moveContent();\n });\n this.documentClick = (e) => {\n if (!this.settings.isOpen) {\n return;\n }\n if (e.target && !hasClassInTree(e.target, this.settings.id)) {\n this.close(e.type);\n }\n };\n this.windowVisibilityChange = () => {\n if (document.hidden) {\n this.close();\n }\n };\n this.selectEl = (typeof config.select === 'string' ? document.querySelector(config.select) : config.select);\n if (!this.selectEl) {\n if (config.events && config.events.error) {\n config.events.error(new Error('Could not find select element'));\n }\n return;\n }\n if (this.selectEl.tagName !== 'SELECT') {\n if (config.events && config.events.error) {\n config.events.error(new Error('Element isnt of type select'));\n }\n return;\n }\n if (this.selectEl.dataset.ssid) {\n this.destroy();\n }\n this.settings = new Settings(config.settings);\n const debounceEvents = ['afterChange', 'beforeOpen', 'afterOpen', 'beforeClose', 'afterClose'];\n for (const key in config.events) {\n if (!config.events.hasOwnProperty(key)) {\n continue;\n }\n if (debounceEvents.indexOf(key) !== -1) {\n this.events[key] = debounce(config.events[key], 100);\n }\n else {\n this.events[key] = config.events[key];\n }\n }\n this.settings.disabled = ((_a = config.settings) === null || _a === void 0 ? void 0 : _a.disabled) ? config.settings.disabled : this.selectEl.disabled;\n this.settings.isMultiple = this.selectEl.multiple;\n this.settings.style = this.selectEl.style.cssText;\n this.settings.class = this.selectEl.className.split(' ');\n this.select = new Select(this.selectEl);\n this.select.updateSelect(this.settings.id, this.settings.style, this.settings.class);\n this.select.hideUI();\n this.select.onValueChange = (values) => {\n this.setSelected(values);\n };\n this.select.onClassChange = (classes) => {\n this.settings.class = classes;\n this.render.updateClassStyles();\n };\n this.select.onDisabledChange = (disabled) => {\n if (disabled) {\n this.disable();\n }\n else {\n this.enable();\n }\n };\n this.select.onOptionsChange = (data) => {\n this.setData(data);\n };\n this.store = new Store(this.settings.isMultiple ? 'multiple' : 'single', config.data ? config.data : this.select.getData());\n if (config.data) {\n this.select.updateOptions(this.store.getData());\n }\n const callbacks = {\n open: this.open.bind(this),\n close: this.close.bind(this),\n addable: this.events.addable ? this.events.addable : undefined,\n setSelected: this.setSelected.bind(this),\n addOption: this.addOption.bind(this),\n search: this.search.bind(this),\n beforeChange: this.events.beforeChange,\n afterChange: this.events.afterChange,\n };\n this.render = new Render(this.settings, this.store, callbacks);\n this.render.renderValues();\n this.render.renderOptions(this.store.getData());\n const selectAriaLabel = this.selectEl.getAttribute('aria-label');\n const selectAriaLabelledBy = this.selectEl.getAttribute('aria-labelledby');\n if (selectAriaLabel) {\n this.render.main.main.setAttribute('aria-label', selectAriaLabel);\n }\n else if (selectAriaLabelledBy) {\n this.render.main.main.setAttribute('aria-labelledby', selectAriaLabelledBy);\n }\n if (this.selectEl.parentNode) {\n this.selectEl.parentNode.insertBefore(this.render.main.main, this.selectEl.nextSibling);\n }\n document.addEventListener('click', this.documentClick);\n window.addEventListener('resize', this.windowResize, false);\n if (this.settings.openPosition === 'auto') {\n window.addEventListener('scroll', this.windowScroll, false);\n }\n document.addEventListener('visibilitychange', this.windowVisibilityChange);\n if (this.settings.disabled) {\n this.disable();\n }\n if (this.settings.alwaysOpen) {\n this.open();\n }\n this.selectEl.slim = this;\n }\n enable() {\n this.settings.disabled = false;\n this.select.enable();\n this.render.enable();\n }\n disable() {\n this.settings.disabled = true;\n this.select.disable();\n this.render.disable();\n }\n getData() {\n return this.store.getData();\n }\n setData(data) {\n const selected = this.store.getSelected();\n const err = this.store.validateDataArray(data);\n if (err) {\n if (this.events.error) {\n this.events.error(err);\n }\n return;\n }\n this.store.setData(data);\n const dataClean = this.store.getData();\n this.select.updateOptions(dataClean);\n this.render.renderValues();\n this.render.renderOptions(dataClean);\n if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n this.events.afterChange(this.store.getSelectedOptions());\n }\n }\n getSelected() {\n return this.store.getSelected();\n }\n setSelected(value, runAfterChange = true) {\n const selected = this.store.getSelected();\n this.store.setSelectedBy('value', Array.isArray(value) ? value : [value]);\n const data = this.store.getData();\n this.select.updateOptions(data);\n this.render.renderValues();\n if (this.render.content.search.input.value !== '') {\n this.search(this.render.content.search.input.value);\n }\n else {\n this.render.renderOptions(data);\n }\n if (runAfterChange && this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n this.events.afterChange(this.store.getSelectedOptions());\n }\n }\n addOption(option) {\n const selected = this.store.getSelected();\n if (!this.store.getDataOptions().some((o) => { var _a; return o.value === ((_a = option.value) !== null && _a !== void 0 ? _a : option.text); })) {\n this.store.addOption(option);\n }\n const data = this.store.getData();\n this.select.updateOptions(data);\n this.render.renderValues();\n this.render.renderOptions(data);\n if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n this.events.afterChange(this.store.getSelectedOptions());\n }\n }\n open() {\n if (this.settings.disabled || this.settings.isOpen) {\n return;\n }\n if (this.events.beforeOpen) {\n this.events.beforeOpen();\n }\n this.render.open();\n if (this.settings.showSearch) {\n this.render.searchFocus();\n }\n this.settings.isOpen = true;\n setTimeout(() => {\n if (this.events.afterOpen) {\n this.events.afterOpen();\n }\n if (this.settings.isOpen) {\n this.settings.isFullOpen = true;\n }\n }, this.settings.timeoutDelay);\n if (this.settings.contentPosition === 'absolute') {\n if (this.settings.intervalMove) {\n clearInterval(this.settings.intervalMove);\n }\n this.settings.intervalMove = setInterval(this.render.moveContent.bind(this.render), 500);\n }\n }\n close(eventType = null) {\n if (!this.settings.isOpen || this.settings.alwaysOpen) {\n return;\n }\n if (this.events.beforeClose) {\n this.events.beforeClose();\n }\n this.render.close();\n if (this.render.content.search.input.value !== '') {\n this.search('');\n }\n this.render.mainFocus(eventType);\n this.settings.isOpen = false;\n this.settings.isFullOpen = false;\n setTimeout(() => {\n if (this.events.afterClose) {\n this.events.afterClose();\n }\n }, this.settings.timeoutDelay);\n if (this.settings.intervalMove) {\n clearInterval(this.settings.intervalMove);\n }\n }\n search(value) {\n if (this.render.content.search.input.value !== value) {\n this.render.content.search.input.value = value;\n }\n if (!this.events.search) {\n this.render.renderOptions(value === '' ? this.store.getData() : this.store.search(value, this.events.searchFilter));\n return;\n }\n this.render.renderSearching();\n const searchResp = this.events.search(value, this.store.getSelectedOptions());\n if (searchResp instanceof Promise) {\n searchResp\n .then((data) => {\n this.render.renderOptions(this.store.partialToFullData(data));\n })\n .catch((err) => {\n this.render.renderError(typeof err === 'string' ? err : err.message);\n });\n return;\n }\n else if (Array.isArray(searchResp)) {\n this.render.renderOptions(this.store.partialToFullData(searchResp));\n }\n else {\n this.render.renderError('Search event must return a promise or an array of data');\n }\n }\n destroy() {\n document.removeEventListener('click', this.documentClick);\n window.removeEventListener('resize', this.windowResize, false);\n if (this.settings.openPosition === 'auto') {\n window.removeEventListener('scroll', this.windowScroll, false);\n }\n document.removeEventListener('visibilitychange', this.windowVisibilityChange);\n this.store.setData([]);\n this.render.destroy();\n this.select.destroy();\n }\n }\n\n return SlimSelect;\n\n}));\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n if (reducer(descriptor, name, obj) !== false) {\n reducedDescriptors[name] = descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _inherits;\nvar _setPrototypeOf = _interopRequireDefault(require(\"./_set_prototype_of\"));\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) (0, _setPrototypeOf).default(subClass, superClass);\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _createSuper;\nvar _isNativeReflectConstruct = _interopRequireDefault(require(\"./_is_native_reflect_construct\"));\nvar _getPrototypeOf = _interopRequireDefault(require(\"./_get_prototype_of\"));\nvar _possibleConstructorReturn = _interopRequireDefault(require(\"./_possible_constructor_return\"));\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = (0, _isNativeReflectConstruct).default();\n return function _createSuperInternal() {\n var Super = (0, _getPrototypeOf).default(Derived), result;\n if (hasNativeReflectConstruct) {\n var NewTarget = (0, _getPrototypeOf).default(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return (0, _possibleConstructorReturn).default(this, result);\n };\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst isStandardBrowserEnv = (() => {\n let product;\n if (typeof navigator !== 'undefined' && (\n (product = navigator.product) === 'ReactNative' ||\n product === 'NativeScript' ||\n product === 'NS')\n ) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n})();\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\n const isStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n isStandardBrowserEnv,\n isStandardBrowserWebWorkerEnv,\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\nconst DEFAULT_CONTENT_TYPE = {\n 'Content-Type': undefined\n};\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n if (!hasJSONContentType) {\n return data;\n }\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nexport default defaults;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _slicedToArray;\nvar _arrayWithHoles = _interopRequireDefault(require(\"./_array_with_holes\"));\nvar _iterableToArray = _interopRequireDefault(require(\"./_iterable_to_array\"));\nvar _nonIterableRest = _interopRequireDefault(require(\"./_non_iterable_rest\"));\nvar _unsupportedIterableToArray = _interopRequireDefault(require(\"./_unsupported_iterable_to_array\"));\nfunction _slicedToArray(arr, i) {\n return (0, _arrayWithHoles).default(arr) || (0, _iterableToArray).default(arr, i) || (0, _unsupportedIterableToArray).default(arr, i) || (0, _nonIterableRest).default();\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _toConsumableArray;\nvar _arrayWithoutHoles = _interopRequireDefault(require(\"./_array_without_holes\"));\nvar _iterableToArray = _interopRequireDefault(require(\"./_iterable_to_array\"));\nvar _nonIterableSpread = _interopRequireDefault(require(\"./_non_iterable_spread\"));\nvar _unsupportedIterableToArray = _interopRequireDefault(require(\"./_unsupported_iterable_to_array\"));\nfunction _toConsumableArray(arr) {\n return (0, _arrayWithoutHoles).default(arr) || (0, _iterableToArray).default(arr) || (0, _unsupportedIterableToArray).default(arr) || (0, _nonIterableSpread).default();\n}\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\nutils.freezeMethods(AxiosHeaders.prototype);\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.isStandardBrowserEnv ?\n\n// Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n const cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n// Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })();\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.isStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n const responseType = config.responseType;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else {\n requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (platform.isStandardBrowserEnv) {\n // Add xsrf header\n const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))\n && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if(fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {\n break;\n }\n }\n\n if (!adapter) {\n if (adapter === false) {\n throw new AxiosError(\n `Adapter ${nameOrAdapter} is not supported by the environment`,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n throw new Error(\n utils.hasOwnProp(knownAdapters, nameOrAdapter) ?\n `Adapter '${nameOrAdapter}' is not available in the build` :\n `Unknown adapter '${nameOrAdapter}'`\n );\n }\n\n if (!utils.isFunction(adapter)) {\n throw new TypeError('adapter is not a function');\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","export const VERSION = \"1.4.0\";","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n let contextHeaders;\n\n // Flatten headers\n contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n contextHeaders && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n mergeConfig\n}\n","import Notiflix from 'notiflix';\nimport SlimSelect from 'slim-select';\n\nimport {\n createMarkupOptions,\n createMarkupCatShow,\n} from '../templates/functions.js';\nimport { fetchBreeds, fetchCatByBreed } from '../js/cat-api.js';\n\nconst BASE_URL = 'https://api.thecatapi.com/v1';\nconst END_POINT = '/breeds';\nconst API_KEY =\n 'live_NqCT8Nwkxuj6edZ1OwQGKuojQMkYLWj7L4oQ3fZLryh0xj2BQo0SHp9dUXgOOBta';\nconst wholeURL = BASE_URL + END_POINT + '?api_key=' + API_KEY;\n\nconst selectBreed = document.getElementById('selectBreed');\nconst loaderItem = document.querySelector('.loader');\nconst divInfoCat = document.querySelector('div.cat-info');\nconst sectionLoad = document.querySelector('.section-load');\n\n//витягуємо дані про котиків із сервера\nfetchBreeds(wholeURL).then(renderData).catch(errorfetchData);\n\nfunction renderData(dataCat) {\n const markup = createMarkupOptions(dataCat);\n selectBreed.innerHTML = markup;\n\n loaderItem.hidden = true;\n selectBreed.hidden = false;\n sectionLoad.hidden = true;\n\n new SlimSelect({\n select: '#selectBreed',\n });\n}\n\nfunction errorfetchData() {\n loaderItem.hidden = true;\n}\n\n//слідкуємо за тим, яку породу користувач вибрав\nselectBreed.addEventListener('change', showInfoBreed);\n\nfunction showInfoBreed(e) {\n fetchCatByBreed(e.target.value).then(showCat).catch(errorGetInfoCat);\n}\n\nfunction showCat(infoCat) {\n divInfoCat.innerHTML = '';\n const markup = createMarkupCatShow(infoCat);\n console.log(markup);\n divInfoCat.innerHTML = markup;\n console.log(divInfoCat);\n}\n\nNotiflix.Notify.init({\n width: '480px',\n position: 'left-top',\n distance: '90px',\n opacity: 1,\n fontSize: '20px',\n clickToClose: true,\n timeout: 1000,\n // ...\n});\n\nfunction errorGetInfoCat(error) {\n Notiflix.Notify.failure('Немає інформації по цьому котику!');\n}\n","import axios from 'axios';\n\nconst BASE_URL = 'https://api.thecatapi.com/v1';\nconst API_KEY = 'live_NqCT8Nwkxuj6edZ1OwQGKuojQMkYLWj7L4oQ3fZLryh0xj2BQo0SHp9dUXgOOBta';\n\nexport function fetchBreeds(URL) {\n return axios.get(URL).then(result => {\n return result.data;\n });\n}\n\nexport function fetchCatByBreed(breedId) {\n console.log(breedId);\n return axios\n .get(`${BASE_URL}/images/search?api_key=${API_KEY}&breed_ids=${breedId}`)\n .then(result => {\n return result.data[0];\n });\n}\n","//ф-ція приймає масив даних котиків та малює розмітку\n//для поля select зі списком порід котів\nexport function createMarkupOptions(arr) {\n return arr\n .map(elem => ``)\n .join();\n}\n\nexport function createMarkupCatShow(array) {\n const markup = ` \n
- Albert Einstein\":e===c.Failure?n=\"\\\"Failure is simply the opportunity to begin again, this time more intelligently.\\\"
- Henry Ford\":e===c.Warning?n=\"\\\"The peoples who want to live comfortably without producing and fatigue; they are doomed to lose their dignity, then liberty, and then independence and destiny.\\\"
- Mustafa Kemal Ataturk\":e===c.Info&&(n=\"\\\"Knowledge rests not upon truth alone, but upon error also.\\\"
- Carl Gustav Jung\")),\"string\"!=typeof o&&(o=\"Okay\"),i.plainText&&(a=N(a),n=N(n),o=N(o)),i.plainText||(a.length>i.titleMaxLength&&(a=\"Possible HTML Tags Error\",n=\"The \\\"plainText\\\" option is \\\"false\\\" and the title content length is more than the \\\"titleMaxLength\\\" option.\",o=\"Okay\"),n.length>i.messageMaxLength&&(a=\"Possible HTML Tags Error\",n=\"The \\\"plainText\\\" option is \\\"false\\\" and the message content length is more than the \\\"messageMaxLength\\\" option.\",o=\"Okay\"),o.length>i.buttonMaxLength&&(a=\"Possible HTML Tags Error\",n=\"The \\\"plainText\\\" option is \\\"false\\\" and the button content length is more than the \\\"buttonMaxLength\\\" option.\",o=\"Okay\")),a.length>i.titleMaxLength&&(a=a.substring(0,i.titleMaxLength)+\"...\"),n.length>i.messageMaxLength&&(n=n.substring(0,i.messageMaxLength)+\"...\"),o.length>i.buttonMaxLength&&(o=o.substring(0,i.buttonMaxLength)+\"...\"),i.cssAnimation||(i.cssAnimationDuration=0);var x=t.document.createElement(\"div\");x.id=p.ID,x.className=i.className,x.style.zIndex=i.zindex,x.style.borderRadius=i.borderRadius,x.style.fontFamily=\"\\\"\"+i.fontFamily+\"\\\", \"+s,i.rtl&&(x.setAttribute(\"dir\",\"rtl\"),x.classList.add(\"nx-rtl-on\")),x.style.display=\"flex\",x.style.flexWrap=\"wrap\",x.style.flexDirection=\"column\",x.style.alignItems=\"center\",x.style.justifyContent=\"center\";var g=\"\",b=!0===i.backOverlayClickToClose;i.backOverlay&&(g=\"\");var u=\"\";if(e===c.Success?u=C(i.svgSize,d.svgColor):e===c.Failure?u=z(i.svgSize,d.svgColor):e===c.Warning?u=S(i.svgSize,d.svgColor):e===c.Info&&(u=L(i.svgSize,d.svgColor)),x.innerHTML=g+\"
\",h=t.document.createElement(\"div\");if(h.id=g.ID,h.className=n.className+(n.cssAnimation?\" nx-with-animation\":\"\")+(n.clickToClose?\" nx-loading-click-to-close\":\"\"),h.style.zIndex=n.zindex,h.style.background=n.backgroundColor,h.style.animationDuration=n.cssAnimationDuration+\"ms\",h.style.fontFamily=\"\\\"\"+n.fontFamily+\"\\\", \"+s,h.style.display=\"flex\",h.style.flexWrap=\"wrap\",h.style.flexDirection=\"column\",h.style.alignItems=\"center\",h.style.justifyContent=\"center\",n.rtl&&(h.setAttribute(\"dir\",\"rtl\"),h.classList.add(\"nx-rtl-on\")),h.innerHTML=k+p,!t.document.getElementById(h.id)&&(t.document.body.appendChild(h),n.clickToClose)){var C=t.document.getElementById(h.id);C.addEventListener(\"click\",function(){h.classList.add(\"nx-remove\");var t=setTimeout(function(){null!==h.parentNode&&(h.parentNode.removeChild(h),clearTimeout(t))},n.cssAnimationDuration)})}}else if(t.document.getElementById(g.ID))var z=t.document.getElementById(g.ID),S=setTimeout(function(){z.classList.add(\"nx-remove\");var t=setTimeout(function(){null!==z.parentNode&&(z.parentNode.removeChild(z),clearTimeout(t))},n.cssAnimationDuration);clearTimeout(S)},r);n=v(!0,n,l)},V=function(e){\"string\"!=typeof e&&(e=\"\");var i=t.document.getElementById(g.ID);if(i)if(0n.messageMaxLength?N(e).substring(0,n.messageMaxLength)+\"...\":N(e);var a=i.getElementsByTagName(\"p\")[0];if(a)a.innerHTML=e;else{var o=t.document.createElement(\"p\");o.id=n.messageID,o.className=\"nx-loading-message nx-loading-message-new\",o.style.color=n.messageColor,o.style.fontSize=n.messageFontSize,o.innerHTML=e,i.appendChild(o)}}else y(\"Where is the new message?\")},q=function(){return\"[id^=NotiflixBlockWrap]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1000;font-family:\\\"Quicksand\\\",-apple-system,BlinkMacSystemFont,\\\"Segoe UI\\\",Roboto,\\\"Helvetica Neue\\\",Arial,sans-serif;background:rgba(255,255,255,.9);text-align:center;animation-duration:.4s;width:100%;height:100%;left:0;top:0;border-radius:inherit;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}[id^=NotiflixBlockWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixBlockWrap]>span[class*=\\\"-icon\\\"]{display:block;width:45px;height:45px;position:relative;margin:0 auto}[id^=NotiflixBlockWrap]>span[class*=\\\"-icon\\\"] svg{width:inherit;height:inherit}[id^=NotiflixBlockWrap]>span[class*=\\\"-message\\\"]{position:relative;display:block;width:100%;margin:10px auto 0;padding:0 10px;font-family:inherit!important;font-weight:normal;font-size:14px;line-height:1.4}[id^=NotiflixBlockWrap].nx-with-animation{-webkit-animation:block-animation-fade .3s ease-in-out 0s normal;animation:block-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixBlockWrap].nx-with-animation.nx-remove{opacity:0;-webkit-animation:block-animation-fade-remove .3s ease-in-out 0s normal;animation:block-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}\"},Q=0,Y=function(e,i,a,n,r,l){var m;if(Array.isArray(a)){if(1>a.length)return y(\"Array of HTMLElements should contains at least one HTMLElement.\"),!1;m=a}else if(Object.prototype.isPrototypeOf.call(NodeList.prototype,a)){if(1>a.length)return y(\"NodeListOf should contains at least one HTMLElement.\"),!1;m=Array.prototype.slice.call(a)}else{var c=\"string\"!=typeof a||1>(a||\"\").length||1===(a||\"\").length&&(\"#\"===(a||\"\")[0]||\".\"===(a||\"\")[0]);if(c)return y(\"The selector parameter must be a string and matches a specified CSS selector(s).\"),!1;var p=t.document.querySelectorAll(a);if(1>p.length)return y(\"You called the \\\"Notiflix.Block...\\\" function with \\\"\"+a+\"\\\" selector, but there is no such element(s) in the document.\"),!1;m=p}o||G.Block.init({});var f=v(!0,o,{});if(\"object\"==typeof n&&!Array.isArray(n)||\"object\"==typeof r&&!Array.isArray(r)){var d={};\"object\"==typeof n?d=n:\"object\"==typeof r&&(d=r),o=v(!0,o,d)}var x=\"\";\"string\"==typeof n&&0=h?h:m.length,z=\"nx-block-temporary-position\";if(e){for(var S,L=[\"area\",\"base\",\"br\",\"col\",\"command\",\"embed\",\"hr\",\"img\",\"input\",\"keygen\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\",\"html\",\"head\",\"title\",\"script\",\"style\",\"iframe\"],X=0;XD.length){var T=\"\";i&&(i===b.Hourglass?T=I(o.svgSize,o.svgColor):i===b.Circle?T=R(o.svgSize,o.svgColor):i===b.Arrows?T=A(o.svgSize,o.svgColor):i===b.Dots?T=M(o.svgSize,o.svgColor):i===b.Pulse?T=B(o.svgSize,o.svgColor):T=W(o.svgSize,o.svgColor));var F=\"\"+T+\"\",E=\"\";0o.messageMaxLength?N(x).substring(0,o.messageMaxLength)+\"...\":N(x),E=\"\"+x+\"\"),Q++;var j=t.document.createElement(\"div\");j.id=u.ID+\"-\"+Q,j.className=g+(o.cssAnimation?\" nx-with-animation\":\"\"),j.style.position=o.position,j.style.zIndex=o.zindex,j.style.background=o.backgroundColor,j.style.animationDuration=o.cssAnimationDuration+\"ms\",j.style.fontFamily=\"\\\"\"+o.fontFamily+\"\\\", \"+s,j.style.display=\"flex\",j.style.flexWrap=\"wrap\",j.style.flexDirection=\"column\",j.style.alignItems=\"center\",j.style.justifyContent=\"center\",o.rtl&&(j.setAttribute(\"dir\",\"rtl\"),j.classList.add(\"nx-rtl-on\")),j.innerHTML=F+E;var O=t.getComputedStyle(S).getPropertyValue(\"position\"),H=\"string\"==typeof O?O.toLocaleLowerCase(\"en\"):\"relative\",P=Math.round(1.25*parseInt(o.svgSize))+40,U=S.offsetHeight||0,V=\"\";P>U&&(V=\"min-height:\"+P+\"px;\");var q=\"\";q=S.getAttribute(\"id\")?\"#\"+S.getAttribute(\"id\"):S.classList[0]?\".\"+S.classList[0]:(S.tagName||\"\").toLocaleLowerCase(\"en\");var Y=\"\",K=-1>=[\"absolute\",\"relative\",\"fixed\",\"sticky\"].indexOf(H);if(K||0\"+q+\".\"+z+\"{\"+Y+V+\"}\",J=t.document.createRange();J.selectNode(t.document.head);var Z=J.createContextualFragment($);t.document.head.appendChild(Z),S.classList.add(z)}S.appendChild(j)}}}else var _=function(e){var i=setTimeout(function(){null!==e.parentNode&&e.parentNode.removeChild(e);var a=e.getAttribute(\"id\"),n=t.document.getElementById(\"Style-\"+a);n&&null!==n.parentNode&&n.parentNode.removeChild(n),clearTimeout(i)},o.cssAnimationDuration)},tt=function(t){if(t&&0\\\" or \\\"NodeListOf\\\" does not have a \\\"Block\\\" element to remove.\")},et=function(t){var e=setTimeout(function(){t.classList.remove(z),clearTimeout(e)},o.cssAnimationDuration+300)},it=setTimeout(function(){for(var t,e=0;e {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n function isEqual(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n }\n function kebabCase(str) {\n const result = str.replace(/[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g, (match) => '-' + match.toLowerCase());\n return str[0] === str[0].toUpperCase() ? result.substring(1) : result;\n }\n\n class Settings {\n constructor(settings) {\n this.id = '';\n this.style = '';\n this.class = [];\n this.isMultiple = false;\n this.isOpen = false;\n this.isFullOpen = false;\n this.intervalMove = null;\n if (!settings) {\n settings = {};\n }\n this.id = 'ss-' + generateID();\n this.style = settings.style || '';\n this.class = settings.class || [];\n this.disabled = settings.disabled !== undefined ? settings.disabled : false;\n this.alwaysOpen = settings.alwaysOpen !== undefined ? settings.alwaysOpen : false;\n this.showSearch = settings.showSearch !== undefined ? settings.showSearch : true;\n this.searchPlaceholder = settings.searchPlaceholder || 'Search';\n this.searchText = settings.searchText || 'No Results';\n this.searchingText = settings.searchingText || 'Searching...';\n this.searchHighlight = settings.searchHighlight !== undefined ? settings.searchHighlight : false;\n this.closeOnSelect = settings.closeOnSelect !== undefined ? settings.closeOnSelect : true;\n this.contentLocation = settings.contentLocation || document.body;\n this.contentPosition = settings.contentPosition || 'absolute';\n this.openPosition = settings.openPosition || 'auto';\n this.placeholderText = settings.placeholderText !== undefined ? settings.placeholderText : 'Select Value';\n this.allowDeselect = settings.allowDeselect !== undefined ? settings.allowDeselect : false;\n this.hideSelected = settings.hideSelected !== undefined ? settings.hideSelected : false;\n this.showOptionTooltips = settings.showOptionTooltips !== undefined ? settings.showOptionTooltips : false;\n this.minSelected = settings.minSelected || 0;\n this.maxSelected = settings.maxSelected || 1000;\n this.timeoutDelay = settings.timeoutDelay || 200;\n this.maxValuesShown = settings.maxValuesShown || 20;\n this.maxValuesMessage = settings.maxValuesMessage || '{number} selected';\n }\n }\n\n class Optgroup {\n constructor(optgroup) {\n this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;\n this.label = optgroup.label || '';\n this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;\n this.selectAllText = optgroup.selectAllText || 'Select All';\n this.closable = optgroup.closable || 'off';\n this.options = [];\n if (optgroup.options) {\n for (const o of optgroup.options) {\n this.options.push(new Option(o));\n }\n }\n }\n }\n class Option {\n constructor(option) {\n this.id = !option.id || option.id === '' ? generateID() : option.id;\n this.value = option.value === undefined ? option.text : option.value;\n this.text = option.text || '';\n this.html = option.html || '';\n this.selected = option.selected !== undefined ? option.selected : false;\n this.display = option.display !== undefined ? option.display : true;\n this.disabled = option.disabled !== undefined ? option.disabled : false;\n this.mandatory = option.mandatory !== undefined ? option.mandatory : false;\n this.placeholder = option.placeholder !== undefined ? option.placeholder : false;\n this.class = option.class || '';\n this.style = option.style || '';\n this.data = option.data || {};\n }\n }\n class Store {\n constructor(type, data) {\n this.selectType = 'single';\n this.data = [];\n this.selectType = type;\n this.setData(data);\n }\n validateDataArray(data) {\n if (!Array.isArray(data)) {\n return new Error('Data must be an array');\n }\n for (let dataObj of data) {\n if (dataObj instanceof Optgroup || 'label' in dataObj) {\n if (!('label' in dataObj)) {\n return new Error('Optgroup must have a label');\n }\n if ('options' in dataObj && dataObj.options) {\n for (let option of dataObj.options) {\n return this.validateOption(option);\n }\n }\n }\n else if (dataObj instanceof Option || 'text' in dataObj) {\n return this.validateOption(dataObj);\n }\n else {\n return new Error('Data object must be a valid optgroup or option');\n }\n }\n return null;\n }\n validateOption(option) {\n if (!('text' in option)) {\n return new Error('Option must have a text');\n }\n return null;\n }\n partialToFullData(data) {\n let dataFinal = [];\n data.forEach((dataObj) => {\n if (dataObj instanceof Optgroup || 'label' in dataObj) {\n let optOptions = [];\n if ('options' in dataObj && dataObj.options) {\n dataObj.options.forEach((option) => {\n optOptions.push(new Option(option));\n });\n }\n if (optOptions.length > 0) {\n dataFinal.push(new Optgroup(dataObj));\n }\n }\n if (dataObj instanceof Option || 'text' in dataObj) {\n dataFinal.push(new Option(dataObj));\n }\n });\n return dataFinal;\n }\n setData(data) {\n this.data = this.partialToFullData(data);\n if (this.selectType === 'single') {\n this.setSelectedBy('value', this.getSelected());\n }\n }\n getData() {\n return this.filter(null, true);\n }\n getDataOptions() {\n return this.filter(null, false);\n }\n addOption(option) {\n this.setData(this.getData().concat(new Option(option)));\n }\n setSelectedBy(selectedType, selectedValues) {\n let firstOption = null;\n let hasSelected = false;\n for (let dataObj of this.data) {\n if (dataObj instanceof Optgroup) {\n for (let option of dataObj.options) {\n if (!firstOption) {\n firstOption = option;\n }\n option.selected = hasSelected ? false : selectedValues.includes(option[selectedType]);\n if (option.selected && this.selectType === 'single') {\n hasSelected = true;\n }\n }\n }\n if (dataObj instanceof Option) {\n if (!firstOption) {\n firstOption = dataObj;\n }\n dataObj.selected = hasSelected ? false : selectedValues.includes(dataObj[selectedType]);\n if (dataObj.selected && this.selectType === 'single') {\n hasSelected = true;\n }\n }\n }\n if (this.selectType === 'single' && firstOption && !hasSelected) {\n firstOption.selected = true;\n }\n }\n getSelected() {\n let selectedOptions = this.getSelectedOptions();\n let selectedValues = [];\n selectedOptions.forEach((option) => {\n selectedValues.push(option.value);\n });\n return selectedValues;\n }\n getSelectedOptions() {\n return this.filter((opt) => {\n return opt.selected;\n }, false);\n }\n getSelectedIDs() {\n let selectedOptions = this.getSelectedOptions();\n let selectedIDs = [];\n selectedOptions.forEach((op) => {\n selectedIDs.push(op.id);\n });\n return selectedIDs;\n }\n getOptgroupByID(id) {\n for (let dataObj of this.data) {\n if (dataObj instanceof Optgroup && dataObj.id === id) {\n return dataObj;\n }\n }\n return null;\n }\n getOptionByID(id) {\n let options = this.filter((opt) => {\n return opt.id === id;\n }, false);\n return options.length ? options[0] : null;\n }\n search(search, searchFilter) {\n search = search.trim();\n if (search === '') {\n return this.getData();\n }\n return this.filter((opt) => {\n return searchFilter(opt, search);\n }, true);\n }\n filter(filter, includeOptgroup) {\n const dataSearch = [];\n this.data.forEach((dataObj) => {\n if (dataObj instanceof Optgroup) {\n let optOptions = [];\n dataObj.options.forEach((option) => {\n if (!filter || filter(option)) {\n if (!includeOptgroup) {\n dataSearch.push(new Option(option));\n }\n else {\n optOptions.push(new Option(option));\n }\n }\n });\n if (optOptions.length > 0) {\n let optgroup = new Optgroup(dataObj);\n optgroup.options = optOptions;\n dataSearch.push(optgroup);\n }\n }\n if (dataObj instanceof Option) {\n if (!filter || filter(dataObj)) {\n dataSearch.push(new Option(dataObj));\n }\n }\n });\n return dataSearch;\n }\n getSelectType() {\n return this.selectType;\n }\n }\n\n class Render {\n constructor(settings, store, callbacks) {\n this.classes = {\n main: 'ss-main',\n placeholder: 'ss-placeholder',\n values: 'ss-values',\n single: 'ss-single',\n max: 'ss-max',\n value: 'ss-value',\n valueText: 'ss-value-text',\n valueDelete: 'ss-value-delete',\n valueOut: 'ss-value-out',\n deselect: 'ss-deselect',\n deselectPath: 'M10,10 L90,90 M10,90 L90,10',\n arrow: 'ss-arrow',\n arrowClose: 'M10,30 L50,70 L90,30',\n arrowOpen: 'M10,70 L50,30 L90,70',\n content: 'ss-content',\n openAbove: 'ss-open-above',\n openBelow: 'ss-open-below',\n search: 'ss-search',\n searchHighlighter: 'ss-search-highlight',\n searching: 'ss-searching',\n addable: 'ss-addable',\n addablePath: 'M50,10 L50,90 M10,50 L90,50',\n list: 'ss-list',\n optgroup: 'ss-optgroup',\n optgroupLabel: 'ss-optgroup-label',\n optgroupLabelText: 'ss-optgroup-label-text',\n optgroupActions: 'ss-optgroup-actions',\n optgroupSelectAll: 'ss-selectall',\n optgroupSelectAllBox: 'M60,10 L10,10 L10,90 L90,90 L90,50',\n optgroupSelectAllCheck: 'M30,45 L50,70 L90,10',\n optgroupClosable: 'ss-closable',\n option: 'ss-option',\n optionDelete: 'M10,10 L90,90 M10,90 L90,10',\n highlighted: 'ss-highlighted',\n open: 'ss-open',\n close: 'ss-close',\n selected: 'ss-selected',\n error: 'ss-error',\n disabled: 'ss-disabled',\n hide: 'ss-hide',\n };\n this.store = store;\n this.settings = settings;\n this.callbacks = callbacks;\n this.main = this.mainDiv();\n this.content = this.contentDiv();\n this.updateClassStyles();\n this.updateAriaAttributes();\n this.settings.contentLocation.appendChild(this.content.main);\n }\n enable() {\n this.main.main.classList.remove(this.classes.disabled);\n this.content.search.input.disabled = false;\n }\n disable() {\n this.main.main.classList.add(this.classes.disabled);\n this.content.search.input.disabled = true;\n }\n open() {\n this.main.arrow.path.setAttribute('d', this.classes.arrowOpen);\n this.main.main.classList.add(this.settings.openPosition === 'up' ? this.classes.openAbove : this.classes.openBelow);\n this.main.main.setAttribute('aria-expanded', 'true');\n this.moveContent();\n const selectedOptions = this.store.getSelectedOptions();\n if (selectedOptions.length) {\n const selectedId = selectedOptions[selectedOptions.length - 1].id;\n const selectedOption = this.content.list.querySelector('[data-id=\"' + selectedId + '\"]');\n if (selectedOption) {\n this.ensureElementInView(this.content.list, selectedOption);\n }\n }\n }\n close() {\n this.main.main.classList.remove(this.classes.openAbove);\n this.main.main.classList.remove(this.classes.openBelow);\n this.main.main.setAttribute('aria-expanded', 'false');\n this.content.main.classList.remove(this.classes.openAbove);\n this.content.main.classList.remove(this.classes.openBelow);\n this.main.arrow.path.setAttribute('d', this.classes.arrowClose);\n }\n updateClassStyles() {\n this.main.main.className = '';\n this.main.main.removeAttribute('style');\n this.content.main.className = '';\n this.content.main.removeAttribute('style');\n this.main.main.classList.add(this.classes.main);\n this.content.main.classList.add(this.classes.content);\n if (this.settings.style !== '') {\n this.main.main.style.cssText = this.settings.style;\n this.content.main.style.cssText = this.settings.style;\n }\n if (this.settings.class.length) {\n for (const c of this.settings.class) {\n if (c.trim() !== '') {\n this.main.main.classList.add(c.trim());\n this.content.main.classList.add(c.trim());\n }\n }\n }\n if (this.settings.contentPosition === 'relative') {\n this.content.main.classList.add('ss-' + this.settings.contentPosition);\n }\n }\n updateAriaAttributes() {\n this.main.main.role = 'combobox';\n this.main.main.setAttribute('aria-haspopup', 'listbox');\n this.main.main.setAttribute('aria-controls', this.content.main.id);\n this.main.main.setAttribute('aria-expanded', 'false');\n this.content.main.setAttribute('role', 'listbox');\n }\n mainDiv() {\n var _a;\n const main = document.createElement('div');\n main.dataset.id = this.settings.id;\n main.id = this.settings.id;\n main.tabIndex = 0;\n main.onkeydown = (e) => {\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowDown':\n this.callbacks.open();\n e.key === 'ArrowDown' ? this.highlight('down') : this.highlight('up');\n return false;\n case 'Tab':\n this.callbacks.close();\n return true;\n case 'Enter':\n case ' ':\n this.callbacks.open();\n const highlighted = this.content.list.querySelector('.' + this.classes.highlighted);\n if (highlighted) {\n highlighted.click();\n }\n return false;\n case 'Escape':\n this.callbacks.close();\n return false;\n }\n };\n main.onclick = (e) => {\n if (this.settings.disabled) {\n return;\n }\n this.settings.isOpen ? this.callbacks.close() : this.callbacks.open();\n };\n const values = document.createElement('div');\n values.classList.add(this.classes.values);\n main.appendChild(values);\n const deselect = document.createElement('div');\n deselect.classList.add(this.classes.deselect);\n const selectedOptions = (_a = this.store) === null || _a === void 0 ? void 0 : _a.getSelectedOptions();\n if (!this.settings.allowDeselect || (this.settings.isMultiple && selectedOptions && selectedOptions.length <= 0)) {\n deselect.classList.add(this.classes.hide);\n }\n else {\n deselect.classList.remove(this.classes.hide);\n }\n deselect.onclick = (e) => {\n e.stopPropagation();\n if (this.settings.disabled) {\n return;\n }\n let shouldDelete = true;\n const before = this.store.getSelectedOptions();\n const after = [];\n if (this.callbacks.beforeChange) {\n shouldDelete = this.callbacks.beforeChange(after, before) === true;\n }\n if (shouldDelete) {\n if (this.settings.isMultiple) {\n this.callbacks.setSelected([], false);\n this.updateDeselectAll();\n }\n else {\n this.callbacks.setSelected([''], false);\n }\n if (this.settings.closeOnSelect) {\n this.callbacks.close();\n }\n if (this.callbacks.afterChange) {\n this.callbacks.afterChange(after);\n }\n }\n };\n const deselectSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n deselectSvg.setAttribute('viewBox', '0 0 100 100');\n const deselectPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n deselectPath.setAttribute('d', this.classes.deselectPath);\n deselectSvg.appendChild(deselectPath);\n deselect.appendChild(deselectSvg);\n main.appendChild(deselect);\n const arrow = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n arrow.classList.add(this.classes.arrow);\n arrow.setAttribute('viewBox', '0 0 100 100');\n const arrowPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n arrowPath.setAttribute('d', this.classes.arrowClose);\n if (this.settings.alwaysOpen) {\n arrow.classList.add(this.classes.hide);\n }\n arrow.appendChild(arrowPath);\n main.appendChild(arrow);\n return {\n main: main,\n values: values,\n deselect: {\n main: deselect,\n svg: deselectSvg,\n path: deselectPath,\n },\n arrow: {\n main: arrow,\n path: arrowPath,\n },\n };\n }\n mainFocus(eventType) {\n if (eventType !== 'click') {\n this.main.main.focus({ preventScroll: true });\n }\n }\n placeholder() {\n const placeholderOption = this.store.filter((o) => o.placeholder, false);\n let placeholderText = this.settings.placeholderText;\n if (placeholderOption.length) {\n if (placeholderOption[0].html !== '') {\n placeholderText = placeholderOption[0].html;\n }\n else if (placeholderOption[0].text !== '') {\n placeholderText = placeholderOption[0].text;\n }\n }\n const placeholder = document.createElement('div');\n placeholder.classList.add(this.classes.placeholder);\n placeholder.innerHTML = placeholderText;\n return placeholder;\n }\n renderValues() {\n if (!this.settings.isMultiple) {\n this.renderSingleValue();\n return;\n }\n this.renderMultipleValues();\n }\n renderSingleValue() {\n const selected = this.store.filter((o) => {\n return o.selected && !o.placeholder;\n }, false);\n const selectedSingle = selected.length > 0 ? selected[0] : null;\n if (!selectedSingle) {\n this.main.values.innerHTML = this.placeholder().outerHTML;\n }\n else {\n const singleValue = document.createElement('div');\n singleValue.classList.add(this.classes.single);\n if (selectedSingle.html) {\n singleValue.innerHTML = selectedSingle.html;\n }\n else {\n singleValue.innerText = selectedSingle.text;\n }\n this.main.values.innerHTML = singleValue.outerHTML;\n }\n if (!this.settings.allowDeselect || !selected.length) {\n this.main.deselect.main.classList.add(this.classes.hide);\n }\n else {\n this.main.deselect.main.classList.remove(this.classes.hide);\n }\n }\n renderMultipleValues() {\n let currentNodes = this.main.values.childNodes;\n let selectedOptions = this.store.filter((opt) => {\n return opt.selected && opt.display;\n }, false);\n if (selectedOptions.length === 0) {\n this.main.values.innerHTML = this.placeholder().outerHTML;\n return;\n }\n else {\n const placeholder = this.main.values.querySelector('.' + this.classes.placeholder);\n if (placeholder) {\n placeholder.remove();\n }\n }\n if (selectedOptions.length > this.settings.maxValuesShown) {\n const singleValue = document.createElement('div');\n singleValue.classList.add(this.classes.max);\n singleValue.textContent = this.settings.maxValuesMessage.replace('{number}', selectedOptions.length.toString());\n this.main.values.innerHTML = singleValue.outerHTML;\n return;\n }\n else {\n const maxValuesMessage = this.main.values.querySelector('.' + this.classes.max);\n if (maxValuesMessage) {\n maxValuesMessage.remove();\n }\n }\n let removeNodes = [];\n for (let i = 0; i < currentNodes.length; i++) {\n const node = currentNodes[i];\n const id = node.getAttribute('data-id');\n if (id) {\n const found = selectedOptions.filter((opt) => {\n return opt.id === id;\n }, false);\n if (!found.length) {\n removeNodes.push(node);\n }\n }\n }\n for (const n of removeNodes) {\n n.classList.add(this.classes.valueOut);\n setTimeout(() => {\n if (this.main.values.hasChildNodes() && this.main.values.contains(n)) {\n this.main.values.removeChild(n);\n }\n }, 100);\n }\n currentNodes = this.main.values.childNodes;\n for (let d = 0; d < selectedOptions.length; d++) {\n let shouldAdd = true;\n for (let i = 0; i < currentNodes.length; i++) {\n if (selectedOptions[d].id === String(currentNodes[i].dataset.id)) {\n shouldAdd = false;\n }\n }\n if (shouldAdd) {\n if (currentNodes.length === 0) {\n this.main.values.appendChild(this.multipleValue(selectedOptions[d]));\n }\n else if (d === 0) {\n this.main.values.insertBefore(this.multipleValue(selectedOptions[d]), currentNodes[d]);\n }\n else {\n currentNodes[d - 1].insertAdjacentElement('afterend', this.multipleValue(selectedOptions[d]));\n }\n }\n }\n this.updateDeselectAll();\n }\n multipleValue(option) {\n const value = document.createElement('div');\n value.classList.add(this.classes.value);\n value.dataset.id = option.id;\n const text = document.createElement('div');\n text.classList.add(this.classes.valueText);\n text.innerText = option.text;\n value.appendChild(text);\n if (!option.mandatory) {\n const deleteDiv = document.createElement('div');\n deleteDiv.classList.add(this.classes.valueDelete);\n deleteDiv.onclick = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (this.settings.disabled) {\n return;\n }\n let shouldDelete = true;\n const before = this.store.getSelectedOptions();\n const after = before.filter((o) => {\n return o.selected && o.id !== option.id;\n }, true);\n if (this.settings.minSelected && after.length < this.settings.minSelected) {\n return;\n }\n if (this.callbacks.beforeChange) {\n shouldDelete = this.callbacks.beforeChange(after, before) === true;\n }\n if (shouldDelete) {\n let selectedValues = [];\n for (const o of after) {\n if (o instanceof Optgroup) {\n for (const c of o.options) {\n selectedValues.push(c.value);\n }\n }\n if (o instanceof Option) {\n selectedValues.push(o.value);\n }\n }\n this.callbacks.setSelected(selectedValues, false);\n if (this.settings.closeOnSelect) {\n this.callbacks.close();\n }\n if (this.callbacks.afterChange) {\n this.callbacks.afterChange(after);\n }\n this.updateDeselectAll();\n }\n };\n const deleteSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n deleteSvg.setAttribute('viewBox', '0 0 100 100');\n const deletePath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n deletePath.setAttribute('d', this.classes.optionDelete);\n deleteSvg.appendChild(deletePath);\n deleteDiv.appendChild(deleteSvg);\n value.appendChild(deleteDiv);\n }\n return value;\n }\n contentDiv() {\n const main = document.createElement('div');\n main.dataset.id = this.settings.id;\n main.id = this.settings.id;\n const search = this.searchDiv();\n main.appendChild(search.main);\n const list = this.listDiv();\n main.appendChild(list);\n return {\n main: main,\n search: search,\n list: list,\n };\n }\n moveContent() {\n if (this.settings.contentPosition === 'relative') {\n this.moveContentBelow();\n return;\n }\n if (this.settings.openPosition === 'down') {\n this.moveContentBelow();\n return;\n }\n else if (this.settings.openPosition === 'up') {\n this.moveContentAbove();\n return;\n }\n if (this.putContent() === 'up') {\n this.moveContentAbove();\n }\n else {\n this.moveContentBelow();\n }\n }\n searchDiv() {\n const main = document.createElement('div');\n const input = document.createElement('input');\n const addable = document.createElement('div');\n main.classList.add(this.classes.search);\n const searchReturn = {\n main,\n input,\n };\n if (!this.settings.showSearch) {\n main.classList.add(this.classes.hide);\n input.readOnly = true;\n }\n input.type = 'search';\n input.placeholder = this.settings.searchPlaceholder;\n input.tabIndex = -1;\n input.setAttribute('aria-label', this.settings.searchPlaceholder);\n input.setAttribute('autocapitalize', 'off');\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('autocorrect', 'off');\n input.oninput = debounce((e) => {\n this.callbacks.search(e.target.value);\n }, 100);\n input.onkeydown = (e) => {\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowDown':\n e.key === 'ArrowDown' ? this.highlight('down') : this.highlight('up');\n return false;\n case 'Tab':\n this.callbacks.close();\n return true;\n case 'Escape':\n this.callbacks.close();\n return false;\n case 'Enter':\n case ' ':\n if (this.callbacks.addable && e.ctrlKey) {\n addable.click();\n return false;\n }\n else {\n const highlighted = this.content.list.querySelector('.' + this.classes.highlighted);\n if (highlighted) {\n highlighted.click();\n return false;\n }\n }\n return true;\n }\n };\n main.appendChild(input);\n if (this.callbacks.addable) {\n addable.classList.add(this.classes.addable);\n const plus = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n plus.setAttribute('viewBox', '0 0 100 100');\n const plusPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n plusPath.setAttribute('d', this.classes.addablePath);\n plus.appendChild(plusPath);\n addable.appendChild(plus);\n addable.onclick = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (!this.callbacks.addable) {\n return;\n }\n const inputValue = this.content.search.input.value.trim();\n if (inputValue === '') {\n this.content.search.input.focus();\n return;\n }\n const runFinish = (oo) => {\n let newOption = new Option(oo);\n this.callbacks.addOption(newOption);\n if (this.settings.isMultiple) {\n let values = this.store.getSelected();\n values.push(newOption.value);\n this.callbacks.setSelected(values, true);\n }\n else {\n this.callbacks.setSelected([newOption.value], true);\n }\n this.callbacks.search('');\n if (this.settings.closeOnSelect) {\n setTimeout(() => {\n this.callbacks.close();\n }, 100);\n }\n };\n const addableValue = this.callbacks.addable(inputValue);\n if (addableValue === false || addableValue === undefined || addableValue === null) {\n return;\n }\n if (addableValue instanceof Promise) {\n addableValue.then((value) => {\n if (typeof value === 'string') {\n runFinish({\n text: value,\n value: value,\n });\n }\n else {\n runFinish(value);\n }\n });\n }\n else if (typeof addableValue === 'string') {\n runFinish({\n text: addableValue,\n value: addableValue,\n });\n }\n else {\n runFinish(addableValue);\n }\n return;\n };\n main.appendChild(addable);\n searchReturn.addable = {\n main: addable,\n svg: plus,\n path: plusPath,\n };\n }\n return searchReturn;\n }\n searchFocus() {\n this.content.search.input.focus();\n }\n getOptions(notPlaceholder = false, notDisabled = false, notHidden = false) {\n let query = '.' + this.classes.option;\n if (notPlaceholder) {\n query += ':not(.' + this.classes.placeholder + ')';\n }\n if (notDisabled) {\n query += ':not(.' + this.classes.disabled + ')';\n }\n if (notHidden) {\n query += ':not(.' + this.classes.hide + ')';\n }\n return Array.from(this.content.list.querySelectorAll(query));\n }\n highlight(dir) {\n const options = this.getOptions(true, true, true);\n if (options.length === 0) {\n return;\n }\n if (options.length === 1) {\n if (!options[0].classList.contains(this.classes.highlighted)) {\n options[0].classList.add(this.classes.highlighted);\n return;\n }\n }\n for (let i = 0; i < options.length; i++) {\n if (options[i].classList.contains(this.classes.highlighted)) {\n const prevOption = options[i];\n prevOption.classList.remove(this.classes.highlighted);\n const prevParent = prevOption.parentElement;\n if (prevParent && prevParent.classList.contains(this.classes.open)) {\n const optgroupLabel = prevParent.querySelector('.' + this.classes.optgroupLabel);\n if (optgroupLabel) {\n optgroupLabel.click();\n }\n }\n let selectOption = options[dir === 'down' ? (i + 1 < options.length ? i + 1 : 0) : i - 1 >= 0 ? i - 1 : options.length - 1];\n selectOption.classList.add(this.classes.highlighted);\n this.ensureElementInView(this.content.list, selectOption);\n const selectParent = selectOption.parentElement;\n if (selectParent && selectParent.classList.contains(this.classes.close)) {\n const optgroupLabel = selectParent.querySelector('.' + this.classes.optgroupLabel);\n if (optgroupLabel) {\n optgroupLabel.click();\n }\n }\n return;\n }\n }\n options[dir === 'down' ? 0 : options.length - 1].classList.add(this.classes.highlighted);\n this.ensureElementInView(this.content.list, options[dir === 'down' ? 0 : options.length - 1]);\n }\n listDiv() {\n const options = document.createElement('div');\n options.classList.add(this.classes.list);\n return options;\n }\n renderError(error) {\n this.content.list.innerHTML = '';\n const errorDiv = document.createElement('div');\n errorDiv.classList.add(this.classes.error);\n errorDiv.textContent = error;\n this.content.list.appendChild(errorDiv);\n }\n renderSearching() {\n this.content.list.innerHTML = '';\n const searchingDiv = document.createElement('div');\n searchingDiv.classList.add(this.classes.searching);\n searchingDiv.textContent = this.settings.searchingText;\n this.content.list.appendChild(searchingDiv);\n }\n renderOptions(data) {\n this.content.list.innerHTML = '';\n if (data.length === 0) {\n const noResults = document.createElement('div');\n noResults.classList.add(this.classes.search);\n noResults.innerHTML = this.settings.searchText;\n this.content.list.appendChild(noResults);\n return;\n }\n for (const d of data) {\n if (d instanceof Optgroup) {\n const optgroupEl = document.createElement('div');\n optgroupEl.classList.add(this.classes.optgroup);\n const optgroupLabel = document.createElement('div');\n optgroupLabel.classList.add(this.classes.optgroupLabel);\n optgroupEl.appendChild(optgroupLabel);\n const optgroupLabelText = document.createElement('div');\n optgroupLabelText.classList.add(this.classes.optgroupLabelText);\n optgroupLabelText.textContent = d.label;\n optgroupLabel.appendChild(optgroupLabelText);\n const optgroupActions = document.createElement('div');\n optgroupActions.classList.add(this.classes.optgroupActions);\n optgroupLabel.appendChild(optgroupActions);\n if (this.settings.isMultiple && d.selectAll) {\n const selectAll = document.createElement('div');\n selectAll.classList.add(this.classes.optgroupSelectAll);\n let allSelected = true;\n for (const o of d.options) {\n if (!o.selected) {\n allSelected = false;\n break;\n }\n }\n if (allSelected) {\n selectAll.classList.add(this.classes.selected);\n }\n const selectAllText = document.createElement('span');\n selectAllText.textContent = d.selectAllText;\n selectAll.appendChild(selectAllText);\n const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n selectAllSvg.setAttribute('viewBox', '0 0 100 100');\n selectAll.appendChild(selectAllSvg);\n const selectAllBox = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n selectAllBox.setAttribute('d', this.classes.optgroupSelectAllBox);\n selectAllSvg.appendChild(selectAllBox);\n const selectAllCheck = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n selectAllCheck.setAttribute('d', this.classes.optgroupSelectAllCheck);\n selectAllSvg.appendChild(selectAllCheck);\n selectAll.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n const currentSelected = this.store.getSelected();\n if (allSelected) {\n const newSelected = currentSelected.filter((s) => {\n for (const o of d.options) {\n if (s === o.value) {\n return false;\n }\n }\n return true;\n });\n this.callbacks.setSelected(newSelected, true);\n return;\n }\n else {\n const newSelected = currentSelected.concat(d.options.map((o) => o.value));\n for (const o of d.options) {\n if (!this.store.getOptionByID(o.id)) {\n this.callbacks.addOption(o);\n }\n }\n this.callbacks.setSelected(newSelected, true);\n return;\n }\n });\n optgroupActions.appendChild(selectAll);\n }\n if (d.closable !== 'off') {\n const optgroupClosable = document.createElement('div');\n optgroupClosable.classList.add(this.classes.optgroupClosable);\n const optgroupClosableSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n optgroupClosableSvg.setAttribute('viewBox', '0 0 100 100');\n optgroupClosableSvg.classList.add(this.classes.arrow);\n optgroupClosable.appendChild(optgroupClosableSvg);\n const optgroupClosableArrow = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n optgroupClosableSvg.appendChild(optgroupClosableArrow);\n if (d.options.some((o) => o.selected) || this.content.search.input.value.trim() !== '') {\n optgroupClosable.classList.add(this.classes.open);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n }\n else if (d.closable === 'open') {\n optgroupEl.classList.add(this.classes.open);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n }\n else if (d.closable === 'close') {\n optgroupEl.classList.add(this.classes.close);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);\n }\n optgroupLabel.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (optgroupEl.classList.contains(this.classes.close)) {\n optgroupEl.classList.remove(this.classes.close);\n optgroupEl.classList.add(this.classes.open);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowOpen);\n }\n else {\n optgroupEl.classList.remove(this.classes.open);\n optgroupEl.classList.add(this.classes.close);\n optgroupClosableArrow.setAttribute('d', this.classes.arrowClose);\n }\n });\n optgroupActions.appendChild(optgroupClosable);\n }\n optgroupEl.appendChild(optgroupLabel);\n for (const o of d.options) {\n optgroupEl.appendChild(this.option(o));\n }\n this.content.list.appendChild(optgroupEl);\n }\n if (d instanceof Option) {\n this.content.list.appendChild(this.option(d));\n }\n }\n }\n option(option) {\n if (option.placeholder) {\n const placeholder = document.createElement('div');\n placeholder.classList.add(this.classes.option);\n placeholder.classList.add(this.classes.hide);\n return placeholder;\n }\n const optionEl = document.createElement('div');\n optionEl.dataset.id = option.id;\n optionEl.id = option.id;\n optionEl.classList.add(this.classes.option);\n optionEl.setAttribute('role', 'option');\n if (option.class) {\n option.class.split(' ').forEach((dataClass) => {\n optionEl.classList.add(dataClass);\n });\n }\n if (option.style) {\n optionEl.style.cssText = option.style;\n }\n if (this.settings.searchHighlight && this.content.search.input.value.trim() !== '') {\n optionEl.innerHTML = this.highlightText(option.html !== '' ? option.html : option.text, this.content.search.input.value, this.classes.searchHighlighter);\n }\n else if (option.html !== '') {\n optionEl.innerHTML = option.html;\n }\n else {\n optionEl.textContent = option.text;\n }\n if (this.settings.showOptionTooltips && optionEl.textContent) {\n optionEl.setAttribute('title', optionEl.textContent);\n }\n if (!option.display) {\n optionEl.classList.add(this.classes.hide);\n }\n if (option.disabled) {\n optionEl.classList.add(this.classes.disabled);\n }\n if (option.selected && this.settings.hideSelected) {\n optionEl.classList.add(this.classes.hide);\n }\n if (option.selected) {\n optionEl.classList.add(this.classes.selected);\n optionEl.setAttribute('aria-selected', 'true');\n this.main.main.setAttribute('aria-activedescendant', optionEl.id);\n }\n else {\n optionEl.classList.remove(this.classes.selected);\n optionEl.setAttribute('aria-selected', 'false');\n }\n optionEl.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n const selectedOptions = this.store.getSelected();\n const element = e.currentTarget;\n const elementID = String(element.dataset.id);\n if (option.disabled || (option.selected && !this.settings.allowDeselect)) {\n return;\n }\n if ((this.settings.isMultiple && this.settings.maxSelected <= selectedOptions.length && !option.selected) ||\n (this.settings.isMultiple && this.settings.minSelected >= selectedOptions.length && option.selected)) {\n return;\n }\n let shouldUpdate = false;\n const before = this.store.getSelectedOptions();\n let after = [];\n if (this.settings.isMultiple) {\n if (option.selected) {\n after = before.filter((o) => o.id !== elementID);\n }\n else {\n after = before.concat(option);\n }\n }\n if (!this.settings.isMultiple) {\n if (option.selected) {\n after = [];\n }\n else {\n after = [option];\n }\n }\n if (!this.callbacks.beforeChange) {\n shouldUpdate = true;\n }\n if (this.callbacks.beforeChange) {\n if (this.callbacks.beforeChange(after, before) === false) {\n shouldUpdate = false;\n }\n else {\n shouldUpdate = true;\n }\n }\n if (shouldUpdate) {\n if (!this.store.getOptionByID(elementID)) {\n this.callbacks.addOption(option);\n }\n this.callbacks.setSelected(after.map((o) => o.value), false);\n if (this.settings.closeOnSelect) {\n this.callbacks.close();\n }\n if (this.callbacks.afterChange) {\n this.callbacks.afterChange(after);\n }\n }\n });\n return optionEl;\n }\n destroy() {\n this.main.main.remove();\n this.content.main.remove();\n }\n highlightText(str, search, className) {\n let completedString = str;\n const regex = new RegExp('(' + search.trim() + ')(?![^<]*>[^<>]*)', 'i');\n if (!str.match(regex)) {\n return str;\n }\n const matchStartPosition = str.match(regex).index;\n const matchEndPosition = matchStartPosition + str.match(regex)[0].toString().length;\n const originalTextFoundByRegex = str.substring(matchStartPosition, matchEndPosition);\n completedString = completedString.replace(regex, `${originalTextFoundByRegex}`);\n return completedString;\n }\n moveContentAbove() {\n const mainHeight = this.main.main.offsetHeight;\n const contentHeight = this.content.main.offsetHeight;\n this.main.main.classList.remove(this.classes.openBelow);\n this.main.main.classList.add(this.classes.openAbove);\n this.content.main.classList.remove(this.classes.openBelow);\n this.content.main.classList.add(this.classes.openAbove);\n const containerRect = this.main.main.getBoundingClientRect();\n this.content.main.style.margin = '-' + (mainHeight + contentHeight - 1) + 'px 0px 0px 0px';\n this.content.main.style.top = containerRect.top + containerRect.height + window.scrollY + 'px';\n this.content.main.style.left = containerRect.left + window.scrollX + 'px';\n this.content.main.style.width = containerRect.width + 'px';\n }\n moveContentBelow() {\n this.main.main.classList.remove(this.classes.openAbove);\n this.main.main.classList.add(this.classes.openBelow);\n this.content.main.classList.remove(this.classes.openAbove);\n this.content.main.classList.add(this.classes.openBelow);\n const containerRect = this.main.main.getBoundingClientRect();\n this.content.main.style.margin = '-1px 0px 0px 0px';\n if (this.settings.contentPosition !== 'relative') {\n this.content.main.style.top = containerRect.top + containerRect.height + window.scrollY + 'px';\n this.content.main.style.left = containerRect.left + window.scrollX + 'px';\n this.content.main.style.width = containerRect.width + 'px';\n }\n }\n ensureElementInView(container, element) {\n const cTop = container.scrollTop + container.offsetTop;\n const cBottom = cTop + container.clientHeight;\n const eTop = element.offsetTop;\n const eBottom = eTop + element.clientHeight;\n if (eTop < cTop) {\n container.scrollTop -= cTop - eTop;\n }\n else if (eBottom > cBottom) {\n container.scrollTop += eBottom - cBottom;\n }\n }\n putContent() {\n const mainHeight = this.main.main.offsetHeight;\n const mainRect = this.main.main.getBoundingClientRect();\n const contentHeight = this.content.main.offsetHeight;\n const spaceBelow = window.innerHeight - (mainRect.top + mainHeight);\n if (spaceBelow <= contentHeight) {\n if (mainRect.top > contentHeight) {\n return 'up';\n }\n else {\n return 'down';\n }\n }\n return 'down';\n }\n updateDeselectAll() {\n if (!this.store || !this.settings) {\n return;\n }\n const selected = this.store.getSelectedOptions();\n const hasSelectedItems = selected && selected.length > 0;\n const isMultiple = this.settings.isMultiple;\n const allowDeselect = this.settings.allowDeselect;\n const deselectButton = this.main.deselect.main;\n const hideClass = this.classes.hide;\n if (allowDeselect && !(isMultiple && !hasSelectedItems)) {\n deselectButton.classList.remove(hideClass);\n }\n else {\n deselectButton.classList.add(hideClass);\n }\n }\n }\n\n class Select {\n constructor(select) {\n this.listen = false;\n this.observer = null;\n this.select = select;\n this.select.addEventListener('change', this.valueChange.bind(this), {\n passive: true,\n });\n this.observer = new MutationObserver(this.observeCall.bind(this));\n this.changeListen(true);\n }\n enable() {\n this.select.disabled = false;\n }\n disable() {\n this.select.disabled = true;\n }\n hideUI() {\n this.select.tabIndex = -1;\n this.select.style.display = 'none';\n this.select.setAttribute('aria-hidden', 'true');\n }\n showUI() {\n this.select.removeAttribute('tabindex');\n this.select.style.display = '';\n this.select.removeAttribute('aria-hidden');\n }\n changeListen(listen) {\n this.listen = listen;\n if (listen) {\n if (this.observer) {\n this.observer.observe(this.select, {\n subtree: true,\n childList: true,\n attributes: true,\n });\n }\n }\n if (!listen) {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n }\n valueChange(ev) {\n if (this.listen && this.onValueChange) {\n this.onValueChange(this.getSelectedValues());\n }\n return true;\n }\n observeCall(mutations) {\n if (!this.listen) {\n return;\n }\n let classChanged = false;\n let disabledChanged = false;\n let optgroupOptionChanged = false;\n for (const m of mutations) {\n if (m.target === this.select) {\n if (m.attributeName === 'disabled') {\n disabledChanged = true;\n }\n if (m.attributeName === 'class') {\n classChanged = true;\n }\n }\n if (m.target.nodeName === 'OPTGROUP' || m.target.nodeName === 'OPTION') {\n optgroupOptionChanged = true;\n }\n }\n if (classChanged && this.onClassChange) {\n this.onClassChange(this.select.className.split(' '));\n }\n if (disabledChanged && this.onDisabledChange) {\n this.changeListen(false);\n this.onDisabledChange(this.select.disabled);\n this.changeListen(true);\n }\n if (optgroupOptionChanged && this.onOptionsChange) {\n this.changeListen(false);\n this.onOptionsChange(this.getData());\n this.changeListen(true);\n }\n }\n getData() {\n let data = [];\n const nodes = this.select.childNodes;\n for (const n of nodes) {\n if (n.nodeName === 'OPTGROUP') {\n data.push(this.getDataFromOptgroup(n));\n }\n if (n.nodeName === 'OPTION') {\n data.push(this.getDataFromOption(n));\n }\n }\n return data;\n }\n getDataFromOptgroup(optgroup) {\n let data = {\n id: optgroup.id,\n label: optgroup.label,\n selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,\n selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',\n closable: optgroup.dataset ? optgroup.dataset.closable : 'off',\n options: [],\n };\n const options = optgroup.childNodes;\n for (const o of options) {\n if (o.nodeName === 'OPTION') {\n data.options.push(this.getDataFromOption(o));\n }\n }\n return data;\n }\n getDataFromOption(option) {\n return {\n id: option.id,\n value: option.value,\n text: option.text,\n html: option.dataset && option.dataset.html ? option.dataset.html : '',\n selected: option.selected,\n display: option.style.display === 'none' ? false : true,\n disabled: option.disabled,\n mandatory: option.dataset ? option.dataset.mandatory === 'true' : false,\n placeholder: option.dataset.placeholder === 'true',\n class: option.className,\n style: option.style.cssText,\n data: option.dataset,\n };\n }\n getSelectedValues() {\n let values = [];\n const options = this.select.childNodes;\n for (const o of options) {\n if (o.nodeName === 'OPTGROUP') {\n const optgroupOptions = o.childNodes;\n for (const oo of optgroupOptions) {\n if (oo.nodeName === 'OPTION') {\n const option = oo;\n if (option.selected) {\n values.push(option.value);\n }\n }\n }\n }\n if (o.nodeName === 'OPTION') {\n const option = o;\n if (option.selected) {\n values.push(option.value);\n }\n }\n }\n return values;\n }\n setSelected(value) {\n this.changeListen(false);\n const options = this.select.childNodes;\n for (const o of options) {\n if (o.nodeName === 'OPTGROUP') {\n const optgroup = o;\n const optgroupOptions = optgroup.childNodes;\n for (const oo of optgroupOptions) {\n if (oo.nodeName === 'OPTION') {\n const option = oo;\n option.selected = value.includes(option.value);\n }\n }\n }\n if (o.nodeName === 'OPTION') {\n const option = o;\n option.selected = value.includes(option.value);\n }\n }\n this.changeListen(true);\n }\n updateSelect(id, style, classes) {\n this.changeListen(false);\n if (id) {\n this.select.dataset.id = id;\n }\n if (style) {\n this.select.style.cssText = style;\n }\n if (classes) {\n this.select.className = '';\n classes.forEach((c) => {\n if (c.trim() !== '') {\n this.select.classList.add(c.trim());\n }\n });\n }\n this.changeListen(true);\n }\n updateOptions(data) {\n this.changeListen(false);\n this.select.innerHTML = '';\n for (const d of data) {\n if (d instanceof Optgroup) {\n this.select.appendChild(this.createOptgroup(d));\n }\n if (d instanceof Option) {\n this.select.appendChild(this.createOption(d));\n }\n }\n this.select.dispatchEvent(new Event('change'));\n this.changeListen(true);\n }\n createOptgroup(optgroup) {\n const optgroupEl = document.createElement('optgroup');\n optgroupEl.id = optgroup.id;\n optgroupEl.label = optgroup.label;\n if (optgroup.selectAll) {\n optgroupEl.dataset.selectAll = 'true';\n }\n if (optgroup.closable !== 'off') {\n optgroupEl.dataset.closable = optgroup.closable;\n }\n if (optgroup.options) {\n for (const o of optgroup.options) {\n optgroupEl.appendChild(this.createOption(o));\n }\n }\n return optgroupEl;\n }\n createOption(info) {\n const optionEl = document.createElement('option');\n optionEl.id = info.id;\n optionEl.value = info.value;\n optionEl.innerHTML = info.text;\n if (info.html !== '') {\n optionEl.setAttribute('data-html', info.html);\n }\n if (info.selected) {\n optionEl.selected = info.selected;\n }\n if (info.disabled) {\n optionEl.disabled = true;\n }\n if (info.display === false) {\n optionEl.style.display = 'none';\n }\n if (info.placeholder) {\n optionEl.setAttribute('data-placeholder', 'true');\n }\n if (info.mandatory) {\n optionEl.setAttribute('data-mandatory', 'true');\n }\n if (info.class) {\n info.class.split(' ').forEach((optionClass) => {\n optionEl.classList.add(optionClass);\n });\n }\n if (info.data && typeof info.data === 'object') {\n Object.keys(info.data).forEach((key) => {\n optionEl.setAttribute('data-' + kebabCase(key), info.data[key]);\n });\n }\n return optionEl;\n }\n destroy() {\n this.changeListen(false);\n this.select.removeEventListener('change', this.valueChange.bind(this));\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n delete this.select.dataset.id;\n this.showUI();\n }\n }\n\n class SlimSelect {\n constructor(config) {\n var _a;\n this.events = {\n search: undefined,\n searchFilter: (opt, search) => {\n return opt.text.toLowerCase().indexOf(search.toLowerCase()) !== -1;\n },\n addable: undefined,\n beforeChange: undefined,\n afterChange: undefined,\n beforeOpen: undefined,\n afterOpen: undefined,\n beforeClose: undefined,\n afterClose: undefined,\n };\n this.windowResize = debounce(() => {\n if (!this.settings.isOpen && !this.settings.isFullOpen) {\n return;\n }\n this.render.moveContent();\n });\n this.windowScroll = debounce(() => {\n if (!this.settings.isOpen && !this.settings.isFullOpen) {\n return;\n }\n this.render.moveContent();\n });\n this.documentClick = (e) => {\n if (!this.settings.isOpen) {\n return;\n }\n if (e.target && !hasClassInTree(e.target, this.settings.id)) {\n this.close(e.type);\n }\n };\n this.windowVisibilityChange = () => {\n if (document.hidden) {\n this.close();\n }\n };\n this.selectEl = (typeof config.select === 'string' ? document.querySelector(config.select) : config.select);\n if (!this.selectEl) {\n if (config.events && config.events.error) {\n config.events.error(new Error('Could not find select element'));\n }\n return;\n }\n if (this.selectEl.tagName !== 'SELECT') {\n if (config.events && config.events.error) {\n config.events.error(new Error('Element isnt of type select'));\n }\n return;\n }\n if (this.selectEl.dataset.ssid) {\n this.destroy();\n }\n this.settings = new Settings(config.settings);\n const debounceEvents = ['afterChange', 'beforeOpen', 'afterOpen', 'beforeClose', 'afterClose'];\n for (const key in config.events) {\n if (!config.events.hasOwnProperty(key)) {\n continue;\n }\n if (debounceEvents.indexOf(key) !== -1) {\n this.events[key] = debounce(config.events[key], 100);\n }\n else {\n this.events[key] = config.events[key];\n }\n }\n this.settings.disabled = ((_a = config.settings) === null || _a === void 0 ? void 0 : _a.disabled) ? config.settings.disabled : this.selectEl.disabled;\n this.settings.isMultiple = this.selectEl.multiple;\n this.settings.style = this.selectEl.style.cssText;\n this.settings.class = this.selectEl.className.split(' ');\n this.select = new Select(this.selectEl);\n this.select.updateSelect(this.settings.id, this.settings.style, this.settings.class);\n this.select.hideUI();\n this.select.onValueChange = (values) => {\n this.setSelected(values);\n };\n this.select.onClassChange = (classes) => {\n this.settings.class = classes;\n this.render.updateClassStyles();\n };\n this.select.onDisabledChange = (disabled) => {\n if (disabled) {\n this.disable();\n }\n else {\n this.enable();\n }\n };\n this.select.onOptionsChange = (data) => {\n this.setData(data);\n };\n this.store = new Store(this.settings.isMultiple ? 'multiple' : 'single', config.data ? config.data : this.select.getData());\n if (config.data) {\n this.select.updateOptions(this.store.getData());\n }\n const callbacks = {\n open: this.open.bind(this),\n close: this.close.bind(this),\n addable: this.events.addable ? this.events.addable : undefined,\n setSelected: this.setSelected.bind(this),\n addOption: this.addOption.bind(this),\n search: this.search.bind(this),\n beforeChange: this.events.beforeChange,\n afterChange: this.events.afterChange,\n };\n this.render = new Render(this.settings, this.store, callbacks);\n this.render.renderValues();\n this.render.renderOptions(this.store.getData());\n const selectAriaLabel = this.selectEl.getAttribute('aria-label');\n const selectAriaLabelledBy = this.selectEl.getAttribute('aria-labelledby');\n if (selectAriaLabel) {\n this.render.main.main.setAttribute('aria-label', selectAriaLabel);\n }\n else if (selectAriaLabelledBy) {\n this.render.main.main.setAttribute('aria-labelledby', selectAriaLabelledBy);\n }\n if (this.selectEl.parentNode) {\n this.selectEl.parentNode.insertBefore(this.render.main.main, this.selectEl.nextSibling);\n }\n document.addEventListener('click', this.documentClick);\n window.addEventListener('resize', this.windowResize, false);\n if (this.settings.openPosition === 'auto') {\n window.addEventListener('scroll', this.windowScroll, false);\n }\n document.addEventListener('visibilitychange', this.windowVisibilityChange);\n if (this.settings.disabled) {\n this.disable();\n }\n if (this.settings.alwaysOpen) {\n this.open();\n }\n this.selectEl.slim = this;\n }\n enable() {\n this.settings.disabled = false;\n this.select.enable();\n this.render.enable();\n }\n disable() {\n this.settings.disabled = true;\n this.select.disable();\n this.render.disable();\n }\n getData() {\n return this.store.getData();\n }\n setData(data) {\n const selected = this.store.getSelected();\n const err = this.store.validateDataArray(data);\n if (err) {\n if (this.events.error) {\n this.events.error(err);\n }\n return;\n }\n this.store.setData(data);\n const dataClean = this.store.getData();\n this.select.updateOptions(dataClean);\n this.render.renderValues();\n this.render.renderOptions(dataClean);\n if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n this.events.afterChange(this.store.getSelectedOptions());\n }\n }\n getSelected() {\n return this.store.getSelected();\n }\n setSelected(value, runAfterChange = true) {\n const selected = this.store.getSelected();\n this.store.setSelectedBy('value', Array.isArray(value) ? value : [value]);\n const data = this.store.getData();\n this.select.updateOptions(data);\n this.render.renderValues();\n if (this.render.content.search.input.value !== '') {\n this.search(this.render.content.search.input.value);\n }\n else {\n this.render.renderOptions(data);\n }\n if (runAfterChange && this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n this.events.afterChange(this.store.getSelectedOptions());\n }\n }\n addOption(option) {\n const selected = this.store.getSelected();\n if (!this.store.getDataOptions().some((o) => { var _a; return o.value === ((_a = option.value) !== null && _a !== void 0 ? _a : option.text); })) {\n this.store.addOption(option);\n }\n const data = this.store.getData();\n this.select.updateOptions(data);\n this.render.renderValues();\n this.render.renderOptions(data);\n if (this.events.afterChange && !isEqual(selected, this.store.getSelected())) {\n this.events.afterChange(this.store.getSelectedOptions());\n }\n }\n open() {\n if (this.settings.disabled || this.settings.isOpen) {\n return;\n }\n if (this.events.beforeOpen) {\n this.events.beforeOpen();\n }\n this.render.open();\n if (this.settings.showSearch) {\n this.render.searchFocus();\n }\n this.settings.isOpen = true;\n setTimeout(() => {\n if (this.events.afterOpen) {\n this.events.afterOpen();\n }\n if (this.settings.isOpen) {\n this.settings.isFullOpen = true;\n }\n }, this.settings.timeoutDelay);\n if (this.settings.contentPosition === 'absolute') {\n if (this.settings.intervalMove) {\n clearInterval(this.settings.intervalMove);\n }\n this.settings.intervalMove = setInterval(this.render.moveContent.bind(this.render), 500);\n }\n }\n close(eventType = null) {\n if (!this.settings.isOpen || this.settings.alwaysOpen) {\n return;\n }\n if (this.events.beforeClose) {\n this.events.beforeClose();\n }\n this.render.close();\n if (this.render.content.search.input.value !== '') {\n this.search('');\n }\n this.render.mainFocus(eventType);\n this.settings.isOpen = false;\n this.settings.isFullOpen = false;\n setTimeout(() => {\n if (this.events.afterClose) {\n this.events.afterClose();\n }\n }, this.settings.timeoutDelay);\n if (this.settings.intervalMove) {\n clearInterval(this.settings.intervalMove);\n }\n }\n search(value) {\n if (this.render.content.search.input.value !== value) {\n this.render.content.search.input.value = value;\n }\n if (!this.events.search) {\n this.render.renderOptions(value === '' ? this.store.getData() : this.store.search(value, this.events.searchFilter));\n return;\n }\n this.render.renderSearching();\n const searchResp = this.events.search(value, this.store.getSelectedOptions());\n if (searchResp instanceof Promise) {\n searchResp\n .then((data) => {\n this.render.renderOptions(this.store.partialToFullData(data));\n })\n .catch((err) => {\n this.render.renderError(typeof err === 'string' ? err : err.message);\n });\n return;\n }\n else if (Array.isArray(searchResp)) {\n this.render.renderOptions(this.store.partialToFullData(searchResp));\n }\n else {\n this.render.renderError('Search event must return a promise or an array of data');\n }\n }\n destroy() {\n document.removeEventListener('click', this.documentClick);\n window.removeEventListener('resize', this.windowResize, false);\n if (this.settings.openPosition === 'auto') {\n window.removeEventListener('scroll', this.windowScroll, false);\n }\n document.removeEventListener('visibilitychange', this.windowVisibilityChange);\n this.store.setData([]);\n this.render.destroy();\n this.select.destroy();\n }\n }\n\n return SlimSelect;\n\n}));\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n if (reducer(descriptor, name, obj) !== false) {\n reducedDescriptors[name] = descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst isStandardBrowserEnv = (() => {\n let product;\n if (typeof navigator !== 'undefined' && (\n (product = navigator.product) === 'ReactNative' ||\n product === 'NativeScript' ||\n product === 'NS')\n ) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n})();\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\n const isStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n isStandardBrowserEnv,\n isStandardBrowserWebWorkerEnv,\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\nconst DEFAULT_CONTENT_TYPE = {\n 'Content-Type': undefined\n};\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n if (!hasJSONContentType) {\n return data;\n }\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\nutils.freezeMethods(AxiosHeaders.prototype);\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.isStandardBrowserEnv ?\n\n// Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n const cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n// Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })();\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.isStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n const responseType = config.responseType;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else {\n requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (platform.isStandardBrowserEnv) {\n // Add xsrf header\n const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))\n && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if(fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {\n break;\n }\n }\n\n if (!adapter) {\n if (adapter === false) {\n throw new AxiosError(\n `Adapter ${nameOrAdapter} is not supported by the environment`,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n throw new Error(\n utils.hasOwnProp(knownAdapters, nameOrAdapter) ?\n `Adapter '${nameOrAdapter}' is not available in the build` :\n `Unknown adapter '${nameOrAdapter}'`\n );\n }\n\n if (!utils.isFunction(adapter)) {\n throw new TypeError('adapter is not a function');\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.4.0\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n let contextHeaders;\n\n // Flatten headers\n contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n contextHeaders && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n mergeConfig\n}\n","import Notiflix from 'notiflix';\nimport SlimSelect from 'slim-select';\n\nimport {\n createMarkupOptions,\n createMarkupCatShow,\n} from '../templates/functions.js';\nimport { fetchBreeds, fetchCatByBreed } from '../js/cat-api.js';\n\nconst BASE_URL = 'https://api.thecatapi.com/v1';\nconst END_POINT = '/breeds';\nconst API_KEY =\n 'live_NqCT8Nwkxuj6edZ1OwQGKuojQMkYLWj7L4oQ3fZLryh0xj2BQo0SHp9dUXgOOBta';\nconst wholeURL = BASE_URL + END_POINT + '?api_key=' + API_KEY;\n\nconst selectBreed = document.getElementById('selectBreed');\nconst loaderItem = document.querySelector('.loader');\nconst divInfoCat = document.querySelector('div.cat-info');\nconst sectionLoad = document.querySelector('.section-load');\n\n//витягуємо дані про котиків із сервера\nfetchBreeds(wholeURL).then(renderData).catch(errorfetchData);\n\nfunction renderData(dataCat) {\n const markup = createMarkupOptions(dataCat);\n selectBreed.innerHTML = markup;\n\n loaderItem.hidden = true;\n selectBreed.hidden = false;\n sectionLoad.hidden = true;\n \n new SlimSelect({\n select: '#selectBreed'\n });\n \n}\n\nfunction errorfetchData() {\n loaderItem.hidden = true;\n // errorItem.hidden = false;\n}\n\n//слідкуємо за тим, яку породу користувач вибрав\nselectBreed.addEventListener('change', showInfoBreed);\n\nfunction showInfoBreed(e) {\n fetchCatByBreed(e.target.value).then(showCat).catch(errorGetInfoCat);\n}\n\nfunction showCat(infoCat) {\n console.log(infoCat);\n const markup = createMarkupCatShow(infoCat);\n divInfoCat.innerHTML = markup;\n}\n\nfunction errorGetInfoCat(error) {\n // Notiflix.Notify.warning(error);\n console.log('x');\n}\n","import axios from 'axios';\n\nconst BASE_URL = 'https://api.thecatapi.com/v1';\nconst API_KEY =\n 'live_NqCT8Nwkxuj6edZ1OwQGKuojQMkYLWj7L4oQ3fZLryh0xj2BQo0SHp9dUXgOOBta';\n\nexport function fetchBreeds(URL) {\n return axios.get(URL).then(result => {\n return result.data;\n });\n}\n\nexport function fetchCatByBreed(breedId) {\n return axios\n .get(`${BASE_URL}/images/search?api_key=${API_KEY}&breed_ids=${breedId}`)\n .then(result => {\n return result.data[0];\n });\n}\n","//ф-ція приймає масив даних котиків та малює розмітку\n//для поля select зі списком порід котів\nexport function createMarkupOptions(arr) {\n return arr\n .map(elem => ``)\n .join();\n}\n\nexport function createMarkupCatShow(array) {\n const markup = ` \n
\n
\n
\n
${array.breeds[0].name}
\n
${array.breeds[0].description}
\n
Temperament: ${array.breeds[0].temperament}
\n
\n
\n `;\n return markup;\n}"],"names":["t","e","$parcel$global","window","$5cd59b5adbcbef33$exports","t1","document","e1","i1","a1","n1","o1","r1","s1","l1","m1","wrapID","overlayID","width","position","distance","opacity","borderRadius","rtl","timeout","messageMaxLength","backOverlay","backOverlayColor","plainText","showOnlyTheLastOne","clickToClose","pauseOnHover","ID","className","zindex","fontFamily","fontSize","cssAnimation","cssAnimationDuration","cssAnimationStyle","closeButton","useIcon","useFontAwesome","fontAwesomeIconStyle","fontAwesomeIconSize","success","background","textColor","childClassName","notiflixIconColor","fontAwesomeClassName","fontAwesomeIconColor","failure","warning","info","c1","p1","backgroundColor","backOverlayClickToClose","svgSize","titleFontSize","titleMaxLength","messageFontSize","buttonFontSize","buttonMaxLength","svgColor","titleColor","messageColor","buttonBackground","buttonColor","f1","d1","buttonsFontSize","buttonsMaxLength","okButtonColor","okButtonBackground","cancelButtonColor","cancelButtonBackground","x1","g1","customSvgUrl","customSvgCode","messageID","b1","u1","querySelectorLimit","y1","console","error","k1","log","w","h1","i","getElementById","a","createElement","id","innerHTML","head","appendChild","v","a2","Object","prototype","toString","call","arguments","n","hasOwnProperty","length","N","textContent","innerText","W1","I1","R1","A1","M","B","D1","T1","F1","o","r","G","Notify","init","c","Array","isArray","p","f","toLocaleLowerCase","substring","d","style","zIndex","left","top","right","bottom","margin","classList","add","maxHeight","display","flexWrap","flexDirection","justifyContent","alignItems","pointerEvents","x","height","animationDuration","body","g","color","setAttribute","b","u","y","insertBefore","firstChild","k","h","C","z","childElementCount","clearTimeout","S","parentNode","removeChild","querySelector","addEventListener","setTimeout","W","remove","I","R","querySelectorAll","A","E1","j1","e2","a3","l","Report","m","z1","S1","L1","O1","H1","i2","n2","Confirm","padding","trim","Math","ceil","L","focus","setSelectionRange","value","target","preventDefault","key","keyCode","dispatchEvent","Event","stopPropagation","returnValue","cancelBubble","P1","U1","Loading","X1","parseInt","replace","innerWidth","q1","Q","Y1","e3","i3","a4","n3","isPrototypeOf","NodeList","slice","Block","X","indexOf","tagName","D","T","F","E","j","q","O","getComputedStyle","getPropertyValue","H","P","round","V","offsetHeight","getAttribute","Y","K","$","J","createRange","selectNode","Z","createContextualFragment","_","tt","et","it","merge","show","ask","s","prompt","standard","hourglass","circle","arrows","dots","pulse","custom","notiflix","change","getElementsByTagName","V1","Notiflix","define","amd","$9b139c02a8c43d26$export$2e2bcd8739ae039","fn","thisArg","apply","$f753f16ae3da2a89$exports","generateID","random","hasClassInTree","element","hasClass","contains","dataset","parentByClass","debounce","func","wait","immediate","args","context","self","later","callNow","isEqual","JSON","stringify","kebabCase","str","result","match","toLowerCase","toUpperCase","Settings","constructor","settings","this","class","isMultiple","isOpen","isFullOpen","intervalMove","disabled","undefined","alwaysOpen","showSearch","searchPlaceholder","searchText","searchingText","searchHighlight","closeOnSelect","contentLocation","contentPosition","openPosition","placeholderText","allowDeselect","hideSelected","showOptionTooltips","minSelected","maxSelected","timeoutDelay","maxValuesShown","maxValuesMessage","Optgroup","optgroup","label","selectAll","selectAllText","closable","options","push","Option","option","text","html","selected","mandatory","placeholder","data","Store","validateDataArray","Error","dataObj","validateOption","partialToFullData","dataFinal","forEach","optOptions","setData","selectType","setSelectedBy","getSelected","getData","filter","getDataOptions","addOption","concat","selectedType","selectedValues","firstOption","hasSelected","includes","selectedOptions","getSelectedOptions","opt","getSelectedIDs","selectedIDs","op","getOptgroupByID","getOptionByID","search","searchFilter","includeOptgroup","dataSearch","getSelectType","type","Render","enable","main","classes","content","input","disable","open","arrow","path","arrowOpen","openAbove","openBelow","moveContent","store","selectedId","selectedOption","list","ensureElementInView","close","arrowClose","updateClassStyles","removeAttribute","cssText","updateAriaAttributes","role","mainDiv","_a","tabIndex","onkeydown","callbacks","highlight","highlighted","click","onclick","values","deselect","hide","shouldDelete","before","after","beforeChange","setSelected","updateDeselectAll","afterChange","deselectSvg","createElementNS","deselectPath","arrowPath","svg","mainFocus","eventType","preventScroll","placeholderOption","renderValues","renderMultipleValues","renderSingleValue","selectedSingle","singleValue","single","outerHTML","currentNodes","childNodes","max","removeNodes","node","valueOut","hasChildNodes","shouldAdd","String","multipleValue","insertAdjacentElement","valueText","deleteDiv","valueDelete","deleteSvg","deletePath","optionDelete","contentDiv","searchDiv","listDiv","putContent","moveContentAbove","moveContentBelow","addable","searchReturn","readOnly","oninput","ctrlKey","plus","plusPath","addablePath","inputValue","runFinish","oo","newOption","addableValue","Promise","then","searchFocus","getOptions","notPlaceholder","notDisabled","notHidden","query","from","dir","prevOption","prevParent","parentElement","optgroupLabel","selectOption","selectParent","renderError","errorDiv","renderSearching","searchingDiv","searching","renderOptions","noResults","optgroupEl","optgroupLabelText","optgroupActions","optgroupSelectAll","allSelected","selectAllSvg","selectAllBox","optgroupSelectAllBox","selectAllCheck","optgroupSelectAllCheck","currentSelected","newSelected","map","o5","optgroupClosable","optgroupClosableSvg","optgroupClosableArrow","some","o2","optionEl","split","dataClass","highlightText","searchHighlighter","currentTarget","elementID","shouldUpdate","destroy","completedString","regex","RegExp","matchStartPosition","index","matchEndPosition","originalTextFoundByRegex","mainHeight","contentHeight","containerRect","getBoundingClientRect","scrollY","scrollX","container","cTop","scrollTop","offsetTop","cBottom","clientHeight","eTop","eBottom","mainRect","innerHeight","hasSelectedItems","deselectButton","hideClass","Select","select","hideUI","showUI","changeListen","listen","observer","observe","subtree","childList","attributes","disconnect","valueChange","ev","onValueChange","getSelectedValues","observeCall","mutations","classChanged","disabledChanged","optgroupOptionChanged","attributeName","nodeName","onClassChange","onDisabledChange","onOptionsChange","nodes","getDataFromOptgroup","getDataFromOption","selectall","selectalltext","optgroupOptions","updateSelect","updateOptions","createOptgroup","createOption","optionClass","keys","removeEventListener","bind","passive","MutationObserver","SlimSelect","render","err","events","dataClean","runAfterChange","beforeOpen","afterOpen","clearInterval","setInterval","beforeClose","afterClose","searchResp","catch","message","documentClick","windowResize","windowScroll","windowVisibilityChange","config","hidden","selectEl","ssid","debounceEvents","multiple","selectAriaLabel","selectAriaLabelledBy","nextSibling","slim","factory","$197982d8c7a73e5f$var$toString","getPrototypeOf","$197982d8c7a73e5f$var$getPrototypeOf","$197982d8c7a73e5f$var$kindOf","cache","create","thing","$197982d8c7a73e5f$var$kindOfTest","$197982d8c7a73e5f$var$typeOfTest","$197982d8c7a73e5f$var$isArray","$197982d8c7a73e5f$var$isUndefined","$197982d8c7a73e5f$var$isArrayBuffer","$197982d8c7a73e5f$var$isString","$197982d8c7a73e5f$var$isFunction","$197982d8c7a73e5f$var$isNumber","$197982d8c7a73e5f$var$isObject","$197982d8c7a73e5f$var$isPlainObject","val","Symbol","toStringTag","iterator","$197982d8c7a73e5f$var$isDate","$197982d8c7a73e5f$var$isFile","$197982d8c7a73e5f$var$isBlob","$197982d8c7a73e5f$var$isFileList","$197982d8c7a73e5f$var$isURLSearchParams","$197982d8c7a73e5f$var$forEach","obj","allOwnKeys","getOwnPropertyNames","len","$197982d8c7a73e5f$var$findKey","_key","$197982d8c7a73e5f$var$_global","globalThis","$197982d8c7a73e5f$var$isContextDefined","$197982d8c7a73e5f$var$isTypedArray","TypedArray","Uint8Array","$197982d8c7a73e5f$var$isHTMLForm","$197982d8c7a73e5f$var$hasOwnProperty","hasOwnProperty1","prop","$197982d8c7a73e5f$var$isRegExp","$197982d8c7a73e5f$var$reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","defineProperties","$197982d8c7a73e5f$var$ALPHABET","ALPHA_DIGIT","$197982d8c7a73e5f$var$isAsyncFn","$197982d8c7a73e5f$export$2e2bcd8739ae039","isBuffer","kind","FormData","append","ArrayBuffer","isView","buffer","pipe","$197982d8c7a73e5f$var$merge","caseless","assignValue","targetKey","charCodeAt","superConstructor","props","defineProperty","assign","sourceObj","destObj","propFilter","merged","searchString","lastIndex","arr","next","done","pair","regExp","matches","exec","hasOwnProp","enumerable","writable","set","arrayOrString","delimiter","p2","defaultValue","Number","isFinite","global","size","alphabet","stack","visit","source","reducedValue","$0c07198b07c857d4$var$AxiosError","code","request","response","captureStackTrace","inherits","toJSON","description","number","fileName","lineNumber","columnNumber","toJSONObject","status","$0c07198b07c857d4$var$prototype","$0c07198b07c857d4$var$descriptors","customProps","axiosError","toFlatObject","cause","$d4ecdbf520e63dca$export$a143d493d941bafc","$034686670a8a195b$export$d622b2ad8d90c771","$034686670a8a195b$export$6100ba28696e12de","$0c07198b07c857d4$export$2e2bcd8739ae039","b64","tmp","lens","$034686670a8a195b$var$getLens","validLen","placeHoldersLen","$034686670a8a195b$var$Arr","$034686670a8a195b$var$_byteLength","curByte","len2","$034686670a8a195b$var$revLookup","uint8","len3","extraBytes","parts","maxChunkLength","$034686670a8a195b$var$encodeChunk","$034686670a8a195b$var$lookup","join","$454af19f7384844b$export$aafa59e2e03f2942","$454af19f7384844b$export$68d8715fc104d294","$034686670a8a195b$var$code","$034686670a8a195b$var$i","$034686670a8a195b$var$len","len1","start","end","num","output","offset","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","Infinity","pow","rt","abs","isNaN","floor","LN2","$d4ecdbf520e63dca$var$customInspectSymbol","$d4ecdbf520e63dca$var$Buffer","$d4ecdbf520e63dca$var$createBuffer","RangeError","buf","setPrototypeOf","arg","encodingOrOffset","TypeError","$d4ecdbf520e63dca$var$allocUnsafe","$d4ecdbf520e63dca$var$from","string","encoding","isEncoding","$d4ecdbf520e63dca$var$byteLength","actual","write","$d4ecdbf520e63dca$var$fromString","arrayView","$d4ecdbf520e63dca$var$isInstance","copy","$d4ecdbf520e63dca$var$fromArrayBuffer","byteOffset","byteLength","$d4ecdbf520e63dca$var$fromArrayLike","$d4ecdbf520e63dca$var$fromArrayView","SharedArrayBuffer","valueOf","$d4ecdbf520e63dca$var$checked","$d4ecdbf520e63dca$var$numberIsNaN","$d4ecdbf520e63dca$var$fromObject","toPrimitive","$d4ecdbf520e63dca$var$assertSize","array","mustMatch","loweredCase","$d4ecdbf520e63dca$var$utf8ToBytes","$d4ecdbf520e63dca$var$base64ToBytes","$d4ecdbf520e63dca$var$slowToString","$d4ecdbf520e63dca$var$hexSlice","$d4ecdbf520e63dca$var$utf8Slice","$d4ecdbf520e63dca$var$asciiSlice","$d4ecdbf520e63dca$var$latin1Slice","$d4ecdbf520e63dca$var$base64Slice","$d4ecdbf520e63dca$var$utf16leSlice","$d4ecdbf520e63dca$var$swap","$d4ecdbf520e63dca$var$bidirectionalIndexOf","$d4ecdbf520e63dca$var$arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","$d4ecdbf520e63dca$var$hexWrite","remaining","strLen","parsed","substr","$d4ecdbf520e63dca$var$utf8Write","$d4ecdbf520e63dca$var$blitBuffer","$d4ecdbf520e63dca$var$asciiWrite","byteArray","$d4ecdbf520e63dca$var$asciiToBytes","$d4ecdbf520e63dca$var$base64Write","$d4ecdbf520e63dca$var$ucs2Write","units","hi","lo","$d4ecdbf520e63dca$var$utf16leToBytes","min","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","codePoints","fromCharCode","$d4ecdbf520e63dca$var$decodeCodePointsArray","TYPED_ARRAY_SUPPORT","proto","foo","$d4ecdbf520e63dca$var$typedArraySupport","get","poolSize","alloc","fill","$d4ecdbf520e63dca$var$alloc","allocUnsafe","allocUnsafeSlow","_isBuffer","compare","pos","swap16","swap32","swap64","toLocaleString","equals","inspect","thisStart","thisEnd","thisCopy","targetCopy","_arr","ret","out","$d4ecdbf520e63dca$var$hexSliceLookupTable","bytes","$d4ecdbf520e63dca$var$checkOffset","ext","$d4ecdbf520e63dca$var$checkInt","$d4ecdbf520e63dca$var$wrtBigUInt64LE","$d4ecdbf520e63dca$var$checkIntBI","BigInt","$d4ecdbf520e63dca$var$wrtBigUInt64BE","$d4ecdbf520e63dca$var$checkIEEE754","$d4ecdbf520e63dca$var$writeFloat","littleEndian","noAssert","$d4ecdbf520e63dca$var$writeDouble","newBuf","subarray","readUintLE","readUIntLE","byteLength1","mul","readUintBE","readUIntBE","byteLength2","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readBigUInt64LE","$d4ecdbf520e63dca$var$defineBigIntMethod","$d4ecdbf520e63dca$var$validateNumber","first","last","$d4ecdbf520e63dca$var$boundsError","readBigUInt64BE","readIntLE","byteLength3","readIntBE","byteLength4","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readBigInt64LE","readBigInt64BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUintLE","writeUIntLE","byteLength5","writeUintBE","writeUIntBE","byteLength6","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeBigUInt64LE","writeBigUInt64BE","writeIntLE","byteLength7","limit","sub","writeIntBE","byteLength8","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeBigInt64LE","writeBigInt64BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","$d4ecdbf520e63dca$var$errors","$d4ecdbf520e63dca$var$E","sym","getMessage","Base","configurable","super","$d4ecdbf520e63dca$var$addNumericalSeparator","byteLength10","range","ERR_OUT_OF_RANGE","byteLength9","$d4ecdbf520e63dca$var$checkBounds","ERR_INVALID_ARG_TYPE","ERR_BUFFER_OUT_OF_BOUNDS","msg","received","isInteger","$d4ecdbf520e63dca$var$INVALID_BASE64_RE","leadSurrogate","$d4ecdbf520e63dca$var$base64clean","src","dst","table","i16","$d4ecdbf520e63dca$var$BufferBigIntNotDefined","$7734bfa34e03fc2a$var$isVisitable","isPlainObject","$7734bfa34e03fc2a$var$removeBrackets","endsWith","$7734bfa34e03fc2a$var$renderKey","token","$7734bfa34e03fc2a$var$predicates","test","$7734bfa34e03fc2a$export$2e2bcd8739ae039","formData","isObject","metaTokens","indexes","isUndefined","visitor","defaultVisitor","useBlob","Blob","isSpecCompliantForm","isFunction","convertValue","isDate","toISOString","isBlob","isArrayBuffer","isTypedArray","$7734bfa34e03fc2a$require$Buffer","$7734bfa34e03fc2a$var$isFlatArray","isFileList","toArray","el","exposedHelpers","build","isString","pop","$cc98c96c287b2efc$var$encode","charMap","encodeURIComponent","$cc98c96c287b2efc$var$AxiosURLSearchParams","params","_pairs","$cc98c96c287b2efc$var$prototype","encoder","_encode","$cc98c96c287b2efc$export$2e2bcd8739ae039","$2166c96446d6ea30$var$encode","$2166c96446d6ea30$export$2e2bcd8739ae039","url","encode","serializeFn","serialize","serializedParams","isURLSearchParams","hashmarkIndex","$41a1c1ac65ef962e$export$2e2bcd8739ae039","use","fulfilled","rejected","handlers","synchronous","runWhen","eject","clear","$1d5acd6ee4a1e450$export$2e2bcd8739ae039","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","$c88647090d2a1f73$export$2e2bcd8739ae039","isBrowser","URLSearchParams","product","navigator","WorkerGlobalScope","importScripts","protocols","$3fb98e26853e5168$export$2e2bcd8739ae039","helpers","isNode","$30b9a4ee1106a4de$export$2e2bcd8739ae039","buildPath","isNumericKey","isLast","$30b9a4ee1106a4de$var$arrayToObject","isFormData","entries","forEachEntry","matchAll","$30b9a4ee1106a4de$var$parsePropPath","$caf5cce0e605762b$var$DEFAULT_CONTENT_TYPE","$caf5cce0e605762b$var$defaults","transitional","adapter","transformRequest","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","isHTMLForm","isStream","isFile","isArrayBufferView","setContentType","formSerializer","_FormData","env","rawValue","parser","parse","$caf5cce0e605762b$var$stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","$caf5cce0e605762b$export$2e2bcd8739ae039","$6b3d4ca234f68ddb$var$ignoreDuplicateOf","toObjectSet","$6b3d4ca234f68ddb$export$2e2bcd8739ae039","rawHeaders","line","$bc98ecaa632caed0$var$$internals","$bc98ecaa632caed0$var$normalizeHeader","header","$bc98ecaa632caed0$var$normalizeValue","$bc98ecaa632caed0$var$matchHeaderValue","isHeaderNameFilter","isRegExp","$bc98ecaa632caed0$var$_iterator","$bc98ecaa632caed0$var$_toStringTag","$bc98ecaa632caed0$var$AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","findKey","setHeaders","tokens","tokensRE","$bc98ecaa632caed0$var$parseTokens","has","matcher","delete","deleted","deleteHeader","normalize","format","normalized","char","$bc98ecaa632caed0$var$formatHeader","targets","asStrings","static","computed","accessors","defineAccessor","accessorName","toCamelCase","methodName","arg1","arg2","arg3","$bc98ecaa632caed0$var$buildAccessors","accessor","freezeMethods","$bc98ecaa632caed0$export$2e2bcd8739ae039","$83709ffa15cc9b1e$export$2e2bcd8739ae039","fns","$ee4e77981fc99baa$export$2e2bcd8739ae039","__CANCEL__","$5dd8c74561f08d70$var$CanceledError","ERR_CANCELED","$5dd8c74561f08d70$export$2e2bcd8739ae039","$1623641cb5783008$export$2e2bcd8739ae039","resolve","reject","ERR_BAD_REQUEST","$f3627a5d0641603b$export$2e2bcd8739ae039","isStandardBrowserEnv","expires","domain","secure","cookie","isNumber","Date","toGMTString","decodeURIComponent","now","$691cc630f9ef56b2$export$2e2bcd8739ae039","baseURL","relativeURL","$1746cdb16526768b$export$2e2bcd8739ae039","requestedURL","$bb07efa23107e01d$export$2e2bcd8739ae039","msie","userAgent","urlParsingNode","originURL","resolveURL","href","protocol","host","hash","hostname","port","pathname","charAt","location","requestURL","$6357329dd8712192$export$2e2bcd8739ae039","$43b00c9657a44656$export$2e2bcd8739ae039","samplesCount","timestamps","firstSampleTS","tail","chunkLength","startedAt","bytesCount","passed","$73b5cdc05ac72ecf$var$progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","$a776da890889b002$var$knownAdapters","http","xhr","XMLHttpRequest","requestData","requestHeaders","onCanceled","cancelToken","unsubscribe","signal","isStandardBrowserWebWorkerEnv","auth","username","password","unescape","btoa","fullPath","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","paramsSerializer","onreadystatechange","readyState","responseURL","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","xsrfValue","withCredentials","setRequestHeader","onDownloadProgress","onUploadProgress","upload","cancel","abort","subscribe","aborted","send","$a776da890889b002$export$2e2bcd8739ae039","getAdapter","adapters","nameOrAdapter","$acd9f6ce0996c2c9$var$throwIfCancellationRequested","throwIfRequested","$acd9f6ce0996c2c9$export$2e2bcd8739ae039","reason","$978ae1e75118f535$var$headersToObject","$978ae1e75118f535$export$2e2bcd8739ae039","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","timeoutMessage","decompress","beforeRedirect","transport","httpAgent","httpsAgent","socketPath","responseEncoding","configValue","$4c84c2d525dc977b$var$validators","$4c84c2d525dc977b$var$deprecatedWarnings","validator","version","formatMessage","desc","opts","ERR_DEPRECATED","warn","$4c84c2d525dc977b$export$2e2bcd8739ae039","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","$4ca0095817960ee3$var$validators","validators","$4ca0095817960ee3$var$Axios","configOrUrl","defaults","contextHeaders","assertOptions","boolean","function","requestInterceptorChain","synchronousRequestInterceptors","interceptors","interceptor","unshift","responseInterceptorChain","promise","chain","newConfig","onFulfilled","onRejected","getUri","instanceConfig","generateHTTPMethod","isForm","$4ca0095817960ee3$export$2e2bcd8739ae039","$1c9d2783569136b3$var$CancelToken","_listeners","splice","executor","resolvePromise","onfulfilled","_resolve","$1c9d2783569136b3$export$2e2bcd8739ae039","$dfc4e5689184d2bd$var$HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","$dfc4e5689184d2bd$export$2e2bcd8739ae039","$8a2573892eafc323$var$axios","$8a2573892eafc323$var$createInstance","defaultConfig","instance","extend","Axios","CanceledError","CancelToken","isCancel","VERSION","toFormData","AxiosError","Cancel","all","promises","spread","callback","isAxiosError","payload","mergeConfig","AxiosHeaders","formToJSON","HttpStatusCode","default","$8a2573892eafc323$export$2e2bcd8739ae039","$1c9bd35df1aeff0f$export$1c00760e9e5a4e95","$1c9bd35df1aeff0f$export$c1fbed17c2f6a328","$1c9bd35df1aeff0f$export$1ab0c6b20d94fa14","$1c9bd35df1aeff0f$export$3b22524397b493c6","$1c9bd35df1aeff0f$export$fd08e3cb425f0d61","$1c9bd35df1aeff0f$export$a4ad2735b021c132","$1c9bd35df1aeff0f$export$84bf76cd7afc7469","$1c9bd35df1aeff0f$export$848c9b7ead0df967","$1c9bd35df1aeff0f$export$fbafdbe06a5b5a9a","$1c9bd35df1aeff0f$export$3ae0fd4797ed47c8","$1c9bd35df1aeff0f$export$10ae0d317ea97f8b","$1c9bd35df1aeff0f$export$4e7d6ff0f3e6520","$1c9bd35df1aeff0f$export$a972f69c851492b3","$1c9bd35df1aeff0f$export$86d7c59254d6a2c9","$1c9bd35df1aeff0f$export$7ec1ebcfa9d8bd6a","$85a5f86b715fe7db$var$selectBreed","$85a5f86b715fe7db$var$loaderItem","$85a5f86b715fe7db$var$divInfoCat","$85a5f86b715fe7db$var$sectionLoad","URL","$85a5f86b715fe7db$var$showCat","infoCat","markup","breeds","temperament","$85a5f86b715fe7db$var$errorGetInfoCat","$85a5f86b715fe7db$var$BASE_URL","dataCat","elem","$parcel$interopDefault","breedId"],"version":3,"file":"index.4d8b7ef8.js.map"}
\ No newline at end of file
diff --git a/index.4d8b7ef8.js b/index.eacd005f.js
similarity index 99%
rename from index.4d8b7ef8.js
rename to index.eacd005f.js
index 535ea13..bf9503e 100644
--- a/index.4d8b7ef8.js
+++ b/index.eacd005f.js
@@ -1,3 +1,3 @@
function t(t){return t&&t.__esModule?t.default:t}var e,i,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o={};e=void 0===n?"undefined"==typeof window?o:window:n,i=function(t){if(void 0===t&&void 0===t.document)return!1;var e,i,n,o,s,a="\n\nVisit documentation page to learn more: https://notiflix.github.io/documentation",r='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',l="Success",c="Failure",f="Warning",p="Info",d={wrapID:"NotiflixNotifyWrap",overlayID:"NotiflixNotifyOverlay",width:"280px",position:"right-top",distance:"10px",opacity:1,borderRadius:"5px",rtl:!1,timeout:3e3,messageMaxLength:110,backOverlay:!1,backOverlayColor:"rgba(0,0,0,0.5)",plainText:!0,showOnlyTheLastOne:!1,clickToClose:!1,pauseOnHover:!0,ID:"NotiflixNotify",className:"notiflix-notify",zindex:4001,fontFamily:"Quicksand",fontSize:"13px",cssAnimation:!0,cssAnimationDuration:400,cssAnimationStyle:"fade",closeButton:!1,useIcon:!0,useFontAwesome:!1,fontAwesomeIconStyle:"basic",fontAwesomeIconSize:"34px",success:{background:"#32c682",textColor:"#fff",childClassName:"notiflix-notify-success",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-check-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(50,198,130,0.2)"},failure:{background:"#ff5549",textColor:"#fff",childClassName:"notiflix-notify-failure",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-times-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(255,85,73,0.2)"},warning:{background:"#eebf31",textColor:"#fff",childClassName:"notiflix-notify-warning",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-exclamation-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(238,191,49,0.2)"},info:{background:"#26c0d3",textColor:"#fff",childClassName:"notiflix-notify-info",notiflixIconColor:"rgba(0,0,0,0.2)",fontAwesomeClassName:"fas fa-info-circle",fontAwesomeIconColor:"rgba(0,0,0,0.2)",backOverlayColor:"rgba(38,192,211,0.2)"}},u="Success",h="Failure",m="Warning",g="Info",b={ID:"NotiflixReportWrap",className:"notiflix-report",width:"320px",backgroundColor:"#f8f8f8",borderRadius:"25px",rtl:!1,zindex:4002,backOverlay:!0,backOverlayColor:"rgba(0,0,0,0.5)",backOverlayClickToClose:!1,fontFamily:"Quicksand",svgSize:"110px",plainText:!0,titleFontSize:"16px",titleMaxLength:34,messageFontSize:"13px",messageMaxLength:400,buttonFontSize:"14px",buttonMaxLength:34,cssAnimation:!0,cssAnimationDuration:360,cssAnimationStyle:"fade",success:{svgColor:"#32c682",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#32c682",buttonColor:"#fff",backOverlayColor:"rgba(50,198,130,0.2)"},failure:{svgColor:"#ff5549",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#ff5549",buttonColor:"#fff",backOverlayColor:"rgba(255,85,73,0.2)"},warning:{svgColor:"#eebf31",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#eebf31",buttonColor:"#fff",backOverlayColor:"rgba(238,191,49,0.2)"},info:{svgColor:"#26c0d3",titleColor:"#1e1e1e",messageColor:"#242424",buttonBackground:"#26c0d3",buttonColor:"#fff",backOverlayColor:"rgba(38,192,211,0.2)"}},x="Show",y="Ask",w="Prompt",v={ID:"NotiflixConfirmWrap",className:"notiflix-confirm",width:"300px",zindex:4003,position:"center",distance:"10px",backgroundColor:"#f8f8f8",borderRadius:"25px",backOverlay:!0,backOverlayColor:"rgba(0,0,0,0.5)",rtl:!1,fontFamily:"Quicksand",cssAnimation:!0,cssAnimationDuration:300,cssAnimationStyle:"fade",plainText:!0,titleColor:"#32c682",titleFontSize:"16px",titleMaxLength:34,messageColor:"#1e1e1e",messageFontSize:"14px",messageMaxLength:110,buttonsFontSize:"15px",buttonsMaxLength:34,okButtonColor:"#f8f8f8",okButtonBackground:"#32c682",cancelButtonColor:"#f8f8f8",cancelButtonBackground:"#a9a9a9"},k="Standard",N="Hourglass",C="Circle",E="Arrows",S="Dots",L="Pulse",A="Custom",O="Notiflix",T={ID:"NotiflixLoadingWrap",className:"notiflix-loading",zindex:4e3,backgroundColor:"rgba(0,0,0,0.8)",rtl:!1,fontFamily:"Quicksand",cssAnimation:!0,cssAnimationDuration:400,clickToClose:!1,customSvgUrl:null,customSvgCode:null,svgSize:"80px",svgColor:"#32c682",messageID:"NotiflixLoadingMessage",messageFontSize:"15px",messageMaxLength:34,messageColor:"#dcdcdc"},B="Standard",R="Hourglass",z="Circle",I="Arrows",M="Dots",D="Pulse",j={ID:"NotiflixBlockWrap",querySelectorLimit:200,className:"notiflix-block",position:"absolute",zindex:1e3,backgroundColor:"rgba(255,255,255,0.9)",rtl:!1,fontFamily:"Quicksand",cssAnimation:!0,cssAnimationDuration:300,svgSize:"45px",svgColor:"#383838",messageFontSize:"14px",messageMaxLength:34,messageColor:"#383838"},U=function(t){return console.error("%c Notiflix Error ","padding:2px;border-radius:20px;color:#fff;background:#ff5549","\n"+t+a)},F=function(t){return console.log("%c Notiflix Info ","padding:2px;border-radius:20px;color:#fff;background:#26c0d3","\n"+t+a)},W=function(e){return e||(e="head"),null!==t.document[e]||(U('\nNotiflix needs to be appended to the "<'+e+'>" element, but you called it before the "<'+e+'>" element has been created.'),!1)},P=function(e,i){if(!W("head"))return!1;if(null!==e()&&!t.document.getElementById(i)){var n=t.document.createElement("style");n.id=i,n.innerHTML=e(),t.document.head.appendChild(n)}},X=function(){var t={},e=!1,i=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],i++);for(var n=function(i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=e&&"[object Object]"===Object.prototype.toString.call(i[n])?X(t[n],i[n]):i[n])};i'},V=function(t,e){return t||(t="60px"),e||(e="#32c682"),''},q=function(t,e){return t||(t="60px"),e||(e="#32c682"),''},$=function(t,e){return t||(t="60px"),e||(e="#32c682"),''},J=function(t,e){return t||(t="60px"),e||(e="#32c682"),''},G=function(t,e){return t||(t="60px"),e||(e="#32c682"),''},Q=function(){return'[id^=NotiflixNotifyWrap]{pointer-events:none;position:fixed;z-index:4001;opacity:1;right:10px;top:10px;width:280px;max-width:96%;-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent}[id^=NotiflixNotifyWrap].nx-flex-center-center{max-height:calc(100vh - 20px);overflow-x:hidden;overflow-y:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:auto}[id^=NotiflixNotifyWrap]::-webkit-scrollbar{width:0;height:0}[id^=NotiflixNotifyWrap]::-webkit-scrollbar-thumb{background:transparent}[id^=NotiflixNotifyWrap]::-webkit-scrollbar-track{background:transparent}[id^=NotiflixNotifyWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixNotifyOverlay]{-webkit-transition:background .3s ease-in-out;-o-transition:background .3s ease-in-out;transition:background .3s ease-in-out}[id^=NotiflixNotifyWrap]>div{pointer-events:all;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;position:relative;margin:0 0 10px;border-radius:5px;background:#1e1e1e;color:#fff;padding:10px 12px;font-size:14px;line-height:1.4}[id^=NotiflixNotifyWrap]>div:last-child{margin:0}[id^=NotiflixNotifyWrap]>div.nx-with-callback{cursor:pointer}[id^=NotiflixNotifyWrap]>div.nx-with-icon{padding:8px;min-height:56px}[id^=NotiflixNotifyWrap]>div.nx-paused{cursor:auto}[id^=NotiflixNotifyWrap]>div.nx-notify-click-to-close{cursor:pointer}[id^=NotiflixNotifyWrap]>div.nx-with-close-button{padding:10px 36px 10px 12px}[id^=NotiflixNotifyWrap]>div.nx-with-icon.nx-with-close-button{padding:6px 36px 6px 6px}[id^=NotiflixNotifyWrap]>div>span.nx-message{cursor:inherit;font-weight:normal;font-family:inherit!important;word-break:break-all;word-break:break-word}[id^=NotiflixNotifyWrap]>div>span.nx-close-button{cursor:pointer;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:absolute;right:8px;top:0;bottom:0;margin:auto;color:inherit;width:20px;height:20px}[id^=NotiflixNotifyWrap]>div>span.nx-close-button:hover{-webkit-transform:rotate(90deg);transform:rotate(90deg)}[id^=NotiflixNotifyWrap]>div>span.nx-close-button>svg{position:absolute;width:16px;height:16px;right:2px;top:2px}[id^=NotiflixNotifyWrap]>div>.nx-message-icon{position:absolute;width:40px;height:40px;font-size:30px;line-height:40px;text-align:center;left:8px;top:0;bottom:0;margin:auto;border-radius:inherit}[id^=NotiflixNotifyWrap]>div>.nx-message-icon-fa.nx-message-icon-fa-shadow{color:inherit;background:rgba(0,0,0,.15);-webkit-box-shadow:inset 0 0 34px rgba(0,0,0,.2);box-shadow:inset 0 0 34px rgba(0,0,0,.2);text-shadow:0 0 10px rgba(0,0,0,.3)}[id^=NotiflixNotifyWrap]>div>span.nx-with-icon{position:relative;float:left;width:calc(100% - 40px);margin:0 0 0 40px;padding:0 0 0 10px;-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixNotifyWrap]>div.nx-rtl-on>.nx-message-icon{left:auto;right:8px}[id^=NotiflixNotifyWrap]>div.nx-rtl-on>span.nx-with-icon{padding:0 10px 0 0;margin:0 40px 0 0}[id^=NotiflixNotifyWrap]>div.nx-rtl-on>span.nx-close-button{right:auto;left:8px}[id^=NotiflixNotifyWrap]>div.nx-with-icon.nx-with-close-button.nx-rtl-on{padding:6px 6px 6px 36px}[id^=NotiflixNotifyWrap]>div.nx-with-close-button.nx-rtl-on{padding:10px 12px 10px 36px}[id^=NotiflixNotifyOverlay].nx-with-animation,[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-fade{-webkit-animation:notify-animation-fade .3s ease-in-out 0s normal;animation:notify-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes notify-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-zoom{-webkit-animation:notify-animation-zoom .3s ease-in-out 0s normal;animation:notify-animation-zoom .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-zoom{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes notify-animation-zoom{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(1);transform:scale(1)}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-right{-webkit-animation:notify-animation-from-right .3s ease-in-out 0s normal;animation:notify-animation-from-right .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-right{0%{right:-300px;opacity:0}50%{right:8px;opacity:1}100%{right:0;opacity:1}}@keyframes notify-animation-from-right{0%{right:-300px;opacity:0}50%{right:8px;opacity:1}100%{right:0;opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-left{-webkit-animation:notify-animation-from-left .3s ease-in-out 0s normal;animation:notify-animation-from-left .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-left{0%{left:-300px;opacity:0}50%{left:8px;opacity:1}100%{left:0;opacity:1}}@keyframes notify-animation-from-left{0%{left:-300px;opacity:0}50%{left:8px;opacity:1}100%{left:0;opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-top{-webkit-animation:notify-animation-from-top .3s ease-in-out 0s normal;animation:notify-animation-from-top .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-top{0%{top:-50px;opacity:0}50%{top:8px;opacity:1}100%{top:0;opacity:1}}@keyframes notify-animation-from-top{0%{top:-50px;opacity:0}50%{top:8px;opacity:1}100%{top:0;opacity:1}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-bottom{-webkit-animation:notify-animation-from-bottom .3s ease-in-out 0s normal;animation:notify-animation-from-bottom .3s ease-in-out 0s normal}@-webkit-keyframes notify-animation-from-bottom{0%{bottom:-50px;opacity:0}50%{bottom:8px;opacity:1}100%{bottom:0;opacity:1}}@keyframes notify-animation-from-bottom{0%{bottom:-50px;opacity:0}50%{bottom:8px;opacity:1}100%{bottom:0;opacity:1}}[id^=NotiflixNotifyOverlay].nx-with-animation.nx-remove,[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-fade.nx-remove{opacity:0;-webkit-animation:notify-remove-fade .3s ease-in-out 0s normal;animation:notify-remove-fade .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-fade{0%{opacity:1}100%{opacity:0}}@keyframes notify-remove-fade{0%{opacity:1}100%{opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-zoom.nx-remove{-webkit-transform:scale(0);transform:scale(0);-webkit-animation:notify-remove-zoom .3s ease-in-out 0s normal;animation:notify-remove-zoom .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-zoom{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(0);transform:scale(0)}}@keyframes notify-remove-zoom{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.05);transform:scale(1.05)}100%{-webkit-transform:scale(0);transform:scale(0)}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-top.nx-remove{opacity:0;-webkit-animation:notify-remove-to-top .3s ease-in-out 0s normal;animation:notify-remove-to-top .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-top{0%{top:0;opacity:1}50%{top:8px;opacity:1}100%{top:-50px;opacity:0}}@keyframes notify-remove-to-top{0%{top:0;opacity:1}50%{top:8px;opacity:1}100%{top:-50px;opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-right.nx-remove{opacity:0;-webkit-animation:notify-remove-to-right .3s ease-in-out 0s normal;animation:notify-remove-to-right .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-right{0%{right:0;opacity:1}50%{right:8px;opacity:1}100%{right:-300px;opacity:0}}@keyframes notify-remove-to-right{0%{right:0;opacity:1}50%{right:8px;opacity:1}100%{right:-300px;opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-bottom.nx-remove{opacity:0;-webkit-animation:notify-remove-to-bottom .3s ease-in-out 0s normal;animation:notify-remove-to-bottom .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-bottom{0%{bottom:0;opacity:1}50%{bottom:8px;opacity:1}100%{bottom:-50px;opacity:0}}@keyframes notify-remove-to-bottom{0%{bottom:0;opacity:1}50%{bottom:8px;opacity:1}100%{bottom:-50px;opacity:0}}[id^=NotiflixNotifyWrap]>div.nx-with-animation.nx-from-left.nx-remove{opacity:0;-webkit-animation:notify-remove-to-left .3s ease-in-out 0s normal;animation:notify-remove-to-left .3s ease-in-out 0s normal}@-webkit-keyframes notify-remove-to-left{0%{left:0;opacity:1}50%{left:8px;opacity:1}100%{left:-300px;opacity:0}}@keyframes notify-remove-to-left{0%{left:0;opacity:1}50%{left:8px;opacity:1}100%{left:-300px;opacity:0}}'},Y=0,K=function(i,n,o,s){if(!W("body"))return!1;e||lt.Notify.init({});var a=X(!0,e,{});if("object"==typeof o&&!Array.isArray(o)||"object"==typeof s&&!Array.isArray(s)){var u={};"object"==typeof o?u=o:"object"==typeof s&&(u=s),e=X(!0,e,u)}var h=e[i.toLocaleLowerCase("en")];Y++,"string"!=typeof n&&(n="Notiflix "+i),e.plainText&&(n=_(n)),!e.plainText&&n.length>e.messageMaxLength&&(e=X(!0,e,{closeButton:!0,messageMaxLength:150}),n='Possible HTML Tags Error: The "plainText" option is "false" and the notification content length is more than the "messageMaxLength" option.'),n.length>e.messageMaxLength&&(n=n.substring(0,e.messageMaxLength)+"..."),"shadow"===e.fontAwesomeIconStyle&&(h.fontAwesomeIconColor=h.background),e.cssAnimation||(e.cssAnimationDuration=0);var m=t.document.getElementById(d.wrapID)||t.document.createElement("div");if(m.id=d.wrapID,m.style.width=e.width,m.style.zIndex=e.zindex,m.style.opacity=e.opacity,"center-center"===e.position?(m.style.left=e.distance,m.style.top=e.distance,m.style.right=e.distance,m.style.bottom=e.distance,m.style.margin="auto",m.classList.add("nx-flex-center-center"),m.style.maxHeight="calc((100vh - "+e.distance+") - "+e.distance+")",m.style.display="flex",m.style.flexWrap="wrap",m.style.flexDirection="column",m.style.justifyContent="center",m.style.alignItems="center",m.style.pointerEvents="none"):"center-top"===e.position?(m.style.left=e.distance,m.style.right=e.distance,m.style.top=e.distance,m.style.bottom="auto",m.style.margin="auto"):"center-bottom"===e.position?(m.style.left=e.distance,m.style.right=e.distance,m.style.bottom=e.distance,m.style.top="auto",m.style.margin="auto"):"right-bottom"===e.position?(m.style.right=e.distance,m.style.bottom=e.distance,m.style.top="auto",m.style.left="auto"):"left-top"===e.position?(m.style.left=e.distance,m.style.top=e.distance,m.style.right="auto",m.style.bottom="auto"):"left-bottom"===e.position?(m.style.left=e.distance,m.style.bottom=e.distance,m.style.top="auto",m.style.right="auto"):(m.style.right=e.distance,m.style.top=e.distance,m.style.left="auto",m.style.bottom="auto"),e.backOverlay){var g=t.document.getElementById(d.overlayID)||t.document.createElement("div");g.id=d.overlayID,g.style.width="100%",g.style.height="100%",g.style.position="fixed",g.style.zIndex=e.zindex-1,g.style.left=0,g.style.top=0,g.style.right=0,g.style.bottom=0,g.style.background=h.backOverlayColor||e.backOverlayColor,g.className=e.cssAnimation?"nx-with-animation":"",g.style.animationDuration=e.cssAnimation?e.cssAnimationDuration+"ms":"",t.document.getElementById(d.overlayID)||t.document.body.appendChild(g)}t.document.getElementById(d.wrapID)||t.document.body.appendChild(m);var b=t.document.createElement("div");b.id=e.ID+"-"+Y,b.className=e.className+" "+h.childClassName+" "+(e.cssAnimation?"nx-with-animation":"")+" "+(e.useIcon?"nx-with-icon":"")+" nx-"+e.cssAnimationStyle+" "+(e.closeButton&&"function"!=typeof o?"nx-with-close-button":"")+" "+("function"==typeof o?"nx-with-callback":"")+" "+(e.clickToClose?"nx-notify-click-to-close":""),b.style.fontSize=e.fontSize,b.style.color=h.textColor,b.style.background=h.background,b.style.borderRadius=e.borderRadius,b.style.pointerEvents="all",e.rtl&&(b.setAttribute("dir","rtl"),b.classList.add("nx-rtl-on")),b.style.fontFamily='"'+e.fontFamily+'", '+r,e.cssAnimation&&(b.style.animationDuration=e.cssAnimationDuration+"ms");var x="";if(e.closeButton&&"function"!=typeof o&&(x=''),e.useIcon)if(e.useFontAwesome)b.innerHTML=''+n+""+(e.closeButton?x:"");else{var y="";i===l?y='':i===c?y='':i===f?y='':i===p&&(y=''),b.innerHTML=y+''+n+""+(e.closeButton?x:"")}else b.innerHTML=''+n+""+(e.closeButton?x:"");if("left-bottom"===e.position||"right-bottom"===e.position){var w=t.document.getElementById(d.wrapID);w.insertBefore(b,w.firstChild)}else t.document.getElementById(d.wrapID).appendChild(b);var v=t.document.getElementById(b.id);if(v){var k,N,C=function(){v.classList.add("nx-remove");var e=t.document.getElementById(d.overlayID);e&&0>=m.childElementCount&&e.classList.add("nx-remove"),clearTimeout(k)},E=function(){if(v&&null!==v.parentNode&&v.parentNode.removeChild(v),0>=m.childElementCount&&null!==m.parentNode){m.parentNode.removeChild(m);var e=t.document.getElementById(d.overlayID);e&&null!==e.parentNode&&e.parentNode.removeChild(e)}clearTimeout(N)};if(e.closeButton&&"function"!=typeof o&&t.document.getElementById(b.id).querySelector("span.nx-close-button").addEventListener("click",(function(){C();var t=setTimeout((function(){E(),clearTimeout(t)}),e.cssAnimationDuration)})),("function"==typeof o||e.clickToClose)&&v.addEventListener("click",(function(){"function"==typeof o&&o(),C();var t=setTimeout((function(){E(),clearTimeout(t)}),e.cssAnimationDuration)})),!e.closeButton&&"function"!=typeof o){var S=function(){k=setTimeout((function(){C()}),e.timeout),N=setTimeout((function(){E()}),e.timeout+e.cssAnimationDuration)};S(),e.pauseOnHover&&(v.addEventListener("mouseenter",(function(){v.classList.add("nx-paused"),clearTimeout(k),clearTimeout(N)})),v.addEventListener("mouseleave",(function(){v.classList.remove("nx-paused"),S()})))}}if(e.showOnlyTheLastOne&&0div[class*="-overlay"]{width:100%;height:100%;left:0;top:0;background:rgba(255,255,255,.5);position:fixed;z-index:0}[id^=NotiflixReportWrap]>div.nx-report-click-to-close{cursor:pointer}[id^=NotiflixReportWrap]>div[class*="-content"]{width:320px;max-width:100%;max-height:96vh;overflow-x:hidden;overflow-y:auto;border-radius:inherit;padding:10px;-webkit-filter:drop-shadow(0 0 5px rgba(0,0,0,0.05));filter:drop-shadow(0 0 5px rgba(0, 0, 0, .05));border:1px solid rgba(0,0,0,.03);background:#f8f8f8;position:relative;z-index:1}[id^=NotiflixReportWrap]>div[class*="-content"]::-webkit-scrollbar{width:0;height:0}[id^=NotiflixReportWrap]>div[class*="-content"]::-webkit-scrollbar-thumb{background:transparent}[id^=NotiflixReportWrap]>div[class*="-content"]::-webkit-scrollbar-track{background:transparent}[id^=NotiflixReportWrap]>div[class*="-content"]>div[class$="-icon"]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:110px;height:110px;display:block;margin:6px auto 12px}[id^=NotiflixReportWrap]>div[class*="-content"]>div[class$="-icon"] svg{min-width:100%;max-width:100%;height:auto}[id^=NotiflixReportWrap]>*>h5{word-break:break-all;word-break:break-word;font-family:inherit!important;font-size:16px;font-weight:500;line-height:1.4;margin:0 0 10px;padding:0 0 10px;border-bottom:1px solid rgba(0,0,0,.1);float:left;width:100%;text-align:center}[id^=NotiflixReportWrap]>*>p{word-break:break-all;word-break:break-word;font-family:inherit!important;font-size:13px;line-height:1.4;font-weight:normal;float:left;width:100%;padding:0 10px;margin:0 0 10px}[id^=NotiflixReportWrap] a#NXReportButton{word-break:break-all;word-break:break-word;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:inherit!important;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;cursor:pointer;float:right;padding:7px 17px;background:#32c682;font-size:14px;line-height:1.4;font-weight:500;border-radius:inherit!important;color:#fff}[id^=NotiflixReportWrap] a#NXReportButton:hover{-webkit-box-shadow:inset 0 -60px 5px -5px rgba(0,0,0,.25);box-shadow:inset 0 -60px 5px -5px rgba(0,0,0,.25)}[id^=NotiflixReportWrap].nx-rtl-on a#NXReportButton{float:left}[id^=NotiflixReportWrap]>div[class*="-overlay"].nx-with-animation{-webkit-animation:report-overlay-animation .3s ease-in-out 0s normal;animation:report-overlay-animation .3s ease-in-out 0s normal}@-webkit-keyframes report-overlay-animation{0%{opacity:0}100%{opacity:1}}@keyframes report-overlay-animation{0%{opacity:0}100%{opacity:1}}[id^=NotiflixReportWrap]>div[class*="-content"].nx-with-animation.nx-fade{-webkit-animation:report-animation-fade .3s ease-in-out 0s normal;animation:report-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes report-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixReportWrap]>div[class*="-content"].nx-with-animation.nx-zoom{-webkit-animation:report-animation-zoom .3s ease-in-out 0s normal;animation:report-animation-zoom .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-zoom{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes report-animation-zoom{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}50%{opacity:1;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}[id^=NotiflixReportWrap].nx-remove>div[class*="-overlay"].nx-with-animation{opacity:0;-webkit-animation:report-overlay-animation-remove .3s ease-in-out 0s normal;animation:report-overlay-animation-remove .3s ease-in-out 0s normal}@-webkit-keyframes report-overlay-animation-remove{0%{opacity:1}100%{opacity:0}}@keyframes report-overlay-animation-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixReportWrap].nx-remove>div[class*="-content"].nx-with-animation.nx-fade{opacity:0;-webkit-animation:report-animation-fade-remove .3s ease-in-out 0s normal;animation:report-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes report-animation-fade-remove{0%{opacity:1}100%{opacity:0}}[id^=NotiflixReportWrap].nx-remove>div[class*="-content"].nx-with-animation.nx-zoom{opacity:0;-webkit-animation:report-animation-zoom-remove .3s ease-in-out 0s normal;animation:report-animation-zoom-remove .3s ease-in-out 0s normal}@-webkit-keyframes report-animation-zoom-remove{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:.5;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes report-animation-zoom-remove{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}50%{opacity:.5;-webkit-transform:scale(1.05);transform:scale(1.05)}100%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}'},tt=function(e,n,o,s,a,l){if(!W("body"))return!1;i||lt.Report.init({});var c={};if("object"==typeof a&&!Array.isArray(a)||"object"==typeof l&&!Array.isArray(l)){var f={};"object"==typeof a?f=a:"object"==typeof l&&(f=l),c=X(!0,i,{}),i=X(!0,i,f)}var p=i[e.toLocaleLowerCase("en")];"string"!=typeof n&&(n="Notiflix "+e),"string"!=typeof o&&(e===u?o='"Do not try to become a person of success but try to become a person of value."
- Albert Einstein':e===h?o='"Failure is simply the opportunity to begin again, this time more intelligently."
- Henry Ford':e===m?o='"The peoples who want to live comfortably without producing and fatigue; they are doomed to lose their dignity, then liberty, and then independence and destiny."
- Mustafa Kemal Ataturk':e===g&&(o='"Knowledge rests not upon truth alone, but upon error also."
- Carl Gustav Jung')),"string"!=typeof s&&(s="Okay"),i.plainText&&(n=_(n),o=_(o),s=_(s)),i.plainText||(n.length>i.titleMaxLength&&(n="Possible HTML Tags Error",o='The "plainText" option is "false" and the title content length is more than the "titleMaxLength" option.',s="Okay"),o.length>i.messageMaxLength&&(n="Possible HTML Tags Error",o='The "plainText" option is "false" and the message content length is more than the "messageMaxLength" option.',s="Okay"),s.length>i.buttonMaxLength&&(n="Possible HTML Tags Error",o='The "plainText" option is "false" and the button content length is more than the "buttonMaxLength" option.',s="Okay")),n.length>i.titleMaxLength&&(n=n.substring(0,i.titleMaxLength)+"..."),o.length>i.messageMaxLength&&(o=o.substring(0,i.messageMaxLength)+"..."),s.length>i.buttonMaxLength&&(s=s.substring(0,i.buttonMaxLength)+"..."),i.cssAnimation||(i.cssAnimationDuration=0);var d=t.document.createElement("div");d.id=b.ID,d.className=i.className,d.style.zIndex=i.zindex,d.style.borderRadius=i.borderRadius,d.style.fontFamily='"'+i.fontFamily+'", '+r,i.rtl&&(d.setAttribute("dir","rtl"),d.classList.add("nx-rtl-on")),d.style.display="flex",d.style.flexWrap="wrap",d.style.flexDirection="column",d.style.alignItems="center",d.style.justifyContent="center";var x="",y=!0===i.backOverlayClickToClose;i.backOverlay&&(x='');var w,v,k="";if(e===u?(w=i.svgSize,v=p.svgColor,w||(w="110px"),v||(v="#32c682"),k=''):e===h?k=function(t,e){return t||(t="110px"),e||(e="#ff5549"),''}(i.svgSize,p.svgColor):e===m?k=function(t,e){return t||(t="110px"),e||(e="#eebf31"),''}(i.svgSize,p.svgColor):e===g&&(k=function(t,e){return t||(t="110px"),e||(e="#26c0d3"),''}(i.svgSize,p.svgColor)),d.innerHTML=x+'
"),o.cssAnimation||(o.cssAnimationDuration=0);var d="";if(e===k)d=H(o.svgSize,o.svgColor);else if(e===N)d=V(o.svgSize,o.svgColor);else if(e===C)d=q(o.svgSize,o.svgColor);else if(e===E)d=$(o.svgSize,o.svgColor);else if(e===S)d=J(o.svgSize,o.svgColor);else if(e===L)d=G(o.svgSize,o.svgColor);else if(e===A&&null!==o.customSvgCode&&null===o.customSvgUrl)d=o.customSvgCode||"";else if(e===A&&null!==o.customSvgUrl&&null===o.customSvgCode)d='';else{if(e===A&&(null===o.customSvgUrl||null===o.customSvgCode))return U('You have to set a static SVG url to "customSvgUrl" option to use Loading Custom.'),!1;d=function(t,e,i){return t||(t="60px"),e||(e="#f8f8f8"),i||(i="#32c682"),''}(o.svgSize,"#f8f8f8","#32c682")}var u=parseInt((o.svgSize||"").replace(/[^0-9]/g,"")),h=t.innerWidth,m=u>=h?h-40+"px":u+"px",g='
'+d+"
",b=t.document.createElement("div");b.id=T.ID,b.className=o.className+(o.cssAnimation?" nx-with-animation":"")+(o.clickToClose?" nx-loading-click-to-close":""),b.style.zIndex=o.zindex,b.style.background=o.backgroundColor,b.style.animationDuration=o.cssAnimationDuration+"ms",b.style.fontFamily='"'+o.fontFamily+'", '+r,b.style.display="flex",b.style.flexWrap="wrap",b.style.flexDirection="column",b.style.alignItems="center",b.style.justifyContent="center",o.rtl&&(b.setAttribute("dir","rtl"),b.classList.add("nx-rtl-on")),b.innerHTML=g+p,!t.document.getElementById(b.id)&&(t.document.body.appendChild(b),o.clickToClose)&&t.document.getElementById(b.id).addEventListener("click",(function(){b.classList.add("nx-remove");var t=setTimeout((function(){null!==b.parentNode&&(b.parentNode.removeChild(b),clearTimeout(t))}),o.cssAnimationDuration)}))}else if(t.document.getElementById(T.ID))var x=t.document.getElementById(T.ID),y=setTimeout((function(){x.classList.add("nx-remove");var t=setTimeout((function(){null!==x.parentNode&&(x.parentNode.removeChild(x),clearTimeout(t))}),o.cssAnimationDuration);clearTimeout(y)}),a);o=X(!0,o,l)},st=function(){return'[id^=NotiflixBlockWrap]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1000;font-family:"Quicksand",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:rgba(255,255,255,.9);text-align:center;animation-duration:.4s;width:100%;height:100%;left:0;top:0;border-radius:inherit;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}[id^=NotiflixBlockWrap] *{-webkit-box-sizing:border-box;box-sizing:border-box}[id^=NotiflixBlockWrap]>span[class*="-icon"]{display:block;width:45px;height:45px;position:relative;margin:0 auto}[id^=NotiflixBlockWrap]>span[class*="-icon"] svg{width:inherit;height:inherit}[id^=NotiflixBlockWrap]>span[class*="-message"]{position:relative;display:block;width:100%;margin:10px auto 0;padding:0 10px;font-family:inherit!important;font-weight:normal;font-size:14px;line-height:1.4}[id^=NotiflixBlockWrap].nx-with-animation{-webkit-animation:block-animation-fade .3s ease-in-out 0s normal;animation:block-animation-fade .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}@keyframes block-animation-fade{0%{opacity:0}100%{opacity:1}}[id^=NotiflixBlockWrap].nx-with-animation.nx-remove{opacity:0;-webkit-animation:block-animation-fade-remove .3s ease-in-out 0s normal;animation:block-animation-fade-remove .3s ease-in-out 0s normal}@-webkit-keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}@keyframes block-animation-fade-remove{0%{opacity:1}100%{opacity:0}}'},at=0,rt=function(e,i,n,o,a,l){var c;if(Array.isArray(n)){if(1>n.length)return U("Array of HTMLElements should contains at least one HTMLElement."),!1;c=n}else if(Object.prototype.isPrototypeOf.call(NodeList.prototype,n)){if(1>n.length)return U("NodeListOf should contains at least one HTMLElement."),!1;c=Array.prototype.slice.call(n)}else{if("string"!=typeof n||1>(n||"").length||1===(n||"").length&&("#"===(n||"")[0]||"."===(n||"")[0]))return U("The selector parameter must be a string and matches a specified CSS selector(s)."),!1;var f=t.document.querySelectorAll(n);if(1>f.length)return U('You called the "Notiflix.Block..." function with "'+n+'" selector, but there is no such element(s) in the document.'),!1;c=f}s||lt.Block.init({});var p=X(!0,s,{});if("object"==typeof o&&!Array.isArray(o)||"object"==typeof a&&!Array.isArray(a)){var d={};"object"==typeof o?d=o:"object"==typeof a&&(d=a),s=X(!0,s,d)}var u="";"string"==typeof o&&0=m?m:c.length,b="nx-block-temporary-position";if(e){for(var x,y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","html","head","title","script","style","iframe"],w=0;wv.length){var k="";i&&(k=i===R?V(s.svgSize,s.svgColor):i===z?q(s.svgSize,s.svgColor):i===I?$(s.svgSize,s.svgColor):i===M?J(s.svgSize,s.svgColor):i===D?G(s.svgSize,s.svgColor):H(s.svgSize,s.svgColor));var N=''+k+"",C="";0s.messageMaxLength?_(u).substring(0,s.messageMaxLength)+"...":_(u),C=''+u+""),at++;var E=t.document.createElement("div");E.id=j.ID+"-"+at,E.className=h+(s.cssAnimation?" nx-with-animation":""),E.style.position=s.position,E.style.zIndex=s.zindex,E.style.background=s.backgroundColor,E.style.animationDuration=s.cssAnimationDuration+"ms",E.style.fontFamily='"'+s.fontFamily+'", '+r,E.style.display="flex",E.style.flexWrap="wrap",E.style.flexDirection="column",E.style.alignItems="center",E.style.justifyContent="center",s.rtl&&(E.setAttribute("dir","rtl"),E.classList.add("nx-rtl-on")),E.innerHTML=N+C;var S,L=t.getComputedStyle(x).getPropertyValue("position"),A="string"==typeof L?L.toLocaleLowerCase("en"):"relative",O=Math.round(1.25*parseInt(s.svgSize))+40,T="";O>(x.offsetHeight||0)&&(T="min-height:"+O+"px;"),S=x.getAttribute("id")?"#"+x.getAttribute("id"):x.classList[0]?"."+x.classList[0]:(x.tagName||"").toLocaleLowerCase("en");var B="",P=-1>=["absolute","relative","fixed","sticky"].indexOf(A);if(P||0'+S+"."+b+"{"+B+T+"}",Y=t.document.createRange();Y.selectNode(t.document.head);var K=Y.createContextualFragment(Q);t.document.head.appendChild(K),x.classList.add(b)}x.appendChild(E)}}}else var Z=function(e){var i=setTimeout((function(){null!==e.parentNode&&e.parentNode.removeChild(e);var n=e.getAttribute("id"),o=t.document.getElementById("Style-"+n);o&&null!==o.parentNode&&o.parentNode.removeChild(o),clearTimeout(i)}),s.cssAnimationDuration)},tt=function(t){if(t&&0" or "NodeListOf" does not have a "Block" element to remove.')},et=function(t){var e=setTimeout((function(){t.classList.remove(b),clearTimeout(e)}),s.cssAnimationDuration+300)},it=setTimeout((function(){for(var t,e=0;eo.messageMaxLength?_(e).substring(0,o.messageMaxLength)+"...":_(e);var n=i.getElementsByTagName("p")[0];if(n)n.innerHTML=e;else{var s=t.document.createElement("p");s.id=o.messageID,s.className="nx-loading-message nx-loading-message-new",s.style.color=o.messageColor,s.style.fontSize=o.messageFontSize,s.innerHTML=e,i.appendChild(s)}}else U("Where is the new message?")}(e)}},Block:{init:function(t){s=X(!0,j,t),P(st,"NotiflixBlockInternalCSS")},merge:function(t){return s?void(s=X(!0,s,t)):(U('You have to initialize the "Notiflix.Block" module before call Merge function.'),!1)},standard:function(t,e,i){rt(!0,B,t,e,i)},hourglass:function(t,e,i){rt(!0,R,t,e,i)},circle:function(t,e,i){rt(!0,z,t,e,i)},arrows:function(t,e,i){rt(!0,I,t,e,i)},dots:function(t,e,i){rt(!0,M,t,e,i)},pulse:function(t,e,i){rt(!0,D,t,e,i)},remove:function(t,e){"number"!=typeof e&&(e=0),rt(!1,null,t,null,null,e)}}};return"object"==typeof t.Notiflix?X(!0,t.Notiflix,{Notify:lt.Notify,Report:lt.Report,Confirm:lt.Confirm,Loading:lt.Loading,Block:lt.Block}):{Notify:lt.Notify,Report:lt.Report,Confirm:lt.Confirm,Loading:lt.Loading,Block:lt.Block}},"function"==typeof define&&define.amd?define([],(function(){return i(e)})):"object"==typeof o?o=i(e):e.Notiflix=i(e);var s={};function a(t,e){return function(){return t.apply(e,arguments)}}s=function(){function t(){return Math.random().toString(36).substring(2,10)}function e(t,e){function i(t,i){return i&&t&&t.classList&&t.classList.contains(i)||i&&t&&t.dataset&&t.dataset.id&&t.dataset.id===e?t:null}function n(t,e){return t&&t!==document?i(t,e)?t:n(t.parentNode,e):null}return i(t,e)||n(t,e)}function i(t,e=50,i=!1){let n;return function(...o){const s=self,a=()=>{n=null,i||t.apply(s,o)},r=i&&!n;clearTimeout(n),n=setTimeout(a,e),r&&t.apply(s,o)}}function n(t,e){return JSON.stringify(t)===JSON.stringify(e)}function o(t){const e=t.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,(t=>"-"+t.toLowerCase()));return t[0]===t[0].toUpperCase()?e.substring(1):e}class s{constructor(e){this.id="",this.style="",this.class=[],this.isMultiple=!1,this.isOpen=!1,this.isFullOpen=!1,this.intervalMove=null,e||(e={}),this.id="ss-"+t(),this.style=e.style||"",this.class=e.class||[],this.disabled=void 0!==e.disabled&&e.disabled,this.alwaysOpen=void 0!==e.alwaysOpen&&e.alwaysOpen,this.showSearch=void 0===e.showSearch||e.showSearch,this.searchPlaceholder=e.searchPlaceholder||"Search",this.searchText=e.searchText||"No Results",this.searchingText=e.searchingText||"Searching...",this.searchHighlight=void 0!==e.searchHighlight&&e.searchHighlight,this.closeOnSelect=void 0===e.closeOnSelect||e.closeOnSelect,this.contentLocation=e.contentLocation||document.body,this.contentPosition=e.contentPosition||"absolute",this.openPosition=e.openPosition||"auto",this.placeholderText=void 0!==e.placeholderText?e.placeholderText:"Select Value",this.allowDeselect=void 0!==e.allowDeselect&&e.allowDeselect,this.hideSelected=void 0!==e.hideSelected&&e.hideSelected,this.showOptionTooltips=void 0!==e.showOptionTooltips&&e.showOptionTooltips,this.minSelected=e.minSelected||0,this.maxSelected=e.maxSelected||1e3,this.timeoutDelay=e.timeoutDelay||200,this.maxValuesShown=e.maxValuesShown||20,this.maxValuesMessage=e.maxValuesMessage||"{number} selected"}}class a{constructor(e){if(this.id=e.id&&""!==e.id?e.id:t(),this.label=e.label||"",this.selectAll=void 0!==e.selectAll&&e.selectAll,this.selectAllText=e.selectAllText||"Select All",this.closable=e.closable||"off",this.options=[],e.options)for(const t of e.options)this.options.push(new r(t))}}class r{constructor(e){this.id=e.id&&""!==e.id?e.id:t(),this.value=void 0===e.value?e.text:e.value,this.text=e.text||"",this.html=e.html||"",this.selected=void 0!==e.selected&&e.selected,this.display=void 0===e.display||e.display,this.disabled=void 0!==e.disabled&&e.disabled,this.mandatory=void 0!==e.mandatory&&e.mandatory,this.placeholder=void 0!==e.placeholder&&e.placeholder,this.class=e.class||"",this.style=e.style||"",this.data=e.data||{}}}class l{validateDataArray(t){if(!Array.isArray(t))return new Error("Data must be an array");for(let e of t){if(!(e instanceof a||"label"in e))return e instanceof r||"text"in e?this.validateOption(e):new Error("Data object must be a valid optgroup or option");if(!("label"in e))return new Error("Optgroup must have a label");if("options"in e&&e.options)for(let t of e.options)return this.validateOption(t)}return null}validateOption(t){return"text"in t?null:new Error("Option must have a text")}partialToFullData(t){let e=[];return t.forEach((t=>{if(t instanceof a||"label"in t){let i=[];"options"in t&&t.options&&t.options.forEach((t=>{i.push(new r(t))})),i.length>0&&e.push(new a(t))}(t instanceof r||"text"in t)&&e.push(new r(t))})),e}setData(t){this.data=this.partialToFullData(t),"single"===this.selectType&&this.setSelectedBy("value",this.getSelected())}getData(){return this.filter(null,!0)}getDataOptions(){return this.filter(null,!1)}addOption(t){this.setData(this.getData().concat(new r(t)))}setSelectedBy(t,e){let i=null,n=!1;for(let o of this.data){if(o instanceof a)for(let s of o.options)i||(i=s),s.selected=!n&&e.includes(s[t]),s.selected&&"single"===this.selectType&&(n=!0);o instanceof r&&(i||(i=o),o.selected=!n&&e.includes(o[t]),o.selected&&"single"===this.selectType&&(n=!0))}"single"===this.selectType&&i&&!n&&(i.selected=!0)}getSelected(){let t=this.getSelectedOptions(),e=[];return t.forEach((t=>{e.push(t.value)})),e}getSelectedOptions(){return this.filter((t=>t.selected),!1)}getSelectedIDs(){let t=this.getSelectedOptions(),e=[];return t.forEach((t=>{e.push(t.id)})),e}getOptgroupByID(t){for(let e of this.data)if(e instanceof a&&e.id===t)return e;return null}getOptionByID(t){let e=this.filter((e=>e.id===t),!1);return e.length?e[0]:null}search(t,e){return""===(t=t.trim())?this.getData():this.filter((i=>e(i,t)),!0)}filter(t,e){const i=[];return this.data.forEach((n=>{if(n instanceof a){let o=[];if(n.options.forEach((n=>{t&&!t(n)||(e?o.push(new r(n)):i.push(new r(n)))})),o.length>0){let t=new a(n);t.options=o,i.push(t)}}n instanceof r&&(t&&!t(n)||i.push(new r(n)))})),i}getSelectType(){return this.selectType}constructor(t,e){this.selectType="single",this.data=[],this.selectType=t,this.setData(e)}}class c{enable(){this.main.main.classList.remove(this.classes.disabled),this.content.search.input.disabled=!1}disable(){this.main.main.classList.add(this.classes.disabled),this.content.search.input.disabled=!0}open(){this.main.arrow.path.setAttribute("d",this.classes.arrowOpen),this.main.main.classList.add("up"===this.settings.openPosition?this.classes.openAbove:this.classes.openBelow),this.main.main.setAttribute("aria-expanded","true"),this.moveContent();const t=this.store.getSelectedOptions();if(t.length){const e=t[t.length-1].id,i=this.content.list.querySelector('[data-id="'+e+'"]');i&&this.ensureElementInView(this.content.list,i)}}close(){this.main.main.classList.remove(this.classes.openAbove),this.main.main.classList.remove(this.classes.openBelow),this.main.main.setAttribute("aria-expanded","false"),this.content.main.classList.remove(this.classes.openAbove),this.content.main.classList.remove(this.classes.openBelow),this.main.arrow.path.setAttribute("d",this.classes.arrowClose)}updateClassStyles(){if(this.main.main.className="",this.main.main.removeAttribute("style"),this.content.main.className="",this.content.main.removeAttribute("style"),this.main.main.classList.add(this.classes.main),this.content.main.classList.add(this.classes.content),""!==this.settings.style&&(this.main.main.style.cssText=this.settings.style,this.content.main.style.cssText=this.settings.style),this.settings.class.length)for(const t of this.settings.class)""!==t.trim()&&(this.main.main.classList.add(t.trim()),this.content.main.classList.add(t.trim()));"relative"===this.settings.contentPosition&&this.content.main.classList.add("ss-"+this.settings.contentPosition)}updateAriaAttributes(){this.main.main.role="combobox",this.main.main.setAttribute("aria-haspopup","listbox"),this.main.main.setAttribute("aria-controls",this.content.main.id),this.main.main.setAttribute("aria-expanded","false"),this.content.main.setAttribute("role","listbox")}mainDiv(){var t;const e=document.createElement("div");e.dataset.id=this.settings.id,e.id=this.settings.id,e.tabIndex=0,e.onkeydown=t=>{switch(t.key){case"ArrowUp":case"ArrowDown":return this.callbacks.open(),"ArrowDown"===t.key?this.highlight("down"):this.highlight("up"),!1;case"Tab":return this.callbacks.close(),!0;case"Enter":case" ":this.callbacks.open();const e=this.content.list.querySelector("."+this.classes.highlighted);return e&&e.click(),!1;case"Escape":return this.callbacks.close(),!1}},e.onclick=t=>{this.settings.disabled||(this.settings.isOpen?this.callbacks.close():this.callbacks.open())};const i=document.createElement("div");i.classList.add(this.classes.values),e.appendChild(i);const n=document.createElement("div");n.classList.add(this.classes.deselect);const o=null===(t=this.store)||void 0===t?void 0:t.getSelectedOptions();!this.settings.allowDeselect||this.settings.isMultiple&&o&&o.length<=0?n.classList.add(this.classes.hide):n.classList.remove(this.classes.hide),n.onclick=t=>{if(t.stopPropagation(),this.settings.disabled)return;let e=!0;const i=this.store.getSelectedOptions(),n=[];this.callbacks.beforeChange&&(e=!0===this.callbacks.beforeChange(n,i)),e&&(this.settings.isMultiple?(this.callbacks.setSelected([],!1),this.updateDeselectAll()):this.callbacks.setSelected([""],!1),this.settings.closeOnSelect&&this.callbacks.close(),this.callbacks.afterChange&&this.callbacks.afterChange(n))};const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("viewBox","0 0 100 100");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",this.classes.deselectPath),s.appendChild(a),n.appendChild(s),e.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.classList.add(this.classes.arrow),r.setAttribute("viewBox","0 0 100 100");const l=document.createElementNS("http://www.w3.org/2000/svg","path");return l.setAttribute("d",this.classes.arrowClose),this.settings.alwaysOpen&&r.classList.add(this.classes.hide),r.appendChild(l),e.appendChild(r),{main:e,values:i,deselect:{main:n,svg:s,path:a},arrow:{main:r,path:l}}}mainFocus(t){"click"!==t&&this.main.main.focus({preventScroll:!0})}placeholder(){const t=this.store.filter((t=>t.placeholder),!1);let e=this.settings.placeholderText;t.length&&(""!==t[0].html?e=t[0].html:""!==t[0].text&&(e=t[0].text));const i=document.createElement("div");return i.classList.add(this.classes.placeholder),i.innerHTML=e,i}renderValues(){this.settings.isMultiple?this.renderMultipleValues():this.renderSingleValue()}renderSingleValue(){const t=this.store.filter((t=>t.selected&&!t.placeholder),!1),e=t.length>0?t[0]:null;if(e){const t=document.createElement("div");t.classList.add(this.classes.single),e.html?t.innerHTML=e.html:t.innerText=e.text,this.main.values.innerHTML=t.outerHTML}else this.main.values.innerHTML=this.placeholder().outerHTML;this.settings.allowDeselect&&t.length?this.main.deselect.main.classList.remove(this.classes.hide):this.main.deselect.main.classList.add(this.classes.hide)}renderMultipleValues(){let t=this.main.values.childNodes,e=this.store.filter((t=>t.selected&&t.display),!1);if(0===e.length)return void(this.main.values.innerHTML=this.placeholder().outerHTML);{const t=this.main.values.querySelector("."+this.classes.placeholder);t&&t.remove()}if(e.length>this.settings.maxValuesShown){const t=document.createElement("div");return t.classList.add(this.classes.max),t.textContent=this.settings.maxValuesMessage.replace("{number}",e.length.toString()),void(this.main.values.innerHTML=t.outerHTML)}{const t=this.main.values.querySelector("."+this.classes.max);t&&t.remove()}let i=[];for(let n=0;nt.id===s),!1).length||i.push(o))}for(const t of i)t.classList.add(this.classes.valueOut),setTimeout((()=>{this.main.values.hasChildNodes()&&this.main.values.contains(t)&&this.main.values.removeChild(t)}),100);t=this.main.values.childNodes;for(let i=0;i{if(e.preventDefault(),e.stopPropagation(),this.settings.disabled)return;let i=!0;const n=this.store.getSelectedOptions(),o=n.filter((e=>e.selected&&e.id!==t.id),!0);if(!(this.settings.minSelected&&o.length{this.callbacks.search(t.target.value)}),100),e.onkeydown=t=>{switch(t.key){case"ArrowUp":case"ArrowDown":return"ArrowDown"===t.key?this.highlight("down"):this.highlight("up"),!1;case"Tab":return this.callbacks.close(),!0;case"Escape":return this.callbacks.close(),!1;case"Enter":case" ":if(this.callbacks.addable&&t.ctrlKey)return n.click(),!1;{const t=this.content.list.querySelector("."+this.classes.highlighted);if(t)return t.click(),!1}return!0}},t.appendChild(e),this.callbacks.addable){n.classList.add(this.classes.addable);const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 100 100");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",this.classes.addablePath),e.appendChild(i),n.appendChild(e),n.onclick=t=>{if(t.preventDefault(),t.stopPropagation(),!this.callbacks.addable)return;const e=this.content.search.input.value.trim();if(""===e)return void this.content.search.input.focus();const i=t=>{let e=new r(t);if(this.callbacks.addOption(e),this.settings.isMultiple){let t=this.store.getSelected();t.push(e.value),this.callbacks.setSelected(t,!0)}else this.callbacks.setSelected([e.value],!0);this.callbacks.search(""),this.settings.closeOnSelect&&setTimeout((()=>{this.callbacks.close()}),100)},n=this.callbacks.addable(e);!1!==n&&null!=n&&(n instanceof Promise?n.then((t=>{i("string"==typeof t?{text:t,value:t}:t)})):i("string"==typeof n?{text:n,value:n}:n))},t.appendChild(n),o.addable={main:n,svg:e,path:i}}return o}searchFocus(){this.content.search.input.focus()}getOptions(t=!1,e=!1,i=!1){let n="."+this.classes.option;return t&&(n+=":not(."+this.classes.placeholder+")"),e&&(n+=":not(."+this.classes.disabled+")"),i&&(n+=":not(."+this.classes.hide+")"),Array.from(this.content.list.querySelectorAll(n))}highlight(t){const e=this.getOptions(!0,!0,!0);if(0!==e.length)if(1!==e.length||e[0].classList.contains(this.classes.highlighted)){for(let i=0;i=0?i-1:e.length-1];s.classList.add(this.classes.highlighted),this.ensureElementInView(this.content.list,s);const a=s.parentElement;if(a&&a.classList.contains(this.classes.close)){const t=a.querySelector("."+this.classes.optgroupLabel);t&&t.click()}return}e["down"===t?0:e.length-1].classList.add(this.classes.highlighted),this.ensureElementInView(this.content.list,e["down"===t?0:e.length-1])}else e[0].classList.add(this.classes.highlighted)}listDiv(){const t=document.createElement("div");return t.classList.add(this.classes.list),t}renderError(t){this.content.list.innerHTML="";const e=document.createElement("div");e.classList.add(this.classes.error),e.textContent=t,this.content.list.appendChild(e)}renderSearching(){this.content.list.innerHTML="";const t=document.createElement("div");t.classList.add(this.classes.searching),t.textContent=this.settings.searchingText,this.content.list.appendChild(t)}renderOptions(t){if(this.content.list.innerHTML="",0===t.length){const t=document.createElement("div");return t.classList.add(this.classes.search),t.innerHTML=this.settings.searchText,void this.content.list.appendChild(t)}for(const e of t){if(e instanceof a){const t=document.createElement("div");t.classList.add(this.classes.optgroup);const i=document.createElement("div");i.classList.add(this.classes.optgroupLabel),t.appendChild(i);const n=document.createElement("div");n.classList.add(this.classes.optgroupLabelText),n.textContent=e.label,i.appendChild(n);const o=document.createElement("div");if(o.classList.add(this.classes.optgroupActions),i.appendChild(o),this.settings.isMultiple&&e.selectAll){const t=document.createElement("div");t.classList.add(this.classes.optgroupSelectAll);let i=!0;for(const t of e.options)if(!t.selected){i=!1;break}i&&t.classList.add(this.classes.selected);const n=document.createElement("span");n.textContent=e.selectAllText,t.appendChild(n);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("viewBox","0 0 100 100"),t.appendChild(s);const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",this.classes.optgroupSelectAllBox),s.appendChild(a);const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d",this.classes.optgroupSelectAllCheck),s.appendChild(r),t.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation();const n=this.store.getSelected();if(i){const t=n.filter((t=>{for(const i of e.options)if(t===i.value)return!1;return!0}));this.callbacks.setSelected(t,!0)}else{const t=n.concat(e.options.map((t=>t.value)));for(const t of e.options)this.store.getOptionByID(t.id)||this.callbacks.addOption(t);this.callbacks.setSelected(t,!0)}})),o.appendChild(t)}if("off"!==e.closable){const n=document.createElement("div");n.classList.add(this.classes.optgroupClosable);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("viewBox","0 0 100 100"),s.classList.add(this.classes.arrow),n.appendChild(s);const a=document.createElementNS("http://www.w3.org/2000/svg","path");s.appendChild(a),e.options.some((t=>t.selected))||""!==this.content.search.input.value.trim()?(n.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):"open"===e.closable?(t.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):"close"===e.closable&&(t.classList.add(this.classes.close),a.setAttribute("d",this.classes.arrowClose)),i.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),t.classList.contains(this.classes.close)?(t.classList.remove(this.classes.close),t.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):(t.classList.remove(this.classes.open),t.classList.add(this.classes.close),a.setAttribute("d",this.classes.arrowClose))})),o.appendChild(n)}t.appendChild(i);for(const i of e.options)t.appendChild(this.option(i));this.content.list.appendChild(t)}e instanceof r&&this.content.list.appendChild(this.option(e))}}option(t){if(t.placeholder){const t=document.createElement("div");return t.classList.add(this.classes.option),t.classList.add(this.classes.hide),t}const e=document.createElement("div");return e.dataset.id=t.id,e.id=t.id,e.classList.add(this.classes.option),e.setAttribute("role","option"),t.class&&t.class.split(" ").forEach((t=>{e.classList.add(t)})),t.style&&(e.style.cssText=t.style),this.settings.searchHighlight&&""!==this.content.search.input.value.trim()?e.innerHTML=this.highlightText(""!==t.html?t.html:t.text,this.content.search.input.value,this.classes.searchHighlighter):""!==t.html?e.innerHTML=t.html:e.textContent=t.text,this.settings.showOptionTooltips&&e.textContent&&e.setAttribute("title",e.textContent),t.display||e.classList.add(this.classes.hide),t.disabled&&e.classList.add(this.classes.disabled),t.selected&&this.settings.hideSelected&&e.classList.add(this.classes.hide),t.selected?(e.classList.add(this.classes.selected),e.setAttribute("aria-selected","true"),this.main.main.setAttribute("aria-activedescendant",e.id)):(e.classList.remove(this.classes.selected),e.setAttribute("aria-selected","false")),e.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const i=this.store.getSelected(),n=e.currentTarget,o=String(n.dataset.id);if(t.disabled||t.selected&&!this.settings.allowDeselect)return;if(this.settings.isMultiple&&this.settings.maxSelected<=i.length&&!t.selected||this.settings.isMultiple&&this.settings.minSelected>=i.length&&t.selected)return;let s=!1;const a=this.store.getSelectedOptions();let r=[];this.settings.isMultiple&&(r=t.selected?a.filter((t=>t.id!==o)):a.concat(t)),this.settings.isMultiple||(r=t.selected?[]:[t]),this.callbacks.beforeChange||(s=!0),this.callbacks.beforeChange&&(s=!1!==this.callbacks.beforeChange(r,a)),s&&(this.store.getOptionByID(o)||this.callbacks.addOption(t),this.callbacks.setSelected(r.map((t=>t.value)),!1),this.settings.closeOnSelect&&this.callbacks.close(),this.callbacks.afterChange&&this.callbacks.afterChange(r))})),e}destroy(){this.main.main.remove(),this.content.main.remove()}highlightText(t,e,i){let n=t;const o=new RegExp("("+e.trim()+")(?![^<]*>[^<>]*)","i");if(!t.match(o))return t;const s=t.match(o).index,a=s+t.match(o)[0].toString().length,r=t.substring(s,a);return n=n.replace(o,`${r}`),n}moveContentAbove(){const t=this.main.main.offsetHeight,e=this.content.main.offsetHeight;this.main.main.classList.remove(this.classes.openBelow),this.main.main.classList.add(this.classes.openAbove),this.content.main.classList.remove(this.classes.openBelow),this.content.main.classList.add(this.classes.openAbove);const i=this.main.main.getBoundingClientRect();this.content.main.style.margin="-"+(t+e-1)+"px 0px 0px 0px",this.content.main.style.top=i.top+i.height+window.scrollY+"px",this.content.main.style.left=i.left+window.scrollX+"px",this.content.main.style.width=i.width+"px"}moveContentBelow(){this.main.main.classList.remove(this.classes.openAbove),this.main.main.classList.add(this.classes.openBelow),this.content.main.classList.remove(this.classes.openAbove),this.content.main.classList.add(this.classes.openBelow);const t=this.main.main.getBoundingClientRect();this.content.main.style.margin="-1px 0px 0px 0px","relative"!==this.settings.contentPosition&&(this.content.main.style.top=t.top+t.height+window.scrollY+"px",this.content.main.style.left=t.left+window.scrollX+"px",this.content.main.style.width=t.width+"px")}ensureElementInView(t,e){const i=t.scrollTop+t.offsetTop,n=i+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;on&&(t.scrollTop+=s-n)}putContent(){const t=this.main.main.offsetHeight,e=this.main.main.getBoundingClientRect(),i=this.content.main.offsetHeight;return window.innerHeight-(e.top+t)<=i&&e.top>i?"up":"down"}updateDeselectAll(){if(!this.store||!this.settings)return;const t=this.store.getSelectedOptions(),e=t&&t.length>0,i=this.settings.isMultiple,n=this.settings.allowDeselect,o=this.main.deselect.main,s=this.classes.hide;!n||i&&!e?o.classList.add(s):o.classList.remove(s)}constructor(t,e,i){this.classes={main:"ss-main",placeholder:"ss-placeholder",values:"ss-values",single:"ss-single",max:"ss-max",value:"ss-value",valueText:"ss-value-text",valueDelete:"ss-value-delete",valueOut:"ss-value-out",deselect:"ss-deselect",deselectPath:"M10,10 L90,90 M10,90 L90,10",arrow:"ss-arrow",arrowClose:"M10,30 L50,70 L90,30",arrowOpen:"M10,70 L50,30 L90,70",content:"ss-content",openAbove:"ss-open-above",openBelow:"ss-open-below",search:"ss-search",searchHighlighter:"ss-search-highlight",searching:"ss-searching",addable:"ss-addable",addablePath:"M50,10 L50,90 M10,50 L90,50",list:"ss-list",optgroup:"ss-optgroup",optgroupLabel:"ss-optgroup-label",optgroupLabelText:"ss-optgroup-label-text",optgroupActions:"ss-optgroup-actions",optgroupSelectAll:"ss-selectall",optgroupSelectAllBox:"M60,10 L10,10 L10,90 L90,90 L90,50",optgroupSelectAllCheck:"M30,45 L50,70 L90,10",optgroupClosable:"ss-closable",option:"ss-option",optionDelete:"M10,10 L90,90 M10,90 L90,10",highlighted:"ss-highlighted",open:"ss-open",close:"ss-close",selected:"ss-selected",error:"ss-error",disabled:"ss-disabled",hide:"ss-hide"},this.store=e,this.settings=t,this.callbacks=i,this.main=this.mainDiv(),this.content=this.contentDiv(),this.updateClassStyles(),this.updateAriaAttributes(),this.settings.contentLocation.appendChild(this.content.main)}}class f{enable(){this.select.disabled=!1}disable(){this.select.disabled=!0}hideUI(){this.select.tabIndex=-1,this.select.style.display="none",this.select.setAttribute("aria-hidden","true")}showUI(){this.select.removeAttribute("tabindex"),this.select.style.display="",this.select.removeAttribute("aria-hidden")}changeListen(t){this.listen=t,t&&this.observer&&this.observer.observe(this.select,{subtree:!0,childList:!0,attributes:!0}),t||this.observer&&this.observer.disconnect()}valueChange(t){return this.listen&&this.onValueChange&&this.onValueChange(this.getSelectedValues()),!0}observeCall(t){if(!this.listen)return;let e=!1,i=!1,n=!1;for(const o of t)o.target===this.select&&("disabled"===o.attributeName&&(i=!0),"class"===o.attributeName&&(e=!0)),"OPTGROUP"!==o.target.nodeName&&"OPTION"!==o.target.nodeName||(n=!0);e&&this.onClassChange&&this.onClassChange(this.select.className.split(" ")),i&&this.onDisabledChange&&(this.changeListen(!1),this.onDisabledChange(this.select.disabled),this.changeListen(!0)),n&&this.onOptionsChange&&(this.changeListen(!1),this.onOptionsChange(this.getData()),this.changeListen(!0))}getData(){let t=[];const e=this.select.childNodes;for(const i of e)"OPTGROUP"===i.nodeName&&t.push(this.getDataFromOptgroup(i)),"OPTION"===i.nodeName&&t.push(this.getDataFromOption(i));return t}getDataFromOptgroup(t){let e={id:t.id,label:t.label,selectAll:!!t.dataset&&"true"===t.dataset.selectall,selectAllText:t.dataset?t.dataset.selectalltext:"Select all",closable:t.dataset?t.dataset.closable:"off",options:[]};const i=t.childNodes;for(const t of i)"OPTION"===t.nodeName&&e.options.push(this.getDataFromOption(t));return e}getDataFromOption(t){return{id:t.id,value:t.value,text:t.text,html:t.dataset&&t.dataset.html?t.dataset.html:"",selected:t.selected,display:"none"!==t.style.display,disabled:t.disabled,mandatory:!!t.dataset&&"true"===t.dataset.mandatory,placeholder:"true"===t.dataset.placeholder,class:t.className,style:t.style.cssText,data:t.dataset}}getSelectedValues(){let t=[];const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected&&t.push(e.value)}}if("OPTION"===i.nodeName){const e=i;e.selected&&t.push(e.value)}}return t}setSelected(t){this.changeListen(!1);const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.value)}}if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.value)}}this.changeListen(!0)}updateSelect(t,e,i){this.changeListen(!1),t&&(this.select.dataset.id=t),e&&(this.select.style.cssText=e),i&&(this.select.className="",i.forEach((t=>{""!==t.trim()&&this.select.classList.add(t.trim())}))),this.changeListen(!0)}updateOptions(t){this.changeListen(!1),this.select.innerHTML="";for(const e of t)e instanceof a&&this.select.appendChild(this.createOptgroup(e)),e instanceof r&&this.select.appendChild(this.createOption(e));this.select.dispatchEvent(new Event("change")),this.changeListen(!0)}createOptgroup(t){const e=document.createElement("optgroup");if(e.id=t.id,e.label=t.label,t.selectAll&&(e.dataset.selectAll="true"),"off"!==t.closable&&(e.dataset.closable=t.closable),t.options)for(const i of t.options)e.appendChild(this.createOption(i));return e}createOption(t){const e=document.createElement("option");return e.id=t.id,e.value=t.value,e.innerHTML=t.text,""!==t.html&&e.setAttribute("data-html",t.html),t.selected&&(e.selected=t.selected),t.disabled&&(e.disabled=!0),!1===t.display&&(e.style.display="none"),t.placeholder&&e.setAttribute("data-placeholder","true"),t.mandatory&&e.setAttribute("data-mandatory","true"),t.class&&t.class.split(" ").forEach((t=>{e.classList.add(t)})),t.data&&"object"==typeof t.data&&Object.keys(t.data).forEach((i=>{e.setAttribute("data-"+o(i),t.data[i])})),e}destroy(){this.changeListen(!1),this.select.removeEventListener("change",this.valueChange.bind(this)),this.observer&&(this.observer.disconnect(),this.observer=null),delete this.select.dataset.id,this.showUI()}constructor(t){this.listen=!1,this.observer=null,this.select=t,this.select.addEventListener("change",this.valueChange.bind(this),{passive:!0}),this.observer=new MutationObserver(this.observeCall.bind(this)),this.changeListen(!0)}}class p{enable(){this.settings.disabled=!1,this.select.enable(),this.render.enable()}disable(){this.settings.disabled=!0,this.select.disable(),this.render.disable()}getData(){return this.store.getData()}setData(t){const e=this.store.getSelected(),i=this.store.validateDataArray(t);if(i)return void(this.events.error&&this.events.error(i));this.store.setData(t);const o=this.store.getData();this.select.updateOptions(o),this.render.renderValues(),this.render.renderOptions(o),this.events.afterChange&&!n(e,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}getSelected(){return this.store.getSelected()}setSelected(t,e=!0){const i=this.store.getSelected();this.store.setSelectedBy("value",Array.isArray(t)?t:[t]);const o=this.store.getData();this.select.updateOptions(o),this.render.renderValues(),""!==this.render.content.search.input.value?this.search(this.render.content.search.input.value):this.render.renderOptions(o),e&&this.events.afterChange&&!n(i,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}addOption(t){const e=this.store.getSelected();this.store.getDataOptions().some((e=>{var i;return e.value===(null!==(i=t.value)&&void 0!==i?i:t.text)}))||this.store.addOption(t);const i=this.store.getData();this.select.updateOptions(i),this.render.renderValues(),this.render.renderOptions(i),this.events.afterChange&&!n(e,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}open(){this.settings.disabled||this.settings.isOpen||(this.events.beforeOpen&&this.events.beforeOpen(),this.render.open(),this.settings.showSearch&&this.render.searchFocus(),this.settings.isOpen=!0,setTimeout((()=>{this.events.afterOpen&&this.events.afterOpen(),this.settings.isOpen&&(this.settings.isFullOpen=!0)}),this.settings.timeoutDelay),"absolute"===this.settings.contentPosition&&(this.settings.intervalMove&&clearInterval(this.settings.intervalMove),this.settings.intervalMove=setInterval(this.render.moveContent.bind(this.render),500)))}close(t=null){this.settings.isOpen&&!this.settings.alwaysOpen&&(this.events.beforeClose&&this.events.beforeClose(),this.render.close(),""!==this.render.content.search.input.value&&this.search(""),this.render.mainFocus(t),this.settings.isOpen=!1,this.settings.isFullOpen=!1,setTimeout((()=>{this.events.afterClose&&this.events.afterClose()}),this.settings.timeoutDelay),this.settings.intervalMove&&clearInterval(this.settings.intervalMove))}search(t){if(this.render.content.search.input.value!==t&&(this.render.content.search.input.value=t),!this.events.search)return void this.render.renderOptions(""===t?this.store.getData():this.store.search(t,this.events.searchFilter));this.render.renderSearching();const e=this.events.search(t,this.store.getSelectedOptions());e instanceof Promise?e.then((t=>{this.render.renderOptions(this.store.partialToFullData(t))})).catch((t=>{this.render.renderError("string"==typeof t?t:t.message)})):Array.isArray(e)?this.render.renderOptions(this.store.partialToFullData(e)):this.render.renderError("Search event must return a promise or an array of data")}destroy(){document.removeEventListener("click",this.documentClick),window.removeEventListener("resize",this.windowResize,!1),"auto"===this.settings.openPosition&&window.removeEventListener("scroll",this.windowScroll,!1),document.removeEventListener("visibilitychange",this.windowVisibilityChange),this.store.setData([]),this.render.destroy(),this.select.destroy()}constructor(t){var n;if(this.events={search:void 0,searchFilter:(t,e)=>-1!==t.text.toLowerCase().indexOf(e.toLowerCase()),addable:void 0,beforeChange:void 0,afterChange:void 0,beforeOpen:void 0,afterOpen:void 0,beforeClose:void 0,afterClose:void 0},this.windowResize=i((()=>{(this.settings.isOpen||this.settings.isFullOpen)&&this.render.moveContent()})),this.windowScroll=i((()=>{(this.settings.isOpen||this.settings.isFullOpen)&&this.render.moveContent()})),this.documentClick=t=>{this.settings.isOpen&&t.target&&!e(t.target,this.settings.id)&&this.close(t.type)},this.windowVisibilityChange=()=>{document.hidden&&this.close()},this.selectEl="string"==typeof t.select?document.querySelector(t.select):t.select,!this.selectEl)return void(t.events&&t.events.error&&t.events.error(new Error("Could not find select element")));if("SELECT"!==this.selectEl.tagName)return void(t.events&&t.events.error&&t.events.error(new Error("Element isnt of type select")));this.selectEl.dataset.ssid&&this.destroy(),this.settings=new s(t.settings);const o=["afterChange","beforeOpen","afterOpen","beforeClose","afterClose"];for(const e in t.events)t.events.hasOwnProperty(e)&&(-1!==o.indexOf(e)?this.events[e]=i(t.events[e],100):this.events[e]=t.events[e]);this.settings.disabled=(null===(n=t.settings)||void 0===n?void 0:n.disabled)?t.settings.disabled:this.selectEl.disabled,this.settings.isMultiple=this.selectEl.multiple,this.settings.style=this.selectEl.style.cssText,this.settings.class=this.selectEl.className.split(" "),this.select=new f(this.selectEl),this.select.updateSelect(this.settings.id,this.settings.style,this.settings.class),this.select.hideUI(),this.select.onValueChange=t=>{this.setSelected(t)},this.select.onClassChange=t=>{this.settings.class=t,this.render.updateClassStyles()},this.select.onDisabledChange=t=>{t?this.disable():this.enable()},this.select.onOptionsChange=t=>{this.setData(t)},this.store=new l(this.settings.isMultiple?"multiple":"single",t.data?t.data:this.select.getData()),t.data&&this.select.updateOptions(this.store.getData());const a={open:this.open.bind(this),close:this.close.bind(this),addable:this.events.addable?this.events.addable:void 0,setSelected:this.setSelected.bind(this),addOption:this.addOption.bind(this),search:this.search.bind(this),beforeChange:this.events.beforeChange,afterChange:this.events.afterChange};this.render=new c(this.settings,this.store,a),this.render.renderValues(),this.render.renderOptions(this.store.getData());const r=this.selectEl.getAttribute("aria-label"),p=this.selectEl.getAttribute("aria-labelledby");r?this.render.main.main.setAttribute("aria-label",r):p&&this.render.main.main.setAttribute("aria-labelledby",p),this.selectEl.parentNode&&this.selectEl.parentNode.insertBefore(this.render.main.main,this.selectEl.nextSibling),document.addEventListener("click",this.documentClick),window.addEventListener("resize",this.windowResize,!1),"auto"===this.settings.openPosition&&window.addEventListener("scroll",this.windowScroll,!1),document.addEventListener("visibilitychange",this.windowVisibilityChange),this.settings.disabled&&this.disable(),this.settings.alwaysOpen&&this.open(),this.selectEl.slim=this}}return p}();const{toString:r}=Object.prototype,{getPrototypeOf:l}=Object,c=(f=Object.create(null),t=>{const e=r.call(t);return f[e]||(f[e]=e.slice(8,-1).toLowerCase())});var f;const p=t=>(t=t.toLowerCase(),e=>c(e)===t),d=t=>e=>typeof e===t,{isArray:u}=Array,h=d("undefined");const m=p("ArrayBuffer");const g=d("string"),b=d("function"),x=d("number"),y=t=>null!==t&&"object"==typeof t,w=t=>{if("object"!==c(t))return!1;const e=l(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},v=p("Date"),k=p("File"),N=p("Blob"),C=p("FileList"),E=p("URLSearchParams");function S(t,e,{allOwnKeys:i=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),u(t))for(n=0,o=t.length;n0;)if(n=i[o],e===n.toLowerCase())return n;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n,O=t=>!h(t)&&t!==A;const T=(B="undefined"!=typeof Uint8Array&&l(Uint8Array),t=>B&&t instanceof B);var B;const R=p("HTMLFormElement"),z=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),I=p("RegExp"),M=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),n={};S(i,((i,o)=>{!1!==e(i,o,t)&&(n[o]=i)})),Object.defineProperties(t,n)},D={DIGIT:"0123456789",ALPHA:"abcdefghijklmnopqrstuvwxyz",ALPHA_DIGIT:"abcdefghijklmnopqrstuvwxyz"+"abcdefghijklmnopqrstuvwxyz".toUpperCase()+"0123456789"};const j=p("AsyncFunction");var U={isArray:u,isArrayBuffer:m,isBuffer:function(t){return null!==t&&!h(t)&&null!==t.constructor&&!h(t.constructor)&&b(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||b(t.append)&&("formdata"===(e=c(t))||"object"===e&&b(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&m(t.buffer),e},isString:g,isNumber:x,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:w,isUndefined:h,isDate:v,isFile:k,isBlob:N,isRegExp:I,isFunction:b,isStream:t=>y(t)&&b(t.pipe),isURLSearchParams:E,isTypedArray:T,isFileList:C,forEach:S,merge:function t(){const{caseless:e}=O(this)&&this||{},i={},n=(n,o)=>{const s=e&&L(i,o)||o;w(i[s])&&w(n)?i[s]=t(i[s],n):w(n)?i[s]=t({},n):u(n)?i[s]=n.slice():i[s]=n};for(let t=0,e=arguments.length;t(S(e,((e,n)=>{i&&b(e)?t[n]=a(e,i):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,n)=>{let o,s,a;const r={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],n&&!n(a,t,e)||r[a]||(e[a]=t[a],r[a]=!0);t=!1!==i&&l(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:c,kindOfTest:p,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;const n=t.indexOf(e,i);return-1!==n&&n===i},toArray:t=>{if(!t)return null;if(u(t))return t;let e=t.length;if(!x(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=i.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll:(t,e)=>{let i;const n=[];for(;null!==(i=t.exec(e));)n.push(i);return n},isHTMLForm:R,hasOwnProperty:z,hasOwnProp:z,reduceDescriptors:M,freezeMethods:t=>{M(t,((e,i)=>{if(b(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=t[i];b(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(t,e)=>{const i={},n=t=>{t.forEach((t=>{i[t]=!0}))};return u(t)?n(t):n(String(t).split(e)),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,i){return e.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:L,global:A,isContextDefined:O,ALPHABET:D,generateString:(t=16,e=D.ALPHA_DIGIT)=>{let i="";const{length:n}=e;for(;t--;)i+=e[Math.random()*n|0];return i},isSpecCompliantForm:function(t){return!!(t&&b(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),i=(t,n)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=u(t)?[]:{};return S(t,((t,e)=>{const s=i(t,n+1);!h(s)&&(o[e]=s)})),e[n]=void 0,o}}return t};return i(t,0)},isAsyncFn:j,isThenable:t=>t&&(y(t)||b(t))&&b(t.then)&&b(t.catch)};function F(t,e,i,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),o&&(this.response=o)}U.inherits(F,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const W=F.prototype,P={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{P[t]={value:t}})),Object.defineProperties(F,P),Object.defineProperty(W,"isAxiosError",{value:!0}),F.from=(t,e,i,n,o,s)=>{const a=Object.create(W);return U.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),F.call(a,t.message,e,i,n,o),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};var X,_,H,V=F;_=function(t){var e,i,n=tt(t),o=n[0],s=n[1],a=new Q(function(t,e,i){return 3*(e+i)/4-i}(0,o,s)),r=0,l=s>0?o-4:o;for(i=0;i>16&255,a[r++]=e>>8&255,a[r++]=255&e;2===s&&(e=G[t.charCodeAt(i)]<<2|G[t.charCodeAt(i+1)]>>4,a[r++]=255&e);1===s&&(e=G[t.charCodeAt(i)]<<10|G[t.charCodeAt(i+1)]<<4|G[t.charCodeAt(i+2)]>>2,a[r++]=e>>8&255,a[r++]=255&e);return a},H=function(t){for(var e,i=t.length,n=i%3,o=[],s=16383,a=0,r=i-n;ar?r:a+s));1===n?(e=t[i-1],o.push(J[e>>2]+J[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],o.push(J[e>>10]+J[e>>4&63]+J[e<<2&63]+"="));return o.join("")}
-/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */;for(var q,$,J=[],G=[],Q="undefined"!=typeof Uint8Array?Uint8Array:Array,Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=0,Z=Y.length;K0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function et(t,e,i){for(var n,o,s=[],a=e;a>18&63]+J[o>>12&63]+J[o>>6&63]+J[63&o]);return s.join("")}G["-".charCodeAt(0)]=62,G["_".charCodeAt(0)]=63,q=function(t,e,i,n,o){var s,a,r=8*o-n-1,l=(1<>1,f=-7,p=i?o-1:0,d=i?-1:1,u=t[e+p];for(p+=d,s=u&(1<<-f)-1,u>>=-f,f+=r;f>0;s=256*s+t[e+p],p+=d,f-=8);for(a=s&(1<<-f)-1,s>>=-f,f+=n;f>0;a=256*a+t[e+p],p+=d,f-=8);if(0===s)s=1-c;else{if(s===l)return a?NaN:1/0*(u?-1:1);a+=Math.pow(2,n),s-=c}return(u?-1:1)*a*Math.pow(2,s-n)},$=function(t,e,i,n,o,s){var a,r,l,c=8*s-o-1,f=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,u=n?0:s-1,h=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(r=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+p>=1?d/l:d*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=f?(r=0,a=f):a+p>=1?(r=(e*l-1)*Math.pow(2,o),a+=p):(r=e*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;t[i+u]=255&r,u+=h,r/=256,o-=8);for(a=a<0;t[i+u]=255&a,u+=h,a/=256,c-=8);t[i+u-h]|=128*m};const it="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;X=ot;function nt(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,ot.prototype),e}function ot(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return rt(t)}return st(t,e,i)}function st(t,e,i){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!ot.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const i=0|pt(t,e);let n=nt(i);const o=n.write(t,e);o!==i&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Ht(t,Uint8Array)){const e=new Uint8Array(t);return ct(e.buffer,e.byteOffset,e.byteLength)}return lt(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Ht(t,ArrayBuffer)||t&&Ht(t.buffer,ArrayBuffer))return ct(t,e,i);if("undefined"!=typeof SharedArrayBuffer&&(Ht(t,SharedArrayBuffer)||t&&Ht(t.buffer,SharedArrayBuffer)))return ct(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return ot.from(n,e,i);const o=function(t){if(ot.isBuffer(t)){const e=0|ft(t.length),i=nt(e);return 0===i.length||t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||Vt(t.length)?nt(0):lt(t);if("Buffer"===t.type&&Array.isArray(t.data))return lt(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return ot.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function at(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function rt(t){return at(t),nt(t<0?0:0|ft(t))}function lt(t){const e=t.length<0?0:0|ft(t.length),i=nt(e);for(let n=0;n=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function pt(t,e){if(ot.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ht(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const i=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Pt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Xt(t).length;default:if(o)return n?-1:Pt(t).length;e=(""+e).toLowerCase(),o=!0}}function dt(t,e,i){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Et(this,e,i);case"utf8":case"utf-8":return kt(this,e,i);case"ascii":return Nt(this,e,i);case"latin1":case"binary":return Ct(this,e,i);case"base64":return vt(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function ut(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function ht(t,e,i,n,o){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),Vt(i=+i)&&(i=o?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(o)return-1;i=t.length-1}else if(i<0){if(!o)return-1;i=0}if("string"==typeof e&&(e=ot.from(e,n)),ot.isBuffer(e))return 0===e.length?-1:mt(t,e,i,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):mt(t,[e],i,n,o);throw new TypeError("val must be string, number or Buffer")}function mt(t,e,i,n,o){let s,a=1,r=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,r/=2,l/=2,i/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){let n=-1;for(s=i;sr&&(i=r-l),s=i;s>=0;s--){let i=!0;for(let n=0;no&&(n=o):n=o;const s=e.length;let a;for(n>s/2&&(n=s/2),a=0;a>8,o=i%256,s.push(o),s.push(n);return s}(e,t.length-i),t,i,n)}function vt(t,e,i){return 0===e&&i===t.length?H(t):H(t.slice(e,i))}function kt(t,e,i){i=Math.min(t.length,i);const n=[];let o=e;for(;o239?4:e>223?3:e>191?2:1;if(o+a<=i){let i,n,r,l;switch(a){case 1:e<128&&(s=e);break;case 2:i=t[o+1],128==(192&i)&&(l=(31&e)<<6|63&i,l>127&&(s=l));break;case 3:i=t[o+1],n=t[o+2],128==(192&i)&&128==(192&n)&&(l=(15&e)<<12|(63&i)<<6|63&n,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:i=t[o+1],n=t[o+2],r=t[o+3],128==(192&i)&&128==(192&n)&&128==(192&r)&&(l=(15&e)<<18|(63&i)<<12|(63&n)<<6|63&r,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=a}return function(t){const e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);let i="",n=0;for(;nn.length?(ot.isBuffer(e)||(e=ot.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!ot.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},ot.byteLength=pt,ot.prototype._isBuffer=!0,ot.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e50&&(t+=" ... "),""},it&&(ot.prototype[it]=ot.prototype.inspect),ot.prototype.compare=function(t,e,i,n,o){if(Ht(t,Uint8Array)&&(t=ot.from(t,t.offset,t.byteLength)),!ot.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||i>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(this===t)return 0;let s=(o>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0);const r=Math.min(s,a),l=this.slice(n,o),c=t.slice(e,i);for(let t=0;t>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}const o=this.length-e;if((void 0===i||i>o)&&(i=o),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return gt(this,t,e,i);case"utf8":case"utf-8":return bt(this,t,e,i);case"ascii":case"latin1":case"binary":return xt(this,t,e,i);case"base64":return yt(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},ot.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(t,e,i){let n="";i=Math.min(t.length,i);for(let o=e;on)&&(i=n);let o="";for(let n=e;ni)throw new RangeError("Trying to access beyond buffer length")}function At(t,e,i,n,o,s){if(!ot.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function Ot(t,e,i,n,o){jt(e,n,o,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a>>=8,t[i++]=a,a>>=8,t[i++]=a,a>>=8,t[i++]=a,i}function Tt(t,e,i,n,o){jt(e,n,o,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s>>=8,t[i+6]=s,s>>=8,t[i+5]=s,s>>=8,t[i+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a>>=8,t[i+2]=a,a>>=8,t[i+1]=a,a>>=8,t[i]=a,i+8}function Bt(t,e,i,n,o,s){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function Rt(t,e,i,n,o){return e=+e,i>>>=0,o||Bt(t,0,i,4),$(t,e,i,n,23,4),i+4}function zt(t,e,i,n,o){return e=+e,i>>>=0,o||Bt(t,0,i,8),$(t,e,i,n,52,8),i+8}ot.prototype.slice=function(t,e){const i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e>>=0,e>>>=0,i||Lt(t,e,this.length);let n=this[t],o=1,s=0;for(;++s>>=0,e>>>=0,i||Lt(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},ot.prototype.readUint8=ot.prototype.readUInt8=function(t,e){return t>>>=0,e||Lt(t,1,this.length),this[t]},ot.prototype.readUint16LE=ot.prototype.readUInt16LE=function(t,e){return t>>>=0,e||Lt(t,2,this.length),this[t]|this[t+1]<<8},ot.prototype.readUint16BE=ot.prototype.readUInt16BE=function(t,e){return t>>>=0,e||Lt(t,2,this.length),this[t]<<8|this[t+1]},ot.prototype.readUint32LE=ot.prototype.readUInt32LE=function(t,e){return t>>>=0,e||Lt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},ot.prototype.readUint32BE=ot.prototype.readUInt32BE=function(t,e){return t>>>=0,e||Lt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},ot.prototype.readBigUInt64LE=$t((function(t){Ut(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||Ft(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+i*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||Ft(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+i;return(BigInt(n)<>>=0,e>>>=0,i||Lt(t,e,this.length);let n=this[t],o=1,s=0;for(;++s=o&&(n-=Math.pow(2,8*e)),n},ot.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||Lt(t,e,this.length);let n=e,o=1,s=this[t+--n];for(;n>0&&(o*=256);)s+=this[t+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s},ot.prototype.readInt8=function(t,e){return t>>>=0,e||Lt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},ot.prototype.readInt16LE=function(t,e){t>>>=0,e||Lt(t,2,this.length);const i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},ot.prototype.readInt16BE=function(t,e){t>>>=0,e||Lt(t,2,this.length);const i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},ot.prototype.readInt32LE=function(t,e){return t>>>=0,e||Lt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},ot.prototype.readInt32BE=function(t,e){return t>>>=0,e||Lt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},ot.prototype.readBigInt64LE=$t((function(t){Ut(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||Ft(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||Ft(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||Lt(t,4,this.length),q(this,t,!0,23,4)},ot.prototype.readFloatBE=function(t,e){return t>>>=0,e||Lt(t,4,this.length),q(this,t,!1,23,4)},ot.prototype.readDoubleLE=function(t,e){return t>>>=0,e||Lt(t,8,this.length),q(this,t,!0,52,8)},ot.prototype.readDoubleBE=function(t,e){return t>>>=0,e||Lt(t,8,this.length),q(this,t,!1,52,8)},ot.prototype.writeUintLE=ot.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e>>>=0,i>>>=0,!n){At(this,t,e,i,Math.pow(2,8*i)-1,0)}let o=1,s=0;for(this[e]=255&t;++s>>=0,i>>>=0,!n){At(this,t,e,i,Math.pow(2,8*i)-1,0)}let o=i-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+i},ot.prototype.writeUint8=ot.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,1,255,0),this[e]=255&t,e+1},ot.prototype.writeUint16LE=ot.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},ot.prototype.writeUint16BE=ot.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},ot.prototype.writeUint32LE=ot.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},ot.prototype.writeUint32BE=ot.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},ot.prototype.writeBigUInt64LE=$t((function(t,e=0){return Ot(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),ot.prototype.writeBigUInt64BE=$t((function(t,e=0){return Tt(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),ot.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*i-1);At(this,t,e,i,n-1,-n)}let o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+i},ot.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*i-1);At(this,t,e,i,n-1,-n)}let o=i-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},ot.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},ot.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},ot.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},ot.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},ot.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||At(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},ot.prototype.writeBigInt64LE=$t((function(t,e=0){return Ot(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),ot.prototype.writeBigInt64BE=$t((function(t,e=0){return Tt(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),ot.prototype.writeFloatLE=function(t,e,i){return Rt(this,t,e,!0,i)},ot.prototype.writeFloatBE=function(t,e,i){return Rt(this,t,e,!1,i)},ot.prototype.writeDoubleLE=function(t,e,i){return zt(this,t,e,!0,i)},ot.prototype.writeDoubleBE=function(t,e,i){return zt(this,t,e,!1,i)},ot.prototype.copy=function(t,e,i,n){if(!ot.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function jt(t,e,i,n,o,s){if(t>i||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${e}${n} and <= ${i}${n}`,new It.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,i){Ut(e,"offset"),void 0!==t[e]&&void 0!==t[e+i]||Ft(e,t.length-(i+1))}(n,o,s)}function Ut(t,e){if("number"!=typeof t)throw new It.ERR_INVALID_ARG_TYPE(e,"number",t)}function Ft(t,e,i){if(Math.floor(t)!==t)throw Ut(t,i),new It.ERR_OUT_OF_RANGE(i||"offset","an integer",t);if(e<0)throw new It.ERR_BUFFER_OUT_OF_BOUNDS;throw new It.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}Mt("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),Mt("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),Mt("ERR_OUT_OF_RANGE",(function(t,e,i){let n=`The value of "${t}" is out of range.`,o=i;return Number.isInteger(i)&&Math.abs(i)>2**32?o=Dt(String(i)):"bigint"==typeof i&&(o=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(o=Dt(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const Wt=/[^+/0-9A-Za-z-_]/g;function Pt(t,e){let i;e=e||1/0;const n=t.length;let o=null;const s=[];for(let a=0;a55295&&i<57344){if(!o){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}o=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),o=i;continue}i=65536+(o-55296<<10|i-56320)}else o&&(e-=3)>-1&&s.push(239,191,189);if(o=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function Xt(t){return _(function(t){if((t=(t=t.split("=")[0]).trim().replace(Wt,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function _t(t,e,i,n){let o;for(o=0;o=e.length||o>=t.length);++o)e[o+i]=t[o];return o}function Ht(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Vt(t){return t!=t}const qt=function(){const t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){const n=16*i;for(let o=0;o<16;++o)e[n+o]=t[i]+t[o]}return e}();function $t(t){return"undefined"==typeof BigInt?Jt:t}function Jt(){throw new Error("BigInt not supported")}var Gt=X;function Qt(t){return U.isPlainObject(t)||U.isArray(t)}function Yt(t){return U.endsWith(t,"[]")?t.slice(0,-2):t}function Kt(t,e,i){return t?t.concat(e).map((function(t,e){return t=Yt(t),!i&&e?"["+t+"]":t})).join(i?".":""):e}const Zt=U.toFlatObject(U,{},null,(function(t){return/^is[A-Z]/.test(t)}));var te=function(t,e,i){if(!U.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(i=U.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!U.isUndefined(e[t])}))).metaTokens,o=i.visitor||c,s=i.dots,a=i.indexes,r=(i.Blob||"undefined"!=typeof Blob&&Blob)&&U.isSpecCompliantForm(e);if(!U.isFunction(o))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(U.isDate(t))return t.toISOString();if(!r&&U.isBlob(t))throw new V("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(t)||U.isTypedArray(t)?r&&"function"==typeof Blob?new Blob([t]):Gt.from(t):t}function c(t,i,o){let r=t;if(t&&!o&&"object"==typeof t)if(U.endsWith(i,"{}"))i=n?i:i.slice(0,-2),t=JSON.stringify(t);else if(U.isArray(t)&&function(t){return U.isArray(t)&&!t.some(Qt)}(t)||(U.isFileList(t)||U.endsWith(i,"[]"))&&(r=U.toArray(t)))return i=Yt(i),r.forEach((function(t,n){!U.isUndefined(t)&&null!==t&&e.append(!0===a?Kt([i],n,s):null===a?i:i+"[]",l(t))})),!1;return!!Qt(t)||(e.append(Kt(o,i,s),l(t)),!1)}const f=[],p=Object.assign(Zt,{defaultVisitor:c,convertValue:l,isVisitable:Qt});if(!U.isObject(t))throw new TypeError("data must be an object");return function t(i,n){if(!U.isUndefined(i)){if(-1!==f.indexOf(i))throw Error("Circular reference detected in "+n.join("."));f.push(i),U.forEach(i,(function(i,s){!0===(!(U.isUndefined(i)||null===i)&&o.call(e,i,U.isString(s)?s.trim():s,n,p))&&t(i,n?n.concat(s):[s])})),f.pop()}}(t),e};function ee(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ie(t,e){this._pairs=[],t&&te(t,this,e)}const ne=ie.prototype;ne.append=function(t,e){this._pairs.push([t,e])},ne.toString=function(t){const e=t?function(e){return t.call(this,e,ee)}:ee;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var oe=ie;function se(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(t,e,i){if(!e)return t;const n=i&&i.encode||se,o=i&&i.serialize;let s;if(s=o?o(e,i):U.isURLSearchParams(e)?e.toString():new oe(e,i).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}var re=class{use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){U.forEach(this.handlers,(function(e){null!==e&&t(e)}))}constructor(){this.handlers=[]}},le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ce={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:oe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function fe(t,e){return te(t,new ce.classes.URLSearchParams,Object.assign({visitor:function(t,e,i,n){return ce.isNode&&U.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}var pe=function(t){function e(t,i,n,o){let s=t[o++];const a=Number.isFinite(+s),r=o>=t.length;if(s=!s&&U.isArray(n)?n.length:s,r)return U.hasOwnProp(n,s)?n[s]=[n[s],i]:n[s]=i,!a;n[s]&&U.isObject(n[s])||(n[s]=[]);return e(t,i,n[s],o)&&U.isArray(n[s])&&(n[s]=function(t){const e={},i=Object.keys(t);let n;const o=i.length;let s;for(n=0;n{e(function(t){return U.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,i,0)})),i}return null};const de={"Content-Type":void 0};const ue={transitional:le,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,o=U.isObject(t);o&&U.isHTMLForm(t)&&(t=new FormData(t));if(U.isFormData(t))return n&&n?JSON.stringify(pe(t)):t;if(U.isArrayBuffer(t)||U.isBuffer(t)||U.isStream(t)||U.isFile(t)||U.isBlob(t))return t;if(U.isArrayBufferView(t))return t.buffer;if(U.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return fe(t,this.formSerializer).toString();if((s=U.isFileList(t))||i.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return te(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,i){if(U.isString(t))try{return(e||JSON.parse)(t),U.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||ue.transitional,i=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&U.isString(t)&&(i&&!this.responseType||n)){const i=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw V.from(t,V.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};U.forEach(["delete","get","head"],(function(t){ue.headers[t]={}})),U.forEach(["post","put","patch"],(function(t){ue.headers[t]=U.merge(de)}));var he=ue;const me=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ge=t=>{const e={};let i,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),i=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!i||e[i]&&me[i]||("set-cookie"===i?e[i]?e[i].push(n):e[i]=[n]:e[i]=e[i]?e[i]+", "+n:n)})),e};const be=Symbol("internals");function xe(t){return t&&String(t).trim().toLowerCase()}function ye(t){return!1===t||null==t?t:U.isArray(t)?t.map(ye):String(t)}function we(t,e,i,n,o){return U.isFunction(n)?n.call(this,e,i):(o&&(e=i),U.isString(e)?U.isString(n)?-1!==e.indexOf(n):U.isRegExp(n)?n.test(e):void 0:void 0)}let ve=Symbol.iterator,ke=Symbol.toStringTag;class Ne{set(t,e,i){const n=this;function o(t,e,i){const o=xe(e);if(!o)throw new Error("header name must be a non-empty string");const s=U.findKey(n,o);(!s||void 0===n[s]||!0===i||void 0===i&&!1!==n[s])&&(n[s||e]=ye(t))}const s=(t,e)=>U.forEach(t,((t,i)=>o(t,i,e)));return U.isPlainObject(t)||t instanceof this.constructor?s(t,e):U.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?s(ge(t),e):null!=t&&o(e,t,i),this}get(t,e){if(t=xe(t)){const i=U.findKey(this,t);if(i){const t=this[i];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(t);)e[n[1]]=n[2];return e}(t);if(U.isFunction(e))return e.call(this,t,i);if(U.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=xe(t)){const i=U.findKey(this,t);return!(!i||void 0===this[i]||e&&!we(0,this[i],i,e))}return!1}delete(t,e){const i=this;let n=!1;function o(t){if(t=xe(t)){const o=U.findKey(i,t);!o||e&&!we(0,i[o],o,e)||(delete i[o],n=!0)}}return U.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const o=e[i];t&&!we(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,i={};return U.forEach(this,((n,o)=>{const s=U.findKey(i,o);if(s)return e[s]=ye(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,i)=>e.toUpperCase()+i))}(o):String(o).trim();a!==o&&delete e[o],e[a]=ye(n),i[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return U.forEach(this,((i,n)=>{null!=i&&!1!==i&&(e[n]=t&&U.isArray(i)?i.join(", "):i)})),e}[ve](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[ke](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach((t=>i.set(t))),i}static accessor(t){const e=(this[be]=this[be]={accessors:{}}).accessors,i=this.prototype;function n(t){const n=xe(t);e[n]||(!function(t,e){const i=U.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+i,{value:function(t,i,o){return this[n].call(this,e,t,i,o)},configurable:!0})}))}(i,t),e[n]=!0)}return U.isArray(t)?t.forEach(n):n(t),this}constructor(t){t&&this.set(t)}}Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.freezeMethods(Ne.prototype),U.freezeMethods(Ne);var Ce=Ne;function Ee(t,e){const i=this||he,n=e||i,o=Ce.from(n.headers);let s=n.data;return U.forEach(t,(function(t){s=t.call(i,s,o.normalize(),e?e.status:void 0)})),o.normalize(),s}function Se(t){return!(!t||!t.__CANCEL__)}function Le(t,e,i){V.call(this,null==t?"canceled":t,V.ERR_CANCELED,e,i),this.name="CanceledError"}U.inherits(Le,V,{__CANCEL__:!0});var Ae=Le;function Oe(t,e,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?e(new V("Request failed with status code "+i.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}var Te=ce.isStandardBrowserEnv?{write:function(t,e,i,n,o,s){const a=[];a.push(t+"="+encodeURIComponent(e)),U.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),U.isString(n)&&a.push("path="+n),U.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Be(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Re(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?Be(t,e):e}var ze=ce.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(i){let n=i;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(t){const e=U.isString(t)?n(t):t;return e.protocol===i.protocol&&e.host===i.host}}():function(){return!0};function Ie(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var Me=function(t,e){t=t||10;const i=new Array(t),n=new Array(t);let o,s=0,a=0;return e=void 0!==e?e:1e3,function(r){const l=Date.now(),c=n[a];o||(o=l),i[s]=r,n[s]=l;let f=a,p=0;for(;f!==s;)p+=i[f++],f%=t;if(s=(s+1)%t,s===a&&(a=(a+1)%t),l-o{const s=o.loaded,a=o.lengthComputable?o.total:void 0,r=s-i,l=n(r);i=s;const c={loaded:s,total:a,progress:a?s/a:void 0,bytes:r,rate:l||void 0,estimated:l&&a&&s<=a?(a-s)/l:void 0,event:o};c[e?"download":"upload"]=!0,t(c)}}const je={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,i){let n=t.data;const o=Ce.from(t.headers).normalize(),s=t.responseType;let a;function r(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}U.isFormData(n)&&(ce.isStandardBrowserEnv||ce.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",i=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+i))}const c=Re(t.baseURL,t.url);function f(){if(!l)return;const n=Ce.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());Oe((function(t){e(t),r()}),(function(t){i(t),r()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:t,request:l}),l=null}if(l.open(t.method.toUpperCase(),ae(c,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(i(new V("Request aborted",V.ECONNABORTED,t,l)),l=null)},l.onerror=function(){i(new V("Network Error",V.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||le;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(new V(e,n.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,t,l)),l=null},ce.isStandardBrowserEnv){const e=(t.withCredentials||ze(c))&&t.xsrfCookieName&&Te.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in l&&U.forEach(o.toJSON(),(function(t,e){l.setRequestHeader(e,t)})),U.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),s&&"json"!==s&&(l.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",De(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",De(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{l&&(i(!e||e.type?new Ae(null,t,l):e),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=Ie(c);p&&-1===ce.protocols.indexOf(p)?i(new V("Unsupported protocol "+p+":",V.ERR_BAD_REQUEST,t)):l.send(n||null)}))}};U.forEach(je,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));var Ue={getAdapter:t=>{t=U.isArray(t)?t:[t];const{length:e}=t;let i,n;for(let o=0;ot instanceof Ce?t.toJSON():t;function Xe(t,e){e=e||{};const i={};function n(t,e,i){return U.isPlainObject(t)&&U.isPlainObject(e)?U.merge.call({caseless:i},t,e):U.isPlainObject(e)?U.merge({},e):U.isArray(e)?e.slice():e}function o(t,e,i){return U.isUndefined(e)?U.isUndefined(t)?void 0:n(void 0,t,i):n(t,e,i)}function s(t,e){if(!U.isUndefined(e))return n(void 0,e)}function a(t,e){return U.isUndefined(e)?U.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function r(i,o,s){return s in e?n(i,o):s in t?n(void 0,i):void 0}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:r,headers:(t,e)=>o(Pe(t),Pe(e),!0)};return U.forEach(Object.keys(Object.assign({},t,e)),(function(n){const s=l[n]||o,a=s(t[n],e[n],n);U.isUndefined(a)&&s!==r||(i[n]=a)})),i}const _e={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{_e[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));const He={};_e.transitional=function(t,e,i){function n(t,e){return"[Axios v1.4.0] Transitional option '"+t+"'"+e+(i?". "+i:"")}return(i,o,s)=>{if(!1===t)throw new V(n(o," has been removed"+(e?" in "+e:"")),V.ERR_DEPRECATED);return e&&!He[o]&&(He[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,o,s)}};var Ve={assertOptions:function(t,e,i){if("object"!=typeof t)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const s=n[o],a=e[s];if(a){const e=t[s],i=void 0===e||a(e,s,t);if(!0!==i)throw new V("option "+s+" must be "+i,V.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new V("Unknown option "+s,V.ERR_BAD_OPTION)}},validators:_e};const qe=Ve.validators;class $e{request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Xe(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:o}=e;let s;void 0!==i&&Ve.assertOptions(i,{silentJSONParsing:qe.transitional(qe.boolean),forcedJSONParsing:qe.transitional(qe.boolean),clarifyTimeoutError:qe.transitional(qe.boolean)},!1),null!=n&&(U.isFunction(n)?e.paramsSerializer={serialize:n}:Ve.assertOptions(n,{encode:qe.function,serialize:qe.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase(),s=o&&U.merge(o.common,o[e.method]),s&&U.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Ce.concat(s,o);const a=[];let r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));let f,p=0;if(!r){const t=[We.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,l),f=t.length,c=Promise.resolve(e);p{if(!i._listeners)return;let e=i._listeners.length;for(;e-- >0;)i._listeners[e](t);i._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{i.subscribe(t),e=t})).then(t);return n.cancel=function(){i.unsubscribe(e)},n},t((function(t,n,o){i.reason||(i.reason=new Ae(t,n,o),e(i.reason))}))}}var Qe=Ge;const Ye={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ye).forEach((([t,e])=>{Ye[e]=t}));var Ke=Ye;const Ze=function t(e){const i=new Je(e),n=a(Je.prototype.request,i);return U.extend(n,Je.prototype,i,{allOwnKeys:!0}),U.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return t(Xe(e,i))},n}(he);Ze.Axios=Je,Ze.CanceledError=Ae,Ze.CancelToken=Qe,Ze.isCancel=Se,Ze.VERSION="1.4.0",Ze.toFormData=te,Ze.AxiosError=V,Ze.Cancel=Ze.CanceledError,Ze.all=function(t){return Promise.all(t)},Ze.spread=function(t){return function(e){return t.apply(null,e)}},Ze.isAxiosError=function(t){return U.isObject(t)&&!0===t.isAxiosError},Ze.mergeConfig=Xe,Ze.AxiosHeaders=Ce,Ze.formToJSON=t=>pe(U.isHTMLForm(t)?new FormData(t):t),Ze.HttpStatusCode=Ke,Ze.default=Ze;var ti=Ze;const{Axios:ei,AxiosError:ii,CanceledError:ni,isCancel:oi,CancelToken:si,VERSION:ai,all:ri,Cancel:li,isAxiosError:ci,spread:fi,toFormData:pi,AxiosHeaders:di,HttpStatusCode:ui,formToJSON:hi,mergeConfig:mi}=ti;const gi=document.getElementById("selectBreed"),bi=document.querySelector(".loader"),xi=document.querySelector("div.cat-info"),yi=document.querySelector(".section-load");var wi;function vi(t){console.log(t);const e=` \x3c!-- розмітка для кота --\x3e\n