@department-of-veterans-affairs/component-library 54.3.0 → 54.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/Modal.unit.spec.js +1 -0
  2. package/dist/1214.app.bundle.js +1 -0
  3. package/dist/1339.app.bundle.js +2 -0
  4. package/dist/{6850.app.bundle.js → 1351.app.bundle.js} +1 -1
  5. package/dist/{6830.app.bundle.js → 1365.app.bundle.js} +1 -1
  6. package/dist/{7481.app.bundle.js → 1450.app.bundle.js} +1 -1
  7. package/dist/2222.app.bundle.js +2 -0
  8. package/dist/{7734.app.bundle.js → 2387.app.bundle.js} +1 -1
  9. package/dist/{4157.app.bundle.js → 2472.app.bundle.js} +1 -1
  10. package/dist/{3589.app.bundle.js → 2654.app.bundle.js} +2 -2
  11. package/dist/{2923.app.bundle.js → 2664.app.bundle.js} +2 -2
  12. package/dist/{7372.app.bundle.js → 2801.app.bundle.js} +2 -2
  13. package/dist/{3601.app.bundle.js → 2858.app.bundle.js} +2 -2
  14. package/dist/{6832.app.bundle.js → 3071.app.bundle.js} +1 -1
  15. package/dist/{6043.app.bundle.js → 3126.app.bundle.js} +1 -1
  16. package/dist/{4351.app.bundle.js → 3156.app.bundle.js} +1 -1
  17. package/dist/{7267.app.bundle.js → 3238.app.bundle.js} +1 -1
  18. package/dist/{6555.app.bundle.js → 4064.app.bundle.js} +1 -1
  19. package/dist/{6650.app.bundle.js → 4117.app.bundle.js} +2 -2
  20. package/dist/{2205.app.bundle.js → 4140.app.bundle.js} +1 -1
  21. package/dist/415.app.bundle.js +1 -0
  22. package/dist/{4569.app.bundle.js → 4164.app.bundle.js} +2 -2
  23. package/dist/{5341.app.bundle.js → 4708.app.bundle.js} +2 -2
  24. package/dist/{1822.app.bundle.js → 4715.app.bundle.js} +2 -2
  25. package/dist/{5938.app.bundle.js → 5019.app.bundle.js} +2 -2
  26. package/dist/{6718.app.bundle.js → 5155.app.bundle.js} +1 -1
  27. package/dist/{9376.app.bundle.js → 5189.app.bundle.js} +2 -2
  28. package/dist/{5845.app.bundle.js → 5306.app.bundle.js} +2 -2
  29. package/dist/{5689.app.bundle.js → 5610.app.bundle.js} +1 -1
  30. package/dist/{5990.app.bundle.js → 5699.app.bundle.js} +2 -2
  31. package/dist/575.app.bundle.js +2 -0
  32. package/dist/{5119.app.bundle.js → 5830.app.bundle.js} +2 -2
  33. package/dist/{7495.app.bundle.js → 6034.app.bundle.js} +2 -2
  34. package/dist/{7307.app.bundle.js → 6246.app.bundle.js} +2 -2
  35. package/dist/{2482.app.bundle.js → 6247.app.bundle.js} +1 -1
  36. package/dist/{7166.app.bundle.js → 6349.app.bundle.js} +2 -2
  37. package/dist/{960.app.bundle.js → 641.app.bundle.js} +1 -1
  38. package/dist/{9186.app.bundle.js → 6527.app.bundle.js} +2 -2
  39. package/dist/{6308.app.bundle.js → 6633.app.bundle.js} +2 -2
  40. package/dist/{1966.app.bundle.js → 6655.app.bundle.js} +2 -2
  41. package/dist/6683.app.bundle.js +2 -0
  42. package/dist/6771.app.bundle.js +1 -0
  43. package/dist/{8915.app.bundle.js → 6824.app.bundle.js} +2 -2
  44. package/dist/712.app.bundle.js +2 -0
  45. package/dist/{4400.app.bundle.js → 7367.app.bundle.js} +2 -2
  46. package/dist/{2986.app.bundle.js → 7531.app.bundle.js} +1 -1
  47. package/dist/{6498.app.bundle.js → 7663.app.bundle.js} +1 -1
  48. package/dist/{3305.app.bundle.js → 7814.app.bundle.js} +2 -2
  49. package/dist/{2236.app.bundle.js → 7821.app.bundle.js} +1 -1
  50. package/dist/8175.app.bundle.js +2 -0
  51. package/dist/82.app.bundle.js +2 -0
  52. package/dist/8206.app.bundle.js +1 -0
  53. package/dist/{4780.app.bundle.js → 8495.app.bundle.js} +2 -2
  54. package/dist/{4996.app.bundle.js → 8735.app.bundle.js} +2 -2
  55. package/dist/8762.app.bundle.js +2 -1
  56. package/dist/{6696.app.bundle.js → 8859.app.bundle.js} +1 -1
  57. package/dist/890.app.bundle.js +2 -0
  58. package/dist/9288.app.bundle.js +1 -0
  59. package/dist/{7084.app.bundle.js → 9409.app.bundle.js} +1 -1
  60. package/dist/9463.app.bundle.js +1 -0
  61. package/dist/{8463.app.bundle.js → 9670.app.bundle.js} +1 -1
  62. package/dist/9724.app.bundle.js +2 -0
  63. package/dist/{5348.app.bundle.js → 9755.app.bundle.js} +2 -2
  64. package/dist/{8255.app.bundle.js → 9794.app.bundle.js} +2 -2
  65. package/dist/{8913.app.bundle.js → 9800.app.bundle.js} +2 -2
  66. package/dist/9915.app.bundle.js +1 -0
  67. package/dist/{5705.app.bundle.js → 9966.app.bundle.js} +2 -2
  68. package/dist/app.bundle.js +1 -1
  69. package/dist/app.bundle.js.LICENSE.txt +1 -1
  70. package/dist/components/contacts.js +1 -1
  71. package/dist/components/i18next.js +1 -1
  72. package/dist/components/types/components.d.ts +2 -2
  73. package/dist/components/va-file-input2.js +1 -1
  74. package/dist/components/va-memorable-date.js +1 -1
  75. package/dist/components/va-omb-info.js +1 -1
  76. package/dist/components/va-pagination.js +1 -1
  77. package/dist/components/va-progress-bar2.js +1 -1
  78. package/dist/components/va-segmented-progress-bar.js +1 -1
  79. package/package.json +15 -15
  80. package/dist/0.app.bundle.js +0 -2
  81. package/dist/12.app.bundle.js +0 -1
  82. package/dist/141.app.bundle.js +0 -2
  83. package/dist/251.app.bundle.js +0 -1
  84. package/dist/272.app.bundle.js +0 -2
  85. package/dist/323.app.bundle.js +0 -2
  86. package/dist/3397.app.bundle.js +0 -1
  87. package/dist/3600.app.bundle.js +0 -1
  88. package/dist/4432.app.bundle.js +0 -2
  89. package/dist/4475.app.bundle.js +0 -1
  90. package/dist/5663.app.bundle.js +0 -2
  91. package/dist/606.app.bundle.js +0 -1
  92. package/dist/6095.app.bundle.js +0 -2
  93. package/dist/6849.app.bundle.js +0 -2
  94. package/dist/9496.app.bundle.js +0 -2
  95. package/dist/9851.app.bundle.js +0 -2
  96. /package/dist/{0.app.bundle.js.LICENSE.txt → 1339.app.bundle.js.LICENSE.txt} +0 -0
  97. /package/dist/{141.app.bundle.js.LICENSE.txt → 2222.app.bundle.js.LICENSE.txt} +0 -0
  98. /package/dist/{1822.app.bundle.js.LICENSE.txt → 2654.app.bundle.js.LICENSE.txt} +0 -0
  99. /package/dist/{1966.app.bundle.js.LICENSE.txt → 2664.app.bundle.js.LICENSE.txt} +0 -0
  100. /package/dist/{272.app.bundle.js.LICENSE.txt → 2801.app.bundle.js.LICENSE.txt} +0 -0
  101. /package/dist/{2923.app.bundle.js.LICENSE.txt → 2858.app.bundle.js.LICENSE.txt} +0 -0
  102. /package/dist/{323.app.bundle.js.LICENSE.txt → 4117.app.bundle.js.LICENSE.txt} +0 -0
  103. /package/dist/{3305.app.bundle.js.LICENSE.txt → 4164.app.bundle.js.LICENSE.txt} +0 -0
  104. /package/dist/{3589.app.bundle.js.LICENSE.txt → 4708.app.bundle.js.LICENSE.txt} +0 -0
  105. /package/dist/{3601.app.bundle.js.LICENSE.txt → 4715.app.bundle.js.LICENSE.txt} +0 -0
  106. /package/dist/{4400.app.bundle.js.LICENSE.txt → 5019.app.bundle.js.LICENSE.txt} +0 -0
  107. /package/dist/{4432.app.bundle.js.LICENSE.txt → 5189.app.bundle.js.LICENSE.txt} +0 -0
  108. /package/dist/{4569.app.bundle.js.LICENSE.txt → 5306.app.bundle.js.LICENSE.txt} +0 -0
  109. /package/dist/{4780.app.bundle.js.LICENSE.txt → 5699.app.bundle.js.LICENSE.txt} +0 -0
  110. /package/dist/{4996.app.bundle.js.LICENSE.txt → 575.app.bundle.js.LICENSE.txt} +0 -0
  111. /package/dist/{5119.app.bundle.js.LICENSE.txt → 5830.app.bundle.js.LICENSE.txt} +0 -0
  112. /package/dist/{5341.app.bundle.js.LICENSE.txt → 6034.app.bundle.js.LICENSE.txt} +0 -0
  113. /package/dist/{5348.app.bundle.js.LICENSE.txt → 6246.app.bundle.js.LICENSE.txt} +0 -0
  114. /package/dist/{5663.app.bundle.js.LICENSE.txt → 6349.app.bundle.js.LICENSE.txt} +0 -0
  115. /package/dist/{5705.app.bundle.js.LICENSE.txt → 6527.app.bundle.js.LICENSE.txt} +0 -0
  116. /package/dist/{5845.app.bundle.js.LICENSE.txt → 6633.app.bundle.js.LICENSE.txt} +0 -0
  117. /package/dist/{5938.app.bundle.js.LICENSE.txt → 6655.app.bundle.js.LICENSE.txt} +0 -0
  118. /package/dist/{5990.app.bundle.js.LICENSE.txt → 6683.app.bundle.js.LICENSE.txt} +0 -0
  119. /package/dist/{6095.app.bundle.js.LICENSE.txt → 6824.app.bundle.js.LICENSE.txt} +0 -0
  120. /package/dist/{6308.app.bundle.js.LICENSE.txt → 712.app.bundle.js.LICENSE.txt} +0 -0
  121. /package/dist/{6650.app.bundle.js.LICENSE.txt → 7367.app.bundle.js.LICENSE.txt} +0 -0
  122. /package/dist/{6849.app.bundle.js.LICENSE.txt → 7814.app.bundle.js.LICENSE.txt} +0 -0
  123. /package/dist/{7166.app.bundle.js.LICENSE.txt → 8175.app.bundle.js.LICENSE.txt} +0 -0
  124. /package/dist/{7307.app.bundle.js.LICENSE.txt → 82.app.bundle.js.LICENSE.txt} +0 -0
  125. /package/dist/{7372.app.bundle.js.LICENSE.txt → 8495.app.bundle.js.LICENSE.txt} +0 -0
  126. /package/dist/{7495.app.bundle.js.LICENSE.txt → 8735.app.bundle.js.LICENSE.txt} +0 -0
  127. /package/dist/{8255.app.bundle.js.LICENSE.txt → 8762.app.bundle.js.LICENSE.txt} +0 -0
  128. /package/dist/{8913.app.bundle.js.LICENSE.txt → 890.app.bundle.js.LICENSE.txt} +0 -0
  129. /package/dist/{8915.app.bundle.js.LICENSE.txt → 9724.app.bundle.js.LICENSE.txt} +0 -0
  130. /package/dist/{9186.app.bundle.js.LICENSE.txt → 9755.app.bundle.js.LICENSE.txt} +0 -0
  131. /package/dist/{9376.app.bundle.js.LICENSE.txt → 9794.app.bundle.js.LICENSE.txt} +0 -0
  132. /package/dist/{9496.app.bundle.js.LICENSE.txt → 9800.app.bundle.js.LICENSE.txt} +0 -0
  133. /package/dist/{9851.app.bundle.js.LICENSE.txt → 9966.app.bundle.js.LICENSE.txt} +0 -0
@@ -5,7 +5,7 @@ object-assign
5
5
  */
6
6
 
7
7
  /*!
8
- Copyright (c) 2018 Jed Watson.
8
+ Copyright (c) 2017 Jed Watson.
9
9
  Licensed under the MIT License (MIT), see
10
10
  http://jedwatson.github.io/classnames
11
11
  */
@@ -1 +1 @@
1
- import{_ as _createClass,a as _classCallCheck,i as instance}from"./i18next.js";var arr=[],each=arr.forEach,slice=arr.slice;function defaults(e){return each.call(slice.call(arguments,1),(function(a){if(a)for(var t in a)void 0===e[t]&&(e[t]=a[t])})),e}var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(e,a,t){var n=t||{};n.path=n.path||"/";var o=e+"="+encodeURIComponent(a);if(n.maxAge>0){var r=n.maxAge-0;if(isNaN(r))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(r)}if(n.domain){if(!fieldContentRegExp.test(n.domain))throw new TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!fieldContentRegExp.test(n.path))throw new TypeError("option path is invalid");o+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");o+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(o+="; HttpOnly"),n.secure&&(o+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o},cookie={create:function(e,a,t,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};t&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*t*1e3)),n&&(o.domain=n),document.cookie=serializeCookie(e,encodeURIComponent(a),o)},read:function(e){for(var a=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(a))return o.substring(a.length,o.length)}return null},remove:function(e){this.create(e,"",-1)}},cookie$1={name:"cookie",lookup:function(e){var a;if(e.lookupCookie&&"undefined"!=typeof document){var t=cookie.read(e.lookupCookie);t&&(a=t)}return a},cacheUserLanguage:function(e,a){a.lookupCookie&&"undefined"!=typeof document&&cookie.create(a.lookupCookie,e,a.cookieMinutes,a.cookieDomain,a.cookieOptions)}},querystring={name:"querystring",lookup:function(e){var a;if("undefined"!=typeof window){var t=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));for(var n=t.substring(1).split("&"),o=0;o<n.length;o++){var r=n[o].indexOf("=");r>0&&n[o].substring(0,r)===e.lookupQuerystring&&(a=n[o].substring(r+1))}}return a}},hasLocalStorageSupport=null,localStorageAvailable=function(){if(null!==hasLocalStorageSupport)return hasLocalStorageSupport;try{hasLocalStorageSupport="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){hasLocalStorageSupport=!1}return hasLocalStorageSupport},localStorage={name:"localStorage",lookup:function(e){var a;if(e.lookupLocalStorage&&localStorageAvailable()){var t=window.localStorage.getItem(e.lookupLocalStorage);t&&(a=t)}return a},cacheUserLanguage:function(e,a){a.lookupLocalStorage&&localStorageAvailable()&&window.localStorage.setItem(a.lookupLocalStorage,e)}},hasSessionStorageSupport=null,sessionStorageAvailable=function(){if(null!==hasSessionStorageSupport)return hasSessionStorageSupport;try{hasSessionStorageSupport="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){hasSessionStorageSupport=!1}return hasSessionStorageSupport},sessionStorage={name:"sessionStorage",lookup:function(e){var a;if(e.lookupSessionStorage&&sessionStorageAvailable()){var t=window.sessionStorage.getItem(e.lookupSessionStorage);t&&(a=t)}return a},cacheUserLanguage:function(e,a){a.lookupSessionStorage&&sessionStorageAvailable()&&window.sessionStorage.setItem(a.lookupSessionStorage,e)}},navigator$1={name:"navigator",lookup:function(e){var a=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var t=0;t<navigator.languages.length;t++)a.push(navigator.languages[t]);navigator.userLanguage&&a.push(navigator.userLanguage),navigator.language&&a.push(navigator.language)}return a.length>0?a:void 0}},htmlTag={name:"htmlTag",lookup:function(e){var a,t=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return t&&"function"==typeof t.getAttribute&&(a=t.getAttribute("lang")),a}},path={name:"path",lookup:function(e){var a;if("undefined"!=typeof window){var t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(t instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof t[e.lookupFromPathIndex])return;a=t[e.lookupFromPathIndex].replace("/","")}else a=t[0].replace("/","")}return a}},subdomain={name:"subdomain",lookup:function(e){var a;if("undefined"!=typeof window){var t=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);t instanceof Array&&(a="number"==typeof e.lookupFromSubdomainIndex?t[e.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):t[0].replace("http://","").replace("https://","").replace(".",""))}return a}};function getDefaults(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Browser=function(){function e(a){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.type="languageDetector",this.detectors={},this.init(a,t)}return _createClass(e,[{key:"init",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=defaults(a,this.options||{},getDefaults()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=t,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(localStorage),this.addDetector(sessionStorage),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path),this.addDetector(subdomain)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var a=this;e||(e=this.options.order);var t=[];return e.forEach((function(e){if(a.detectors[e]){var n=a.detectors[e].lookup(a.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}},{key:"cacheUserLanguage",value:function(e,a){var t=this;a||(a=this.options.caches),a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||a.forEach((function(a){t.detectors[a]&&t.detectors[a].cacheUserLanguage(e,t.options)})))}}]),e}();Browser.type="languageDetector";const mainTag={name:"mainTag",lookup(e){const a=document.querySelector("main");return a?.getAttribute("lang")}},enTranslation={error:"Error",required:"(*Required)",select:"- Select -","max-chars":"(Max. {{length}} characters)","min-chars":"(Min. {{length}} characters)","date-of-birth":"Date of birth",month:"Month",day:"Day",year:"Year","month-select":"Please select a month","month-range":"Please enter a month between {{start}} and {{end}}","day-range":"Please enter a day between {{start}} and {{end}}","year-range":"Please enter a year between {{start}} and {{end}}","expand-all":"Expand all","collapse-all":"Collapse all","expand-all-aria-label":"Expand all accordions","collapse-all-aria-label":"Collapse all accordions",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December","on-this-page":"On this page","date-hint":"Enter 1 or 2 digits for the month and day and 4 digits for the year.","date-hint-with-select":"Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.","date-hint-month":"Enter 1 or 2 digits for the month.","date-hint-month-select":"Select a month.","date-hint-day":"Enter 1 or 2 digits for the day.","date-hint-year":"Enter 4 digits for the year.","date-error":"Please enter a complete date","number-error":"Please enter a valid number","gov-site-label":"Official website of the United States government","gov-site-button":"Here's how you know","gov-site-website":"Official websites use .{{tld}}","gov-site-explanation":"A .{{tld}} website belongs to an official government organization in the United States.","gov-site-https":"Secure .{{tld}} websites use HTTPS","gov-site-lock":"A lock {{image}} or https:// means you've safely connected to the .{{tld}} website. Share sensitive information only on official, secure websites.",next:"Next",previous:"Previous","crisis-line-trigger-text":"Talk to the <strong>Veterans Crisis Line</strong> now","crisis-line-modal-title":"We’re here anytime, day or night – 24/7","crisis-line-intro":"If you are a Veteran in crisis or concerned about one, connect with our caring, qualified responders for confidential help. Many of them are Veterans themselves.","crisis-line-phone-label":"Call","crisis-line-phone-extension-label":"and select","crisis-line-text-label":"Text","crisis-line-chat-label":"Start a confidential chat","crisis-line-tty-label":"For TTY, call","crisis-line-tty-extension-label":"then","crisis-line-resources-link-label":"Get more resources at","crisis-line-resources-link-text":"VeteransCrisisLine.net"},esTranslation={error:"Error",required:"(*Requerido)",select:"- Seleccione -","max-chars":"(Número máximo de caracteres: {{length}})","min-chars":"(Número mínimo de caracteres: {{length}})","date-of-birth":"Fecha de nacimiento",month:"Mes",day:"Día",year:"Año","month-range":"Ingrese un mes entre {{start}} y {{end}}","day-range":"Ingrese un día entre {{start}} y {{end}}","year-range":"Ingrese un año entre {{start}} y {{end}}","expand-all":"Expandir todo","collapse-all":"Contraer todo","expand-all-aria-label":"Expandir todos los acordeones","collapse-all-aria-label":"Contraer todos los acordeones",january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre","on-this-page":"En esta página","date-hint":"Ingrese 1 o 2 dígitos para el mes y el día y 4 dígitos para el año.","date-hint-with-select":"Seleccione un mes. Ingrese 1 o 2 dígitos para el día y 4 dígitos para el año.","date-hint-month":"Ingrese 1 o 2 dígitos para el mes.","date-hint-month-select":"Seleccione un mes.","date-hint-day":"Ingrese 1 o 2 dígitos para el día.","date-hint-year":"Ingrese 4 dígitos para el año.","date-error":"Ingrese una fecha completa","gov-site-label":"Un sitio oficial del Gobierno de Estados Unidos","gov-site-button":"Así es como usted puede verificarlo","gov-site-website":"Los sitios web oficiales usan .{{tld}}","gov-site-explanation":"Un sitio web .{{tld}} pertenece a una organización oficial del Gobierno de Estados Unidos.","gov-site-https":"Los sitios web seguros .{{tld}} usan HTTPS","gov-site-lock":"Un candado {{image}} o https:// significa que usted se conectó de forma segura a un sitio web .{{tld}}. Comparta información sensible sólo en sitios web oficiales y seguros.",next:"Siguiente",previous:"Anterior"},tlTranslation={error:"Error",required:"(*Kailangan)","max-chars":"(Pinakamarami ang {{length}} karakter)","min-chars":"(Pinakamababa ang {{length}} karakter)","date-of-birth":"Petsa ng Kapanganakan",month:"Buwan",day:"Araw",year:"Taon","month-range":"Mangyaring ilagay ang buwan sa pagitan ng {{start}} at {{end}}","day-range":"Mangyaring ilagay ang araw sa pagitan ng {{start}} at {{end}}","year-range":"Mangyaring ilagay ang taon sa pagitan ng {{start}} at {{end}}","expand-all":"I-expand lahat","collapse-all":"I-collapse ang lahat","expand-all-aria-label":"I-expand ang lahat ng accordion","collapse-all-aria-label":"I-collapse ang lahat ng accordion","on-this-page":"Sa pahinang ito","date-hint":"Maglagay ng 1 o 2 numero para sa buwan at araw, at 4 na numero para sa taon.","date-hint-with-select":"Pumili ng buwan. Maglagay ng 1 o 2 numero para sa araw, at 4 na numero para sa taon.","date-hint-month":"Maglagay ng 1 o 2 numero para sa buwan.","date-hint-month-select":"Pumili ng buwan.","date-hint-day":"Maglagay ng 1 o 2 numero para sa araw.","date-hint-year":"Maglagay ng 4 na numero para sa taon.","date-error":"Mangyaring maglagay ng kumpletong petsa"},languageDetector=new Browser;languageDetector.addDetector(mainTag),instance.use(languageDetector).init({fallbackLng:"en",detection:{order:["mainTag","htmlTag"]},resources:{en:{translation:enTranslation},es:{translation:esTranslation},tl:{translation:tlTranslation}}}),window.addEventListener("load",(e=>{console.log("DOM fully loaded and parsed");const a=document.querySelector("main");if(a){const e=a.getAttribute("lang");e&&instance.changeLanguage(e),new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&"lang"===e.attributeName&&instance.changeLanguage(a.getAttribute("lang"))}))})).observe(a,{attributes:!0})}}));const contactsMap=Object.freeze({"222_VETS":{phoneNumber:"8772228387",description:"VA Help Line"},"4AID_VET":{phoneNumber:"8774243838",description:"National Call Center for Homeless Veterans"},711:{phoneNumber:"711",description:"Telecommunications Relay Service"},911:{phoneNumber:"911",description:"911"},CAREGIVER:{phoneNumber:"8552603274",description:"VA National Caregiver Support Line"},CRISIS_LINE:{phoneNumber:"8002738255",description:"Veterans Crisis hotline"},CRISIS_TTY:{phoneNumber:"8002738255",description:"Veterans Crisis hotline TTY"},CRISIS_MODAL_TTY:{phoneNumber:"711",extension:"988",description:"Veterans Crisis hotline TTY"},DMC:{phoneNumber:"8008270648",description:"Debt Management Center"},DMC_OVERSEAS:{phoneNumber:"6127136415",description:"Debt Management Center (Overseas)"},DMDC_DEERS:{phoneNumber:"8663632883",description:"Defense Manpower Data Center (DMDC) | Defense Enrollment Eligibility Reporting System (DEERS) Support Office"},DS_LOGON:{phoneNumber:"8005389552",description:"Defense Manpower Data Center"},DS_LOGON_TTY:{phoneNumber:"8663632883",description:"Defense Manpower Data Center TTY"},FEDERAL_RELAY_SERVICE:{phoneNumber:"8008778339",description:"Federal Relay Service"},GI_BILL:{phoneNumber:"8884424551",description:"Education Call Center (1-888-GI-BILL-1)"},GO_DIRECT:{phoneNumber:"8003331795",description:"Go Direct/Direct Express (Treasury)"},HELP_DESK:{phoneNumber:"8006982411",description:"VA Help desk"},HEALTH_RESOURCE_CENTER:{phoneNumber:"8664001238",description:"Health Resource Center"},HEALTHCARE_ELIGIBILITY_CENTER:{phoneNumber:"8554888440",description:"VA Healthcare Eligibility Center (Eligibility Division)"},HELP_TTY:{phoneNumber:"8008778339",description:"VA Help Desk TTY"},MY_HEALTHEVET:{phoneNumber:"8773270022",description:"My HealtheVet help desk"},NCA:{phoneNumber:"8005351117",description:"National Cemetery Scheduling Office"},SUICIDE_PREVENTION_LIFELINE:{phoneNumber:"8007994889",description:"Suicide Prevention Line"},TESC:{phoneNumber:"8882242950",description:"U.S. Treasury Electronic Payment Solution Center"},TREASURY_DMS:{phoneNumber:"8888263127",description:"U.S. Department of the Treasury (Debt Management Services)"},VA_311:{phoneNumber:"8006982411",description:"VA Help desk (VA411)"},VA_411:{phoneNumber:"8006982411",description:"VA Help desk (VA411)"},VA_BENEFITS:{phoneNumber:"8008271000",description:"Veterans Benefits Assistance"}}),CONTACTS=Object.freeze(Object.entries(contactsMap).reduce(((e,a)=>Object.assign(Object.assign({},e),{[a[0]]:a[1].phoneNumber})),{})),CONTACTS_WITH_EXTENSION=Object.freeze(Object.entries(contactsMap).reduce(((e,[a,t])=>Object.assign(Object.assign({},e),{[a]:t.extension?{phoneNumber:t.phoneNumber,extension:t.extension}:{phoneNumber:t.phoneNumber}})),{}));export{CONTACTS as C,CONTACTS_WITH_EXTENSION as a,contactsMap as c};
1
+ import{i as instance}from"./i18next.js";const{slice:slice,forEach:forEach}=[];function defaults(e){return forEach.call(slice.call(arguments,1),(t=>{if(t)for(const a in t)void 0===e[a]&&(e[a]=t[a])})),e}function hasXSS(e){return"string"==typeof e&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(e)))}const fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(e,t){const a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let o=`${e}=${encodeURIComponent(t)}`;if(a.maxAge>0){const e=a.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(e)}`}if(a.domain){if(!fieldContentRegExp.test(a.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${a.domain}`}if(a.path){if(!fieldContentRegExp.test(a.path))throw new TypeError("option path is invalid");o+=`; Path=${a.path}`}if(a.expires){if("function"!=typeof a.expires.toUTCString)throw new TypeError("option expires is invalid");o+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(o+="; HttpOnly"),a.secure&&(o+="; Secure"),a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return a.partitioned&&(o+="; Partitioned"),o},cookie={create(e,t,a,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};a&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+60*a*1e3)),o&&(n.domain=o),document.cookie=serializeCookie(e,t,n)},read(e){const t=`${e}=`,a=document.cookie.split(";");for(let e=0;e<a.length;e++){let o=a[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var cookie$1={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return cookie.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:a,cookieMinutes:o,cookieDomain:n,cookieOptions:i}=t;a&&"undefined"!=typeof document&&cookie.create(a,e,o,n,i)}},querystring={name:"querystring",lookup(e){let t,{lookupQuerystring:a}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const o=e.substring(1).split("&");for(let e=0;e<o.length;e++){const n=o[e].indexOf("=");n>0&&o[e].substring(0,n)===a&&(t=o[e].substring(n+1))}}return t}},hash={name:"hash",lookup(e){let t,{lookupHash:a,lookupFromHashIndex:o}=e;if("undefined"!=typeof window){const{hash:e}=window.location;if(e&&e.length>2){const n=e.substring(1);if(a){const e=n.split("&");for(let o=0;o<e.length;o++){const n=e[o].indexOf("=");n>0&&e[o].substring(0,n)===a&&(t=e[o].substring(n+1))}}if(t)return t;if(!t&&o>-1){const t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;const a="number"==typeof o?o:0;return t[a]?.replace("/","")}}}return t}};let hasLocalStorageSupport=null;const localStorageAvailable=()=>{if(null!==hasLocalStorageSupport)return hasLocalStorageSupport;try{if(hasLocalStorageSupport="undefined"!=typeof window&&null!==window.localStorage,!hasLocalStorageSupport)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){hasLocalStorageSupport=!1}return hasLocalStorageSupport};var localStorage={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&localStorageAvailable())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:a}=t;a&&localStorageAvailable()&&window.localStorage.setItem(a,e)}};let hasSessionStorageSupport=null;const sessionStorageAvailable=()=>{if(null!==hasSessionStorageSupport)return hasSessionStorageSupport;try{if(hasSessionStorageSupport="undefined"!=typeof window&&null!==window.sessionStorage,!hasSessionStorageSupport)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){hasSessionStorageSupport=!1}return hasSessionStorageSupport};var sessionStorage={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&sessionStorageAvailable())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:a}=t;a&&sessionStorageAvailable()&&window.sessionStorage.setItem(a,e)}},navigator$1={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:a,language:o}=navigator;if(e)for(let a=0;a<e.length;a++)t.push(e[a]);a&&t.push(a),o&&t.push(o)}return t.length>0?t:void 0}},htmlTag={name:"htmlTag",lookup(e){let t,{htmlTag:a}=e;const o=a||("undefined"!=typeof document?document.documentElement:null);return o&&"function"==typeof o.getAttribute&&(t=o.getAttribute("lang")),t}},path={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(a))return;const o="number"==typeof t?t:0;return a[o]?.replace("/","")}},subdomain={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const a="number"==typeof t?t+1:1,o="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(o)return o[a]}};let canCookies=!1;try{canCookies=!0}catch(e){}const order=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];canCookies||order.splice(1,1);const getDefaults=()=>({order:order,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Browser{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=defaults(t,this.options||{},getDefaults()),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(localStorage),this.addDetector(sessionStorage),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path),this.addDetector(subdomain),this.addDetector(hash)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let a=this.detectors[e].lookup(this.options);a&&"string"==typeof a&&(a=[a]),a&&(t=t.concat(a))}})),t=t.filter((e=>null!=e&&!hasXSS(e))).map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}Browser.type="languageDetector";const mainTag={name:"mainTag",lookup(e){const t=document.querySelector("main");return t?.getAttribute("lang")}},enTranslation={error:"Error",required:"(*Required)",select:"- Select -","max-chars":"(Max. {{length}} characters)","min-chars":"(Min. {{length}} characters)","date-of-birth":"Date of birth",month:"Month",day:"Day",year:"Year","month-select":"Please select a month","month-range":"Please enter a month between {{start}} and {{end}}","day-range":"Please enter a day between {{start}} and {{end}}","year-range":"Please enter a year between {{start}} and {{end}}","expand-all":"Expand all","collapse-all":"Collapse all","expand-all-aria-label":"Expand all accordions","collapse-all-aria-label":"Collapse all accordions",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December","on-this-page":"On this page","date-hint":"Enter 1 or 2 digits for the month and day and 4 digits for the year.","date-hint-with-select":"Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.","date-hint-month":"Enter 1 or 2 digits for the month.","date-hint-month-select":"Select a month.","date-hint-day":"Enter 1 or 2 digits for the day.","date-hint-year":"Enter 4 digits for the year.","date-error":"Please enter a complete date","number-error":"Please enter a valid number","gov-site-label":"Official website of the United States government","gov-site-button":"Here's how you know","gov-site-website":"Official websites use .{{tld}}","gov-site-explanation":"A .{{tld}} website belongs to an official government organization in the United States.","gov-site-https":"Secure .{{tld}} websites use HTTPS","gov-site-lock":"A lock {{image}} or https:// means you've safely connected to the .{{tld}} website. Share sensitive information only on official, secure websites.",next:"Next",previous:"Previous","crisis-line-trigger-text":"Talk to the <strong>Veterans Crisis Line</strong> now","crisis-line-modal-title":"We’re here anytime, day or night – 24/7","crisis-line-intro":"If you are a Veteran in crisis or concerned about one, connect with our caring, qualified responders for confidential help. Many of them are Veterans themselves.","crisis-line-phone-label":"Call","crisis-line-phone-extension-label":"and select","crisis-line-text-label":"Text","crisis-line-chat-label":"Start a confidential chat","crisis-line-tty-label":"For TTY, call","crisis-line-tty-extension-label":"then","crisis-line-resources-link-label":"Get more resources at","crisis-line-resources-link-text":"VeteransCrisisLine.net"},esTranslation={error:"Error",required:"(*Requerido)",select:"- Seleccione -","max-chars":"(Número máximo de caracteres: {{length}})","min-chars":"(Número mínimo de caracteres: {{length}})","date-of-birth":"Fecha de nacimiento",month:"Mes",day:"Día",year:"Año","month-range":"Ingrese un mes entre {{start}} y {{end}}","day-range":"Ingrese un día entre {{start}} y {{end}}","year-range":"Ingrese un año entre {{start}} y {{end}}","expand-all":"Expandir todo","collapse-all":"Contraer todo","expand-all-aria-label":"Expandir todos los acordeones","collapse-all-aria-label":"Contraer todos los acordeones",january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre","on-this-page":"En esta página","date-hint":"Ingrese 1 o 2 dígitos para el mes y el día y 4 dígitos para el año.","date-hint-with-select":"Seleccione un mes. Ingrese 1 o 2 dígitos para el día y 4 dígitos para el año.","date-hint-month":"Ingrese 1 o 2 dígitos para el mes.","date-hint-month-select":"Seleccione un mes.","date-hint-day":"Ingrese 1 o 2 dígitos para el día.","date-hint-year":"Ingrese 4 dígitos para el año.","date-error":"Ingrese una fecha completa","gov-site-label":"Un sitio oficial del Gobierno de Estados Unidos","gov-site-button":"Así es como usted puede verificarlo","gov-site-website":"Los sitios web oficiales usan .{{tld}}","gov-site-explanation":"Un sitio web .{{tld}} pertenece a una organización oficial del Gobierno de Estados Unidos.","gov-site-https":"Los sitios web seguros .{{tld}} usan HTTPS","gov-site-lock":"Un candado {{image}} o https:// significa que usted se conectó de forma segura a un sitio web .{{tld}}. Comparta información sensible sólo en sitios web oficiales y seguros.",next:"Siguiente",previous:"Anterior"},tlTranslation={error:"Error",required:"(*Kailangan)","max-chars":"(Pinakamarami ang {{length}} karakter)","min-chars":"(Pinakamababa ang {{length}} karakter)","date-of-birth":"Petsa ng Kapanganakan",month:"Buwan",day:"Araw",year:"Taon","month-range":"Mangyaring ilagay ang buwan sa pagitan ng {{start}} at {{end}}","day-range":"Mangyaring ilagay ang araw sa pagitan ng {{start}} at {{end}}","year-range":"Mangyaring ilagay ang taon sa pagitan ng {{start}} at {{end}}","expand-all":"I-expand lahat","collapse-all":"I-collapse ang lahat","expand-all-aria-label":"I-expand ang lahat ng accordion","collapse-all-aria-label":"I-collapse ang lahat ng accordion","on-this-page":"Sa pahinang ito","date-hint":"Maglagay ng 1 o 2 numero para sa buwan at araw, at 4 na numero para sa taon.","date-hint-with-select":"Pumili ng buwan. Maglagay ng 1 o 2 numero para sa araw, at 4 na numero para sa taon.","date-hint-month":"Maglagay ng 1 o 2 numero para sa buwan.","date-hint-month-select":"Pumili ng buwan.","date-hint-day":"Maglagay ng 1 o 2 numero para sa araw.","date-hint-year":"Maglagay ng 4 na numero para sa taon.","date-error":"Mangyaring maglagay ng kumpletong petsa"},languageDetector=new Browser;languageDetector.addDetector(mainTag),instance.use(languageDetector).init({fallbackLng:"en",detection:{order:["mainTag","htmlTag"]},resources:{en:{translation:enTranslation},es:{translation:esTranslation},tl:{translation:tlTranslation}}}),window.addEventListener("load",(e=>{console.log("DOM fully loaded and parsed");const t=document.querySelector("main");if(t){const e=t.getAttribute("lang");e&&instance.changeLanguage(e),new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&"lang"===e.attributeName&&instance.changeLanguage(t.getAttribute("lang"))}))})).observe(t,{attributes:!0})}}));const contactsMap=Object.freeze({"222_VETS":{phoneNumber:"8772228387",description:"VA Help Line"},"4AID_VET":{phoneNumber:"8774243838",description:"National Call Center for Homeless Veterans"},711:{phoneNumber:"711",description:"Telecommunications Relay Service"},911:{phoneNumber:"911",description:"911"},CAREGIVER:{phoneNumber:"8552603274",description:"VA National Caregiver Support Line"},CRISIS_LINE:{phoneNumber:"8002738255",description:"Veterans Crisis hotline"},CRISIS_TTY:{phoneNumber:"8002738255",description:"Veterans Crisis hotline TTY"},CRISIS_MODAL_TTY:{phoneNumber:"711",extension:"988",description:"Veterans Crisis hotline TTY"},DMC:{phoneNumber:"8008270648",description:"Debt Management Center"},DMC_OVERSEAS:{phoneNumber:"6127136415",description:"Debt Management Center (Overseas)"},DMDC_DEERS:{phoneNumber:"8663632883",description:"Defense Manpower Data Center (DMDC) | Defense Enrollment Eligibility Reporting System (DEERS) Support Office"},DS_LOGON:{phoneNumber:"8005389552",description:"Defense Manpower Data Center"},DS_LOGON_TTY:{phoneNumber:"8663632883",description:"Defense Manpower Data Center TTY"},FEDERAL_RELAY_SERVICE:{phoneNumber:"8008778339",description:"Federal Relay Service"},GI_BILL:{phoneNumber:"8884424551",description:"Education Call Center (1-888-GI-BILL-1)"},GO_DIRECT:{phoneNumber:"8003331795",description:"Go Direct/Direct Express (Treasury)"},HELP_DESK:{phoneNumber:"8006982411",description:"VA Help desk"},HEALTH_RESOURCE_CENTER:{phoneNumber:"8664001238",description:"Health Resource Center"},HEALTHCARE_ELIGIBILITY_CENTER:{phoneNumber:"8554888440",description:"VA Healthcare Eligibility Center (Eligibility Division)"},HELP_TTY:{phoneNumber:"8008778339",description:"VA Help Desk TTY"},MY_HEALTHEVET:{phoneNumber:"8773270022",description:"My HealtheVet help desk"},NCA:{phoneNumber:"8005351117",description:"National Cemetery Scheduling Office"},SUICIDE_PREVENTION_LIFELINE:{phoneNumber:"8007994889",description:"Suicide Prevention Line"},TESC:{phoneNumber:"8882242950",description:"U.S. Treasury Electronic Payment Solution Center"},TREASURY_DMS:{phoneNumber:"8888263127",description:"U.S. Department of the Treasury (Debt Management Services)"},VA_311:{phoneNumber:"8006982411",description:"VA Help desk (VA411)"},VA_411:{phoneNumber:"8006982411",description:"VA Help desk (VA411)"},VA_BENEFITS:{phoneNumber:"8008271000",description:"Veterans Benefits Assistance"}}),CONTACTS=Object.freeze(Object.entries(contactsMap).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t[0]]:t[1].phoneNumber})),{})),CONTACTS_WITH_EXTENSION=Object.freeze(Object.entries(contactsMap).reduce(((e,[t,a])=>Object.assign(Object.assign({},e),{[t]:a.extension?{phoneNumber:a.phoneNumber,extension:a.extension}:{phoneNumber:a.phoneNumber}})),{}));export{CONTACTS as C,CONTACTS_WITH_EXTENSION as a,contactsMap as c};
@@ -1 +1 @@
1
- function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function toPropertyKey(e){var t=toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _possibleConstructorReturn(e,t){if(t&&("object"==_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _defineProperty(e,t,n){return(t=toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var consoleLogger={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Logger=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.init(t,n)}return _createClass(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||consoleLogger,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,_objectSpread(_objectSpread({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}(),baseLogger=new Logger,EventEmitter=function(){function e(){_classCallCheck(this,e),this.observers={}}return _createClass(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function defer(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function makeString(e){return null==e?"":""+e}function copy(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function getLastOfPath(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function setPath(e,t,n){var r=getLastOfPath(e,t,Object);r.obj[r.k]=n}function pushPath(e,t,n,r){var o=getLastOfPath(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}function getPath(e,t){var n=getLastOfPath(e,t),r=n.obj,o=n.k;if(r)return r[o]}function getPathWithDefaults(e,t,n){var r=getPath(e,n);return void 0!==r?r:getPath(t,n)}function deepExtend(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):deepExtend(e[r],t[r],n):e[r]=t[r]);return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escape(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return _entityMap[e]})):e}var isIE10="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,n){t=t||"",n=n||"";var r=chars.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}function ownKeys$1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function deepFind(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,s=r.slice(i,i+a).join(n),c=o[s];void 0===c&&r.length>i+a;)a++,c=o[s=r.slice(i,i+a).join(n)];if(void 0===c)return;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var u=r.slice(i+a).join(n);return u?deepFind(c,u,n):void 0}o=o[r[i]]}return o}}var ResourceStore=function(){_inherits(t,EventEmitter);var e=_createSuper(t);function t(n){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck(this,t),r=e.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(r)),r.data=n||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return _createClass(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=getPath(this.data,a);return s||!i||"string"!=typeof n?s:deepFind(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),setPath(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=getPath(this.data,a)||{};r?deepExtend(s,n,o):s=_objectSpread$1(_objectSpread$1({},s),n),setPath(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?_objectSpread$1(_objectSpread$1({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),t}(),postProcessor={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function ownKeys$2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$2(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$2(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var checkedLoadedFor={},Translator=function(){_inherits(t,EventEmitter);var e=_createSuper$1(t);function t(n){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,t),r=e.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(r)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,_assertThisInitialized(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=baseLogger.create("translator"),r}return _createClass(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||looksLikeObjectPath(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var c=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),e=c.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,n,r){var o=this;if("object"!==_typeof(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],n),s=a.key,c=a.namespaces,u=c[c.length-1],l=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(p){var f=n.nsSeparator||this.options.nsSeparator;return u+f+s}return s}var g=this.resolve(e,n),h=g&&g.res,d=g&&g.usedKey||s,y=g&&g.exactUsedKey||s,v=Object.prototype.toString.apply(h),b=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&h&&"string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h&&["[object Number]","[object Function]","[object RegExp]"].indexOf(v)<0&&("string"!=typeof b||"[object Array]"!==v)){if(!n.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,h,_objectSpread$2(_objectSpread$2({},n),{},{ns:c})):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var O="[object Array]"===v,k=O?[]:{},S=O?y:d;for(var j in h)if(Object.prototype.hasOwnProperty.call(h,j)){var w="".concat(S).concat(i).concat(j);k[j]=this.translate(w,_objectSpread$2(_objectSpread$2({},n),{joinArrays:!1,ns:c})),k[j]===w&&(k[j]=h[j])}h=k}}else if(m&&"string"==typeof b&&"[object Array]"===v)(h=h.join(b))&&(h=this.extendTranslation(h,e,n,r));else{var P=!1,x=!1,_=void 0!==n.count&&"string"!=typeof n.count,L=t.hasDefaultValue(n),C=_?this.pluralResolver.getSuffix(l,n.count,n):"",R=n["defaultValue".concat(C)]||n.defaultValue;!this.isValidLookup(h)&&L&&(P=!0,h=R),this.isValidLookup(h)||(x=!0,h=s);var E=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&x?void 0:h,N=L&&R!==h&&this.options.updateMissing;if(x||P||N){if(this.logger.log(N?"updateKey":"missingKey",l,u,s,N?R:h),i){var $=this.resolve(s,_objectSpread$2(_objectSpread$2({},n),{},{keySeparator:!1}));$&&$.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var I=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var D=0;D<F.length;D++)I.push(F[D]);else"all"===this.options.saveMissingTo?I=this.languageUtils.toResolveHierarchy(n.lng||this.language):I.push(n.lng||this.language);var T=function(e,t,r){var i=L&&r!==h?r:E;o.options.missingKeyHandler?o.options.missingKeyHandler(e,u,t,i,N,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,u,t,i,N,n),o.emit("missingKey",e,u,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?I.forEach((function(e){o.pluralResolver.getSuffixes(e,n).forEach((function(t){T([e],s+t,n["defaultValue".concat(t)]||R)}))})):T(I,s,R))}h=this.extendTranslation(h,e,n,g,r),x&&h===s&&this.options.appendNamespaceToMissingKey&&(h="".concat(u,":").concat(s)),(x||P)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(s,P?h:void 0):this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(_objectSpread$2(_objectSpread$2({},n),{interpolation:_objectSpread$2(_objectSpread$2({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u=_objectSpread$2(_objectSpread$2({},this.options.interpolation.defaultVariables),u)),e=this.interpolator.interpolate(e,u,n.lng||this.language,n),s){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var p=n.postProcess||this.options.postProcess,f="string"==typeof p?[p]:p;return null!=e&&f&&f.length&&!1!==n.applyPostProcessor&&(e=postProcessor.handle(f,e,t,this.options&&this.options.postProcessPassResolved?_objectSpread$2({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),u=c.key;n=u;var l=c.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,f=p&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),g=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!checkedLoadedFor["".concat(h[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(checkedLoadedFor["".concat(h[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,c=[u];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(c,u,n,e,s);else{var l;p&&(l=a.pluralResolver.getSuffix(n,s.count,s));var h="_zero";if(p&&(c.push(u+l),f&&c.push(u+h)),g){var d="".concat(u).concat(a.options.contextSeparator).concat(s.context);c.push(d),p&&(c.push(d+l),f&&c.push(d+h))}}for(;i=c.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),t}();function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=capitalize(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=capitalize(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=capitalize(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};return sets.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}}))})),e}var PluralResolver=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.languageUtils=t,this.options=n,this.logger=baseLogger.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return suffixesOrder[e]-suffixesOrder[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),e}();function ownKeys$3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$3(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$3(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Interpolator=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,e),this.logger=baseLogger.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return _createClass(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:escape,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?regexEscape(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?regexEscape(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?regexEscape(t.nestingPrefix):t.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=t.nestingSuffix?regexEscape(t.nestingSuffix):t.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var o=getPathWithDefaults(t,c,e);return s.alwaysFormat?s.format(o,void 0,n,_objectSpread$3(_objectSpread$3(_objectSpread$3({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(getPathWithDefaults(t,c,a),u,n,_objectSpread$3(_objectSpread$3(_objectSpread$3({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var p=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof p){var c=p(e,o,r);i="string"==typeof c?c:""}else if(r&&r.hasOwnProperty(n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=makeString(i));var u=t.safeValue(i);if(e=e.replace(o[0],u),f?(t.regex.lastIndex+=u.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=_objectSpread$3({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0],o=(o=this.interpolate(o,a)).replace(/'/g,'"');try{a=JSON.parse(o),t&&(a=_objectSpread$3(_objectSpread$3({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),c=l,u=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=makeString(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),u&&(r=c.reduce((function(e,t){return o.format(e,t,i.lng,_objectSpread$3(_objectSpread$3({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function ownKeys$4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$4(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$4(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function parseFormatStr(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=_toArray(e.split(":")),r=t[0],o=t.slice(1).join(":");n[r.trim()]||(n[r.trim()]=o.trim()),"false"===o.trim()&&(n[r.trim()]=!1),"true"===o.trim()&&(n[r.trim()]=!0),isNaN(o.trim())||(n[r.trim()]=parseInt(o.trim(),10))}}))}return{formatName:t,formatOptions:n}}var Formatter=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,e),this.logger=baseLogger.create("formatter"),this.options=t,this.formats={number:function(e,t,n){return new Intl.NumberFormat(t,n).format(e)},currency:function(e,t,n){return new Intl.NumberFormat(t,_objectSpread$4(_objectSpread$4({},n),{},{style:"currency"})).format(e)},datetime:function(e,t,n){return new Intl.DateTimeFormat(t,_objectSpread$4({},n)).format(e)},relativetime:function(e,t,n){return new Intl.RelativeTimeFormat(t,_objectSpread$4({},n)).format(e,n.range||"day")},list:function(e,t,n){return new Intl.ListFormat(t,_objectSpread$4({},n)).format(e)}},this.init(t)}return _createClass(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,n,r){var o=this;return t.split(this.formatSeparator).reduce((function(e,t){var i=parseFormatStr(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var c=e;try{var u=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=u.locale||u.lng||r.locale||r.lng||n;c=o.formats[a](e,l,_objectSpread$4(_objectSpread$4(_objectSpread$4({},s),r),u))}catch(e){o.logger.warn(e)}return c}return o.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}();function ownKeys$5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$5(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper$2(e){var t=_isNativeReflectConstruct$2();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function remove(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}var Connector=function(){_inherits(t,EventEmitter);var e=_createSuper$2(t);function t(n,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _classCallCheck(this,t),i=e.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(i)),i.backend=n,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=baseLogger.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return _createClass(t,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i=[],a=[],s=[],c=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?a.indexOf(s)<0&&a.push(s):(o.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),i.indexOf(s)<0&&i.push(s),c.indexOf(t)<0&&c.push(t)))})),r||s.push(e)})),(i.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:i,pending:a,toLoadLanguages:s,toLoadNamespaces:c}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){pushPath(n.loaded,[o],i),remove(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,c){s&&c&&o<5?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,c)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,_objectSpread$5(_objectSpread$5({},i),{},{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}();function get(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===_typeof(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===_typeof(e[2])||"object"===_typeof(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function ownKeys$6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$6(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$6(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper$3(e){var t=_isNativeReflectConstruct$3();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$3(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function noop(){}function bindMemberFunctions(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var I18n=function(){_inherits(t,EventEmitter);var e=_createSuper$3(t);function t(){var n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(_classCallCheck(this,t),n=e.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(n)),n.options=transformOptions(r),n.services={},n.logger=baseLogger,n.modules={external:[]},bindMemberFunctions(_assertThisInitialized(n)),o&&!n.isInitialized&&!r.isClone){if(!n.options.initImmediate)return n.init(r,o),_possibleConstructorReturn(n,_assertThisInitialized(n));setTimeout((function(){n.init(r,o)}),0)}return n}return _createClass(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=get();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=_objectSpread$6(_objectSpread$6(_objectSpread$6({},r),this.options),transformOptions(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_objectSpread$6(_objectSpread$6({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?baseLogger.init(o(this.modules.logger),this.options):baseLogger.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=Formatter);var a=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var s=this.services;s.logger=baseLogger,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new PluralResolver(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Interpolator(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Connector(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=noop),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var u=defer(),l=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),u}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)})),this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=defer();return e||(e=this.languages),t||(t=this.options.ns),n||(n=noop),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&postProcessor.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=defer();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==_typeof(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];i=r.options.overloadTranslationOptionHandler([t,o].concat(s))}else i=_objectSpread$6({},o);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns;var u=r.options.keySeparator||".",l=n?"".concat(n).concat(u).concat(t):t;return r.t(l,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!a(r,e)||o&&!a(i,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=defer();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=defer();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,o=_objectSpread$6(_objectSpread$6(_objectSpread$6({},this.options),n),{isClone:!0}),i=new t(o);return["store","services","language"].forEach((function(t){i[t]=e[t]})),i.services=_objectSpread$6({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new Translator(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(o,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}();_defineProperty(I18n,"createInstance",(function(){return new I18n(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var instance=I18n.createInstance();instance.createInstance=I18n.createInstance;export{_createClass as _,_classCallCheck as a,instance as i};
1
+ const isString=e=>"string"==typeof e,defer=()=>{let e,t;const s=new Promise(((s,i)=>{e=s,t=i}));return s.resolve=e,s.reject=t,s},makeString=e=>null==e?"":""+e,copy=(e,t,s)=>{e.forEach((e=>{t[e]&&(s[e]=t[e])}))},lastOfPathSeparatorRegExp=/###/g,cleanKey=e=>e&&e.indexOf("###")>-1?e.replace(lastOfPathSeparatorRegExp,"."):e,canNotTraverseDeeper=e=>!e||isString(e),getLastOfPath=(e,t,s)=>{const i=isString(t)?t.split("."):t;let o=0;for(;o<i.length-1;){if(canNotTraverseDeeper(e))return{};const t=cleanKey(i[o]);!e[t]&&s&&(e[t]=new s),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return canNotTraverseDeeper(e)?{}:{obj:e,k:cleanKey(i[o])}},setPath=(e,t,s)=>{const{obj:i,k:o}=getLastOfPath(e,t,Object);if(void 0!==i||1===t.length)return void(i[o]=s);let r=t[t.length-1],n=t.slice(0,t.length-1),a=getLastOfPath(e,n,Object);for(;void 0===a.obj&&n.length;)r=`${n[n.length-1]}.${r}`,n=n.slice(0,n.length-1),a=getLastOfPath(e,n,Object),a?.obj&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=s},pushPath=(e,t,s,i)=>{const{obj:o,k:r}=getLastOfPath(e,t,Object);o[r]=o[r]||[],o[r].push(s)},getPath=(e,t)=>{const{obj:s,k:i}=getLastOfPath(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},getPathWithDefaults=(e,t,s)=>{const i=getPath(e,s);return void 0!==i?i:getPath(t,s)},deepExtend=(e,t,s)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(i in e?isString(e[i])||e[i]instanceof String||isString(t[i])||t[i]instanceof String?s&&(e[i]=t[i]):deepExtend(e[i],t[i],s):e[i]=t[i]);return e},regexEscape=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const escape=e=>isString(e)?e.replace(/[&<>"'\/]/g,(e=>_entityMap[e])):e;class RegExpCache{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20),looksLikeObjectPath=(e,t,s)=>{t=t||"",s=s||"";const i=chars.filter((e=>t.indexOf(e)<0&&s.indexOf(e)<0));if(0===i.length)return!0;const o=looksLikeObjectPathRegExpCache.getRegExp(`(${i.map((e=>"?"===e?"\\?":e)).join("|")})`);let r=!o.test(e);if(!r){const t=e.indexOf(s);t>0&&!o.test(e.substring(0,t))&&(r=!0)}return r},deepFind=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const i=t.split(s);let o=e;for(let e=0;e<i.length;){if(!o||"object"!=typeof o)return;let t,r="";for(let n=e;n<i.length;++n)if(n!==e&&(r+=s),r+=i[n],t=o[r],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&n<i.length-1)continue;e+=n-e+1;break}o=t}return o},getCleanedCode=e=>e?.replace("_","-"),consoleLogger={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Logger{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||consoleLogger,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(isString(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Logger(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Logger(this.logger,e)}}var baseLogger=new Logger;class EventEmitter{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach((([e,s])=>{for(let i=0;i<s;i++)e(...t)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([s,i])=>{for(let o=0;o<i;o++)s.apply(s,[e,...t])}))}}class ResourceStore extends EventEmitter{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,i={}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,r=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let n;e.indexOf(".")>-1?n=e.split("."):(n=[e,t],s&&(Array.isArray(s)?n.push(...s):isString(s)&&o?n.push(...s.split(o)):n.push(s)));const a=getPath(this.data,n);return!a&&!t&&!s&&e.indexOf(".")>-1&&(e=n[0],t=n[1],s=n.slice(2).join(".")),!a&&r&&isString(s)?deepFind(this.data?.[e]?.[t],s,o):a}addResource(e,t,s,i,o={silent:!1}){const r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let n=[e,t];s&&(n=n.concat(r?s.split(r):s)),e.indexOf(".")>-1&&(n=e.split("."),i=t,t=n[1]),this.addNamespaces(t),setPath(this.data,n,i),o.silent||this.emit("added",e,t,s,i)}addResources(e,t,s,i={silent:!1}){for(const i in s)(isString(s[i])||Array.isArray(s[i]))&&this.addResource(e,t,i,s[i],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,o,r={silent:!1,skipCopy:!1}){let n=[e,t];e.indexOf(".")>-1&&(n=e.split("."),i=s,s=t,t=n[1]),this.addNamespaces(t);let a=getPath(this.data,n)||{};r.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?deepExtend(a,s,o):a={...a,...s},setPath(this.data,n,a),r.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,i,o){return e.forEach((e=>{t=this.processors[e]?.process(t,s,i,o)??t})),t}};const PATH_KEY=Symbol("i18next/PATH_KEY");function createProxy(){const e=[],t=Object.create(null);let s;return t.get=(i,o)=>(s?.revoke?.(),o===PATH_KEY?e:(e.push(o),s=Proxy.revocable(i,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}function keysFromSelector(e,t){const{[PATH_KEY]:s}=e(createProxy());return s.join(t?.keySeparator??".")}const checkedLoadedFor={},shouldHandleAsObject=e=>!isString(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Translator extends EventEmitter{constructor(e,t={}){super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(null==e)return!1;const i=this.resolve(e,s);if(void 0===i?.res)return!1;const o=shouldHandleAsObject(i.res);return!1!==s.returnObjects||!o}extractFromKey(e,t){let s=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===s&&(s=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const r=s&&e.indexOf(s)>-1,n=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||looksLikeObjectPath(e,s,i));if(r&&!n){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:isString(o)?[o]:o};const r=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(r[0])>-1)&&(o=r.shift()),e=r.join(i)}return{key:e,namespaces:isString(o)?[o]:o}}translate(e,t,s){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=keysFromSelector(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:n,namespaces:a}=this.extractFromKey(e[e.length-1],i),l=a[a.length-1];let h=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===h&&(h=":");const c=i.lng||this.language,g=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return g?o?{res:`${l}${h}${n}`,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${h}${n}`:o?{res:n,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:n;const p=this.resolve(e,i);let u=p?.res;const d=p?.usedKey||n,f=p?.exactUsedKey||n,m=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==i.count&&!isString(i.count),S=Translator.hasDefaultValue(i),b=x?this.pluralResolver.getSuffix(c,i.count,i):"",v=i.ordinal&&x?this.pluralResolver.getSuffix(c,i.count,{ordinal:!1}):"",k=x&&!i.ordinal&&0===i.count,L=k&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${b}`]||i[`defaultValue${v}`]||i.defaultValue;let O=u;y&&!u&&S&&(O=L);const P=shouldHandleAsObject(O),C=Object.prototype.toString.apply(O);if(!(y&&O&&P&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||isString(m)&&Array.isArray(O))if(y&&isString(m)&&Array.isArray(u))u=u.join(m),u&&(u=this.extendTranslation(u,e,i,s));else{let t=!1,o=!1;!this.isValidLookup(u)&&S&&(t=!0,u=L),this.isValidLookup(u)||(o=!0,u=n);const a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:u,g=S&&L!==u&&this.options.updateMissing;if(o||t||g){if(this.logger.log(g?"updateKey":"missingKey",c,l,n,g?L:u),r){const e=this.resolve(n,{...i,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);const s=(e,t,s)=>{const o=S&&s!==u?s:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,g,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,g,i),this.emit("missingKey",e,l,t,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,i);k&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{s([e],n+t,i[`defaultValue${t}`]||L)}))})):s(e,n,L))}u=this.extendTranslation(u,e,i,p,s),o&&u===n&&this.options.appendNamespaceToMissingKey&&(u=`${l}${h}${n}`),(o||t)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${h}${n}`:n,t?u:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,O,{...i,ns:a}):`key '${n} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(r){const e=Array.isArray(O),t=e?[]:{},s=e?f:d;for(const e in O)if(Object.prototype.hasOwnProperty.call(O,e)){const o=`${s}${r}${e}`;t[e]=S&&!u?this.translate(o,{...i,defaultValue:shouldHandleAsObject(L)?L[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...i,joinArrays:!1,ns:a}),t[e]===o&&(t[e]=O[e])}u=t}}return o?(p.res=u,p.usedParams=this.getUsedParamsDetails(i),p):u}extendTranslation(e,t,s,i,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const r=isString(e)&&(void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let n;if(r){const t=e.match(this.interpolator.nestingRegexp);n=t&&t.length}let a=s.replace&&!isString(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,s.lng||this.language||i.usedLng,s),r){const t=e.match(this.interpolator.nestingRegexp);n<(t&&t.length)&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),!1!==s.nest&&(e=this.interpolator.nest(e,((...e)=>o?.[0]!==e[0]||s.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),s)),s.interpolation&&this.interpolator.reset()}const r=s.postProcess||this.options.postProcess,n=isString(r)?[r]:r;return null!=e&&n?.length&&!1!==s.applyPostProcessor&&(e=postProcessor.handle(n,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,i,o,r,n;return isString(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(s))return;const a=this.extractFromKey(e,t),l=a.key;i=l;let h=a.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const c=void 0!==t.count&&!isString(t.count),g=c&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(isString(t.context)||"number"==typeof t.context)&&""!==t.context,u=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach((e=>{this.isValidLookup(s)||(n=e,checkedLoadedFor[`${u[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(n)||(checkedLoadedFor[`${u[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${u.join(", ")}" won't get resolved as namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),u.forEach((i=>{if(this.isValidLookup(s))return;r=i;const n=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(n,l,i,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(i,t.count,t));const s=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(o)&&n.push(l+e.replace(o,this.options.pluralSeparator)),n.push(l+e),g&&n.push(l+s)),p){const i=`${l}${this.options.contextSeparator||"_"}${t.context}`;n.push(i),c&&(t.ordinal&&0===e.indexOf(o)&&n.push(i+e.replace(o,this.options.pluralSeparator)),n.push(i+e),g&&n.push(i+s))}}let a;for(;a=n.pop();)this.isValidLookup(s)||(o=a,s=this.getResource(i,e,a,t))})))}))})),{res:s,usedKey:i,exactUsedKey:o,usedLng:r,usedNS:n}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!isString(e.replace);let i=s?e.replace:e;if(s&&void 0!==e.count&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const e of t)delete i[e]}return i}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class LanguageUtil{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(e){if(!(e=getCleanedCode(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=getCleanedCode(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(isString(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const s=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(s)||(t=s)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;const i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find((e=>e===i?e:e.indexOf("-")<0&&i.indexOf("-")<0?void 0:e.indexOf("-")>0&&i.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),isString(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),i=[],o=e=>{e&&(this.isSupportedCode(e)?i.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return isString(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):isString(e)&&o(this.formatLanguageCode(e)),s.forEach((e=>{i.indexOf(e)<0&&o(this.formatLanguageCode(e))})),i}}const suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5},dummyRule={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class PluralResolver{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=baseLogger.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=getCleanedCode("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let r;try{r=new Intl.PluralRules(s,{type:i})}catch(s){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),dummyRule;if(!e.match(/-|_/))return dummyRule;const i=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(i,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort(((e,t)=>suffixesOrder[e]-suffixesOrder[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const deepFindWithDefaults=(e,t,s,i=".",o=!0)=>{let r=getPathWithDefaults(e,t,s);return!r&&o&&isString(s)&&(r=deepFind(e,s,i),void 0===r&&(r=deepFind(t,s,i))),r},regexSafe=e=>e.replace(/\$/g,"$$$$");class Interpolator{constructor(e={}){this.logger=baseLogger.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:o,prefixEscaped:r,suffix:n,suffixEscaped:a,formatSeparator:l,unescapeSuffix:h,unescapePrefix:c,nestingPrefix:g,nestingPrefixEscaped:p,nestingSuffix:u,nestingSuffixEscaped:d,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:escape,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==i&&i,this.prefix=o?regexEscape(o):r||"{{",this.suffix=n?regexEscape(n):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=h?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?regexEscape(g):p||regexEscape("$t("),this.nestingSuffix=u?regexEscape(u):d||regexEscape(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let o,r,n;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=deepFindWithDefaults(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,s,{...i,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),r=o.shift().trim(),n=o.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(t,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),n,s,{...i,...t,interpolationkey:r})};this.resetRegExp();const h=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>regexSafe(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?regexSafe(this.escape(e)):regexSafe(e)}].forEach((t=>{for(n=0;o=t.regex.exec(e);){const s=o[1].trim();if(r=l(s),void 0===r)if("function"==typeof h){const t=h(e,o,i);r=isString(t)?t:""}else if(i&&Object.prototype.hasOwnProperty.call(i,s))r="";else{if(c){r=o[0];continue}this.logger.warn(`missed to pass in variable ${s} for interpolating ${e}`),r=""}else isString(r)||this.useRawValueToEscape||(r=makeString(r));const a=t.safeValue(r);if(e=e.replace(o[0],a),c?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,n++,n>=this.maxReplaces)break}})),e}nest(e,t,s={}){let i,o,r;const n=(e,t)=>{const s=this.nestingOptionsSeparator;if(e.indexOf(s)<0)return e;const i=e.split(new RegExp(`${s}[ ]*{`));let o=`{${i[1]}`;e=i[0],o=this.interpolate(o,r);const n=o.match(/'/g),a=o.match(/"/g);((n?.length??0)%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{r=JSON.parse(o),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${o}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;i=this.nestingRegexp.exec(e);){let a=[];r={...s},r=r.replace&&!isString(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const l=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(-1!==l&&(a=i[1].slice(l).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),i[1]=i[1].slice(0,l)),o=t(n.call(this,i[1].trim(),r),r),o&&i[0]===e&&!isString(o))return o;isString(o)||(o=makeString(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),o=""),a.length&&(o=a.reduce(((e,t)=>this.format(e,t,s.lng,{...s,interpolationkey:i[1].trim()})),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}const parseFormatStr=e=>{let t=e.toLowerCase().trim();const s={};if(e.indexOf("(")>-1){const i=e.split("(");t=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);"currency"===t&&o.indexOf(":")<0?s.currency||(s.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?s.range||(s.range=o.trim()):o.split(";").forEach((e=>{if(e){const[t,...i]=e.split(":"),o=i.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();s[r]||(s[r]=o),"false"===o&&(s[r]=!1),"true"===o&&(s[r]=!0),isNaN(o)||(s[r]=parseInt(o,10))}}))}return{formatName:t,formatOptions:s}},createCachedFormatter=e=>{const t={};return(s,i,o)=>{let r=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(r={...r,[o.interpolationkey]:void 0});const n=i+JSON.stringify(r);let a=t[n];return a||(a=e(getCleanedCode(i),o),t[n]=a),a(s)}},createNonCachedFormatter=e=>(t,s,i)=>e(getCleanedCode(s),i)(t);class Formatter{constructor(e={}){this.logger=baseLogger.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?createCachedFormatter:createNonCachedFormatter;this.formats={number:s(((e,t)=>{const s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)})),currency:s(((e,t)=>{const s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)})),datetime:s(((e,t)=>{const s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)})),relativetime:s(((e,t)=>{const s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")})),list:s(((e,t)=>{const s=new Intl.ListFormat(e,{...t});return e=>s.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=createCachedFormatter(t)}format(e,t,s,i={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((e=>e.indexOf(")")>-1))){const e=o.findIndex((e=>e.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce(((e,t)=>{const{formatName:o,formatOptions:r}=parseFormatStr(t);if(this.formats[o]){let t=e;try{const n=i?.formatParams?.[i.interpolationkey]||{},a=n.locale||n.lng||i.locale||i.lng||s;t=this.formats[o](e,a,{...r,...i,...n})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e}),e)}}const removePending=(e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)};class Connector extends EventEmitter{constructor(e,t,s,i={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,i.backend,i)}queueLoad(e,t,s,i){const o={},r={},n={},a={};return e.forEach((e=>{let i=!0;t.forEach((t=>{const n=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[n]=2:this.state[n]<0||(1===this.state[n]?void 0===r[n]&&(r[n]=!0):(this.state[n]=1,i=!1,void 0===r[n]&&(r[n]=!0),void 0===o[n]&&(o[n]=!0),void 0===a[t]&&(a[t]=!0)))})),i||(n[e]=!0)})),(Object.keys(o).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(r),toLoadLanguages:Object.keys(n),toLoadNamespaces:Object.keys(a)}}loaded(e,t,s){const i=e.split("|"),o=i[0],r=i[1];t&&this.emit("failedLoading",o,r,t),!t&&s&&this.store.addResourceBundle(o,r,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const n={};this.queue.forEach((s=>{pushPath(s.loaded,[o],r),removePending(s,e),t&&s.errors.push(t),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach((e=>{n[e]||(n[e]={});const t=s.loaded[e];t.length&&t.forEach((t=>{void 0===n[e][t]&&(n[e][t]=!0)}))})),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())})),this.emit("loaded",n),this.queue=this.queue.filter((e=>!e.done))}read(e,t,s,i=0,o=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:o,callback:r});this.readingCalls++;const n=(n,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}n&&a&&i<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,s,i+1,2*o,r)}),o):r(n,a)},a=this.backend[s].bind(this.backend);if(2!==a.length)return a(e,t,n);try{const s=a(e,t);s&&"function"==typeof s.then?s.then((e=>n(null,e))).catch(n):n(null,s)}catch(e){n(e)}}prepareLoading(e,t,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();isString(e)&&(e=this.languageUtils.toResolveHierarchy(e)),isString(t)&&(t=[t]);const o=this.queueLoad(e,t,s,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),i=s[0],o=s[1];this.read(i,o,"read",void 0,void 0,((s,r)=>{s&&this.logger.warn(`${t}loading namespace ${o} for language ${i} failed`,s),!s&&r&&this.logger.log(`${t}loaded namespace ${o} for language ${i}`,r),this.loaded(e,s,r)}))}saveMissing(e,t,s,i,o,r={},n=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=s&&""!==s){if(this.backend?.create){const a={...r,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,s,i,a):l(e,t,s,i),o&&"function"==typeof o.then?o.then((e=>n(null,e))).catch(n):n(null,o)}catch(e){n(e)}else l(e,t,s,i,n,a)}e&&e[0]&&this.store.addResource(e[0],t,s,i)}}else this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const get=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),isString(e[1])&&(t.defaultValue=e[1]),isString(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const s=e[3]||e[2];Object.keys(s).forEach((e=>{t[e]=s[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),transformOptions=e=>(isString(e.ns)&&(e.ns=[e.ns]),isString(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),isString(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),noop=()=>{},bindMemberFunctions=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))};class I18n extends EventEmitter{constructor(e={},t){if(super(),this.options=transformOptions(e),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(isString(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=get();this.options={...s,...this.options,...transformOptions(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?baseLogger.init(i(this.modules.logger),this.options):baseLogger.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Formatter;const t=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const o=this.services;o.logger=baseLogger,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new PluralResolver(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=i(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new Interpolator(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Connector(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=noop),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=(...t)=>this.store[e](...t)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const o=defer(),r=()=>{const e=(e,s)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(s),t(e,s)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),o}loadResources(e,t=noop){let s=t;const i=isString(e)?e:this.language;if("function"==typeof e&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return s();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};i?t(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e))),this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),s(e)}))}else s(null)}reloadResources(e,t,s){const i=defer();return"function"==typeof e&&(s=e,e=void 0),"function"==typeof t&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=noop),this.services.backendConnector.reload(e,t,(e=>{i.resolve(),s(e)})),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&postProcessor.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=defer();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,r)=>{r?this.isLanguageChangingTo===e&&(i(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,s.resolve(((...e)=>this.t(...e))),t&&t(o,((...e)=>this.t(...e)))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const s=isString(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(s)?s:this.services.languageUtils.getBestMatchFromCodes(isString(t)?[t]:t);r&&(this.language||i(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector?.cacheUserLanguage?.(r)),this.loadResources(r,(e=>{o(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),s}getFixedT(e,t,s){const i=(e,t,...o)=>{let r;r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},r.lng=r.lng||i.lng,r.lngs=r.lngs||i.lngs,r.ns=r.ns||i.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||s||i.keyPrefix);const n=this.options.keySeparator||".";let a;return r.keyPrefix&&Array.isArray(e)?a=e.map((e=>("function"==typeof e&&(e=keysFromSelector(e,{...this.options,...t})),`${r.keyPrefix}${n}${e}`))):("function"==typeof e&&(e=keysFromSelector(e,{...this.options,...t})),a=r.keyPrefix?`${r.keyPrefix}${n}${e}`:e),this.t(a,r)};return isString(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=s,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const r=(e,t)=>{const s=this.services.backendConnector.state[`${e}|${t}`];return-1===s||0===s||2===s};if(t.precheck){const e=t.precheck(this,r);if(void 0!==e)return e}return!(!this.hasResourceBundle(s,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(s,e)||i&&!r(o,e)))}loadNamespaces(e,t){const s=defer();return this.options.ns?(isString(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{s.resolve(),t&&t(e)})),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=defer();isString(e)&&(e=[e]);const i=this.options.preload||[],o=e.filter((e=>i.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return o.length?(this.options.preload=i.concat(o),this.loadResources((e=>{s.resolve(),t&&t(e)})),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new LanguageUtil(get());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new I18n(e,t)}cloneInstance(e={},t=noop){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},o=new I18n(i);if(void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e)),["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},s){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((s,i)=>(s[i]={...e[t][i]},s)),e[t]),e)),{});o.store=new ResourceStore(e,i),o.services.resourceStore=o.store}return o.translator=new Translator(o.services,i),o.translator.on("*",((e,...t)=>{o.emit(e,...t)})),o.init(i,t),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;export{instance as i};
@@ -1344,7 +1344,7 @@ export namespace Components {
1344
1344
  */
1345
1345
  "ombNumber"?: string;
1346
1346
  /**
1347
- * Displays the Respondent Burden section in the Privacy Act Statement modal and how many minutes the form is expected to take.
1347
+ * The Respondent Burden section in the Privacy Act Statement modal and how many minutes the form is expected to take. Note that the displayed text will convert minutes to hours and minutes when the value is over 60.
1348
1348
  */
1349
1349
  "resBurden"?: number;
1350
1350
  }
@@ -5439,7 +5439,7 @@ declare namespace LocalJSX {
5439
5439
  */
5440
5440
  "ombNumber"?: string;
5441
5441
  /**
5442
- * Displays the Respondent Burden section in the Privacy Act Statement modal and how many minutes the form is expected to take.
5442
+ * The Respondent Burden section in the Privacy Act Statement modal and how many minutes the form is expected to take. Note that the displayed text will convert minutes to hours and minutes when the value is over 60.
5443
5443
  */
5444
5444
  "resBurden"?: number;
5445
5445
  }
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-button-icon2.js";import{d as defineCustomElement$5}from"./va-card2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-modal2.js";import{d as defineCustomElement$2}from"./va-progress-bar2.js";import{d as defineCustomElement$1}from"./va-text-input2.js";import{i as instance}from"./i18next.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),s.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(s),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),s=document.createElement("div"),a=`Drag ${i} here or`,r="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${a} ${r}`,s.classList.add(INSTRUCTIONS_CLASS),s.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),s.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${a}</span> <span class="${CHOOSE_CLASS}">${r}</span>`),e.parentNode.insertBefore(s,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),s},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),s=e.closest(DROPZONE),a=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,s.insertBefore(t,a)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),s=createVisibleInstructions(e),{dropZoneEl:a}=getFileInputContext(e);return t?a.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:s,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),s=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),a=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);s&&(s.outerHTML=""),a&&(a.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,i)=>{const s=e;let a=DEFAULT_FILE_STATUS_TEXT;1===t.length?a=`You have selected the file: ${i}`:t.length>1&&(a=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout((()=>{s.textContent=a}),1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),s=e.closest(`.${TARGET_CLASS}`),a=s.querySelector(`.${INSTRUCTIONS_CLASS}`);let r="Change file",o="";1===t.length?o=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${r}</span>`):t.length>1&&(r="Change files",o=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${r}</span>`)),a.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=o,s.insertBefore(i,a),e.setAttribute("aria-label",r)},handleChange=(e,t,i,s)=>{const a=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],r=s.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),o=[];removeOldPreviews(s,i);for(let e=0;e<a.length;e+=1){const t=new FileReader,r=a[e].name;let n;o.push(r),t.onloadstart=function(){n=createUniqueID(makeSafeForID(r)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${n}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${r}\n <div>`))},t.onloadend=function(){const e=s.querySelector(`#${n}`);r.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):r.indexOf(".doc")>0||r.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):r.indexOf(".xls")>0||r.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):r.indexOf(".mov")>0||r.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},a[e]&&t.readAsDataURL(a[e])}0===a.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,a),updateStatusMessage(r,a,o)},preventInvalidFiles=(e,t,i,s)=>{const a=t.getAttribute("accept");s.classList.remove("has-invalid-file");const r=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(a){const o=a.split(","),n=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<o.length;e+=1){const i=o[e];if(l=t.name.indexOf(i)>0||r(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(s,i),t.value="",s.insertBefore(n,t),n.textContent=t.dataset.errormessage||"This is not a valid file type.",n.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),s.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,s)=>{preventInvalidFiles(e,t,i,s),!0===TYPE_IS_VALID&&handleChange(e,t,i,s)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),i.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),i.addEventListener("drop",(function(s){s.preventDefault(),this.classList.remove(DRAG_CLASS);const a=s.dataTransfer;if(s.target.files=a.files,a.files.length>1)return;handleUpload(s,e,t,i);const r=new CustomEvent("change",{detail:{files:a.files}});e.dispatchEvent(r)}),!1),e.addEventListener("input",(s=>handleUpload(s,e,t,i)),!1)}))},teardown(e){selectOrMatches(INPUT,e).forEach((e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS}))},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".heic":"image/heic"},vaFileInputCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .with-separator{border-top:1px solid var(--vads-color-base-lighter)}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.vaPasswordChange=createEvent(this,"vaPasswordChange",7),this.vaFileInputError=createEvent(this,"vaFileInputError",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.chooseFileString="choose from folder",this.dragFileString="Drag a file here or ",this.FILE_PREVIEW_SIZE_LIMIT=5242880,this.handleChange=e=>{const t=e.target;this.fileContents=null,t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.getExtension=e=>{const t=e.name.replace(/^\./,"");return(t.includes(".")?`.${t.split(".").pop()}`:null)||e.type},this.getFileTypeErrorMessage=e=>{const t=this.getExtension(e);return`We do not accept ${t?`${t} files`:"this file type"}. Choose a new file.`},this.handleFile=(e,t=!0)=>{let i=null;if(this.accept){const t=this.normalizeAcceptProp(this.accept);this.isAcceptedFileType(e.type,t)||(this.removeFile(!1),i=this.getFileTypeErrorMessage(e))}if(0===e.size&&(i="The file you selected is empty. Files must be larger than 0B."),e.size>this.maxFileSize&&(i=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`),e.size<this.minFileSize&&(i=`We can't upload your file because it's too small. Files must be at least ${this.formatFileSize(this.minFileSize)}.`),this.uploadedFile=null,this.file=e,i)return this.internalError=i,this.vaFileInputError.emit({error:i}),void this.resetState();t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,e.size<this.FILE_PREVIEW_SIZE_LIMIT&&this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File deleted. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.formatFileSize=e=>{const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,i)=>{const s=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,s):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,s))},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=null,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.encrypted=!1,this.uploadedFile=void 0,this.maxFileSize=1/0,this.minFileSize=0,this.percentUploaded=null,this.passwordError=void 0}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}handleError(e,t){t&&e&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e),setTimeout((()=>{t&&(t.textContent="")}),1e4)}),1e3)}async generateFileContents(e){if(!e)return;const t=e.slice(0,20),i=await t.arrayBuffer();if(new Uint8Array(i).every((e=>0===e)))return;const s=new FileReader;this.fileType=e.type,s.onloadend=()=>{this.fileContents=s.result},!this.fileType||"application/pdf"!==this.fileType&&!this.fileType.startsWith("image/")||this.fileType.includes("heic")||s.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,this.dragFileString,h("span",{class:"file-input-choose-text"},this.chooseFileString))}handlePasswordChange(e){this.vaPasswordChange.emit({password:e.target.value})}render(){const{label:e,name:t,required:i,accept:s,error:a,hint:r,dragFileString:o,chooseFileString:n,uploadMessage:l,headerSize:d,fileContents:c,fileType:p,headless:u,value:m,readOnly:f,encrypted:g,statusText:b,uploadedFile:v,percentUploaded:E,passwordError:S,internalError:A}=this;m&&!this.file&&this.handleFile(m,!1);const{uploadStatus:_,file:C}=this,x=a||A,L=`${r?"input-hint-message":""} ${x?"input-error-message":""}`.trim()||null,w=("file-input-target "+(x?"file-input-target-error":"")).trim();let y=h("div",{key:"c68812b3e98174d80b1e90456d21a3d632ad9c50",class:"thumbnail-container","aria-hidden":"true"},h("svg",{key:"c299dbd47727245c5e7cb0a9e2d42d506b13a76e",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"a6a79e4957c45586e45e0a6a3fd406716c1994ff",d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})));x?y=h("div",{key:"b5d5aeb7bfd44043a8e170cbfc4f724b91828b60",class:"thumbnail-container"},h("va-icon",{key:"9c9d0117a1e20d2e7bfdace4ffd129a625d8b53d",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):c&&p.startsWith("image/")&&(y=h("div",{key:"d15c0b8a523164d485a782d584a4d113e9b0943d",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"3f7d46bbcf27bfb44854123c0b35cf1f5c479acd",class:"thumbnail-preview",src:c,alt:"image"})));let I=u?"headless-selected-files-wrapper":"selected-files-wrapper";const T=null!==E&&E<100;let F="file-status-label";return T&&(F=`${F} uploading-status`),h(Host,{key:"347f21eec88a8415c63389a3a9cb31476cab03f4",class:{"has-error":!!x}},!f&&!u&&h("span",{key:"4bb4ed67cb6dcade5feeb8518232de9efca439e5"},e&&this.renderLabelOrHeader(e,i,d)),r&&!f&&!u&&h("div",{key:"70ff75d90185eedb9b2eb0dfd7bf546f6bd04d50",class:"usa-hint",id:"input-hint-message"},r),h("div",{key:"f48e20d50bb64e184277b87da2cee5bd7c567651",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"e0e05afb05cf7b990270c486d8ec2a09a0c2c1b5",id:"fileInputField",class:"file-input","aria-label":`${e}${i?" "+instance.t("required"):""}. ${o}${n}`,style:{visibility:"success"===_||v||A?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:s,"aria-describedby":L,onChange:this.handleChange}),v||C?h("div",{class:I},!u&&h("div",{class:"selected-files-label"},f?"Files you uploaded":"Selected files"),h("div",{class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{class:"va-card"},h("div",{class:"file-info-section"},y,h("div",{class:"file-info-group vads-u-line-height--2"},h("span",{class:"file-label"},C?C.name:v.name),x&&h("span",{id:"input-error-message",role:"alert"},h("span",{class:"usa-sr-only"},instance.t("error")),h("span",{"aria-live":"polite",class:"usa-error-message"},x)),!T&&h("span",{class:"file-size-label"},this.formatFileSize(C?C.size:v.size)),h("span",{class:F,"aria-live":"polite"},T?"Uploading...":b))),h("div",{class:this.showSeparator?"with-separator":void 0},!f&&T&&h(Fragment,null,h("va-progress-bar",{percent:E,noPercentScreenReader:!0}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})),!T&&h(Fragment,null,g&&h("va-text-input",{type:"password",onInput:e=>{this.handlePasswordChange(e)},label:"File password",required:!0,error:S}),h("div",{class:"additional-info-slot"},h("slot",null))),!f&&!T&&h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:`change file ${C?C.name:v.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,label:`delete file ${C?C.name:v.name}`})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, delete this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll delete the uploaded file"," ",h("span",{class:"file-label"},C?C.name:v.name)))))):h("div",null,h("span",{id:"file-input-error-alert",role:"alert"},x&&h(Fragment,null,h("span",{class:"usa-sr-only"},instance.t("error")),h("span",{class:"usa-error-message"},x))),h("div",{class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{class:w},h("div",{class:"file-input-box"}),h("div",{class:"file-input-instructions"},l||this.getDefaultUploadMessage())))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"],error:["handleError"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],encrypted:[4],uploadedFile:[1040],maxFileSize:[2,"max-file-size"],minFileSize:[2,"min-file-size"],percentUploaded:[1538,"percent-uploaded"],passwordError:[1,"password-error"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"],error:["handleError"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal","va-progress-bar","va-text-input"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-button-icon":customElements.get(e)||defineCustomElement$6();break;case"va-card":customElements.get(e)||defineCustomElement$5();break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-modal":customElements.get(e)||defineCustomElement$3();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$2();break;case"va-text-input":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-button-icon2.js";import{d as defineCustomElement$5}from"./va-card2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-modal2.js";import{d as defineCustomElement$2}from"./va-progress-bar2.js";import{d as defineCustomElement$1}from"./va-text-input2.js";import{i as instance}from"./i18next.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),s.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(s),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),s=document.createElement("div"),a=`Drag ${i} here or`,r="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${a} ${r}`,s.classList.add(INSTRUCTIONS_CLASS),s.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),s.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${a}</span> <span class="${CHOOSE_CLASS}">${r}</span>`),e.parentNode.insertBefore(s,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),s},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),s=e.closest(DROPZONE),a=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,s.insertBefore(t,a)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),s=createVisibleInstructions(e),{dropZoneEl:a}=getFileInputContext(e);return t?a.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:s,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),s=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),a=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);s&&(s.outerHTML=""),a&&(a.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,i)=>{const s=e;let a=DEFAULT_FILE_STATUS_TEXT;1===t.length?a=`You have selected the file: ${i}`:t.length>1&&(a=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout((()=>{s.textContent=a}),1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),s=e.closest(`.${TARGET_CLASS}`),a=s.querySelector(`.${INSTRUCTIONS_CLASS}`);let r="Change file",o="";1===t.length?o=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${r}</span>`):t.length>1&&(r="Change files",o=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${r}</span>`)),a.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=o,s.insertBefore(i,a),e.setAttribute("aria-label",r)},handleChange=(e,t,i,s)=>{const a=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],r=s.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),o=[];removeOldPreviews(s,i);for(let e=0;e<a.length;e+=1){const t=new FileReader,r=a[e].name;let n;o.push(r),t.onloadstart=function(){n=createUniqueID(makeSafeForID(r)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${n}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${r}\n <div>`))},t.onloadend=function(){const e=s.querySelector(`#${n}`);r.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):r.indexOf(".doc")>0||r.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):r.indexOf(".xls")>0||r.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):r.indexOf(".mov")>0||r.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},a[e]&&t.readAsDataURL(a[e])}0===a.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,a),updateStatusMessage(r,a,o)},preventInvalidFiles=(e,t,i,s)=>{const a=t.getAttribute("accept");s.classList.remove("has-invalid-file");const r=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(a){const o=a.split(","),n=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<o.length;e+=1){const i=o[e];if(l=t.name.indexOf(i)>0||r(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(s,i),t.value="",s.insertBefore(n,t),n.textContent=t.dataset.errormessage||"This is not a valid file type.",n.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),s.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,s)=>{preventInvalidFiles(e,t,i,s),!0===TYPE_IS_VALID&&handleChange(e,t,i,s)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),i.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),i.addEventListener("drop",(function(s){s.preventDefault(),this.classList.remove(DRAG_CLASS);const a=s.dataTransfer;if(s.target.files=a.files,a.files.length>1)return;handleUpload(s,e,t,i);const r=new CustomEvent("change",{detail:{files:a.files}});e.dispatchEvent(r)}),!1),e.addEventListener("input",(s=>handleUpload(s,e,t,i)),!1)}))},teardown(e){selectOrMatches(INPUT,e).forEach((e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS}))},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".heic":"image/heic"},vaFileInputCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .with-separator{border-top:1px solid var(--vads-color-base-lighter)}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.vaPasswordChange=createEvent(this,"vaPasswordChange",7),this.vaFileInputError=createEvent(this,"vaFileInputError",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.chooseFileString="choose from folder",this.dragFileString="Drag a file here or ",this.FILE_PREVIEW_SIZE_LIMIT=5242880,this.handleChange=e=>{const t=e.target;this.fileContents=null,t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.getExtension=e=>{const t=e.name.replace(/^\./,"");return(t.includes(".")?`.${t.split(".").pop()}`:null)||e.type},this.getFileTypeErrorMessage=e=>{const t=this.getExtension(e);return`We do not accept ${t?`${t} files`:"this file type"}. Choose a new file.`},this.handleFile=(e,t=!0)=>{let i=null;if(this.accept){const t=this.normalizeAcceptProp(this.accept);this.isAcceptedFileType(e.type,t)||(this.removeFile(!1),i=this.getFileTypeErrorMessage(e))}if(0===e.size&&(i="The file you selected is empty. Files must be larger than 0B."),e.size>this.maxFileSize&&(i=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`),e.size<this.minFileSize&&(i=`We can't upload your file because it's too small. Files must be at least ${this.formatFileSize(this.minFileSize)}.`),this.uploadedFile=null,this.file=e,i)return this.internalError=i,this.vaFileInputError.emit({error:i}),void this.resetState();t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,e.size<this.FILE_PREVIEW_SIZE_LIMIT&&this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File deleted. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.formatFileSize=e=>{const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,i)=>{const s=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,s):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,s))},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=null,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.encrypted=!1,this.uploadedFile=void 0,this.maxFileSize=1/0,this.minFileSize=0,this.percentUploaded=null,this.passwordError=void 0}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}handleError(e,t){t&&e&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e),setTimeout((()=>{t&&(t.textContent="")}),1e4)}),1e3)}async generateFileContents(e){if(!e)return;const t=e.slice(0,20),i=await t.arrayBuffer();if(new Uint8Array(i).every((e=>0===e)))return;const s=new FileReader;this.fileType=e.type,s.onloadend=()=>{this.fileContents=s.result},!this.fileType||"application/pdf"!==this.fileType&&!this.fileType.startsWith("image/")||this.fileType.includes("heic")||s.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,this.dragFileString,h("span",{class:"file-input-choose-text"},this.chooseFileString))}handlePasswordChange(e){this.vaPasswordChange.emit({password:e.target.value})}render(){const{label:e,name:t,required:i,accept:s,error:a,hint:r,dragFileString:o,chooseFileString:n,uploadMessage:l,headerSize:d,fileContents:c,fileType:p,headless:u,value:m,readOnly:f,encrypted:g,statusText:v,uploadedFile:b,percentUploaded:E,passwordError:S,internalError:A}=this;m&&!this.file&&this.handleFile(m,!1);const{uploadStatus:_,file:C}=this,x=a||A,L=`${r?"input-hint-message":""} ${x?"input-error-message":""}`.trim()||null,w=("file-input-target "+(x?"file-input-target-error":"")).trim();let y=h("div",{key:"2a9207d6c52c70f433e690919b5d8bbede45ce3c",class:"thumbnail-container","aria-hidden":"true"},h("svg",{key:"0ef12f3c26be697762b8482f9c4cec22402897ec",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"0e1afced00c7d8d7a8317c4b1673487e7683a085",d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})));x?y=h("div",{key:"645297225cdd9b0f619dd04660f3883acb72feeb",class:"thumbnail-container"},h("va-icon",{key:"02297e086380fe0cd80e56625c23cec071bdca5c",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):c&&p.startsWith("image/")&&(y=h("div",{key:"51507a9f5a8b45594aca5fdbc7252f55eac030e7",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"1e304b78de0bf0772e9cab22bbb74835b8860933",class:"thumbnail-preview",src:c,alt:"image"})));let I=u?"headless-selected-files-wrapper":"selected-files-wrapper";const T=null!==E&&E<100;let F="file-status-label";return T&&(F=`${F} uploading-status`),h(Host,{key:"d416dceedca410c4c3e74809fa5376a34894ea6a",class:{"has-error":!!x}},!f&&!u&&h("span",{key:"d347036d030bbda5780450d2df503a1905908c47"},e&&this.renderLabelOrHeader(e,i,d)),r&&!f&&!u&&h("div",{key:"0a576102d95284eb486bd8c4a4af408183eb968a",class:"usa-hint",id:"input-hint-message"},r),h("div",{key:"af20643cc5c1dd22a32324be60e08fb408272a2c",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"1c380295da8d477fbe72be36f5cd1befa6472c31",id:"fileInputField",class:"file-input","aria-label":`${e}${i?" "+instance.t("required"):""}. ${o}${n}`,style:{visibility:"success"===_||b||A?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:s,"aria-describedby":L,onChange:this.handleChange}),b||C?h("div",{class:I},!u&&h("div",{class:"selected-files-label"},f?"Files you uploaded":"Selected files"),h("div",{class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{class:"va-card"},h("div",{class:"file-info-section"},y,h("div",{class:"file-info-group vads-u-line-height--2"},h("span",{class:"file-label"},C?C.name:b.name),x&&h("span",{id:"input-error-message",role:"alert"},h("span",{class:"usa-sr-only"},instance.t("error")),h("span",{"aria-live":"polite",class:"usa-error-message"},x)),!T&&h("span",{class:"file-size-label"},this.formatFileSize(C?C.size:b.size)),h("span",{class:F,"aria-live":"polite"},T?"Uploading...":v))),h("div",{class:this.showSeparator?"with-separator":void 0},!f&&T&&h(Fragment,null,h("va-progress-bar",{percent:E,noPercentScreenReader:!0}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})),!T&&h(Fragment,null,g&&h("va-text-input",{type:"password",onInput:e=>{this.handlePasswordChange(e)},label:"File password",required:!0,error:S}),h("div",{class:"additional-info-slot"},h("slot",null))),!f&&!T&&h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:`change file ${C?C.name:b.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,label:`delete file ${C?C.name:b.name}`})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, delete this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll delete the uploaded file"," ",h("span",{class:"file-label"},C?C.name:b.name)))))):h("div",null,h("span",{id:"file-input-error-alert",role:"alert"},x&&h(Fragment,null,h("span",{class:"usa-sr-only"},instance.t("error")),h("span",{class:"usa-error-message"},x))),h("div",{class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{class:w},h("div",{class:"file-input-box"}),h("div",{class:"file-input-instructions"},l||this.getDefaultUploadMessage())))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"],error:["handleError"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],encrypted:[4],uploadedFile:[1040],maxFileSize:[2,"max-file-size"],minFileSize:[2,"min-file-size"],percentUploaded:[1538,"percent-uploaded"],passwordError:[1,"password-error"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"],error:["handleError"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal","va-progress-bar","va-text-input"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-button-icon":customElements.get(e)||defineCustomElement$6();break;case"va-card":customElements.get(e)||defineCustomElement$5();break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-modal":customElements.get(e)||defineCustomElement$3();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$2();break;case"va-text-input":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};