vercel 59.25.2 → 59.26.0
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.
- package/dist/chunks/{add-SAOTFJXH.js → add-7CEPFR35.js} +1 -1
- package/dist/chunks/{add-I6OSDG7H.js → add-BPO73UED.js} +1 -1
- package/dist/chunks/{add-S7UAQFMS.js → add-Q65RNNBF.js} +1 -1
- package/dist/chunks/{build-BQESAY3M.js → build-AJPBKMGK.js} +1 -1
- package/dist/chunks/{chunk-5TPZVSS5.js → chunk-3CIIAJBJ.js} +3 -3
- package/dist/chunks/{chunk-WPM4TQDF.js → chunk-3FGSIRD5.js} +1 -1
- package/dist/chunks/{chunk-N2KPEDSI.js → chunk-42C7M2DD.js} +2 -2
- package/dist/chunks/{chunk-L6PCGBYI.js → chunk-4BPSXZFF.js} +1 -1
- package/dist/chunks/{chunk-OILNJ2J2.js → chunk-5W7VRJZR.js} +1 -1
- package/dist/chunks/{chunk-TKIRQYH5.js → chunk-BPELLO6Y.js} +1 -1
- package/dist/chunks/{chunk-NO52HJTS.js → chunk-C344L5OM.js} +2 -2
- package/dist/chunks/{chunk-J43KZUZH.js → chunk-DKC2MN2N.js} +1 -1
- package/dist/chunks/{chunk-TBKDCQGQ.js → chunk-DR7AZ4XF.js} +1 -1
- package/dist/chunks/{chunk-55GJZFU7.js → chunk-I45QEFK2.js} +1 -1
- package/dist/chunks/{chunk-OBMNRGJT.js → chunk-I6YV55VE.js} +1 -1
- package/dist/chunks/{chunk-IQZ4RZCG.js → chunk-IDMLMBP2.js} +1 -1
- package/dist/chunks/chunk-JMNAVONO.js +65 -0
- package/dist/chunks/{chunk-PSLDCFUV.js → chunk-JTR6QD37.js} +1 -1
- package/dist/chunks/{chunk-Q3DGBC7N.js → chunk-K3J7NEGK.js} +1 -1
- package/dist/chunks/{chunk-HFFYL7RZ.js → chunk-KHQXR6LF.js} +1 -1
- package/dist/chunks/{chunk-DM5B3RL5.js → chunk-L4L6CGDV.js} +1 -1
- package/dist/chunks/{chunk-5RZGGOSU.js → chunk-LN7BPZIT.js} +1 -1
- package/dist/chunks/{chunk-MNN5SBQF.js → chunk-LNKUNAUP.js} +4 -4
- package/dist/chunks/{chunk-LFI3BSDC.js → chunk-NVMGCOK5.js} +1 -1
- package/dist/chunks/{chunk-IHLGZY7E.js → chunk-O5DEFRH7.js} +1 -1
- package/dist/chunks/{chunk-DRKY4FD3.js → chunk-O5Q6EC2F.js} +1 -1
- package/dist/chunks/{chunk-SIQZNFAH.js → chunk-PYLLDA3W.js} +1 -1
- package/dist/chunks/{chunk-2UN7VRFD.js → chunk-R362DOVP.js} +1 -1
- package/dist/chunks/{chunk-CJE2WOKF.js → chunk-S4NCBLV6.js} +1 -1
- package/dist/chunks/chunk-SW7MNF4H.js +7 -0
- package/dist/chunks/{chunk-ZC4LOS3A.js → chunk-T3IQ73QB.js} +1 -1
- package/dist/chunks/{chunk-ADRTPMZX.js → chunk-TXH2XVIS.js} +1 -1
- package/dist/chunks/{chunk-GTDDB5H3.js → chunk-U7NFRQBY.js} +2 -2
- package/dist/chunks/{chunk-F2YV6NXW.js → chunk-UOBYXHTU.js} +1 -1
- package/dist/chunks/{chunk-EIXOJUNN.js → chunk-UTVDFSQS.js} +1 -1
- package/dist/chunks/chunk-VHTNAYWA.js +7 -0
- package/dist/chunks/{chunk-B6RDQTJF.js → chunk-VVWALKUM.js} +1 -1
- package/dist/chunks/{chunk-IFLDELCH.js → chunk-WJ3REKMV.js} +1 -1
- package/dist/chunks/{chunk-CGUVZZE7.js → chunk-X6HQXT4J.js} +1 -1
- package/dist/chunks/{chunk-AAD7Z4WP.js → chunk-XACRGCJ7.js} +2 -2
- package/dist/chunks/{chunk-YQ2O2NIF.js → chunk-XSVY6XV7.js} +1 -1
- package/dist/chunks/{chunk-AKZOYEBP.js → chunk-YJZFFNUB.js} +4 -6
- package/dist/chunks/{chunk-QHU7NQI5.js → chunk-ZP7YHNNS.js} +1 -1
- package/dist/chunks/{clear-OLTGPRJ5.js → clear-C3BSTDH7.js} +1 -1
- package/dist/chunks/{compile-vercel-config-NKOWFZZG.js → compile-vercel-config-Y4L43MSC.js} +1 -1
- package/dist/chunks/{config-CZOTS44A.js → config-7K3UXF5F.js} +1 -1
- package/dist/chunks/{config-DF4DBQSB.js → config-AG6AKRRF.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{delete-MTZHX4LY.js → delete-IPTVXAQ4.js} +1 -1
- package/dist/chunks/{delete-5QARUXY7.js → delete-L5DES7EP.js} +1 -1
- package/dist/chunks/{detect-projects-BTDKBOU4.js → detect-projects-3AFQ2AC5.js} +1 -1
- package/dist/chunks/{detect-services-K72FCUKE.js → detect-services-TWWDUYSE.js} +1 -1
- package/dist/chunks/{disable-5PFOEZKB.js → disable-6CAAEGVC.js} +1 -1
- package/dist/chunks/{discard-XDKXFPA5.js → discard-KBDHJHJI.js} +1 -1
- package/dist/chunks/{edit-YHZH2MYH.js → edit-CXXXHULR.js} +1 -1
- package/dist/chunks/{edit-WJSAUDWF.js → edit-JFX42TEP.js} +1 -1
- package/dist/chunks/{enable-NYSTJC2H.js → enable-WTFXPBG7.js} +1 -1
- package/dist/chunks/{export-ZKT6EB42.js → export-QHA7QNTG.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-UEYQIDXM.js → generate-cert-for-deploy-QDKU7BG4.js} +1 -1
- package/dist/chunks/{image-2SK4J4O4.js → image-GYQXOH2D.js} +1 -1
- package/dist/chunks/{import-builders-UBNV7HJX.js → import-builders-PTCVQUVR.js} +1 -1
- package/dist/chunks/{inspect-DVBCOD7K.js → inspect-FAWLUVF6.js} +1 -1
- package/dist/chunks/{inspect-M6ZJQF6V.js → inspect-GBUKZRHO.js} +1 -1
- package/dist/chunks/{inspect-Y6BQY3VA.js → inspect-MVTUZPVS.js} +1 -1
- package/dist/chunks/{inspect-S6AT7LNW.js → inspect-PDJ3UMRO.js} +1 -1
- package/dist/chunks/{inspect-MCDQHBHZ.js → inspect-VZHAYHEA.js} +1 -1
- package/dist/chunks/{list-6GSMWNLA.js → list-43GDYOWL.js} +1 -1
- package/dist/chunks/{list-PPFTGAC6.js → list-G3ZNWCBU.js} +1 -1
- package/dist/chunks/{list-373ZPONO.js → list-ISVVIQE6.js} +1 -1
- package/dist/chunks/{login-RQ4VYI5A.js → login-TPFWIU2R.js} +1 -1
- package/dist/chunks/{logs-TMTBVNCC.js → logs-ZDWF5H4D.js} +1 -1
- package/dist/chunks/{ls-W7TJY3RN.js → ls-2B3TZDPF.js} +1 -1
- package/dist/chunks/{ls-MNTDNVC5.js → ls-DS57ZWXK.js} +1 -1
- package/dist/chunks/{ls-NXJRIM6O.js → ls-JOG7XQSQ.js} +1 -1
- package/dist/chunks/{ls-XYOHKCZP.js → ls-NOUO2TWU.js} +1 -1
- package/dist/chunks/{ls-X3GP2IRA.js → ls-PTJWLEMP.js} +1 -1
- package/dist/chunks/{ls-3BRR7JIX.js → ls-TQUAXPGK.js} +1 -1
- package/dist/chunks/{ls-ZVLXMLGD.js → ls-TZRZQ5V2.js} +1 -1
- package/dist/chunks/mutate-OUGXB4LW.js +9 -0
- package/dist/chunks/notifications-MWQKW7OT.js +7 -0
- package/dist/chunks/{open-6ERMTBK7.js → open-BUIBZPD2.js} +1 -1
- package/dist/chunks/{permissions-KKF5YWC3.js → permissions-ZMOA4ECQ.js} +1 -1
- package/dist/chunks/{publish-W53JMHOA.js → publish-QT5PSEWA.js} +1 -1
- package/dist/chunks/{pull-JDBB2JO5.js → pull-5MDAB4PI.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-RHJZ6U72.js → purchase-domain-if-available-4U6OO6HV.js} +1 -1
- package/dist/chunks/{push-DLROWCQ4.js → push-DVUYKBOH.js} +1 -1
- package/dist/chunks/{query-R2OKVWWT.js → query-T5VANB2N.js} +1 -1
- package/dist/chunks/{reorder-YD4ENV5L.js → reorder-UGIUH3VH.js} +1 -1
- package/dist/chunks/{reply-TCDHRSGG.js → reply-YP2M4ATZ.js} +1 -1
- package/dist/chunks/{resolve-ZEC456YB.js → resolve-6RR7C4XZ.js} +1 -1
- package/dist/chunks/{restore-RH6YGGXG.js → restore-YTC3XRMJ.js} +1 -1
- package/dist/chunks/{rm-G6EOLSCZ.js → rm-I2HO26QU.js} +1 -1
- package/dist/chunks/{rm-PCTYRCOB.js → rm-LJIDHUSA.js} +1 -1
- package/dist/chunks/{rm-3M5ADIDW.js → rm-PUBG4Y4A.js} +1 -1
- package/dist/chunks/{rm-SHCFLXHI.js → rm-QDLJEXJO.js} +1 -1
- package/dist/chunks/{rm-UGEBIUFV.js → rm-YCO5JQT7.js} +1 -1
- package/dist/chunks/{rule-inspect-TED7H6MG.js → rule-inspect-2GVHRJU4.js} +1 -1
- package/dist/chunks/{rules-DGGA3QHB.js → rules-NWRB7QGL.js} +1 -1
- package/dist/chunks/{schema-22D2HKSJ.js → schema-AKPM5RZI.js} +1 -1
- package/dist/chunks/{schema-H6XU3F2A.js → schema-T5YNYHEL.js} +1 -1
- package/dist/chunks/{set-7UAH7RCL.js → set-72D2UDIU.js} +1 -1
- package/dist/chunks/{setup-and-link-NHQPSPPZ.js → setup-and-link-AUDIANQN.js} +1 -1
- package/dist/chunks/{tags-OYKSDCSO.js → tags-OU23UWEL.js} +1 -1
- package/dist/chunks/{update-OIQ44IMN.js → update-4553CPRC.js} +1 -1
- package/dist/chunks/vlt-builder-importer-6DGKK72W.js +11 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/dev/index.js +13 -13
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +9 -9
- package/dist/index.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +53 -53
- package/dist/chunks/chunk-OAKO6LVS.js +0 -7
- package/dist/chunks/chunk-QRBAWXHP.js +0 -65
- package/dist/chunks/chunk-YSN4YTUY.js +0 -7
- package/dist/chunks/mutate-QJREWJEH.js +0 -9
- package/dist/chunks/notifications-D57XNFN2.js +0 -7
- package/dist/chunks/vlt-builder-importer-YVCYYRVV.js +0 -11
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{displayDetectedServices,readConfig,setupAndLink}from"../../chunks/chunk-ADRTPMZX.js";import{tryDetectServices}from"../../chunks/chunk-OBMNRGJT.js";import"../../chunks/chunk-B6RDQTJF.js";import{import_write_build_result,require_detect_builders_with_services,require_get_files,require_mime_types,require_service_schedules}from"../../chunks/chunk-ZC4LOS3A.js";import{importBuilders,require_npa}from"../../chunks/chunk-NO52HJTS.js";import"../../chunks/chunk-CJPM2DXZ.js";import"../../chunks/chunk-7RR7MIMT.js";import"../../chunks/chunk-QHJLRTVY.js";import{require_fast_deep_equal}from"../../chunks/chunk-4MZK6JT6.js";import"../../chunks/chunk-3B4P7YHO.js";import{getUpdateCommand}from"../../chunks/chunk-DRKY4FD3.js";import"../../chunks/chunk-KKS7XWEX.js";import{readJSONFile}from"../../chunks/chunk-5RZGGOSU.js";import"../../chunks/chunk-DM5B3RL5.js";import"../../chunks/chunk-XQQGQ55A.js";import"../../chunks/chunk-2H77IRPI.js";import{pickOverrides,require_dist as require_dist5}from"../../chunks/chunk-N2KPEDSI.js";import"../../chunks/chunk-OHDEHZLX.js";import"../../chunks/chunk-M2W3HKV3.js";import"../../chunks/chunk-PHW54NU5.js";import"../../chunks/chunk-V6MR45PD.js";import"../../chunks/chunk-HWWHR7H3.js";import"../../chunks/chunk-2I64AYHG.js";import{require_ms}from"../../chunks/chunk-QTKJC2O5.js";import{promptExperimentalServicesMigration}from"../../chunks/chunk-WPM4TQDF.js";import{validateConfig}from"../../chunks/chunk-YSN4YTUY.js";import{require_brace_expansion,require_dist as require_dist3,require_dist2 as require_dist4,require_minimatch}from"../../chunks/chunk-QRBAWXHP.js";import{require_main}from"../../chunks/chunk-IQZ4RZCG.js";import"../../chunks/chunk-P2O5DOYE.js";import{require_inherits}from"../../chunks/chunk-L3JDEHCQ.js";import{VERCEL_OIDC_TOKEN,pullEnvRecords}from"../../chunks/chunk-CJE2WOKF.js";import"../../chunks/chunk-HFFYL7RZ.js";import"../../chunks/chunk-H4FTGLWV.js";import"../../chunks/chunk-ULLWCOYC.js";import{require_json_parse_better_errors}from"../../chunks/chunk-N6CNMMSZ.js";import"../../chunks/chunk-I46LFJJG.js";import{getSubcommand}from"../../chunks/chunk-ETV3C2CV.js";import"../../chunks/chunk-OI263FBO.js";import"../../chunks/chunk-QHU7NQI5.js";import{printProjectNotFoundError}from"../../chunks/chunk-IFLDELCH.js";import"../../chunks/chunk-T4LZS75P.js";import{require_frameworks}from"../../chunks/chunk-KK4AJES5.js";import{DEV_QUEUE_API_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_QUEUE_PROXY_PREFIX,DEV_RESOURCE_TOKEN,DEV_RUNTIME_CACHE_DEFAULT_PORT,devCommand,getDevQueueEnv,isValidDevResourceHost,listenOnDevResourcePort}from"../../chunks/chunk-AZ6NRDHG.js";import{require_dist as require_dist2}from"../../chunks/chunk-FAW6NBLQ.js";import"../../chunks/chunk-KUVMCIR4.js";import"../../chunks/chunk-SOJCELXH.js";import{param}from"../../chunks/chunk-SXUEGVWB.js";import"../../chunks/chunk-6BZCSVH6.js";import{help}from"../../chunks/chunk-V6IKQCOT.js";import"../../chunks/chunk-6TAQ6OWD.js";import"../../chunks/chunk-R3B67TKQ.js";import"../../chunks/chunk-C5KVTG2O.js";import"../../chunks/chunk-6NPXWN5F.js";import"../../chunks/chunk-WPS6JZF6.js";import{detectExplicitScope,getLocalPathConfig,highlight}from"../../chunks/chunk-OILNJ2J2.js";import{getGlobalPathConfig}from"../../chunks/chunk-JSKGZLE4.js";import{TelemetryClient}from"../../chunks/chunk-A5VLP25I.js";import"../../chunks/chunk-RCTYVKM5.js";import{isNativeBinaryInstall}from"../../chunks/chunk-7T6TL3GQ.js";import"../../chunks/chunk-GHM7V3GG.js";import"../../chunks/chunk-5XJNPXQK.js";import{printError}from"../../chunks/chunk-N5AIKGEO.js";import{parseArguments}from"../../chunks/chunk-WWB66KP5.js";import{directFetch}from"../../chunks/chunk-MY4MONOH.js";import{VERCEL_DIR,findRepoRoot,getLinkedProject,getVercelDirectory,require_lib,require_pluralize,resolveProjectCwd}from"../../chunks/chunk-5TPZVSS5.js";import"../../chunks/chunk-F2ZWW2IO.js";import"../../chunks/chunk-B4ATVYZW.js";import"../../chunks/chunk-PPCFQQSU.js";import"../../chunks/chunk-BRK4OB4B.js";import"../../chunks/chunk-OSCCYU74.js";import{buildCommandWithYes,outputActionRequired}from"../../chunks/chunk-KCARCOP5.js";import"../../chunks/chunk-BKV35LVB.js";import{getFlagsSpecification}from"../../chunks/chunk-JAJW3P42.js";import{printAlignedLabel}from"../../chunks/chunk-YMM3VY3J.js";import"../../chunks/chunk-SM5JI6QM.js";import"../../chunks/chunk-VOZEB6PD.js";import{CantParseJSONFile,LambdaSizeExceededError,MissingDotenvVarsError,NowError,require_bytes}from"../../chunks/chunk-RINZXCDJ.js";import{cmd,getCommandName,getCommandNamePlain,getTitleName}from"../../chunks/chunk-FI772UVH.js";import{Diagnostic,defineDiagnostics,link_default,output_manager_default,require_build_utils}from"../../chunks/chunk-EWWFNMPZ.js";import{require_dist}from"../../chunks/chunk-QGIQK47P.js";import{pkg_default}from"../../chunks/chunk-AVSPFBLM.js";import"../../chunks/chunk-XCJDGQO7.js";import"../../chunks/chunk-YPTLSODC.js";import"../../chunks/chunk-7HL2RPUO.js";import{require_source}from"../../chunks/chunk-U7KCDTCH.js";import{require_supports_color}from"../../chunks/chunk-N3ZZ7FHQ.js";import"../../chunks/chunk-GU6VIFR5.js";import{__commonJS,__require,__toESM}from"../../chunks/chunk-6L236MNA.js";var require_bytes2=__commonJS({"../../node_modules/.pnpm/bytes@3.1.0/node_modules/bytes/index.js"(exports2,module2){"use strict";module2.exports=bytes2;module2.exports.format=format;module2.exports.parse=parse2;var formatThousandsRegExp=/\B(?=(\d{3})+(?!\d))/g,formatDecimalsRegExp=/(?:\.0*|(\.[^0]+)0+)$/,map={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},parseRegExp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bytes2(value,options){return typeof value=="string"?parse2(value):typeof value=="number"?format(value,options):null}function format(value,options){if(!Number.isFinite(value))return null;var mag=Math.abs(value),thousandsSeparator=options&&options.thousandsSeparator||"",unitSeparator=options&&options.unitSeparator||"",decimalPlaces=options&&options.decimalPlaces!==void 0?options.decimalPlaces:2,fixedDecimals=!!(options&&options.fixedDecimals),unit=options&&options.unit||"";(!unit||!map[unit.toLowerCase()])&&(mag>=map.pb?unit="PB":mag>=map.tb?unit="TB":mag>=map.gb?unit="GB":mag>=map.mb?unit="MB":mag>=map.kb?unit="KB":unit="B");var val=value/map[unit.toLowerCase()],str=val.toFixed(decimalPlaces);return fixedDecimals||(str=str.replace(formatDecimalsRegExp,"$1")),thousandsSeparator&&(str=str.replace(formatThousandsRegExp,thousandsSeparator)),str+unitSeparator+unit}function parse2(val){if(typeof val=="number"&&!isNaN(val))return val;if(typeof val!="string")return null;var results=parseRegExp.exec(val),floatValue,unit="b";return results?(floatValue=parseFloat(results[1]),unit=results[4].toLowerCase()):(floatValue=parseInt(val,10),unit="b"),Math.floor(map[unit]*floatValue)}}});var require_callsite_tostring=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/callsite-tostring.js"(exports2,module2){"use strict";module2.exports=callSiteToString2;function callSiteFileLocation(callSite){var fileName,fileLocation="";if(callSite.isNative()?fileLocation="native":callSite.isEval()?(fileName=callSite.getScriptNameOrSourceURL(),fileName||(fileLocation=callSite.getEvalOrigin())):fileName=callSite.getFileName(),fileName){fileLocation+=fileName;var lineNumber=callSite.getLineNumber();if(lineNumber!=null){fileLocation+=":"+lineNumber;var columnNumber=callSite.getColumnNumber();columnNumber&&(fileLocation+=":"+columnNumber)}}return fileLocation||"unknown source"}function callSiteToString2(callSite){var addSuffix=!0,fileLocation=callSiteFileLocation(callSite),functionName=callSite.getFunctionName(),isConstructor=callSite.isConstructor(),isMethodCall=!(callSite.isToplevel()||isConstructor),line="";if(isMethodCall){var methodName=callSite.getMethodName(),typeName=getConstructorName(callSite);functionName?(typeName&&functionName.indexOf(typeName)!==0&&(line+=typeName+"."),line+=functionName,methodName&&functionName.lastIndexOf("."+methodName)!==functionName.length-methodName.length-1&&(line+=" [as "+methodName+"]")):line+=typeName+"."+(methodName||"<anonymous>")}else isConstructor?line+="new "+(functionName||"<anonymous>"):functionName?line+=functionName:(addSuffix=!1,line+=fileLocation);return addSuffix&&(line+=" ("+fileLocation+")"),line}function getConstructorName(obj){var receiver=obj.receiver;return receiver.constructor&&receiver.constructor.name||null}}});var require_event_listener_count=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/event-listener-count.js"(exports2,module2){"use strict";module2.exports=eventListenerCount2;function eventListenerCount2(emitter,type){return emitter.listeners(type).length}}});var require_compat=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/index.js"(exports2,module2){"use strict";var EventEmitter=__require("events").EventEmitter;lazyProperty(module2.exports,"callSiteToString",function(){var limit=Error.stackTraceLimit,obj={},prep=Error.prepareStackTrace;function prepareObjectStackTrace2(obj2,stack3){return stack3}Error.prepareStackTrace=prepareObjectStackTrace2,Error.stackTraceLimit=2,Error.captureStackTrace(obj);var stack2=obj.stack.slice();return Error.prepareStackTrace=prep,Error.stackTraceLimit=limit,stack2[0].toString?toString:require_callsite_tostring()});lazyProperty(module2.exports,"eventListenerCount",function(){return EventEmitter.listenerCount||require_event_listener_count()});function lazyProperty(obj,prop,getter){function get(){var val=getter();return Object.defineProperty(obj,prop,{configurable:!0,enumerable:!0,value:val}),val}Object.defineProperty(obj,prop,{configurable:!0,enumerable:!0,get})}function toString(obj){return obj.toString()}}});var require_depd=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/index.js"(exports,module){var callSiteToString=require_compat().callSiteToString,eventListenerCount=require_compat().eventListenerCount,relative=__require("path").relative;module.exports=depd;var basePath=process.cwd();function containsNamespace(str,namespace){for(var vals=str.split(/[ ,]+/),ns=String(namespace).toLowerCase(),i=0;i<vals.length;i++){var val=vals[i];if(val&&(val==="*"||val.toLowerCase()===ns))return!0}return!1}function convertDataDescriptorToAccessor(obj,prop,message2){var descriptor=Object.getOwnPropertyDescriptor(obj,prop),value=descriptor.value;return descriptor.get=function(){return value},descriptor.writable&&(descriptor.set=function(val){return value=val}),delete descriptor.value,delete descriptor.writable,Object.defineProperty(obj,prop,descriptor),descriptor}function createArgumentsString(arity){for(var str="",i=0;i<arity;i++)str+=", arg"+i;return str.substr(2)}function createStackString(stack2){var str=this.name+": "+this.namespace;this.message&&(str+=" deprecated "+this.message);for(var i=0;i<stack2.length;i++)str+=`
|
|
7
|
+
import{displayDetectedServices,readConfig,setupAndLink}from"../../chunks/chunk-TXH2XVIS.js";import{tryDetectServices}from"../../chunks/chunk-I6YV55VE.js";import"../../chunks/chunk-VVWALKUM.js";import{import_write_build_result,require_detect_builders_with_services,require_get_files,require_mime_types,require_service_schedules}from"../../chunks/chunk-T3IQ73QB.js";import{importBuilders,require_npa}from"../../chunks/chunk-C344L5OM.js";import"../../chunks/chunk-CJPM2DXZ.js";import"../../chunks/chunk-7RR7MIMT.js";import"../../chunks/chunk-QHJLRTVY.js";import{require_fast_deep_equal}from"../../chunks/chunk-4MZK6JT6.js";import"../../chunks/chunk-3B4P7YHO.js";import{getUpdateCommand}from"../../chunks/chunk-O5Q6EC2F.js";import"../../chunks/chunk-KKS7XWEX.js";import{readJSONFile}from"../../chunks/chunk-LN7BPZIT.js";import"../../chunks/chunk-L4L6CGDV.js";import"../../chunks/chunk-XQQGQ55A.js";import"../../chunks/chunk-2H77IRPI.js";import{pickOverrides,require_dist as require_dist5}from"../../chunks/chunk-42C7M2DD.js";import"../../chunks/chunk-OHDEHZLX.js";import"../../chunks/chunk-M2W3HKV3.js";import"../../chunks/chunk-PHW54NU5.js";import"../../chunks/chunk-V6MR45PD.js";import"../../chunks/chunk-HWWHR7H3.js";import"../../chunks/chunk-2I64AYHG.js";import{require_ms}from"../../chunks/chunk-QTKJC2O5.js";import{promptExperimentalServicesMigration}from"../../chunks/chunk-3FGSIRD5.js";import{validateConfig}from"../../chunks/chunk-VHTNAYWA.js";import{require_brace_expansion,require_dist as require_dist3,require_dist2 as require_dist4,require_minimatch}from"../../chunks/chunk-JMNAVONO.js";import{require_main}from"../../chunks/chunk-IDMLMBP2.js";import"../../chunks/chunk-P2O5DOYE.js";import{require_inherits}from"../../chunks/chunk-L3JDEHCQ.js";import{VERCEL_OIDC_TOKEN,pullEnvRecords}from"../../chunks/chunk-S4NCBLV6.js";import"../../chunks/chunk-KHQXR6LF.js";import"../../chunks/chunk-H4FTGLWV.js";import"../../chunks/chunk-ULLWCOYC.js";import{require_json_parse_better_errors}from"../../chunks/chunk-N6CNMMSZ.js";import"../../chunks/chunk-I46LFJJG.js";import{getSubcommand}from"../../chunks/chunk-ETV3C2CV.js";import"../../chunks/chunk-OI263FBO.js";import"../../chunks/chunk-ZP7YHNNS.js";import{printProjectNotFoundError}from"../../chunks/chunk-WJ3REKMV.js";import"../../chunks/chunk-T4LZS75P.js";import{require_frameworks}from"../../chunks/chunk-KK4AJES5.js";import{DEV_QUEUE_API_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_QUEUE_PROXY_PREFIX,DEV_RESOURCE_TOKEN,DEV_RUNTIME_CACHE_DEFAULT_PORT,devCommand,getDevQueueEnv,isValidDevResourceHost,listenOnDevResourcePort}from"../../chunks/chunk-AZ6NRDHG.js";import{require_dist as require_dist2}from"../../chunks/chunk-FAW6NBLQ.js";import"../../chunks/chunk-KUVMCIR4.js";import"../../chunks/chunk-SOJCELXH.js";import{param}from"../../chunks/chunk-SXUEGVWB.js";import"../../chunks/chunk-6BZCSVH6.js";import{help}from"../../chunks/chunk-V6IKQCOT.js";import"../../chunks/chunk-6TAQ6OWD.js";import"../../chunks/chunk-R3B67TKQ.js";import"../../chunks/chunk-C5KVTG2O.js";import"../../chunks/chunk-6NPXWN5F.js";import"../../chunks/chunk-WPS6JZF6.js";import{detectExplicitScope,getLocalPathConfig,highlight}from"../../chunks/chunk-5W7VRJZR.js";import{getGlobalPathConfig}from"../../chunks/chunk-JSKGZLE4.js";import{TelemetryClient}from"../../chunks/chunk-A5VLP25I.js";import"../../chunks/chunk-RCTYVKM5.js";import{isNativeBinaryInstall}from"../../chunks/chunk-7T6TL3GQ.js";import"../../chunks/chunk-GHM7V3GG.js";import"../../chunks/chunk-5XJNPXQK.js";import{printError}from"../../chunks/chunk-N5AIKGEO.js";import{parseArguments}from"../../chunks/chunk-WWB66KP5.js";import{directFetch}from"../../chunks/chunk-MY4MONOH.js";import{VERCEL_DIR,findRepoRoot,getLinkedProject,getVercelDirectory,require_lib,require_pluralize,resolveProjectCwd}from"../../chunks/chunk-3CIIAJBJ.js";import"../../chunks/chunk-F2ZWW2IO.js";import"../../chunks/chunk-B4ATVYZW.js";import"../../chunks/chunk-PPCFQQSU.js";import"../../chunks/chunk-BRK4OB4B.js";import"../../chunks/chunk-OSCCYU74.js";import{buildCommandWithYes,outputActionRequired}from"../../chunks/chunk-KCARCOP5.js";import"../../chunks/chunk-BKV35LVB.js";import{getFlagsSpecification}from"../../chunks/chunk-JAJW3P42.js";import{printAlignedLabel}from"../../chunks/chunk-YMM3VY3J.js";import"../../chunks/chunk-SM5JI6QM.js";import"../../chunks/chunk-VOZEB6PD.js";import{CantParseJSONFile,LambdaSizeExceededError,MissingDotenvVarsError,NowError,require_bytes}from"../../chunks/chunk-RINZXCDJ.js";import{cmd,getCommandName,getCommandNamePlain,getTitleName}from"../../chunks/chunk-FI772UVH.js";import{Diagnostic,defineDiagnostics,link_default,output_manager_default,require_build_utils}from"../../chunks/chunk-EWWFNMPZ.js";import{require_dist}from"../../chunks/chunk-QGIQK47P.js";import{pkg_default}from"../../chunks/chunk-AVSPFBLM.js";import"../../chunks/chunk-XCJDGQO7.js";import"../../chunks/chunk-YPTLSODC.js";import"../../chunks/chunk-7HL2RPUO.js";import{require_source}from"../../chunks/chunk-U7KCDTCH.js";import{require_supports_color}from"../../chunks/chunk-N3ZZ7FHQ.js";import"../../chunks/chunk-GU6VIFR5.js";import{__commonJS,__require,__toESM}from"../../chunks/chunk-6L236MNA.js";var require_bytes2=__commonJS({"../../node_modules/.pnpm/bytes@3.1.0/node_modules/bytes/index.js"(exports2,module2){"use strict";module2.exports=bytes2;module2.exports.format=format;module2.exports.parse=parse2;var formatThousandsRegExp=/\B(?=(\d{3})+(?!\d))/g,formatDecimalsRegExp=/(?:\.0*|(\.[^0]+)0+)$/,map={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},parseRegExp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bytes2(value,options){return typeof value=="string"?parse2(value):typeof value=="number"?format(value,options):null}function format(value,options){if(!Number.isFinite(value))return null;var mag=Math.abs(value),thousandsSeparator=options&&options.thousandsSeparator||"",unitSeparator=options&&options.unitSeparator||"",decimalPlaces=options&&options.decimalPlaces!==void 0?options.decimalPlaces:2,fixedDecimals=!!(options&&options.fixedDecimals),unit=options&&options.unit||"";(!unit||!map[unit.toLowerCase()])&&(mag>=map.pb?unit="PB":mag>=map.tb?unit="TB":mag>=map.gb?unit="GB":mag>=map.mb?unit="MB":mag>=map.kb?unit="KB":unit="B");var val=value/map[unit.toLowerCase()],str=val.toFixed(decimalPlaces);return fixedDecimals||(str=str.replace(formatDecimalsRegExp,"$1")),thousandsSeparator&&(str=str.replace(formatThousandsRegExp,thousandsSeparator)),str+unitSeparator+unit}function parse2(val){if(typeof val=="number"&&!isNaN(val))return val;if(typeof val!="string")return null;var results=parseRegExp.exec(val),floatValue,unit="b";return results?(floatValue=parseFloat(results[1]),unit=results[4].toLowerCase()):(floatValue=parseInt(val,10),unit="b"),Math.floor(map[unit]*floatValue)}}});var require_callsite_tostring=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/callsite-tostring.js"(exports2,module2){"use strict";module2.exports=callSiteToString2;function callSiteFileLocation(callSite){var fileName,fileLocation="";if(callSite.isNative()?fileLocation="native":callSite.isEval()?(fileName=callSite.getScriptNameOrSourceURL(),fileName||(fileLocation=callSite.getEvalOrigin())):fileName=callSite.getFileName(),fileName){fileLocation+=fileName;var lineNumber=callSite.getLineNumber();if(lineNumber!=null){fileLocation+=":"+lineNumber;var columnNumber=callSite.getColumnNumber();columnNumber&&(fileLocation+=":"+columnNumber)}}return fileLocation||"unknown source"}function callSiteToString2(callSite){var addSuffix=!0,fileLocation=callSiteFileLocation(callSite),functionName=callSite.getFunctionName(),isConstructor=callSite.isConstructor(),isMethodCall=!(callSite.isToplevel()||isConstructor),line="";if(isMethodCall){var methodName=callSite.getMethodName(),typeName=getConstructorName(callSite);functionName?(typeName&&functionName.indexOf(typeName)!==0&&(line+=typeName+"."),line+=functionName,methodName&&functionName.lastIndexOf("."+methodName)!==functionName.length-methodName.length-1&&(line+=" [as "+methodName+"]")):line+=typeName+"."+(methodName||"<anonymous>")}else isConstructor?line+="new "+(functionName||"<anonymous>"):functionName?line+=functionName:(addSuffix=!1,line+=fileLocation);return addSuffix&&(line+=" ("+fileLocation+")"),line}function getConstructorName(obj){var receiver=obj.receiver;return receiver.constructor&&receiver.constructor.name||null}}});var require_event_listener_count=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/event-listener-count.js"(exports2,module2){"use strict";module2.exports=eventListenerCount2;function eventListenerCount2(emitter,type){return emitter.listeners(type).length}}});var require_compat=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/index.js"(exports2,module2){"use strict";var EventEmitter=__require("events").EventEmitter;lazyProperty(module2.exports,"callSiteToString",function(){var limit=Error.stackTraceLimit,obj={},prep=Error.prepareStackTrace;function prepareObjectStackTrace2(obj2,stack3){return stack3}Error.prepareStackTrace=prepareObjectStackTrace2,Error.stackTraceLimit=2,Error.captureStackTrace(obj);var stack2=obj.stack.slice();return Error.prepareStackTrace=prep,Error.stackTraceLimit=limit,stack2[0].toString?toString:require_callsite_tostring()});lazyProperty(module2.exports,"eventListenerCount",function(){return EventEmitter.listenerCount||require_event_listener_count()});function lazyProperty(obj,prop,getter){function get(){var val=getter();return Object.defineProperty(obj,prop,{configurable:!0,enumerable:!0,value:val}),val}Object.defineProperty(obj,prop,{configurable:!0,enumerable:!0,get})}function toString(obj){return obj.toString()}}});var require_depd=__commonJS({"../../node_modules/.pnpm/depd@1.1.2/node_modules/depd/index.js"(exports,module){var callSiteToString=require_compat().callSiteToString,eventListenerCount=require_compat().eventListenerCount,relative=__require("path").relative;module.exports=depd;var basePath=process.cwd();function containsNamespace(str,namespace){for(var vals=str.split(/[ ,]+/),ns=String(namespace).toLowerCase(),i=0;i<vals.length;i++){var val=vals[i];if(val&&(val==="*"||val.toLowerCase()===ns))return!0}return!1}function convertDataDescriptorToAccessor(obj,prop,message2){var descriptor=Object.getOwnPropertyDescriptor(obj,prop),value=descriptor.value;return descriptor.get=function(){return value},descriptor.writable&&(descriptor.set=function(val){return value=val}),delete descriptor.value,delete descriptor.writable,Object.defineProperty(obj,prop,descriptor),descriptor}function createArgumentsString(arity){for(var str="",i=0;i<arity;i++)str+=", arg"+i;return str.substr(2)}function createStackString(stack2){var str=this.name+": "+this.namespace;this.message&&(str+=" deprecated "+this.message);for(var i=0;i<stack2.length;i++)str+=`
|
|
8
8
|
at `+callSiteToString(stack2[i]);return str}function depd(namespace){if(!namespace)throw new TypeError("argument namespace is required");var stack2=getStack(),site2=callSiteLocation(stack2[1]),file=site2[0];function deprecate2(message2){log.call(deprecate2,message2)}return deprecate2._file=file,deprecate2._ignored=isignored(namespace),deprecate2._namespace=namespace,deprecate2._traced=istraced(namespace),deprecate2._warned=Object.create(null),deprecate2.function=wrapfunction,deprecate2.property=wrapproperty,deprecate2}function isignored(namespace){if(process.noDeprecation)return!0;var str=process.env.NO_DEPRECATION||"";return containsNamespace(str,namespace)}function istraced(namespace){if(process.traceDeprecation)return!0;var str=process.env.TRACE_DEPRECATION||"";return containsNamespace(str,namespace)}function log(message2,site2){var haslisteners=eventListenerCount(process,"deprecation")!==0;if(!(!haslisteners&&this._ignored)){var caller,callFile,callSite,depSite,i=0,seen=!1,stack2=getStack(),file=this._file;for(site2?(depSite=site2,callSite=callSiteLocation(stack2[1]),callSite.name=depSite.name,file=callSite[0]):(i=2,depSite=callSiteLocation(stack2[i]),callSite=depSite);i<stack2.length;i++)if(caller=callSiteLocation(stack2[i]),callFile=caller[0],callFile===file)seen=!0;else if(callFile===this._file)file=this._file;else if(seen)break;var key=caller?depSite.join(":")+"__"+caller.join(":"):void 0;if(!(key!==void 0&&key in this._warned)){this._warned[key]=!0;var msg=message2;if(msg||(msg=callSite===depSite||!callSite.name?defaultMessage(depSite):defaultMessage(callSite)),haslisteners){var err=DeprecationError(this._namespace,msg,stack2.slice(i));process.emit("deprecation",err);return}var format=process.stderr.isTTY?formatColor:formatPlain,output=format.call(this,msg,caller,stack2.slice(i));process.stderr.write(output+`
|
|
9
9
|
`,"utf8")}}}function callSiteLocation(callSite){var file=callSite.getFileName()||"<anonymous>",line=callSite.getLineNumber(),colm=callSite.getColumnNumber();callSite.isEval()&&(file=callSite.getEvalOrigin()+", "+file);var site2=[file,line,colm];return site2.callSite=callSite,site2.name=callSite.getFunctionName(),site2}function defaultMessage(site2){var callSite=site2.callSite,funcName=site2.name;funcName||(funcName="<anonymous@"+formatLocation(site2)+">");var context=callSite.getThis(),typeName=context&&callSite.getTypeName();return typeName==="Object"&&(typeName=void 0),typeName==="Function"&&(typeName=context.name||typeName),typeName&&callSite.getMethodName()?typeName+"."+funcName:funcName}function formatPlain(msg,caller,stack2){var timestamp=new Date().toUTCString(),formatted=timestamp+" "+this._namespace+" deprecated "+msg;if(this._traced){for(var i=0;i<stack2.length;i++)formatted+=`
|
|
10
10
|
at `+callSiteToString(stack2[i]);return formatted}return caller&&(formatted+=" at "+formatLocation(caller)),formatted}function formatColor(msg,caller,stack2){var formatted="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+msg+"\x1B[39m";if(this._traced){for(var i=0;i<stack2.length;i++)formatted+=`
|
|
@@ -26,18 +26,18 @@ return fn.apply(this, arguments)
|
|
|
26
26
|
\r
|
|
27
27
|
`};common.setupSocket(socket),head&&head.length&&socket.unshift(head);var proxyReq=(common.isSSL.test(options.target.protocol)?https:http2).request(common.setupOutgoing(options.ssl||{},options,req));return server&&server.emit("proxyReqWs",proxyReq,req,socket,options,head),proxyReq.on("error",onOutgoingError),proxyReq.on("response",function(res){res.upgrade||(socket.write(createHttpHeader("HTTP/"+res.httpVersion+" "+res.statusCode+" "+res.statusMessage,res.headers)),res.pipe(socket))}),proxyReq.on("upgrade",function(proxyRes,proxySocket,proxyHead){proxySocket.on("error",onOutgoingError),proxySocket.on("end",function(){server.emit("close",proxyRes,proxySocket,proxyHead)}),socket.on("error",function(){proxySocket.destroy()}),common.setupSocket(proxySocket),proxyHead&&proxyHead.length&&proxySocket.unshift(proxyHead),socket.write(createHttpHeader("HTTP/1.1 101 Switching Protocols",proxyRes.headers)),proxySocket.pipe(socket).pipe(proxySocket),server.emit("open",proxySocket),server.emit("proxySocket",proxySocket)}),proxyReq.end();function onOutgoingError(err){clb?clb(err,req,socket):server.emit("error",err,req,socket),socket.end()}}}}});var require_http_proxy=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy/index.js"(exports2,module2){var httpProxy2=module2.exports,extend=Object.assign,parse_url=__require("url").parse,EE3=require_eventemitter3(),http2=__require("http"),https=__require("https"),web=require_web_incoming(),ws=require_ws_incoming();httpProxy2.Server=ProxyServer;function createRightProxy(type){return function(options){return function(req,res){var passes=type==="ws"?this.wsPasses:this.webPasses,args2=[].slice.call(arguments),cntr=args2.length-1,head,cbl;typeof args2[cntr]=="function"&&(cbl=args2[cntr],cntr--);var requestOptions=options;if(!(args2[cntr]instanceof Buffer)&&args2[cntr]!==res&&(requestOptions=extend({},options),extend(requestOptions,args2[cntr]),cntr--),args2[cntr]instanceof Buffer&&(head=args2[cntr]),["target","forward"].forEach(function(e){typeof requestOptions[e]=="string"&&(requestOptions[e]=parse_url(requestOptions[e]))}),!requestOptions.target&&!requestOptions.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var i=0;i<passes.length&&!passes[i](req,res,requestOptions,head,this,cbl);i++);}}}httpProxy2.createRightProxy=createRightProxy;function ProxyServer(options){EE3.call(this),options=options||{},options.prependPath=options.prependPath!==!1,this.web=this.proxyRequest=createRightProxy("web")(options),this.ws=this.proxyWebsocketRequest=createRightProxy("ws")(options),this.options=options,this.webPasses=Object.keys(web).map(function(pass){return web[pass]}),this.wsPasses=Object.keys(ws).map(function(pass){return ws[pass]}),this.on("error",this.onError,this)}__require("util").inherits(ProxyServer,EE3);ProxyServer.prototype.onError=function(err){if(this.listeners("error").length===1)throw err};ProxyServer.prototype.listen=function(port,hostname){var self=this,closure=function(req,res){self.web(req,res)};return this._server=this.options.ssl?https.createServer(this.options.ssl,closure):http2.createServer(closure),this.options.ws&&this._server.on("upgrade",function(req,socket,head){self.ws(req,socket,head)}),this._server.listen(port,hostname),this};ProxyServer.prototype.close=function(callback){var self=this;this._server&&this._server.close(done);function done(){self._server=null,callback&&callback.apply(null,arguments)}};ProxyServer.prototype.before=function(type,passName,callback){if(type!=="ws"&&type!=="web")throw new Error("type must be `web` or `ws`");var passes=type==="ws"?this.wsPasses:this.webPasses,i=!1;if(passes.forEach(function(v,idx){v.name===passName&&(i=idx)}),i===!1)throw new Error("No such pass");passes.splice(i,0,callback)};ProxyServer.prototype.after=function(type,passName,callback){if(type!=="ws"&&type!=="web")throw new Error("type must be `web` or `ws`");var passes=type==="ws"?this.wsPasses:this.webPasses,i=!1;if(passes.forEach(function(v,idx){v.name===passName&&(i=idx)}),i===!1)throw new Error("No such pass");passes.splice(i++,0,callback)}}});var require_http_proxy2=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/lib/http-proxy.js"(exports2,module2){var ProxyServer=require_http_proxy().Server;function createProxyServer(options){return new ProxyServer(options)}ProxyServer.createProxyServer=createProxyServer;ProxyServer.createServer=createProxyServer;ProxyServer.createProxy=createProxyServer;module2.exports=ProxyServer}});var require_http_proxy_node16=__commonJS({"../../node_modules/.pnpm/http-proxy-node16@1.0.6_debug@3.1.0/node_modules/http-proxy-node16/index.js"(exports2,module2){module2.exports=require_http_proxy2()}});var require_urlparser=__commonJS({"../../node_modules/.pnpm/fast-url-parser@1.1.3/node_modules/fast-url-parser/src/urlparser.js"(exports2,module2){"use strict";function Url(){this._protocol=null,this._href="",this._port=-1,this._query=null,this.auth=null,this.slashes=null,this.host=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null,this._prependSlash=!1}var querystring=__require("querystring");Url.queryString=querystring;Url.prototype.parse=function(str,parseQueryString2,hostDenotesSlash,disableAutoEscapeChars){if(typeof str!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof str);for(var start=0,end=str.length-1;str.charCodeAt(start)<=32;)start++;for(;str.charCodeAt(end)<=32;)end--;if(start=this._parseProtocol(str,start,end),this._protocol!=="javascript"){start=this._parseHost(str,start,end,hostDenotesSlash);var proto=this._protocol;!this.hostname&&(this.slashes||proto&&!slashProtocols[proto])&&(this.hostname=this.host="")}if(start<=end){var ch=str.charCodeAt(start);ch===47||ch===92?this._parsePath(str,start,end,disableAutoEscapeChars):ch===63?this._parseQuery(str,start,end,disableAutoEscapeChars):ch===35?this._parseHash(str,start,end,disableAutoEscapeChars):this._protocol!=="javascript"?this._parsePath(str,start,end,disableAutoEscapeChars):this.pathname=str.slice(start,end+1)}if(!this.pathname&&this.hostname&&this._slashProtocols[this._protocol]&&(this.pathname="/"),parseQueryString2){var search=this.search;search==null&&(search=this.search=""),search.charCodeAt(0)===63&&(search=search.slice(1)),this.query=Url.queryString.parse(search)}};Url.prototype.resolve=function(relative4){return this.resolveObject(Url.parse(relative4,!1,!0)).format()};Url.prototype.format=function(){var auth=this.auth||"";auth&&(auth=encodeURIComponent(auth),auth=auth.replace(/%3A/i,":"),auth+="@");var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",search=this.search||"",query="",hostname=this.hostname||"",port=this.port||"",host=!1,scheme="",q=this.query;if(q&&typeof q=="object"&&(query=Url.queryString.stringify(q)),search||(search=query?"?"+query:""),protocol&&protocol.charCodeAt(protocol.length-1)!==58&&(protocol+=":"),this.host)host=auth+this.host;else if(hostname){var ip6=hostname.indexOf(":")>-1;ip6&&(hostname="["+hostname+"]"),host=auth+hostname+(port?":"+port:"")}var slashes=this.slashes||(!protocol||slashProtocols[protocol])&&host!==!1;return protocol?scheme=protocol+(slashes?"//":""):slashes&&(scheme="//"),slashes&&pathname&&pathname.charCodeAt(0)!==47&&(pathname="/"+pathname),search&&search.charCodeAt(0)!==63&&(search="?"+search),hash&&hash.charCodeAt(0)!==35&&(hash="#"+hash),pathname=escapePathName(pathname),search=escapeSearch(search),scheme+(host===!1?"":host)+pathname+search+hash};Url.prototype.resolveObject=function(relative4){typeof relative4=="string"&&(relative4=Url.parse(relative4,!1,!0));var result=this._clone();if(result.hash=relative4.hash,!relative4.href)return result._href="",result;if(relative4.slashes&&!relative4._protocol)return relative4._copyPropsTo(result,!0),slashProtocols[result._protocol]&&result.hostname&&!result.pathname&&(result.pathname="/"),result._href="",result;if(relative4._protocol&&relative4._protocol!==result._protocol){if(!slashProtocols[relative4._protocol])return relative4._copyPropsTo(result,!1),result._href="",result;if(result._protocol=relative4._protocol,!relative4.host&&relative4._protocol!=="javascript"){for(var relPath=(relative4.pathname||"").split("/");relPath.length&&!(relative4.host=relPath.shift()););relative4.host||(relative4.host=""),relative4.hostname||(relative4.hostname=""),relPath[0]!==""&&relPath.unshift(""),relPath.length<2&&relPath.unshift(""),result.pathname=relPath.join("/")}else result.pathname=relative4.pathname;return result.search=relative4.search,result.host=relative4.host||"",result.auth=relative4.auth,result.hostname=relative4.hostname||relative4.host,result._port=relative4._port,result.slashes=result.slashes||relative4.slashes,result._href="",result}var isSourceAbs=result.pathname&&result.pathname.charCodeAt(0)===47,isRelAbs=relative4.host||relative4.pathname&&relative4.pathname.charCodeAt(0)===47,mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative4.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split("/")||[],relPath=relative4.pathname&&relative4.pathname.split("/")||[],psychotic=result._protocol&&!slashProtocols[result._protocol];if(psychotic&&(result.hostname="",result._port=-1,result.host&&(srcPath[0]===""?srcPath[0]=result.host:srcPath.unshift(result.host)),result.host="",relative4._protocol&&(relative4.hostname="",relative4._port=-1,relative4.host&&(relPath[0]===""?relPath[0]=relative4.host:relPath.unshift(relative4.host)),relative4.host=""),mustEndAbs=mustEndAbs&&(relPath[0]===""||srcPath[0]==="")),isRelAbs)result.host=relative4.host?relative4.host:result.host,result.hostname=relative4.hostname?relative4.hostname:result.hostname,result.search=relative4.search,srcPath=relPath;else if(relPath.length)srcPath||(srcPath=[]),srcPath.pop(),srcPath=srcPath.concat(relPath),result.search=relative4.search;else if(relative4.search){if(psychotic){result.hostname=result.host=srcPath.shift();var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative4.search,result._href="",result}if(!srcPath.length)return result.pathname=null,result._href="",result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative4.host)&&(last==="."||last==="..")||last==="",up=0,i2=srcPath.length;i2>=0;i2--)last=srcPath[i2],last==="."?srcPath.splice(i2,1):last===".."?(srcPath.splice(i2,1),up++):up&&(srcPath.splice(i2,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charCodeAt(0)!==47)&&srcPath.unshift(""),hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"&&srcPath.push("");var isAbsolute4=srcPath[0]===""||srcPath[0]&&srcPath[0].charCodeAt(0)===47;if(psychotic){result.hostname=result.host=isAbsolute4?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute4&&srcPath.unshift(""),result.pathname=srcPath.length===0?null:srcPath.join("/"),result.auth=relative4.auth||result.auth,result.slashes=result.slashes||relative4.slashes,result._href="",result};var punycode=__require("punycode");Url.prototype._hostIdna=function(hostname){return punycode.toASCII(hostname)};var escapePathName=Url.prototype._escapePathName=function(pathname){return containsCharacter2(pathname,35,63)?_escapePath(pathname):pathname},escapeSearch=Url.prototype._escapeSearch=function(search){return containsCharacter2(search,35,-1)?_escapeSearch(search):search};Url.prototype._parseProtocol=function(str,start,end){for(var doLowerCase=!1,protocolCharacters=this._protocolCharacters,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===58){var protocol=str.slice(start,i2);return doLowerCase&&(protocol=protocol.toLowerCase()),this._protocol=protocol,i2+1}else if(protocolCharacters[ch]===1)ch<97&&(doLowerCase=!0);else return start}return start};Url.prototype._parseAuth=function(str,start,end,decode){var auth=str.slice(start,end+1);decode&&(auth=decodeURIComponent(auth)),this.auth=auth};Url.prototype._parsePort=function(str,start,end){for(var port=0,hadChars=!1,validPort=!0,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(48<=ch&&ch<=57)port=10*port+(ch-48),hadChars=!0;else{validPort=!1,(ch===92||ch===47)&&(validPort=!0);break}}return port===0&&!hadChars||!validPort?(validPort||(this._port=-2),0):(this._port=port,i2-start)};Url.prototype._parseHost=function(str,start,end,slashesDenoteHost){var hostEndingCharacters=this._hostEndingCharacters,first=str.charCodeAt(start),second=str.charCodeAt(start+1);if((first===47||first===92)&&(second===47||second===92)){if(this.slashes=!0,start===0){if(end<2)return start;var hasAuth=containsCharacter(str,64,2,hostEndingCharacters);if(!hasAuth&&!slashesDenoteHost)return this.slashes=null,start}start+=2}else if(!this._protocol||slashProtocols[this._protocol])return start;for(var doLowerCase=!1,idna=!1,hostNameStart=start,hostNameEnd=end,lastCh=-1,portLength=0,charsAfterDot=0,authNeedsDecoding=!1,j=-1,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===64)j=i2;else if(ch===37)authNeedsDecoding=!0;else if(hostEndingCharacters[ch]===1)break}if(j>-1&&(this._parseAuth(str,start,j-1,authNeedsDecoding),start=hostNameStart=j+1),str.charCodeAt(start)===91){for(var i2=start+1;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===93){str.charCodeAt(i2+1)===58&&(portLength=this._parsePort(str,i2+2,end)+1);var hostname=str.slice(start+1,i2).toLowerCase();return this.hostname=hostname,this.host=this._port>0?"["+hostname+"]:"+this._port:"["+hostname+"]",this.pathname="/",i2+portLength+1}}return start}for(var i2=start;i2<=end;++i2){if(charsAfterDot>62)return this.hostname=this.host=str.slice(start,i2),i2;var ch=str.charCodeAt(i2);if(ch===58){portLength=this._parsePort(str,i2+1,end)+1,hostNameEnd=i2-1;break}else if(ch<97){if(ch===46)charsAfterDot=-1;else if(65<=ch&&ch<=90)doLowerCase=!0;else if(!(ch===45||ch===95||ch===43||48<=ch&&ch<=57)){hostEndingCharacters[ch]===0&&this._noPrependSlashHostEnders[ch]===0&&(this._prependSlash=!0),hostNameEnd=i2-1;break}}else if(ch>=123){if(ch<=126){this._noPrependSlashHostEnders[ch]===0&&(this._prependSlash=!0),hostNameEnd=i2-1;break}idna=!0}lastCh=ch,charsAfterDot++}if(hostNameEnd+1!==start&&hostNameEnd-hostNameStart<=256){var hostname=str.slice(hostNameStart,hostNameEnd+1);doLowerCase&&(hostname=hostname.toLowerCase()),idna&&(hostname=this._hostIdna(hostname)),this.hostname=hostname,this.host=this._port>0?hostname+":"+this._port:hostname}return hostNameEnd+1+portLength};Url.prototype._copyPropsTo=function(input,noProtocol){noProtocol||(input._protocol=this._protocol),input._href=this._href,input._port=this._port,input._prependSlash=this._prependSlash,input.auth=this.auth,input.slashes=this.slashes,input.host=this.host,input.hostname=this.hostname,input.hash=this.hash,input.search=this.search,input.pathname=this.pathname};Url.prototype._clone=function(){var ret=new Url;return ret._protocol=this._protocol,ret._href=this._href,ret._port=this._port,ret._prependSlash=this._prependSlash,ret.auth=this.auth,ret.slashes=this.slashes,ret.host=this.host,ret.hostname=this.hostname,ret.hash=this.hash,ret.search=this.search,ret.pathname=this.pathname,ret};Url.prototype._getComponentEscaped=function(str,start,end,isAfterQuery){for(var cur=start,i2=start,ret="",autoEscapeMap2=isAfterQuery?this._afterQueryAutoEscapeMap:this._autoEscapeMap;i2<=end;++i2){var ch=str.charCodeAt(i2),escaped=autoEscapeMap2[ch];escaped!==""&&escaped!==void 0&&(cur<i2&&(ret+=str.slice(cur,i2)),ret+=escaped,cur=i2+1)}return cur<i2+1&&(ret+=str.slice(cur,i2)),ret};Url.prototype._parsePath=function(str,start,end,disableAutoEscapeChars){for(var pathStart=start,pathEnd=end,escape2=!1,autoEscapeCharacters=this._autoEscapeCharacters,prePath=this._port===-2?"/:":"",i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===35){this._parseHash(str,i2,end,disableAutoEscapeChars),pathEnd=i2-1;break}else if(ch===63){this._parseQuery(str,i2,end,disableAutoEscapeChars),pathEnd=i2-1;break}else!disableAutoEscapeChars&&!escape2&&autoEscapeCharacters[ch]===1&&(escape2=!0)}if(pathStart>pathEnd){this.pathname=prePath===""?"/":prePath;return}var path6;escape2?path6=this._getComponentEscaped(str,pathStart,pathEnd,!1):path6=str.slice(pathStart,pathEnd+1),this.pathname=prePath===""?this._prependSlash?"/"+path6:path6:prePath+path6};Url.prototype._parseQuery=function(str,start,end,disableAutoEscapeChars){for(var queryStart=start,queryEnd=end,escape2=!1,autoEscapeCharacters=this._autoEscapeCharacters,i2=start;i2<=end;++i2){var ch=str.charCodeAt(i2);if(ch===35){this._parseHash(str,i2,end,disableAutoEscapeChars),queryEnd=i2-1;break}else!disableAutoEscapeChars&&!escape2&&autoEscapeCharacters[ch]===1&&(escape2=!0)}if(queryStart>queryEnd){this.search="";return}var query;escape2?query=this._getComponentEscaped(str,queryStart,queryEnd,!0):query=str.slice(queryStart,queryEnd+1),this.search=query};Url.prototype._parseHash=function(str,start,end,disableAutoEscapeChars){if(start>end){this.hash="";return}this.hash=disableAutoEscapeChars?str.slice(start,end+1):this._getComponentEscaped(str,start,end,!0)};Object.defineProperty(Url.prototype,"port",{get:function(){return this._port>=0?""+this._port:null},set:function(v){v==null?this._port=-1:this._port=parseInt(v,10)}});Object.defineProperty(Url.prototype,"query",{get:function(){var query=this._query;if(query!=null)return query;var search=this.search;return search&&(search.charCodeAt(0)===63&&(search=search.slice(1)),search!=="")&&(this._query=search),search},set:function(v){this._query=v}});Object.defineProperty(Url.prototype,"path",{get:function(){var p=this.pathname||"",s=this.search||"";return p||s?p+s:p==null&&s?"/"+s:null},set:function(){}});Object.defineProperty(Url.prototype,"protocol",{get:function(){var proto=this._protocol;return proto&&proto+":"},set:function(v){if(typeof v=="string"){var end=v.length-1;v.charCodeAt(end)===58?this._protocol=v.slice(0,end):this._protocol=v}else v==null&&(this._protocol=null)}});Object.defineProperty(Url.prototype,"href",{get:function(){var href=this._href;return href||(href=this._href=this.format()),href},set:function(v){this._href=v}});Url.parse=function(str,parseQueryString2,hostDenotesSlash,disableAutoEscapeChars){if(str instanceof Url)return str;var ret=new Url;return ret.parse(str,!!parseQueryString2,!!hostDenotesSlash,!!disableAutoEscapeChars),ret};Url.format=function(obj){return typeof obj=="string"&&(obj=Url.parse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)};Url.resolve=function(source,relative4){return Url.parse(source,!1,!0).resolve(relative4)};Url.resolveObject=function(source,relative4){return source?Url.parse(source,!1,!0).resolveObject(relative4):relative4};function _escapePath(pathname){return pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match)})}function _escapeSearch(search){return search.replace(/#/g,function(match){return encodeURIComponent(match)})}function containsCharacter(string,char1,fromIndex,stopCharacterTable){for(var len2=string.length,i2=fromIndex;i2<len2;++i2){var ch=string.charCodeAt(i2);if(ch===char1)return!0;if(stopCharacterTable[ch]===1)return!1}return!1}function containsCharacter2(string,char1,char2){for(var i2=0,len2=string.length;i2<len2;++i2){var ch=string.charCodeAt(i2);if(ch===char1||ch===char2)return!0}return!1}function makeAsciiTable(spec){var ret=new Uint8Array(128);return spec.forEach(function(item){if(typeof item=="number")ret[item]=1;else for(var start=item[0],end=item[1],j=start;j<=end;++j)ret[j]=1}),ret}var autoEscape=["<",">",'"',"`"," ","\r",`
|
|
28
28
|
`," ","{","}","|","\\","^","`","'"],autoEscapeMap=new Array(128);for(i=0,len=autoEscapeMap.length;i<len;++i)autoEscapeMap[i]="";var i,len;for(i=0,len=autoEscape.length;i<len;++i)c=autoEscape[i],esc=encodeURIComponent(c),esc===c&&(esc=escape(c)),autoEscapeMap[c.charCodeAt(0)]=esc;var c,esc,i,len,afterQueryAutoEscapeMap=autoEscapeMap.slice();autoEscapeMap[92]="/";var slashProtocols=Url.prototype._slashProtocols={http:!0,https:!0,gopher:!0,file:!0,ftp:!0,"http:":!0,"https:":!0,"gopher:":!0,"file:":!0,"ftp:":!0};function f(){}f.prototype=slashProtocols;Url.prototype._protocolCharacters=makeAsciiTable([[97,122],[65,90],46,43,45]);Url.prototype._hostEndingCharacters=makeAsciiTable([35,63,47,92]);Url.prototype._autoEscapeCharacters=makeAsciiTable(autoEscape.map(function(v){return v.charCodeAt(0)}));Url.prototype._noPrependSlashHostEnders=makeAsciiTable(["<",">","'","`"," ","\r",`
|
|
29
|
-
`," ","{","}","|","^","`",'"',"%",";"].map(function(v){return v.charCodeAt(0)}));Url.prototype._autoEscapeMap=autoEscapeMap;Url.prototype._afterQueryAutoEscapeMap=afterQueryAutoEscapeMap;module2.exports=Url;Url.replace=function(){__require.cache.url={exports:Url}}}});var require_glob_slash=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/glob-slash.js"(exports2,module2){var path6=__require("path"),normalize2=value=>path6.posix.normalize(path6.posix.join("/",value));module2.exports=value=>value.charAt(0)==="!"?`!${normalize2(value.substr(1))}`:normalize2(value);module2.exports.normalize=normalize2}});var require_minimatch2=__commonJS({"../../node_modules/.pnpm/minimatch@3.0.4/node_modules/minimatch/minimatch.js"(exports2,module2){module2.exports=
|
|
30
|
-
%s`,tail,tail,pl,re);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=!0,re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar(),escaping&&(re+="\\\\");var addPatternStart=!1;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=!0}for(var n=negativeLists.length-1;n>-1;n--){var nl=negativeLists[n],nlBefore=re.slice(0,nl.reStart),nlFirst=re.slice(nl.reStart,nl.reEnd-8),nlLast=re.slice(nl.reEnd-8,nl.reEnd),nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1,cleanAfter=nlAfter;for(i=0;i<openParensBefore;i++)cleanAfter=cleanAfter.replace(/\)[+*?]?/,"");nlAfter=cleanAfter;var dollar="";nlAfter===""&&isSub!==SUBPARSE&&(dollar="$");var newRe=nlBefore+nlFirst+nlAfter+dollar+nlLast;re=newRe}if(re!==""&&hasMagic&&(re="(?=.)"+re),addPatternStart&&(re=patternStart+re),isSub===SUBPARSE)return[re,hasMagic];if(!hasMagic)return globUnescape(pattern);var flags=options.nocase?"i":"";try{var regExp=new RegExp("^"+re+"$",flags)}catch{return new RegExp("$.")}return regExp._glob=pattern,regExp._src=re,regExp}
|
|
29
|
+
`," ","{","}","|","^","`",'"',"%",";"].map(function(v){return v.charCodeAt(0)}));Url.prototype._autoEscapeMap=autoEscapeMap;Url.prototype._afterQueryAutoEscapeMap=afterQueryAutoEscapeMap;module2.exports=Url;Url.replace=function(){__require.cache.url={exports:Url}}}});var require_glob_slash=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/glob-slash.js"(exports2,module2){var path6=__require("path"),normalize2=value=>path6.posix.normalize(path6.posix.join("/",value));module2.exports=value=>value.charAt(0)==="!"?`!${normalize2(value.substr(1))}`:normalize2(value);module2.exports.normalize=normalize2}});var require_minimatch2=__commonJS({"../../node_modules/.pnpm/minimatch@3.0.4/node_modules/minimatch/minimatch.js"(exports2,module2){module2.exports=minimatch4;minimatch4.Minimatch=Minimatch;var path6={sep:"/"};try{path6=__require("path")}catch{}var GLOBSTAR=minimatch4.GLOBSTAR=Minimatch.GLOBSTAR={},expand=require_brace_expansion(),plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){return set[c]=!0,set},{})}var slashSplit=/\/+/;minimatch4.filter=filter;function filter(pattern,options){return options=options||{},function(p,i,list){return minimatch4(p,pattern,options)}}function ext(a,b){a=a||{},b=b||{};var t={};return Object.keys(b).forEach(function(k){t[k]=b[k]}),Object.keys(a).forEach(function(k){t[k]=a[k]}),t}minimatch4.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch4;var orig=minimatch4,m=function(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};return m.Minimatch=function(pattern,options){return new orig.Minimatch(pattern,ext(def,options))},m};Minimatch.defaults=function(def){return!def||!Object.keys(def).length?Minimatch:minimatch4.defaults(def).Minimatch};function minimatch4(p,pattern,options){if(typeof pattern!="string")throw new TypeError("glob pattern string required");return options||(options={}),!options.nocomment&&pattern.charAt(0)==="#"?!1:pattern.trim()===""?p==="":new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch))return new Minimatch(pattern,options);if(typeof pattern!="string")throw new TypeError("glob pattern string required");options||(options={}),pattern=pattern.trim(),path6.sep!=="/"&&(pattern=pattern.split(path6.sep).join("/")),this.options=options,this.set=[],this.pattern=pattern,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(!this._made){var pattern=this.pattern,options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=!0;return}if(!pattern){this.empty=!0;return}this.parseNegate();var set=this.globSet=this.braceExpand();options.debug&&(this.debug=console.error),this.debug(this.pattern,set),set=this.globParts=set.map(function(s){return s.split(slashSplit)}),this.debug(this.pattern,set),set=set.map(function(s,si,set2){return s.map(this.parse,this)},this),this.debug(this.pattern,set),set=set.filter(function(s){return s.indexOf(!1)===-1}),this.debug(this.pattern,set),this.set=set}}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=!1,options=this.options,negateOffset=0;if(!options.nonegate){for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++)negate=!negate,negateOffset++;negateOffset&&(this.pattern=pattern.substr(negateOffset)),this.negate=negate}}minimatch4.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(options||(this instanceof Minimatch?options=this.options:options={}),pattern=typeof pattern>"u"?this.pattern:pattern,typeof pattern>"u")throw new TypeError("undefined pattern");return options.nobrace||!pattern.match(/\{.*\}/)?[pattern]:expand(pattern)}Minimatch.prototype.parse=parse2;var SUBPARSE={};function parse2(pattern,isSub){if(pattern.length>1024*64)throw new TypeError("pattern is too long");var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=!1,patternListStack=[],negativeLists=[],stateChar,inClass=!1,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star,hasMagic=!0;break;case"?":re+=qmark,hasMagic=!0;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re),stateChar=!1}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){if(this.debug("%s %s %s %j",pattern,i,re,c),escaping&&reSpecials[c]){re+="\\"+c,escaping=!1;continue}switch(c){case"/":return!1;case"\\":clearStateChar(),escaping=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c),inClass){this.debug(" in class"),c==="!"&&i===classStart+1&&(c="^"),re+=c;continue}self.debug("call clearStateChar %j",stateChar),clearStateChar(),stateChar=c,options.noext&&clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close}),re+=stateChar==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",stateChar,re),stateChar=!1;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar(),hasMagic=!0;var pl=patternListStack.pop();re+=pl.close,pl.type==="!"&&negativeLists.push(pl),pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|",escaping=!1;continue}clearStateChar(),re+="|";continue;case"[":if(clearStateChar(),inClass){re+="\\"+c;continue}inClass=!0,classStart=i,reClassStart=re.length,re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c,escaping=!1;continue}if(inClass){var cs=pattern.substring(classStart+1,i);try{RegExp("["+cs+"]")}catch{var sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]",hasMagic=hasMagic||sp[1],inClass=!1;continue}}hasMagic=!0,inClass=!1,re+=c;continue;default:clearStateChar(),escaping?escaping=!1:reSpecials[c]&&!(c==="^"&&inClass)&&(re+="\\"),re+=c}}for(inClass&&(cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0],hasMagic=hasMagic||sp[1]),pl=patternListStack.pop();pl;pl=patternListStack.pop()){var tail=re.slice(pl.reStart+pl.open.length);this.debug("setting tail",re,pl),tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(_,$1,$2){return $2||($2="\\"),$1+$1+$2+"|"}),this.debug(`tail=%j
|
|
30
|
+
%s`,tail,tail,pl,re);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=!0,re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar(),escaping&&(re+="\\\\");var addPatternStart=!1;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=!0}for(var n=negativeLists.length-1;n>-1;n--){var nl=negativeLists[n],nlBefore=re.slice(0,nl.reStart),nlFirst=re.slice(nl.reStart,nl.reEnd-8),nlLast=re.slice(nl.reEnd-8,nl.reEnd),nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1,cleanAfter=nlAfter;for(i=0;i<openParensBefore;i++)cleanAfter=cleanAfter.replace(/\)[+*?]?/,"");nlAfter=cleanAfter;var dollar="";nlAfter===""&&isSub!==SUBPARSE&&(dollar="$");var newRe=nlBefore+nlFirst+nlAfter+dollar+nlLast;re=newRe}if(re!==""&&hasMagic&&(re="(?=.)"+re),addPatternStart&&(re=patternStart+re),isSub===SUBPARSE)return[re,hasMagic];if(!hasMagic)return globUnescape(pattern);var flags=options.nocase?"i":"";try{var regExp=new RegExp("^"+re+"$",flags)}catch{return new RegExp("$.")}return regExp._glob=pattern,regExp._src=re,regExp}minimatch4.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;var set=this.set;if(!set.length)return this.regexp=!1,this.regexp;var options=this.options,twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"",re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p=="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$",this.negate&&(re="^(?!"+re+").*$");try{this.regexp=new RegExp(re,flags)}catch{this.regexp=!1}return this.regexp}minimatch4.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);return list=list.filter(function(f){return mm.match(f)}),mm.options.nonull&&!list.length&&list.push(pattern),list};Minimatch.prototype.match=match;function match(f,partial){if(this.debug("match",f,this.pattern),this.comment)return!1;if(this.empty)return f==="";if(f==="/"&&partial)return!0;var options=this.options;path6.sep!=="/"&&(f=f.split(path6.sep).join("/")),f=f.split(slashSplit),this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename,i;for(i=f.length-1;i>=0&&(filename=f[i],!filename);i--);for(i=0;i<set.length;i++){var pattern=set[i],file=f;options.matchBase&&pattern.length===1&&(file=[filename]);var hit=this.matchOne(file,pattern,partial);if(hit)return options.flipNegate?!0:!this.negate}return options.flipNegate?!1:this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{this:this,file,pattern}),this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];if(this.debug(pattern,p,f),p===!1)return!1;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){for(this.debug("** at the end");fi<fl;fi++)if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return!1;return!0}for(;fr<fl;){var swallowee=file[fr];if(this.debug(`
|
|
31
31
|
globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),pattern.slice(pr),partial))return this.debug("globstar found match!",fr,fl,swallowee),!0;if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue"),fr++}return!!(partial&&(this.debug(`
|
|
32
|
-
>>> no match, partial?`,file,fr,pattern,pr),fr===fl))}var hit;if(typeof p=="string"?(options.nocase?hit=f.toLowerCase()===p.toLowerCase():hit=f===p,this.debug("string match",p,f,hit)):(hit=f.match(p),this.debug("pattern match",p,f,hit)),!hit)return!1}if(fi===fl&&pi===pl)return!0;if(fi===fl)return partial;if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}});var require_path_to_regexp=__commonJS({"../../node_modules/.pnpm/path-to-regexp@2.2.1/node_modules/path-to-regexp/index.js"(exports2,module2){module2.exports=pathToRegexp;module2.exports.parse=parse2;module2.exports.compile=compile;module2.exports.tokensToFunction=tokensToFunction;module2.exports.tokensToRegExp=tokensToRegExp;var DEFAULT_DELIMITER="/",DEFAULT_DELIMITERS="./",PATH_REGEXP=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function parse2(str,options){for(var tokens=[],key=0,index=0,path6="",defaultDelimiter=options&&options.delimiter||DEFAULT_DELIMITER,delimiters=options&&options.delimiters||DEFAULT_DELIMITERS,pathEscaped=!1,res;(res=PATH_REGEXP.exec(str))!==null;){var m=res[0],escaped=res[1],offset=res.index;if(path6+=str.slice(index,offset),index=offset+m.length,escaped){path6+=escaped[1],pathEscaped=!0;continue}var prev="",next=str[index],name=res[2],capture=res[3],group=res[4],modifier=res[5];if(!pathEscaped&&path6.length){var k=path6.length-1;delimiters.indexOf(path6[k])>-1&&(prev=path6[k],path6=path6.slice(0,k))}path6&&(tokens.push(path6),path6="",pathEscaped=!1);var partial=prev!==""&&next!==void 0&&next!==prev,repeat=modifier==="+"||modifier==="*",optional=modifier==="?"||modifier==="*",delimiter2=prev||defaultDelimiter,pattern=capture||group;tokens.push({name:name||key++,prefix:prev,delimiter:delimiter2,optional,repeat,partial,pattern:pattern?escapeGroup(pattern):"[^"+escapeString(delimiter2)+"]+?"})}return(path6||index<str.length)&&tokens.push(path6+str.substr(index)),tokens}function compile(str,options){return tokensToFunction(parse2(str,options))}function tokensToFunction(tokens){for(var matches=new Array(tokens.length),i=0;i<tokens.length;i++)typeof tokens[i]=="object"&&(matches[i]=new RegExp("^(?:"+tokens[i].pattern+")$"));return function(data,options){for(var path6="",encode=options&&options.encode||encodeURIComponent,i2=0;i2<tokens.length;i2++){var token=tokens[i2];if(typeof token=="string"){path6+=token;continue}var value=data?data[token.name]:void 0,segment;if(Array.isArray(value)){if(!token.repeat)throw new TypeError('Expected "'+token.name+'" to not repeat, but got array');if(value.length===0){if(token.optional)continue;throw new TypeError('Expected "'+token.name+'" to not be empty')}for(var j=0;j<value.length;j++){if(segment=encode(value[j],token),!matches[i2].test(segment))throw new TypeError('Expected all "'+token.name+'" to match "'+token.pattern+'"');path6+=(j===0?token.prefix:token.delimiter)+segment}continue}if(typeof value=="string"||typeof value=="number"||typeof value=="boolean"){if(segment=encode(String(value),token),!matches[i2].test(segment))throw new TypeError('Expected "'+token.name+'" to match "'+token.pattern+'", but got "'+segment+'"');path6+=token.prefix+segment;continue}if(token.optional){token.partial&&(path6+=token.prefix);continue}throw new TypeError('Expected "'+token.name+'" to be '+(token.repeat?"an array":"a string"))}return path6}}function escapeString(str){return str.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function escapeGroup(group){return group.replace(/([=!:$/()])/g,"\\$1")}function flags(options){return options&&options.sensitive?"":"i"}function regexpToRegexp(path6,keys){if(!keys)return path6;var groups=path6.source.match(/\((?!\?)/g);if(groups)for(var i=0;i<groups.length;i++)keys.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return path6}function arrayToRegexp(path6,keys,options){for(var parts=[],i=0;i<path6.length;i++)parts.push(pathToRegexp(path6[i],keys,options).source);return new RegExp("(?:"+parts.join("|")+")",flags(options))}function stringToRegexp(path6,keys,options){return tokensToRegExp(parse2(path6,options),keys,options)}function tokensToRegExp(tokens,keys,options){options=options||{};for(var strict=options.strict,end=options.end!==!1,delimiter2=escapeString(options.delimiter||DEFAULT_DELIMITER),delimiters=options.delimiters||DEFAULT_DELIMITERS,endsWith=[].concat(options.endsWith||[]).map(escapeString).concat("$").join("|"),route="",isEndDelimited=tokens.length===0,i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token=="string")route+=escapeString(token),isEndDelimited=i===tokens.length-1&&delimiters.indexOf(token[token.length-1])>-1;else{var prefix=escapeString(token.prefix),capture=token.repeat?"(?:"+token.pattern+")(?:"+prefix+"(?:"+token.pattern+"))*":token.pattern;keys&&keys.push(token),token.optional?token.partial?route+=prefix+"("+capture+")?":route+="(?:"+prefix+"("+capture+"))?":route+=prefix+"("+capture+")"}}return end?(strict||(route+="(?:"+delimiter2+")?"),route+=endsWith==="$"?"$":"(?="+endsWith+")"):(strict||(route+="(?:"+delimiter2+"(?="+endsWith+"))?"),isEndDelimited||(route+="(?="+delimiter2+"|"+endsWith+")")),new RegExp("^"+route,flags(options))}function pathToRegexp(path6,keys,options){return path6 instanceof RegExp?regexpToRegexp(path6,keys):Array.isArray(path6)?arrayToRegexp(path6,keys,options):stringToRegexp(path6,keys,options)}}});var require_db=__commonJS({"../../node_modules/.pnpm/mime-db@1.33.0/node_modules/mime-db/db.json"(exports2,module2){module2.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana"},"application/3gpp-ims+xml":{source:"iana"},"application/a2l":{source:"iana"},"application/activemessage":{source:"iana"},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana"},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",extensions:["atomsvc"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana"},"application/bacnet-xdd+zip":{source:"iana"},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana"},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana"},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/cbor":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana"},"application/ccxml+xml":{source:"iana",extensions:["ccxml"]},"application/cdfx+xml":{source:"iana"},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana"},"application/cellml+xml":{source:"iana"},"application/cfw":{source:"iana"},"application/clue_info+xml":{source:"iana"},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana"},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana"},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana"},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana"},"application/cstadata+xml":{source:"iana"},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",extensions:["mpd"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana"},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana"},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/docbook+xml":{source:"apache",extensions:["dbk"]},"application/dskpp+xml":{source:"iana"},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/emergencycalldata.comment+xml":{source:"iana"},"application/emergencycalldata.control+xml":{source:"iana"},"application/emergencycalldata.deviceinfo+xml":{source:"iana"},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana"},"application/emergencycalldata.serviceinfo+xml":{source:"iana"},"application/emergencycalldata.subscriberinfo+xml":{source:"iana"},"application/emergencycalldata.veds+xml":{source:"iana"},"application/emma+xml":{source:"iana",extensions:["emma"]},"application/emotionml+xml":{source:"iana"},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana"},"application/epub+zip":{source:"iana",extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana"},"application/fhir+xml":{source:"iana"},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1,extensions:["woff"]},"application/framework-attributes+xml":{source:"iana"},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geoxacml+xml":{source:"iana"},"application/gml+xml":{source:"iana",extensions:["gml"]},"application/gpx+xml":{source:"apache",extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana"},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana"},"application/ibe-pkg-reply+xml":{source:"iana"},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana"},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana"},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana"},"application/kpml-response+xml":{source:"iana"},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana"},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana"},"application/lost+xml":{source:"iana",extensions:["lostxml"]},"application/lostsync+xml":{source:"iana"},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",extensions:["mads"]},"application/manifest+json":{charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",extensions:["mathml"]},"application/mathml-content+xml":{source:"iana"},"application/mathml-presentation+xml":{source:"iana"},"application/mbms-associated-procedure-description+xml":{source:"iana"},"application/mbms-deregister+xml":{source:"iana"},"application/mbms-envelope+xml":{source:"iana"},"application/mbms-msk+xml":{source:"iana"},"application/mbms-msk-response+xml":{source:"iana"},"application/mbms-protection-description+xml":{source:"iana"},"application/mbms-reception-report+xml":{source:"iana"},"application/mbms-register+xml":{source:"iana"},"application/mbms-register-response+xml":{source:"iana"},"application/mbms-schedule+xml":{source:"iana"},"application/mbms-user-service-description+xml":{source:"iana"},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana"},"application/media_control+xml":{source:"iana"},"application/mediaservercontrol+xml":{source:"iana",extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",extensions:["metalink"]},"application/metalink4+xml":{source:"iana",extensions:["meta4"]},"application/mets+xml":{source:"iana",extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mmt-usd+xml":{source:"iana"},"application/mods+xml":{source:"iana",extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana"},"application/mrb-publish+xml":{source:"iana"},"application/msc-ivr+xml":{source:"iana"},"application/msc-mixer+xml":{source:"iana"},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana"},"application/n-triples":{source:"iana"},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana"},"application/news-groupinfo":{source:"iana"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana"},"application/node":{source:"iana"},"application/nss":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p2p-overlay+xml":{source:"iana"},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana"},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana"},"application/pidf-diff+xml":{source:"iana"},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",extensions:["pls"]},"application/poc-settings+xml":{source:"iana"},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana"},"application/provenance+xml":{source:"iana"},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.hpub+zip":{source:"iana"},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana"},"application/pskc+xml":{source:"iana",extensions:["pskcxml"]},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf"]},"application/reginfo+xml":{source:"iana",extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",extensions:["rld"]},"application/rfc+xml":{source:"iana"},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana"},"application/rls-services+xml":{source:"iana",extensions:["rs"]},"application/route-apd+xml":{source:"iana"},"application/route-s-tsid+xml":{source:"iana"},"application/route-usd+xml":{source:"iana"},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana"},"application/samlmetadata+xml":{source:"iana"},"application/sbml+xml":{source:"iana",extensions:["sbml"]},"application/scaip+xml":{source:"iana"},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/sep+xml":{source:"iana"},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",extensions:["shf"]},"application/sieve":{source:"iana"},"application/simple-filter+xml":{source:"iana"},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",extensions:["srx"]},"application/spirits-event+xml":{source:"iana"},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",extensions:["grxml"]},"application/sru+xml":{source:"iana",extensions:["sru"]},"application/ssdl+xml":{source:"apache",extensions:["ssdl"]},"application/ssml+xml":{source:"iana",extensions:["ssml"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/tei+xml":{source:"iana",extensions:["tei","teicorpus"]},"application/thraud+xml":{source:"iana",extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tnauthlist":{source:"iana"},"application/trig":{source:"iana"},"application/ttml+xml":{source:"iana"},"application/tve-trigger":{source:"iana"},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana"},"application/urc-ressheet+xml":{source:"iana"},"application/urc-targetdesc+xml":{source:"iana"},"application/urc-uisocketdesc+xml":{source:"iana"},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana"},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana"},"application/vnd.3gpp-prose+xml":{source:"iana"},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana"},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana"},"application/vnd.3gpp.bsf+xml":{source:"iana"},"application/vnd.3gpp.gmop+xml":{source:"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana"},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana"},"application/vnd.3gpp.mcptt-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana"},"application/vnd.3gpp.mid-call+xml":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana"},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana"},"application/vnd.3gpp.srvcc-info+xml":{source:"iana"},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana"},"application/vnd.3gpp.ussd+xml":{source:"iana"},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana"},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",extensions:["mpkg"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana"},"application/vnd.balsamiq.bmml+xml":{source:"iana"},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana"},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana"},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana"},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",extensions:["wbs"]},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana"},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana"},"application/vnd.cybank":{source:"iana"},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume-movie":{source:"iana"},"application/vnd.desmume.movie":{source:"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana"},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana"},"application/vnd.dvb.notif-container+xml":{source:"iana"},"application/vnd.dvb.notif-generic+xml":{source:"iana"},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana"},"application/vnd.dvb.notif-init+xml":{source:"iana"},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana"},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana"},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana"},"application/vnd.eszigno3+xml":{source:"iana",extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana"},"application/vnd.etsi.asic-e+zip":{source:"iana"},"application/vnd.etsi.asic-s+zip":{source:"iana"},"application/vnd.etsi.cug+xml":{source:"iana"},"application/vnd.etsi.iptvcommand+xml":{source:"iana"},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana"},"application/vnd.etsi.iptvprofile+xml":{source:"iana"},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana"},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana"},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana"},"application/vnd.etsi.iptvservice+xml":{source:"iana"},"application/vnd.etsi.iptvsync+xml":{source:"iana"},"application/vnd.etsi.iptvueprofile+xml":{source:"iana"},"application/vnd.etsi.mcid+xml":{source:"iana"},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana"},"application/vnd.etsi.pstn+xml":{source:"iana"},"application/vnd.etsi.sci+xml":{source:"iana"},"application/vnd.etsi.simservs+xml":{source:"iana"},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana"},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana"},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana"},"application/vnd.gov.sk.e-form+zip":{source:"iana"},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana"},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana"},"application/vnd.imagemeter.image+zip":{source:"iana"},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana"},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana"},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana"},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana"},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana"},"application/vnd.iptc.g2.packageitem+xml":{source:"iana"},"application/vnd.iptc.g2.planningitem+xml":{source:"iana"},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",extensions:["lasxml"]},"application/vnd.liberty-request+xml":{source:"iana"},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",extensions:["lbe"]},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana"},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana"},"application/vnd.marlin.drm.conftoken+xml":{source:"iana"},"application/vnd.marlin.drm.license+xml":{source:"iana"},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana"},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana"},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana"},"application/vnd.ms-printing.printticket+xml":{source:"apache"},"application/vnd.ms-printschematicket+xml":{source:"iana"},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana"},"application/vnd.nokia.iptv.config+xml":{source:"iana"},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana"},"application/vnd.nokia.landmarkcollection+xml":{source:"iana"},"application/vnd.nokia.n-gage.ac+xml":{source:"iana"},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana"},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana"},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana"},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana"},"application/vnd.oipf.dae.xhtml+xml":{source:"iana"},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana"},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana"},"application/vnd.oipf.spdlist+xml":{source:"iana"},"application/vnd.oipf.ueprofile+xml":{source:"iana"},"application/vnd.oipf.userprofile+xml":{source:"iana"},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana"},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.imd+xml":{source:"iana"},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana"},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana"},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.sprov+xml":{source:"iana"},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana"},"application/vnd.oma.cab-feature-handler+xml":{source:"iana"},"application/vnd.oma.cab-pcc+xml":{source:"iana"},"application/vnd.oma.cab-subs-invite+xml":{source:"iana"},"application/vnd.oma.cab-user-prefs+xml":{source:"iana"},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana"},"application/vnd.oma.group-usage-list+xml":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana"},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana"},"application/vnd.oma.poc.final-report+xml":{source:"iana"},"application/vnd.oma.poc.groups+xml":{source:"iana"},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana"},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana"},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana"},"application/vnd.oma.xcap-directory+xml":{source:"iana"},"application/vnd.omads-email+xml":{source:"iana"},"application/vnd.omads-file+xml":{source:"iana"},"application/vnd.omads-folder+xml":{source:"iana"},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana"},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana"},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana"},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana"},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana"},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana"},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos+xml":{source:"iana"},"application/vnd.paos.xml":{source:"apache"},"application/vnd.patentdive":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana"},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana"},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana"},"application/vnd.radisys.msml+xml":{source:"iana"},"application/vnd.radisys.msml-audit+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana"},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana"},"application/vnd.radisys.msml-conf+xml":{source:"iana"},"application/vnd.radisys.msml-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana"},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana"},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.software602.filler.form+xml":{source:"iana"},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana"},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana"},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.tmd.mediaflex.api+xml":{source:"iana"},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana"},"application/vnd.wv.ssp+xml":{source:"iana"},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana"},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",extensions:["zaz"]},"application/voicexml+xml":{source:"iana",extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana"},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"apache",extensions:["der","crt","pem"]},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana"},"application/xaml+xml":{source:"apache",extensions:["xaml"]},"application/xcap-att+xml":{source:"iana"},"application/xcap-caps+xml":{source:"iana"},"application/xcap-diff+xml":{source:"iana",extensions:["xdf"]},"application/xcap-el+xml":{source:"iana"},"application/xcap-error+xml":{source:"iana"},"application/xcap-ns+xml":{source:"iana"},"application/xcon-conference-info+xml":{source:"iana"},"application/xcon-conference-info-diff+xml":{source:"iana"},"application/xenc+xml":{source:"iana",extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache"},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana"},"application/xmpp+xml":{source:"iana"},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",extensions:["xpl"]},"application/xslt+xml":{source:"iana",extensions:["xslt"]},"application/xspf+xml":{source:"apache",extensions:["xspf"]},"application/xv+xml":{source:"iana",extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana"},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana"},"application/yin+xml":{source:"iana",extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana"},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana"},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tone":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana"},"image/apng":{compressible:!1,extensions:["apng"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana"},"image/emf":{source:"iana"},"image/fits":{source:"iana"},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana"},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana"},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana"},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/tiff-fx":{source:"iana"},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana"},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana"},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana"},"image/vnd.valve.source.texture":{source:"iana"},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana"},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana"},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/vnd.collada+xml":{source:"iana",extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana"},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana"},"model/vnd.parasolid.transmit.binary":{source:"iana"},"model/vnd.parasolid.transmit.text":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.valve.source.compiled-map":{source:"iana"},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana"},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana"},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana",compressible:!1},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fwdred":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shex":{extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana"},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vp8":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}}});var require_mime_db=__commonJS({"../../node_modules/.pnpm/mime-db@1.33.0/node_modules/mime-db/index.js"(exports2,module2){module2.exports=require_db()}});var require_mime_types2=__commonJS({"../../node_modules/.pnpm/mime-types@2.1.18/node_modules/mime-types/index.js"(exports2){"use strict";var db=require_mime_db(),extname3=__require("path").extname,EXTRACT_TYPE_REGEXP=/^\s*([^;\s]*)(?:;|\s|$)/,TEXT_TYPE_REGEXP=/^text\//i;exports2.charset=charset;exports2.charsets={lookup:charset};exports2.contentType=contentType2;exports2.extension=extension;exports2.extensions=Object.create(null);exports2.lookup=lookup;exports2.types=Object.create(null);populateMaps(exports2.extensions,exports2.types);function charset(type){if(!type||typeof type!="string")return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),mime=match&&db[match[1].toLowerCase()];return mime&&mime.charset?mime.charset:match&&TEXT_TYPE_REGEXP.test(match[1])?"UTF-8":!1}function contentType2(str){if(!str||typeof str!="string")return!1;var mime=str.indexOf("/")===-1?exports2.lookup(str):str;if(!mime)return!1;if(mime.indexOf("charset")===-1){var charset2=exports2.charset(mime);charset2&&(mime+="; charset="+charset2.toLowerCase())}return mime}function extension(type){if(!type||typeof type!="string")return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),exts=match&&exports2.extensions[match[1].toLowerCase()];return!exts||!exts.length?!1:exts[0]}function lookup(path6){if(!path6||typeof path6!="string")return!1;var extension2=extname3("x."+path6).toLowerCase().substr(1);return extension2&&exports2.types[extension2]||!1}function populateMaps(extensions,types){var preference=["nginx","apache",void 0,"iana"];Object.keys(db).forEach(function(type){var mime=db[type],exts=mime.extensions;if(!(!exts||!exts.length)){extensions[type]=exts;for(var i=0;i<exts.length;i++){var extension2=exts[i];if(types[extension2]){var from=preference.indexOf(db[types[extension2]].source),to=preference.indexOf(mime.source);if(types[extension2]!=="application/octet-stream"&&(from>to||from===to&&types[extension2].substr(0,12)==="application/"))continue}types[extension2]=type}}})}}});var require_content_disposition=__commonJS({"../../node_modules/.pnpm/content-disposition@0.5.2/node_modules/content-disposition/index.js"(exports2,module2){"use strict";module2.exports=contentDisposition;module2.exports.parse=parse2;var basename2=__require("path").basename,ENCODE_URL_ATTR_CHAR_REGEXP=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,HEX_ESCAPE_REGEXP=/%[0-9A-Fa-f]{2}/,HEX_ESCAPE_REPLACE_REGEXP=/%([0-9A-Fa-f]{2})/g,NON_LATIN1_REGEXP=/[^\x20-\x7e\xa0-\xff]/g,QESC_REGEXP=/\\([\u0000-\u007f])/g,QUOTE_REGEXP=/([\\"])/g,PARAM_REGEXP=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,TEXT_REGEXP=/^[\x20-\x7e\x80-\xff]+$/,TOKEN_REGEXP=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,EXT_VALUE_REGEXP=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,DISPOSITION_TYPE_REGEXP=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function contentDisposition(filename,options){var opts=options||{},type=opts.type||"attachment",params=createparams(filename,opts.fallback);return format(new ContentDisposition(type,params))}function createparams(filename,fallback){if(filename!==void 0){var params={};if(typeof filename!="string")throw new TypeError("filename must be a string");if(fallback===void 0&&(fallback=!0),typeof fallback!="string"&&typeof fallback!="boolean")throw new TypeError("fallback must be a string or boolean");if(typeof fallback=="string"&&NON_LATIN1_REGEXP.test(fallback))throw new TypeError("fallback must be ISO-8859-1 string");var name=basename2(filename),isQuotedString=TEXT_REGEXP.test(name),fallbackName=typeof fallback!="string"?fallback&&getlatin1(name):basename2(fallback),hasFallback=typeof fallbackName=="string"&&fallbackName!==name;return(hasFallback||!isQuotedString||HEX_ESCAPE_REGEXP.test(name))&&(params["filename*"]=name),(isQuotedString||hasFallback)&&(params.filename=hasFallback?fallbackName:name),params}}function format(obj){var parameters=obj.parameters,type=obj.type;if(!type||typeof type!="string"||!TOKEN_REGEXP.test(type))throw new TypeError("invalid type");var string=String(type).toLowerCase();if(parameters&&typeof parameters=="object")for(var param2,params=Object.keys(parameters).sort(),i=0;i<params.length;i++){param2=params[i];var val=param2.substr(-1)==="*"?ustring(parameters[param2]):qstring(parameters[param2]);string+="; "+param2+"="+val}return string}function decodefield(str){var match=EXT_VALUE_REGEXP.exec(str);if(!match)throw new TypeError("invalid extended field value");var charset=match[1].toLowerCase(),encoded=match[2],value,binary=encoded.replace(HEX_ESCAPE_REPLACE_REGEXP,pdecode);switch(charset){case"iso-8859-1":value=getlatin1(binary);break;case"utf-8":value=new Buffer(binary,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return value}function getlatin1(val){return String(val).replace(NON_LATIN1_REGEXP,"?")}function parse2(string){if(!string||typeof string!="string")throw new TypeError("argument string is required");var match=DISPOSITION_TYPE_REGEXP.exec(string);if(!match)throw new TypeError("invalid type format");var index=match[0].length,type=match[1].toLowerCase(),key,names=[],params={},value;for(index=PARAM_REGEXP.lastIndex=match[0].substr(-1)===";"?index-1:index;match=PARAM_REGEXP.exec(string);){if(match.index!==index)throw new TypeError("invalid parameter format");if(index+=match[0].length,key=match[1].toLowerCase(),value=match[2],names.indexOf(key)!==-1)throw new TypeError("invalid duplicate parameter");if(names.push(key),key.indexOf("*")+1===key.length){key=key.slice(0,-1),value=decodefield(value),params[key]=value;continue}typeof params[key]!="string"&&(value[0]==='"'&&(value=value.substr(1,value.length-2).replace(QESC_REGEXP,"$1")),params[key]=value)}if(index!==-1&&index!==string.length)throw new TypeError("invalid parameter format");return new ContentDisposition(type,params)}function pdecode(str,hex){return String.fromCharCode(parseInt(hex,16))}function pencode(char){var hex=String(char).charCodeAt(0).toString(16).toUpperCase();return hex.length===1?"%0"+hex:"%"+hex}function qstring(val){var str=String(val);return'"'+str.replace(QUOTE_REGEXP,"\\$1")+'"'}function ustring(val){var str=String(val),encoded=encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP,pencode);return"UTF-8''"+encoded}function ContentDisposition(type,parameters){this.type=type,this.parameters=parameters}}});var require_path_is_inside=__commonJS({"../../node_modules/.pnpm/path-is-inside@1.0.2/node_modules/path-is-inside/lib/path-is-inside.js"(exports2,module2){"use strict";var path6=__require("path");module2.exports=function(thePath,potentialParent){return thePath=stripTrailingSep(thePath),potentialParent=stripTrailingSep(potentialParent),process.platform==="win32"&&(thePath=thePath.toLowerCase(),potentialParent=potentialParent.toLowerCase()),thePath.lastIndexOf(potentialParent,0)===0&&(thePath[potentialParent.length]===path6.sep||thePath[potentialParent.length]===void 0)};function stripTrailingSep(thePath){return thePath[thePath.length-1]===path6.sep?thePath.slice(0,-1):thePath}}});var require_range_parser=__commonJS({"../../node_modules/.pnpm/range-parser@1.2.0/node_modules/range-parser/index.js"(exports2,module2){"use strict";module2.exports=rangeParser;function rangeParser(size,str,options){var index=str.indexOf("=");if(index===-1)return-2;var arr=str.slice(index+1).split(","),ranges=[];ranges.type=str.slice(0,index);for(var i=0;i<arr.length;i++){var range=arr[i].split("-"),start=parseInt(range[0],10),end=parseInt(range[1],10);isNaN(start)?(start=size-end,end=size-1):isNaN(end)&&(end=size-1),end>size-1&&(end=size-1),!(isNaN(start)||isNaN(end)||start>end||start<0)&&ranges.push({start,end})}return ranges.length<1?-1:options&&options.combine?combineRanges(ranges):ranges}function combineRanges(ranges){for(var ordered=ranges.map(mapWithIndex).sort(sortByRangeStart),j=0,i=1;i<ordered.length;i++){var range=ordered[i],current=ordered[j];range.start>current.end+1?ordered[++j]=range:range.end>current.end&&(current.end=range.end,current.index=Math.min(current.index,range.index))}ordered.length=j+1;var combined=ordered.sort(sortByRangeIndex).map(mapWithoutIndex);return combined.type=ranges.type,combined}function mapWithIndex(range,index){return{start:range.start,end:range.end,index}}function mapWithoutIndex(range){return{start:range.start,end:range.end}}function sortByRangeIndex(a,b){return a.index-b.index}function sortByRangeStart(a,b){return a.start-b.start}}});var require_directory=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/directory.js"(exports2,module2){(function(){function directory(it){var encodeHTML6=typeof _encodeHTML<"u"?_encodeHTML:function(doNotSkipEncoded){var encodeHTMLRules={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}(),out='<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Files within '+encodeHTML6(it.directory)+`</title> <style>body { margin: 0; padding: 30px; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased;}main { max-width: 920px;}header { display: flex; justify-content: space-between; flex-wrap: wrap;}h1 { font-size: 18px; font-weight: 500; margin-top: 0; color: #000;}header h1 a { font-size: 18px; font-weight: 500; margin-top: 0; color: #000;}h1 i { font-style: normal;}ul { margin: 0 0 0 -2px; padding: 20px 0 0 0;}ul li { list-style: none; font-size: 14px; display: flex; justify-content: space-between;}a { text-decoration: none;}ul a { color: #000; padding: 10px 5px; margin: 0 -5px; white-space: nowrap; overflow: hidden; display: block; width: 100%; text-overflow: ellipsis;}header a { color: #0076FF; font-size: 11px; font-weight: 400; display: inline-block; line-height: 20px;}svg { height: 13px; vertical-align: text-bottom;}ul a::before { display: inline-block; vertical-align: middle; margin-right: 10px; width: 24px; text-align: center; line-height: 12px;}ul a.file::before { content: url("data:image/svg+xml;utf8,<svg width='15' height='19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 8C8.34 8 7 6.66 7 5V1H3c-1.1 0-2 .9-2 2v13c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V8h-4zM8 5c0 1.1.9 2 2 2h3.59L8 1.41V5zM3 0h5l7 7v9c0 1.66-1.34 3-3 3H3c-1.66 0-3-1.34-3-3V3c0-1.66 1.34-3 3-3z' fill='black'/></svg>");}ul a:hover { text-decoration: underline;}ul a.folder::before { content: url("data:image/svg+xml;utf8,<svg width='20' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M18.784 3.87a1.565 1.565 0 0 0-.565-.356V2.426c0-.648-.523-1.171-1.15-1.171H8.996L7.908.25A.89.89 0 0 0 7.302 0H2.094C1.445 0 .944.523.944 1.171v2.3c-.21.085-.398.21-.565.356a1.348 1.348 0 0 0-.377 1.004l.398 9.83C.42 15.393 1.048 16 1.8 16h15.583c.753 0 1.36-.586 1.4-1.339l.398-9.83c.021-.313-.125-.69-.397-.962zM1.843 3.41V1.191c0-.146.104-.272.25-.272H7.26l1.234 1.088c.083.042.167.104.293.104h8.282c.125 0 .25.126.25.272V3.41H1.844zm15.54 11.712H1.78a.47.47 0 0 1-.481-.46l-.397-9.83c0-.147.041-.252.125-.356a.504.504 0 0 1 .377-.147H17.78c.125 0 .272.063.377.147.083.083.125.209.125.334l-.418 9.83c-.021.272-.23.482-.481.482z' fill='black'/></svg>");}ul a.lambda::before { content: url("data:image/svg+xml; utf8,<svg width='15' height='19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M3.5 14.4354H5.31622L7.30541 9.81311H7.43514L8.65315 13.0797C9.05676 14.1643 9.55405 14.5 10.7 14.5C11.0171 14.5 11.291 14.4677 11.5 14.4032V13.1572C11.3847 13.1766 11.2622 13.2024 11.1541 13.2024C10.6351 13.2024 10.3829 13.0281 10.1595 12.4664L8.02613 7.07586C7.21171 5.01646 6.54865 4.5 5.11441 4.5C4.83333 4.5 4.62432 4.53228 4.37207 4.59038V5.83635C4.56667 5.81052 4.66036 5.79761 4.77568 5.79761C5.64775 5.79761 5.9 6.0042 6.4045 7.19852L6.64234 7.77954L3.5 14.4354Z' fill='black'/><rect x='0.5' y='0.5' width='14' height='18' rx='2.5' stroke='black'/></svg>");}ul a.file.gif::before,ul a.file.jpg::before,ul a.file.png::before,ul a.file.svg::before { content: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'><rect x='6' y='6' width='68' height='68' rx='5' ry='5'/><circle cx='24' cy='24' r='8'/><path d='M73 49L59 34 37 52m16 20L27 42 7 58'/></svg>");}::selection { background-color: #79FFE1; color: #000;}::-moz-selection { background-color: #79FFE1; color: #000;}@media (min-width: 768px) { ul {display: flex;flex-wrap: wrap; } ul li {width: 230px;padding-right: 20px; }}@media (min-width: 992px) { body {padding: 45px; } h1, header h1 a {font-size: 15px; } ul li {font-size: 13px;box-sizing: border-box;justify-content: flex-start; }}</style> </head> <body> <main> <header> <h1> <i>Index of </i> `,arr1=it.paths;if(arr1)for(var value,index=-1,l1=arr1.length-1;index<l1;)value=arr1[index+=1],out+=' <a href="/'+encodeHTML6(value.url)+'">'+encodeHTML6(value.name)+"</a> ";out+=' </h1> </header> <ul id="files"> ';var arr2=it.files;if(arr2)for(var value,index=-1,l2=arr2.length-1;index<l2;)value=arr2[index+=1],out+=' <li> <a href="'+encodeHTML6(value.relative)+'" title="'+encodeHTML6(value.title)+'" class="'+encodeHTML6(value.type)+" "+encodeHTML6(value.ext)+'">'+encodeHTML6(value.base)+"</a> </li> ";return out+=" </ul></main> </body></html>",out}var itself=directory,_encodeHTML=function(doNotSkipEncoded){var encodeHTMLRules={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}();typeof module2<"u"&&module2.exports?module2.exports=itself:typeof define=="function"?define(function(){return itself}):(window.render=window.render||{},window.render.directory=itself)})()}});var require_error=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/error.js"(exports2,module2){(function(){function error2(it){var out='<!DOCTYPE html><head> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/> <style> body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; } main, aside, section { display: flex; justify-content: center; align-items: center; flex-direction: column; } main { height: 100%; } aside { background: #000; flex-shrink: 1; padding: 30px 20px; } aside p { margin: 0; color: #999999; font-size: 14px; line-height: 24px; } aside a { color: #fff; text-decoration: none; } section span { font-size: 24px; font-weight: 500; display: block; border-bottom: 1px solid #EAEAEA; text-align: center; padding-bottom: 20px; width: 100px; } section p { font-size: 14px; font-weight: 400; } section span + p { margin: 20px 0 0 0; } @media (min-width: 768px) { section { height: 40px; flex-direction: row; } section span, section p { height: 100%; line-height: 40px; } section span { border-bottom: 0; border-right: 1px solid #EAEAEA; padding: 0 20px 0 0; width: auto; } section span + p { margin: 0; padding-left: 20px; } aside { padding: 50px 0; } aside p { max-width: 520px; text-align: center; } } </style></head><body> <main> <section> <span>'+it.statusCode+"</span> <p>"+it.message+"</p> </section> </main></body>";return out}var itself=error2,_encodeHTML=function(doNotSkipEncoded){var encodeHTMLRules={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}();typeof module2<"u"&&module2.exports?module2.exports=itself:typeof define=="function"?define(function(){return itself}):(window.render=window.render||{},window.render.error=itself)})()}});var require_src2=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/index.js"(exports2,module2){var{promisify}=__require("util"),path6=__require("path"),{createHash}=__require("crypto"),{realpath,lstat:lstat2,createReadStream,readdir:readdir2}=__require("fs"),url4=require_urlparser(),slasher=require_glob_slash(),minimatch3=require_minimatch2(),pathToRegExp=require_path_to_regexp(),mime=require_mime_types2(),bytes2=require_bytes(),contentDisposition=require_content_disposition(),isPathInside=require_path_is_inside(),parseRange=require_range_parser(),directoryTemplate2=require_directory(),errorTemplate=require_error(),etags=new Map,calculateSha=(handlers,absolutePath)=>new Promise((resolve3,reject)=>{let hash=createHash("sha1");hash.update(path6.extname(absolutePath)),hash.update("-");let rs=handlers.createReadStream(absolutePath);rs.on("error",reject),rs.on("data",buf=>hash.update(buf)),rs.on("end",()=>{let sha=hash.digest("hex");resolve3(sha)})}),sourceMatches=(source,requestPath,allowSegments)=>{let keys=[],slashed=slasher(source),resolvedPath=path6.posix.resolve(requestPath),results=null;if(allowSegments){let normalized=slashed.replace("*","(.*)");results=pathToRegExp(normalized,keys).exec(resolvedPath),results||(keys.length=0)}return results||minimatch3(resolvedPath,slashed)?{keys,results}:null},toTarget=(source,destination,previousPath)=>{let matches=sourceMatches(source,previousPath,!0);if(!matches)return null;let{keys,results}=matches,props={},{protocol}=url4.parse(destination),normalizedDest=protocol?destination:slasher(destination),toPath=pathToRegExp.compile(normalizedDest);for(let index=0;index<keys.length;index++){let{name}=keys[index];props[name]=results[index+1]}return toPath(props)},applyRewrites=(requestPath,rewrites=[],repetitive)=>{let rewritesCopy=rewrites.slice(),fallback=repetitive?requestPath:null;if(rewritesCopy.length===0)return fallback;for(let index=0;index<rewritesCopy.length;index++){let{source,destination}=rewrites[index],target=toTarget(source,destination,requestPath);if(target)return rewritesCopy.splice(index,1),applyRewrites(slasher(target),rewritesCopy,!0)}return fallback},ensureSlashStart=target=>target.startsWith("/")?target:`/${target}`,shouldRedirect=(decodedPath,{redirects=[],trailingSlash},cleanUrl)=>{let slashing=typeof trailingSlash=="boolean",defaultType=301,matchHTML=/(\.html|\/index)$/g;if(redirects.length===0&&!slashing&&!cleanUrl)return null;let cleanedUrl=!1;if(cleanUrl&&matchHTML.test(decodedPath)&&(decodedPath=decodedPath.replace(matchHTML,""),cleanedUrl=!0),slashing){let{ext,name}=path6.parse(decodedPath),isTrailed=decodedPath.endsWith("/"),isDotfile=name.startsWith("."),target=null;if(!trailingSlash&&isTrailed?target=decodedPath.slice(0,-1):trailingSlash&&!isTrailed&&!ext&&!isDotfile&&(target=`${decodedPath}/`),decodedPath.indexOf("//")>-1&&(target=decodedPath.replace(/\/+/g,"/")),target)return{target:ensureSlashStart(target),statusCode:defaultType}}if(cleanedUrl)return{target:ensureSlashStart(decodedPath),statusCode:defaultType};for(let index=0;index<redirects.length;index++){let{source,destination,type}=redirects[index],target=toTarget(source,destination,decodedPath);if(target)return{target,statusCode:type||defaultType}}return null},appendHeaders=(target,source)=>{for(let index=0;index<source.length;index++){let{key,value}=source[index];target[key]=value}},getHeaders=async(handlers,config,current,absolutePath,stats)=>{let{headers:customHeaders=[],etag=!1}=config,related={},{base}=path6.parse(absolutePath),relativePath=path6.relative(current,absolutePath);if(customHeaders.length>0)for(let index=0;index<customHeaders.length;index++){let{source,headers:headers2}=customHeaders[index];sourceMatches(source,slasher(relativePath))&&appendHeaders(related,headers2)}let defaultHeaders={};if(stats){if(defaultHeaders={"Content-Length":stats.size,"Content-Disposition":contentDisposition(base,{type:"inline"}),"Accept-Ranges":"bytes"},etag){let[mtime,sha]=etags.get(absolutePath)||[];Number(mtime)!==Number(stats.mtime)&&(sha=await calculateSha(handlers,absolutePath),etags.set(absolutePath,[stats.mtime,sha])),defaultHeaders.ETag=`"${sha}"`}else defaultHeaders["Last-Modified"]=stats.mtime.toUTCString();let contentType2=mime.contentType(base);contentType2&&(defaultHeaders["Content-Type"]=contentType2)}let headers=Object.assign(defaultHeaders,related);for(let key in headers)headers.hasOwnProperty(key)&&headers[key]===null&&delete headers[key];return headers},applicable=(decodedPath,configEntry)=>{if(typeof configEntry=="boolean")return configEntry;if(Array.isArray(configEntry)){for(let index=0;index<configEntry.length;index++){let source=configEntry[index];if(sourceMatches(source,decodedPath))return!0}return!1}return!0},getPossiblePaths=(relativePath,extension)=>[path6.join(relativePath,`index${extension}`),relativePath.endsWith("/")?relativePath.replace(/\/$/g,extension):relativePath+extension].filter(item=>path6.basename(item)!==extension),findRelated=async(current,relativePath,rewrittenPath,originalStat)=>{let possible=rewrittenPath?[rewrittenPath]:getPossiblePaths(relativePath,".html"),stats=null;for(let index=0;index<possible.length;index++){let related=possible[index],absolutePath=path6.join(current,related);try{stats=await originalStat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")throw err}if(stats)return{stats,absolutePath}}return null},canBeListed=(excluded,file)=>{let slashed=slasher(file),whether=!0;for(let mark=0;mark<excluded.length;mark++){let source=excluded[mark];if(sourceMatches(source,slashed)){whether=!1;break}}return whether},renderDirectory=async(current,acceptsJSON,handlers,methods,config,paths)=>{let{directoryListing,trailingSlash,unlisted=[],renderSingle}=config,slashSuffix=typeof trailingSlash=="boolean"?trailingSlash?"/":"":"/",{relativePath,absolutePath}=paths,excluded=[".DS_Store",".git",...unlisted];if(!applicable(relativePath,directoryListing)&&!renderSingle)return{};let files=await handlers.readdir(absolutePath),canRenderSingle=renderSingle&&files.length===1;for(let index=0;index<files.length;index++){let file=files[index],filePath=path6.resolve(absolutePath,file),details=path6.parse(filePath),stats=null;if(methods.lstat?stats=await handlers.lstat(filePath,!0):stats=await handlers.lstat(filePath),details.relative=path6.join(relativePath,details.base),stats.isDirectory())details.base+=slashSuffix,details.relative+=slashSuffix,details.type="folder";else{if(canRenderSingle)return{singleFile:!0,absolutePath:filePath,stats};details.ext=details.ext.split(".")[1]||"txt",details.type="file",details.size=bytes2(stats.size,{unitSeparator:" ",decimalPlaces:0})}details.title=details.base,canBeListed(excluded,file)?files[index]=details:delete files[index]}let toRoot=path6.relative(current,absolutePath),directory=path6.join(path6.basename(current),toRoot,slashSuffix),pathParts=directory.split(path6.sep).filter(Boolean);if(files=files.sort((a,b)=>{let aIsDir=a.type==="directory",bIsDir=b.type==="directory";return aIsDir&&!bIsDir?-1:bIsDir&&!aIsDir||a.base>b.base?1:a.base<b.base?-1:0}).filter(Boolean),toRoot.length>0){let directoryPath=[...pathParts].slice(1),relative4=path6.join("/",...directoryPath,"..",slashSuffix);files.unshift({type:"directory",base:"..",relative:relative4,title:relative4,ext:""})}let subPaths=[];for(let index=0;index<pathParts.length;index++){let parents=[],isLast=index===pathParts.length-1,before=0;for(;before<=index;)parents.push(pathParts[before]),before++;parents.shift(),subPaths.push({name:pathParts[index]+(isLast?slashSuffix:"/"),url:index===0?"":parents.join("/")+slashSuffix})}let spec={files,directory,paths:subPaths};return{directory:acceptsJSON?JSON.stringify(spec):directoryTemplate2(spec)}},sendError=async(absolutePath,response,acceptsJSON,current,handlers,config,spec)=>{let{err:original,message:message2,code,statusCode}=spec;if(original&&process.env.NODE_ENV!=="test"&&console.error(original),response.statusCode=statusCode,acceptsJSON){response.setHeader("Content-Type","application/json; charset=utf-8"),response.end(JSON.stringify({error:{code,message:message2}}));return}let stats=null,errorPage=path6.join(current,`${statusCode}.html`);try{stats=await handlers.lstat(errorPage)}catch(err){err.code!=="ENOENT"&&console.error(err)}if(stats){let stream=null;try{stream=await handlers.createReadStream(errorPage);let headers2=await getHeaders(handlers,config,current,errorPage,stats);response.writeHead(statusCode,headers2),stream.pipe(response);return}catch(err){console.error(err)}}let headers=await getHeaders(handlers,config,current,absolutePath,null);headers["Content-Type"]="text/html; charset=utf-8",response.writeHead(statusCode,headers),response.end(errorTemplate({statusCode,message:message2}))},internalError=async(...args2)=>{let lastIndex=args2.length-1,err=args2[lastIndex];return args2[lastIndex]={statusCode:500,code:"internal_server_error",message:"A server error has occurred",err},sendError(...args2)},getHandlers=methods=>Object.assign({lstat:promisify(lstat2),realpath:promisify(realpath),createReadStream,readdir:promisify(readdir2),sendError},methods);module2.exports=async(request,response,config={},methods={})=>{let cwd=process.cwd(),current=config.public?path6.resolve(cwd,config.public):cwd,handlers=getHandlers(methods),relativePath=null,acceptsJSON=null;request.headers.accept&&(acceptsJSON=request.headers.accept.includes("application/json"));try{relativePath=decodeURIComponent(url4.parse(request.url).pathname)}catch{return sendError("/",response,acceptsJSON,current,handlers,config,{statusCode:400,code:"bad_request",message:"Bad Request"})}let absolutePath=path6.join(current,relativePath);if(!isPathInside(absolutePath,current))return sendError(absolutePath,response,acceptsJSON,current,handlers,config,{statusCode:400,code:"bad_request",message:"Bad Request"});let cleanUrl=applicable(relativePath,config.cleanUrls),redirect2=shouldRedirect(relativePath,config,cleanUrl);if(redirect2){response.writeHead(redirect2.statusCode,{Location:encodeURI(redirect2.target)}),response.end();return}let stats=null;if(path6.extname(relativePath)!=="")try{stats=await handlers.lstat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}let rewrittenPath=applyRewrites(relativePath,config.rewrites);if(!stats&&(cleanUrl||rewrittenPath))try{let related=await findRelated(current,relativePath,rewrittenPath,handlers.lstat);related&&({stats,absolutePath}=related)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(!stats)try{stats=await handlers.lstat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(stats&&stats.isDirectory()){let directory=null,singleFile=null;try{let related=await renderDirectory(current,acceptsJSON,handlers,methods,config,{relativePath,absolutePath});related.singleFile?{stats,absolutePath,singleFile}=related:{directory}=related}catch(err){if(err.code!=="ENOENT")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(directory){let contentType2=acceptsJSON?"application/json; charset=utf-8":"text/html; charset=utf-8";response.statusCode=200,response.setHeader("Content-Type",contentType2),response.end(directory);return}singleFile||(stats=null)}let isSymLink=stats&&stats.isSymbolicLink();if(!stats||!config.symlinks&&isSymLink)return handlers.sendError(absolutePath,response,acceptsJSON,current,handlers,config,{statusCode:404,code:"not_found",message:"The requested path could not be found"});isSymLink&&(absolutePath=await handlers.realpath(absolutePath),stats=await handlers.lstat(absolutePath));let streamOpts={};if(request.headers.range&&stats.size){let range=parseRange(stats.size,request.headers.range);if(typeof range=="object"&&range.type==="bytes"){let{start,end}=range[0];streamOpts.start=start,streamOpts.end=end,response.statusCode=206}else response.statusCode=416,response.setHeader("Content-Range",`bytes */${stats.size}`)}let stream=null;try{stream=await handlers.createReadStream(absolutePath,streamOpts)}catch(err){return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}let headers=await getHeaders(handlers,config,current,absolutePath,stats);if(streamOpts.start!==void 0&&streamOpts.end!==void 0&&(headers["Content-Range"]=`bytes ${streamOpts.start}-${streamOpts.end}/${stats.size}`,headers["Content-Length"]=streamOpts.end-streamOpts.start+1),request.headers.range==null&&headers.ETag&&headers.ETag===request.headers["if-none-match"]){response.statusCode=304,response.end();return}response.writeHead(response.statusCode||200,headers),stream.pipe(response)}}});var require_dist6=__commonJS({"../../node_modules/.pnpm/pcre-to-regexp@1.0.0/node_modules/pcre-to-regexp/dist/index.js"(exports2,module2){"use strict";var characterClasses={alnum:"[A-Za-z0-9]",word:"[A-Za-z0-9_]",alpha:"[A-Za-z]",blank:"[ \\t]",cntrl:"[\\x00-\\x1F\\x7F]",digit:"\\d",graph:"[\\x21-\\x7E]",lower:"[a-z]",print:"[\\x20-\\x7E]",punct:"[\\]\\[!\"#$%&'()*+,./:;<=>?@\\\\^_`{|}~-]",space:"\\s",upper:"[A-Z]",xdigit:"[A-Fa-f0-9]"};function createPCRE(pattern,namedCaptures){pattern=String(pattern||"").trim();let originalPattern=pattern,delim,flags="";if(/^[^a-zA-Z\\\s]/.test(pattern)){delim=pattern[0];let lastDelimIndex=pattern.lastIndexOf(delim);flags+=pattern.substring(lastDelimIndex+1),pattern=pattern.substring(1,lastDelimIndex)}let numGroups=0;pattern=replaceCaptureGroups(pattern,group=>{if(/^\(\?[P<']/.test(group)){let match=/^\(\?P?[<']([^>']+)[>']/.exec(group);if(!match)throw new Error(`Failed to extract named captures from ${JSON.stringify(group)}`);let capture=group.substring(match[0].length,group.length-1);return namedCaptures&&(namedCaptures[numGroups]=match[1]),numGroups++,`(${capture})`}return group.substring(0,3)==="(?:"||numGroups++,group}),pattern=pattern.replace(/\[:([^:]+):\]/g,(characterClass,name)=>characterClasses[name]||characterClass);let regexp=new RegExp(pattern,flags);return regexp.delimiter=delim,regexp.pcrePattern=originalPattern,regexp.pcreFlags=flags,regexp}function replaceCaptureGroups(pattern,fn2){let start=0,depth=0,escaped=!1;for(let i=0;i<pattern.length;i++){let cur=pattern[i];if(escaped){escaped=!1;continue}switch(cur){case"(":depth===0&&(start=i),depth++;break;case")":if(depth>0&&(depth--,depth===0)){let end=i+1,l=start===0?"":pattern.substring(0,start),r=pattern.substring(end),v=String(fn2(pattern.substring(start,end)));pattern=l+v+r,i=start}break;case"\\":escaped=!0;break;default:break}}return pattern}createPCRE.characterClasses=characterClasses;module2.exports=createPCRE}});var require_dist7=__commonJS({"../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js"(exports2,module2){"use strict";function noop(){}function once2(emitter,name){let o=once2.spread(emitter,name),r=o.then(args2=>args2[0]);return r.cancel=o.cancel,r}(function(once3){function spread(emitter,name){let c=null,p=new Promise((resolve3,reject)=>{function cancel(){emitter.removeListener(name,onEvent),emitter.removeListener("error",onError),p.cancel=noop}function onEvent(...args2){cancel(),resolve3(args2)}function onError(err){cancel(),reject(err)}c=cancel,emitter.on(name,onEvent),emitter.on("error",onError)});if(!c)throw new TypeError("Could not get `cancel()` function");return p.cancel=c,p}once3.spread=spread})(once2||(once2={}));module2.exports=once2}});var require_get_port=__commonJS({"../../node_modules/.pnpm/get-port@5.1.1/node_modules/get-port/index.js"(exports2,module2){"use strict";var net=__require("net"),Locked=class extends Error{constructor(port){super(`${port} is locked`)}},lockedPorts={old:new Set,young:new Set},releaseOldLockedPortsIntervalMs=1e3*15,interval,getAvailablePort=options=>new Promise((resolve3,reject)=>{let server=net.createServer();server.unref(),server.on("error",reject),server.listen(options,()=>{let{port}=server.address();server.close(()=>{resolve3(port)})})}),portCheckSequence=function*(ports){ports&&(yield*ports),yield 0};module2.exports=async options=>{let ports;options&&(ports=typeof options.port=="number"?[options.port]:options.port),interval===void 0&&(interval=setInterval(()=>{lockedPorts.old=lockedPorts.young,lockedPorts.young=new Set},releaseOldLockedPortsIntervalMs),interval.unref&&interval.unref());for(let port of portCheckSequence(ports))try{let availablePort=await getAvailablePort({...options,port});for(;lockedPorts.old.has(availablePort)||lockedPorts.young.has(availablePort);){if(port!==0)throw new Locked(port);availablePort=await getAvailablePort({...options,port})}return lockedPorts.young.add(availablePort),availablePort}catch(error2){if(!["EADDRINUSE","EACCES"].includes(error2.code)&&!(error2 instanceof Locked))throw error2}throw new Error("No available ports found")};module2.exports.makeRange=(from,to)=>{if(!Number.isInteger(from)||!Number.isInteger(to))throw new TypeError("`from` and `to` must be integer numbers");if(from<1024||from>65535)throw new RangeError("`from` must be between 1024 and 65535");if(to<1024||to>65536)throw new RangeError("`to` must be between 1024 and 65536");if(to<from)throw new RangeError("`to` must be greater than or equal to `from`");return function*(from2,to2){for(let port=from2;port<=to2;port++)yield port}(from,to)}}});var require_is_port_reachable=__commonJS({"../../node_modules/.pnpm/is-port-reachable@3.1.0/node_modules/is-port-reachable/index.js"(exports2,module2){"use strict";var net=__require("net");module2.exports=async(port,{timeout=1e3,host}={})=>{let promise=new Promise((resolve3,reject)=>{let socket=new net.Socket,onError=()=>{socket.destroy(),reject()};socket.setTimeout(timeout),socket.once("error",onError),socket.once("timeout",onError),socket.connect(port,host,()=>{socket.end(),resolve3()})});try{return await promise,!0}catch{return!1}}}});var require_tree_kill=__commonJS({"../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports2,module2){"use strict";var childProcess=__require("child_process"),spawn=childProcess.spawn,exec=childProcess.exec;module2.exports=function(pid,signal,callback){if(typeof signal=="function"&&callback===void 0&&(callback=signal,signal=void 0),pid=parseInt(pid),Number.isNaN(pid)){if(callback)return callback(new Error("pid must be a number"));throw new Error("pid must be a number")}var tree={},pidsToProcess={};switch(tree[pid]=[],pidsToProcess[pid]=1,process.platform){case"win32":exec("taskkill /pid "+pid+" /T /F",callback);break;case"darwin":buildProcessTree(pid,tree,pidsToProcess,function(parentPid){return spawn("pgrep",["-P",parentPid])},function(){killAll(tree,signal,callback)});break;default:buildProcessTree(pid,tree,pidsToProcess,function(parentPid){return spawn("ps",["-o","pid","--no-headers","--ppid",parentPid])},function(){killAll(tree,signal,callback)});break}};function killAll(tree,signal,callback){var killed={};try{Object.keys(tree).forEach(function(pid){tree[pid].forEach(function(pidpid){killed[pidpid]||(killPid(pidpid,signal),killed[pidpid]=1)}),killed[pid]||(killPid(pid,signal),killed[pid]=1)})}catch(err){if(callback)return callback(err);throw err}if(callback)return callback()}function killPid(pid,signal){try{process.kill(parseInt(pid,10),signal)}catch(err){if(err.code!=="ESRCH")throw err}}function buildProcessTree(parentPid,tree,pidsToProcess,spawnChildProcessesList,cb){var ps=spawnChildProcessesList(parentPid),allData="";ps.stdout.on("data",function(data){var data=data.toString("ascii");allData+=data});var onClose=function(code){if(delete pidsToProcess[parentPid],code!=0){Object.keys(pidsToProcess).length==0&&cb();return}allData.match(/\d+/g).forEach(function(pid){pid=parseInt(pid,10),tree[parentPid].push(pid),tree[pid]=[],pidsToProcess[pid]=1,buildProcessTree(pid,tree,pidsToProcess,spawnChildProcessesList,cb)})};ps.on("close",onClose)}}});var require_escape_html=__commonJS({"../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js"(exports2,module2){"use strict";var matchHtmlRegExp=/["'&<>]/;module2.exports=escapeHtml;function escapeHtml(string){var str=""+string,match=matchHtmlRegExp.exec(str);if(!match)return str;var escape2,html="",index=0,lastIndex=0;for(index=match.index;index<str.length;index++){switch(str.charCodeAt(index)){case 34:escape2=""";break;case 38:escape2="&";break;case 39:escape2="'";break;case 60:escape2="<";break;case 62:escape2=">";break;default:continue}lastIndex!==index&&(html+=str.substring(lastIndex,index)),lastIndex=index+1,html+=escape2}return lastIndex!==index?html+str.substring(lastIndex,index):html}}});var import_chalk4=__toESM(require_source(),1);import path5 from"path";var import_chalk3=__toESM(require_source(),1),import_ms8=__toESM(require_ms(),1),import_fs_extra2=__toESM(require_lib(),1),import_fs_detectors3=__toESM(require_dist4(),1),import_frameworks4=__toESM(require_frameworks(),1);import{resolve as resolve2,join as join6}from"path";var import_fs_extra=__toESM(require_lib(),1),import_ms6=__toESM(require_ms(),1),import_chalk2=__toESM(require_source(),1);import url3,{URL as URL2}from"url";import http from"http";var import_pluralize2=__toESM(require_pluralize(),1),import_raw_body=__toESM(require_raw_body(),1),import_async_listen=__toESM(require_dist2(),1),import_minimatch2=__toESM(require_minimatch(),1),import_http_proxy_node16=__toESM(require_http_proxy_node16(),1),import_serve_handler=__toESM(require_src2(),1),import_pcre_to_regexp2=__toESM(require_dist6(),1),import_dotenv=__toESM(require_main(),1),import_once=__toESM(require_dist7(),1),import_directory=__toESM(require_directory(),1),import_get_port2=__toESM(require_get_port(),1),import_fast_deep_equal=__toESM(require_fast_deep_equal(),1);import{randomBytes as randomBytes2,timingSafeEqual}from"crypto";import{watch}from"chokidar";import path4,{isAbsolute as isAbsolute3,basename,dirname as dirname3,extname as extname2,join as join4,sep as sep2}from"path";var import_is_port_reachable=__toESM(require_is_port_reachable(),1);var import_build_utils=__toESM(require_build_utils(),1),import_ms=__toESM(require_ms(),1),REPORT_A_BUG="This is likely a bug in the Vercel CLI. Please report it at https://vercel.com/help.",REPORT_A_BUILDER_BUG="This is likely a bug in the Builder that produced this function. Report it to the Builder's author, or at https://vercel.com/help for an official `@vercel/*` Builder.",dev=defineDiagnostics({codes:{DEV_RECURSIVE_INVOCATION:{why:"`vercel dev` must not recursively invoke itself",fix:"Check the Development Command in your Project Settings and the `dev` script in `package.json` \u2014 neither should call `vercel dev`.",docs:"https://vercel.link/recursive-invocation-of-commands"},DEV_LOCK_HELD:{why:"Another `vercel dev` process is already running for this project",fix:p=>p.detail},DEV_INVALID_WINDOWS_PIPE:{why:p=>`Invalid Windows named pipe endpoint: ${p.endpoint}`,fix:"Use a pipe path beginning with `\\\\.\\`, e.g. `pipe:\\\\.\\pipe\\my-app`."},DEV_INVALID_UNIX_SOCKET:{why:p=>`Invalid UNIX domain socket endpoint: ${p.endpoint}`,fix:"Provide a socket path, e.g. `unix:/tmp/my-app.sock`."},DEV_INVALID_LISTEN_SCHEME:{why:p=>`Unknown \`--listen\` scheme (protocol): ${p.protocol}`,fix:"Use a port (e.g. `3000`), or a `tcp:`, `unix:`, or `pipe:` endpoint."},DEV_PORT_DETECTION_TIMED_OUT:{why:p=>`Detecting port ${p.port} timed out after ${(0,import_ms.default)(p.timeout)}`,fix:"Ensure your Development Command starts a server that listens on the expected port."},DEV_BUILDER_LOAD_FAILED:{why:p=>`Failed to load Builder "${p.use}"`,fix:"Check that the Builder is installed and spelled correctly in your `vercel.json` `builds` configuration."},DEV_SIDECAR_UNSUPPORTED_TYPE:{why:p=>`Development sidecar "${p.name}" has unsupported type "${p.type}"`,fix:REPORT_A_BUILDER_BUG},DEV_SIDECAR_DUPLICATE_NAME:{why:p=>`Multiple builders contributed a development sidecar named "${p.name}"`,fix:REPORT_A_BUILDER_BUG},DEV_QUEUE_CONSUMER_DUPLICATE:{why:p=>`Queue consumer "${p.consumerGroup}" is configured more than once for topic "${p.topic}"`,fix:"Remove the duplicate consumer configuration so each consumer subscribes to a topic only once."},DEV_SERVICE_NO_DEV_SERVER:{why:p=>`No dev server available for service "${p.name}" (framework: ${p.framework})`,fix:"Add a Development Command for this service, or set its framework so one can be detected."},DEV_SERVICE_NO_PID:{why:p=>`Failed to start service "${p.name}": no PID returned`,fix:"Verify the service Development Command is executable and starts successfully."},DEV_SERVICE_NO_STDIO:{why:p=>`Failed to start service "${p.name}": expected child process to have stdout and stderr`,fix:REPORT_A_BUG},DEV_BUILDER_RESULT_NOT_LAMBDA:{why:'The result of "builder.build()" must be a `Lambda`',fix:REPORT_A_BUILDER_BUG},DEV_BUILDER_RESULT_HAS_MAXDURATION:{why:'The result of "builder.build()" must not contain `maxDuration`',fix:REPORT_A_BUILDER_BUG},DEV_BUILDER_RESULT_HAS_MEMORY:{why:'The result of "builder.build()" must not contain `memory`',fix:REPORT_A_BUILDER_BUG},DEV_UNSUPPORTED_BUILDER_VERSION:{why:p=>`${p.titleName} CLI does not support builder version ${p.version}`,fix:p=>p.updateMessage},DEV_INVALID_ROUTES:{why:p=>p.message,fix:REPORT_A_BUILDER_BUG},DEV_LISTEN_ADDRESS_IN_USE:{why:p=>`Requested socket ${p.address} is already in use`,fix:"Stop the process using that socket, or pass a different `--listen` address."},DEV_UNSUPPORTED_CONFIG_VERSION:{why:"Cannot run `version: 1` projects",fix:'Upgrade the project to the current configuration \u2014 remove `"version": 1` from your `vercel.json`.'},DEV_CWD_NOT_FOUND:{why:p=>`Directory \`${p.cwd}\` does not exist`,fix:"Run the command from an existing directory, or pass a valid path."},DEV_CWD_NOT_DIRECTORY:{why:p=>`Path \`${p.cwd}\` is not a directory`,fix:"Point the command at a directory rather than a file."},DEV_INTERNAL_ADDRESS_UNAVAILABLE:{why:"Invalid access to `address` because `start` has not yet populated `this.address`",fix:REPORT_A_BUG},DEV_INTERNAL_NO_ROUTE_RESULT:{why:"Expected Route Result but none was found",fix:REPORT_A_BUG},DEV_INTERNAL_MISSING_CHILD_STDIO:{why:"Expected child process to have stdout and stderr",fix:REPORT_A_BUG},DEV_SYSCALL_ERROR:{why:p=>p.message,fix:"This is an operating-system error. Check the file path, permissions, and ports referenced above, then retry."}}}),FIX_BY_CODE={missing_build_script:"Add a `build` script to your `package.json`, or set a Build Command in your Project Settings.",MISSING_DOTENV_VARS:"Define the missing variables in your `.env` file, or pull them with `vercel env pull`.",MAX_LAMBDA_SIZE_EXCEEDED:"Reduce the function bundle \u2014 trim dependencies or included files, or split the function.",NODE_DEPENDENCY_SYNC_FAILED:"Install your dependencies (e.g. `npm install`) and confirm they resolve, then retry.",INSTALL_COMMAND_FAILED:"Fix the dependency error logged above, then retry.",CONFLICTING_CONFIG_FILES:"Keep a single configuration file \u2014 remove the extra `vercel.json`/`now.json`.",CANT_PARSE_JSON_FILE:"Fix the JSON syntax error at the location shown above, then retry."};function toDiagnostic(err){if(err instanceof Diagnostic)return err;let source=err,why=err instanceof Error?err.message:typeof source.message=="string"?source.message:String(err);if(typeof source.errno=="number"||typeof source.syscall=="string")return dev.DEV_SYSCALL_ERROR({message:why,cause:err});let code=typeof source.code=="string"?source.code:void 0,docs=typeof source.link=="string"?source.link:void 0,action=typeof source.action=="string"?source.action:void 0,fix=code?FIX_BY_CODE[code]:void 0,diagnostic=new Diagnostic({why,fix,docs,cause:err});return code&&(diagnostic.name=code),action&&(diagnostic.action=action),diagnostic}var DevCommandExitError=class extends Diagnostic{constructor(message2,exitCode){super({why:message2,fix:"Your Development Command exited before the dev server was ready. Fix the error logged above, then confirm the command runs on its own (e.g. `npm run dev`)."});this.name="DEV_COMMAND_EXITED",this.exitCode=exitCode}},ServiceStartError=class extends Diagnostic{constructor(failures){let dedupeErrorCodes=new Set(["PYTHON_EXTERNAL_VENV_DETECTED"]),seenCodes=new Set,uniqueMessages=[],childFixes=[],childCodes=[];for(let err of failures){let message2=err instanceof Error?err.message:String(err),rawCode=err?.code,code=err instanceof import_build_utils.NowBuildError?err.code:typeof rawCode=="string"?rawCode:void 0;code&&dedupeErrorCodes.has(code)?seenCodes.has(code)||(uniqueMessages.push(message2),seenCodes.add(code)):uniqueMessages.push(message2),code&&!childCodes.includes(code)&&childCodes.push(code);let childFix=code?FIX_BY_CODE[code]:void 0;childFix&&!childFixes.includes(childFix)&&childFixes.push(childFix)}super({why:uniqueMessages.join(`
|
|
32
|
+
>>> no match, partial?`,file,fr,pattern,pr),fr===fl))}var hit;if(typeof p=="string"?(options.nocase?hit=f.toLowerCase()===p.toLowerCase():hit=f===p,this.debug("string match",p,f,hit)):(hit=f.match(p),this.debug("pattern match",p,f,hit)),!hit)return!1}if(fi===fl&&pi===pl)return!0;if(fi===fl)return partial;if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}});var require_path_to_regexp=__commonJS({"../../node_modules/.pnpm/path-to-regexp@2.2.1/node_modules/path-to-regexp/index.js"(exports2,module2){module2.exports=pathToRegexp;module2.exports.parse=parse2;module2.exports.compile=compile;module2.exports.tokensToFunction=tokensToFunction;module2.exports.tokensToRegExp=tokensToRegExp;var DEFAULT_DELIMITER="/",DEFAULT_DELIMITERS="./",PATH_REGEXP=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function parse2(str,options){for(var tokens=[],key=0,index=0,path6="",defaultDelimiter=options&&options.delimiter||DEFAULT_DELIMITER,delimiters=options&&options.delimiters||DEFAULT_DELIMITERS,pathEscaped=!1,res;(res=PATH_REGEXP.exec(str))!==null;){var m=res[0],escaped=res[1],offset=res.index;if(path6+=str.slice(index,offset),index=offset+m.length,escaped){path6+=escaped[1],pathEscaped=!0;continue}var prev="",next=str[index],name=res[2],capture=res[3],group=res[4],modifier=res[5];if(!pathEscaped&&path6.length){var k=path6.length-1;delimiters.indexOf(path6[k])>-1&&(prev=path6[k],path6=path6.slice(0,k))}path6&&(tokens.push(path6),path6="",pathEscaped=!1);var partial=prev!==""&&next!==void 0&&next!==prev,repeat=modifier==="+"||modifier==="*",optional=modifier==="?"||modifier==="*",delimiter2=prev||defaultDelimiter,pattern=capture||group;tokens.push({name:name||key++,prefix:prev,delimiter:delimiter2,optional,repeat,partial,pattern:pattern?escapeGroup(pattern):"[^"+escapeString(delimiter2)+"]+?"})}return(path6||index<str.length)&&tokens.push(path6+str.substr(index)),tokens}function compile(str,options){return tokensToFunction(parse2(str,options))}function tokensToFunction(tokens){for(var matches=new Array(tokens.length),i=0;i<tokens.length;i++)typeof tokens[i]=="object"&&(matches[i]=new RegExp("^(?:"+tokens[i].pattern+")$"));return function(data,options){for(var path6="",encode=options&&options.encode||encodeURIComponent,i2=0;i2<tokens.length;i2++){var token=tokens[i2];if(typeof token=="string"){path6+=token;continue}var value=data?data[token.name]:void 0,segment;if(Array.isArray(value)){if(!token.repeat)throw new TypeError('Expected "'+token.name+'" to not repeat, but got array');if(value.length===0){if(token.optional)continue;throw new TypeError('Expected "'+token.name+'" to not be empty')}for(var j=0;j<value.length;j++){if(segment=encode(value[j],token),!matches[i2].test(segment))throw new TypeError('Expected all "'+token.name+'" to match "'+token.pattern+'"');path6+=(j===0?token.prefix:token.delimiter)+segment}continue}if(typeof value=="string"||typeof value=="number"||typeof value=="boolean"){if(segment=encode(String(value),token),!matches[i2].test(segment))throw new TypeError('Expected "'+token.name+'" to match "'+token.pattern+'", but got "'+segment+'"');path6+=token.prefix+segment;continue}if(token.optional){token.partial&&(path6+=token.prefix);continue}throw new TypeError('Expected "'+token.name+'" to be '+(token.repeat?"an array":"a string"))}return path6}}function escapeString(str){return str.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function escapeGroup(group){return group.replace(/([=!:$/()])/g,"\\$1")}function flags(options){return options&&options.sensitive?"":"i"}function regexpToRegexp(path6,keys){if(!keys)return path6;var groups=path6.source.match(/\((?!\?)/g);if(groups)for(var i=0;i<groups.length;i++)keys.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return path6}function arrayToRegexp(path6,keys,options){for(var parts=[],i=0;i<path6.length;i++)parts.push(pathToRegexp(path6[i],keys,options).source);return new RegExp("(?:"+parts.join("|")+")",flags(options))}function stringToRegexp(path6,keys,options){return tokensToRegExp(parse2(path6,options),keys,options)}function tokensToRegExp(tokens,keys,options){options=options||{};for(var strict=options.strict,end=options.end!==!1,delimiter2=escapeString(options.delimiter||DEFAULT_DELIMITER),delimiters=options.delimiters||DEFAULT_DELIMITERS,endsWith=[].concat(options.endsWith||[]).map(escapeString).concat("$").join("|"),route="",isEndDelimited=tokens.length===0,i=0;i<tokens.length;i++){var token=tokens[i];if(typeof token=="string")route+=escapeString(token),isEndDelimited=i===tokens.length-1&&delimiters.indexOf(token[token.length-1])>-1;else{var prefix=escapeString(token.prefix),capture=token.repeat?"(?:"+token.pattern+")(?:"+prefix+"(?:"+token.pattern+"))*":token.pattern;keys&&keys.push(token),token.optional?token.partial?route+=prefix+"("+capture+")?":route+="(?:"+prefix+"("+capture+"))?":route+=prefix+"("+capture+")"}}return end?(strict||(route+="(?:"+delimiter2+")?"),route+=endsWith==="$"?"$":"(?="+endsWith+")"):(strict||(route+="(?:"+delimiter2+"(?="+endsWith+"))?"),isEndDelimited||(route+="(?="+delimiter2+"|"+endsWith+")")),new RegExp("^"+route,flags(options))}function pathToRegexp(path6,keys,options){return path6 instanceof RegExp?regexpToRegexp(path6,keys):Array.isArray(path6)?arrayToRegexp(path6,keys,options):stringToRegexp(path6,keys,options)}}});var require_db=__commonJS({"../../node_modules/.pnpm/mime-db@1.33.0/node_modules/mime-db/db.json"(exports2,module2){module2.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana"},"application/3gpp-ims+xml":{source:"iana"},"application/a2l":{source:"iana"},"application/activemessage":{source:"iana"},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana"},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",extensions:["atomsvc"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana"},"application/bacnet-xdd+zip":{source:"iana"},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana"},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana"},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/cbor":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana"},"application/ccxml+xml":{source:"iana",extensions:["ccxml"]},"application/cdfx+xml":{source:"iana"},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana"},"application/cellml+xml":{source:"iana"},"application/cfw":{source:"iana"},"application/clue_info+xml":{source:"iana"},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana"},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana"},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana"},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana"},"application/cstadata+xml":{source:"iana"},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",extensions:["mpd"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana"},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana"},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/docbook+xml":{source:"apache",extensions:["dbk"]},"application/dskpp+xml":{source:"iana"},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/emergencycalldata.comment+xml":{source:"iana"},"application/emergencycalldata.control+xml":{source:"iana"},"application/emergencycalldata.deviceinfo+xml":{source:"iana"},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana"},"application/emergencycalldata.serviceinfo+xml":{source:"iana"},"application/emergencycalldata.subscriberinfo+xml":{source:"iana"},"application/emergencycalldata.veds+xml":{source:"iana"},"application/emma+xml":{source:"iana",extensions:["emma"]},"application/emotionml+xml":{source:"iana"},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana"},"application/epub+zip":{source:"iana",extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana"},"application/fhir+xml":{source:"iana"},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1,extensions:["woff"]},"application/framework-attributes+xml":{source:"iana"},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geoxacml+xml":{source:"iana"},"application/gml+xml":{source:"iana",extensions:["gml"]},"application/gpx+xml":{source:"apache",extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana"},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana"},"application/ibe-pkg-reply+xml":{source:"iana"},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana"},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana"},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana"},"application/kpml-response+xml":{source:"iana"},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana"},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana"},"application/lost+xml":{source:"iana",extensions:["lostxml"]},"application/lostsync+xml":{source:"iana"},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",extensions:["mads"]},"application/manifest+json":{charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",extensions:["mathml"]},"application/mathml-content+xml":{source:"iana"},"application/mathml-presentation+xml":{source:"iana"},"application/mbms-associated-procedure-description+xml":{source:"iana"},"application/mbms-deregister+xml":{source:"iana"},"application/mbms-envelope+xml":{source:"iana"},"application/mbms-msk+xml":{source:"iana"},"application/mbms-msk-response+xml":{source:"iana"},"application/mbms-protection-description+xml":{source:"iana"},"application/mbms-reception-report+xml":{source:"iana"},"application/mbms-register+xml":{source:"iana"},"application/mbms-register-response+xml":{source:"iana"},"application/mbms-schedule+xml":{source:"iana"},"application/mbms-user-service-description+xml":{source:"iana"},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana"},"application/media_control+xml":{source:"iana"},"application/mediaservercontrol+xml":{source:"iana",extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",extensions:["metalink"]},"application/metalink4+xml":{source:"iana",extensions:["meta4"]},"application/mets+xml":{source:"iana",extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mmt-usd+xml":{source:"iana"},"application/mods+xml":{source:"iana",extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana"},"application/mrb-publish+xml":{source:"iana"},"application/msc-ivr+xml":{source:"iana"},"application/msc-mixer+xml":{source:"iana"},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana"},"application/n-triples":{source:"iana"},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana"},"application/news-groupinfo":{source:"iana"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana"},"application/node":{source:"iana"},"application/nss":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p2p-overlay+xml":{source:"iana"},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana"},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana"},"application/pidf-diff+xml":{source:"iana"},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",extensions:["pls"]},"application/poc-settings+xml":{source:"iana"},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana"},"application/provenance+xml":{source:"iana"},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.hpub+zip":{source:"iana"},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana"},"application/pskc+xml":{source:"iana",extensions:["pskcxml"]},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf"]},"application/reginfo+xml":{source:"iana",extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",extensions:["rld"]},"application/rfc+xml":{source:"iana"},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana"},"application/rls-services+xml":{source:"iana",extensions:["rs"]},"application/route-apd+xml":{source:"iana"},"application/route-s-tsid+xml":{source:"iana"},"application/route-usd+xml":{source:"iana"},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana"},"application/samlmetadata+xml":{source:"iana"},"application/sbml+xml":{source:"iana",extensions:["sbml"]},"application/scaip+xml":{source:"iana"},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/sep+xml":{source:"iana"},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",extensions:["shf"]},"application/sieve":{source:"iana"},"application/simple-filter+xml":{source:"iana"},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",extensions:["srx"]},"application/spirits-event+xml":{source:"iana"},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",extensions:["grxml"]},"application/sru+xml":{source:"iana",extensions:["sru"]},"application/ssdl+xml":{source:"apache",extensions:["ssdl"]},"application/ssml+xml":{source:"iana",extensions:["ssml"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/tei+xml":{source:"iana",extensions:["tei","teicorpus"]},"application/thraud+xml":{source:"iana",extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tnauthlist":{source:"iana"},"application/trig":{source:"iana"},"application/ttml+xml":{source:"iana"},"application/tve-trigger":{source:"iana"},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana"},"application/urc-ressheet+xml":{source:"iana"},"application/urc-targetdesc+xml":{source:"iana"},"application/urc-uisocketdesc+xml":{source:"iana"},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana"},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana"},"application/vnd.3gpp-prose+xml":{source:"iana"},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana"},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana"},"application/vnd.3gpp.bsf+xml":{source:"iana"},"application/vnd.3gpp.gmop+xml":{source:"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana"},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana"},"application/vnd.3gpp.mcptt-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana"},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana"},"application/vnd.3gpp.mid-call+xml":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana"},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana"},"application/vnd.3gpp.srvcc-info+xml":{source:"iana"},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana"},"application/vnd.3gpp.ussd+xml":{source:"iana"},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana"},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",extensions:["mpkg"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana"},"application/vnd.balsamiq.bmml+xml":{source:"iana"},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana"},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana"},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana"},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",extensions:["wbs"]},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana"},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana"},"application/vnd.cybank":{source:"iana"},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume-movie":{source:"iana"},"application/vnd.desmume.movie":{source:"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana"},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana"},"application/vnd.dvb.notif-container+xml":{source:"iana"},"application/vnd.dvb.notif-generic+xml":{source:"iana"},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana"},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana"},"application/vnd.dvb.notif-init+xml":{source:"iana"},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana"},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana"},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana"},"application/vnd.eszigno3+xml":{source:"iana",extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana"},"application/vnd.etsi.asic-e+zip":{source:"iana"},"application/vnd.etsi.asic-s+zip":{source:"iana"},"application/vnd.etsi.cug+xml":{source:"iana"},"application/vnd.etsi.iptvcommand+xml":{source:"iana"},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana"},"application/vnd.etsi.iptvprofile+xml":{source:"iana"},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana"},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana"},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana"},"application/vnd.etsi.iptvservice+xml":{source:"iana"},"application/vnd.etsi.iptvsync+xml":{source:"iana"},"application/vnd.etsi.iptvueprofile+xml":{source:"iana"},"application/vnd.etsi.mcid+xml":{source:"iana"},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana"},"application/vnd.etsi.pstn+xml":{source:"iana"},"application/vnd.etsi.sci+xml":{source:"iana"},"application/vnd.etsi.simservs+xml":{source:"iana"},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana"},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana"},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana"},"application/vnd.gov.sk.e-form+zip":{source:"iana"},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana"},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana"},"application/vnd.imagemeter.image+zip":{source:"iana"},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana"},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana"},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana"},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana"},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsitem+xml":{source:"iana"},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana"},"application/vnd.iptc.g2.packageitem+xml":{source:"iana"},"application/vnd.iptc.g2.planningitem+xml":{source:"iana"},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",extensions:["lasxml"]},"application/vnd.liberty-request+xml":{source:"iana"},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",extensions:["lbe"]},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana"},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana"},"application/vnd.marlin.drm.conftoken+xml":{source:"iana"},"application/vnd.marlin.drm.license+xml":{source:"iana"},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana"},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana"},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana"},"application/vnd.ms-printing.printticket+xml":{source:"apache"},"application/vnd.ms-printschematicket+xml":{source:"iana"},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana"},"application/vnd.nokia.iptv.config+xml":{source:"iana"},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana"},"application/vnd.nokia.landmarkcollection+xml":{source:"iana"},"application/vnd.nokia.n-gage.ac+xml":{source:"iana"},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana"},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana"},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana"},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana"},"application/vnd.oipf.dae.xhtml+xml":{source:"iana"},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana"},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana"},"application/vnd.oipf.spdlist+xml":{source:"iana"},"application/vnd.oipf.ueprofile+xml":{source:"iana"},"application/vnd.oipf.userprofile+xml":{source:"iana"},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana"},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.imd+xml":{source:"iana"},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana"},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana"},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana"},"application/vnd.oma.bcast.sprov+xml":{source:"iana"},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana"},"application/vnd.oma.cab-feature-handler+xml":{source:"iana"},"application/vnd.oma.cab-pcc+xml":{source:"iana"},"application/vnd.oma.cab-subs-invite+xml":{source:"iana"},"application/vnd.oma.cab-user-prefs+xml":{source:"iana"},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana"},"application/vnd.oma.group-usage-list+xml":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana"},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana"},"application/vnd.oma.poc.final-report+xml":{source:"iana"},"application/vnd.oma.poc.groups+xml":{source:"iana"},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana"},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana"},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana"},"application/vnd.oma.xcap-directory+xml":{source:"iana"},"application/vnd.omads-email+xml":{source:"iana"},"application/vnd.omads-file+xml":{source:"iana"},"application/vnd.omads-folder+xml":{source:"iana"},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana"},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana"},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana"},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana"},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana"},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana"},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos+xml":{source:"iana"},"application/vnd.paos.xml":{source:"apache"},"application/vnd.patentdive":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana"},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana"},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana"},"application/vnd.radisys.msml+xml":{source:"iana"},"application/vnd.radisys.msml-audit+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana"},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana"},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana"},"application/vnd.radisys.msml-conf+xml":{source:"iana"},"application/vnd.radisys.msml-dialog+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana"},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana"},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana"},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.software602.filler.form+xml":{source:"iana"},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana"},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana"},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.tmd.mediaflex.api+xml":{source:"iana"},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana"},"application/vnd.wv.ssp+xml":{source:"iana"},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana"},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",extensions:["zaz"]},"application/voicexml+xml":{source:"iana",extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana"},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"apache",extensions:["der","crt","pem"]},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana"},"application/xaml+xml":{source:"apache",extensions:["xaml"]},"application/xcap-att+xml":{source:"iana"},"application/xcap-caps+xml":{source:"iana"},"application/xcap-diff+xml":{source:"iana",extensions:["xdf"]},"application/xcap-el+xml":{source:"iana"},"application/xcap-error+xml":{source:"iana"},"application/xcap-ns+xml":{source:"iana"},"application/xcon-conference-info+xml":{source:"iana"},"application/xcon-conference-info-diff+xml":{source:"iana"},"application/xenc+xml":{source:"iana",extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache"},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana"},"application/xmpp+xml":{source:"iana"},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",extensions:["xpl"]},"application/xslt+xml":{source:"iana",extensions:["xslt"]},"application/xspf+xml":{source:"apache",extensions:["xspf"]},"application/xv+xml":{source:"iana",extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana"},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana"},"application/yin+xml":{source:"iana",extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana"},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana"},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tone":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana"},"image/apng":{compressible:!1,extensions:["apng"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana"},"image/emf":{source:"iana"},"image/fits":{source:"iana"},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana"},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana"},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana"},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/tiff-fx":{source:"iana"},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana"},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana"},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana"},"image/vnd.valve.source.texture":{source:"iana"},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana"},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana"},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/vnd.collada+xml":{source:"iana",extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana"},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana"},"model/vnd.parasolid.transmit.binary":{source:"iana"},"model/vnd.parasolid.transmit.text":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.valve.source.compiled-map":{source:"iana"},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana"},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana"},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana",compressible:!1},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fwdred":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shex":{extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana"},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vp8":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}}});var require_mime_db=__commonJS({"../../node_modules/.pnpm/mime-db@1.33.0/node_modules/mime-db/index.js"(exports2,module2){module2.exports=require_db()}});var require_mime_types2=__commonJS({"../../node_modules/.pnpm/mime-types@2.1.18/node_modules/mime-types/index.js"(exports2){"use strict";var db=require_mime_db(),extname3=__require("path").extname,EXTRACT_TYPE_REGEXP=/^\s*([^;\s]*)(?:;|\s|$)/,TEXT_TYPE_REGEXP=/^text\//i;exports2.charset=charset;exports2.charsets={lookup:charset};exports2.contentType=contentType2;exports2.extension=extension;exports2.extensions=Object.create(null);exports2.lookup=lookup;exports2.types=Object.create(null);populateMaps(exports2.extensions,exports2.types);function charset(type){if(!type||typeof type!="string")return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),mime=match&&db[match[1].toLowerCase()];return mime&&mime.charset?mime.charset:match&&TEXT_TYPE_REGEXP.test(match[1])?"UTF-8":!1}function contentType2(str){if(!str||typeof str!="string")return!1;var mime=str.indexOf("/")===-1?exports2.lookup(str):str;if(!mime)return!1;if(mime.indexOf("charset")===-1){var charset2=exports2.charset(mime);charset2&&(mime+="; charset="+charset2.toLowerCase())}return mime}function extension(type){if(!type||typeof type!="string")return!1;var match=EXTRACT_TYPE_REGEXP.exec(type),exts=match&&exports2.extensions[match[1].toLowerCase()];return!exts||!exts.length?!1:exts[0]}function lookup(path6){if(!path6||typeof path6!="string")return!1;var extension2=extname3("x."+path6).toLowerCase().substr(1);return extension2&&exports2.types[extension2]||!1}function populateMaps(extensions,types){var preference=["nginx","apache",void 0,"iana"];Object.keys(db).forEach(function(type){var mime=db[type],exts=mime.extensions;if(!(!exts||!exts.length)){extensions[type]=exts;for(var i=0;i<exts.length;i++){var extension2=exts[i];if(types[extension2]){var from=preference.indexOf(db[types[extension2]].source),to=preference.indexOf(mime.source);if(types[extension2]!=="application/octet-stream"&&(from>to||from===to&&types[extension2].substr(0,12)==="application/"))continue}types[extension2]=type}}})}}});var require_content_disposition=__commonJS({"../../node_modules/.pnpm/content-disposition@0.5.2/node_modules/content-disposition/index.js"(exports2,module2){"use strict";module2.exports=contentDisposition;module2.exports.parse=parse2;var basename2=__require("path").basename,ENCODE_URL_ATTR_CHAR_REGEXP=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,HEX_ESCAPE_REGEXP=/%[0-9A-Fa-f]{2}/,HEX_ESCAPE_REPLACE_REGEXP=/%([0-9A-Fa-f]{2})/g,NON_LATIN1_REGEXP=/[^\x20-\x7e\xa0-\xff]/g,QESC_REGEXP=/\\([\u0000-\u007f])/g,QUOTE_REGEXP=/([\\"])/g,PARAM_REGEXP=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,TEXT_REGEXP=/^[\x20-\x7e\x80-\xff]+$/,TOKEN_REGEXP=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,EXT_VALUE_REGEXP=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,DISPOSITION_TYPE_REGEXP=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function contentDisposition(filename,options){var opts=options||{},type=opts.type||"attachment",params=createparams(filename,opts.fallback);return format(new ContentDisposition(type,params))}function createparams(filename,fallback){if(filename!==void 0){var params={};if(typeof filename!="string")throw new TypeError("filename must be a string");if(fallback===void 0&&(fallback=!0),typeof fallback!="string"&&typeof fallback!="boolean")throw new TypeError("fallback must be a string or boolean");if(typeof fallback=="string"&&NON_LATIN1_REGEXP.test(fallback))throw new TypeError("fallback must be ISO-8859-1 string");var name=basename2(filename),isQuotedString=TEXT_REGEXP.test(name),fallbackName=typeof fallback!="string"?fallback&&getlatin1(name):basename2(fallback),hasFallback=typeof fallbackName=="string"&&fallbackName!==name;return(hasFallback||!isQuotedString||HEX_ESCAPE_REGEXP.test(name))&&(params["filename*"]=name),(isQuotedString||hasFallback)&&(params.filename=hasFallback?fallbackName:name),params}}function format(obj){var parameters=obj.parameters,type=obj.type;if(!type||typeof type!="string"||!TOKEN_REGEXP.test(type))throw new TypeError("invalid type");var string=String(type).toLowerCase();if(parameters&&typeof parameters=="object")for(var param2,params=Object.keys(parameters).sort(),i=0;i<params.length;i++){param2=params[i];var val=param2.substr(-1)==="*"?ustring(parameters[param2]):qstring(parameters[param2]);string+="; "+param2+"="+val}return string}function decodefield(str){var match=EXT_VALUE_REGEXP.exec(str);if(!match)throw new TypeError("invalid extended field value");var charset=match[1].toLowerCase(),encoded=match[2],value,binary=encoded.replace(HEX_ESCAPE_REPLACE_REGEXP,pdecode);switch(charset){case"iso-8859-1":value=getlatin1(binary);break;case"utf-8":value=new Buffer(binary,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return value}function getlatin1(val){return String(val).replace(NON_LATIN1_REGEXP,"?")}function parse2(string){if(!string||typeof string!="string")throw new TypeError("argument string is required");var match=DISPOSITION_TYPE_REGEXP.exec(string);if(!match)throw new TypeError("invalid type format");var index=match[0].length,type=match[1].toLowerCase(),key,names=[],params={},value;for(index=PARAM_REGEXP.lastIndex=match[0].substr(-1)===";"?index-1:index;match=PARAM_REGEXP.exec(string);){if(match.index!==index)throw new TypeError("invalid parameter format");if(index+=match[0].length,key=match[1].toLowerCase(),value=match[2],names.indexOf(key)!==-1)throw new TypeError("invalid duplicate parameter");if(names.push(key),key.indexOf("*")+1===key.length){key=key.slice(0,-1),value=decodefield(value),params[key]=value;continue}typeof params[key]!="string"&&(value[0]==='"'&&(value=value.substr(1,value.length-2).replace(QESC_REGEXP,"$1")),params[key]=value)}if(index!==-1&&index!==string.length)throw new TypeError("invalid parameter format");return new ContentDisposition(type,params)}function pdecode(str,hex){return String.fromCharCode(parseInt(hex,16))}function pencode(char){var hex=String(char).charCodeAt(0).toString(16).toUpperCase();return hex.length===1?"%0"+hex:"%"+hex}function qstring(val){var str=String(val);return'"'+str.replace(QUOTE_REGEXP,"\\$1")+'"'}function ustring(val){var str=String(val),encoded=encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP,pencode);return"UTF-8''"+encoded}function ContentDisposition(type,parameters){this.type=type,this.parameters=parameters}}});var require_path_is_inside=__commonJS({"../../node_modules/.pnpm/path-is-inside@1.0.2/node_modules/path-is-inside/lib/path-is-inside.js"(exports2,module2){"use strict";var path6=__require("path");module2.exports=function(thePath,potentialParent){return thePath=stripTrailingSep(thePath),potentialParent=stripTrailingSep(potentialParent),process.platform==="win32"&&(thePath=thePath.toLowerCase(),potentialParent=potentialParent.toLowerCase()),thePath.lastIndexOf(potentialParent,0)===0&&(thePath[potentialParent.length]===path6.sep||thePath[potentialParent.length]===void 0)};function stripTrailingSep(thePath){return thePath[thePath.length-1]===path6.sep?thePath.slice(0,-1):thePath}}});var require_range_parser=__commonJS({"../../node_modules/.pnpm/range-parser@1.2.0/node_modules/range-parser/index.js"(exports2,module2){"use strict";module2.exports=rangeParser;function rangeParser(size,str,options){var index=str.indexOf("=");if(index===-1)return-2;var arr=str.slice(index+1).split(","),ranges=[];ranges.type=str.slice(0,index);for(var i=0;i<arr.length;i++){var range=arr[i].split("-"),start=parseInt(range[0],10),end=parseInt(range[1],10);isNaN(start)?(start=size-end,end=size-1):isNaN(end)&&(end=size-1),end>size-1&&(end=size-1),!(isNaN(start)||isNaN(end)||start>end||start<0)&&ranges.push({start,end})}return ranges.length<1?-1:options&&options.combine?combineRanges(ranges):ranges}function combineRanges(ranges){for(var ordered=ranges.map(mapWithIndex).sort(sortByRangeStart),j=0,i=1;i<ordered.length;i++){var range=ordered[i],current=ordered[j];range.start>current.end+1?ordered[++j]=range:range.end>current.end&&(current.end=range.end,current.index=Math.min(current.index,range.index))}ordered.length=j+1;var combined=ordered.sort(sortByRangeIndex).map(mapWithoutIndex);return combined.type=ranges.type,combined}function mapWithIndex(range,index){return{start:range.start,end:range.end,index}}function mapWithoutIndex(range){return{start:range.start,end:range.end}}function sortByRangeIndex(a,b){return a.index-b.index}function sortByRangeStart(a,b){return a.start-b.start}}});var require_directory=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/directory.js"(exports2,module2){(function(){function directory(it){var encodeHTML6=typeof _encodeHTML<"u"?_encodeHTML:function(doNotSkipEncoded){var encodeHTMLRules={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}(),out='<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Files within '+encodeHTML6(it.directory)+`</title> <style>body { margin: 0; padding: 30px; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased;}main { max-width: 920px;}header { display: flex; justify-content: space-between; flex-wrap: wrap;}h1 { font-size: 18px; font-weight: 500; margin-top: 0; color: #000;}header h1 a { font-size: 18px; font-weight: 500; margin-top: 0; color: #000;}h1 i { font-style: normal;}ul { margin: 0 0 0 -2px; padding: 20px 0 0 0;}ul li { list-style: none; font-size: 14px; display: flex; justify-content: space-between;}a { text-decoration: none;}ul a { color: #000; padding: 10px 5px; margin: 0 -5px; white-space: nowrap; overflow: hidden; display: block; width: 100%; text-overflow: ellipsis;}header a { color: #0076FF; font-size: 11px; font-weight: 400; display: inline-block; line-height: 20px;}svg { height: 13px; vertical-align: text-bottom;}ul a::before { display: inline-block; vertical-align: middle; margin-right: 10px; width: 24px; text-align: center; line-height: 12px;}ul a.file::before { content: url("data:image/svg+xml;utf8,<svg width='15' height='19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 8C8.34 8 7 6.66 7 5V1H3c-1.1 0-2 .9-2 2v13c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V8h-4zM8 5c0 1.1.9 2 2 2h3.59L8 1.41V5zM3 0h5l7 7v9c0 1.66-1.34 3-3 3H3c-1.66 0-3-1.34-3-3V3c0-1.66 1.34-3 3-3z' fill='black'/></svg>");}ul a:hover { text-decoration: underline;}ul a.folder::before { content: url("data:image/svg+xml;utf8,<svg width='20' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M18.784 3.87a1.565 1.565 0 0 0-.565-.356V2.426c0-.648-.523-1.171-1.15-1.171H8.996L7.908.25A.89.89 0 0 0 7.302 0H2.094C1.445 0 .944.523.944 1.171v2.3c-.21.085-.398.21-.565.356a1.348 1.348 0 0 0-.377 1.004l.398 9.83C.42 15.393 1.048 16 1.8 16h15.583c.753 0 1.36-.586 1.4-1.339l.398-9.83c.021-.313-.125-.69-.397-.962zM1.843 3.41V1.191c0-.146.104-.272.25-.272H7.26l1.234 1.088c.083.042.167.104.293.104h8.282c.125 0 .25.126.25.272V3.41H1.844zm15.54 11.712H1.78a.47.47 0 0 1-.481-.46l-.397-9.83c0-.147.041-.252.125-.356a.504.504 0 0 1 .377-.147H17.78c.125 0 .272.063.377.147.083.083.125.209.125.334l-.418 9.83c-.021.272-.23.482-.481.482z' fill='black'/></svg>");}ul a.lambda::before { content: url("data:image/svg+xml; utf8,<svg width='15' height='19' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M3.5 14.4354H5.31622L7.30541 9.81311H7.43514L8.65315 13.0797C9.05676 14.1643 9.55405 14.5 10.7 14.5C11.0171 14.5 11.291 14.4677 11.5 14.4032V13.1572C11.3847 13.1766 11.2622 13.2024 11.1541 13.2024C10.6351 13.2024 10.3829 13.0281 10.1595 12.4664L8.02613 7.07586C7.21171 5.01646 6.54865 4.5 5.11441 4.5C4.83333 4.5 4.62432 4.53228 4.37207 4.59038V5.83635C4.56667 5.81052 4.66036 5.79761 4.77568 5.79761C5.64775 5.79761 5.9 6.0042 6.4045 7.19852L6.64234 7.77954L3.5 14.4354Z' fill='black'/><rect x='0.5' y='0.5' width='14' height='18' rx='2.5' stroke='black'/></svg>");}ul a.file.gif::before,ul a.file.jpg::before,ul a.file.png::before,ul a.file.svg::before { content: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'><rect x='6' y='6' width='68' height='68' rx='5' ry='5'/><circle cx='24' cy='24' r='8'/><path d='M73 49L59 34 37 52m16 20L27 42 7 58'/></svg>");}::selection { background-color: #79FFE1; color: #000;}::-moz-selection { background-color: #79FFE1; color: #000;}@media (min-width: 768px) { ul {display: flex;flex-wrap: wrap; } ul li {width: 230px;padding-right: 20px; }}@media (min-width: 992px) { body {padding: 45px; } h1, header h1 a {font-size: 15px; } ul li {font-size: 13px;box-sizing: border-box;justify-content: flex-start; }}</style> </head> <body> <main> <header> <h1> <i>Index of </i> `,arr1=it.paths;if(arr1)for(var value,index=-1,l1=arr1.length-1;index<l1;)value=arr1[index+=1],out+=' <a href="/'+encodeHTML6(value.url)+'">'+encodeHTML6(value.name)+"</a> ";out+=' </h1> </header> <ul id="files"> ';var arr2=it.files;if(arr2)for(var value,index=-1,l2=arr2.length-1;index<l2;)value=arr2[index+=1],out+=' <li> <a href="'+encodeHTML6(value.relative)+'" title="'+encodeHTML6(value.title)+'" class="'+encodeHTML6(value.type)+" "+encodeHTML6(value.ext)+'">'+encodeHTML6(value.base)+"</a> </li> ";return out+=" </ul></main> </body></html>",out}var itself=directory,_encodeHTML=function(doNotSkipEncoded){var encodeHTMLRules={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}();typeof module2<"u"&&module2.exports?module2.exports=itself:typeof define=="function"?define(function(){return itself}):(window.render=window.render||{},window.render.directory=itself)})()}});var require_error=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/error.js"(exports2,module2){(function(){function error2(it){var out='<!DOCTYPE html><head> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/> <style> body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; } main, aside, section { display: flex; justify-content: center; align-items: center; flex-direction: column; } main { height: 100%; } aside { background: #000; flex-shrink: 1; padding: 30px 20px; } aside p { margin: 0; color: #999999; font-size: 14px; line-height: 24px; } aside a { color: #fff; text-decoration: none; } section span { font-size: 24px; font-weight: 500; display: block; border-bottom: 1px solid #EAEAEA; text-align: center; padding-bottom: 20px; width: 100px; } section p { font-size: 14px; font-weight: 400; } section span + p { margin: 20px 0 0 0; } @media (min-width: 768px) { section { height: 40px; flex-direction: row; } section span, section p { height: 100%; line-height: 40px; } section span { border-bottom: 0; border-right: 1px solid #EAEAEA; padding: 0 20px 0 0; width: auto; } section span + p { margin: 0; padding-left: 20px; } aside { padding: 50px 0; } aside p { max-width: 520px; text-align: center; } } </style></head><body> <main> <section> <span>'+it.statusCode+"</span> <p>"+it.message+"</p> </section> </main></body>";return out}var itself=error2,_encodeHTML=function(doNotSkipEncoded){var encodeHTMLRules={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},matchHTML=doNotSkipEncoded?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(code){return code?code.toString().replace(matchHTML,function(m){return encodeHTMLRules[m]||m}):""}}();typeof module2<"u"&&module2.exports?module2.exports=itself:typeof define=="function"?define(function(){return itself}):(window.render=window.render||{},window.render.error=itself)})()}});var require_src2=__commonJS({"../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/index.js"(exports2,module2){var{promisify}=__require("util"),path6=__require("path"),{createHash}=__require("crypto"),{realpath,lstat:lstat2,createReadStream,readdir:readdir2}=__require("fs"),url4=require_urlparser(),slasher=require_glob_slash(),minimatch4=require_minimatch2(),pathToRegExp=require_path_to_regexp(),mime=require_mime_types2(),bytes2=require_bytes(),contentDisposition=require_content_disposition(),isPathInside=require_path_is_inside(),parseRange=require_range_parser(),directoryTemplate2=require_directory(),errorTemplate=require_error(),etags=new Map,calculateSha=(handlers,absolutePath)=>new Promise((resolve3,reject)=>{let hash=createHash("sha1");hash.update(path6.extname(absolutePath)),hash.update("-");let rs=handlers.createReadStream(absolutePath);rs.on("error",reject),rs.on("data",buf=>hash.update(buf)),rs.on("end",()=>{let sha=hash.digest("hex");resolve3(sha)})}),sourceMatches=(source,requestPath,allowSegments)=>{let keys=[],slashed=slasher(source),resolvedPath=path6.posix.resolve(requestPath),results=null;if(allowSegments){let normalized=slashed.replace("*","(.*)");results=pathToRegExp(normalized,keys).exec(resolvedPath),results||(keys.length=0)}return results||minimatch4(resolvedPath,slashed)?{keys,results}:null},toTarget=(source,destination,previousPath)=>{let matches=sourceMatches(source,previousPath,!0);if(!matches)return null;let{keys,results}=matches,props={},{protocol}=url4.parse(destination),normalizedDest=protocol?destination:slasher(destination),toPath=pathToRegExp.compile(normalizedDest);for(let index=0;index<keys.length;index++){let{name}=keys[index];props[name]=results[index+1]}return toPath(props)},applyRewrites=(requestPath,rewrites=[],repetitive)=>{let rewritesCopy=rewrites.slice(),fallback=repetitive?requestPath:null;if(rewritesCopy.length===0)return fallback;for(let index=0;index<rewritesCopy.length;index++){let{source,destination}=rewrites[index],target=toTarget(source,destination,requestPath);if(target)return rewritesCopy.splice(index,1),applyRewrites(slasher(target),rewritesCopy,!0)}return fallback},ensureSlashStart=target=>target.startsWith("/")?target:`/${target}`,shouldRedirect=(decodedPath,{redirects=[],trailingSlash},cleanUrl)=>{let slashing=typeof trailingSlash=="boolean",defaultType=301,matchHTML=/(\.html|\/index)$/g;if(redirects.length===0&&!slashing&&!cleanUrl)return null;let cleanedUrl=!1;if(cleanUrl&&matchHTML.test(decodedPath)&&(decodedPath=decodedPath.replace(matchHTML,""),cleanedUrl=!0),slashing){let{ext,name}=path6.parse(decodedPath),isTrailed=decodedPath.endsWith("/"),isDotfile=name.startsWith("."),target=null;if(!trailingSlash&&isTrailed?target=decodedPath.slice(0,-1):trailingSlash&&!isTrailed&&!ext&&!isDotfile&&(target=`${decodedPath}/`),decodedPath.indexOf("//")>-1&&(target=decodedPath.replace(/\/+/g,"/")),target)return{target:ensureSlashStart(target),statusCode:defaultType}}if(cleanedUrl)return{target:ensureSlashStart(decodedPath),statusCode:defaultType};for(let index=0;index<redirects.length;index++){let{source,destination,type}=redirects[index],target=toTarget(source,destination,decodedPath);if(target)return{target,statusCode:type||defaultType}}return null},appendHeaders=(target,source)=>{for(let index=0;index<source.length;index++){let{key,value}=source[index];target[key]=value}},getHeaders=async(handlers,config,current,absolutePath,stats)=>{let{headers:customHeaders=[],etag=!1}=config,related={},{base}=path6.parse(absolutePath),relativePath=path6.relative(current,absolutePath);if(customHeaders.length>0)for(let index=0;index<customHeaders.length;index++){let{source,headers:headers2}=customHeaders[index];sourceMatches(source,slasher(relativePath))&&appendHeaders(related,headers2)}let defaultHeaders={};if(stats){if(defaultHeaders={"Content-Length":stats.size,"Content-Disposition":contentDisposition(base,{type:"inline"}),"Accept-Ranges":"bytes"},etag){let[mtime,sha]=etags.get(absolutePath)||[];Number(mtime)!==Number(stats.mtime)&&(sha=await calculateSha(handlers,absolutePath),etags.set(absolutePath,[stats.mtime,sha])),defaultHeaders.ETag=`"${sha}"`}else defaultHeaders["Last-Modified"]=stats.mtime.toUTCString();let contentType2=mime.contentType(base);contentType2&&(defaultHeaders["Content-Type"]=contentType2)}let headers=Object.assign(defaultHeaders,related);for(let key in headers)headers.hasOwnProperty(key)&&headers[key]===null&&delete headers[key];return headers},applicable=(decodedPath,configEntry)=>{if(typeof configEntry=="boolean")return configEntry;if(Array.isArray(configEntry)){for(let index=0;index<configEntry.length;index++){let source=configEntry[index];if(sourceMatches(source,decodedPath))return!0}return!1}return!0},getPossiblePaths=(relativePath,extension)=>[path6.join(relativePath,`index${extension}`),relativePath.endsWith("/")?relativePath.replace(/\/$/g,extension):relativePath+extension].filter(item=>path6.basename(item)!==extension),findRelated=async(current,relativePath,rewrittenPath,originalStat)=>{let possible=rewrittenPath?[rewrittenPath]:getPossiblePaths(relativePath,".html"),stats=null;for(let index=0;index<possible.length;index++){let related=possible[index],absolutePath=path6.join(current,related);try{stats=await originalStat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")throw err}if(stats)return{stats,absolutePath}}return null},canBeListed=(excluded,file)=>{let slashed=slasher(file),whether=!0;for(let mark=0;mark<excluded.length;mark++){let source=excluded[mark];if(sourceMatches(source,slashed)){whether=!1;break}}return whether},renderDirectory=async(current,acceptsJSON,handlers,methods,config,paths)=>{let{directoryListing,trailingSlash,unlisted=[],renderSingle}=config,slashSuffix=typeof trailingSlash=="boolean"?trailingSlash?"/":"":"/",{relativePath,absolutePath}=paths,excluded=[".DS_Store",".git",...unlisted];if(!applicable(relativePath,directoryListing)&&!renderSingle)return{};let files=await handlers.readdir(absolutePath),canRenderSingle=renderSingle&&files.length===1;for(let index=0;index<files.length;index++){let file=files[index],filePath=path6.resolve(absolutePath,file),details=path6.parse(filePath),stats=null;if(methods.lstat?stats=await handlers.lstat(filePath,!0):stats=await handlers.lstat(filePath),details.relative=path6.join(relativePath,details.base),stats.isDirectory())details.base+=slashSuffix,details.relative+=slashSuffix,details.type="folder";else{if(canRenderSingle)return{singleFile:!0,absolutePath:filePath,stats};details.ext=details.ext.split(".")[1]||"txt",details.type="file",details.size=bytes2(stats.size,{unitSeparator:" ",decimalPlaces:0})}details.title=details.base,canBeListed(excluded,file)?files[index]=details:delete files[index]}let toRoot=path6.relative(current,absolutePath),directory=path6.join(path6.basename(current),toRoot,slashSuffix),pathParts=directory.split(path6.sep).filter(Boolean);if(files=files.sort((a,b)=>{let aIsDir=a.type==="directory",bIsDir=b.type==="directory";return aIsDir&&!bIsDir?-1:bIsDir&&!aIsDir||a.base>b.base?1:a.base<b.base?-1:0}).filter(Boolean),toRoot.length>0){let directoryPath=[...pathParts].slice(1),relative4=path6.join("/",...directoryPath,"..",slashSuffix);files.unshift({type:"directory",base:"..",relative:relative4,title:relative4,ext:""})}let subPaths=[];for(let index=0;index<pathParts.length;index++){let parents=[],isLast=index===pathParts.length-1,before=0;for(;before<=index;)parents.push(pathParts[before]),before++;parents.shift(),subPaths.push({name:pathParts[index]+(isLast?slashSuffix:"/"),url:index===0?"":parents.join("/")+slashSuffix})}let spec={files,directory,paths:subPaths};return{directory:acceptsJSON?JSON.stringify(spec):directoryTemplate2(spec)}},sendError=async(absolutePath,response,acceptsJSON,current,handlers,config,spec)=>{let{err:original,message:message2,code,statusCode}=spec;if(original&&process.env.NODE_ENV!=="test"&&console.error(original),response.statusCode=statusCode,acceptsJSON){response.setHeader("Content-Type","application/json; charset=utf-8"),response.end(JSON.stringify({error:{code,message:message2}}));return}let stats=null,errorPage=path6.join(current,`${statusCode}.html`);try{stats=await handlers.lstat(errorPage)}catch(err){err.code!=="ENOENT"&&console.error(err)}if(stats){let stream=null;try{stream=await handlers.createReadStream(errorPage);let headers2=await getHeaders(handlers,config,current,errorPage,stats);response.writeHead(statusCode,headers2),stream.pipe(response);return}catch(err){console.error(err)}}let headers=await getHeaders(handlers,config,current,absolutePath,null);headers["Content-Type"]="text/html; charset=utf-8",response.writeHead(statusCode,headers),response.end(errorTemplate({statusCode,message:message2}))},internalError=async(...args2)=>{let lastIndex=args2.length-1,err=args2[lastIndex];return args2[lastIndex]={statusCode:500,code:"internal_server_error",message:"A server error has occurred",err},sendError(...args2)},getHandlers=methods=>Object.assign({lstat:promisify(lstat2),realpath:promisify(realpath),createReadStream,readdir:promisify(readdir2),sendError},methods);module2.exports=async(request,response,config={},methods={})=>{let cwd=process.cwd(),current=config.public?path6.resolve(cwd,config.public):cwd,handlers=getHandlers(methods),relativePath=null,acceptsJSON=null;request.headers.accept&&(acceptsJSON=request.headers.accept.includes("application/json"));try{relativePath=decodeURIComponent(url4.parse(request.url).pathname)}catch{return sendError("/",response,acceptsJSON,current,handlers,config,{statusCode:400,code:"bad_request",message:"Bad Request"})}let absolutePath=path6.join(current,relativePath);if(!isPathInside(absolutePath,current))return sendError(absolutePath,response,acceptsJSON,current,handlers,config,{statusCode:400,code:"bad_request",message:"Bad Request"});let cleanUrl=applicable(relativePath,config.cleanUrls),redirect2=shouldRedirect(relativePath,config,cleanUrl);if(redirect2){response.writeHead(redirect2.statusCode,{Location:encodeURI(redirect2.target)}),response.end();return}let stats=null;if(path6.extname(relativePath)!=="")try{stats=await handlers.lstat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}let rewrittenPath=applyRewrites(relativePath,config.rewrites);if(!stats&&(cleanUrl||rewrittenPath))try{let related=await findRelated(current,relativePath,rewrittenPath,handlers.lstat);related&&({stats,absolutePath}=related)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(!stats)try{stats=await handlers.lstat(absolutePath)}catch(err){if(err.code!=="ENOENT"&&err.code!=="ENOTDIR")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(stats&&stats.isDirectory()){let directory=null,singleFile=null;try{let related=await renderDirectory(current,acceptsJSON,handlers,methods,config,{relativePath,absolutePath});related.singleFile?{stats,absolutePath,singleFile}=related:{directory}=related}catch(err){if(err.code!=="ENOENT")return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}if(directory){let contentType2=acceptsJSON?"application/json; charset=utf-8":"text/html; charset=utf-8";response.statusCode=200,response.setHeader("Content-Type",contentType2),response.end(directory);return}singleFile||(stats=null)}let isSymLink=stats&&stats.isSymbolicLink();if(!stats||!config.symlinks&&isSymLink)return handlers.sendError(absolutePath,response,acceptsJSON,current,handlers,config,{statusCode:404,code:"not_found",message:"The requested path could not be found"});isSymLink&&(absolutePath=await handlers.realpath(absolutePath),stats=await handlers.lstat(absolutePath));let streamOpts={};if(request.headers.range&&stats.size){let range=parseRange(stats.size,request.headers.range);if(typeof range=="object"&&range.type==="bytes"){let{start,end}=range[0];streamOpts.start=start,streamOpts.end=end,response.statusCode=206}else response.statusCode=416,response.setHeader("Content-Range",`bytes */${stats.size}`)}let stream=null;try{stream=await handlers.createReadStream(absolutePath,streamOpts)}catch(err){return internalError(absolutePath,response,acceptsJSON,current,handlers,config,err)}let headers=await getHeaders(handlers,config,current,absolutePath,stats);if(streamOpts.start!==void 0&&streamOpts.end!==void 0&&(headers["Content-Range"]=`bytes ${streamOpts.start}-${streamOpts.end}/${stats.size}`,headers["Content-Length"]=streamOpts.end-streamOpts.start+1),request.headers.range==null&&headers.ETag&&headers.ETag===request.headers["if-none-match"]){response.statusCode=304,response.end();return}response.writeHead(response.statusCode||200,headers),stream.pipe(response)}}});var require_dist6=__commonJS({"../../node_modules/.pnpm/pcre-to-regexp@1.0.0/node_modules/pcre-to-regexp/dist/index.js"(exports2,module2){"use strict";var characterClasses={alnum:"[A-Za-z0-9]",word:"[A-Za-z0-9_]",alpha:"[A-Za-z]",blank:"[ \\t]",cntrl:"[\\x00-\\x1F\\x7F]",digit:"\\d",graph:"[\\x21-\\x7E]",lower:"[a-z]",print:"[\\x20-\\x7E]",punct:"[\\]\\[!\"#$%&'()*+,./:;<=>?@\\\\^_`{|}~-]",space:"\\s",upper:"[A-Z]",xdigit:"[A-Fa-f0-9]"};function createPCRE(pattern,namedCaptures){pattern=String(pattern||"").trim();let originalPattern=pattern,delim,flags="";if(/^[^a-zA-Z\\\s]/.test(pattern)){delim=pattern[0];let lastDelimIndex=pattern.lastIndexOf(delim);flags+=pattern.substring(lastDelimIndex+1),pattern=pattern.substring(1,lastDelimIndex)}let numGroups=0;pattern=replaceCaptureGroups(pattern,group=>{if(/^\(\?[P<']/.test(group)){let match=/^\(\?P?[<']([^>']+)[>']/.exec(group);if(!match)throw new Error(`Failed to extract named captures from ${JSON.stringify(group)}`);let capture=group.substring(match[0].length,group.length-1);return namedCaptures&&(namedCaptures[numGroups]=match[1]),numGroups++,`(${capture})`}return group.substring(0,3)==="(?:"||numGroups++,group}),pattern=pattern.replace(/\[:([^:]+):\]/g,(characterClass,name)=>characterClasses[name]||characterClass);let regexp=new RegExp(pattern,flags);return regexp.delimiter=delim,regexp.pcrePattern=originalPattern,regexp.pcreFlags=flags,regexp}function replaceCaptureGroups(pattern,fn2){let start=0,depth=0,escaped=!1;for(let i=0;i<pattern.length;i++){let cur=pattern[i];if(escaped){escaped=!1;continue}switch(cur){case"(":depth===0&&(start=i),depth++;break;case")":if(depth>0&&(depth--,depth===0)){let end=i+1,l=start===0?"":pattern.substring(0,start),r=pattern.substring(end),v=String(fn2(pattern.substring(start,end)));pattern=l+v+r,i=start}break;case"\\":escaped=!0;break;default:break}}return pattern}createPCRE.characterClasses=characterClasses;module2.exports=createPCRE}});var require_dist7=__commonJS({"../../node_modules/.pnpm/@tootallnate+once@1.1.2/node_modules/@tootallnate/once/dist/index.js"(exports2,module2){"use strict";function noop(){}function once2(emitter,name){let o=once2.spread(emitter,name),r=o.then(args2=>args2[0]);return r.cancel=o.cancel,r}(function(once3){function spread(emitter,name){let c=null,p=new Promise((resolve3,reject)=>{function cancel(){emitter.removeListener(name,onEvent),emitter.removeListener("error",onError),p.cancel=noop}function onEvent(...args2){cancel(),resolve3(args2)}function onError(err){cancel(),reject(err)}c=cancel,emitter.on(name,onEvent),emitter.on("error",onError)});if(!c)throw new TypeError("Could not get `cancel()` function");return p.cancel=c,p}once3.spread=spread})(once2||(once2={}));module2.exports=once2}});var require_get_port=__commonJS({"../../node_modules/.pnpm/get-port@5.1.1/node_modules/get-port/index.js"(exports2,module2){"use strict";var net=__require("net"),Locked=class extends Error{constructor(port){super(`${port} is locked`)}},lockedPorts={old:new Set,young:new Set},releaseOldLockedPortsIntervalMs=1e3*15,interval,getAvailablePort=options=>new Promise((resolve3,reject)=>{let server=net.createServer();server.unref(),server.on("error",reject),server.listen(options,()=>{let{port}=server.address();server.close(()=>{resolve3(port)})})}),portCheckSequence=function*(ports){ports&&(yield*ports),yield 0};module2.exports=async options=>{let ports;options&&(ports=typeof options.port=="number"?[options.port]:options.port),interval===void 0&&(interval=setInterval(()=>{lockedPorts.old=lockedPorts.young,lockedPorts.young=new Set},releaseOldLockedPortsIntervalMs),interval.unref&&interval.unref());for(let port of portCheckSequence(ports))try{let availablePort=await getAvailablePort({...options,port});for(;lockedPorts.old.has(availablePort)||lockedPorts.young.has(availablePort);){if(port!==0)throw new Locked(port);availablePort=await getAvailablePort({...options,port})}return lockedPorts.young.add(availablePort),availablePort}catch(error2){if(!["EADDRINUSE","EACCES"].includes(error2.code)&&!(error2 instanceof Locked))throw error2}throw new Error("No available ports found")};module2.exports.makeRange=(from,to)=>{if(!Number.isInteger(from)||!Number.isInteger(to))throw new TypeError("`from` and `to` must be integer numbers");if(from<1024||from>65535)throw new RangeError("`from` must be between 1024 and 65535");if(to<1024||to>65536)throw new RangeError("`to` must be between 1024 and 65536");if(to<from)throw new RangeError("`to` must be greater than or equal to `from`");return function*(from2,to2){for(let port=from2;port<=to2;port++)yield port}(from,to)}}});var require_is_port_reachable=__commonJS({"../../node_modules/.pnpm/is-port-reachable@3.1.0/node_modules/is-port-reachable/index.js"(exports2,module2){"use strict";var net=__require("net");module2.exports=async(port,{timeout=1e3,host}={})=>{let promise=new Promise((resolve3,reject)=>{let socket=new net.Socket,onError=()=>{socket.destroy(),reject()};socket.setTimeout(timeout),socket.once("error",onError),socket.once("timeout",onError),socket.connect(port,host,()=>{socket.end(),resolve3()})});try{return await promise,!0}catch{return!1}}}});var require_tree_kill=__commonJS({"../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports2,module2){"use strict";var childProcess=__require("child_process"),spawn=childProcess.spawn,exec=childProcess.exec;module2.exports=function(pid,signal,callback){if(typeof signal=="function"&&callback===void 0&&(callback=signal,signal=void 0),pid=parseInt(pid),Number.isNaN(pid)){if(callback)return callback(new Error("pid must be a number"));throw new Error("pid must be a number")}var tree={},pidsToProcess={};switch(tree[pid]=[],pidsToProcess[pid]=1,process.platform){case"win32":exec("taskkill /pid "+pid+" /T /F",callback);break;case"darwin":buildProcessTree(pid,tree,pidsToProcess,function(parentPid){return spawn("pgrep",["-P",parentPid])},function(){killAll(tree,signal,callback)});break;default:buildProcessTree(pid,tree,pidsToProcess,function(parentPid){return spawn("ps",["-o","pid","--no-headers","--ppid",parentPid])},function(){killAll(tree,signal,callback)});break}};function killAll(tree,signal,callback){var killed={};try{Object.keys(tree).forEach(function(pid){tree[pid].forEach(function(pidpid){killed[pidpid]||(killPid(pidpid,signal),killed[pidpid]=1)}),killed[pid]||(killPid(pid,signal),killed[pid]=1)})}catch(err){if(callback)return callback(err);throw err}if(callback)return callback()}function killPid(pid,signal){try{process.kill(parseInt(pid,10),signal)}catch(err){if(err.code!=="ESRCH")throw err}}function buildProcessTree(parentPid,tree,pidsToProcess,spawnChildProcessesList,cb){var ps=spawnChildProcessesList(parentPid),allData="";ps.stdout.on("data",function(data){var data=data.toString("ascii");allData+=data});var onClose=function(code){if(delete pidsToProcess[parentPid],code!=0){Object.keys(pidsToProcess).length==0&&cb();return}allData.match(/\d+/g).forEach(function(pid){pid=parseInt(pid,10),tree[parentPid].push(pid),tree[pid]=[],pidsToProcess[pid]=1,buildProcessTree(pid,tree,pidsToProcess,spawnChildProcessesList,cb)})};ps.on("close",onClose)}}});var require_escape_html=__commonJS({"../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js"(exports2,module2){"use strict";var matchHtmlRegExp=/["'&<>]/;module2.exports=escapeHtml;function escapeHtml(string){var str=""+string,match=matchHtmlRegExp.exec(str);if(!match)return str;var escape2,html="",index=0,lastIndex=0;for(index=match.index;index<str.length;index++){switch(str.charCodeAt(index)){case 34:escape2=""";break;case 38:escape2="&";break;case 39:escape2="'";break;case 60:escape2="<";break;case 62:escape2=">";break;default:continue}lastIndex!==index&&(html+=str.substring(lastIndex,index)),lastIndex=index+1,html+=escape2}return lastIndex!==index?html+str.substring(lastIndex,index):html}}});var import_chalk4=__toESM(require_source(),1);import path5 from"path";var import_chalk3=__toESM(require_source(),1),import_ms8=__toESM(require_ms(),1),import_fs_extra2=__toESM(require_lib(),1),import_fs_detectors3=__toESM(require_dist4(),1),import_frameworks4=__toESM(require_frameworks(),1);import{resolve as resolve2,join as join6}from"path";var import_fs_extra=__toESM(require_lib(),1),import_ms6=__toESM(require_ms(),1),import_chalk2=__toESM(require_source(),1);import url3,{URL as URL2}from"url";import http from"http";import{Socket}from"net";var import_pluralize2=__toESM(require_pluralize(),1),import_raw_body=__toESM(require_raw_body(),1),import_async_listen=__toESM(require_dist2(),1),import_minimatch3=__toESM(require_minimatch(),1),import_http_proxy_node16=__toESM(require_http_proxy_node16(),1),import_serve_handler=__toESM(require_src2(),1),import_pcre_to_regexp2=__toESM(require_dist6(),1),import_dotenv=__toESM(require_main(),1),import_once=__toESM(require_dist7(),1),import_directory=__toESM(require_directory(),1),import_get_port2=__toESM(require_get_port(),1),import_fast_deep_equal=__toESM(require_fast_deep_equal(),1);import{randomBytes as randomBytes2,timingSafeEqual}from"crypto";import{watch}from"chokidar";import path4,{isAbsolute as isAbsolute3,basename,dirname as dirname3,extname as extname2,join as join4,sep as sep2}from"path";var import_is_port_reachable=__toESM(require_is_port_reachable(),1);var import_build_utils=__toESM(require_build_utils(),1),import_ms=__toESM(require_ms(),1),REPORT_A_BUG="This is likely a bug in the Vercel CLI. Please report it at https://vercel.com/help.",REPORT_A_BUILDER_BUG="This is likely a bug in the Builder that produced this function. Report it to the Builder's author, or at https://vercel.com/help for an official `@vercel/*` Builder.",dev=defineDiagnostics({codes:{DEV_RECURSIVE_INVOCATION:{why:"`vercel dev` must not recursively invoke itself",fix:"Check the Development Command in your Project Settings and the `dev` script in `package.json` \u2014 neither should call `vercel dev`.",docs:"https://vercel.link/recursive-invocation-of-commands"},DEV_LOCK_HELD:{why:"Another `vercel dev` process is already running for this project",fix:p=>p.detail},DEV_INVALID_WINDOWS_PIPE:{why:p=>`Invalid Windows named pipe endpoint: ${p.endpoint}`,fix:"Use a pipe path beginning with `\\\\.\\`, e.g. `pipe:\\\\.\\pipe\\my-app`."},DEV_INVALID_UNIX_SOCKET:{why:p=>`Invalid UNIX domain socket endpoint: ${p.endpoint}`,fix:"Provide a socket path, e.g. `unix:/tmp/my-app.sock`."},DEV_INVALID_LISTEN_SCHEME:{why:p=>`Unknown \`--listen\` scheme (protocol): ${p.protocol}`,fix:"Use a port (e.g. `3000`), or a `tcp:`, `unix:`, or `pipe:` endpoint."},DEV_PORT_DETECTION_TIMED_OUT:{why:p=>`Detecting port ${p.port} timed out after ${(0,import_ms.default)(p.timeout)}`,fix:"Ensure your Development Command starts a server that listens on the expected port."},DEV_BUILDER_LOAD_FAILED:{why:p=>`Failed to load Builder "${p.use}"`,fix:"Check that the Builder is installed and spelled correctly in your `vercel.json` `builds` configuration."},DEV_SIDECAR_UNSUPPORTED_TYPE:{why:p=>`Development sidecar "${p.name}" has unsupported type "${p.type}"`,fix:REPORT_A_BUILDER_BUG},DEV_SIDECAR_DUPLICATE_NAME:{why:p=>`Multiple builders contributed a development sidecar named "${p.name}"`,fix:REPORT_A_BUILDER_BUG},DEV_QUEUE_CONSUMER_DUPLICATE:{why:p=>`Queue consumer "${p.consumerGroup}" is configured more than once for topic "${p.topic}"`,fix:"Remove the duplicate consumer configuration so each consumer subscribes to a topic only once."},DEV_QUEUE_FUNCTION_UNSUPPORTED:{why:p=>`Can't register the queue trigger for "${p.sourceFile}": ${p.reason}.`,fix:"Use an endpoint supported by the builder for local queue delivery, or test this trigger in a deployment."},DEV_FUNCTION_MANIFEST_INVALID:{why:p=>`Builder "${p.use}" returned an invalid development function manifest.`,fix:"Check getDevManifest output identities, invocation paths, and normalized trigger metadata. Paths must not contain an origin, query, fragment, or traversal."},DEV_FUNCTION_OUTPUT_DUPLICATE:{why:p=>`Development function output "${p.outputPath}" is configured more than once.`,fix:"Each deployment function output must have one owner."},DEV_QUEUE_FUNCTION_UNMATCHED:{why:p=>`No local queue endpoint matches functions["${p.pattern}"]. Its queue trigger will not receive messages.`,fix:"Check the source path and earlier functions entries. The builder must support getDevManifest or a conventional per-entrypoint function build."},DEV_SERVICE_NO_DEV_SERVER:{why:p=>`No dev server available for service "${p.name}" (framework: ${p.framework})`,fix:"Add a Development Command for this service, or set its framework so one can be detected."},DEV_SERVICE_NO_PID:{why:p=>`Failed to start service "${p.name}": no PID returned`,fix:"Verify the service Development Command is executable and starts successfully."},DEV_SERVICE_NO_STDIO:{why:p=>`Failed to start service "${p.name}": expected child process to have stdout and stderr`,fix:REPORT_A_BUG},DEV_BUILDER_RESULT_NOT_LAMBDA:{why:'The result of "builder.build()" must be a `Lambda`',fix:REPORT_A_BUILDER_BUG},DEV_BUILDER_RESULT_HAS_MAXDURATION:{why:'The result of "builder.build()" must not contain `maxDuration`',fix:REPORT_A_BUILDER_BUG},DEV_BUILDER_RESULT_HAS_MEMORY:{why:'The result of "builder.build()" must not contain `memory`',fix:REPORT_A_BUILDER_BUG},DEV_UNSUPPORTED_BUILDER_VERSION:{why:p=>`${p.titleName} CLI does not support builder version ${p.version}`,fix:p=>p.updateMessage},DEV_INVALID_ROUTES:{why:p=>p.message,fix:REPORT_A_BUILDER_BUG},DEV_LISTEN_ADDRESS_IN_USE:{why:p=>`Requested socket ${p.address} is already in use`,fix:"Stop the process using that socket, or pass a different `--listen` address."},DEV_UNSUPPORTED_CONFIG_VERSION:{why:"Cannot run `version: 1` projects",fix:'Upgrade the project to the current configuration \u2014 remove `"version": 1` from your `vercel.json`.'},DEV_CWD_NOT_FOUND:{why:p=>`Directory \`${p.cwd}\` does not exist`,fix:"Run the command from an existing directory, or pass a valid path."},DEV_CWD_NOT_DIRECTORY:{why:p=>`Path \`${p.cwd}\` is not a directory`,fix:"Point the command at a directory rather than a file."},DEV_INTERNAL_ADDRESS_UNAVAILABLE:{why:"Invalid access to `address` because `start` has not yet populated `this.address`",fix:REPORT_A_BUG},DEV_INTERNAL_NO_ROUTE_RESULT:{why:"Expected Route Result but none was found",fix:REPORT_A_BUG},DEV_INTERNAL_MISSING_CHILD_STDIO:{why:"Expected child process to have stdout and stderr",fix:REPORT_A_BUG},DEV_SYSCALL_ERROR:{why:p=>p.message,fix:"This is an operating-system error. Check the file path, permissions, and ports referenced above, then retry."}}}),FIX_BY_CODE={missing_build_script:"Add a `build` script to your `package.json`, or set a Build Command in your Project Settings.",MISSING_DOTENV_VARS:"Define the missing variables in your `.env` file, or pull them with `vercel env pull`.",MAX_LAMBDA_SIZE_EXCEEDED:"Reduce the function bundle \u2014 trim dependencies or included files, or split the function.",NODE_DEPENDENCY_SYNC_FAILED:"Install your dependencies (e.g. `npm install`) and confirm they resolve, then retry.",INSTALL_COMMAND_FAILED:"Fix the dependency error logged above, then retry.",CONFLICTING_CONFIG_FILES:"Keep a single configuration file \u2014 remove the extra `vercel.json`/`now.json`.",CANT_PARSE_JSON_FILE:"Fix the JSON syntax error at the location shown above, then retry."};function toDiagnostic(err){if(err instanceof Diagnostic)return err;let source=err,why=err instanceof Error?err.message:typeof source.message=="string"?source.message:String(err);if(typeof source.errno=="number"||typeof source.syscall=="string")return dev.DEV_SYSCALL_ERROR({message:why,cause:err});let code=typeof source.code=="string"?source.code:void 0,docs=typeof source.link=="string"?source.link:void 0,action=typeof source.action=="string"?source.action:void 0,fix=code?FIX_BY_CODE[code]:void 0,diagnostic=new Diagnostic({why,fix,docs,cause:err});return code&&(diagnostic.name=code),action&&(diagnostic.action=action),diagnostic}var DevCommandExitError=class extends Diagnostic{constructor(message2,exitCode){super({why:message2,fix:"Your Development Command exited before the dev server was ready. Fix the error logged above, then confirm the command runs on its own (e.g. `npm run dev`)."});this.name="DEV_COMMAND_EXITED",this.exitCode=exitCode}},ServiceStartError=class extends Diagnostic{constructor(failures){let dedupeErrorCodes=new Set(["PYTHON_EXTERNAL_VENV_DETECTED"]),seenCodes=new Set,uniqueMessages=[],childFixes=[],childCodes=[];for(let err of failures){let message2=err instanceof Error?err.message:String(err),rawCode=err?.code,code=err instanceof import_build_utils.NowBuildError?err.code:typeof rawCode=="string"?rawCode:void 0;code&&dedupeErrorCodes.has(code)?seenCodes.has(code)||(uniqueMessages.push(message2),seenCodes.add(code)):uniqueMessages.push(message2),code&&!childCodes.includes(code)&&childCodes.push(code);let childFix=code?FIX_BY_CODE[code]:void 0;childFix&&!childFixes.includes(childFix)&&childFixes.push(childFix)}super({why:uniqueMessages.join(`
|
|
33
33
|
`),fix:childFixes.length?childFixes.join(`
|
|
34
|
-
`):"Review the per-service errors above and fix each failing service before retrying."});this.name="DEV_SERVICE_START_FAILED",this.childCodes=childCodes}};function telemetryCodes(diagnostic){return diagnostic instanceof ServiceStartError&&diagnostic.childCodes.length?diagnostic.childCodes:[diagnostic.name]}function sleep(ms9){return new Promise(resolve3=>setTimeout(resolve3,ms9))}async function getReachableHostOnPort(port){let optsIpv4={host:"127.0.0.1"},optsIpv6={host:"::1"};return(await Promise.all([(0,import_is_port_reachable.default)(port,optsIpv6).then(r=>r&&`[${optsIpv6.host}]`),(0,import_is_port_reachable.default)(port,optsIpv4).then(r=>r&&optsIpv4.host)])).find(Boolean)||!1}async function checkForPort(port,timeout){let host,start=Date.now();for(;!(host=await getReachableHostOnPort(port))&&!(Date.now()-start>timeout);)await sleep(100);if(!host)throw dev.DEV_PORT_DETECTION_TIMED_OUT({port,timeout});return host}var import_npm_package_arg=__toESM(require_npa(),1),import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_client=__toESM(require_dist5(),1),import_routing_utils3=__toESM(require_dist3(),1),import_build_utils7=__toESM(require_build_utils(),1),import_fs_detectors2=__toESM(require_dist4(),1),import_detect_builders_with_services=__toESM(require_detect_builders_with_services(),1),import_frameworks3=__toESM(require_frameworks(),1);var import_build_utils2=__toESM(require_build_utils(),1);import{relative as nativeRelative}from"path";function relative2(a,b){return(0,import_build_utils2.normalizePath)(nativeRelative(a,b))}var import_get_files=__toESM(require_get_files(),1);function staticFiles(path6,options){return(0,import_get_files.staticFiles)(path6,options,output_manager_default)}var import_pcre_to_regexp=__toESM(require_dist6(),1);import url2 from"url";function isURL(str){return typeof str=="string"&&/^https?:\/\//.test(str)}var import_routing_utils=__toESM(require_dist3(),1);function parseQueryString(querystring){let query=Object.create(null);if(!querystring||!querystring.startsWith("?")||querystring==="?")return query;let params=querystring.slice(1).split("&");for(let param2 of params){let[key,value]=param2.split("=");key!==void 0&&(key=decodeURIComponent(key)),value!==void 0&&(value=decodeURIComponent(value));let existing=query[key];existing||(existing=[],query[key]=existing),existing.push(value)}return query}function formatQueryString(query){if(!query)return null;let s="",prefix="?";for(let[key,values]of Object.entries(query))for(let value of values)s+=prefix,s+=encodeURIComponent(key),value!==void 0&&(s+="=",s+=encodeURIComponent(value)),prefix="&";return s||null}import url from"url";function resolveTransforms(transforms,ctx){return!transforms||transforms.length===0?[]:transforms.map(transform=>transform.type==="request.path"?{...transform,args:resolveString(transform.args,transform,ctx)}:{...transform,target:{key:resolveKey(transform.target.key,transform,ctx)},args:resolveArgs(transform.args,transform,ctx)})}function applyResponseTransforms(headers,transforms){for(let transform of transforms)transform.type==="response.headers"&&"target"in transform&&applyTransform(headers,transform,!0)}function applyRequestTransforms(req,transforms){if(transforms.length===0)return;applyRequestHeaderTransforms(req.headers,transforms);let parsed=url.parse(req.url||"/"),query=parseQueryString(parsed.search);applyQueryTransforms(query,transforms);let newPath=getRequestPath(transforms);newPath!==void 0&&(parsed.pathname=newPath),parsed.search=formatQueryString(query),req.url=url.format(parsed)}function hasResponseTransforms(transforms){return transforms.some(t=>t.type==="response.headers")}function resolveKey(key,_transform,ctx){return typeof key=="string"?expandCaptureGroups(key,ctx.match,ctx.keys):key}function resolveArgs(args2,transform,ctx){return typeof args2=="string"?resolveString(args2,transform,ctx):Array.isArray(args2)?args2.map(a=>typeof a=="string"?resolveString(a,transform,ctx):a):args2}function resolveString(value,transform,ctx){let resolved=expandCaptureGroups(value,ctx.match,ctx.keys);return transform.env&&transform.env.length>0&&ctx.env&&(resolved=expandEnvVars(resolved,transform.env,ctx.env)),resolved}function expandCaptureGroups(str,match,keys){return str.replace(/\$([0-9A-Za-z_]+)/g,(whole,name)=>{let namedIdx=keys.indexOf(name);if(namedIdx!==-1)return match[namedIdx+1]??"";if(/^[0-9]+$/.test(name)){let n=parseInt(name,10);if(n<match.length)return match[n]??""}return whole})}function expandEnvVars(str,allowlist,env){let allowed=new Set(allowlist);return str.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}|\$([A-Za-z_][A-Za-z0-9_]*)/g,(match,braced,bare)=>{let name=braced??bare;return!allowed.has(name)||env[name]===void 0?match:env[name]})}function applyRequestHeaderTransforms(headers,transforms){for(let transform of transforms)transform.type==="request.headers"&&"target"in transform&&applyTransform(headers,transform,!0)}function applyQueryTransforms(query,transforms){for(let transform of transforms)transform.type==="request.query"&&"target"in transform&&applyTransform(query,transform,!1);for(let key of Object.keys(query)){let value=query[key];value===void 0?delete query[key]:typeof value=="string"&&(query[key]=[value])}}var HEADER_NAME_RE=/^[-\w]+$/,HEADER_VALUE_RE=/^[-\w:;.,/\\"'?!(){}[\]@<>=+*#$&`|~%^ ]+$/;function isValidHeaderName(name){return name.length>0&&HEADER_NAME_RE.test(name)}function isValidHeaderValue(value){return value.length>0&&HEADER_VALUE_RE.test(value)}function hasValidHeaderArgs(args2){return typeof args2=="string"?isValidHeaderValue(args2):Array.isArray(args2)?args2.every(isValidHeaderValue):!1}function applyTransform(data,transform,isHeader){let keySelector=transform.target?.key;if(keySelector==null||isHeader&&(transform.op==="set"||transform.op==="append")&&(typeof keySelector=="string"&&!isValidHeaderName(keySelector)||!hasValidHeaderArgs(transform.args)))return;let matchedKeys=findMatchingKeys(data,keySelector);switch(transform.op){case"set":opSet(data,matchedKeys,keySelector,transform.args);break;case"append":opAppend(data,matchedKeys,keySelector,transform.args,isHeader);break;case"delete":opDelete(data,matchedKeys,transform.args,isHeader);break;default:break}}function isValidRequestPath(path6){if(path6===""||path6.length>2048||path6[0]!=="/"||path6.startsWith("//")||/[?#]/.test(path6))return!1;for(let i=0;i<path6.length;i++){let code=path6.charCodeAt(i);if(code<=32||code===127)return!1}return!0}function getRequestPath(transforms){let path6;for(let transform of transforms)transform.type==="request.path"&&transform.op==="set"&&typeof transform.args=="string"&&isValidRequestPath(transform.args)&&(path6=transform.args);return path6}function findMatchingKeys(data,keyPattern){let matched=[];for(let key of Object.keys(data))matchesRule(key,keyPattern)&&matched.push(key);return matched}function matchesRule(candidate,rule){if(candidate=candidate.toLowerCase(),rule==null)return!0;if(typeof rule=="string")return candidate===rule.toLowerCase();let r=rule;for(let[op,val]of Object.entries(r))if(val!==void 0)switch(op){case"eq":if(candidate!==String(val).toLowerCase())return!1;break;case"neq":if(candidate===val.toLowerCase())return!1;break;case"inc":if(!val.some(v=>candidate===v.toLowerCase()))return!1;break;case"ninc":if(val.some(v=>candidate===v.toLowerCase()))return!1;break;case"pre":if(!candidate.startsWith(String(val).toLowerCase()))return!1;break;case"suf":if(!candidate.endsWith(String(val).toLowerCase()))return!1;break;case"sub":if(!candidate.includes(String(val).toLowerCase()))return!1;break;case"gt":if(!(Number(candidate)>val))return!1;break;case"gte":if(!(Number(candidate)>=val))return!1;break;case"lt":if(!(Number(candidate)<val))return!1;break;case"lte":if(!(Number(candidate)<=val))return!1;break;default:break}return!0}function opSet(data,matchedKeys,keySelector,args2){for(let key of matchedKeys)data[key]=args2;matchedKeys.length===0&&typeof keySelector=="string"&&data[keySelector]===void 0&&!isEmptyArgs(args2)&&(data[keySelector]=args2)}function opAppend(data,matchedKeys,keySelector,args2,isHeader){if(isEmptyArgs(args2))return;let toAppend=typeof args2=="string"?[args2]:args2??[];for(let key of matchedKeys){let next=[...toValueList(data[key],isHeader),...toAppend];setTransformValue(data,key,fromValueList(next))}matchedKeys.length===0&&typeof keySelector=="string"&&setTransformValue(data,keySelector,fromValueList(toAppend))}function opDelete(data,matchedKeys,args2,isHeader){if(args2==null){for(let key of matchedKeys)delete data[key];return}let patterns=typeof args2=="string"?[args2]:args2;for(let key of matchedKeys){let kept=toValueList(data[key],isHeader).filter(value=>!patterns.some(pattern=>matchesRule(value,pattern)));setTransformValue(data,key,fromValueList(kept))}}function toValueList(value,isHeader){if(value===void 0)return[];if(Array.isArray(value))return value;let str=String(value);return isHeader&&str.includes(",")?str.split(",").map(v=>v.trim()).filter(v=>v!==""):[str]}function fromValueList(values){if(values.length!==0)return values.length===1?values[0]:values}function setTransformValue(data,key,value){value===void 0?delete data[key]:data[key]=value}function isEmptyArgs(args2){return args2==null?!0:typeof args2=="string"?args2==="":args2.length===0}function resolveRouteParameters(str,match,keys){return str.replace(/\$([1-9a-zA-Z]+)/g,(_,param2)=>{let matchIndex=keys.indexOf(param2);return matchIndex===-1?matchIndex=parseInt(param2,10):matchIndex++,match[matchIndex]||""})}function getRoutesTypes(routes=[]){let handleMap=new Map,prevHandle=null;return routes.forEach(route=>{if((0,import_routing_utils.isHandler)(route))prevHandle=route.handle;else{let routes2=handleMap.get(prevHandle);routes2?routes2.push(route):handleMap.set(prevHandle,[route])}}),handleMap}async function devRouter(reqUrl="/",reqMethod,routes,devServer,vercelConfig,previousHeaders,missRoutes,phase){let result,{pathname:reqPathname,search:reqSearch}=url2.parse(reqUrl);reqPathname=reqPathname||"/";let reqQuery=parseQueryString(reqSearch),combinedHeaders={...previousHeaders},status,isContinue=!1,requestTransforms=[],responseTransforms;if(routes){let idx=-1;for(let routeConfig of routes){if(idx++,isContinue=!1,(0,import_routing_utils.isHandler)(routeConfig))continue;let{src,headers,methods}=routeConfig;if(Array.isArray(methods)&&reqMethod&&!methods.includes(reqMethod))continue;let keys=[],flags=devServer&&devServer.isCaseSensitive()?"":"i",matcher=(0,import_pcre_to_regexp.default)(`%${src}%${flags}`,keys),match=matcher.exec(reqPathname)||matcher.exec(reqPathname.substring(1));if(match){let routeTransforms=routeConfig.transforms?resolveTransforms(routeConfig.transforms,{match,keys,env:devServer?.envConfigs.runEnv}):[],isServiceMarker=typeof routeConfig.destination=="object"&&routeConfig.destination!==null&&routeConfig.destination.type==="service";!isServiceMarker&&routeTransforms.length>0&&requestTransforms.push(...routeTransforms);let destPath=reqPathname;if(routeConfig.dest&&(destPath=resolveRouteParameters(routeConfig.dest,match,keys)),headers)for(let originalKey of Object.keys(headers)){let lowerKey=originalKey.toLowerCase();if(!(previousHeaders&&Object.prototype.hasOwnProperty.call(previousHeaders,lowerKey)&&(phase==="hit"||phase==="miss"))){let originalValue=headers[originalKey],value=resolveRouteParameters(originalValue,match,keys);combinedHeaders[lowerKey]=value}}if(routeConfig.continue){routeConfig.status&&(status=routeConfig.status),routeTransforms.length>0&&(responseTransforms=routeTransforms),reqPathname=destPath,isContinue=!0;continue}let isDestUrl=isURL(destPath);if(routeConfig.check&&devServer&&vercelConfig&&phase!=="hit"&&!isDestUrl){let{pathname}=url2.parse(destPath);if(pathname=pathname||"/",!await devServer.hasFilesystem(pathname,vercelConfig)&&!(routeConfig.status&&phase!=="miss"))if(missRoutes&&missRoutes.length>0){routeTransforms.length>0&&(responseTransforms=routeTransforms);let missResult=await devRouter(destPath,reqMethod,missRoutes,devServer,vercelConfig,combinedHeaders,[],"miss");if(missResult.found)return requestTransforms.length>0&&(missResult.requestTransforms=[...requestTransforms,...missResult.requestTransforms??[]]),!missResult.responseTransforms&&responseTransforms&&(missResult.responseTransforms=responseTransforms),missResult;reqPathname=destPath;continue}else{routeConfig.status&&phase==="miss"&&(status=routeConfig.status),routeTransforms.length>0&&(responseTransforms=routeTransforms),reqPathname=destPath;continue}}let effectiveStatus=routeConfig.status||status,isRedirectExit=typeof effectiveStatus=="number"&&effectiveStatus>=300&&effectiveStatus<400;if(!isServiceMarker&&!isRedirectExit&&routeTransforms.length>0&&(responseTransforms=routeTransforms),isDestUrl){result={found:!0,dest:destPath,continue:isContinue,userDest:!1,isDestUrl,status:routeConfig.status||status,headers:combinedHeaders,query:reqQuery,matched_route:routeConfig,matched_route_idx:idx,phase,requestTransforms,responseTransforms};break}else{destPath.startsWith("/")||(destPath=`/${destPath}`);let{pathname:destPathname,search:destSearch}=url2.parse(destPath);destPathname=destPathname||"/";let destQuery=parseQueryString(destSearch);Object.assign(destQuery,reqQuery),result={found:!0,dest:destPathname,continue:isContinue,userDest:!!routeConfig.dest,isDestUrl,status:routeConfig.status||status,headers:combinedHeaders,query:destQuery,matched_route:routeConfig,matched_route_idx:idx,phase,requestTransforms,responseTransforms};break}}}}return result||(result={found:!1,dest:reqPathname,continue:isContinue,status,isDestUrl:!1,query:reqQuery,headers:combinedHeaders,phase,requestTransforms,responseTransforms}),result}var import_mime_types=__toESM(require_mime_types(),1);import path from"path";function getMimeType(fileName){let extension=path.extname(fileName);return(0,import_mime_types.contentType)(extension)||"application/octet-stream"}var import_ms2=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1),import_build_utils3=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist4(),1),import_pluralize=__toESM(require_pluralize(),1),import_minimatch=__toESM(require_minimatch(),1);import{readFileSync,unlinkSync}from"fs";import{delimiter,dirname,join}from"path";import{fork}from"child_process";import{createFunction}from"@vercel/fun";var import_tree_kill=__toESM(require_tree_kill(),1);function treeKill(pid,signal="SIGTERM"){return new Promise((resolve3,reject)=>{(0,import_tree_kill.default)(pid,signal,err=>{err?reject(err):resolve3()})})}var import_routing_utils2=__toESM(require_dist3(),1);async function getUnsupportedBuilderVersionError(version){let updateMessage;try{updateMessage=`Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`}catch(error2){updateMessage=error2 instanceof Error?error2.message:"Update the CLI with the package manager that installed it."}return dev.DEV_UNSUPPORTED_BUILDER_VERSION({titleName:getTitleName(),version,updateMessage})}async function deserializeOutput(obj){switch(obj.type){case"FileFsRef":return Object.assign(Object.create(import_build_utils3.FileFsRef.prototype),obj);case"FileBlob":{let fileBlob=Object.assign(Object.create(import_build_utils3.FileBlob.prototype),obj);return fileBlob.data=Buffer.from(obj.data.data),fileBlob}case"Lambda":{let lambda=Object.assign(Object.create(import_build_utils3.Lambda.prototype),obj);if(obj.zipBufferPath){lambda.zipBuffer=readFileSync(obj.zipBufferPath);try{unlinkSync(obj.zipBufferPath)}catch{}}else obj.zipBuffer&&(lambda.zipBuffer=Buffer.from(obj.zipBuffer.data));return lambda}}}async function deserializeBuildOutputs(serialized){let result={};for(let[name,obj]of Object.entries(serialized))result[name]=await deserializeOutput(obj);return result}async function createBuildProcess(match,envConfigs,workPath){output_manager_default.debug(`Creating build process for "${match.entrypoint}"`);let builderWorkerPath=join(__dirname,"builder-worker.cjs"),nodeExecPath=(0,import_build_utils3.getNodeExecPath)(),PATH=`${dirname(nodeExecPath)}${delimiter}${process.env.PATH}`,env={...process.env,PATH,...envConfigs.allEnv},buildProcess=fork(builderWorkerPath,[],{cwd:workPath,execArgv:[],execPath:isNativeBinaryInstall()?process.execPath:nodeExecPath,env});return match.buildProcess=buildProcess,buildProcess.on("close",(code,signal)=>{output_manager_default.debug(`Build process for "${match.entrypoint}" exited with ${signal||code}`),match.buildProcess=void 0}),new Promise((resolve3,reject)=>{buildProcess.once("message",data=>{data!==null&&typeof data=="object"&&data.type!=="ready"?reject(new Error('Did not get "ready" event from builder')):resolve3(buildProcess)})})}async function executeBuild(vercelConfig,devServer,files,match,requestPath,isInitialBuild,filesChanged,filesRemoved){let{builderWithPkg:{path:requirePath,builder,pkg}}=match,{entrypoint,use}=match,isStatic=(0,import_fs_detectors.isStaticRuntime)(use),{envConfigs,cwd:workPath,devCacheDir}=devServer,debug=output_manager_default.isDebugEnabled(),startTime=Date.now(),showBuildTimestamp=!isStatic&&(!isInitialBuild||debug);showBuildTimestamp&&(output_manager_default.log(`Building ${use}:${entrypoint}`),output_manager_default.debug(`Using \`${pkg.name}${pkg.version?`@${pkg.version}`:""}\``));let config=match.config||{},result,{buildProcess}=match;!isStatic&&!buildProcess&&(buildProcess=await createBuildProcess(match,envConfigs,workPath));let serviceRoutePrefix=config.routePrefix,serviceWorkspace=config.workspace,buildOptions={files,entrypoint,workPath,repoRootPath:workPath,config,meta:{isDev:!0,requestPath,devCacheDir,filesChanged,filesRemoved,env:{...envConfigs.runEnv},buildEnv:{...envConfigs.buildEnv}},...typeof serviceRoutePrefix=="string"||typeof serviceWorkspace=="string"?{service:{routePrefix:typeof serviceRoutePrefix=="string"?serviceRoutePrefix:void 0,workspace:typeof serviceWorkspace=="string"?serviceWorkspace:void 0}}:void 0},buildResultOrOutputs;buildProcess?(buildProcess.send({type:"build",requirePath,buildOptions}),buildResultOrOutputs=await new Promise((resolve3,reject)=>{function onMessage({type,result:result2,error:error2}){cleanup(),type==="buildResult"?result2?resolve3(result2):error2&&reject(Object.assign(new Error,error2)):reject(new Error(`Got unexpected message type: ${type}`))}function onExit(code,signal){cleanup();let err=new Error(`Builder exited with ${signal||code} before sending build result`);reject(err)}function cleanup(){buildProcess.removeListener("close",onExit),buildProcess.removeListener("message",onMessage)}buildProcess.on("close",onExit),buildProcess.on("message",onMessage)})):buildResultOrOutputs=await builder.build(buildOptions);let effectiveVersion=builder.version;if(effectiveVersion===-1)if("resultVersion"in buildResultOrOutputs){let vx=buildResultOrOutputs;effectiveVersion=vx.resultVersion,buildResultOrOutputs=vx.result}else effectiveVersion=buildResultOrOutputs.output?.type==="Lambda"?3:2;if(!effectiveVersion||effectiveVersion===1)result={output:buildResultOrOutputs,routes:[],watch:[]};else if(effectiveVersion===2)result=buildResultOrOutputs;else if(effectiveVersion===3){let{output,...rest}=buildResultOrOutputs;if(!output||output.type!=="Lambda")throw dev.DEV_BUILDER_RESULT_NOT_LAMBDA();if(output.maxDuration)throw dev.DEV_BUILDER_RESULT_HAS_MAXDURATION();if(output.affinity)throw new Error('The result of "builder.build()" must not contain `affinity`');if(output.maxConcurrency)throw new Error('The result of "builder.build()" must not contain `maxConcurrency`');if(output.memory)throw dev.DEV_BUILDER_RESULT_HAS_MEMORY();for(let[src,func]of Object.entries(config.functions||{}))if(src===entrypoint||(0,import_minimatch.default)(entrypoint,src)){func.maxDuration&&(output.maxDuration=func.maxDuration),func.affinity&&(output.affinity=func.affinity),func.maxConcurrency&&(output.maxConcurrency=func.maxConcurrency),func.memory&&(output.memory=func.memory);break}result={...rest,output:{[entrypoint]:output}}}else throw await getUnsupportedBuilderVersionError(builder.version);let normalized=(0,import_routing_utils2.normalizeRoutes)(result.routes);if(normalized.error)throw dev.DEV_INVALID_ROUTES({message:normalized.error.message});result.routes=normalized.routes||[];let{output:buildOutput}=result,{cleanUrls}=vercelConfig;for(let[originalPath,value]of Object.entries(buildOutput)){let path6=(0,import_build_utils3.normalizePath)(originalPath);cleanUrls&&path6.endsWith(".html")&&(path6=path6.slice(0,-5),(value.type==="FileBlob"||value.type==="FileFsRef")&&(value.contentType=value.contentType||"text/html; charset=utf-8"));let extensionless=devServer.getExtensionlessFile(path6);extensionless&&(path6=extensionless),buildOutput[path6]=value}let deserializedOutput=await deserializeBuildOutputs(buildOutput);for(let[name,output]of Object.entries(deserializedOutput))buildOutput[name]=output;result.watch=(result.watch||[]).map(w=>w.startsWith("./")?w.substring(2):w),result.watch.includes(entrypoint)||result.watch.push(entrypoint);let maxLambdaBytes=(0,import_bytes.default)("50mb");for(let asset of Object.values(result.output))if(asset.type==="Lambda"&&!(typeof asset.runtime=="string"&&asset.runtime.startsWith("python"))&&asset.runtime!=="container"){let size=asset.zipBuffer.length;if(size>maxLambdaBytes)throw new LambdaSizeExceededError(size,maxLambdaBytes)}if(await Promise.all(Object.entries(result.output).map(async entry=>{let path6=entry[0],asset=entry[1];if(asset.type==="Lambda"&&asset.runtime!=="container"){let oldAsset=match.buildOutput&&match.buildOutput[path6];oldAsset&&oldAsset.type==="Lambda"&&oldAsset.fn&&await oldAsset.fn.destroy();let ZipFile=asset.zipBuffer||await asset.createZip();asset.fn=await createFunction({Code:{ZipFile},Handler:asset.handler,Runtime:asset.runtime,MemorySize:asset.memory||3009,Environment:{Variables:{...vercelConfig.env,...asset.environment,...envConfigs.runEnv}}})}match.buildTimestamp=Date.now()})),match.buildResults.set(requestPath,result),Object.assign(match.buildOutput,result.output),showBuildTimestamp){let endTime=Date.now();output_manager_default.log(`Built ${use}:${entrypoint} [${(0,import_ms2.default)(endTime-startTime)}]`)}}async function getBuildMatches(vercelConfig,cwd,devServer,fileList){let matches=[];if(fileList.length===0)return matches;let noMatches=[],builds=vercelConfig.builds||[{src:"**",use:"@vercel/static"}],builderSpecs=new Set(builds.map(b=>b.use).filter(Boolean)),buildersWithPkgs=await importBuilders(builderSpecs,cwd);for(let buildConfig of builds){let{src="**",use,config={}}=buildConfig;if(!use)continue;src[0]==="/"&&(src=src.substring(1)),(0,import_build_utils3.isBackendFramework)(buildConfig.config?.framework)&&(src="package.json");let mapToEntrypoint=new Map;if(buildConfig.config?.framework&&(0,import_build_utils3.isPythonFramework)(buildConfig.config?.framework)){let originalSrc=src,existing=["pyproject.toml","requirements.txt","Pipfile"].filter(p=>fileList.includes(p));existing.length>0&&(src=existing[0],mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="node"&&!fileList.includes(src)){let originalSrc=src,existing=fileList.find(path6=>/^(?:src\/)?server\.[cm]?[jt]s$/.test(path6));existing&&(src=existing,mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="go"&&!fileList.includes(src)){let originalSrc=src,existing=["main.go","cmd/api/main.go","cmd/server/main.go"].filter(p=>fileList.includes(p));existing.length>0&&(src=existing[0],mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="rust"&&src==="src/main.rs"&&!fileList.includes(src)){let originalSrc=src;fileList.includes("Cargo.toml")&&(src="Cargo.toml",mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="container"&&!fileList.includes(src)){let originalSrc=src,existing=["Dockerfile.vercel","Containerfile.vercel","Dockerfile","Containerfile"].find(p=>fileList.includes(p));existing&&(src=existing,mapToEntrypoint.set(src,originalSrc))}let extensionless=devServer.getExtensionlessFile(src);extensionless&&(mapToEntrypoint.set(extensionless,src),src=extensionless);let files=fileList.filter(name=>name===src||(0,import_minimatch.default)(name,src,{dot:!0})).map(name=>join(cwd,name));files.length===0&&(config.zeroConfig&&use==="@vercel/static"||noMatches.push(buildConfig));for(let file of files){src=relative2(cwd,file);let entrypoint=mapToEntrypoint.get(src)||src;if(config.zeroConfig&&config.outputDirectory){let outputMatch=config.outputDirectory+"/";src.startsWith(outputMatch)&&(src=src.slice(outputMatch.length))}let builderWithPkg=buildersWithPkgs.get(use);if(!builderWithPkg)throw dev.DEV_BUILDER_LOAD_FAILED({use});matches.push({...buildConfig,src,entrypoint,builderWithPkg,buildOutput:{},buildResults:new Map,buildTimestamp:0})}}if(noMatches.length>0){output_manager_default.warn(`You defined ${(0,import_pluralize.default)("build",noMatches.length,!0)} that did not match any source files (please ensure they are NOT defined in ${highlight(".vercelignore")}):`);for(let buildConfig of noMatches)output_manager_default.print(`- ${JSON.stringify(buildConfig)}
|
|
34
|
+
`):"Review the per-service errors above and fix each failing service before retrying."});this.name="DEV_SERVICE_START_FAILED",this.childCodes=childCodes}};function telemetryCodes(diagnostic){return diagnostic instanceof ServiceStartError&&diagnostic.childCodes.length?diagnostic.childCodes:[diagnostic.name]}function sleep(ms9){return new Promise(resolve3=>setTimeout(resolve3,ms9))}async function getReachableHostOnPort(port){let optsIpv4={host:"127.0.0.1"},optsIpv6={host:"::1"};return(await Promise.all([(0,import_is_port_reachable.default)(port,optsIpv6).then(r=>r&&`[${optsIpv6.host}]`),(0,import_is_port_reachable.default)(port,optsIpv4).then(r=>r&&optsIpv4.host)])).find(Boolean)||!1}async function checkForPort(port,timeout){let host,start=Date.now();for(;!(host=await getReachableHostOnPort(port))&&!(Date.now()-start>timeout);)await sleep(100);if(!host)throw dev.DEV_PORT_DETECTION_TIMED_OUT({port,timeout});return host}var import_npm_package_arg=__toESM(require_npa(),1),import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_client=__toESM(require_dist5(),1),import_routing_utils3=__toESM(require_dist3(),1),import_build_utils8=__toESM(require_build_utils(),1),import_fs_detectors2=__toESM(require_dist4(),1),import_detect_builders_with_services=__toESM(require_detect_builders_with_services(),1),import_frameworks3=__toESM(require_frameworks(),1);var import_build_utils2=__toESM(require_build_utils(),1);import{relative as nativeRelative}from"path";function relative2(a,b){return(0,import_build_utils2.normalizePath)(nativeRelative(a,b))}var import_get_files=__toESM(require_get_files(),1);function staticFiles(path6,options){return(0,import_get_files.staticFiles)(path6,options,output_manager_default)}var import_pcre_to_regexp=__toESM(require_dist6(),1);import url2 from"url";function isURL(str){return typeof str=="string"&&/^https?:\/\//.test(str)}var import_routing_utils=__toESM(require_dist3(),1);function parseQueryString(querystring){let query=Object.create(null);if(!querystring||!querystring.startsWith("?")||querystring==="?")return query;let params=querystring.slice(1).split("&");for(let param2 of params){let[key,value]=param2.split("=");key!==void 0&&(key=decodeURIComponent(key)),value!==void 0&&(value=decodeURIComponent(value));let existing=query[key];existing||(existing=[],query[key]=existing),existing.push(value)}return query}function formatQueryString(query){if(!query)return null;let s="",prefix="?";for(let[key,values]of Object.entries(query))for(let value of values)s+=prefix,s+=encodeURIComponent(key),value!==void 0&&(s+="=",s+=encodeURIComponent(value)),prefix="&";return s||null}import url from"url";function resolveTransforms(transforms,ctx){return!transforms||transforms.length===0?[]:transforms.map(transform=>transform.type==="request.path"?{...transform,args:resolveString(transform.args,transform,ctx)}:{...transform,target:{key:resolveKey(transform.target.key,transform,ctx)},args:resolveArgs(transform.args,transform,ctx)})}function applyResponseTransforms(headers,transforms){for(let transform of transforms)transform.type==="response.headers"&&"target"in transform&&applyTransform(headers,transform,!0)}function applyRequestTransforms(req,transforms){if(transforms.length===0)return;applyRequestHeaderTransforms(req.headers,transforms);let parsed=url.parse(req.url||"/"),query=parseQueryString(parsed.search);applyQueryTransforms(query,transforms);let newPath=getRequestPath(transforms);newPath!==void 0&&(parsed.pathname=newPath),parsed.search=formatQueryString(query),req.url=url.format(parsed)}function hasResponseTransforms(transforms){return transforms.some(t=>t.type==="response.headers")}function resolveKey(key,_transform,ctx){return typeof key=="string"?expandCaptureGroups(key,ctx.match,ctx.keys):key}function resolveArgs(args2,transform,ctx){return typeof args2=="string"?resolveString(args2,transform,ctx):Array.isArray(args2)?args2.map(a=>typeof a=="string"?resolveString(a,transform,ctx):a):args2}function resolveString(value,transform,ctx){let resolved=expandCaptureGroups(value,ctx.match,ctx.keys);return transform.env&&transform.env.length>0&&ctx.env&&(resolved=expandEnvVars(resolved,transform.env,ctx.env)),resolved}function expandCaptureGroups(str,match,keys){return str.replace(/\$([0-9A-Za-z_]+)/g,(whole,name)=>{let namedIdx=keys.indexOf(name);if(namedIdx!==-1)return match[namedIdx+1]??"";if(/^[0-9]+$/.test(name)){let n=parseInt(name,10);if(n<match.length)return match[n]??""}return whole})}function expandEnvVars(str,allowlist,env){let allowed=new Set(allowlist);return str.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}|\$([A-Za-z_][A-Za-z0-9_]*)/g,(match,braced,bare)=>{let name=braced??bare;return!allowed.has(name)||env[name]===void 0?match:env[name]})}function applyRequestHeaderTransforms(headers,transforms){for(let transform of transforms)transform.type==="request.headers"&&"target"in transform&&applyTransform(headers,transform,!0)}function applyQueryTransforms(query,transforms){for(let transform of transforms)transform.type==="request.query"&&"target"in transform&&applyTransform(query,transform,!1);for(let key of Object.keys(query)){let value=query[key];value===void 0?delete query[key]:typeof value=="string"&&(query[key]=[value])}}var HEADER_NAME_RE=/^[-\w]+$/,HEADER_VALUE_RE=/^[-\w:;.,/\\"'?!(){}[\]@<>=+*#$&`|~%^ ]+$/;function isValidHeaderName(name){return name.length>0&&HEADER_NAME_RE.test(name)}function isValidHeaderValue(value){return value.length>0&&HEADER_VALUE_RE.test(value)}function hasValidHeaderArgs(args2){return typeof args2=="string"?isValidHeaderValue(args2):Array.isArray(args2)?args2.every(isValidHeaderValue):!1}function applyTransform(data,transform,isHeader){let keySelector=transform.target?.key;if(keySelector==null||isHeader&&(transform.op==="set"||transform.op==="append")&&(typeof keySelector=="string"&&!isValidHeaderName(keySelector)||!hasValidHeaderArgs(transform.args)))return;let matchedKeys=findMatchingKeys(data,keySelector);switch(transform.op){case"set":opSet(data,matchedKeys,keySelector,transform.args);break;case"append":opAppend(data,matchedKeys,keySelector,transform.args,isHeader);break;case"delete":opDelete(data,matchedKeys,transform.args,isHeader);break;default:break}}function isValidRequestPath(path6){if(path6===""||path6.length>2048||path6[0]!=="/"||path6.startsWith("//")||/[?#]/.test(path6))return!1;for(let i=0;i<path6.length;i++){let code=path6.charCodeAt(i);if(code<=32||code===127)return!1}return!0}function getRequestPath(transforms){let path6;for(let transform of transforms)transform.type==="request.path"&&transform.op==="set"&&typeof transform.args=="string"&&isValidRequestPath(transform.args)&&(path6=transform.args);return path6}function findMatchingKeys(data,keyPattern){let matched=[];for(let key of Object.keys(data))matchesRule(key,keyPattern)&&matched.push(key);return matched}function matchesRule(candidate,rule){if(candidate=candidate.toLowerCase(),rule==null)return!0;if(typeof rule=="string")return candidate===rule.toLowerCase();let r=rule;for(let[op,val]of Object.entries(r))if(val!==void 0)switch(op){case"eq":if(candidate!==String(val).toLowerCase())return!1;break;case"neq":if(candidate===val.toLowerCase())return!1;break;case"inc":if(!val.some(v=>candidate===v.toLowerCase()))return!1;break;case"ninc":if(val.some(v=>candidate===v.toLowerCase()))return!1;break;case"pre":if(!candidate.startsWith(String(val).toLowerCase()))return!1;break;case"suf":if(!candidate.endsWith(String(val).toLowerCase()))return!1;break;case"sub":if(!candidate.includes(String(val).toLowerCase()))return!1;break;case"gt":if(!(Number(candidate)>val))return!1;break;case"gte":if(!(Number(candidate)>=val))return!1;break;case"lt":if(!(Number(candidate)<val))return!1;break;case"lte":if(!(Number(candidate)<=val))return!1;break;default:break}return!0}function opSet(data,matchedKeys,keySelector,args2){for(let key of matchedKeys)data[key]=args2;matchedKeys.length===0&&typeof keySelector=="string"&&data[keySelector]===void 0&&!isEmptyArgs(args2)&&(data[keySelector]=args2)}function opAppend(data,matchedKeys,keySelector,args2,isHeader){if(isEmptyArgs(args2))return;let toAppend=typeof args2=="string"?[args2]:args2??[];for(let key of matchedKeys){let next=[...toValueList(data[key],isHeader),...toAppend];setTransformValue(data,key,fromValueList(next))}matchedKeys.length===0&&typeof keySelector=="string"&&setTransformValue(data,keySelector,fromValueList(toAppend))}function opDelete(data,matchedKeys,args2,isHeader){if(args2==null){for(let key of matchedKeys)delete data[key];return}let patterns=typeof args2=="string"?[args2]:args2;for(let key of matchedKeys){let kept=toValueList(data[key],isHeader).filter(value=>!patterns.some(pattern=>matchesRule(value,pattern)));setTransformValue(data,key,fromValueList(kept))}}function toValueList(value,isHeader){if(value===void 0)return[];if(Array.isArray(value))return value;let str=String(value);return isHeader&&str.includes(",")?str.split(",").map(v=>v.trim()).filter(v=>v!==""):[str]}function fromValueList(values){if(values.length!==0)return values.length===1?values[0]:values}function setTransformValue(data,key,value){value===void 0?delete data[key]:data[key]=value}function isEmptyArgs(args2){return args2==null?!0:typeof args2=="string"?args2==="":args2.length===0}function resolveRouteParameters(str,match,keys){return str.replace(/\$([1-9a-zA-Z]+)/g,(_,param2)=>{let matchIndex=keys.indexOf(param2);return matchIndex===-1?matchIndex=parseInt(param2,10):matchIndex++,match[matchIndex]||""})}function getRoutesTypes(routes=[]){let handleMap=new Map,prevHandle=null;return routes.forEach(route=>{if((0,import_routing_utils.isHandler)(route))prevHandle=route.handle;else{let routes2=handleMap.get(prevHandle);routes2?routes2.push(route):handleMap.set(prevHandle,[route])}}),handleMap}async function devRouter(reqUrl="/",reqMethod,routes,devServer,vercelConfig,previousHeaders,missRoutes,phase){let result,{pathname:reqPathname,search:reqSearch}=url2.parse(reqUrl);reqPathname=reqPathname||"/";let reqQuery=parseQueryString(reqSearch),combinedHeaders={...previousHeaders},status,isContinue=!1,requestTransforms=[],responseTransforms;if(routes){let idx=-1;for(let routeConfig of routes){if(idx++,isContinue=!1,(0,import_routing_utils.isHandler)(routeConfig))continue;let{src,headers,methods}=routeConfig;if(Array.isArray(methods)&&reqMethod&&!methods.includes(reqMethod))continue;let keys=[],flags=devServer&&devServer.isCaseSensitive()?"":"i",matcher=(0,import_pcre_to_regexp.default)(`%${src}%${flags}`,keys),match=matcher.exec(reqPathname)||matcher.exec(reqPathname.substring(1));if(match){let routeTransforms=routeConfig.transforms?resolveTransforms(routeConfig.transforms,{match,keys,env:devServer?.envConfigs.runEnv}):[],isServiceMarker=typeof routeConfig.destination=="object"&&routeConfig.destination!==null&&routeConfig.destination.type==="service";!isServiceMarker&&routeTransforms.length>0&&requestTransforms.push(...routeTransforms);let destPath=reqPathname;if(routeConfig.dest&&(destPath=resolveRouteParameters(routeConfig.dest,match,keys)),headers)for(let originalKey of Object.keys(headers)){let lowerKey=originalKey.toLowerCase();if(!(previousHeaders&&Object.prototype.hasOwnProperty.call(previousHeaders,lowerKey)&&(phase==="hit"||phase==="miss"))){let originalValue=headers[originalKey],value=resolveRouteParameters(originalValue,match,keys);combinedHeaders[lowerKey]=value}}if(routeConfig.continue){routeConfig.status&&(status=routeConfig.status),routeTransforms.length>0&&(responseTransforms=routeTransforms),reqPathname=destPath,isContinue=!0;continue}let isDestUrl=isURL(destPath);if(routeConfig.check&&devServer&&vercelConfig&&phase!=="hit"&&!isDestUrl){let{pathname}=url2.parse(destPath);if(pathname=pathname||"/",!await devServer.hasFilesystem(pathname,vercelConfig)&&!(routeConfig.status&&phase!=="miss"))if(missRoutes&&missRoutes.length>0){routeTransforms.length>0&&(responseTransforms=routeTransforms);let missResult=await devRouter(destPath,reqMethod,missRoutes,devServer,vercelConfig,combinedHeaders,[],"miss");if(missResult.found)return requestTransforms.length>0&&(missResult.requestTransforms=[...requestTransforms,...missResult.requestTransforms??[]]),!missResult.responseTransforms&&responseTransforms&&(missResult.responseTransforms=responseTransforms),missResult;reqPathname=destPath;continue}else{routeConfig.status&&phase==="miss"&&(status=routeConfig.status),routeTransforms.length>0&&(responseTransforms=routeTransforms),reqPathname=destPath;continue}}let effectiveStatus=routeConfig.status||status,isRedirectExit=typeof effectiveStatus=="number"&&effectiveStatus>=300&&effectiveStatus<400;if(!isServiceMarker&&!isRedirectExit&&routeTransforms.length>0&&(responseTransforms=routeTransforms),isDestUrl){result={found:!0,dest:destPath,continue:isContinue,userDest:!1,isDestUrl,status:routeConfig.status||status,headers:combinedHeaders,query:reqQuery,matched_route:routeConfig,matched_route_idx:idx,phase,requestTransforms,responseTransforms};break}else{destPath.startsWith("/")||(destPath=`/${destPath}`);let{pathname:destPathname,search:destSearch}=url2.parse(destPath);destPathname=destPathname||"/";let destQuery=parseQueryString(destSearch);Object.assign(destQuery,reqQuery),result={found:!0,dest:destPathname,continue:isContinue,userDest:!!routeConfig.dest,isDestUrl,status:routeConfig.status||status,headers:combinedHeaders,query:destQuery,matched_route:routeConfig,matched_route_idx:idx,phase,requestTransforms,responseTransforms};break}}}}return result||(result={found:!1,dest:reqPathname,continue:isContinue,status,isDestUrl:!1,query:reqQuery,headers:combinedHeaders,phase,requestTransforms,responseTransforms}),result}var import_mime_types=__toESM(require_mime_types(),1);import path from"path";function getMimeType(fileName){let extension=path.extname(fileName);return(0,import_mime_types.contentType)(extension)||"application/octet-stream"}var import_ms2=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1),import_build_utils3=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist4(),1),import_pluralize=__toESM(require_pluralize(),1),import_minimatch=__toESM(require_minimatch(),1);import{readFileSync,unlinkSync}from"fs";import{delimiter,dirname,join}from"path";import{fork}from"child_process";import{createFunction}from"@vercel/fun";var import_tree_kill=__toESM(require_tree_kill(),1);function treeKill(pid,signal="SIGTERM"){return new Promise((resolve3,reject)=>{(0,import_tree_kill.default)(pid,signal,err=>{err?reject(err):resolve3()})})}var import_routing_utils2=__toESM(require_dist3(),1);async function getUnsupportedBuilderVersionError(version){let updateMessage;try{updateMessage=`Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`}catch(error2){updateMessage=error2 instanceof Error?error2.message:"Update the CLI with the package manager that installed it."}return dev.DEV_UNSUPPORTED_BUILDER_VERSION({titleName:getTitleName(),version,updateMessage})}async function deserializeOutput(obj){switch(obj.type){case"FileFsRef":return Object.assign(Object.create(import_build_utils3.FileFsRef.prototype),obj);case"FileBlob":{let fileBlob=Object.assign(Object.create(import_build_utils3.FileBlob.prototype),obj);return fileBlob.data=Buffer.from(obj.data.data),fileBlob}case"Lambda":{let lambda=Object.assign(Object.create(import_build_utils3.Lambda.prototype),obj);if(obj.zipBufferPath){lambda.zipBuffer=readFileSync(obj.zipBufferPath);try{unlinkSync(obj.zipBufferPath)}catch{}}else obj.zipBuffer&&(lambda.zipBuffer=Buffer.from(obj.zipBuffer.data));return lambda}}}async function deserializeBuildOutputs(serialized){let result={};for(let[name,obj]of Object.entries(serialized))result[name]=await deserializeOutput(obj);return result}async function createBuildProcess(match,envConfigs,workPath){output_manager_default.debug(`Creating build process for "${match.entrypoint}"`);let builderWorkerPath=join(__dirname,"builder-worker.cjs"),nodeExecPath=(0,import_build_utils3.getNodeExecPath)(),PATH=`${dirname(nodeExecPath)}${delimiter}${process.env.PATH}`,env={...process.env,PATH,...envConfigs.allEnv},buildProcess=fork(builderWorkerPath,[],{cwd:workPath,execArgv:[],execPath:isNativeBinaryInstall()?process.execPath:nodeExecPath,env});return match.buildProcess=buildProcess,buildProcess.on("close",(code,signal)=>{output_manager_default.debug(`Build process for "${match.entrypoint}" exited with ${signal||code}`),match.buildProcess=void 0}),new Promise((resolve3,reject)=>{buildProcess.once("message",data=>{data!==null&&typeof data=="object"&&data.type!=="ready"?reject(new Error('Did not get "ready" event from builder')):resolve3(buildProcess)})})}async function executeBuild(vercelConfig,devServer,files,match,requestPath,isInitialBuild,filesChanged,filesRemoved){let{builderWithPkg:{path:requirePath,builder,pkg}}=match,{entrypoint,use}=match,isStatic=(0,import_fs_detectors.isStaticRuntime)(use),{envConfigs,cwd:workPath,devCacheDir}=devServer,debug=output_manager_default.isDebugEnabled(),startTime=Date.now(),showBuildTimestamp=!isStatic&&(!isInitialBuild||debug);showBuildTimestamp&&(output_manager_default.log(`Building ${use}:${entrypoint}`),output_manager_default.debug(`Using \`${pkg.name}${pkg.version?`@${pkg.version}`:""}\``));let config=match.config||{},result,{buildProcess}=match;!isStatic&&!buildProcess&&(buildProcess=await createBuildProcess(match,envConfigs,workPath));let serviceRoutePrefix=config.routePrefix,serviceWorkspace=config.workspace,buildOptions={files,entrypoint,workPath,repoRootPath:workPath,config,meta:{isDev:!0,requestPath,devCacheDir,filesChanged,filesRemoved,env:{...envConfigs.runEnv},buildEnv:{...envConfigs.buildEnv}},...typeof serviceRoutePrefix=="string"||typeof serviceWorkspace=="string"?{service:{routePrefix:typeof serviceRoutePrefix=="string"?serviceRoutePrefix:void 0,workspace:typeof serviceWorkspace=="string"?serviceWorkspace:void 0}}:void 0},buildResultOrOutputs;buildProcess?(buildProcess.send({type:"build",requirePath,buildOptions}),buildResultOrOutputs=await new Promise((resolve3,reject)=>{function onMessage({type,result:result2,error:error2}){cleanup(),type==="buildResult"?result2?resolve3(result2):error2&&reject(Object.assign(new Error,error2)):reject(new Error(`Got unexpected message type: ${type}`))}function onExit(code,signal){cleanup();let err=new Error(`Builder exited with ${signal||code} before sending build result`);reject(err)}function cleanup(){buildProcess.removeListener("close",onExit),buildProcess.removeListener("message",onMessage)}buildProcess.on("close",onExit),buildProcess.on("message",onMessage)})):buildResultOrOutputs=await builder.build(buildOptions);let effectiveVersion=builder.version;if(effectiveVersion===-1)if("resultVersion"in buildResultOrOutputs){let vx=buildResultOrOutputs;effectiveVersion=vx.resultVersion,buildResultOrOutputs=vx.result}else effectiveVersion=buildResultOrOutputs.output?.type==="Lambda"?3:2;if(!effectiveVersion||effectiveVersion===1)result={output:buildResultOrOutputs,routes:[],watch:[]};else if(effectiveVersion===2)result=buildResultOrOutputs;else if(effectiveVersion===3){let{output,...rest}=buildResultOrOutputs;if(!output||output.type!=="Lambda")throw dev.DEV_BUILDER_RESULT_NOT_LAMBDA();if(output.maxDuration)throw dev.DEV_BUILDER_RESULT_HAS_MAXDURATION();if(output.affinity)throw new Error('The result of "builder.build()" must not contain `affinity`');if(output.maxConcurrency)throw new Error('The result of "builder.build()" must not contain `maxConcurrency`');if(output.memory)throw dev.DEV_BUILDER_RESULT_HAS_MEMORY();for(let[src,func]of Object.entries(config.functions||{}))if(src===entrypoint||(0,import_minimatch.default)(entrypoint,src)){func.maxDuration&&(output.maxDuration=func.maxDuration),func.affinity&&(output.affinity=func.affinity),func.maxConcurrency&&(output.maxConcurrency=func.maxConcurrency),func.memory&&(output.memory=func.memory);break}result={...rest,output:{[entrypoint]:output}}}else throw await getUnsupportedBuilderVersionError(builder.version);let normalized=(0,import_routing_utils2.normalizeRoutes)(result.routes);if(normalized.error)throw dev.DEV_INVALID_ROUTES({message:normalized.error.message});result.routes=normalized.routes||[];let{output:buildOutput}=result,{cleanUrls}=vercelConfig;for(let[originalPath,value]of Object.entries(buildOutput)){let path6=(0,import_build_utils3.normalizePath)(originalPath);cleanUrls&&path6.endsWith(".html")&&(path6=path6.slice(0,-5),(value.type==="FileBlob"||value.type==="FileFsRef")&&(value.contentType=value.contentType||"text/html; charset=utf-8"));let extensionless=devServer.getExtensionlessFile(path6);extensionless&&(path6=extensionless),buildOutput[path6]=value}let deserializedOutput=await deserializeBuildOutputs(buildOutput);for(let[name,output]of Object.entries(deserializedOutput))buildOutput[name]=output;result.watch=(result.watch||[]).map(w=>w.startsWith("./")?w.substring(2):w),result.watch.includes(entrypoint)||result.watch.push(entrypoint);let maxLambdaBytes=(0,import_bytes.default)("50mb");for(let asset of Object.values(result.output))if(asset.type==="Lambda"&&!(typeof asset.runtime=="string"&&asset.runtime.startsWith("python"))&&asset.runtime!=="container"){let size=asset.zipBuffer.length;if(size>maxLambdaBytes)throw new LambdaSizeExceededError(size,maxLambdaBytes)}if(await Promise.all(Object.entries(result.output).map(async entry=>{let path6=entry[0],asset=entry[1];if(asset.type==="Lambda"&&asset.runtime!=="container"){let oldAsset=match.buildOutput&&match.buildOutput[path6];oldAsset&&oldAsset.type==="Lambda"&&oldAsset.fn&&await oldAsset.fn.destroy();let ZipFile=asset.zipBuffer||await asset.createZip();asset.fn=await createFunction({Code:{ZipFile},Handler:asset.handler,Runtime:asset.runtime,MemorySize:asset.memory||3009,Environment:{Variables:{...vercelConfig.env,...asset.environment,...envConfigs.runEnv}}})}match.buildTimestamp=Date.now()})),match.buildResultVersion=effectiveVersion,match.buildResults.set(requestPath,result),Object.assign(match.buildOutput,result.output),showBuildTimestamp){let endTime=Date.now();output_manager_default.log(`Built ${use}:${entrypoint} [${(0,import_ms2.default)(endTime-startTime)}]`)}}async function getBuildMatches(vercelConfig,cwd,devServer,fileList){let matches=[];if(fileList.length===0)return matches;let noMatches=[],builds=vercelConfig.builds||[{src:"**",use:"@vercel/static"}],builderSpecs=new Set(builds.map(b=>b.use).filter(Boolean)),buildersWithPkgs=await importBuilders(builderSpecs,cwd);for(let buildConfig of builds){let{src="**",use,config={}}=buildConfig;if(!use)continue;src[0]==="/"&&(src=src.substring(1)),(0,import_build_utils3.isBackendFramework)(buildConfig.config?.framework)&&(src="package.json");let mapToEntrypoint=new Map;if(buildConfig.config?.framework&&(0,import_build_utils3.isPythonFramework)(buildConfig.config?.framework)){let originalSrc=src,existing=["pyproject.toml","requirements.txt","Pipfile"].filter(p=>fileList.includes(p));existing.length>0&&(src=existing[0],mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="node"&&!fileList.includes(src)){let originalSrc=src,existing=fileList.find(path6=>/^(?:src\/)?server\.[cm]?[jt]s$/.test(path6));existing&&(src=existing,mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="go"&&!fileList.includes(src)){let originalSrc=src,existing=["main.go","cmd/api/main.go","cmd/server/main.go"].filter(p=>fileList.includes(p));existing.length>0&&(src=existing[0],mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="rust"&&src==="src/main.rs"&&!fileList.includes(src)){let originalSrc=src;fileList.includes("Cargo.toml")&&(src="Cargo.toml",mapToEntrypoint.set(src,originalSrc))}if(buildConfig.config?.framework==="container"&&!fileList.includes(src)){let originalSrc=src,existing=["Dockerfile.vercel","Containerfile.vercel","Dockerfile","Containerfile"].find(p=>fileList.includes(p));existing&&(src=existing,mapToEntrypoint.set(src,originalSrc))}let extensionless=devServer.getExtensionlessFile(src);extensionless&&(mapToEntrypoint.set(extensionless,src),src=extensionless);let files=fileList.filter(name=>name===src||(0,import_minimatch.default)(name,src,{dot:!0})).map(name=>join(cwd,name));files.length===0&&(config.zeroConfig&&use==="@vercel/static"||noMatches.push(buildConfig));for(let file of files){src=relative2(cwd,file);let entrypoint=mapToEntrypoint.get(src)||src;if(config.zeroConfig&&config.outputDirectory){let outputMatch=config.outputDirectory+"/";src.startsWith(outputMatch)&&(src=src.slice(outputMatch.length))}let builderWithPkg=buildersWithPkgs.get(use);if(!builderWithPkg)throw dev.DEV_BUILDER_LOAD_FAILED({use});matches.push({...buildConfig,src,entrypoint,builderWithPkg,buildOutput:{},buildResults:new Map,buildTimestamp:0})}}if(noMatches.length>0){output_manager_default.warn(`You defined ${(0,import_pluralize.default)("build",noMatches.length,!0)} that did not match any source files (please ensure they are NOT defined in ${highlight(".vercelignore")}):`);for(let buildConfig of noMatches)output_manager_default.print(`- ${JSON.stringify(buildConfig)}
|
|
35
35
|
`)}return matches}async function shutdownBuilder(match){let ops=[];if(match.buildProcess){let{pid}=match.buildProcess;output_manager_default.debug(`Killing builder sub-process with PID ${pid}`);let killPromise=treeKill(pid).then(()=>{output_manager_default.debug(`Killed builder with PID ${pid}`)}).catch(err=>{output_manager_default.debug(`Failed to kill builder with PID ${pid}: ${err}`)});ops.push(killPromise),delete match.buildProcess}if(match.buildOutput)for(let asset of Object.values(match.buildOutput))asset.type==="Lambda"&&asset.fn&&(output_manager_default.debug("Shutting down Lambda function"),ops.push(asset.fn.destroy()));await Promise.all(ops)}var import_build_utils4=__toESM(require_build_utils(),1),import_frameworks=__toESM(require_frameworks(),1);var BUILDPACK_DEV_UNSUPPORTED="BUILDPACK_DEV_UNSUPPORTED";function getBuildpackRuntime(builder){let buildpack=builder?.config?.buildpack;return typeof buildpack=="string"&&buildpack.length>0?buildpack:void 0}function runtimeDisplayName(runtime){return import_frameworks.frameworkList.find(f=>f.slug===runtime)?.name??runtime}function buildpackDevUnsupportedError(runtime){return new import_build_utils4.NowBuildError({code:BUILDPACK_DEV_UNSUPPORTED,message:`${getCommandName("dev")} doesn't support ${runtimeDisplayName(runtime)} projects yet.`})}function buildpackServicesDevUnsupportedError(services){let names=services.map(s=>`"${s.name}"`),list=names.length===1?names[0]:`${names.slice(0,-1).join(", ")} and ${names[names.length-1]}`,label=`${[...new Set(services.map(s=>runtimeDisplayName(s.runtime)))].join(" and ")} ${names.length===1?"service":"services"}`;return new import_build_utils4.NowBuildError({code:BUILDPACK_DEV_UNSUPPORTED,message:`${getCommandName("dev")} doesn't support the ${label} ${list} yet.`})}function assertNoBuildpackServices(services){let blocked=[];for(let service of services){let runtime=getBuildpackRuntime(service.builder);runtime&&blocked.push({name:service.name,runtime})}if(blocked.length>0)throw buildpackServicesDevUnsupportedError(blocked)}var httpStatusDescriptionMap=new Map([[400,"BAD_REQUEST"],[402,"PAYMENT_REQUIRED"],[403,"FORBIDDEN"],[404,"NOT_FOUND"],[405,"NOT_ALLOWED"],[410,"GONE"],[413,"PAYLOAD_TOO_LARGE"],[429,"RATE_LIMITED"],[500,"INTERNAL_SERVER_ERROR"],[501,"NOT_IMPLEMENTED"],[502,"BAD_GATEWAY"],[503,"SERVICE_UNAVAILABLE"],[504,"GATEWAY_TIMEOUT"],[508,"INFINITE_LOOP"]]),errorMessageMap=new Map([[400,"Bad request"],[402,"Payment required"],[403,"You don't have the required permissions"],[404,"The page could not be found"],[405,"Method not allowed"],[410,"The deployment has been removed"],[413,"Request Entity Too Large"],[429,"Rate limited"],[500,"A server error has occurred"],[501,"Not implemented"],[503,"The deployment is currently unavailable"],[504,"An error occurred with your deployment"],[508,"Infinite loop detected"]]),appError={title:"An error occurred with this application.",subtitle:"This is an error with the application itself, not the platform.",app_error:!0},pageNotFoundError={title:"The page could not be found.",subtitle:"The page could not be found in the application.",app_error:!0};function generateErrorMessage(statusCode,errorCode){return statusCode===404?pageNotFoundError:statusCode===502?appError:{title:errorMessageMap.get(statusCode)||"Error occurred",app_error:!1}}function generateHttpStatusDescription(statusCode){return httpStatusDescriptionMap.get(statusCode)||"UNKNOWN_ERROR"}function createErrorReporter(recordCode){return err=>{let diagnostic=toDiagnostic(err);for(let code of telemetryCodes(diagnostic))recordCode(code);return output_manager_default.prettyError(diagnostic),diagnostic}}var import_escape_html=__toESM(require_escape_html(),1);function error(it){let out="<main> ";return it.error_code=="EDGE_FUNCTION_INVOCATION_FAILED"&&(out+=' <p class="error-title error-title-guilty"> <strong>This Edge Function</strong><span> has crashed.</span> </p> '),out+=" ",it.error_code=="FUNCTION_INVOCATION_FAILED"&&(out+=' <p class="error-title error-title-guilty"> <strong>This Serverless Function</strong><span> has crashed.</span> </p> '),out+=' <p class="devinfo-container"> <span class="error-code"><strong>'+it.http_status_code+"</strong>: "+(0,import_escape_html.default)(it.http_status_description)+"</span> ",it.error_code&&(out+=' <span class="devinfo-line">Code: <code>'+(0,import_escape_html.default)(it.error_code)+"</code></span> "),out+=' <span class="devinfo-line">ID: <code>'+(0,import_escape_html.default)(it.request_id)+"</code> </p> <p> <ul> <li> Check the logs in your terminal window to see the application error. </li> </ul> </p></main>",out}var import_escape_html2=__toESM(require_escape_html(),1);function error_base(it){return'<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#000"> <title>'+it.http_status_code+": "+(0,import_escape_html2.default)(it.http_status_description)+`</title> <style> html { font-size: 62.5%; box-sizing: border-box; height: -webkit-fill-available } *, ::after, ::before { box-sizing: inherit } body { font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif; font-size: 1.6rem; line-height: 1.65; word-break: break-word; font-kerning: auto; font-variant: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; hyphens: auto; height: 100vh; height: -webkit-fill-available; max-height: 100vh; max-height: -webkit-fill-available; margin: 0 } ::selection { background: #79FFE1; } ::-moz-selection { background: #79FFE1; } a { cursor: pointer; color: #0070f3; text-decoration: none; transition: all .2s ease; border-bottom: 1px solid transparent } a:hover { border-bottom: 1px solid #0070f3 } ul { padding: 0; margin-left: 1.5em; list-style-type: none } li { margin-bottom: 10px } ul li:before { content: '\\02013' } li:before { display: inline-block; color: #ccc; position: absolute; margin-left: -18px; transition: color .2s ease } code { font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: .92em } code:after, code:before { content: '\`' } .container { display: flex; justify-content: center; flex-direction: column; min-height: 100% } main { max-width: 80rem; padding: 4rem 6rem; margin: auto } ul { margin-bottom: 32px } .error-title { font-size: 2rem; padding-left: 22px; line-height: 1.5; margin-bottom: 24px; } .error-title-guilty { border-left: 2px solid #ED367F; } .error-title-innocent { border-left: 2px solid #59B89C; } main p { color: #333 } .devinfo-container { border: 1px solid #ddd; border-radius: 4px; padding: 2rem; display: flex; flex-direction: column; margin-bottom: 32px } .error-code { margin: 0; font-size: 1.6rem; color: #000; margin-bottom: 1.6rem } .devinfo-line { color: #333 } .devinfo-line code, code, li { color: #000 } .devinfo-line:not(:last-child) { margin-bottom: 8px } .docs-link, .contact-link { font-weight: 500 } header, footer, footer a { display: flex; justify-content: center; align-items: center } header, footer { min-height: 100px; height: 100px; } header { border-bottom: 1px solid #eaeaea; } header h1 { font-size: 1.8rem; margin: 0; font-weight: 500; } header p { font-size: 1.3rem; margin: 0; font-weight: 500; } .header-item { display: flex; padding: 0 2rem; margin: 2rem 0; text-decoration: line-through; color: #999; } .header-item.active { color: #ff0080; text-decoration: none; } .header-item.first { border-right: 1px solid #eaeaea; } .header-item-content { display: flex; flex-direction: column; } .header-item-icon { margin-right: 1rem; margin-top: 0.6rem; } footer { border-top: 1px solid #eaeaea; } footer a { color: #000 } footer a:hover { border-bottom-color: transparent } footer svg { margin-left: .8rem } .note { padding: 8pt 16pt; border-radius: 5px; border: 1px solid #0070f3; font-size: 14px; line-height: 1.8; color: #0070f3; } @media (max-width:500px) { .devinfo-container .devinfo-line code { margin-top: .4rem } .devinfo-container .devinfo-line:not(:last-child) { margin-bottom: 1.6rem } .devinfo-container { margin-bottom: 0; } header { flex-direction: column; height: auto; min-height: auto; align-items: flex-start; } .header-item.first { border-right: none; margin-bottom: 0; } main { padding: 1rem 2rem; } body { font-size: 1.4rem; line-height: 1.55; } footer { display: none; } .note { margin-top: 16px; } } </style> </head> <body> <div class="container"> `+it.view+" </div> </body></html>"}var import_escape_html3=__toESM(require_escape_html(),1);function error_404(it){let out='<main> <p class="devinfo-container"> <span class="error-code"><strong>'+it.http_status_code+"</strong>: "+(0,import_escape_html3.default)(it.http_status_description)+"</span> ";return it.error_code&&(out+=' <span class="devinfo-line">Code: <code>'+(0,import_escape_html3.default)(it.error_code)+"</code></span> "),out+=' <span class="devinfo-line">ID: <code>'+(0,import_escape_html3.default)(it.request_id)+"</code> </p></main>",out}var import_escape_html4=__toESM(require_escape_html(),1);function error_502(it){let out='<main> <p class="devinfo-container"> <span class="error-code"><strong>'+it.http_status_code+"</strong>: "+(0,import_escape_html4.default)(it.http_status_description)+"</span> ";return it.error_code&&(out+=' <span class="devinfo-line">Code: <code>'+(0,import_escape_html4.default)(it.error_code)+"</code></span> "),out+=' <span class="devinfo-line">ID: <code>'+(0,import_escape_html4.default)(it.request_id)+"</code> </p> <p> <ul> <li> Check the logs in your terminal window to see the application error. </li> </ul> </p></main>",out}var import_escape_html5=__toESM(require_escape_html(),1);function redirect(it){return"<!doctype html><!-- https://now.sh --><h1>Redirecting ("+it.statusCode+")</h1><a>"+(0,import_escape_html5.default)(it.location)+"</a>"}var import_ms4=__toESM(require_ms(),1),import_get_port=__toESM(require_get_port(),1),import_chalk=__toESM(require_source(),1),import_frameworks2=__toESM(require_frameworks(),1);import path2 from"path";import{Transform,Writable}from"stream";function parseCronFields(expression){let parts=expression.trim().split(/\s+/);if(parts.length!==5)return null;let[minute,hour,dayOfMonth,month,dayOfWeek]=parts;return{minute,hour,dayOfMonth,month,dayOfWeek}}function expandCronField(field,min,max){let values=new Set;for(let part of field.split(",")){let stepMatch=part.match(/^(.+)\/(\d+)$/),range=stepMatch?stepMatch[1]:part,step=stepMatch?parseInt(stepMatch[2],10):1,start,end;if(range==="*")start=min,end=max;else if(range.includes("-")){let[lo,hi]=range.split("-").map(Number);start=lo,end=hi}else{let val=parseInt(range,10);start=val,end=val}for(let i=start;i<=end;i+=step)values.add(i)}return values}function nextOrWrap(sorted,current){for(let v of sorted)if(v>=current)return v;return null}function dayMatches(date,daysOfMonth,daysOfWeek,orDays){return orDays?daysOfMonth.has(date.getDate())||daysOfWeek.has(date.getDay()):daysOfMonth.has(date.getDate())&&daysOfWeek.has(date.getDay())}function getNextCronDelay(expression,now=new Date){let parsed=parseCronFields(expression);if(!parsed)return null;let minuteSet=expandCronField(parsed.minute,0,59),hourSet=expandCronField(parsed.hour,0,23),domSet=expandCronField(parsed.dayOfMonth,1,31),monthSet=expandCronField(parsed.month,1,12),dowSet=expandCronField(parsed.dayOfWeek,0,6),sortedMinutes=[...minuteSet].sort((a,b)=>a-b),sortedHours=[...hourSet].sort((a,b)=>a-b),sortedMonths=[...monthSet].sort((a,b)=>a-b),orDays=parsed.dayOfMonth!=="*"&&parsed.dayOfWeek!=="*",t=new Date(now);t.setSeconds(0,0),t.setMinutes(t.getMinutes()+1);let maxYear=t.getFullYear()+4;for(;t.getFullYear()<=maxYear;){let month=t.getMonth()+1,nextMonth=nextOrWrap(sortedMonths,month);if(nextMonth===null||nextMonth>month){let targetMonth=nextMonth??sortedMonths[0];nextMonth===null&&t.setFullYear(t.getFullYear()+1),t.setMonth(targetMonth-1,1),t.setHours(sortedHours[0],sortedMinutes[0]);continue}if(!dayMatches(t,domSet,dowSet,orDays)){t.setDate(t.getDate()+1),t.setHours(sortedHours[0],sortedMinutes[0]);continue}let hour=t.getHours(),nextHour=nextOrWrap(sortedHours,hour);if(nextHour===null||nextHour>hour){nextHour===null?(t.setDate(t.getDate()+1),t.setHours(sortedHours[0],sortedMinutes[0])):t.setHours(nextHour,sortedMinutes[0]);continue}let minute=t.getMinutes(),nextMinute=nextOrWrap(sortedMinutes,minute);if(nextMinute===null||nextMinute>minute){nextMinute===null?t.setHours(t.getHours()+1,sortedMinutes[0]):t.setMinutes(nextMinute);continue}return t.getTime()-now.getTime()}return null}var import_build_utils5=__toESM(require_build_utils(),1);var import_service_schedules=__toESM(require_service_schedules(),1);import{chmodSync,mkdirSync,readFileSync as readFileSync2,renameSync,rmSync,writeFileSync}from"node:fs";import{randomUUID}from"node:crypto";import{dirname as dirname2,isAbsolute,join as join2,normalize,sep}from"node:path";var manifest_default={nextDevWebSocketPreload:{source:"node-preloads/next-dev-websocket.cjs",destination:"node-preloads/next-dev-websocket.cjs"}};var runtimeAssets=manifest_default;function getRuntimeAssetsDir(version=pkg_default.version,globalRoot=getGlobalPathConfig()){return join2(globalRoot,"runtime-assets",version)}function materializeRuntimeAsset(id,options={}){let definition=runtimeAssets[id];if(!definition)throw new Error(`Unknown runtime asset: ${String(id)}`);let source=validateRelativePath(id,"source",definition.source),destination=validateRelativePath(id,"destination",definition.destination),data=readRuntimeAsset(source),destinationPath=join2(getRuntimeAssetsDir(options.version??pkg_default.version,options.globalRoot??getGlobalPathConfig()),destination),destinationDir=dirname2(destinationPath),temporaryPath=`${destinationPath}.${process.pid}.${randomUUID()}.tmp`;mkdirSync(destinationDir,{recursive:!0});try{writeFileSync(temporaryPath,new Uint8Array(data.buffer,data.byteOffset,data.byteLength)),definition.executable&&chmodSync(temporaryPath,493);try{renameSync(temporaryPath,destinationPath)}catch(error2){let code=error2.code;if(code!=="EEXIST"&&code!=="EPERM")throw error2;rmSync(destinationPath,{force:!0}),renameSync(temporaryPath,destinationPath)}}finally{rmSync(temporaryPath,{force:!0})}return destinationPath}function readRuntimeAsset(source,moduleDir=__dirname){let candidates=[join2(moduleDir,"runtime-assets",source),join2(moduleDir,"..","runtime-assets",source),join2(moduleDir,"..","..","runtime-assets",source)],lastError;for(let candidate of candidates)try{return readFileSync2(candidate)}catch(error2){if(error2.code!=="ENOENT")throw error2;lastError=error2}throw lastError}function validateRelativePath(id,field,value){let normalized=normalize(value);if(!value||isAbsolute(value)||normalized===".."||normalized.startsWith(`..${sep}`))throw new Error(`Runtime asset "${id}" has an invalid ${field} path: ${JSON.stringify(value)}`);return normalized}function injectNextDevWebSocketShimIfNeeded(env,command,projectSettings,runtimeOptions){if(!shouldInjectNextDevWebSocketShim(command,projectSettings))return;let shimPath=materializeRuntimeAsset("nextDevWebSocketPreload",runtimeOptions);return env.NODE_OPTIONS=prependNodeRequireOption(env.NODE_OPTIONS,shimPath),shimPath}function shouldInjectNextDevWebSocketShim(command,projectSettings){return projectSettings?.framework==="nextjs"||/(?:^|\s)(?:next|next\.js)(?:\s+dev)?(?:\s+-|\s*$|$)/.test(command)}function prependNodeRequireOption(nodeOptions,requirePath){let requireOption=`--require ${JSON.stringify(requirePath)}`;return nodeOptions?`${requireOption} ${nodeOptions}`:requireOption}function replaceDevCommandPort(command,port){return command.replace(/\$PORT/g,`${port}`).replace(/%PORT%/g,`${port}`)}var import_ms3=__toESM(require_ms(),1);var DEV_RUNTIME_CACHE_PREFIX="/_svc/_cache/",DEV_RUNTIME_CACHE_API_PREFIX="/v1/suspense-cache/",DEV_RUNTIME_CACHE_ITEM_PREFIX=`${DEV_RUNTIME_CACHE_PREFIX}v1/suspense-cache/`,HEADER_CACHE_STATE="x-vercel-cache-state",HEADER_CACHE_TAGS="x-vercel-cache-tags",HEADER_REVALIDATE="x-vercel-revalidate",HEADER_CACHE_ITEM_NAME="x-vercel-cache-item-name",TICK_INTERVAL=(0,import_ms3.default)("1m");function getDevRuntimeCacheEnv(origin,itemPrefix=DEV_RUNTIME_CACHE_ITEM_PREFIX){return{RUNTIME_CACHE_ENDPOINT:`${origin}${itemPrefix}`,RUNTIME_CACHE_HEADERS:JSON.stringify({authorization:`Bearer ${DEV_RESOURCE_TOKEN}`})}}var RuntimeCacheStore=class{constructor(){this.entries=new Map;this.tagExpirations=new Map;this.sequence=0;this.tickTimer=setInterval(()=>this.tick(),TICK_INTERVAL),this.tickTimer.unref()}get(key){let entry=this.entries.get(key);return entry?this.isStale(entry)?(this.entries.delete(key),null):{value:entry.value,tags:entry.tags,ageSeconds:Math.floor((Date.now()-entry.lastModified)/1e3)}:null}set(key,value,options={}){let ttlSeconds=options.ttlSeconds;this.entries.set(key,{value,tags:options.tags??[],ttlMs:ttlSeconds&&ttlSeconds>0?ttlSeconds*1e3:null,lastModified:Date.now(),sequence:++this.sequence})}delete(key){this.entries.delete(key)}expireTags(tags){let sequence=++this.sequence;for(let tag of tags)this.tagExpirations.set(tag,sequence)}size(){return this.entries.size}stop(){clearInterval(this.tickTimer)}isStale(entry){if(entry.ttlMs!==null&&entry.lastModified+entry.ttlMs<=Date.now())return!0;for(let tag of entry.tags){let expiredAt=this.tagExpirations.get(tag);if(expiredAt!==void 0&&expiredAt>entry.sequence)return!0}return!1}tick(){for(let[key,entry]of this.entries)this.isStale(entry)&&this.entries.delete(key)}};var STARTUP_TIMEOUT=(0,import_ms4.default)("5m"),SERVICE_COLORS=[import_chalk.default.cyan,import_chalk.default.magenta,import_chalk.default.yellow,import_chalk.default.green,import_chalk.default.blue];function createServiceLogger(serviceName,colorIndex,maxNameLength){let color=SERVICE_COLORS[colorIndex%SERVICE_COLORS.length],padding=" ".repeat(maxNameLength-serviceName.length),prefix=color(`[${serviceName}]`)+padding,createTransform=streamLabel=>{let buffer="",labelPrefix=output_manager_default.debugEnabled?`${prefix} ${import_chalk.default.gray(`(${streamLabel})`)}`:prefix;return new Transform({transform(chunk,_encoding,callback){buffer+=chunk.toString();let lines=buffer.split(`
|
|
36
36
|
`);if(buffer=lines.pop()||"",lines.length>0){let prefixed=lines.map(line=>`${labelPrefix} ${line}`).join(`
|
|
37
37
|
`);callback(null,prefixed+`
|
|
38
38
|
`)}else callback(null,"")},flush(callback){buffer?callback(null,`${labelPrefix} ${buffer}
|
|
39
|
-
`):callback(null,"")}})},stdout=createTransform("stdout"),stderr=createTransform("stderr");return stdout.pipe(process.stdout),stderr.pipe(process.stderr),{stdout,stderr,cleanup:()=>{stdout.unpipe(process.stdout),stderr.unpipe(process.stderr),stdout.destroy(),stderr.destroy()}}}function getServiceRoutePrefixes(service){return(0,import_build_utils5.isQueueTriggeredService)(service)||(0,import_build_utils5.isWorkflowTriggeredService)(service)?[(0,import_build_utils5.getInternalServiceWorkerPathPrefix)(service.name)]:(0,import_build_utils5.isScheduleTriggeredService)(service)?[(0,import_build_utils5.getInternalServiceCronPathPrefix)(service.name)]:service.type==="web"?[service.routePrefix||"/"]:[]}function getEntrypointForService(builderSrc,entrypoint,dir){let resolved=builderSrc||entrypoint||"";if(dir&&dir!=="."){let prefix=dir.endsWith("/")?dir:`${dir}/`;resolved.startsWith(prefix)&&(resolved=resolved.slice(prefix.length))}return resolved}var FORCE_KILL_GRACE_MS=2e3,STOP_ALL_TIMEOUT_MS=8e3;function killGroup(pid,signal){try{return process.kill(-pid,signal),!0}catch(err){let code=err.code;if(code==="ESRCH"||code==="EPERM")return!1;throw err}}function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}function waitForExit(pid,proc,timeoutMs){return proc&&(proc.exitCode!==null||proc.signalCode!==null)||!isProcessAlive(pid)?Promise.resolve(!0):new Promise(resolve3=>{let settled=!1,finish=died=>{settled||(settled=!0,clearInterval(poll),clearTimeout(deadline),proc&&proc.removeListener("exit",onExit),resolve3(died))},onExit=()=>finish(!0);proc&&proc.once("exit",onExit);let poll=setInterval(()=>{isProcessAlive(pid)||finish(!0)},100),deadline=setTimeout(()=>finish(!1),timeoutMs)})}var ServicesOrchestrator=class{constructor(options){this.managedServices=new Map;this.managedProcesses=new Map;this.servicePorts=new Map;this.installMeta={};this.cronTimers=[];this.stopping=!1;this.services=options.services,this.cwd=options.cwd,this.repoRoot=options.repoRoot,this.maxNameLength=Math.max(...options.services.map(s=>s.name.length)),this.proxyOrigin=options.proxyOrigin,this.resourceEndpoints=options.resourceEndpoints,this.envFilesValues=options.env,this.useImplicitEnvInjection=options.useImplicitEnvInjection,this.preferServiceBuilder=options.preferServiceBuilder??!1,this.onQueueSubscriptions=options.onQueueSubscriptions;let pythonWorkspaces=options.services.filter(service=>service.runtime==="python").map(service=>path2.resolve(this.cwd,(0,import_build_utils5.isExperimentalServiceV2)(service)?service.root||".":service.workspace||"."));this.pythonServiceCount=new Set(pythonWorkspaces).size,this.hasQueueServices=options.services.filter(import_build_utils5.isExperimentalService).some(import_build_utils5.isQueueBackedService)}forceKillAllSync(){let killOne=pid=>{if(pid)try{killGroup(pid,"SIGKILL")}catch{}};for(let[,proc]of this.managedProcesses)killOne(proc.pid);for(let[,service]of this.managedServices)killOne(service.pid)}registerExitBackstop(){if(this.exitBackstop)return;let backstop=()=>this.forceKillAllSync();this.exitBackstop=backstop,process.on("exit",backstop)}unregisterExitBackstop(){this.exitBackstop&&(process.removeListener("exit",this.exitBackstop),this.exitBackstop=void 0)}async startAll(){output_manager_default.debug(`Starting ${this.services.length} services`),this.registerExitBackstop(),await this.allocateServicePorts();let startPromises=this.services.map((service,index)=>this.startService(service,index).then(result=>(this.managedServices.set(result.name,result),result))),failures=(await Promise.allSettled(startPromises)).filter(r=>r.status==="rejected");if(failures.length>0)throw await this.stopAll(),new ServiceStartError(failures.map(f=>f.reason));output_manager_default.debug(`All ${this.managedServices.size} services started successfully`),this.startCronSchedulers()}async stopAll(){if(this.stopping)return;this.stopping=!0;let totalCount=this.managedServices.size+this.managedProcesses.size;output_manager_default.debug(`Stopping ${totalCount} services/processes`);let stopPromises=[];for(let[name,service]of this.managedServices){output_manager_default.debug(`Stopping service "${name}" (PID: ${service.pid})`);let stopService=async()=>{service.shutdown&&await service.shutdown().catch(err=>{output_manager_default.debug(`Failed to shutdown service "${name}": ${err}`)}),service.pid&&await this.terminateProcessGroup(name,service.pid,service.process).catch(err=>{output_manager_default.debug(`Failed to kill service "${name}": ${err}`)})};stopPromises.push(stopService()),service.logger.cleanup()}for(let[name,proc]of this.managedProcesses)proc.pid&&!this.managedServices.has(name)&&(output_manager_default.debug(`Stopping process "${name}" (PID: ${proc.pid})`),stopPromises.push(this.terminateProcessGroup(name,proc.pid,proc).catch(err=>{output_manager_default.debug(`Failed to stop process "${name}": ${err}`)})));for(let timer of this.cronTimers)clearTimeout(timer);this.cronTimers=[];let timedOut=!1,timeoutHandle,timeout=new Promise(resolve3=>{timeoutHandle=setTimeout(()=>{timedOut=!0,output_manager_default.debug(`stopAll timed out after ${STOP_ALL_TIMEOUT_MS}ms; remaining processes will be SIGKILLed on exit`),resolve3()},STOP_ALL_TIMEOUT_MS)});try{await Promise.race([Promise.all(stopPromises),timeout])}finally{timeoutHandle&&clearTimeout(timeoutHandle)}timedOut||(this.managedServices.clear(),this.managedProcesses.clear(),this.unregisterExitBackstop(),output_manager_default.debug("All services stopped"))}async terminateProcessGroup(name,pid,proc){try{killGroup(pid,"SIGTERM")}catch(err){output_manager_default.debug(`SIGTERM group kill for "${name}" failed: ${err}`)}if(await treeKill(pid,"SIGTERM").catch(err=>{output_manager_default.debug(`tree-kill (SIGTERM) for "${name}" failed: ${err}`)}),!await waitForExit(pid,proc,FORCE_KILL_GRACE_MS)){output_manager_default.debug(`Escalating to SIGKILL for "${name}" (PID: ${pid})`);try{killGroup(pid,"SIGKILL")}catch(err){output_manager_default.debug(`SIGKILL group kill for "${name}" failed: ${err}`)}await treeKill(pid,"SIGKILL").catch(()=>{})}}getServiceForRoute(pathname){let bestMatch=null,bestMatchLength=-1;for(let service of this.managedServices.values())for(let routePrefix of service.routePrefixes){if(routePrefix==="/"){bestMatchLength===-1&&(bestMatch=service,bestMatchLength=0);continue}let normalizedPrefix=routePrefix.startsWith("/")?routePrefix:`/${routePrefix}`;(pathname===normalizedPrefix||pathname.startsWith(`${normalizedPrefix}/`))&&normalizedPrefix.length>bestMatchLength&&(bestMatch=service,bestMatchLength=normalizedPrefix.length)}return bestMatch}getServiceOrigin(serviceName){let service=this.managedServices.get(serviceName);return service?`http://${service.host}:${service.port}`:null}hasServices(){return this.managedServices.size>0}getServices(){return this.managedServices}async allocateServicePorts(){let used=new Set;for(let service of this.services){let port=await(0,import_get_port.default)();for(;used.has(port);)port=await(0,import_get_port.default)();used.add(port),this.servicePorts.set(service.name,port)}}async startService(service,colorIndex){let logger=createServiceLogger(service.name,colorIndex,this.maxNameLength),spec=(0,import_build_utils5.isExperimentalServiceV2)(service)?this.getV2StartSpec(service):this.getV1StartSpec(service),port=this.servicePorts.get(service.name);port!==void 0&&(spec.env.VERCEL_DEV_PORT=String(port));let buildpackRuntime=getBuildpackRuntime(service.builder);if(buildpackRuntime)throw buildpackServicesDevUnsupportedError([{name:service.name,runtime:buildpackRuntime}]);if(spec.builderSpec){let result=await this.tryStartWithBuilder(service.name,spec,logger,port);if(result)return result}let devCommand2=spec.explicitDevCommand||spec.framework?.settings?.devCommand?.value;if(!devCommand2)throw dev.DEV_SERVICE_NO_DEV_SERVER({name:service.name,framework:service.framework??"none"});return this.spawnDevCommandProcess({name:service.name,devCommand:devCommand2,framework:spec.framework,workspacePath:spec.rootPath,env:spec.env,logger,builderConfig:spec.builderConfig,routePrefixes:spec.routePrefixes,workspaceLabel:spec.rootLabel,port})}applyRuntimeCacheEnv(env){env.RUNTIME_CACHE_ENDPOINT||Object.assign(env,getDevRuntimeCacheEnv(this.resourceEndpoints.runtimeCache.direct,""))}applyContainerResourceProxyEnv(env){let endpoints=this.resourceEndpoints;env.VERCEL_QUEUE_BASE_URL===endpoints.queues.direct&&Object.assign(env,getDevQueueEnv(endpoints.queues.proxy,env.VERCEL_HAS_WORKER_SERVICES!==void 0)),env.RUNTIME_CACHE_ENDPOINT===endpoints.runtimeCache.direct&&Object.assign(env,getDevRuntimeCacheEnv(endpoints.runtimeCache.proxy,""))}getV1StartSpec(service){let framework=import_frameworks2.frameworkList.find(f=>f.slug===service.framework),effectiveProcessEnv=(0,import_build_utils5.cloneEnv)(this.envFilesValues,process.env),perServiceEnv={};this.useImplicitEnvInjection?perServiceEnv=(0,import_build_utils5.getExperimentalServiceUrlEnvVars)({services:this.services,frameworkList:framework?[framework]:[],origin:this.proxyOrigin,currentEnv:effectiveProcessEnv}):service.env&&(perServiceEnv=(0,import_build_utils5.getServiceUrlEnvVars)({requestedEnv:service.env,consumerService:service,services:this.services,frameworkList:import_frameworks2.frameworkList,origin:this.proxyOrigin,currentEnv:effectiveProcessEnv}));let env=(0,import_build_utils5.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},perServiceEnv,effectiveProcessEnv);env.VERCEL_SERVICE_TYPE=service.type,service.trigger&&(env.VERCEL_SERVICE_TRIGGER=service.trigger),this.hasQueueServices&&service.runtime==="python"&&env.VERCEL_HAS_WORKER_SERVICES===void 0&&(env.VERCEL_HAS_WORKER_SERVICES="1"),Object.assign(env,getDevQueueEnv(this.resourceEndpoints.queues.direct,this.hasQueueServices)),this.applyRuntimeCacheEnv(env),service.routePrefix&&service.routePrefix!=="/"&&(env.VERCEL_SERVICE_ROUTE_PREFIX=service.routePrefix,env.VERCEL_SERVICE_ROUTE_PREFIX_STRIP="1");let workspace=service.workspace||".";return{rootPath:path2.join(this.cwd,workspace),rootLabel:workspace,framework,builderSpec:this.preferServiceBuilder?service.builder?.use||framework?.useRuntime?.use:framework?.useRuntime?.use||service.builder?.use,entrypoint:getEntrypointForService(service.builder?.src,service.entrypoint,workspace),builderConfig:service.builder?.config,frameworkForDev:service.framework||"services",servicePayload:{name:service.name,type:service.type,trigger:service.trigger,routePrefix:service.routePrefix,subdomain:service.subdomain,workspace:service.workspace,schedule:service.schedule},routePrefixes:getServiceRoutePrefixes(service),env}}getV2StartSpec(service){let framework=import_frameworks2.frameworkList.find(f=>f.slug===service.framework),effectiveProcessEnv=(0,import_build_utils5.cloneEnv)(this.envFilesValues,process.env),perServiceEnv={};for(let binding of service.bindings??[]){if(binding.type!==void 0&&binding.type!=="service"||binding.format!=="url"||binding.env in effectiveProcessEnv)continue;let targetPort=this.servicePorts.get(binding.service);targetPort!==void 0&&(perServiceEnv[binding.env]=`http://127.0.0.1:${targetPort}`)}let env=(0,import_build_utils5.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},effectiveProcessEnv,perServiceEnv);this.hasQueueServices&&service.runtime==="python"&&env.VERCEL_HAS_WORKER_SERVICES===void 0&&(env.VERCEL_HAS_WORKER_SERVICES="1"),Object.assign(env,getDevQueueEnv(this.resourceEndpoints.queues.direct,this.hasQueueServices)),this.applyRuntimeCacheEnv(env);let root=service.root||".";return{rootPath:path2.join(this.cwd,root),rootLabel:root,framework,builderSpec:framework?.useRuntime?.use||service.builder?.use,entrypoint:getEntrypointForService(service.builder?.src,service.entrypoint,root),builderConfig:service.builder?.config,frameworkForDev:service.framework||"services",servicePayload:{name:service.name,workspace:root},routePrefixes:[],env,explicitDevCommand:service.devCommand}}async tryStartWithBuilder(name,spec,logger,port){if(!spec.builderSpec)return null;try{let builderWithPkg=(await importBuilders(new Set([spec.builderSpec]),this.cwd)).get(spec.builderSpec),builder=builderWithPkg?.builder;if(!builder?.startDevServer)return null;builderWithPkg?.pkg.name==="@vercel/container"&&this.applyContainerResourceProxyEnv(spec.env),output_manager_default.debug(`Starting ${import_chalk.default.bold(name)} using ${import_chalk.default.cyan.bold(spec.builderSpec)}`),injectNextDevWebSocketShimIfNeeded(spec.env,spec.framework?.settings.devCommand?.value||"",{framework:spec.framework?.slug});let result=await builder.startDevServer({entrypoint:spec.entrypoint,workPath:spec.rootPath,repoRootPath:this.repoRoot,config:{...spec.builderConfig||{},framework:spec.frameworkForDev},meta:{isDev:!0,env:spec.env,port,serviceCount:this.services.length,pythonServiceCount:this.pythonServiceCount,syncDependencies:!0,serviceName:name,devResourceEndpoints:this.resourceEndpoints},service:spec.servicePayload,files:{},onStdout:data=>logger.stdout.write(data),onStderr:data=>logger.stderr.write(data)});if(!result)return null;let host=await checkForPort(result.port,STARTUP_TIMEOUT);return output_manager_default.debug(`Service ${name} started on ${host}:${result.port}`),result.queueSubscriptions?.length&&this.onQueueSubscriptions?.(name,result.queueSubscriptions),{name,host,port:result.port,pid:result.pid,shutdown:result.shutdown,routePrefixes:spec.routePrefixes,workspace:spec.rootLabel,logger,crons:result.crons,queueSubscriptions:result.queueSubscriptions}}catch(err){if(output_manager_default.debug(`Failed to use startDevServer for ${name}: ${err}`),err instanceof import_build_utils5.NowBuildError)throw err;return null}}async spawnDevCommandProcess(params){let{name,devCommand:devCommand2,framework,workspacePath,env,logger,builderConfig,routePrefixes,workspaceLabel}=params;await this.syncDependencies(builderConfig,workspacePath,logger);let port=params.port??await(0,import_get_port.default)();env.PORT=`${port}`;let command=replaceDevCommandPort(devCommand2,port),nodeBinPath=(0,import_build_utils5.getNodeBinPaths)({base:this.repoRoot,start:workspacePath}).join(path2.delimiter);env.PATH=`${nodeBinPath}${path2.delimiter}${env.PATH}`,output_manager_default.debug(`Starting ${import_chalk.default.bold(name)} with ${import_chalk.default.cyan.bold(`"${command}"`)}`),process.stdout.columns&&(env.COLUMNS=`${process.stdout.columns}`),injectNextDevWebSocketShimIfNeeded(env,command,{framework:framework?.slug});let child=(0,import_build_utils5.spawnCommand)(command,{cwd:workspacePath,env,stdio:["ignore","pipe","pipe"],detached:!0});if(child.pid){if(!child.stdout||!child.stderr)throw dev.DEV_SERVICE_NO_STDIO({name})}else throw dev.DEV_SERVICE_NO_PID({name});this.managedProcesses.set(name,child),child.stdout?.on("data",chunk=>{logger.stdout.write(chunk)}),child.stderr?.on("data",chunk=>{logger.stderr.write(chunk)});let host;try{host=await this.waitForPort(child,name,port)}catch(error2){throw this.managedProcesses.delete(name),error2}return output_manager_default.debug(`Service ${name} listening on ${host}:${port}`),{name,host,port,pid:child.pid,process:child,routePrefixes,workspace:workspaceLabel,logger}}async waitForPort(child,serviceName,port){let processError=new Promise((_,reject)=>{child.on("error",reject),child.on("exit",code=>{reject(new Error(`Service "${serviceName}" exited with code ${code} before port was available`))})});return Promise.race([checkForPort(port,STARTUP_TIMEOUT),processError])}async syncDependencies(config,workspacePath,logger){logger.stdout.write(`${import_chalk.default.gray("Synchronizing dependencies...")}
|
|
40
|
-
`);let installCommand=typeof config?.installCommand=="string"?config.installCommand.trim():"";installCommand?await this.runInstallCommand(installCommand,workspacePath,logger):await this.maybeInstallJSDependencies(workspacePath,logger)}async runBuffered(logger,task){let captured=[],bufStdout=new Writable({write(chunk,_enc,cb){let b=Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk);captured.push(["stdout",b]),output_manager_default.debugEnabled&&logger.stdout.write(b),cb()}}),bufStderr=new Writable({write(chunk,_enc,cb){let b=Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk);captured.push(["stderr",b]),output_manager_default.debugEnabled&&logger.stderr.write(b),cb()}});try{await task(bufStdout,bufStderr)}catch(err){for(let[channel,chunk]of captured)logger[channel].write(chunk);throw err}}async runInstallCommand(command,workspacePath,logger){await this.runBuffered(logger,(stdout,stderr)=>new Promise((resolve3,reject)=>{output_manager_default.debug(`Running install command: "${command}" in ${workspacePath}`);let child=(0,import_build_utils5.spawnCommand)(command,{cwd:workspacePath,stdio:["inherit","pipe","pipe"]});child.stdout?.on("data",chunk=>stdout.write(chunk)),child.stderr?.on("data",chunk=>stderr.write(chunk)),child.on("error",reject),child.on("exit",(code,signal)=>{code===0?resolve3():reject(new import_build_utils5.NowBuildError({code:"INSTALL_COMMAND_FAILED",message:`Install command "${command}" failed with code ${code}, signal ${signal}`}))})}))}async maybeInstallJSDependencies(workspacePath,logger){await this.runBuffered(logger,async(stdout,stderr)=>{try{await(0,import_build_utils5.runNpmInstall)(workspacePath,[],void 0,this.installMeta,void 0,{stdout,stderr})}catch(err){throw new import_build_utils5.NowBuildError({code:"NODE_DEPENDENCY_SYNC_FAILED",message:`Failed to install Node.JS dependencies: ${err instanceof Error?err.message:String(err)}`})}})}startCronSchedulers(){for(let[name,managed]of this.managedServices){let service=this.services.find(candidate=>candidate.name===name),crons=managed.crons&&managed.crons.length>0?managed.crons:service&&(0,import_build_utils5.isExperimentalService)(service)&&(0,import_build_utils5.isScheduleTriggeredService)(service)&&service.schedule?(0,import_service_schedules.getStaticServiceSchedules)(service.schedule).map(schedule=>({path:(0,import_build_utils5.getInternalServiceCronPath)(name,service.entrypoint||service.builder.src||"index",service.handlerFunction||"cron"),schedule})):[];if(crons.length!==0)for(let cron of crons)output_manager_default.debug(`Scheduling job service ${import_chalk.default.bold(name)} (${import_chalk.default.cyan(cron.schedule)})`),this.scheduleCronTrigger(name,cron.path,cron.schedule,managed)}}scheduleCronTrigger(serviceName,cronPath,schedule,managed){let delayMs=getNextCronDelay(schedule);if(delayMs===null){output_manager_default.warn(`Could not parse cron schedule "${schedule}" for service "${serviceName}", skipping auto-trigger`);return}let timer=setTimeout(async()=>{if(!this.stopping){output_manager_default.debug(`Triggering scheduled job ${import_chalk.default.bold(serviceName)} (schedule: ${import_chalk.default.cyan(schedule)})`);try{let url4=`http://${managed.host}:${managed.port}${cronPath}`,res=await fetch(url4,{method:"POST"});output_manager_default.debug(`Cron trigger for "${serviceName}" responded with status ${res.status}`)}catch(err){output_manager_default.error(`Cron trigger for "${serviceName}" failed: ${err instanceof Error?err.message:String(err)}`)}this.scheduleCronTrigger(serviceName,cronPath,schedule,managed)}},delayMs);this.cronTimers.push(timer)}};var import_ms5=__toESM(require_ms(),1);import{randomBytes}from"crypto";var import_build_utils6=__toESM(require_build_utils(),1);var DEFAULT_RETRY_AFTER=(0,import_ms5.default)("1m"),DEFAULT_MAX_DELIVERIES=32,DEFAULT_INITIAL_DELAY=0,DEFAULT_VISIBILITY_TIMEOUT=(0,import_ms5.default)("1m"),DEFAULT_RETENTION=(0,import_ms5.default)("1h"),TICK_INTERVAL2=(0,import_ms5.default)("1s");function topicPatternToRegex(pattern){let parts=pattern.split("*").map(s=>s.replace(/-/g,"\\-"));return new RegExp(`^${parts.join("[A-Za-z0-9_\\-]*")}$`)}var QueueBroker=class{constructor(services,getServiceOrigin){this.getServiceOrigin=getServiceOrigin;this.messages=new Map;this.idempotencyRecords=new Map;this.duplicateMessages=new Map;this.consumerGroups=[];this.deliveryState=new Map;this.registerServices(services),this.tickTimer=setInterval(()=>this.tick(),TICK_INTERVAL2),this.tickTimer.unref()}registerServices(services){for(let service of services){if(!(0,import_build_utils6.isQueueBackedService)(service))continue;let topicConfigs=(0,import_build_utils6.getServiceQueueTopicConfigs)(service),consumerGroup=service.consumer??service.name;for(let topicConfig of topicConfigs){let topicPattern=topicConfig.topic,id=`${consumerGroup}::${topicPattern}`,existingGroup=this.consumerGroups.find(group2=>group2.id===id);if(existingGroup&&!existingGroup.serviceName){existingGroup.serviceName=service.name,existingGroup.serviceOriginFn=()=>this.getServiceOrigin(service.name),existingGroup.retryAfterMs=topicConfig.retryAfterSeconds!==void 0?topicConfig.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,existingGroup.initialDelayMs=topicConfig.initialDelaySeconds!==void 0?topicConfig.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY,this.activatePushGroup(existingGroup);continue}if(existingGroup)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup,topic:topicPattern});let group={id,name:consumerGroup,serviceName:service.name,topicPattern,topicRegex:topicPatternToRegex(topicPattern),serviceOriginFn:()=>this.getServiceOrigin(service.name),retryAfterMs:topicConfig.retryAfterSeconds!==void 0?topicConfig.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:topicConfig.initialDelaySeconds!==void 0?topicConfig.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY};this.consumerGroups.push(group),this.deliveryState.set(group.id,this.createRetainedDeliveries(group)),this.activatePushGroup(group)}}}updateServiceSubscriptions(serviceName,subscriptions){if(subscriptions.length===0)return;let kept=[];for(let group of this.consumerGroups)group.serviceName===serviceName?this.deliveryState.delete(group.id):kept.push(group);this.consumerGroups=kept;for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,existingGroup=this.consumerGroups.find(group2=>group2.id===id);if(existingGroup&&!existingGroup.serviceName){existingGroup.serviceName=serviceName,existingGroup.serviceOriginFn=()=>this.getServiceOrigin(serviceName),existingGroup.retryAfterMs=subscription.retryAfterSeconds!==void 0?subscription.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,existingGroup.maxDeliveries=subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,existingGroup.initialDelayMs=subscription.initialDelaySeconds!==void 0?subscription.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY,this.activatePushGroup(existingGroup);continue}if(existingGroup){output_manager_default.debug(`Queue consumer "${subscription.consumer}" is already registered for topic "${subscription.topic}"; keeping the first registration`);continue}let group={id,name:subscription.consumer,serviceName,topicPattern:subscription.topic,topicRegex:topicPatternToRegex(subscription.topic),serviceOriginFn:()=>this.getServiceOrigin(serviceName),retryAfterMs:subscription.retryAfterSeconds!==void 0?subscription.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,maxDeliveries:subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,initialDelayMs:subscription.initialDelaySeconds!==void 0?subscription.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY};this.consumerGroups.push(group),this.deliveryState.set(group.id,this.createRetainedDeliveries(group)),this.activatePushGroup(group)}output_manager_default.debug(`Queue consumer groups for service "${serviceName}" updated from ${subscriptions.length} introspected subscription(s)`)}enqueue(queueName,payload,contentType2,options){let now=Date.now(),messageId=randomBytes(16).toString("hex"),retentionMs=(options?.retentionSeconds??0)>0?options.retentionSeconds*1e3:DEFAULT_RETENTION,idempotencyRecordKey=options?.idempotencyKey?`${queueName}:${options.idempotencyKey}`:void 0;if(idempotencyRecordKey){let record=this.idempotencyRecords.get(idempotencyRecordKey);if(record&&record.expiresAt>Date.now())return this.duplicateMessages.set(messageId,{queueName,originalMessageId:record.messageId,expiresAt:Date.now()+retentionMs}),output_manager_default.debug(`queues: skipped duplicate message for queue "${queueName}"`),{messageId};record&&this.idempotencyRecords.delete(idempotencyRecordKey)}idempotencyRecordKey&&this.idempotencyRecords.set(idempotencyRecordKey,{messageId,expiresAt:Date.now()+retentionMs});let message2={messageId,payload,contentType:contentType2,queueName,createdAt:new Date(now).toISOString(),retentionMs,visibleAt:(options?.delaySeconds??0)>0?now+options.delaySeconds*1e3:0};this.messages.set(messageId,message2),output_manager_default.debug(`queues: stored message ${messageId} for queue "${queueName}"`);let matchingGroups=this.consumerGroups.filter(g=>g.topicRegex.test(queueName));matchingGroups.length===0&&output_manager_default.debug(`queues: no consumer group matches topic "${queueName}", message stored but not dispatched`);for(let group of matchingGroups){let groupDeliveries=this.deliveryState.get(group.id),initialVisibleAt=group.initialDelayMs>0?now+group.initialDelayMs:0,visibleAt=Math.max(message2.visibleAt,initialVisibleAt);groupDeliveries.set(messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt,leaseExpiresAt:0}),visibleAt<=now&&group.serviceOriginFn&&this.dispatchToConsumer(message2,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)})}return{messageId}}getOriginalMessageIdForDuplicate(queueName,messageId){let duplicate=this.duplicateMessages.get(messageId);return!duplicate||duplicate.queueName!==queueName?null:duplicate.expiresAt<=Date.now()?(this.duplicateMessages.delete(messageId),null):duplicate.originalMessageId}receiveById(queueName,messageId,consumerGroup){let message2=this.messages.get(messageId);if(!message2||message2.queueName!==queueName||this.isMessageExpired(message2))return null;let group=this.getOrCreatePullGroup(queueName,consumerGroup),state=this.deliveryState.get(group.id)?.get(messageId);if(!state)return null;if(state.status==="pending"){if(state.visibleAt>Date.now())return null;state.status="in-flight",state.receiptHandle=randomBytes(16).toString("hex"),state.deliveryCount++,state.leaseExpiresAt=Date.now()+DEFAULT_VISIBILITY_TIMEOUT}return{messageId:message2.messageId,payload:message2.payload,contentType:message2.contentType,deliveryCount:state.deliveryCount,createdAt:message2.createdAt,receiptHandle:state.receiptHandle}}receiveMessages(queueName,consumerGroup,options){let group=this.getOrCreatePullGroup(queueName,consumerGroup),groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return[];let now=Date.now(),limit=Math.min(Math.max(options?.limit??1,1),10),visibilityTimeoutMs=(options?.visibilityTimeoutSeconds??DEFAULT_VISIBILITY_TIMEOUT/1e3)*1e3,results=[];for(let[messageId,state]of groupDeliveries){let message2=this.messages.get(messageId);if(!message2){groupDeliveries.delete(messageId);continue}if(this.isMessageExpired(message2,now)){this.deleteMessage(messageId);continue}if(message2.queueName!==queueName||state.status!=="pending"||state.visibleAt>now)continue;let receiptHandle=randomBytes(16).toString("hex");if(state.status="in-flight",state.receiptHandle=receiptHandle,state.deliveryCount++,state.leaseExpiresAt=Date.now()+visibilityTimeoutMs,results.push({messageId:message2.messageId,payload:message2.payload,contentType:message2.contentType,deliveryCount:state.deliveryCount,createdAt:message2.createdAt,receiptHandle}),results.length>=limit)break}return results}acknowledge(messageId,consumerGroup,receiptHandle){let{deliveries:groupDeliveries,state}=this.findDeliveryState(messageId,consumerGroup);return!groupDeliveries||!state?!1:state.receiptHandle&&state.receiptHandle!==receiptHandle?(output_manager_default.debug(`queues: ACK rejected for ${messageId} in group "${consumerGroup}" - receipt handle mismatch`),!1):(state.status="acked",groupDeliveries.delete(messageId),output_manager_default.debug(`queues: ACK message ${messageId} in group "${consumerGroup}"`),!0)}changeVisibility(messageId,consumerGroup,receiptHandle,timeoutSeconds){let{state}=this.findDeliveryState(messageId,consumerGroup);return!state||state.status!=="in-flight"||state.receiptHandle&&state.receiptHandle!==receiptHandle?!1:(state.leaseExpiresAt=Date.now()+timeoutSeconds*1e3,output_manager_default.debug(`queues: visibility for ${messageId} in group "${consumerGroup}" extended by ${timeoutSeconds}s`),!0)}findMessageIdByReceiptHandle(consumerGroup,receiptHandle){for(let group of this.consumerGroups){if(group.name!==consumerGroup)continue;let deliveries=this.deliveryState.get(group.id);if(deliveries){for(let[messageId,state]of deliveries)if(state.receiptHandle===receiptHandle)return messageId}}return null}findDeliveryState(messageId,serviceName){for(let group of this.consumerGroups){if(group.name!==serviceName)continue;let deliveries=this.deliveryState.get(group.id);if(!deliveries)continue;let state=deliveries.get(messageId);if(state)return{deliveries,state}}return{deliveries:null,state:null}}getOrCreatePullGroup(queueName,consumerGroup){let existingGroup=this.consumerGroups.find(group2=>group2.name===consumerGroup&&group2.topicRegex.test(queueName));if(existingGroup)return existingGroup;let group={id:`${consumerGroup}::${queueName}`,name:consumerGroup,topicPattern:queueName,topicRegex:topicPatternToRegex(queueName),retryAfterMs:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:DEFAULT_INITIAL_DELAY},deliveries=new Map;for(let message2 of this.messages.values())message2.queueName!==queueName||this.isMessageExpired(message2)||deliveries.set(message2.messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt:message2.visibleAt,leaseExpiresAt:0});return this.consumerGroups.push(group),this.deliveryState.set(group.id,deliveries),group}isMessageExpired(message2,now=Date.now()){return new Date(message2.createdAt).getTime()+message2.retentionMs<now}deleteMessage(messageId){this.messages.delete(messageId);for(let groupDeliveries of this.deliveryState.values())groupDeliveries.delete(messageId)}createRetainedDeliveries(group){let deliveries=new Map;for(let message2 of this.messages.values())!group.topicRegex.test(message2.queueName)||this.isMessageExpired(message2)||deliveries.set(message2.messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt:Math.max(message2.visibleAt,new Date(message2.createdAt).getTime()+group.initialDelayMs),leaseExpiresAt:0});return deliveries}activatePushGroup(group){if(!group.serviceOriginFn)return;let now=Date.now(),deliveries=this.deliveryState.get(group.id);if(deliveries)for(let[messageId,state]of deliveries){let message2=this.messages.get(messageId);!message2||state.status!=="pending"||(state.visibleAt=Math.max(state.visibleAt,new Date(message2.createdAt).getTime()+group.initialDelayMs),state.visibleAt<=now&&this.dispatchToConsumer(message2,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)}))}}async dispatchToConsumer(message2,group){let groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return;let state=groupDeliveries.get(message2.messageId);if(!state||state.status==="acked")return;if(state.deliveryCount>=group.maxDeliveries){output_manager_default.debug(`queues: message ${message2.messageId} exceeded maxDeliveries (${group.maxDeliveries}) for group "${group.name}", dropping`),groupDeliveries.delete(message2.messageId);return}let upstream=group.serviceOriginFn?.();if(!upstream){state.visibleAt=Date.now()+TICK_INTERVAL2;return}let receiptHandle=randomBytes(16).toString("hex");state.status="in-flight",state.receiptHandle=receiptHandle,state.deliveryCount++,state.leaseExpiresAt=Date.now()+DEFAULT_VISIBILITY_TIMEOUT;let now=new Date().toISOString(),expiresAt=new Date(new Date(message2.createdAt).getTime()+message2.retentionMs).toISOString();output_manager_default.debug(`queues: dispatching v2beta callback to worker "${group.name}" at ${upstream}`);try{let response=await directFetch(`${upstream}/`,{method:"POST",headers:{"content-type":message2.contentType,"ce-type":"com.vercel.queue.v2beta","ce-specversion":"1.0","ce-source":`/topic/${message2.queueName}/consumer/${group.name}`,"ce-id":message2.messageId,"ce-time":now,"ce-vqsmessageid":message2.messageId,"ce-vqsqueuename":message2.queueName,"ce-vqsconsumergroup":group.name,"ce-vqsreceipthandle":receiptHandle,"ce-vqsdeliverycount":String(state.deliveryCount),"ce-vqscreatedat":message2.createdAt,"ce-vqsexpiresat":expiresAt,"ce-vqsregion":"dev1"},body:message2.payload});response.ok||(output_manager_default.debug(`queues: worker "${group.name}" returned ${response.status} for message ${message2.messageId}`),this.handleDeliveryFailure(message2.messageId,group))}catch(err){output_manager_default.debug(`queues: failed to dispatch CloudEvent to "${group.name}": ${err}`),this.handleDeliveryFailure(message2.messageId,group)}}handleDeliveryFailure(messageId,group){let groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return;let state=groupDeliveries.get(messageId);state&&(state.status="pending",state.visibleAt=Date.now()+group.retryAfterMs,state.leaseExpiresAt=0)}tick(){let now=Date.now();for(let[key,record]of this.idempotencyRecords)record.expiresAt<=now&&this.idempotencyRecords.delete(key);for(let[messageId,record]of this.duplicateMessages)record.expiresAt<=now&&this.duplicateMessages.delete(messageId);for(let[messageId,message2]of this.messages)this.isMessageExpired(message2,now)&&this.deleteMessage(messageId);for(let group of this.consumerGroups){let groupDeliveries=this.deliveryState.get(group.id);if(groupDeliveries)for(let[messageId,state]of groupDeliveries){let message2=this.messages.get(messageId);if(!message2){groupDeliveries.delete(messageId);continue}if(state.status==="in-flight"&&state.leaseExpiresAt<=now){state.deliveryCount>=group.maxDeliveries?(output_manager_default.debug(`queues: message ${messageId} exceeded maxDeliveries (${group.maxDeliveries}) for group "${group.name}", dropping`),groupDeliveries.delete(messageId)):(state.status="pending",state.visibleAt=group.serviceOriginFn?now+group.retryAfterMs:now,state.leaseExpiresAt=0);continue}state.status==="pending"&&state.visibleAt<=now&&group.serviceOriginFn&&this.dispatchToConsumer(message2,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)})}}}stop(){clearInterval(this.tickTimer)}};import path3 from"path";function toOrchestratorService(sidecar){let{type:_type,...subscriber}=sidecar;return{...subscriber,schema:"experimentalServices",type:"worker",trigger:"queue"}}async function collectBuilderDevSidecars({builds,workPath,services=[]}){let builderSpecs=new Set(builds.map(build=>build.use)),buildersWithPkgs=await importBuilders(builderSpecs,workPath),servicesByBuilder=new Map(services.map(service=>[service.builder,service])),sidecars=(await Promise.all(builds.map(async build=>{let builder=buildersWithPkgs.get(build.use)?.builder;if(!builder)throw dev.DEV_BUILDER_LOAD_FAILED({use:build.use});let service=servicesByBuilder.get(build),serviceRoot=service?.root??".",sidecars2=await builder.getDevSidecars?.({workPath:path3.join(workPath,serviceRoot),build,...service?{service}:{}})??[];return service?sidecars2.map(sidecar=>({...sidecar,name:`${service.name}-${sidecar.name}`,workspace:serviceRoot})):sidecars2}))).flat(),names=new Set;for(let sidecar of sidecars){let{name,type}=sidecar;if(type!=="subscriber")throw dev.DEV_SIDECAR_UNSUPPORTED_TYPE({name,type});if(names.has(name))throw dev.DEV_SIDECAR_DUPLICATE_NAME({name});names.add(name)}return sidecars}function nodeHeadersToFetchHeaders(nodeHeaders){let headers=new globalThis.Headers;for(let[name,value]of Object.entries(nodeHeaders))if(Array.isArray(value))for(let val of value)headers.append(name,val);else typeof value<"u"&&headers.set(name,String(value));return headers}var NEVER_COMBINE_RESPONSE_HEADERS=new Set(["set-cookie","www-authenticate","proxy-authenticate"]),COMMA_JOIN_RESPONSE_HEADERS=new Set(["vary"]);function applyChainResponseHeader(res,name,value){if(NEVER_COMBINE_RESPONSE_HEADERS.has(name)){let existing=res.getHeader(name),values=Array.isArray(existing)?existing.map(String):existing!==void 0?[String(existing)]:[];values.push(value),res.setHeader(name,values);return}if(COMMA_JOIN_RESPONSE_HEADERS.has(name)){let existing=res.getHeader(name);res.setHeader(name,existing!==void 0?`${existing}, ${value}`:value);return}res.setHeader(name,value)}var NONOVERRIDABLE_HEADERS=new Set(["host","connection","content-length","transfer-encoding","keep-alive","transfer-encoding","te","upgrade","trailer"]);function applyOverriddenHeaders(reqHeaders,respHeaders){let headers=new globalThis.Headers(respHeaders),overriddenHeaders=headers.get("x-middleware-override-headers");if(!overriddenHeaders)return headers;let overriddenKeys=new Set;for(let key of overriddenHeaders.split(","))overriddenKeys.add(key.trim());headers.delete("x-middleware-override-headers");for(let key of Object.keys(reqHeaders))!NONOVERRIDABLE_HEADERS.has(key)&&!overriddenKeys.has(key)&&delete reqHeaders[key];for(let key of overriddenKeys.keys()){if(NONOVERRIDABLE_HEADERS.has(key))continue;let valueKey="x-middleware-request-"+key,newValue=headers.get(valueKey);reqHeaders[key]!==newValue&&(newValue?reqHeaders[key]=newValue:delete reqHeaders[key]),headers.delete(valueKey)}return headers}var import_error_utils=__toESM(require_dist(),1);import{parse}from"url";function parseListen(str,defaultPort=3e3){let port=Number(str);if(!isNaN(port))return[port];let url4=parse(str);switch(url4.protocol){case"pipe:":{let cutStr=str.replace(/^pipe:/,"");if(cutStr.slice(0,4)!=="\\\\.\\")throw dev.DEV_INVALID_WINDOWS_PIPE({endpoint:str});return[cutStr]}case"unix:":if(!url4.pathname)throw dev.DEV_INVALID_UNIX_SOCKET({endpoint:str});return[url4.pathname];case"tcp:":return url4.port=url4.port||String(defaultPort),[parseInt(url4.port,10),url4.hostname??void 0];default:if(!url4.slashes){if(url4.protocol===null)return[defaultPort,url4.pathname??void 0];if(port=Number(url4.hostname),url4.protocol&&!isNaN(port))return[port,url4.protocol.substring(0,url4.protocol.length-1)]}throw dev.DEV_INVALID_LISTEN_SCHEME({protocol:url4.protocol})}}function replaceLocalhost(address){return address.replace("[::]","localhost").replace("0.0.0.0","localhost")}import{lstat,readdir,readFile,stat}from"node:fs/promises";import{extname,isAbsolute as isAbsolute2,join as join3,relative as relative3,resolve}from"node:path";import{parse as parseUrl}from"node:url";var MAX_REDIRECTS=1e6,MAX_FILES=100,MAX_URL_LENGTH=2048,VALID_STATUS_CODES=new Set([301,302,303,307,308]),SUPPORTED_EXTENSIONS=new Set([".csv",".json",".jsonl"]),BulkRedirectTable=class{constructor(){this.caseSensitiveByHostPath=new Map;this.caseInsensitiveByHostPath=new Map;this.caseSensitiveByPath=new Map;this.caseInsensitiveByPath=new Map}get size(){return this.caseSensitiveByHostPath.size+this.caseInsensitiveByHostPath.size+this.caseSensitiveByPath.size+this.caseInsensitiveByPath.size}add(redirect2){let{host,pathname}=parseSource(redirect2.source),stored={destination:redirect2.destination,statusCode:redirect2.statusCode,preserveQueryParams:redirect2.preserveQueryParams};if(host){let key=hostPathKey(host,pathname);redirect2.caseSensitive?this.caseSensitiveByHostPath.set(key,stored):this.caseInsensitiveByHostPath.set(key.toLowerCase(),stored);return}redirect2.caseSensitive?this.caseSensitiveByPath.set(pathname,stored):this.caseInsensitiveByPath.set(pathname.toLowerCase(),stored)}lookup(pathname,host){let hostname=host?hostnameFromHostHeader(host):"";if(hostname){let hostKey=hostPathKey(hostname,pathname),hostMatch=this.caseSensitiveByHostPath.get(hostKey)||this.caseInsensitiveByHostPath.get(hostKey.toLowerCase());if(hostMatch)return hostMatch}return this.caseSensitiveByPath.get(pathname)||this.caseInsensitiveByPath.get(pathname.toLowerCase())}};async function getBulkRedirectsSignature(cwd,bulkRedirectsPath){if(!bulkRedirectsPath)return"";let resolved=resolveBulkRedirectsPath(cwd,bulkRedirectsPath);if(!resolved)return`invalid:${bulkRedirectsPath}`;try{let stats=await stat(resolved);if(stats.isFile())return`file:${resolved}:${stats.mtimeMs}:${stats.size}`;if(!stats.isDirectory())return`other:${resolved}:${stats.mtimeMs}`;let files=await listRedirectFiles(resolved),parts=await Promise.all(files.map(async file=>{try{let fileStats=await stat(file);return`${file}:${fileStats.mtimeMs}:${fileStats.size}`}catch{return`${file}:missing`}}));return`dir:${resolved}:${parts.join("|")}`}catch{return`missing:${resolved}`}}async function loadBulkRedirects(cwd,bulkRedirectsPath){let warnings=[],table=new BulkRedirectTable,resolved=resolveBulkRedirectsPath(cwd,bulkRedirectsPath);if(!resolved)return warnings.push(`Skipping bulk redirects path "${bulkRedirectsPath}" because it resolves outside the project directory.`),{table,redirectCount:0,fileCount:0,warnings};let files;try{let stats=await stat(resolved);if(stats.isDirectory())files=await listRedirectFiles(resolved),files.length>MAX_FILES&&(warnings.push(`Bulk redirects directory "${bulkRedirectsPath}" has ${files.length} files; only the first ${MAX_FILES} will be used.`),files=files.slice(0,MAX_FILES));else if(stats.isFile()){let ext=extname(resolved).toLowerCase();if(!SUPPORTED_EXTENSIONS.has(ext))return warnings.push(`Bulk redirects file "${bulkRedirectsPath}" must be a .csv, .json, or .jsonl file.`),{table,redirectCount:0,fileCount:0,warnings};files=[resolved]}else return warnings.push(`Bulk redirects path "${bulkRedirectsPath}" is not a file or directory.`),{table,redirectCount:0,fileCount:0,warnings}}catch(err){if(isNotFound(err))return warnings.push(`Bulk redirects path "${bulkRedirectsPath}" was not found.`),{table,redirectCount:0,fileCount:0,warnings};throw err}let redirectCount=0;for(let file of files){if(redirectCount>=MAX_REDIRECTS){warnings.push(`Bulk redirects limit of ${MAX_REDIRECTS} reached; remaining entries were skipped.`);break}let remaining=MAX_REDIRECTS-redirectCount,parsed=await parseRedirectFile(file,remaining,warnings,cwd);for(let redirect2 of parsed)table.add(redirect2),redirectCount++}let duplicateCount=redirectCount-table.size;return duplicateCount>0&&warnings.push(`Bulk redirects contain ${duplicateCount} duplicate ${duplicateCount===1?"source":"sources"}; the last occurrence wins.`),{table,redirectCount,fileCount:files.length,warnings}}function resolveBulkRedirect(table,reqUrl,host){let parsed=parseUrl(reqUrl),match=table.lookup(parsed.pathname||"/",host);if(!match)return;let location=match.destination;return match.preserveQueryParams&&parsed.search&&(location=appendQueryParams(location,parsed.search)),{location,statusCode:match.statusCode}}function appendQueryParams(destination,search){let query=search.startsWith("?")?search.slice(1):search;return query?destination.includes("?")?`${destination}&${query}`:`${destination}?${query}`:destination}function resolveBulkRedirectsPath(cwd,bulkRedirectsPath){let projectRoot=resolve(cwd),resolved=resolve(projectRoot,bulkRedirectsPath),relativeFromRoot=relative3(projectRoot,resolved);return relativeFromRoot.startsWith("..")||isAbsolute2(relativeFromRoot)?null:resolved}async function listRedirectFiles(dir){let files=[];return await walk(dir,files),files.sort(),files}async function walk(dir,files){let entries=await readdir(dir);for(let entry of entries){let fullPath=join3(dir,entry),stats=await lstat(fullPath);stats.isDirectory()?await walk(fullPath,files):stats.isFile()&&SUPPORTED_EXTENSIONS.has(extname(fullPath).toLowerCase())&&files.push(fullPath)}}async function parseRedirectFile(file,remaining,warnings,cwd){let rel=relative3(cwd,file)||file,ext=extname(file).toLowerCase(),content;try{content=stripBom(await readFile(file,"utf8"))}catch(err){return warnings.push(`Failed to read bulk redirects file "${rel}": ${errorMessage(err)}`),[]}try{return ext===".csv"?parseCsvRedirects(content,remaining,warnings,rel):ext===".jsonl"?parseJsonlRedirects(content,remaining,warnings,rel):parseJsonRedirects(content,remaining,warnings,rel)}catch(err){return warnings.push(`Failed to parse bulk redirects file "${rel}": ${errorMessage(err)}`),[]}}function parseJsonRedirects(content,remaining,warnings,rel){let parsed=JSON.parse(content);return Array.isArray(parsed)?normalizeRedirects(parsed,remaining,warnings,rel):(warnings.push(`Bulk redirects file "${rel}" must contain a JSON array of redirects.`),[])}function parseJsonlRedirects(content,remaining,warnings,rel){let rows=[],lines=content.split(/\r?\n/);for(let i=0;i<lines.length;i++){let line=lines[i].trim();if(line)try{rows.push(JSON.parse(line))}catch{warnings.push(`Skipping invalid JSONL in "${rel}" at line ${i+1}.`)}}return normalizeRedirects(rows,remaining,warnings,rel)}var CSV_HEADER_ALIASES={source:"source",destination:"destination",permanent:"permanent",statuscode:"statusCode",casesensitive:"caseSensitive",preservequeryparams:"preserveQueryParams"};function parseCsvRedirects(content,remaining,warnings,rel){let lines=content.split(/\r?\n/).filter(line=>line.trim().length>0);if(lines.length===0)return warnings.push(`Bulk redirects CSV "${rel}" is empty.`),[];let headers=parseCsvLine(lines[0]).map(header=>CSV_HEADER_ALIASES[header.trim().toLowerCase()]);if(!headers.includes("source")||!headers.includes("destination"))return warnings.push(`Bulk redirects CSV "${rel}" must have "source" and "destination" columns.`),[];let rows=[];for(let i=1;i<lines.length;i++){let values=parseCsvLine(lines[i]),row={};for(let col=0;col<headers.length;col++){let header=headers[col];header&&(row[header]=values[col]??"")}rows.push(row)}return normalizeRedirects(rows,remaining,warnings,rel)}function normalizeRedirects(rows,remaining,warnings,rel){let redirects=[];for(let i=0;i<rows.length;i++){if(redirects.length>=remaining){warnings.push(`Bulk redirects limit of ${MAX_REDIRECTS} reached while reading "${rel}"; remaining entries were skipped.`);break}let row=rows[i];if(!row||typeof row!="object"){warnings.push(`Skipping invalid redirect in "${rel}" at index ${i}.`);continue}let record=row,source=asTrimmedString(record.source),destination=asTrimmedString(record.destination);if(!source||!destination){warnings.push(`Skipping redirect in "${rel}" at index ${i}: source and destination are required.`);continue}if(source.length>MAX_URL_LENGTH||destination.length>MAX_URL_LENGTH){warnings.push(`Skipping redirect in "${rel}" at index ${i}: source and destination must be at most ${MAX_URL_LENGTH} characters.`);continue}let statusCode;if(record.statusCode!==void 0&&record.statusCode!==""){let parsedStatus=parseStatusCode(record.statusCode);if(parsedStatus===void 0){warnings.push(`Skipping redirect in "${rel}" at index ${i}: statusCode must be one of ${[...VALID_STATUS_CODES].join(", ")}.`);continue}statusCode=parsedStatus}else statusCode=parseBoolean(record.permanent)??!1?308:307;redirects.push({source,destination,statusCode,caseSensitive:parseBoolean(record.caseSensitive)??!1,preserveQueryParams:parseBoolean(record.preserveQueryParams)??!1})}return redirects}function parseSource(source){if(/^https?:\/\//i.test(source))try{let parsed=new URL(source);return{host:parsed.hostname.toLowerCase(),pathname:parsed.pathname||"/"}}catch{return{host:null,pathname:source}}return{host:null,pathname:source||"/"}}function hostPathKey(host,pathname){return`${host}\0${pathname}`}function hostnameFromHostHeader(hostHeader){let trimmed=hostHeader.trim();if(!trimmed)return"";if(trimmed.startsWith("[")){let end=trimmed.indexOf("]");return end===-1?trimmed.toLowerCase():trimmed.slice(1,end).toLowerCase()}let colon=trimmed.lastIndexOf(":");return colon!==-1&&trimmed.indexOf(":")===colon?trimmed.slice(0,colon).toLowerCase():trimmed.toLowerCase()}function parseBoolean(value){if(typeof value=="boolean")return value;if(typeof value=="number")return value===1?!0:value===0?!1:void 0;if(typeof value!="string")return;let normalized=value.trim().toLowerCase();if(normalized==="t"||normalized==="true")return!0;if(normalized==="f"||normalized==="false")return!1}function parseStatusCode(value){let n=typeof value=="number"?value:typeof value=="string"?Number(value.trim()):NaN;return VALID_STATUS_CODES.has(n)?n:void 0}function asTrimmedString(value){if(typeof value!="string")return;let trimmed=value.trim();return trimmed||void 0}function parseCsvLine(line){let fields=[],current="",inQuotes=!1;for(let i=0;i<line.length;i++){let char=line[i];inQuotes?char==='"'?line[i+1]==='"'?(current+='"',i++):inQuotes=!1:current+=char:char==='"'?inQuotes=!0:char===","?(fields.push(current),current=""):current+=char}return fields.push(current),fields}function stripBom(content){return content.charCodeAt(0)===65279?content.slice(1):content}function isNotFound(err){return typeof err=="object"&&err!==null&&"code"in err&&err.code==="ENOENT"}function errorMessage(err){return err instanceof Error?err.message:String(err)}var DEV_SERVER_PORT_BIND_TIMEOUT=(0,import_ms6.default)("5m"),DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS=60,DEV_RUNTIME_CACHE_MAX_ITEM_SIZE=2*1024*1024,DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS=31536e3,frameworkRuntimeSet=new Set(import_frameworks3.frameworkList.map(f=>f.useRuntime?.use||"@vercel/static-build"));function isApiDirBuild(build){let src=build.src?.replace(/^\.\//,"");return typeof src=="string"&&src.startsWith("api/")}function sortBuilders(buildA,buildB){return buildA&&buildA.use&&(0,import_fs_detectors2.isOfficialRuntime)("static-build",buildA.use)?1:buildB&&buildB.use&&(0,import_fs_detectors2.isOfficialRuntime)("static-build",buildB.use)?-1:0}var DevServer=class{constructor(cwd,options){this.initialDevCommandStarted=!1;this.responseTransformsByReq=new WeakMap;this.shouldBuildInDev=build=>{if(!this.shouldUseServicesOrchestrator()&&isApiDirBuild(build))return!0;let{name}=(0,import_npm_package_arg.default)(build.use);return!frameworkRuntimeSet.has(name||"")};this.clearVercelConfigPromise=()=>{this.getVercelConfigPromise=null};this.getExtensionlessFile=path6=>{let ext=extname2(path6);return this.apiDir&&path6.startsWith(this.apiDir+"/")&&this.apiExtensions.has(ext)?path6.slice(0,-ext.length):null};this.devServerHandler=async(req,res)=>{await this.startPromise;let requestId=generateRequestId(this.podId);if(this.stopping){res.setHeader("Connection","close"),await this.send404(req,res,requestId);return}let method=req.method||"GET";output_manager_default.debug(`${import_chalk2.default.bold(method)} ${req.url}`);try{let vercelConfig=await this.getVercelConfig();await this.serveProjectAsNowV2(req,res,requestId,vercelConfig)}catch(err){console.error(err),(0,import_error_utils.isError)(err)&&typeof err.stack=="string"&&output_manager_default.debug(err.stack),res.finished||(res.statusCode=500,res.end((0,import_error_utils.errorToString)(err)))}};this.exitWithStatus=async(match,routeResult,phase,req,res,requestId,responseTransforms)=>{let{status,headers,dest}=routeResult,location=headers.location||dest;if(status&&location&&300<=status&&status<=399)return output_manager_default.debug(`Route found with redirect status code ${status}`),await this.sendRedirect(req,res,requestId,location,status,responseTransforms),!0;if(!match&&status&&phase!=="miss"){if(routeResult.userDest)return!1;output_manager_default.debug(`Route found with with status code ${status}`);let errorHeaders={...headers};return responseTransforms&&applyResponseTransforms(errorHeaders,responseTransforms),await this.sendError(req,res,requestId,"",status,errorHeaders),!0}return!1};this.handleQueuesRoute=async(req,res,pathname)=>{if(!this.queueBroker){res.writeHead(503),res.end("Queues broker not initialized");return}if(!pathname.startsWith(DEV_QUEUE_API_PREFIX)){res.writeHead(404),res.end("Not Found");return}let topicPath=pathname.slice(DEV_QUEUE_API_PREFIX.length),sendMatch=topicPath.match(/^([A-Za-z0-9_-]+)$/);if(req.method==="POST"&&sendMatch){let topic=sendMatch[1],contentType2=req.headers["content-type"]||"application/json",payload=await(0,import_raw_body.default)(req),retentionHeader=req.headers["vqs-retention-seconds"],retentionSeconds=retentionHeader&&!isNaN(parseInt(retentionHeader,10))?parseInt(retentionHeader,10):void 0,delayHeader=req.headers["vqs-delay-seconds"],delaySeconds=delayHeader&&!isNaN(parseInt(delayHeader,10))?parseInt(delayHeader,10):void 0,idempotencyKey=req.headers["vqs-idempotency-key"],{messageId}=this.queueBroker.enqueue(topic,payload,contentType2,{retentionSeconds,delaySeconds,idempotencyKey});res.writeHead(201,{"Content-Type":"application/json","Vqs-Message-Id":messageId}),res.end(JSON.stringify({messageId}));return}let receiveByIdMatch=topicPath.match(/^([A-Za-z0-9_-]+)\/consumer\/([A-Za-z0-9_-]+)\/id\/([^/]+)$/);if(req.method==="POST"&&receiveByIdMatch){let[,queueName,consumer,messageId]=receiveByIdMatch,originalMessageId=this.queueBroker.getOriginalMessageIdForDuplicate(queueName,messageId);if(originalMessageId){res.writeHead(409,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"This messageId was a duplicate - use originalMessageId instead",originalMessageId}));return}let result=this.queueBroker.receiveById(queueName,messageId,consumer);if(!result){res.writeHead(404),res.end("Message not found");return}let boundary=`----vcdevboundary${randomBytes2(8).toString("hex")}`,partHeaders=[`Vqs-Message-Id: ${messageId}`,`Vqs-Delivery-Count: ${result.deliveryCount}`,`Vqs-Timestamp: ${result.createdAt}`,`Vqs-Receipt-Handle: ${result.receiptHandle}`,`Content-Type: ${result.contentType}`].join(`\r
|
|
39
|
+
`):callback(null,"")}})},stdout=createTransform("stdout"),stderr=createTransform("stderr");return stdout.pipe(process.stdout),stderr.pipe(process.stderr),{stdout,stderr,cleanup:()=>{stdout.unpipe(process.stdout),stderr.unpipe(process.stderr),stdout.destroy(),stderr.destroy()}}}function getServiceRoutePrefixes(service){return(0,import_build_utils5.isQueueTriggeredService)(service)||(0,import_build_utils5.isWorkflowTriggeredService)(service)?[(0,import_build_utils5.getInternalServiceWorkerPathPrefix)(service.name)]:(0,import_build_utils5.isScheduleTriggeredService)(service)?[(0,import_build_utils5.getInternalServiceCronPathPrefix)(service.name)]:service.type==="web"?[service.routePrefix||"/"]:[]}function getEntrypointForService(builderSrc,entrypoint,dir){let resolved=builderSrc||entrypoint||"";if(dir&&dir!=="."){let prefix=dir.endsWith("/")?dir:`${dir}/`;resolved.startsWith(prefix)&&(resolved=resolved.slice(prefix.length))}return resolved}var FORCE_KILL_GRACE_MS=2e3,STOP_ALL_TIMEOUT_MS=8e3;function killGroup(pid,signal){try{return process.kill(-pid,signal),!0}catch(err){let code=err.code;if(code==="ESRCH"||code==="EPERM")return!1;throw err}}function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}function waitForExit(pid,proc,timeoutMs){return proc&&(proc.exitCode!==null||proc.signalCode!==null)||!isProcessAlive(pid)?Promise.resolve(!0):new Promise(resolve3=>{let settled=!1,finish=died=>{settled||(settled=!0,clearInterval(poll),clearTimeout(deadline),proc&&proc.removeListener("exit",onExit),resolve3(died))},onExit=()=>finish(!0);proc&&proc.once("exit",onExit);let poll=setInterval(()=>{isProcessAlive(pid)||finish(!0)},100),deadline=setTimeout(()=>finish(!1),timeoutMs)})}var ServicesOrchestrator=class{constructor(options){this.managedServices=new Map;this.managedProcesses=new Map;this.servicePorts=new Map;this.installMeta={};this.cronTimers=[];this.stopping=!1;this.services=options.services,this.cwd=options.cwd,this.repoRoot=options.repoRoot,this.maxNameLength=Math.max(...options.services.map(s=>s.name.length)),this.proxyOrigin=options.proxyOrigin,this.resourceEndpoints=options.resourceEndpoints,this.envFilesValues=options.env,this.useImplicitEnvInjection=options.useImplicitEnvInjection,this.preferServiceBuilder=options.preferServiceBuilder??!1,this.onQueueSubscriptions=options.onQueueSubscriptions;let pythonWorkspaces=options.services.filter(service=>service.runtime==="python").map(service=>path2.resolve(this.cwd,(0,import_build_utils5.isExperimentalServiceV2)(service)?service.root||".":service.workspace||"."));this.pythonServiceCount=new Set(pythonWorkspaces).size,this.hasQueueServices=options.services.filter(import_build_utils5.isExperimentalService).some(import_build_utils5.isQueueBackedService)}forceKillAllSync(){let killOne=pid=>{if(pid)try{killGroup(pid,"SIGKILL")}catch{}};for(let[,proc]of this.managedProcesses)killOne(proc.pid);for(let[,service]of this.managedServices)killOne(service.pid)}registerExitBackstop(){if(this.exitBackstop)return;let backstop=()=>this.forceKillAllSync();this.exitBackstop=backstop,process.on("exit",backstop)}unregisterExitBackstop(){this.exitBackstop&&(process.removeListener("exit",this.exitBackstop),this.exitBackstop=void 0)}async startAll(){output_manager_default.debug(`Starting ${this.services.length} services`),this.registerExitBackstop(),await this.allocateServicePorts();let startPromises=this.services.map((service,index)=>this.startService(service,index).then(result=>(this.managedServices.set(result.name,result),result))),failures=(await Promise.allSettled(startPromises)).filter(r=>r.status==="rejected");if(failures.length>0)throw await this.stopAll(),new ServiceStartError(failures.map(f=>f.reason));output_manager_default.debug(`All ${this.managedServices.size} services started successfully`),this.startCronSchedulers()}async stopAll(){if(this.stopping)return;this.stopping=!0;let totalCount=this.managedServices.size+this.managedProcesses.size;output_manager_default.debug(`Stopping ${totalCount} services/processes`);let stopPromises=[];for(let[name,service]of this.managedServices){output_manager_default.debug(`Stopping service "${name}" (PID: ${service.pid})`);let stopService=async()=>{service.shutdown&&await service.shutdown().catch(err=>{output_manager_default.debug(`Failed to shutdown service "${name}": ${err}`)}),service.pid&&await this.terminateProcessGroup(name,service.pid,service.process).catch(err=>{output_manager_default.debug(`Failed to kill service "${name}": ${err}`)})};stopPromises.push(stopService()),service.logger.cleanup()}for(let[name,proc]of this.managedProcesses)proc.pid&&!this.managedServices.has(name)&&(output_manager_default.debug(`Stopping process "${name}" (PID: ${proc.pid})`),stopPromises.push(this.terminateProcessGroup(name,proc.pid,proc).catch(err=>{output_manager_default.debug(`Failed to stop process "${name}": ${err}`)})));for(let timer of this.cronTimers)clearTimeout(timer);this.cronTimers=[];let timedOut=!1,timeoutHandle,timeout=new Promise(resolve3=>{timeoutHandle=setTimeout(()=>{timedOut=!0,output_manager_default.debug(`stopAll timed out after ${STOP_ALL_TIMEOUT_MS}ms; remaining processes will be SIGKILLed on exit`),resolve3()},STOP_ALL_TIMEOUT_MS)});try{await Promise.race([Promise.all(stopPromises),timeout])}finally{timeoutHandle&&clearTimeout(timeoutHandle)}timedOut||(this.managedServices.clear(),this.managedProcesses.clear(),this.unregisterExitBackstop(),output_manager_default.debug("All services stopped"))}async terminateProcessGroup(name,pid,proc){try{killGroup(pid,"SIGTERM")}catch(err){output_manager_default.debug(`SIGTERM group kill for "${name}" failed: ${err}`)}if(await treeKill(pid,"SIGTERM").catch(err=>{output_manager_default.debug(`tree-kill (SIGTERM) for "${name}" failed: ${err}`)}),!await waitForExit(pid,proc,FORCE_KILL_GRACE_MS)){output_manager_default.debug(`Escalating to SIGKILL for "${name}" (PID: ${pid})`);try{killGroup(pid,"SIGKILL")}catch(err){output_manager_default.debug(`SIGKILL group kill for "${name}" failed: ${err}`)}await treeKill(pid,"SIGKILL").catch(()=>{})}}getServiceForRoute(pathname){let bestMatch=null,bestMatchLength=-1;for(let service of this.managedServices.values())for(let routePrefix of service.routePrefixes){if(routePrefix==="/"){bestMatchLength===-1&&(bestMatch=service,bestMatchLength=0);continue}let normalizedPrefix=routePrefix.startsWith("/")?routePrefix:`/${routePrefix}`;(pathname===normalizedPrefix||pathname.startsWith(`${normalizedPrefix}/`))&&normalizedPrefix.length>bestMatchLength&&(bestMatch=service,bestMatchLength=normalizedPrefix.length)}return bestMatch}getServiceOrigin(serviceName){let service=this.managedServices.get(serviceName);return service?`http://${service.host}:${service.port}`:null}hasServices(){return this.managedServices.size>0}getServices(){return this.managedServices}async allocateServicePorts(){let used=new Set;for(let service of this.services){let port=await(0,import_get_port.default)();for(;used.has(port);)port=await(0,import_get_port.default)();used.add(port),this.servicePorts.set(service.name,port)}}async startService(service,colorIndex){let logger=createServiceLogger(service.name,colorIndex,this.maxNameLength),spec=(0,import_build_utils5.isExperimentalServiceV2)(service)?this.getV2StartSpec(service):this.getV1StartSpec(service),port=this.servicePorts.get(service.name);port!==void 0&&(spec.env.VERCEL_DEV_PORT=String(port));let buildpackRuntime=getBuildpackRuntime(service.builder);if(buildpackRuntime)throw buildpackServicesDevUnsupportedError([{name:service.name,runtime:buildpackRuntime}]);if(spec.builderSpec){let result=await this.tryStartWithBuilder(service.name,spec,logger,port);if(result)return result}let devCommand2=spec.explicitDevCommand||spec.framework?.settings?.devCommand?.value;if(!devCommand2)throw dev.DEV_SERVICE_NO_DEV_SERVER({name:service.name,framework:service.framework??"none"});return this.spawnDevCommandProcess({name:service.name,devCommand:devCommand2,framework:spec.framework,workspacePath:spec.rootPath,env:spec.env,logger,builderConfig:spec.builderConfig,routePrefixes:spec.routePrefixes,workspaceLabel:spec.rootLabel,port})}applyRuntimeCacheEnv(env){env.RUNTIME_CACHE_ENDPOINT||Object.assign(env,getDevRuntimeCacheEnv(this.resourceEndpoints.runtimeCache.direct,""))}applyContainerResourceProxyEnv(env){let endpoints=this.resourceEndpoints;env.VERCEL_QUEUE_BASE_URL===endpoints.queues.direct&&Object.assign(env,getDevQueueEnv(endpoints.queues.proxy,env.VERCEL_HAS_WORKER_SERVICES!==void 0)),env.RUNTIME_CACHE_ENDPOINT===endpoints.runtimeCache.direct&&Object.assign(env,getDevRuntimeCacheEnv(endpoints.runtimeCache.proxy,""))}getV1StartSpec(service){let framework=import_frameworks2.frameworkList.find(f=>f.slug===service.framework),effectiveProcessEnv=(0,import_build_utils5.cloneEnv)(this.envFilesValues,process.env),perServiceEnv={};this.useImplicitEnvInjection?perServiceEnv=(0,import_build_utils5.getExperimentalServiceUrlEnvVars)({services:this.services,frameworkList:framework?[framework]:[],origin:this.proxyOrigin,currentEnv:effectiveProcessEnv}):service.env&&(perServiceEnv=(0,import_build_utils5.getServiceUrlEnvVars)({requestedEnv:service.env,consumerService:service,services:this.services,frameworkList:import_frameworks2.frameworkList,origin:this.proxyOrigin,currentEnv:effectiveProcessEnv}));let env=(0,import_build_utils5.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},perServiceEnv,effectiveProcessEnv);env.VERCEL_SERVICE_TYPE=service.type,service.trigger&&(env.VERCEL_SERVICE_TRIGGER=service.trigger),this.hasQueueServices&&service.runtime==="python"&&env.VERCEL_HAS_WORKER_SERVICES===void 0&&(env.VERCEL_HAS_WORKER_SERVICES="1"),Object.assign(env,getDevQueueEnv(this.resourceEndpoints.queues.direct,this.hasQueueServices)),this.applyRuntimeCacheEnv(env),service.routePrefix&&service.routePrefix!=="/"&&(env.VERCEL_SERVICE_ROUTE_PREFIX=service.routePrefix,env.VERCEL_SERVICE_ROUTE_PREFIX_STRIP="1");let workspace=service.workspace||".";return{rootPath:path2.join(this.cwd,workspace),rootLabel:workspace,framework,builderSpec:this.preferServiceBuilder?service.builder?.use||framework?.useRuntime?.use:framework?.useRuntime?.use||service.builder?.use,entrypoint:getEntrypointForService(service.builder?.src,service.entrypoint,workspace),builderConfig:service.builder?.config,frameworkForDev:service.framework||"services",servicePayload:{name:service.name,type:service.type,trigger:service.trigger,routePrefix:service.routePrefix,subdomain:service.subdomain,workspace:service.workspace,schedule:service.schedule},routePrefixes:getServiceRoutePrefixes(service),env}}getV2StartSpec(service){let framework=import_frameworks2.frameworkList.find(f=>f.slug===service.framework),effectiveProcessEnv=(0,import_build_utils5.cloneEnv)(this.envFilesValues,process.env),perServiceEnv={};for(let binding of service.bindings??[]){if(binding.type!==void 0&&binding.type!=="service"||binding.format!=="url"||binding.env in effectiveProcessEnv)continue;let targetPort=this.servicePorts.get(binding.service);targetPort!==void 0&&(perServiceEnv[binding.env]=`http://127.0.0.1:${targetPort}`)}let env=(0,import_build_utils5.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},effectiveProcessEnv,perServiceEnv);this.hasQueueServices&&service.runtime==="python"&&env.VERCEL_HAS_WORKER_SERVICES===void 0&&(env.VERCEL_HAS_WORKER_SERVICES="1"),Object.assign(env,getDevQueueEnv(this.resourceEndpoints.queues.direct,this.hasQueueServices)),this.applyRuntimeCacheEnv(env);let root=service.root||".";return{rootPath:path2.join(this.cwd,root),rootLabel:root,framework,builderSpec:framework?.useRuntime?.use||service.builder?.use,entrypoint:getEntrypointForService(service.builder?.src,service.entrypoint,root),builderConfig:service.builder?.config,frameworkForDev:service.framework||"services",servicePayload:{name:service.name,workspace:root},routePrefixes:[],env,explicitDevCommand:service.devCommand}}async tryStartWithBuilder(name,spec,logger,port){if(!spec.builderSpec)return null;try{let builderWithPkg=(await importBuilders(new Set([spec.builderSpec]),this.cwd)).get(spec.builderSpec),builder=builderWithPkg?.builder;if(!builder?.startDevServer)return null;builderWithPkg?.pkg.name==="@vercel/container"&&this.applyContainerResourceProxyEnv(spec.env),output_manager_default.debug(`Starting ${import_chalk.default.bold(name)} using ${import_chalk.default.cyan.bold(spec.builderSpec)}`),injectNextDevWebSocketShimIfNeeded(spec.env,spec.framework?.settings.devCommand?.value||"",{framework:spec.framework?.slug});let result=await builder.startDevServer({entrypoint:spec.entrypoint,workPath:spec.rootPath,repoRootPath:this.repoRoot,config:{...spec.builderConfig||{},framework:spec.frameworkForDev},meta:{isDev:!0,env:spec.env,port,serviceCount:this.services.length,pythonServiceCount:this.pythonServiceCount,syncDependencies:!0,serviceName:name,devResourceEndpoints:this.resourceEndpoints},service:spec.servicePayload,files:{},onStdout:data=>logger.stdout.write(data),onStderr:data=>logger.stderr.write(data)});if(!result)return null;let host=await checkForPort(result.port,STARTUP_TIMEOUT);return output_manager_default.debug(`Service ${name} started on ${host}:${result.port}`),result.queueSubscriptions?.length&&this.onQueueSubscriptions?.(name,result.queueSubscriptions),{name,host,port:result.port,pid:result.pid,shutdown:result.shutdown,routePrefixes:spec.routePrefixes,workspace:spec.rootLabel,logger,crons:result.crons,queueSubscriptions:result.queueSubscriptions}}catch(err){if(output_manager_default.debug(`Failed to use startDevServer for ${name}: ${err}`),err instanceof import_build_utils5.NowBuildError)throw err;return null}}async spawnDevCommandProcess(params){let{name,devCommand:devCommand2,framework,workspacePath,env,logger,builderConfig,routePrefixes,workspaceLabel}=params;await this.syncDependencies(builderConfig,workspacePath,logger);let port=params.port??await(0,import_get_port.default)();env.PORT=`${port}`,env.VERCEL_CLI_VERSION=pkg_default.version;let command=replaceDevCommandPort(devCommand2,port),nodeBinPath=(0,import_build_utils5.getNodeBinPaths)({base:this.repoRoot,start:workspacePath}).join(path2.delimiter);env.PATH=`${nodeBinPath}${path2.delimiter}${env.PATH}`,output_manager_default.debug(`Starting ${import_chalk.default.bold(name)} with ${import_chalk.default.cyan.bold(`"${command}"`)}`),process.stdout.columns&&(env.COLUMNS=`${process.stdout.columns}`),injectNextDevWebSocketShimIfNeeded(env,command,{framework:framework?.slug});let child=(0,import_build_utils5.spawnCommand)(command,{cwd:workspacePath,env,stdio:["ignore","pipe","pipe"],detached:!0});if(child.pid){if(!child.stdout||!child.stderr)throw dev.DEV_SERVICE_NO_STDIO({name})}else throw dev.DEV_SERVICE_NO_PID({name});this.managedProcesses.set(name,child),child.stdout?.on("data",chunk=>{logger.stdout.write(chunk)}),child.stderr?.on("data",chunk=>{logger.stderr.write(chunk)});let host;try{host=await this.waitForPort(child,name,port)}catch(error2){throw this.managedProcesses.delete(name),error2}return output_manager_default.debug(`Service ${name} listening on ${host}:${port}`),{name,host,port,pid:child.pid,process:child,routePrefixes,workspace:workspaceLabel,logger}}async waitForPort(child,serviceName,port){let processError=new Promise((_,reject)=>{child.on("error",reject),child.on("exit",code=>{reject(new Error(`Service "${serviceName}" exited with code ${code} before port was available`))})});return Promise.race([checkForPort(port,STARTUP_TIMEOUT),processError])}async syncDependencies(config,workspacePath,logger){logger.stdout.write(`${import_chalk.default.gray("Synchronizing dependencies...")}
|
|
40
|
+
`);let installCommand=typeof config?.installCommand=="string"?config.installCommand.trim():"";installCommand?await this.runInstallCommand(installCommand,workspacePath,logger):await this.maybeInstallJSDependencies(workspacePath,logger)}async runBuffered(logger,task){let captured=[],bufStdout=new Writable({write(chunk,_enc,cb){let b=Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk);captured.push(["stdout",b]),output_manager_default.debugEnabled&&logger.stdout.write(b),cb()}}),bufStderr=new Writable({write(chunk,_enc,cb){let b=Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk);captured.push(["stderr",b]),output_manager_default.debugEnabled&&logger.stderr.write(b),cb()}});try{await task(bufStdout,bufStderr)}catch(err){for(let[channel,chunk]of captured)logger[channel].write(chunk);throw err}}async runInstallCommand(command,workspacePath,logger){await this.runBuffered(logger,(stdout,stderr)=>new Promise((resolve3,reject)=>{output_manager_default.debug(`Running install command: "${command}" in ${workspacePath}`);let child=(0,import_build_utils5.spawnCommand)(command,{cwd:workspacePath,stdio:["inherit","pipe","pipe"]});child.stdout?.on("data",chunk=>stdout.write(chunk)),child.stderr?.on("data",chunk=>stderr.write(chunk)),child.on("error",reject),child.on("exit",(code,signal)=>{code===0?resolve3():reject(new import_build_utils5.NowBuildError({code:"INSTALL_COMMAND_FAILED",message:`Install command "${command}" failed with code ${code}, signal ${signal}`}))})}))}async maybeInstallJSDependencies(workspacePath,logger){await this.runBuffered(logger,async(stdout,stderr)=>{try{await(0,import_build_utils5.runNpmInstall)(workspacePath,[],void 0,this.installMeta,void 0,{stdout,stderr})}catch(err){throw new import_build_utils5.NowBuildError({code:"NODE_DEPENDENCY_SYNC_FAILED",message:`Failed to install Node.JS dependencies: ${err instanceof Error?err.message:String(err)}`})}})}startCronSchedulers(){for(let[name,managed]of this.managedServices){let service=this.services.find(candidate=>candidate.name===name),crons=managed.crons&&managed.crons.length>0?managed.crons:service&&(0,import_build_utils5.isExperimentalService)(service)&&(0,import_build_utils5.isScheduleTriggeredService)(service)&&service.schedule?(0,import_service_schedules.getStaticServiceSchedules)(service.schedule).map(schedule=>({path:(0,import_build_utils5.getInternalServiceCronPath)(name,service.entrypoint||service.builder.src||"index",service.handlerFunction||"cron"),schedule})):[];if(crons.length!==0)for(let cron of crons)output_manager_default.debug(`Scheduling job service ${import_chalk.default.bold(name)} (${import_chalk.default.cyan(cron.schedule)})`),this.scheduleCronTrigger(name,cron.path,cron.schedule,managed)}}scheduleCronTrigger(serviceName,cronPath,schedule,managed){let delayMs=getNextCronDelay(schedule);if(delayMs===null){output_manager_default.warn(`Could not parse cron schedule "${schedule}" for service "${serviceName}", skipping auto-trigger`);return}let timer=setTimeout(async()=>{if(!this.stopping){output_manager_default.debug(`Triggering scheduled job ${import_chalk.default.bold(serviceName)} (schedule: ${import_chalk.default.cyan(schedule)})`);try{let url4=`http://${managed.host}:${managed.port}${cronPath}`,res=await fetch(url4,{method:"POST"});output_manager_default.debug(`Cron trigger for "${serviceName}" responded with status ${res.status}`)}catch(err){output_manager_default.error(`Cron trigger for "${serviceName}" failed: ${err instanceof Error?err.message:String(err)}`)}this.scheduleCronTrigger(serviceName,cronPath,schedule,managed)}},delayMs);this.cronTimers.push(timer)}};var import_ms5=__toESM(require_ms(),1);import{randomBytes}from"crypto";var import_build_utils6=__toESM(require_build_utils(),1);var DEFAULT_RETRY_AFTER=(0,import_ms5.default)("1m"),DEFAULT_MAX_DELIVERIES=32,DEFAULT_INITIAL_DELAY=0,DEFAULT_VISIBILITY_TIMEOUT=(0,import_ms5.default)("1m"),DEFAULT_RETENTION=(0,import_ms5.default)("1h"),TICK_INTERVAL2=(0,import_ms5.default)("1s");function topicPatternToRegex(pattern){let parts=pattern.split("*").map(s=>s.replace(/-/g,"\\-"));return new RegExp(`^${parts.join("[A-Za-z0-9_\\-]*")}$`)}var QueueBroker=class{constructor(services,getServiceOrigin){this.getServiceOrigin=getServiceOrigin;this.messages=new Map;this.idempotencyRecords=new Map;this.duplicateMessages=new Map;this.consumerGroups=[];this.deliveryState=new Map;this.registerServices(services),this.tickTimer=setInterval(()=>this.tick(),TICK_INTERVAL2),this.tickTimer.unref()}registerServices(services){let ids=new Set;for(let service of services.filter(import_build_utils6.isQueueBackedService))for(let{topic}of(0,import_build_utils6.getServiceQueueTopicConfigs)(service)){let consumerGroup=service.consumer??service.name,id=`${consumerGroup}::${topic}`,existing=this.consumerGroups.find(group=>group.id===id);if(ids.has(id)||existing?.serviceOriginFn||existing?.resolveFunction)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup,topic});ids.add(id)}for(let service of services){if(!(0,import_build_utils6.isQueueBackedService)(service))continue;let topicConfigs=(0,import_build_utils6.getServiceQueueTopicConfigs)(service),consumerGroup=service.consumer??service.name;for(let topicConfig of topicConfigs){let topicPattern=topicConfig.topic,id=`${consumerGroup}::${topicPattern}`,existingGroup=this.consumerGroups.find(group2=>group2.id===id);if(existingGroup&&!existingGroup.serviceOriginFn&&!existingGroup.resolveFunction){existingGroup.serviceName=service.name,existingGroup.serviceOriginFn=()=>this.getServiceOrigin(service.name),existingGroup.retryAfterMs=topicConfig.retryAfterSeconds!==void 0?topicConfig.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,existingGroup.initialDelayMs=topicConfig.initialDelaySeconds!==void 0?topicConfig.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY,this.activatePushGroup(existingGroup);continue}if(existingGroup)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup,topic:topicPattern});let group={id,name:consumerGroup,serviceName:service.name,topicPattern,topicRegex:topicPatternToRegex(topicPattern),serviceOriginFn:()=>this.getServiceOrigin(service.name),retryAfterMs:topicConfig.retryAfterSeconds!==void 0?topicConfig.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:topicConfig.initialDelaySeconds!==void 0?topicConfig.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY};this.consumerGroups.push(group),this.deliveryState.set(group.id,this.createRetainedDeliveries(group)),this.activatePushGroup(group)}}}updateServiceSubscriptions(serviceName,subscriptions){if(subscriptions.length===0)return;let kept=[];for(let group of this.consumerGroups)group.serviceName===serviceName?this.deliveryState.delete(group.id):kept.push(group);this.consumerGroups=kept;for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,existingGroup=this.consumerGroups.find(group2=>group2.id===id);if(existingGroup&&!existingGroup.serviceOriginFn&&!existingGroup.resolveFunction){existingGroup.serviceName=serviceName,existingGroup.serviceOriginFn=()=>this.getServiceOrigin(serviceName),existingGroup.retryAfterMs=subscription.retryAfterSeconds!==void 0?subscription.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,existingGroup.maxDeliveries=subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,existingGroup.initialDelayMs=subscription.initialDelaySeconds!==void 0?subscription.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY,this.activatePushGroup(existingGroup);continue}if(existingGroup){output_manager_default.debug(`Queue consumer "${subscription.consumer}" is already registered for topic "${subscription.topic}"; keeping the first registration`);continue}let group={id,name:subscription.consumer,serviceName,topicPattern:subscription.topic,topicRegex:topicPatternToRegex(subscription.topic),serviceOriginFn:()=>this.getServiceOrigin(serviceName),retryAfterMs:subscription.retryAfterSeconds!==void 0?subscription.retryAfterSeconds*1e3:DEFAULT_RETRY_AFTER,maxDeliveries:subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,initialDelayMs:subscription.initialDelaySeconds!==void 0?subscription.initialDelaySeconds*1e3:DEFAULT_INITIAL_DELAY};this.consumerGroups.push(group),this.deliveryState.set(group.id,this.createRetainedDeliveries(group)),this.activatePushGroup(group)}output_manager_default.debug(`Queue consumer groups for service "${serviceName}" updated from ${subscriptions.length} introspected subscription(s)`)}validateFunctionSubscriptions(subscriptions){let ids=new Set;for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,existing=this.consumerGroups.find(group=>group.id===id);if(ids.has(id)||existing?.serviceOriginFn&&!existing.configOwned)throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup:subscription.consumer,topic:subscription.topic});ids.add(id)}}setFunctionSubscriptions(subscriptions,resolve3){this.validateFunctionSubscriptions(subscriptions);let ids=new Set(subscriptions.map(subscription=>`${subscription.consumer}::${subscription.topic}`));for(let group of this.consumerGroups)group.configOwned&&!ids.has(group.id)&&(delete group.configOwned,delete group.resolveFunction);for(let subscription of subscriptions){let id=`${subscription.consumer}::${subscription.topic}`,group=this.consumerGroups.find(group2=>group2.id===id);group||(group={id,name:subscription.consumer,topicPattern:subscription.topic,topicRegex:topicPatternToRegex(subscription.topic),retryAfterMs:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:DEFAULT_INITIAL_DELAY},this.consumerGroups.push(group),this.deliveryState.set(id,this.createRetainedDeliveries(group))),group.configOwned=!0,group.resolveFunction=()=>resolve3(subscription.outputPath),group.retryAfterMs=subscription.retryAfterSeconds===void 0?DEFAULT_RETRY_AFTER:subscription.retryAfterSeconds*1e3,group.maxDeliveries=subscription.maxDeliveries??DEFAULT_MAX_DELIVERIES,group.initialDelayMs=(subscription.initialDelaySeconds??0)*1e3,this.activatePushGroup(group)}}enqueue(queueName,payload,contentType2,options){let now=Date.now(),messageId=randomBytes(16).toString("hex"),retentionMs=(options?.retentionSeconds??0)>0?options.retentionSeconds*1e3:DEFAULT_RETENTION,idempotencyRecordKey=options?.idempotencyKey?`${queueName}:${options.idempotencyKey}`:void 0;if(idempotencyRecordKey){let record=this.idempotencyRecords.get(idempotencyRecordKey);if(record&&record.expiresAt>Date.now())return this.duplicateMessages.set(messageId,{queueName,originalMessageId:record.messageId,expiresAt:Date.now()+retentionMs}),output_manager_default.debug(`queues: skipped duplicate message for queue "${queueName}"`),{messageId};record&&this.idempotencyRecords.delete(idempotencyRecordKey)}idempotencyRecordKey&&this.idempotencyRecords.set(idempotencyRecordKey,{messageId,expiresAt:Date.now()+retentionMs});let message2={messageId,payload,contentType:contentType2,queueName,createdAt:new Date(now).toISOString(),retentionMs,visibleAt:(options?.delaySeconds??0)>0?now+options.delaySeconds*1e3:0};this.messages.set(messageId,message2),output_manager_default.debug(`queues: stored message ${messageId} for queue "${queueName}"`);let matchingGroups=this.consumerGroups.filter(g=>g.topicRegex.test(queueName));matchingGroups.length===0&&output_manager_default.debug(`queues: no consumer group matches topic "${queueName}", message stored but not dispatched`);for(let group of matchingGroups){let groupDeliveries=this.deliveryState.get(group.id),initialVisibleAt=group.initialDelayMs>0?now+group.initialDelayMs:0,visibleAt=Math.max(message2.visibleAt,initialVisibleAt);groupDeliveries.set(messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt,leaseExpiresAt:0}),visibleAt<=now&&(group.serviceOriginFn||group.resolveFunction)&&this.dispatchToConsumer(message2,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)})}return{messageId}}getOriginalMessageIdForDuplicate(queueName,messageId){let duplicate=this.duplicateMessages.get(messageId);return!duplicate||duplicate.queueName!==queueName?null:duplicate.expiresAt<=Date.now()?(this.duplicateMessages.delete(messageId),null):duplicate.originalMessageId}receiveById(queueName,messageId,consumerGroup){let message2=this.messages.get(messageId);if(!message2||message2.queueName!==queueName||this.isMessageExpired(message2))return null;let group=this.getOrCreatePullGroup(queueName,consumerGroup),state=this.deliveryState.get(group.id)?.get(messageId);if(!state)return null;if(state.status==="pending"){if(state.visibleAt>Date.now())return null;state.status="in-flight",state.receiptHandle=randomBytes(16).toString("hex"),state.deliveryCount++,state.leaseExpiresAt=Date.now()+DEFAULT_VISIBILITY_TIMEOUT}return{messageId:message2.messageId,payload:message2.payload,contentType:message2.contentType,deliveryCount:state.deliveryCount,createdAt:message2.createdAt,receiptHandle:state.receiptHandle}}receiveMessages(queueName,consumerGroup,options){let group=this.getOrCreatePullGroup(queueName,consumerGroup),groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return[];let now=Date.now(),limit=Math.min(Math.max(options?.limit??1,1),10),visibilityTimeoutMs=(options?.visibilityTimeoutSeconds??DEFAULT_VISIBILITY_TIMEOUT/1e3)*1e3,results=[];for(let[messageId,state]of groupDeliveries){let message2=this.messages.get(messageId);if(!message2){groupDeliveries.delete(messageId);continue}if(this.isMessageExpired(message2,now)){this.deleteMessage(messageId);continue}if(message2.queueName!==queueName||state.status!=="pending"||state.visibleAt>now)continue;let receiptHandle=randomBytes(16).toString("hex");if(state.status="in-flight",state.receiptHandle=receiptHandle,state.deliveryCount++,state.leaseExpiresAt=Date.now()+visibilityTimeoutMs,results.push({messageId:message2.messageId,payload:message2.payload,contentType:message2.contentType,deliveryCount:state.deliveryCount,createdAt:message2.createdAt,receiptHandle}),results.length>=limit)break}return results}acknowledge(messageId,consumerGroup,receiptHandle){let{deliveries:groupDeliveries,state}=this.findDeliveryState(messageId,consumerGroup);return!groupDeliveries||!state?!1:state.receiptHandle&&state.receiptHandle!==receiptHandle?(output_manager_default.debug(`queues: ACK rejected for ${messageId} in group "${consumerGroup}" - receipt handle mismatch`),!1):(state.status="acked",groupDeliveries.delete(messageId),output_manager_default.debug(`queues: ACK message ${messageId} in group "${consumerGroup}"`),!0)}changeVisibility(messageId,consumerGroup,receiptHandle,timeoutSeconds){let{state}=this.findDeliveryState(messageId,consumerGroup);return!state||state.status!=="in-flight"||state.receiptHandle&&state.receiptHandle!==receiptHandle?!1:(state.leaseExpiresAt=Date.now()+timeoutSeconds*1e3,output_manager_default.debug(`queues: visibility for ${messageId} in group "${consumerGroup}" extended by ${timeoutSeconds}s`),!0)}findMessageIdByReceiptHandle(consumerGroup,receiptHandle){for(let group of this.consumerGroups){if(group.name!==consumerGroup)continue;let deliveries=this.deliveryState.get(group.id);if(deliveries){for(let[messageId,state]of deliveries)if(state.receiptHandle===receiptHandle)return messageId}}return null}findDeliveryState(messageId,serviceName){for(let group of this.consumerGroups){if(group.name!==serviceName)continue;let deliveries=this.deliveryState.get(group.id);if(!deliveries)continue;let state=deliveries.get(messageId);if(state)return{deliveries,state}}return{deliveries:null,state:null}}getOrCreatePullGroup(queueName,consumerGroup){let existingGroup=this.consumerGroups.find(group2=>group2.name===consumerGroup&&group2.topicRegex.test(queueName));if(existingGroup)return existingGroup;let group={id:`${consumerGroup}::${queueName}`,name:consumerGroup,topicPattern:queueName,topicRegex:topicPatternToRegex(queueName),retryAfterMs:DEFAULT_RETRY_AFTER,maxDeliveries:DEFAULT_MAX_DELIVERIES,initialDelayMs:DEFAULT_INITIAL_DELAY},deliveries=new Map;for(let message2 of this.messages.values())message2.queueName!==queueName||this.isMessageExpired(message2)||deliveries.set(message2.messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt:message2.visibleAt,leaseExpiresAt:0});return this.consumerGroups.push(group),this.deliveryState.set(group.id,deliveries),group}isMessageExpired(message2,now=Date.now()){return new Date(message2.createdAt).getTime()+message2.retentionMs<now}deleteMessage(messageId){this.messages.delete(messageId);for(let groupDeliveries of this.deliveryState.values())groupDeliveries.delete(messageId)}createRetainedDeliveries(group){let deliveries=new Map;for(let message2 of this.messages.values())!group.topicRegex.test(message2.queueName)||this.isMessageExpired(message2)||deliveries.set(message2.messageId,{status:"pending",deliveryCount:0,receiptHandle:"",visibleAt:Math.max(message2.visibleAt,new Date(message2.createdAt).getTime()+group.initialDelayMs),leaseExpiresAt:0});return deliveries}activatePushGroup(group){if(!group.serviceOriginFn&&!group.resolveFunction)return;let now=Date.now(),deliveries=this.deliveryState.get(group.id);if(deliveries)for(let[messageId,state]of deliveries){let message2=this.messages.get(messageId);!message2||state.status!=="pending"||(state.visibleAt=Math.max(state.visibleAt,new Date(message2.createdAt).getTime()+group.initialDelayMs),state.visibleAt<=now&&this.dispatchToConsumer(message2,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)}))}}async dispatchToConsumer(message2,group){let groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return;let state=groupDeliveries.get(message2.messageId);if(!state||state.status!=="pending")return;if(state.deliveryCount>=group.maxDeliveries){output_manager_default.debug(`queues: message ${message2.messageId} exceeded maxDeliveries (${group.maxDeliveries}) for group "${group.name}", dropping`),groupDeliveries.delete(message2.messageId);return}let upstream=group.serviceOriginFn?.(),dispatch=group.resolveFunction?.();if(!upstream&&!dispatch){state.visibleAt=Date.now()+TICK_INTERVAL2;return}let receiptHandle=randomBytes(16).toString("hex");state.status="in-flight",state.receiptHandle=receiptHandle,state.deliveryCount++,state.leaseExpiresAt=Date.now()+DEFAULT_VISIBILITY_TIMEOUT;let now=new Date().toISOString(),expiresAt=new Date(new Date(message2.createdAt).getTime()+message2.retentionMs).toISOString();output_manager_default.debug(`queues: dispatching v2beta callback to worker "${group.name}"`);try{let request={method:"POST",headers:{"content-type":message2.contentType,"ce-type":"com.vercel.queue.v2beta","ce-specversion":"1.0","ce-source":`/topic/${message2.queueName}/consumer/${group.name}`,"ce-id":message2.messageId,"ce-time":now,"ce-vqsmessageid":message2.messageId,"ce-vqsqueuename":message2.queueName,"ce-vqsconsumergroup":group.name,"ce-vqsreceipthandle":receiptHandle,"ce-vqsdeliverycount":String(state.deliveryCount),"ce-vqscreatedat":message2.createdAt,"ce-vqsexpiresat":expiresAt,"ce-vqsregion":"dev1"},body:message2.payload},response=dispatch?await dispatch(request):await directFetch(`${upstream}/`,request);if(response===null){state.receiptHandle===receiptHandle&&state.status==="in-flight"&&(state.status="pending",state.deliveryCount--,state.receiptHandle="",state.leaseExpiresAt=0,state.visibleAt=Date.now()+TICK_INTERVAL2);return}response.ok||(output_manager_default.debug(`queues: worker "${group.name}" returned ${response.status} for message ${message2.messageId}`),this.handleDeliveryFailure(message2.messageId,group,receiptHandle))}catch(err){output_manager_default.debug(`queues: failed to dispatch CloudEvent to "${group.name}": ${err}`),this.handleDeliveryFailure(message2.messageId,group,receiptHandle)}}handleDeliveryFailure(messageId,group,receiptHandle){let groupDeliveries=this.deliveryState.get(group.id);if(!groupDeliveries)return;let state=groupDeliveries.get(messageId);!state||state.receiptHandle!==receiptHandle||(state.status="pending",state.visibleAt=Date.now()+group.retryAfterMs,state.leaseExpiresAt=0)}tick(){let now=Date.now();for(let[key,record]of this.idempotencyRecords)record.expiresAt<=now&&this.idempotencyRecords.delete(key);for(let[messageId,record]of this.duplicateMessages)record.expiresAt<=now&&this.duplicateMessages.delete(messageId);for(let[messageId,message2]of this.messages)this.isMessageExpired(message2,now)&&this.deleteMessage(messageId);for(let group of this.consumerGroups){let groupDeliveries=this.deliveryState.get(group.id);if(groupDeliveries)for(let[messageId,state]of groupDeliveries){let message2=this.messages.get(messageId);if(!message2){groupDeliveries.delete(messageId);continue}if(state.status==="in-flight"&&state.leaseExpiresAt<=now){state.deliveryCount>=group.maxDeliveries?(output_manager_default.debug(`queues: message ${messageId} exceeded maxDeliveries (${group.maxDeliveries}) for group "${group.name}", dropping`),groupDeliveries.delete(messageId)):(state.status="pending",state.visibleAt=group.serviceOriginFn||group.resolveFunction?now+group.retryAfterMs:now,state.leaseExpiresAt=0);continue}state.status==="pending"&&state.visibleAt<=now&&(group.serviceOriginFn||group.resolveFunction)&&this.dispatchToConsumer(message2,group).catch(err=>{output_manager_default.debug(`queues: unexpected dispatch error: ${err}`)})}}}stop(){clearInterval(this.tickTimer)}};var import_build_utils7=__toESM(require_build_utils(),1),import_minimatch2=__toESM(require_minimatch(),1);import{posix}from"path";function validPath(value,http2=!1){if(typeof value!="string"||!value)return!1;try{let pathname=http2?value:`/${value}`,decoded=decodeURIComponent(pathname);return pathname.startsWith("/")&&!pathname.startsWith("//")&&!/[\\?#\s]/.test(pathname)&&new URL(pathname,"http://localhost").pathname===pathname&&!/[\\?#\x00-\x1f\x7f]/.test(decoded)&&!/%2f/i.test(pathname)&&!decoded.split("/").some(segment=>segment==="."||segment==="..")&&(http2||!value.endsWith("/")&&!value.includes("//"))}catch{return!1}}async function collectDevFunctions({scopes,workPath,files,config,env}){let builders=await importBuilders(new Set(scopes.map(({build})=>build.use)),workPath),unmatched=new Set(Object.entries(config.functions??{}).filter(([,fn2])=>fn2.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta")).map(([pattern])=>pattern)),functions=new Map,schedules=[];for(let scope of scopes){let{build,target}=scope,builder=builders.get(build.use)?.builder;if(!builder)throw dev.DEV_BUILDER_LOAD_FAILED({use:build.use});let scopedConfig=structuredClone({...config,...build.config,functions:build.config?.functions??(build.config?.zeroConfig?{}:config.functions)}),manifest;if(builder.getDevManifest)manifest=await builder.getDevManifest({workPath,build,files,config:scopedConfig,env});else{manifest={functions:[],matchedFunctionPatterns:[]};let mode=build.config??{};if(target!=="builder"||mode.framework||mode.middleware||mode.buildType==="middleware"||mode.buildType==="app"||mode.serviceName||mode.serviceType||mode.buildpack||!build.src||build.src.includes("<"))continue;let pattern=build.src.replace(/^\//,"");for(let sourceFile of files){if(!(sourceFile===pattern||(0,import_minimatch2.default)(sourceFile,pattern,{dot:!0}))||builder.version!==3&&!(builder.version===-1&&mode.zeroConfig&&pattern.startsWith("api/")&&sourceFile.startsWith("api/"))||/(^|\/)package\.json$/.test(sourceFile)||/^(?:src\/)?middleware\.[^/]+$/.test(sourceFile))continue;let extension=posix.extname(sourceFile),outputPath=mode.zeroConfig&&extension?sourceFile.slice(0,-extension.length):sourceFile,{experimentalTriggers}=await(0,import_build_utils7.getLambdaOptionsFromFunction)({sourceFile,config:scopedConfig});manifest.functions.push({outputPath,sourceFile,invocation:{type:"entrypoint",entrypoint:sourceFile},experimentalTriggers});let matched=Object.keys(scopedConfig.functions??{}).find(key=>sourceFile===key||(0,import_minimatch2.default)(sourceFile,key));matched&&manifest.matchedFunctionPatterns.push(matched)}}if(!Array.isArray(manifest?.functions)||!Array.isArray(manifest?.matchedFunctionPatterns)||manifest.matchedFunctionPatterns.some(pattern=>typeof pattern!="string")||manifest.schedules!==void 0&&!Array.isArray(manifest.schedules))throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:build.use});for(let fn2 of manifest.functions){if(!validPath(fn2?.outputPath)||fn2.outputPath.endsWith(".func")||fn2.sourceFile!==void 0&&!validPath(fn2.sourceFile)||!fn2.invocation||(fn2.invocation.type==="http"?!validPath(fn2.invocation.pathname,!0):fn2.invocation.type!=="entrypoint"||!validPath(fn2.invocation.entrypoint))||fn2.experimentalTriggers!==void 0&&!Array.isArray(fn2.experimentalTriggers))throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:build.use});if(functions.has(fn2.outputPath))throw dev.DEV_FUNCTION_OUTPUT_DUPLICATE({outputPath:fn2.outputPath});functions.set(fn2.outputPath,{outputPath:fn2.outputPath,sourceFile:fn2.sourceFile,invocation:structuredClone(fn2.invocation),experimentalTriggers:structuredClone(fn2.experimentalTriggers),scope})}schedules.push(...structuredClone(manifest.schedules??[]));for(let pattern of manifest.matchedFunctionPatterns)unmatched.delete(pattern)}return{functions,schedules,unmatchedPatterns:[...unmatched]}}function deriveQueueSubscriptions(registry){let subscriptions=[],ids=new Set;for(let fn2 of registry.functions.values())for(let trigger of fn2.experimentalTriggers??[]){if(!trigger||typeof trigger.type!="string")throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:fn2.scope.build.use});if(trigger.type!=="queue/v2beta")continue;let{consumer,topic,retryAfterSeconds,initialDelaySeconds,maxDeliveries}=trigger;if(typeof consumer!="string"||!consumer||typeof topic!="string"||!topic||[retryAfterSeconds,initialDelaySeconds,maxDeliveries].some(value=>value!==void 0&&(!Number.isFinite(value)||value<0))||retryAfterSeconds!==void 0&&retryAfterSeconds<=0||maxDeliveries!==void 0&&(!Number.isInteger(maxDeliveries)||maxDeliveries<1))throw dev.DEV_FUNCTION_MANIFEST_INVALID({use:fn2.scope.build.use});let id=`${consumer}::${topic}`;if(ids.has(id))throw dev.DEV_QUEUE_CONSUMER_DUPLICATE({consumerGroup:consumer,topic});ids.add(id),subscriptions.push({outputPath:fn2.outputPath,consumer,topic,retryAfterSeconds,initialDelaySeconds,maxDeliveries})}return subscriptions}import path3 from"path";function toOrchestratorService(sidecar){let{type:_type,...subscriber}=sidecar;return{...subscriber,schema:"experimentalServices",type:"worker",trigger:"queue"}}async function collectBuilderDevSidecars({builds,workPath,services=[]}){let builderSpecs=new Set(builds.map(build=>build.use)),buildersWithPkgs=await importBuilders(builderSpecs,workPath),servicesByBuilder=new Map(services.map(service=>[service.builder,service])),sidecars=(await Promise.all(builds.map(async build=>{let builder=buildersWithPkgs.get(build.use)?.builder;if(!builder)throw dev.DEV_BUILDER_LOAD_FAILED({use:build.use});let service=servicesByBuilder.get(build),serviceRoot=service?.root??".",sidecars2=await builder.getDevSidecars?.({workPath:path3.join(workPath,serviceRoot),build,...service?{service}:{}})??[];return service?sidecars2.map(sidecar=>({...sidecar,name:`${service.name}-${sidecar.name}`,workspace:serviceRoot})):sidecars2}))).flat(),names=new Set;for(let sidecar of sidecars){let{name,type}=sidecar;if(type!=="subscriber")throw dev.DEV_SIDECAR_UNSUPPORTED_TYPE({name,type});if(names.has(name))throw dev.DEV_SIDECAR_DUPLICATE_NAME({name});names.add(name)}return sidecars}function nodeHeadersToFetchHeaders(nodeHeaders){let headers=new globalThis.Headers;for(let[name,value]of Object.entries(nodeHeaders))if(Array.isArray(value))for(let val of value)headers.append(name,val);else typeof value<"u"&&headers.set(name,String(value));return headers}var NEVER_COMBINE_RESPONSE_HEADERS=new Set(["set-cookie","www-authenticate","proxy-authenticate"]),COMMA_JOIN_RESPONSE_HEADERS=new Set(["vary"]);function applyChainResponseHeader(res,name,value){if(NEVER_COMBINE_RESPONSE_HEADERS.has(name)){let existing=res.getHeader(name),values=Array.isArray(existing)?existing.map(String):existing!==void 0?[String(existing)]:[];values.push(value),res.setHeader(name,values);return}if(COMMA_JOIN_RESPONSE_HEADERS.has(name)){let existing=res.getHeader(name);res.setHeader(name,existing!==void 0?`${existing}, ${value}`:value);return}res.setHeader(name,value)}var NONOVERRIDABLE_HEADERS=new Set(["host","connection","content-length","transfer-encoding","keep-alive","transfer-encoding","te","upgrade","trailer"]);function applyOverriddenHeaders(reqHeaders,respHeaders){let headers=new globalThis.Headers(respHeaders),overriddenHeaders=headers.get("x-middleware-override-headers");if(!overriddenHeaders)return headers;let overriddenKeys=new Set;for(let key of overriddenHeaders.split(","))overriddenKeys.add(key.trim());headers.delete("x-middleware-override-headers");for(let key of Object.keys(reqHeaders))!NONOVERRIDABLE_HEADERS.has(key)&&!overriddenKeys.has(key)&&delete reqHeaders[key];for(let key of overriddenKeys.keys()){if(NONOVERRIDABLE_HEADERS.has(key))continue;let valueKey="x-middleware-request-"+key,newValue=headers.get(valueKey);reqHeaders[key]!==newValue&&(newValue?reqHeaders[key]=newValue:delete reqHeaders[key]),headers.delete(valueKey)}return headers}var import_error_utils=__toESM(require_dist(),1);import{parse}from"url";function parseListen(str,defaultPort=3e3){let port=Number(str);if(!isNaN(port))return[port];let url4=parse(str);switch(url4.protocol){case"pipe:":{let cutStr=str.replace(/^pipe:/,"");if(cutStr.slice(0,4)!=="\\\\.\\")throw dev.DEV_INVALID_WINDOWS_PIPE({endpoint:str});return[cutStr]}case"unix:":if(!url4.pathname)throw dev.DEV_INVALID_UNIX_SOCKET({endpoint:str});return[url4.pathname];case"tcp:":return url4.port=url4.port||String(defaultPort),[parseInt(url4.port,10),url4.hostname??void 0];default:if(!url4.slashes){if(url4.protocol===null)return[defaultPort,url4.pathname??void 0];if(port=Number(url4.hostname),url4.protocol&&!isNaN(port))return[port,url4.protocol.substring(0,url4.protocol.length-1)]}throw dev.DEV_INVALID_LISTEN_SCHEME({protocol:url4.protocol})}}function replaceLocalhost(address){return address.replace("[::]","localhost").replace("0.0.0.0","localhost")}import{lstat,readdir,readFile,stat}from"node:fs/promises";import{extname,isAbsolute as isAbsolute2,join as join3,relative as relative3,resolve}from"node:path";import{parse as parseUrl}from"node:url";var MAX_REDIRECTS=1e6,MAX_FILES=100,MAX_URL_LENGTH=2048,VALID_STATUS_CODES=new Set([301,302,303,307,308]),SUPPORTED_EXTENSIONS=new Set([".csv",".json",".jsonl"]),BulkRedirectTable=class{constructor(){this.caseSensitiveByHostPath=new Map;this.caseInsensitiveByHostPath=new Map;this.caseSensitiveByPath=new Map;this.caseInsensitiveByPath=new Map}get size(){return this.caseSensitiveByHostPath.size+this.caseInsensitiveByHostPath.size+this.caseSensitiveByPath.size+this.caseInsensitiveByPath.size}add(redirect2){let{host,pathname}=parseSource(redirect2.source),stored={destination:redirect2.destination,statusCode:redirect2.statusCode,preserveQueryParams:redirect2.preserveQueryParams};if(host){let key=hostPathKey(host,pathname);redirect2.caseSensitive?this.caseSensitiveByHostPath.set(key,stored):this.caseInsensitiveByHostPath.set(key.toLowerCase(),stored);return}redirect2.caseSensitive?this.caseSensitiveByPath.set(pathname,stored):this.caseInsensitiveByPath.set(pathname.toLowerCase(),stored)}lookup(pathname,host){let hostname=host?hostnameFromHostHeader(host):"";if(hostname){let hostKey=hostPathKey(hostname,pathname),hostMatch=this.caseSensitiveByHostPath.get(hostKey)||this.caseInsensitiveByHostPath.get(hostKey.toLowerCase());if(hostMatch)return hostMatch}return this.caseSensitiveByPath.get(pathname)||this.caseInsensitiveByPath.get(pathname.toLowerCase())}};async function getBulkRedirectsSignature(cwd,bulkRedirectsPath){if(!bulkRedirectsPath)return"";let resolved=resolveBulkRedirectsPath(cwd,bulkRedirectsPath);if(!resolved)return`invalid:${bulkRedirectsPath}`;try{let stats=await stat(resolved);if(stats.isFile())return`file:${resolved}:${stats.mtimeMs}:${stats.size}`;if(!stats.isDirectory())return`other:${resolved}:${stats.mtimeMs}`;let files=await listRedirectFiles(resolved),parts=await Promise.all(files.map(async file=>{try{let fileStats=await stat(file);return`${file}:${fileStats.mtimeMs}:${fileStats.size}`}catch{return`${file}:missing`}}));return`dir:${resolved}:${parts.join("|")}`}catch{return`missing:${resolved}`}}async function loadBulkRedirects(cwd,bulkRedirectsPath){let warnings=[],table=new BulkRedirectTable,resolved=resolveBulkRedirectsPath(cwd,bulkRedirectsPath);if(!resolved)return warnings.push(`Skipping bulk redirects path "${bulkRedirectsPath}" because it resolves outside the project directory.`),{table,redirectCount:0,fileCount:0,warnings};let files;try{let stats=await stat(resolved);if(stats.isDirectory())files=await listRedirectFiles(resolved),files.length>MAX_FILES&&(warnings.push(`Bulk redirects directory "${bulkRedirectsPath}" has ${files.length} files; only the first ${MAX_FILES} will be used.`),files=files.slice(0,MAX_FILES));else if(stats.isFile()){let ext=extname(resolved).toLowerCase();if(!SUPPORTED_EXTENSIONS.has(ext))return warnings.push(`Bulk redirects file "${bulkRedirectsPath}" must be a .csv, .json, or .jsonl file.`),{table,redirectCount:0,fileCount:0,warnings};files=[resolved]}else return warnings.push(`Bulk redirects path "${bulkRedirectsPath}" is not a file or directory.`),{table,redirectCount:0,fileCount:0,warnings}}catch(err){if(isNotFound(err))return warnings.push(`Bulk redirects path "${bulkRedirectsPath}" was not found.`),{table,redirectCount:0,fileCount:0,warnings};throw err}let redirectCount=0;for(let file of files){if(redirectCount>=MAX_REDIRECTS){warnings.push(`Bulk redirects limit of ${MAX_REDIRECTS} reached; remaining entries were skipped.`);break}let remaining=MAX_REDIRECTS-redirectCount,parsed=await parseRedirectFile(file,remaining,warnings,cwd);for(let redirect2 of parsed)table.add(redirect2),redirectCount++}let duplicateCount=redirectCount-table.size;return duplicateCount>0&&warnings.push(`Bulk redirects contain ${duplicateCount} duplicate ${duplicateCount===1?"source":"sources"}; the last occurrence wins.`),{table,redirectCount,fileCount:files.length,warnings}}function resolveBulkRedirect(table,reqUrl,host){let parsed=parseUrl(reqUrl),match=table.lookup(parsed.pathname||"/",host);if(!match)return;let location=match.destination;return match.preserveQueryParams&&parsed.search&&(location=appendQueryParams(location,parsed.search)),{location,statusCode:match.statusCode}}function appendQueryParams(destination,search){let query=search.startsWith("?")?search.slice(1):search;return query?destination.includes("?")?`${destination}&${query}`:`${destination}?${query}`:destination}function resolveBulkRedirectsPath(cwd,bulkRedirectsPath){let projectRoot=resolve(cwd),resolved=resolve(projectRoot,bulkRedirectsPath),relativeFromRoot=relative3(projectRoot,resolved);return relativeFromRoot.startsWith("..")||isAbsolute2(relativeFromRoot)?null:resolved}async function listRedirectFiles(dir){let files=[];return await walk(dir,files),files.sort(),files}async function walk(dir,files){let entries=await readdir(dir);for(let entry of entries){let fullPath=join3(dir,entry),stats=await lstat(fullPath);stats.isDirectory()?await walk(fullPath,files):stats.isFile()&&SUPPORTED_EXTENSIONS.has(extname(fullPath).toLowerCase())&&files.push(fullPath)}}async function parseRedirectFile(file,remaining,warnings,cwd){let rel=relative3(cwd,file)||file,ext=extname(file).toLowerCase(),content;try{content=stripBom(await readFile(file,"utf8"))}catch(err){return warnings.push(`Failed to read bulk redirects file "${rel}": ${errorMessage(err)}`),[]}try{return ext===".csv"?parseCsvRedirects(content,remaining,warnings,rel):ext===".jsonl"?parseJsonlRedirects(content,remaining,warnings,rel):parseJsonRedirects(content,remaining,warnings,rel)}catch(err){return warnings.push(`Failed to parse bulk redirects file "${rel}": ${errorMessage(err)}`),[]}}function parseJsonRedirects(content,remaining,warnings,rel){let parsed=JSON.parse(content);return Array.isArray(parsed)?normalizeRedirects(parsed,remaining,warnings,rel):(warnings.push(`Bulk redirects file "${rel}" must contain a JSON array of redirects.`),[])}function parseJsonlRedirects(content,remaining,warnings,rel){let rows=[],lines=content.split(/\r?\n/);for(let i=0;i<lines.length;i++){let line=lines[i].trim();if(line)try{rows.push(JSON.parse(line))}catch{warnings.push(`Skipping invalid JSONL in "${rel}" at line ${i+1}.`)}}return normalizeRedirects(rows,remaining,warnings,rel)}var CSV_HEADER_ALIASES={source:"source",destination:"destination",permanent:"permanent",statuscode:"statusCode",casesensitive:"caseSensitive",preservequeryparams:"preserveQueryParams"};function parseCsvRedirects(content,remaining,warnings,rel){let lines=content.split(/\r?\n/).filter(line=>line.trim().length>0);if(lines.length===0)return warnings.push(`Bulk redirects CSV "${rel}" is empty.`),[];let headers=parseCsvLine(lines[0]).map(header=>CSV_HEADER_ALIASES[header.trim().toLowerCase()]);if(!headers.includes("source")||!headers.includes("destination"))return warnings.push(`Bulk redirects CSV "${rel}" must have "source" and "destination" columns.`),[];let rows=[];for(let i=1;i<lines.length;i++){let values=parseCsvLine(lines[i]),row={};for(let col=0;col<headers.length;col++){let header=headers[col];header&&(row[header]=values[col]??"")}rows.push(row)}return normalizeRedirects(rows,remaining,warnings,rel)}function normalizeRedirects(rows,remaining,warnings,rel){let redirects=[];for(let i=0;i<rows.length;i++){if(redirects.length>=remaining){warnings.push(`Bulk redirects limit of ${MAX_REDIRECTS} reached while reading "${rel}"; remaining entries were skipped.`);break}let row=rows[i];if(!row||typeof row!="object"){warnings.push(`Skipping invalid redirect in "${rel}" at index ${i}.`);continue}let record=row,source=asTrimmedString(record.source),destination=asTrimmedString(record.destination);if(!source||!destination){warnings.push(`Skipping redirect in "${rel}" at index ${i}: source and destination are required.`);continue}if(source.length>MAX_URL_LENGTH||destination.length>MAX_URL_LENGTH){warnings.push(`Skipping redirect in "${rel}" at index ${i}: source and destination must be at most ${MAX_URL_LENGTH} characters.`);continue}let statusCode;if(record.statusCode!==void 0&&record.statusCode!==""){let parsedStatus=parseStatusCode(record.statusCode);if(parsedStatus===void 0){warnings.push(`Skipping redirect in "${rel}" at index ${i}: statusCode must be one of ${[...VALID_STATUS_CODES].join(", ")}.`);continue}statusCode=parsedStatus}else statusCode=parseBoolean(record.permanent)??!1?308:307;redirects.push({source,destination,statusCode,caseSensitive:parseBoolean(record.caseSensitive)??!1,preserveQueryParams:parseBoolean(record.preserveQueryParams)??!1})}return redirects}function parseSource(source){if(/^https?:\/\//i.test(source))try{let parsed=new URL(source);return{host:parsed.hostname.toLowerCase(),pathname:parsed.pathname||"/"}}catch{return{host:null,pathname:source}}return{host:null,pathname:source||"/"}}function hostPathKey(host,pathname){return`${host}\0${pathname}`}function hostnameFromHostHeader(hostHeader){let trimmed=hostHeader.trim();if(!trimmed)return"";if(trimmed.startsWith("[")){let end=trimmed.indexOf("]");return end===-1?trimmed.toLowerCase():trimmed.slice(1,end).toLowerCase()}let colon=trimmed.lastIndexOf(":");return colon!==-1&&trimmed.indexOf(":")===colon?trimmed.slice(0,colon).toLowerCase():trimmed.toLowerCase()}function parseBoolean(value){if(typeof value=="boolean")return value;if(typeof value=="number")return value===1?!0:value===0?!1:void 0;if(typeof value!="string")return;let normalized=value.trim().toLowerCase();if(normalized==="t"||normalized==="true")return!0;if(normalized==="f"||normalized==="false")return!1}function parseStatusCode(value){let n=typeof value=="number"?value:typeof value=="string"?Number(value.trim()):NaN;return VALID_STATUS_CODES.has(n)?n:void 0}function asTrimmedString(value){if(typeof value!="string")return;let trimmed=value.trim();return trimmed||void 0}function parseCsvLine(line){let fields=[],current="",inQuotes=!1;for(let i=0;i<line.length;i++){let char=line[i];inQuotes?char==='"'?line[i+1]==='"'?(current+='"',i++):inQuotes=!1:current+=char:char==='"'?inQuotes=!0:char===","?(fields.push(current),current=""):current+=char}return fields.push(current),fields}function stripBom(content){return content.charCodeAt(0)===65279?content.slice(1):content}function isNotFound(err){return typeof err=="object"&&err!==null&&"code"in err&&err.code==="ENOENT"}function errorMessage(err){return err instanceof Error?err.message:String(err)}var DEV_SERVER_PORT_BIND_TIMEOUT=(0,import_ms6.default)("5m"),DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS=60,DEV_RUNTIME_CACHE_MAX_ITEM_SIZE=2*1024*1024,DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS=31536e3,frameworkRuntimeSet=new Set(import_frameworks3.frameworkList.map(f=>f.useRuntime?.use||"@vercel/static-build"));function isApiDirBuild(build){let src=build.src?.replace(/^\.\//,"");return typeof src=="string"&&src.startsWith("api/")}function sortBuilders(buildA,buildB){return buildA&&buildA.use&&(0,import_fs_detectors2.isOfficialRuntime)("static-build",buildA.use)?1:buildB&&buildB.use&&(0,import_fs_detectors2.isOfficialRuntime)("static-build",buildB.use)?-1:0}var DevServer=class{constructor(cwd,options){this.initialDevCommandStarted=!1;this.functionDispatchReady=!1;this.functionReconciliations=0;this.configGeneration=0;this.unmatchedQueuePatterns=new Set;this.functionRegistry={functions:new Map,schedules:[],unmatchedPatterns:[]};this.responseTransformsByReq=new WeakMap;this.shouldBuildInDev=build=>{if(!this.shouldUseServicesOrchestrator()&&isApiDirBuild(build))return!0;let{name}=(0,import_npm_package_arg.default)(build.use);return!frameworkRuntimeSet.has(name||"")};this.clearVercelConfigPromise=()=>{this.getVercelConfigPromise=null};this.getExtensionlessFile=path6=>{let ext=extname2(path6);return this.apiDir&&path6.startsWith(this.apiDir+"/")&&this.apiExtensions.has(ext)?path6.slice(0,-ext.length):null};this.devServerHandler=async(req,res)=>{await this.startPromise;let requestId=generateRequestId(this.podId);if(this.stopping){res.setHeader("Connection","close"),await this.send404(req,res,requestId);return}let method=req.method||"GET";output_manager_default.debug(`${import_chalk2.default.bold(method)} ${req.url}`);try{let vercelConfig=await this.getVercelConfig();await this.serveProjectAsNowV2(req,res,requestId,vercelConfig)}catch(err){console.error(err),(0,import_error_utils.isError)(err)&&typeof err.stack=="string"&&output_manager_default.debug(err.stack),res.finished||(res.statusCode=500,res.end((0,import_error_utils.errorToString)(err)))}};this.exitWithStatus=async(match,routeResult,phase,req,res,requestId,responseTransforms)=>{let{status,headers,dest}=routeResult,location=headers.location||dest;if(status&&location&&300<=status&&status<=399)return output_manager_default.debug(`Route found with redirect status code ${status}`),await this.sendRedirect(req,res,requestId,location,status,responseTransforms),!0;if(!match&&status&&phase!=="miss"){if(routeResult.userDest)return!1;output_manager_default.debug(`Route found with with status code ${status}`);let errorHeaders={...headers};return responseTransforms&&applyResponseTransforms(errorHeaders,responseTransforms),await this.sendError(req,res,requestId,"",status,errorHeaders),!0}return!1};this.handleQueuesRoute=async(req,res,pathname)=>{if(!this.queueBroker){res.writeHead(503),res.end("Queues broker not initialized");return}if(!pathname.startsWith(DEV_QUEUE_API_PREFIX)){res.writeHead(404),res.end("Not Found");return}let topicPath=pathname.slice(DEV_QUEUE_API_PREFIX.length),sendMatch=topicPath.match(/^([A-Za-z0-9_-]+)$/);if(req.method==="POST"&&sendMatch){let topic=sendMatch[1],contentType2=req.headers["content-type"]||"application/json",payload=await(0,import_raw_body.default)(req),retentionHeader=req.headers["vqs-retention-seconds"],retentionSeconds=retentionHeader&&!isNaN(parseInt(retentionHeader,10))?parseInt(retentionHeader,10):void 0,delayHeader=req.headers["vqs-delay-seconds"],delaySeconds=delayHeader&&!isNaN(parseInt(delayHeader,10))?parseInt(delayHeader,10):void 0,idempotencyKey=req.headers["vqs-idempotency-key"],{messageId}=this.queueBroker.enqueue(topic,payload,contentType2,{retentionSeconds,delaySeconds,idempotencyKey});res.writeHead(201,{"Content-Type":"application/json","Vqs-Message-Id":messageId}),res.end(JSON.stringify({messageId}));return}let receiveByIdMatch=topicPath.match(/^([A-Za-z0-9_-]+)\/consumer\/([A-Za-z0-9_-]+)\/id\/([^/]+)$/);if(req.method==="POST"&&receiveByIdMatch){let[,queueName,consumer,messageId]=receiveByIdMatch,originalMessageId=this.queueBroker.getOriginalMessageIdForDuplicate(queueName,messageId);if(originalMessageId){res.writeHead(409,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"This messageId was a duplicate - use originalMessageId instead",originalMessageId}));return}let result=this.queueBroker.receiveById(queueName,messageId,consumer);if(!result){res.writeHead(404),res.end("Message not found");return}let boundary=`----vcdevboundary${randomBytes2(8).toString("hex")}`,partHeaders=[`Vqs-Message-Id: ${messageId}`,`Vqs-Delivery-Count: ${result.deliveryCount}`,`Vqs-Timestamp: ${result.createdAt}`,`Vqs-Receipt-Handle: ${result.receiptHandle}`,`Content-Type: ${result.contentType}`].join(`\r
|
|
41
41
|
`),body=Buffer.concat([Uint8Array.from(Buffer.from(`--${boundary}\r
|
|
42
42
|
${partHeaders}\r
|
|
43
43
|
\r
|
|
@@ -50,19 +50,19 @@ ${partHeaders}\r
|
|
|
50
50
|
`)),Uint8Array.from(msg.payload),Uint8Array.from(Buffer.from(`\r
|
|
51
51
|
`)))}parts.push(Uint8Array.from(Buffer.from(`--${boundary}--\r
|
|
52
52
|
`)));let body=Buffer.concat(parts);res.writeHead(200,{"Content-Type":`multipart/mixed; boundary=${boundary}`,"Content-Length":body.length}),res.end(body);return}let leaseMatch=topicPath.match(/^([A-Za-z0-9_-]+)\/consumer\/([A-Za-z0-9_-]+)\/lease\/([^/]+)(?:\/visibility)?$/);if(leaseMatch&&(req.method==="DELETE"||req.method==="PATCH")){let[,,consumer,receiptHandle]=leaseMatch,messageId=this.queueBroker.findMessageIdByReceiptHandle(consumer,receiptHandle);if(!messageId){res.writeHead(404,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Message not found"}));return}if(req.method==="DELETE"){this.queueBroker.acknowledge(messageId,consumer,receiptHandle),res.writeHead(204),res.end();return}let body=await(0,import_raw_body.default)(req),timeoutSeconds=DEV_QUEUES_DEFAULT_VISIBILITY_TIMEOUT_SECONDS;try{let parsed=JSON.parse(body.toString());typeof parsed.visibilityTimeoutSeconds=="number"&&parsed.visibilityTimeoutSeconds>=0&&(timeoutSeconds=parsed.visibilityTimeoutSeconds)}catch(err){output_manager_default.debug(`queues: failed to parse visibility timeout body: ${err}`)}this.queueBroker.changeVisibility(messageId,consumer,receiptHandle,timeoutSeconds),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}res.writeHead(404),res.end("Not Found")};this.handleRuntimeCacheRoute=async(req,res,pathname)=>{let store=this.runtimeCache;if(!store){res.writeHead(503),res.end("Runtime Cache not initialized");return}if(!pathname.startsWith(DEV_RUNTIME_CACHE_API_PREFIX)){res.writeHead(404),res.end("Not Found");return}let itemPath=pathname.slice(DEV_RUNTIME_CACHE_API_PREFIX.length),searchParams=new URL2(req.url||"/","http://localhost").searchParams;if(itemPath==="revalidate"){if(req.method!=="POST"){res.writeHead(405),res.end("Method Not Allowed");return}let tags=(searchParams.get("tags")||"").split(",").map(tag=>tag.trim()).filter(Boolean),itemId=searchParams.get("itemId")||void 0;if(tags.length===0&&!itemId){res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"No tags or itemId provided"}));return}tags.length>0&&(store.expireTags(tags),output_manager_default.debug(`runtime cache: expired tags "${tags.join(",")}"`)),itemId&&(store.delete(itemId),output_manager_default.debug(`runtime cache: expired item "${itemId}"`)),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({revalidated:!0}));return}let key;try{key=decodeURIComponent(itemPath)}catch{res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Invalid cache key"}));return}if(!key){res.writeHead(404),res.end("Not Found");return}if(req.method==="GET"){let hit=store.get(key);if(!hit){output_manager_default.debug(`runtime cache: MISS "${key}"`),res.writeHead(404),res.end("Not Found");return}output_manager_default.debug(`runtime cache: HIT "${key}"`);let headers={"Content-Type":"application/json","Content-Length":hit.value.length,[HEADER_CACHE_STATE]:"fresh",Age:String(hit.ageSeconds)};hit.tags.length>0&&(headers[HEADER_CACHE_TAGS]=hit.tags.join(",")),res.writeHead(200,headers),res.end(hit.value);return}if(req.method==="POST"){let revalidateHeader=req.headers[HEADER_REVALIDATE],ttlSeconds;if(revalidateHeader)if(revalidateHeader==="Infinity"||["false","False","FALSE","f","F"].includes(revalidateHeader))ttlSeconds=DEV_RUNTIME_CACHE_ONE_YEAR_SECONDS;else if(/^[+-]?\d+$/.test(revalidateHeader)){let parsedRevalidate=Number(revalidateHeader);if(!Number.isSafeInteger(parsedRevalidate)||parsedRevalidate<0){res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Invalid revalidate value"}));return}if(parsedRevalidate===0){res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}ttlSeconds=parsedRevalidate}else{res.writeHead(400,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Invalid revalidate value"}));return}let value;try{value=await(0,import_raw_body.default)(req,{limit:DEV_RUNTIME_CACHE_MAX_ITEM_SIZE})}catch(err){if(err.statusCode===413){res.writeHead(413,{"Content-Type":"application/json"}),res.end(JSON.stringify({error:"Cache item is too large"}));return}throw err}let tagsHeader=req.headers[HEADER_CACHE_TAGS];store.set(key,value,{ttlSeconds,tags:(tagsHeader||"").split(",").map(tag=>tag.trim()).filter(Boolean)});let name=req.headers[HEADER_CACHE_ITEM_NAME];output_manager_default.debug(`runtime cache: SET "${key}"${name?` (${name})`:""} ${value.length} bytes`),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}if(req.method==="DELETE"){store.delete(key),output_manager_default.debug(`runtime cache: DELETE "${key}"`),res.writeHead(200,{"Content-Type":"application/json"}),res.end(JSON.stringify({success:!0}));return}res.writeHead(405),res.end("Method Not Allowed")};this.serveProjectAsNowV2=async(req,res,requestId,vercelConfig,routes=vercelConfig.routes,callLevel=0)=>{let{debug}=output_manager_default,parsed=url3.parse(req.url||"/");if(typeof parsed.pathname=="string"&&parsed.pathname.includes("//")){let location=parsed.pathname.replace(/\/+/g,"/");if(parsed.search&&(location+=parsed.search),req.method==="GET"){await this.sendRedirect(req,res,requestId,location,301);return}debug(`Rewriting URL from "${req.url}" to "${location}"`),req.url=location}let queueProxyPrefix=`${DEV_QUEUE_PROXY_PREFIX}/${this.resourceProxyToken}`,runtimeCacheProxyPrefix=`${DEV_RUNTIME_CACHE_PREFIX}${this.resourceProxyToken}`;if(callLevel===0&&this.queueBroker){let pathname=parsed.pathname||"/";if(pathname.startsWith(`${queueProxyPrefix}/`)){if(!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}await this.handleQueuesRoute(req,res,pathname.slice(queueProxyPrefix.length));return}}if(callLevel===0){let pathname=parsed.pathname||"/";if(pathname.startsWith(`${runtimeCacheProxyPrefix}/`)){if(!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}await this.handleRuntimeCacheRoute(req,res,pathname.slice(runtimeCacheProxyPrefix.length));return}}if(callLevel===0&&this.bulkRedirects){let bulkMatch=resolveBulkRedirect(this.bulkRedirects,req.url||"/",typeof req.headers.host=="string"?req.headers.host:void 0);if(bulkMatch){debug(`Bulk redirect ${bulkMatch.statusCode}: ${req.url} -> ${bulkMatch.location}`),await this.sendRedirect(req,res,requestId,bulkMatch.location,bulkMatch.statusCode);return}}if(callLevel===0&&this.orchestrator){let pathname=parsed.pathname||"/",service=this.orchestrator.getServiceForRoute(pathname);if(service){debug(`Found service: ${service.name}`);let upstream=`http://${service.host}:${service.port}`;debug(`Proxying to service "${service.name}": ${upstream}`);let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.setResponseHeaders(res,requestId),proxyPass(req,res,upstream,this,requestId,!1)}}callLevel===0&&await this.updateBuildMatches(vercelConfig),this.blockingBuildsPromise&&(debug("Waiting for builds to complete before handling request"),await this.blockingBuildsPromise);let getReqUrl=rr=>{if(rr.dest){if(rr.query){let destParsed=url3.parse(rr.dest),destQuery=parseQueryString(destParsed.search);return Object.assign(destQuery,rr.query),destParsed.search=formatQueryString(destQuery),url3.format(destParsed)}return rr.dest}return req.url},handleMap=getRoutesTypes(routes),missRoutes=handleMap.get("miss")||[],hitRoutes=handleMap.get("hit")||[],errorRoutes=handleMap.get("error")||[],filesystemRoutes=handleMap.get("filesystem")||[],phases=[null,"filesystem"],routeResult=null,match=null,statusCode,prevUrl=req.url,prevHeaders={},requestTransforms=[],responseTransforms,middlewares=[...this.buildMatches.values()].filter(m=>m.config?.middleware===!0);for(let middleware of middlewares){let startMiddlewareResult,middlewarePid,{envConfigs,files,devCacheDir,cwd:workPath}=this;try{let{builder:builder2}=middleware.builderWithPkg;if(typeof builder2.startDevServer=="function"&&(startMiddlewareResult=await builder2.startDevServer({files,entrypoint:middleware.entrypoint,workPath,repoRootPath:this.repoRoot,config:{projectSettings:this.projectSettings,...middleware.config},meta:{isDev:!0,...this.getDevResourceMeta(),devCacheDir,requestUrl:req.url,env:this.getBuilderDevEnv(middleware,envConfigs.runEnv),buildEnv:{...envConfigs.buildEnv}}})),startMiddlewareResult){let{port,pid,shutdown}=startMiddlewareResult;middlewarePid=pid,this.shutdownCallbacks.set(pid,shutdown),debug(`Invoking middleware "${middleware.src}" (port=${port})`);let middlewareReqHeaders=nodeHeadersToFetchHeaders(req.headers),proxyHeaders=this.getProxyHeaders(req,requestId,!0);for(let[name,value]of nodeHeadersToFetchHeaders(proxyHeaders))middlewareReqHeaders.set(name,value);let middlewareReqPath=url3.parse(req.url||"/").path||"/",middlewareRes=await directFetch(`http://127.0.0.1:${port}${middlewareReqPath}`,{headers:middlewareReqHeaders,method:req.method,redirect:"manual"}),middlewareBody=Buffer.from(await middlewareRes.arrayBuffer());if(middlewareRes.status===500&&middlewareBody.byteLength===0){await this.sendError(req,res,requestId,"EDGE_FUNCTION_INVOCATION_FAILED",500);return}res.statusCode=middlewareRes.status;let rewritePath="",contentType2="",shouldContinue=!1,skipMiddlewareHeaders=new Set(["date","connection","content-length","transfer-encoding"]),middlewareHeaders=applyOverriddenHeaders(req.headers,middlewareRes.headers);for(let[name,value]of middlewareHeaders)name==="x-middleware-next"?shouldContinue=value==="1":name==="x-middleware-rewrite"?(rewritePath=value,shouldContinue=!0):name==="content-type"?contentType2=value:skipMiddlewareHeaders.has(name)||(applyChainResponseHeader(res,name,value),req.headers[name]=value);if(!shouldContinue){this.setResponseHeaders(res,requestId),middlewareBody.length>0?(res.setHeader("content-length",middlewareBody.length),contentType2&&res.setHeader("content-type",contentType2),res.end(middlewareBody)):res.end();return}if(rewritePath){debug(`Detected rewrite path from middleware: "${rewritePath}"`),prevUrl=rewritePath;let beforeRewriteUrl=req.url||"/";if(isURL(rewritePath)){let rewriteUrlParsed=new URL2(rewritePath);if(this.address.origin===rewriteUrlParsed.origin)req.url=rewritePath.slice(rewriteUrlParsed.origin.length)||"/",prevUrl=req.url;else{debug(`ProxyPass: ${rewritePath}`),this.setResponseHeaders(res,requestId),proxyPass(req,res,rewritePath,this,requestId);return}}else{let rewriteUrlParsed=url3.parse(beforeRewriteUrl);rewriteUrlParsed.search=url3.parse(rewritePath).search,req.url=url3.format(rewriteUrlParsed)}debug(`Rewrote incoming HTTP URL from "${beforeRewriteUrl}" to "${req.url}"`)}}}catch(err){(0,import_error_utils.isSpawnError)(err)&&err.code==="ENOENT"&&(err.message=`Command not found: ${import_chalk2.default.cyan(err.path,...err.spawnargs)}
|
|
53
|
-
Please ensure that ${cmd(err.path)} is properly installed`,err.link="https://vercel.link/command-not-found"),output_manager_default.prettyError(err),await this.sendError(req,res,requestId,"MIDDLEWARE_INVOCATION_FAILED",500);return}finally{middlewarePid&&this.killBuilderDevServer(middlewarePid)}}for(let phase of phases){statusCode=void 0;let phaseRoutes=handleMap.get(phase)||[];if(routeResult=await devRouter(prevUrl,req.method,phaseRoutes,this,vercelConfig,prevHeaders,missRoutes,phase),routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms),routeResult.continue&&(routeResult.dest&&(prevUrl=getReqUrl(routeResult)),routeResult.headers&&(prevHeaders=routeResult.headers)),callLevel===0&&this.orchestrator&&!routeResult.continue&&isServiceDestination(routeResult.matched_route))return this.delegateToService(req,res,requestId,routeResult.matched_route,vercelConfig,requestTransforms,responseTransforms);if(routeResult.isDestUrl){let destParsed=url3.parse(routeResult.dest),destQuery=parseQueryString(destParsed.search);Object.assign(destQuery,routeResult.query),destParsed.search=formatQueryString(destQuery);let destUrl=url3.format(destParsed);return this.prepareTransforms(req,requestTransforms,responseTransforms),debug(`ProxyPass: ${destUrl}`),this.setResponseHeaders(res,requestId),proxyPass(req,res,destUrl,this,requestId)}if(match=await findBuildMatch(this.buildMatches,this.files,routeResult.dest,this,vercelConfig),await this.exitWithStatus(match,routeResult,phase,req,res,requestId,responseTransforms))return;if(!match&&missRoutes.length>0){if(routeResult=await devRouter(getReqUrl(routeResult),req.method,missRoutes,this,vercelConfig,routeResult.headers,[],"miss"),routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms),match=await findBuildMatch(this.buildMatches,this.files,routeResult.dest,this,vercelConfig),await this.exitWithStatus(match,routeResult,phase,req,res,requestId,responseTransforms))return}else if(match&&hitRoutes.length>0){let prevStatus=routeResult.status;routeResult=await devRouter(getReqUrl(routeResult),req.method,hitRoutes,this,vercelConfig,routeResult.headers,[],"hit"),routeResult.status=prevStatus,routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms)}if(statusCode=routeResult.status,match||phase===null&&filesystemRoutes.length===0)break}if(!match&&routeResult&&errorRoutes.length>0){let routeResultForError=await devRouter(getReqUrl(routeResult),req.method,errorRoutes,this,vercelConfig,routeResult.headers,[],"error"),{matched_route}=routeResultForError,matchForError=await findBuildMatch(this.buildMatches,this.files,routeResultForError.dest,this,vercelConfig);if(matchForError)debug("Route match detected in error phase, breaking loop"),routeResult=routeResultForError,statusCode=routeResultForError.status,match=matchForError,routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms);else if(matched_route&&matched_route.src&&!matched_route.dest&&(debug("Route without `dest` detected in error phase, attempting to exit early"),await this.exitWithStatus(matchForError,routeResultForError,"error",req,res,requestId,responseTransforms)))return}if(!routeResult)throw dev.DEV_INTERNAL_NO_ROUTE_RESULT();let{dest,query,headers}=routeResult;for(let[name,value]of Object.entries(headers))res.setHeader(name,value);statusCode&&Object.defineProperty(res,"statusCode",{get(){return statusCode},set(_){}});let requestPath=dest.replace(/^\//,"");if(!match){if(this.devProcessOrigin){let upstream=this.devProcessOrigin;debug(`Proxying to frontend dev server: ${upstream}`);let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;this.setResponseHeaders(res,requestId);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);return origUrl.pathname=dest,Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format(origUrl),this.prepareTransforms(req,requestTransforms,responseTransforms),proxyPass(req,res,upstream,this,requestId,!1)}(statusCode===404&&routeResult.phase==="miss"||!this.renderDirectoryListing(req,res,requestPath,requestId))&&await this.send404(req,res,requestId);return}let buildRequestPath=match.buildResults.has(null)?null:requestPath,buildResult=match.buildResults.get(buildRequestPath);if(buildResult&&Array.isArray(buildResult.routes)&&buildResult.routes.length>0){let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);origUrl.pathname=dest,Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery);let newUrl=url3.format(origUrl);debug(`Checking build result's ${buildResult.routes.length} \`routes\` to match ${newUrl}`);let matchedRoute=await devRouter(newUrl,req.method,buildResult.routes,this,vercelConfig);if(matchedRoute.found&&callLevel===0){debug(`Found matching route ${matchedRoute.dest} for ${newUrl}`),req.url=newUrl,await this.serveProjectAsNowV2(req,res,requestId,vercelConfig,buildResult.routes,callLevel+1);return}}let{builder,pkg:builderPkg}=match.builderWithPkg;if(typeof builder.startDevServer=="function"){let devServerResult=null;try{
|
|
54
|
-
Please ensure that ${cmd(err.path)} is properly installed`,err.link="https://vercel.link/command-not-found"),output_manager_default.prettyError(err),await this.sendError(req,res,requestId,"NO_RESPONSE_FROM_FUNCTION",502);return}if(devServerResult){requestId=generateRequestId(this.podId,!0);let{port,pid,shutdown,persistent}=devServerResult;this.shutdownCallbacks.set(pid,shutdown),persistent||res.once("close",()=>{this.killBuilderDevServer(pid)}),debug(`Proxying to "${builderPkg.name}" dev server (port=${port}, pid=${pid})`);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format({pathname:origUrl.pathname,search:origUrl.search});let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.prepareTransforms(req,requestTransforms,responseTransforms),this.setResponseHeaders(res,requestId),proxyPass(req,res,`http://127.0.0.1:${port}`,this,requestId,!1)}else debug(`Skipping \`startDevServer()\` for ${match.entrypoint}`)}let foundAsset=findAsset(match,requestPath,vercelConfig);if(!foundAsset&&callLevel===0&&(await this.triggerBuild(match,buildRequestPath,req,vercelConfig),foundAsset=findAsset(match,requestPath,vercelConfig)),this.devProcessOrigin&&(!foundAsset||foundAsset&&foundAsset.asset.type!=="Lambda")){debug("Proxying to frontend dev server");let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.prepareTransforms(req,requestTransforms,responseTransforms),this.setResponseHeaders(res,requestId),proxyPass(req,res,this.devProcessOrigin,this,requestId,!1)}if(!foundAsset){await this.send404(req,res,requestId);return}let{asset,assetKey}=foundAsset;switch(debug(`Serving asset: [${asset.type}] ${assetKey} ${asset.contentType||""}`),asset.type){case"FileFsRef":this.setResponseHeaders(res,requestId);let staticResHeaders={};applyResponseTransforms(staticResHeaders,responseTransforms??[]);for(let[name,value]of Object.entries(staticResHeaders))value!==void 0&&res.setHeader(name,value);return req.url=`/${basename(asset.fsPath)}`,serveStaticFile(req,res,dirname3(asset.fsPath),{headers:[{source:"**/*",headers:[{key:"Content-Type",value:asset.contentType||getMimeType(assetKey)}]}]});case"FileBlob":let headers2={"Content-Length":asset.data.length,"Content-Type":asset.contentType||getMimeType(assetKey)};applyResponseTransforms(headers2,responseTransforms??[]),this.setResponseHeaders(res,requestId,headers2),res.end(asset.data);return;case"Lambda":if(!asset.fn){await this.sendError(req,res,requestId,"INTERNAL_LAMBDA_NOT_FOUND");return}requestId=generateRequestId(this.podId,!0);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format({pathname:origUrl.pathname,search:origUrl.search}),applyRequestTransforms(req,requestTransforms);let path6=req.url||"/",body=await(0,import_raw_body.default)(req),payload={method:req.method||"GET",host:req.headers.host,path:path6,headers:{...req.headers,...this.getProxyHeaders(req,requestId,!0)},encoding:"base64",body:body.toString("base64")};debug(`Invoking lambda: "${assetKey}" with ${path6}`);let result;try{result=await asset.fn({Action:"Invoke",body:JSON.stringify(payload)})}catch(err){console.error(err),await this.sendError(req,res,requestId,"NO_RESPONSE_FROM_FUNCTION",502);return}statusCode||(res.statusCode=result.statusCode);let lambdaHeaders=result.headers??{};applyResponseTransforms(lambdaHeaders,responseTransforms??[]),this.setResponseHeaders(res,requestId,lambdaHeaders);let resBody;return result.encoding==="base64"&&typeof result.body=="string"?resBody=Buffer.from(result.body,"base64"):resBody=result.body,res.end(resBody);default:await this.sendError(req,res,requestId,"UNKNOWN_ASSET_TYPE")}};this.cwd=cwd,this.repoRoot=options.repoRoot??cwd,this.envConfigs={buildEnv:{},runEnv:{},allEnv:{}},this.envValues=options.envValues||{},this.projectId=options.projectId,this.orgId=options.orgId,this.queuePort=options.queuePort,this.runtimeCachePort=options.runtimeCachePort,this.resourceProxyToken=randomBytes2(32).toString("base64url"),this.reportError=createErrorReporter(code=>options.onErrorCode?.(code)),this.files={},this.originalProjectSettings=options.projectSettings,this.projectSettings=options.projectSettings,this.services=options.services,this.useImplicitServicesEnvInjection=options.useImplicitServicesEnvInjection??!0,this.caseSensitive=!1,this.apiDir=null,this.apiExtensions=new Set,this.proxy=import_http_proxy_node16.default.createProxyServer({changeOrigin:!0,ws:!0,xfwd:!0}),this.proxy.on("proxyRes",(proxyRes,req)=>{proxyRes.headers.server="Vercel";let responseTransforms=this.responseTransformsByReq.get(req);responseTransforms&&(this.responseTransformsByReq.delete(req),applyResponseTransforms(proxyRes.headers,responseTransforms))}),this.proxy.on("error",(err,req,res)=>{if(output_manager_default.debug(`Proxy error for ${req?.url??"unknown request"}: ${(0,import_error_utils.errorToString)(err)}`),!!res){if("destroy"in res&&typeof res.destroy=="function"){res.destroy();return}res instanceof http.ServerResponse&&(res.headersSent||res.writeHead(502),res.end())}}),this.server=http.createServer(this.devServerHandler),this.server.timeout=0,this.queueServer=http.createServer((req,res)=>{this.handleResourceServerRequest(req,res,this.queueOrigin,this.handleQueuesRoute)}),this.runtimeCacheServer=http.createServer((req,res)=>{this.handleResourceServerRequest(req,res,this.runtimeCacheOrigin,this.handleRuntimeCacheRoute)}),this.stopping=!1,this.buildMatches=new Map,this.inProgressBuilds=new Map,this.devCacheDir=join4(getVercelDirectory(cwd),"cache"),this.vercelConfigWarning=!1,this.getVercelConfigPromise=null,this.blockingBuildsPromise=null,this.startPromise=null,this.bulkRedirects=null,this.bulkRedirectsSignature=null,this.bulkRedirectsLastPath=null,this.bulkRedirectsResolvedPath=null,this.bulkRedirectsDirty=!0,this.watchAggregationId=null,this.watchAggregationEvents=[],this.watchAggregationTimeout=500,this.filter=path6=>!!path6,this.podId=Math.random().toString(32).slice(-5),this.shutdownCallbacks=new Map}get address(){if(!this._address)throw dev.DEV_INTERNAL_ADDRESS_UNAVAILABLE();return this._address}shouldUseServicesOrchestrator(){return!!(this.services&&this.services.length>0)}hasSubscribers(){return!!this.sidecars?.length}getDevQueueEnv(){return this.queueOrigin?getDevQueueEnv(this.queueOrigin,this.hasSubscribers()):{}}getDevRuntimeCacheEnv(env){return!this.runtimeCacheOrigin||env.RUNTIME_CACHE_ENDPOINT?{}:process.env.RUNTIME_CACHE_ENDPOINT?{RUNTIME_CACHE_ENDPOINT:process.env.RUNTIME_CACHE_ENDPOINT,...process.env.RUNTIME_CACHE_HEADERS?{RUNTIME_CACHE_HEADERS:process.env.RUNTIME_CACHE_HEADERS}:{}}:getDevRuntimeCacheEnv(this.runtimeCacheOrigin,DEV_RUNTIME_CACHE_API_PREFIX)}get resourceEndpoints(){if(!this.queueOrigin||!this.runtimeCacheOrigin)throw new Error("Local resource servers have not started");return{queues:{direct:this.queueOrigin,proxy:`${this.address.origin}${DEV_QUEUE_PROXY_PREFIX}/${this.resourceProxyToken}`},runtimeCache:{direct:`${this.runtimeCacheOrigin}${DEV_RUNTIME_CACHE_API_PREFIX}`,proxy:`${this.address.origin}${DEV_RUNTIME_CACHE_PREFIX}${this.resourceProxyToken}${DEV_RUNTIME_CACHE_API_PREFIX}`}}}getDevResourceMeta(){return{devResourceEndpoints:this.resourceEndpoints}}handleResourceServerRequest(req,res,origin,handler){if(!origin||!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}if(!isValidDevResourceHost(origin,req.headers.host)){res.writeHead(403),res.end("Forbidden");return}let pathname=new URL2(req.url||"/","http://127.0.0.1").pathname;handler(req,res,pathname).catch(err=>{output_manager_default.debug(`Local resource request failed for ${req.url||"/"}: ${(0,import_error_utils.errorToString)(err)}`),res.headersSent||res.writeHead(500),res.end("Internal Server Error")})}isAuthorizedResourceRequest(req,token){let authorization=req.headers.authorization;if(typeof authorization!="string")return!1;let encoder=new TextEncoder,actual=encoder.encode(authorization),expected=encoder.encode(`Bearer ${token}`);return actual.length===expected.length&&timingSafeEqual(actual,expected)}getBuilderDevEnv(match,env){let result={...env};if(match.builderWithPkg.pkg.name!=="@vercel/container")return result;let endpoints=this.resourceEndpoints;return result.VERCEL_QUEUE_BASE_URL===endpoints.queues.direct&&Object.assign(result,getDevQueueEnv(endpoints.queues.proxy,result.VERCEL_HAS_WORKER_SERVICES!==void 0)),result.RUNTIME_CACHE_ENDPOINT===endpoints.runtimeCache.direct&&Object.assign(result,getDevRuntimeCacheEnv(endpoints.runtimeCache.proxy,"")),result}getSidecarDevMeta(match){let serviceCount=(this.sidecars??[]).filter(sidecar=>sidecar.builder.use!==match.use?!1:!sidecar.workspace||sidecar.workspace===".").length;return serviceCount>0?{serviceCount}:{}}async setupBuilderDevSidecars(){if(this.shouldUseServicesOrchestrator())return;let sidecars=this.sidecars??[];if(sidecars.length===0)return;Object.assign(this.envConfigs.runEnv,this.getDevQueueEnv());let services=sidecars.map(toOrchestratorService),orchestrator=new ServicesOrchestrator({services,cwd:this.cwd,repoRoot:this.repoRoot,env:this.envConfigs.allEnv,proxyOrigin:this.address.origin,resourceEndpoints:this.resourceEndpoints,useImplicitEnvInjection:!1,preferServiceBuilder:!0,onQueueSubscriptions:(serviceName,subscriptions)=>this.queueBroker?.updateServiceSubscriptions(serviceName,subscriptions)});this.sidecarOrchestrator=orchestrator,this.queueBroker?.registerServices(services);try{await orchestrator.startAll()}catch(err){throw await orchestrator.stopAll(),this.sidecarOrchestrator=void 0,this.sidecars=[],err}output_manager_default.log(`Started ${sidecars.length} development ${(0,import_pluralize2.default)("sidecar",sidecars.length)}`)}async exit(code=1){await this.stop(code),process.exit(code)}enqueueFsEvent(type,path6){this.bulkRedirectsResolvedPath&&(path6===this.bulkRedirectsResolvedPath||path6.startsWith(this.bulkRedirectsResolvedPath+sep2))&&(this.bulkRedirectsDirty=!0),this.watchAggregationEvents.push({type,path:path6}),this.watchAggregationId===null&&(this.watchAggregationId=setTimeout(()=>{let events=this.watchAggregationEvents.slice();this.watchAggregationEvents.length=0,this.watchAggregationId=null,this.handleFilesystemEvents(events).catch(err=>{output_manager_default.prettyError(err),(0,import_error_utils.isError)(err)&&typeof err.stack=="string"&&output_manager_default.debug(err.stack)})},this.watchAggregationTimeout))}async handleFilesystemEvents(events){output_manager_default.debug(`Filesystem watcher notified of ${events.length} events`);let filesChanged=new Set,filesRemoved=new Set,distPaths=[];for(let buildMatch of this.buildMatches.values())for(let buildResult of buildMatch.buildResults.values())buildResult.distPath&&distPaths.push(buildResult.distPath);events=events.filter(event=>distPaths.every(distPath=>!event.path.startsWith(distPath)));for(let event of events)event.type==="add"?await this.handleFileCreated(event.path,filesChanged,filesRemoved):event.type==="unlink"?this.handleFileDeleted(event.path,filesChanged,filesRemoved):event.type==="change"&&await this.handleFileModified(event.path,filesChanged,filesRemoved);let vercelConfig=await this.getVercelConfig();await this.updateBuildMatches(vercelConfig);let filesChangedArray=[...filesChanged],filesRemovedArray=[...filesRemoved],needsRebuild=new Map;for(let match of this.buildMatches.values())for(let[requestPath,result]of match.buildResults)if(!needsRebuild.has(result)&&Array.isArray(result.watch)){for(let pattern of result.watch)if(minimatches(filesChangedArray,pattern)||minimatches(filesRemovedArray,pattern)){needsRebuild.set(result,[requestPath,match]);break}}if(needsRebuild.size>0){output_manager_default.debug(`Triggering ${needsRebuild.size} rebuilds`),filesChangedArray.length>0&&output_manager_default.debug(`Files changed: ${filesChangedArray.join(", ")}`),filesRemovedArray.length>0&&output_manager_default.debug(`Files removed: ${filesRemovedArray.join(", ")}`);for(let[result,[requestPath,match]]of needsRebuild)requestPath===null||await shouldServe(match,this.files,requestPath,this,vercelConfig)?this.triggerBuild(match,requestPath,null,vercelConfig,result,filesChangedArray,filesRemovedArray).catch(err=>{output_manager_default.warn(`An error occurred while rebuilding \`${match.src}\`:`),console.error(err.stack)}):output_manager_default.debug(`Not rebuilding because \`shouldServe()\` returned \`false\` for "${match.use}" request path "${requestPath}"`)}}async handleFileCreated(fsPath,changed,removed){let name=relative2(this.cwd,fsPath);try{await this.getVercelConfig(),this.files[name]=await import_build_utils7.FileFsRef.fromFsPath({fsPath});let extensionless=this.getExtensionlessFile(name);extensionless&&(this.files[extensionless]=await import_build_utils7.FileFsRef.fromFsPath({fsPath})),fileChanged(name,changed,removed),output_manager_default.debug(`File created: ${name}`)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT")output_manager_default.debug(`File created, but has since been deleted: ${name}`),fileRemoved(name,this.files,changed,removed);else throw err}}handleFileDeleted(fsPath,changed,removed){let name=relative2(this.cwd,fsPath);output_manager_default.debug(`File deleted: ${name}`),fileRemoved(name,this.files,changed,removed);let extensionless=this.getExtensionlessFile(name);extensionless&&(output_manager_default.debug(`File deleted: ${extensionless}`),fileRemoved(extensionless,this.files,changed,removed))}async handleFileModified(fsPath,changed,removed){let name=relative2(this.cwd,fsPath);try{this.files[name]=await import_build_utils7.FileFsRef.fromFsPath({fsPath}),fileChanged(name,changed,removed),output_manager_default.debug(`File modified: ${name}`)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT")output_manager_default.debug(`File modified, but has since been deleted: ${name}`),fileRemoved(name,this.files,changed,removed);else throw err}}async updateBuildMatches(vercelConfig,isInitial=!1){let fileList=this.resolveBuildFiles(this.files),matches=await getBuildMatches(vercelConfig,this.cwd,this,fileList),sources=matches.map(m=>m.src);isInitial&&fileList.length===0&&output_manager_default.warn("There are no files inside your deployment.");let ops=[];for(let src of this.buildMatches.keys())if(!sources.includes(src)){output_manager_default.debug(`Removing build match for "${src}"`);let match=this.buildMatches.get(src);match&&ops.push(shutdownBuilder(match)),this.buildMatches.delete(src)}await Promise.all(ops);let blockingBuilds=[];for(let match of matches){let currentMatch=this.buildMatches.get(match.src);if(!buildMatchEquals(currentMatch,match)&&(output_manager_default.debug(`Adding build match for "${match.src}" with "${match.use}"`),this.buildMatches.set(match.src,match),!isInitial&&needsBlockingBuild(match))){let buildPromise=executeBuild(vercelConfig,this,this.files,match,null,!1);blockingBuilds.push(buildPromise)}}blockingBuilds.length>0&&(output_manager_default.debug(`Waiting for ${blockingBuilds.length} "blocking builds"`),this.blockingBuildsPromise=Promise.all(blockingBuilds).then(()=>{output_manager_default.debug('Cleaning up "blockingBuildsPromise" after successful resolve'),this.blockingBuildsPromise=null}).catch(err=>{output_manager_default.debug(`Cleaning up "blockingBuildsPromise" after error: ${err}`),this.blockingBuildsPromise=null,err&&output_manager_default.prettyError(err)})),this.buildMatches=new Map([...this.buildMatches.entries()].sort((matchA,matchB)=>sortBuilders(matchA[1],matchB[1])))}async getLocalEnv(fileName,base){let filePath=join4(this.cwd,fileName),env={};try{let dotenv=await import_fs_extra.default.readFile(filePath,"utf8");output_manager_default.debug(`Using local env: ${filePath}`),env=(0,import_dotenv.parse)(dotenv),env=this.injectSystemValuesInDotenv(env)}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ENOENT")throw err}try{return{...this.validateEnvConfig(fileName,base||{},env)}}catch(err){if(err instanceof MissingDotenvVarsError)this.reportError(err),await this.exit();else throw err}return{}}getVercelConfig(){if(this.getVercelConfigPromise)return this.getVercelConfigPromise;this.getVercelConfigPromise=this._getVercelConfig();let clear=this.clearVercelConfigPromise;return this.getVercelConfigPromise.then(clear,clear),this.getVercelConfigPromise}get devCommand(){if(this.projectSettings?.devCommand)return this.projectSettings.devCommand;if(this.projectSettings?.framework){let frameworkSlug=this.projectSettings.framework,framework=import_frameworks3.frameworkList.find(f=>f.slug===frameworkSlug);if(framework){let defaults=framework.settings.devCommand.value;if(defaults)return defaults}if((0,import_build_utils7.shouldUseExperimentalBackends)(frameworkSlug))return"npx @vercel/cervel dev"}}async _getVercelConfig(){let{compileVercelConfig}=await import("../../chunks/compile-vercel-config-NKOWFZZG.js");await compileVercelConfig(this.cwd);let configPath=getLocalPathConfig(this.cwd),[pkg=null,vercelConfig={version:2,[import_client.fileNameSymbol]:"vercel.json"}]=await Promise.all([this.readJsonFile("package.json"),this.readJsonFile(configPath)]);await this.validateVercelConfig(vercelConfig),this.projectSettings={...this.originalProjectSettings,...pickOverrides(vercelConfig)};let{error:routeError,routes:maybeRoutes}=(0,import_routing_utils3.getTransformedRoutes)(vercelConfig);routeError&&(this.reportError(routeError),await this.exit()),vercelConfig.routes=maybeRoutes||[];let hasServices=(this.services?.length??0)>0,hasResolvedServices=!!this.services&&this.services.length>0;if(!vercelConfig.experimentalServices&&!hasResolvedServices&&(!vercelConfig.builds||vercelConfig.builds.length===0)){let{projectSettings,cleanUrls,trailingSlash}=vercelConfig,files=(await staticFiles(this.cwd,{})).map(f=>relative2(this.cwd,f)),detectedBuilders=await(0,import_detect_builders_with_services.detectBuildersWithServices)(files,pkg,{tag:"latest",bunVersion:vercelConfig.bunVersion,functions:vercelConfig.functions,projectSettings:projectSettings||this.projectSettings,featHandleMiss:!0,cleanUrls,trailingSlash,proxy:vercelConfig.proxy,workPath:this.cwd}),{builders,warnings,errors,defaultRoutes,redirectRoutes,rewriteRoutes,errorRoutes}=detectedBuilders,hostRewriteRoutes=detectedBuilders.hostRewriteRoutes;if(errors&&(this.reportError(errors[0]),await this.exit()),warnings?.length>0&&warnings.forEach(warning=>output_manager_default.warn(warning.message,null,warning.link,warning.action)),builders){let buildpackRuntime=builders.map(getBuildpackRuntime).find(runtime=>runtime!==void 0);if(buildpackRuntime)throw buildpackDevUnsupportedError(buildpackRuntime);vercelConfig.builds=vercelConfig.builds||[],vercelConfig.builds.push(...builders),delete vercelConfig.functions}let serviceRewrites=detectedBuilders.serviceRewrites,serviceRewriteRoutes=serviceRewrites&&serviceRewrites.length>0?(0,import_routing_utils3.convertRewrites)(serviceRewrites):null,routes=[];routes.push(...redirectRoutes||[]),routes=(0,import_routing_utils3.appendRoutesToPhase)({routes,newRoutes:hostRewriteRoutes??null,phase:null}),routes.push(...(0,import_routing_utils3.appendRoutesToPhase)({routes:vercelConfig.routes,newRoutes:[...rewriteRoutes||[],...serviceRewriteRoutes||[]],phase:"filesystem"})),routes=(0,import_routing_utils3.appendRoutesToPhase)({routes,newRoutes:errorRoutes,phase:"error"}),routes.push(...defaultRoutes||[]),vercelConfig.routes=routes}else if(hasResolvedServices&&vercelConfig.proxy){let{entrypoint}=vercelConfig.proxy;await import_fs_extra.default.pathExists(join4(this.cwd,entrypoint))||(output_manager_default.error(`The proxy entrypoint \`${entrypoint}\` does not exist. Set \`proxy.entrypoint\` to an existing \`.js\` or \`.ts\` file.`),await this.exit()),vercelConfig.builds=vercelConfig.builds||[],vercelConfig.builds.push((0,import_fs_detectors2.getProxyBuilder)(vercelConfig.proxy,"latest",vercelConfig.functions))}if(this.sidecars===void 0){let services=(this.services??[]).filter(import_build_utils7.isExperimentalServiceV2);this.sidecars=await collectBuilderDevSidecars({builds:this.shouldUseServicesOrchestrator()?services.map(service=>service.builder):vercelConfig.builds??[],workPath:this.cwd,services})}Array.isArray(vercelConfig.builds)&&((this.devCommand||hasServices)&&(vercelConfig.builds=vercelConfig.builds.filter(this.shouldBuildInDev)),vercelConfig.builds.sort(sortBuilders)),vercelConfig.routes=(vercelConfig.routes||[]).filter(route=>"has"in route?(this.vercelConfigWarning||(this.vercelConfigWarning=!0,output_manager_default.warn(`The "has" property in ${vercelConfig[import_client.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`)),!1):!0),this.caseSensitive=hasNewRoutingProperties(vercelConfig),this.apiDir=(0,import_fs_detectors2.detectApiDirectory)(vercelConfig.builds||[]),this.apiExtensions=(0,import_fs_detectors2.detectApiExtensions)(vercelConfig.builds||[]);let[runEnv,buildEnv]=await Promise.all([this.getLocalEnv(".env",vercelConfig.env),this.getLocalEnv(".env.build",vercelConfig.build?.env)]),allEnv={...buildEnv,...runEnv};if(Object.keys(allEnv).length===0){let envValues={...this.envValues};this.address.host&&(envValues.VERCEL_URL=this.address.host),allEnv={...envValues},runEnv={...envValues},buildEnv={...envValues}}return runEnv.NOW_REGION="dev1",buildEnv.NOW_REGION="dev1",allEnv.NOW_REGION="dev1",allEnv.VERCEL_ENV="development",allEnv.VERCEL="1",this.projectId&&!process.env.VERCEL_PROJECT_ID&&("VERCEL_PROJECT_ID"in allEnv||(allEnv.VERCEL_PROJECT_ID=this.projectId),"VERCEL_PROJECT_ID"in runEnv||(runEnv.VERCEL_PROJECT_ID=this.projectId)),this.orgId&&!process.env.VERCEL_ORG_ID&&("VERCEL_ORG_ID"in allEnv||(allEnv.VERCEL_ORG_ID=this.orgId),"VERCEL_ORG_ID"in runEnv||(runEnv.VERCEL_ORG_ID=this.orgId)),this.projectSettings?.autoExposeSystemEnvs&&(runEnv.VERCEL_REGION="dev1"),Object.assign(runEnv,this.getDevQueueEnv()),Object.assign(runEnv,this.getDevRuntimeCacheEnv(runEnv)),this.envConfigs={buildEnv,runEnv,allEnv},this.initialDevCommandStarted&&await this.runDevCommand(),await this.refreshBulkRedirects(vercelConfig.bulkRedirectsPath),vercelConfig}async refreshBulkRedirects(bulkRedirectsPath){let configPath=bulkRedirectsPath??null;if(configPath===this.bulkRedirectsLastPath&&!this.bulkRedirectsDirty)return;if(this.bulkRedirectsLastPath=configPath,this.bulkRedirectsDirty=!1,this.bulkRedirectsResolvedPath=configPath?resolveBulkRedirectsPath(this.cwd,configPath):null,!configPath){this.bulkRedirects=null,this.bulkRedirectsSignature=null;return}let signature=await getBulkRedirectsSignature(this.cwd,configPath);if(signature!==this.bulkRedirectsSignature){this.bulkRedirectsSignature=signature;try{let result=await loadBulkRedirects(this.cwd,configPath);this.bulkRedirects=result.table;for(let warning of result.warnings)output_manager_default.warn(warning);let count=result.table.size;count>0&&output_manager_default.log(`Loaded ${count} bulk ${(0,import_pluralize2.default)("redirect",count)} from ${configPath}`)}catch(err){this.bulkRedirects=null,output_manager_default.warn(`Failed to load bulk redirects from "${configPath}": ${(0,import_error_utils.errorToString)(err)}`)}}}async readJsonFile(filePath){let rel,abs;isAbsolute3(filePath)?(rel=path4.relative(this.cwd,filePath),abs=filePath):(rel=filePath,abs=join4(this.cwd,filePath)),output_manager_default.debug(`Reading \`${rel}\` file`);try{let raw=await import_fs_extra.default.readFile(abs,"utf8"),parsed=(0,import_json_parse_better_errors.default)(raw);return parsed[import_client.fileNameSymbol]=rel,parsed}catch(err){if((0,import_error_utils.isError)(err))(0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"?output_manager_default.debug(`No \`${rel}\` file present`):err.name==="SyntaxError"&&output_manager_default.warn(`There is a syntax error in the \`${rel}\` file: ${err.message}`);else throw err}}async tryValidateOrExit(config,validate){let message2=validate(config);message2&&(output_manager_default.error(message2),await this.exit(1))}async validateVercelConfig(config){if(config.version===1){this.reportError(dev.DEV_UNSUPPORTED_CONFIG_VERSION()),await this.exit(1);return}let error2=validateConfig(config);error2&&(this.reportError(error2),await this.exit(1))}validateEnvConfig(type,env={},localEnv={}){let missing=Object.entries(env).filter(([name,value])=>typeof value=="string"&&value.startsWith("@")&&!hasProp(localEnv,name)).map(([name])=>name);if(missing.length>0)throw new MissingDotenvVarsError(type,missing);let merged={...env,...localEnv},hasInvalidName=!1;for(let key of Object.keys(merged))/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)||(output_manager_default.warn(`Ignoring ${type.split(".").slice(1).reverse().join(" ")} var ${JSON.stringify(key)} because name is invalid`),hasInvalidName=!0,delete merged[key]);return hasInvalidName&&output_manager_default.log("The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should not start with a digit"),merged}injectSystemValuesInDotenv(env){for(let name of Object.keys(env))name==="VERCEL_URL"?env.VERCEL_URL=this.address.host:name==="VERCEL_REGION"&&(env.VERCEL_REGION="dev1");return env}resolveBuildFiles(files){return Object.keys(files).filter(this.filter)}isWatcherIgnored(fsPath){let relativePath=relative2(this.cwd,fsPath);return relativePath===""?!1:!this.filter(relativePath)}start(...listenSpec){return this.startPromise||(this.startPromise=this._start(...listenSpec).catch(async err=>{throw await this.stop(),err})),this.startPromise}async _start(...listenSpec){if(!import_fs_extra.default.existsSync(this.cwd))throw dev.DEV_CWD_NOT_FOUND({cwd:this.cwd});if(!import_fs_extra.default.lstatSync(this.cwd).isDirectory())throw dev.DEV_CWD_NOT_DIRECTORY({cwd:this.cwd});let{ig}=await(0,import_client.getVercelIgnore)(this.cwd);this.filter=ig.createFilter();let address=null;for(;typeof address!="string";)try{address=(await(0,import_async_listen.listen)(this.server,...listenSpec)).toString()}catch(err){if((0,import_error_utils.isErrnoException)(err))output_manager_default.debug(`Got listen error: ${err.code}`),err.code==="EADDRINUSE"&&(typeof listenSpec[0]=="number"?(output_manager_default.note(`Requested port ${import_chalk2.default.yellow(String(listenSpec[0]))} is already in use`),listenSpec[0]++):(this.reportError(dev.DEV_LISTEN_ADDRESS_IN_USE({address:String(listenSpec[0])})),process.exit(1)));else throw err}this._address=new URL2(replaceLocalhost(address)),this.runtimeCache=new RuntimeCacheStore;let runtimeCacheListener=await listenOnDevResourcePort(this.runtimeCacheServer,{name:"Runtime Cache",flag:"--runtime-cache-port",defaultPort:DEV_RUNTIME_CACHE_DEFAULT_PORT,port:this.runtimeCachePort,reservedPorts:this.queuePort!==void 0&&this.queuePort!==0?[this.queuePort]:void 0});this.runtimeCacheOrigin=runtimeCacheListener.origin,runtimeCacheListener.defaultPort!==void 0&&output_manager_default.warn(`Runtime Cache default port ${runtimeCacheListener.defaultPort} is unavailable; listening on ${runtimeCacheListener.port} instead.
|
|
53
|
+
Please ensure that ${cmd(err.path)} is properly installed`,err.link="https://vercel.link/command-not-found"),output_manager_default.prettyError(err),await this.sendError(req,res,requestId,"MIDDLEWARE_INVOCATION_FAILED",500);return}finally{middlewarePid&&this.killBuilderDevServer(middlewarePid)}}for(let phase of phases){statusCode=void 0;let phaseRoutes=handleMap.get(phase)||[];if(routeResult=await devRouter(prevUrl,req.method,phaseRoutes,this,vercelConfig,prevHeaders,missRoutes,phase),routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms),routeResult.continue&&(routeResult.dest&&(prevUrl=getReqUrl(routeResult)),routeResult.headers&&(prevHeaders=routeResult.headers)),callLevel===0&&this.orchestrator&&!routeResult.continue&&isServiceDestination(routeResult.matched_route))return this.delegateToService(req,res,requestId,routeResult.matched_route,vercelConfig,requestTransforms,responseTransforms);if(routeResult.isDestUrl){let destParsed=url3.parse(routeResult.dest),destQuery=parseQueryString(destParsed.search);Object.assign(destQuery,routeResult.query),destParsed.search=formatQueryString(destQuery);let destUrl=url3.format(destParsed);return this.prepareTransforms(req,requestTransforms,responseTransforms),debug(`ProxyPass: ${destUrl}`),this.setResponseHeaders(res,requestId),proxyPass(req,res,destUrl,this,requestId)}if(match=await findBuildMatch(this.buildMatches,this.files,routeResult.dest,this,vercelConfig),await this.exitWithStatus(match,routeResult,phase,req,res,requestId,responseTransforms))return;if(!match&&missRoutes.length>0){if(routeResult=await devRouter(getReqUrl(routeResult),req.method,missRoutes,this,vercelConfig,routeResult.headers,[],"miss"),routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms),match=await findBuildMatch(this.buildMatches,this.files,routeResult.dest,this,vercelConfig),await this.exitWithStatus(match,routeResult,phase,req,res,requestId,responseTransforms))return}else if(match&&hitRoutes.length>0){let prevStatus=routeResult.status;routeResult=await devRouter(getReqUrl(routeResult),req.method,hitRoutes,this,vercelConfig,routeResult.headers,[],"hit"),routeResult.status=prevStatus,routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms)}if(statusCode=routeResult.status,match||phase===null&&filesystemRoutes.length===0)break}if(!match&&routeResult&&errorRoutes.length>0){let routeResultForError=await devRouter(getReqUrl(routeResult),req.method,errorRoutes,this,vercelConfig,routeResult.headers,[],"error"),{matched_route}=routeResultForError,matchForError=await findBuildMatch(this.buildMatches,this.files,routeResultForError.dest,this,vercelConfig);if(matchForError)debug("Route match detected in error phase, breaking loop"),routeResult=routeResultForError,statusCode=routeResultForError.status,match=matchForError,routeResult.requestTransforms&&requestTransforms.push(...routeResult.requestTransforms),routeResult.responseTransforms&&(responseTransforms=routeResult.responseTransforms);else if(matched_route&&matched_route.src&&!matched_route.dest&&(debug("Route without `dest` detected in error phase, attempting to exit early"),await this.exitWithStatus(matchForError,routeResultForError,"error",req,res,requestId,responseTransforms)))return}if(!routeResult)throw dev.DEV_INTERNAL_NO_ROUTE_RESULT();let{dest,query,headers}=routeResult;for(let[name,value]of Object.entries(headers))res.setHeader(name,value);statusCode&&Object.defineProperty(res,"statusCode",{get(){return statusCode},set(_){}});let requestPath=dest.replace(/^\//,"");if(!match){if(this.devProcessOrigin){let upstream=this.devProcessOrigin;debug(`Proxying to frontend dev server: ${upstream}`);let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;this.setResponseHeaders(res,requestId);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);return origUrl.pathname=dest,Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format(origUrl),this.prepareTransforms(req,requestTransforms,responseTransforms),proxyPass(req,res,upstream,this,requestId,!1)}(statusCode===404&&routeResult.phase==="miss"||!this.renderDirectoryListing(req,res,requestPath,requestId))&&await this.send404(req,res,requestId);return}let buildRequestPath=match.buildResults.has(null)?null:requestPath,buildResult=match.buildResults.get(buildRequestPath);if(buildResult&&Array.isArray(buildResult.routes)&&buildResult.routes.length>0){let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);origUrl.pathname=dest,Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery);let newUrl=url3.format(origUrl);debug(`Checking build result's ${buildResult.routes.length} \`routes\` to match ${newUrl}`);let matchedRoute=await devRouter(newUrl,req.method,buildResult.routes,this,vercelConfig);if(matchedRoute.found&&callLevel===0){debug(`Found matching route ${matchedRoute.dest} for ${newUrl}`),req.url=newUrl,await this.serveProjectAsNowV2(req,res,requestId,vercelConfig,buildResult.routes,callLevel+1);return}}let{builder,pkg:builderPkg}=match.builderWithPkg;if(typeof builder.startDevServer=="function"){let devServerResult=null;try{devServerResult=await this.startBuildMatchDevServer(match,requestPath)}catch(err){(0,import_error_utils.isSpawnError)(err)&&err.code==="ENOENT"&&(err.message=`Command not found: ${import_chalk2.default.cyan(err.path,...err.spawnargs)}
|
|
54
|
+
Please ensure that ${cmd(err.path)} is properly installed`,err.link="https://vercel.link/command-not-found"),output_manager_default.prettyError(err),await this.sendError(req,res,requestId,"NO_RESPONSE_FROM_FUNCTION",502);return}if(devServerResult){requestId=generateRequestId(this.podId,!0);let{port,pid,shutdown,persistent}=devServerResult;this.shutdownCallbacks.set(pid,shutdown),persistent||res.once("close",()=>{this.killBuilderDevServer(pid)}),debug(`Proxying to "${builderPkg.name}" dev server (port=${port}, pid=${pid})`);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format({pathname:origUrl.pathname,search:origUrl.search});let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.prepareTransforms(req,requestTransforms,responseTransforms),this.setResponseHeaders(res,requestId),proxyPass(req,res,`http://127.0.0.1:${port}`,this,requestId,!1)}else debug(`Skipping \`startDevServer()\` for ${match.entrypoint}`)}let foundAsset=findAsset(match,requestPath,vercelConfig);if(!foundAsset&&callLevel===0&&(await this.triggerBuild(match,buildRequestPath,req,vercelConfig),foundAsset=findAsset(match,requestPath,vercelConfig)),this.devProcessOrigin&&(!foundAsset||foundAsset&&foundAsset.asset.type!=="Lambda")){debug("Proxying to frontend dev server");let headers2=this.getProxyHeaders(req,requestId,!1);for(let[name,value]of Object.entries(headers2))req.headers[name]=value;return this.prepareTransforms(req,requestTransforms,responseTransforms),this.setResponseHeaders(res,requestId),proxyPass(req,res,this.devProcessOrigin,this,requestId,!1)}if(!foundAsset){await this.send404(req,res,requestId);return}let{asset,assetKey}=foundAsset;switch(debug(`Serving asset: [${asset.type}] ${assetKey} ${asset.contentType||""}`),asset.type){case"FileFsRef":this.setResponseHeaders(res,requestId);let staticResHeaders={};applyResponseTransforms(staticResHeaders,responseTransforms??[]);for(let[name,value]of Object.entries(staticResHeaders))value!==void 0&&res.setHeader(name,value);return req.url=`/${basename(asset.fsPath)}`,serveStaticFile(req,res,dirname3(asset.fsPath),{headers:[{source:"**/*",headers:[{key:"Content-Type",value:asset.contentType||getMimeType(assetKey)}]}]});case"FileBlob":let headers2={"Content-Length":asset.data.length,"Content-Type":asset.contentType||getMimeType(assetKey)};applyResponseTransforms(headers2,responseTransforms??[]),this.setResponseHeaders(res,requestId,headers2),res.end(asset.data);return;case"Lambda":if(!asset.fn){await this.sendError(req,res,requestId,"INTERNAL_LAMBDA_NOT_FOUND");return}requestId=generateRequestId(this.podId,!0);let origUrl=url3.parse(req.url||"/"),origQuery=parseQueryString(origUrl.search);Object.assign(origQuery,query),origUrl.search=formatQueryString(origQuery),req.url=url3.format({pathname:origUrl.pathname,search:origUrl.search}),applyRequestTransforms(req,requestTransforms);let path6=req.url||"/",body=await(0,import_raw_body.default)(req);debug(`Invoking lambda: "${assetKey}" with ${path6}`);let result;try{result=await this.invokeBuiltLambda(asset,req,requestId,body)}catch(err){console.error(err),await this.sendError(req,res,requestId,"NO_RESPONSE_FROM_FUNCTION",502);return}statusCode||(res.statusCode=result.statusCode);let lambdaHeaders=result.headers??{};applyResponseTransforms(lambdaHeaders,responseTransforms??[]),this.setResponseHeaders(res,requestId,lambdaHeaders);let resBody;return result.encoding==="base64"&&typeof result.body=="string"?resBody=Buffer.from(result.body,"base64"):resBody=result.body,res.end(resBody);default:await this.sendError(req,res,requestId,"UNKNOWN_ASSET_TYPE")}};this.cwd=cwd,this.repoRoot=options.repoRoot??cwd,this.envConfigs={buildEnv:{},runEnv:{},allEnv:{}},this.envValues=options.envValues||{},this.projectId=options.projectId,this.orgId=options.orgId,this.queuePort=options.queuePort,this.runtimeCachePort=options.runtimeCachePort,this.resourceProxyToken=randomBytes2(32).toString("base64url"),this.reportError=createErrorReporter(code=>options.onErrorCode?.(code)),this.files={},this.originalProjectSettings=options.projectSettings,this.projectSettings=options.projectSettings,this.services=options.services,this.useImplicitServicesEnvInjection=options.useImplicitServicesEnvInjection??!0,this.caseSensitive=!1,this.apiDir=null,this.apiExtensions=new Set,this.proxy=import_http_proxy_node16.default.createProxyServer({changeOrigin:!0,ws:!0,xfwd:!0}),this.proxy.on("proxyRes",(proxyRes,req)=>{proxyRes.headers.server="Vercel";let responseTransforms=this.responseTransformsByReq.get(req);responseTransforms&&(this.responseTransformsByReq.delete(req),applyResponseTransforms(proxyRes.headers,responseTransforms))}),this.proxy.on("error",(err,req,res)=>{if(output_manager_default.debug(`Proxy error for ${req?.url??"unknown request"}: ${(0,import_error_utils.errorToString)(err)}`),!!res){if("destroy"in res&&typeof res.destroy=="function"){res.destroy();return}res instanceof http.ServerResponse&&(res.headersSent||res.writeHead(502),res.end())}}),this.server=http.createServer(this.devServerHandler),this.server.timeout=0,this.queueServer=http.createServer((req,res)=>{this.handleResourceServerRequest(req,res,this.queueOrigin,this.handleQueuesRoute)}),this.runtimeCacheServer=http.createServer((req,res)=>{this.handleResourceServerRequest(req,res,this.runtimeCacheOrigin,this.handleRuntimeCacheRoute)}),this.stopping=!1,this.buildMatches=new Map,this.inProgressBuilds=new Map,this.devCacheDir=join4(getVercelDirectory(cwd),"cache"),this.vercelConfigWarning=!1,this.getVercelConfigPromise=null,this.blockingBuildsPromise=null,this.startPromise=null,this.bulkRedirects=null,this.bulkRedirectsSignature=null,this.bulkRedirectsLastPath=null,this.bulkRedirectsResolvedPath=null,this.bulkRedirectsDirty=!0,this.watchAggregationId=null,this.watchAggregationEvents=[],this.watchAggregationTimeout=500,this.filter=path6=>!!path6,this.podId=Math.random().toString(32).slice(-5),this.shutdownCallbacks=new Map}get address(){if(!this._address)throw dev.DEV_INTERNAL_ADDRESS_UNAVAILABLE();return this._address}shouldUseServicesOrchestrator(){return!!(this.services&&this.services.length>0)}hasSubscribers(){return!!this.sidecars?.length}getDevQueueEnv(){return this.queueOrigin?getDevQueueEnv(this.queueOrigin,this.hasSubscribers()):{}}getDevRuntimeCacheEnv(env){return!this.runtimeCacheOrigin||env.RUNTIME_CACHE_ENDPOINT?{}:process.env.RUNTIME_CACHE_ENDPOINT?{RUNTIME_CACHE_ENDPOINT:process.env.RUNTIME_CACHE_ENDPOINT,...process.env.RUNTIME_CACHE_HEADERS?{RUNTIME_CACHE_HEADERS:process.env.RUNTIME_CACHE_HEADERS}:{}}:getDevRuntimeCacheEnv(this.runtimeCacheOrigin,DEV_RUNTIME_CACHE_API_PREFIX)}get resourceEndpoints(){if(!this.queueOrigin||!this.runtimeCacheOrigin)throw new Error("Local resource servers have not started");return{queues:{direct:this.queueOrigin,proxy:`${this.address.origin}${DEV_QUEUE_PROXY_PREFIX}/${this.resourceProxyToken}`},runtimeCache:{direct:`${this.runtimeCacheOrigin}${DEV_RUNTIME_CACHE_API_PREFIX}`,proxy:`${this.address.origin}${DEV_RUNTIME_CACHE_PREFIX}${this.resourceProxyToken}${DEV_RUNTIME_CACHE_API_PREFIX}`}}}getDevResourceMeta(){return{devResourceEndpoints:this.resourceEndpoints}}handleResourceServerRequest(req,res,origin,handler){if(!origin||!this.isAuthorizedResourceRequest(req,DEV_RESOURCE_TOKEN)){res.writeHead(401,{"WWW-Authenticate":"Bearer"}),res.end("Unauthorized");return}if(!isValidDevResourceHost(origin,req.headers.host)){res.writeHead(403),res.end("Forbidden");return}let pathname=new URL2(req.url||"/","http://127.0.0.1").pathname;handler(req,res,pathname).catch(err=>{output_manager_default.debug(`Local resource request failed for ${req.url||"/"}: ${(0,import_error_utils.errorToString)(err)}`),res.headersSent||res.writeHead(500),res.end("Internal Server Error")})}isAuthorizedResourceRequest(req,token){let authorization=req.headers.authorization;if(typeof authorization!="string")return!1;let encoder=new TextEncoder,actual=encoder.encode(authorization),expected=encoder.encode(`Bearer ${token}`);return actual.length===expected.length&&timingSafeEqual(actual,expected)}getBuilderDevEnv(match,env){let result={...env};if(match.builderWithPkg.pkg.name!=="@vercel/container")return result;let endpoints=this.resourceEndpoints;return result.VERCEL_QUEUE_BASE_URL===endpoints.queues.direct&&Object.assign(result,getDevQueueEnv(endpoints.queues.proxy,result.VERCEL_HAS_WORKER_SERVICES!==void 0)),result.RUNTIME_CACHE_ENDPOINT===endpoints.runtimeCache.direct&&Object.assign(result,getDevRuntimeCacheEnv(endpoints.runtimeCache.proxy,"")),result}getSidecarDevMeta(match){let serviceCount=(this.sidecars??[]).filter(sidecar=>sidecar.builder.use!==match.use?!1:!sidecar.workspace||sidecar.workspace===".").length;return serviceCount>0?{serviceCount}:{}}async setupBuilderDevSidecars(){if(this.shouldUseServicesOrchestrator())return;let sidecars=this.sidecars??[];if(sidecars.length===0)return;Object.assign(this.envConfigs.runEnv,this.getDevQueueEnv());let services=sidecars.map(toOrchestratorService),orchestrator=new ServicesOrchestrator({services,cwd:this.cwd,repoRoot:this.repoRoot,env:this.envConfigs.allEnv,proxyOrigin:this.address.origin,resourceEndpoints:this.resourceEndpoints,useImplicitEnvInjection:!1,preferServiceBuilder:!0,onQueueSubscriptions:(serviceName,subscriptions)=>this.queueBroker?.updateServiceSubscriptions(serviceName,subscriptions)});this.sidecarOrchestrator=orchestrator,this.queueBroker?.registerServices(services);try{await orchestrator.startAll()}catch(err){throw await orchestrator.stopAll(),this.sidecarOrchestrator=void 0,this.sidecars=[],err}output_manager_default.log(`Started ${sidecars.length} development ${(0,import_pluralize2.default)("sidecar",sidecars.length)}`)}async exit(code=1){await this.stop(code),process.exit(code)}enqueueFsEvent(type,path6){this.bulkRedirectsResolvedPath&&(path6===this.bulkRedirectsResolvedPath||path6.startsWith(this.bulkRedirectsResolvedPath+sep2))&&(this.bulkRedirectsDirty=!0),this.watchAggregationEvents.push({type,path:path6}),this.watchAggregationId===null&&(this.watchAggregationId=setTimeout(()=>{let events=this.watchAggregationEvents.slice();this.watchAggregationEvents.length=0,this.watchAggregationId=null,this.handleFilesystemEvents(events).catch(err=>{output_manager_default.prettyError(err),(0,import_error_utils.isError)(err)&&typeof err.stack=="string"&&output_manager_default.debug(err.stack)})},this.watchAggregationTimeout))}async handleFilesystemEvents(events){output_manager_default.debug(`Filesystem watcher notified of ${events.length} events`);let filesChanged=new Set,filesRemoved=new Set,distPaths=[];for(let buildMatch of this.buildMatches.values())for(let buildResult of buildMatch.buildResults.values())buildResult.distPath&&distPaths.push(buildResult.distPath);if(events=events.filter(event=>distPaths.every(distPath=>!event.path.startsWith(distPath))),events.length!==0){this.functionReconciliations++;try{this.configGeneration++,this.functionDiscovery=void 0;for(let event of events)event.type==="add"?await this.handleFileCreated(event.path,filesChanged,filesRemoved):event.type==="unlink"?this.handleFileDeleted(event.path,filesChanged,filesRemoved):event.type==="change"&&await this.handleFileModified(event.path,filesChanged,filesRemoved);let vercelConfig=await this.getVercelConfig();await this.updateBuildMatches(vercelConfig);let filesChangedArray=[...filesChanged],filesRemovedArray=[...filesRemoved],needsRebuild=new Map;for(let match of this.buildMatches.values()){this.canonicalizeFunctionBuild(match);for(let[requestPath,result]of match.buildResults)if(!needsRebuild.has(result)&&Array.isArray(result.watch)){for(let pattern of result.watch)if(minimatches(filesChangedArray,pattern)||minimatches(filesRemovedArray,pattern)){needsRebuild.set(result,[requestPath,match]);break}}}if(needsRebuild.size>0){output_manager_default.debug(`Triggering ${needsRebuild.size} rebuilds`),filesChangedArray.length>0&&output_manager_default.debug(`Files changed: ${filesChangedArray.join(", ")}`),filesRemovedArray.length>0&&output_manager_default.debug(`Files removed: ${filesRemovedArray.join(", ")}`);for(let[result,[requestPath,match]]of needsRebuild)requestPath===null||await shouldServe(match,this.files,requestPath,this,vercelConfig)?this.triggerBuild(match,requestPath,null,vercelConfig,result,filesChangedArray,filesRemovedArray).catch(err=>{output_manager_default.warn(`An error occurred while rebuilding \`${match.src}\`:`),console.error(err.stack)}):output_manager_default.debug(`Not rebuilding because \`shouldServe()\` returned \`false\` for "${match.use}" request path "${requestPath}"`)}}finally{this.functionReconciliations--}}}async handleFileCreated(fsPath,changed,removed){let name=relative2(this.cwd,fsPath);try{await this.getVercelConfig(),this.files[name]=await import_build_utils8.FileFsRef.fromFsPath({fsPath});let extensionless=this.getExtensionlessFile(name);extensionless&&(this.files[extensionless]=await import_build_utils8.FileFsRef.fromFsPath({fsPath})),fileChanged(name,changed,removed),output_manager_default.debug(`File created: ${name}`)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT")output_manager_default.debug(`File created, but has since been deleted: ${name}`),fileRemoved(name,this.files,changed,removed);else throw err}}handleFileDeleted(fsPath,changed,removed){let name=relative2(this.cwd,fsPath);output_manager_default.debug(`File deleted: ${name}`),fileRemoved(name,this.files,changed,removed);let extensionless=this.getExtensionlessFile(name);extensionless&&(output_manager_default.debug(`File deleted: ${extensionless}`),fileRemoved(extensionless,this.files,changed,removed))}async handleFileModified(fsPath,changed,removed){let name=relative2(this.cwd,fsPath);try{this.files[name]=await import_build_utils8.FileFsRef.fromFsPath({fsPath}),fileChanged(name,changed,removed),output_manager_default.debug(`File modified: ${name}`)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT")output_manager_default.debug(`File modified, but has since been deleted: ${name}`),fileRemoved(name,this.files,changed,removed);else throw err}}async updateBuildMatches(vercelConfig,isInitial=!1){let fileList=this.resolveBuildFiles(this.files),matches=await getBuildMatches(vercelConfig,this.cwd,this,fileList),sources=matches.map(m=>m.src);isInitial&&fileList.length===0&&output_manager_default.warn("There are no files inside your deployment.");let ops=[];for(let src of this.buildMatches.keys())if(!sources.includes(src)){output_manager_default.debug(`Removing build match for "${src}"`);let match=this.buildMatches.get(src);match&&ops.push(shutdownBuilder(match)),this.buildMatches.delete(src)}await Promise.all(ops);let blockingBuilds=[];for(let match of matches){let currentMatch=this.buildMatches.get(match.src);if(!buildMatchEquals(currentMatch,match)&&(output_manager_default.debug(`Adding build match for "${match.src}" with "${match.use}"`),this.buildMatches.set(match.src,match),!isInitial&&needsBlockingBuild(match))){let buildPromise=executeBuild(vercelConfig,this,this.files,match,null,!1);blockingBuilds.push(buildPromise)}}blockingBuilds.length>0&&(output_manager_default.debug(`Waiting for ${blockingBuilds.length} "blocking builds"`),this.blockingBuildsPromise=Promise.all(blockingBuilds).then(()=>{output_manager_default.debug('Cleaning up "blockingBuildsPromise" after successful resolve'),this.blockingBuildsPromise=null}).catch(err=>{output_manager_default.debug(`Cleaning up "blockingBuildsPromise" after error: ${err}`),this.blockingBuildsPromise=null,err&&output_manager_default.prettyError(err)})),this.buildMatches=new Map([...this.buildMatches.entries()].sort((matchA,matchB)=>sortBuilders(matchA[1],matchB[1])))}async getLocalEnv(fileName,base){let filePath=join4(this.cwd,fileName),env={};try{let dotenv=await import_fs_extra.default.readFile(filePath,"utf8");output_manager_default.debug(`Using local env: ${filePath}`),env=(0,import_dotenv.parse)(dotenv),env=this.injectSystemValuesInDotenv(env)}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ENOENT")throw err}try{return{...this.validateEnvConfig(fileName,base||{},env)}}catch(err){if(err instanceof MissingDotenvVarsError)this.reportError(err),await this.exit();else throw err}return{}}getVercelConfig(){if(this.getVercelConfigPromise)return this.getVercelConfigPromise;this.getVercelConfigPromise=(async()=>{for(;;){let generation=this.configGeneration;try{let config=await this._getVercelConfig();if(generation===this.configGeneration)return config}catch(err){if(generation===this.configGeneration)throw err}this.functionDiscovery=void 0}})();let clear=this.clearVercelConfigPromise;return this.getVercelConfigPromise.then(clear,clear),this.getVercelConfigPromise}get devCommand(){return this.getDevCommand(this.projectSettings)}getDevCommand(projectSettings){if(projectSettings?.devCommand)return projectSettings.devCommand;if(projectSettings?.framework){let frameworkSlug=projectSettings.framework,framework=import_frameworks3.frameworkList.find(f=>f.slug===frameworkSlug);if(framework){let defaults=framework.settings.devCommand.value;if(defaults)return defaults}if((0,import_build_utils8.shouldUseExperimentalBackends)(frameworkSlug))return"npx @vercel/cervel dev"}}getFunctionDiscovery(options){let key=JSON.stringify(options);if(!this.functionDiscovery||this.functionDiscovery.key!==key){let promise=collectDevFunctions(options);this.functionDiscovery={key,promise},promise.catch(()=>{this.functionDiscovery?.promise===promise&&(this.functionDiscovery=void 0)})}return this.functionDiscovery.promise}getDevFunction(outputPath){return this.functionRegistry.functions.get(outputPath)}getDevSchedules(){return this.functionRegistry.schedules}resolveDevFunction(outputPath){let fn2=this.getDevFunction(outputPath);if(!fn2||this.stopping)return null;if(fn2.invocation.type==="http"){if(!this.devProcessOrigin)return null}else if(!this.functionDispatchReady||this.functionReconciliations>0||!this.getDevFunctionMatch(fn2))return null;return request=>this.invokeDevFunction(outputPath,request)}getDevFunctionMatch(fn2){if(fn2.invocation.type!=="entrypoint"||fn2.scope.target!=="builder")return;let{entrypoint}=fn2.invocation;return[...this.buildMatches.values()].find(match=>match.entrypoint===entrypoint&&match.use===fn2.scope.build.use&&(0,import_fast_deep_equal.default)(match.config??{},fn2.scope.build.config??{}))}canonicalizeFunctionBuild(match){if(![...this.functionRegistry.functions.values()].some(fn2=>this.getDevFunctionMatch(fn2)===match))return!1;if(match.buildResults.size&&!(match.buildResults.size===1&&match.buildResults.has(null))){let results=[...match.buildResults.values()],result=results[results.length-1];result.watch=[...new Set(results.flatMap(result2=>result2.watch))],match.buildResults.clear(),match.buildResults.set(null,result)}return!0}async invokeDevFunction(outputPath,request){let fn2=this.getDevFunction(outputPath);if(!fn2||!this.resolveDevFunction(outputPath))return null;let generation=this.configGeneration,isCurrent=()=>!this.stopping&&generation===this.configGeneration&&this.getDevFunction(outputPath)===fn2;if(fn2.invocation.type==="http"){let response=await directFetch(`${this.devProcessOrigin}${fn2.invocation.pathname}`,{...request,redirect:"manual"});return await response.arrayBuffer(),{ok:response.ok,status:response.status}}let match=this.getDevFunctionMatch(fn2),config=this.functionConfig,req=new http.IncomingMessage(new Socket);req.method=request.method,req.url=`/${outputPath}`,req.headers={host:this.address.host,...request.headers};let requestId=generateRequestId(this.podId,!0),currentMatch=()=>isCurrent()&&this.getDevFunctionMatch(fn2)===match,devServerResult=await this.startBuildMatchDevServer(match,outputPath);if(devServerResult){let{port,pid,shutdown,persistent}=devServerResult;this.shutdownCallbacks.set(pid,shutdown);try{if(!currentMatch())return null;let response=await directFetch(`http://127.0.0.1:${port}/${outputPath}`,{...request,headers:nodeHeadersToFetchHeaders({...req.headers,...this.getProxyHeaders(req,requestId,!0)}),redirect:"manual"});return await response.arrayBuffer(),{ok:response.ok,status:response.status}}finally{let current=this.getDevFunction(outputPath);(this.stopping||!persistent||!current||this.getDevFunctionMatch(current)!==match)&&this.shutdownCallbacks.has(pid)&&await this.killBuilderDevServer(pid)}}if(!currentMatch())return null;let{entrypoint}=fn2.invocation,getAsset=()=>match.buildOutput[(match.buildResultVersion??match.builderWithPkg.builder.version)===2?outputPath:entrypoint];this.canonicalizeFunctionBuild(match);let asset=getAsset();if((!asset||this.inProgressBuilds.get(match)?.size)&&(await this.triggerBuild(match,null,null,config),asset=getAsset()),!currentMatch())return null;if(!asset||asset.type!=="Lambda"||!asset.fn)return{ok:!1,status:404};let result=await this.invokeBuiltLambda(asset,req,requestId,request.body);return{ok:result.statusCode>=200&&result.statusCode<300,status:result.statusCode}}async startBuildMatchDevServer(match,requestPath){let{builder}=match.builderWithPkg;if(!builder.startDevServer)return null;let{envConfigs,files,devCacheDir,cwd:workPath}=this;return builder.startDevServer({files,entrypoint:match.entrypoint,workPath,config:match.config||{},repoRootPath:this.repoRoot,meta:{isDev:!0,...this.getDevResourceMeta(),requestPath,devCacheDir,...this.getSidecarDevMeta(match),env:this.getBuilderDevEnv(match,{...envConfigs.runEnv,VERCEL_DEBUG_PREFIX:output_manager_default.debugEnabled?"[builder]":void 0}),buildEnv:{...envConfigs.buildEnv}}})}invokeBuiltLambda(asset,req,requestId,body){let payload={method:req.method||"GET",host:req.headers.host,path:req.url||"/",headers:{...req.headers,...this.getProxyHeaders(req,requestId,!0)},encoding:"base64",body:body.toString("base64")};return asset.fn({Action:"Invoke",body:JSON.stringify(payload)})}async _getVercelConfig(){let generation=this.configGeneration,{compileVercelConfig}=await import("../../chunks/compile-vercel-config-Y4L43MSC.js");await compileVercelConfig(this.cwd);let configPath=getLocalPathConfig(this.cwd),[pkg=null,vercelConfig={version:2,[import_client.fileNameSymbol]:"vercel.json"}]=await Promise.all([this.readJsonFile("package.json"),this.readJsonFile(configPath)]);await this.validateVercelConfig(vercelConfig);let functionConfig=structuredClone(vercelConfig),sourceFiles;for(let[name,service]of Object.entries(this.queueBroker?vercelConfig.services??vercelConfig.experimentalServicesV2??{}:{}))if(Object.values(service.functions??{}).some(fn2=>fn2.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta")))throw dev.DEV_QUEUE_FUNCTION_UNSUPPORTED({sourceFile:`services.${name}.functions`,reason:"service-hosted function queue triggers are not supported locally yet"});let nextProjectSettings={...this.originalProjectSettings,...pickOverrides(vercelConfig)},{error:routeError,routes:maybeRoutes}=(0,import_routing_utils3.getTransformedRoutes)(vercelConfig);routeError&&(this.reportError(routeError),await this.exit()),vercelConfig.routes=maybeRoutes||[];let hasServices=(this.services?.length??0)>0,hasResolvedServices=!!this.services&&this.services.length>0;if(!vercelConfig.experimentalServices&&!hasResolvedServices&&(!vercelConfig.builds||vercelConfig.builds.length===0)){let{projectSettings,cleanUrls,trailingSlash}=vercelConfig,files=(await staticFiles(this.cwd,{})).map(f=>relative2(this.cwd,f));sourceFiles=files;let detectionOptions={tag:"latest",bunVersion:vercelConfig.bunVersion,functions:vercelConfig.functions,projectSettings:projectSettings||nextProjectSettings,featHandleMiss:!0,cleanUrls,trailingSlash,proxy:vercelConfig.proxy,workPath:this.cwd},detectedBuilders=await(0,import_detect_builders_with_services.detectBuildersWithServices)(files,pkg,detectionOptions);for(;detectedBuilders.errors?.length===1&&detectedBuilders.errors[0].code==="unused_function";){let error2=detectedBuilders.errors[0],unmatchedQueue=Object.entries(detectionOptions.functions??{}).find(([pattern,fn2])=>error2.message.startsWith(`The pattern "${pattern}" defined in \`functions\` `)&&fn2.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta"));if(!unmatchedQueue)break;detectionOptions.functions={...detectionOptions.functions},delete detectionOptions.functions[unmatchedQueue[0]],detectedBuilders=await(0,import_detect_builders_with_services.detectBuildersWithServices)(files,pkg,detectionOptions)}let{builders,warnings,errors,defaultRoutes,redirectRoutes,rewriteRoutes,errorRoutes}=detectedBuilders,hostRewriteRoutes=detectedBuilders.hostRewriteRoutes;if(errors&&(this.reportError(errors[0]),await this.exit()),warnings?.length>0&&warnings.forEach(warning=>output_manager_default.warn(warning.message,null,warning.link,warning.action)),builders){let buildpackRuntime=builders.map(getBuildpackRuntime).find(runtime=>runtime!==void 0);if(buildpackRuntime)throw buildpackDevUnsupportedError(buildpackRuntime);vercelConfig.builds=vercelConfig.builds||[],vercelConfig.builds.push(...builders),delete vercelConfig.functions}let serviceRewrites=detectedBuilders.serviceRewrites,serviceRewriteRoutes=serviceRewrites&&serviceRewrites.length>0?(0,import_routing_utils3.convertRewrites)(serviceRewrites):null,routes=[];routes.push(...redirectRoutes||[]),routes=(0,import_routing_utils3.appendRoutesToPhase)({routes,newRoutes:hostRewriteRoutes??null,phase:null}),routes.push(...(0,import_routing_utils3.appendRoutesToPhase)({routes:vercelConfig.routes,newRoutes:[...rewriteRoutes||[],...serviceRewriteRoutes||[]],phase:"filesystem"})),routes=(0,import_routing_utils3.appendRoutesToPhase)({routes,newRoutes:errorRoutes,phase:"error"}),routes.push(...defaultRoutes||[]),vercelConfig.routes=routes}else if(hasResolvedServices&&vercelConfig.proxy){let{entrypoint}=vercelConfig.proxy;await import_fs_extra.default.pathExists(join4(this.cwd,entrypoint))||(output_manager_default.error(`The proxy entrypoint \`${entrypoint}\` does not exist. Set \`proxy.entrypoint\` to an existing \`.js\` or \`.ts\` file.`),await this.exit()),vercelConfig.builds=vercelConfig.builds||[],vercelConfig.builds.push((0,import_fs_detectors2.getProxyBuilder)(vercelConfig.proxy,"latest",vercelConfig.functions))}if(this.sidecars===void 0){let services=(this.services??[]).filter(import_build_utils8.isExperimentalServiceV2);this.sidecars=await collectBuilderDevSidecars({builds:this.shouldUseServicesOrchestrator()?services.map(service=>service.builder):vercelConfig.builds??[],workPath:this.cwd,services})}let functionBuilds=[...vercelConfig.builds??[]];Array.isArray(vercelConfig.builds)&&((this.getDevCommand(nextProjectSettings)||hasServices)&&(vercelConfig.builds=vercelConfig.builds.filter(this.shouldBuildInDev)),vercelConfig.builds.sort(sortBuilders)),vercelConfig.routes=(vercelConfig.routes||[]).filter(route=>"has"in route?(this.vercelConfigWarning||(this.vercelConfigWarning=!0,output_manager_default.warn(`The "has" property in ${vercelConfig[import_client.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`)),!1):!0);let[runEnv,buildEnv]=await Promise.all([this.getLocalEnv(".env",vercelConfig.env),this.getLocalEnv(".env.build",vercelConfig.build?.env)]),allEnv={...buildEnv,...runEnv};if(Object.keys(allEnv).length===0){let envValues={...this.envValues};this.address.host&&(envValues.VERCEL_URL=this.address.host),allEnv={...envValues},runEnv={...envValues},buildEnv={...envValues}}runEnv.NODE_ENV??=process.env.NODE_ENV??"development",allEnv.NODE_ENV??=runEnv.NODE_ENV,runEnv.NOW_REGION="dev1",buildEnv.NOW_REGION="dev1",allEnv.NOW_REGION="dev1",allEnv.VERCEL_ENV="development",allEnv.VERCEL="1",this.projectId&&!process.env.VERCEL_PROJECT_ID&&("VERCEL_PROJECT_ID"in allEnv||(allEnv.VERCEL_PROJECT_ID=this.projectId),"VERCEL_PROJECT_ID"in runEnv||(runEnv.VERCEL_PROJECT_ID=this.projectId)),this.orgId&&!process.env.VERCEL_ORG_ID&&("VERCEL_ORG_ID"in allEnv||(allEnv.VERCEL_ORG_ID=this.orgId),"VERCEL_ORG_ID"in runEnv||(runEnv.VERCEL_ORG_ID=this.orgId)),nextProjectSettings?.autoExposeSystemEnvs&&(runEnv.VERCEL_REGION="dev1"),Object.assign(runEnv,this.getDevQueueEnv()),Object.assign(runEnv,this.getDevRuntimeCacheEnv(runEnv));let hasQueueFunctions=Object.values(functionConfig.functions??{}).some(fn2=>fn2.experimentalTriggers?.some(trigger=>trigger.type==="queue/v2beta"));if(this.queueBroker&&hasQueueFunctions&&hasResolvedServices)throw dev.DEV_QUEUE_FUNCTION_UNSUPPORTED({sourceFile:"functions",reason:"service-hosted function queue triggers are not supported locally yet"});let registry=await this.getFunctionDiscovery({scopes:(hasResolvedServices?[]:functionBuilds).map(build=>({build,target:vercelConfig.builds?.includes(build)?"builder":"framework"})),workPath:this.cwd,files:(sourceFiles??(await staticFiles(this.cwd,{})).map(f=>relative2(this.cwd,f))).sort(),config:functionConfig,env:{...process.env,...allEnv,...this.getDevQueueEnv(),...this.getDevRuntimeCacheEnv(allEnv)}}),subscriptions;try{subscriptions=deriveQueueSubscriptions(registry),this.queueBroker?.validateFunctionSubscriptions(subscriptions)}catch(err){throw this.functionDiscovery=void 0,err}let{unmatchedPatterns}=registry;if(await this.refreshBulkRedirects(vercelConfig.bulkRedirectsPath),generation!==this.configGeneration)return vercelConfig;let restartForFunctionEnv=!!(this.devCommandEnv&&[...registry.functions.values()].some(fn2=>fn2.invocation.type==="http")&&!(0,import_fast_deep_equal.default)(this.devCommandEnv,allEnv));if(this.projectSettings=nextProjectSettings,this.caseSensitive=hasNewRoutingProperties(vercelConfig),this.apiDir=(0,import_fs_detectors2.detectApiDirectory)(vercelConfig.builds||[]),this.apiExtensions=(0,import_fs_detectors2.detectApiExtensions)(vercelConfig.builds||[]),this.envConfigs={buildEnv,runEnv,allEnv},this.initialDevCommandStarted&&await this.runDevCommand(restartForFunctionEnv),generation!==this.configGeneration)return vercelConfig;this.queueBroker?.validateFunctionSubscriptions(subscriptions),this.functionRegistry=registry,this.functionConfig=vercelConfig,this.queueBroker?.setFunctionSubscriptions(subscriptions,outputPath=>this.resolveDevFunction(outputPath));for(let pattern of unmatchedPatterns)if(!this.unmatchedQueuePatterns.has(pattern)){let warning=dev.DEV_QUEUE_FUNCTION_UNMATCHED({pattern});output_manager_default.warn(`[${warning.name}] ${warning.message} ${warning.fix}`)}return this.unmatchedQueuePatterns=new Set(unmatchedPatterns),vercelConfig}async refreshBulkRedirects(bulkRedirectsPath){let configPath=bulkRedirectsPath??null;if(configPath===this.bulkRedirectsLastPath&&!this.bulkRedirectsDirty)return;if(this.bulkRedirectsLastPath=configPath,this.bulkRedirectsDirty=!1,this.bulkRedirectsResolvedPath=configPath?resolveBulkRedirectsPath(this.cwd,configPath):null,!configPath){this.bulkRedirects=null,this.bulkRedirectsSignature=null;return}let signature=await getBulkRedirectsSignature(this.cwd,configPath);if(signature!==this.bulkRedirectsSignature){this.bulkRedirectsSignature=signature;try{let result=await loadBulkRedirects(this.cwd,configPath);this.bulkRedirects=result.table;for(let warning of result.warnings)output_manager_default.warn(warning);let count=result.table.size;count>0&&output_manager_default.log(`Loaded ${count} bulk ${(0,import_pluralize2.default)("redirect",count)} from ${configPath}`)}catch(err){this.bulkRedirects=null,output_manager_default.warn(`Failed to load bulk redirects from "${configPath}": ${(0,import_error_utils.errorToString)(err)}`)}}}async readJsonFile(filePath){let rel,abs;isAbsolute3(filePath)?(rel=path4.relative(this.cwd,filePath),abs=filePath):(rel=filePath,abs=join4(this.cwd,filePath)),output_manager_default.debug(`Reading \`${rel}\` file`);try{let raw=await import_fs_extra.default.readFile(abs,"utf8"),parsed=(0,import_json_parse_better_errors.default)(raw);return parsed[import_client.fileNameSymbol]=rel,parsed}catch(err){if((0,import_error_utils.isError)(err))(0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"?output_manager_default.debug(`No \`${rel}\` file present`):err.name==="SyntaxError"&&output_manager_default.warn(`There is a syntax error in the \`${rel}\` file: ${err.message}`);else throw err}}async tryValidateOrExit(config,validate){let message2=validate(config);message2&&(output_manager_default.error(message2),await this.exit(1))}async validateVercelConfig(config){if(config.version===1){this.reportError(dev.DEV_UNSUPPORTED_CONFIG_VERSION()),await this.exit(1);return}let error2=validateConfig(config);error2&&(this.reportError(error2),await this.exit(1))}validateEnvConfig(type,env={},localEnv={}){let missing=Object.entries(env).filter(([name,value])=>typeof value=="string"&&value.startsWith("@")&&!hasProp(localEnv,name)).map(([name])=>name);if(missing.length>0)throw new MissingDotenvVarsError(type,missing);let merged={...env,...localEnv},hasInvalidName=!1;for(let key of Object.keys(merged))/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)||(output_manager_default.warn(`Ignoring ${type.split(".").slice(1).reverse().join(" ")} var ${JSON.stringify(key)} because name is invalid`),hasInvalidName=!0,delete merged[key]);return hasInvalidName&&output_manager_default.log("The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should not start with a digit"),merged}injectSystemValuesInDotenv(env){for(let name of Object.keys(env))name==="VERCEL_URL"?env.VERCEL_URL=this.address.host:name==="VERCEL_REGION"&&(env.VERCEL_REGION="dev1");return env}resolveBuildFiles(files){return Object.keys(files).filter(this.filter)}isWatcherIgnored(fsPath){let relativePath=relative2(this.cwd,fsPath);return relativePath===""?!1:!this.filter(relativePath)}start(...listenSpec){return this.startPromise||(this.startPromise=this._start(...listenSpec).catch(async err=>{throw await this.stop(),err})),this.startPromise}async _start(...listenSpec){if(!import_fs_extra.default.existsSync(this.cwd))throw dev.DEV_CWD_NOT_FOUND({cwd:this.cwd});if(!import_fs_extra.default.lstatSync(this.cwd).isDirectory())throw dev.DEV_CWD_NOT_DIRECTORY({cwd:this.cwd});let{ig}=await(0,import_client.getVercelIgnore)(this.cwd);this.filter=ig.createFilter();let address=null;for(;typeof address!="string";)try{address=(await(0,import_async_listen.listen)(this.server,...listenSpec)).toString()}catch(err){if((0,import_error_utils.isErrnoException)(err))output_manager_default.debug(`Got listen error: ${err.code}`),err.code==="EADDRINUSE"&&(typeof listenSpec[0]=="number"?(output_manager_default.note(`Requested port ${import_chalk2.default.yellow(String(listenSpec[0]))} is already in use`),listenSpec[0]++):(this.reportError(dev.DEV_LISTEN_ADDRESS_IN_USE({address:String(listenSpec[0])})),process.exit(1)));else throw err}this._address=new URL2(replaceLocalhost(address)),this.runtimeCache=new RuntimeCacheStore;let runtimeCacheListener=await listenOnDevResourcePort(this.runtimeCacheServer,{name:"Runtime Cache",flag:"--runtime-cache-port",defaultPort:DEV_RUNTIME_CACHE_DEFAULT_PORT,port:this.runtimeCachePort,reservedPorts:this.queuePort!==void 0&&this.queuePort!==0?[this.queuePort]:void 0});this.runtimeCacheOrigin=runtimeCacheListener.origin,runtimeCacheListener.defaultPort!==void 0&&output_manager_default.warn(`Runtime Cache default port ${runtimeCacheListener.defaultPort} is unavailable; listening on ${runtimeCacheListener.port} instead.
|
|
55
55
|
External clients configured for ${runtimeCacheListener.defaultPort} will not reach this dev server. Pin a port with --runtime-cache-port.`);let queueListener=await listenOnDevResourcePort(this.queueServer,{name:"Vercel Queues",flag:"--queue-port",defaultPort:DEV_QUEUE_DEFAULT_PORT,port:this.queuePort});this.queueOrigin=queueListener.origin,queueListener.defaultPort!==void 0&&output_manager_default.warn(`Vercel Queues default port ${queueListener.defaultPort} is unavailable; listening on ${queueListener.port} instead.
|
|
56
|
-
External clients configured for ${queueListener.defaultPort} will not reach this dev server. Pin a port with --queue-port.`),this.queueBroker=new QueueBroker([],name=>this.orchestrator?.getServiceOrigin(name)??this.sidecarOrchestrator?.getServiceOrigin(name)??null);let vercelConfig=await this.getVercelConfig(),devCommandPromise,startDevCommand=()=>{this.initialDevCommandStarted=!0,devCommandPromise=this.runDevCommand(),devCommandPromise.catch(()=>{})};if(this.shouldUseServicesOrchestrator()){let orchestratorServices=[...this.services||[],...(this.sidecars||[]).map(toOrchestratorService)];this.orchestrator=new ServicesOrchestrator({services:orchestratorServices,cwd:this.cwd,repoRoot:this.repoRoot,env:this.envConfigs.allEnv,proxyOrigin:this.address.origin,resourceEndpoints:this.resourceEndpoints,useImplicitEnvInjection:this.useImplicitServicesEnvInjection,onQueueSubscriptions:(serviceName,subscriptions)=>this.queueBroker?.updateServiceSubscriptions(serviceName,subscriptions)});let queueServices=orchestratorServices.filter(
|
|
57
|
-
`);let v1WebServices=(this.services||[]).filter(
|
|
56
|
+
External clients configured for ${queueListener.defaultPort} will not reach this dev server. Pin a port with --queue-port.`),this.queueBroker=new QueueBroker([],name=>this.orchestrator?.getServiceOrigin(name)??this.sidecarOrchestrator?.getServiceOrigin(name)??null);let vercelConfig=await this.getVercelConfig(),devCommandPromise,startDevCommand=()=>{this.initialDevCommandStarted=!0,devCommandPromise=this.runDevCommand(),devCommandPromise.catch(()=>{})};if(this.shouldUseServicesOrchestrator()){let orchestratorServices=[...this.services||[],...(this.sidecars||[]).map(toOrchestratorService)];this.orchestrator=new ServicesOrchestrator({services:orchestratorServices,cwd:this.cwd,repoRoot:this.repoRoot,env:this.envConfigs.allEnv,proxyOrigin:this.address.origin,resourceEndpoints:this.resourceEndpoints,useImplicitEnvInjection:this.useImplicitServicesEnvInjection,onQueueSubscriptions:(serviceName,subscriptions)=>this.queueBroker?.updateServiceSubscriptions(serviceName,subscriptions)});let queueServices=orchestratorServices.filter(import_build_utils8.isExperimentalService).filter(import_build_utils8.isQueueBackedService);this.queueBroker.registerServices(queueServices),devCommandPromise=this.orchestrator.startAll(),this.devProcessOrigin=void 0;let addressFormatted=this.address.toString();this.address.pathname==="/"&&this.address.protocol==="http:"&&(addressFormatted=addressFormatted.replace(/\/$/,"")),output_manager_default.print(`${import_chalk2.default.cyan(">")} Available at:
|
|
57
|
+
`);let v1WebServices=(this.services||[]).filter(import_build_utils8.isExperimentalService).filter(service=>service.type==="web");if(v1WebServices.length>0)for(let service of v1WebServices){let servicePath=service.routePrefix||"/",serviceUrl=`${addressFormatted}${servicePath==="/"?"":servicePath}`;output_manager_default.print(` ${import_chalk2.default.bold(service.name)}: ${link_default(serviceUrl)}
|
|
58
58
|
`)}else output_manager_default.print(` ${link_default(addressFormatted)}
|
|
59
|
-
`)}else this.hasSubscribers()||startDevCommand();let files=await staticFiles(this.cwd,{});this.files={};for(let fsPath of files){let path6=relative2(this.cwd,fsPath),{mode}=await import_fs_extra.default.stat(fsPath);this.files[path6]=new
|
|
59
|
+
`)}else this.hasSubscribers()||startDevCommand();let files=await staticFiles(this.cwd,{});this.files={};for(let fsPath of files){let path6=relative2(this.cwd,fsPath),{mode}=await import_fs_extra.default.stat(fsPath);this.files[path6]=new import_build_utils8.FileFsRef({mode,fsPath});let extensionless=this.getExtensionlessFile(path6);extensionless&&(this.files[extensionless]=new import_build_utils8.FileFsRef({mode,fsPath}))}await this.updateBuildMatches(vercelConfig,!0),await this.setupBuilderDevSidecars(),!this.shouldUseServicesOrchestrator()&&!devCommandPromise&&startDevCommand();let blockingBuilds=Array.from(this.buildMatches.values()).filter(needsBlockingBuild);if(blockingBuilds.length>0){output_manager_default.log(`Creating initial ${(0,import_pluralize2.default)("build",blockingBuilds.length)}`);for(let match of blockingBuilds)await executeBuild(vercelConfig,this,this.files,match,null,!0);output_manager_default.success("Build completed")}if(await import_fs_extra.default.mkdirp(this.devCacheDir),this.watcher=watch(this.cwd,{ignored:fsPath=>this.isWatcherIgnored(fsPath),ignoreInitial:!0,usePolling:!1,persistent:!0}),this.watcher.on("add",path6=>{this.enqueueFsEvent("add",path6)}),this.watcher.on("change",path6=>{this.enqueueFsEvent("change",path6)}),this.watcher.on("unlink",path6=>{this.enqueueFsEvent("unlink",path6)}),this.watcher.on("error",err=>{output_manager_default.error(`Watcher error: ${err}`)}),await(0,import_once.default)(this.watcher,"ready"),this.server.on("upgrade",async(req,socket,head)=>{if(await this.startPromise,this.orchestrator||this.sidecarOrchestrator){let pathname2=url3.parse(req.url||"/").pathname||"/",service=this.orchestrator?.getServiceForRoute(pathname2)||this.sidecarOrchestrator?.getServiceForRoute(pathname2);if(service){let target=`http://${service.host}:${service.port}`;output_manager_default.debug(`Detected "upgrade" event, proxying to service "${service.name}" at ${target}`),this.proxy.ws(req,socket,head,{target});return}if(this.orchestrator){let vercelConfig2=await this.getVercelConfig();if(vercelConfig2.experimentalServicesV2||vercelConfig2.services){let routeResult=await devRouter(req.url||"/",req.method,vercelConfig2.routes,this,vercelConfig2);if(isServiceDestination(routeResult.matched_route)){let{service:serviceName}=routeResult.matched_route.destination,origin=this.orchestrator.getServiceOrigin(serviceName);if(origin){output_manager_default.debug(`Detected "upgrade" event, proxying to service "${serviceName}" at ${origin}`),this.proxy.ws(req,socket,head,{target:origin});return}}}output_manager_default.debug(`Detected "upgrade" event, but no matching service found for ${pathname2}`),socket.destroy();return}}if(this.devProcessOrigin){let target=this.devProcessOrigin;output_manager_default.debug(`Detected "upgrade" event, proxying to ${target}`),this.proxy.ws(req,socket,head,{target});return}let pathname=url3.parse(req.url||"/").pathname||"/";for(let match of this.buildMatches.values()){let{builder}=match.builderWithPkg;if(typeof builder.startDevServer=="function")try{let result=await builder.startDevServer({files:this.files,entrypoint:match.entrypoint,workPath:this.cwd,config:match.config||{},repoRootPath:this.repoRoot,meta:{isDev:!0,...this.getDevResourceMeta(),requestPath:pathname,devCacheDir:this.devCacheDir,...this.getSidecarDevMeta(match),env:this.getBuilderDevEnv(match,this.envConfigs.runEnv),buildEnv:{...this.envConfigs.buildEnv}}});if(result){let{port,pid,shutdown}=result;this.shutdownCallbacks.set(pid,shutdown);let target=`http://127.0.0.1:${port}`;output_manager_default.debug(`Detected "upgrade" event, proxying to builder dev server at ${target}`),this.proxy.ws(req,socket,head,{target});return}}catch(err){output_manager_default.debug(`Failed to start dev server for upgrade: ${err}`)}}output_manager_default.debug(`Detected "upgrade" event, but no backend available for ${pathname}`),socket.destroy()}),await devCommandPromise,this.functionDispatchReady=!0,output_manager_default.log("Local resources:"),printAlignedLabel("Vercel Queues",link_default(this.queueOrigin)),printAlignedLabel("Runtime Cache",link_default(this.resourceEndpoints.runtimeCache.direct)),!this.orchestrator?.hasServices()){let addressFormatted=this.address.toString();this.address.pathname==="/"&&this.address.protocol==="http:"&&(addressFormatted=addressFormatted.replace(/\/$/,"")),output_manager_default.ready(`Available at ${link_default(addressFormatted)}`)}}async stop(_exitCode){if(this.stopping)return;this.stopping=!0;let{devProcess}=this,{debug}=output_manager_default,ops=[];for(let match of this.buildMatches.values())ops.push(shutdownBuilder(match));if(devProcess&&ops.push(treeKill(devProcess.pid)),this.orchestrator&&ops.push(this.orchestrator.stopAll()),this.sidecarOrchestrator&&ops.push(this.sidecarOrchestrator.stopAll()),this.queueBroker&&this.queueBroker.stop(),this.runtimeCache&&(this.runtimeCache.stop(),this.runtimeCache=void 0),ops.push(close(this.queueServer)),ops.push(close(this.runtimeCacheServer)),ops.push(close(this.server)),this.watcher){debug("Closing file watcher");let closePromise=this.watcher.close();closePromise&&ops.push(closePromise)}for(let pid of this.shutdownCallbacks.keys())ops.push(this.killBuilderDevServer(pid));await Promise.all(ops)}async killBuilderDevServer(pid){let{debug}=output_manager_default;debug(`Killing builder dev server with PID ${pid}`);let shutdownCb=this.shutdownCallbacks.get(pid);if(this.shutdownCallbacks.delete(pid),shutdownCb){debug(`Running shutdown callback for PID ${pid}`),await shutdownCb();return}try{await treeKill(pid),debug(`Killed builder dev server with PID ${pid}`)}catch(err){debug(`Failed to kill builder dev server with PID ${pid}: ${err}`)}}async send404(req,res,requestId){return this.sendError(req,res,requestId,"NOT_FOUND",404)}async sendError(req,res,requestId,errorCode,statusCode=500,headers={}){res.statusCode=statusCode,this.setResponseHeaders(res,requestId,headers);let http_status_description=generateHttpStatusDescription(statusCode),error_code=errorCode||http_status_description,errorMessage2=generateErrorMessage(statusCode,error_code),body,{accept="text/plain"}=req.headers;if(accept.includes("json"))res.setHeader("content-type","application/json"),body=`${JSON.stringify({error:{code:statusCode,message:errorMessage2.title}})}
|
|
60
60
|
`;else if(accept.includes("html")){res.setHeader("content-type","text/html; charset=utf-8");let view;statusCode===404?view=error_404({...errorMessage2,http_status_code:statusCode,http_status_description,error_code,request_id:requestId}):statusCode===502?view=error_502({...errorMessage2,http_status_code:statusCode,http_status_description,error_code,request_id:requestId}):view=error({http_status_code:statusCode,http_status_description,error_code,request_id:requestId}),body=error_base({http_status_code:statusCode,http_status_description,view})}else res.setHeader("content-type","text/plain; charset=utf-8"),body=`${errorMessage2.title}
|
|
61
61
|
|
|
62
62
|
${error_code}
|
|
63
63
|
`;res.end(body)}async sendRedirect(req,res,requestId,location,statusCode=302,responseTransforms){output_manager_default.debug(`Redirect ${statusCode}: ${location}`),res.statusCode=statusCode;let redirectHeaders={location};responseTransforms&&applyResponseTransforms(redirectHeaders,responseTransforms),this.setResponseHeaders(res,requestId,redirectHeaders);let body,{accept="text/plain"}=req.headers;accept.includes("json")?(res.setHeader("content-type","application/json"),body=`${JSON.stringify({redirect:location,status:String(statusCode)})}
|
|
64
64
|
`):accept.includes("html")?(res.setHeader("content-type","text/html; charset=utf-8"),body=redirect({location,statusCode})):(res.setHeader("content-type","text/plain; charset=utf-8"),body=`Redirecting...
|
|
65
|
-
`),res.end(body)}getRequestIp(req){return req.connection.remoteAddress||"127.0.0.1"}setResponseHeaders(res,requestId,headers={}){let allHeaders={"cache-control":"public, max-age=0, must-revalidate",...headers,server:"Vercel","x-vercel-id":requestId,"x-vercel-cache":"MISS"};for(let[name,value]of Object.entries(allHeaders))res.setHeader(name,value)}prepareTransforms(req,requestTransforms,responseTransforms){requestTransforms&&requestTransforms.length>0&&applyRequestTransforms(req,requestTransforms),responseTransforms&&hasResponseTransforms(responseTransforms)&&this.responseTransformsByReq.set(req,responseTransforms)}clearResponseTransforms(req){this.responseTransformsByReq.delete(req)}getProxyHeaders(req,requestId,xfwd){let ip=this.getRequestIp(req),{host}=req.headers,headers={connection:"close","x-real-ip":ip,"x-vercel-deployment-url":host,"x-vercel-forwarded-for":ip,"x-vercel-id":requestId};return xfwd&&(headers["x-forwarded-host"]=host,headers["x-forwarded-proto"]="http",headers["x-forwarded-for"]=ip),headers}getServiceRouteTable(serviceName){if(!this.serviceRoutesTable){this.serviceRoutesTable=new Map;for(let service of this.services||[]){if(!(0,import_build_utils7.isExperimentalServiceV2)(service))continue;let{routes,error:error2}=(0,import_routing_utils3.getTransformedRoutes)({routes:service.routes,rewrites:service.rewrites,redirects:service.redirects,headers:service.headers,cleanUrls:service.cleanUrls,trailingSlash:service.trailingSlash});error2?(output_manager_default.warn(`Invalid routes for service "${service.name}": ${error2.message}`),this.serviceRoutesTable.set(service.name,[])):this.serviceRoutesTable.set(service.name,routes||[])}}return this.serviceRoutesTable.get(serviceName)||[]}async delegateToService(req,res,requestId,matchedRoute,vercelConfig,requestTransforms,responseTransforms){let{debug}=output_manager_default,{service:serviceName,path:destPath}=matchedRoute.destination,origin=this.orchestrator?.getServiceOrigin(serviceName);if(!origin){output_manager_default.error(`Cannot route to service ${cmd(serviceName)}: it is not running.`),await this.sendError(req,res,requestId,"FUNCTION_INVOCATION_FAILED",502);return}let parsed=url3.parse(req.url||"/"),originalPathname=parsed.pathname||"/",lookupPath=originalPathname;if(typeof destPath=="string"&&matchedRoute.src){let keys=[],matcher=(0,import_pcre_to_regexp2.default)(`%${matchedRoute.src}%${this.isCaseSensitive()?"":"i"}`,keys),match=matcher.exec(originalPathname)||matcher.exec(originalPathname.substring(1));lookupPath=match?resolveRouteParameters(destPath,match,keys):destPath}let serviceRoutes=this.getServiceRouteTable(serviceName),proxyHeaders=this.getProxyHeaders(req,requestId,!1),requestTransformsToApply=[...requestTransforms??[]],responseTransformsToApply=responseTransforms,lookupUrl=`${lookupPath}${parsed.search||""}`,rewrittenUrl,externalDestUrl;if(serviceRoutes.length>0){let serviceResult=await devRouter(lookupUrl,req.method,serviceRoutes,this,vercelConfig);serviceResult.requestTransforms&&requestTransformsToApply.push(...serviceResult.requestTransforms),serviceResult.responseTransforms&&(responseTransformsToApply=serviceResult.responseTransforms);let location=serviceResult.headers?.location;if(location&&typeof serviceResult.status=="number"&&serviceResult.status>=300&&serviceResult.status<400){await this.sendRedirect(req,res,requestId,location,serviceResult.status,responseTransformsToApply);return}if(serviceResult.headers)for(let[name,value]of Object.entries(serviceResult.headers))name!=="location"&&res.setHeader(name,value);if(serviceResult.dest){let destParsed=url3.parse(serviceResult.dest),destQuery=parseQueryString(destParsed.search);Object.assign(destQuery,serviceResult.query),destParsed.search=formatQueryString(destQuery);let resolvedDest=url3.format(destParsed);serviceResult.isDestUrl?externalDestUrl=resolvedDest:resolvedDest!==lookupUrl&&(rewrittenUrl=resolvedDest)}}rewrittenUrl!==void 0&&(req.url=rewrittenUrl);for(let[name,value]of Object.entries(proxyHeaders))req.headers[name]=value;return this.prepareTransforms(req,requestTransformsToApply,responseTransformsToApply),this.setResponseHeaders(res,requestId),externalDestUrl?(debug(`Service "${serviceName}" rewrite to external URL: ${externalDestUrl}`),proxyPass(req,res,externalDestUrl,this,requestId)):(debug(`Delegating to service "${serviceName}": ${origin}${req.url}`),proxyPass(req,res,origin,this,requestId,!1))}async triggerBuild(match,requestPath,req,vercelConfig,previousBuildResult,filesChanged,filesRemoved){let buildKey=requestPath===null?match.entrypoint:`${match.entrypoint}-${requestPath}`,buildPromise=this.inProgressBuilds.get(buildKey);if(buildPromise){let msg=`De-duping build "${buildKey}"`;req&&(msg+=` for "${req.method} ${req.url}"`),output_manager_default.debug(msg)}else{if(previousBuildResult)for(let[name]of Object.entries(previousBuildResult.output))output_manager_default.debug(`Removing asset "${name}"`),delete match.buildOutput[name];let msg=`Building asset "${buildKey}"`;req&&(msg+=` for "${req.method} ${req.url}"`),output_manager_default.debug(msg),buildPromise=executeBuild(vercelConfig,this,this.files,match,requestPath,!1,filesChanged,filesRemoved),this.inProgressBuilds.set(buildKey,buildPromise)}try{await buildPromise}finally{output_manager_default.debug(`Built asset ${buildKey}`),this.inProgressBuilds.delete(buildKey)}}renderDirectoryListing(_req,res,requestPath,requestId){if(this.projectSettings?.directoryListing===!1)return!1;let prefix=requestPath;prefix.length>0&&!prefix.endsWith("/")&&(prefix+="/");let dirs=new Set,files=Array.from(this.buildMatches.keys()).filter(p=>{let base=basename(p);if(base==="now.json"||base==="vercel.json"||base==="vercel.toml"||base===".nowignore"||base===".vercelignore"||!p.startsWith(prefix))return!1;let rel=relative2(prefix,p);if(rel.includes("/")){let dir=rel.split("/")[0];if(dirs.has(dir))return!1;dirs.add(dir)}return!0}).map(p=>{let base=basename(p),ext="",type="file",href,rel=relative2(prefix,p);return rel.includes("/")?(type="folder",base=rel.split("/")[0],href=`/${prefix}${base}/`):(ext=extname2(p).substring(1),href=`/${prefix}${base}`),{type,relative:href,ext,title:href,base}});if(files.length===0)return!1;let directory=`/${prefix}`,directoryHtml=(0,import_directory.default)({files,paths:[{name:directory,url:requestPath}],directory});return this.setResponseHeaders(res,requestId),res.setHeader("Content-Type","text/html; charset=utf-8"),res.setHeader("Content-Length",String(Buffer.byteLength(directoryHtml,"utf8"))),res.end(directoryHtml),!0}async hasFilesystem(dest,vercelConfig){return!!await findBuildMatch(this.buildMatches,this.files,dest,this,vercelConfig,!0)}isCaseSensitive(){return this.caseSensitive}async runDevCommand(forceRestart=!1){if(this.shouldUseServicesOrchestrator())return;let{devCommand:devCommand2,cwd}=this;if(devCommand2===this.currentDevCommand&&!forceRestart||(this.currentDevCommand=devCommand2,this.devProcess&&(await treeKill(this.devProcess.pid),this.devProcess=void 0,this.devProcessOrigin=void 0),!devCommand2))return;output_manager_default.log(`Running Dev Command ${import_chalk2.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`);let port=await(0,import_get_port2.default)(),env=(0,import_build_utils7.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},process.env,this.envConfigs.allEnv,this.getDevQueueEnv(),{PORT:`${port}`});Object.assign(env,this.getDevRuntimeCacheEnv(env));let nodeBinPath=(0,import_build_utils7.getNodeBinPaths)({base:this.repoRoot,start:cwd}).join(path4.delimiter);env.PATH=`${nodeBinPath}${path4.delimiter}${env.PATH}`;let command=replaceDevCommandPort(devCommand2,port);injectNextDevWebSocketShimIfNeeded(env,command,this.projectSettings),output_manager_default.debug(`Starting dev command with parameters: ${JSON.stringify({cwd,command,port})}`),output_manager_default.debug(`Spawning dev command: ${command}`);let proxyPort=new RegExp(port.toString(),"g"),p=(0,import_build_utils7.spawnCommand)(command,{stdio:["inherit","pipe","pipe"],cwd,env});if(this.devProcess=p,!p.stdout||!p.stderr)throw dev.DEV_INTERNAL_MISSING_CHILD_STDIO();p.stderr.pipe(process.stderr),p.stdout.setEncoding("utf8"),p.stdout.on("data",data=>{process.stdout.write(data.replace(proxyPort,this.address.port))});let devProcessExited=new Promise((_,reject)=>{p.on("error",err=>{output_manager_default.debug(`Dev command errored: ${err}`),reject(err)}),p.on("exit",(code,signal)=>{output_manager_default.debug(`Dev command exited with "${signal||code}"`),reject(new DevCommandExitError(`Dev command \u201C${devCommand2}\u201D exited with code ${signal||code}`,code??1))})});p.on("close",(code,signal)=>{output_manager_default.debug(`Dev command closed with "${signal||code}"`),this.devProcessOrigin=void 0});let devProcessHost=await Promise.race([checkForPort(port,DEV_SERVER_PORT_BIND_TIMEOUT),devProcessExited]);this.devProcessOrigin=`http://${devProcessHost}:${port}`}};function isServiceDestination(route){return!!route&&!(0,import_routing_utils3.isHandler)(route)&&typeof route.destination=="object"&&route.destination!==null&&"service"in route.destination&&typeof route.destination.service=="string"}function proxyPass(req,res,dest,devServer,requestId,ignorePath=!0){devServer.proxy.web(req,res,{target:dest,ignorePath},error2=>{devServer.clearResponseTransforms(req),output_manager_default.debug(`Failed to complete request to ${req.url}: ${error2}`),res.headersSent||devServer.sendError(req,res,requestId,"FUNCTION_INVOCATION_FAILED")})}function serveStaticFile(req,res,cwd,opts){return(0,import_serve_handler.default)(req,res,{public:cwd,cleanUrls:!1,etag:!0,...opts})}function close(server){return new Promise((resolve3,reject)=>{server.close(err=>{err&&(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ERR_SERVER_NOT_RUNNING")?reject(err):resolve3()})})}function generateRequestId(podId,isInvoke=!1){return`dev1::${isInvoke?"dev1::":""}${[podId,Date.now(),randomBytes2(6).toString("hex")].join("-")}`}function hasProp(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}async function findBuildMatch(matches,files,requestPath,devServer,vercelConfig,isFilesystem=!1){requestPath=requestPath.replace(/^\//,"");let bestIndexMatch;for(let match of matches.values())if(await shouldServe(match,files,requestPath,devServer,vercelConfig,isFilesystem,!!bestIndexMatch))if(isIndex(match.src)){if(extname2(match.src)===".html")return match;bestIndexMatch=match}else return match;return bestIndexMatch||null}async function shouldServe(match,files,requestPath,devServer,vercelConfig,isFilesystem=!1,hasMatched=!1){let{src,config,builderWithPkg:{builder}}=match;if(config?.middleware===!0)return!1;let cleanSrc=src.endsWith(".html")?src.slice(0,-5):src,trimmedPath=requestPath.endsWith("/")?requestPath.slice(0,-1):requestPath;if(vercelConfig.cleanUrls&&vercelConfig.trailingSlash&&cleanSrc===trimmedPath)return!0;if(vercelConfig.cleanUrls&&!vercelConfig.trailingSlash&&cleanSrc===requestPath)return!0;if(!vercelConfig.cleanUrls&&vercelConfig.trailingSlash&&src===trimmedPath)return!0;if(typeof builder.shouldServe=="function"){if(await builder.shouldServe({entrypoint:src,files,config:config||{},requestPath,workPath:devServer.cwd,hasMatched}))return!0}else{if(findAsset(match,requestPath,vercelConfig))return!0;if(!isFilesystem&&await findMatchingRoute(match,requestPath,devServer,vercelConfig))return!0}return!1}async function findMatchingRoute(match,requestPath,devServer,vercelConfig){let reqUrl=`/${requestPath}`;for(let buildResult of match.buildResults.values()){if(!Array.isArray(buildResult.routes))continue;let route=await devRouter(reqUrl,void 0,buildResult.routes,devServer,vercelConfig);if(route.found)return route}}function findAsset(match,requestPath,vercelConfig){if(!match.buildOutput)return;let assetKey=requestPath.replace(/\/$/,""),asset=match.buildOutput[requestPath];if(vercelConfig.trailingSlash&&requestPath.endsWith("/")&&(asset=match.buildOutput[requestPath.slice(0,-1)]),!asset){for(let[name,a]of Object.entries(match.buildOutput))if(isIndex(name)&&dirnameWithoutDot(name)===assetKey){asset=a,assetKey=name;break}}if(asset)return{asset,assetKey}}function dirnameWithoutDot(path6){let dir=dirname3(path6);return dir==="."&&(dir=""),dir}function isIndex(path6){let ext=extname2(path6);return basename(path6,ext)==="index"}function minimatches(files,pattern){return files.some(file=>file===pattern||(0,import_minimatch2.default)(file,pattern,{dot:!0}))}function fileChanged(name,changed,removed){changed.add(name),removed.delete(name)}function fileRemoved(name,files,changed,removed){delete files[name],changed.delete(name),removed.add(name)}function needsBlockingBuild(buildMatch){let{builder}=buildMatch.builderWithPkg;return typeof builder.shouldServe!="function"}function hasNewRoutingProperties(vercelConfig){return typeof vercelConfig.cleanUrls!==void 0||typeof vercelConfig.headers!==void 0||typeof vercelConfig.redirects!==void 0||typeof vercelConfig.rewrites!==void 0||typeof vercelConfig.trailingSlash!==void 0}function buildMatchEquals(a,b){return!(!a||!b||a.src!==b.src||a.use!==b.use||!(0,import_fast_deep_equal.default)(a.config||{},b.config||{}))}var import_ms7=__toESM(require_ms(),1);import{setTimeout as setTimeout2}from"node:timers/promises";import{decodeJwt}from"jose";import{performance}from"perf_hooks";var REFRESH_BEFORE_EXPIRY_MILLIS=getMs((0,import_ms7.default)("15m"),process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS),THROTTLE_MILLIS=getMs((0,import_ms7.default)("1m"),process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS);function getMs(defaultValue,overrideValue){if(overrideValue){let result=(0,import_ms7.default)(overrideValue);if(Number.isFinite(result)&&result>0)return result}return defaultValue}async function*refreshOidcToken(signal,client,projectId,envValues,source,throttleMillis){throttleMillis??=THROTTLE_MILLIS;let lastPulledEnvAt=clock(),refreshCount=0;for(;!signal.aborted;){let oidcToken=envValues[VERCEL_OIDC_TOKEN];if(!oidcToken){output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is absent; disabling refreshes`);return}let now=clock(),expiresAfterMillis;try{let{exp}=decodeJwt(oidcToken);expiresAfterMillis=exp!==void 0?exp*1e3-now:void 0}catch{}if(expiresAfterMillis===void 0||!Number.isFinite(expiresAfterMillis)){output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is invalid; disabling refreshes`);return}refreshCount++>0&&expiresAfterMillis>0&&(yield oidcToken);let refreshAfterMillis=Math.max(0,expiresAfterMillis-REFRESH_BEFORE_EXPIRY_MILLIS);now+refreshAfterMillis-lastPulledEnvAt<throttleMillis&&(refreshAfterMillis=throttleMillis);let expiresAfterSecs=Math.abs(Math.round(millisToSecs(expiresAfterMillis))),refreshAfterSecs=Math.round(millisToSecs(refreshAfterMillis));expiresAfterMillis<0?output_manager_default.debug(`${VERCEL_OIDC_TOKEN} expired ${expiresAfterSecs}s ago; refreshing in ${refreshAfterSecs}s`):output_manager_default.debug(`${VERCEL_OIDC_TOKEN} expires in ${expiresAfterSecs}s; refreshing in ${refreshAfterSecs}s`),await setTimeout2(refreshAfterMillis,void 0,{signal});let envValuesOrNull=await pullEnvValuesUntilSuccessful(signal,client,projectId,source,throttleMillis);if(!envValuesOrNull)return;envValues=envValuesOrNull,lastPulledEnvAt=clock()}}async function pullEnvValuesUntilSuccessful(signal,client,projectId,source,millis){for(;!signal.aborted;)try{return(await pullEnvRecords(client,projectId,source)).env}catch{output_manager_default.debug(`Failed to pull environment; trying again in ${Math.round(millisToSecs(millis))}s`),await setTimeout2(millis,void 0,{signal})}return null}function clock(){return performance.timeOrigin+performance.now()}function millisToSecs(millis){return millis/1e3}import{join as join5}from"path";import{mkdir,open,unlink,readFile as readFile2}from"fs/promises";import{unlinkSync as unlinkSync2,constants}from"fs";var DEV_LOCK_FILE="dev.lock";function isProcessRunning(pid){try{return process.kill(pid,0),!0}catch{return!1}}async function tryCreateLockFile(lockPath,content){try{let fd=await open(lockPath,constants.O_CREAT|constants.O_EXCL|constants.O_WRONLY);return await fd.writeFile(content,"utf8"),await fd.close(),!0}catch(err){if(err.code==="EEXIST")return!1;throw err}}async function tryReadLockFile(lockPath){try{let content=await readFile2(lockPath,"utf8");return JSON.parse(content)}catch{return null}}async function acquireDevLock(projectRoot,port){let vercelDir=join5(projectRoot,VERCEL_DIR),lockPath=join5(vercelDir,DEV_LOCK_FILE);await mkdir(vercelDir,{recursive:!0});let lockData={pid:process.pid,port,startedAt:Date.now(),cwd:projectRoot},lockContent=JSON.stringify(lockData);try{if(await tryCreateLockFile(lockPath,lockContent))return{acquired:!0}}catch(err){output_manager_default.debug(`Failed to create lock file: ${err}`)}let existingLock=await tryReadLockFile(lockPath);if(existingLock){if(isProcessRunning(existingLock.pid))return{acquired:!1,existingLock};output_manager_default.debug(`Removing stale lock from PID ${existingLock.pid}`);try{await unlink(lockPath)}catch(err){output_manager_default.debug(`Failed to remove stale lock file: ${err}`)}try{if(await tryCreateLockFile(lockPath,lockContent))return{acquired:!0}}catch(err){output_manager_default.debug(`Failed to create lock after removing stale: ${err}`)}let newLock=await tryReadLockFile(lockPath);if(newLock)return{acquired:!1,existingLock:newLock}}else output_manager_default.debug("Lock file exists but cannot be read");return{acquired:!1,existingLock:null,reason:`The lock file at \`${lockPath}\` could not be read. If no other \`vercel dev\` is running, remove it and retry.`}}function releaseDevLock(projectRoot){let lockPath=join5(projectRoot,VERCEL_DIR,DEV_LOCK_FILE);try{unlinkSync2(lockPath)}catch(err){output_manager_default.debug(`Failed to release lock: ${err}`)}}function parseResourcePort(value,flag){if(value===void 0)return;if(!/^\d+$/.test(value))throw new Error(`${flag} must be an integer between 0 and 65535`);let port=Number(value);if(!Number.isSafeInteger(port)||port>65535)throw new Error(`${flag} must be an integer between 0 and 65535`);return port}async function dev2(client,opts,args2,telemetry,localConfig){let[dir="."]=args2,cwd=resolve2(dir),localConfigCwd=cwd,listen2=parseListen(opts["--listen"]||"3000"),queuePort=parseResourcePort(opts["--queue-port"],"--queue-port"),runtimeCachePort=parseResourcePort(opts["--runtime-cache-port"],"--runtime-cache-port");if(queuePort!==void 0&&queuePort!==0&&queuePort===runtimeCachePort)throw new Error("--queue-port and --runtime-cache-port must use different ports");cwd=await resolveProjectCwd(cwd);let projectNameOrId=opts["--project"],reportError=createErrorReporter(code=>telemetry.trackError(code)),link=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client)});if(link.status==="not_linked"&&!process.env.__VERCEL_SKIP_DEV_CMD)if(opts["--local"])output_manager_default.warn(`Running dev server in local mode without a project setup:
|
|
65
|
+
`),res.end(body)}getRequestIp(req){return req.connection.remoteAddress||"127.0.0.1"}setResponseHeaders(res,requestId,headers={}){let allHeaders={"cache-control":"public, max-age=0, must-revalidate",...headers,server:"Vercel","x-vercel-id":requestId,"x-vercel-cache":"MISS"};for(let[name,value]of Object.entries(allHeaders))res.setHeader(name,value)}prepareTransforms(req,requestTransforms,responseTransforms){requestTransforms&&requestTransforms.length>0&&applyRequestTransforms(req,requestTransforms),responseTransforms&&hasResponseTransforms(responseTransforms)&&this.responseTransformsByReq.set(req,responseTransforms)}clearResponseTransforms(req){this.responseTransformsByReq.delete(req)}getProxyHeaders(req,requestId,xfwd){let ip=this.getRequestIp(req),{host}=req.headers,headers={connection:"close","x-real-ip":ip,"x-vercel-deployment-url":host,"x-vercel-forwarded-for":ip,"x-vercel-id":requestId};return xfwd&&(headers["x-forwarded-host"]=host,headers["x-forwarded-proto"]="http",headers["x-forwarded-for"]=ip),headers}getServiceRouteTable(serviceName){if(!this.serviceRoutesTable){this.serviceRoutesTable=new Map;for(let service of this.services||[]){if(!(0,import_build_utils8.isExperimentalServiceV2)(service))continue;let{routes,error:error2}=(0,import_routing_utils3.getTransformedRoutes)({routes:service.routes,rewrites:service.rewrites,redirects:service.redirects,headers:service.headers,cleanUrls:service.cleanUrls,trailingSlash:service.trailingSlash});error2?(output_manager_default.warn(`Invalid routes for service "${service.name}": ${error2.message}`),this.serviceRoutesTable.set(service.name,[])):this.serviceRoutesTable.set(service.name,routes||[])}}return this.serviceRoutesTable.get(serviceName)||[]}async delegateToService(req,res,requestId,matchedRoute,vercelConfig,requestTransforms,responseTransforms){let{debug}=output_manager_default,{service:serviceName,path:destPath}=matchedRoute.destination,origin=this.orchestrator?.getServiceOrigin(serviceName);if(!origin){output_manager_default.error(`Cannot route to service ${cmd(serviceName)}: it is not running.`),await this.sendError(req,res,requestId,"FUNCTION_INVOCATION_FAILED",502);return}let parsed=url3.parse(req.url||"/"),originalPathname=parsed.pathname||"/",lookupPath=originalPathname;if(typeof destPath=="string"&&matchedRoute.src){let keys=[],matcher=(0,import_pcre_to_regexp2.default)(`%${matchedRoute.src}%${this.isCaseSensitive()?"":"i"}`,keys),match=matcher.exec(originalPathname)||matcher.exec(originalPathname.substring(1));lookupPath=match?resolveRouteParameters(destPath,match,keys):destPath}let serviceRoutes=this.getServiceRouteTable(serviceName),proxyHeaders=this.getProxyHeaders(req,requestId,!1),requestTransformsToApply=[...requestTransforms??[]],responseTransformsToApply=responseTransforms,lookupUrl=`${lookupPath}${parsed.search||""}`,rewrittenUrl,externalDestUrl;if(serviceRoutes.length>0){let serviceResult=await devRouter(lookupUrl,req.method,serviceRoutes,this,vercelConfig);serviceResult.requestTransforms&&requestTransformsToApply.push(...serviceResult.requestTransforms),serviceResult.responseTransforms&&(responseTransformsToApply=serviceResult.responseTransforms);let location=serviceResult.headers?.location;if(location&&typeof serviceResult.status=="number"&&serviceResult.status>=300&&serviceResult.status<400){await this.sendRedirect(req,res,requestId,location,serviceResult.status,responseTransformsToApply);return}if(serviceResult.headers)for(let[name,value]of Object.entries(serviceResult.headers))name!=="location"&&res.setHeader(name,value);if(serviceResult.dest){let destParsed=url3.parse(serviceResult.dest),destQuery=parseQueryString(destParsed.search);Object.assign(destQuery,serviceResult.query),destParsed.search=formatQueryString(destQuery);let resolvedDest=url3.format(destParsed);serviceResult.isDestUrl?externalDestUrl=resolvedDest:resolvedDest!==lookupUrl&&(rewrittenUrl=resolvedDest)}}rewrittenUrl!==void 0&&(req.url=rewrittenUrl);for(let[name,value]of Object.entries(proxyHeaders))req.headers[name]=value;return this.prepareTransforms(req,requestTransformsToApply,responseTransformsToApply),this.setResponseHeaders(res,requestId),externalDestUrl?(debug(`Service "${serviceName}" rewrite to external URL: ${externalDestUrl}`),proxyPass(req,res,externalDestUrl,this,requestId)):(debug(`Delegating to service "${serviceName}": ${origin}${req.url}`),proxyPass(req,res,origin,this,requestId,!1))}async triggerBuild(match,requestPath,req,vercelConfig,previousBuildResult,filesChanged,filesRemoved){let functionBuild=this.canonicalizeFunctionBuild(match),cacheKey=functionBuild?null:requestPath,builds=this.inProgressBuilds.get(match)??new Map;if(functionBuild&&[...builds.keys()].some(key=>key!==null)){let pending=[...new Set(builds.values())],promise=pending.length===1?pending[0]:Promise.all(pending).then(()=>{});builds.clear(),builds.set(null,promise)}let buildKey=requestPath===null?match.entrypoint:`${match.entrypoint}-${requestPath}`,buildPromise=builds.get(cacheKey);if(buildPromise){let msg=`De-duping build "${buildKey}"`;req&&(msg+=` for "${req.method} ${req.url}"`),output_manager_default.debug(msg)}else{if(previousBuildResult)for(let[name]of Object.entries(previousBuildResult.output))output_manager_default.debug(`Removing asset "${name}"`),delete match.buildOutput[name];let msg=`Building asset "${buildKey}"`;req&&(msg+=` for "${req.method} ${req.url}"`),output_manager_default.debug(msg),buildPromise=executeBuild(vercelConfig,this,this.files,match,requestPath,!1,filesChanged,filesRemoved),builds.set(cacheKey,buildPromise),this.inProgressBuilds.set(match,builds)}try{await buildPromise,this.canonicalizeFunctionBuild(match)}finally{output_manager_default.debug(`Built asset ${buildKey}`),builds.get(cacheKey)===buildPromise&&builds.delete(cacheKey),builds.size===0&&this.inProgressBuilds.get(match)===builds&&this.inProgressBuilds.delete(match)}}renderDirectoryListing(_req,res,requestPath,requestId){if(this.projectSettings?.directoryListing===!1)return!1;let prefix=requestPath;prefix.length>0&&!prefix.endsWith("/")&&(prefix+="/");let dirs=new Set,files=Array.from(this.buildMatches.keys()).filter(p=>{let base=basename(p);if(base==="now.json"||base==="vercel.json"||base==="vercel.toml"||base===".nowignore"||base===".vercelignore"||!p.startsWith(prefix))return!1;let rel=relative2(prefix,p);if(rel.includes("/")){let dir=rel.split("/")[0];if(dirs.has(dir))return!1;dirs.add(dir)}return!0}).map(p=>{let base=basename(p),ext="",type="file",href,rel=relative2(prefix,p);return rel.includes("/")?(type="folder",base=rel.split("/")[0],href=`/${prefix}${base}/`):(ext=extname2(p).substring(1),href=`/${prefix}${base}`),{type,relative:href,ext,title:href,base}});if(files.length===0)return!1;let directory=`/${prefix}`,directoryHtml=(0,import_directory.default)({files,paths:[{name:directory,url:requestPath}],directory});return this.setResponseHeaders(res,requestId),res.setHeader("Content-Type","text/html; charset=utf-8"),res.setHeader("Content-Length",String(Buffer.byteLength(directoryHtml,"utf8"))),res.end(directoryHtml),!0}async hasFilesystem(dest,vercelConfig){return!!await findBuildMatch(this.buildMatches,this.files,dest,this,vercelConfig,!0)}isCaseSensitive(){return this.caseSensitive}async runDevCommand(forceRestart=!1){if(this.shouldUseServicesOrchestrator())return;let{devCommand:devCommand2,cwd}=this;if(devCommand2===this.currentDevCommand&&!forceRestart||(this.currentDevCommand=devCommand2,this.devProcess&&(await treeKill(this.devProcess.pid),this.devProcess=void 0,this.devProcessOrigin=void 0),!devCommand2))return;output_manager_default.log(`Running Dev Command ${import_chalk2.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`);let port=await(0,import_get_port2.default)(),env=(0,import_build_utils8.cloneEnv)({FORCE_COLOR:process.stdout.isTTY?"1":"0",BROWSER:"none"},process.env,this.envConfigs.allEnv,this.getDevQueueEnv(),{PORT:`${port}`,VERCEL_CLI_VERSION:pkg_default.version});Object.assign(env,this.getDevRuntimeCacheEnv(env));let nodeBinPath=(0,import_build_utils8.getNodeBinPaths)({base:this.repoRoot,start:cwd}).join(path4.delimiter);env.PATH=`${nodeBinPath}${path4.delimiter}${env.PATH}`;let command=replaceDevCommandPort(devCommand2,port);injectNextDevWebSocketShimIfNeeded(env,command,this.projectSettings),output_manager_default.debug(`Starting dev command with parameters: ${JSON.stringify({cwd,command,port})}`),output_manager_default.debug(`Spawning dev command: ${command}`);let proxyPort=new RegExp(port.toString(),"g"),p=(0,import_build_utils8.spawnCommand)(command,{stdio:["inherit","pipe","pipe"],cwd,env});if(this.devProcess=p,this.devCommandEnv={...this.envConfigs.allEnv},!p.stdout||!p.stderr)throw dev.DEV_INTERNAL_MISSING_CHILD_STDIO();p.stderr.pipe(process.stderr),p.stdout.setEncoding("utf8"),p.stdout.on("data",data=>{process.stdout.write(data.replace(proxyPort,this.address.port))});let devProcessExited=new Promise((_,reject)=>{p.on("error",err=>{output_manager_default.debug(`Dev command errored: ${err}`),reject(err)}),p.on("exit",(code,signal)=>{output_manager_default.debug(`Dev command exited with "${signal||code}"`),reject(new DevCommandExitError(`Dev command \u201C${devCommand2}\u201D exited with code ${signal||code}`,code??1))})});p.on("close",(code,signal)=>{output_manager_default.debug(`Dev command closed with "${signal||code}"`),this.devProcessOrigin=void 0});let devProcessHost=await Promise.race([checkForPort(port,DEV_SERVER_PORT_BIND_TIMEOUT),devProcessExited]);this.devProcessOrigin=`http://${devProcessHost}:${port}`}};function isServiceDestination(route){return!!route&&!(0,import_routing_utils3.isHandler)(route)&&typeof route.destination=="object"&&route.destination!==null&&"service"in route.destination&&typeof route.destination.service=="string"}function proxyPass(req,res,dest,devServer,requestId,ignorePath=!0){devServer.proxy.web(req,res,{target:dest,ignorePath},error2=>{devServer.clearResponseTransforms(req),output_manager_default.debug(`Failed to complete request to ${req.url}: ${error2}`),res.headersSent||devServer.sendError(req,res,requestId,"FUNCTION_INVOCATION_FAILED")})}function serveStaticFile(req,res,cwd,opts){return(0,import_serve_handler.default)(req,res,{public:cwd,cleanUrls:!1,etag:!0,...opts})}function close(server){return new Promise((resolve3,reject)=>{server.close(err=>{err&&(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ERR_SERVER_NOT_RUNNING")?reject(err):resolve3()})})}function generateRequestId(podId,isInvoke=!1){return`dev1::${isInvoke?"dev1::":""}${[podId,Date.now(),randomBytes2(6).toString("hex")].join("-")}`}function hasProp(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}async function findBuildMatch(matches,files,requestPath,devServer,vercelConfig,isFilesystem=!1){requestPath=requestPath.replace(/^\//,"");let bestIndexMatch;for(let match of matches.values())if(await shouldServe(match,files,requestPath,devServer,vercelConfig,isFilesystem,!!bestIndexMatch))if(isIndex(match.src)){if(extname2(match.src)===".html")return match;bestIndexMatch=match}else return match;return bestIndexMatch||null}async function shouldServe(match,files,requestPath,devServer,vercelConfig,isFilesystem=!1,hasMatched=!1){let{src,config,builderWithPkg:{builder}}=match;if(config?.middleware===!0)return!1;let cleanSrc=src.endsWith(".html")?src.slice(0,-5):src,trimmedPath=requestPath.endsWith("/")?requestPath.slice(0,-1):requestPath;if(vercelConfig.cleanUrls&&vercelConfig.trailingSlash&&cleanSrc===trimmedPath)return!0;if(vercelConfig.cleanUrls&&!vercelConfig.trailingSlash&&cleanSrc===requestPath)return!0;if(!vercelConfig.cleanUrls&&vercelConfig.trailingSlash&&src===trimmedPath)return!0;if(typeof builder.shouldServe=="function"){if(await builder.shouldServe({entrypoint:src,files,config:config||{},requestPath,workPath:devServer.cwd,hasMatched}))return!0}else{if(findAsset(match,requestPath,vercelConfig))return!0;if(!isFilesystem&&await findMatchingRoute(match,requestPath,devServer,vercelConfig))return!0}return!1}async function findMatchingRoute(match,requestPath,devServer,vercelConfig){let reqUrl=`/${requestPath}`;for(let buildResult of match.buildResults.values()){if(!Array.isArray(buildResult.routes))continue;let route=await devRouter(reqUrl,void 0,buildResult.routes,devServer,vercelConfig);if(route.found)return route}}function findAsset(match,requestPath,vercelConfig){if(!match.buildOutput)return;let assetKey=requestPath.replace(/\/$/,""),asset=match.buildOutput[requestPath];if(vercelConfig.trailingSlash&&requestPath.endsWith("/")&&(asset=match.buildOutput[requestPath.slice(0,-1)]),!asset){for(let[name,a]of Object.entries(match.buildOutput))if(isIndex(name)&&dirnameWithoutDot(name)===assetKey){asset=a,assetKey=name;break}}if(asset)return{asset,assetKey}}function dirnameWithoutDot(path6){let dir=dirname3(path6);return dir==="."&&(dir=""),dir}function isIndex(path6){let ext=extname2(path6);return basename(path6,ext)==="index"}function minimatches(files,pattern){return files.some(file=>file===pattern||(0,import_minimatch3.default)(file,pattern,{dot:!0}))}function fileChanged(name,changed,removed){changed.add(name),removed.delete(name)}function fileRemoved(name,files,changed,removed){delete files[name],changed.delete(name),removed.add(name)}function needsBlockingBuild(buildMatch){let{builder}=buildMatch.builderWithPkg;return typeof builder.shouldServe!="function"}function hasNewRoutingProperties(vercelConfig){return typeof vercelConfig.cleanUrls!==void 0||typeof vercelConfig.headers!==void 0||typeof vercelConfig.redirects!==void 0||typeof vercelConfig.rewrites!==void 0||typeof vercelConfig.trailingSlash!==void 0}function buildMatchEquals(a,b){return!(!a||!b||a.src!==b.src||a.use!==b.use||!(0,import_fast_deep_equal.default)(a.config||{},b.config||{}))}var import_ms7=__toESM(require_ms(),1);import{setTimeout as setTimeout2}from"node:timers/promises";import{decodeJwt}from"jose";import{performance}from"perf_hooks";var REFRESH_BEFORE_EXPIRY_MILLIS=getMs((0,import_ms7.default)("15m"),process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS),THROTTLE_MILLIS=getMs((0,import_ms7.default)("1m"),process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS);function getMs(defaultValue,overrideValue){if(overrideValue){let result=(0,import_ms7.default)(overrideValue);if(Number.isFinite(result)&&result>0)return result}return defaultValue}async function*refreshOidcToken(signal,client,projectId,envValues,source,throttleMillis){throttleMillis??=THROTTLE_MILLIS;let lastPulledEnvAt=clock(),refreshCount=0;for(;!signal.aborted;){let oidcToken=envValues[VERCEL_OIDC_TOKEN];if(!oidcToken){output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is absent; disabling refreshes`);return}let now=clock(),expiresAfterMillis;try{let{exp}=decodeJwt(oidcToken);expiresAfterMillis=exp!==void 0?exp*1e3-now:void 0}catch{}if(expiresAfterMillis===void 0||!Number.isFinite(expiresAfterMillis)){output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is invalid; disabling refreshes`);return}refreshCount++>0&&expiresAfterMillis>0&&(yield oidcToken);let refreshAfterMillis=Math.max(0,expiresAfterMillis-REFRESH_BEFORE_EXPIRY_MILLIS);now+refreshAfterMillis-lastPulledEnvAt<throttleMillis&&(refreshAfterMillis=throttleMillis);let expiresAfterSecs=Math.abs(Math.round(millisToSecs(expiresAfterMillis))),refreshAfterSecs=Math.round(millisToSecs(refreshAfterMillis));expiresAfterMillis<0?output_manager_default.debug(`${VERCEL_OIDC_TOKEN} expired ${expiresAfterSecs}s ago; refreshing in ${refreshAfterSecs}s`):output_manager_default.debug(`${VERCEL_OIDC_TOKEN} expires in ${expiresAfterSecs}s; refreshing in ${refreshAfterSecs}s`),await setTimeout2(refreshAfterMillis,void 0,{signal});let envValuesOrNull=await pullEnvValuesUntilSuccessful(signal,client,projectId,source,throttleMillis);if(!envValuesOrNull)return;envValues=envValuesOrNull,lastPulledEnvAt=clock()}}async function pullEnvValuesUntilSuccessful(signal,client,projectId,source,millis){for(;!signal.aborted;)try{return(await pullEnvRecords(client,projectId,source)).env}catch{output_manager_default.debug(`Failed to pull environment; trying again in ${Math.round(millisToSecs(millis))}s`),await setTimeout2(millis,void 0,{signal})}return null}function clock(){return performance.timeOrigin+performance.now()}function millisToSecs(millis){return millis/1e3}import{join as join5}from"path";import{mkdir,open,unlink,readFile as readFile2}from"fs/promises";import{unlinkSync as unlinkSync2,constants}from"fs";var DEV_LOCK_FILE="dev.lock";function isProcessRunning(pid){try{return process.kill(pid,0),!0}catch{return!1}}async function tryCreateLockFile(lockPath,content){try{let fd=await open(lockPath,constants.O_CREAT|constants.O_EXCL|constants.O_WRONLY);return await fd.writeFile(content,"utf8"),await fd.close(),!0}catch(err){if(err.code==="EEXIST")return!1;throw err}}async function tryReadLockFile(lockPath){try{let content=await readFile2(lockPath,"utf8");return JSON.parse(content)}catch{return null}}async function acquireDevLock(projectRoot,port){let vercelDir=join5(projectRoot,VERCEL_DIR),lockPath=join5(vercelDir,DEV_LOCK_FILE);await mkdir(vercelDir,{recursive:!0});let lockData={pid:process.pid,port,startedAt:Date.now(),cwd:projectRoot},lockContent=JSON.stringify(lockData);try{if(await tryCreateLockFile(lockPath,lockContent))return{acquired:!0}}catch(err){output_manager_default.debug(`Failed to create lock file: ${err}`)}let existingLock=await tryReadLockFile(lockPath);if(existingLock){if(isProcessRunning(existingLock.pid))return{acquired:!1,existingLock};output_manager_default.debug(`Removing stale lock from PID ${existingLock.pid}`);try{await unlink(lockPath)}catch(err){output_manager_default.debug(`Failed to remove stale lock file: ${err}`)}try{if(await tryCreateLockFile(lockPath,lockContent))return{acquired:!0}}catch(err){output_manager_default.debug(`Failed to create lock after removing stale: ${err}`)}let newLock=await tryReadLockFile(lockPath);if(newLock)return{acquired:!1,existingLock:newLock}}else output_manager_default.debug("Lock file exists but cannot be read");return{acquired:!1,existingLock:null,reason:`The lock file at \`${lockPath}\` could not be read. If no other \`vercel dev\` is running, remove it and retry.`}}function releaseDevLock(projectRoot){let lockPath=join5(projectRoot,VERCEL_DIR,DEV_LOCK_FILE);try{unlinkSync2(lockPath)}catch(err){output_manager_default.debug(`Failed to release lock: ${err}`)}}function parseResourcePort(value,flag){if(value===void 0)return;if(!/^\d+$/.test(value))throw new Error(`${flag} must be an integer between 0 and 65535`);let port=Number(value);if(!Number.isSafeInteger(port)||port>65535)throw new Error(`${flag} must be an integer between 0 and 65535`);return port}async function dev2(client,opts,args2,telemetry,localConfig){let[dir="."]=args2,cwd=resolve2(dir),localConfigCwd=cwd,listen2=parseListen(opts["--listen"]||"3000"),queuePort=parseResourcePort(opts["--queue-port"],"--queue-port"),runtimeCachePort=parseResourcePort(opts["--runtime-cache-port"],"--runtime-cache-port");if(queuePort!==void 0&&queuePort!==0&&queuePort===runtimeCachePort)throw new Error("--queue-port and --runtime-cache-port must use different ports");cwd=await resolveProjectCwd(cwd);let projectNameOrId=opts["--project"],reportError=createErrorReporter(code=>telemetry.trackError(code)),link=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client)});if(link.status==="not_linked"&&!process.env.__VERCEL_SKIP_DEV_CMD)if(opts["--local"])output_manager_default.warn(`Running dev server in local mode without a project setup:
|
|
66
66
|
- Environment variables will not be pulled from Vercel
|
|
67
67
|
- Project settings are defined by local configuration
|
|
68
68
|
|