vite 2.7.2 → 2.7.6

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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

Files changed (87) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE.md +41 -11
  3. package/dist/client/client.mjs +1 -1
  4. package/dist/client/client.mjs.map +1 -1
  5. package/dist/node/build.d.ts +7 -7
  6. package/dist/node/chunks/{dep-58399509.js → dep-2d8e2cb1.js} +1 -1
  7. package/dist/node/chunks/dep-2d8e2cb1.js.map +1 -0
  8. package/dist/node/chunks/{dep-453486e7.js → dep-47e8be55.js} +2 -2
  9. package/dist/node/chunks/{dep-453486e7.js.map → dep-47e8be55.js.map} +1 -1
  10. package/dist/node/chunks/{dep-fffc0487.js → dep-5fb6fc32.js} +2 -2
  11. package/dist/node/chunks/dep-5fb6fc32.js.map +1 -0
  12. package/dist/node/chunks/{dep-93096c54.js → dep-e88755c3.js} +79 -61
  13. package/dist/node/chunks/dep-e88755c3.js.map +1 -0
  14. package/dist/node/chunks/{dep-7817f5b4.js → dep-fcec4469.js} +545 -187
  15. package/dist/node/chunks/dep-fcec4469.js.map +1 -0
  16. package/dist/node/cli.js +4 -4
  17. package/dist/node/cli.js.map +1 -1
  18. package/dist/node/config.d.ts +14 -14
  19. package/dist/node/http.d.ts +5 -5
  20. package/dist/node/index.d.ts +44 -44
  21. package/dist/node/index.js +1 -1
  22. package/dist/node/logger.d.ts +4 -4
  23. package/dist/node/optimizer/esbuildDepPlugin.d.ts +3 -3
  24. package/dist/node/optimizer/index.d.ts +2 -2
  25. package/dist/node/optimizer/registerMissing.d.ts +1 -1
  26. package/dist/node/optimizer/scan.d.ts +1 -1
  27. package/dist/node/packages.d.ts +2 -2
  28. package/dist/node/plugin.d.ts +7 -7
  29. package/dist/node/plugins/asset.d.ts +3 -3
  30. package/dist/node/plugins/assetImportMetaUrl.d.ts +2 -2
  31. package/dist/node/plugins/clientInjections.d.ts +2 -2
  32. package/dist/node/plugins/css.d.ts +7 -9
  33. package/dist/node/plugins/dataUri.d.ts +1 -1
  34. package/dist/node/plugins/define.d.ts +2 -2
  35. package/dist/node/plugins/esbuild.d.ts +4 -4
  36. package/dist/node/plugins/html.d.ts +5 -5
  37. package/dist/node/plugins/importAnalysis.d.ts +2 -2
  38. package/dist/node/plugins/importAnalysisBuild.d.ts +2 -2
  39. package/dist/node/plugins/index.d.ts +2 -2
  40. package/dist/node/plugins/json.d.ts +1 -1
  41. package/dist/node/plugins/loadFallback.d.ts +1 -1
  42. package/dist/node/plugins/manifest.d.ts +2 -2
  43. package/dist/node/plugins/modulePreloadPolyfill.d.ts +2 -2
  44. package/dist/node/plugins/preAlias.d.ts +1 -1
  45. package/dist/node/plugins/reporter.d.ts +2 -2
  46. package/dist/node/plugins/resolve.d.ts +4 -4
  47. package/dist/node/plugins/ssrRequireHook.d.ts +2 -2
  48. package/dist/node/plugins/terser.d.ts +2 -2
  49. package/dist/node/plugins/wasm.d.ts +2 -2
  50. package/dist/node/plugins/worker.d.ts +2 -2
  51. package/dist/node/preview.d.ts +4 -4
  52. package/dist/node/server/hmr.d.ts +3 -3
  53. package/dist/node/server/index.d.ts +15 -14
  54. package/dist/node/server/middlewares/base.d.ts +2 -2
  55. package/dist/node/server/middlewares/error.d.ts +4 -4
  56. package/dist/node/server/middlewares/indexHtml.d.ts +2 -2
  57. package/dist/node/server/middlewares/proxy.d.ts +4 -4
  58. package/dist/node/server/middlewares/spaFallback.d.ts +1 -1
  59. package/dist/node/server/middlewares/static.d.ts +2 -2
  60. package/dist/node/server/middlewares/time.d.ts +1 -1
  61. package/dist/node/server/middlewares/transform.d.ts +2 -2
  62. package/dist/node/server/moduleGraph.d.ts +2 -2
  63. package/dist/node/server/openBrowser.d.ts +1 -1
  64. package/dist/node/server/pluginContainer.d.ts +5 -5
  65. package/dist/node/server/send.d.ts +2 -2
  66. package/dist/node/server/sourcemap.d.ts +1 -1
  67. package/dist/node/server/transformRequest.d.ts +2 -2
  68. package/dist/node/server/ws.d.ts +5 -5
  69. package/dist/node/ssr/ssrExternal.d.ts +1 -1
  70. package/dist/node/ssr/ssrManifestPlugin.d.ts +2 -2
  71. package/dist/node/ssr/ssrModuleLoader.d.ts +1 -1
  72. package/dist/node/ssr/ssrStacktrace.d.ts +1 -1
  73. package/dist/node/ssr/ssrTransform.d.ts +2 -2
  74. package/dist/node/utils.d.ts +2 -2
  75. package/package.json +13 -13
  76. package/src/client/client.ts +3 -3
  77. package/src/client/overlay.ts +1 -1
  78. package/types/alias.d.ts +1 -1
  79. package/types/chokidar.d.ts +2 -2
  80. package/types/http-proxy.d.ts +4 -4
  81. package/types/importMeta.d.ts +6 -0
  82. package/types/shims.d.ts +5 -5
  83. package/types/ws.d.ts +6 -6
  84. package/dist/node/chunks/dep-58399509.js.map +0 -1
  85. package/dist/node/chunks/dep-7817f5b4.js.map +0 -1
  86. package/dist/node/chunks/dep-93096c54.js.map +0 -1
  87. package/dist/node/chunks/dep-fffc0487.js.map +0 -1
@@ -2171,7 +2171,7 @@ function setup(env) {
2171
2171
 
2172
2172
  /**
2173
2173
  * Selects a color for a debug namespace
2174
- * @param {String} namespace The namespace string for the for the debug instance to be colored
2174
+ * @param {String} namespace The namespace string for the debug instance to be colored
2175
2175
  * @return {Number|String} An ANSI color code for the given namespace
2176
2176
  * @api private
2177
2177
  */
@@ -3760,7 +3760,7 @@ function buildSourceMapTree(input, loader, relativeRoot) {
3760
3760
  const maps = asArray(input).map(decodeSourceMap);
3761
3761
  const map = maps.pop();
3762
3762
  for (let i = 0; i < maps.length; i++) {
3763
- if (maps[i].sources.length !== 1) {
3763
+ if (maps[i].sources.length > 1) {
3764
3764
  throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
3765
3765
  'Did you specify these with the most recent transformation maps first?');
3766
3766
  }
@@ -5712,7 +5712,7 @@ MagicString.prototype.trimStart = function trimStart (charType) {
5712
5712
  * @param typeMap [Object] Map of MIME type -> Array[extensions]
5713
5713
  * @param ...
5714
5714
  */
5715
- function Mime$3() {
5715
+ function Mime$1() {
5716
5716
  this._types = Object.create(null);
5717
5717
  this._extensions = Object.create(null);
5718
5718
 
@@ -5744,7 +5744,7 @@ function Mime$3() {
5744
5744
  * @param map (Object) type definitions
5745
5745
  * @param force (Boolean) if true, force overriding of existing definitions
5746
5746
  */
5747
- Mime$3.prototype.define = function(typeMap, force) {
5747
+ Mime$1.prototype.define = function(typeMap, force) {
5748
5748
  for (let type in typeMap) {
5749
5749
  let extensions = typeMap[type].map(function(t) {
5750
5750
  return t.toLowerCase();
@@ -5783,7 +5783,7 @@ Mime$3.prototype.define = function(typeMap, force) {
5783
5783
  /**
5784
5784
  * Lookup a mime type based on extension
5785
5785
  */
5786
- Mime$3.prototype.getType = function(path) {
5786
+ Mime$1.prototype.getType = function(path) {
5787
5787
  path = String(path);
5788
5788
  let last = path.replace(/^.*[/\\]/, '').toLowerCase();
5789
5789
  let ext = last.replace(/^.*\./, '').toLowerCase();
@@ -5797,17 +5797,17 @@ Mime$3.prototype.getType = function(path) {
5797
5797
  /**
5798
5798
  * Return file extension associated with a mime type
5799
5799
  */
5800
- Mime$3.prototype.getExtension = function(type) {
5800
+ Mime$1.prototype.getExtension = function(type) {
5801
5801
  type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
5802
5802
  return type && this._extensions[type.toLowerCase()] || null;
5803
5803
  };
5804
5804
 
5805
- var Mime_1$1 = Mime$3;
5805
+ var Mime_1 = Mime$1;
5806
5806
 
5807
- var standard$1 = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};
5807
+ var standard = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};
5808
5808
 
5809
- let Mime$2 = Mime_1$1;
5810
- var lite$1 = new Mime$2(standard$1);
5809
+ let Mime = Mime_1;
5810
+ var lite = new Mime(standard);
5811
5811
 
5812
5812
  const assetUrlRE = /__VITE_ASSET__([a-z\d]{8})__(?:\$_(.*?)__)?/g;
5813
5813
  const rawRE = /(\?|&)raw(?:&|$)/;
@@ -6033,7 +6033,7 @@ async function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false
6033
6033
  (!file.endsWith('.svg') &&
6034
6034
  content.length < Number(config.build.assetsInlineLimit))) {
6035
6035
  // base64 inlined as a string
6036
- url = `data:${lite$1.getType(file)};base64,${content.toString('base64')}`;
6036
+ url = `data:${lite.getType(file)};base64,${content.toString('base64')}`;
6037
6037
  }
6038
6038
  else {
6039
6039
  // emit as asset
@@ -20099,13 +20099,14 @@ function cssPostPlugin(config) {
20099
20099
  return `export default ${JSON.stringify(css)}`;
20100
20100
  }
20101
20101
  return [
20102
- `import { updateStyle, removeStyle } from ${JSON.stringify(path__default.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
20103
- `const id = ${JSON.stringify(id)}`,
20104
- `const css = ${JSON.stringify(css)}`,
20105
- `updateStyle(id, css)`,
20102
+ `import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path__default.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
20103
+ `const __vite__id = ${JSON.stringify(id)}`,
20104
+ `const __vite__css = ${JSON.stringify(css)}`,
20105
+ `__vite__updateStyle(__vite__id, __vite__css)`,
20106
20106
  // css modules exports change on edit so it can't self accept
20107
- `${modulesCode || `import.meta.hot.accept()\nexport default css`}`,
20108
- `import.meta.hot.prune(() => removeStyle(id))`
20107
+ `${modulesCode ||
20108
+ `import.meta.hot.accept()\nexport default __vite__css`}`,
20109
+ `import.meta.hot.prune(() => __vite__removeStyle(__vite__id))`
20109
20110
  ].join('\n');
20110
20111
  }
20111
20112
  }
@@ -20382,7 +20383,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
20382
20383
  const postcssOptions = (postcssConfig && postcssConfig.options) || {};
20383
20384
  const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
20384
20385
  if (needInlineImport) {
20385
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-58399509.js'); }).then(function (n) { return n.index; })).default({
20386
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-2d8e2cb1.js'); }).then(function (n) { return n.index; })).default({
20386
20387
  async resolve(id, basedir) {
20387
20388
  const resolved = await atImportResolvers.css(id, path__default.join(basedir, '*'));
20388
20389
  if (resolved) {
@@ -20396,7 +20397,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
20396
20397
  replacer: urlReplacer
20397
20398
  }));
20398
20399
  if (isModule) {
20399
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-fffc0487.js'); }).then(function (n) { return n.index; })).default({
20400
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-5fb6fc32.js'); }).then(function (n) { return n.index; })).default({
20400
20401
  ...modulesOptions,
20401
20402
  getJSON(cssFileName, _modules, outputFileName) {
20402
20403
  modules = _modules;
@@ -21401,7 +21402,7 @@ const assetAttrsConfig = {
21401
21402
  const isAsyncScriptMap = new WeakMap();
21402
21403
  async function traverseHtml(html, filePath, visitor) {
21403
21404
  // lazy load compiler
21404
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-93096c54.js'); }).then(function (n) { return n.compilerDom_cjs; });
21405
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-e88755c3.js'); }).then(function (n) { return n.compilerDom_cjs; });
21405
21406
  // @vue/compiler-core doesn't like lowercase doctypes
21406
21407
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
21407
21408
  try {
@@ -21411,12 +21412,7 @@ async function traverseHtml(html, filePath, visitor) {
21411
21412
  });
21412
21413
  }
21413
21414
  catch (e) {
21414
- const parseError = {
21415
- loc: filePath,
21416
- frame: '',
21417
- ...formatParseError(e, filePath, html)
21418
- };
21419
- throw new Error(`Unable to parse ${JSON.stringify(parseError.loc)}\n${parseError.frame}`);
21415
+ handleParseError(e, html, filePath);
21420
21416
  }
21421
21417
  }
21422
21418
  function getScriptInfo(node) {
@@ -21439,17 +21435,28 @@ function getScriptInfo(node) {
21439
21435
  }
21440
21436
  return { src, isModule, isAsync };
21441
21437
  }
21442
- function formatParseError(e, id, html) {
21443
- // normalize the error to rollup format
21444
- if (e.loc) {
21445
- e.frame = generateCodeFrame(html, e.loc.start.offset);
21446
- e.loc = {
21438
+ /**
21439
+ * Format Vue @type {CompilerError} to @type {RollupError}
21440
+ */
21441
+ function formatParseError(compilerError, id, html) {
21442
+ const formattedError = { ...compilerError };
21443
+ if (compilerError.loc) {
21444
+ formattedError.frame = generateCodeFrame(html, compilerError.loc.start.offset);
21445
+ formattedError.loc = {
21447
21446
  file: id,
21448
- line: e.loc.start.line,
21449
- column: e.loc.start.column
21447
+ line: compilerError.loc.start.line,
21448
+ column: compilerError.loc.start.column
21450
21449
  };
21451
21450
  }
21452
- return e;
21451
+ return formattedError;
21452
+ }
21453
+ function handleParseError(compilerError, html, filePath) {
21454
+ const parseError = {
21455
+ loc: filePath,
21456
+ frame: '',
21457
+ ...formatParseError(compilerError, filePath, html)
21458
+ };
21459
+ throw new Error(`Unable to parse HTML; ${compilerError.message}\n at ${JSON.stringify(parseError.loc)}\n${parseError.frame}`);
21453
21460
  }
21454
21461
  /**
21455
21462
  * Compiles index.html into an entry js module
@@ -21467,6 +21474,7 @@ function buildHtmlPlugin(config) {
21467
21474
  isAsyncScriptMap.set(config, new Map());
21468
21475
  },
21469
21476
  async transform(html, id) {
21477
+ var _a, _b;
21470
21478
  if (id.endsWith('.html')) {
21471
21479
  const publicPath = `/${slash$3(path__default.relative(config.root, id))}`;
21472
21480
  // pre-transform
@@ -21529,7 +21537,8 @@ function buildHtmlPlugin(config) {
21529
21537
  if (p.type === 6 /* ATTRIBUTE */ &&
21530
21538
  p.value &&
21531
21539
  assetAttrs.includes(p.name)) {
21532
- const url = p.value.content;
21540
+ // assetsUrl may be encodeURI
21541
+ const url = decodeURI(p.value.content);
21533
21542
  if (!isExcludedUrl(url)) {
21534
21543
  if (node.tag === 'link' && isCSSRequest(url)) {
21535
21544
  // CSS references, convert to import
@@ -21557,20 +21566,27 @@ function buildHtmlPlugin(config) {
21557
21566
  config.logger.warn(`\nMixed async and defer script modules in ${id}, output script will fallback to defer. Every script, including inline ones, need to be marked as async for your output script to be async.`);
21558
21567
  }
21559
21568
  // for each encountered asset url, rewrite original html so that it
21560
- // references the post-build location.
21569
+ // references the post-build location, ignoring empty attributes and
21570
+ // attributes that directly reference named output.
21571
+ const namedOutput = Object.keys(((_b = (_a = config === null || config === void 0 ? void 0 : config.build) === null || _a === void 0 ? void 0 : _a.rollupOptions) === null || _b === void 0 ? void 0 : _b.input) || {});
21561
21572
  for (const attr of assetUrls) {
21562
21573
  const value = attr.value;
21563
- try {
21564
- const url = attr.name === 'srcset'
21565
- ? await processSrcSet(value.content, ({ url }) => urlToBuiltUrl(url, id, config, this))
21566
- : await urlToBuiltUrl(value.content, id, config, this);
21567
- s.overwrite(value.loc.start.offset, value.loc.end.offset, `"${url}"`);
21568
- }
21569
- catch (e) {
21570
- // #1885 preload may be pointing to urls that do not exist
21571
- // locally on disk
21572
- if (e.code !== 'ENOENT') {
21573
- throw e;
21574
+ // assetsUrl may be encodeURI
21575
+ const content = decodeURI(value.content);
21576
+ if (content !== '' && // Empty attribute
21577
+ !namedOutput.includes(content) && // Direct reference to named output
21578
+ !namedOutput.includes(content.replace(/^\//, '')) // Allow for absolute references as named output can't be an absolute path
21579
+ ) {
21580
+ try {
21581
+ const url = attr.name === 'srcset'
21582
+ ? await processSrcSet(content, ({ url }) => urlToBuiltUrl(url, id, config, this))
21583
+ : await urlToBuiltUrl(content, id, config, this);
21584
+ s.overwrite(value.loc.start.offset, value.loc.end.offset, `"${url}"`);
21585
+ }
21586
+ catch (e) {
21587
+ if (e.code !== 'ENOENT') {
21588
+ throw e;
21589
+ }
21574
21590
  }
21575
21591
  }
21576
21592
  }
@@ -22736,7 +22752,7 @@ function manifestPlugin(config) {
22736
22752
  const ext = path__default.extname(name);
22737
22753
  name = name.slice(0, -ext.length) + `-legacy` + ext;
22738
22754
  }
22739
- return name;
22755
+ return name.replace(/\0/g, '');
22740
22756
  }
22741
22757
  else {
22742
22758
  return `_` + path__default.basename(chunk.fileName);
@@ -30758,6 +30774,7 @@ function resolveSSRExternal(config, knownImports) {
30758
30774
  }
30759
30775
  return externals;
30760
30776
  }
30777
+ const CJS_CONTENT_RE = /\bmodule\.exports\b|\bexports[.\[]|\brequire\s*\(|\bObject\.(defineProperty|defineProperties|assign)\s*\(\s*exports\b/;
30761
30778
  // do we need to do this ahead of time or could we do it lazily?
30762
30779
  function collectExternals(root, preserveSymlinks, ssrExternals, seen, logger) {
30763
30780
  var _a;
@@ -30836,11 +30853,11 @@ function collectExternals(root, preserveSymlinks, ssrExternals, seen, logger) {
30836
30853
  }
30837
30854
  // check if the entry is cjs
30838
30855
  const content = fs__default.readFileSync(esmEntry, 'utf-8');
30839
- if (/\bmodule\.exports\b|\bexports[.\[]|\brequire\s*\(/.test(content)) {
30856
+ if (CJS_CONTENT_RE.test(content)) {
30840
30857
  ssrExternals.add(id);
30841
30858
  continue;
30842
30859
  }
30843
- logger.warn(`${id} is incorrectly packaged. Please contact the package author to fix.`);
30860
+ logger.warn(`${id} doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.`);
30844
30861
  }
30845
30862
  }
30846
30863
  for (const depRoot of depsToTrace) {
@@ -43349,7 +43366,7 @@ function loadFallbackPlugin() {
43349
43366
  };
43350
43367
  }
43351
43368
 
43352
- function resolveBuildOptions(root, raw) {
43369
+ function resolveBuildOptions(root, raw, isBuild) {
43353
43370
  var _a;
43354
43371
  const resolved = {
43355
43372
  target: 'modules',
@@ -43398,18 +43415,22 @@ function resolveBuildOptions(root, raw) {
43398
43415
  ]))
43399
43416
  : resolve(raw.rollupOptions.input);
43400
43417
  }
43401
- else {
43402
- input = resolve((raw === null || raw === void 0 ? void 0 : raw.lib)
43403
- ? raw.lib.entry
43404
- : typeof (raw === null || raw === void 0 ? void 0 : raw.ssr) === 'string'
43405
- ? raw.ssr
43406
- : 'index.html');
43418
+ else if ((raw === null || raw === void 0 ? void 0 : raw.lib) && isBuild) {
43419
+ input = resolve(raw.lib.entry);
43420
+ }
43421
+ else if (typeof (raw === null || raw === void 0 ? void 0 : raw.ssr) === 'string') {
43422
+ input = resolve(raw.ssr);
43423
+ }
43424
+ else if (isBuild) {
43425
+ input = resolve('index.html');
43407
43426
  }
43408
43427
  if (!!(raw === null || raw === void 0 ? void 0 : raw.ssr) && typeof input === 'string' && input.endsWith('.html')) {
43409
43428
  throw new Error(`rollupOptions.input should not be an html file when building for SSR. ` +
43410
43429
  `Please specify a dedicated SSR entry.`);
43411
43430
  }
43412
- resolved.rollupOptions.input = input;
43431
+ if (input) {
43432
+ resolved.rollupOptions.input = input;
43433
+ }
43413
43434
  // handle special build targets
43414
43435
  if (resolved.target === 'modules') {
43415
43436
  // Support browserslist
@@ -43449,7 +43470,7 @@ function resolveBuildPlugins(config) {
43449
43470
  dynamicImportVariables(options.dynamicImportVarsOptions),
43450
43471
  assetImportMetaUrlPlugin(config),
43451
43472
  ...(options.rollupOptions.plugins
43452
- ? options.rollupOptions.plugins.filter((p) => !!p)
43473
+ ? options.rollupOptions.plugins.filter(Boolean)
43453
43474
  : [])
43454
43475
  ],
43455
43476
  post: [
@@ -49560,7 +49581,7 @@ function readFileIfExists(value) {
49560
49581
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
49561
49582
  */
49562
49583
  async function createCertificate() {
49563
- const { generate } = await Promise.resolve().then(function () { return require('./dep-453486e7.js'); }).then(function (n) { return n.index; });
49584
+ const { generate } = await Promise.resolve().then(function () { return require('./dep-47e8be55.js'); }).then(function (n) { return n.index; });
49564
49585
  const pems = generate(null, {
49565
49586
  algorithm: 'sha256',
49566
49587
  days: 30,
@@ -53835,6 +53856,9 @@ function createWebSocketServer(server, config, httpsOptions) {
53835
53856
  },
53836
53857
  close() {
53837
53858
  return new Promise((resolve, reject) => {
53859
+ wss.clients.forEach((client) => {
53860
+ client.terminate();
53861
+ });
53838
53862
  wss.close((err) => {
53839
53863
  if (err) {
53840
53864
  reject(err);
@@ -56822,7 +56846,8 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
56822
56846
  if (((parent === null || parent === void 0 ? void 0 : parent.type) === 'AssignmentPattern' &&
56823
56847
  (parent === null || parent === void 0 ? void 0 : parent.right) === child) ||
56824
56848
  ((parent === null || parent === void 0 ? void 0 : parent.type) === 'TemplateLiteral' &&
56825
- (parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child)))) {
56849
+ (parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child))) ||
56850
+ ((parent === null || parent === void 0 ? void 0 : parent.type) === 'CallExpression' && (parent === null || parent === void 0 ? void 0 : parent.callee) === child)) {
56826
56851
  return;
56827
56852
  }
56828
56853
  setScope(node, child.name);
@@ -56840,6 +56865,9 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
56840
56865
  if (property.type === 'RestElement') {
56841
56866
  setScope(parentFunction, property.argument.name);
56842
56867
  }
56868
+ else if (property.value.type === 'AssignmentPattern') {
56869
+ setScope(parentFunction, property.value.left.name);
56870
+ }
56843
56871
  else {
56844
56872
  setScope(parentFunction, property.value.name);
56845
56873
  }
@@ -57037,107 +57065,421 @@ function list(dir, callback, pre='') {
57037
57065
  }
57038
57066
  }
57039
57067
 
57040
- /**
57041
- * @param typeMap [Object] Map of MIME type -> Array[extensions]
57042
- * @param ...
57043
- */
57044
- function Mime$1() {
57045
- this._types = Object.create(null);
57046
- this._extensions = Object.create(null);
57047
-
57048
- for (let i = 0; i < arguments.length; i++) {
57049
- this.define(arguments[i]);
57050
- }
57051
-
57052
- this.define = this.define.bind(this);
57053
- this.getType = this.getType.bind(this);
57054
- this.getExtension = this.getExtension.bind(this);
57068
+ const mimes = {
57069
+ "ez": "application/andrew-inset",
57070
+ "aw": "application/applixware",
57071
+ "atom": "application/atom+xml",
57072
+ "atomcat": "application/atomcat+xml",
57073
+ "atomdeleted": "application/atomdeleted+xml",
57074
+ "atomsvc": "application/atomsvc+xml",
57075
+ "dwd": "application/atsc-dwd+xml",
57076
+ "held": "application/atsc-held+xml",
57077
+ "rsat": "application/atsc-rsat+xml",
57078
+ "bdoc": "application/bdoc",
57079
+ "xcs": "application/calendar+xml",
57080
+ "ccxml": "application/ccxml+xml",
57081
+ "cdfx": "application/cdfx+xml",
57082
+ "cdmia": "application/cdmi-capability",
57083
+ "cdmic": "application/cdmi-container",
57084
+ "cdmid": "application/cdmi-domain",
57085
+ "cdmio": "application/cdmi-object",
57086
+ "cdmiq": "application/cdmi-queue",
57087
+ "cu": "application/cu-seeme",
57088
+ "mpd": "application/dash+xml",
57089
+ "davmount": "application/davmount+xml",
57090
+ "dbk": "application/docbook+xml",
57091
+ "dssc": "application/dssc+der",
57092
+ "xdssc": "application/dssc+xml",
57093
+ "es": "application/ecmascript",
57094
+ "ecma": "application/ecmascript",
57095
+ "emma": "application/emma+xml",
57096
+ "emotionml": "application/emotionml+xml",
57097
+ "epub": "application/epub+zip",
57098
+ "exi": "application/exi",
57099
+ "fdt": "application/fdt+xml",
57100
+ "pfr": "application/font-tdpfr",
57101
+ "geojson": "application/geo+json",
57102
+ "gml": "application/gml+xml",
57103
+ "gpx": "application/gpx+xml",
57104
+ "gxf": "application/gxf",
57105
+ "gz": "application/gzip",
57106
+ "hjson": "application/hjson",
57107
+ "stk": "application/hyperstudio",
57108
+ "ink": "application/inkml+xml",
57109
+ "inkml": "application/inkml+xml",
57110
+ "ipfix": "application/ipfix",
57111
+ "its": "application/its+xml",
57112
+ "jar": "application/java-archive",
57113
+ "war": "application/java-archive",
57114
+ "ear": "application/java-archive",
57115
+ "ser": "application/java-serialized-object",
57116
+ "class": "application/java-vm",
57117
+ "js": "application/javascript",
57118
+ "mjs": "application/javascript",
57119
+ "json": "application/json",
57120
+ "map": "application/json",
57121
+ "json5": "application/json5",
57122
+ "jsonml": "application/jsonml+json",
57123
+ "jsonld": "application/ld+json",
57124
+ "lgr": "application/lgr+xml",
57125
+ "lostxml": "application/lost+xml",
57126
+ "hqx": "application/mac-binhex40",
57127
+ "cpt": "application/mac-compactpro",
57128
+ "mads": "application/mads+xml",
57129
+ "webmanifest": "application/manifest+json",
57130
+ "mrc": "application/marc",
57131
+ "mrcx": "application/marcxml+xml",
57132
+ "ma": "application/mathematica",
57133
+ "nb": "application/mathematica",
57134
+ "mb": "application/mathematica",
57135
+ "mathml": "application/mathml+xml",
57136
+ "mbox": "application/mbox",
57137
+ "mscml": "application/mediaservercontrol+xml",
57138
+ "metalink": "application/metalink+xml",
57139
+ "meta4": "application/metalink4+xml",
57140
+ "mets": "application/mets+xml",
57141
+ "maei": "application/mmt-aei+xml",
57142
+ "musd": "application/mmt-usd+xml",
57143
+ "mods": "application/mods+xml",
57144
+ "m21": "application/mp21",
57145
+ "mp21": "application/mp21",
57146
+ "mp4s": "application/mp4",
57147
+ "m4p": "application/mp4",
57148
+ "doc": "application/msword",
57149
+ "dot": "application/msword",
57150
+ "mxf": "application/mxf",
57151
+ "nq": "application/n-quads",
57152
+ "nt": "application/n-triples",
57153
+ "cjs": "application/node",
57154
+ "bin": "application/octet-stream",
57155
+ "dms": "application/octet-stream",
57156
+ "lrf": "application/octet-stream",
57157
+ "mar": "application/octet-stream",
57158
+ "so": "application/octet-stream",
57159
+ "dist": "application/octet-stream",
57160
+ "distz": "application/octet-stream",
57161
+ "pkg": "application/octet-stream",
57162
+ "bpk": "application/octet-stream",
57163
+ "dump": "application/octet-stream",
57164
+ "elc": "application/octet-stream",
57165
+ "deploy": "application/octet-stream",
57166
+ "exe": "application/octet-stream",
57167
+ "dll": "application/octet-stream",
57168
+ "deb": "application/octet-stream",
57169
+ "dmg": "application/octet-stream",
57170
+ "iso": "application/octet-stream",
57171
+ "img": "application/octet-stream",
57172
+ "msi": "application/octet-stream",
57173
+ "msp": "application/octet-stream",
57174
+ "msm": "application/octet-stream",
57175
+ "buffer": "application/octet-stream",
57176
+ "oda": "application/oda",
57177
+ "opf": "application/oebps-package+xml",
57178
+ "ogx": "application/ogg",
57179
+ "omdoc": "application/omdoc+xml",
57180
+ "onetoc": "application/onenote",
57181
+ "onetoc2": "application/onenote",
57182
+ "onetmp": "application/onenote",
57183
+ "onepkg": "application/onenote",
57184
+ "oxps": "application/oxps",
57185
+ "relo": "application/p2p-overlay+xml",
57186
+ "xer": "application/patch-ops-error+xml",
57187
+ "pdf": "application/pdf",
57188
+ "pgp": "application/pgp-encrypted",
57189
+ "asc": "application/pgp-signature",
57190
+ "sig": "application/pgp-signature",
57191
+ "prf": "application/pics-rules",
57192
+ "p10": "application/pkcs10",
57193
+ "p7m": "application/pkcs7-mime",
57194
+ "p7c": "application/pkcs7-mime",
57195
+ "p7s": "application/pkcs7-signature",
57196
+ "p8": "application/pkcs8",
57197
+ "ac": "application/pkix-attr-cert",
57198
+ "cer": "application/pkix-cert",
57199
+ "crl": "application/pkix-crl",
57200
+ "pkipath": "application/pkix-pkipath",
57201
+ "pki": "application/pkixcmp",
57202
+ "pls": "application/pls+xml",
57203
+ "ai": "application/postscript",
57204
+ "eps": "application/postscript",
57205
+ "ps": "application/postscript",
57206
+ "provx": "application/provenance+xml",
57207
+ "cww": "application/prs.cww",
57208
+ "pskcxml": "application/pskc+xml",
57209
+ "raml": "application/raml+yaml",
57210
+ "rdf": "application/rdf+xml",
57211
+ "owl": "application/rdf+xml",
57212
+ "rif": "application/reginfo+xml",
57213
+ "rnc": "application/relax-ng-compact-syntax",
57214
+ "rl": "application/resource-lists+xml",
57215
+ "rld": "application/resource-lists-diff+xml",
57216
+ "rs": "application/rls-services+xml",
57217
+ "rapd": "application/route-apd+xml",
57218
+ "sls": "application/route-s-tsid+xml",
57219
+ "rusd": "application/route-usd+xml",
57220
+ "gbr": "application/rpki-ghostbusters",
57221
+ "mft": "application/rpki-manifest",
57222
+ "roa": "application/rpki-roa",
57223
+ "rsd": "application/rsd+xml",
57224
+ "rss": "application/rss+xml",
57225
+ "rtf": "application/rtf",
57226
+ "sbml": "application/sbml+xml",
57227
+ "scq": "application/scvp-cv-request",
57228
+ "scs": "application/scvp-cv-response",
57229
+ "spq": "application/scvp-vp-request",
57230
+ "spp": "application/scvp-vp-response",
57231
+ "sdp": "application/sdp",
57232
+ "senmlx": "application/senml+xml",
57233
+ "sensmlx": "application/sensml+xml",
57234
+ "setpay": "application/set-payment-initiation",
57235
+ "setreg": "application/set-registration-initiation",
57236
+ "shf": "application/shf+xml",
57237
+ "siv": "application/sieve",
57238
+ "sieve": "application/sieve",
57239
+ "smi": "application/smil+xml",
57240
+ "smil": "application/smil+xml",
57241
+ "rq": "application/sparql-query",
57242
+ "srx": "application/sparql-results+xml",
57243
+ "gram": "application/srgs",
57244
+ "grxml": "application/srgs+xml",
57245
+ "sru": "application/sru+xml",
57246
+ "ssdl": "application/ssdl+xml",
57247
+ "ssml": "application/ssml+xml",
57248
+ "swidtag": "application/swid+xml",
57249
+ "tei": "application/tei+xml",
57250
+ "teicorpus": "application/tei+xml",
57251
+ "tfi": "application/thraud+xml",
57252
+ "tsd": "application/timestamped-data",
57253
+ "toml": "application/toml",
57254
+ "trig": "application/trig",
57255
+ "ttml": "application/ttml+xml",
57256
+ "ubj": "application/ubjson",
57257
+ "rsheet": "application/urc-ressheet+xml",
57258
+ "td": "application/urc-targetdesc+xml",
57259
+ "vxml": "application/voicexml+xml",
57260
+ "wasm": "application/wasm",
57261
+ "wgt": "application/widget",
57262
+ "hlp": "application/winhlp",
57263
+ "wsdl": "application/wsdl+xml",
57264
+ "wspolicy": "application/wspolicy+xml",
57265
+ "xaml": "application/xaml+xml",
57266
+ "xav": "application/xcap-att+xml",
57267
+ "xca": "application/xcap-caps+xml",
57268
+ "xdf": "application/xcap-diff+xml",
57269
+ "xel": "application/xcap-el+xml",
57270
+ "xns": "application/xcap-ns+xml",
57271
+ "xenc": "application/xenc+xml",
57272
+ "xhtml": "application/xhtml+xml",
57273
+ "xht": "application/xhtml+xml",
57274
+ "xlf": "application/xliff+xml",
57275
+ "xml": "application/xml",
57276
+ "xsl": "application/xml",
57277
+ "xsd": "application/xml",
57278
+ "rng": "application/xml",
57279
+ "dtd": "application/xml-dtd",
57280
+ "xop": "application/xop+xml",
57281
+ "xpl": "application/xproc+xml",
57282
+ "xslt": "application/xml",
57283
+ "xspf": "application/xspf+xml",
57284
+ "mxml": "application/xv+xml",
57285
+ "xhvml": "application/xv+xml",
57286
+ "xvml": "application/xv+xml",
57287
+ "xvm": "application/xv+xml",
57288
+ "yang": "application/yang",
57289
+ "yin": "application/yin+xml",
57290
+ "zip": "application/zip",
57291
+ "3gpp": "video/3gpp",
57292
+ "adp": "audio/adpcm",
57293
+ "amr": "audio/amr",
57294
+ "au": "audio/basic",
57295
+ "snd": "audio/basic",
57296
+ "mid": "audio/midi",
57297
+ "midi": "audio/midi",
57298
+ "kar": "audio/midi",
57299
+ "rmi": "audio/midi",
57300
+ "mxmf": "audio/mobile-xmf",
57301
+ "mp3": "audio/mpeg",
57302
+ "m4a": "audio/mp4",
57303
+ "mp4a": "audio/mp4",
57304
+ "mpga": "audio/mpeg",
57305
+ "mp2": "audio/mpeg",
57306
+ "mp2a": "audio/mpeg",
57307
+ "m2a": "audio/mpeg",
57308
+ "m3a": "audio/mpeg",
57309
+ "oga": "audio/ogg",
57310
+ "ogg": "audio/ogg",
57311
+ "spx": "audio/ogg",
57312
+ "opus": "audio/ogg",
57313
+ "s3m": "audio/s3m",
57314
+ "sil": "audio/silk",
57315
+ "wav": "audio/wav",
57316
+ "weba": "audio/webm",
57317
+ "xm": "audio/xm",
57318
+ "ttc": "font/collection",
57319
+ "otf": "font/otf",
57320
+ "ttf": "font/ttf",
57321
+ "woff": "font/woff",
57322
+ "woff2": "font/woff2",
57323
+ "exr": "image/aces",
57324
+ "apng": "image/apng",
57325
+ "avif": "image/avif",
57326
+ "bmp": "image/bmp",
57327
+ "cgm": "image/cgm",
57328
+ "drle": "image/dicom-rle",
57329
+ "emf": "image/emf",
57330
+ "fits": "image/fits",
57331
+ "g3": "image/g3fax",
57332
+ "gif": "image/gif",
57333
+ "heic": "image/heic",
57334
+ "heics": "image/heic-sequence",
57335
+ "heif": "image/heif",
57336
+ "heifs": "image/heif-sequence",
57337
+ "hej2": "image/hej2k",
57338
+ "hsj2": "image/hsj2",
57339
+ "ief": "image/ief",
57340
+ "jls": "image/jls",
57341
+ "jp2": "image/jp2",
57342
+ "jpg2": "image/jp2",
57343
+ "jpeg": "image/jpeg",
57344
+ "jpg": "image/jpeg",
57345
+ "jpe": "image/jpeg",
57346
+ "jph": "image/jph",
57347
+ "jhc": "image/jphc",
57348
+ "jpm": "image/jpm",
57349
+ "jpx": "image/jpx",
57350
+ "jpf": "image/jpx",
57351
+ "jxr": "image/jxr",
57352
+ "jxra": "image/jxra",
57353
+ "jxrs": "image/jxrs",
57354
+ "jxs": "image/jxs",
57355
+ "jxsc": "image/jxsc",
57356
+ "jxsi": "image/jxsi",
57357
+ "jxss": "image/jxss",
57358
+ "ktx": "image/ktx",
57359
+ "ktx2": "image/ktx2",
57360
+ "png": "image/png",
57361
+ "btif": "image/prs.btif",
57362
+ "pti": "image/prs.pti",
57363
+ "sgi": "image/sgi",
57364
+ "svg": "image/svg+xml",
57365
+ "svgz": "image/svg+xml",
57366
+ "t38": "image/t38",
57367
+ "tif": "image/tiff",
57368
+ "tiff": "image/tiff",
57369
+ "tfx": "image/tiff-fx",
57370
+ "webp": "image/webp",
57371
+ "wmf": "image/wmf",
57372
+ "disposition-notification": "message/disposition-notification",
57373
+ "u8msg": "message/global",
57374
+ "u8dsn": "message/global-delivery-status",
57375
+ "u8mdn": "message/global-disposition-notification",
57376
+ "u8hdr": "message/global-headers",
57377
+ "eml": "message/rfc822",
57378
+ "mime": "message/rfc822",
57379
+ "3mf": "model/3mf",
57380
+ "gltf": "model/gltf+json",
57381
+ "glb": "model/gltf-binary",
57382
+ "igs": "model/iges",
57383
+ "iges": "model/iges",
57384
+ "msh": "model/mesh",
57385
+ "mesh": "model/mesh",
57386
+ "silo": "model/mesh",
57387
+ "mtl": "model/mtl",
57388
+ "obj": "model/obj",
57389
+ "stpz": "model/step+zip",
57390
+ "stpxz": "model/step-xml+zip",
57391
+ "stl": "model/stl",
57392
+ "wrl": "model/vrml",
57393
+ "vrml": "model/vrml",
57394
+ "x3db": "model/x3d+fastinfoset",
57395
+ "x3dbz": "model/x3d+binary",
57396
+ "x3dv": "model/x3d-vrml",
57397
+ "x3dvz": "model/x3d+vrml",
57398
+ "x3d": "model/x3d+xml",
57399
+ "x3dz": "model/x3d+xml",
57400
+ "appcache": "text/cache-manifest",
57401
+ "manifest": "text/cache-manifest",
57402
+ "ics": "text/calendar",
57403
+ "ifb": "text/calendar",
57404
+ "coffee": "text/coffeescript",
57405
+ "litcoffee": "text/coffeescript",
57406
+ "css": "text/css",
57407
+ "csv": "text/csv",
57408
+ "html": "text/html",
57409
+ "htm": "text/html",
57410
+ "shtml": "text/html",
57411
+ "jade": "text/jade",
57412
+ "jsx": "text/jsx",
57413
+ "less": "text/less",
57414
+ "markdown": "text/markdown",
57415
+ "md": "text/markdown",
57416
+ "mml": "text/mathml",
57417
+ "mdx": "text/mdx",
57418
+ "n3": "text/n3",
57419
+ "txt": "text/plain",
57420
+ "text": "text/plain",
57421
+ "conf": "text/plain",
57422
+ "def": "text/plain",
57423
+ "list": "text/plain",
57424
+ "log": "text/plain",
57425
+ "in": "text/plain",
57426
+ "ini": "text/plain",
57427
+ "dsc": "text/prs.lines.tag",
57428
+ "rtx": "text/richtext",
57429
+ "sgml": "text/sgml",
57430
+ "sgm": "text/sgml",
57431
+ "shex": "text/shex",
57432
+ "slim": "text/slim",
57433
+ "slm": "text/slim",
57434
+ "spdx": "text/spdx",
57435
+ "stylus": "text/stylus",
57436
+ "styl": "text/stylus",
57437
+ "tsv": "text/tab-separated-values",
57438
+ "t": "text/troff",
57439
+ "tr": "text/troff",
57440
+ "roff": "text/troff",
57441
+ "man": "text/troff",
57442
+ "me": "text/troff",
57443
+ "ms": "text/troff",
57444
+ "ttl": "text/turtle",
57445
+ "uri": "text/uri-list",
57446
+ "uris": "text/uri-list",
57447
+ "urls": "text/uri-list",
57448
+ "vcard": "text/vcard",
57449
+ "vtt": "text/vtt",
57450
+ "yaml": "text/yaml",
57451
+ "yml": "text/yaml",
57452
+ "3gp": "video/3gpp",
57453
+ "3g2": "video/3gpp2",
57454
+ "h261": "video/h261",
57455
+ "h263": "video/h263",
57456
+ "h264": "video/h264",
57457
+ "m4s": "video/iso.segment",
57458
+ "jpgv": "video/jpeg",
57459
+ "jpgm": "image/jpm",
57460
+ "mj2": "video/mj2",
57461
+ "mjp2": "video/mj2",
57462
+ "ts": "video/mp2t",
57463
+ "mp4": "video/mp4",
57464
+ "mp4v": "video/mp4",
57465
+ "mpg4": "video/mp4",
57466
+ "mpeg": "video/mpeg",
57467
+ "mpg": "video/mpeg",
57468
+ "mpe": "video/mpeg",
57469
+ "m1v": "video/mpeg",
57470
+ "m2v": "video/mpeg",
57471
+ "ogv": "video/ogg",
57472
+ "qt": "video/quicktime",
57473
+ "mov": "video/quicktime",
57474
+ "webm": "video/webm"
57475
+ };
57476
+
57477
+ function lookup(extn) {
57478
+ let tmp = ('' + extn).trim().toLowerCase();
57479
+ let idx = tmp.lastIndexOf('.');
57480
+ return mimes[!~idx ? tmp : tmp.substring(++idx)];
57055
57481
  }
57056
57482
 
57057
- /**
57058
- * Define mimetype -> extension mappings. Each key is a mime-type that maps
57059
- * to an array of extensions associated with the type. The first extension is
57060
- * used as the default extension for the type.
57061
- *
57062
- * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
57063
- *
57064
- * If a type declares an extension that has already been defined, an error will
57065
- * be thrown. To suppress this error and force the extension to be associated
57066
- * with the new type, pass `force`=true. Alternatively, you may prefix the
57067
- * extension with "*" to map the type to extension, without mapping the
57068
- * extension to the type.
57069
- *
57070
- * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});
57071
- *
57072
- *
57073
- * @param map (Object) type definitions
57074
- * @param force (Boolean) if true, force overriding of existing definitions
57075
- */
57076
- Mime$1.prototype.define = function(typeMap, force) {
57077
- for (let type in typeMap) {
57078
- let extensions = typeMap[type].map(function(t) {
57079
- return t.toLowerCase();
57080
- });
57081
- type = type.toLowerCase();
57082
-
57083
- for (let i = 0; i < extensions.length; i++) {
57084
- const ext = extensions[i];
57085
-
57086
- // '*' prefix = not the preferred type for this extension. So fixup the
57087
- // extension, and skip it.
57088
- if (ext[0] === '*') {
57089
- continue;
57090
- }
57091
-
57092
- if (!force && (ext in this._types)) {
57093
- throw new Error(
57094
- 'Attempt to change mapping for "' + ext +
57095
- '" extension from "' + this._types[ext] + '" to "' + type +
57096
- '". Pass `force=true` to allow this, otherwise remove "' + ext +
57097
- '" from the list of extensions for "' + type + '".'
57098
- );
57099
- }
57100
-
57101
- this._types[ext] = type;
57102
- }
57103
-
57104
- // Use first extension as default
57105
- if (force || !this._extensions[type]) {
57106
- const ext = extensions[0];
57107
- this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);
57108
- }
57109
- }
57110
- };
57111
-
57112
- /**
57113
- * Lookup a mime type based on extension
57114
- */
57115
- Mime$1.prototype.getType = function(path) {
57116
- path = String(path);
57117
- let last = path.replace(/^.*[/\\]/, '').toLowerCase();
57118
- let ext = last.replace(/^.*\./, '').toLowerCase();
57119
-
57120
- let hasPath = last.length < path.length;
57121
- let hasDot = ext.length < last.length - 1;
57122
-
57123
- return (hasDot || !hasPath) && this._types[ext] || null;
57124
- };
57125
-
57126
- /**
57127
- * Return file extension associated with a mime type
57128
- */
57129
- Mime$1.prototype.getExtension = function(type) {
57130
- type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
57131
- return type && this._extensions[type.toLowerCase()] || null;
57132
- };
57133
-
57134
- var Mime_1 = Mime$1;
57135
-
57136
- var standard = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};
57137
-
57138
- let Mime = Mime_1;
57139
- var lite = new Mime(standard);
57140
-
57141
57483
  const noop$1 = () => {};
57142
57484
 
57143
57485
  function isMatch(uri, arr) {
@@ -57230,7 +57572,7 @@ const ENCODING = {
57230
57572
  function toHeaders(name, stats, isEtag) {
57231
57573
  let enc = ENCODING[name.slice(-3)];
57232
57574
 
57233
- let ctype = lite.getType(name.slice(0, enc && -3)) || '';
57575
+ let ctype = lookup(name.slice(0, enc && -3)) || '';
57234
57576
  if (ctype === 'text/html') ctype += ';charset=utf-8';
57235
57577
 
57236
57578
  let headers = {
@@ -57641,21 +57983,26 @@ function transformMiddleware(server) {
57641
57983
  // always allow vite client requests so that it can trigger page reload
57642
57984
  !((_a = req.url) === null || _a === void 0 ? void 0 : _a.startsWith(CLIENT_PUBLIC_PATH)) &&
57643
57985
  !((_b = req.url) === null || _b === void 0 ? void 0 : _b.includes('vite/dist/client'))) {
57644
- // missing dep pending reload, hold request until reload happens
57645
- server._pendingReload.then(() =>
57646
- // If the refresh has not happened after timeout, Vite considers
57647
- // something unexpected has happened. In this case, Vite
57648
- // returns an empty response that will error.
57649
- setTimeout(() => {
57986
+ try {
57987
+ // missing dep pending reload, hold request until reload happens
57988
+ await Promise.race([
57989
+ server._pendingReload,
57990
+ // If the refresh has not happened after timeout, Vite considers
57991
+ // something unexpected has happened. In this case, Vite
57992
+ // returns an empty response that will error.
57993
+ new Promise((_, reject) => setTimeout(reject, NEW_DEPENDENCY_BUILD_TIMEOUT))
57994
+ ]);
57995
+ }
57996
+ catch {
57650
57997
  // Don't do anything if response has already been sent
57651
- if (res.writableEnded)
57652
- return;
57653
- // status code request timeout
57654
- res.statusCode = 408;
57655
- res.end(`<h1>[vite] Something unexpected happened while optimizing "${req.url}"<h1>` +
57656
- `<p>The current page should have reloaded by now</p>`);
57657
- }, NEW_DEPENDENCY_BUILD_TIMEOUT));
57658
- return;
57998
+ if (!res.writableEnded) {
57999
+ // status code request timeout
58000
+ res.statusCode = 408;
58001
+ res.end(`<h1>[vite] Something unexpected happened while optimizing "${req.url}"<h1>` +
58002
+ `<p>The current page should have reloaded by now</p>`);
58003
+ }
58004
+ return;
58005
+ }
57659
58006
  }
57660
58007
  let url = decodeURI(removeTimestampQuery(req.url)).replace(NULL_BYTE_PLACEHOLDER, '\0');
57661
58008
  const withoutQuery = cleanUrl(url);
@@ -58055,7 +58402,12 @@ async function handleHMRUpdate(file, server) {
58055
58402
  // auto restart server
58056
58403
  debugHmr(`[config change] ${source.dim(shortFile)}`);
58057
58404
  config.logger.info(source.green(`${path__default.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true });
58058
- await server.restart();
58405
+ try {
58406
+ await server.restart();
58407
+ }
58408
+ catch (e) {
58409
+ config.logger.error(source.red(e));
58410
+ }
58059
58411
  return;
58060
58412
  }
58061
58413
  debugHmr(`[file change] ${source.dim(shortFile)}`);
@@ -67991,7 +68343,7 @@ function resolveServerOptions(root, raw) {
67991
68343
  async function restartServer(server) {
67992
68344
  // @ts-ignore
67993
68345
  global.__vite_start_time = perf_hooks.performance.now();
67994
- const { port } = server.config.server;
68346
+ const { port: prevPort, host: prevHost } = server.config.server;
67995
68347
  await server.close();
67996
68348
  let newServer = null;
67997
68349
  try {
@@ -68009,11 +68361,17 @@ async function restartServer(server) {
68009
68361
  server[key] = newServer[key];
68010
68362
  }
68011
68363
  }
68012
- if (!server.config.server.middlewareMode) {
68364
+ const { logger, server: { port, host, middlewareMode } } = server.config;
68365
+ if (!middlewareMode) {
68013
68366
  await server.listen(port, true);
68367
+ logger.info('server restarted.', { timestamp: true });
68368
+ if (port !== prevPort || host !== prevHost) {
68369
+ logger.info('');
68370
+ server.printUrls();
68371
+ }
68014
68372
  }
68015
68373
  else {
68016
- server.config.logger.info('server restarted.', { timestamp: true });
68374
+ logger.info('server restarted.', { timestamp: true });
68017
68375
  }
68018
68376
  }
68019
68377
 
@@ -82030,7 +82388,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
82030
82388
  }
82031
82389
  // resolve public base url
82032
82390
  const BASE_URL = resolveBaseUrl(config.base, command === 'build', logger);
82033
- const resolvedBuildOptions = resolveBuildOptions(resolvedRoot, config.build);
82391
+ const resolvedBuildOptions = resolveBuildOptions(resolvedRoot, config.build, command === 'build');
82034
82392
  // resolve cache directory
82035
82393
  const pkgPath = lookupFile(resolvedRoot, [`package.json`], true /* pathOnly */);
82036
82394
  const cacheDir = config.cacheDir
@@ -82234,10 +82592,10 @@ function resolveBaseUrl(base = '/', isBuild, logger) {
82234
82592
  }
82235
82593
  return base;
82236
82594
  }
82237
- function mergeConfigRecursively(a, b, rootPath) {
82238
- const merged = { ...a };
82239
- for (const key in b) {
82240
- const value = b[key];
82595
+ function mergeConfigRecursively(defaults, overrides, rootPath) {
82596
+ const merged = { ...defaults };
82597
+ for (const key in overrides) {
82598
+ const value = overrides[key];
82241
82599
  if (value == null) {
82242
82600
  continue;
82243
82601
  }
@@ -82268,8 +82626,8 @@ function mergeConfigRecursively(a, b, rootPath) {
82268
82626
  }
82269
82627
  return merged;
82270
82628
  }
82271
- function mergeConfig(a, b, isRoot = true) {
82272
- return mergeConfigRecursively(a, b, isRoot ? '' : '.');
82629
+ function mergeConfig(defaults, overrides, isRoot = true) {
82630
+ return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.');
82273
82631
  }
82274
82632
  function mergeAlias(a = [], b = []) {
82275
82633
  return [...normalizeAlias(a), ...normalizeAlias(b)];
@@ -82555,4 +82913,4 @@ exports.send = send$1;
82555
82913
  exports.sortUserPlugins = sortUserPlugins;
82556
82914
  exports.source = source;
82557
82915
  exports.transformWithEsbuild = transformWithEsbuild;
82558
- //# sourceMappingURL=dep-7817f5b4.js.map
82916
+ //# sourceMappingURL=dep-fcec4469.js.map