needle-cloud 2.3.0-alpha.5 → 2.3.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.esm.js +1 -1
- package/package.json +7 -7
package/dist/cli.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"node-fetch";import{File as n}from"@web-std/file";import t,{randomUUID as o}from"node:crypto";import i from"@caporal/core";import a,{existsSync as s,statSync as r,readFileSync as c,readdirSync as l,appendFileSync as p,mkdirSync as u,writeFileSync as d,lstatSync as m,readFile as f}from"fs";import h from"open";import g,{randomUUID as v}from"crypto";import x from"buffer";import b,{resolve as y,join as w,relative as _,sep as k,isAbsolute as j,dirname as S}from"path";import $ from"ora";import{existsSync as T,mkdirSync as E,renameSync as C,realpathSync as O,statSync as R,rename as z,readFileSync as N,writeFileSync as A,watch as L}from"node:fs";import{writeFile as F}from"node:fs/promises";import U,{homedir as I}from"node:os";import q,{join as W}from"node:path";import P,{TextEncoder as B}from"util";import D,{Readable as M}from"stream";import G from"http";import J from"https";import H from"url";import K from"assert";import V from"tty";import Y,{homedir as Z,tmpdir as X}from"os";import Q from"zlib";import{EventEmitter as ee}from"events";import{createInterface as ne}from"node:readline/promises";import te from"dotenv";import oe from"@logto/node";import{Router as ie}from"express";import ae,{WebSocketServer as se}from"ws";import{execFileSync as re}from"child_process";import{minimatch as ce}from"minimatch";import le from"body-parser";import{createInterface as pe}from"node:readline";import{execFileSync as ue}from"node:child_process";const de={status:"/v1/status",version:"/v1/version",api:"/v1/api",usage:{get:"/v1/usage"},affiliate:{get:"/v1/affiliate/get",link_clicked:"/v1/affiliate/link_clicked"},account:{public_key:"/v1/account/public_key",post_machine:"/v1/account/machine",connect:"/v1/account/connect",get_licenses:"/v1/account/get/licenses",set_license_active:"/v1/account/set_license_active",set_licenses_active:"/v1/account/set_licenses_active",buy_licenses:"/v1/account/buy_licenses",update_licenses:"/v1/account/update_licenses",update_payment_method:"/v1/account/update_payment_method",get_billing:"/v1/account/get_billing",resume_subscription:"/v1/account/resume_subscription",cancel_subscription:"/v1/account/cancel_subscription",start_billingportal_session:"/v1/account/start_billingportal_session",post_preferences:"/v1/account/preferences",get_preferences:"/v1/account/preferences"},ai:{llmstxt:"/v1/ai/llmstxt",chat:"/v1/ai/chat",list_chats:"/v1/ai/chat/list",chat_tool_result:"/v1/ai/chat/tool-result",chat_stop:"/v1/ai/chat/stop",ask:"/v1/ai/ask",post_settings:"/v1/ai/chat/settings",ws:"/v1/ws",cli_ws:"/v1/cli/ws"},organizations:{get:"/v1/organizations/get",orgs_details:"/v1/organizations/details",licenses:"/v1/organizations/licenses",get_invitations:"/v1/organizations/get_invitations"},events:{get:"/v1/events/get",post:"/v1/events/post",list:"/v1/events/list"},reports:{get:"/v1/reports/get",post:"/v1/reports/post"},diagnostics:{download_failed:"/v1/diagnostics/download-failed"},questionnaire:{get:"/v1/questionnaires/get",post:"/v1/questionnaires/post"},roadmap:{get:"/v1/roadmap/get",post_vote:"/v1/roadmap/post"},tokens:{create:"/v1/tokens/create",delete:"/v1/tokens/delete",list:"/v1/tokens/list"},get:{stats:"/v1/get/stats",jobs:"/v1/list/jobs",deployments:"/v1/list/deployments",discounts:"/v1/get/discounts"},files:{entry:"/v1/files/:identifier/:version/",file:"/v1/files/:identifier/:version/*"},view:{get_analytics:"/v1/view/analytics",get_public_info:"/v1/view/public/info",post_version:"/v1/view/post_version"},content:{root:"/v1/content",download:"/v1/content/download",detail:"/v1/content/:identifier",update:"/v1/content/:identifier",delete:"/v1/content/:identifier",restore:"/v1/content/:identifier/restore"},public:{content_list:"/v1/public/content",content_detail:"/v1/public/content/:identifier"},collections:{list:"/v1/collections/list",get:"/v1/collections/get",create:"/v1/collections/create",update:"/v1/collections/update",delete:"/v1/collections/delete",add_item:"/v1/collections/add-item",remove_item:"/v1/collections/remove-item",reorder_items:"/v1/collections/reorder-items"},upload:{request:"/v1/upload/request",request_put_url:"/v1/upload/put",update_results:"/v1/upload/results",done:"/v1/upload/done",cancel:"/v1/upload/cancel"},jobs:{create:"/v1/jobs/create",get_id:"/v1/jobs/get_id",request_start:"/v1/jobs/request_start",presigned_url:"/v1/jobs/presigned-url",presigned_urls:"/v1/jobs/presigned-urls",download_urls:"/v1/jobs/download-urls",request_restart:"/v1/jobs/restart",delete:"/v1/jobs/delete",post_update:"/v1/jobs/update",post_results_stats:"/v1/jobs/results_stats",post_usage:"/v1/jobs/post_usage",get_status:"/v1/jobs/status",get_org:"/v1/jobs/org",query:"/v1/jobs/query",request_job_that_needs_stats:"/v1/jobs/job_needs_stats"},worker:{ping:"/v1/worker/ping",get_available_count:"/v1/worker/get_available_count",post_available_info:"/v1/worker/post_available_info",get_available_info:"/v1/worker/get_available_info"},local_projects:{get:{user:"/v1/local_projects/user",by_id:"/v1/local_projects/"},post:"/v1/local_projects"}};function me(e){const n={authorization:"Bearer "+e.authToken};return e.org&&(n["x-needle-cloud-org"]=e.org),e.roles&&(n.roles=e.roles.join(",")),e.roles_org&&(n.roles_org=e.roles_org.join(",")),n}const fe={credentials:"omit"};function he(e,n){return function(){return e.apply(n,arguments)}}const{toString:ge}=Object.prototype,{getPrototypeOf:ve}=Object,xe=(be=Object.create(null),e=>{const n=ge.call(e);return be[n]||(be[n]=n.slice(8,-1).toLowerCase())});var be;const ye=e=>(e=e.toLowerCase(),n=>xe(n)===e),we=e=>n=>typeof n===e,{isArray:_e}=Array,ke=we("undefined"),je=ye("ArrayBuffer"),Se=we("string"),$e=we("function"),Te=we("number"),Ee=e=>null!==e&&"object"==typeof e,Ce=e=>{if("object"!==xe(e))return!1;const n=ve(e);return!(null!==n&&n!==Object.prototype&&null!==Object.getPrototypeOf(n)||Symbol.toStringTag in e||Symbol.iterator in e)},Oe=ye("Date"),Re=ye("File"),ze=ye("Blob"),Ne=ye("FileList"),Ae=ye("URLSearchParams"),[Le,Fe,Ue,Ie]=["ReadableStream","Request","Response","Headers"].map(ye);function qe(e,n,{allOwnKeys:t=!1}={}){if(null==e)return;let o,i;if("object"!=typeof e&&(e=[e]),_e(e))for(o=0,i=e.length;o<i;o++)n.call(null,e[o],o,e);else{const i=t?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(o=0;o<a;o++)s=i[o],n.call(null,e[s],s,e)}}function We(e,n){n=n.toLowerCase();const t=Object.keys(e);let o,i=t.length;for(;i-- >0;)if(o=t[i],n===o.toLowerCase())return o;return null}const Pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Be=e=>!ke(e)&&e!==Pe,De=(Me="undefined"!=typeof Uint8Array&&ve(Uint8Array),e=>Me&&e instanceof Me);var Me;const Ge=ye("HTMLFormElement"),Je=(({hasOwnProperty:e})=>(n,t)=>e.call(n,t))(Object.prototype),He=ye("RegExp"),Ke=(e,n)=>{const t=Object.getOwnPropertyDescriptors(e),o={};qe(t,(t,i)=>{let a;!1!==(a=n(t,i,e))&&(o[i]=a||t)}),Object.defineProperties(e,o)},Ve="abcdefghijklmnopqrstuvwxyz",Ye="0123456789",Ze={DIGIT:Ye,ALPHA:Ve,ALPHA_DIGIT:Ve+Ve.toUpperCase()+Ye},Xe=ye("AsyncFunction"),Qe=(en="function"==typeof setImmediate,nn=$e(Pe.postMessage),en?setImmediate:nn?(tn=`axios@${Math.random()}`,on=[],Pe.addEventListener("message",({source:e,data:n})=>{e===Pe&&n===tn&&on.length&&on.shift()()},!1),e=>{on.push(e),Pe.postMessage(tn,"*")}):e=>setTimeout(e));var en,nn,tn,on;const an="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Pe):"undefined"!=typeof process&&process.nextTick||Qe;var sn={isArray:_e,isArrayBuffer:je,isBuffer:function(e){return null!==e&&!ke(e)&&null!==e.constructor&&!ke(e.constructor)&&$e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let n;return e&&("function"==typeof FormData&&e instanceof FormData||$e(e.append)&&("formdata"===(n=xe(e))||"object"===n&&$e(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let n;return n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&je(e.buffer),n},isString:Se,isNumber:Te,isBoolean:e=>!0===e||!1===e,isObject:Ee,isPlainObject:Ce,isReadableStream:Le,isRequest:Fe,isResponse:Ue,isHeaders:Ie,isUndefined:ke,isDate:Oe,isFile:Re,isBlob:ze,isRegExp:He,isFunction:$e,isStream:e=>Ee(e)&&$e(e.pipe),isURLSearchParams:Ae,isTypedArray:De,isFileList:Ne,forEach:qe,merge:function e(){const{caseless:n}=Be(this)&&this||{},t={},o=(o,i)=>{const a=n&&We(t,i)||i;t[a]=Ce(t[a])&&Ce(o)?e(t[a],o):Ce(o)?e({},o):_e(o)?o.slice():o};for(let e=0,n=arguments.length;e<n;e++)arguments[e]&&qe(arguments[e],o);return t},extend:(e,n,t,{allOwnKeys:o}={})=>(qe(n,(n,o)=>{e[o]=t&&$e(n)?he(n,t):n},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,n,t,o)=>{e.prototype=Object.create(n.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),t&&Object.assign(e.prototype,t)},toFlatObject:(e,n,t,o)=>{let i,a,s;const r={};if(n=n||{},null==e)return n;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],o&&!o(s,e,n)||r[s]||(n[s]=e[s],r[s]=!0);e=!1!==t&&ve(e)}while(e&&(!t||t(e,n))&&e!==Object.prototype);return n},kindOf:xe,kindOfTest:ye,endsWith:(e,n,t)=>{e=String(e),(void 0===t||t>e.length)&&(t=e.length);const o=e.indexOf(n,t-=n.length);return-1!==o&&o===t},toArray:e=>{if(!e)return null;if(_e(e))return e;let n=e.length;if(!Te(n))return null;const t=new Array(n);for(;n-- >0;)t[n]=e[n];return t},forEachEntry:(e,n)=>{const t=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=t.next())&&!o.done;){const t=o.value;n.call(e,t[0],t[1])}},matchAll:(e,n)=>{let t;const o=[];for(;null!==(t=e.exec(n));)o.push(t);return o},isHTMLForm:Ge,hasOwnProperty:Je,hasOwnProp:Je,reduceDescriptors:Ke,freezeMethods:e=>{Ke(e,(n,t)=>{if($e(e)&&-1!==["arguments","caller","callee"].indexOf(t))return!1;$e(e[t])&&(n.enumerable=!1,"writable"in n?n.writable=!1:n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")}))})},toObjectSet:(e,n)=>{const t={},o=e=>{e.forEach(e=>{t[e]=!0})};return _e(e)?o(e):o(String(e).split(n)),t},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,t){return n.toUpperCase()+t}),noop:()=>{},toFiniteNumber:(e,n)=>null!=e&&Number.isFinite(e=+e)?e:n,findKey:We,global:Pe,isContextDefined:Be,ALPHABET:Ze,generateString:(e=16,n=Ze.ALPHA_DIGIT)=>{let t="";const{length:o}=n;for(;e--;)t+=n[Math.random()*o|0];return t},isSpecCompliantForm:function(e){return!!(e&&$e(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const n=new Array(10),t=(e,o)=>{if(Ee(e)){if(n.indexOf(e)>=0)return;if(!("toJSON"in e)){n[o]=e;const i=_e(e)?[]:{};return qe(e,(e,n)=>{const a=t(e,o+1);!ke(a)&&(i[n]=a)}),n[o]=void 0,i}}return e};return t(e,0)},isAsyncFn:Xe,isThenable:e=>e&&(Ee(e)||$e(e))&&$e(e.then)&&$e(e.catch),setImmediate:Qe,asap:an};function rn(e,n,t,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",n&&(this.code=n),t&&(this.config=t),o&&(this.request=o),i&&(this.response=i)}sn.inherits(rn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:sn.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const cn=rn.prototype,ln={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ln[e]={value:e}}),Object.defineProperties(rn,ln),Object.defineProperty(cn,"isAxiosError",{value:!0}),rn.from=(e,n,t,o,i,a)=>{const s=Object.create(cn);return sn.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),rn.call(s,e.message,n,t,o,i),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};var pn=D.Stream,un=dn;function dn(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}P.inherits(dn,pn),dn.create=function(e,n){var t=new this;for(var o in n=n||{})t[o]=n[o];t.source=e;var i=e.emit;return e.emit=function(){return t._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),t.pauseStream&&e.pause(),t},Object.defineProperty(dn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),dn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},dn.prototype.resume=function(){this._released||this.release(),this.source.resume()},dn.prototype.pause=function(){this.source.pause()},dn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},dn.prototype.pipe=function(){var e=pn.prototype.pipe.apply(this,arguments);return this.resume(),e},dn.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},dn.prototype._checkIfMaxDataSizeExceeded=function(){this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize||(this._maxDataSizeExceeded=!0,this.emit("error",new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.")))};var mn=D.Stream,fn=hn;function hn(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}P.inherits(hn,mn),hn.create=function(e){var n=new this;for(var t in e=e||{})n[t]=e[t];return n},hn.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},hn.prototype.append=function(e){if(hn.isStreamLike(e)){if(!(e instanceof un)){var n=un.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=n}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},hn.prototype.pipe=function(e,n){return mn.prototype.pipe.call(this,e,n),this.resume(),e},hn.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},hn.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){hn.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},hn.prototype._pipeNext=function(e){if(this._currentStream=e,hn.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});this.write(e),this._getNext()},hn.prototype._handleErrors=function(e){var n=this;e.on("error",function(e){n._emitError(e)})},hn.prototype.write=function(e){this.emit("data",e)},hn.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},hn.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},hn.prototype.end=function(){this._reset(),this.emit("end")},hn.prototype.destroy=function(){this._reset(),this.emit("close")},hn.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},hn.prototype._checkDataSize=function(){this._updateDataSize(),this.dataSize<=this.maxDataSize||this._emitError(new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded."))},hn.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(n){n.dataSize&&(e.dataSize+=n.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},hn.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var gn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vn(e){var n={exports:{}};return e(n,n.exports),n.exports}var xn={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"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/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+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/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"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",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,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",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0,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",compressible:!0,extensions:["its"]},"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/jscalendar+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",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"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",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,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",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{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/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"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","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,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",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"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",compressible:!0,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",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"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/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"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",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,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",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"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/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{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.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"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",compressible:!1,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",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"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",compressible:!0},"application/vnd.android.ota":{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.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"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.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{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",compressible:!0},"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.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"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",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"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",compressible:!1},"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",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{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.dbf":{source:"iana",extensions:["dbf"]},"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",compressible:!0,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.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"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.dvbisl+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"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.eclipse.ditto+json":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"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",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"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.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{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.familysearch.gedcom+zip":{source:"iana",compressible:!1},"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.ficlab.flb+zip":{source:"iana",compressible:!1},"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.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"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.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"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",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"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",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,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.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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+json":{source:"iana",compressible:!0},"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",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"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",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"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":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"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",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"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",compressible:!0},"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",compressible:!0},"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",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"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.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"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",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"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",compressible:!0},"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.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{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",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0,extensions:["obgx"]},"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",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"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",compressible:!0},"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.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{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",compressible:!0},"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.psfs":{source:"iana"},"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",compressible:!0},"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",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{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",compressible:!0,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.sar":{source:"iana"},"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.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"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.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"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.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,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.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"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",compressible:!0,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.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{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",charset:"UTF-8",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.dpp":{source:"iana"},"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",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"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",compressible:!0},"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",compressible:!0,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",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"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",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,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",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,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-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"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-keepass2":{extensions:["kdbx"]},"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-pki-message":{source:"iana"},"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:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,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",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"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",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,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",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{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/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"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/flexfec":{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/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"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","opus"]},"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/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{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/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{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.dts.uhd":{source:"iana"},"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",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"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",extensions:["pti"]},"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",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"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",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"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.pco.b16":{source:"iana",extensions:["b16"]},"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",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"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",extensions:["3mf"]},"model/e57":{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/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,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",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"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",extensions:["x3db"]},"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",extensions:["x3dv"]},"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"},"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/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"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/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{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":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"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/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"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",charset:"UTF-8",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",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"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.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"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":{source:"iana",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":{compressible:!0,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/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{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",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"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/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{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/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{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}},bn=vn(function(e,n){var t,o,i,a=b.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),t=n&&xn[n[1].toLowerCase()];return t&&t.charset?t.charset:!(!n||!r.test(n[1]))&&"UTF-8"}n.charset=c,n.charsets={lookup:c},n.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?n.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var o=n.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t},n.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),o=t&&n.extensions[t[1].toLowerCase()];return!(!o||!o.length)&&o[0]},n.extensions=Object.create(null),n.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=a("x."+e).toLowerCase().substr(1);return t&&n.types[t]||!1},n.types=Object.create(null),t=n.extensions,o=n.types,i=["nginx","apache",void 0,"iana"],Object.keys(xn).forEach(function(e){var n=xn[e],a=n.extensions;if(a&&a.length){t[e]=a;for(var s=0;s<a.length;s++){var r=a[s];if(o[r]){var c=i.indexOf(xn[o[r]].source),l=i.indexOf(n.source);if("application/octet-stream"!==o[r]&&(c>l||c===l&&"application/"===o[r].substr(0,12)))continue}o[r]=e}}})}),yn=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},wn=function(e){var n=!1;return yn(function(){n=!0}),function(t,o){n?e(t,o):yn(function(){e(t,o)})}},_n=function(e){Object.keys(e.jobs).forEach(kn.bind(e)),e.jobs={}};function kn(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var jn=function(e,n,t,o){var i=t.keyedList?t.keyedList[t.index]:t.index;t.jobs[i]=function(e,n,t,o){return 2==e.length?e(t,wn(o)):e(t,n,wn(o))}(n,i,e[i],function(e,n){i in t.jobs&&(delete t.jobs[i],e?_n(t):t.results[i]=n,o(e,t.results))})},Sn=function(e,n){var t=!Array.isArray(e),o={index:0,keyedList:t||n?Object.keys(e):null,jobs:{},results:t?{}:[],size:t?Object.keys(e).length:e.length};return n&&o.keyedList.sort(t?n:function(t,o){return n(e[t],e[o])}),o},$n=function(e){Object.keys(this.jobs).length&&(this.index=this.size,_n(this),wn(e)(null,this.results))},Tn=function(e,n,t,o){var i=Sn(e,t);return jn(e,n,i,function t(a,s){a?o(a,s):(i.index++,i.index<(i.keyedList||e).length?jn(e,n,i,t):o(null,i.results))}),$n.bind(i,o)};function En(e,n){return e<n?-1:e>n?1:0}Tn.ascending=En,Tn.descending=function(e,n){return-1*En(e,n)};var Cn=function(e,n){return Object.keys(n).forEach(function(t){e[t]=e[t]||n[t]}),e},On=H.parse,Rn=D.Stream,zn=Nn;function Nn(e){if(!(this instanceof Nn))return new Nn(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fn.call(this),e=e||{})this[n]=e[n]}P.inherits(Nn,fn),Nn.LINE_BREAK="\r\n",Nn.DEFAULT_CONTENT_TYPE="application/octet-stream",Nn.prototype.append=function(e,n,t){"string"==typeof(t=t||{})&&(t={filename:t});var o=fn.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),P.isArray(n))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,n,t),a=this._multiPartFooter();o(i),o(n),o(a),this._trackLength(i,n,t)}},Nn.prototype._trackLength=function(e,n,t){var o=0;null!=t.knownLength?o+=+t.knownLength:Buffer.isBuffer(n)?o=n.length:"string"==typeof n&&(o=Buffer.byteLength(n)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+Nn.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Rn)&&(t.knownLength||this._valuesToMeasure.push(n))},Nn.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&Infinity!=e.end&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):a.stat(e.path,function(t,o){t?n(t):n(null,o.size-(e.start?e.start:0))}):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",function(t){e.pause(),n(null,+t.headers["content-length"])}),e.resume()):n("Unknown stream")},Nn.prototype._multiPartHeader=function(e,n,t){if("string"==typeof t.header)return t.header;var o,i=this._getContentDisposition(n,t),a=this._getContentType(n,t),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof t.header&&Cn(r,t.header),r)r.hasOwnProperty(c)&&null!=(o=r[c])&&(Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+Nn.LINE_BREAK));return"--"+this.getBoundary()+Nn.LINE_BREAK+s+Nn.LINE_BREAK},Nn.prototype._getContentDisposition=function(e,n){var t,o;return"string"==typeof n.filepath?t=b.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?t=b.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(t=b.basename(e.client._httpMessage.path||"")),t&&(o='filename="'+t+'"'),o},Nn.prototype._getContentType=function(e,n){var t=n.contentType;return!t&&e.name&&(t=bn.lookup(e.name)),!t&&e.path&&(t=bn.lookup(e.path)),!t&&e.readable&&e.hasOwnProperty("httpVersion")&&(t=e.headers["content-type"]),t||!n.filepath&&!n.filename||(t=bn.lookup(n.filepath||n.filename)),t||"object"!=typeof e||(t=Nn.DEFAULT_CONTENT_TYPE),t},Nn.prototype._multiPartFooter=function(){return function(e){var n=Nn.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},Nn.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Nn.LINE_BREAK},Nn.prototype.getHeaders=function(e){var n,t={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t},Nn.prototype.setBoundary=function(e){this._boundary=e},Nn.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Nn.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),t=0,o=this._streams.length;t<o;t++)"function"!=typeof this._streams[t]&&(e=Buffer.isBuffer(this._streams[t])?Buffer.concat([e,this._streams[t]]):Buffer.concat([e,Buffer.from(this._streams[t])]),"string"==typeof this._streams[t]&&this._streams[t].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(Nn.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Nn.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Nn.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Nn.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Nn.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?function(e,n,t){for(var o=Sn(e);o.index<(o.keyedList||e).length;)jn(e,n,o,function(e,n){e?t(e,n):0!==Object.keys(o.jobs).length||t(null,o.results)}),o.index++;$n.bind(o,t)}(this._valuesToMeasure,this._lengthRetriever,function(t,o){t?e(t):(o.forEach(function(e){n+=e}),e(null,n))}):process.nextTick(e.bind(this,null,n))},Nn.prototype.submit=function(e,n){var t,o,i={method:"post"};return"string"==typeof e?(e=On(e),o=Cn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(o=Cn(e,i)).port||(o.port="https:"==o.protocol?443:80),o.headers=this.getHeaders(e.headers),t="https:"==o.protocol?J.request(o):G.request(o),this.getLength(function(e,o){if(e&&"Unknown stream"!==e)this._error(e);else if(o&&t.setHeader("Content-Length",o),this.pipe(t),n){var i,a=function(e,o){return t.removeListener("error",a),t.removeListener("response",i),n.call(this,e,o)};i=a.bind(this,null),t.on("error",a),t.on("response",i)}}.bind(this)),t},Nn.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Nn.prototype.toString=function(){return"[object FormData]"};var An=zn;function Ln(e){return sn.isPlainObject(e)||sn.isArray(e)}function Fn(e){return sn.endsWith(e,"[]")?e.slice(0,-2):e}function Un(e,n,t){return e?e.concat(n).map(function(e,n){return e=Fn(e),!t&&n?"["+e+"]":e}).join(t?".":""):n}const In=sn.toFlatObject(sn,{},null,function(e){return/^is[A-Z]/.test(e)});function qn(e,n,t){if(!sn.isObject(e))throw new TypeError("target must be an object");n=n||new(An||FormData);const o=(t=sn.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,n){return!sn.isUndefined(n[e])})).metaTokens,i=t.visitor||l,a=t.dots,s=t.indexes,r=(t.Blob||"undefined"!=typeof Blob&&Blob)&&sn.isSpecCompliantForm(n);if(!sn.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(sn.isDate(e))return e.toISOString();if(!r&&sn.isBlob(e))throw new rn("Blob is not supported. Use a Buffer instead.");return sn.isArrayBuffer(e)||sn.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,t,i){let r=e;if(e&&!i&&"object"==typeof e)if(sn.endsWith(t,"{}"))t=o?t:t.slice(0,-2),e=JSON.stringify(e);else if(sn.isArray(e)&&function(e){return sn.isArray(e)&&!e.some(Ln)}(e)||(sn.isFileList(e)||sn.endsWith(t,"[]"))&&(r=sn.toArray(e)))return t=Fn(t),r.forEach(function(e,o){!sn.isUndefined(e)&&null!==e&&n.append(!0===s?Un([t],o,a):null===s?t:t+"[]",c(e))}),!1;return!!Ln(e)||(n.append(Un(i,t,a),c(e)),!1)}const p=[],u=Object.assign(In,{defaultVisitor:l,convertValue:c,isVisitable:Ln});if(!sn.isObject(e))throw new TypeError("data must be an object");return function e(t,o){if(!sn.isUndefined(t)){if(-1!==p.indexOf(t))throw Error("Circular reference detected in "+o.join("."));p.push(t),sn.forEach(t,function(t,a){!0===(!(sn.isUndefined(t)||null===t)&&i.call(n,t,sn.isString(a)?a.trim():a,o,u))&&e(t,o?o.concat(a):[a])}),p.pop()}}(e),n}function Wn(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return n[e]})}function Pn(e,n){this._pairs=[],e&&qn(e,this,n)}const Bn=Pn.prototype;function Dn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mn(e,n,t){if(!n)return e;const o=t&&t.encode||Dn,i=t&&t.serialize;let a;if(a=i?i(n,t):sn.isURLSearchParams(n)?n.toString():new Pn(n,t).toString(o),a){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Bn.append=function(e,n){this._pairs.push([e,n])},Bn.toString=function(e){const n=e?function(n){return e.call(this,n,Wn)}:Wn;return this._pairs.map(function(e){return n(e[0])+"="+n(e[1])},"").join("&")};var Gn=class{constructor(){this.handlers=[]}use(e,n,t){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){sn.forEach(this.handlers,function(n){null!==n&&e(n)})}},Jn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hn={isNode:!0,classes:{URLSearchParams:H.URLSearchParams,FormData:An,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};const Kn="undefined"!=typeof window&&"undefined"!=typeof document,Vn=(Yn="undefined"!=typeof navigator&&navigator.product,Kn&&["ReactNative","NativeScript","NS"].indexOf(Yn)<0);var Yn,Zn={__proto__:null,hasBrowserEnv:Kn,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:Vn,origin:Kn&&window.location.href||"http://localhost",...Hn};function Xn(e){function n(e,t,o,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),r=i>=e.length;return a=!a&&sn.isArray(o)?o.length:a,r?(o[a]=sn.hasOwnProp(o,a)?[o[a],t]:t,!s):(o[a]&&sn.isObject(o[a])||(o[a]=[]),n(e,t,o[a],i)&&sn.isArray(o[a])&&(o[a]=function(e){const n={},t=Object.keys(e);let o;const i=t.length;let a;for(o=0;o<i;o++)a=t[o],n[a]=e[a];return n}(o[a])),!s)}if(sn.isFormData(e)&&sn.isFunction(e.entries)){const t={};return sn.forEachEntry(e,(e,o)=>{n(function(e){return sn.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),o,t,0)}),t}return null}const Qn={transitional:Jn,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const t=n.getContentType()||"",o=t.indexOf("application/json")>-1,i=sn.isObject(e);if(i&&sn.isHTMLForm(e)&&(e=new FormData(e)),sn.isFormData(e))return o?JSON.stringify(Xn(e)):e;if(sn.isArrayBuffer(e)||sn.isBuffer(e)||sn.isStream(e)||sn.isFile(e)||sn.isBlob(e)||sn.isReadableStream(e))return e;if(sn.isArrayBufferView(e))return e.buffer;if(sn.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(t.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return qn(e,new Zn.classes.URLSearchParams,Object.assign({visitor:function(e,n,t,o){return Zn.isNode&&sn.isBuffer(e)?(this.append(n,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((a=sn.isFileList(e))||t.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return qn(a?{"files[]":e}:e,n&&new n,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),function(e,n,t){if(sn.isString(e))try{return(0,JSON.parse)(e),sn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||Qn.transitional,t=n&&n.forcedJSONParsing,o="json"===this.responseType;if(sn.isResponse(e)||sn.isReadableStream(e))return e;if(e&&sn.isString(e)&&(t&&!this.responseType||o)){const t=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(t){if("SyntaxError"===e.name)throw rn.from(e,rn.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zn.classes.FormData,Blob:Zn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};sn.forEach(["delete","get","head","post","put","patch"],e=>{Qn.headers[e]={}});var et=Qn;const nt=sn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tt=Symbol("internals");function ot(e){return e&&String(e).trim().toLowerCase()}function it(e){return!1===e||null==e?e:sn.isArray(e)?e.map(it):String(e)}function at(e,n,t,o,i){return sn.isFunction(o)?o.call(this,n,t):(i&&(n=t),sn.isString(n)?sn.isString(o)?-1!==n.indexOf(o):sn.isRegExp(o)?o.test(n):void 0:void 0)}class st{constructor(e){e&&this.set(e)}set(e,n,t){const o=this;function i(e,n,t){const i=ot(n);if(!i)throw new Error("header name must be a non-empty string");const a=sn.findKey(o,i);(!a||void 0===o[a]||!0===t||void 0===t&&!1!==o[a])&&(o[a||n]=it(e))}const a=(e,n)=>sn.forEach(e,(e,t)=>i(e,t,n));if(sn.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(sn.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const n={};let t,o,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),t=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim(),!t||n[t]&&nt[t]||("set-cookie"===t?n[t]?n[t].push(o):n[t]=[o]:n[t]=n[t]?n[t]+", "+o:o)}),n})(e),n);else if(sn.isHeaders(e))for(const[n,o]of e.entries())i(o,n,t);else null!=e&&i(n,e,t);return this}get(e,n){if(e=ot(e)){const t=sn.findKey(this,e);if(t){const e=this[t];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=t.exec(e);)n[o[1]]=o[2];return n}(e);if(sn.isFunction(n))return n.call(this,e,t);if(sn.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ot(e)){const t=sn.findKey(this,e);return!(!t||void 0===this[t]||n&&!at(0,this[t],t,n))}return!1}delete(e,n){const t=this;let o=!1;function i(e){if(e=ot(e)){const i=sn.findKey(t,e);!i||n&&!at(0,t[i],i,n)||(delete t[i],o=!0)}}return sn.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let t=n.length,o=!1;for(;t--;){const i=n[t];e&&!at(0,this[i],i,e,!0)||(delete this[i],o=!0)}return o}normalize(e){const n=this,t={};return sn.forEach(this,(o,i)=>{const a=sn.findKey(t,i);if(a)return n[a]=it(o),void delete n[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,t)=>n.toUpperCase()+t)}(i):String(i).trim();s!==i&&delete n[i],n[s]=it(o),t[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return sn.forEach(this,(t,o)=>{null!=t&&!1!==t&&(n[o]=e&&sn.isArray(t)?t.join(", "):t)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const t=new this(e);return n.forEach(e=>t.set(e)),t}static accessor(e){const n=(this[tt]=this[tt]={accessors:{}}).accessors,t=this.prototype;function o(e){const o=ot(e);n[o]||(function(e,n){const t=sn.toCamelCase(" "+n);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+t,{value:function(e,t,i){return this[o].call(this,n,e,t,i)},configurable:!0})})}(t,e),n[o]=!0)}return sn.isArray(e)?e.forEach(o):o(e),this}}st.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),sn.reduceDescriptors(st.prototype,({value:e},n)=>{let t=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(e){this[t]=e}}}),sn.freezeMethods(st);var rt=st;function ct(e,n){const t=this||et,o=n||t,i=rt.from(o.headers);let a=o.data;return sn.forEach(e,function(e){a=e.call(t,a,i.normalize(),n?n.status:void 0)}),i.normalize(),a}function lt(e){return!(!e||!e.__CANCEL__)}function pt(e,n,t){rn.call(this,null==e?"canceled":e,rn.ERR_CANCELED,n,t),this.name="CanceledError"}function ut(e,n,t){const o=t.config.validateStatus;t.status&&o&&!o(t.status)?n(new rn("Request failed with status code "+t.status,[rn.ERR_BAD_REQUEST,rn.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t)):e(t)}function dt(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}sn.inherits(pt,rn,{__CANCEL__:!0});var mt=H.parse,ft={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},ht=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function gt(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var vt=1e3,xt=60*vt,bt=60*xt,yt=24*bt,wt=7*yt,_t=function(e,n){n=n||{};var t=typeof e;if("string"===t&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var n=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(n){var t=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*t;case"weeks":case"week":case"w":return t*wt;case"days":case"day":case"d":return t*yt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*bt;case"minutes":case"minute":case"mins":case"min":case"m":return t*xt;case"seconds":case"second":case"secs":case"sec":case"s":return t*vt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}(e);if("number"===t&&isFinite(e))return n.long?function(e){var n=Math.abs(e);return n>=yt?kt(e,n,yt,"day"):n>=bt?kt(e,n,bt,"hour"):n>=xt?kt(e,n,xt,"minute"):n>=vt?kt(e,n,vt,"second"):e+" ms"}(e):function(e){var n=Math.abs(e);return n>=yt?Math.round(e/yt)+"d":n>=bt?Math.round(e/bt)+"h":n>=xt?Math.round(e/xt)+"m":n>=vt?Math.round(e/vt)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function kt(e,n,t,o){var i=n>=1.5*t;return Math.round(e/t)+" "+o+(i?"s":"")}var jt=function(e){function n(e){let o,i,a,s=null;function r(...e){if(!r.enabled)return;const t=r,i=Number(new Date);t.diff=i-(o||i),t.prev=o,t.curr=i,o=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(o,i)=>{if("%%"===o)return"%";a++;const s=n.formatters[i];return"function"==typeof s&&(o=s.call(t,e[a]),e.splice(a,1),a--),o}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=t,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==n.namespaces&&(i=n.namespaces,a=n.enabled(e)),a),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function t(e,t){const o=n(this.namespace+(void 0===t?":":t)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(o),...n.skips.map(o).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(t=0;t<i;t++)o[t]&&("-"===(e=o[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,o;for(t=0,o=n.skips.length;t<o;t++)if(n.skips[t].test(e))return!1;for(t=0,o=n.names.length;t<o;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=_t,n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n},St=vn(function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,i=0;n[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),n.splice(i,0,t)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),e.exports=jt(n);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),$t=(e,n=process.argv)=>{const t=e.startsWith("-")?"":1===e.length?"-":"--",o=n.indexOf(t+e),i=n.indexOf("--");return-1!==o&&(-1===i||o<i)};const{env:Tt}=process;let Et;function Ct(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ot(e,n){if(0===Et)return 0;if($t("color=16m")||$t("color=full")||$t("color=truecolor"))return 3;if($t("color=256"))return 2;if(e&&!n&&void 0===Et)return 0;const t=Et||0;if("dumb"===Tt.TERM)return t;if("win32"===process.platform){const e=Y.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in Tt)||"codeship"===Tt.CI_NAME?1:t;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("truecolor"===Tt.COLORTERM)return 3;if("TERM_PROGRAM"in Tt){const e=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:t}$t("no-color")||$t("no-colors")||$t("color=false")||$t("color=never")?Et=0:($t("color")||$t("colors")||$t("color=true")||$t("color=always"))&&(Et=1),"FORCE_COLOR"in Tt&&(Et="true"===Tt.FORCE_COLOR?1:"false"===Tt.FORCE_COLOR?0:0===Tt.FORCE_COLOR.length?1:Math.min(parseInt(Tt.FORCE_COLOR,10),3));var Rt,zt={supportsColor:function(e){return Ct(Ot(e,e&&e.isTTY))},stdout:Ct(Ot(!0,V.isatty(1))),stderr:Ct(Ot(!0,V.isatty(2)))},Nt=vn(function(e,n){n.init=function(e){e.inspectOpts={};const t=Object.keys(n.inspectOpts);for(let o=0;o<t.length;o++)e.inspectOpts[t[o]]=n.inspectOpts[t[o]]},n.log=function(...e){return process.stderr.write(P.format(...e)+"\n")},n.formatArgs=function(t){const{namespace:o,useColors:i}=this;if(i){const n=this.color,i="[3"+(n<8?n:"8;5;"+n),a=` ${i};1m${o} [0m`;t[0]=a+t[0].split("\n").join("\n"+a),t.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else t[0]=(n.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+o+" "+t[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):V.isatty(process.stderr.fd)},n.destroy=P.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{zt&&(zt.stderr||zt).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,n)=>{const t=n.substring(6).toLowerCase().replace(/_([a-z])/g,(e,n)=>n.toUpperCase());let o=process.env[n];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),e[t]=o,e},{}),e.exports=jt(n);const{formatters:t}=e.exports;t.o=function(e){return this.inspectOpts.colors=this.useColors,P.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},t.O=function(e){return this.inspectOpts.colors=this.useColors,P.inspect(e,this.inspectOpts)}}),At=vn(function(e){e.exports="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?St:Nt}),Lt=function(){if(!Rt){try{Rt=At("follow-redirects")}catch(e){}"function"!=typeof Rt&&(Rt=function(){})}Rt.apply(null,arguments)},Ft=H.URL,Ut=D.Writable,It=!1;try{K(new Ft)}catch(e){It="ERR_INVALID_URL"===e.code}var qt=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Wt=["abort","aborted","connect","error","socket","timeout"],Pt=Object.create(null);Wt.forEach(function(e){Pt[e]=function(n,t,o){this._redirectable.emit(e,n,t,o)}});var Bt=no("ERR_INVALID_URL","Invalid URL",TypeError),Dt=no("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Mt=no("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Dt),Gt=no("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Jt=no("ERR_STREAM_WRITE_AFTER_END","write after end"),Ht=Ut.prototype.destroy||Yt;function Kt(e,n){Ut.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var t=this;this._onNativeResponse=function(e){try{t._processResponse(e)}catch(e){t.emit("error",e instanceof Dt?e:new Dt({cause:e}))}},this._performRequest()}function Vt(e){var n={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(e).forEach(function(o){var i=o+":",a=t[i]=e[o],s=n[o]=Object.create(a);Object.defineProperties(s,{request:{value:function(e,o,a){return Ft&&e instanceof Ft?e=Qt(e):oo(e)?e=Qt(Zt(e)):(a=o,o=Xt(e),e={protocol:i}),io(o)&&(a=o,o=null),(o=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,o)).nativeProtocols=t,oo(o.host)||oo(o.hostname)||(o.hostname="::1"),K.equal(o.protocol,i,"protocol mismatch"),Lt("options",o),new Kt(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,t){var o=s.request(e,n,t);return o.end(),o},configurable:!0,enumerable:!0,writable:!0}})}),n}function Yt(){}function Zt(e){var n;if(It)n=new Ft(e);else if(!oo((n=Xt(H.parse(e))).protocol))throw new Bt({input:e});return n}function Xt(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Bt({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Bt({input:e.href||e});return e}function Qt(e,n){var t=n||{};for(var o of qt)t[o]=e[o];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),""!==t.port&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function eo(e,n){var t;for(var o in n)e.test(o)&&(t=n[o],delete n[o]);return null==t?void 0:String(t).trim()}function no(e,n,t){function o(t){Error.captureStackTrace(this,this.constructor),Object.assign(this,t||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return o.prototype=new(t||Error),Object.defineProperties(o.prototype,{constructor:{value:o,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),o}function to(e,n){for(var t of Wt)e.removeListener(t,Pt[t]);e.on("error",Yt),e.destroy(n)}function oo(e){return"string"==typeof e||e instanceof String}function io(e){return"function"==typeof e}(Kt.prototype=Object.create(Ut.prototype)).abort=function(){to(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},Kt.prototype.destroy=function(e){return to(this._currentRequest,e),Ht.call(this,e),this},Kt.prototype.write=function(e,n,t){if(this._ending)throw new Jt;if(!(oo(e)||"object"==typeof(o=e)&&"length"in o))throw new TypeError("data should be a string, Buffer or Uint8Array");var o;io(n)&&(t=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,t)):(this.emit("error",new Gt),this.abort()):t&&t()},Kt.prototype.end=function(e,n,t){if(io(e)?(t=e,e=n=null):io(n)&&(t=n,n=null),e){var o=this,i=this._currentRequest;this.write(e,n,function(){o._ended=!0,i.end(null,null,t)}),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,t)},Kt.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},Kt.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Kt.prototype.setTimeout=function(e,n){var t=this;function o(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function i(n){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),a()},e),o(n)}function a(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",a),t.removeListener("error",a),t.removeListener("response",a),t.removeListener("close",a),n&&t.removeListener("timeout",n),t.socket||t._currentRequest.removeListener("socket",i)}return n&&this.on("timeout",n),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",o),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Kt.prototype[e]=function(n,t){return this._currentRequest[e](n,t)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Kt.prototype,e,{get:function(){return this._currentRequest[e]}})}),Kt.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},Kt.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(!n)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var t=e.slice(0,-1);this._options.agent=this._options.agents[t]}var o=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var i of(o._redirectable=this,Wt))o.on(i,Pt[i]);if(this._currentUrl=/^\//.test(this._options.path)?H.format(this._options):this._options.path,this._isRedirect){var a=0,s=this,r=this._requestBodyBuffers;!function e(n){if(o===s._currentRequest)if(n)s.emit("error",n);else if(a<r.length){var t=r[a++];o.finished||o.write(t.data,t.encoding,e)}else s._ended&&o.end()}()}},Kt.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var t,o=e.headers.location;if(!o||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(to(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Mt;var i=this._options.beforeRedirect;i&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],eo(/^content-/i,this._options.headers));var s=eo(/^host$/i,this._options.headers),r=Zt(this._currentUrl),c=s||r.host,l=/^\w+:/.test(o)?this._currentUrl:H.format(Object.assign(r,{host:c})),p=function(e,n){return It?new Ft(e,n):Zt(H.resolve(n,e))}(o,l);Lt("redirecting to",p.href),this._isRedirect=!0,Qt(p,this._options),(p.protocol!==r.protocol&&"https:"!==p.protocol||p.host!==c&&!function(e,n){K(oo(e)&&oo(n));var t=e.length-n.length-1;return t>0&&"."===e[t]&&e.endsWith(n)}(p.host,c))&&eo(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),io(i)&&(i(this._options,{headers:e.headers,statusCode:n},{url:l,method:a,headers:t}),this._sanitizeOptions(this._options)),this._performRequest()};var ao=Vt({http:G,https:J});ao.wrap=Vt;const so="1.7.4";function ro(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}const co=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/,lo=Symbol("internals");var po=class extends D.Transform{constructor(e){super({readableHighWaterMark:(e=sn.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(e,n)=>!sn.isUndefined(n[e]))).chunkSize});const n=this[lo]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))})}_read(e){const n=this[lo];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,t){const o=this[lo],i=o.maxRate,a=this.readableHighWaterMark,s=o.timeWindow,r=i/(1e3/s),c=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*r):0,l=(e,n)=>{const t=Buffer.byteLength(e);o.bytesSeen+=t,o.bytes+=t,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(e)?process.nextTick(n):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(n)}},p=(e,n)=>{const t=Buffer.byteLength(e);let p,u=null,d=a,m=0;if(i){const e=Date.now();(!o.ts||(m=e-o.ts)>=s)&&(o.ts=e,p=r-o.bytes,o.bytes=p<0?-p:0,m=0),p=r-o.bytes}if(i){if(p<=0)return setTimeout(()=>{n(null,e)},s-m);p<d&&(d=p)}d&&t>d&&t-d>c&&(u=e.subarray(d),e=e.subarray(0,d)),l(e,u?()=>{process.nextTick(n,null,u)}:n)};p(e,function e(n,o){if(n)return t(n);o?p(o,e):t(null)})}};const{asyncIterator:uo}=Symbol;var mo=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[uo]?yield*e[uo]():yield e};const fo=sn.ALPHABET.ALPHA_DIGIT+"-_",ho=new B,go="\r\n",vo=ho.encode(go);class xo{constructor(e,n){const{escapeName:t}=this.constructor,o=sn.isString(n);let i=`Content-Disposition: form-data; name="${t(e)}"${!o&&n.name?`; filename="${t(n.name)}"`:""}${go}`;o?n=ho.encode(String(n).replace(/\r?\n|\r\n?/g,go)):i+=`Content-Type: ${n.type||"application/octet-stream"}${go}`,this.headers=ho.encode(i+go),this.contentLength=o?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=n}async*encode(){yield this.headers;const{value:e}=this;sn.isTypedArray(e)?yield e:yield*mo(e),yield vo}static escapeName(e){return String(e).replace(/[\r\n"]/g,e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e]))}}var bo=class extends D.Transform{__transform(e,n,t){this.push(e),t()}_transform(e,n,t){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,n)}this.__transform(e,n,t)}},yo=(e,n)=>sn.isAsyncFn(e)?function(...t){const o=t.pop();e.apply(this,t).then(e=>{try{n?o(null,...n(e)):o(null,e)}catch(e){o(e)}},o)}:e;const wo=(e,n,t=3)=>{let o=0;const i=function(e,n){e=e||10;const t=new Array(e),o=new Array(e);let i,a=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),l=o[s];i||(i=c),t[a]=r,o[a]=c;let p=s,u=0;for(;p!==a;)u+=t[p++],p%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),c-i<n)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(e,n){let t,o,i=0,a=1e3/n;const s=(n,a=Date.now())=>{i=a,t=null,o&&(clearTimeout(o),o=null),e.apply(null,n)};return[(...e)=>{const n=Date.now(),r=n-i;r>=a?s(e,n):(t=e,o||(o=setTimeout(()=>{o=null,s(t)},a-r)))},()=>t&&s(t)]}(t=>{const a=t.loaded,s=t.lengthComputable?t.total:void 0,r=a-o,c=i(r);o=a,e({loaded:a,total:s,progress:s?a/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&a<=s?(s-a)/c:void 0,event:t,lengthComputable:null!=s,[n?"download":"upload"]:!0})},t)},_o=(e,n)=>{const t=null!=e;return[o=>n[0]({lengthComputable:t,total:e,loaded:o}),n[1]]},ko=e=>(...n)=>sn.asap(()=>e(...n)),jo={flush:Q.constants.Z_SYNC_FLUSH,finishFlush:Q.constants.Z_SYNC_FLUSH},So={flush:Q.constants.BROTLI_OPERATION_FLUSH,finishFlush:Q.constants.BROTLI_OPERATION_FLUSH},$o=sn.isFunction(Q.createBrotliDecompress),{http:To,https:Eo}=ao,Co=/https:?/,Oo=Zn.protocols.map(e=>e+":"),Ro=(e,[n,t])=>(e.on("end",t).on("error",t),n);function zo(e,n){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,n)}function No(e,n,t){let o=n;if(!o&&!1!==o){const e=function(e){var n="string"==typeof e?mt(e):e||{},t=n.protocol,o=n.host,i=n.port;if("string"!=typeof o||!o||"string"!=typeof t)return"";if(t=t.split(":",1)[0],!function(e,n){var t=(gt("npm_config_no_proxy")||gt("no_proxy")).toLowerCase();return!t||"*"!==t&&t.split(/[,\s]/).every(function(t){if(!t)return!0;var o=t.match(/^(.+):(\d+)$/),i=o?o[1]:t,a=o?parseInt(o[2]):0;return!(!a||a===n)||(/^[.*]/.test(i)?("*"===i.charAt(0)&&(i=i.slice(1)),!ht.call(e,i)):e!==i)})}(o=o.replace(/:\d*$/,""),i=parseInt(i)||ft[t]||0))return"";var a=gt("npm_config_"+t+"_proxy")||gt(t+"_proxy")||gt("npm_config_proxy")||gt("all_proxy");return a&&-1===a.indexOf("://")&&(a=t+"://"+a),a}(t);e&&(o=new URL(e))}if(o){if(o.username&&(o.auth=(o.username||"")+":"+(o.password||"")),o.auth){(o.auth.username||o.auth.password)&&(o.auth=(o.auth.username||"")+":"+(o.auth.password||""));const n=Buffer.from(o.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=o.hostname||o.host;e.hostname=n,e.host=n,e.port=o.port,e.path=t,o.protocol&&(e.protocol=o.protocol.includes(":")?o.protocol:`${o.protocol}:`)}e.beforeRedirects.proxy=function(e){No(e,n,e.href)}}const Ao="undefined"!=typeof process&&"process"===sn.kindOf(process),Lo=(e,n)=>(({address:e,family:n})=>{if(!sn.isString(e))throw TypeError("address must be a string");return{address:e,family:n||(e.indexOf(".")<0?6:4)}})(sn.isObject(e)?e:{address:e,family:n});var Fo=Ao&&function(e){return n=async function(n,t,o){let{data:i,lookup:a,family:s}=e;const{responseType:r,responseEncoding:c}=e,l=e.method.toUpperCase();let p,u,d=!1;if(a){const e=yo(a,e=>sn.isArray(e)?e:[e]);a=(n,t,o)=>{e(n,t,(e,n,i)=>{if(e)return o(e);const a=sn.isArray(n)?n.map(e=>Lo(e)):[Lo(n,i)];t.all?o(e,a):o(e,a[0].address,a[0].family)})}}const m=new ee,f=()=>{e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h),m.removeAllListeners()};function h(n){m.emit("abort",!n||n.type?new pt(null,e,u):n)}o((e,n)=>{p=!0,n&&(d=!0,f())}),m.once("abort",t),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h)));const g=dt(e.baseURL,e.url),v=new URL(g,sn.hasBrowserEnv?Zn.origin:void 0),x=v.protocol||Oo[0];if("data:"===x){let o;if("GET"!==l)return ut(n,t,{status:405,statusText:"method not allowed",headers:{},config:e});try{o=function(e,n,t){const o=t&&t.Blob||Zn.classes.Blob,i=ro(e);if(void 0===n&&o&&(n=!0),"data"===i){e=i.length?e.slice(i.length+1):e;const t=co.exec(e);if(!t)throw new rn("Invalid URL",rn.ERR_INVALID_URL);const a=t[1],s=t[2],r=Buffer.from(decodeURIComponent(t[3]),s?"base64":"utf8");if(n){if(!o)throw new rn("Blob is not supported",rn.ERR_NOT_SUPPORT);return new o([r],{type:a})}return r}throw new rn("Unsupported protocol "+i,rn.ERR_NOT_SUPPORT)}(e.url,"blob"===r,{Blob:e.env&&e.env.Blob})}catch(n){throw rn.from(n,rn.ERR_BAD_REQUEST,e)}return"text"===r?(o=o.toString(c),c&&"utf8"!==c||(o=sn.stripBOM(o))):"stream"===r&&(o=D.Readable.from(o)),ut(n,t,{data:o,status:200,statusText:"OK",headers:new rt,config:e})}if(-1===Oo.indexOf(x))return t(new rn("Unsupported protocol "+x,rn.ERR_BAD_REQUEST,e));const b=rt.from(e.headers).normalize();b.set("User-Agent","axios/"+so,!1);const{onUploadProgress:y,onDownloadProgress:w}=e,_=e.maxRate;let k,j;if(sn.isSpecCompliantForm(i)){const e=b.getContentType(/boundary=([-_\w\d]{10,70})/i);i=((e,n,t)=>{const{tag:o="form-data-boundary",size:i=25,boundary:a=o+"-"+sn.generateString(i,fo)}=t||{};if(!sn.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");const s=ho.encode("--"+a+go),r=ho.encode("--"+a+"--"+go+go);let c=r.byteLength;const l=Array.from(e.entries()).map(([e,n])=>{const t=new xo(e,n);return c+=t.size,t});c+=s.byteLength*l.length,c=sn.toFiniteNumber(c);const p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(p["Content-Length"]=c),n&&n(p),M.from(async function*(){for(const e of l)yield s,yield*e.encode();yield r}())})(i,e=>{b.set(e)},{tag:`axios-${so}-boundary`,boundary:e&&e[1]||void 0})}else if(sn.isFormData(i)&&sn.isFunction(i.getHeaders)){if(b.set(i.getHeaders()),!b.hasContentLength())try{const e=await P.promisify(i.getLength).call(i);Number.isFinite(e)&&e>=0&&b.setContentLength(e)}catch(e){}}else if(sn.isBlob(i))i.size&&b.setContentType(i.type||"application/octet-stream"),b.setContentLength(i.size||0),i=D.Readable.from(mo(i));else if(i&&!sn.isStream(i)){if(Buffer.isBuffer(i));else if(sn.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!sn.isString(i))return t(new rn("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",rn.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(b.setContentLength(i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return t(new rn("Request body larger than maxBodyLength limit",rn.ERR_BAD_REQUEST,e))}const S=sn.toFiniteNumber(b.getContentLength());let $,T;sn.isArray(_)?(k=_[0],j=_[1]):k=j=_,i&&(y||k)&&(sn.isStream(i)||(i=D.Readable.from(i,{objectMode:!1})),i=D.pipeline([i,new po({maxRate:sn.toFiniteNumber(k)})],sn.noop),y&&i.on("progress",Ro(i,_o(S,wo(ko(y),!1,3))))),e.auth&&($=(e.auth.username||"")+":"+(e.auth.password||"")),!$&&v.username&&($=v.username+":"+v.password),$&&b.delete("authorization");try{T=Mn(v.pathname+v.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const o=new Error(n.message);return o.config=e,o.url=e.url,o.exists=!0,t(o)}b.set("Accept-Encoding","gzip, compress, deflate"+($o?", br":""),!1);const E={path:T,method:l,headers:b.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:$,protocol:x,family:s,beforeRedirect:zo,beforeRedirects:{}};let C;!sn.isUndefined(a)&&(E.lookup=a),e.socketPath?E.socketPath=e.socketPath:(E.hostname=v.hostname,E.port=v.port,No(E,e.proxy,x+"//"+v.hostname+(v.port?":"+v.port:"")+E.path));const O=Co.test(E.protocol);if(E.agent=O?e.httpsAgent:e.httpAgent,e.transport?C=e.transport:0===e.maxRedirects?C=O?J:G:(e.maxRedirects&&(E.maxRedirects=e.maxRedirects),e.beforeRedirect&&(E.beforeRedirects.config=e.beforeRedirect),C=O?Eo:To),E.maxBodyLength=e.maxBodyLength>-1?e.maxBodyLength:Infinity,e.insecureHTTPParser&&(E.insecureHTTPParser=e.insecureHTTPParser),u=C.request(E,function(o){if(u.destroyed)return;const i=[o],a=+o.headers["content-length"];if(w||j){const e=new po({maxRate:sn.toFiniteNumber(j)});w&&e.on("progress",Ro(e,_o(a,wo(ko(w),!0,3)))),i.push(e)}let s=o;const p=o.req||u;if(!1!==e.decompress&&o.headers["content-encoding"])switch("HEAD"!==l&&204!==o.statusCode||delete o.headers["content-encoding"],(o.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":i.push(Q.createUnzip(jo)),delete o.headers["content-encoding"];break;case"deflate":i.push(new bo),i.push(Q.createUnzip(jo)),delete o.headers["content-encoding"];break;case"br":$o&&(i.push(Q.createBrotliDecompress(So)),delete o.headers["content-encoding"])}s=i.length>1?D.pipeline(i,sn.noop):i[0];const h=D.finished(s,()=>{h(),f()}),g={status:o.statusCode,statusText:o.statusMessage,headers:new rt(o.headers),config:e,request:p};if("stream"===r)g.data=s,ut(n,t,g);else{const o=[];let i=0;s.on("data",function(n){o.push(n),i+=n.length,e.maxContentLength>-1&&i>e.maxContentLength&&(d=!0,s.destroy(),t(new rn("maxContentLength size of "+e.maxContentLength+" exceeded",rn.ERR_BAD_RESPONSE,e,p)))}),s.on("aborted",function(){if(d)return;const n=new rn("maxContentLength size of "+e.maxContentLength+" exceeded",rn.ERR_BAD_RESPONSE,e,p);s.destroy(n),t(n)}),s.on("error",function(n){u.destroyed||t(rn.from(n,null,e,p))}),s.on("end",function(){try{let e=1===o.length?o[0]:Buffer.concat(o);"arraybuffer"!==r&&(e=e.toString(c),c&&"utf8"!==c||(e=sn.stripBOM(e))),g.data=e}catch(n){return t(rn.from(n,null,e,g.request,g))}ut(n,t,g)})}m.once("abort",e=>{s.destroyed||(s.emit("error",e),s.destroy())})}),m.once("abort",e=>{t(e),u.destroy(e)}),u.on("error",function(n){t(rn.from(n,null,e,u))}),u.on("socket",function(e){e.setKeepAlive(!0,6e4)}),e.timeout){const n=parseInt(e.timeout,10);if(Number.isNaN(n))return void t(new rn("error trying to parse `config.timeout` to int",rn.ERR_BAD_OPTION_VALUE,e,u));u.setTimeout(n,function(){if(p)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new rn(n,(e.transitional||Jn).clarifyTimeoutError?rn.ETIMEDOUT:rn.ECONNABORTED,e,u)),h()})}if(sn.isStream(i)){let n=!1,t=!1;i.on("end",()=>{n=!0}),i.once("error",e=>{t=!0,u.destroy(e)}),i.on("close",()=>{n||t||h(new pt("Request stream has been aborted",e,u))}),i.pipe(u)}else u.end(i)},new Promise((e,t)=>{let o,i;const a=(e,n)=>{i||(i=!0,o&&o(e,n))},s=e=>{a(e,!0),t(e)};n(n=>{a(n),e(n)},s,e=>o=e).catch(s)});var n},Uo=Zn.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let t;function o(t){let o=t;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){const n=sn.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},Io=Zn.hasStandardBrowserEnv?{write(e,n,t,o,i,a){const s=[e+"="+encodeURIComponent(n)];sn.isNumber(t)&&s.push("expires="+new Date(t).toGMTString()),sn.isString(o)&&s.push("path="+o),sn.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};const qo=e=>e instanceof rt?{...e}:e;function Wo(e,n){n=n||{};const t={};function o(e,n,t){return sn.isPlainObject(e)&&sn.isPlainObject(n)?sn.merge.call({caseless:t},e,n):sn.isPlainObject(n)?sn.merge({},n):sn.isArray(n)?n.slice():n}function i(e,n,t){return sn.isUndefined(n)?sn.isUndefined(e)?void 0:o(void 0,e,t):o(e,n,t)}function a(e,n){if(!sn.isUndefined(n))return o(void 0,n)}function s(e,n){return sn.isUndefined(n)?sn.isUndefined(e)?void 0:o(void 0,e):o(void 0,n)}function r(t,i,a){return a in n?o(t,i):a in e?o(void 0,t):void 0}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r,headers:(e,n)=>i(qo(e),qo(n),!0)};return sn.forEach(Object.keys(Object.assign({},e,n)),function(o){const a=c[o]||i,s=a(e[o],n[o],o);sn.isUndefined(s)&&a!==r||(t[o]=s)}),t}var Po=e=>{const n=Wo({},e);let t,{data:o,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:s,headers:r,auth:c}=n;if(n.headers=r=rt.from(r),n.url=Mn(dt(n.baseURL,n.url),e.params,e.paramsSerializer),c&&r.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),sn.isFormData(o))if(Zn.hasStandardBrowserEnv||Zn.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(!1!==(t=r.getContentType())){const[e,...n]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];r.setContentType([e||"multipart/form-data",...n].join("; "))}if(Zn.hasStandardBrowserEnv&&(i&&sn.isFunction(i)&&(i=i(n)),i||!1!==i&&Uo(n.url))){const e=a&&s&&Io.read(s);e&&r.set(a,e)}return n},Bo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(n,t){const o=Po(e);let i=o.data;const a=rt.from(o.headers).normalize();let s,r,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=o;function f(){l&&l(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const o=rt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());ut(function(e){n(e),f()},function(e){t(e),f()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:o,config:e,request:h}),h=null}h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(t(new rn("Request aborted",rn.ECONNABORTED,e,h)),h=null)},h.onerror=function(){t(new rn("Network Error",rn.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let n=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";o.timeoutErrorMessage&&(n=o.timeoutErrorMessage),t(new rn(n,(o.transitional||Jn).clarifyTimeoutError?rn.ETIMEDOUT:rn.ECONNABORTED,e,h)),h=null},void 0===i&&a.setContentType(null),"setRequestHeader"in h&&sn.forEach(a.toJSON(),function(e,n){h.setRequestHeader(n,e)}),sn.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),m&&([c,p]=wo(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([r,l]=wo(d),h.upload.addEventListener("progress",r),h.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=n=>{h&&(t(!n||n.type?new pt(null,e,h):n),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=ro(o.url);v&&-1===Zn.protocols.indexOf(v)?t(new rn("Unsupported protocol "+v+":",rn.ERR_BAD_REQUEST,e)):h.send(i||null)})},Do=(e,n)=>{let t,o=new AbortController;const i=function(e){if(!t){t=!0,s();const n=e instanceof Error?e:this.reason;o.abort(n instanceof rn?n:new pt(n instanceof Error?n.message:n))}};let a=n&&setTimeout(()=>{i(new rn(`timeout ${n} of ms exceeded`,rn.ETIMEDOUT))},n);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",i));const{signal:r}=o;return r.unsubscribe=s,[r,()=>{a&&clearTimeout(a),a=null}]};const Mo=function*(e,n){let t=e.byteLength;if(!n||t<n)return void(yield e);let o,i=0;for(;i<t;)o=i+n,yield e.slice(i,o),i=o},Go=(e,n,t,o,i)=>{const a=async function*(e,n,t){for await(const o of e)yield*Mo(ArrayBuffer.isView(o)?o:await t(String(o)),n)}(e,n,i);let s,r=0,c=e=>{s||(s=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:n,value:o}=await a.next();if(n)return c(),void e.close();if(t){let e=r+=o.byteLength;t(e)}e.enqueue(new Uint8Array(o))}catch(e){throw c(e),e}},cancel:e=>(c(e),a.return())},{highWaterMark:2})},Jo="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ho=Jo&&"function"==typeof ReadableStream,Ko=Jo&&("function"==typeof TextEncoder?(Vo=new TextEncoder,e=>Vo.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Vo;const Yo=(e,...n)=>{try{return!!e(...n)}catch(e){return!1}},Zo=Ho&&Yo(()=>{let e=!1;const n=new Request(Zn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),Xo=Ho&&Yo(()=>sn.isReadableStream(new Response("").body)),Qo={stream:Xo&&(e=>e.body)};var ei;Jo&&(ei=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Qo[e]&&(Qo[e]=sn.isFunction(ei[e])?n=>n[e]():(n,t)=>{throw new rn(`Response type '${e}' is not supported`,rn.ERR_NOT_SUPPORT,t)})}));var ni=Jo&&(async e=>{let{url:n,method:t,data:o,signal:i,cancelToken:a,timeout:s,onDownloadProgress:r,onUploadProgress:c,responseType:l,headers:p,withCredentials:u="same-origin",fetchOptions:d}=Po(e);l=l?(l+"").toLowerCase():"text";let m,f,[h,g]=i||a||s?Do([i,a],s):[];const v=()=>{!m&&setTimeout(()=>{h&&h.unsubscribe()}),m=!0};let x;try{if(c&&Zo&&"get"!==t&&"head"!==t&&0!==(x=await(async(e,n)=>{const t=sn.toFiniteNumber(e.getContentLength());return null==t?(async e=>null==e?0:sn.isBlob(e)?e.size:sn.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:sn.isArrayBufferView(e)||sn.isArrayBuffer(e)?e.byteLength:(sn.isURLSearchParams(e)&&(e+=""),sn.isString(e)?(await Ko(e)).byteLength:void 0))(n):t})(p,o))){let e,t=new Request(n,{method:"POST",body:o,duplex:"half"});if(sn.isFormData(o)&&(e=t.headers.get("content-type"))&&p.setContentType(e),t.body){const[e,n]=_o(x,wo(ko(c)));o=Go(t.body,65536,e,n,Ko)}}sn.isString(u)||(u=u?"include":"omit"),f=new Request(n,{...d,signal:h,method:t.toUpperCase(),headers:p.normalize().toJSON(),body:o,duplex:"half",credentials:u});let i=await fetch(f);const a=Xo&&("stream"===l||"response"===l);if(Xo&&(r||a)){const e={};["status","statusText","headers"].forEach(n=>{e[n]=i[n]});const n=sn.toFiniteNumber(i.headers.get("content-length")),[t,o]=r&&_o(n,wo(ko(r),!0))||[];i=new Response(Go(i.body,65536,t,()=>{o&&o(),a&&v()},Ko),e)}l=l||"text";let s=await Qo[sn.findKey(Qo,l)||"text"](i,e);return!a&&v(),g&&g(),await new Promise((n,t)=>{ut(n,t,{data:s,headers:rt.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})})}catch(n){if(v(),n&&"TypeError"===n.name&&/fetch/i.test(n.message))throw Object.assign(new rn("Network Error",rn.ERR_NETWORK,e,f),{cause:n.cause||n});throw rn.from(n,n&&n.code,e,f)}});const ti={http:Fo,xhr:Bo,fetch:ni};sn.forEach(ti,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch(e){}Object.defineProperty(e,"adapterName",{value:n})}});const oi=e=>`- ${e}`,ii=e=>sn.isFunction(e)||null===e||!1===e;var ai=e=>{e=sn.isArray(e)?e:[e];const{length:n}=e;let t,o;const i={};for(let a=0;a<n;a++){let n;if(t=e[a],o=t,!ii(t)&&(o=ti[(n=String(t)).toLowerCase()],void 0===o))throw new rn(`Unknown adapter '${n}'`);if(o)break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,n])=>`adapter ${e} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new rn("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(oi).join("\n"):" "+oi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function si(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pt(null,e)}function ri(e){return si(e),e.headers=rt.from(e.headers),e.data=ct.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ai(e.adapter||et.adapter)(e).then(function(n){return si(e),n.data=ct.call(e,e.transformResponse,n),n.headers=rt.from(n.headers),n},function(n){return lt(n)||(si(e),n&&n.response&&(n.response.data=ct.call(e,e.transformResponse,n.response),n.response.headers=rt.from(n.response.headers))),Promise.reject(n)})}const ci={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{ci[e]=function(t){return typeof t===e||"a"+(n<1?"n ":" ")+e}});const li={};ci.transitional=function(e,n,t){function o(e,n){return"[Axios v1.7.4] Transitional option '"+e+"'"+n+(t?". "+t:"")}return(t,i,a)=>{if(!1===e)throw new rn(o(i," has been removed"+(n?" in "+n:"")),rn.ERR_DEPRECATED);return n&&!li[i]&&(li[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(t,i,a)}};var pi={assertOptions:function(e,n,t){if("object"!=typeof e)throw new rn("options must be an object",rn.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=n[a];if(s){const n=e[a],t=void 0===n||s(n,a,e);if(!0!==t)throw new rn("option "+a+" must be "+t,rn.ERR_BAD_OPTION_VALUE)}else if(!0!==t)throw new rn("Unknown option "+a,rn.ERR_BAD_OPTION)}},validators:ci};const ui=pi.validators;class di{constructor(e){this.defaults=e,this.interceptors={request:new Gn,response:new Gn}}async request(e,n){try{return await this._request(e,n)}catch(e){if(e instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;const t=n.stack?n.stack.replace(/^.+\n/,""):"";try{e.stack?t&&!String(e.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+t):e.stack=t}catch(e){}}throw e}}_request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=Wo(this.defaults,n);const{transitional:t,paramsSerializer:o,headers:i}=n;void 0!==t&&pi.assertOptions(t,{silentJSONParsing:ui.transitional(ui.boolean),forcedJSONParsing:ui.transitional(ui.boolean),clarifyTimeoutError:ui.transitional(ui.boolean)},!1),null!=o&&(sn.isFunction(o)?n.paramsSerializer={serialize:o}:pi.assertOptions(o,{encode:ui.function,serialize:ui.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&sn.merge(i.common,i[n.method]);i&&sn.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),n.headers=rt.concat(a,i);const s=[];let r=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p,u=0;if(!r){const e=[ri.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),p=e.length,l=Promise.resolve(n);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=n;for(u=0;u<p;){const e=s[u++],n=s[u++];try{d=e(d)}catch(e){n.call(this,e);break}}try{l=ri.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Mn(dt((e=Wo(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}sn.forEach(["delete","get","head","options"],function(e){di.prototype[e]=function(n,t){return this.request(Wo(t||{},{method:e,url:n,data:(t||{}).data}))}}),sn.forEach(["post","put","patch"],function(e){function n(n){return function(t,o,i){return this.request(Wo(i||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:o}))}}di.prototype[e]=n(),di.prototype[e+"Form"]=n(!0)});var mi=di;class fi{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(e){n=e});const t=this;this.promise.then(e=>{if(!t._listeners)return;let n=t._listeners.length;for(;n-- >0;)t._listeners[n](e);t._listeners=null}),this.promise.then=e=>{let n;const o=new Promise(e=>{t.subscribe(e),n=e}).then(e);return o.cancel=function(){t.unsubscribe(n)},o},e(function(e,o,i){t.reason||(t.reason=new pt(e,o,i),n(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new fi(function(n){e=n}),cancel:e}}}var hi=fi;const gi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gi).forEach(([e,n])=>{gi[n]=e});var vi=gi;const xi=function e(n){const t=new mi(n),o=he(mi.prototype.request,t);return sn.extend(o,mi.prototype,t,{allOwnKeys:!0}),sn.extend(o,t,null,{allOwnKeys:!0}),o.create=function(t){return e(Wo(n,t))},o}(et);xi.Axios=mi,xi.CanceledError=pt,xi.CancelToken=hi,xi.isCancel=lt,xi.VERSION=so,xi.toFormData=qn,xi.AxiosError=rn,xi.Cancel=xi.CanceledError,xi.all=function(e){return Promise.all(e)},xi.spread=function(e){return function(n){return e.apply(null,n)}},xi.isAxiosError=function(e){return sn.isObject(e)&&!0===e.isAxiosError},xi.mergeConfig=Wo,xi.AxiosHeaders=rt,xi.formToJSON=e=>Xn(sn.isHTMLForm(e)?new FormData(e):e),xi.getAdapter=ai,xi.HttpStatusCode=vi,xi.default=xi;var bi=xi;const{CanceledError:yi}=bi,wi=/screenshot(\-\d+?)?\.needle\.(webp|png|jpg|jpeg)/;async function _i(e,n){const t=n.baseUrl+de.jobs.post_update,o={...me(n),job_id:e.identifier,status:e.status},i={status_message:e.status_message,error:e.error,progress:e.progress},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)}).catch(e=>(console.error(e),null));return!!a&&a.ok}async function ki(e,n){const t=n.baseUrl+de.jobs.get_status,o={...me(n),job_id:e,org:n.org},i=await fetch(t,{...fe,method:"GET",headers:o}).catch(e=>(n.verbose?console.error("Failed to get job status",e):console.error("Failed to get job status",e.message),null));return i?i.ok?await i.json():(console.error("Failed to get status",i.status,await i.text()),null):null}var ji=vn(function(e){!function(){var n="input is invalid type",t="object"==typeof window,o=t?window:{};o.JS_MD5_NO_WINDOW&&(t=!1);var i=!t&&"object"==typeof self,a=!o.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?o=gn:i&&(o=self);var s,r=!o.JS_MD5_NO_COMMON_JS&&e.exports,c=!o.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],u=[0,8,16,24],d=["hex","array","digest","buffer","arrayBuffer","base64"],m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(c){var h=new ArrayBuffer(68);s=new Uint8Array(h),f=new Uint32Array(h)}var v=Array.isArray;!o.JS_MD5_NO_NODE_JS&&v||(v=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var b=ArrayBuffer.isView;!c||!o.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&b||(b=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(n);if(c&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!v(e)&&!b(e))throw new Error(n);return[e,!1]},w=function(e){return function(n){return new k(!0).update(n)[e]()}},_=function(e){return function(n,t){return new j(n,!0).update(t)[e]()}};function k(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(c){var n=new ArrayBuffer(68);this.buffer8=new Uint8Array(n),this.blocks=new Uint32Array(n)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function j(e,n){var t,o=y(e);if(e=o[0],o[1]){var i,a=[],s=e.length,r=0;for(t=0;t<s;++t)(i=e.charCodeAt(t))<128?a[r++]=i:i<2048?(a[r++]=192|i>>>6,a[r++]=128|63&i):i<55296||i>=57344?(a[r++]=224|i>>>12,a[r++]=128|i>>>6&63,a[r++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++t)),a[r++]=240|i>>>18,a[r++]=128|i>>>12&63,a[r++]=128|i>>>6&63,a[r++]=128|63&i);e=a}e.length>64&&(e=new k(!0).update(e).array());var c=[],l=[];for(t=0;t<64;++t){var p=e[t]||0;c[t]=92^p,l[t]=54^p}k.call(this,n),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=n}k.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");for(var n,t,o=y(e),i=o[1],a=0,s=(e=o[0]).length,r=this.blocks,l=this.buffer8;a<s;){if(this.hashed&&(this.hashed=!1,r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),i)if(c)for(t=this.start;a<s&&t<64;++a)(n=e.charCodeAt(a))<128?l[t++]=n:n<2048?(l[t++]=192|n>>>6,l[t++]=128|63&n):n<55296||n>=57344?(l[t++]=224|n>>>12,l[t++]=128|n>>>6&63,l[t++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),l[t++]=240|n>>>18,l[t++]=128|n>>>12&63,l[t++]=128|n>>>6&63,l[t++]=128|63&n);else for(t=this.start;a<s&&t<64;++a)(n=e.charCodeAt(a))<128?r[t>>>2]|=n<<u[3&t++]:n<2048?(r[t>>>2]|=(192|n>>>6)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]):n<55296||n>=57344?(r[t>>>2]|=(224|n>>>12)<<u[3&t++],r[t>>>2]|=(128|n>>>6&63)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),r[t>>>2]|=(240|n>>>18)<<u[3&t++],r[t>>>2]|=(128|n>>>12&63)<<u[3&t++],r[t>>>2]|=(128|n>>>6&63)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]);else if(c)for(t=this.start;a<s&&t<64;++a)l[t++]=e[a];else for(t=this.start;a<s&&t<64;++a)r[t>>>2]|=e[a]<<u[3&t++];this.lastByteIndex=t,this.bytes+=t-this.start,t>=64?(this.start=t-64,this.hash(),this.hashed=!0):this.start=t}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,n=this.lastByteIndex;e[n>>>2]|=p[3&n],n>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},k.prototype.hash=function(){var e,n,t,o,i,a,s=this.blocks;this.first?n=((n=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879|0)^(t=((t=(-271733879^(o=((o=(-1732584194^2004318071&e)+s[1]-117830708)<<12|o>>>20)+e|0)&(-271733879^e))+s[2]-1126478375)<<17|t>>>15)+o|0)&(o^e))+s[3]-1316259209)<<22|n>>>10)+t|0:(e=this.h0,n=this.h1,n=((n+=((e=((e+=((o=this.h3)^n&((t=this.h2)^o))+s[0]-680876936)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[1]-389564586)<<12|o>>>20)+e|0)&(e^n))+s[2]+606105819)<<17|t>>>15)+o|0)&(o^e))+s[3]-1044525330)<<22|n>>>10)+t|0),n=((n+=((e=((e+=(o^n&(t^o))+s[4]-176418897)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[5]+1200080426)<<12|o>>>20)+e|0)&(e^n))+s[6]-1473231341)<<17|t>>>15)+o|0)&(o^e))+s[7]-45705983)<<22|n>>>10)+t|0,n=((n+=((e=((e+=(o^n&(t^o))+s[8]+1770035416)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[9]-1958414417)<<12|o>>>20)+e|0)&(e^n))+s[10]-42063)<<17|t>>>15)+o|0)&(o^e))+s[11]-1990404162)<<22|n>>>10)+t|0,n=((n+=((e=((e+=(o^n&(t^o))+s[12]+1804603682)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[13]-40341101)<<12|o>>>20)+e|0)&(e^n))+s[14]-1502002290)<<17|t>>>15)+o|0)&(o^e))+s[15]+1236535329)<<22|n>>>10)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[1]-165796510)<<5|e>>>27)+n|0)^n))+s[6]-1069501632)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[11]+643717713)<<14|t>>>18)+o|0)^o))+s[0]-373897302)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[5]-701558691)<<5|e>>>27)+n|0)^n))+s[10]+38016083)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[15]-660478335)<<14|t>>>18)+o|0)^o))+s[4]-405537848)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[9]+568446438)<<5|e>>>27)+n|0)^n))+s[14]-1019803690)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[3]-187363961)<<14|t>>>18)+o|0)^o))+s[8]+1163531501)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[13]-1444681467)<<5|e>>>27)+n|0)^n))+s[2]-51403784)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[7]+1735328473)<<14|t>>>18)+o|0)^o))+s[12]-1926607734)<<20|n>>>12)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[5]-378558)<<4|e>>>28)+n|0))+s[8]-2022574463)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[11]+1839030562)<<16|t>>>16)+o|0))+s[14]-35309556)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[1]-1530992060)<<4|e>>>28)+n|0))+s[4]+1272893353)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[7]-155497632)<<16|t>>>16)+o|0))+s[10]-1094730640)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[13]+681279174)<<4|e>>>28)+n|0))+s[0]-358537222)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[3]-722521979)<<16|t>>>16)+o|0))+s[6]+76029189)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[9]-640364487)<<4|e>>>28)+n|0))+s[12]-421815835)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[15]+530742520)<<16|t>>>16)+o|0))+s[2]-995338651)<<23|n>>>9)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[0]-198630844)<<6|e>>>26)+n|0)|~t))+s[7]+1126891415)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[14]-1416354905)<<15|t>>>17)+o|0)|~e))+s[5]-57434055)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[12]+1700485571)<<6|e>>>26)+n|0)|~t))+s[3]-1894986606)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[10]-1051523)<<15|t>>>17)+o|0)|~e))+s[1]-2054922799)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[8]+1873313359)<<6|e>>>26)+n|0)|~t))+s[15]-30611744)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[6]-1560198380)<<15|t>>>17)+o|0)|~e))+s[13]+1309151649)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[4]-145523070)<<6|e>>>26)+n|0)|~t))+s[11]-1120210379)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[2]+718787259)<<15|t>>>17)+o|0)|~e))+s[9]-343485551)<<21|n>>>11)+t|0,this.first?(this.h0=e+1732584193|0,this.h1=n-271733879|0,this.h2=t-1732584194|0,this.h3=o+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+n|0,this.h2=this.h2+t|0,this.h3=this.h3+o|0)},k.prototype.toString=k.prototype.hex=function(){this.finalize();var e=this.h0,n=this.h1,t=this.h2,o=this.h3;return l[e>>>4&15]+l[15&e]+l[e>>>12&15]+l[e>>>8&15]+l[e>>>20&15]+l[e>>>16&15]+l[e>>>28&15]+l[e>>>24&15]+l[n>>>4&15]+l[15&n]+l[n>>>12&15]+l[n>>>8&15]+l[n>>>20&15]+l[n>>>16&15]+l[n>>>28&15]+l[n>>>24&15]+l[t>>>4&15]+l[15&t]+l[t>>>12&15]+l[t>>>8&15]+l[t>>>20&15]+l[t>>>16&15]+l[t>>>28&15]+l[t>>>24&15]+l[o>>>4&15]+l[15&o]+l[o>>>12&15]+l[o>>>8&15]+l[o>>>20&15]+l[o>>>16&15]+l[o>>>28&15]+l[o>>>24&15]},k.prototype.array=k.prototype.digest=function(){this.finalize();var e=this.h0,n=this.h1,t=this.h2,o=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&o,o>>>8&255,o>>>16&255,o>>>24&255]},k.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),n=new Uint32Array(e);return n[0]=this.h0,n[1]=this.h1,n[2]=this.h2,n[3]=this.h3,e},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.base64=function(){for(var e,n,t,o="",i=this.array(),a=0;a<15;)e=i[a++],n=i[a++],t=i[a++],o+=m[e>>>2]+m[63&(e<<4|n>>>4)]+m[63&(n<<2|t>>>6)]+m[63&t];return o+(m[(e=i[a])>>>2]+m[e<<4&63]+"==")},(j.prototype=new k).finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();k.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),k.prototype.finalize.call(this)}};var S=function(){var e=w("hex");a&&(e=function(e){var t,i=g,a=x.Buffer;return t=a.from&&!o.JS_MD5_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(o){if("string"==typeof o)return i.createHash("md5").update(o,"utf8").digest("hex");if(null==o)throw new Error(n);return o.constructor===ArrayBuffer&&(o=new Uint8Array(o)),v(o)||b(o)||o.constructor===a?i.createHash("md5").update(t(o)).digest("hex"):e(o)}}(e)),e.create=function(){return new k},e.update=function(n){return e.create().update(n)};for(var t=0;t<d.length;++t){var i=d[t];e[i]=w(i)}return e}();S.md5=S,S.md5.hmac=function(){var e=_("hex");e.create=function(e){return new j(e)},e.update=function(n,t){return e.create(n).update(t)};for(var n=0;n<d.length;++n){var t=d[n];e[t]=_(t)}return e}(),r?e.exports=S:o.md5=S}()});function Si(e,n=0){return Ci(e,n,2).getUint16(0,!0)}function $i(e,n=0){return Ci(e,n,4).getUint32(0,!0)}function Ti(e,n=0,t=e.byteLength){const o=e.slice(n,n+t);return Oi.decode(new Uint8Array(o))}function Ei(e,n,t=0){if(e.length<n.length+t)return!1;for(const[o,i]of n.entries())if(null!==i&&i!==e[o+t])return!1;return!0}function Ci(e,n,t){const o=e.slice(n,n+t);return new DataView(new Uint8Array(o).buffer)}const Oi=new TextDecoder("utf8"),Ri=[["db","application/vnd.sqlite3",[83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0]],["woff","font/woff",[119,79,70,70]],["woff2","font/woff2",[119,79,70,50]],["bmp","image/bmp",[66,77]],["gif","image/gif",[71,73,70,56,55,97]],["gif","image/gif",[71,73,70,56,57,97]],["heic","image/heic",[102,116,121,112,104,101,105],{offset:4}],["heic","image/heic",[102,116,121,112,109],{offset:4}],["ico","image/x-icon",[0,0,1,0]],["jpg","image/jpeg",[255,216,255]],["pdf","application/pdf",[37,80,68,70,45]],["png","image/png",[137,80,78,71,13,10,26,10]],["7z","application/x-7z-compressed",[55,122,188,175,39,28]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,0]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,1,0]],["rtf","application/rtf",[123,92,114,116,102,49]],["bz2","application/x-bzip2",[66,90,104]],["gz","application/gzip",[31,139]],["tar","application/x-tar",[117,115,116,97,114,0,48,48],{offset:257}],["tar","application/x-tar",[117,115,116,97,114,32,32,0],{offset:257}],["tif","image/tiff",[73,73,42,0]],["tiff","image/tiff",[77,77,0,42]],["zip","application/zip",[80,75,3,4],{exact:!1}],["zip","application/zip",[80,75,5,6]],["mp3","audio/mp3",[255,251]],["mp3","audio/mp3",[255,243]],["mp3","audio/mp3",[255,242]],["mp3","audio/mp3",[73,68,51]],["mp4","video/mp4",[102,116,121,112,105,115,111,109],{offset:4}],["avi","video/x-msvideo",[82,73,70,70,null,null,null,null,65,86,73,32]],["wav","audio/wav",[82,73,70,70,null,null,null,null,87,65,86,69]],["ogx","application/ogg",[79,103,103,83],{exact:!1},[["oga","audio/ogg",[127,70,76,65,67],{offset:28}],["ogg","audio/ogg",[1,118,111,114,98,105,115],{offset:28}],["ogm","video/ogg",[1,118,105,100,101,111,0],{offset:28}],["ogv","video/ogg",[128,116,104,101,111,114,97],{offset:28}]]],["webp","image/webp",[82,73,70,70,null,null,null,null,87,69,66,80]],["psd","image/vnd.adobe.photoshop",[56,66,80,83]],["flac","audio/x-flac",[102,76,97,67]],["wasm","application/wasm",[0,97,115,109]],["deb","application/x-deb",[33,60,97,114,99,104,62,10]],["exe","application/x-msdownload",[77,90]],["exe","application/x-msdownload",[90,77]],["class","application/java-vm",[202,254,186,190]]];function zi(e){return e.flatMap(([e,n,t,o={},i=[]])=>[[e,n,t,o],...i])}function Ni(e,n){const t=Si(e,26),o=Ti(e,30,t),[i]=o.split("/"),a=o.endsWith(".xml");return"META-INF"===i?{ext:"jar",mime:"application/java-archive"}:"ppt"===i&&a?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:"word"===i&&a?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:"xl"===i&&a?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:"mimetype"===i?function(e,n){const t=$i(e,18),o=$i(e,22),i=Si(e,28);if(t===o){const o=Ti(e,30+n+i,t);if("application/vnd.oasis.opendocument.presentation"===o)return{ext:"odp",mime:o};if("application/vnd.oasis.opendocument.spreadsheet"===o)return{ext:"ods",mime:o};if("application/vnd.oasis.opendocument.text"===o)return{ext:"odt",mime:o};if("application/epub+zip"===o)return{ext:"epub",mime:o}}}(e,t)??n:n}const Ai=function(e){return zi(e).map(([e,n,t,{offset:o=0}={}])=>t.length+o).reduce((e,n)=>n>e?n:e,0)}(Ri);function Li(e,n){for(const[t,o,i,{exact:a=!0,offset:s=0}={},r=[]]of n)if(Ei(e,i,s)){if("zip"===t&&!a)return Ni(e.buffer,{ext:t,mime:o});if(!a&&r.length)for(const[n,t,o,{offset:i=0}={}]of r)if(Ei(e,o,i))return{ext:n,mime:t};return{ext:t,mime:o}}}function Fi(e,n,t=void 0){const o=function(e,n,t){let o=0;for(;;){let n=e.indexOf("\\",o);if(-1===n)break;o=n+1,e=e.replace("\\","/")}return e}(e).split("/").pop()||e,i=(null==t?void 0:t.type)||Ii(n,e),a=new File([n],o,{type:i});return a.path=e,a}function Ui(e){const n=ji.md5.create();return n.update(e),n.base64()}function Ii(e,n=void 0){const t=function(e,{extra:n=!1,hint:t}={}){const o=new Uint8Array(e.slice(0,Ai));if(t){const e=function(e,{ext:n,mime:t}){return n||t?zi(e).filter(e=>e[0]===n||e[1]===t):[]}(Ri,t);if(e.length>0){const n=Li(o,e);if(void 0!==n)return n}}return Li(o,Ri)||(n?function(e){return function(e){try{const n=Ti(e);if(!function(e){for(let n=0;n<e.length;n++)try{const t=e.charCodeAt(n);if(65533===t||t<=8)return!1}catch{return!1}return!0}(n))return;try{return JSON.parse(n),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(t)return t.mime;const o=new Uint8Array(e).subarray(0,4);let i="";for(var a=0;a<o.length;a++)i+=o[a].toString(16);let s="unknown";switch(i){case"676c5446":s="model/gltf-binary";break;case"89504e47":s="image/png";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;default:s="unknown"}return"unknown"===s&&"string"==typeof n&&(s=function(e){const n=e.toLowerCase();let t="";return n.endsWith(".html")||n.endsWith(".html.gz")||n.endsWith(".html.br")?t="text/html":n.endsWith(".js")||n.endsWith(".js.gz")||n.endsWith(".js.br")||n.endsWith(".mjs")||n.endsWith(".mjs.gz")||n.endsWith(".mjs.br")||n.endsWith(".cjs")||n.endsWith(".cjs.gz")||n.endsWith(".cjs.br")?t="application/javascript":n.endsWith(".wasm")?t="application/wasm":n.endsWith(".css")||n.endsWith(".css.gz")||n.endsWith(".css.br")?t="text/css":n.endsWith(".json")?t="application/json":n.endsWith(".txt")?t="text/plain":n.endsWith(".md")?t="text/markdown":n.endsWith(".yaml")||n.endsWith(".yml")?t="application/yaml":n.endsWith(".bin")?t="application/octet-stream":n.endsWith(".png")?t="image/png":n.endsWith(".jpg")||n.endsWith(".jpeg")?t="image/jpeg":n.endsWith(".gif")?t="image/gif":n.endsWith(".webp")?t="image/webp":n.endsWith(".avif")?t="image/avif":n.endsWith(".bmp")?t="image/bmp":n.endsWith(".tiff")||n.endsWith(".tif")?t="image/tiff":n.endsWith(".ico")?t="image/x-icon":n.endsWith(".svg")?t="image/svg+xml":n.endsWith(".xml")?t="application/xml":n.endsWith(".hdr")?t="image/vnd.radiance":n.endsWith(".exr")?t="image/x-exr":n.endsWith(".ktx2")?t="image/ktx2":n.endsWith(".ktx")?t="image/ktx":n.endsWith(".dds")?t="image/vnd-ms.dds":n.endsWith(".ogg")?t="audio/ogg":n.endsWith(".mp3")?t="audio/mpeg":n.endsWith(".wav")?t="audio/wave":n.endsWith(".flac")?t="audio/flac":n.endsWith(".m4a")?t="audio/mp4":n.endsWith(".aac")?t="audio/aac":n.endsWith(".mp4")?t="video/mp4":n.endsWith(".webm")?t="video/webm":n.endsWith(".mov")?t="video/quicktime":n.endsWith(".woff2")?t="font/woff2":n.endsWith(".woff")?t="font/woff":n.endsWith(".ttf")?t="font/ttf":n.endsWith(".otf")?t="font/otf":n.endsWith(".zip")?t="application/zip":n.endsWith(".glb")?t="model/gltf-binary":n.endsWith(".gltf")?t="model/gltf+json":n.endsWith(".vrm")?t="model/gltf-binary":n.endsWith(".usdz")?t="model/vnd.usdz+zip":n.endsWith(".usda")?t="model/vnd.usd-usda":n.endsWith(".usdc")?t="model/vnd.usd-usdc":n.endsWith(".usd")?t="model/vnd.usd-usd":n.endsWith(".mtl")?t="model/mtl":n.endsWith(".obj")?t="model/obj":n.endsWith(".fbx")?t="model/vnd.autodesk.fbx":n.endsWith(".stl")?t="model/stl":n.endsWith(".mtlx")?t="application/materialx+xml":n.endsWith(".ply")?t="model/ply":n.endsWith(".dae")?t="model/vnd.collada+xml":n.endsWith(".3mf")?t="model/3mf":(n.endsWith(".splat")||n.endsWith(".spz"))&&(t="application/octet-stream"),t}(n)),s}function qi(e,n){const t=e.toLowerCase();return"application/gzip"===n||"application/brotli"===n?(t.endsWith(".html.gz")||t.endsWith(".html.br")?(n="text/html",e=e.substring(0,e.length-3)):t.endsWith(".js.gz")||t.endsWith(".js.br")||t.endsWith(".mjs.gz")||t.endsWith(".mjs.br")||t.endsWith(".cjs.gz")||t.endsWith(".cjs.br")?(n="application/javascript",e=e.substring(0,e.length-3)):t.endsWith(".css.gz")||t.endsWith(".css.br")?(n="text/css",e=e.substring(0,e.length-3)):t.endsWith(".json.gz")||t.endsWith(".json.br")?(n="text/json",e=e.substring(0,e.length-3)):t.endsWith(".txt.gz")||t.endsWith(".txt.br")?(n="text/plain",e=e.substring(0,e.length-3)):t.endsWith(".wasm.gz")||t.endsWith(".wasm.br")?(n="application/wasm",e=e.substring(0,e.length-3)):t.endsWith(".bin.gz")||t.endsWith(".bin.br")?(n="application/octet-stream",e=e.substring(0,e.length-3)):t.endsWith(".png.gz")||t.endsWith(".png.br")?(n="image/png",e=e.substring(0,e.length-3)):t.endsWith(".jpg.gz")||t.endsWith(".jpg.br")||t.endsWith(".jpeg.gz")||t.endsWith(".jpeg.br")?(n="image/jpeg",e=e.substring(0,e.length-3)):t.endsWith(".gif.gz")||t.endsWith(".gif.br")?(n="image/gif",e=e.substring(0,e.length-3)):t.endsWith(".webp.gz")||t.endsWith(".webp.br")?(n="image/webp",e=e.substring(0,e.length-3)):t.endsWith(".svg.gz")||t.endsWith(".svg.br")?(n="image/svg+xml",e=e.substring(0,e.length-3)):t.endsWith(".xml.gz")||t.endsWith(".xml.br")?(n="application/xml",e=e.substring(0,e.length-3)):t.endsWith(".ico.gz")||t.endsWith(".ico.br")?(n="image/x-icon",e=e.substring(0,e.length-3)):t.endsWith(".avif.gz")||t.endsWith(".avif.br")?(n="image/avif",e=e.substring(0,e.length-3)):t.endsWith(".bmp.gz")||t.endsWith(".bmp.br")?(n="image/bmp",e=e.substring(0,e.length-3)):t.endsWith(".tiff.gz")||t.endsWith(".tiff.br")||t.endsWith(".tif.gz")||t.endsWith(".tif.br")?(n="image/tiff",e=e.substring(0,e.length-3)):t.endsWith(".hdr.gz")||t.endsWith(".hdr.br")?(n="image/vnd.radiance",e=e.substring(0,e.length-3)):t.endsWith(".exr.gz")||t.endsWith(".exr.br")?(n="image/x-exr",e=e.substring(0,e.length-3)):t.endsWith(".ktx2.gz")||t.endsWith(".ktx2.br")?(n="image/ktx2",e=e.substring(0,e.length-3)):t.endsWith(".ktx.gz")||t.endsWith(".ktx.br")?(n="image/ktx",e=e.substring(0,e.length-3)):t.endsWith(".dds.gz")||t.endsWith(".dds.br")?(n="image/vnd-ms.dds",e=e.substring(0,e.length-3)):t.endsWith(".webm.gz")||t.endsWith(".webm.br")?(n="video/webm",e=e.substring(0,e.length-3)):t.endsWith(".mp4.gz")||t.endsWith(".mp4.br")?(n="video/mp4",e=e.substring(0,e.length-3)):t.endsWith(".mov.gz")||t.endsWith(".mov.br")?(n="video/quicktime",e=e.substring(0,e.length-3)):t.endsWith(".mp3.gz")||t.endsWith(".mp3.br")?(n="audio/mpeg",e=e.substring(0,e.length-3)):t.endsWith(".wav.gz")||t.endsWith(".wav.br")?(n="audio/wave",e=e.substring(0,e.length-3)):t.endsWith(".ogg.gz")||t.endsWith(".ogg.br")?(n="audio/ogg",e=e.substring(0,e.length-3)):t.endsWith(".flac.gz")||t.endsWith(".flac.br")?(n="audio/flac",e=e.substring(0,e.length-3)):t.endsWith(".m4a.gz")||t.endsWith(".m4a.br")?(n="audio/mp4",e=e.substring(0,e.length-3)):t.endsWith(".aac.gz")||t.endsWith(".aac.br")?(n="audio/aac",e=e.substring(0,e.length-3)):t.endsWith(".woff2.gz")||t.endsWith(".woff2.br")?(n="font/woff2",e=e.substring(0,e.length-3)):t.endsWith(".woff.gz")||t.endsWith(".woff.br")?(n="font/woff",e=e.substring(0,e.length-3)):t.endsWith(".ttf.gz")||t.endsWith(".ttf.br")?(n="font/ttf",e=e.substring(0,e.length-3)):t.endsWith(".otf.gz")||t.endsWith(".otf.br")?(n="font/otf",e=e.substring(0,e.length-3)):t.endsWith(".md.gz")||t.endsWith(".md.br")?(n="text/markdown",e=e.substring(0,e.length-3)):t.endsWith(".yaml.gz")||t.endsWith(".yaml.br")||t.endsWith(".yml.gz")||t.endsWith(".yml.br")?(n="application/yaml",e=e.substring(0,e.length-3)):t.endsWith(".zip.gz")||t.endsWith(".zip.br")?(n="application/zip",e=e.substring(0,e.length-3)):t.endsWith(".glb.gz")||t.endsWith(".glb.br")?(n="model/gltf-binary",e=e.substring(0,e.length-3)):t.endsWith(".gltf.gz")||t.endsWith(".gltf.br")?(n="model/gltf+json",e=e.substring(0,e.length-3)):t.endsWith(".vrm.gz")||t.endsWith(".vrm.br")?(n="model/gltf-binary",e=e.substring(0,e.length-3)):t.endsWith(".usdz.gz")||t.endsWith(".usdz.br")?(n="model/vnd.usdz+zip",e=e.substring(0,e.length-3)):t.endsWith(".usda.gz")||t.endsWith(".usda.br")?(n="model/vnd.usd-usda",e=e.substring(0,e.length-3)):t.endsWith(".usdc.gz")||t.endsWith(".usdc.br")?(n="model/vnd.usd-usdc",e=e.substring(0,e.length-3)):t.endsWith(".usd.gz")||t.endsWith(".usd.br")?(n="model/vnd.usd-usd",e=e.substring(0,e.length-3)):t.endsWith(".obj.gz")||t.endsWith(".obj.br")?(n="model/obj",e=e.substring(0,e.length-3)):t.endsWith(".mtl.gz")||t.endsWith(".mtl.br")?(n="model/mtl",e=e.substring(0,e.length-3)):t.endsWith(".stl.gz")||t.endsWith(".stl.br")?(n="model/stl",e=e.substring(0,e.length-3)):t.endsWith(".mtlx.gz")||t.endsWith(".mtlx.br")?(n="application/materialx+xml",e=e.substring(0,e.length-3)):t.endsWith(".ply.gz")||t.endsWith(".ply.br")?(n="model/ply",e=e.substring(0,e.length-3)):t.endsWith(".dae.gz")||t.endsWith(".dae.br")?(n="model/vnd.collada+xml",e=e.substring(0,e.length-3)):t.endsWith(".3mf.gz")||t.endsWith(".3mf.br")?(n="model/3mf",e=e.substring(0,e.length-3)):(t.endsWith(".splat.gz")||t.endsWith(".splat.br")||t.endsWith(".spz.gz")||t.endsWith(".spz.br"))&&(n="application/octet-stream",e=e.substring(0,e.length-3)),{filename:e,mimetype:n}):null}function Wi(e,n=void 0,t=!0){const o=Math.abs(e);if(o>=1099511627776){let o=t?" TB":"";return(e/1099511627776).toFixed(void 0===n?2:n)+o}if(o>=1073741824){let o=t?" GB":"";return(e/1073741824).toFixed(void 0===n?2:n)+o}if(o>=1048576){let o=t?" MB":"";return(e/1048576).toFixed(void 0===n?1:n)+o}if(o>=1024){let o=t?" KB":"";return(e/1024).toFixed(void 0===n?0:n)+o}let i=t?" B":"";return e.toFixed(0)+i}function Pi(e){return e.split("/").reduce((e,n)=>("."===n||(".."===n?e.pop():null!=n&&n.length&&e.push(n)),e),[]).join("/")}function Bi(e,n){let t=n;for(;t<e.length&&0!==e[t];)t++;return t>=e.length?null:new TextDecoder("latin1").decode(e.subarray(n,t))}async function Di(e){return new Promise(n=>setTimeout(n,e))}function Mi(e,n,t=void 0){e instanceof Date&&(e=e.getTime()),n instanceof Date&&(n=n.getTime());let o=n-e,i=o>0;const a=!1!==(null==t?void 0:t.prefix),s=!1!==(null==t?void 0:t.suffix);let r="",c="";o<0&&(o=-o);const l=Math.floor(o/1e3),p=Math.floor(l/60),u=Math.floor(p/60),d=Math.floor(u/24);if(null!=(null==t?void 0:t.limitInDays)&&d>=t.limitInDays)return a&&(r="on "),`${r}${new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}${c}`;r=a?i?"":"in ":"",c=s&&i?" ago":"";const m=Math.floor(d/30),f=Math.floor(m/12);return 1===f?`${r}1 year${c}`:f>1?`${r}${Math.floor(f)} years${c}`:1===m?`${r}1 month${c}`:m>1?`${r}${Math.floor(m)} months${c}`:1===d?i&&null!=t&&t.allowSimple?"yesterday":`${r}1 day${c}`:d>1?`${r}${Math.floor(d)} days${c}`:1===u?`${r}1 hour${c}`:u>1?`${r}${Math.floor(u)} hours${c}`:1===p?`${r}1 minute${c}`:p>1?`${r}${Math.floor(p)} minutes${c}`:null!=t&&t.allowSimple&&l<10?"just now":`${r}${l.toFixed(0)} seconds${c}`}const Gi=/^image_(?<image_lod>\d+)_|^mesh_lod_(?<mesh_lod>\d+)_/;function Ji(e){return e.includes("\\u")?JSON.parse(`"${e}"`):decodeURIComponent(e)}function Hi(e){let n=null,t="";const o=e.filter(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());if(1===o.length)return n=o[0],n;const i=e.filter(e=>e.name.toLowerCase().endsWith(".html")||e.name.toLowerCase().endsWith(".htm")||e.name.toLowerCase().endsWith(".html.gz")||e.name.toLowerCase().endsWith(".html.br"));if(1===i.length)return i[0];if(i.length>1){const e=new Map;for(const n of i){const t=n.path.split("/");let o=e.get(t.length);o||(o=[],e.set(t.length,o)),o.push(n)}const o=Array.from(e.keys()).sort((e,n)=>e-n);if(o.length>0)for(const t of o){const o=e.get(t);if(!o)continue;const i=o.find(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());return i?(n=i,n):(n=o[0],n)}return t="Invalid upload: Multiple HTML files found but could not determine root.",console.error(t,i.map(e=>e.path||e.name)),{error:t}}const a=e.filter(e=>e.name.toLowerCase().endsWith(".glb")||e.name.toLowerCase().endsWith(".gltf")||e.name.toLowerCase().endsWith(".vrm"));if(a.length>1){const e=function(e){const n=new Array,t=/(mesh_lod|image)_\d_(.{1,50})/;for(const o of e){if(t.test(o.name))continue;const e=o.name.toLowerCase();(e.endsWith(".gltf")||e.endsWith(".vrm")||e.endsWith(".glb"))&&n.push(o)}return 1==n.length?n[0]:Yi(n)}(a);return e?(n=e,n):(t="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(t,a.map(e=>e.path||e.name)),{error:t})}if(1===a.length)return n=a[0],n;const s=e.filter(e=>e.name.toLowerCase().endsWith(".usdz")||e.name.toLowerCase().endsWith(".usd")||e.name.toLowerCase().endsWith(".usda")||e.name.toLowerCase().endsWith(".usdc"));s.length>=1&&(n=Yi(s));const r=e.filter(e=>e.name.toLowerCase().endsWith(".fbx"));if(r.length>1)return t="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(t,r),{error:t};if(1===r.length)return n=r[0],n;const c=e.filter(e=>e.name.toLowerCase().endsWith(".obj"));if(c.length>1)return t="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(t,c),{error:t};if(1===c.length)return n=c[0],n;const l=e.filter(e=>e.name.toLowerCase().endsWith(".stl"));if(l.length>1)return t="Invalid upload: Multiple stl files found. This is currently not supported.",console.error(t,l),{error:t};if(1===l.length)return n=l[0],n;if(1===e.length&&!e[0].arrayBuffer&&e[0].path.toLowerCase().startsWith("http"))return n=e[0],n;const p=e.filter(e=>e.name.toLowerCase().endsWith("package.json"));if(1===p.length)return n=p[0],n;if(p.length>1)return t="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(t,p),{error:t};const u=e.filter(e=>e.name.toLowerCase().endsWith(".mtlx"));if(u.length>1)return t="Invalid upload: Multiple mtlx files found. This is currently not supported.",console.error(t,u),{error:t};if(1===u.length)return n=u[0],n;const d=e.filter(e=>{const n=e.name.toLowerCase();return n.endsWith(".exr")||n.endsWith(".hdr")||n.endsWith(".hdri")});return d.length>1?(t="Invalid upload: Multiple HDRI files found. Upload them as separate content items.",console.error(t,d.map(e=>e.path||e.name)),{error:t}):1===d.length?(n=d[0],n):n||{error:"No supported file to upload found..."}}const Ki=new Set(["glb","gltf","vrm"]),Vi=new Set(["fbx","obj","stl","usd","usda","usdz"]);function Yi(e){let n=-1,t=Infinity;for(let o=0;o<e.length;o++){const i=e[o];i.path.split("/").length<t&&(t=i.path.split("/").length,n=o)}return n<0?null:e[n]}class Zi{constructor(e,n){this.totalFiles=e,this.estimatedTotalSize=n,this.uploadedSize=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime,this.lastUploadedSize=0,this.speedEMA=null,this.emaFactor=.1,this.smoothedRemainingTime=null,this.recentSpeeds=new Array,this.maxRecentSpeeds=20,this.initialEstimateThreshold=.05}updateProgress(e){const n=Date.now(),t=(n-this.lastUpdateTime)/1e3,o=e-this.lastUploadedSize;if(this.uploadedSize=e,t>0&&o>0){this.recentSpeeds.push(o/t),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();const e=this.recentSpeeds.reduce((e,n)=>e+n,0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?e:this.emaFactor*e+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=n,this.lastUploadedSize=e;const i=this.uploadedSize/this.estimatedTotalSize,a=(n-this.startTime)/1e3,s=this.speedEMA&&this.speedEMA>0?this.speedEMA:this.uploadedSize/a;let r;if(r=s>0?(this.estimatedTotalSize-this.uploadedSize)/s:Infinity,i>=this.initialEstimateThreshold)if(null===this.smoothedRemainingTime)this.smoothedRemainingTime=r;else{const e=.1;this.smoothedRemainingTime=(1-e)*this.smoothedRemainingTime+e*r}else this.smoothedRemainingTime=a/i-a;return this.smoothedRemainingTime=Math.max(this.smoothedRemainingTime,(this.estimatedTotalSize-this.uploadedSize)/s),{progress:100*i,estimatedTimeRemaining:Math.round(this.smoothedRemainingTime),estimatedTimeRemainingString:this.smoothedRemainingTime>3?this.__formatTime(this.smoothedRemainingTime):"few seconds"}}__formatTime(e){if(!isFinite(e)||e>86400)return"Calculating...";if(e<60)return`${Math.round(e)}sec`;const n=Math.floor(e/60);return n<60?`${n}min`:`${Math.floor(n/60)}h ${n%60}min`}}async function Xi(e){const n=await import("./pako.esm-01431bd2.js"),t=await e.arrayBuffer(),o=n.gzip(new Uint8Array(t)).buffer.slice(0);if(o.byteLength>51200&&o.byteLength>=t.byteLength){if(t.byteLength>0)return null}else if(!(o instanceof ArrayBuffer))return console.error("gzipCompress: Invalid ArrayBuffer"),{error:`Gzip compressing failed for "${e.name}" (unexpected result)`};return Fi(`${"path"in e?e.path:e.name}.gz`,o,{type:"application/gzip"})}async function Qi(e,n,t=void 0){const o=async function(e,n,t){var o,i,a,s,r,c,l,p,u,d,m,f,h,g,v;const x=n.files.filter(e=>{const n=e.name||"";return!n||n.endsWith("/")?(console.warn(`[upload] Skipping directory entry: "${n}"`),!1):0!==e.size||(console.warn(`[upload] Skipping zero-byte file: "${n}"`),!1)});n.files=x;const b=(null==(o=t)?void 0:o.loglevel)||"none";if(!x.length)return"none"!=b&&console.error("No files to upload"),{success:!1,error:"No files to upload"};if(!n.entrypoint){const e=Hi(x);if(null==e)return{success:!1,error:"No entrypoint file found"};if("object"==typeof e&&"error"in e)return{success:!1,error:e.error};"info"===b&&console.log("Entrypoint: "+e.name),n.entrypoint=e}n.entrypoint&&!x.includes(n.entrypoint)&&x.push(n.entrypoint);const y=await async function(e){if(e.length>5e3)return{success:!1,error:"Too many files. Maximum filecount is 5000"};let n=0,t=0,o=0,i=0;for(let c=e.length-1;c>=0;c--){const l=e[c];if(n+=l.size,n>1073741824)return{success:!1,error:`Total file size exceeds limit of ${1024..toFixed(0)} MB. Please reduce the size of your upload.`};const p=l.name.toLocaleLowerCase();if(".ds_store"!==p){if(p.endsWith(".gltf")?o++:p.endsWith(".glb")?(r=p)&&Gi.test(r)||i++:p.endsWith(".vrm")&&t++,p.endsWith(".gltf")){var a;o+=1,console.log(`Found glTF file ${l.name}. Will check if all dependencies are available\n`,e);const n=await l.text(),t=n.matchAll(/"uri"\s*:\s*"(?<value>.*?)"/g);if(!t)continue;const i=JSON.parse(n);if("2.0"!==i.asset.version)return console.warn("⚠ glTF version is not 2.0. This is currently not supported."),{success:!1,error:`glTF version ${i.asset.version} is unsupported.Please use glTF 2.0.`};const r=null==(a=l.path)?void 0:a.split("/"),c=r.splice(0,r.length-1).join("/");for(const n of t){var s;const t=null==(s=n.groups)?void 0:s.value;if(t){let n=!1;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("www.")){console.log(`✅ Found remote dependency ${t} `);break}if(t.startsWith("data:")){console.log(`✅ Found embedded dependency ${t} `);break}{const o=Pi(`${c}/${Ji(t)}`);console.log('❓ Check if local dependency exists "'+o+'"');for(const t of e){if(t.webkitRelativePath===o||t.name==o){n=!0,console.log(`✅ Found dependency in name or webkit: ${t.name} || ${t.webkitRelativePath} `);break}if(t.path===o){n=!0,console.log(`✅ Found dependency in path: ${t.path} `);break}}}if(!n)return console.warn("⚠ Missing dependency "+t,c),{success:!1,error:"Missing resource: "+t}}}}}else e.splice(c,1)}var r;return{success:!0,vrm_count:t,gltf_count:o,glb_count:i}}(x);if("error"in y)return{success:!1,error:y.error||"Failed to validate files"};if(null!=(i=n.entrypoint)&&i.name.endsWith(".htm")||null!=(a=n.entrypoint)&&a.name.endsWith(".html")||null!=(s=n.entrypoint)&&s.name.endsWith(".html.gz")||null!=(r=n.entrypoint)&&r.name.endsWith(".html.br"))t||(t={}),t.type="deployment";else if(y.vrm_count>10)return{success:!1,error:"Multiple model files found - this is not supported for asset uploads. Please upload a single model file only."};if(n.raw)"none"!=b&&console.warn("Raw upload - skipping gzip compression of files");else for(let e=0;e<x.length;e++){const o=x[e],i=o.name.toLowerCase();if(i.endsWith(".html")||i.endsWith(".js")||i.endsWith(".css")){var w,_;"none"!==(null==(w=t)?void 0:w.loglevel)&&console.log(`gZip compressing file: ${o.name}`);const i=await Xi(o).catch(e=>({error:`Error compressing ${o.name}: ${e.message}`}));if(null===i){var k;"none"!==(null==(k=t)?void 0:k.loglevel)&&console.error(`Did not compress file: ${o.name}`);continue}if("error"in i)return{success:!1,error:i.error,status:500};if(!i)return{success:!1,error:`Failed to compress ${o.name}`,status:500};const a=n.entrypoint===o;x[e]=i,a&&(n.entrypoint=i),"none"!==(null==(_=t)?void 0:_.loglevel)&&console.log(`gZip compressed file: ${o.name} ${a?"(entrypoint)":""}`)}}x.sort((e,n)=>e.name.includes(".needle")&&!n.name.includes(".needle")?-1:!e.name.includes(".needle")&&n.name.includes(".needle")?1:0);const{baseUrl:j,authToken:S}=e,$="Bearer "+S,T={...me(e),triggered_by:n.triggered_by,filename:`${encodeURIComponent(n.entrypoint.name)}`,"total-files":x.length.toString(),"total-files-size":x.reduce((e,n)=>e+n.size,0).toString()};null!=(c=t)&&c.content_id&&(T.content_id=t.content_id),null!=(l=t)&&l.type&&(T.type=t.type),null!=(p=t)&&p.name&&(T.name=encodeURIComponent(t.name)),null!=(u=t)&&u.parent_job_id&&(T.parent_job_id=t.parent_job_id);const E={entrypoint:(null==(d=n.entrypoint)?void 0:d.path)||(null==(m=n.entrypoint)?void 0:m.name),files:[]};null!=(f=t)&&f.content_type&&(E.content_type=t.content_type);const C={outputs:[E]},O=[];for(let e=0;e<x.length;e++){var R,z,N;const n=x[e];let o=n.path||n.webkitRelativePath||n.name;if(null!=(R=o)&&R.includes(":"))throw new Error(`Invalid filename: ${o}`);let i=await n.arrayBuffer();const a=n.size;let s=n.type;if(null!=(z=s)&&z.length&&"unknown"!==s.toLowerCase()||(s=Ii(i,o)),"deployment"===(null==(N=t)?void 0:N.type)){const e=qi(o,s);e&&(o=e.filename,s=e.mimetype)}const r=Ui(i);O[e]=i,E.files[e]={filename:o,content_type:s,content_length:a,content_md5:r}}try{const e=await async function(e){var n,t,o,i,a;if(!e||"function"!=typeof e.slice||"number"!=typeof e.size)return null;const s=Math.min(e.size,65536);if(s<=0)return null;let r;try{const n=await e.slice(0,s).arrayBuffer();r=new Uint8Array(n)}catch{return null}return null!=(n=null!=(t=null!=(o=null!=(i=null!=(a=function(e){if(e.length<24)return null;if(137!==e[0]||80!==e[1]||78!==e[2]||71!==e[3])return null;if(13!==e[4]||10!==e[5]||26!==e[6]||10!==e[7])return null;const n=new DataView(e.buffer,e.byteOffset),t=n.getUint32(16,!1),o=n.getUint32(20,!1);return t&&o?{width:t,height:o}:null}(r))?a:function(e){if(e.length<28)return null;const n=[171,75,84,88,32,50,48,187,13,10,26,10];for(let t=0;t<n.length;t++)if(e[t]!==n[t])return null;const t=new DataView(e.buffer,e.byteOffset),o=t.getUint32(20,!0),i=t.getUint32(24,!0);return o&&i?{width:o,height:i}:null}(r))?i:function(e){if(e.length<16)return null;if(118!==e[0]||47!==e[1]||49!==e[2]||1!==e[3])return null;const n=new DataView(e.buffer,e.byteOffset);let t=8;for(;t<e.length;){const o=Bi(e,t);if(null===o)return null;if(0===o.length)return null;t+=o.length+1;const i=Bi(e,t);if(null===i)return null;if(t+=i.length+1,t+4>e.length)return null;const a=n.getInt32(t,!0);if(t+=4,a<0||t+a>e.length)return null;if("dataWindow"===o&&"box2i"===i&&16===a){const e=n.getInt32(t,!0),o=n.getInt32(t+4,!0),i=n.getInt32(t+8,!0)-e+1,a=n.getInt32(t+12,!0)-o+1;return i<=0||a<=0?null:{width:i,height:a}}t+=a}return null}(r))?o:function(e){if(e.length<30)return null;if(82!==e[0]||73!==e[1]||70!==e[2]||70!==e[3])return null;if(87!==e[8]||69!==e[9]||66!==e[10]||80!==e[11])return null;const n=String.fromCharCode(e[12],e[13],e[14],e[15]);if("VP8 "===n){const n=16383&(e[26]|e[27]<<8),t=16383&(e[28]|e[29]<<8);return n&&t?{width:n,height:t}:null}return"VP8L"===n?47!==e[20]?null:{width:1+(16383&(e[21]|e[22]<<8)),height:1+(16383&(e[22]>>6|e[23]<<2|(15&e[24])<<10))}:"VP8X"===n?{width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}:null}(r))?t:function(e){if(e.length<4)return null;if(255!==e[0]||216!==e[1])return null;let n=2;for(;n<e.length-8;){for(;n<e.length&&255===e[n];)n++;if(n>=e.length)return null;const t=e[n++];if(1===t||t>=208&&t<=217)continue;if(n+2>e.length)return null;const o=e[n]<<8|e[n+1];if(o<2||n+o>e.length)return null;if(t>=192&&t<=207&&196!==t&&200!==t&&204!==t){if(n+7>e.length)return null;const t=e[n+3]<<8|e[n+4],o=e[n+5]<<8|e[n+6];return o&&t?{width:o,height:t}:null}n+=o}return null}(r))?n:function(e){if(e.length<10)return null;if(35!==e[0]||63!==e[1])return null;const n=new TextDecoder("latin1").decode(e.subarray(0,Math.min(e.length,4096))).match(/[+-]Y\s+(\d+)\s+[+-]X\s+(\d+)/);if(!n)return null;const t=parseInt(n[1],10),o=parseInt(n[2],10);return o&&t?{width:o,height:t}:null}(r)}(n.entrypoint);e&&(E.width=e.width,E.height=e.height)}catch(e){"debug"===b&&console.warn("readImageResolution failed; uploading without dimensions",e)}const A=await fetch(j+de.upload.request,{...fe,method:"POST",headers:T,body:JSON.stringify(C)}).catch(e=>"fetch failed"==e.message||"Failed to fetch"==e.message?`Network error. Make sure you are connected to the internet and ${j} is reachable.`:(console.error("Failed to begin upload\n",e),null));if(null===A||"string"==typeof A)return{success:!1,error:A||"Failed to begin upload"};if(!A.ok){const e=await A.text();if(e.startsWith("{")){const n=JSON.parse(e);if("error"in n)return{success:!1,status:A.status,error:n.error}}return"none"!=b&&console.error("Failed to begin upload\n",A.status,e),{success:!1,status:A.status,error:`${e}`}}const L=await A.json();"debug"===b&&console.debug("BeginResponse",L);const F=x.reduce((e,n)=>e+n.size,0);var U;if("exists"===L.type)return"none"!=b&&console.log("Upload already exists",L.id),null!=(U=t)&&U.onStart&&t.onStart(L.id,L.content_id),{success:!0,uploadSkipped:!0,id:L.id,type:L.job_type,content_id:L.content_id,filesUploaded:x.length,totalSize:F,url:L.url};const I=n.entrypoint.webkitRelativePath||n.entrypoint.name;let q=0;null==(h=t)||null==(h=h.abort)||h.addEventListener("abort",async()=>{console.log("Upload aborted: Cancelling upload"),await fetch(j+de.upload.cancel,{...fe,method:"POST",headers:{authorization:$,id:L.id}})});let W=!1,P=Date.now();function B(n,t,o=!1){if(!o&&Date.now()-P<1e3)return!1;if(W&&"completed"!==t)return void("none"!=b&&console.warn("Invalid status update..."));P=Date.now();const i=Math.floor(q/F*100);return"debug"===b&&console.log("SET STATUS: "+t,n,i),_i({identifier:L.id,status:t,status_message:n,progress:i},e),!0}null!=(g=t)&&g.onStart&&t.onStart(L.id,L.content_id);const D=Date.now(),M=new Zi(x.length,F/1024/1024),G=new Array;let J=!1;const H=[...x],K=x.length;for(let o=0;o<H.length;o++){var V;if(null!=(V=t)&&null!=(V=V.abort)&&V.aborted){console.debug("Upload aborted");break}if(J){console.debug("Upload failed");break}if(G.length<10){console.debug(`Uploading file ${o}/${x.length}: ${x[o].name}`);let i=0,a=0;const s=E.files[o],r=s.filename,c=O[o],l=s.content_length,p=s.content_type,u=x[o],d=u.name.endsWith(".gz")?"gzip":u.name.endsWith(".br")?"br":void 0,m=ea({uploadId:L.id,uploadRequestPUTUrl:L.request_put_url,entrypointPath:I,file:x[o],fileName:r,fileMd5:s.content_md5,fileBuffer:c,fileType:p,content_encoding:d,fileSize:l,fileIndex:o,fileNumber:o+1,fileCount:K,loglevel:b,experimental:n.experimental,args:e,options:t,onProgress:e=>{var n;const s=e.progress||0;i=x[o].size*s;const c=i-a;if(a=i,q+=c,null!=(n=t)&&n.progress){const e=q/F,n=x.length,i=x[o].size,a=(Date.now()-D)/1e3,c=M.updateProgress(q/1024/1024);t.progress({uploadedBytes:q,totalBytes:F,progress01:e,fileName:x[o].name,fileSize:i,fileProgress01:s,fileIndex:o,totalFiles:n,estimatedTimeLeftDisplay:c.estimatedTimeRemainingString,estimatedTimeLeft:c.estimatedTimeRemaining,elapsedTime:a}),B(`Uploading file ${o+1}/${n} (${r}): ${(100*s).toFixed(0)}% of ${Wi(F)}. Finished in approx. ${c.estimatedTimeRemainingString}`,"running",!1)}}}).then(e=>{if(!0!==e)return e;for(let e=G.length-1;e>=0;e--)G[e]===m&&G.splice(e,1);B(`Uploaded ${Wi(q)+" of "+Wi(F)} for ${x[o].name}`,"running")}).catch(e=>{var n;null!=(n=t)&&null!=(n=n.abort)&&n.aborted?console.warn("Upload aborted"):(console.error(e.message),J=!0)});G.push(m)}G.length>=10&&await Promise.race(G)}if(await Promise.all(G).catch(e=>{var n;null!=(n=t)&&null!=(n=n.abort)&&n.aborted?console.warn("Upload aborted"):(console.error(e.message),J=!0)}),J)return await _i({identifier:L.id,status:"failed",error:"Failed to upload files"},e),{success:!1,error:"Failed to upload files"};if(null!=(v=t)&&null!=(v=v.abort)&&v.aborted)return await _i({identifier:L.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},e),{success:!1,error:"Upload aborted"};W=!0,console.log(`Upload Done: All files uploaded to ${L.id}`);const Y={...me(e),id:L.id};"none"!=b&&console.log("Completing upload - notify server");let Z=null;for(let e=0;e<5;e++){var X;await Di(1e3*e);const n=AbortSignal.timeout(6e4+5e3*e);if(Z=await fetch(j+de.upload.done,{...fe,method:"POST",headers:Y,signal:n}).catch(n=>(console.error(`Failed to complete upload (${e+1} / 5)`,n.message),null)),!0===(null==(X=Z)?void 0:X.ok))break;var Q;"none"!=b&&e<4&&console.warn(`Failed to complete upload (${(null==(Q=Z)?void 0:Q.status)||"no status"}): will retry in 1 second`)}if(!Z)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};if(!Z.ok){if(524===Z.status)return console.error("Failed to complete upload: Gateway Timeout"),{success:!1,error:"Failed to complete upload: Gateway Timeout"};{const e=await Z.text();return console.error(`Failed to complete upload (${Z.status}): ${e}`),{success:!1,error:"Failed to complete upload"}}}"none"!=b&&console.log("Upload complete");const ee=await Z.json();return{success:!0,type:ee.type,uploadSkipped:!1,id:ee.id,content_id:ee.content_id,url:ee.url,filesUploaded:x.length,totalSize:F}}(e,n,t);return await o.finally(()=>{})}async function ea(e){const{uploadId:n,uploadRequestPUTUrl:t,entrypointPath:o,file:i,fileName:a,fileBuffer:s,fileMd5:r,fileSize:c,fileType:l,content_encoding:p,fileIndex:u,fileNumber:d,fileCount:m,loglevel:f,args:h,options:g,experimental:v}=e;"info"===f&&console.log(`Uploading file "${i.name}" type=${l} (${c}) ${i.type} with hash ${r}`);const x={...me(h),"Content-Type":"application/json",org:h.org,job_id:n,filesize:c.toString(),progress:(u/m*100).toFixed(0)},b={filename:a,entrypoint:o,"content-type":l,"content-md5":r,"content-encoding":p,output_index:0};"debug"===f&&console.debug("Requesting presigned URL with headers",x);const y=JSON.stringify(b);let w=null,_="";for(let e=0;e<5;e++){var k;if(null!=w)break;if(null!=g&&null!=(k=g.abort)&&k.aborted)throw new Error("Upload aborted");await Di(200*e),w=await fetch(t,{...fe,method:"POST",headers:x,body:y}).then(async e=>e.ok?await e.json():(_=await e.text(),console.log(t),console.warn(`Failed to get presigned url for "${a}" "${l}" (${e.status}).\n→ Retrying...`),null)).catch(e=>(_=e.message,console.warn("Failed to get presigned url "+e.message+", retrying..."),null))}if(null==w)throw new Error(`Failed to get presigned url for "${a}" "${l}" \n${_}`);const j=w.presigned_url;var S=!1;let $=null;for(let n=0;n<5;n++){var T;if(n>0&&("none"!==f&&console.log(`Retry PUT #${n} for file ${a}`),await Di(1e3*n)),null!=g&&null!=(T=g.abort)&&T.aborted)throw new yi("Upload aborted");const t={"Content-Type":l,"Content-MD5":r};v&&(t["Content-Length"]=c.toString()),p&&(t["Content-Encoding"]=p),0===n&&"none"!=f&&console.log(`Uploading file ${d}/${m}: ${a}`),"debug"===f&&console.debug("PUT with headers",t);const o=await bi.put(j,s,{...fe,withCredentials:!1,signal:null==g?void 0:g.abort,headers:t,timeout:3e5,onUploadProgress:n=>{e.onProgress(n)}}).catch(e=>($=e.message,e instanceof yi||("none"!==f&&console.error(`Failed to upload file (PUT) (${d}, ${a}) "${e.message}"`),"debug"===f&&(console.log(t,{fileSize:c}),e.response?console.debug(e.response):console.debug(e))),null));if(o){if(200!==o.status){$=`${o.statusText} (${o.status})`,console.debug(`Failed (${o.status} ${o.status}) to upload file ${i.name} to "${w.path}". Retrying...`);continue}S=!0,"info"===f&&console.log(`Uploaded file ${d}/${m} "${a}" (${l}, ${Wi(c)})`);break}}var E;if(!S)throw console.error("Failed to upload file "+a),await _i({identifier:n,status:"failed",status_message:`Failed to upload file (${a}): ${null==(E=$)?void 0:E.substring(0,200)}`,error:"Failed to upload file "+a},h),new Error("Failed to upload file "+a);return!0}async function na(e,n,t){const o=e.baseUrl+de.jobs.presigned_url,i=await fetch(o,{...fe,method:"POST",headers:{...me(e),job_id:n},body:JSON.stringify(t)}).catch(e=>(console.error(e),null));return i&&i.ok?await i.text():(console.error("Failed to get presigned download URL",null==i?void 0:i.status),null)}async function ta(e,n){const t=e.baseUrl+de.jobs.create,o={...me(e),"content-type":"application/json"},i={type:"ai-material",triggered_by:e.trigger_type,parameters:{...n}},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request texture generation (${a.status}): ${e}`),{error:e||`Request failed (${a.status})`}}return await a.json().catch(e=>(console.error(e),null))}async function oa(e,n={}){const t=new URL(e.baseUrl+de.content.root);n.content_type&&t.searchParams.set("content_type",n.content_type),n.content_format&&t.searchParams.set("content_format",n.content_format),n.search&&t.searchParams.set("search",n.search),n.tags&&t.searchParams.set("tags",n.tags),n.types&&t.searchParams.set("types",n.types),n.trash&&t.searchParams.set("trash","true"),n.is_public&&t.searchParams.set("is_public","true"),n.page&&t.searchParams.set("page",String(n.page)),n.limit&&t.searchParams.set("limit",String(n.limit)),n.collection_id&&t.searchParams.set("collection_id",n.collection_id),n.offset&&t.searchParams.set("offset",String(n.offset));const o=me(e),i=await fetch(t,{...fe,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to list content (${i.status}): ${e}`)}return await i.json()}async function ia(e,n){const t=`${e.baseUrl}${de.content.root}/${n}`,o=me(e),i=await fetch(t,{...fe,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to get content (${i.status}): ${e}`)}return await i.json()}const aa=1179937895,sa=1313821514,ra={schema:{name:"load_needle_engine_skill",description:'Load the Needle Engine skill with coding guidelines, patterns, and reference docs. IMPORTANT: Do NOT call this for greetings, general conversation, or vague messages like "I have a question about Needle Engine". Only call this when the user asks a specific technical or coding question that requires Needle Engine knowledge to answer. Wait for the actual question first. Without arguments loads the main skill file. Use the "file" parameter to load specific reference files (e.g. "references/api.md", "references/components.md"). Call without arguments first to discover available references.',inputSchema:{type:"object",properties:{file:{type:"string",description:'File to load relative to the skill root, e.g. "references/api.md". Defaults to the main skill file.'}},additionalProperties:!1,required:[]}},async execute(e){const n=(null==e?void 0:e.file)||"SKILL.md";if(n.includes("..")||n.startsWith("/"))return{error:"Invalid file path."};try{const e="https://raw.githubusercontent.com/needle-tools/ai/main/providers/claude/plugin/skills/needle-engine/"+encodeURI(n),t=new AbortController,o=setTimeout(()=>t.abort(),5e3),i=await fetch(e,{signal:t.signal,redirect:"follow"});return clearTimeout(o),i.ok?{content:await i.text()}:{error:`Could not fetch '${n}' (HTTP ${i.status})`}}catch(e){return{error:`Error fetching skill: ${e.message}`}}}};function ca(e){let n,t=null,o="";for(const i of e.split("\n"))i.startsWith("event: ")?t=i.slice(7).trim():i.startsWith("data: ")?o=i.slice(6):i.startsWith("id: ")&&(n=parseInt(i.slice(4).trim(),10));if(!t)return null;let i=null;switch(t){case"delta":i={type:"delta",content:decodeURIComponent(o)};break;case"message":i={type:"message",content:decodeURIComponent(o)};break;case"status":i={type:"status",message:decodeURIComponent(o)};break;case"error":i={type:"error",message:decodeURIComponent(o)};break;case"stopped":i={type:"stopped"};break;case"tool_call":i={type:"tool_call",...JSON.parse(o)};break;case"tool_result":i={type:"tool_result",...JSON.parse(o)};break;case"done":{const e=JSON.parse(o),{chat_url:n,...t}=e;i={type:"done",token_usage:t},n&&(i.chat_url=n);break}case"message_id":i={type:"message_id",message_id:decodeURIComponent(o)};break;case"chat_id":i={type:"chat_id",chat_id:decodeURIComponent(o)}}return i&&void 0!==n&&(i.id=n),i}function la(e,n){const t=me(e);return null!=n&&n.personal&&(t["x-needle-ai-chat"]="personal"),null!=n&&n.instanceId&&(t["x-needle-instance-id"]=n.instanceId),t}function pa(e,n){return n.stream?async function*(e,n){const t=new URL(e.baseUrl+de.ai.chat),o=la(e,n);o["Content-Type"]="application/json";const i={type:"new_message",slug:n.slug,message:n.message,stream:!0,source:n.source,full_url:n.full_url,pathname:n.pathname,context:n.context},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to stream chat message (${a.status}): ${e}`)}if(!a.body)throw new Error("Response body is null — streaming not supported in this environment");yield*async function*(e){const n=e.getReader(),t=new TextDecoder;let o="";try{for(;;){const{done:e,value:i}=await n.read();if(e)break;o+=t.decode(i,{stream:!0});const a=o.split("\n\n");o=a.pop()||"";for(const e of a){const n=ca(e);n&&(yield n)}}if(o.trim()){const e=ca(o);e&&(yield e)}}finally{n.releaseLock()}}(a.body)}(e,n):async function(e,n){const t=new URL(e.baseUrl+de.ai.chat),o=la(e,n);o["Content-Type"]="application/json";const i={type:"new_message",slug:n.slug,message:n.message,stream:!1,source:n.source,full_url:n.full_url,pathname:n.pathname,context:n.context},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to send chat message (${a.status}): ${e}`)}return await a.json()}(e,n)}const ua=()=>"https://cloud.needle.tools/account",da=()=>"https://cloud.needle.tools/edit";function ma(e){return h(e)}const fa=["node_modules",".git",".vscode",".vercel",".github",".idea"];function ha(e,n,t=null,o="",i=0){if(null===t){if(i>0)throw new Error("result must be provided if level > 0. Did you forget to pass it?");t={files:[],total_size:0}}if(0===i){if(!s(n))throw new Error(`Directory or file "${n}" does not exist.`);if(r(n).isFile()){const e=Fi(n,c(n));return e.path=e.name,t.files.push(e),t.entrypoint=e,t}}else if(i>20)throw new Error("Recursion depth too high. Are you sure you are providing the correct directory?");const a=l(n,{withFileTypes:!0});for(const i of a)if(0==i.isDirectory()){if("optimization"===e&&0==((p=(p=i.name).toLowerCase()).endsWith(".glb")||p.endsWith(".gltf")||p.endsWith(".vrm")||p.endsWith(".usdz")||p.endsWith(".usd")||p.endsWith(".fbx")))continue;const a=Fi(o+i.name,c(n+"/"+i.name));if(t.files.push(a),t.total_size+=a.size,t.total_size>1073741824)throw new Error(`Collected filesize exceeds ${1024..toFixed(0)} MB. Are you sure you are providing the correct directory?`);if(t.files.length>1e4)throw new Error(`Too many files (${t.files.length}): The maximum filecount is 10,000.`)}var p;for(const s of a)if(s.isDirectory()){if(fa.includes(s.name))continue;ha(e,n+"/"+s.name,t,o+s.name+"/",i+1)}return t}const ga=new RegExp("\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b","g"),va=new RegExp("\\b[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\b","gi"),xa=new RegExp("(Authorization:\\s*)([^\\s,;\"']+(?:\\s+[^\\s,;\"']+)?)","gi"),ba=new RegExp("\\bBearer\\s+([A-Za-z0-9._\\-=]+)","g"),ya=new RegExp("([?&]token=)([^&\\s\"'<>]+)","g"),wa=new RegExp("<redacted:\\d+ch>","g"),_a=["cli.log","cli.prev.log"],ka=q.join(U.homedir(),".needle","cli","logs");E(ka,{recursive:!0});try{!function(e,n){const t={migrated:[],skipped:[]};if(!e||!n)return t;if(q.resolve(e)===q.resolve(n))return t;if(!T(e))return t;for(const o of _a){const i=q.join(e,o);if(T(i))try{E(n,{recursive:!0});const e=q.join(n,o);if(T(e)){const e=q.join(n,o.replace(/\.log$/,"")+".legacy.log");C(i,e),t.skipped.push(o)}else C(i,e),t.migrated.push(o)}catch(e){console.error(`[needle-cloud] Failed to migrate legacy log ${o}: ${e instanceof Error?e.message:e}`)}}}(q.join(O(U.tmpdir()),"Needle","Cloud","logs"),ka)}catch(e){console.error(`[needle-cloud] legacy log migration check failed: ${e instanceof Error?e.message:e}`)}const ja=q.resolve(ka,"cli.log");if(T(ja)){const e=R(ja),n=e.mtimeMs;if(Date.now()-n>432e5||e.size>52428800){const e=q.resolve(ka,"cli.prev.log");z(ja,e,n=>{n?console.error(`Failed to rename log file: ${n.message}`):console.log(`Log file renamed to ${e}`)})}}function Sa(){return ja}async function $a(e,n){return e=function(e){if("string"!=typeof e)return e;if(0===e.length)return e;if(wa.test(e)&&(wa.lastIndex=0,!function(e){ga.lastIndex=0,va.lastIndex=0,xa.lastIndex=0,ba.lastIndex=0,ya.lastIndex=0;const n=ga.test(e)||va.test(e)||xa.test(e)||ba.test(e)||ya.test(e);return ga.lastIndex=0,va.lastIndex=0,xa.lastIndex=0,ba.lastIndex=0,ya.lastIndex=0,n}(e.replace(wa,""))))return e;wa.lastIndex=0;let n=e;return n=n.replace(xa,(e,n,t)=>`${n}<redacted:${t.length}ch>`),n=n.replace(ya,(e,n,t)=>`${n}<redacted:${t.length}ch>`),n=n.replace(ba,(e,n)=>`<redacted:${("Bearer "+n).length}ch>`),n=n.replace(ga,e=>`<redacted:${e.length}ch>`),n=n.replace(va,e=>`<redacted:${e.length}ch>`),n}(e),e=`[${(new Date).toISOString()}] ${e}`,null!=n&&n.emptyLineBefore&&(e="\n"+e),F(ja,e+"\n",{flag:"a"}).then(()=>!0).catch(e=>(console.error(`Failed to write to log file: ${e.message}`),!1))}function Ta(e,n,t){process.env.GITHUB_ACTIONS&&(process.env.GITHUB_OUTPUT?p(process.env.GITHUB_OUTPUT,`${e}=${n}\n`):null==t||t.logger.warn("GITHUB_OUTPUT environment variable is not set. Cannot set output variables."))}async function Ea(e){var n;e.directory=b.resolve(e.directory);let{files:t,entrypoint:o}=ha("deployment",e.directory);if(e.entrypoint&&(o=t.find(n=>n.path===e.entrypoint),!o))return void $().fail(`Entrypoint "${e.entrypoint}" not found. Please make sure you provide a valid entrypoint.`);if(!o){const e=Hi(t);if("error"in e)return $a(`[Deployment] Error determining entrypoint: ${e.error}`),void $().fail(`Error: ${e.error}`);o=e}if(!(t.length>0&&o&&(o.name.toLowerCase().endsWith(".html")||o.name.toLowerCase().endsWith(".html.gz")||o.name.toLowerCase().endsWith(".html.br"))))return $a("[Deployment] Deployment is not valid: No .html file found."),void $().fail("Deployment is not valid: No .html file found.");if(!o)return $a("[Deployment] No entrypoint found. Please provide an index.html file in your project."),void $().fail("No entrypoint found. Please provide an index.html file in your project.");const i=null!=(n=e.endpoint)&&n.length?e.endpoint:"https://cloud.needle.tools/api";let a=e.name;a||(a=Ca(e.directory)||void 0);let s=null==i?void 0:i.includes("localhost");const r=a?` of "${a}"`:"",c=$().start(`Begin deployment${r} ${s?"(local)":""} of ${t.length} files...`);c.spinner="earth",await Di(50);let l=-1;$a(`Deployment started${r} ${s?"(local)":""} of ${t.length} files...`);const p=await Qi({baseUrl:i,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:t,entrypoint:o,experimental:e.experimental,raw:e.raw},{name:a,type:"deployment",loglevel:e.verbose?"debug":"none",progress:e=>{if(e.fileIndex!==l){l=e.fileIndex;const n=e.totalBytes/1024/1024;c.text=`Uploading file ${e.fileIndex+1} of ${e.totalFiles} files: ${(e.uploadedBytes/1024/1024).toFixed(1)} / ${n.toFixed(1)} MB. Total progress: ${(100*e.progress01).toFixed(1)} %. Time passed: ${e.elapsedTime.toFixed(0)}sec. About ${e.estimatedTimeLeftDisplay} until complete.`}}}).catch(e=>(c.fail(e),null));if(null!=p&&!0===p.success){c.succeed(`🚀 Deployment${r} successful (${p.content_id}/${p.id})`);let n="";n=p.url?p.url:"https://cloud.needle.tools/view/"+p.content_id+"/"+p.id,console.log("🔗 View the deployment at: "+n),e.open&&ma(n);try{Ta("deployment_url",n,{logger:e.logger}),Ta("edit_id",p.content_id,{logger:e.logger})}catch(n){e.logger.error("Error writing output for CI: "+n)}}else c.fail(`${null==p?void 0:p.error}`)}function Ca(e,n=0){if(n>10)return null;const t=b.join(e,"needle.config.json");if(s(t)){const n=b.join(e,"package.json");if(s(n)){var o;const e=c(n,"utf8"),t=JSON.parse(e);if(null!=(o=t.name)&&o.length)return t.name}return b.basename(e)}const i=b.dirname(e);return i===e?null:Ca(i,n+1)}async function Oa(e){if(!e.outDir)throw new Error("Output directory is required");const n=$("Downloading results...").start(),t=await async function(e){const n=await async function(e){if(!e.identifier)return null;const n={...me(e)},t={job_id:e.identifier,fields:e.fields,content_format:e.content_format},o=e.baseUrl+de.jobs.query,i=await fetch(o,{...fe,method:"POST",headers:n,body:JSON.stringify(t)}).catch(e=>(console.error(e),null));if(null==i)return null;if(!i.ok)return console.error("Failed to get job",i.status,await i.text()),null;const a=await i.json().catch(e=>(console.error(e),null));return null==a?null:a.job}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,fields:["results"],content_format:e.content_format});if(null==n||!n.results)return{error:`Job ${e.identifier} did not produce any result files`};const t=n.results;if(!t.bucket||!t.directory)return{error:`Job ${e.identifier} has incomplete result data`};const o=[];for(const n of t.files){if((i=n.filename).startsWith(".extras/")||i.startsWith(".extras\\")||i.endsWith("screenshot.needle.webp")||wi.test(i)||i.endsWith(".needle.log"))continue;const a=`${t.directory}/${n.filename}`,s=await na(e,e.identifier,{bucket:t.bucket,key:a});if(!s){console.error(`Failed to get presigned URL for: ${n.filename}`);continue}const r=await fetch(s).catch(e=>(console.error(e),null));if(!r||!r.ok){console.error(`Failed to download (${null==r?void 0:r.status} | ${null==r?void 0:r.statusText}): ${n.filename}`);continue}const c=await r.arrayBuffer().catch(e=>(console.error(e),null));if(!c)return{error:`Failed to read downloaded file: ${n.filename}`};o.push({filename:n.filename,data:c})}var i;return{files:o}}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,content_format:e.content_format});if("error"in t)return n.fail(t.error),{error:t.error};const o=[];for(const i of t.files){n.text=`Downloading ${i.filename}`,s(e.outDir)||u(e.outDir,{recursive:!0});let a=i.filename;if(e.filename){const n=i.filename.substring(i.filename.lastIndexOf("."));if(1===t.files.length)a=e.filename.includes(".")?e.filename:e.filename+n;else{const n=i.filename.substring(i.filename.lastIndexOf(".")),t=i.filename.substring(0,i.filename.lastIndexOf("."));a=e.filename+"-"+t+n}}const r=e.outDir+"/"+a,c=r.split("/").slice(0,-1).join("/");s(c)||u(c,{recursive:!0}),e.verbose&&console.log(`Writing ${i.filename} (${(i.data.byteLength/1024).toFixed(2)} KB) to "${r}"`),d(r,Buffer.from(i.data)),o.push(r)}return n.succeed(`Downloaded ${o.length} ${1===o.length?"file":"files"}: ${o.join(", ")}`),e.verbose&&console.log("Downloaded files:\n",o),{success:!0,paths:o}}async function Ra(e){const{token:n,org_id:t,slug:o,message:i,stream:a}=e;if(a){const e=pa({baseUrl:"https://cloud.needle.tools/api",authToken:n,org:t},{slug:o,message:i,stream:!0,source:"cli"});for await(const n of e)switch(n.type){case"delta":process.stdout.write(n.content);break;case"message":break;case"status":process.stdout.write(`[${n.message}]\n`);break;case"error":return void $().fail(n.message);case"tool_call":process.stdout.write(`[tool: ${n.name}]\n`);break;case"done":process.stdout.write("\n")}}else{const e=$("Thinking...").start(),a=await pa({baseUrl:"https://cloud.needle.tools/api",authToken:n,org:t},{slug:o,message:i,stream:!1,source:"cli"});e.stop(),console.log(a.content)}}async function za(e){const n=new URL((e.endpoint||"https://cloud.needle.tools/api")+de.get.deployments);n.searchParams.append("offset",e.offset.toString()),n.searchParams.append("limit",e.limit.toString()),e.names&&n.searchParams.append("name",e.names.map(e=>e.trim()).join(","));const t=await fetch(n,{method:"GET",headers:{...me({authToken:e.authToken,org:e.org})}});return t.ok?await t.json():{status:t.status,error:await t.text()}}const Na=["#e06c75","#d19a66","#e5c07b","#98c379","#7ec8a4","#56b6c2","#61afef","#528bff","#c678dd","#e88de4","#be5046","#d4976c","#b5cea8","#4ec9b0","#9cdcfe","#c8ae9d"];function Aa(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t)|0;const[t,o,i]=function(e){const n=parseInt(e.slice(1),16);return[n>>16&255,n>>8&255,255&n]}(Na[Math.abs(n)%Na.length]);return`[38;2;${t};${o};${i}m${e}[0m`}function La(e){return`[2m${e}[0m`}const Fa=8424,Ua="http://localhost:8424";var Ia;const qa={appId:"2stnsoa6a1b0gwc7lra55",appSecret:"seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",endpoint:"https://auth.needle.tools",resources:["https://cloud.needle.tools/api"],scopes:["openid","profile","email","roles","urn:logto:scope:organizations","urn:logto:scope:organization_roles","identities","custom_data","all","read","write","delete","upload","download","invite","editor"]},Wa={getAccessToken:!0,fetchUserInfo:!0,resource:null==(Ia=qa.resources)?void 0:Ia[0],resources:qa.resources||[],scopes:qa.scopes||[]};function Pa(e="default"){return null==e?`${Ua}/?signed-out=1`:"too-many-logins"===e?`${Ua}/?too-many-logins=1`:"error"===e?`${Ua}/?error=1`:`${Ua}/?signed-out=1`}var Ba;function Da(){Ga.clear(),a.existsSync(Ka)&&a.rmSync(Ka,{recursive:!0}),a.existsSync(Va)&&a.rmSync(Va,{recursive:!0})}const Ma=process.argv.includes("--debug-auth"),Ga=new Map;let Ja=null==(Ba=qa.resources)?void 0:Ba[0];if(Ja)try{Ja=new URL(Ja).hostname}catch(e){Ma&&console.error("Invalid resource URL",Ja)}let Ha=Ja||"-";Ha=Ha.replace(/[^a-zA-Z0-9\.\-]/g,"");const Ka=b.join(Z(),".needle",".auth",Ha),Va=`${X()}/Needle/Cloud/.auth/${Ha}`;!function(){if(a.existsSync(Va)){Ma&&console.debug("Migrating auth data from legacy location",Va,"→",Ka);try{a.existsSync(Ka)||a.mkdirSync(Ka,{recursive:!0,mode:448});for(const e of a.readdirSync(Va)){const n=b.join(Va,e),t=b.join(Ka,e);a.statSync(n).isFile()&&!a.existsSync(t)&&(a.copyFileSync(n,t),a.chmodSync(t,384))}a.rmSync(Va,{recursive:!0}),Ma&&console.debug("Legacy auth data migrated successfully")}catch(e){Ma&&console.error("Failed to migrate legacy auth data",e)}}}();const Ya={accessToken:`${Ka}/accessToken`,refreshToken:`${Ka}/refreshToken`,idToken:`${Ka}/idToken`,signInSession:`${Ka}/signInSession`};function Za(e){return Ya[e]||`${Ka}/${e}`}const Xa=new class{constructor(){this.basePath=Ka}async setItem(e,n){Ma&&console.debug("\n- SET ITEM",e,n),a.existsSync(this.basePath)||a.mkdirSync(this.basePath,{recursive:!0,mode:448});const t=Za(e);t&&a.writeFileSync(t,n,{mode:384}),Ga.set(e,n)}async getItem(e){Ma&&console.debug("\n- GET ITEM",e);const n=Ga.get(e);if(void 0===n){const n=Za(e);if(n){if(a.existsSync(n)){const t=a.readFileSync(n,"utf8");return Ga.set(e,t),t}}else console.error(`Unknown token name: ${e}`);return null}return String(n)}async removeItem(e){Ma&&console.debug("\n- REMOVE ITEM",e),Ga.delete(e);const n=Za(e);if(n&&a.existsSync(n)){try{const e=a.statSync(n).size;e>0&&a.writeFileSync(n,Buffer.alloc(e,0),{mode:384})}catch{}a.rmSync(n)}}};let Qa=null;function es(){return Qa||(Qa=new oe(qa,{storage:Xa,navigate:()=>{}})),Qa}function ns(){Qa=null}let ts=null;function os(e,n){return ts?ts.then(()=>e.getContext(n),()=>e.getContext(n)):(ts=e.getContext(n).finally(()=>{ts=null}),ts)}function is(){return os(e=es(),Wa).then(n=>{const t=n;return t.client=e,t}).catch(async e=>{const n=e instanceof Error?e.message:String(e);return"oidc.invalid_token"==e.code||"oidc.invalid_grant"==e.code?($a(`OIDC: ${e.code} – token refresh failed, clearing stale tokens`),Da(),Qa=null,console.error("Session expired – please log in again: npx needle-cloud login")):e.code?(console.error(e.code),$a(`OIDC: ${e.code} – ${n}`)):$a(`OIDC: getContext failed – ${n}`),null});var e}let as=null;function ss(e){var n;const t=null==(n=e.userInfo)?void 0:n.custom_data;if(!t)return[];const o=t.machines;return o?o.map(e=>e.name):[]}let rs=Date.now();async function cs(e){var n;const t=Date.now();t-rs>3e4&&"client"in e&&(rs=t,await e.client.fetchUserInfo().catch(console.error));const o=null==(n=e.userInfo)?void 0:n.custom_data;if(!o)return!1;if(as||await ls(),!as)return console.error("Failed to get machine id"),!0;const i=o.machines;if(!i)return!1;const a=i.some(e=>e.id===as);return a}async function ls(){return as||await import("node-machine-id").then(async e=>{const n=await e.default.machineId(!1);as=n}),as}function ps(){return Y.userInfo().username+"@"+Y.hostname()}async function us(e,n={signout:!1}){if(e.accessToken){const o={machine_id:await ls(),machine_name:ps(),platform:Y.platform(),arch:Y.arch()},i=await fetch("https://cloud.needle.tools/api"+de.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(e=>{var n,t;const o=(null==e||null==(n=e.cause)?void 0:n.code)||(null==e||null==(t=e.cause)?void 0:t.message)||(null==e?void 0:e.message)||"connection refused";return console.error(`Failed to validate login: ${o} - Make sure https://cloud.needle.tools/api is reachable`),$a(`Failed to validate login: "${o}" - Make sure https://cloud.needle.tools/api is reachable.`),{status:502,error:`Failed to validate login at 'https://cloud.needle.tools/api' (${o}) - make sure this URL is reachable.`}});if(!i)return!1;if("error"in i)return i;let a=!0;if(403===i.status){const e=await i.text();if(e.trimStart().startsWith("{")){const n=JSON.parse(e);n.logins&&(a=!1,$a("Too many logins from different machines"),$().fail("You have reached the maximum number of allowed logins\n"),$().warn(`Please logout from one of the following machines:\n- ${n.logins.join("\n- ")}\n`))}}var t;return!!a||(n.signout&&(Da(),"client"in e&&(null==(t=e.client)||t.signOut(Pa("too-many-logins")))),!1)}return!0}let ds=null;function ms(){if(ds)return ds;{const e=gs();return ds=e,e}}const fs="projects.json";function hs(){const e=process.env.HOME||process.env.USERPROFILE||process.cwd(),n=w(e,".needle");return s(n)||u(n,{recursive:!0}),w(n,fs)}function gs(){const e=hs();if(!s(e))return{entries:[]};const n=c(e,"utf-8");try{const e=JSON.parse(n);return ds=e,e}catch(e){return console.error("Failed to parse project info file:",e),{entries:[]}}}const vs=JSON.parse(c(new URL("../package.json",import.meta.url),"utf-8"));function xs(){return vs.version}const bs=process.env.NEEDLE_SEARCH_ENDPOINT||"https://search.needle.tools",ys=process.env.NEEDLE_SEARCH_API_KEY||"da5737c00d6822c32a1b9e3b5dab094bfc17e205aef2f7f3e1a0fd4ebc77b79f",ws=[{name:"needle_cloud_me",description:"Get current Needle Cloud user information",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},{name:"needle_search",description:"Search Needle Engine documentation, forum posts, and community discussions. Returns relevant content ranked by semantic similarity. Use this to find information about Needle Engine features, APIs, components, workflows, and troubleshooting.\n\nIMPORTANT: If search results seem irrelevant or low-quality (scores below 0.6, or results don't match the topic), retry with different search terms — up to 3 total attempts. Try varying your query: use specific class/method names, try shorter keyword-based queries, or rephrase the question. Do NOT guess or fabricate answers based on poor search results.",inputSchema:{type:"object",properties:{query:{type:"string",description:'What to search for, e.g. "how to add physics components" or "WebXR hand tracking" or "deploy to vercel"'},limit:{type:"number",description:"Maximum number of results to return (1-20, default 5)"}},additionalProperties:!1,required:["query"]}}],_s={needle_cloud_me:async function(e){try{const e=await is(),n=null==e?void 0:e.userInfo;return n?JSON.stringify({id:n.sub,name:n.name||n.preferred_username,email:n.email,profile_picture:n.picture}):"No user is currently logged in."}catch(e){return"Error retrieving user: "+(e instanceof Error?e.message:String(e))}},needle_search:async function(n){const t=n.query;if(!t||"string"!=typeof t)return{content:[{type:"text",text:"Error: query parameter is required."}]};const o=Math.min(Math.max(Number(n.limit)||5,1),20),i=`${bs}/api/semantic-search?q=${encodeURIComponent(t)}&limit=${o}`,a={Accept:"application/json"};ys&&(a.Authorization=`Bearer ${ys}`);try{const n=await e(i,{headers:a,signal:AbortSignal.timeout(15e3)});if(!n.ok){const e=await n.text().catch(()=>"");return{content:[{type:"text",text:`Search API error (${n.status}): ${e}`}]}}const o=await n.json();if(!o.results||0===o.results.length)return{content:[{type:"text",text:`No results found for: "${t}"`}]};const s=o.results.map((e,n)=>`## [${n+1}] ${e.title} (score: ${e.score})\nSource: ${e.source}${e.url?` — ${e.url}`:""}\n\n`+e.content+(e.truncated?`\n\n> Content truncated (${e.content.length} of ${e.contentLength} chars shown).${e.url?` Full content: ${e.url}`:""}`:"")).join("\n\n---\n\n");return{content:[{type:"text",text:`Found ${o.results.length} results for "${t}" (${o.durationMs}ms):\n\n${s}`}]}}catch(e){return{content:[{type:"text",text:`Search failed: ${e instanceof Error?e.message:String(e)}`}]}}}},ks=new Map;function js(e,n){const t=ws.findIndex(n=>n.name===e);-1!==t&&(ws.splice(t,1),delete _s[e],n())}function Ss(e,n,t,o){const i=ws.findIndex(n=>n.name===e.name);if(-1!==i&&ws.splice(i,1),ws.push(e),_s[e.name]=n,$s.delete(e.name),null!=t&&t.source){const n=ks.get(t.source)||new Set;n.add(e.name),ks.set(t.source,n)}o()}const $s=new Map;async function Ts(e,n){const t=_s[e];if(!t){const n=$s.get(e);if(n)return{isError:!0,content:[{type:"text",text:`This tool is currently unavailable because "${n}" disconnected. Please reconnect (e.g. reopen the browser tab) and try again. You should also call tools/list to refresh your available tools.`}]};throw new Error(`Tool "${e}" is not registered.`)}const o=await t(n);if("string"==typeof o)return{content:[{type:"text",text:o}]};if("object"==typeof o)return Array.isArray(o.content)?o:{content:[{type:"text",text:JSON.stringify(o)}]};throw new Error(`Invalid tool result type for tool "${e}".`)}const Es=200,Cs=2e3,Os=new RegExp("^[A-Za-z0-9_./*?\\[\\]{},\\-]+$");function Rs({pattern:e,glob:n,root:t,maxResults:o}){if("string"!=typeof e)throw new Error("invalid pattern: must be a string");if(e.length>Cs)throw new Error(`invalid pattern: exceeds ${Cs} characters`);if(null!=n&&""!==n){if("string"!=typeof n)throw new Error("invalid glob: must be a string");if(n.length>Es)throw new Error(`invalid glob: exceeds ${Es} characters`);if(!Os.test(n))throw new Error("invalid glob: contains disallowed characters")}const i=["-rn"];return n&&i.push(`--include=${n}`),i.push(`--max-count=${o}`,"-E",e,t),i}function zs(e={}){Ss({name:"get_editor_logpath",description:"Get the filepath to the editor log file (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];if(null!=e&&e.log_location){const t=r(e.log_location).mtime;n.content.push({type:"text",text:`${e.log_location} (last modified: ${t.toLocaleString()})`})}else{let t="No recent project with known log location known.";e&&(t+=" Recent project is "+(null==e?void 0:e.project_location)),n.content.push({type:"text",text:t})}}return n},{source:"cli"},()=>{}),Ss({name:"get_editor_project_path",description:"Get the filepath to the currently opened project in the editor (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.project_location?{type:"text",text:e.project_location}:{type:"text",text:"No recent project with known project location known."})}return n},{source:"cli"},()=>{}),Ss({name:"get_editor_scene_path",description:"Get the filepath to the currently opened scene in the editor (Unity or Blender). Use this to find out which scene the user is working on.",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.scene_location?{type:"text",text:e.scene_location}:{type:"text",text:"No recent project with known scene location known."})}return n},{source:"cli"},()=>{}),Ss({name:"get_web_project_path",description:"Get the filepath to the web project directory (the Needle Engine web frontend project).",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.web_location?{type:"text",text:e.web_location}:{type:"text",text:"No recent project with known web project location known."})}return n},{source:"cli"},()=>{}),Ss({name:"local_read_file",description:"Read a file from the user's local project (editor project or web project). The path must be relative to the project root or an absolute path inside the project. Returns the file contents (or a portion if offset/limit are specified). Use 'filter' to search for specific terms within the file.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path (relative to project root, or absolute within the project)"},offset:{type:"number",description:"Line number to start reading from (1-based, default: 1). In filter mode: number of matches to skip."},limit:{type:"number",description:"Maximum number of lines to return (default: 200, max: 1000). In filter mode: max matches to return."},filter:{type:"string",description:"Search term to grep for in the file (case-insensitive). Returns matching lines with line numbers instead of sequential content."}},additionalProperties:!1,required:["path"]}},async e=>{const n=Fs(e.path);if(!n)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};try{const t=r(n.resolved).mtime.toISOString(),o=c(n.resolved,"utf-8").split("\n");if(e.filter){const i=e.filter.toLowerCase(),a=[];for(let e=0;e<o.length;e++)o[e].toLowerCase().includes(i)&&a.push(`${e+1}: ${o[e]}`);const s=a.length,r=Math.max(0,e.offset||0),c=Math.min(Math.max(e.limit||200,1),1e3),l=a.slice(r,r+c);return{content:[{type:"text",text:`File: ${n.resolved} (modified: ${t}) — filter="${e.filter}" → ${s} matches (showing ${r+1}-${r+l.length}) in ${o.length} lines\n`+l.join("\n")}]}}const i=Math.max(1,e.offset||1),a=Math.min(e.limit||200,1e3),s=o.slice(i-1,i-1+a),l=s.map((e,n)=>`${i+n}: ${e}`).join("\n");return{content:[{type:"text",text:`File: ${n.resolved} (${o.length} lines, modified: ${t}, showing ${i}-${i+s.length-1})\n`+l}]}}catch(e){return{content:[{type:"text",text:`Error reading file: ${e.message}`}]}}},{source:"cli"},()=>{}),Ss({name:"local_grep",description:"Search for a pattern in the user's local project files (editor project and web project) using grep. Returns matching lines with file paths and line numbers.",inputSchema:{type:"object",properties:{pattern:{type:"string",description:"Search pattern (regular expression)"},glob:{type:"string",description:"File glob filter, e.g. '*.ts' or '*.cs' (optional)"},max_results:{type:"number",description:"Maximum number of matching lines to return (default: 50)"}},additionalProperties:!1,required:["pattern"]}},async e=>{const n=Ls();if(0===n.length)return{content:[{type:"text",text:"Error: no active project found."}]};const t=Math.min(e.max_results||50,200),o=[];try{Rs({pattern:e.pattern,glob:e.glob,root:".",maxResults:t})}catch(e){return{content:[{type:"text",text:`Error: ${e.message}`}]}}for(const a of n)try{const n=Rs({pattern:e.pattern,glob:e.glob,root:a,maxResults:t});let s="";try{s=re("grep",n,{encoding:"utf-8",maxBuffer:1048576,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch(e){if(1!==(null==e?void 0:e.status))throw e;var i;s=(null==(i=e.stdout)||null==i.toString?void 0:i.toString())||""}if(s.trim()){const e=s.trim().split("\n").map(e=>e.startsWith(a)?e.substring(a.length+1):e);o.push(...e)}}catch{}if(0===o.length){const t=n.length>0?`\nSearched in:\n${n.join("\n")}`:"\nNo project directories available to search.";return{content:[{type:"text",text:`No matches found for pattern: ${e.pattern}${t}`}]}}const a=o.slice(0,t);return{content:[{type:"text",text:`Found ${o.length} matches${o.length>t?` (showing first ${t})`:""}:\n`+a.join("\n")}]}},{source:"cli"},()=>{}),Ss({name:"local_list_files",description:"List files in the user's local project directories matching an optional glob pattern. By default searches both the editor project (Unity/Blender) and the web project. Use the 'project' parameter to target a specific one. Results are prefixed with <web_project>/..., <unity>/..., or <blender>/... so you know which root each file belongs to.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Subdirectory to list (relative to the selected project root, default: root)"},pattern:{type:"string",description:"Glob pattern to filter files, e.g. '*.ts' or '*.glb'. Supports multiple patterns separated by '|', e.g. '*.gltf|*.glb' (optional)"},recursive:{type:"boolean",description:"Whether to list files recursively (default: false)"},project:{type:"string",enum:["web","editor"],description:"Which project root to search: 'web' for the Needle Engine web project (use this for exported assets, source files, node_modules), 'editor' for the Unity/Blender project. Omit to search both."}},additionalProperties:!1,required:[]}},async e=>{const n=Ns();if(!n)return{content:[{type:"text",text:"Error: no active project found."}]};const t="blender"===n.editor?"<blender>":"unity"===n.editor?"<unity>":"<editor_project>",o=[];if(e.project&&"editor"!==e.project||!n.project_location||o.push({root:y(n.project_location),label:t}),e.project&&"web"!==e.project||!n.web_location||o.push({root:y(n.web_location),label:"<web_project>"}),0===o.length)return{content:[{type:"text",text:"Error: no active project found."}]};const i=[];for(const{root:n,label:t}of o){const o=e.path?As(e.path,n):n;if(o)try{var a;const s=Is(o,n,null!=(a=e.recursive)&&a,e.pattern,0);i.push(...s.map(e=>({file:e,root:n,label:t})))}catch{}}if(0===i.length)return{content:[{type:"text",text:"No files found."+(o.length>0?`\nSearched in:\n${o.map(e=>`${e.label} → ${e.root}`).join("\n")}`:"\nNo project directories available to search.")}]};const s=i.slice(0,500).map(e=>`${e.label}/${_(e.root,e.file)}`);return{content:[{type:"text",text:`Found ${i.length} files${i.length>500?" (showing first 500)":""}:\n`+s.join("\n")}]}},{source:"cli"},()=>{}),Ss({name:"local_read_editor_log",description:"Read or search the Unity or Blender editor log file. By default reads the last N lines. Use the 'filter' parameter to search for specific terms (e.g. error messages, warnings, component names) across the entire log.",inputSchema:{type:"object",properties:{lines:{type:"number",description:"Number of lines to read from the end of the log (default: 100, max: 500). Ignored when filter is set."},filter:{type:"string",description:"Search term to grep for in the log (case-insensitive). Returns all matching lines from the entire log instead of just the tail."},offset:{type:"number",description:"Number of matching results to skip from the start (default: 0). Only used with filter."},limit:{type:"number",description:"Maximum number of matching results to return (default: 200, max: 500). Only used with filter."}},additionalProperties:!1,required:[]}},async e=>{const n=Ns();var t;if(null==n||!n.log_location)return $a(`read_editor_log: no editor log file known (project: ${null!=(t=null==n?void 0:n.project_location)?t:"none"})`),{content:[{type:"text",text:"Error: no editor log file known. Is a Unity or Blender project open?"}]};try{const t=c(n.log_location,"utf-8").split("\n");let o,i;if(e.filter){const n=e.filter.toLowerCase();o=[];for(let e=0;e<t.length;e++)t[e].toLowerCase().includes(n)&&o.push(`L${e+1}: ${t[e]}`);const a=o.length,s=Math.max(0,e.offset||0),r=Math.min(Math.max(e.limit||200,1),500);o=o.slice(s,s+r),i=`filter="${e.filter}" → ${a} matches (showing ${s+1}-${s+o.length}) in ${t.length} total lines`}else{const n=Math.min(Math.max(e.lines||100,1),500);o=t.slice(-n),i=`last ${n} of ${t.length} lines`}const a="unity"===n.editor?function(e){const n=[],t=new Map;let o=!1,i=0;for(const a of e){if(/^\s+at\s/.test(a)||/^\s*(UnityEngine\.|System\.|Unity\.)/.test(a)||/^\s+\w+[\w.<>]+\s*\(/.test(a)){o||(o=!0,i=0),i++,i<=3?n.push(a):4===i&&n.push(" ... (stack trace truncated)");continue}if(o=!1,i=0,!a.trim())continue;const e=t.get(a)||0;if(t.set(a,e+1),0===e)n.push(a);else if(1===e)n.push(` [repeated ${e+1}x] ${a}`);else{const t=n.length-1;t>=0&&n[t].startsWith(" [repeated")&&(n[t]=` [repeated ${e+1}x] ${a}`)}}return n}(o):o,s=5e4;let r=a.join("\n"),l="";if(r.length>s){r=r.substring(r.length-s);const e=r.indexOf("\n");e>0&&(r=r.substring(e+1)),l=" (output truncated to last ~50KB)"}return{content:[{type:"text",text:`Editor log: ${n.log_location} (${i}, ${a.length} after processing, editor: ${n.editor})${l}:\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading log: ${e.message}`}]}}},{source:"cli"},()=>{}),Ss({name:"local_read_gltf",description:"Read and summarize a glTF or GLB file from the user's local project. Without a query, returns a structured summary including nodes, meshes, materials, animations, extensions, and compression/optimization hints. Use 'query' to drill into specific parts using JSON pointer paths. Use '*' as a wildcard for array indices or object keys. For GLB files, extracts the JSON chunk and skips binary data.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path to a .gltf or .glb file (relative to project root, or absolute path)"},query:{type:"string",description:"JSON pointer path to extract a specific part of the glTF, e.g. '/nodes/0', '/materials', '/extensions/NEEDLE_progressive', '/materials/*/extensions'. Use '*' as a wildcard for array indices or object keys."}},additionalProperties:!1,required:["path"]}},async e=>{let n=Fs(e.path);if(!n)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};if(!s(n.resolved))return{content:[{type:"text",text:`Error: file not found: ${n.resolved}`}]};try{const t=function(e){const n=e.toLowerCase();if(n.endsWith(".gltf")){const n=c(e,"utf-8");return JSON.parse(n)}if(n.endsWith(".glb")){const n=c(e);if(n.length<20)return null;if(1179937895!==n.readUInt32LE(0))return null;const t=n.readUInt32LE(12);if(1313821514!==n.readUInt32LE(16))return null;const o=n.toString("utf-8",20,20+t);return JSON.parse(o)}return null}(n.resolved);if(!t)return{content:[{type:"text",text:"Error: could not parse glTF/GLB file."}]};const o=5e4;if(e.query){const i=Us(t,e.query.replace(/^\//,"").split("/"));if(void 0===i)return{content:[{type:"text",text:`No data found at pointer: ${e.query}`}]};let a=JSON.stringify(i),s=!1;return a.length>o&&(a=a.substring(0,o),s=!0),{content:[{type:"text",text:`${e.query} in ${n.resolved}`+(s?` (truncated to ${o} chars)`:"")+"\n"+a}]}}let i=function(e,n){var t,o,i,a,s,r,c,l,p,u,d,m,f;const h=[`glTF: ${n}`];if(e.asset){const n=[];e.asset.version&&n.push(`v${e.asset.version}`),e.asset.generator&&n.push(e.asset.generator),h.push(`Asset: ${n.join(", ")}`)}if(null!=(t=e.extensionsUsed)&&t.length&&h.push(`Extensions used: ${e.extensionsUsed.join(", ")}`),null!=(o=e.extensionsRequired)&&o.length&&h.push(`Extensions required: ${e.extensionsRequired.join(", ")}`),null!=(i=e.scenes)&&i.length&&h.push(`Scenes: ${e.scenes.length}${void 0!==e.scene?` (default: ${e.scene})`:""}`),null!=(a=e.nodes)&&a.length){var g,v,x;h.push(`\nNodes (${e.nodes.length}):`);const n=null!=(g=null==(v=e.scenes)||null==(v=v[null!=(x=e.scene)?x:0])?void 0:v.nodes)?g:[],t=new Set,o=(n,i)=>{if(i>6||t.has(n))return;t.add(n);const a=e.nodes[n];if(!a)return;const s=" ".repeat(i),r=[];if(void 0!==a.mesh&&r.push(`mesh:${a.mesh}`),void 0!==a.camera&&r.push(`camera:${a.camera}`),void 0!==a.skin&&r.push(`skin:${a.skin}`),a.extensions&&r.push(`ext:[${Object.keys(a.extensions).join(",")}]`),h.push(`${s}- ${a.name||`node_${n}`}${r.length?` (${r.join(", ")})`:""}`),a.children)for(const e of a.children)o(e,i+1)};for(const e of n)o(e,1);t.size<e.nodes.length&&t.size>0&&h.push(` ... and ${e.nodes.length-t.size} more nodes`)}if(null!=(s=e.meshes)&&s.length){h.push(`\nMeshes (${e.meshes.length}):`);for(const n of e.meshes.slice(0,30)){var b,y;const e=null!=(b=null==(y=n.primitives)?void 0:y.length)?b:0;h.push(` - ${n.name||"(unnamed)"} (${e} primitive${1!==e?"s":""})`)}e.meshes.length>30&&h.push(` ... and ${e.meshes.length-30} more`)}if(null!=(r=e.materials)&&r.length){h.push(`\nMaterials (${e.materials.length}):`);for(const n of e.materials.slice(0,30)){const e=n.name||"(unnamed)",t=[];n.pbrMetallicRoughness&&t.push("PBR"),n.alphaMode&&"OPAQUE"!==n.alphaMode&&t.push(n.alphaMode),n.doubleSided&&t.push("doubleSided"),n.extensions&&t.push(`ext:[${Object.keys(n.extensions).join(",")}]`),h.push(` - ${e}${t.length?` (${t.join(", ")})`:""}`)}e.materials.length>30&&h.push(` ... and ${e.materials.length-30} more`)}if(null!=(c=e.textures)&&c.length&&h.push(`Textures: ${e.textures.length}`),null!=(l=e.images)&&l.length&&h.push(`Images: ${e.images.length}`),null!=(p=e.animations)&&p.length){h.push(`\nAnimations (${e.animations.length}):`);for(const n of e.animations.slice(0,20)){var w,_;const e=null!=(w=null==(_=n.channels)?void 0:_.length)?w:0;h.push(` - ${n.name||"(unnamed)"} (${e} channel${1!==e?"s":""})`)}e.animations.length>20&&h.push(` ... and ${e.animations.length-20} more`)}if(null!=(u=e.skins)&&u.length){h.push(`\nSkins (${e.skins.length}):`);for(const n of e.skins.slice(0,10)){var k,j;h.push(` - ${n.name||"(unnamed)"} (${null!=(k=null==(j=n.joints)?void 0:j.length)?k:0} joints)`)}}if(null!=(d=e.cameras)&&d.length){h.push(`\nCameras (${e.cameras.length}):`);for(const n of e.cameras)h.push(` - ${n.name||"(unnamed)"} (${n.type})`)}if(null!=(m=e.buffers)&&m.length){const n=e.buffers.reduce((e,n)=>e+(n.byteLength||0),0);h.push(`\nBuffers: ${e.buffers.length} (${(n/1024/1024).toFixed(1)} MB total)`)}return null!=(f=e.accessors)&&f.length&&h.push(`Accessors: ${e.accessors.length}`),h.join("\n")}(t,n.resolved);return i.length>o&&(i=i.substring(0,o)+"\n... (truncated)"),{content:[{type:"text",text:i}]}}catch(e){return{content:[{type:"text",text:`Error reading glTF: ${e.message}`}]}}},{source:"cli"},()=>{}),Ss(ra.schema,async e=>{const n=await ra.execute(e);return"error"in n?{content:[{type:"text",text:n.error}]}:{content:[{type:"text",text:n.content}]}},{source:"cli"},()=>{}),null!=e&&e.logToolCount&&$a(`[MCP] registered ${ws.length} built-in tools: ${ws.map(e=>e.name).join(", ")}`)}function Ns(){var e;const n=ms();return null!=n&&null!=(e=n.entries)&&e.length?n.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0]:null}function As(e,n){const t=y(n,e),o=y(n);return t.startsWith(o+k)||t===o?t:null}function Ls(){const e=Ns();if(!e)return[];const n=[];return e.project_location&&n.push(y(e.project_location)),e.web_location&&n.push(y(e.web_location)),n}function Fs(e){const n=Ls();for(const t of n){const n=As(e,t);if(n&&s(n))return{resolved:n,root:t}}for(const t of n){const n=As(e,t);if(n)return{resolved:n,root:t}}const t=y(e);for(const e of n)if(t.startsWith(e+k)||t===e)return{resolved:t,root:e};return null}function Us(e,n){if(0===n.length||null==e)return e;const[t,...o]=n;if("*"!==t)return Us(e[/^\d+$/.test(t)?Number(t):t],o);if(Array.isArray(e)){const n=e.map(e=>Us(e,o)).filter(e=>void 0!==e);return n.length>0?n:void 0}if("object"==typeof e){const n={};for(const t of Object.keys(e)){const i=Us(e[t],o);void 0!==i&&(n[t]=i)}return Object.keys(n).length>0?n:void 0}}function Is(e,n,t,o,i){if(i>10)return[];const a=[],s=l(e,{withFileTypes:!0}),r="node_modules"===(e.split("/").pop()||e.split("\\").pop()||"");for(const c of s){if(r){if(".needle"!==c.name&&".vite"!==c.name)continue}else{if("Library"===c.name)continue;if(c.name.startsWith(".")||"node_modules"===c.name){if(!t)continue;if(c.name.startsWith("."))continue}}const s=w(e,c.name);if(c.isDirectory())t&&a.push(...Is(s,n,!0,o,i+1));else{if(o&&!o.split("|").map(e=>(e=e.trim()).startsWith(".")&&!e.startsWith("*.")?"*"+e:e).filter(Boolean).some(e=>ce(c.name,e,{nocase:!0})))continue;a.push(s)}}return a}const qs="settings.json";function Ws(){return W(I(),".needle")}function Ps(e){const n=W(null!=e?e:Ws(),qs);if(!T(n))return{};try{const e=JSON.parse(N(n,"utf-8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function Bs(e){return"disabled"===Ps(e).remote_ai_tools}function Ds(e,n){if(!T(e))try{E(e,{recursive:!0})}catch{}let t=null,o=null;try{t=L(e,{persistent:!1},(e,t)=>{t&&t.toString()!==qs||(o&&clearTimeout(o),o=setTimeout(()=>{o=null;try{n()}catch{}},50))}),null==t.on||t.on("error",()=>{})}catch{}return()=>{o&&(clearTimeout(o),o=null);try{var e;null==(e=t)||e.close()}catch{}t=null}}var Ms={__proto__:null,KNOWN_SETTINGS:{remote_ai_tools:{displayName:"Remote AI tools",default:"enabled",description:"Allow Needle Cloud AI chat to dispatch tool calls (file reads, search, etc.) to this machine.",command:"needle-cloud settings remote-ai-tools <true|false>"}},defaultSettingsDir:Ws,readSettings:Ps,writeSetting:function(e,n,t){const o=Ps(e);null===t?delete o[n]:o[n]=t,E(e,{recursive:!0}),A(W(e,qs),JSON.stringify(o,null,2)+"\n","utf-8")},areRemoteAiToolsDisabled:Bs,watchSettings:Ds};const Gs=2e3,Js=6e4,Hs=25e3,Ks=1e4,Vs=o();let Ys=null,Zs=null,Xs=null,Qs=null,er=Gs,nr=!1,tr=!1;function or(){Ys||(Bs()?$a("Needle Cloud connection: skipped (remote_ai_tools disabled in settings)"):(nr=!1,Zs&&(clearTimeout(Zs),Zs=null),er=Gs,ar()))}function ir(e){nr=!0,sr(),Zs&&(clearTimeout(Zs),Zs=null),Ys?($a(`Needle Cloud connection: closing (reason: ${null!=e?e:"shutdown"})`),Ys.close(1e3,null!=e?e:"shutdown"),Ys=null):e&&$a(`Needle Cloud connection: disconnect requested (reason: ${e}) — no active connection`)}async function ar(){let e=await async function(){try{var e;return null!=(e=(await os(es(),{getAccessToken:!0,fetchUserInfo:!1,resource:Wa.resource})).accessToken)?e:null}catch(e){return $a(`Token refresh failed: ${e instanceof Error?e.message:e}`),e&&"object"==typeof e&&"oidc.invalid_grant"===e.code&&(Da(),Qa=null),null}}();if(e||(e=function(){const e=Za("accessToken");if(a.existsSync(e)){const n=a.readFileSync(e,"utf8");if(n){const e=JSON.parse(n),t=null==e?void 0:e["@https://cloud.needle.tools/api"];return null==t?void 0:t.token}}return null}(),e&&$a("Needle Cloud connection: using cached token (refresh failed)")),!e)return tr||($a("Needle Cloud connection: skipped (not logged in)"),tr=!0),void rr(!0);tr=!1;const n="https://cloud.needle.tools/api".replace(/^http/,"ws")+"/v1/cli/ws?token="+encodeURIComponent(e)+"&instance="+encodeURIComponent(Vs);$a("Needle Cloud connection: connecting...");const t=`needle-cloud/${xs()} Node/${process.versions.node}`;Ys=new ae(n,{headers:{"User-Agent":t,Origin:"cli://needle-cloud"}}),Ys.on("open",()=>{er=Gs,$a("Needle Cloud connection: established"),function(){var e,n,t,o,i;if(!Ys||Ys.readyState!==ae.OPEN)return;const a=ms(),s=null==a||null==(e=a.entries)||null==(e=e.sort((e,n)=>n.last_accessed-e.last_accessed))?void 0:e[0],r={type:"presence",editor:null!=(n=null==s?void 0:s.editor)?n:"unknown",project:null!=(t=null==s?void 0:s.project_location)?t:null,scene:null!=(o=null==s?void 0:s.scene_location)?o:null,web_project:null!=(i=null==s?void 0:s.web_location)?i:null,cli_version:xs()};Ys.send(JSON.stringify(r))}(),function(){if(!Ys||Ys.readyState!==ae.OPEN)return;try{zs()}catch(e){$a(`Needle Cloud connection: registerServerTools failed: ${e}`)}const e=ws.map(e=>e.name);$a(`Needle Cloud connection: sending ${e.length} tools: ${e.join(", ")}`),Ys.send(JSON.stringify({type:"tools",tools:ws.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema}))}))}(),sr(),Xs=setInterval(()=>{Ys&&Ys.readyState===ae.OPEN&&(Ys.ping(),Qs=setTimeout(()=>{$a("Needle Cloud connection: pong timeout, terminating"),Ys&&Ys.terminate()},Ks))},Hs)}),Ys.on("pong",()=>{Qs&&(clearTimeout(Qs),Qs=null)}),Ys.on("message",e=>{try{const t=JSON.parse(e.toString());var n;"execute_tool"===t.type&&t.requestId&&t.toolName&&async function(e,n,t){$a(`Cloud tool request: ${n}(${Object.keys(t).length>0?" "+Object.entries(t).map(([e,n])=>`${e}=${JSON.stringify(n)}`).join(", "):""}) [${e}]`);const o=Date.now();try{var i,a;const s=await Ts(n,t);$a(`Cloud tool result: ${n} → ${null!=(i=null==s||null==(a=s.content)?void 0:a.reduce((e,n)=>{var t;return e+((null==(t=n.text)?void 0:t.length)||0)},0))?i:0} chars in ${Date.now()-o}ms [${e}]`),Ys&&Ys.readyState===ae.OPEN&&Ys.send(JSON.stringify({type:"tool_result",requestId:e,result:s}))}catch(t){const i=t instanceof Error?t.message:String(t);$a(`Cloud tool error: ${n} → ${i} in ${Date.now()-o}ms [${e}]`),Ys&&Ys.readyState===ae.OPEN&&Ys.send(JSON.stringify({type:"tool_result",requestId:e,error:i}))}}(t.requestId,t.toolName,null!=(n=t.args)?n:{})}catch{}}),Ys.on("close",(e,n)=>{const t=(null==n?void 0:n.toString())||"";$a(`Needle Cloud connection: closed (code=${e}${t?" "+t:""})`),sr(),Ys=null,nr||rr()}),Ys.on("error",e=>{$a(`Needle Cloud connection: error - ${e.message||"connection refused"} (is https://cloud.needle.tools/api reachable?)`)})}function sr(){Xs&&(clearInterval(Xs),Xs=null),Qs&&(clearTimeout(Qs),Qs=null)}function rr(e=!1){nr||Zs||(e||$a(`Needle Cloud connection: reconnecting in ${er/1e3}s`),Zs=setTimeout(()=>{Zs=null,ar()},er),er=Math.min(2*er,Js))}const cr=e=>{const n=ie();return n.use("/:action",async(n,t,o)=>{const{action:i}=n.params,a=(s={navigate:e=>{t.redirect(e)}},new oe(qa,{storage:Xa,navigate:e=>{if(null==s.navigate)throw new Error("Can not navigate");s.navigate(e)}}));var s;switch(i){case"sign-in":e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,$a("Sign in..."),await a.clearAllTokens(),ns();try{await a.signIn(`${Ua}/auth-callback`)}catch(e){const n=null==e?void 0:e.cause,o=`Sign-in failed: ${null!=n&&n.code?`${n.code}${n.address?` (${n.address}:${n.port})`:""}`:(null==e?void 0:e.message)||"unknown error"}`;return $a(o),console.error(o),t.status(502).send(o)}break;case"sign-out":{var r,c;const n=await is(),t=(null==n||null==(r=n.userInfo)?void 0:r.sub)||(null==n||null==(c=n.claims)?void 0:c.sub),o=null==n?void 0:n.accessToken;$a(`Sign out... (${t})`),t&&o&&await async function(e){return!e.accessToken||import("node-machine-id").then(async n=>{const t=await ls();return as=t,await fetch("https://cloud.needle.tools/api"+de.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify({action:"logout",machine_id:t,machine_name:ps()})}).catch(e=>{$a(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`),console.error(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`)}),!0})}({userId:t,accessToken:o}).catch(e=>{console.error(e),$a(`Failed to validate logout: ${e}`)}),e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,console.log("User signed out"+(t?`: ${t}`:"")),await a.signOut(Pa()),ns();break}case"auth-callback":if(n.url){const o=await a.handleSignInCallback(`${Ua}${n.originalUrl}`).catch(e=>({error:e}));if(ns(),o&&"error"in o){$a(`Error during sign in: ${o.error}`);const e=o.error instanceof Error?o.error.message:String(o.error);t.redirect(Ua+"?cancelled&message="+encodeURIComponent(e))}else{var l,p,u,d;const n=await is();if(null!=n&&n.isAuthenticated){var m,f;e.invalid_login=!1,e.user_email=(null==(m=n.claims)?void 0:m.email)||(null==(f=n.userInfo)?void 0:f.email)||null,e.logged_in_machine_names=[...ss(n)];const o=await us(n,{signout:!0});if(!o)return e.invalid_login=!0,e.invalid_login_type="too-many-logins",t.redirect(Pa("too-many-logins"));if("object"==typeof o&&"error"in o)return e.invalid_login=!0,e.invalid_login_type="error",e.error=o.error,t.redirect(Pa("error"));ns()}console.log(`User logged in: ${(null==n||null==(l=n.userInfo)?void 0:l.sub)||(null==n||null==(p=n.claims)?void 0:p.sub)}`),$a(`User logged in: ${(null==n||null==(u=n.userInfo)?void 0:u.sub)||(null==n||null==(d=n.claims)?void 0:d.sub)}`),or(),t.redirect(Ua)}}break;default:o()}}),n};function lr(e){var n,t,o,i;if(!e)return"";let a=(null==(n=e.claims)?void 0:n.name)||(null==(t=e.userInfo)?void 0:t.name)||(null==(o=e.claims)?void 0:o.username)||"";var s,r;return(!a||a.length<=0)&&null!=(i=e.claims)&&i.email?(r=null==(s=e.claims)?void 0:s.email)?(r=(r=(r=(r=r.split("@")[0]).replace(/[^a-zA-Z0-9]/g," ")).replace(/\s+/g," ")).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),r):r:a}async function pr(e,n=null){var t,o;if(!e)return{status:500,error:"User is not provided"};if(!e.isAuthenticated)return{status:403,error:"User is not authenticated"};const i=(null==(t=e.claims)?void 0:t.sub)||(null==(o=e.userInfo)?void 0:o.sub);n===i&&(n=null);let a=null;if(null==n)a=e.accessToken;else if(null!=n){var s;let t=null==e||null==(s=e.userInfo)||null==(s=s.organization_data)?void 0:s.find(e=>e.id===n);if(!t){var r;const o=n.toLowerCase();t=null==e||null==(r=e.userInfo)||null==(r=r.organization_data)?void 0:r.find(e=>e.name.toLowerCase()===o)}if(!t)return{status:403,error:`User is not part of team "${n}"`};n=t.id,a=await e.client.getOrganizationToken(t.id).catch(e=>{var o;return console.error(`Error getting organization token for "${null==(o=t)?void 0:o.name}" (${n}): ${e.message}`),null})}return a?{authToken:a,org:n}:{status:403,error:"No access token found"}}const ur=function(){return async(e,n,t)=>{const o=await is();Object.defineProperty(e,"user",{enumerable:!0,get:()=>o}),t()}},dr=`${Ua}/mcp`,mr="2025-06-18",fr={name:"Needle Cloud MCP",version:"1.0.0"};function hr(e){return{jsonrpc:"2.0",id:e,result:{protocolVersion:mr,capabilities:{tools:{listChanged:!0}},serverInfo:fr}}}async function gr(e,n){const t=!0===(null==n?void 0:n.proxy),{method:o,params:i,id:a}=e;if("initialize"===o)return hr(null!=a?a:0);if("ping"===o)return{jsonrpc:"2.0",id:a,result:{}};if("notifications/initialized"===o||"notifications/cancelled"===o)return null;if("tools/list"===o){try{zs()}catch{}let e=ws;if(t){const n=await async function(){try{var e,n;const t=await fetch(dr,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"}),signal:AbortSignal.timeout(2e3)});return t.ok&&null!=(e=null==(n=(await t.json()).result)?void 0:n.tools)?e:[]}catch{return[]}}();if(n.length>0){const t=new Set(ws.map(e=>e.name));e=[...ws,...n.filter(e=>!t.has(e.name))]}}return{jsonrpc:"2.0",id:a,result:{tools:e}}}if("tools/call"===o){const e=null==i?void 0:i.name;try{zs()}catch{}try{return{jsonrpc:"2.0",id:a,result:await Ts(e,(null==i?void 0:i.arguments)||{})}}catch(n){if(t)try{const n=await async function(e,n){const t=await fetch(dr,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:e,arguments:n}}),signal:AbortSignal.timeout(35e3)}),o=await t.json();if(o.error)throw new Error(o.error.message);return o.result}(e,(null==i?void 0:i.arguments)||{});return{jsonrpc:"2.0",id:a,result:n}}catch{}return{jsonrpc:"2.0",id:a,error:{code:-32603,message:`Tool execution failed: ${n.message}`}}}}return{jsonrpc:"2.0",id:null!=a?a:null,error:{code:-32601,message:`Method '${o}' not found`}}}function vr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}let xr=!1;const br=ie(),yr=new Set,wr=new Map;let _r=0;function kr(){const e=[];for(const[n,{connectedAt:t,userAgent:o}]of wr)e.push({id:n,connectedAt:t,userAgent:o});return e}function jr(e,n,t){if((n.headers.accept||"").includes("text/event-stream")){t.setHeader("Content-Type","text/event-stream"),t.setHeader("Cache-Control","no-cache"),t.setHeader("Connection","keep-alive"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),t.flushHeaders(),t.write(": connected\n\n");const o=n.headers["user-agent"]||"";return wr.set(e,{id:e,client:t,connectedAt:Date.now(),userAgent:o}),console.log(`[MCP] SSE client connected (ID: ${e}) ${o}. Total clients: ${wr.size}`),$a(`MCP SSE client connected (ID: ${e}) ${o}. Total clients: ${wr.size}`),n.on("close",()=>{console.log(`[MCP] SSE client disconnected (ID: ${e}): ${o}`),$a(`MCP SSE client disconnected (ID: ${e}): ${o}`),wr.delete(e)}),!0}return!1}function Sr(e){if(!Array.isArray(e))return console.error("Invalid input: paths should be an array of strings."),null;for(const n of e)if(!1!==s(n))try{const e=$r(n);if(e)return e}catch(e){}}function $r(e){const n=w(e,".git");if(s(n)){const e=function(e){const n=m(e);if(n.isDirectory())return w(e,"config");if(n.isFile()){const n=c(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(n){let t=n[1].trim();j(t)||(t=y(S(e),t));const o=w(t,"config");if(s(o))return o;const i=w(t,"commondir");if(s(i)){let e=c(i,"utf-8").trim();return j(e)||(e=y(t,e)),w(e,"config")}}}return null}(n);if(e&&s(e)){const n=function(e){const n=c(e,"utf-8"),t=/\[remote\s+"(?<name>.+?)"\].+?url\s*=\s*(?<url>.+?)$/gms,o=[];let i;for(;null!==(i=t.exec(n));)if(i.groups){const e=i.groups.name,n=i.groups.url.trim();n.length&&o.push({name:e,url:n})}const a=o.find(e=>"origin"===e.name)||o.find(e=>"upstream"===e.name)||o[0];return a?a.url:null}(e);if(n)return n}}const t=w(e,".plastic");if(s(t)){const e=w(t,"replicas.db");if(s(e)){const n=c(e,"utf-8").split("\n");for(const e of n){const n=e.split("=");if(2===n.length&&"repo"===n[0].trim()){const e=n[1].trim();if(e.length)return e}}}}const o=w(e,"..");return o===e?null:$r(o)}br.get("/mcp",async(e,n)=>{if(jr(_r++,e,n))return;const t=function(e){const n=[...ws].sort((e,n)=>e.name.localeCompare(n.name)),t=n.map(e=>`\n <div class="tool">\n <span class="tool-name">${vr(e.name)}</span>\n <span class="tool-desc">${vr(function(e){const n=e.indexOf("\n");return-1===n?e:e.slice(0,n)}(e.description))}</span>\n </div>`).join("\n");return`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Needle MCP Server</title>\n <style>\n * { box-sizing: border-box; }\n body {\n background: #f0f4ef;\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.6;\n padding: 20px 24px;\n max-width: 960px;\n margin: 0 auto;\n color: #1a1a1a;\n }\n header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n }\n h2 {\n margin-top: 1.2em;\n margin-bottom: 0.4em;\n }\n a { color: inherit; }\n img.logo {\n height: 2em;\n width: auto;\n }\n .badge {\n font-size: 0.75em;\n background: #d0d4cf;\n padding: 2px 8px;\n border-radius: 10px;\n vertical-align: middle;\n font-weight: normal;\n }\n .tools-info {\n color: #555;\n font-size: 0.9rem;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n /* Tool items */\n .tool {\n background: #fff;\n border: 1px solid #d8dcd7;\n border-radius: 6px;\n margin-bottom: 6px;\n padding: 10px 14px;\n display: flex;\n align-items: baseline;\n gap: 10px;\n }\n .tool-name {\n font-weight: 600;\n white-space: nowrap;\n }\n .tool-desc {\n color: #555;\n font-size: 0.9rem;\n }\n</style>\n</head>\n<body>\n <header>\n <img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" />\n <strong>Needle MCP Server</strong>\n </header>\n\n <p>The Needle MCP server is alive and running.</p>\n\n <h2>Usage</h2>\n <p><a href="https://fwd.needle.tools/mcp">Open Documentation</a></p>\n\n <h2>Available Tools <span class="badge">${n.length}</span></h2>\n <p class="tools-info">These tools are available to AI agents connected via the Model Context Protocol (MCP).</p>\n ${t}\n</body>\n</html>`}();n.status(200).header("Content-Type","text/html; charset=utf-8").send(t)}),br.post("/mcp",async(e,n)=>{const t=e.headers.accept||"",o=e.headers["user-agent"]||"",{method:i,id:a}=e.body;console.log(`[MCP] Received request from ${o} (${i}) (ID: ${a})`),n.setHeader("Content-Type","application/json"),n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id");try{if("initialize"===i&&t.includes("text/event-stream")){const t=void 0!==a?a:_r++;if(jr(t,e,n)){xr=!0;const e=hr(t);return void n.write(`data: ${JSON.stringify(e)}\n\n`)}}const r=await gr(e.body);if("initialize"===i){xr=!0;const e=v();yr.add(e),n.setHeader("Mcp-Session-Id",e),console.log(`[MCP] New session created: ${e} for ${o}`),$a(`MCP New session: ${e} for ${o}`)}if(null===r)return n.status(204).end();if($a(`MCP Request: ${i}`),"tools/list"===i){var s;const e=(null==(s=r.result)||null==(s=s.tools)?void 0:s.map(e=>e.name))||[];console.log(`[MCP] Sending tools/list: ${e.length} tools [${e.join(", ")}]`)}else{const e=JSON.stringify(r);console.log(`[MCP] Sending response for ${i}:`,e.length>500?e.substring(0,500)+" [...]":e)}n.json(r)}catch(e){console.error("[MCP] Error processing request:",e);const t={jsonrpc:"2.0",error:{code:-32603,message:"Internal server error",data:"development"===process.env.NODE_ENV?e.stack:void 0},id:a||null};n.json(t)}}),br.options("/mcp",(e,n)=>{n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS, DELETE"),n.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),n.status(204).end()});let Tr=!1;function Er(e,n={}){Tr&&process.stdout.write(JSON.stringify({jsonrpc:"2.0",method:e,params:n})+"\n")}var Cr={__proto__:null,sendStdioNotification:Er,startStdio:function(){Tr=!0,process.stdin.resume();const e=pe({input:process.stdin,terminal:!1});e.on("line",async e=>{const n=e.trim();if(!n)return;let t;try{t=JSON.parse(n)}catch{return void process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}})+"\n")}const o=await gr(t,{proxy:!0});null!==o&&process.stdout.write(JSON.stringify(o)+"\n")}),e.on("close",()=>{Tr=!1,process.exit(0)})}};let Or=null;function Rr(){Or&&clearTimeout(Or),Or=setTimeout(()=>{!function(e,n={}){if(0===wr.size)return;const t=`data: ${JSON.stringify({jsonrpc:"2.0",method:"notifications/tools/list_changed",params:n})}\n\n`;for(const[e,{client:n}]of wr)try{n.write(t)}catch(n){console.error(`[MCP] Error sending notification to client (${e}):`,n),wr.delete(e)}}(),Er("notifications/tools/list_changed")},10)}const zr=new Set(["https://cloud.needle.tools","https://needle.tools","https://engine.needle.tools","https://docs.needle.tools"]),Nr=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Ar(e){if("string"!=typeof e||0===e.length)return!1;if(zr.has(e))return!0;let n;try{n=new URL(e)}catch{return!1}if("/"!==n.pathname&&""!==n.pathname)return!1;if(""!==n.search||""!==n.hash)return!1;if("http:"!==n.protocol&&"https:"!==n.protocol)return!1;const t=n.hostname.toLowerCase();return!!Nr.has(t)||"::1"===t}const Lr="[MCP]",Fr=new Array,{json:Ur}=le;function Ir(e){const n=null==e?void 0:e.cause;return null!=n&&n.code?`${n.code}${n.address?` (${n.address}:${n.port})`:""}`:null!=n&&n.message?n.message:null!=e&&e.code?e.code:null!=e&&e.message&&"fetch failed"!==e.message?e.message:"connection refused or network unreachable"}async function qr(n={restart:!1}){const t=await e(Ua).catch(e=>({ok:!1})),i="/sign-in",a="/api/authenticated",r="/api/projects",c="/api/content",l={baseUrl:Ua,port:Fa,isHost:!1,auth_endpoints:{"sign-in":`${Ua}${i}`,"sign-out":`${Ua}/sign-out`,"is-authenticated":`${Ua}${a}`}};let p=t.ok;if(p){var u;const h=await e(`${Ua}/api/info`).catch(()=>null);if(null!=h&&h.ok){const g=await h.json().catch(()=>null);null!=g&&g.api_endpoint&&"https://cloud.needle.tools/api"!==g.api_endpoint&&($a(`Running server uses different API endpoint (${g.api_endpoint} vs https://cloud.needle.tools/api), restarting...`),n||(n={}),n.restart=!0)}if(!0===(null==(u=n)?void 0:u.restart)){$a("Restarting auth server...");const v=`${Ua}/restart`;n.ora&&(n.ora.text="Sending restart request to server");const x=new AbortController;setTimeout(()=>x.abort(),1e4);let b={};try{const _=w(Z(),".needle","local-server-token"),k=JSON.parse((await import("fs")).readFileSync(_,"utf-8"));k.token&&(b={Authorization:`Bearer ${k.token}`})}catch{}const y=await e(v,{method:"post",signal:x.signal,headers:b}).catch(e=>({ok:!1,status:400,error:e}));if(y.ok)return await Di(300),qr({restart:!1});console.error("Failed to restart server",y.status),$a(`Failed to restart server: ${y.status}`)}}if(!p){process.title="Needle CLI server";const j=await import("express").catch(e=>{throw console.error("Error starting the auth server (express not found)",e),$a("Error starting the auth server"),new Error("Failed to load express module")});if(!j)throw $a("Error loading auth server module"),new Error("Failed to load express module");$a(`Starting Needle CLI server ${xs()}... (Using api at https://cloud.needle.tools/api)`,{emptyLineBefore:!0}),l.isHost=!0;let S=null;const $={invalid_login:!1,invalid_login_type:null,user_email:null,logged_in_machine_names:[]};let T=j.default();T.use(Ur({limit:"10mb"}));const C=w(Z(),".needle"),O=function(e,n){const t=o(),i=W(e,"local-server-token");E(e,{recursive:!0});const a=JSON.stringify({token:t,pid:process.pid,port:n},null,2);if(A(i,a,{encoding:"utf-8",mode:384}),"win32"===process.platform)try{const e=process.env.USERNAME||process.env.USER||"";e&&ue("icacls",[i,"/inheritance:r","/grant:r",`${e}:(F)`],{stdio:"ignore",timeout:5e3})}catch{}return t}(C,Fa);$a(`Local token written to ${w(C,"local-server-token")}`);const R=function(e,n=5e3){const t=new Map,o=Math.max(1,Math.round(n/1e3));return(i,a)=>{const s=Date.now(),r=t.get(i);if(!r||s-r.lastLog>n){var c;const n=null!=(c=null==r?void 0:r.suppressed)?c:0;e(n>0?`${a} [+${n} similar in last ${o}s]`:a),t.set(i,{lastLog:s,suppressed:0})}else r.suppressed++}}(e=>$a(`Denied: ${e}`),5e3);T.use(function(e){const n=null==e?void 0:e.onDenied;return(e,t,o)=>{var i,a;if("OPTIONS"===e.method)return o();const s=null==(i=e.headers)?void 0:i.origin,r=null==(a=e.headers)?void 0:a["sec-fetch-site"];if("none"===r||"same-origin"===r)return o();if(s){if(Ar(s))return o();if(n)try{var c,l,p,u;const t=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown",o=null!=(p=null!=(u=e.path)?u:e.url)?p:"?";n(`origin|${s}|${o}`,`denied origin=${s} path=${o} ua="${t}"`)}catch{}return t.status(403).send("Forbidden: origin not allowed")}return o()}}({onDenied:R}));const z=new Set(["/","/sign-in","/sign-out","/auth-callback","/api/info","/api/authenticated","/api/public_key","/mcp","/register"]),N="needle_local";T.use((e,n,t)=>{var o,i,a;if("OPTIONS"===e.method)return t();if(z.has(e.path))return t();if(e.path.startsWith("/mcp/"))return t();if(e.path.startsWith("/.well-known/"))return t();const s=null==(o=e.headers)?void 0:o.authorization;if(s){const e=s.split(" ");if(2===e.length&&"Bearer"===e[0]&&e[1]===O)return t()}if((null==(i=e.query)?void 0:i.token)===O)return t();const r=((null==(a=e.headers)?void 0:a.cookie)||"").split(";").map(e=>e.trim()).find(e=>e.startsWith(N+"="));if(r&&r.split("=")[1]===O)return t();try{var c,l;const n=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown";R(`token|${n}|${e.path}`,`path=${e.path} ua="${n}" — no valid token or cookie`)}catch{}return n.status(401).send("Unauthorized: token required")}),T.use(cr($)),n.ora?(n.ora.start("Starting MCP server..."),n.ora.succeed(`MCP server available at ${Ua}/mcp`)):console.log(`\nMCP server available at ${Ua}/mcp .`),T.use(br);const L="\n <title>Needle Cloud</title>\n <link rel=\"icon\" href=\"https://cdn.needle.tools/static/branding/favicon.ico\" type=\"image/x-icon\">\n <style>\n body { \n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 18px;\n padding: 2rem;\n background: #f0f4ef;\n }\n a {\n color: rgb(120, 76, 223);\n }\n .main_panel {\n display: flex;\n flex-direction: column;\n gap: .5rem;\n justify-content: flex-start;\n align-items: center;\n width: min(80ch, 90vw);\n margin: 0 auto;\n\n height: 100%;\n\n & img.logo {\n height: 3rem;\n margin-bottom: 1rem;\n }\n }\n .secondary {\n color: rgba(0, 0, 0, .5);\n }\n .error-details {\n font-size: 12px;\n color: rgba(0, 0, 0, .5);\n }\n .error-details a {\n color: inherit;\n }\n </style>",F=`<div class="main_panel"><img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" title="Needle Logo (${xs()})"/>`,U="</div>";let I="";T.get("/",ur(),async(e,n)=>{var t,o;if(null!=(t=e.user)&&t.isAuthenticated?n.cookie(N,O,{httpOnly:!0,sameSite:"strict",path:"/"}):n.clearCookie(N,{path:"/"}),n.set({"Content-Type":"text/html; charset=utf-8"}),n.write(L),null!=e.query.cancelled)return n.end("Login cancelled. You can close this window now."),void $a("Login cancelled by user");if(null!=e.query["too-many-logins"]&&$.logged_in_machine_names.length){var a;const e=ua();let t="<div>";return t+="<strong>You have reached the maximum number of allowed device logins!</strong><br/><br/>",t+=(null==(a=$.logged_in_machine_names)?void 0:a.map(e=>`• ${e}`).join("<br/>"))+"<br/><br/>",t+=`1) Go to <a href="${e}#device-logins" target="_blank">Needle Cloud device logins</a> and logout one of your devices.<br/>\n 2) Then <a href="${i}">sign-in on this machine</a>.<br/><br/>`,t+="</div>",n.status(406),n.end(F+t+U),void $a(`Login failed: Too many logins from different machines: [${$.logged_in_machine_names.join(", ")}]`)}if(null!=e.query.error)return n.status(500),void n.end(`${F}\n <div>\n <strong>An error occurred</strong>: Please make sure <i>https://cloud.needle.tools/api</i> and <i>https://auth.needle.tools</i> are reachable and not blocked by your firewall or network. After that please try to <a href="${i}">sign-in</a> again.\n <br/><span class="error-details">If the issue persists, please contact support and include the log file: <a title="Link to local log file. Please copy this url and open it in your file explorer or terminal" href="file://${Sa()}" target="_blank">${Sa()}</a></span>\n </div>\n ${U}`);if(null!=(o=e.user)&&o.isAuthenticated){var s;if(!await cs(e.user)){if($.invalid_login=!0,$.logged_in_machine_names=[...ss(e.user)],Da(),$a("Cleared stored auth data"),"client"in e.user){const n=e.user;await n.client.clearAccessToken(),await n.client.clearAllTokens(),$a("Cleared all tokens")}return n.end(`${F}<div>You have been logged out from this machine. You can close this window now or try to <a href="${i}">sign in</a> again</div>${U}`)}$.invalid_login=!1,n.end(`${F}\n <div>\n Hi ${lr(e.user)} — you logged in successfully. You can close this window now.\n </div>\n ${U}`);const t=`Logged in successfully as ${lr(e.user)} (${null==(s=e.user.userInfo)?void 0:s.sub})`;return void(I!==t&&(I=t,$a(I)))}let r=`<span><a href="${i}">Sign in</a> to your Needle account</span>`;"1"===e.query["signed-out"]&&(r=`<span class="secondary">You have been signed out successfully.</span>${r}`),n.write(F+r+U),n.end()}),T.post("/restart",(e,t)=>{var o;n.ora&&(n.ora.text="Received restart event. This instance will close"),null==(o=S)||o.close(e=>{e&&console.error(e)}),setTimeout(()=>{process.exit(0)},100),t.status(200).end("Server is restarting"),$a("Server is restarting\n")}),T.get("/api/logs",async(e,n)=>{const t=Sa();s(t)?f(t,"utf-8",(e,o)=>{if(e)return console.error(e),void n.status(500).end("Failed to read log file");n.set({"Content-Type":"text/plain; charset=utf-8"});const i=o.split("\n").filter(e=>e.length>0).reverse().join("\n");let a=`--- Needle CLI v${xs()} Log File (newest first) ---\n${t}\n\n`;a+=i,n.status(200).end(a)}):n.status(404).end("Log file not found")}),T.get("/api/info",(e,n)=>{n.json({api_endpoint:"https://cloud.needle.tools/api",version:xs()})}),T.get(a,ur(),async(e,n)=>{var t;if(!0===$.invalid_login){const e=Wr($);return n.status(e.status).json(e)}$.invalid_login=!1,n.status(null!=(t=e.user)&&t.isAuthenticated?200:400).send()}),T.get("/api/user",ur(),async(e,n)=>{var t;const o=e.user;if(null==o||!o.isAuthenticated){if(!0===$.invalid_login){const e=Wr($);return n.status(e.status).json(e)}return n.status(401).json({error:"Not authenticated"})}if($.invalid_login=!1,!await cs(o))return Da(),n.status(403).json({error:"You have been logged out from this machine"});if(null==o||!o.claims)return n.status(400).json({error:"User claims not found"});if(null==o||!o.userInfo)return n.status(400).json({error:"User info not found"});const i=null==o||null==(t=o.claims)?void 0:t.organization_roles,a=null==o?void 0:o.userInfo.custom_data,s={authenticated:o.isAuthenticated,id:o.userInfo.sub,name:lr(o),email:o.claims.email||o.userInfo.email||"",profile_picture:o.userInfo.picture||"",default_org_id:(null==a?void 0:a.default_org)||"none",orgs:[]},r=["manage","owner","member","developer"];o.userInfo.organization_data&&(s.orgs=o.userInfo.organization_data.map(e=>{var n;const t={id:e.id,name:e.name,roles:(null==i?void 0:i.filter(n=>n.startsWith(e.id)).map(e=>e.split(":")[1]))||[],canWrite:!1};return t.canWrite=null==(n=t.roles)?void 0:n.some(e=>r.includes(e)),t}).sort((e,n)=>e.id===s.default_org_id?-1:n.id===s.default_org_id?1:e.name.localeCompare(n.name))),n.json(s)}),T.get("/api/license",ur(),async(n,t)=>{var o,i,a;const s=null==(o=n.query.token)?void 0:o.toString(),r=null==(i=n.query.org)?void 0:i.toString();let c=null;if(s)c={authToken:s};else{const e=await is();if(!e||!e.isAuthenticated)return t.status(401).json({error:"Not authenticated",code:"not_authenticated"});if(!await cs(e))return Da(),t.status(403).json({error:"Invalid login"});c=await pr(e,r||null).catch(e=>({status:500,error:e.message}))}if(!c)return t.status(500).json({error:"Failed to fetch licenses (Missing auth)"});if("error"in c)return t.status(c.status).json({error:c.error});const l=me(c),p=null==(a=n.query.integration)?void 0:a.toLocaleString(),u={...l,"x-needle":"cli","x-needle-integration":null!=p&&p.length?p:"unknown"},d=await e(`https://cloud.needle.tools/api${de.account.get_licenses}`,{method:"GET",headers:u}).catch(e=>{const n=Ir(e);return console.error("Failed to fetch licenses:",n),$a(`Failed to fetch licenses: "${n}" - is https://cloud.needle.tools/api reachable?`),null});if(!d)return t.status(502).json({error:"Failed to fetch licenses: upstream API unreachable"});if(d.ok){const e=await d.json();return void 0===e.can_use_editor&&(e.can_use_editor=!0),t.json(e)}return t.status(d.status).json({error:d.statusText})}),T.get("/api/deployments",ur(),async(e,n)=>{var t;const o=await is();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i=null==(t=e.query.org)?void 0:t.toString(),a=await pr(o,i).catch(e=>({status:500,error:e.message}));if("error"in a)return n.status(a.status).json({error:a.error});if(i&&!a.org)return n.status(400).json({error:"Organization not found"});const s=await za({endpoint:"https://cloud.needle.tools/api",authToken:a.authToken,org:a.org||void 0,limit:20,offset:0,names:void 0}).catch(e=>(console.error("List Deployments error: "+e.message),{status:502,error:"Failed to list deployments: upstream API unreachable"}));if("error"in s)return n.status(s.status).json({error:s.error});for(const e of s.deployments)e.editUrl=`${da()}/${e.id}`;const r={...s};return n.json(r)}),T.get(c,ur(),async(e,n)=>{var t,o,i,a,s,r,c,l;const p=await is();if(!p||!p.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const u=(null==(t=e.query.org)?void 0:t.toString())||(null==(o=p.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,d=await pr(p,u).catch(e=>({status:500,error:e.message}));if("error"in d)return n.status(d.status).json({error:d.error});const m={content_type:(null==(i=e.query.content_type)?void 0:i.toString())||void 0,content_format:(null==(a=e.query.content_format)?void 0:a.toString())||void 0,search:(null==(s=e.query.search)?void 0:s.toString())||void 0,tags:(null==(r=e.query.tags)?void 0:r.toString())||void 0,types:(null==(c=e.query.types)?void 0:c.toString())||void 0,trash:"true"===e.query.trash||void 0,collection_id:(null==(l=e.query.collection_id)?void 0:l.toString())||void 0,limit:e.query.limit?parseInt(e.query.limit.toString()):void 0,page:e.query.page?parseInt(e.query.page.toString()):void 0,offset:e.query.offset?parseInt(e.query.offset.toString()):void 0},f=await oa({baseUrl:"https://cloud.needle.tools/api",authToken:d.authToken,org:d.org||void 0},m).catch(e=>(console.error("List content error: "+e.message),{status:502,error:"Failed to list content: upstream API unreachable"}));return"error"in f?n.status(f.status).json({error:f.error}):n.json(f)}),T.get(c+"/:identifier",ur(),async(e,n)=>{var t,o;const i=await is();if(!i||!i.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const a=(null==(t=e.query.org)?void 0:t.toString())||(null==(o=i.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,s=await pr(i,a).catch(e=>({status:500,error:e.message}));if("error"in s)return n.status(s.status).json({error:s.error});const r=await ia({baseUrl:"https://cloud.needle.tools/api",authToken:s.authToken,org:s.org||void 0},e.params.identifier).catch(e=>(console.error("Get content error: "+e.message),{status:502,error:"Failed to get content: upstream API unreachable"}));return"error"in r?n.status(r.status).json({error:r.error}):n.json(r)}),T.get(r,ur(),async(n,t)=>{const o=await is();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i=`https://cloud.needle.tools/api${de.local_projects.get.user}`,a=await e(i,{method:"GET",headers:{Authorization:`Bearer ${o.accessToken}`}}).catch(e=>(console.error("Failed to fetch projects:",Ir(e)),null));if(!a)return t.status(502).json({error:"Failed to fetch projects: upstream API unreachable"});if(!a.ok)return t.status(a.status).json({error:a.statusText});const s=await a.json().catch(e=>console.error(e));return t.json(s)}),T.get(r+"/:id",ur(),async(n,t)=>{var o;const i=await is();if(!i||!i.isAuthenticated)return t.status(401).json({error:"Not authenticated"});let a=null==(o=n.query.org)?void 0:o.toString();const s=await pr(i,a).catch(e=>({status:500,error:e.message}));if(!s)return t.status(500).json({error:"Failed to fetch projects"});if("error"in s)return t.status(s.status).json({error:s.error});const r=me(s),c=`https://cloud.needle.tools/api${de.local_projects.get.by_id}${encodeURIComponent(n.params.id)}`,l=await e(c,{method:"GET",headers:{...r}}).catch(e=>(console.error("Failed to fetch project:",Ir(e)),null));if(!l)return t.status(502).json({error:"Failed to fetch project: upstream API unreachable. Please try again later or contact hi@needle.tools"});if(!l.ok)return t.status(l.status).json({error:l.statusText});const p=await l.json().catch(e=>(console.error(e),null));return p?t.json(p):t.status(500).json({error:"Failed to parse data. Please try again later or contact hi@needle.tools"})}),T.post("/api/projects",ur(),async(n,t)=>{const o=await is();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i="string"==typeof n.body?JSON.parse(n.body):n.body,a={machine_id:await ls(),project_id:i.project_id,project_name:i.project_name,scene_name:i.scene_name,web_project_path:i.web_project_path,editor_name:i.editor_name,editor_version:i.editor_version};if(!a.project_id||!a.project_name)return t.status(400).json({error:"Invalid request"});const s=`https://cloud.needle.tools/api${de.local_projects.post}`,r=await e(s,{method:"POST",headers:{Authorization:`Bearer ${o.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(a)}).catch(e=>(console.error("Failed to upsert project:",Ir(e)),null));return r?r.ok?t.send("OK"):t.status(r.status).json({error:r.statusText}):t.status(502).json({error:"Failed to upsert project: upstream API unreachable"})}),T.get("/api/public_key",ur(),async(n,t)=>{var o,i;const a=await is();if(!a||!a.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const s=null==(o=n.query.org)?void 0:o.toString(),r=await pr(a,s).catch(e=>({error:e.message,status:500}));if(!r)return t.status(500).json({error:"Failed to fetch public key"});if("error"in r)return t.status(r.status).json({error:r.error});const c={project_id:(null==(i=n.query.project_id)?void 0:i.toString())||void 0,machine_id:await ls()},l=await e(`https://cloud.needle.tools/api${de.account.public_key}`,{method:"POST",headers:{...me(r),"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(e=>(console.error("Failed to fetch public key:",Ir(e)),null));if(!l)return t.status(502).json({error:"Failed to fetch public key: upstream API unreachable"});if(l.ok){const e=await l.json().catch(console.error);return null!=e&&e.public_key?t.json(e):t.status(500).json({error:"Failed to fetch public key"})}return t.status(l.status).json({error:l.statusText})}),T.get("/api/local_project_id",async(e,n)=>{const t=e.query.paths;if(!t)return n.status(400).json({error:"Missing paths"});let o=[];"string"==typeof t?o=t.split(",").map(e=>e.trim()).filter(e=>e.length>0):Array.isArray(t)&&(o=t.map(e=>e.toString().trim()).filter(e=>e.length>0));const i=Sr(o);return i?n.json({project_id:i}):n.status(404).json({error:"Project ID not found"})}),T.post("/api/project/info",ur(),async(e,n)=>{(function(e){try{!function(e){var n,t,o,i;const a={last_accessed:Date.now(),editor:null!=(n=e.scene_path)&&n.endsWith(".unity")?"unity":null!=(t=e.scene_path)&&t.endsWith(".blend")?"blender":"unknown",editor_version:e.editor_version,editor_installation_path:e.editor_installation_path,log_location:e.editor_log_path,project_location:e.unity_project_path||e.blender_project_path||e.scene_path,scene_location:e.scene_path,web_location:e.web_project_path,needle_engine_integration_location:e.needle_sourcecode_location},s=hs();let r=gs();const c=r.entries.findIndex(e=>e.project_location===a.project_location),l=null==(o=r.entries[0])?void 0:o.project_location;-1!==c?r.entries[c]=a:r.entries.push(a),r.entries.sort((e,n)=>n.last_accessed-e.last_accessed),r.entries.length>30&&(r.entries=r.entries.slice(0,30));const p=null==(i=r.entries[0])?void 0:i.project_location;p&&p!==l&&$a(`Active project changed: ${l||"(none)"} → ${p}`);try{ds=r;const e=JSON.stringify(r);d(s,e,"utf-8")}catch(e){console.error("Failed to save project info:",e)}}(e)}catch(e){$a("Error saving project info: "+e)}})("string"==typeof e.body?JSON.parse(e.body):e.body),n.send("OK")});let q=null;const P=new Promise(e=>q=e);function m(){$a("Cleaning up auth server...")}S=T.listen(Fa,()=>{null==q||q()}),function(e,n){e.on("connection",e=>{const t=e.remoteAddress;if(!function(e){if(!e)return!1;const n=e.includes("%")?e.slice(0,e.indexOf("%")):e;return"127.0.0.1"===n||"::1"===n||"::ffff:127.0.0.1"===n}(t)){try{null==n||n(`Local server: rejected non-loopback connection from ${t||"unknown"}`)}catch{}e.destroy()}})}(S,$a),S.on("close",m),process.on("exit",m),process.on("SIGINT",()=>{m(),process.exit(0)}),await P.catch(e=>{console.error(e),$a(`Error starting the auth server (promise failed): ${e.message}`)}),function(e,n){const t=new se({server:e,path:"/mcp/ws",verifyClient:({req:e},n)=>{var t;const o=null==(t=e.headers)?void 0:t.origin;if(o&&!Ar(o))return $a(`${Lr} rejected WS upgrade: disallowed origin ${o}`),void n(!1,403,"Forbidden: origin not allowed");n(!0)}});$a("MCP websocket server created.");let o=0,i=new Map;t.on("connection",e=>{const n=++o;Fr.push(e),console.log(`${Lr} client connected (#${n})`),$a(`${Lr} client connected (#${n})`),e.on("close",()=>{const t=Fr.indexOf(e);-1!==t&&Fr.splice(t,1);const o=i.get(n);if(o){for(const e of o)js(e,Rr);i.delete(n)}console.log(`${Lr} client disconnected (#${n})`),$a(`${Lr} client disconnected (#${n})`)});const t=new Map;e.on("message",o=>{try{const a=o.toString(),s=JSON.parse(a);switch(s.command){default:console.log(`${Lr} Unknown command: ${s.command}`),$a(`Unknown MCP websocket command received: ${s.command}`);break;case"get_connected_clients":!function(n,t){const o={clients:[...kr()],command:"mcp_server_response",messageId:"messageId"in n?n.messageId:void 0};e.send(JSON.stringify(o))}(s);break;case"register_tools":{const o=s.tools,a=s.source;a&&function(e,n){const t=ks.get(e);if(t&&t.size>0){console.log(`[MCP] Removing ${t.size} tools registered from ${e}`);let o=!1;for(const n of t){const t=ws.findIndex(e=>e.name===n);-1!==t&&(ws.splice(t,1),delete _s[n],$s.set(n,e),o=!0)}ks.delete(e),o&&n()}}(a,Rr);const r=a||"unknown";console.log(`${Lr} ${r} registered ${o.length} tool${1===o.length?"":"s"}`),$a(`${Lr} ${r} registered ${o.length} tool${1===o.length?"":"s"}`);const c=i.get(n)||new Set;i.set(n,c);for(const n of o)c.add(n.name),Ss(n,async o=>{console.log(`Tool ${n.name} executed via WebSocket with args:`,o);const i=`${n.name}-${Date.now()}-${Math.random()}`;return await new Promise((a,s)=>{const r=setTimeout(()=>{t.has(i)&&(console.error(`${Lr} Tool execution timed out for tool: ${n.name}`),t.delete(i),s(new Error(`Tool execution timed out for tool: ${n.name}`)))},3e4);t.set(i,{resolve:e=>{a(e),clearTimeout(r)},reject:s}),e.send(JSON.stringify({command:"execute_tool",toolName:n.name,args:o,requestId:i}))})},{source:a},Rr);break}case"tool_result":{const e=s.requestId,n=s.result;if(console.log(`${Lr} Received tool result for requestId: ${e}`,n),t.has(e)){const o=t.get(e);null==o||o.resolve(n),t.delete(e)}else console.error(`${Lr} No pending tool execution found for requestId: ${e}`);break}}}catch(e){console.error(`${Lr} Error processing WebSocket message:`,e)}})})}(S),zs({logToolCount:!0}),or();const B=Ds(C,()=>{Bs()?($a("Settings changed: remote_ai_tools disabled — closing cloud connection"),ir("remote_ai_tools setting disabled")):($a("Settings changed: remote_ai_tools enabled — opening cloud connection"),or())});process.on("exit",()=>{B(),ir("process exit")})}return l}function Wr(e){let n="";return n=e.error?e.error:e.logged_in_machine_names.length>0?`You're already authenticated on ${e.logged_in_machine_names.length} other machine(s)${e.user_email?` with ${e.user_email}`:""}. Please logout from other machines first on ${ua()}. You're currently logged in on: ${e.logged_in_machine_names.join(", ")}`:"An unknown error occured.",{status:403,error:n}}async function Pr(e={headless:!1,silent:!1,clearAuthData:!1}){return!0===e.clearAuthData&&await Da(),Dr("sign-in",{...e})}function Br(e={}){return Dr("sign-out",{...e})}function Dr(n,t){return new Promise(async(o,i)=>{let a=!1;if("sign-in"==n){const e=await is();if(null!=e&&e.isAuthenticated&&e.accessToken)return await us(e)?(a=!0,t.ora&&(t.ora.text=`Authorized as ${lr(e)}`),"gotoAccountPage"in t&&!0===t.gotoAccountPage&&(t.ora&&(t.ora.text="Opening account page in the browser"),ma(ua()),await new Promise(e=>setTimeout(e,2e3))),o(e)):o(null);if(!0===t.headless)return o(null)}else if("sign-out"==n&&!0===t.headless){a=!0,Da();const n=await qr(),t=await e(n.auth_endpoints["sign-out"],{follow:2});return o(t.ok)}const s=await qr();switch(t.timeout||(t.timeout=6e5),"number"==typeof t.timeout&&t.timeout>0&&setTimeout(()=>{a||(t.ora&&t.ora.fail('Timeout "'+n+'"'),o(null))},t.timeout),n){case"sign-in":const e=s.auth_endpoints["sign-in"];setTimeout(()=>ma(e),300),t.ora&&(t.ora.text=`Please authenticate in the browser: ${e}`),setTimeout(l,2e3);break;case"sign-out":Da(),ma(s.auth_endpoints["sign-out"]),setTimeout(l,2e3)}let r=0;const c=10;function l(){e(s.auth_endpoints["is-authenticated"]).then(async e=>{if(200===e.status||400===e.status||403===e.status)switch(n){case"sign-in":if(200===e.status){const e=await is();return e&&!await us(e)?o(null):(a=!0,t.ora&&e&&(t.ora.text="User is authenticated"),o(e))}if(403===e.status){t.ora&&t.ora.fail("Authentication failed");const n=await e.text();if(n.startsWith("{")){const e=JSON.parse(n);if("logged_in_machine_names"in e&&Array.isArray(e.logged_in_machine_names)){const n=e.logged_in_machine_names;$().fail(`You're already authenticated on ${n.length} other machine(s). Please logout from other machines first. You're currently logged in on: ${n.join(", ")}`)}}return o(null)}break;case"sign-out":if(400===e.status)return a=!0,Da(),t.ora&&(t.ora.text="User is signed-out"),o(!0)}else if(r++,r>c)return t.ora?t.ora.fail(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`):t.silent||console.error(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`),o(null);setTimeout(l,1e3)}).catch(e=>{r>=10&&console.debug("Error polling auth status: "+e.message)})}})}globalThis.fetch||(globalThis.fetch=e),globalThis.File||(globalThis.File=n),globalThis.crypto||(globalThis.crypto=t.webcrypto);const Mr=process.argv.includes("--silent"),Gr=JSON.parse(c(new URL("../package.json",import.meta.url),"utf-8"));!Mr&&process.argv.includes("version")&&console.log(`☁ Needle CLI — ${Gr.version}, Node ${process.version}`);const Jr="The access token to use. Use the login command or get a token from https://cloud.needle.tools. You can pass the access token with your command or set the environment variable NEEDLE_CLOUD_TOKEN";async function Hr(e,n=null,t=!0){let o,i=null==e?void 0:e.toString();var a;if(i||(te.config(),process.env.NEEDLE_CLOUD_TOKEN&&(i=process.env.NEEDLE_CLOUD_TOKEN,null!=(a=i)&&a.length&&console.log("Using NEEDLE_CLOUD_TOKEN token from env"))),""===i||"true"===i){const e=(await import("node:readline")).createInterface({input:process.stdin}),n=10;let t,i="",a=!1;return new Promise(s=>{const r="Paste your https://cloud.needle.tools/team#token access token here:",c=$({text:r,interval:200,spinner:"moon"}).start();process.stdin.setRawMode(!0),process.stdin.on("data",l=>{const p=l.toString();""===p&&process.exit();const u="\n"===p||"\r"===p;if(!u&&"\n"!==p&&"\r"!==p){""===p||"\b"===p?i=i.slice(0,-1):i+=p;const e=i.replace(/./g,"*");c.text=`${r} ${e}`}clearTimeout(t),t=setTimeout(()=>{if(!a&&(u||i.trim().length>n)){process.stdin.setRawMode(!1),e.close(),a=!0;const n=i.trim();if(n.length>0){const e=n.slice(3,-3).replace(/./g,"*");c.succeed("Access token received: "+e)}else c.fail("No access token provided");s({accessToken:n,org_id:o})}},150)})})}if(!i){let e;await async function(){const e=await is();return null==e?void 0:e.isAuthenticated}()||(e=Mr?void 0:$("No access token found. Please sign in to authenticate...").start()),$a("No access token provided, attempting login. Org: "+n);const a=Pr({headless:!t,ora:e,timeout:12e4}),d=await a;var s;if(d&&!await cs(d)?(null==(s=e)||s.fail("You are not logged in from this machine. Please login again."),await Br({headless:!0}),process.exit(1)):e&&($a("User logged in via getAccessToken "+(null==d?void 0:d.isAuthenticated)),d?e.succeed("Logged in"):e.fail("Login failed")),null!=d&&d.isAuthenticated){var r;if(null==n){const e=await async function(e){var n;if(!e)return{status:401,error:"Not authenticated"};const t=null==(n=e.userInfo)?void 0:n.custom_data;return t?t.default_org?t.default_org:(console.warn("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),$a("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),null):null}(d);"string"==typeof e&&(n=e)}else n===(null==(r=d.userInfo)?void 0:r.sub)&&(n=null);if(n){var c,l,p;if(o=null==(c=d.userInfo)||null==(c=c.organization_data)||null==(c=c.find(e=>e.id===n))?void 0:c.id,o||(n=null==(l=n.toString())?void 0:l.toLowerCase(),null!=o||(o=null==(p=d.userInfo)||null==(p=p.organization_data)||null==(p=p.find(e=>e.name.toLowerCase()===n))?void 0:p.id)),!o)throw new Error(`ERR: You (${lr(d)}) are not a member of the team "${n}" or the team does not exist. Please check the team name/id and try again.`);i=await(null==d?void 0:d.client.getOrganizationToken(o)),$a("Getting access token for org "+o+", "+i.substring(0,8)+"...")}else{var u;$a("Getting access token for user "+(null==(u=d.userInfo)?void 0:u.sub)),i=null==d?void 0:d.accessToken}}}return i||(console.error("ERR: Missing NEEDLE_CLOUD_TOKEN token. Please provide the access token argument or set the environment variable NEEDLE_CLOUD_TOKEN. Get an access token for your team at https://cloud.needle.tools/team"),$a("ERR: Missing NEEDLE_CLOUD_TOKEN token. Org: "+o),process.exit(403)),{accessToken:i,org_id:o}}const Kr=i.program;async function Vr(){const{spawn:e}=await import("node:child_process");e(process.execPath,[process.argv[1],"start","--integration","cli-login"],{stdio:"inherit",env:{...process.env,NEEDLE_CLOUD_TOKEN:process.env.NEEDLE_CLOUD_TOKEN||""}}),await new Promise(e=>setTimeout(e,1e3))}Kr.version(Gr.version).description("Command-line interface (CLI) for Needle Cloud"),Kr.command("start","Starts the Needle Auth server").alias("start-server").configure({visible:!1,strictOptions:!1}).help("Start the local server for Needle Cloud. This is required to authenticate with Needle Cloud and access your account and data.").option("--restart <restart>","Restarts the server",{required:!1,validator:Kr.BOOLEAN,default:!1}).option("--integration <integration>","Hint for the process which integration triggered this command",{required:!1,validator:Kr.STRING}).action(async({options:e})=>{const n=e.integration,t=Mr?void 0:$("Starting Needle License server "+(n?`(from ${n})`:"")).start();qr({ora:t,restart:e.restart}).catch(e=>{console.error("Failed to start server:",e),null==t||t.fail("Failed to start server: "+e.message),process.exit(1)}).then(e=>{null!=e&&e.baseUrl&&e.isHost?null==t||t.succeed(`Server started on ${e.baseUrl} (v${xs()})`):!1===(null==e?void 0:e.isHost)?(n||null==t||t.warn(`Server is running on ${e.baseUrl||e.port}`),process.exit(0)):(null==t||t.fail("Failed to start server"),process.exit(1))})}),Kr.command("settings","Show current Needle CLI settings").action(async()=>{const{readSettings:e,KNOWN_SETTINGS:n}=await Promise.resolve().then(function(){return Ms}),t=e();for(const[e,o]of Object.entries(n)){const n=t[e],i=void 0!==n?String(n):o.default;console.log(`\n ${"enabled"===i?"[x]":"[ ]"} ${o.displayName}: ${i}${void 0===n?" (default)":""}`),console.log(` ${o.description}`),console.log(` Change: ${o.command}`)}console.log("")}),Kr.command("settings remote-ai-tools","Enable or disable cloud AI tool dispatch to this machine").help("When disabled, the CLI does NOT connect to the Needle Cloud AI tool dispatcher (wss://cloud.needle.tools/v1/cli/ws), so cloud-side AI chats cannot invoke tools (file reads, grep, etc.) on this machine. The local /mcp/ws endpoint used by Unity/Blender stays available. Setting persists in ~/.needle/settings.json.").argument("<enabled>","true to enable, false to disable",{validator:Kr.BOOLEAN}).action(async({args:e})=>{const{writeSetting:n,defaultSettingsDir:t}=await Promise.resolve().then(function(){return Ms}),o=e.enabled,i=t();o?(n(i,"remote_ai_tools",null),console.log("Remote AI tools enabled (default)."),$a("Settings: remote_ai_tools set to enabled (default) via CLI command")):(n(i,"remote_ai_tools","disabled"),console.log("Remote AI tools disabled. The cloud AI chat will not be able to dispatch tools to this machine."),$a("Settings: remote_ai_tools set to disabled via CLI command"))}),Kr.command("mcp","Start MCP server for AI agents (stdio transport)").help('Start the Needle Cloud MCP server using stdio transport.\nThis is the standard way to connect AI agents (Claude Desktop, Cursor, VS Code, etc.).\n\nAdd to your MCP client config:\n{\n "mcpServers": {\n "needle": {\n "command": "npx",\n "args": ["-y", "needle-cloud", "mcp"]\n }\n }\n}').action(async()=>{const{startStdio:e}=await Promise.resolve().then(function(){return Cr});e()}),Kr.command("get-project-id","Gets the project id for a local project").configure({visible:!1,strictOptions:!1}).argument("<paths...>","The path to the local project (web project directory)").action(async({args:e})=>{const n=Sr(e.paths);n?console.log(`Found project ID: "${n}"`):console.log("No project ID found.")}),Kr.command("login","Login to Needle Cloud").help("Login to Needle Cloud. If you are already logged in, this will refresh the access token.").option("--headless <headless>","The headless process will not open a browser window to login. If the user is not authorized then no auth flow can be started. Use this if you only want to **check** if the user is authenticated",{required:!1,validator:Kr.BOOLEAN,default:!1}).option("--clear <clear>","Refresh the access token",{required:!1,validator:Kr.BOOLEAN,default:!1}).action(async({options:e})=>{await Vr();const n=e.headless.valueOf()||!1,t=e.clear.valueOf()||!1,o=Mr?void 0:$("Login").start();await Pr({headless:n,silent:Mr,clearAuthData:t,ora:o}).then(async e=>{null!=e&&e.isAuthenticated?null==o||o.succeed("Successfully logged in as "+lr(e)):0==n?null!=e&&e.claims||null!=e&&e.userInfo?null==o||o.warn(`You (${lr(e)}) are not authenticated...`):null==o||o.fail("Login failed"):Mr||null==o||o.warn("Not logged in"),process.exit(null!=e&&e.isAuthenticated?0:1)})}),Kr.command("logout","Logout of Needle Cloud").help("Logout of Needle Cloud (if you have logged in before).").option("--headless <headless>","Headless will not open a browser window to logout",{required:!1,validator:Kr.BOOLEAN,default:!1}).action(async({options:e})=>{await Vr();const n=e.headless.valueOf()||!1;await Br({headless:n}).then(e=>{e?$("Logged out").succeed():$("Logout failed").fail(),process.exit(e?0:1)})}),Kr.command("me","Prints your user information").help("Prints basic informaton about the logged in Needle Cloud account (your account)").action(async({})=>{const e=Mr?void 0:$("Query user data").start(),n=await is();if(null!=n&&n.isAuthenticated&&await cs(n)){const a=n.userInfo||n.claims;var t,o,i;a?(null==e||e.succeed(`You are logged in as ${lr(n)}`),console.log(`- Name: ${lr(n)}`),console.log(`- ID: ${a.sub}`),a.email&&console.log(`- Email: ${a.email}`),a.phone_number&&console.log(`- Phone: ${a.phone_number}`),null!=(t=n.userInfo)&&t.organization_data&&console.log(`- Teams [${null==(o=n.userInfo)?void 0:o.organization_data.length}]: ${null==(i=n.userInfo)?void 0:i.organization_data.sort((e,n)=>e.name.localeCompare(n.name)).map(e=>e.name).join(", ")}`)):null==e||e.fail("Failed to get user data")}else null==e||e.warn("You are not logged in")}),Kr.command("get-pro","Start license flow for Needle Engine PRO").configure({visible:!1,strictArgsCount:!1,strictOptions:!1}).option("--org <org>","The team to purchase the license for",{validator:Kr.STRING}).action(async({options:e})=>{var n;let t=(null==(n=e.org)?void 0:n.toString())||null;const o=$().start("Start Needle Engine PRO purchase flow"),i=function(e){e=e||{};const n="undefined"!=typeof window?window.location:null;"current_page"===e.baseUrl&&(e.baseUrl=null==n?void 0:n.href);let t=e.pathname||(null==n?void 0:n.pathname),o=e.baseUrl||(null==n?void 0:n.href);if(!t||!o)return null;const i=new URL(t,o);return n&&(i.search=n.search),e.license||(e.license="needle-engine:pro"),i.searchParams.set("purchase_intent",e.license),e.account_id&&i.searchParams.set("account_id",e.account_id),e.return_url&&i.searchParams.set("return_url",e.return_url),e.checkout_if_possible&&i.searchParams.set("checkout_if_possible","true"),e.show_all_cards&&i.searchParams.set("show_all_cards","true"),e.affiliate_id&&i.searchParams.set("affiliate_id",e.affiliate_id),e.tracking_id&&i.searchParams.set("tracking_id",e.tracking_id),i}({baseUrl:"https://cloud.needle.tools",pathname:t?`/team/${t}`:"/account",account_id:t,license:"needle-engine:pro",return_url:null});if(!i)return void o.fail("Failed to get purchase url - please visit https://cloud.needle.tools");const a=i.toString();o.succeed(`Started Needle Engine PRO purchase flow: opening browser at ${a}`),ma(a)});const Yr={account:{url:ua}},Zr=`"${Object.keys(Yr).join('", "')}"`;Kr.command("open",`Open a page in the default browser. Options are: ${Zr}`).argument("<page>",`The page to open. Options are: ${Zr}`,{validator:Kr.STRING}).configure({strictOptions:!1,strictArgsCount:!1,visible:!1}).help("").action(async({args:e,logger:n})=>{const t=e.page.toString(),o=Yr[t];o?"url"in o?ma(o.url()):n.error(`Unknown argument: ${t}`):n.error(`Unknown argument: ${t}. Options are: ${Zr}`)}),Kr.command("list-deployments","Get a list of deployed websites").configure({visible:!1}).help("").option("--token <token>",Jr,{validator:Kr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Kr.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Kr.STRING}).option("--limit <limit>","Limit the number of deployments to show (min: 0, max: 100)",{validator:Kr.NUMBER,default:10}).option("--offset <offset>","The offset for deployments (default: 0, min: 0)",{validator:Kr.NUMBER,default:0}).option("--format <format>","The output format. Options: cli (default), json",{validator:Kr.STRING,default:"cli",hidden:!0}).option("--name","Filter by one or multiple deployment names (separated by ;)",{validator:Kr.STRING}).action(async({options:e,logger:n})=>{var t,o,i;const{accessToken:a,org_id:s}=await Hr(e.token,e.org),r=(null==(t=e.endpoint)?void 0:t.toString())||"https://cloud.needle.tools/api",c=e.limit.valueOf(),l=e.offset.valueOf(),p=(null==(o=e.format)?void 0:o.toString())||"cli",u=(null==(i=e.name)?void 0:i.toString())||void 0;if(c<0)return void n.error("The limit can not be negative");if(c>100)return void n.error("The limit can not be higher than 100");const d=$("Query deployments").start(),m=await za({endpoint:r,authToken:a,org:s,limit:c,offset:l,names:null==u?void 0:u.split(";")}).catch(e=>{n.error(e)});if(m&&"error"in m)d.fail(m.error+" (status: "+m.status+")");else if(m){if("json"===p){d.succeed(`Found ${m.deployments.length} deployments`);const e=JSON.stringify(m.deployments);return void console.log(e)}m.deployments.length>0?(d.succeed(`Found ${m.deployments.length} deployments`),m.deployments.forEach((e,t)=>{n.info(`${t+c*l}: ${e.name} – ${e.url}`)})):d.warn("No deployments found"),process.exit(0)}else d.fail("Failed to query deployments"),process.exit(1)}),Kr.command("list","List content items (3d assets, deployments, materials, etc.)").alias("list-content").help('List content items stored in Needle Cloud.\n\nUse --type to filter by content type (e.g. "material", "3d-asset", "deployment").\nUse --format to filter by output format (e.g. "glb", "textures").').option("--token <token>",Jr,{validator:Kr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Kr.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Kr.STRING}).option("--type <type>","Filter by content type (e.g. material, 3d-asset, deployment)",{required:!1,validator:Kr.STRING}).option("--format <format>","Filter by output format (e.g. glb, textures)",{required:!1,validator:Kr.STRING}).option("--search <search>","Search by name, title or description",{required:!1,validator:Kr.STRING}).option("--limit <limit>","Max number of items to show (default: 20, max: 100)",{validator:Kr.NUMBER,default:20}).option("--offset <offset>","Offset for pagination (default: 0)",{validator:Kr.NUMBER,default:0}).option("--output <output>","Output style: cli (default), json",{validator:Kr.STRING,default:"cli"}).action(async({options:e,logger:n})=>{var t,o,i,a,s,r,c,l,p;const{accessToken:u,org_id:d}=await Hr(e.token,e.org),m=(null==(t=e.endpoint)?void 0:t.toString())||"https://cloud.needle.tools/api",f=Math.min(null!=(o=null==(i=e.limit)?void 0:i.valueOf())?o:20,100),h=null!=(a=null==(s=e.offset)?void 0:s.valueOf())?a:0,g=(null==(r=e.output)?void 0:r.toString())||"cli",v=(null==(c=e.type)?void 0:c.toString())||void 0,x=(null==(l=e.format)?void 0:l.toString())||void 0,b=(null==(p=e.search)?void 0:p.toString())||void 0,y=$("Querying content...").start();try{const e=await oa({baseUrl:m,authToken:u,org:d},{content_type:v,content_format:x,search:b,limit:f,offset:h});if("json"===g)return y.succeed(`Found ${e.items.length} of ${e.total} items`),void console.log(JSON.stringify(e.items,null,2));0===e.items.length&&(y.warn("No content found"+(v?` (type: ${v})`:"")+(x?` (format: ${x})`:"")),process.exit(0)),y.succeed(`Found ${e.items.length} of ${e.total} items`);const t=e.items.map(e=>{var n;const t=e.title||"(untitled)";return{id:e.identifier,type:e.content_type||"?",formats:null!=(n=e.content_formats)&&n.length?e.content_formats.join(", "):"",name:t.length>20?t.slice(0,17)+"...":t,versions:String(e.version_count||0),date:e.created_at?Mi(new Date(e.created_at),new Date,{allowSimple:!0,limitInDays:2}):""}}),o={id:Math.max(2,...t.map(e=>e.id.length)),type:Math.max(4,...t.map(e=>e.type.length)),formats:Math.max(7,...t.map(e=>e.formats.length)),name:Math.max(4,...t.map(e=>e.name.length))},i=La(` ${"ID".padEnd(o.id)} ${"TYPE".padEnd(o.type)} ${"FORMATS".padEnd(o.formats)} ${"NAME".padEnd(o.name)} ${"#".padStart(3)} AGE`);n.info(i);for(const e of t){const t=Aa(e.type).padEnd(o.type+11),i=(e.formats?e.formats.split(", "):[]).map(e=>Aa(e)).join(", ")+" ".repeat(Math.max(0,o.formats-e.formats.length));n.info(` ${La(e.id.padEnd(o.id))} ${t} ${i} ${e.name.padEnd(o.name)} ${e.versions.padStart(3)} ${La(e.date)}`)}e.total>h+f&&n.info(` ... ${e.total-h-f} more (use --offset ${h+f})`),process.exit(0)}catch(e){y.fail(e.message),process.exit(1)}}),Kr.command("download","Download a content item by identifier").help('Download files from a content item.\n\nUse --format to select which output format to download (e.g. "glb", "textures").\n\nUsage:\n needle-cloud download <identifier> [directory]\n needle-cloud download abc123 --format glb').argument("<identifier>","Content item identifier",{validator:Kr.STRING}).argument("[directory]","Output directory (default: current directory)",{default:"."}).option("--token <token>",Jr,{validator:Kr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Kr.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Kr.STRING}).option("--format <format>","Output format to download (e.g. glb, textures)",{required:!1,validator:Kr.STRING}).option("--name <name>","Output filename (without extension)",{required:!1,validator:Kr.STRING}).option("--verbose","Show detailed download info",{required:!1,validator:Kr.BOOLEAN,default:!1}).action(async({args:e,options:n,logger:t})=>{var o,i,a,s,r,c;const{accessToken:l,org_id:p}=await Hr(n.token,n.org),u=(null==(o=n.endpoint)?void 0:o.toString())||"https://cloud.needle.tools/api",d=e.identifier.toString(),m=(null==(i=e.directory)?void 0:i.toString())||".",f=(null==(a=n.name)?void 0:a.toString())||void 0,h=null!=(s=null==(r=n.verbose)?void 0:r.valueOf())&&s,g=(null==(c=n.format)?void 0:c.toString())||void 0,v=$("Looking up content...").start();try{var x;const e={baseUrl:u,authToken:l,org:p},n=await ia(e,d).catch(()=>null);if(!n)return void v.fail(`Content not found: "${d}". Use the exact content identifier (see list-content).`);const o=null==(x=n.versions)?void 0:x[0];if(!o)return void v.fail(`Content "${n.title||n.name}" has no versions`);let i=o.identifier;if(g){let e=!1;for(const t of n.versions){if(t.content_format===g){i=t.identifier,e=!0;break}const n=t.variants.find(e=>e.content_format===g);if(n){i=n.identifier,e=!0;break}}if(!e)return void v.fail(`No output with format "${g}" found for "${n.title||n.name}"`)}v.text=`Downloading "${n.title||n.name}"${g?` (format: ${g})`:""}...`,v.stop();const a=await Oa({baseUrl:u,authToken:l,org:p,identifier:i,outDir:m,filename:f,verbose:h,content_format:g});"error"in a&&t.error(a.error)}catch(e){v.fail(e.message)}}),Kr.command("deploy","Deploy a website to Needle").help("").argument("<directory>","The directory to deploy",{validator:Kr.STRING}).option("--token <token>",Jr,{validator:Kr.STRING}).option("--team <team>","The team name or id to deploy to (not needed when using token/accesstoken)",{required:!1,validator:Kr.STRING}).option("--org <org>","The organization name or id to deloy to (not needed when using token/accesstoken)",{required:!1,validator:Kr.STRING,hidden:!0}).option("--name <name>","The project name. This name will also be used in your website URL",{required:!1,validator:Kr.STRING}).option("--entrypoint <entrypoint>",'The entrypoint file to use (e.g. "index.html"). This is useful if you want to deploy a folder with multiple HTML files and you want to configure which file to load initially or if you have multiple model files in one folder',{required:!1,validator:Kr.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Kr.STRING,hidden:!0}).option("--open","Open the deployment in the default browser",{default:!0,validator:Kr.BOOLEAN}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Kr.BOOLEAN,default:!1,hidden:!0}).option("--experimental","Use the experimental upload API. Mostly used for debugging (default: false)",{required:!1,validator:Kr.BOOLEAN,default:!1,hidden:!0}).option("--raw","Use raw to disallow modifications like gzip compression on upload",{required:!1,validator:Kr.BOOLEAN,default:!1,hidden:!0}).action(async({args:e,options:n,logger:t})=>{var o,i,a;const s=n.open,{accessToken:r,org_id:c}=await Hr(n.token,n.team||n.org),l=n.verbose.valueOf(),p=n.experimental.valueOf()||!1,u=n.raw.valueOf()||!1;await Ea({logger:t,endpoint:(null==(o=n.endpoint)?void 0:o.toString())||void 0,token:r,org_id:c,directory:e.directory.toString(),name:(null==(i=n.name)?void 0:i.toString())||void 0,entrypoint:(null==(a=n.entrypoint)?void 0:a.toString())||void 0,open:s,verbose:l||!1,experimental:p||!1,raw:u||!1})}),Kr.command("optimize","Optimize glTF, GLB, VRM, FBX, USD files").help("").option("--token <token>",Jr,{validator:Kr.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Kr.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Kr.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be optimized",{validator:Kr.STRING}).option("--outdir <outdir>","The output directory for the optimized file(s). If set your optimized asset files will automatically be downloaded to this directory.",{required:!1,validator:Kr.STRING}).option("--name <name>","The optimization project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Kr.STRING}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Kr.BOOLEAN,default:!1}).option("--progressive","Use Needle progressive loading",{required:!1,validator:Kr.BOOLEAN,default:!0}).action(async({args:e,options:n,logger:t})=>{var o,i,a;const c=n.verbose.valueOf(),{accessToken:l,org_id:p}=await Hr(n.token,n.team||n.org);if(l!=n.token){const e=await is();null!=e&&e.isAuthenticated?p||($("Please provide an organization id to optimize files...").fail(),process.exit(1)):($("Please login to optimize files...").fail(),process.exit(1));const n=await async function(e,n){const t=e.baseUrl+de.account.get_licenses,o={...{...n},...me(e)},i=await fetch(t,{...fe,method:"GET",headers:o}).catch(e=>(console.error(e),null));return i?i.ok?(await i.json()).licenses:(console.error(i.statusText,await i.text()),[]):[]}({baseUrl:"https://cloud.needle.tools/api",authToken:l,org:p},{type:"org",org_id:p});(!n||n.length<=0||!n.find(e=>"Needle Engine"===e.type&&("pro"===e.license||"enterprise"===e.license)))&&($("Update to Needle PRO or Enterprise required to optimize files via CLI. Visit https://cloud.needle.tools/get-pro").fail(),process.exit(1))}const u=(null==(o=n.progressive)?void 0:o.valueOf())||!0,d=await async function(e){if(e.outDir){var n;if((null==(n=e.outDir)?void 0:n.length)<=0){const e="Output Directory is invalid";return $().fail(e),{error:e}}if(s(e.outDir)&&r(e.outDir).isFile()){const e="The output directory is a file - it must be a directory";return $().fail(e),{error:e}}}const t=e.fileOrDirectory;if(!s(t))return $().fail(`File not found: ${t}`),{error:"File not found"};if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${ua()}`};if(void 0!==e.name&&e.name&&(e.name.length<=0||"true"===e.name||"false"===e.name))return{error:`Name is not valid: "${e.name}". Please provide a valid name`};e.fileOrDirectory=y(e.fileOrDirectory);const o=$(`Gathering files ${e.fileOrDirectory}`).start();let i=null;try{i=ha("optimization",e.fileOrDirectory)}catch(n){return $().fail(`${n.message||`Failed to collect files in ${e.fileOrDirectory}`}`),{error:"Failed to collect files"}}o.text=`Uploading ${i.files.length} files for optimization:\n- ${i.files.map(e=>e.path||e.name).join("\n -")}`;const a="https://cloud.needle.tools/api";e.verbose&&console.log("Using endpoint:",a);const c=function(e){var n,t;if(function(e){return e.some(e=>{let n=e.name.toLowerCase();return!!(n.endsWith(".html")||n.endsWith(".htm")||n.endsWith(".html.gz")||n.endsWith(".html.br"))||"mimetype"in e&&"text/html"===e.mimetype})}(e))return{kind:"deployment",contentType:void 0,uploadType:"deployment",canOptimize:!1,canConvertToGLB:!1};if(function(e){if(!e||1!==e.length)return!1;const n=e[0].name;return"string"==typeof(t=n)&&0!==t.length&&t.toLowerCase().endsWith(".exr")||function(e){if("string"!=typeof e||0===e.length)return!1;const n=e.toLowerCase();return n.endsWith(".hdr")||n.endsWith(".hdri")}(n)||function(e){return"string"==typeof e&&0!==e.length&&/\.pmrem(\d+x\d+)?\.ktx2$/i.test(e)}(n);var t}(e))return{kind:"environment-texture",contentType:"hdri",uploadType:void 0,canOptimize:!1,canConvertToGLB:!1};const o=null!=(n=null==(t=e[0])||null==(t=t.name.split(".").pop())?void 0:t.toLowerCase())?n:"";return{kind:"asset",contentType:"3d-asset",uploadType:void 0,canOptimize:e.some(e=>{var n;const t=null==(n=e.name.split(".").pop())?void 0:n.toLowerCase();return null!=t&&Ki.has(t)}),canConvertToGLB:Vi.has(o)}}(i.files);let l=c.contentType;if("asset"===c.kind&&1===i.files.length){const n=i.files[0].name.toLowerCase();if(n.endsWith(".glb")||n.endsWith(".gltf"))try{const n=i.files[0].path||i.files[0].name,t=await async function(e){return e.toLowerCase().endsWith(".gltf")?async function(e){const{readFile:n}=await import("node:fs/promises"),t=await n(e,"utf-8");return JSON.parse(t)}(e):async function(e){const{open:n}=await import("node:fs/promises"),t=await n(e,"r");try{const e=Buffer.alloc(20),{bytesRead:n}=await t.read(e,0,e.length,0);if(n<e.length)throw new Error("File too small to be a GLB");const o=new DataView(e.buffer,e.byteOffset,e.byteLength);if(o.getUint32(0,!0)!==aa)throw new Error("Not a GLB (magic mismatch)");const i=o.getUint32(12,!0);if(o.getUint32(16,!0)!==sa)throw new Error("First chunk is not JSON");const a=20+i,s=Buffer.alloc(a),{bytesRead:r}=await t.read(s,0,a,0);if(r<a)throw new Error("File truncated — JSON chunk could not be read in full");return function(e){const n=e instanceof Uint8Array?e:new Uint8Array(e);if(n.byteLength<20)throw new Error("Buffer too small to be a GLB");const t=new DataView(n.buffer,n.byteOffset,n.byteLength);if(t.getUint32(0,!0)!==aa)throw new Error("Not a GLB (magic mismatch)");const o=t.getUint32(12,!0);if(t.getUint32(16,!0)!==sa)throw new Error("First chunk is not JSON");const i=20+o;if(i>n.byteLength)throw new Error("JSON chunk exceeds buffer length");const a=n.subarray(20,i),s=(new TextDecoder).decode(a);return JSON.parse(s)}(s)}finally{await t.close()}}(e)}(n);"material"===function(e){return function(e){if(!e)return!1;const n=!e.nodes||0===e.nodes.length,t=!e.meshes||0===e.meshes.length,o=Array.isArray(e.materials)&&1===e.materials.length;return n&&t&&o}(e)?"material":"3d-asset"}(t)&&(l="material",e.verbose&&console.log(`Detected material-only asset: ${n}`))}catch(n){e.verbose&&console.warn("Failed to inspect asset for material detection:",n.message)}}const p=await Qi({baseUrl:a,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:i.files,entrypoint:i.entrypoint},{type:c.uploadType||"upload",name:e.name,content_type:l,loglevel:e.verbose?"debug":"none",progress:e=>{o.text=`Uploading ${e.fileName} - finished in approx. ${e.estimatedTimeLeftDisplay}, ${100*e.progress01}%`}});if(0==p.success){const e=`${p.error||"Unknown error: could not start upload"}`;return o.fail(e),{error:e,noprint:!0}}if(p.success){const n=`${da()}/${p.content_id}?select_team=1`;o.succeed(p.uploadSkipped?`Files have already been uploaded to ${n}`:`Uploaded ${i.files.length} files for optimization to ${n}`);const t=await async function(e,n={progressive:!0}){const t=e.baseUrl+de.jobs.create,o={...me(e),"content-type":"application/json"},i={type:"optimization",job_id:e.id,triggered_by:e.trigger_type,parameters:{...n}},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request optimization (${a.status}): ${e} `),null}return await a.json().catch(e=>(console.error(e),null))}({baseUrl:a,authToken:e.token,org:e.org_id,id:p.id,trigger_type:"cli"},{progressive:e.progressive,pipeline_version:"latest"});if(!t)return{error:"Failed to send optimization request"};if("error"in t){const e=`Failed to optimize: ${t.error}`;return console.error(e),{error:e}}{const n=t.job,o=$(`Optimization requested for ${n.name||n.identifier}`).start();let i=!1;for(o.color="gray";;){if("completed"===t.job.status){var u;i=!0,o.succeed(`${null!=(u=t.message)?u:"Optimization completed"}`);break}let s=2e3;const r=await ki(n.identifier,{baseUrl:a,authToken:e.token,org:t.job.org});if("new"!==(null==r?void 0:r.status)&&"pending"!==(null==r?void 0:r.status)||(o.text="Your asset is queued - waiting for optimization to start",o.color="yellow",s=2e3),"running"===(null==r?void 0:r.status))o.text=`Your asset is being optimized: ${r.progress?`${r.progress}%`:""} ${r.status_message?`— ${r.status_message}`:""}`,o.color="cyan",s=1e3;else if("stalled"===(null==r?void 0:r.status))s=2500;else{if("completed"===(null==r?void 0:r.status)){i=!0,o.succeed(`Your asset has finished optimizing: ${r.status_message}`);break}if("canceled"===(null==r?void 0:r.status))return o.fail(`Optimization cancelled: ${r.error}`),{error:r.error||"Optimization cancelled"};if("failed"===(null==r?void 0:r.status))return o.fail(`Optimization failed: ${r.error}`),console.error(`Optimization failed: ${r.error}`),{error:r.error||"Optimization failed"}}await Di(s)}if(i){if(e.outDir){const t=await Oa({baseUrl:a,authToken:e.token,org:e.org_id,identifier:n.identifier,outDir:e.outDir,verbose:e.verbose});if("error"in t)return{error:t.error}}else $().succeed(`Asset successfully optimized: https://cloud.needle.tools/edit/${n.content_id} (To download optimized files, use the --outdir option)`);return{success:!0}}}}return{error:"Unknown error"}}({logger:t,token:l,org_id:p,fileOrDirectory:e.path.toString(),name:(null==(i=n.name)?void 0:i.toString())||void 0,progressive:u,outDir:(null==(a=n.outdir)?void 0:a.toString())||void 0,verbose:c||!1}).catch(e=>{console.error(e),process.exit(1)});Array.isArray(d)?process.exit(0):"error"in d&&(d.noprint||console.error(d.error),process.exit(1))}),Kr.command("generate-material","Generate a PBR material from a text prompt").help("").argument("<prompt>","The text prompt describing the material to generate",{validator:Kr.STRING}).option("--token <token>",Jr,{validator:Kr.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Kr.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Kr.STRING,hidden:!0}).option("--resolution <resolution>","The material texture resolution (256, 512, 1k, 2k, 4k)",{default:"512",required:!1,validator:Kr.STRING}).option("--name <name>","Output filename",{required:!1,validator:Kr.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:Kr.STRING}).action(async({args:e,options:n,logger:t})=>{var o,i,a;const{accessToken:s,org_id:r}=await Hr(n.token,n.team||n.org),c=e.prompt.toString(),l=null==(o=n.resolution)?void 0:o.toString(),p=null==(i=n.outdir)?void 0:i.toString(),u=null==(a=n.name)?void 0:a.toString(),d=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${ua()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const n="https://cloud.needle.tools/api";$a(`[generate-material] Starting request to ${n}, prompt="${e.prompt}", resolution=${e.resolution||512}`,{emptyLineBefore:!0});const t=$("Requesting material generation...").start(),o=await Promise.race([ta({baseUrl:n,authToken:e.token,org:e.org_id,trigger_type:"cli"},{prompt:e.prompt,resolution:e.resolution||512}).catch(e=>({error:e.message||"Request failed"})),new Promise(e=>setTimeout(()=>e({error:"Request timed out after 30s. Please try again."}),3e4))]);if("error"in o)return $a(`[generate-material] Request failed: ${o.error}`),t.fail(o.error),{error:o.error};const i=o.job;if($a(`[generate-material] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return $a(`[generate-material] Job canceled: ${i.status_message||"quota exceeded"}`),t.fail(i.status_message||"Material generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};t.succeed(`Material generation requested: ${i.identifier}`);const a=$("Waiting for material generation...").start();for(a.color="gray";;){if("completed"===i.status){a.succeed("Material generation completed");break}let t=2e3;const o=await ki(i.identifier,{baseUrl:n,authToken:e.token,org:i.org});if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your material is queued - waiting for generation to start",a.color="yellow",t=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating material: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",t=1e3;else{if("completed"===(null==o?void 0:o.status)){$a(`[generate-material] Job completed: ${i.identifier}`),a.succeed(`Material generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return $a(`[generate-material] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`Material generation canceled: ${o.error||""}`),{error:o.error||"Material generation canceled"};if("failed"===(null==o?void 0:o.status))return $a(`[generate-material] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`Material generation failed: ${o.error||""}`),{error:o.error||"Material generation failed"}}await Di(t)}if(e.outDir){const t=await Oa({baseUrl:n,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in t)return{error:t.error}}return{success:!0,identifier:i.identifier}}({logger:t,token:s,org_id:r,prompt:c,resolution:l,outputName:u,outDir:p});"error"in d&&(d.error&&t.error(d.error),process.exit(1)),!p&&d.identifier&&console.log(d.identifier),process.exit(0)}),Kr.command("ask","Send a message to the Needle Cloud AI").help("Send a message to the Needle Cloud AI chat.\n\nWithout a message argument, starts an interactive session.\nBy default streams the response to the terminal. Use --no-stream for a single JSON response.\nUse --slug to continue an existing chat conversation.\nDefault slug is <your-user-id>-cli (persistent across sessions).").argument("[message...]","The message to send (omit for interactive mode)").option("--token <token>",Jr,{validator:Kr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Kr.STRING}).option("--slug <slug>","Chat slug to continue an existing conversation",{required:!1,validator:Kr.STRING}).option("--no-stream","Disable streaming (returns full response at once)",{required:!1,validator:Kr.BOOLEAN,default:!1}).action(async({args:e,options:n})=>{var t,o;const{accessToken:i,org_id:a}=await Hr(n.token,n.org),s=Array.isArray(e.message)?e.message:e.message?[e.message]:[],r=s.length?s.join(" "):void 0,c=(null==(t=n.slug)?void 0:t.toString())||void 0,l=(null==(o=n.noStream)?void 0:o.valueOf())||!1;await async function(e){const{token:n,org_id:t,message:o,slug:i,stream:a}=e,s=i||function(e){try{const n=e.split(".")[1],t=JSON.parse(Buffer.from(n,"base64url").toString());if(t.sub)return t.sub+"-cli"}catch{}return"cli-"+Math.random().toString(36).slice(2,10)}(n);await async function(e){const{token:n,org_id:t,slug:o,stream:i,initialMessage:a}=e,s=ne({input:process.stdin,output:process.stdout});console.log(`Needle Cloud AI (chat: ${o})`),console.log('Type your message. Press Ctrl+C or type "exit" to quit.\n');try{for(a&&(console.log(`> ${a}`),await Ra({token:n,org_id:t,slug:o,message:a,stream:i}),console.log(""));;){const e=(await s.question("> ")).trim();if(e){if("exit"===e||"quit"===e)break;await Ra({token:n,org_id:t,slug:o,message:e,stream:i}),console.log("")}}}finally{s.close()}}({token:n,org_id:t,slug:s,stream:a,initialMessage:o})}({token:i,org_id:a,message:r,slug:c,stream:!l}),process.exit(0)});export{Kr as program};
|
|
1
|
+
import e from"node-fetch";import{File as n}from"@web-std/file";import t,{randomUUID as o}from"node:crypto";import i from"@caporal/core";import a,{existsSync as s,statSync as r,readFileSync as c,readdirSync as l,appendFileSync as p,mkdirSync as u,writeFileSync as d,lstatSync as m,readFile as f}from"fs";import h from"open";import g,{randomUUID as v}from"crypto";import x from"buffer";import b,{resolve as y,join as w,relative as _,sep as k,isAbsolute as j,dirname as S}from"path";import $ from"ora";import{existsSync as T,mkdirSync as E,renameSync as C,realpathSync as O,statSync as R,rename as z,readFileSync as N,writeFileSync as A,watch as L}from"node:fs";import{writeFile as F}from"node:fs/promises";import U,{homedir as I}from"node:os";import q,{join as W}from"node:path";import P,{TextEncoder as B}from"util";import D,{Readable as M}from"stream";import G from"http";import J from"https";import H from"url";import K from"assert";import V from"tty";import Y,{homedir as Z,tmpdir as X}from"os";import Q from"zlib";import{EventEmitter as ee}from"events";import{createInterface as ne}from"node:readline/promises";import te from"dotenv";import oe from"@logto/node";import{Router as ie}from"express";import ae,{WebSocketServer as se}from"ws";import{execFileSync as re}from"child_process";import{minimatch as ce}from"minimatch";import le from"body-parser";import{createInterface as pe}from"node:readline";import{execFileSync as ue}from"node:child_process";const de={status:"/v1/status",version:"/v1/version",api:"/v1/api",usage:{get:"/v1/usage"},affiliate:{get:"/v1/affiliate/get",link_clicked:"/v1/affiliate/link_clicked"},account:{public_key:"/v1/account/public_key",post_machine:"/v1/account/machine",connect:"/v1/account/connect",get_licenses:"/v1/account/get/licenses",set_license_active:"/v1/account/set_license_active",set_licenses_active:"/v1/account/set_licenses_active",buy_licenses:"/v1/account/buy_licenses",update_licenses:"/v1/account/update_licenses",update_payment_method:"/v1/account/update_payment_method",get_billing:"/v1/account/get_billing",resume_subscription:"/v1/account/resume_subscription",cancel_subscription:"/v1/account/cancel_subscription",start_billingportal_session:"/v1/account/start_billingportal_session",post_preferences:"/v1/account/preferences",get_preferences:"/v1/account/preferences"},ai:{llmstxt:"/v1/ai/llmstxt",chat:"/v1/ai/chat",list_chats:"/v1/ai/chat/list",chat_tool_result:"/v1/ai/chat/tool-result",chat_stop:"/v1/ai/chat/stop",ask:"/v1/ai/ask",post_settings:"/v1/ai/chat/settings",ws:"/v1/ws",cli_ws:"/v1/cli/ws"},organizations:{get:"/v1/organizations/get",orgs_details:"/v1/organizations/details",licenses:"/v1/organizations/licenses",get_invitations:"/v1/organizations/get_invitations"},events:{get:"/v1/events/get",post:"/v1/events/post",list:"/v1/events/list"},reports:{get:"/v1/reports/get",post:"/v1/reports/post"},diagnostics:{download_failed:"/v1/diagnostics/download-failed"},questionnaire:{get:"/v1/questionnaires/get",post:"/v1/questionnaires/post"},roadmap:{get:"/v1/roadmap/get",post_vote:"/v1/roadmap/post"},tokens:{create:"/v1/tokens/create",delete:"/v1/tokens/delete",list:"/v1/tokens/list"},get:{stats:"/v1/get/stats",jobs:"/v1/list/jobs",deployments:"/v1/list/deployments",discounts:"/v1/get/discounts"},files:{entry:"/v1/files/:identifier/:version/",file:"/v1/files/:identifier/:version/*"},view:{get_analytics:"/v1/view/analytics",get_public_info:"/v1/view/public/info",post_version:"/v1/view/post_version"},content:{root:"/v1/content",download:"/v1/content/download",detail:"/v1/content/:identifier",update:"/v1/content/:identifier",delete:"/v1/content/:identifier",restore:"/v1/content/:identifier/restore"},public:{content_list:"/v1/public/content",content_detail:"/v1/public/content/:identifier"},collections:{list:"/v1/collections/list",get:"/v1/collections/get",create:"/v1/collections/create",update:"/v1/collections/update",delete:"/v1/collections/delete",add_item:"/v1/collections/add-item",remove_item:"/v1/collections/remove-item",reorder_items:"/v1/collections/reorder-items"},upload:{request:"/v1/upload/request",request_put_url:"/v1/upload/put",update_results:"/v1/upload/results",done:"/v1/upload/done",cancel:"/v1/upload/cancel"},jobs:{create:"/v1/jobs/create",get_id:"/v1/jobs/get_id",request_start:"/v1/jobs/request_start",presigned_url:"/v1/jobs/presigned-url",presigned_urls:"/v1/jobs/presigned-urls",download_urls:"/v1/jobs/download-urls",request_restart:"/v1/jobs/restart",delete:"/v1/jobs/delete",post_update:"/v1/jobs/update",post_results_stats:"/v1/jobs/results_stats",post_usage:"/v1/jobs/post_usage",get_status:"/v1/jobs/status",get_org:"/v1/jobs/org",query:"/v1/jobs/query",request_job_that_needs_stats:"/v1/jobs/job_needs_stats"},worker:{ping:"/v1/worker/ping",get_available_count:"/v1/worker/get_available_count",post_available_info:"/v1/worker/post_available_info",get_available_info:"/v1/worker/get_available_info"},local_projects:{get:{user:"/v1/local_projects/user",by_id:"/v1/local_projects/"},post:"/v1/local_projects"}};function me(e){const n={authorization:"Bearer "+e.authToken};return e.org&&(n["x-needle-cloud-org"]=e.org),e.roles&&(n.roles=e.roles.join(",")),e.roles_org&&(n.roles_org=e.roles_org.join(",")),n}const fe={credentials:"omit"};function he(e,n){return function(){return e.apply(n,arguments)}}const{toString:ge}=Object.prototype,{getPrototypeOf:ve}=Object,xe=(be=Object.create(null),e=>{const n=ge.call(e);return be[n]||(be[n]=n.slice(8,-1).toLowerCase())});var be;const ye=e=>(e=e.toLowerCase(),n=>xe(n)===e),we=e=>n=>typeof n===e,{isArray:_e}=Array,ke=we("undefined"),je=ye("ArrayBuffer"),Se=we("string"),$e=we("function"),Te=we("number"),Ee=e=>null!==e&&"object"==typeof e,Ce=e=>{if("object"!==xe(e))return!1;const n=ve(e);return!(null!==n&&n!==Object.prototype&&null!==Object.getPrototypeOf(n)||Symbol.toStringTag in e||Symbol.iterator in e)},Oe=ye("Date"),Re=ye("File"),ze=ye("Blob"),Ne=ye("FileList"),Ae=ye("URLSearchParams"),[Le,Fe,Ue,Ie]=["ReadableStream","Request","Response","Headers"].map(ye);function qe(e,n,{allOwnKeys:t=!1}={}){if(null==e)return;let o,i;if("object"!=typeof e&&(e=[e]),_e(e))for(o=0,i=e.length;o<i;o++)n.call(null,e[o],o,e);else{const i=t?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(o=0;o<a;o++)s=i[o],n.call(null,e[s],s,e)}}function We(e,n){n=n.toLowerCase();const t=Object.keys(e);let o,i=t.length;for(;i-- >0;)if(o=t[i],n===o.toLowerCase())return o;return null}const Pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Be=e=>!ke(e)&&e!==Pe,De=(Me="undefined"!=typeof Uint8Array&&ve(Uint8Array),e=>Me&&e instanceof Me);var Me;const Ge=ye("HTMLFormElement"),Je=(({hasOwnProperty:e})=>(n,t)=>e.call(n,t))(Object.prototype),He=ye("RegExp"),Ke=(e,n)=>{const t=Object.getOwnPropertyDescriptors(e),o={};qe(t,(t,i)=>{let a;!1!==(a=n(t,i,e))&&(o[i]=a||t)}),Object.defineProperties(e,o)},Ve="abcdefghijklmnopqrstuvwxyz",Ye="0123456789",Ze={DIGIT:Ye,ALPHA:Ve,ALPHA_DIGIT:Ve+Ve.toUpperCase()+Ye},Xe=ye("AsyncFunction"),Qe=(en="function"==typeof setImmediate,nn=$e(Pe.postMessage),en?setImmediate:nn?(tn=`axios@${Math.random()}`,on=[],Pe.addEventListener("message",({source:e,data:n})=>{e===Pe&&n===tn&&on.length&&on.shift()()},!1),e=>{on.push(e),Pe.postMessage(tn,"*")}):e=>setTimeout(e));var en,nn,tn,on;const an="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Pe):"undefined"!=typeof process&&process.nextTick||Qe;var sn={isArray:_e,isArrayBuffer:je,isBuffer:function(e){return null!==e&&!ke(e)&&null!==e.constructor&&!ke(e.constructor)&&$e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let n;return e&&("function"==typeof FormData&&e instanceof FormData||$e(e.append)&&("formdata"===(n=xe(e))||"object"===n&&$e(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let n;return n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&je(e.buffer),n},isString:Se,isNumber:Te,isBoolean:e=>!0===e||!1===e,isObject:Ee,isPlainObject:Ce,isReadableStream:Le,isRequest:Fe,isResponse:Ue,isHeaders:Ie,isUndefined:ke,isDate:Oe,isFile:Re,isBlob:ze,isRegExp:He,isFunction:$e,isStream:e=>Ee(e)&&$e(e.pipe),isURLSearchParams:Ae,isTypedArray:De,isFileList:Ne,forEach:qe,merge:function e(){const{caseless:n}=Be(this)&&this||{},t={},o=(o,i)=>{const a=n&&We(t,i)||i;t[a]=Ce(t[a])&&Ce(o)?e(t[a],o):Ce(o)?e({},o):_e(o)?o.slice():o};for(let e=0,n=arguments.length;e<n;e++)arguments[e]&&qe(arguments[e],o);return t},extend:(e,n,t,{allOwnKeys:o}={})=>(qe(n,(n,o)=>{e[o]=t&&$e(n)?he(n,t):n},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,n,t,o)=>{e.prototype=Object.create(n.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),t&&Object.assign(e.prototype,t)},toFlatObject:(e,n,t,o)=>{let i,a,s;const r={};if(n=n||{},null==e)return n;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],o&&!o(s,e,n)||r[s]||(n[s]=e[s],r[s]=!0);e=!1!==t&&ve(e)}while(e&&(!t||t(e,n))&&e!==Object.prototype);return n},kindOf:xe,kindOfTest:ye,endsWith:(e,n,t)=>{e=String(e),(void 0===t||t>e.length)&&(t=e.length);const o=e.indexOf(n,t-=n.length);return-1!==o&&o===t},toArray:e=>{if(!e)return null;if(_e(e))return e;let n=e.length;if(!Te(n))return null;const t=new Array(n);for(;n-- >0;)t[n]=e[n];return t},forEachEntry:(e,n)=>{const t=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=t.next())&&!o.done;){const t=o.value;n.call(e,t[0],t[1])}},matchAll:(e,n)=>{let t;const o=[];for(;null!==(t=e.exec(n));)o.push(t);return o},isHTMLForm:Ge,hasOwnProperty:Je,hasOwnProp:Je,reduceDescriptors:Ke,freezeMethods:e=>{Ke(e,(n,t)=>{if($e(e)&&-1!==["arguments","caller","callee"].indexOf(t))return!1;$e(e[t])&&(n.enumerable=!1,"writable"in n?n.writable=!1:n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")}))})},toObjectSet:(e,n)=>{const t={},o=e=>{e.forEach(e=>{t[e]=!0})};return _e(e)?o(e):o(String(e).split(n)),t},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,t){return n.toUpperCase()+t}),noop:()=>{},toFiniteNumber:(e,n)=>null!=e&&Number.isFinite(e=+e)?e:n,findKey:We,global:Pe,isContextDefined:Be,ALPHABET:Ze,generateString:(e=16,n=Ze.ALPHA_DIGIT)=>{let t="";const{length:o}=n;for(;e--;)t+=n[Math.random()*o|0];return t},isSpecCompliantForm:function(e){return!!(e&&$e(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const n=new Array(10),t=(e,o)=>{if(Ee(e)){if(n.indexOf(e)>=0)return;if(!("toJSON"in e)){n[o]=e;const i=_e(e)?[]:{};return qe(e,(e,n)=>{const a=t(e,o+1);!ke(a)&&(i[n]=a)}),n[o]=void 0,i}}return e};return t(e,0)},isAsyncFn:Xe,isThenable:e=>e&&(Ee(e)||$e(e))&&$e(e.then)&&$e(e.catch),setImmediate:Qe,asap:an};function rn(e,n,t,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",n&&(this.code=n),t&&(this.config=t),o&&(this.request=o),i&&(this.response=i)}sn.inherits(rn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:sn.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const cn=rn.prototype,ln={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ln[e]={value:e}}),Object.defineProperties(rn,ln),Object.defineProperty(cn,"isAxiosError",{value:!0}),rn.from=(e,n,t,o,i,a)=>{const s=Object.create(cn);return sn.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),rn.call(s,e.message,n,t,o,i),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};var pn=D.Stream,un=dn;function dn(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}P.inherits(dn,pn),dn.create=function(e,n){var t=new this;for(var o in n=n||{})t[o]=n[o];t.source=e;var i=e.emit;return e.emit=function(){return t._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),t.pauseStream&&e.pause(),t},Object.defineProperty(dn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),dn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},dn.prototype.resume=function(){this._released||this.release(),this.source.resume()},dn.prototype.pause=function(){this.source.pause()},dn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},dn.prototype.pipe=function(){var e=pn.prototype.pipe.apply(this,arguments);return this.resume(),e},dn.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},dn.prototype._checkIfMaxDataSizeExceeded=function(){this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize||(this._maxDataSizeExceeded=!0,this.emit("error",new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.")))};var mn=D.Stream,fn=hn;function hn(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}P.inherits(hn,mn),hn.create=function(e){var n=new this;for(var t in e=e||{})n[t]=e[t];return n},hn.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},hn.prototype.append=function(e){if(hn.isStreamLike(e)){if(!(e instanceof un)){var n=un.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=n}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},hn.prototype.pipe=function(e,n){return mn.prototype.pipe.call(this,e,n),this.resume(),e},hn.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},hn.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){hn.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},hn.prototype._pipeNext=function(e){if(this._currentStream=e,hn.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});this.write(e),this._getNext()},hn.prototype._handleErrors=function(e){var n=this;e.on("error",function(e){n._emitError(e)})},hn.prototype.write=function(e){this.emit("data",e)},hn.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},hn.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},hn.prototype.end=function(){this._reset(),this.emit("end")},hn.prototype.destroy=function(){this._reset(),this.emit("close")},hn.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},hn.prototype._checkDataSize=function(){this._updateDataSize(),this.dataSize<=this.maxDataSize||this._emitError(new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded."))},hn.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(n){n.dataSize&&(e.dataSize+=n.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},hn.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var gn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vn(e){var n={exports:{}};return e(n,n.exports),n.exports}var xn={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"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/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+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/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"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",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,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",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0,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",compressible:!0,extensions:["its"]},"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/jscalendar+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",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"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",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,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",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{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/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"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","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,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",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"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",compressible:!0,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",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"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/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"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",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,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",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"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/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{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.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"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",compressible:!1,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",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"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",compressible:!0},"application/vnd.android.ota":{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.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"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.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{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",compressible:!0},"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.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"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",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"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",compressible:!1},"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",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{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.dbf":{source:"iana",extensions:["dbf"]},"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",compressible:!0,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.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"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.dvbisl+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"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.eclipse.ditto+json":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"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",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"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.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{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.familysearch.gedcom+zip":{source:"iana",compressible:!1},"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.ficlab.flb+zip":{source:"iana",compressible:!1},"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.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"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.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"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",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"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",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,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.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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+json":{source:"iana",compressible:!0},"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",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"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",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"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":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"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",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"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",compressible:!0},"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",compressible:!0},"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",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"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.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"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",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"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",compressible:!0},"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.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"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",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{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",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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",compressible:!0,extensions:["obgx"]},"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",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"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",compressible:!0},"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.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{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",compressible:!0},"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.psfs":{source:"iana"},"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",compressible:!0},"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",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{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",compressible:!0,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.sar":{source:"iana"},"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.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"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.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"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.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,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.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"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",compressible:!0,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.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{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",charset:"UTF-8",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.dpp":{source:"iana"},"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",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"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",compressible:!0},"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",compressible:!0,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",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"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",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,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",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,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-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"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-keepass2":{extensions:["kdbx"]},"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-pki-message":{source:"iana"},"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:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,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",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"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",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,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",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{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/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"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/flexfec":{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/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"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","opus"]},"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/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{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/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{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.dts.uhd":{source:"iana"},"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",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"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",extensions:["pti"]},"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",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"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",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"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.pco.b16":{source:"iana",extensions:["b16"]},"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",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"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",extensions:["3mf"]},"model/e57":{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/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,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",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"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",extensions:["x3db"]},"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",extensions:["x3dv"]},"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"},"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/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"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/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{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":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"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/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"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",charset:"UTF-8",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",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"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.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"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":{source:"iana",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":{compressible:!0,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/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{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",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"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/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{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/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{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}},bn=vn(function(e,n){var t,o,i,a=b.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),t=n&&xn[n[1].toLowerCase()];return t&&t.charset?t.charset:!(!n||!r.test(n[1]))&&"UTF-8"}n.charset=c,n.charsets={lookup:c},n.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?n.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var o=n.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t},n.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),o=t&&n.extensions[t[1].toLowerCase()];return!(!o||!o.length)&&o[0]},n.extensions=Object.create(null),n.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=a("x."+e).toLowerCase().substr(1);return t&&n.types[t]||!1},n.types=Object.create(null),t=n.extensions,o=n.types,i=["nginx","apache",void 0,"iana"],Object.keys(xn).forEach(function(e){var n=xn[e],a=n.extensions;if(a&&a.length){t[e]=a;for(var s=0;s<a.length;s++){var r=a[s];if(o[r]){var c=i.indexOf(xn[o[r]].source),l=i.indexOf(n.source);if("application/octet-stream"!==o[r]&&(c>l||c===l&&"application/"===o[r].substr(0,12)))continue}o[r]=e}}})}),yn=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},wn=function(e){var n=!1;return yn(function(){n=!0}),function(t,o){n?e(t,o):yn(function(){e(t,o)})}},_n=function(e){Object.keys(e.jobs).forEach(kn.bind(e)),e.jobs={}};function kn(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var jn=function(e,n,t,o){var i=t.keyedList?t.keyedList[t.index]:t.index;t.jobs[i]=function(e,n,t,o){return 2==e.length?e(t,wn(o)):e(t,n,wn(o))}(n,i,e[i],function(e,n){i in t.jobs&&(delete t.jobs[i],e?_n(t):t.results[i]=n,o(e,t.results))})},Sn=function(e,n){var t=!Array.isArray(e),o={index:0,keyedList:t||n?Object.keys(e):null,jobs:{},results:t?{}:[],size:t?Object.keys(e).length:e.length};return n&&o.keyedList.sort(t?n:function(t,o){return n(e[t],e[o])}),o},$n=function(e){Object.keys(this.jobs).length&&(this.index=this.size,_n(this),wn(e)(null,this.results))},Tn=function(e,n,t,o){var i=Sn(e,t);return jn(e,n,i,function t(a,s){a?o(a,s):(i.index++,i.index<(i.keyedList||e).length?jn(e,n,i,t):o(null,i.results))}),$n.bind(i,o)};function En(e,n){return e<n?-1:e>n?1:0}Tn.ascending=En,Tn.descending=function(e,n){return-1*En(e,n)};var Cn=function(e,n){return Object.keys(n).forEach(function(t){e[t]=e[t]||n[t]}),e},On=H.parse,Rn=D.Stream,zn=Nn;function Nn(e){if(!(this instanceof Nn))return new Nn(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fn.call(this),e=e||{})this[n]=e[n]}P.inherits(Nn,fn),Nn.LINE_BREAK="\r\n",Nn.DEFAULT_CONTENT_TYPE="application/octet-stream",Nn.prototype.append=function(e,n,t){"string"==typeof(t=t||{})&&(t={filename:t});var o=fn.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),P.isArray(n))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,n,t),a=this._multiPartFooter();o(i),o(n),o(a),this._trackLength(i,n,t)}},Nn.prototype._trackLength=function(e,n,t){var o=0;null!=t.knownLength?o+=+t.knownLength:Buffer.isBuffer(n)?o=n.length:"string"==typeof n&&(o=Buffer.byteLength(n)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+Nn.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Rn)&&(t.knownLength||this._valuesToMeasure.push(n))},Nn.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&Infinity!=e.end&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):a.stat(e.path,function(t,o){t?n(t):n(null,o.size-(e.start?e.start:0))}):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",function(t){e.pause(),n(null,+t.headers["content-length"])}),e.resume()):n("Unknown stream")},Nn.prototype._multiPartHeader=function(e,n,t){if("string"==typeof t.header)return t.header;var o,i=this._getContentDisposition(n,t),a=this._getContentType(n,t),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof t.header&&Cn(r,t.header),r)r.hasOwnProperty(c)&&null!=(o=r[c])&&(Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+Nn.LINE_BREAK));return"--"+this.getBoundary()+Nn.LINE_BREAK+s+Nn.LINE_BREAK},Nn.prototype._getContentDisposition=function(e,n){var t,o;return"string"==typeof n.filepath?t=b.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?t=b.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(t=b.basename(e.client._httpMessage.path||"")),t&&(o='filename="'+t+'"'),o},Nn.prototype._getContentType=function(e,n){var t=n.contentType;return!t&&e.name&&(t=bn.lookup(e.name)),!t&&e.path&&(t=bn.lookup(e.path)),!t&&e.readable&&e.hasOwnProperty("httpVersion")&&(t=e.headers["content-type"]),t||!n.filepath&&!n.filename||(t=bn.lookup(n.filepath||n.filename)),t||"object"!=typeof e||(t=Nn.DEFAULT_CONTENT_TYPE),t},Nn.prototype._multiPartFooter=function(){return function(e){var n=Nn.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},Nn.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Nn.LINE_BREAK},Nn.prototype.getHeaders=function(e){var n,t={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t},Nn.prototype.setBoundary=function(e){this._boundary=e},Nn.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Nn.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),t=0,o=this._streams.length;t<o;t++)"function"!=typeof this._streams[t]&&(e=Buffer.isBuffer(this._streams[t])?Buffer.concat([e,this._streams[t]]):Buffer.concat([e,Buffer.from(this._streams[t])]),"string"==typeof this._streams[t]&&this._streams[t].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(Nn.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Nn.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Nn.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Nn.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Nn.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?function(e,n,t){for(var o=Sn(e);o.index<(o.keyedList||e).length;)jn(e,n,o,function(e,n){e?t(e,n):0!==Object.keys(o.jobs).length||t(null,o.results)}),o.index++;$n.bind(o,t)}(this._valuesToMeasure,this._lengthRetriever,function(t,o){t?e(t):(o.forEach(function(e){n+=e}),e(null,n))}):process.nextTick(e.bind(this,null,n))},Nn.prototype.submit=function(e,n){var t,o,i={method:"post"};return"string"==typeof e?(e=On(e),o=Cn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(o=Cn(e,i)).port||(o.port="https:"==o.protocol?443:80),o.headers=this.getHeaders(e.headers),t="https:"==o.protocol?J.request(o):G.request(o),this.getLength(function(e,o){if(e&&"Unknown stream"!==e)this._error(e);else if(o&&t.setHeader("Content-Length",o),this.pipe(t),n){var i,a=function(e,o){return t.removeListener("error",a),t.removeListener("response",i),n.call(this,e,o)};i=a.bind(this,null),t.on("error",a),t.on("response",i)}}.bind(this)),t},Nn.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Nn.prototype.toString=function(){return"[object FormData]"};var An=zn;function Ln(e){return sn.isPlainObject(e)||sn.isArray(e)}function Fn(e){return sn.endsWith(e,"[]")?e.slice(0,-2):e}function Un(e,n,t){return e?e.concat(n).map(function(e,n){return e=Fn(e),!t&&n?"["+e+"]":e}).join(t?".":""):n}const In=sn.toFlatObject(sn,{},null,function(e){return/^is[A-Z]/.test(e)});function qn(e,n,t){if(!sn.isObject(e))throw new TypeError("target must be an object");n=n||new(An||FormData);const o=(t=sn.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,n){return!sn.isUndefined(n[e])})).metaTokens,i=t.visitor||l,a=t.dots,s=t.indexes,r=(t.Blob||"undefined"!=typeof Blob&&Blob)&&sn.isSpecCompliantForm(n);if(!sn.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(sn.isDate(e))return e.toISOString();if(!r&&sn.isBlob(e))throw new rn("Blob is not supported. Use a Buffer instead.");return sn.isArrayBuffer(e)||sn.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,t,i){let r=e;if(e&&!i&&"object"==typeof e)if(sn.endsWith(t,"{}"))t=o?t:t.slice(0,-2),e=JSON.stringify(e);else if(sn.isArray(e)&&function(e){return sn.isArray(e)&&!e.some(Ln)}(e)||(sn.isFileList(e)||sn.endsWith(t,"[]"))&&(r=sn.toArray(e)))return t=Fn(t),r.forEach(function(e,o){!sn.isUndefined(e)&&null!==e&&n.append(!0===s?Un([t],o,a):null===s?t:t+"[]",c(e))}),!1;return!!Ln(e)||(n.append(Un(i,t,a),c(e)),!1)}const p=[],u=Object.assign(In,{defaultVisitor:l,convertValue:c,isVisitable:Ln});if(!sn.isObject(e))throw new TypeError("data must be an object");return function e(t,o){if(!sn.isUndefined(t)){if(-1!==p.indexOf(t))throw Error("Circular reference detected in "+o.join("."));p.push(t),sn.forEach(t,function(t,a){!0===(!(sn.isUndefined(t)||null===t)&&i.call(n,t,sn.isString(a)?a.trim():a,o,u))&&e(t,o?o.concat(a):[a])}),p.pop()}}(e),n}function Wn(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return n[e]})}function Pn(e,n){this._pairs=[],e&&qn(e,this,n)}const Bn=Pn.prototype;function Dn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mn(e,n,t){if(!n)return e;const o=t&&t.encode||Dn,i=t&&t.serialize;let a;if(a=i?i(n,t):sn.isURLSearchParams(n)?n.toString():new Pn(n,t).toString(o),a){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Bn.append=function(e,n){this._pairs.push([e,n])},Bn.toString=function(e){const n=e?function(n){return e.call(this,n,Wn)}:Wn;return this._pairs.map(function(e){return n(e[0])+"="+n(e[1])},"").join("&")};var Gn=class{constructor(){this.handlers=[]}use(e,n,t){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){sn.forEach(this.handlers,function(n){null!==n&&e(n)})}},Jn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hn={isNode:!0,classes:{URLSearchParams:H.URLSearchParams,FormData:An,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};const Kn="undefined"!=typeof window&&"undefined"!=typeof document,Vn=(Yn="undefined"!=typeof navigator&&navigator.product,Kn&&["ReactNative","NativeScript","NS"].indexOf(Yn)<0);var Yn,Zn={__proto__:null,hasBrowserEnv:Kn,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:Vn,origin:Kn&&window.location.href||"http://localhost",...Hn};function Xn(e){function n(e,t,o,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),r=i>=e.length;return a=!a&&sn.isArray(o)?o.length:a,r?(o[a]=sn.hasOwnProp(o,a)?[o[a],t]:t,!s):(o[a]&&sn.isObject(o[a])||(o[a]=[]),n(e,t,o[a],i)&&sn.isArray(o[a])&&(o[a]=function(e){const n={},t=Object.keys(e);let o;const i=t.length;let a;for(o=0;o<i;o++)a=t[o],n[a]=e[a];return n}(o[a])),!s)}if(sn.isFormData(e)&&sn.isFunction(e.entries)){const t={};return sn.forEachEntry(e,(e,o)=>{n(function(e){return sn.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),o,t,0)}),t}return null}const Qn={transitional:Jn,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const t=n.getContentType()||"",o=t.indexOf("application/json")>-1,i=sn.isObject(e);if(i&&sn.isHTMLForm(e)&&(e=new FormData(e)),sn.isFormData(e))return o?JSON.stringify(Xn(e)):e;if(sn.isArrayBuffer(e)||sn.isBuffer(e)||sn.isStream(e)||sn.isFile(e)||sn.isBlob(e)||sn.isReadableStream(e))return e;if(sn.isArrayBufferView(e))return e.buffer;if(sn.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(t.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return qn(e,new Zn.classes.URLSearchParams,Object.assign({visitor:function(e,n,t,o){return Zn.isNode&&sn.isBuffer(e)?(this.append(n,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((a=sn.isFileList(e))||t.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return qn(a?{"files[]":e}:e,n&&new n,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),function(e,n,t){if(sn.isString(e))try{return(0,JSON.parse)(e),sn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||Qn.transitional,t=n&&n.forcedJSONParsing,o="json"===this.responseType;if(sn.isResponse(e)||sn.isReadableStream(e))return e;if(e&&sn.isString(e)&&(t&&!this.responseType||o)){const t=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(t){if("SyntaxError"===e.name)throw rn.from(e,rn.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zn.classes.FormData,Blob:Zn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};sn.forEach(["delete","get","head","post","put","patch"],e=>{Qn.headers[e]={}});var et=Qn;const nt=sn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tt=Symbol("internals");function ot(e){return e&&String(e).trim().toLowerCase()}function it(e){return!1===e||null==e?e:sn.isArray(e)?e.map(it):String(e)}function at(e,n,t,o,i){return sn.isFunction(o)?o.call(this,n,t):(i&&(n=t),sn.isString(n)?sn.isString(o)?-1!==n.indexOf(o):sn.isRegExp(o)?o.test(n):void 0:void 0)}class st{constructor(e){e&&this.set(e)}set(e,n,t){const o=this;function i(e,n,t){const i=ot(n);if(!i)throw new Error("header name must be a non-empty string");const a=sn.findKey(o,i);(!a||void 0===o[a]||!0===t||void 0===t&&!1!==o[a])&&(o[a||n]=it(e))}const a=(e,n)=>sn.forEach(e,(e,t)=>i(e,t,n));if(sn.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(sn.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const n={};let t,o,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),t=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim(),!t||n[t]&&nt[t]||("set-cookie"===t?n[t]?n[t].push(o):n[t]=[o]:n[t]=n[t]?n[t]+", "+o:o)}),n})(e),n);else if(sn.isHeaders(e))for(const[n,o]of e.entries())i(o,n,t);else null!=e&&i(n,e,t);return this}get(e,n){if(e=ot(e)){const t=sn.findKey(this,e);if(t){const e=this[t];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=t.exec(e);)n[o[1]]=o[2];return n}(e);if(sn.isFunction(n))return n.call(this,e,t);if(sn.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ot(e)){const t=sn.findKey(this,e);return!(!t||void 0===this[t]||n&&!at(0,this[t],t,n))}return!1}delete(e,n){const t=this;let o=!1;function i(e){if(e=ot(e)){const i=sn.findKey(t,e);!i||n&&!at(0,t[i],i,n)||(delete t[i],o=!0)}}return sn.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let t=n.length,o=!1;for(;t--;){const i=n[t];e&&!at(0,this[i],i,e,!0)||(delete this[i],o=!0)}return o}normalize(e){const n=this,t={};return sn.forEach(this,(o,i)=>{const a=sn.findKey(t,i);if(a)return n[a]=it(o),void delete n[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,t)=>n.toUpperCase()+t)}(i):String(i).trim();s!==i&&delete n[i],n[s]=it(o),t[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return sn.forEach(this,(t,o)=>{null!=t&&!1!==t&&(n[o]=e&&sn.isArray(t)?t.join(", "):t)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const t=new this(e);return n.forEach(e=>t.set(e)),t}static accessor(e){const n=(this[tt]=this[tt]={accessors:{}}).accessors,t=this.prototype;function o(e){const o=ot(e);n[o]||(function(e,n){const t=sn.toCamelCase(" "+n);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+t,{value:function(e,t,i){return this[o].call(this,n,e,t,i)},configurable:!0})})}(t,e),n[o]=!0)}return sn.isArray(e)?e.forEach(o):o(e),this}}st.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),sn.reduceDescriptors(st.prototype,({value:e},n)=>{let t=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(e){this[t]=e}}}),sn.freezeMethods(st);var rt=st;function ct(e,n){const t=this||et,o=n||t,i=rt.from(o.headers);let a=o.data;return sn.forEach(e,function(e){a=e.call(t,a,i.normalize(),n?n.status:void 0)}),i.normalize(),a}function lt(e){return!(!e||!e.__CANCEL__)}function pt(e,n,t){rn.call(this,null==e?"canceled":e,rn.ERR_CANCELED,n,t),this.name="CanceledError"}function ut(e,n,t){const o=t.config.validateStatus;t.status&&o&&!o(t.status)?n(new rn("Request failed with status code "+t.status,[rn.ERR_BAD_REQUEST,rn.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t)):e(t)}function dt(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}sn.inherits(pt,rn,{__CANCEL__:!0});var mt=H.parse,ft={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},ht=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function gt(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var vt=1e3,xt=60*vt,bt=60*xt,yt=24*bt,wt=7*yt,_t=function(e,n){n=n||{};var t=typeof e;if("string"===t&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var n=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(n){var t=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*t;case"weeks":case"week":case"w":return t*wt;case"days":case"day":case"d":return t*yt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*bt;case"minutes":case"minute":case"mins":case"min":case"m":return t*xt;case"seconds":case"second":case"secs":case"sec":case"s":return t*vt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}(e);if("number"===t&&isFinite(e))return n.long?function(e){var n=Math.abs(e);return n>=yt?kt(e,n,yt,"day"):n>=bt?kt(e,n,bt,"hour"):n>=xt?kt(e,n,xt,"minute"):n>=vt?kt(e,n,vt,"second"):e+" ms"}(e):function(e){var n=Math.abs(e);return n>=yt?Math.round(e/yt)+"d":n>=bt?Math.round(e/bt)+"h":n>=xt?Math.round(e/xt)+"m":n>=vt?Math.round(e/vt)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function kt(e,n,t,o){var i=n>=1.5*t;return Math.round(e/t)+" "+o+(i?"s":"")}var jt=function(e){function n(e){let o,i,a,s=null;function r(...e){if(!r.enabled)return;const t=r,i=Number(new Date);t.diff=i-(o||i),t.prev=o,t.curr=i,o=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(o,i)=>{if("%%"===o)return"%";a++;const s=n.formatters[i];return"function"==typeof s&&(o=s.call(t,e[a]),e.splice(a,1),a--),o}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=t,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==n.namespaces&&(i=n.namespaces,a=n.enabled(e)),a),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function t(e,t){const o=n(this.namespace+(void 0===t?":":t)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(o),...n.skips.map(o).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(t=0;t<i;t++)o[t]&&("-"===(e=o[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,o;for(t=0,o=n.skips.length;t<o;t++)if(n.skips[t].test(e))return!1;for(t=0,o=n.names.length;t<o;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=_t,n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n},St=vn(function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,i=0;n[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),n.splice(i,0,t)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),e.exports=jt(n);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),$t=(e,n=process.argv)=>{const t=e.startsWith("-")?"":1===e.length?"-":"--",o=n.indexOf(t+e),i=n.indexOf("--");return-1!==o&&(-1===i||o<i)};const{env:Tt}=process;let Et;function Ct(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ot(e,n){if(0===Et)return 0;if($t("color=16m")||$t("color=full")||$t("color=truecolor"))return 3;if($t("color=256"))return 2;if(e&&!n&&void 0===Et)return 0;const t=Et||0;if("dumb"===Tt.TERM)return t;if("win32"===process.platform){const e=Y.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in Tt)||"codeship"===Tt.CI_NAME?1:t;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("truecolor"===Tt.COLORTERM)return 3;if("TERM_PROGRAM"in Tt){const e=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:t}$t("no-color")||$t("no-colors")||$t("color=false")||$t("color=never")?Et=0:($t("color")||$t("colors")||$t("color=true")||$t("color=always"))&&(Et=1),"FORCE_COLOR"in Tt&&(Et="true"===Tt.FORCE_COLOR?1:"false"===Tt.FORCE_COLOR?0:0===Tt.FORCE_COLOR.length?1:Math.min(parseInt(Tt.FORCE_COLOR,10),3));var Rt,zt={supportsColor:function(e){return Ct(Ot(e,e&&e.isTTY))},stdout:Ct(Ot(!0,V.isatty(1))),stderr:Ct(Ot(!0,V.isatty(2)))},Nt=vn(function(e,n){n.init=function(e){e.inspectOpts={};const t=Object.keys(n.inspectOpts);for(let o=0;o<t.length;o++)e.inspectOpts[t[o]]=n.inspectOpts[t[o]]},n.log=function(...e){return process.stderr.write(P.format(...e)+"\n")},n.formatArgs=function(t){const{namespace:o,useColors:i}=this;if(i){const n=this.color,i="[3"+(n<8?n:"8;5;"+n),a=` ${i};1m${o} [0m`;t[0]=a+t[0].split("\n").join("\n"+a),t.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else t[0]=(n.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+o+" "+t[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):V.isatty(process.stderr.fd)},n.destroy=P.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{zt&&(zt.stderr||zt).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,n)=>{const t=n.substring(6).toLowerCase().replace(/_([a-z])/g,(e,n)=>n.toUpperCase());let o=process.env[n];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),e[t]=o,e},{}),e.exports=jt(n);const{formatters:t}=e.exports;t.o=function(e){return this.inspectOpts.colors=this.useColors,P.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},t.O=function(e){return this.inspectOpts.colors=this.useColors,P.inspect(e,this.inspectOpts)}}),At=vn(function(e){e.exports="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?St:Nt}),Lt=function(){if(!Rt){try{Rt=At("follow-redirects")}catch(e){}"function"!=typeof Rt&&(Rt=function(){})}Rt.apply(null,arguments)},Ft=H.URL,Ut=D.Writable,It=!1;try{K(new Ft)}catch(e){It="ERR_INVALID_URL"===e.code}var qt=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Wt=["abort","aborted","connect","error","socket","timeout"],Pt=Object.create(null);Wt.forEach(function(e){Pt[e]=function(n,t,o){this._redirectable.emit(e,n,t,o)}});var Bt=no("ERR_INVALID_URL","Invalid URL",TypeError),Dt=no("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Mt=no("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Dt),Gt=no("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Jt=no("ERR_STREAM_WRITE_AFTER_END","write after end"),Ht=Ut.prototype.destroy||Yt;function Kt(e,n){Ut.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var t=this;this._onNativeResponse=function(e){try{t._processResponse(e)}catch(e){t.emit("error",e instanceof Dt?e:new Dt({cause:e}))}},this._performRequest()}function Vt(e){var n={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(e).forEach(function(o){var i=o+":",a=t[i]=e[o],s=n[o]=Object.create(a);Object.defineProperties(s,{request:{value:function(e,o,a){return Ft&&e instanceof Ft?e=Qt(e):oo(e)?e=Qt(Zt(e)):(a=o,o=Xt(e),e={protocol:i}),io(o)&&(a=o,o=null),(o=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,o)).nativeProtocols=t,oo(o.host)||oo(o.hostname)||(o.hostname="::1"),K.equal(o.protocol,i,"protocol mismatch"),Lt("options",o),new Kt(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,t){var o=s.request(e,n,t);return o.end(),o},configurable:!0,enumerable:!0,writable:!0}})}),n}function Yt(){}function Zt(e){var n;if(It)n=new Ft(e);else if(!oo((n=Xt(H.parse(e))).protocol))throw new Bt({input:e});return n}function Xt(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Bt({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Bt({input:e.href||e});return e}function Qt(e,n){var t=n||{};for(var o of qt)t[o]=e[o];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),""!==t.port&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function eo(e,n){var t;for(var o in n)e.test(o)&&(t=n[o],delete n[o]);return null==t?void 0:String(t).trim()}function no(e,n,t){function o(t){Error.captureStackTrace(this,this.constructor),Object.assign(this,t||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return o.prototype=new(t||Error),Object.defineProperties(o.prototype,{constructor:{value:o,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),o}function to(e,n){for(var t of Wt)e.removeListener(t,Pt[t]);e.on("error",Yt),e.destroy(n)}function oo(e){return"string"==typeof e||e instanceof String}function io(e){return"function"==typeof e}(Kt.prototype=Object.create(Ut.prototype)).abort=function(){to(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},Kt.prototype.destroy=function(e){return to(this._currentRequest,e),Ht.call(this,e),this},Kt.prototype.write=function(e,n,t){if(this._ending)throw new Jt;if(!(oo(e)||"object"==typeof(o=e)&&"length"in o))throw new TypeError("data should be a string, Buffer or Uint8Array");var o;io(n)&&(t=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,t)):(this.emit("error",new Gt),this.abort()):t&&t()},Kt.prototype.end=function(e,n,t){if(io(e)?(t=e,e=n=null):io(n)&&(t=n,n=null),e){var o=this,i=this._currentRequest;this.write(e,n,function(){o._ended=!0,i.end(null,null,t)}),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,t)},Kt.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},Kt.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Kt.prototype.setTimeout=function(e,n){var t=this;function o(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function i(n){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),a()},e),o(n)}function a(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",a),t.removeListener("error",a),t.removeListener("response",a),t.removeListener("close",a),n&&t.removeListener("timeout",n),t.socket||t._currentRequest.removeListener("socket",i)}return n&&this.on("timeout",n),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",o),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Kt.prototype[e]=function(n,t){return this._currentRequest[e](n,t)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Kt.prototype,e,{get:function(){return this._currentRequest[e]}})}),Kt.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},Kt.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(!n)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var t=e.slice(0,-1);this._options.agent=this._options.agents[t]}var o=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var i of(o._redirectable=this,Wt))o.on(i,Pt[i]);if(this._currentUrl=/^\//.test(this._options.path)?H.format(this._options):this._options.path,this._isRedirect){var a=0,s=this,r=this._requestBodyBuffers;!function e(n){if(o===s._currentRequest)if(n)s.emit("error",n);else if(a<r.length){var t=r[a++];o.finished||o.write(t.data,t.encoding,e)}else s._ended&&o.end()}()}},Kt.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var t,o=e.headers.location;if(!o||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(to(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Mt;var i=this._options.beforeRedirect;i&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],eo(/^content-/i,this._options.headers));var s=eo(/^host$/i,this._options.headers),r=Zt(this._currentUrl),c=s||r.host,l=/^\w+:/.test(o)?this._currentUrl:H.format(Object.assign(r,{host:c})),p=function(e,n){return It?new Ft(e,n):Zt(H.resolve(n,e))}(o,l);Lt("redirecting to",p.href),this._isRedirect=!0,Qt(p,this._options),(p.protocol!==r.protocol&&"https:"!==p.protocol||p.host!==c&&!function(e,n){K(oo(e)&&oo(n));var t=e.length-n.length-1;return t>0&&"."===e[t]&&e.endsWith(n)}(p.host,c))&&eo(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),io(i)&&(i(this._options,{headers:e.headers,statusCode:n},{url:l,method:a,headers:t}),this._sanitizeOptions(this._options)),this._performRequest()};var ao=Vt({http:G,https:J});ao.wrap=Vt;const so="1.7.4";function ro(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}const co=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/,lo=Symbol("internals");var po=class extends D.Transform{constructor(e){super({readableHighWaterMark:(e=sn.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(e,n)=>!sn.isUndefined(n[e]))).chunkSize});const n=this[lo]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))})}_read(e){const n=this[lo];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,t){const o=this[lo],i=o.maxRate,a=this.readableHighWaterMark,s=o.timeWindow,r=i/(1e3/s),c=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*r):0,l=(e,n)=>{const t=Buffer.byteLength(e);o.bytesSeen+=t,o.bytes+=t,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(e)?process.nextTick(n):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(n)}},p=(e,n)=>{const t=Buffer.byteLength(e);let p,u=null,d=a,m=0;if(i){const e=Date.now();(!o.ts||(m=e-o.ts)>=s)&&(o.ts=e,p=r-o.bytes,o.bytes=p<0?-p:0,m=0),p=r-o.bytes}if(i){if(p<=0)return setTimeout(()=>{n(null,e)},s-m);p<d&&(d=p)}d&&t>d&&t-d>c&&(u=e.subarray(d),e=e.subarray(0,d)),l(e,u?()=>{process.nextTick(n,null,u)}:n)};p(e,function e(n,o){if(n)return t(n);o?p(o,e):t(null)})}};const{asyncIterator:uo}=Symbol;var mo=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[uo]?yield*e[uo]():yield e};const fo=sn.ALPHABET.ALPHA_DIGIT+"-_",ho=new B,go="\r\n",vo=ho.encode(go);class xo{constructor(e,n){const{escapeName:t}=this.constructor,o=sn.isString(n);let i=`Content-Disposition: form-data; name="${t(e)}"${!o&&n.name?`; filename="${t(n.name)}"`:""}${go}`;o?n=ho.encode(String(n).replace(/\r?\n|\r\n?/g,go)):i+=`Content-Type: ${n.type||"application/octet-stream"}${go}`,this.headers=ho.encode(i+go),this.contentLength=o?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=n}async*encode(){yield this.headers;const{value:e}=this;sn.isTypedArray(e)?yield e:yield*mo(e),yield vo}static escapeName(e){return String(e).replace(/[\r\n"]/g,e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e]))}}var bo=class extends D.Transform{__transform(e,n,t){this.push(e),t()}_transform(e,n,t){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,n)}this.__transform(e,n,t)}},yo=(e,n)=>sn.isAsyncFn(e)?function(...t){const o=t.pop();e.apply(this,t).then(e=>{try{n?o(null,...n(e)):o(null,e)}catch(e){o(e)}},o)}:e;const wo=(e,n,t=3)=>{let o=0;const i=function(e,n){e=e||10;const t=new Array(e),o=new Array(e);let i,a=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),l=o[s];i||(i=c),t[a]=r,o[a]=c;let p=s,u=0;for(;p!==a;)u+=t[p++],p%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),c-i<n)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(e,n){let t,o,i=0,a=1e3/n;const s=(n,a=Date.now())=>{i=a,t=null,o&&(clearTimeout(o),o=null),e.apply(null,n)};return[(...e)=>{const n=Date.now(),r=n-i;r>=a?s(e,n):(t=e,o||(o=setTimeout(()=>{o=null,s(t)},a-r)))},()=>t&&s(t)]}(t=>{const a=t.loaded,s=t.lengthComputable?t.total:void 0,r=a-o,c=i(r);o=a,e({loaded:a,total:s,progress:s?a/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&a<=s?(s-a)/c:void 0,event:t,lengthComputable:null!=s,[n?"download":"upload"]:!0})},t)},_o=(e,n)=>{const t=null!=e;return[o=>n[0]({lengthComputable:t,total:e,loaded:o}),n[1]]},ko=e=>(...n)=>sn.asap(()=>e(...n)),jo={flush:Q.constants.Z_SYNC_FLUSH,finishFlush:Q.constants.Z_SYNC_FLUSH},So={flush:Q.constants.BROTLI_OPERATION_FLUSH,finishFlush:Q.constants.BROTLI_OPERATION_FLUSH},$o=sn.isFunction(Q.createBrotliDecompress),{http:To,https:Eo}=ao,Co=/https:?/,Oo=Zn.protocols.map(e=>e+":"),Ro=(e,[n,t])=>(e.on("end",t).on("error",t),n);function zo(e,n){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,n)}function No(e,n,t){let o=n;if(!o&&!1!==o){const e=function(e){var n="string"==typeof e?mt(e):e||{},t=n.protocol,o=n.host,i=n.port;if("string"!=typeof o||!o||"string"!=typeof t)return"";if(t=t.split(":",1)[0],!function(e,n){var t=(gt("npm_config_no_proxy")||gt("no_proxy")).toLowerCase();return!t||"*"!==t&&t.split(/[,\s]/).every(function(t){if(!t)return!0;var o=t.match(/^(.+):(\d+)$/),i=o?o[1]:t,a=o?parseInt(o[2]):0;return!(!a||a===n)||(/^[.*]/.test(i)?("*"===i.charAt(0)&&(i=i.slice(1)),!ht.call(e,i)):e!==i)})}(o=o.replace(/:\d*$/,""),i=parseInt(i)||ft[t]||0))return"";var a=gt("npm_config_"+t+"_proxy")||gt(t+"_proxy")||gt("npm_config_proxy")||gt("all_proxy");return a&&-1===a.indexOf("://")&&(a=t+"://"+a),a}(t);e&&(o=new URL(e))}if(o){if(o.username&&(o.auth=(o.username||"")+":"+(o.password||"")),o.auth){(o.auth.username||o.auth.password)&&(o.auth=(o.auth.username||"")+":"+(o.auth.password||""));const n=Buffer.from(o.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=o.hostname||o.host;e.hostname=n,e.host=n,e.port=o.port,e.path=t,o.protocol&&(e.protocol=o.protocol.includes(":")?o.protocol:`${o.protocol}:`)}e.beforeRedirects.proxy=function(e){No(e,n,e.href)}}const Ao="undefined"!=typeof process&&"process"===sn.kindOf(process),Lo=(e,n)=>(({address:e,family:n})=>{if(!sn.isString(e))throw TypeError("address must be a string");return{address:e,family:n||(e.indexOf(".")<0?6:4)}})(sn.isObject(e)?e:{address:e,family:n});var Fo=Ao&&function(e){return n=async function(n,t,o){let{data:i,lookup:a,family:s}=e;const{responseType:r,responseEncoding:c}=e,l=e.method.toUpperCase();let p,u,d=!1;if(a){const e=yo(a,e=>sn.isArray(e)?e:[e]);a=(n,t,o)=>{e(n,t,(e,n,i)=>{if(e)return o(e);const a=sn.isArray(n)?n.map(e=>Lo(e)):[Lo(n,i)];t.all?o(e,a):o(e,a[0].address,a[0].family)})}}const m=new ee,f=()=>{e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h),m.removeAllListeners()};function h(n){m.emit("abort",!n||n.type?new pt(null,e,u):n)}o((e,n)=>{p=!0,n&&(d=!0,f())}),m.once("abort",t),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h)));const g=dt(e.baseURL,e.url),v=new URL(g,sn.hasBrowserEnv?Zn.origin:void 0),x=v.protocol||Oo[0];if("data:"===x){let o;if("GET"!==l)return ut(n,t,{status:405,statusText:"method not allowed",headers:{},config:e});try{o=function(e,n,t){const o=t&&t.Blob||Zn.classes.Blob,i=ro(e);if(void 0===n&&o&&(n=!0),"data"===i){e=i.length?e.slice(i.length+1):e;const t=co.exec(e);if(!t)throw new rn("Invalid URL",rn.ERR_INVALID_URL);const a=t[1],s=t[2],r=Buffer.from(decodeURIComponent(t[3]),s?"base64":"utf8");if(n){if(!o)throw new rn("Blob is not supported",rn.ERR_NOT_SUPPORT);return new o([r],{type:a})}return r}throw new rn("Unsupported protocol "+i,rn.ERR_NOT_SUPPORT)}(e.url,"blob"===r,{Blob:e.env&&e.env.Blob})}catch(n){throw rn.from(n,rn.ERR_BAD_REQUEST,e)}return"text"===r?(o=o.toString(c),c&&"utf8"!==c||(o=sn.stripBOM(o))):"stream"===r&&(o=D.Readable.from(o)),ut(n,t,{data:o,status:200,statusText:"OK",headers:new rt,config:e})}if(-1===Oo.indexOf(x))return t(new rn("Unsupported protocol "+x,rn.ERR_BAD_REQUEST,e));const b=rt.from(e.headers).normalize();b.set("User-Agent","axios/"+so,!1);const{onUploadProgress:y,onDownloadProgress:w}=e,_=e.maxRate;let k,j;if(sn.isSpecCompliantForm(i)){const e=b.getContentType(/boundary=([-_\w\d]{10,70})/i);i=((e,n,t)=>{const{tag:o="form-data-boundary",size:i=25,boundary:a=o+"-"+sn.generateString(i,fo)}=t||{};if(!sn.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");const s=ho.encode("--"+a+go),r=ho.encode("--"+a+"--"+go+go);let c=r.byteLength;const l=Array.from(e.entries()).map(([e,n])=>{const t=new xo(e,n);return c+=t.size,t});c+=s.byteLength*l.length,c=sn.toFiniteNumber(c);const p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(p["Content-Length"]=c),n&&n(p),M.from(async function*(){for(const e of l)yield s,yield*e.encode();yield r}())})(i,e=>{b.set(e)},{tag:`axios-${so}-boundary`,boundary:e&&e[1]||void 0})}else if(sn.isFormData(i)&&sn.isFunction(i.getHeaders)){if(b.set(i.getHeaders()),!b.hasContentLength())try{const e=await P.promisify(i.getLength).call(i);Number.isFinite(e)&&e>=0&&b.setContentLength(e)}catch(e){}}else if(sn.isBlob(i))i.size&&b.setContentType(i.type||"application/octet-stream"),b.setContentLength(i.size||0),i=D.Readable.from(mo(i));else if(i&&!sn.isStream(i)){if(Buffer.isBuffer(i));else if(sn.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!sn.isString(i))return t(new rn("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",rn.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(b.setContentLength(i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return t(new rn("Request body larger than maxBodyLength limit",rn.ERR_BAD_REQUEST,e))}const S=sn.toFiniteNumber(b.getContentLength());let $,T;sn.isArray(_)?(k=_[0],j=_[1]):k=j=_,i&&(y||k)&&(sn.isStream(i)||(i=D.Readable.from(i,{objectMode:!1})),i=D.pipeline([i,new po({maxRate:sn.toFiniteNumber(k)})],sn.noop),y&&i.on("progress",Ro(i,_o(S,wo(ko(y),!1,3))))),e.auth&&($=(e.auth.username||"")+":"+(e.auth.password||"")),!$&&v.username&&($=v.username+":"+v.password),$&&b.delete("authorization");try{T=Mn(v.pathname+v.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const o=new Error(n.message);return o.config=e,o.url=e.url,o.exists=!0,t(o)}b.set("Accept-Encoding","gzip, compress, deflate"+($o?", br":""),!1);const E={path:T,method:l,headers:b.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:$,protocol:x,family:s,beforeRedirect:zo,beforeRedirects:{}};let C;!sn.isUndefined(a)&&(E.lookup=a),e.socketPath?E.socketPath=e.socketPath:(E.hostname=v.hostname,E.port=v.port,No(E,e.proxy,x+"//"+v.hostname+(v.port?":"+v.port:"")+E.path));const O=Co.test(E.protocol);if(E.agent=O?e.httpsAgent:e.httpAgent,e.transport?C=e.transport:0===e.maxRedirects?C=O?J:G:(e.maxRedirects&&(E.maxRedirects=e.maxRedirects),e.beforeRedirect&&(E.beforeRedirects.config=e.beforeRedirect),C=O?Eo:To),E.maxBodyLength=e.maxBodyLength>-1?e.maxBodyLength:Infinity,e.insecureHTTPParser&&(E.insecureHTTPParser=e.insecureHTTPParser),u=C.request(E,function(o){if(u.destroyed)return;const i=[o],a=+o.headers["content-length"];if(w||j){const e=new po({maxRate:sn.toFiniteNumber(j)});w&&e.on("progress",Ro(e,_o(a,wo(ko(w),!0,3)))),i.push(e)}let s=o;const p=o.req||u;if(!1!==e.decompress&&o.headers["content-encoding"])switch("HEAD"!==l&&204!==o.statusCode||delete o.headers["content-encoding"],(o.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":i.push(Q.createUnzip(jo)),delete o.headers["content-encoding"];break;case"deflate":i.push(new bo),i.push(Q.createUnzip(jo)),delete o.headers["content-encoding"];break;case"br":$o&&(i.push(Q.createBrotliDecompress(So)),delete o.headers["content-encoding"])}s=i.length>1?D.pipeline(i,sn.noop):i[0];const h=D.finished(s,()=>{h(),f()}),g={status:o.statusCode,statusText:o.statusMessage,headers:new rt(o.headers),config:e,request:p};if("stream"===r)g.data=s,ut(n,t,g);else{const o=[];let i=0;s.on("data",function(n){o.push(n),i+=n.length,e.maxContentLength>-1&&i>e.maxContentLength&&(d=!0,s.destroy(),t(new rn("maxContentLength size of "+e.maxContentLength+" exceeded",rn.ERR_BAD_RESPONSE,e,p)))}),s.on("aborted",function(){if(d)return;const n=new rn("maxContentLength size of "+e.maxContentLength+" exceeded",rn.ERR_BAD_RESPONSE,e,p);s.destroy(n),t(n)}),s.on("error",function(n){u.destroyed||t(rn.from(n,null,e,p))}),s.on("end",function(){try{let e=1===o.length?o[0]:Buffer.concat(o);"arraybuffer"!==r&&(e=e.toString(c),c&&"utf8"!==c||(e=sn.stripBOM(e))),g.data=e}catch(n){return t(rn.from(n,null,e,g.request,g))}ut(n,t,g)})}m.once("abort",e=>{s.destroyed||(s.emit("error",e),s.destroy())})}),m.once("abort",e=>{t(e),u.destroy(e)}),u.on("error",function(n){t(rn.from(n,null,e,u))}),u.on("socket",function(e){e.setKeepAlive(!0,6e4)}),e.timeout){const n=parseInt(e.timeout,10);if(Number.isNaN(n))return void t(new rn("error trying to parse `config.timeout` to int",rn.ERR_BAD_OPTION_VALUE,e,u));u.setTimeout(n,function(){if(p)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new rn(n,(e.transitional||Jn).clarifyTimeoutError?rn.ETIMEDOUT:rn.ECONNABORTED,e,u)),h()})}if(sn.isStream(i)){let n=!1,t=!1;i.on("end",()=>{n=!0}),i.once("error",e=>{t=!0,u.destroy(e)}),i.on("close",()=>{n||t||h(new pt("Request stream has been aborted",e,u))}),i.pipe(u)}else u.end(i)},new Promise((e,t)=>{let o,i;const a=(e,n)=>{i||(i=!0,o&&o(e,n))},s=e=>{a(e,!0),t(e)};n(n=>{a(n),e(n)},s,e=>o=e).catch(s)});var n},Uo=Zn.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let t;function o(t){let o=t;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){const n=sn.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},Io=Zn.hasStandardBrowserEnv?{write(e,n,t,o,i,a){const s=[e+"="+encodeURIComponent(n)];sn.isNumber(t)&&s.push("expires="+new Date(t).toGMTString()),sn.isString(o)&&s.push("path="+o),sn.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};const qo=e=>e instanceof rt?{...e}:e;function Wo(e,n){n=n||{};const t={};function o(e,n,t){return sn.isPlainObject(e)&&sn.isPlainObject(n)?sn.merge.call({caseless:t},e,n):sn.isPlainObject(n)?sn.merge({},n):sn.isArray(n)?n.slice():n}function i(e,n,t){return sn.isUndefined(n)?sn.isUndefined(e)?void 0:o(void 0,e,t):o(e,n,t)}function a(e,n){if(!sn.isUndefined(n))return o(void 0,n)}function s(e,n){return sn.isUndefined(n)?sn.isUndefined(e)?void 0:o(void 0,e):o(void 0,n)}function r(t,i,a){return a in n?o(t,i):a in e?o(void 0,t):void 0}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r,headers:(e,n)=>i(qo(e),qo(n),!0)};return sn.forEach(Object.keys(Object.assign({},e,n)),function(o){const a=c[o]||i,s=a(e[o],n[o],o);sn.isUndefined(s)&&a!==r||(t[o]=s)}),t}var Po=e=>{const n=Wo({},e);let t,{data:o,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:s,headers:r,auth:c}=n;if(n.headers=r=rt.from(r),n.url=Mn(dt(n.baseURL,n.url),e.params,e.paramsSerializer),c&&r.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),sn.isFormData(o))if(Zn.hasStandardBrowserEnv||Zn.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(!1!==(t=r.getContentType())){const[e,...n]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];r.setContentType([e||"multipart/form-data",...n].join("; "))}if(Zn.hasStandardBrowserEnv&&(i&&sn.isFunction(i)&&(i=i(n)),i||!1!==i&&Uo(n.url))){const e=a&&s&&Io.read(s);e&&r.set(a,e)}return n},Bo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(n,t){const o=Po(e);let i=o.data;const a=rt.from(o.headers).normalize();let s,r,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=o;function f(){l&&l(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const o=rt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());ut(function(e){n(e),f()},function(e){t(e),f()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:o,config:e,request:h}),h=null}h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(t(new rn("Request aborted",rn.ECONNABORTED,e,h)),h=null)},h.onerror=function(){t(new rn("Network Error",rn.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let n=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";o.timeoutErrorMessage&&(n=o.timeoutErrorMessage),t(new rn(n,(o.transitional||Jn).clarifyTimeoutError?rn.ETIMEDOUT:rn.ECONNABORTED,e,h)),h=null},void 0===i&&a.setContentType(null),"setRequestHeader"in h&&sn.forEach(a.toJSON(),function(e,n){h.setRequestHeader(n,e)}),sn.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),m&&([c,p]=wo(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([r,l]=wo(d),h.upload.addEventListener("progress",r),h.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=n=>{h&&(t(!n||n.type?new pt(null,e,h):n),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=ro(o.url);v&&-1===Zn.protocols.indexOf(v)?t(new rn("Unsupported protocol "+v+":",rn.ERR_BAD_REQUEST,e)):h.send(i||null)})},Do=(e,n)=>{let t,o=new AbortController;const i=function(e){if(!t){t=!0,s();const n=e instanceof Error?e:this.reason;o.abort(n instanceof rn?n:new pt(n instanceof Error?n.message:n))}};let a=n&&setTimeout(()=>{i(new rn(`timeout ${n} of ms exceeded`,rn.ETIMEDOUT))},n);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",i));const{signal:r}=o;return r.unsubscribe=s,[r,()=>{a&&clearTimeout(a),a=null}]};const Mo=function*(e,n){let t=e.byteLength;if(!n||t<n)return void(yield e);let o,i=0;for(;i<t;)o=i+n,yield e.slice(i,o),i=o},Go=(e,n,t,o,i)=>{const a=async function*(e,n,t){for await(const o of e)yield*Mo(ArrayBuffer.isView(o)?o:await t(String(o)),n)}(e,n,i);let s,r=0,c=e=>{s||(s=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:n,value:o}=await a.next();if(n)return c(),void e.close();if(t){let e=r+=o.byteLength;t(e)}e.enqueue(new Uint8Array(o))}catch(e){throw c(e),e}},cancel:e=>(c(e),a.return())},{highWaterMark:2})},Jo="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ho=Jo&&"function"==typeof ReadableStream,Ko=Jo&&("function"==typeof TextEncoder?(Vo=new TextEncoder,e=>Vo.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Vo;const Yo=(e,...n)=>{try{return!!e(...n)}catch(e){return!1}},Zo=Ho&&Yo(()=>{let e=!1;const n=new Request(Zn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),Xo=Ho&&Yo(()=>sn.isReadableStream(new Response("").body)),Qo={stream:Xo&&(e=>e.body)};var ei;Jo&&(ei=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Qo[e]&&(Qo[e]=sn.isFunction(ei[e])?n=>n[e]():(n,t)=>{throw new rn(`Response type '${e}' is not supported`,rn.ERR_NOT_SUPPORT,t)})}));var ni=Jo&&(async e=>{let{url:n,method:t,data:o,signal:i,cancelToken:a,timeout:s,onDownloadProgress:r,onUploadProgress:c,responseType:l,headers:p,withCredentials:u="same-origin",fetchOptions:d}=Po(e);l=l?(l+"").toLowerCase():"text";let m,f,[h,g]=i||a||s?Do([i,a],s):[];const v=()=>{!m&&setTimeout(()=>{h&&h.unsubscribe()}),m=!0};let x;try{if(c&&Zo&&"get"!==t&&"head"!==t&&0!==(x=await(async(e,n)=>{const t=sn.toFiniteNumber(e.getContentLength());return null==t?(async e=>null==e?0:sn.isBlob(e)?e.size:sn.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:sn.isArrayBufferView(e)||sn.isArrayBuffer(e)?e.byteLength:(sn.isURLSearchParams(e)&&(e+=""),sn.isString(e)?(await Ko(e)).byteLength:void 0))(n):t})(p,o))){let e,t=new Request(n,{method:"POST",body:o,duplex:"half"});if(sn.isFormData(o)&&(e=t.headers.get("content-type"))&&p.setContentType(e),t.body){const[e,n]=_o(x,wo(ko(c)));o=Go(t.body,65536,e,n,Ko)}}sn.isString(u)||(u=u?"include":"omit"),f=new Request(n,{...d,signal:h,method:t.toUpperCase(),headers:p.normalize().toJSON(),body:o,duplex:"half",credentials:u});let i=await fetch(f);const a=Xo&&("stream"===l||"response"===l);if(Xo&&(r||a)){const e={};["status","statusText","headers"].forEach(n=>{e[n]=i[n]});const n=sn.toFiniteNumber(i.headers.get("content-length")),[t,o]=r&&_o(n,wo(ko(r),!0))||[];i=new Response(Go(i.body,65536,t,()=>{o&&o(),a&&v()},Ko),e)}l=l||"text";let s=await Qo[sn.findKey(Qo,l)||"text"](i,e);return!a&&v(),g&&g(),await new Promise((n,t)=>{ut(n,t,{data:s,headers:rt.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})})}catch(n){if(v(),n&&"TypeError"===n.name&&/fetch/i.test(n.message))throw Object.assign(new rn("Network Error",rn.ERR_NETWORK,e,f),{cause:n.cause||n});throw rn.from(n,n&&n.code,e,f)}});const ti={http:Fo,xhr:Bo,fetch:ni};sn.forEach(ti,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch(e){}Object.defineProperty(e,"adapterName",{value:n})}});const oi=e=>`- ${e}`,ii=e=>sn.isFunction(e)||null===e||!1===e;var ai=e=>{e=sn.isArray(e)?e:[e];const{length:n}=e;let t,o;const i={};for(let a=0;a<n;a++){let n;if(t=e[a],o=t,!ii(t)&&(o=ti[(n=String(t)).toLowerCase()],void 0===o))throw new rn(`Unknown adapter '${n}'`);if(o)break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,n])=>`adapter ${e} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new rn("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(oi).join("\n"):" "+oi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function si(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pt(null,e)}function ri(e){return si(e),e.headers=rt.from(e.headers),e.data=ct.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ai(e.adapter||et.adapter)(e).then(function(n){return si(e),n.data=ct.call(e,e.transformResponse,n),n.headers=rt.from(n.headers),n},function(n){return lt(n)||(si(e),n&&n.response&&(n.response.data=ct.call(e,e.transformResponse,n.response),n.response.headers=rt.from(n.response.headers))),Promise.reject(n)})}const ci={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{ci[e]=function(t){return typeof t===e||"a"+(n<1?"n ":" ")+e}});const li={};ci.transitional=function(e,n,t){function o(e,n){return"[Axios v1.7.4] Transitional option '"+e+"'"+n+(t?". "+t:"")}return(t,i,a)=>{if(!1===e)throw new rn(o(i," has been removed"+(n?" in "+n:"")),rn.ERR_DEPRECATED);return n&&!li[i]&&(li[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(t,i,a)}};var pi={assertOptions:function(e,n,t){if("object"!=typeof e)throw new rn("options must be an object",rn.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=n[a];if(s){const n=e[a],t=void 0===n||s(n,a,e);if(!0!==t)throw new rn("option "+a+" must be "+t,rn.ERR_BAD_OPTION_VALUE)}else if(!0!==t)throw new rn("Unknown option "+a,rn.ERR_BAD_OPTION)}},validators:ci};const ui=pi.validators;class di{constructor(e){this.defaults=e,this.interceptors={request:new Gn,response:new Gn}}async request(e,n){try{return await this._request(e,n)}catch(e){if(e instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;const t=n.stack?n.stack.replace(/^.+\n/,""):"";try{e.stack?t&&!String(e.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+t):e.stack=t}catch(e){}}throw e}}_request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=Wo(this.defaults,n);const{transitional:t,paramsSerializer:o,headers:i}=n;void 0!==t&&pi.assertOptions(t,{silentJSONParsing:ui.transitional(ui.boolean),forcedJSONParsing:ui.transitional(ui.boolean),clarifyTimeoutError:ui.transitional(ui.boolean)},!1),null!=o&&(sn.isFunction(o)?n.paramsSerializer={serialize:o}:pi.assertOptions(o,{encode:ui.function,serialize:ui.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&sn.merge(i.common,i[n.method]);i&&sn.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),n.headers=rt.concat(a,i);const s=[];let r=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p,u=0;if(!r){const e=[ri.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),p=e.length,l=Promise.resolve(n);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=n;for(u=0;u<p;){const e=s[u++],n=s[u++];try{d=e(d)}catch(e){n.call(this,e);break}}try{l=ri.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Mn(dt((e=Wo(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}sn.forEach(["delete","get","head","options"],function(e){di.prototype[e]=function(n,t){return this.request(Wo(t||{},{method:e,url:n,data:(t||{}).data}))}}),sn.forEach(["post","put","patch"],function(e){function n(n){return function(t,o,i){return this.request(Wo(i||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:o}))}}di.prototype[e]=n(),di.prototype[e+"Form"]=n(!0)});var mi=di;class fi{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(e){n=e});const t=this;this.promise.then(e=>{if(!t._listeners)return;let n=t._listeners.length;for(;n-- >0;)t._listeners[n](e);t._listeners=null}),this.promise.then=e=>{let n;const o=new Promise(e=>{t.subscribe(e),n=e}).then(e);return o.cancel=function(){t.unsubscribe(n)},o},e(function(e,o,i){t.reason||(t.reason=new pt(e,o,i),n(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new fi(function(n){e=n}),cancel:e}}}var hi=fi;const gi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gi).forEach(([e,n])=>{gi[n]=e});var vi=gi;const xi=function e(n){const t=new mi(n),o=he(mi.prototype.request,t);return sn.extend(o,mi.prototype,t,{allOwnKeys:!0}),sn.extend(o,t,null,{allOwnKeys:!0}),o.create=function(t){return e(Wo(n,t))},o}(et);xi.Axios=mi,xi.CanceledError=pt,xi.CancelToken=hi,xi.isCancel=lt,xi.VERSION=so,xi.toFormData=qn,xi.AxiosError=rn,xi.Cancel=xi.CanceledError,xi.all=function(e){return Promise.all(e)},xi.spread=function(e){return function(n){return e.apply(null,n)}},xi.isAxiosError=function(e){return sn.isObject(e)&&!0===e.isAxiosError},xi.mergeConfig=Wo,xi.AxiosHeaders=rt,xi.formToJSON=e=>Xn(sn.isHTMLForm(e)?new FormData(e):e),xi.getAdapter=ai,xi.HttpStatusCode=vi,xi.default=xi;var bi=xi;const{CanceledError:yi}=bi,wi=/screenshot(\-\d+?)?\.needle\.(webp|png|jpg|jpeg)/;async function _i(e,n){const t=n.baseUrl+de.jobs.post_update,o={...me(n),job_id:e.identifier,status:e.status},i={status_message:e.status_message,error:e.error,progress:e.progress},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)}).catch(e=>(console.error(e),null));return!!a&&a.ok}async function ki(e,n){const t=n.baseUrl+de.jobs.get_status,o={...me(n),job_id:e,org:n.org},i=await fetch(t,{...fe,method:"GET",headers:o}).catch(e=>(n.verbose?console.error("Failed to get job status",e):console.error("Failed to get job status",e.message),null));return i?i.ok?await i.json():(console.error("Failed to get status",i.status,await i.text()),null):null}var ji=vn(function(e){!function(){var n="input is invalid type",t="object"==typeof window,o=t?window:{};o.JS_MD5_NO_WINDOW&&(t=!1);var i=!t&&"object"==typeof self,a=!o.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?o=gn:i&&(o=self);var s,r=!o.JS_MD5_NO_COMMON_JS&&e.exports,c=!o.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],u=[0,8,16,24],d=["hex","array","digest","buffer","arrayBuffer","base64"],m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(c){var h=new ArrayBuffer(68);s=new Uint8Array(h),f=new Uint32Array(h)}var v=Array.isArray;!o.JS_MD5_NO_NODE_JS&&v||(v=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var b=ArrayBuffer.isView;!c||!o.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&b||(b=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(n);if(c&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!v(e)&&!b(e))throw new Error(n);return[e,!1]},w=function(e){return function(n){return new k(!0).update(n)[e]()}},_=function(e){return function(n,t){return new j(n,!0).update(t)[e]()}};function k(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(c){var n=new ArrayBuffer(68);this.buffer8=new Uint8Array(n),this.blocks=new Uint32Array(n)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function j(e,n){var t,o=y(e);if(e=o[0],o[1]){var i,a=[],s=e.length,r=0;for(t=0;t<s;++t)(i=e.charCodeAt(t))<128?a[r++]=i:i<2048?(a[r++]=192|i>>>6,a[r++]=128|63&i):i<55296||i>=57344?(a[r++]=224|i>>>12,a[r++]=128|i>>>6&63,a[r++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++t)),a[r++]=240|i>>>18,a[r++]=128|i>>>12&63,a[r++]=128|i>>>6&63,a[r++]=128|63&i);e=a}e.length>64&&(e=new k(!0).update(e).array());var c=[],l=[];for(t=0;t<64;++t){var p=e[t]||0;c[t]=92^p,l[t]=54^p}k.call(this,n),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=n}k.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");for(var n,t,o=y(e),i=o[1],a=0,s=(e=o[0]).length,r=this.blocks,l=this.buffer8;a<s;){if(this.hashed&&(this.hashed=!1,r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),i)if(c)for(t=this.start;a<s&&t<64;++a)(n=e.charCodeAt(a))<128?l[t++]=n:n<2048?(l[t++]=192|n>>>6,l[t++]=128|63&n):n<55296||n>=57344?(l[t++]=224|n>>>12,l[t++]=128|n>>>6&63,l[t++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),l[t++]=240|n>>>18,l[t++]=128|n>>>12&63,l[t++]=128|n>>>6&63,l[t++]=128|63&n);else for(t=this.start;a<s&&t<64;++a)(n=e.charCodeAt(a))<128?r[t>>>2]|=n<<u[3&t++]:n<2048?(r[t>>>2]|=(192|n>>>6)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]):n<55296||n>=57344?(r[t>>>2]|=(224|n>>>12)<<u[3&t++],r[t>>>2]|=(128|n>>>6&63)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),r[t>>>2]|=(240|n>>>18)<<u[3&t++],r[t>>>2]|=(128|n>>>12&63)<<u[3&t++],r[t>>>2]|=(128|n>>>6&63)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]);else if(c)for(t=this.start;a<s&&t<64;++a)l[t++]=e[a];else for(t=this.start;a<s&&t<64;++a)r[t>>>2]|=e[a]<<u[3&t++];this.lastByteIndex=t,this.bytes+=t-this.start,t>=64?(this.start=t-64,this.hash(),this.hashed=!0):this.start=t}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,n=this.lastByteIndex;e[n>>>2]|=p[3&n],n>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},k.prototype.hash=function(){var e,n,t,o,i,a,s=this.blocks;this.first?n=((n=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879|0)^(t=((t=(-271733879^(o=((o=(-1732584194^2004318071&e)+s[1]-117830708)<<12|o>>>20)+e|0)&(-271733879^e))+s[2]-1126478375)<<17|t>>>15)+o|0)&(o^e))+s[3]-1316259209)<<22|n>>>10)+t|0:(e=this.h0,n=this.h1,n=((n+=((e=((e+=((o=this.h3)^n&((t=this.h2)^o))+s[0]-680876936)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[1]-389564586)<<12|o>>>20)+e|0)&(e^n))+s[2]+606105819)<<17|t>>>15)+o|0)&(o^e))+s[3]-1044525330)<<22|n>>>10)+t|0),n=((n+=((e=((e+=(o^n&(t^o))+s[4]-176418897)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[5]+1200080426)<<12|o>>>20)+e|0)&(e^n))+s[6]-1473231341)<<17|t>>>15)+o|0)&(o^e))+s[7]-45705983)<<22|n>>>10)+t|0,n=((n+=((e=((e+=(o^n&(t^o))+s[8]+1770035416)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[9]-1958414417)<<12|o>>>20)+e|0)&(e^n))+s[10]-42063)<<17|t>>>15)+o|0)&(o^e))+s[11]-1990404162)<<22|n>>>10)+t|0,n=((n+=((e=((e+=(o^n&(t^o))+s[12]+1804603682)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[13]-40341101)<<12|o>>>20)+e|0)&(e^n))+s[14]-1502002290)<<17|t>>>15)+o|0)&(o^e))+s[15]+1236535329)<<22|n>>>10)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[1]-165796510)<<5|e>>>27)+n|0)^n))+s[6]-1069501632)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[11]+643717713)<<14|t>>>18)+o|0)^o))+s[0]-373897302)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[5]-701558691)<<5|e>>>27)+n|0)^n))+s[10]+38016083)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[15]-660478335)<<14|t>>>18)+o|0)^o))+s[4]-405537848)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[9]+568446438)<<5|e>>>27)+n|0)^n))+s[14]-1019803690)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[3]-187363961)<<14|t>>>18)+o|0)^o))+s[8]+1163531501)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[13]-1444681467)<<5|e>>>27)+n|0)^n))+s[2]-51403784)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[7]+1735328473)<<14|t>>>18)+o|0)^o))+s[12]-1926607734)<<20|n>>>12)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[5]-378558)<<4|e>>>28)+n|0))+s[8]-2022574463)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[11]+1839030562)<<16|t>>>16)+o|0))+s[14]-35309556)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[1]-1530992060)<<4|e>>>28)+n|0))+s[4]+1272893353)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[7]-155497632)<<16|t>>>16)+o|0))+s[10]-1094730640)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[13]+681279174)<<4|e>>>28)+n|0))+s[0]-358537222)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[3]-722521979)<<16|t>>>16)+o|0))+s[6]+76029189)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[9]-640364487)<<4|e>>>28)+n|0))+s[12]-421815835)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[15]+530742520)<<16|t>>>16)+o|0))+s[2]-995338651)<<23|n>>>9)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[0]-198630844)<<6|e>>>26)+n|0)|~t))+s[7]+1126891415)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[14]-1416354905)<<15|t>>>17)+o|0)|~e))+s[5]-57434055)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[12]+1700485571)<<6|e>>>26)+n|0)|~t))+s[3]-1894986606)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[10]-1051523)<<15|t>>>17)+o|0)|~e))+s[1]-2054922799)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[8]+1873313359)<<6|e>>>26)+n|0)|~t))+s[15]-30611744)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[6]-1560198380)<<15|t>>>17)+o|0)|~e))+s[13]+1309151649)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[4]-145523070)<<6|e>>>26)+n|0)|~t))+s[11]-1120210379)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[2]+718787259)<<15|t>>>17)+o|0)|~e))+s[9]-343485551)<<21|n>>>11)+t|0,this.first?(this.h0=e+1732584193|0,this.h1=n-271733879|0,this.h2=t-1732584194|0,this.h3=o+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+n|0,this.h2=this.h2+t|0,this.h3=this.h3+o|0)},k.prototype.toString=k.prototype.hex=function(){this.finalize();var e=this.h0,n=this.h1,t=this.h2,o=this.h3;return l[e>>>4&15]+l[15&e]+l[e>>>12&15]+l[e>>>8&15]+l[e>>>20&15]+l[e>>>16&15]+l[e>>>28&15]+l[e>>>24&15]+l[n>>>4&15]+l[15&n]+l[n>>>12&15]+l[n>>>8&15]+l[n>>>20&15]+l[n>>>16&15]+l[n>>>28&15]+l[n>>>24&15]+l[t>>>4&15]+l[15&t]+l[t>>>12&15]+l[t>>>8&15]+l[t>>>20&15]+l[t>>>16&15]+l[t>>>28&15]+l[t>>>24&15]+l[o>>>4&15]+l[15&o]+l[o>>>12&15]+l[o>>>8&15]+l[o>>>20&15]+l[o>>>16&15]+l[o>>>28&15]+l[o>>>24&15]},k.prototype.array=k.prototype.digest=function(){this.finalize();var e=this.h0,n=this.h1,t=this.h2,o=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&o,o>>>8&255,o>>>16&255,o>>>24&255]},k.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),n=new Uint32Array(e);return n[0]=this.h0,n[1]=this.h1,n[2]=this.h2,n[3]=this.h3,e},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.base64=function(){for(var e,n,t,o="",i=this.array(),a=0;a<15;)e=i[a++],n=i[a++],t=i[a++],o+=m[e>>>2]+m[63&(e<<4|n>>>4)]+m[63&(n<<2|t>>>6)]+m[63&t];return o+(m[(e=i[a])>>>2]+m[e<<4&63]+"==")},(j.prototype=new k).finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();k.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),k.prototype.finalize.call(this)}};var S=function(){var e=w("hex");a&&(e=function(e){var t,i=g,a=x.Buffer;return t=a.from&&!o.JS_MD5_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(o){if("string"==typeof o)return i.createHash("md5").update(o,"utf8").digest("hex");if(null==o)throw new Error(n);return o.constructor===ArrayBuffer&&(o=new Uint8Array(o)),v(o)||b(o)||o.constructor===a?i.createHash("md5").update(t(o)).digest("hex"):e(o)}}(e)),e.create=function(){return new k},e.update=function(n){return e.create().update(n)};for(var t=0;t<d.length;++t){var i=d[t];e[i]=w(i)}return e}();S.md5=S,S.md5.hmac=function(){var e=_("hex");e.create=function(e){return new j(e)},e.update=function(n,t){return e.create(n).update(t)};for(var n=0;n<d.length;++n){var t=d[n];e[t]=_(t)}return e}(),r?e.exports=S:o.md5=S}()});function Si(e,n=0){return Ci(e,n,2).getUint16(0,!0)}function $i(e,n=0){return Ci(e,n,4).getUint32(0,!0)}function Ti(e,n=0,t=e.byteLength){const o=e.slice(n,n+t);return Oi.decode(new Uint8Array(o))}function Ei(e,n,t=0){if(e.length<n.length+t)return!1;for(const[o,i]of n.entries())if(null!==i&&i!==e[o+t])return!1;return!0}function Ci(e,n,t){const o=e.slice(n,n+t);return new DataView(new Uint8Array(o).buffer)}const Oi=new TextDecoder("utf8"),Ri=[["db","application/vnd.sqlite3",[83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0]],["woff","font/woff",[119,79,70,70]],["woff2","font/woff2",[119,79,70,50]],["bmp","image/bmp",[66,77]],["gif","image/gif",[71,73,70,56,55,97]],["gif","image/gif",[71,73,70,56,57,97]],["heic","image/heic",[102,116,121,112,104,101,105],{offset:4}],["heic","image/heic",[102,116,121,112,109],{offset:4}],["ico","image/x-icon",[0,0,1,0]],["jpg","image/jpeg",[255,216,255]],["pdf","application/pdf",[37,80,68,70,45]],["png","image/png",[137,80,78,71,13,10,26,10]],["7z","application/x-7z-compressed",[55,122,188,175,39,28]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,0]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,1,0]],["rtf","application/rtf",[123,92,114,116,102,49]],["bz2","application/x-bzip2",[66,90,104]],["gz","application/gzip",[31,139]],["tar","application/x-tar",[117,115,116,97,114,0,48,48],{offset:257}],["tar","application/x-tar",[117,115,116,97,114,32,32,0],{offset:257}],["tif","image/tiff",[73,73,42,0]],["tiff","image/tiff",[77,77,0,42]],["zip","application/zip",[80,75,3,4],{exact:!1}],["zip","application/zip",[80,75,5,6]],["mp3","audio/mp3",[255,251]],["mp3","audio/mp3",[255,243]],["mp3","audio/mp3",[255,242]],["mp3","audio/mp3",[73,68,51]],["mp4","video/mp4",[102,116,121,112,105,115,111,109],{offset:4}],["avi","video/x-msvideo",[82,73,70,70,null,null,null,null,65,86,73,32]],["wav","audio/wav",[82,73,70,70,null,null,null,null,87,65,86,69]],["ogx","application/ogg",[79,103,103,83],{exact:!1},[["oga","audio/ogg",[127,70,76,65,67],{offset:28}],["ogg","audio/ogg",[1,118,111,114,98,105,115],{offset:28}],["ogm","video/ogg",[1,118,105,100,101,111,0],{offset:28}],["ogv","video/ogg",[128,116,104,101,111,114,97],{offset:28}]]],["webp","image/webp",[82,73,70,70,null,null,null,null,87,69,66,80]],["psd","image/vnd.adobe.photoshop",[56,66,80,83]],["flac","audio/x-flac",[102,76,97,67]],["wasm","application/wasm",[0,97,115,109]],["deb","application/x-deb",[33,60,97,114,99,104,62,10]],["exe","application/x-msdownload",[77,90]],["exe","application/x-msdownload",[90,77]],["class","application/java-vm",[202,254,186,190]]];function zi(e){return e.flatMap(([e,n,t,o={},i=[]])=>[[e,n,t,o],...i])}function Ni(e,n){const t=Si(e,26),o=Ti(e,30,t),[i]=o.split("/"),a=o.endsWith(".xml");return"META-INF"===i?{ext:"jar",mime:"application/java-archive"}:"ppt"===i&&a?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:"word"===i&&a?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:"xl"===i&&a?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:"mimetype"===i?function(e,n){const t=$i(e,18),o=$i(e,22),i=Si(e,28);if(t===o){const o=Ti(e,30+n+i,t);if("application/vnd.oasis.opendocument.presentation"===o)return{ext:"odp",mime:o};if("application/vnd.oasis.opendocument.spreadsheet"===o)return{ext:"ods",mime:o};if("application/vnd.oasis.opendocument.text"===o)return{ext:"odt",mime:o};if("application/epub+zip"===o)return{ext:"epub",mime:o}}}(e,t)??n:n}const Ai=function(e){return zi(e).map(([e,n,t,{offset:o=0}={}])=>t.length+o).reduce((e,n)=>n>e?n:e,0)}(Ri);function Li(e,n){for(const[t,o,i,{exact:a=!0,offset:s=0}={},r=[]]of n)if(Ei(e,i,s)){if("zip"===t&&!a)return Ni(e.buffer,{ext:t,mime:o});if(!a&&r.length)for(const[n,t,o,{offset:i=0}={}]of r)if(Ei(e,o,i))return{ext:n,mime:t};return{ext:t,mime:o}}}function Fi(e,n,t=void 0){const o=function(e,n,t){let o=0;for(;;){let n=e.indexOf("\\",o);if(-1===n)break;o=n+1,e=e.replace("\\","/")}return e}(e).split("/").pop()||e,i=(null==t?void 0:t.type)||Ii(n,e),a=new File([n],o,{type:i});return a.path=e,a}function Ui(e){const n=ji.md5.create();return n.update(e),n.base64()}function Ii(e,n=void 0){const t=function(e,{extra:n=!1,hint:t}={}){const o=new Uint8Array(e.slice(0,Ai));if(t){const e=function(e,{ext:n,mime:t}){return n||t?zi(e).filter(e=>e[0]===n||e[1]===t):[]}(Ri,t);if(e.length>0){const n=Li(o,e);if(void 0!==n)return n}}return Li(o,Ri)||(n?function(e){return function(e){try{const n=Ti(e);if(!function(e){for(let n=0;n<e.length;n++)try{const t=e.charCodeAt(n);if(65533===t||t<=8)return!1}catch{return!1}return!0}(n))return;try{return JSON.parse(n),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(t)return t.mime;const o=new Uint8Array(e).subarray(0,4);let i="";for(var a=0;a<o.length;a++)i+=o[a].toString(16);let s="unknown";switch(i){case"676c5446":s="model/gltf-binary";break;case"89504e47":s="image/png";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;default:s="unknown"}return"unknown"===s&&"string"==typeof n&&(s=function(e){const n=e.toLowerCase();let t="";return n.endsWith(".html")||n.endsWith(".html.gz")||n.endsWith(".html.br")?t="text/html":n.endsWith(".js")||n.endsWith(".js.gz")||n.endsWith(".js.br")||n.endsWith(".mjs")||n.endsWith(".mjs.gz")||n.endsWith(".mjs.br")||n.endsWith(".cjs")||n.endsWith(".cjs.gz")||n.endsWith(".cjs.br")?t="application/javascript":n.endsWith(".wasm")?t="application/wasm":n.endsWith(".css")||n.endsWith(".css.gz")||n.endsWith(".css.br")?t="text/css":n.endsWith(".json")?t="application/json":n.endsWith(".txt")?t="text/plain":n.endsWith(".md")?t="text/markdown":n.endsWith(".yaml")||n.endsWith(".yml")?t="application/yaml":n.endsWith(".bin")?t="application/octet-stream":n.endsWith(".png")?t="image/png":n.endsWith(".jpg")||n.endsWith(".jpeg")?t="image/jpeg":n.endsWith(".gif")?t="image/gif":n.endsWith(".webp")?t="image/webp":n.endsWith(".avif")?t="image/avif":n.endsWith(".bmp")?t="image/bmp":n.endsWith(".tiff")||n.endsWith(".tif")?t="image/tiff":n.endsWith(".ico")?t="image/x-icon":n.endsWith(".svg")?t="image/svg+xml":n.endsWith(".xml")?t="application/xml":n.endsWith(".hdr")?t="image/vnd.radiance":n.endsWith(".exr")?t="image/x-exr":n.endsWith(".ktx2")?t="image/ktx2":n.endsWith(".ktx")?t="image/ktx":n.endsWith(".dds")?t="image/vnd-ms.dds":n.endsWith(".ogg")?t="audio/ogg":n.endsWith(".mp3")?t="audio/mpeg":n.endsWith(".wav")?t="audio/wave":n.endsWith(".flac")?t="audio/flac":n.endsWith(".m4a")?t="audio/mp4":n.endsWith(".aac")?t="audio/aac":n.endsWith(".mp4")?t="video/mp4":n.endsWith(".webm")?t="video/webm":n.endsWith(".mov")?t="video/quicktime":n.endsWith(".woff2")?t="font/woff2":n.endsWith(".woff")?t="font/woff":n.endsWith(".ttf")?t="font/ttf":n.endsWith(".otf")?t="font/otf":n.endsWith(".zip")?t="application/zip":n.endsWith(".glb")?t="model/gltf-binary":n.endsWith(".gltf")?t="model/gltf+json":n.endsWith(".vrm")?t="model/gltf-binary":n.endsWith(".usdz")?t="model/vnd.usdz+zip":n.endsWith(".usda")?t="model/vnd.usd-usda":n.endsWith(".usdc")?t="model/vnd.usd-usdc":n.endsWith(".usd")?t="model/vnd.usd-usd":n.endsWith(".mtl")?t="model/mtl":n.endsWith(".obj")?t="model/obj":n.endsWith(".fbx")?t="model/vnd.autodesk.fbx":n.endsWith(".stl")?t="model/stl":n.endsWith(".mtlx")?t="application/materialx+xml":n.endsWith(".ply")?t="model/ply":n.endsWith(".dae")?t="model/vnd.collada+xml":n.endsWith(".3mf")?t="model/3mf":(n.endsWith(".splat")||n.endsWith(".spz"))&&(t="application/octet-stream"),t}(n)),s}function qi(e,n){const t=e.toLowerCase();return"application/gzip"===n||"application/brotli"===n?(t.endsWith(".html.gz")||t.endsWith(".html.br")?(n="text/html",e=e.substring(0,e.length-3)):t.endsWith(".js.gz")||t.endsWith(".js.br")||t.endsWith(".mjs.gz")||t.endsWith(".mjs.br")||t.endsWith(".cjs.gz")||t.endsWith(".cjs.br")?(n="application/javascript",e=e.substring(0,e.length-3)):t.endsWith(".css.gz")||t.endsWith(".css.br")?(n="text/css",e=e.substring(0,e.length-3)):t.endsWith(".json.gz")||t.endsWith(".json.br")?(n="text/json",e=e.substring(0,e.length-3)):t.endsWith(".txt.gz")||t.endsWith(".txt.br")?(n="text/plain",e=e.substring(0,e.length-3)):t.endsWith(".wasm.gz")||t.endsWith(".wasm.br")?(n="application/wasm",e=e.substring(0,e.length-3)):t.endsWith(".bin.gz")||t.endsWith(".bin.br")?(n="application/octet-stream",e=e.substring(0,e.length-3)):t.endsWith(".png.gz")||t.endsWith(".png.br")?(n="image/png",e=e.substring(0,e.length-3)):t.endsWith(".jpg.gz")||t.endsWith(".jpg.br")||t.endsWith(".jpeg.gz")||t.endsWith(".jpeg.br")?(n="image/jpeg",e=e.substring(0,e.length-3)):t.endsWith(".gif.gz")||t.endsWith(".gif.br")?(n="image/gif",e=e.substring(0,e.length-3)):t.endsWith(".webp.gz")||t.endsWith(".webp.br")?(n="image/webp",e=e.substring(0,e.length-3)):t.endsWith(".svg.gz")||t.endsWith(".svg.br")?(n="image/svg+xml",e=e.substring(0,e.length-3)):t.endsWith(".xml.gz")||t.endsWith(".xml.br")?(n="application/xml",e=e.substring(0,e.length-3)):t.endsWith(".ico.gz")||t.endsWith(".ico.br")?(n="image/x-icon",e=e.substring(0,e.length-3)):t.endsWith(".avif.gz")||t.endsWith(".avif.br")?(n="image/avif",e=e.substring(0,e.length-3)):t.endsWith(".bmp.gz")||t.endsWith(".bmp.br")?(n="image/bmp",e=e.substring(0,e.length-3)):t.endsWith(".tiff.gz")||t.endsWith(".tiff.br")||t.endsWith(".tif.gz")||t.endsWith(".tif.br")?(n="image/tiff",e=e.substring(0,e.length-3)):t.endsWith(".hdr.gz")||t.endsWith(".hdr.br")?(n="image/vnd.radiance",e=e.substring(0,e.length-3)):t.endsWith(".exr.gz")||t.endsWith(".exr.br")?(n="image/x-exr",e=e.substring(0,e.length-3)):t.endsWith(".ktx2.gz")||t.endsWith(".ktx2.br")?(n="image/ktx2",e=e.substring(0,e.length-3)):t.endsWith(".ktx.gz")||t.endsWith(".ktx.br")?(n="image/ktx",e=e.substring(0,e.length-3)):t.endsWith(".dds.gz")||t.endsWith(".dds.br")?(n="image/vnd-ms.dds",e=e.substring(0,e.length-3)):t.endsWith(".webm.gz")||t.endsWith(".webm.br")?(n="video/webm",e=e.substring(0,e.length-3)):t.endsWith(".mp4.gz")||t.endsWith(".mp4.br")?(n="video/mp4",e=e.substring(0,e.length-3)):t.endsWith(".mov.gz")||t.endsWith(".mov.br")?(n="video/quicktime",e=e.substring(0,e.length-3)):t.endsWith(".mp3.gz")||t.endsWith(".mp3.br")?(n="audio/mpeg",e=e.substring(0,e.length-3)):t.endsWith(".wav.gz")||t.endsWith(".wav.br")?(n="audio/wave",e=e.substring(0,e.length-3)):t.endsWith(".ogg.gz")||t.endsWith(".ogg.br")?(n="audio/ogg",e=e.substring(0,e.length-3)):t.endsWith(".flac.gz")||t.endsWith(".flac.br")?(n="audio/flac",e=e.substring(0,e.length-3)):t.endsWith(".m4a.gz")||t.endsWith(".m4a.br")?(n="audio/mp4",e=e.substring(0,e.length-3)):t.endsWith(".aac.gz")||t.endsWith(".aac.br")?(n="audio/aac",e=e.substring(0,e.length-3)):t.endsWith(".woff2.gz")||t.endsWith(".woff2.br")?(n="font/woff2",e=e.substring(0,e.length-3)):t.endsWith(".woff.gz")||t.endsWith(".woff.br")?(n="font/woff",e=e.substring(0,e.length-3)):t.endsWith(".ttf.gz")||t.endsWith(".ttf.br")?(n="font/ttf",e=e.substring(0,e.length-3)):t.endsWith(".otf.gz")||t.endsWith(".otf.br")?(n="font/otf",e=e.substring(0,e.length-3)):t.endsWith(".md.gz")||t.endsWith(".md.br")?(n="text/markdown",e=e.substring(0,e.length-3)):t.endsWith(".yaml.gz")||t.endsWith(".yaml.br")||t.endsWith(".yml.gz")||t.endsWith(".yml.br")?(n="application/yaml",e=e.substring(0,e.length-3)):t.endsWith(".zip.gz")||t.endsWith(".zip.br")?(n="application/zip",e=e.substring(0,e.length-3)):t.endsWith(".glb.gz")||t.endsWith(".glb.br")?(n="model/gltf-binary",e=e.substring(0,e.length-3)):t.endsWith(".gltf.gz")||t.endsWith(".gltf.br")?(n="model/gltf+json",e=e.substring(0,e.length-3)):t.endsWith(".vrm.gz")||t.endsWith(".vrm.br")?(n="model/gltf-binary",e=e.substring(0,e.length-3)):t.endsWith(".usdz.gz")||t.endsWith(".usdz.br")?(n="model/vnd.usdz+zip",e=e.substring(0,e.length-3)):t.endsWith(".usda.gz")||t.endsWith(".usda.br")?(n="model/vnd.usd-usda",e=e.substring(0,e.length-3)):t.endsWith(".usdc.gz")||t.endsWith(".usdc.br")?(n="model/vnd.usd-usdc",e=e.substring(0,e.length-3)):t.endsWith(".usd.gz")||t.endsWith(".usd.br")?(n="model/vnd.usd-usd",e=e.substring(0,e.length-3)):t.endsWith(".obj.gz")||t.endsWith(".obj.br")?(n="model/obj",e=e.substring(0,e.length-3)):t.endsWith(".mtl.gz")||t.endsWith(".mtl.br")?(n="model/mtl",e=e.substring(0,e.length-3)):t.endsWith(".stl.gz")||t.endsWith(".stl.br")?(n="model/stl",e=e.substring(0,e.length-3)):t.endsWith(".mtlx.gz")||t.endsWith(".mtlx.br")?(n="application/materialx+xml",e=e.substring(0,e.length-3)):t.endsWith(".ply.gz")||t.endsWith(".ply.br")?(n="model/ply",e=e.substring(0,e.length-3)):t.endsWith(".dae.gz")||t.endsWith(".dae.br")?(n="model/vnd.collada+xml",e=e.substring(0,e.length-3)):t.endsWith(".3mf.gz")||t.endsWith(".3mf.br")?(n="model/3mf",e=e.substring(0,e.length-3)):(t.endsWith(".splat.gz")||t.endsWith(".splat.br")||t.endsWith(".spz.gz")||t.endsWith(".spz.br"))&&(n="application/octet-stream",e=e.substring(0,e.length-3)),{filename:e,mimetype:n}):null}function Wi(e,n=void 0,t=!0){const o=Math.abs(e);if(o>=1099511627776){let o=t?" TB":"";return(e/1099511627776).toFixed(void 0===n?2:n)+o}if(o>=1073741824){let o=t?" GB":"";return(e/1073741824).toFixed(void 0===n?2:n)+o}if(o>=1048576){let o=t?" MB":"";return(e/1048576).toFixed(void 0===n?1:n)+o}if(o>=1024){let o=t?" KB":"";return(e/1024).toFixed(void 0===n?0:n)+o}let i=t?" B":"";return e.toFixed(0)+i}function Pi(e){return e.split("/").reduce((e,n)=>("."===n||(".."===n?e.pop():null!=n&&n.length&&e.push(n)),e),[]).join("/")}function Bi(e,n){let t=n;for(;t<e.length&&0!==e[t];)t++;return t>=e.length?null:new TextDecoder("latin1").decode(e.subarray(n,t))}async function Di(e){return new Promise(n=>setTimeout(n,e))}function Mi(e,n,t=void 0){e instanceof Date&&(e=e.getTime()),n instanceof Date&&(n=n.getTime());let o=n-e,i=o>0;const a=!1!==(null==t?void 0:t.prefix),s=!1!==(null==t?void 0:t.suffix);let r="",c="";o<0&&(o=-o);const l=Math.floor(o/1e3),p=Math.floor(l/60),u=Math.floor(p/60),d=Math.floor(u/24);if(null!=(null==t?void 0:t.limitInDays)&&d>=t.limitInDays)return a&&(r="on "),`${r}${new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}${c}`;r=a?i?"":"in ":"",c=s&&i?" ago":"";const m=Math.floor(d/30),f=Math.floor(m/12);return 1===f?`${r}1 year${c}`:f>1?`${r}${Math.floor(f)} years${c}`:1===m?`${r}1 month${c}`:m>1?`${r}${Math.floor(m)} months${c}`:1===d?i&&null!=t&&t.allowSimple?"yesterday":`${r}1 day${c}`:d>1?`${r}${Math.floor(d)} days${c}`:1===u?`${r}1 hour${c}`:u>1?`${r}${Math.floor(u)} hours${c}`:1===p?`${r}1 minute${c}`:p>1?`${r}${Math.floor(p)} minutes${c}`:null!=t&&t.allowSimple&&l<10?"just now":`${r}${l.toFixed(0)} seconds${c}`}const Gi=/^image_(?<image_lod>\d+)_|^mesh_lod_(?<mesh_lod>\d+)_/;function Ji(e){return e.includes("\\u")?JSON.parse(`"${e}"`):decodeURIComponent(e)}function Hi(e){let n=null,t="";const o=e.filter(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());if(1===o.length)return n=o[0],n;const i=e.filter(e=>e.name.toLowerCase().endsWith(".html")||e.name.toLowerCase().endsWith(".htm")||e.name.toLowerCase().endsWith(".html.gz")||e.name.toLowerCase().endsWith(".html.br"));if(1===i.length)return i[0];if(i.length>1){const e=new Map;for(const n of i){const t=n.path.split("/");let o=e.get(t.length);o||(o=[],e.set(t.length,o)),o.push(n)}const o=Array.from(e.keys()).sort((e,n)=>e-n);if(o.length>0)for(const t of o){const o=e.get(t);if(!o)continue;const i=o.find(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());return i?(n=i,n):(n=o[0],n)}return t="Invalid upload: Multiple HTML files found but could not determine root.",console.error(t,i.map(e=>e.path||e.name)),{error:t}}const a=e.filter(e=>e.name.toLowerCase().endsWith(".glb")||e.name.toLowerCase().endsWith(".gltf")||e.name.toLowerCase().endsWith(".vrm"));if(a.length>1){const e=function(e){const n=new Array,t=/(mesh_lod|image)_\d_(.{1,50})/;for(const o of e){if(t.test(o.name))continue;const e=o.name.toLowerCase();(e.endsWith(".gltf")||e.endsWith(".vrm")||e.endsWith(".glb"))&&n.push(o)}return 1==n.length?n[0]:Yi(n)}(a);return e?(n=e,n):(t="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(t,a.map(e=>e.path||e.name)),{error:t})}if(1===a.length)return n=a[0],n;const s=e.filter(e=>e.name.toLowerCase().endsWith(".usdz")||e.name.toLowerCase().endsWith(".usd")||e.name.toLowerCase().endsWith(".usda")||e.name.toLowerCase().endsWith(".usdc"));s.length>=1&&(n=Yi(s));const r=e.filter(e=>e.name.toLowerCase().endsWith(".fbx"));if(r.length>1)return t="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(t,r),{error:t};if(1===r.length)return n=r[0],n;const c=e.filter(e=>e.name.toLowerCase().endsWith(".obj"));if(c.length>1)return t="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(t,c),{error:t};if(1===c.length)return n=c[0],n;const l=e.filter(e=>e.name.toLowerCase().endsWith(".stl"));if(l.length>1)return t="Invalid upload: Multiple stl files found. This is currently not supported.",console.error(t,l),{error:t};if(1===l.length)return n=l[0],n;if(1===e.length&&!e[0].arrayBuffer&&e[0].path.toLowerCase().startsWith("http"))return n=e[0],n;const p=e.filter(e=>e.name.toLowerCase().endsWith("package.json"));if(1===p.length)return n=p[0],n;if(p.length>1)return t="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(t,p),{error:t};const u=e.filter(e=>e.name.toLowerCase().endsWith(".mtlx"));if(u.length>1)return t="Invalid upload: Multiple mtlx files found. This is currently not supported.",console.error(t,u),{error:t};if(1===u.length)return n=u[0],n;const d=e.filter(e=>{const n=e.name.toLowerCase();return n.endsWith(".exr")||n.endsWith(".hdr")||n.endsWith(".hdri")});return d.length>1?(t="Invalid upload: Multiple HDRI files found. Upload them as separate content items.",console.error(t,d.map(e=>e.path||e.name)),{error:t}):1===d.length?(n=d[0],n):n||{error:"No supported file to upload found..."}}const Ki=new Set(["glb","gltf","vrm"]),Vi=new Set(["fbx","obj","stl","usd","usda","usdz"]);function Yi(e){let n=-1,t=Infinity;for(let o=0;o<e.length;o++){const i=e[o];i.path.split("/").length<t&&(t=i.path.split("/").length,n=o)}return n<0?null:e[n]}class Zi{constructor(e,n){this.totalFiles=e,this.estimatedTotalSize=n,this.uploadedSize=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime,this.lastUploadedSize=0,this.speedEMA=null,this.emaFactor=.1,this.smoothedRemainingTime=null,this.recentSpeeds=new Array,this.maxRecentSpeeds=20,this.initialEstimateThreshold=.05}updateProgress(e){const n=Date.now(),t=(n-this.lastUpdateTime)/1e3,o=e-this.lastUploadedSize;if(this.uploadedSize=e,t>0&&o>0){this.recentSpeeds.push(o/t),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();const e=this.recentSpeeds.reduce((e,n)=>e+n,0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?e:this.emaFactor*e+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=n,this.lastUploadedSize=e;const i=this.uploadedSize/this.estimatedTotalSize,a=(n-this.startTime)/1e3,s=this.speedEMA&&this.speedEMA>0?this.speedEMA:this.uploadedSize/a;let r;if(r=s>0?(this.estimatedTotalSize-this.uploadedSize)/s:Infinity,i>=this.initialEstimateThreshold)if(null===this.smoothedRemainingTime)this.smoothedRemainingTime=r;else{const e=.1;this.smoothedRemainingTime=(1-e)*this.smoothedRemainingTime+e*r}else this.smoothedRemainingTime=a/i-a;return this.smoothedRemainingTime=Math.max(this.smoothedRemainingTime,(this.estimatedTotalSize-this.uploadedSize)/s),{progress:100*i,estimatedTimeRemaining:Math.round(this.smoothedRemainingTime),estimatedTimeRemainingString:this.smoothedRemainingTime>3?this.__formatTime(this.smoothedRemainingTime):"few seconds"}}__formatTime(e){if(!isFinite(e)||e>86400)return"Calculating...";if(e<60)return`${Math.round(e)}sec`;const n=Math.floor(e/60);return n<60?`${n}min`:`${Math.floor(n/60)}h ${n%60}min`}}async function Xi(e){const n=await import("./pako.esm-01431bd2.js"),t=await e.arrayBuffer(),o=n.gzip(new Uint8Array(t)).buffer.slice(0);if(o.byteLength>51200&&o.byteLength>=t.byteLength){if(t.byteLength>0)return null}else if(!(o instanceof ArrayBuffer))return console.error("gzipCompress: Invalid ArrayBuffer"),{error:`Gzip compressing failed for "${e.name}" (unexpected result)`};return Fi(`${"path"in e?e.path:e.name}.gz`,o,{type:"application/gzip"})}async function Qi(e,n,t=void 0){const o=async function(e,n,t){var o,i,a,s,r,c,l,p,u,d,m,f,h,g,v;const x=n.files.filter(e=>{const n=e.name||"";return!n||n.endsWith("/")?(console.warn(`[upload] Skipping directory entry: "${n}"`),!1):0!==e.size||(console.warn(`[upload] Skipping zero-byte file: "${n}"`),!1)});n.files=x;const b=(null==(o=t)?void 0:o.loglevel)||"none";if(!x.length)return"none"!=b&&console.error("No files to upload"),{success:!1,error:"No files to upload"};if(!n.entrypoint){const e=Hi(x);if(null==e)return{success:!1,error:"No entrypoint file found"};if("object"==typeof e&&"error"in e)return{success:!1,error:e.error};"info"===b&&console.log("Entrypoint: "+e.name),n.entrypoint=e}n.entrypoint&&!x.includes(n.entrypoint)&&x.push(n.entrypoint);const y=await async function(e){if(e.length>5e3)return{success:!1,error:"Too many files. Maximum filecount is 5000"};let n=0,t=0,o=0,i=0;for(let c=e.length-1;c>=0;c--){const l=e[c];if(n+=l.size,n>1073741824)return{success:!1,error:`Total file size exceeds limit of ${1024..toFixed(0)} MB. Please reduce the size of your upload.`};const p=l.name.toLocaleLowerCase();if(".ds_store"!==p){if(p.endsWith(".gltf")?o++:p.endsWith(".glb")?(r=p)&&Gi.test(r)||i++:p.endsWith(".vrm")&&t++,p.endsWith(".gltf")){var a;o+=1,console.log(`Found glTF file ${l.name}. Will check if all dependencies are available\n`,e);const n=await l.text(),t=n.matchAll(/"uri"\s*:\s*"(?<value>.*?)"/g);if(!t)continue;const i=JSON.parse(n);if("2.0"!==i.asset.version)return console.warn("⚠ glTF version is not 2.0. This is currently not supported."),{success:!1,error:`glTF version ${i.asset.version} is unsupported.Please use glTF 2.0.`};const r=null==(a=l.path)?void 0:a.split("/"),c=r.splice(0,r.length-1).join("/");for(const n of t){var s;const t=null==(s=n.groups)?void 0:s.value;if(t){let n=!1;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("www.")){console.log(`✅ Found remote dependency ${t} `);break}if(t.startsWith("data:")){console.log(`✅ Found embedded dependency ${t} `);break}{const o=Pi(`${c}/${Ji(t)}`);console.log('❓ Check if local dependency exists "'+o+'"');for(const t of e){if(t.webkitRelativePath===o||t.name==o){n=!0,console.log(`✅ Found dependency in name or webkit: ${t.name} || ${t.webkitRelativePath} `);break}if(t.path===o){n=!0,console.log(`✅ Found dependency in path: ${t.path} `);break}}}if(!n)return console.warn("⚠ Missing dependency "+t,c),{success:!1,error:"Missing resource: "+t}}}}}else e.splice(c,1)}var r;return{success:!0,vrm_count:t,gltf_count:o,glb_count:i}}(x);if("error"in y)return{success:!1,error:y.error||"Failed to validate files"};if(null!=(i=n.entrypoint)&&i.name.endsWith(".htm")||null!=(a=n.entrypoint)&&a.name.endsWith(".html")||null!=(s=n.entrypoint)&&s.name.endsWith(".html.gz")||null!=(r=n.entrypoint)&&r.name.endsWith(".html.br"))t||(t={}),t.type="deployment";else if(y.vrm_count>10)return{success:!1,error:"Multiple model files found - this is not supported for asset uploads. Please upload a single model file only."};if(n.raw)"none"!=b&&console.warn("Raw upload - skipping gzip compression of files");else for(let e=0;e<x.length;e++){const o=x[e],i=o.name.toLowerCase();if(i.endsWith(".html")||i.endsWith(".js")||i.endsWith(".css")){var w,_;"none"!==(null==(w=t)?void 0:w.loglevel)&&console.log(`gZip compressing file: ${o.name}`);const i=await Xi(o).catch(e=>({error:`Error compressing ${o.name}: ${e.message}`}));if(null===i){var k;"none"!==(null==(k=t)?void 0:k.loglevel)&&console.error(`Did not compress file: ${o.name}`);continue}if("error"in i)return{success:!1,error:i.error,status:500};if(!i)return{success:!1,error:`Failed to compress ${o.name}`,status:500};const a=n.entrypoint===o;x[e]=i,a&&(n.entrypoint=i),"none"!==(null==(_=t)?void 0:_.loglevel)&&console.log(`gZip compressed file: ${o.name} ${a?"(entrypoint)":""}`)}}x.sort((e,n)=>e.name.includes(".needle")&&!n.name.includes(".needle")?-1:!e.name.includes(".needle")&&n.name.includes(".needle")?1:0);const{baseUrl:j,authToken:S}=e,$="Bearer "+S,T={...me(e),triggered_by:n.triggered_by,filename:`${encodeURIComponent(n.entrypoint.name)}`,"total-files":x.length.toString(),"total-files-size":x.reduce((e,n)=>e+n.size,0).toString()};null!=(c=t)&&c.content_id&&(T.content_id=t.content_id),null!=(l=t)&&l.type&&(T.type=t.type),null!=(p=t)&&p.name&&(T.name=encodeURIComponent(t.name)),null!=(u=t)&&u.parent_job_id&&(T.parent_job_id=t.parent_job_id);const E={entrypoint:(null==(d=n.entrypoint)?void 0:d.path)||(null==(m=n.entrypoint)?void 0:m.name),files:[]};null!=(f=t)&&f.content_type&&(E.content_type=t.content_type);const C={outputs:[E]},O=[];for(let e=0;e<x.length;e++){var R,z,N;const n=x[e];let o=n.path||n.webkitRelativePath||n.name;if(null!=(R=o)&&R.includes(":"))throw new Error(`Invalid filename: ${o}`);let i=await n.arrayBuffer();const a=n.size;let s=n.type;if(null!=(z=s)&&z.length&&"unknown"!==s.toLowerCase()||(s=Ii(i,o)),"deployment"===(null==(N=t)?void 0:N.type)){const e=qi(o,s);e&&(o=e.filename,s=e.mimetype)}const r=Ui(i);O[e]=i,E.files[e]={filename:o,content_type:s,content_length:a,content_md5:r}}try{const e=await async function(e){var n,t,o,i,a;if(!e||"function"!=typeof e.slice||"number"!=typeof e.size)return null;const s=Math.min(e.size,65536);if(s<=0)return null;let r;try{const n=await e.slice(0,s).arrayBuffer();r=new Uint8Array(n)}catch{return null}return null!=(n=null!=(t=null!=(o=null!=(i=null!=(a=function(e){if(e.length<24)return null;if(137!==e[0]||80!==e[1]||78!==e[2]||71!==e[3])return null;if(13!==e[4]||10!==e[5]||26!==e[6]||10!==e[7])return null;const n=new DataView(e.buffer,e.byteOffset),t=n.getUint32(16,!1),o=n.getUint32(20,!1);return t&&o?{width:t,height:o}:null}(r))?a:function(e){if(e.length<28)return null;const n=[171,75,84,88,32,50,48,187,13,10,26,10];for(let t=0;t<n.length;t++)if(e[t]!==n[t])return null;const t=new DataView(e.buffer,e.byteOffset),o=t.getUint32(20,!0),i=t.getUint32(24,!0);return o&&i?{width:o,height:i}:null}(r))?i:function(e){if(e.length<16)return null;if(118!==e[0]||47!==e[1]||49!==e[2]||1!==e[3])return null;const n=new DataView(e.buffer,e.byteOffset);let t=8;for(;t<e.length;){const o=Bi(e,t);if(null===o)return null;if(0===o.length)return null;t+=o.length+1;const i=Bi(e,t);if(null===i)return null;if(t+=i.length+1,t+4>e.length)return null;const a=n.getInt32(t,!0);if(t+=4,a<0||t+a>e.length)return null;if("dataWindow"===o&&"box2i"===i&&16===a){const e=n.getInt32(t,!0),o=n.getInt32(t+4,!0),i=n.getInt32(t+8,!0)-e+1,a=n.getInt32(t+12,!0)-o+1;return i<=0||a<=0?null:{width:i,height:a}}t+=a}return null}(r))?o:function(e){if(e.length<30)return null;if(82!==e[0]||73!==e[1]||70!==e[2]||70!==e[3])return null;if(87!==e[8]||69!==e[9]||66!==e[10]||80!==e[11])return null;const n=String.fromCharCode(e[12],e[13],e[14],e[15]);if("VP8 "===n){const n=16383&(e[26]|e[27]<<8),t=16383&(e[28]|e[29]<<8);return n&&t?{width:n,height:t}:null}return"VP8L"===n?47!==e[20]?null:{width:1+(16383&(e[21]|e[22]<<8)),height:1+(16383&(e[22]>>6|e[23]<<2|(15&e[24])<<10))}:"VP8X"===n?{width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}:null}(r))?t:function(e){if(e.length<4)return null;if(255!==e[0]||216!==e[1])return null;let n=2;for(;n<e.length-8;){for(;n<e.length&&255===e[n];)n++;if(n>=e.length)return null;const t=e[n++];if(1===t||t>=208&&t<=217)continue;if(n+2>e.length)return null;const o=e[n]<<8|e[n+1];if(o<2||n+o>e.length)return null;if(t>=192&&t<=207&&196!==t&&200!==t&&204!==t){if(n+7>e.length)return null;const t=e[n+3]<<8|e[n+4],o=e[n+5]<<8|e[n+6];return o&&t?{width:o,height:t}:null}n+=o}return null}(r))?n:function(e){if(e.length<10)return null;if(35!==e[0]||63!==e[1])return null;const n=new TextDecoder("latin1").decode(e.subarray(0,Math.min(e.length,4096))).match(/[+-]Y\s+(\d+)\s+[+-]X\s+(\d+)/);if(!n)return null;const t=parseInt(n[1],10),o=parseInt(n[2],10);return o&&t?{width:o,height:t}:null}(r)}(n.entrypoint);e&&(E.width=e.width,E.height=e.height)}catch(e){"debug"===b&&console.warn("readImageResolution failed; uploading without dimensions",e)}const A=await fetch(j+de.upload.request,{...fe,method:"POST",headers:T,body:JSON.stringify(C)}).catch(e=>"fetch failed"==e.message||"Failed to fetch"==e.message?`Network error. Make sure you are connected to the internet and ${j} is reachable.`:(console.error("Failed to begin upload\n",e),null));if(null===A||"string"==typeof A)return{success:!1,error:A||"Failed to begin upload"};if(!A.ok){const e=await A.text();if(e.startsWith("{")){const n=JSON.parse(e);if("error"in n)return{success:!1,status:A.status,error:n.error}}return"none"!=b&&console.error("Failed to begin upload\n",A.status,e),{success:!1,status:A.status,error:`${e}`}}const L=await A.json();"debug"===b&&console.debug("BeginResponse",L);const F=x.reduce((e,n)=>e+n.size,0);var U;if("exists"===L.type)return"none"!=b&&console.log("Upload already exists",L.id),null!=(U=t)&&U.onStart&&t.onStart(L.id,L.content_id),{success:!0,uploadSkipped:!0,id:L.id,type:L.job_type,content_id:L.content_id,filesUploaded:x.length,totalSize:F,url:L.url};const I=n.entrypoint.webkitRelativePath||n.entrypoint.name;let q=0;null==(h=t)||null==(h=h.abort)||h.addEventListener("abort",async()=>{console.log("Upload aborted: Cancelling upload"),await fetch(j+de.upload.cancel,{...fe,method:"POST",headers:{authorization:$,id:L.id}})});let W=!1,P=Date.now();function B(n,t,o=!1){if(!o&&Date.now()-P<1e3)return!1;if(W&&"completed"!==t)return void("none"!=b&&console.warn("Invalid status update..."));P=Date.now();const i=Math.floor(q/F*100);return"debug"===b&&console.log("SET STATUS: "+t,n,i),_i({identifier:L.id,status:t,status_message:n,progress:i},e),!0}null!=(g=t)&&g.onStart&&t.onStart(L.id,L.content_id);const D=Date.now(),M=new Zi(x.length,F/1024/1024),G=new Array;let J=!1;const H=[...x],K=x.length;for(let o=0;o<H.length;o++){var V;if(null!=(V=t)&&null!=(V=V.abort)&&V.aborted){console.debug("Upload aborted");break}if(J){console.debug("Upload failed");break}if(G.length<10){console.debug(`Uploading file ${o}/${x.length}: ${x[o].name}`);let i=0,a=0;const s=E.files[o],r=s.filename,c=O[o],l=s.content_length,p=s.content_type,u=x[o],d=u.name.endsWith(".gz")?"gzip":u.name.endsWith(".br")?"br":void 0,m=ea({uploadId:L.id,uploadRequestPUTUrl:L.request_put_url,entrypointPath:I,file:x[o],fileName:r,fileMd5:s.content_md5,fileBuffer:c,fileType:p,content_encoding:d,fileSize:l,fileIndex:o,fileNumber:o+1,fileCount:K,loglevel:b,experimental:n.experimental,args:e,options:t,onProgress:e=>{var n;const s=e.progress||0;i=x[o].size*s;const c=i-a;if(a=i,q+=c,null!=(n=t)&&n.progress){const e=q/F,n=x.length,i=x[o].size,a=(Date.now()-D)/1e3,c=M.updateProgress(q/1024/1024);t.progress({uploadedBytes:q,totalBytes:F,progress01:e,fileName:x[o].name,fileSize:i,fileProgress01:s,fileIndex:o,totalFiles:n,estimatedTimeLeftDisplay:c.estimatedTimeRemainingString,estimatedTimeLeft:c.estimatedTimeRemaining,elapsedTime:a}),B(`Uploading file ${o+1}/${n} (${r}): ${(100*s).toFixed(0)}% of ${Wi(F)}. Finished in approx. ${c.estimatedTimeRemainingString}`,"running",!1)}}}).then(e=>{if(!0!==e)return e;for(let e=G.length-1;e>=0;e--)G[e]===m&&G.splice(e,1);B(`Uploaded ${Wi(q)+" of "+Wi(F)} for ${x[o].name}`,"running")}).catch(e=>{var n;null!=(n=t)&&null!=(n=n.abort)&&n.aborted?console.warn("Upload aborted"):(console.error(e.message),J=!0)});G.push(m)}G.length>=10&&await Promise.race(G)}if(await Promise.all(G).catch(e=>{var n;null!=(n=t)&&null!=(n=n.abort)&&n.aborted?console.warn("Upload aborted"):(console.error(e.message),J=!0)}),J)return await _i({identifier:L.id,status:"failed",error:"Failed to upload files"},e),{success:!1,error:"Failed to upload files"};if(null!=(v=t)&&null!=(v=v.abort)&&v.aborted)return await _i({identifier:L.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},e),{success:!1,error:"Upload aborted"};W=!0,console.log(`Upload Done: All files uploaded to ${L.id}`);const Y={...me(e),id:L.id};"none"!=b&&console.log("Completing upload - notify server");let Z=null;for(let e=0;e<5;e++){var X;await Di(1e3*e);const n=AbortSignal.timeout(6e4+5e3*e);if(Z=await fetch(j+de.upload.done,{...fe,method:"POST",headers:Y,signal:n}).catch(n=>(console.error(`Failed to complete upload (${e+1} / 5)`,n.message),null)),!0===(null==(X=Z)?void 0:X.ok))break;var Q;"none"!=b&&e<4&&console.warn(`Failed to complete upload (${(null==(Q=Z)?void 0:Q.status)||"no status"}): will retry in 1 second`)}if(!Z)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};if(!Z.ok){if(524===Z.status)return console.error("Failed to complete upload: Gateway Timeout"),{success:!1,error:"Failed to complete upload: Gateway Timeout"};{const e=await Z.text();return console.error(`Failed to complete upload (${Z.status}): ${e}`),{success:!1,error:"Failed to complete upload"}}}"none"!=b&&console.log("Upload complete");const ee=await Z.json();return{success:!0,type:ee.type,uploadSkipped:!1,id:ee.id,content_id:ee.content_id,url:ee.url,filesUploaded:x.length,totalSize:F}}(e,n,t);return await o.finally(()=>{})}async function ea(e){const{uploadId:n,uploadRequestPUTUrl:t,entrypointPath:o,file:i,fileName:a,fileBuffer:s,fileMd5:r,fileSize:c,fileType:l,content_encoding:p,fileIndex:u,fileNumber:d,fileCount:m,loglevel:f,args:h,options:g,experimental:v}=e;"info"===f&&console.log(`Uploading file "${i.name}" type=${l} (${c}) ${i.type} with hash ${r}`);const x={...me(h),"Content-Type":"application/json",org:h.org,job_id:n,filesize:c.toString(),progress:(u/m*100).toFixed(0)},b={filename:a,entrypoint:o,"content-type":l,"content-md5":r,"content-encoding":p,output_index:0};"debug"===f&&console.debug("Requesting presigned URL with headers",x);const y=JSON.stringify(b);let w=null,_="";for(let e=0;e<5;e++){var k;if(null!=w)break;if(null!=g&&null!=(k=g.abort)&&k.aborted)throw new Error("Upload aborted");await Di(200*e),w=await fetch(t,{...fe,method:"POST",headers:x,body:y}).then(async e=>e.ok?await e.json():(_=await e.text(),console.log(t),console.warn(`Failed to get presigned url for "${a}" "${l}" (${e.status}).\n→ Retrying...`),null)).catch(e=>(_=e.message,console.warn("Failed to get presigned url "+e.message+", retrying..."),null))}if(null==w)throw new Error(`Failed to get presigned url for "${a}" "${l}" \n${_}`);const j=w.presigned_url;var S=!1;let $=null;for(let n=0;n<5;n++){var T;if(n>0&&("none"!==f&&console.log(`Retry PUT #${n} for file ${a}`),await Di(1e3*n)),null!=g&&null!=(T=g.abort)&&T.aborted)throw new yi("Upload aborted");const t={"Content-Type":l,"Content-MD5":r};v&&(t["Content-Length"]=c.toString()),p&&(t["Content-Encoding"]=p),0===n&&"none"!=f&&console.log(`Uploading file ${d}/${m}: ${a}`),"debug"===f&&console.debug("PUT with headers",t);const o=await bi.put(j,s,{...fe,withCredentials:!1,signal:null==g?void 0:g.abort,headers:t,timeout:3e5,onUploadProgress:n=>{e.onProgress(n)}}).catch(e=>($=e.message,e instanceof yi||("none"!==f&&console.error(`Failed to upload file (PUT) (${d}, ${a}) "${e.message}"`),"debug"===f&&(console.log(t,{fileSize:c}),e.response?console.debug(e.response):console.debug(e))),null));if(o){if(200!==o.status){$=`${o.statusText} (${o.status})`,console.debug(`Failed (${o.status} ${o.status}) to upload file ${i.name} to "${w.path}". Retrying...`);continue}S=!0,"info"===f&&console.log(`Uploaded file ${d}/${m} "${a}" (${l}, ${Wi(c)})`);break}}var E;if(!S)throw console.error("Failed to upload file "+a),await _i({identifier:n,status:"failed",status_message:`Failed to upload file (${a}): ${null==(E=$)?void 0:E.substring(0,200)}`,error:"Failed to upload file "+a},h),new Error("Failed to upload file "+a);return!0}async function na(e,n,t){const o=e.baseUrl+de.jobs.presigned_url,i=await fetch(o,{...fe,method:"POST",headers:{...me(e),job_id:n},body:JSON.stringify(t)}).catch(e=>(console.error(e),null));return i&&i.ok?await i.text():(console.error("Failed to get presigned download URL",null==i?void 0:i.status),null)}async function ta(e,n){const t=e.baseUrl+de.jobs.create,o={...me(e),"content-type":"application/json"},i={type:"ai-material",triggered_by:e.trigger_type,parameters:{...n}},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request texture generation (${a.status}): ${e}`),{error:e||`Request failed (${a.status})`}}return await a.json().catch(e=>(console.error(e),null))}async function oa(e,n={}){const t=new URL(e.baseUrl+de.content.root);n.content_type&&t.searchParams.set("content_type",n.content_type),n.content_format&&t.searchParams.set("content_format",n.content_format),n.search&&t.searchParams.set("search",n.search),n.tags&&t.searchParams.set("tags",n.tags),n.types&&t.searchParams.set("types",n.types),n.trash&&t.searchParams.set("trash","true"),n.is_public&&t.searchParams.set("is_public","true"),n.page&&t.searchParams.set("page",String(n.page)),n.limit&&t.searchParams.set("limit",String(n.limit)),n.collection_id&&t.searchParams.set("collection_id",n.collection_id),n.offset&&t.searchParams.set("offset",String(n.offset));const o=me(e),i=await fetch(t,{...fe,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to list content (${i.status}): ${e}`)}return await i.json()}async function ia(e,n){const t=`${e.baseUrl}${de.content.root}/${n}`,o=me(e),i=await fetch(t,{...fe,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to get content (${i.status}): ${e}`)}return await i.json()}const aa=1179937895,sa=1313821514,ra={schema:{name:"load_needle_engine_skill",description:'Load the Needle Engine skill with coding guidelines, patterns, and reference docs. IMPORTANT: Do NOT call this for greetings, general conversation, or vague messages like "I have a question about Needle Engine". Only call this when the user asks a specific technical or coding question that requires Needle Engine knowledge to answer. Wait for the actual question first. Without arguments loads the main skill file. Use the "file" parameter to load specific reference files (e.g. "references/api.md", "references/components.md"). Call without arguments first to discover available references.',inputSchema:{type:"object",properties:{file:{type:"string",description:'File to load relative to the skill root, e.g. "references/api.md". Defaults to the main skill file.'}},additionalProperties:!1,required:[]}},async execute(e){const n=(null==e?void 0:e.file)||"SKILL.md";if(n.includes("..")||n.startsWith("/"))return{error:"Invalid file path."};try{const e="https://raw.githubusercontent.com/needle-tools/ai/main/providers/claude/plugin/skills/needle-engine/"+encodeURI(n),t=new AbortController,o=setTimeout(()=>t.abort(),5e3),i=await fetch(e,{signal:t.signal,redirect:"follow"});return clearTimeout(o),i.ok?{content:await i.text()}:{error:`Could not fetch '${n}' (HTTP ${i.status})`}}catch(e){return{error:`Error fetching skill: ${e.message}`}}}};function ca(e){let n,t=null,o="";for(const i of e.split("\n"))i.startsWith("event: ")?t=i.slice(7).trim():i.startsWith("data: ")?o=i.slice(6):i.startsWith("id: ")&&(n=parseInt(i.slice(4).trim(),10));if(!t)return null;let i=null;switch(t){case"delta":i={type:"delta",content:decodeURIComponent(o)};break;case"message":i={type:"message",content:decodeURIComponent(o)};break;case"status":i={type:"status",message:decodeURIComponent(o)};break;case"error":i={type:"error",message:decodeURIComponent(o)};break;case"stopped":i={type:"stopped"};break;case"tool_call":i={type:"tool_call",...JSON.parse(o)};break;case"tool_result":i={type:"tool_result",...JSON.parse(o)};break;case"done":{const e=JSON.parse(o),{chat_url:n,...t}=e;i={type:"done",token_usage:t},n&&(i.chat_url=n);break}case"message_id":i={type:"message_id",message_id:decodeURIComponent(o)};break;case"chat_id":i={type:"chat_id",chat_id:decodeURIComponent(o)}}return i&&void 0!==n&&(i.id=n),i}function la(e,n){const t=me(e);return null!=n&&n.personal&&(t["x-needle-ai-chat"]="personal"),null!=n&&n.instanceId&&(t["x-needle-instance-id"]=n.instanceId),t}function pa(e,n){return n.stream?async function*(e,n){const t=new URL(e.baseUrl+de.ai.chat),o=la(e,n);o["Content-Type"]="application/json";const i={type:"new_message",slug:n.slug,message:n.message,stream:!0,source:n.source,full_url:n.full_url,pathname:n.pathname,context:n.context},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to stream chat message (${a.status}): ${e}`)}if(!a.body)throw new Error("Response body is null — streaming not supported in this environment");yield*async function*(e){const n=e.getReader(),t=new TextDecoder;let o="";try{for(;;){const{done:e,value:i}=await n.read();if(e)break;o+=t.decode(i,{stream:!0});const a=o.split("\n\n");o=a.pop()||"";for(const e of a){const n=ca(e);n&&(yield n)}}if(o.trim()){const e=ca(o);e&&(yield e)}}finally{n.releaseLock()}}(a.body)}(e,n):async function(e,n){const t=new URL(e.baseUrl+de.ai.chat),o=la(e,n);o["Content-Type"]="application/json";const i={type:"new_message",slug:n.slug,message:n.message,stream:!1,source:n.source,full_url:n.full_url,pathname:n.pathname,context:n.context},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to send chat message (${a.status}): ${e}`)}return await a.json()}(e,n)}const ua=()=>"https://cloud.needle.tools/account",da=()=>"https://cloud.needle.tools/edit";function ma(e){return h(e)}const fa=["node_modules",".git",".vscode",".vercel",".github",".idea"];function ha(e,n,t=null,o="",i=0){if(null===t){if(i>0)throw new Error("result must be provided if level > 0. Did you forget to pass it?");t={files:[],total_size:0}}if(0===i){if(!s(n))throw new Error(`Directory or file "${n}" does not exist.`);if(r(n).isFile()){const e=Fi(n,c(n));return e.path=e.name,t.files.push(e),t.entrypoint=e,t}}else if(i>20)throw new Error("Recursion depth too high. Are you sure you are providing the correct directory?");const a=l(n,{withFileTypes:!0});for(const i of a)if(0==i.isDirectory()){if("optimization"===e&&0==((p=(p=i.name).toLowerCase()).endsWith(".glb")||p.endsWith(".gltf")||p.endsWith(".vrm")||p.endsWith(".usdz")||p.endsWith(".usd")||p.endsWith(".fbx")))continue;const a=Fi(o+i.name,c(n+"/"+i.name));if(t.files.push(a),t.total_size+=a.size,t.total_size>1073741824)throw new Error(`Collected filesize exceeds ${1024..toFixed(0)} MB. Are you sure you are providing the correct directory?`);if(t.files.length>1e4)throw new Error(`Too many files (${t.files.length}): The maximum filecount is 10,000.`)}var p;for(const s of a)if(s.isDirectory()){if(fa.includes(s.name))continue;ha(e,n+"/"+s.name,t,o+s.name+"/",i+1)}return t}const ga=new RegExp("\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b","g"),va=new RegExp("\\b[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\b","gi"),xa=new RegExp("(Authorization:\\s*)([^\\s,;\"']+(?:\\s+[^\\s,;\"']+)?)","gi"),ba=new RegExp("\\bBearer\\s+([A-Za-z0-9._\\-=]+)","g"),ya=new RegExp("([?&]token=)([^&\\s\"'<>]+)","g"),wa=new RegExp("<redacted:\\d+ch>","g"),_a=["cli.log","cli.prev.log"],ka=q.join(U.homedir(),".needle","cli","logs");E(ka,{recursive:!0});try{!function(e,n){const t={migrated:[],skipped:[]};if(!e||!n)return t;if(q.resolve(e)===q.resolve(n))return t;if(!T(e))return t;for(const o of _a){const i=q.join(e,o);if(T(i))try{E(n,{recursive:!0});const e=q.join(n,o);if(T(e)){const e=q.join(n,o.replace(/\.log$/,"")+".legacy.log");C(i,e),t.skipped.push(o)}else C(i,e),t.migrated.push(o)}catch(e){console.error(`[needle-cloud] Failed to migrate legacy log ${o}: ${e instanceof Error?e.message:e}`)}}}(q.join(O(U.tmpdir()),"Needle","Cloud","logs"),ka)}catch(e){console.error(`[needle-cloud] legacy log migration check failed: ${e instanceof Error?e.message:e}`)}const ja=q.resolve(ka,"cli.log");if(T(ja)){const e=R(ja),n=e.mtimeMs;if(Date.now()-n>432e5||e.size>52428800){const e=q.resolve(ka,"cli.prev.log");z(ja,e,n=>{n?console.error(`Failed to rename log file: ${n.message}`):console.log(`Log file renamed to ${e}`)})}}function Sa(){return ja}async function $a(e,n){return e=function(e){if("string"!=typeof e)return e;if(0===e.length)return e;if(wa.test(e)&&(wa.lastIndex=0,!function(e){ga.lastIndex=0,va.lastIndex=0,xa.lastIndex=0,ba.lastIndex=0,ya.lastIndex=0;const n=ga.test(e)||va.test(e)||xa.test(e)||ba.test(e)||ya.test(e);return ga.lastIndex=0,va.lastIndex=0,xa.lastIndex=0,ba.lastIndex=0,ya.lastIndex=0,n}(e.replace(wa,""))))return e;wa.lastIndex=0;let n=e;return n=n.replace(xa,(e,n,t)=>`${n}<redacted:${t.length}ch>`),n=n.replace(ya,(e,n,t)=>`${n}<redacted:${t.length}ch>`),n=n.replace(ba,(e,n)=>`<redacted:${("Bearer "+n).length}ch>`),n=n.replace(ga,e=>`<redacted:${e.length}ch>`),n=n.replace(va,e=>`<redacted:${e.length}ch>`),n}(e),e=`[${(new Date).toISOString()}] ${e}`,null!=n&&n.emptyLineBefore&&(e="\n"+e),F(ja,e+"\n",{flag:"a"}).then(()=>!0).catch(e=>(console.error(`Failed to write to log file: ${e.message}`),!1))}function Ta(e,n,t){process.env.GITHUB_ACTIONS&&(process.env.GITHUB_OUTPUT?p(process.env.GITHUB_OUTPUT,`${e}=${n}\n`):null==t||t.logger.warn("GITHUB_OUTPUT environment variable is not set. Cannot set output variables."))}async function Ea(e){var n;e.directory=b.resolve(e.directory);let{files:t,entrypoint:o}=ha("deployment",e.directory);if(e.entrypoint&&(o=t.find(n=>n.path===e.entrypoint),!o))return void $().fail(`Entrypoint "${e.entrypoint}" not found. Please make sure you provide a valid entrypoint.`);if(!o){const e=Hi(t);if("error"in e)return $a(`[Deployment] Error determining entrypoint: ${e.error}`),void $().fail(`Error: ${e.error}`);o=e}if(!(t.length>0&&o&&(o.name.toLowerCase().endsWith(".html")||o.name.toLowerCase().endsWith(".html.gz")||o.name.toLowerCase().endsWith(".html.br"))))return $a("[Deployment] Deployment is not valid: No .html file found."),void $().fail("Deployment is not valid: No .html file found.");if(!o)return $a("[Deployment] No entrypoint found. Please provide an index.html file in your project."),void $().fail("No entrypoint found. Please provide an index.html file in your project.");const i=null!=(n=e.endpoint)&&n.length?e.endpoint:"https://cloud.needle.tools/api";let a=e.name;a||(a=Ca(e.directory)||void 0);let s=null==i?void 0:i.includes("localhost");const r=a?` of "${a}"`:"",c=$().start(`Begin deployment${r} ${s?"(local)":""} of ${t.length} files...`);c.spinner="earth",await Di(50);let l=-1;$a(`Deployment started${r} ${s?"(local)":""} of ${t.length} files...`);const p=await Qi({baseUrl:i,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:t,entrypoint:o,experimental:e.experimental,raw:e.raw},{name:a,type:"deployment",loglevel:e.verbose?"debug":"none",progress:e=>{if(e.fileIndex!==l){l=e.fileIndex;const n=e.totalBytes/1024/1024;c.text=`Uploading file ${e.fileIndex+1} of ${e.totalFiles} files: ${(e.uploadedBytes/1024/1024).toFixed(1)} / ${n.toFixed(1)} MB. Total progress: ${(100*e.progress01).toFixed(1)} %. Time passed: ${e.elapsedTime.toFixed(0)}sec. About ${e.estimatedTimeLeftDisplay} until complete.`}}}).catch(e=>(c.fail(e),null));if(null!=p&&!0===p.success){c.succeed(`🚀 Deployment${r} successful (${p.content_id}/${p.id})`);let n="";n=p.url?p.url:"https://cloud.needle.tools/view/"+p.content_id+"/"+p.id,console.log("🔗 View the deployment at: "+n),e.open&&ma(n);try{Ta("deployment_url",n,{logger:e.logger}),Ta("edit_id",p.content_id,{logger:e.logger})}catch(n){e.logger.error("Error writing output for CI: "+n)}}else c.fail(`${null==p?void 0:p.error}`)}function Ca(e,n=0){if(n>10)return null;const t=b.join(e,"needle.config.json");if(s(t)){const n=b.join(e,"package.json");if(s(n)){var o;const e=c(n,"utf8"),t=JSON.parse(e);if(null!=(o=t.name)&&o.length)return t.name}return b.basename(e)}const i=b.dirname(e);return i===e?null:Ca(i,n+1)}async function Oa(e){if(!e.outDir)throw new Error("Output directory is required");const n=$("Downloading results...").start(),t=await async function(e){const n=await async function(e){if(!e.identifier)return null;const n={...me(e)},t={job_id:e.identifier,fields:e.fields,content_format:e.content_format},o=e.baseUrl+de.jobs.query,i=await fetch(o,{...fe,method:"POST",headers:n,body:JSON.stringify(t)}).catch(e=>(console.error(e),null));if(null==i)return null;if(!i.ok)return console.error("Failed to get job",i.status,await i.text()),null;const a=await i.json().catch(e=>(console.error(e),null));return null==a?null:a.job}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,fields:["results"],content_format:e.content_format});if(null==n||!n.results)return{error:`Job ${e.identifier} did not produce any result files`};const t=n.results;if(!t.bucket||!t.directory)return{error:`Job ${e.identifier} has incomplete result data`};const o=[];for(const n of t.files){if((i=n.filename).startsWith(".extras/")||i.startsWith(".extras\\")||i.endsWith("screenshot.needle.webp")||wi.test(i)||i.endsWith(".needle.log"))continue;const a=`${t.directory}/${n.filename}`,s=await na(e,e.identifier,{bucket:t.bucket,key:a});if(!s){console.error(`Failed to get presigned URL for: ${n.filename}`);continue}const r=await fetch(s).catch(e=>(console.error(e),null));if(!r||!r.ok){console.error(`Failed to download (${null==r?void 0:r.status} | ${null==r?void 0:r.statusText}): ${n.filename}`);continue}const c=await r.arrayBuffer().catch(e=>(console.error(e),null));if(!c)return{error:`Failed to read downloaded file: ${n.filename}`};o.push({filename:n.filename,data:c})}var i;return{files:o}}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,content_format:e.content_format});if("error"in t)return n.fail(t.error),{error:t.error};const o=[];for(const i of t.files){n.text=`Downloading ${i.filename}`,s(e.outDir)||u(e.outDir,{recursive:!0});let a=i.filename;if(e.filename){const n=i.filename.substring(i.filename.lastIndexOf("."));if(1===t.files.length)a=e.filename.includes(".")?e.filename:e.filename+n;else{const n=i.filename.substring(i.filename.lastIndexOf(".")),t=i.filename.substring(0,i.filename.lastIndexOf("."));a=e.filename+"-"+t+n}}const r=e.outDir+"/"+a,c=r.split("/").slice(0,-1).join("/");s(c)||u(c,{recursive:!0}),e.verbose&&console.log(`Writing ${i.filename} (${(i.data.byteLength/1024).toFixed(2)} KB) to "${r}"`),d(r,Buffer.from(i.data)),o.push(r)}return n.succeed(`Downloaded ${o.length} ${1===o.length?"file":"files"}: ${o.join(", ")}`),e.verbose&&console.log("Downloaded files:\n",o),{success:!0,paths:o}}async function Ra(e){const{token:n,org_id:t,slug:o,message:i,stream:a}=e;if(a){const e=pa({baseUrl:"https://cloud.needle.tools/api",authToken:n,org:t},{slug:o,message:i,stream:!0,source:"cli"});for await(const n of e)switch(n.type){case"delta":process.stdout.write(n.content);break;case"message":break;case"status":process.stdout.write(`[${n.message}]\n`);break;case"error":return void $().fail(n.message);case"tool_call":process.stdout.write(`[tool: ${n.name}]\n`);break;case"done":process.stdout.write("\n")}}else{const e=$("Thinking...").start(),a=await pa({baseUrl:"https://cloud.needle.tools/api",authToken:n,org:t},{slug:o,message:i,stream:!1,source:"cli"});e.stop(),console.log(a.content)}}async function za(e){const n=new URL((e.endpoint||"https://cloud.needle.tools/api")+de.get.deployments);n.searchParams.append("offset",e.offset.toString()),n.searchParams.append("limit",e.limit.toString()),e.names&&n.searchParams.append("name",e.names.map(e=>e.trim()).join(","));const t=await fetch(n,{method:"GET",headers:{...me({authToken:e.authToken,org:e.org})}});return t.ok?await t.json():{status:t.status,error:await t.text()}}const Na=["#e06c75","#d19a66","#e5c07b","#98c379","#7ec8a4","#56b6c2","#61afef","#528bff","#c678dd","#e88de4","#be5046","#d4976c","#b5cea8","#4ec9b0","#9cdcfe","#c8ae9d"];function Aa(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t)|0;const[t,o,i]=function(e){const n=parseInt(e.slice(1),16);return[n>>16&255,n>>8&255,255&n]}(Na[Math.abs(n)%Na.length]);return`[38;2;${t};${o};${i}m${e}[0m`}function La(e){return`[2m${e}[0m`}const Fa=8424,Ua="http://localhost:8424";var Ia;const qa={appId:"2stnsoa6a1b0gwc7lra55",appSecret:"seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",endpoint:"https://auth.needle.tools",resources:["https://cloud.needle.tools/api"],scopes:["openid","profile","email","roles","urn:logto:scope:organizations","urn:logto:scope:organization_roles","identities","custom_data","all","read","write","delete","upload","download","invite","editor"]},Wa={getAccessToken:!0,fetchUserInfo:!0,resource:null==(Ia=qa.resources)?void 0:Ia[0],resources:qa.resources||[],scopes:qa.scopes||[]};function Pa(e="default"){return null==e?`${Ua}/?signed-out=1`:"too-many-logins"===e?`${Ua}/?too-many-logins=1`:"error"===e?`${Ua}/?error=1`:`${Ua}/?signed-out=1`}var Ba;function Da(){Ga.clear(),a.existsSync(Ka)&&a.rmSync(Ka,{recursive:!0}),a.existsSync(Va)&&a.rmSync(Va,{recursive:!0})}const Ma=process.argv.includes("--debug-auth"),Ga=new Map;let Ja=null==(Ba=qa.resources)?void 0:Ba[0];if(Ja)try{Ja=new URL(Ja).hostname}catch(e){Ma&&console.error("Invalid resource URL",Ja)}let Ha=Ja||"-";Ha=Ha.replace(/[^a-zA-Z0-9\.\-]/g,"");const Ka=b.join(Z(),".needle",".auth",Ha),Va=`${X()}/Needle/Cloud/.auth/${Ha}`;!function(){if(a.existsSync(Va)){Ma&&console.debug("Migrating auth data from legacy location",Va,"→",Ka);try{a.existsSync(Ka)||a.mkdirSync(Ka,{recursive:!0,mode:448});for(const e of a.readdirSync(Va)){const n=b.join(Va,e),t=b.join(Ka,e);a.statSync(n).isFile()&&!a.existsSync(t)&&(a.copyFileSync(n,t),a.chmodSync(t,384))}a.rmSync(Va,{recursive:!0}),Ma&&console.debug("Legacy auth data migrated successfully")}catch(e){Ma&&console.error("Failed to migrate legacy auth data",e)}}}();const Ya={accessToken:`${Ka}/accessToken`,refreshToken:`${Ka}/refreshToken`,idToken:`${Ka}/idToken`,signInSession:`${Ka}/signInSession`};function Za(e){return Ya[e]||`${Ka}/${e}`}const Xa=new class{constructor(){this.basePath=Ka}async setItem(e,n){Ma&&console.debug("\n- SET ITEM",e,n),a.existsSync(this.basePath)||a.mkdirSync(this.basePath,{recursive:!0,mode:448});const t=Za(e);t&&a.writeFileSync(t,n,{mode:384}),Ga.set(e,n)}async getItem(e){Ma&&console.debug("\n- GET ITEM",e);const n=Ga.get(e);if(void 0===n){const n=Za(e);if(n){if(a.existsSync(n)){const t=a.readFileSync(n,"utf8");return Ga.set(e,t),t}}else console.error(`Unknown token name: ${e}`);return null}return String(n)}async removeItem(e){Ma&&console.debug("\n- REMOVE ITEM",e),Ga.delete(e);const n=Za(e);if(n&&a.existsSync(n)){try{const e=a.statSync(n).size;e>0&&a.writeFileSync(n,Buffer.alloc(e,0),{mode:384})}catch{}a.rmSync(n)}}};let Qa=null;function es(){return Qa||(Qa=new oe(qa,{storage:Xa,navigate:()=>{}})),Qa}function ns(){Qa=null}let ts=null;function os(e,n){return ts?ts.then(()=>e.getContext(n),()=>e.getContext(n)):(ts=e.getContext(n).finally(()=>{ts=null}),ts)}function is(){return os(e=es(),Wa).then(n=>{const t=n;return t.client=e,t}).catch(async e=>{const n=e instanceof Error?e.message:String(e);return"oidc.invalid_token"==e.code||"oidc.invalid_grant"==e.code?($a(`OIDC: ${e.code} – token refresh failed, clearing stale tokens`),Da(),Qa=null,console.error("Session expired – please log in again: npx needle-cloud login")):e.code?(console.error(e.code),$a(`OIDC: ${e.code} – ${n}`)):$a(`OIDC: getContext failed – ${n}`),null});var e}let as=null;function ss(e){var n;const t=null==(n=e.userInfo)?void 0:n.custom_data;if(!t)return[];const o=t.machines;return o?o.map(e=>e.name):[]}let rs=Date.now();async function cs(e){var n;const t=Date.now();t-rs>3e4&&"client"in e&&(rs=t,await e.client.fetchUserInfo().catch(console.error));const o=null==(n=e.userInfo)?void 0:n.custom_data;if(!o)return!1;if(as||await ls(),!as)return console.error("Failed to get machine id"),!0;const i=o.machines;if(!i)return!1;const a=i.some(e=>e.id===as);return a}async function ls(){return as||await import("node-machine-id").then(async e=>{const n=await e.default.machineId(!1);as=n}),as}function ps(){return Y.userInfo().username+"@"+Y.hostname()}async function us(e,n={signout:!1}){if(e.accessToken){const o={machine_id:await ls(),machine_name:ps(),platform:Y.platform(),arch:Y.arch()},i=await fetch("https://cloud.needle.tools/api"+de.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(e=>{var n,t;const o=(null==e||null==(n=e.cause)?void 0:n.code)||(null==e||null==(t=e.cause)?void 0:t.message)||(null==e?void 0:e.message)||"connection refused";return console.error(`Failed to validate login: ${o} - Make sure https://cloud.needle.tools/api is reachable`),$a(`Failed to validate login: "${o}" - Make sure https://cloud.needle.tools/api is reachable.`),{status:502,error:`Failed to validate login at 'https://cloud.needle.tools/api' (${o}) - make sure this URL is reachable.`}});if(!i)return!1;if("error"in i)return i;let a=!0;if(403===i.status){const e=await i.text();if(e.trimStart().startsWith("{")){const n=JSON.parse(e);n.logins&&(a=!1,$a("Too many logins from different machines"),$().fail("You have reached the maximum number of allowed logins\n"),$().warn(`Please logout from one of the following machines:\n- ${n.logins.join("\n- ")}\n`))}}var t;return!!a||(n.signout&&(Da(),"client"in e&&(null==(t=e.client)||t.signOut(Pa("too-many-logins")))),!1)}return!0}let ds=null;function ms(){if(ds)return ds;{const e=gs();return ds=e,e}}const fs="projects.json";function hs(){const e=process.env.HOME||process.env.USERPROFILE||process.cwd(),n=w(e,".needle");return s(n)||u(n,{recursive:!0}),w(n,fs)}function gs(){const e=hs();if(!s(e))return{entries:[]};const n=c(e,"utf-8");try{const e=JSON.parse(n);return ds=e,e}catch(e){return console.error("Failed to parse project info file:",e),{entries:[]}}}const vs=JSON.parse(c(new URL("../package.json",import.meta.url),"utf-8"));function xs(){return vs.version}const bs=process.env.NEEDLE_SEARCH_ENDPOINT||"https://search.needle.tools",ys=process.env.NEEDLE_SEARCH_API_KEY||"da5737c00d6822c32a1b9e3b5dab094bfc17e205aef2f7f3e1a0fd4ebc77b79f",ws=[{name:"needle_cloud_me",description:"Get current Needle Cloud user information",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},{name:"needle_search",description:"Search Needle Engine documentation, forum posts, and community discussions. Returns relevant content ranked by semantic similarity. Use this to find information about Needle Engine features, APIs, components, workflows, and troubleshooting.\n\nIMPORTANT: If search results seem irrelevant or low-quality (scores below 0.6, or results don't match the topic), retry with different search terms — up to 3 total attempts. Try varying your query: use specific class/method names, try shorter keyword-based queries, or rephrase the question. Do NOT guess or fabricate answers based on poor search results.",inputSchema:{type:"object",properties:{query:{type:"string",description:'What to search for, e.g. "how to add physics components" or "WebXR hand tracking" or "deploy to vercel"'},limit:{type:"number",description:"Maximum number of results to return (1-20, default 5)"}},additionalProperties:!1,required:["query"]}}],_s={needle_cloud_me:async function(e){try{const e=await is(),n=null==e?void 0:e.userInfo;return n?JSON.stringify({id:n.sub,name:n.name||n.preferred_username,email:n.email,profile_picture:n.picture}):"No user is currently logged in."}catch(e){return"Error retrieving user: "+(e instanceof Error?e.message:String(e))}},needle_search:async function(n){const t=n.query;if(!t||"string"!=typeof t)return{content:[{type:"text",text:"Error: query parameter is required."}]};const o=Math.min(Math.max(Number(n.limit)||5,1),20),i=`${bs}/api/semantic-search?q=${encodeURIComponent(t)}&limit=${o}`,a={Accept:"application/json"};ys&&(a.Authorization=`Bearer ${ys}`);try{const n=await e(i,{headers:a,signal:AbortSignal.timeout(15e3)});if(!n.ok){const e=await n.text().catch(()=>"");return{content:[{type:"text",text:`Search API error (${n.status}): ${e}`}]}}const o=await n.json();if(!o.results||0===o.results.length)return{content:[{type:"text",text:`No results found for: "${t}"`}]};const s=o.results.map((e,n)=>`## [${n+1}] ${e.title} (score: ${e.score})\nSource: ${e.source}${e.url?` — ${e.url}`:""}\n\n`+e.content+(e.truncated?`\n\n> Content truncated (${e.content.length} of ${e.contentLength} chars shown).${e.url?` Full content: ${e.url}`:""}`:"")).join("\n\n---\n\n");return{content:[{type:"text",text:`Found ${o.results.length} results for "${t}" (${o.durationMs}ms):\n\n${s}`}]}}catch(e){return{content:[{type:"text",text:`Search failed: ${e instanceof Error?e.message:String(e)}`}]}}}},ks=new Map;function js(e,n){const t=ws.findIndex(n=>n.name===e);-1!==t&&(ws.splice(t,1),delete _s[e],n())}function Ss(e,n,t,o){const i=ws.findIndex(n=>n.name===e.name);if(-1!==i&&ws.splice(i,1),ws.push(e),_s[e.name]=n,$s.delete(e.name),null!=t&&t.source){const n=ks.get(t.source)||new Set;n.add(e.name),ks.set(t.source,n)}o()}const $s=new Map;async function Ts(e,n){const t=_s[e];if(!t){const n=$s.get(e);if(n)return{isError:!0,content:[{type:"text",text:`This tool is currently unavailable because "${n}" disconnected. Please reconnect (e.g. reopen the browser tab) and try again. You should also call tools/list to refresh your available tools.`}]};throw new Error(`Tool "${e}" is not registered.`)}const o=await t(n);if("string"==typeof o)return{content:[{type:"text",text:o}]};if("object"==typeof o)return Array.isArray(o.content)?o:{content:[{type:"text",text:JSON.stringify(o)}]};throw new Error(`Invalid tool result type for tool "${e}".`)}const Es=200,Cs=2e3,Os=new RegExp("^[A-Za-z0-9_./*?\\[\\]{},\\-]+$");function Rs({pattern:e,glob:n,root:t,maxResults:o}){if("string"!=typeof e)throw new Error("invalid pattern: must be a string");if(e.length>Cs)throw new Error(`invalid pattern: exceeds ${Cs} characters`);if(null!=n&&""!==n){if("string"!=typeof n)throw new Error("invalid glob: must be a string");if(n.length>Es)throw new Error(`invalid glob: exceeds ${Es} characters`);if(!Os.test(n))throw new Error("invalid glob: contains disallowed characters")}const i=["-rn"];return n&&i.push(`--include=${n}`),i.push(`--max-count=${o}`,"-E",e,t),i}function zs(e={}){Ss({name:"get_editor_logpath",description:"Get the filepath to the editor log file (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];if(null!=e&&e.log_location){const t=r(e.log_location).mtime;n.content.push({type:"text",text:`${e.log_location} (last modified: ${t.toLocaleString()})`})}else{let t="No recent project with known log location known.";e&&(t+=" Recent project is "+(null==e?void 0:e.project_location)),n.content.push({type:"text",text:t})}}return n},{source:"cli"},()=>{}),Ss({name:"get_editor_project_path",description:"Get the filepath to the currently opened project in the editor (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.project_location?{type:"text",text:e.project_location}:{type:"text",text:"No recent project with known project location known."})}return n},{source:"cli"},()=>{}),Ss({name:"get_editor_scene_path",description:"Get the filepath to the currently opened scene in the editor (Unity or Blender). Use this to find out which scene the user is working on.",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.scene_location?{type:"text",text:e.scene_location}:{type:"text",text:"No recent project with known scene location known."})}return n},{source:"cli"},()=>{}),Ss({name:"get_web_project_path",description:"Get the filepath to the web project directory (the Needle Engine web frontend project).",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=ms();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.web_location?{type:"text",text:e.web_location}:{type:"text",text:"No recent project with known web project location known."})}return n},{source:"cli"},()=>{}),Ss({name:"local_read_file",description:"Read a file from the user's local project (editor project or web project). The path must be relative to the project root or an absolute path inside the project. Returns the file contents (or a portion if offset/limit are specified). Use 'filter' to search for specific terms within the file.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path (relative to project root, or absolute within the project)"},offset:{type:"number",description:"Line number to start reading from (1-based, default: 1). In filter mode: number of matches to skip."},limit:{type:"number",description:"Maximum number of lines to return (default: 200, max: 1000). In filter mode: max matches to return."},filter:{type:"string",description:"Search term to grep for in the file (case-insensitive). Returns matching lines with line numbers instead of sequential content."}},additionalProperties:!1,required:["path"]}},async e=>{const n=Fs(e.path);if(!n)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};try{const t=r(n.resolved).mtime.toISOString(),o=c(n.resolved,"utf-8").split("\n");if(e.filter){const i=e.filter.toLowerCase(),a=[];for(let e=0;e<o.length;e++)o[e].toLowerCase().includes(i)&&a.push(`${e+1}: ${o[e]}`);const s=a.length,r=Math.max(0,e.offset||0),c=Math.min(Math.max(e.limit||200,1),1e3),l=a.slice(r,r+c);return{content:[{type:"text",text:`File: ${n.resolved} (modified: ${t}) — filter="${e.filter}" → ${s} matches (showing ${r+1}-${r+l.length}) in ${o.length} lines\n`+l.join("\n")}]}}const i=Math.max(1,e.offset||1),a=Math.min(e.limit||200,1e3),s=o.slice(i-1,i-1+a),l=s.map((e,n)=>`${i+n}: ${e}`).join("\n");return{content:[{type:"text",text:`File: ${n.resolved} (${o.length} lines, modified: ${t}, showing ${i}-${i+s.length-1})\n`+l}]}}catch(e){return{content:[{type:"text",text:`Error reading file: ${e.message}`}]}}},{source:"cli"},()=>{}),Ss({name:"local_grep",description:"Search for a pattern in the user's local project files (editor project and web project) using grep. Returns matching lines with file paths and line numbers.",inputSchema:{type:"object",properties:{pattern:{type:"string",description:"Search pattern (regular expression)"},glob:{type:"string",description:"File glob filter, e.g. '*.ts' or '*.cs' (optional)"},max_results:{type:"number",description:"Maximum number of matching lines to return (default: 50)"}},additionalProperties:!1,required:["pattern"]}},async e=>{const n=Ls();if(0===n.length)return{content:[{type:"text",text:"Error: no active project found."}]};const t=Math.min(e.max_results||50,200),o=[];try{Rs({pattern:e.pattern,glob:e.glob,root:".",maxResults:t})}catch(e){return{content:[{type:"text",text:`Error: ${e.message}`}]}}for(const a of n)try{const n=Rs({pattern:e.pattern,glob:e.glob,root:a,maxResults:t});let s="";try{s=re("grep",n,{encoding:"utf-8",maxBuffer:1048576,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch(e){if(1!==(null==e?void 0:e.status))throw e;var i;s=(null==(i=e.stdout)||null==i.toString?void 0:i.toString())||""}if(s.trim()){const e=s.trim().split("\n").map(e=>e.startsWith(a)?e.substring(a.length+1):e);o.push(...e)}}catch{}if(0===o.length){const t=n.length>0?`\nSearched in:\n${n.join("\n")}`:"\nNo project directories available to search.";return{content:[{type:"text",text:`No matches found for pattern: ${e.pattern}${t}`}]}}const a=o.slice(0,t);return{content:[{type:"text",text:`Found ${o.length} matches${o.length>t?` (showing first ${t})`:""}:\n`+a.join("\n")}]}},{source:"cli"},()=>{}),Ss({name:"local_list_files",description:"List files in the user's local project directories matching an optional glob pattern. By default searches both the editor project (Unity/Blender) and the web project. Use the 'project' parameter to target a specific one. Results are prefixed with <web_project>/..., <unity>/..., or <blender>/... so you know which root each file belongs to.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Subdirectory to list (relative to the selected project root, default: root)"},pattern:{type:"string",description:"Glob pattern to filter files, e.g. '*.ts' or '*.glb'. Supports multiple patterns separated by '|', e.g. '*.gltf|*.glb' (optional)"},recursive:{type:"boolean",description:"Whether to list files recursively (default: false)"},project:{type:"string",enum:["web","editor"],description:"Which project root to search: 'web' for the Needle Engine web project (use this for exported assets, source files, node_modules), 'editor' for the Unity/Blender project. Omit to search both."}},additionalProperties:!1,required:[]}},async e=>{const n=Ns();if(!n)return{content:[{type:"text",text:"Error: no active project found."}]};const t="blender"===n.editor?"<blender>":"unity"===n.editor?"<unity>":"<editor_project>",o=[];if(e.project&&"editor"!==e.project||!n.project_location||o.push({root:y(n.project_location),label:t}),e.project&&"web"!==e.project||!n.web_location||o.push({root:y(n.web_location),label:"<web_project>"}),0===o.length)return{content:[{type:"text",text:"Error: no active project found."}]};const i=[];for(const{root:n,label:t}of o){const o=e.path?As(e.path,n):n;if(o)try{var a;const s=Is(o,n,null!=(a=e.recursive)&&a,e.pattern,0);i.push(...s.map(e=>({file:e,root:n,label:t})))}catch{}}if(0===i.length)return{content:[{type:"text",text:"No files found."+(o.length>0?`\nSearched in:\n${o.map(e=>`${e.label} → ${e.root}`).join("\n")}`:"\nNo project directories available to search.")}]};const s=i.slice(0,500).map(e=>`${e.label}/${_(e.root,e.file)}`);return{content:[{type:"text",text:`Found ${i.length} files${i.length>500?" (showing first 500)":""}:\n`+s.join("\n")}]}},{source:"cli"},()=>{}),Ss({name:"local_read_editor_log",description:"Read or search the Unity or Blender editor log file. By default reads the last N lines. Use the 'filter' parameter to search for specific terms (e.g. error messages, warnings, component names) across the entire log.",inputSchema:{type:"object",properties:{lines:{type:"number",description:"Number of lines to read from the end of the log (default: 100, max: 500). Ignored when filter is set."},filter:{type:"string",description:"Search term to grep for in the log (case-insensitive). Returns all matching lines from the entire log instead of just the tail."},offset:{type:"number",description:"Number of matching results to skip from the start (default: 0). Only used with filter."},limit:{type:"number",description:"Maximum number of matching results to return (default: 200, max: 500). Only used with filter."}},additionalProperties:!1,required:[]}},async e=>{const n=Ns();var t;if(null==n||!n.log_location)return $a(`read_editor_log: no editor log file known (project: ${null!=(t=null==n?void 0:n.project_location)?t:"none"})`),{content:[{type:"text",text:"Error: no editor log file known. Is a Unity or Blender project open?"}]};try{const t=c(n.log_location,"utf-8").split("\n");let o,i;if(e.filter){const n=e.filter.toLowerCase();o=[];for(let e=0;e<t.length;e++)t[e].toLowerCase().includes(n)&&o.push(`L${e+1}: ${t[e]}`);const a=o.length,s=Math.max(0,e.offset||0),r=Math.min(Math.max(e.limit||200,1),500);o=o.slice(s,s+r),i=`filter="${e.filter}" → ${a} matches (showing ${s+1}-${s+o.length}) in ${t.length} total lines`}else{const n=Math.min(Math.max(e.lines||100,1),500);o=t.slice(-n),i=`last ${n} of ${t.length} lines`}const a="unity"===n.editor?function(e){const n=[],t=new Map;let o=!1,i=0;for(const a of e){if(/^\s+at\s/.test(a)||/^\s*(UnityEngine\.|System\.|Unity\.)/.test(a)||/^\s+\w+[\w.<>]+\s*\(/.test(a)){o||(o=!0,i=0),i++,i<=3?n.push(a):4===i&&n.push(" ... (stack trace truncated)");continue}if(o=!1,i=0,!a.trim())continue;const e=t.get(a)||0;if(t.set(a,e+1),0===e)n.push(a);else if(1===e)n.push(` [repeated ${e+1}x] ${a}`);else{const t=n.length-1;t>=0&&n[t].startsWith(" [repeated")&&(n[t]=` [repeated ${e+1}x] ${a}`)}}return n}(o):o,s=5e4;let r=a.join("\n"),l="";if(r.length>s){r=r.substring(r.length-s);const e=r.indexOf("\n");e>0&&(r=r.substring(e+1)),l=" (output truncated to last ~50KB)"}return{content:[{type:"text",text:`Editor log: ${n.log_location} (${i}, ${a.length} after processing, editor: ${n.editor})${l}:\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading log: ${e.message}`}]}}},{source:"cli"},()=>{}),Ss({name:"local_read_gltf",description:"Read and summarize a glTF or GLB file from the user's local project. Without a query, returns a structured summary including nodes, meshes, materials, animations, extensions, and compression/optimization hints. Use 'query' to drill into specific parts using JSON pointer paths. Use '*' as a wildcard for array indices or object keys. For GLB files, extracts the JSON chunk and skips binary data.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path to a .gltf or .glb file (relative to project root, or absolute path)"},query:{type:"string",description:"JSON pointer path to extract a specific part of the glTF, e.g. '/nodes/0', '/materials', '/extensions/NEEDLE_progressive', '/materials/*/extensions'. Use '*' as a wildcard for array indices or object keys."}},additionalProperties:!1,required:["path"]}},async e=>{let n=Fs(e.path);if(!n)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};if(!s(n.resolved))return{content:[{type:"text",text:`Error: file not found: ${n.resolved}`}]};try{const t=function(e){const n=e.toLowerCase();if(n.endsWith(".gltf")){const n=c(e,"utf-8");return JSON.parse(n)}if(n.endsWith(".glb")){const n=c(e);if(n.length<20)return null;if(1179937895!==n.readUInt32LE(0))return null;const t=n.readUInt32LE(12);if(1313821514!==n.readUInt32LE(16))return null;const o=n.toString("utf-8",20,20+t);return JSON.parse(o)}return null}(n.resolved);if(!t)return{content:[{type:"text",text:"Error: could not parse glTF/GLB file."}]};const o=5e4;if(e.query){const i=Us(t,e.query.replace(/^\//,"").split("/"));if(void 0===i)return{content:[{type:"text",text:`No data found at pointer: ${e.query}`}]};let a=JSON.stringify(i),s=!1;return a.length>o&&(a=a.substring(0,o),s=!0),{content:[{type:"text",text:`${e.query} in ${n.resolved}`+(s?` (truncated to ${o} chars)`:"")+"\n"+a}]}}let i=function(e,n){var t,o,i,a,s,r,c,l,p,u,d,m,f;const h=[`glTF: ${n}`];if(e.asset){const n=[];e.asset.version&&n.push(`v${e.asset.version}`),e.asset.generator&&n.push(e.asset.generator),h.push(`Asset: ${n.join(", ")}`)}if(null!=(t=e.extensionsUsed)&&t.length&&h.push(`Extensions used: ${e.extensionsUsed.join(", ")}`),null!=(o=e.extensionsRequired)&&o.length&&h.push(`Extensions required: ${e.extensionsRequired.join(", ")}`),null!=(i=e.scenes)&&i.length&&h.push(`Scenes: ${e.scenes.length}${void 0!==e.scene?` (default: ${e.scene})`:""}`),null!=(a=e.nodes)&&a.length){var g,v,x;h.push(`\nNodes (${e.nodes.length}):`);const n=null!=(g=null==(v=e.scenes)||null==(v=v[null!=(x=e.scene)?x:0])?void 0:v.nodes)?g:[],t=new Set,o=(n,i)=>{if(i>6||t.has(n))return;t.add(n);const a=e.nodes[n];if(!a)return;const s=" ".repeat(i),r=[];if(void 0!==a.mesh&&r.push(`mesh:${a.mesh}`),void 0!==a.camera&&r.push(`camera:${a.camera}`),void 0!==a.skin&&r.push(`skin:${a.skin}`),a.extensions&&r.push(`ext:[${Object.keys(a.extensions).join(",")}]`),h.push(`${s}- ${a.name||`node_${n}`}${r.length?` (${r.join(", ")})`:""}`),a.children)for(const e of a.children)o(e,i+1)};for(const e of n)o(e,1);t.size<e.nodes.length&&t.size>0&&h.push(` ... and ${e.nodes.length-t.size} more nodes`)}if(null!=(s=e.meshes)&&s.length){h.push(`\nMeshes (${e.meshes.length}):`);for(const n of e.meshes.slice(0,30)){var b,y;const e=null!=(b=null==(y=n.primitives)?void 0:y.length)?b:0;h.push(` - ${n.name||"(unnamed)"} (${e} primitive${1!==e?"s":""})`)}e.meshes.length>30&&h.push(` ... and ${e.meshes.length-30} more`)}if(null!=(r=e.materials)&&r.length){h.push(`\nMaterials (${e.materials.length}):`);for(const n of e.materials.slice(0,30)){const e=n.name||"(unnamed)",t=[];n.pbrMetallicRoughness&&t.push("PBR"),n.alphaMode&&"OPAQUE"!==n.alphaMode&&t.push(n.alphaMode),n.doubleSided&&t.push("doubleSided"),n.extensions&&t.push(`ext:[${Object.keys(n.extensions).join(",")}]`),h.push(` - ${e}${t.length?` (${t.join(", ")})`:""}`)}e.materials.length>30&&h.push(` ... and ${e.materials.length-30} more`)}if(null!=(c=e.textures)&&c.length&&h.push(`Textures: ${e.textures.length}`),null!=(l=e.images)&&l.length&&h.push(`Images: ${e.images.length}`),null!=(p=e.animations)&&p.length){h.push(`\nAnimations (${e.animations.length}):`);for(const n of e.animations.slice(0,20)){var w,_;const e=null!=(w=null==(_=n.channels)?void 0:_.length)?w:0;h.push(` - ${n.name||"(unnamed)"} (${e} channel${1!==e?"s":""})`)}e.animations.length>20&&h.push(` ... and ${e.animations.length-20} more`)}if(null!=(u=e.skins)&&u.length){h.push(`\nSkins (${e.skins.length}):`);for(const n of e.skins.slice(0,10)){var k,j;h.push(` - ${n.name||"(unnamed)"} (${null!=(k=null==(j=n.joints)?void 0:j.length)?k:0} joints)`)}}if(null!=(d=e.cameras)&&d.length){h.push(`\nCameras (${e.cameras.length}):`);for(const n of e.cameras)h.push(` - ${n.name||"(unnamed)"} (${n.type})`)}if(null!=(m=e.buffers)&&m.length){const n=e.buffers.reduce((e,n)=>e+(n.byteLength||0),0);h.push(`\nBuffers: ${e.buffers.length} (${(n/1024/1024).toFixed(1)} MB total)`)}return null!=(f=e.accessors)&&f.length&&h.push(`Accessors: ${e.accessors.length}`),h.join("\n")}(t,n.resolved);return i.length>o&&(i=i.substring(0,o)+"\n... (truncated)"),{content:[{type:"text",text:i}]}}catch(e){return{content:[{type:"text",text:`Error reading glTF: ${e.message}`}]}}},{source:"cli"},()=>{}),Ss(ra.schema,async e=>{const n=await ra.execute(e);return"error"in n?{content:[{type:"text",text:n.error}]}:{content:[{type:"text",text:n.content}]}},{source:"cli"},()=>{}),null!=e&&e.logToolCount&&$a(`[MCP] registered ${ws.length} built-in tools: ${ws.map(e=>e.name).join(", ")}`)}function Ns(){var e;const n=ms();return null!=n&&null!=(e=n.entries)&&e.length?n.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0]:null}function As(e,n){const t=y(n,e),o=y(n);return t.startsWith(o+k)||t===o?t:null}function Ls(){const e=Ns();if(!e)return[];const n=[];return e.project_location&&n.push(y(e.project_location)),e.web_location&&n.push(y(e.web_location)),n}function Fs(e){const n=Ls();for(const t of n){const n=As(e,t);if(n&&s(n))return{resolved:n,root:t}}for(const t of n){const n=As(e,t);if(n)return{resolved:n,root:t}}const t=y(e);for(const e of n)if(t.startsWith(e+k)||t===e)return{resolved:t,root:e};return null}function Us(e,n){if(0===n.length||null==e)return e;const[t,...o]=n;if("*"!==t)return Us(e[/^\d+$/.test(t)?Number(t):t],o);if(Array.isArray(e)){const n=e.map(e=>Us(e,o)).filter(e=>void 0!==e);return n.length>0?n:void 0}if("object"==typeof e){const n={};for(const t of Object.keys(e)){const i=Us(e[t],o);void 0!==i&&(n[t]=i)}return Object.keys(n).length>0?n:void 0}}function Is(e,n,t,o,i){if(i>10)return[];const a=[],s=l(e,{withFileTypes:!0}),r="node_modules"===(e.split("/").pop()||e.split("\\").pop()||"");for(const c of s){if(r){if(".needle"!==c.name&&".vite"!==c.name)continue}else{if("Library"===c.name)continue;if(c.name.startsWith(".")||"node_modules"===c.name){if(!t)continue;if(c.name.startsWith("."))continue}}const s=w(e,c.name);if(c.isDirectory())t&&a.push(...Is(s,n,!0,o,i+1));else{if(o&&!o.split("|").map(e=>(e=e.trim()).startsWith(".")&&!e.startsWith("*.")?"*"+e:e).filter(Boolean).some(e=>ce(c.name,e,{nocase:!0})))continue;a.push(s)}}return a}const qs="settings.json";function Ws(){return W(I(),".needle")}function Ps(e){const n=W(null!=e?e:Ws(),qs);if(!T(n))return{};try{const e=JSON.parse(N(n,"utf-8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function Bs(e){return"disabled"===Ps(e).remote_ai_tools}function Ds(e,n){if(!T(e))try{E(e,{recursive:!0})}catch{}let t=null,o=null;try{t=L(e,{persistent:!1},(e,t)=>{t&&t.toString()!==qs||(o&&clearTimeout(o),o=setTimeout(()=>{o=null;try{n()}catch{}},50))}),null==t.on||t.on("error",()=>{})}catch{}return()=>{o&&(clearTimeout(o),o=null);try{var e;null==(e=t)||e.close()}catch{}t=null}}var Ms={__proto__:null,KNOWN_SETTINGS:{remote_ai_tools:{displayName:"Remote AI tools",default:"enabled",description:"Allow Needle Cloud AI chat to dispatch tool calls (file reads, search, etc.) to this machine.",command:"needle-cloud settings remote-ai-tools <true|false>"}},defaultSettingsDir:Ws,readSettings:Ps,writeSetting:function(e,n,t){const o=Ps(e);null===t?delete o[n]:o[n]=t,E(e,{recursive:!0}),A(W(e,qs),JSON.stringify(o,null,2)+"\n","utf-8")},areRemoteAiToolsDisabled:Bs,watchSettings:Ds};const Gs=2e3,Js=6e4,Hs=25e3,Ks=1e4,Vs=o();let Ys=null,Zs=null,Xs=null,Qs=null,er=Gs,nr=!1,tr=!1;function or(){Ys||(Bs()?$a("Needle Cloud connection: skipped (remote_ai_tools disabled in settings)"):(nr=!1,Zs&&(clearTimeout(Zs),Zs=null),er=Gs,ar()))}function ir(e){nr=!0,sr(),Zs&&(clearTimeout(Zs),Zs=null),Ys?($a(`Needle Cloud connection: closing (reason: ${null!=e?e:"shutdown"})`),Ys.close(1e3,null!=e?e:"shutdown"),Ys=null):e&&$a(`Needle Cloud connection: disconnect requested (reason: ${e}) — no active connection`)}async function ar(){let e=await async function(){try{var e;return null!=(e=(await os(es(),{getAccessToken:!0,fetchUserInfo:!1,resource:Wa.resource})).accessToken)?e:null}catch(e){return $a(`Token refresh failed: ${e instanceof Error?e.message:e}`),e&&"object"==typeof e&&"oidc.invalid_grant"===e.code&&(Da(),Qa=null),null}}();if(e||(e=function(){const e=Za("accessToken");if(a.existsSync(e)){const n=a.readFileSync(e,"utf8");if(n){const e=JSON.parse(n),t=null==e?void 0:e["@https://cloud.needle.tools/api"];return null==t?void 0:t.token}}return null}(),e&&$a("Needle Cloud connection: using cached token (refresh failed)")),!e)return tr||($a("Needle Cloud connection: skipped (not logged in)"),tr=!0),void rr(!0);tr=!1;const n="https://cloud.needle.tools/api".replace(/^http/,"ws")+"/v1/cli/ws?token="+encodeURIComponent(e)+"&instance="+encodeURIComponent(Vs);$a("Needle Cloud connection: connecting...");const t=`needle-cloud/${xs()} Node/${process.versions.node}`;Ys=new ae(n,{headers:{"User-Agent":t,Origin:"cli://needle-cloud"}}),Ys.on("open",()=>{er=Gs,$a("Needle Cloud connection: established"),function(){var e,n,t,o,i;if(!Ys||Ys.readyState!==ae.OPEN)return;const a=ms(),s=null==a||null==(e=a.entries)||null==(e=e.sort((e,n)=>n.last_accessed-e.last_accessed))?void 0:e[0],r={type:"presence",editor:null!=(n=null==s?void 0:s.editor)?n:"unknown",project:null!=(t=null==s?void 0:s.project_location)?t:null,scene:null!=(o=null==s?void 0:s.scene_location)?o:null,web_project:null!=(i=null==s?void 0:s.web_location)?i:null,cli_version:xs()};Ys.send(JSON.stringify(r))}(),function(){if(!Ys||Ys.readyState!==ae.OPEN)return;try{zs()}catch(e){$a(`Needle Cloud connection: registerServerTools failed: ${e}`)}const e=ws.map(e=>e.name);$a(`Needle Cloud connection: sending ${e.length} tools: ${e.join(", ")}`),Ys.send(JSON.stringify({type:"tools",tools:ws.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema}))}))}(),sr(),Xs=setInterval(()=>{Ys&&Ys.readyState===ae.OPEN&&(Ys.ping(),Qs=setTimeout(()=>{$a("Needle Cloud connection: pong timeout, terminating"),Ys&&Ys.terminate()},Ks))},Hs)}),Ys.on("pong",()=>{Qs&&(clearTimeout(Qs),Qs=null)}),Ys.on("message",e=>{try{const t=JSON.parse(e.toString());var n;"execute_tool"===t.type&&t.requestId&&t.toolName&&async function(e,n,t){$a(`Cloud tool request: ${n}(${Object.keys(t).length>0?" "+Object.entries(t).map(([e,n])=>`${e}=${JSON.stringify(n)}`).join(", "):""}) [${e}]`);const o=Date.now();try{var i,a;const s=await Ts(n,t);$a(`Cloud tool result: ${n} → ${null!=(i=null==s||null==(a=s.content)?void 0:a.reduce((e,n)=>{var t;return e+((null==(t=n.text)?void 0:t.length)||0)},0))?i:0} chars in ${Date.now()-o}ms [${e}]`),Ys&&Ys.readyState===ae.OPEN&&Ys.send(JSON.stringify({type:"tool_result",requestId:e,result:s}))}catch(t){const i=t instanceof Error?t.message:String(t);$a(`Cloud tool error: ${n} → ${i} in ${Date.now()-o}ms [${e}]`),Ys&&Ys.readyState===ae.OPEN&&Ys.send(JSON.stringify({type:"tool_result",requestId:e,error:i}))}}(t.requestId,t.toolName,null!=(n=t.args)?n:{})}catch{}}),Ys.on("close",(e,n)=>{const t=(null==n?void 0:n.toString())||"";$a(`Needle Cloud connection: closed (code=${e}${t?" "+t:""})`),sr(),Ys=null,nr||rr()}),Ys.on("error",e=>{$a(`Needle Cloud connection: error - ${e.message||"connection refused"} (is https://cloud.needle.tools/api reachable?)`)})}function sr(){Xs&&(clearInterval(Xs),Xs=null),Qs&&(clearTimeout(Qs),Qs=null)}function rr(e=!1){nr||Zs||(e||$a(`Needle Cloud connection: reconnecting in ${er/1e3}s`),Zs=setTimeout(()=>{Zs=null,ar()},er),er=Math.min(2*er,Js))}const cr=e=>{const n=ie();return n.use("/:action",async(n,t,o)=>{const{action:i}=n.params,a=(s={navigate:e=>{t.redirect(e)}},new oe(qa,{storage:Xa,navigate:e=>{if(null==s.navigate)throw new Error("Can not navigate");s.navigate(e)}}));var s;switch(i){case"sign-in":e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,$a("Sign in..."),await a.clearAllTokens(),ns();try{await a.signIn(`${Ua}/auth-callback`)}catch(e){const n=null==e?void 0:e.cause,o=`Sign-in failed: ${null!=n&&n.code?`${n.code}${n.address?` (${n.address}:${n.port})`:""}`:(null==e?void 0:e.message)||"unknown error"}`;return $a(o),console.error(o),t.status(502).send(o)}break;case"sign-out":{var r,c;const n=await is(),t=(null==n||null==(r=n.userInfo)?void 0:r.sub)||(null==n||null==(c=n.claims)?void 0:c.sub),o=null==n?void 0:n.accessToken;$a(`Sign out... (${t})`),t&&o&&await async function(e){return!e.accessToken||import("node-machine-id").then(async n=>{const t=await ls();return as=t,await fetch("https://cloud.needle.tools/api"+de.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify({action:"logout",machine_id:t,machine_name:ps()})}).catch(e=>{$a(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`),console.error(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`)}),!0})}({userId:t,accessToken:o}).catch(e=>{console.error(e),$a(`Failed to validate logout: ${e}`)}),e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,console.log("User signed out"+(t?`: ${t}`:"")),await a.signOut(Pa()),ns();break}case"auth-callback":if(n.url){const o=await a.handleSignInCallback(`${Ua}${n.originalUrl}`).catch(e=>({error:e}));if(ns(),o&&"error"in o){$a(`Error during sign in: ${o.error}`);const e=o.error instanceof Error?o.error.message:String(o.error);t.redirect(Ua+"?cancelled&message="+encodeURIComponent(e))}else{var l,p,u,d;const n=await is();if(null!=n&&n.isAuthenticated){var m,f;e.invalid_login=!1,e.user_email=(null==(m=n.claims)?void 0:m.email)||(null==(f=n.userInfo)?void 0:f.email)||null,e.logged_in_machine_names=[...ss(n)];const o=await us(n,{signout:!0});if(!o)return e.invalid_login=!0,e.invalid_login_type="too-many-logins",t.redirect(Pa("too-many-logins"));if("object"==typeof o&&"error"in o)return e.invalid_login=!0,e.invalid_login_type="error",e.error=o.error,t.redirect(Pa("error"));ns()}console.log(`User logged in: ${(null==n||null==(l=n.userInfo)?void 0:l.sub)||(null==n||null==(p=n.claims)?void 0:p.sub)}`),$a(`User logged in: ${(null==n||null==(u=n.userInfo)?void 0:u.sub)||(null==n||null==(d=n.claims)?void 0:d.sub)}`),or(),t.redirect(Ua)}}break;default:o()}}),n};function lr(e){var n,t,o,i;if(!e)return"";let a=(null==(n=e.claims)?void 0:n.name)||(null==(t=e.userInfo)?void 0:t.name)||(null==(o=e.claims)?void 0:o.username)||"";var s,r;return(!a||a.length<=0)&&null!=(i=e.claims)&&i.email?(r=null==(s=e.claims)?void 0:s.email)?(r=(r=(r=(r=r.split("@")[0]).replace(/[^a-zA-Z0-9]/g," ")).replace(/\s+/g," ")).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),r):r:a}async function pr(e,n=null){var t,o;if(!e)return{status:500,error:"User is not provided"};if(!e.isAuthenticated)return{status:403,error:"User is not authenticated"};const i=(null==(t=e.claims)?void 0:t.sub)||(null==(o=e.userInfo)?void 0:o.sub);n===i&&(n=null);let a=null;if(null==n)a=e.accessToken;else if(null!=n){var s;let t=null==e||null==(s=e.userInfo)||null==(s=s.organization_data)?void 0:s.find(e=>e.id===n);if(!t){var r;const o=n.toLowerCase();t=null==e||null==(r=e.userInfo)||null==(r=r.organization_data)?void 0:r.find(e=>e.name.toLowerCase()===o)}if(!t)return{status:403,error:`User is not part of team "${n}"`};n=t.id,a=await e.client.getOrganizationToken(t.id).catch(e=>{var o;return console.error(`Error getting organization token for "${null==(o=t)?void 0:o.name}" (${n}): ${e.message}`),null})}return a?{authToken:a,org:n}:{status:403,error:"No access token found"}}const ur=function(){return async(e,n,t)=>{const o=await is();Object.defineProperty(e,"user",{enumerable:!0,get:()=>o}),t()}},dr=`${Ua}/mcp`,mr="2025-06-18",fr={name:"Needle Cloud MCP",version:"1.0.0"};function hr(e){return{jsonrpc:"2.0",id:e,result:{protocolVersion:mr,capabilities:{tools:{listChanged:!0}},serverInfo:fr}}}async function gr(e,n){const t=!0===(null==n?void 0:n.proxy),{method:o,params:i,id:a}=e;if("initialize"===o)return hr(null!=a?a:0);if("ping"===o)return{jsonrpc:"2.0",id:a,result:{}};if("notifications/initialized"===o||"notifications/cancelled"===o)return null;if("tools/list"===o){try{zs()}catch{}let e=ws;if(t){const n=await async function(){try{var e,n;const t=await fetch(dr,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"}),signal:AbortSignal.timeout(2e3)});return t.ok&&null!=(e=null==(n=(await t.json()).result)?void 0:n.tools)?e:[]}catch{return[]}}();if(n.length>0){const t=new Set(ws.map(e=>e.name));e=[...ws,...n.filter(e=>!t.has(e.name))]}}return{jsonrpc:"2.0",id:a,result:{tools:e}}}if("tools/call"===o){const e=null==i?void 0:i.name;try{zs()}catch{}try{return{jsonrpc:"2.0",id:a,result:await Ts(e,(null==i?void 0:i.arguments)||{})}}catch(n){if(t)try{const n=await async function(e,n){const t=await fetch(dr,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:e,arguments:n}}),signal:AbortSignal.timeout(35e3)}),o=await t.json();if(o.error)throw new Error(o.error.message);return o.result}(e,(null==i?void 0:i.arguments)||{});return{jsonrpc:"2.0",id:a,result:n}}catch{}return{jsonrpc:"2.0",id:a,error:{code:-32603,message:`Tool execution failed: ${n.message}`}}}}return{jsonrpc:"2.0",id:null!=a?a:null,error:{code:-32601,message:`Method '${o}' not found`}}}function vr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}let xr=!1;const br=ie(),yr=new Set,wr=new Map;let _r=0;function kr(){const e=[];for(const[n,{connectedAt:t,userAgent:o}]of wr)e.push({id:n,connectedAt:t,userAgent:o});return e}function jr(e,n,t){if((n.headers.accept||"").includes("text/event-stream")){t.setHeader("Content-Type","text/event-stream"),t.setHeader("Cache-Control","no-cache"),t.setHeader("Connection","keep-alive"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),t.flushHeaders(),t.write(": connected\n\n");const o=n.headers["user-agent"]||"";return wr.set(e,{id:e,client:t,connectedAt:Date.now(),userAgent:o}),console.log(`[MCP] SSE client connected (ID: ${e}) ${o}. Total clients: ${wr.size}`),$a(`MCP SSE client connected (ID: ${e}) ${o}. Total clients: ${wr.size}`),n.on("close",()=>{console.log(`[MCP] SSE client disconnected (ID: ${e}): ${o}`),$a(`MCP SSE client disconnected (ID: ${e}): ${o}`),wr.delete(e)}),!0}return!1}function Sr(e){if(!Array.isArray(e))return console.error("Invalid input: paths should be an array of strings."),null;for(const n of e)if(!1!==s(n))try{const e=$r(n);if(e)return e}catch(e){}}function $r(e){const n=w(e,".git");if(s(n)){const e=function(e){const n=m(e);if(n.isDirectory())return w(e,"config");if(n.isFile()){const n=c(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(n){let t=n[1].trim();j(t)||(t=y(S(e),t));const o=w(t,"config");if(s(o))return o;const i=w(t,"commondir");if(s(i)){let e=c(i,"utf-8").trim();return j(e)||(e=y(t,e)),w(e,"config")}}}return null}(n);if(e&&s(e)){const n=function(e){const n=c(e,"utf-8"),t=/\[remote\s+"(?<name>.+?)"\].+?url\s*=\s*(?<url>.+?)$/gms,o=[];let i;for(;null!==(i=t.exec(n));)if(i.groups){const e=i.groups.name,n=i.groups.url.trim();n.length&&o.push({name:e,url:n})}const a=o.find(e=>"origin"===e.name)||o.find(e=>"upstream"===e.name)||o[0];return a?a.url:null}(e);if(n)return n}}const t=w(e,".plastic");if(s(t)){const e=w(t,"replicas.db");if(s(e)){const n=c(e,"utf-8").split("\n");for(const e of n){const n=e.split("=");if(2===n.length&&"repo"===n[0].trim()){const e=n[1].trim();if(e.length)return e}}}}const o=w(e,"..");return o===e?null:$r(o)}br.get("/mcp",async(e,n)=>{if(jr(_r++,e,n))return;const t=function(e){const n=[...ws].sort((e,n)=>e.name.localeCompare(n.name)),t=n.map(e=>`\n <div class="tool">\n <span class="tool-name">${vr(e.name)}</span>\n <span class="tool-desc">${vr(function(e){const n=e.indexOf("\n");return-1===n?e:e.slice(0,n)}(e.description))}</span>\n </div>`).join("\n");return`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Needle MCP Server</title>\n <style>\n * { box-sizing: border-box; }\n body {\n background: #f0f4ef;\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.6;\n padding: 20px 24px;\n max-width: 960px;\n margin: 0 auto;\n color: #1a1a1a;\n }\n header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n }\n h2 {\n margin-top: 1.2em;\n margin-bottom: 0.4em;\n }\n a { color: inherit; }\n img.logo {\n height: 2em;\n width: auto;\n }\n .badge {\n font-size: 0.75em;\n background: #d0d4cf;\n padding: 2px 8px;\n border-radius: 10px;\n vertical-align: middle;\n font-weight: normal;\n }\n .tools-info {\n color: #555;\n font-size: 0.9rem;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n /* Tool items */\n .tool {\n background: #fff;\n border: 1px solid #d8dcd7;\n border-radius: 6px;\n margin-bottom: 6px;\n padding: 10px 14px;\n display: flex;\n align-items: baseline;\n gap: 10px;\n }\n .tool-name {\n font-weight: 600;\n white-space: nowrap;\n }\n .tool-desc {\n color: #555;\n font-size: 0.9rem;\n }\n</style>\n</head>\n<body>\n <header>\n <img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" />\n <strong>Needle MCP Server</strong>\n </header>\n\n <p>The Needle MCP server is alive and running.</p>\n\n <h2>Usage</h2>\n <p><a href="https://fwd.needle.tools/mcp">Open Documentation</a></p>\n\n <h2>Available Tools <span class="badge">${n.length}</span></h2>\n <p class="tools-info">These tools are available to AI agents connected via the Model Context Protocol (MCP).</p>\n ${t}\n</body>\n</html>`}();n.status(200).header("Content-Type","text/html; charset=utf-8").send(t)}),br.post("/mcp",async(e,n)=>{const t=e.headers.accept||"",o=e.headers["user-agent"]||"",{method:i,id:a}=e.body;console.log(`[MCP] Received request from ${o} (${i}) (ID: ${a})`),n.setHeader("Content-Type","application/json"),n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id");try{if("initialize"===i&&t.includes("text/event-stream")){const t=void 0!==a?a:_r++;if(jr(t,e,n)){xr=!0;const e=hr(t);return void n.write(`data: ${JSON.stringify(e)}\n\n`)}}const r=await gr(e.body);if("initialize"===i){xr=!0;const e=v();yr.add(e),n.setHeader("Mcp-Session-Id",e),console.log(`[MCP] New session created: ${e} for ${o}`),$a(`MCP New session: ${e} for ${o}`)}if(null===r)return n.status(204).end();if($a(`MCP Request: ${i}`),"tools/list"===i){var s;const e=(null==(s=r.result)||null==(s=s.tools)?void 0:s.map(e=>e.name))||[];console.log(`[MCP] Sending tools/list: ${e.length} tools [${e.join(", ")}]`)}else{const e=JSON.stringify(r);console.log(`[MCP] Sending response for ${i}:`,e.length>500?e.substring(0,500)+" [...]":e)}n.json(r)}catch(e){console.error("[MCP] Error processing request:",e);const t={jsonrpc:"2.0",error:{code:-32603,message:"Internal server error",data:"development"===process.env.NODE_ENV?e.stack:void 0},id:a||null};n.json(t)}}),br.options("/mcp",(e,n)=>{n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS, DELETE"),n.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),n.status(204).end()});let Tr=!1;function Er(e,n={}){Tr&&process.stdout.write(JSON.stringify({jsonrpc:"2.0",method:e,params:n})+"\n")}var Cr={__proto__:null,sendStdioNotification:Er,startStdio:function(){Tr=!0,process.stdin.resume();const e=pe({input:process.stdin,terminal:!1});e.on("line",async e=>{const n=e.trim();if(!n)return;let t;try{t=JSON.parse(n)}catch{return void process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}})+"\n")}const o=await gr(t,{proxy:!0});null!==o&&process.stdout.write(JSON.stringify(o)+"\n")}),e.on("close",()=>{Tr=!1,process.exit(0)})}};let Or=null;function Rr(){Or&&clearTimeout(Or),Or=setTimeout(()=>{!function(e,n={}){if(0===wr.size)return;const t=`data: ${JSON.stringify({jsonrpc:"2.0",method:"notifications/tools/list_changed",params:n})}\n\n`;for(const[e,{client:n}]of wr)try{n.write(t)}catch(n){console.error(`[MCP] Error sending notification to client (${e}):`,n),wr.delete(e)}}(),Er("notifications/tools/list_changed")},10)}const zr=new Set(["https://cloud.needle.tools","https://needle.tools","https://engine.needle.tools","https://docs.needle.tools","chrome-extension://kjcepmifiddcepiocokclhibpkgcdomk","chrome-extension://jonplpbnhmanoekkgcepnedhghflblmo"]),Nr=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Ar(e){if("string"!=typeof e||0===e.length)return!1;if(zr.has(e))return!0;let n;try{n=new URL(e)}catch{return!1}if("/"!==n.pathname&&""!==n.pathname)return!1;if(""!==n.search||""!==n.hash)return!1;if("http:"!==n.protocol&&"https:"!==n.protocol)return!1;const t=n.hostname.toLowerCase();return!!Nr.has(t)||"::1"===t}const Lr="[MCP]",Fr=new Array,Ur="2026-05-30T17:01:27.266Z",{json:Ir}=le;function qr(e){const n=null==e?void 0:e.cause;return null!=n&&n.code?`${n.code}${n.address?` (${n.address}:${n.port})`:""}`:null!=n&&n.message?n.message:null!=e&&e.code?e.code:null!=e&&e.message&&"fetch failed"!==e.message?e.message:"connection refused or network unreachable"}async function Wr(n={restart:!1}){const t=await e(Ua).catch(e=>({ok:!1})),i="/sign-in",a="/api/authenticated",r="/api/projects",c="/api/content",l={baseUrl:Ua,port:Fa,isHost:!1,auth_endpoints:{"sign-in":`${Ua}${i}`,"sign-out":`${Ua}/sign-out`,"is-authenticated":`${Ua}${a}`}};let p=t.ok;if(p){var u;const h=await e(`${Ua}/api/info`).catch(()=>null);if(null!=h&&h.ok){const g=await h.json().catch(()=>null);null!=g&&g.api_endpoint&&"https://cloud.needle.tools/api"!==g.api_endpoint&&($a(`Running server uses different API endpoint (${g.api_endpoint} vs https://cloud.needle.tools/api), restarting...`),n||(n={}),n.restart=!0)}if(!0===(null==(u=n)?void 0:u.restart)){$a("Restarting auth server...");const v=`${Ua}/restart`;n.ora&&(n.ora.text="Sending restart request to server");const x=new AbortController;setTimeout(()=>x.abort(),1e4);let b={};try{const _=w(Z(),".needle","local-server-token"),k=JSON.parse((await import("fs")).readFileSync(_,"utf-8"));k.token&&(b={Authorization:`Bearer ${k.token}`})}catch{}const y=await e(v,{method:"post",signal:x.signal,headers:b}).catch(e=>({ok:!1,status:400,error:e}));if(y.ok)return await Di(300),Wr({restart:!1});console.error("Failed to restart server",y.status),$a(`Failed to restart server: ${y.status}`)}}if(!p){process.title="Needle CLI server";const j=await import("express").catch(e=>{throw console.error("Error starting the auth server (express not found)",e),$a("Error starting the auth server"),new Error("Failed to load express module")});if(!j)throw $a("Error loading auth server module"),new Error("Failed to load express module");$a(`Starting Needle CLI server ${xs()} (built ${Ur})... (Using api at https://cloud.needle.tools/api)`,{emptyLineBefore:!0}),l.isHost=!0;let S=null;const $={invalid_login:!1,invalid_login_type:null,user_email:null,logged_in_machine_names:[]};let T=j.default();T.use(Ir({limit:"10mb"}));const C=w(Z(),".needle"),O=function(e,n){const t=o(),i=W(e,"local-server-token");E(e,{recursive:!0});const a=JSON.stringify({token:t,pid:process.pid,port:n},null,2);if(A(i,a,{encoding:"utf-8",mode:384}),"win32"===process.platform)try{const e=process.env.USERNAME||process.env.USER||"";e&&ue("icacls",[i,"/inheritance:r","/grant:r",`${e}:(F)`],{stdio:"ignore",timeout:5e3})}catch{}return t}(C,Fa);$a(`Local token written to ${w(C,"local-server-token")}`);const R=function(e,n=5e3){const t=new Map,o=Math.max(1,Math.round(n/1e3));return(i,a)=>{const s=Date.now(),r=t.get(i);if(!r||s-r.lastLog>n){var c;const n=null!=(c=null==r?void 0:r.suppressed)?c:0;e(n>0?`${a} [+${n} similar in last ${o}s]`:a),t.set(i,{lastLog:s,suppressed:0})}else r.suppressed++}}(e=>$a(`Denied: ${e}`),5e3);T.use(function(e){const n=null==e?void 0:e.onDenied;return(e,t,o)=>{var i,a;if("OPTIONS"===e.method)return o();const s=null==(i=e.headers)?void 0:i.origin,r=null==(a=e.headers)?void 0:a["sec-fetch-site"];if("none"===r||"same-origin"===r)return o();if(s){if(Ar(s))return o();if(n)try{var c,l,p,u;const t=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown",o=null!=(p=null!=(u=e.path)?u:e.url)?p:"?";n(`origin|${s}|${o}`,`denied origin=${s} path=${o} ua="${t}"`)}catch{}return t.status(403).send("Forbidden: origin not allowed")}return o()}}({onDenied:R}));const z=new Set(["/","/sign-in","/sign-out","/auth-callback","/api/info","/api/authenticated","/api/public_key","/mcp","/register"]),N="needle_local";T.use((e,n,t)=>{var o,i,a;if("OPTIONS"===e.method)return t();if(z.has(e.path))return t();if(e.path.startsWith("/mcp/"))return t();if(e.path.startsWith("/.well-known/"))return t();const s=null==(o=e.headers)?void 0:o.authorization;if(s){const e=s.split(" ");if(2===e.length&&"Bearer"===e[0]&&e[1]===O)return t()}if((null==(i=e.query)?void 0:i.token)===O)return t();const r=((null==(a=e.headers)?void 0:a.cookie)||"").split(";").map(e=>e.trim()).find(e=>e.startsWith(N+"="));if(r&&r.split("=")[1]===O)return t();try{var c,l;const n=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown";R(`token|${n}|${e.path}`,`path=${e.path} ua="${n}" — no valid token or cookie`)}catch{}return n.status(401).send("Unauthorized: token required")}),T.use(cr($)),n.ora?(n.ora.start("Starting MCP server..."),n.ora.succeed(`MCP server available at ${Ua}/mcp`)):console.log(`\nMCP server available at ${Ua}/mcp .`),T.use(br);const L="\n <title>Needle Cloud</title>\n <link rel=\"icon\" href=\"https://cdn.needle.tools/static/branding/favicon.ico\" type=\"image/x-icon\">\n <style>\n body { \n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 18px;\n padding: 2rem;\n background: #f0f4ef;\n }\n a {\n color: rgb(120, 76, 223);\n }\n .main_panel {\n display: flex;\n flex-direction: column;\n gap: .5rem;\n justify-content: flex-start;\n align-items: center;\n width: min(80ch, 90vw);\n margin: 0 auto;\n\n height: 100%;\n\n & img.logo {\n height: 3rem;\n margin-bottom: 1rem;\n }\n }\n .secondary {\n color: rgba(0, 0, 0, .5);\n }\n .error-details {\n font-size: 12px;\n color: rgba(0, 0, 0, .5);\n }\n .error-details a {\n color: inherit;\n }\n </style>",F=`<div class="main_panel"><img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" title="Needle Logo (${xs()})"/>`,U="</div>";let I="";T.get("/",ur(),async(e,n)=>{var t,o;if(null!=(t=e.user)&&t.isAuthenticated?n.cookie(N,O,{httpOnly:!0,sameSite:"strict",path:"/"}):n.clearCookie(N,{path:"/"}),n.set({"Content-Type":"text/html; charset=utf-8"}),n.write(L),null!=e.query.cancelled)return n.end("Login cancelled. You can close this window now."),void $a("Login cancelled by user");if(null!=e.query["too-many-logins"]&&$.logged_in_machine_names.length){var a;const e=ua();let t="<div>";return t+="<strong>You have reached the maximum number of allowed device logins!</strong><br/><br/>",t+=(null==(a=$.logged_in_machine_names)?void 0:a.map(e=>`• ${e}`).join("<br/>"))+"<br/><br/>",t+=`1) Go to <a href="${e}#device-logins" target="_blank">Needle Cloud device logins</a> and logout one of your devices.<br/>\n 2) Then <a href="${i}">sign-in on this machine</a>.<br/><br/>`,t+="</div>",n.status(406),n.end(F+t+U),void $a(`Login failed: Too many logins from different machines: [${$.logged_in_machine_names.join(", ")}]`)}if(null!=e.query.error)return n.status(500),void n.end(`${F}\n <div>\n <strong>An error occurred</strong>: Please make sure <i>https://cloud.needle.tools/api</i> and <i>https://auth.needle.tools</i> are reachable and not blocked by your firewall or network. After that please try to <a href="${i}">sign-in</a> again.\n <br/><span class="error-details">If the issue persists, please contact support and include the log file: <a title="Link to local log file. Please copy this url and open it in your file explorer or terminal" href="file://${Sa()}" target="_blank">${Sa()}</a></span>\n </div>\n ${U}`);if(null!=(o=e.user)&&o.isAuthenticated){var s;if(!await cs(e.user)){if($.invalid_login=!0,$.logged_in_machine_names=[...ss(e.user)],Da(),$a("Cleared stored auth data"),"client"in e.user){const n=e.user;await n.client.clearAccessToken(),await n.client.clearAllTokens(),$a("Cleared all tokens")}return n.end(`${F}<div>You have been logged out from this machine. You can close this window now or try to <a href="${i}">sign in</a> again</div>${U}`)}$.invalid_login=!1,n.end(`${F}\n <div>\n Hi ${lr(e.user)} — you logged in successfully. You can close this window now.\n </div>\n ${U}`);const t=`Logged in successfully as ${lr(e.user)} (${null==(s=e.user.userInfo)?void 0:s.sub})`;return void(I!==t&&(I=t,$a(I)))}let r=`<span><a href="${i}">Sign in</a> to your Needle account</span>`;"1"===e.query["signed-out"]&&(r=`<span class="secondary">You have been signed out successfully.</span>${r}`),n.write(F+r+U),n.end()}),T.post("/restart",(e,t)=>{var o;n.ora&&(n.ora.text="Received restart event. This instance will close"),null==(o=S)||o.close(e=>{e&&console.error(e)}),setTimeout(()=>{process.exit(0)},100),t.status(200).end("Server is restarting"),$a("Server is restarting\n")}),T.get("/api/logs",async(e,n)=>{const t=Sa();s(t)?f(t,"utf-8",(e,o)=>{if(e)return console.error(e),void n.status(500).end("Failed to read log file");n.set({"Content-Type":"text/plain; charset=utf-8"});const i=o.split("\n").filter(e=>e.length>0).reverse().join("\n");let a=`--- Needle CLI v${xs()} (built ${Ur}) Log File (newest first) ---\n${t}\n\n`;a+=i,n.status(200).end(a)}):n.status(404).end("Log file not found")}),T.get("/api/info",(e,n)=>{n.json({api_endpoint:"https://cloud.needle.tools/api",version:xs()})}),T.get(a,ur(),async(e,n)=>{var t;if(!0===$.invalid_login){const e=Pr($);return n.status(e.status).json(e)}$.invalid_login=!1,n.status(null!=(t=e.user)&&t.isAuthenticated?200:400).send()}),T.get("/api/user",ur(),async(e,n)=>{var t;const o=e.user;if(null==o||!o.isAuthenticated){if(!0===$.invalid_login){const e=Pr($);return n.status(e.status).json(e)}return n.status(401).json({error:"Not authenticated"})}if($.invalid_login=!1,!await cs(o))return Da(),n.status(403).json({error:"You have been logged out from this machine"});if(null==o||!o.claims)return n.status(400).json({error:"User claims not found"});if(null==o||!o.userInfo)return n.status(400).json({error:"User info not found"});const i=null==o||null==(t=o.claims)?void 0:t.organization_roles,a=null==o?void 0:o.userInfo.custom_data,s={authenticated:o.isAuthenticated,id:o.userInfo.sub,name:lr(o),email:o.claims.email||o.userInfo.email||"",profile_picture:o.userInfo.picture||"",default_org_id:(null==a?void 0:a.default_org)||"none",orgs:[]},r=["manage","owner","member","developer"];o.userInfo.organization_data&&(s.orgs=o.userInfo.organization_data.map(e=>{var n;const t={id:e.id,name:e.name,roles:(null==i?void 0:i.filter(n=>n.startsWith(e.id)).map(e=>e.split(":")[1]))||[],canWrite:!1};return t.canWrite=null==(n=t.roles)?void 0:n.some(e=>r.includes(e)),t}).sort((e,n)=>e.id===s.default_org_id?-1:n.id===s.default_org_id?1:e.name.localeCompare(n.name))),n.json(s)}),T.get("/api/license",ur(),async(n,t)=>{var o,i,a;const s=null==(o=n.query.token)?void 0:o.toString(),r=null==(i=n.query.org)?void 0:i.toString();let c=null;if(s)c={authToken:s};else{const e=await is();if(!e||!e.isAuthenticated)return t.status(401).json({error:"Not authenticated",code:"not_authenticated"});if(!await cs(e))return Da(),t.status(403).json({error:"Invalid login"});c=await pr(e,r||null).catch(e=>({status:500,error:e.message}))}if(!c)return t.status(500).json({error:"Failed to fetch licenses (Missing auth)"});if("error"in c)return t.status(c.status).json({error:c.error});const l=me(c),p=null==(a=n.query.integration)?void 0:a.toLocaleString(),u={...l,"x-needle":"cli","x-needle-integration":null!=p&&p.length?p:"unknown"},d=await e(`https://cloud.needle.tools/api${de.account.get_licenses}`,{method:"GET",headers:u}).catch(e=>{const n=qr(e);return console.error("Failed to fetch licenses:",n),$a(`Failed to fetch licenses: "${n}" - is https://cloud.needle.tools/api reachable?`),null});if(!d)return t.status(502).json({error:"Failed to fetch licenses: upstream API unreachable"});if(d.ok){const e=await d.json();return void 0===e.can_use_editor&&(e.can_use_editor=!0),t.json(e)}return t.status(d.status).json({error:d.statusText})}),T.get("/api/deployments",ur(),async(e,n)=>{var t;const o=await is();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i=null==(t=e.query.org)?void 0:t.toString(),a=await pr(o,i).catch(e=>({status:500,error:e.message}));if("error"in a)return n.status(a.status).json({error:a.error});if(i&&!a.org)return n.status(400).json({error:"Organization not found"});const s=await za({endpoint:"https://cloud.needle.tools/api",authToken:a.authToken,org:a.org||void 0,limit:20,offset:0,names:void 0}).catch(e=>(console.error("List Deployments error: "+e.message),{status:502,error:"Failed to list deployments: upstream API unreachable"}));if("error"in s)return n.status(s.status).json({error:s.error});for(const e of s.deployments)e.editUrl=`${da()}/${e.id}`;const r={...s};return n.json(r)}),T.get(c,ur(),async(e,n)=>{var t,o,i,a,s,r,c,l;const p=await is();if(!p||!p.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const u=(null==(t=e.query.org)?void 0:t.toString())||(null==(o=p.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,d=await pr(p,u).catch(e=>({status:500,error:e.message}));if("error"in d)return n.status(d.status).json({error:d.error});const m={content_type:(null==(i=e.query.content_type)?void 0:i.toString())||void 0,content_format:(null==(a=e.query.content_format)?void 0:a.toString())||void 0,search:(null==(s=e.query.search)?void 0:s.toString())||void 0,tags:(null==(r=e.query.tags)?void 0:r.toString())||void 0,types:(null==(c=e.query.types)?void 0:c.toString())||void 0,trash:"true"===e.query.trash||void 0,collection_id:(null==(l=e.query.collection_id)?void 0:l.toString())||void 0,limit:e.query.limit?parseInt(e.query.limit.toString()):void 0,page:e.query.page?parseInt(e.query.page.toString()):void 0,offset:e.query.offset?parseInt(e.query.offset.toString()):void 0},f=await oa({baseUrl:"https://cloud.needle.tools/api",authToken:d.authToken,org:d.org||void 0},m).catch(e=>(console.error("List content error: "+e.message),{status:502,error:"Failed to list content: upstream API unreachable"}));return"error"in f?n.status(f.status).json({error:f.error}):n.json(f)}),T.get(c+"/:identifier",ur(),async(e,n)=>{var t,o;const i=await is();if(!i||!i.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const a=(null==(t=e.query.org)?void 0:t.toString())||(null==(o=i.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,s=await pr(i,a).catch(e=>({status:500,error:e.message}));if("error"in s)return n.status(s.status).json({error:s.error});const r=await ia({baseUrl:"https://cloud.needle.tools/api",authToken:s.authToken,org:s.org||void 0},e.params.identifier).catch(e=>(console.error("Get content error: "+e.message),{status:502,error:"Failed to get content: upstream API unreachable"}));return"error"in r?n.status(r.status).json({error:r.error}):n.json(r)}),T.get(r,ur(),async(n,t)=>{const o=await is();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i=`https://cloud.needle.tools/api${de.local_projects.get.user}`,a=await e(i,{method:"GET",headers:{Authorization:`Bearer ${o.accessToken}`}}).catch(e=>(console.error("Failed to fetch projects:",qr(e)),null));if(!a)return t.status(502).json({error:"Failed to fetch projects: upstream API unreachable"});if(!a.ok)return t.status(a.status).json({error:a.statusText});const s=await a.json().catch(e=>console.error(e));return t.json(s)}),T.get(r+"/:id",ur(),async(n,t)=>{var o;const i=await is();if(!i||!i.isAuthenticated)return t.status(401).json({error:"Not authenticated"});let a=null==(o=n.query.org)?void 0:o.toString();const s=await pr(i,a).catch(e=>({status:500,error:e.message}));if(!s)return t.status(500).json({error:"Failed to fetch projects"});if("error"in s)return t.status(s.status).json({error:s.error});const r=me(s),c=`https://cloud.needle.tools/api${de.local_projects.get.by_id}${encodeURIComponent(n.params.id)}`,l=await e(c,{method:"GET",headers:{...r}}).catch(e=>(console.error("Failed to fetch project:",qr(e)),null));if(!l)return t.status(502).json({error:"Failed to fetch project: upstream API unreachable. Please try again later or contact hi@needle.tools"});if(!l.ok)return t.status(l.status).json({error:l.statusText});const p=await l.json().catch(e=>(console.error(e),null));return p?t.json(p):t.status(500).json({error:"Failed to parse data. Please try again later or contact hi@needle.tools"})}),T.post("/api/projects",ur(),async(n,t)=>{const o=await is();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i="string"==typeof n.body?JSON.parse(n.body):n.body,a={machine_id:await ls(),project_id:i.project_id,project_name:i.project_name,scene_name:i.scene_name,web_project_path:i.web_project_path,editor_name:i.editor_name,editor_version:i.editor_version};if(!a.project_id||!a.project_name)return t.status(400).json({error:"Invalid request"});const s=`https://cloud.needle.tools/api${de.local_projects.post}`,r=await e(s,{method:"POST",headers:{Authorization:`Bearer ${o.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(a)}).catch(e=>(console.error("Failed to upsert project:",qr(e)),null));return r?r.ok?t.send("OK"):t.status(r.status).json({error:r.statusText}):t.status(502).json({error:"Failed to upsert project: upstream API unreachable"})}),T.get("/api/public_key",ur(),async(n,t)=>{var o,i;const a=await is();if(!a||!a.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const s=null==(o=n.query.org)?void 0:o.toString(),r=await pr(a,s).catch(e=>({error:e.message,status:500}));if(!r)return t.status(500).json({error:"Failed to fetch public key"});if("error"in r)return t.status(r.status).json({error:r.error});const c={project_id:(null==(i=n.query.project_id)?void 0:i.toString())||void 0,machine_id:await ls()},l=await e(`https://cloud.needle.tools/api${de.account.public_key}`,{method:"POST",headers:{...me(r),"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(e=>(console.error("Failed to fetch public key:",qr(e)),null));if(!l)return t.status(502).json({error:"Failed to fetch public key: upstream API unreachable"});if(l.ok){const e=await l.json().catch(console.error);return null!=e&&e.public_key?t.json(e):t.status(500).json({error:"Failed to fetch public key"})}return t.status(l.status).json({error:l.statusText})}),T.get("/api/local_project_id",async(e,n)=>{const t=e.query.paths;if(!t)return n.status(400).json({error:"Missing paths"});let o=[];"string"==typeof t?o=t.split(",").map(e=>e.trim()).filter(e=>e.length>0):Array.isArray(t)&&(o=t.map(e=>e.toString().trim()).filter(e=>e.length>0));const i=Sr(o);return i?n.json({project_id:i}):n.status(404).json({error:"Project ID not found"})}),T.post("/api/project/info",ur(),async(e,n)=>{(function(e){try{!function(e){var n,t,o,i;const a={last_accessed:Date.now(),editor:null!=(n=e.scene_path)&&n.endsWith(".unity")?"unity":null!=(t=e.scene_path)&&t.endsWith(".blend")?"blender":"unknown",editor_version:e.editor_version,editor_installation_path:e.editor_installation_path,log_location:e.editor_log_path,project_location:e.unity_project_path||e.blender_project_path||e.scene_path,scene_location:e.scene_path,web_location:e.web_project_path,needle_engine_integration_location:e.needle_sourcecode_location},s=hs();let r=gs();const c=r.entries.findIndex(e=>e.project_location===a.project_location),l=null==(o=r.entries[0])?void 0:o.project_location;-1!==c?r.entries[c]=a:r.entries.push(a),r.entries.sort((e,n)=>n.last_accessed-e.last_accessed),r.entries.length>30&&(r.entries=r.entries.slice(0,30));const p=null==(i=r.entries[0])?void 0:i.project_location;p&&p!==l&&$a(`Active project changed: ${l||"(none)"} → ${p}`);try{ds=r;const e=JSON.stringify(r);d(s,e,"utf-8")}catch(e){console.error("Failed to save project info:",e)}}(e)}catch(e){$a("Error saving project info: "+e)}})("string"==typeof e.body?JSON.parse(e.body):e.body),n.send("OK")});let q=null;const P=new Promise(e=>q=e);function m(){$a("Cleaning up auth server...")}S=T.listen(Fa,()=>{null==q||q()}),function(e,n){e.on("connection",e=>{const t=e.remoteAddress;if(!function(e){if(!e)return!1;const n=e.includes("%")?e.slice(0,e.indexOf("%")):e;return"127.0.0.1"===n||"::1"===n||"::ffff:127.0.0.1"===n}(t)){try{null==n||n(`Local server: rejected non-loopback connection from ${t||"unknown"}`)}catch{}e.destroy()}})}(S,$a),S.on("close",m),process.on("exit",m),process.on("SIGINT",()=>{m(),process.exit(0)}),await P.catch(e=>{console.error(e),$a(`Error starting the auth server (promise failed): ${e.message}`)}),function(e,n){const t=new se({server:e,path:"/mcp/ws",verifyClient:({req:e},n)=>{var t;const o=null==(t=e.headers)?void 0:t.origin;if(o&&!Ar(o))return $a(`${Lr} rejected WS upgrade: disallowed origin ${o}`),void n(!1,403,"Forbidden: origin not allowed");n(!0)}});$a("MCP websocket server created.");let o=0,i=new Map;t.on("connection",e=>{const n=++o;Fr.push(e),console.log(`${Lr} client connected (#${n})`),$a(`${Lr} client connected (#${n})`),e.on("close",()=>{const t=Fr.indexOf(e);-1!==t&&Fr.splice(t,1);const o=i.get(n);if(o){for(const e of o)js(e,Rr);i.delete(n)}console.log(`${Lr} client disconnected (#${n})`),$a(`${Lr} client disconnected (#${n})`)});const t=new Map;e.on("message",o=>{try{const a=o.toString(),s=JSON.parse(a);switch(s.command){default:console.log(`${Lr} Unknown command: ${s.command}`),$a(`Unknown MCP websocket command received: ${s.command}`);break;case"get_connected_clients":!function(n,t){const o={clients:[...kr()],command:"mcp_server_response",messageId:"messageId"in n?n.messageId:void 0};e.send(JSON.stringify(o))}(s);break;case"register_tools":{const o=s.tools,a=s.source;a&&function(e,n){const t=ks.get(e);if(t&&t.size>0){console.log(`[MCP] Removing ${t.size} tools registered from ${e}`);let o=!1;for(const n of t){const t=ws.findIndex(e=>e.name===n);-1!==t&&(ws.splice(t,1),delete _s[n],$s.set(n,e),o=!0)}ks.delete(e),o&&n()}}(a,Rr);const r=a||"unknown";console.log(`${Lr} ${r} registered ${o.length} tool${1===o.length?"":"s"}`),$a(`${Lr} ${r} registered ${o.length} tool${1===o.length?"":"s"}`);const c=i.get(n)||new Set;i.set(n,c);for(const n of o)c.add(n.name),Ss(n,async o=>{console.log(`Tool ${n.name} executed via WebSocket with args:`,o);const i=`${n.name}-${Date.now()}-${Math.random()}`;return await new Promise((a,s)=>{const r=setTimeout(()=>{t.has(i)&&(console.error(`${Lr} Tool execution timed out for tool: ${n.name}`),t.delete(i),s(new Error(`Tool execution timed out for tool: ${n.name}`)))},3e4);t.set(i,{resolve:e=>{a(e),clearTimeout(r)},reject:s}),e.send(JSON.stringify({command:"execute_tool",toolName:n.name,args:o,requestId:i}))})},{source:a},Rr);break}case"tool_result":{const e=s.requestId,n=s.result;if(console.log(`${Lr} Received tool result for requestId: ${e}`,n),t.has(e)){const o=t.get(e);null==o||o.resolve(n),t.delete(e)}else console.error(`${Lr} No pending tool execution found for requestId: ${e}`);break}}}catch(e){console.error(`${Lr} Error processing WebSocket message:`,e)}})})}(S),zs({logToolCount:!0}),or();const B=Ds(C,()=>{Bs()?($a("Settings changed: remote_ai_tools disabled — closing cloud connection"),ir("remote_ai_tools setting disabled")):($a("Settings changed: remote_ai_tools enabled — opening cloud connection"),or())});process.on("exit",()=>{B(),ir("process exit")})}return l}function Pr(e){let n="";return n=e.error?e.error:e.logged_in_machine_names.length>0?`You're already authenticated on ${e.logged_in_machine_names.length} other machine(s)${e.user_email?` with ${e.user_email}`:""}. Please logout from other machines first on ${ua()}. You're currently logged in on: ${e.logged_in_machine_names.join(", ")}`:"An unknown error occured.",{status:403,error:n}}async function Br(e={headless:!1,silent:!1,clearAuthData:!1}){return!0===e.clearAuthData&&await Da(),Mr("sign-in",{...e})}function Dr(e={}){return Mr("sign-out",{...e})}function Mr(n,t){return new Promise(async(o,i)=>{let a=!1;if("sign-in"==n){const e=await is();if(null!=e&&e.isAuthenticated&&e.accessToken)return await us(e)?(a=!0,t.ora&&(t.ora.text=`Authorized as ${lr(e)}`),"gotoAccountPage"in t&&!0===t.gotoAccountPage&&(t.ora&&(t.ora.text="Opening account page in the browser"),ma(ua()),await new Promise(e=>setTimeout(e,2e3))),o(e)):o(null);if(!0===t.headless)return o(null)}else if("sign-out"==n&&!0===t.headless){a=!0,Da();const n=await Wr(),t=await e(n.auth_endpoints["sign-out"],{follow:2});return o(t.ok)}const s=await Wr();switch(t.timeout||(t.timeout=6e5),"number"==typeof t.timeout&&t.timeout>0&&setTimeout(()=>{a||(t.ora&&t.ora.fail('Timeout "'+n+'"'),o(null))},t.timeout),n){case"sign-in":const e=s.auth_endpoints["sign-in"];setTimeout(()=>ma(e),300),t.ora&&(t.ora.text=`Please authenticate in the browser: ${e}`),setTimeout(l,2e3);break;case"sign-out":Da(),ma(s.auth_endpoints["sign-out"]),setTimeout(l,2e3)}let r=0;const c=10;function l(){e(s.auth_endpoints["is-authenticated"]).then(async e=>{if(200===e.status||400===e.status||403===e.status)switch(n){case"sign-in":if(200===e.status){const e=await is();return e&&!await us(e)?o(null):(a=!0,t.ora&&e&&(t.ora.text="User is authenticated"),o(e))}if(403===e.status){t.ora&&t.ora.fail("Authentication failed");const n=await e.text();if(n.startsWith("{")){const e=JSON.parse(n);if("logged_in_machine_names"in e&&Array.isArray(e.logged_in_machine_names)){const n=e.logged_in_machine_names;$().fail(`You're already authenticated on ${n.length} other machine(s). Please logout from other machines first. You're currently logged in on: ${n.join(", ")}`)}}return o(null)}break;case"sign-out":if(400===e.status)return a=!0,Da(),t.ora&&(t.ora.text="User is signed-out"),o(!0)}else if(r++,r>c)return t.ora?t.ora.fail(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`):t.silent||console.error(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`),o(null);setTimeout(l,1e3)}).catch(e=>{r>=10&&console.debug("Error polling auth status: "+e.message)})}})}globalThis.fetch||(globalThis.fetch=e),globalThis.File||(globalThis.File=n),globalThis.crypto||(globalThis.crypto=t.webcrypto);const Gr=process.argv.includes("--silent"),Jr=JSON.parse(c(new URL("../package.json",import.meta.url),"utf-8"));!Gr&&process.argv.includes("version")&&console.log(`☁ Needle CLI — ${Jr.version}, Node ${process.version}`);const Hr="The access token to use. Use the login command or get a token from https://cloud.needle.tools. You can pass the access token with your command or set the environment variable NEEDLE_CLOUD_TOKEN";async function Kr(e,n=null,t=!0){let o,i=null==e?void 0:e.toString();var a;if(i||(te.config(),process.env.NEEDLE_CLOUD_TOKEN&&(i=process.env.NEEDLE_CLOUD_TOKEN,null!=(a=i)&&a.length&&console.log("Using NEEDLE_CLOUD_TOKEN token from env"))),""===i||"true"===i){const e=(await import("node:readline")).createInterface({input:process.stdin}),n=10;let t,i="",a=!1;return new Promise(s=>{const r="Paste your https://cloud.needle.tools/team#token access token here:",c=$({text:r,interval:200,spinner:"moon"}).start();process.stdin.setRawMode(!0),process.stdin.on("data",l=>{const p=l.toString();""===p&&process.exit();const u="\n"===p||"\r"===p;if(!u&&"\n"!==p&&"\r"!==p){""===p||"\b"===p?i=i.slice(0,-1):i+=p;const e=i.replace(/./g,"*");c.text=`${r} ${e}`}clearTimeout(t),t=setTimeout(()=>{if(!a&&(u||i.trim().length>n)){process.stdin.setRawMode(!1),e.close(),a=!0;const n=i.trim();if(n.length>0){const e=n.slice(3,-3).replace(/./g,"*");c.succeed("Access token received: "+e)}else c.fail("No access token provided");s({accessToken:n,org_id:o})}},150)})})}if(!i){let e;await async function(){const e=await is();return null==e?void 0:e.isAuthenticated}()||(e=Gr?void 0:$("No access token found. Please sign in to authenticate...").start()),$a("No access token provided, attempting login. Org: "+n);const a=Br({headless:!t,ora:e,timeout:12e4}),d=await a;var s;if(d&&!await cs(d)?(null==(s=e)||s.fail("You are not logged in from this machine. Please login again."),await Dr({headless:!0}),process.exit(1)):e&&($a("User logged in via getAccessToken "+(null==d?void 0:d.isAuthenticated)),d?e.succeed("Logged in"):e.fail("Login failed")),null!=d&&d.isAuthenticated){var r;if(null==n){const e=await async function(e){var n;if(!e)return{status:401,error:"Not authenticated"};const t=null==(n=e.userInfo)?void 0:n.custom_data;return t?t.default_org?t.default_org:(console.warn("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),$a("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),null):null}(d);"string"==typeof e&&(n=e)}else n===(null==(r=d.userInfo)?void 0:r.sub)&&(n=null);if(n){var c,l,p;if(o=null==(c=d.userInfo)||null==(c=c.organization_data)||null==(c=c.find(e=>e.id===n))?void 0:c.id,o||(n=null==(l=n.toString())?void 0:l.toLowerCase(),null!=o||(o=null==(p=d.userInfo)||null==(p=p.organization_data)||null==(p=p.find(e=>e.name.toLowerCase()===n))?void 0:p.id)),!o)throw new Error(`ERR: You (${lr(d)}) are not a member of the team "${n}" or the team does not exist. Please check the team name/id and try again.`);i=await(null==d?void 0:d.client.getOrganizationToken(o)),$a("Getting access token for org "+o+", "+i.substring(0,8)+"...")}else{var u;$a("Getting access token for user "+(null==(u=d.userInfo)?void 0:u.sub)),i=null==d?void 0:d.accessToken}}}return i||(console.error("ERR: Missing NEEDLE_CLOUD_TOKEN token. Please provide the access token argument or set the environment variable NEEDLE_CLOUD_TOKEN. Get an access token for your team at https://cloud.needle.tools/team"),$a("ERR: Missing NEEDLE_CLOUD_TOKEN token. Org: "+o),process.exit(403)),{accessToken:i,org_id:o}}const Vr=i.program;async function Yr(){const{spawn:e}=await import("node:child_process");e(process.execPath,[process.argv[1],"start","--integration","cli-login"],{stdio:"inherit",env:{...process.env,NEEDLE_CLOUD_TOKEN:process.env.NEEDLE_CLOUD_TOKEN||""}}),await new Promise(e=>setTimeout(e,1e3))}Vr.version(Jr.version).description("Command-line interface (CLI) for Needle Cloud"),Vr.command("start","Starts the Needle Auth server").alias("start-server").configure({visible:!1,strictOptions:!1}).help("Start the local server for Needle Cloud. This is required to authenticate with Needle Cloud and access your account and data.").option("--restart <restart>","Restarts the server",{required:!1,validator:Vr.BOOLEAN,default:!1}).option("--integration <integration>","Hint for the process which integration triggered this command",{required:!1,validator:Vr.STRING}).action(async({options:e})=>{const n=e.integration,t=Gr?void 0:$("Starting Needle License server "+(n?`(from ${n})`:"")).start();Wr({ora:t,restart:e.restart}).catch(e=>{console.error("Failed to start server:",e),null==t||t.fail("Failed to start server: "+e.message),process.exit(1)}).then(e=>{null!=e&&e.baseUrl&&e.isHost?null==t||t.succeed(`Server started on ${e.baseUrl} (v${xs()}, built ${function(e){if("string"!=typeof Ur||0===Ur.length)return"unknown";const n=new Date(Ur);if(Number.isNaN(n.getTime()))return"unknown";const t=e=>String(e).padStart(2,"0");return`${n.getFullYear()}-${t(n.getMonth()+1)}-${t(n.getDate())} ${t(n.getHours())}:${t(n.getMinutes())}`}()})`):!1===(null==e?void 0:e.isHost)?(n||null==t||t.warn(`Server is running on ${e.baseUrl||e.port}`),process.exit(0)):(null==t||t.fail("Failed to start server"),process.exit(1))})}),Vr.command("settings","Show current Needle CLI settings").action(async()=>{const{readSettings:e,KNOWN_SETTINGS:n}=await Promise.resolve().then(function(){return Ms}),t=e();for(const[e,o]of Object.entries(n)){const n=t[e],i=void 0!==n?String(n):o.default;console.log(`\n ${"enabled"===i?"[x]":"[ ]"} ${o.displayName}: ${i}${void 0===n?" (default)":""}`),console.log(` ${o.description}`),console.log(` Change: ${o.command}`)}console.log("")}),Vr.command("settings remote-ai-tools","Enable or disable cloud AI tool dispatch to this machine").help("When disabled, the CLI does NOT connect to the Needle Cloud AI tool dispatcher (wss://cloud.needle.tools/v1/cli/ws), so cloud-side AI chats cannot invoke tools (file reads, grep, etc.) on this machine. The local /mcp/ws endpoint used by Unity/Blender stays available. Setting persists in ~/.needle/settings.json.").argument("<enabled>","true to enable, false to disable",{validator:Vr.BOOLEAN}).action(async({args:e})=>{const{writeSetting:n,defaultSettingsDir:t}=await Promise.resolve().then(function(){return Ms}),o=e.enabled,i=t();o?(n(i,"remote_ai_tools",null),console.log("Remote AI tools enabled (default)."),$a("Settings: remote_ai_tools set to enabled (default) via CLI command")):(n(i,"remote_ai_tools","disabled"),console.log("Remote AI tools disabled. The cloud AI chat will not be able to dispatch tools to this machine."),$a("Settings: remote_ai_tools set to disabled via CLI command"))}),Vr.command("mcp","Start MCP server for AI agents (stdio transport)").help('Start the Needle Cloud MCP server using stdio transport.\nThis is the standard way to connect AI agents (Claude Desktop, Cursor, VS Code, etc.).\n\nAdd to your MCP client config:\n{\n "mcpServers": {\n "needle": {\n "command": "npx",\n "args": ["-y", "needle-cloud", "mcp"]\n }\n }\n}').action(async()=>{const{startStdio:e}=await Promise.resolve().then(function(){return Cr});e()}),Vr.command("get-project-id","Gets the project id for a local project").configure({visible:!1,strictOptions:!1}).argument("<paths...>","The path to the local project (web project directory)").action(async({args:e})=>{const n=Sr(e.paths);n?console.log(`Found project ID: "${n}"`):console.log("No project ID found.")}),Vr.command("login","Login to Needle Cloud").help("Login to Needle Cloud. If you are already logged in, this will refresh the access token.").option("--headless <headless>","The headless process will not open a browser window to login. If the user is not authorized then no auth flow can be started. Use this if you only want to **check** if the user is authenticated",{required:!1,validator:Vr.BOOLEAN,default:!1}).option("--clear <clear>","Refresh the access token",{required:!1,validator:Vr.BOOLEAN,default:!1}).action(async({options:e})=>{await Yr();const n=e.headless.valueOf()||!1,t=e.clear.valueOf()||!1,o=Gr?void 0:$("Login").start();await Br({headless:n,silent:Gr,clearAuthData:t,ora:o}).then(async e=>{null!=e&&e.isAuthenticated?null==o||o.succeed("Successfully logged in as "+lr(e)):0==n?null!=e&&e.claims||null!=e&&e.userInfo?null==o||o.warn(`You (${lr(e)}) are not authenticated...`):null==o||o.fail("Login failed"):Gr||null==o||o.warn("Not logged in"),process.exit(null!=e&&e.isAuthenticated?0:1)})}),Vr.command("logout","Logout of Needle Cloud").help("Logout of Needle Cloud (if you have logged in before).").option("--headless <headless>","Headless will not open a browser window to logout",{required:!1,validator:Vr.BOOLEAN,default:!1}).action(async({options:e})=>{await Yr();const n=e.headless.valueOf()||!1;await Dr({headless:n}).then(e=>{e?$("Logged out").succeed():$("Logout failed").fail(),process.exit(e?0:1)})}),Vr.command("me","Prints your user information").help("Prints basic informaton about the logged in Needle Cloud account (your account)").action(async({})=>{const e=Gr?void 0:$("Query user data").start(),n=await is();if(null!=n&&n.isAuthenticated&&await cs(n)){const a=n.userInfo||n.claims;var t,o,i;a?(null==e||e.succeed(`You are logged in as ${lr(n)}`),console.log(`- Name: ${lr(n)}`),console.log(`- ID: ${a.sub}`),a.email&&console.log(`- Email: ${a.email}`),a.phone_number&&console.log(`- Phone: ${a.phone_number}`),null!=(t=n.userInfo)&&t.organization_data&&console.log(`- Teams [${null==(o=n.userInfo)?void 0:o.organization_data.length}]: ${null==(i=n.userInfo)?void 0:i.organization_data.sort((e,n)=>e.name.localeCompare(n.name)).map(e=>e.name).join(", ")}`)):null==e||e.fail("Failed to get user data")}else null==e||e.warn("You are not logged in")}),Vr.command("get-pro","Start license flow for Needle Engine PRO").configure({visible:!1,strictArgsCount:!1,strictOptions:!1}).option("--org <org>","The team to purchase the license for",{validator:Vr.STRING}).action(async({options:e})=>{var n;let t=(null==(n=e.org)?void 0:n.toString())||null;const o=$().start("Start Needle Engine PRO purchase flow"),i=function(e){e=e||{};const n="undefined"!=typeof window?window.location:null;"current_page"===e.baseUrl&&(e.baseUrl=null==n?void 0:n.href);let t=e.pathname||(null==n?void 0:n.pathname),o=e.baseUrl||(null==n?void 0:n.href);if(!t||!o)return null;const i=new URL(t,o);return n&&(i.search=n.search),e.license||(e.license="needle-engine:pro"),i.searchParams.set("purchase_intent",e.license),e.account_id&&i.searchParams.set("account_id",e.account_id),e.return_url&&i.searchParams.set("return_url",e.return_url),e.checkout_if_possible&&i.searchParams.set("checkout_if_possible","true"),e.show_all_cards&&i.searchParams.set("show_all_cards","true"),e.affiliate_id&&i.searchParams.set("affiliate_id",e.affiliate_id),e.tracking_id&&i.searchParams.set("tracking_id",e.tracking_id),i}({baseUrl:"https://cloud.needle.tools",pathname:t?`/team/${t}`:"/account",account_id:t,license:"needle-engine:pro",return_url:null});if(!i)return void o.fail("Failed to get purchase url - please visit https://cloud.needle.tools");const a=i.toString();o.succeed(`Started Needle Engine PRO purchase flow: opening browser at ${a}`),ma(a)});const Zr={account:{url:ua}},Xr=`"${Object.keys(Zr).join('", "')}"`;Vr.command("open",`Open a page in the default browser. Options are: ${Xr}`).argument("<page>",`The page to open. Options are: ${Xr}`,{validator:Vr.STRING}).configure({strictOptions:!1,strictArgsCount:!1,visible:!1}).help("").action(async({args:e,logger:n})=>{const t=e.page.toString(),o=Zr[t];o?"url"in o?ma(o.url()):n.error(`Unknown argument: ${t}`):n.error(`Unknown argument: ${t}. Options are: ${Xr}`)}),Vr.command("list-deployments","Get a list of deployed websites").configure({visible:!1}).help("").option("--token <token>",Hr,{validator:Vr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Vr.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Vr.STRING}).option("--limit <limit>","Limit the number of deployments to show (min: 0, max: 100)",{validator:Vr.NUMBER,default:10}).option("--offset <offset>","The offset for deployments (default: 0, min: 0)",{validator:Vr.NUMBER,default:0}).option("--format <format>","The output format. Options: cli (default), json",{validator:Vr.STRING,default:"cli",hidden:!0}).option("--name","Filter by one or multiple deployment names (separated by ;)",{validator:Vr.STRING}).action(async({options:e,logger:n})=>{var t,o,i;const{accessToken:a,org_id:s}=await Kr(e.token,e.org),r=(null==(t=e.endpoint)?void 0:t.toString())||"https://cloud.needle.tools/api",c=e.limit.valueOf(),l=e.offset.valueOf(),p=(null==(o=e.format)?void 0:o.toString())||"cli",u=(null==(i=e.name)?void 0:i.toString())||void 0;if(c<0)return void n.error("The limit can not be negative");if(c>100)return void n.error("The limit can not be higher than 100");const d=$("Query deployments").start(),m=await za({endpoint:r,authToken:a,org:s,limit:c,offset:l,names:null==u?void 0:u.split(";")}).catch(e=>{n.error(e)});if(m&&"error"in m)d.fail(m.error+" (status: "+m.status+")");else if(m){if("json"===p){d.succeed(`Found ${m.deployments.length} deployments`);const e=JSON.stringify(m.deployments);return void console.log(e)}m.deployments.length>0?(d.succeed(`Found ${m.deployments.length} deployments`),m.deployments.forEach((e,t)=>{n.info(`${t+c*l}: ${e.name} – ${e.url}`)})):d.warn("No deployments found"),process.exit(0)}else d.fail("Failed to query deployments"),process.exit(1)}),Vr.command("list","List content items (3d assets, deployments, materials, etc.)").alias("list-content").help('List content items stored in Needle Cloud.\n\nUse --type to filter by content type (e.g. "material", "3d-asset", "deployment").\nUse --format to filter by output format (e.g. "glb", "textures").').option("--token <token>",Hr,{validator:Vr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Vr.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Vr.STRING}).option("--type <type>","Filter by content type (e.g. material, 3d-asset, deployment)",{required:!1,validator:Vr.STRING}).option("--format <format>","Filter by output format (e.g. glb, textures)",{required:!1,validator:Vr.STRING}).option("--search <search>","Search by name, title or description",{required:!1,validator:Vr.STRING}).option("--limit <limit>","Max number of items to show (default: 20, max: 100)",{validator:Vr.NUMBER,default:20}).option("--offset <offset>","Offset for pagination (default: 0)",{validator:Vr.NUMBER,default:0}).option("--output <output>","Output style: cli (default), json",{validator:Vr.STRING,default:"cli"}).action(async({options:e,logger:n})=>{var t,o,i,a,s,r,c,l,p;const{accessToken:u,org_id:d}=await Kr(e.token,e.org),m=(null==(t=e.endpoint)?void 0:t.toString())||"https://cloud.needle.tools/api",f=Math.min(null!=(o=null==(i=e.limit)?void 0:i.valueOf())?o:20,100),h=null!=(a=null==(s=e.offset)?void 0:s.valueOf())?a:0,g=(null==(r=e.output)?void 0:r.toString())||"cli",v=(null==(c=e.type)?void 0:c.toString())||void 0,x=(null==(l=e.format)?void 0:l.toString())||void 0,b=(null==(p=e.search)?void 0:p.toString())||void 0,y=$("Querying content...").start();try{const e=await oa({baseUrl:m,authToken:u,org:d},{content_type:v,content_format:x,search:b,limit:f,offset:h});if("json"===g)return y.succeed(`Found ${e.items.length} of ${e.total} items`),void console.log(JSON.stringify(e.items,null,2));0===e.items.length&&(y.warn("No content found"+(v?` (type: ${v})`:"")+(x?` (format: ${x})`:"")),process.exit(0)),y.succeed(`Found ${e.items.length} of ${e.total} items`);const t=e.items.map(e=>{var n;const t=e.title||"(untitled)";return{id:e.identifier,type:e.content_type||"?",formats:null!=(n=e.content_formats)&&n.length?e.content_formats.join(", "):"",name:t.length>20?t.slice(0,17)+"...":t,versions:String(e.version_count||0),date:e.created_at?Mi(new Date(e.created_at),new Date,{allowSimple:!0,limitInDays:2}):""}}),o={id:Math.max(2,...t.map(e=>e.id.length)),type:Math.max(4,...t.map(e=>e.type.length)),formats:Math.max(7,...t.map(e=>e.formats.length)),name:Math.max(4,...t.map(e=>e.name.length))},i=La(` ${"ID".padEnd(o.id)} ${"TYPE".padEnd(o.type)} ${"FORMATS".padEnd(o.formats)} ${"NAME".padEnd(o.name)} ${"#".padStart(3)} AGE`);n.info(i);for(const e of t){const t=Aa(e.type).padEnd(o.type+11),i=(e.formats?e.formats.split(", "):[]).map(e=>Aa(e)).join(", ")+" ".repeat(Math.max(0,o.formats-e.formats.length));n.info(` ${La(e.id.padEnd(o.id))} ${t} ${i} ${e.name.padEnd(o.name)} ${e.versions.padStart(3)} ${La(e.date)}`)}e.total>h+f&&n.info(` ... ${e.total-h-f} more (use --offset ${h+f})`),process.exit(0)}catch(e){y.fail(e.message),process.exit(1)}}),Vr.command("download","Download a content item by identifier").help('Download files from a content item.\n\nUse --format to select which output format to download (e.g. "glb", "textures").\n\nUsage:\n needle-cloud download <identifier> [directory]\n needle-cloud download abc123 --format glb').argument("<identifier>","Content item identifier",{validator:Vr.STRING}).argument("[directory]","Output directory (default: current directory)",{default:"."}).option("--token <token>",Hr,{validator:Vr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Vr.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Vr.STRING}).option("--format <format>","Output format to download (e.g. glb, textures)",{required:!1,validator:Vr.STRING}).option("--name <name>","Output filename (without extension)",{required:!1,validator:Vr.STRING}).option("--verbose","Show detailed download info",{required:!1,validator:Vr.BOOLEAN,default:!1}).action(async({args:e,options:n,logger:t})=>{var o,i,a,s,r,c;const{accessToken:l,org_id:p}=await Kr(n.token,n.org),u=(null==(o=n.endpoint)?void 0:o.toString())||"https://cloud.needle.tools/api",d=e.identifier.toString(),m=(null==(i=e.directory)?void 0:i.toString())||".",f=(null==(a=n.name)?void 0:a.toString())||void 0,h=null!=(s=null==(r=n.verbose)?void 0:r.valueOf())&&s,g=(null==(c=n.format)?void 0:c.toString())||void 0,v=$("Looking up content...").start();try{var x;const e={baseUrl:u,authToken:l,org:p},n=await ia(e,d).catch(()=>null);if(!n)return void v.fail(`Content not found: "${d}". Use the exact content identifier (see list-content).`);const o=null==(x=n.versions)?void 0:x[0];if(!o)return void v.fail(`Content "${n.title||n.name}" has no versions`);let i=o.identifier;if(g){let e=!1;for(const t of n.versions){if(t.content_format===g){i=t.identifier,e=!0;break}const n=t.variants.find(e=>e.content_format===g);if(n){i=n.identifier,e=!0;break}}if(!e)return void v.fail(`No output with format "${g}" found for "${n.title||n.name}"`)}v.text=`Downloading "${n.title||n.name}"${g?` (format: ${g})`:""}...`,v.stop();const a=await Oa({baseUrl:u,authToken:l,org:p,identifier:i,outDir:m,filename:f,verbose:h,content_format:g});"error"in a&&t.error(a.error)}catch(e){v.fail(e.message)}}),Vr.command("deploy","Deploy a website to Needle").help("").argument("<directory>","The directory to deploy",{validator:Vr.STRING}).option("--token <token>",Hr,{validator:Vr.STRING}).option("--team <team>","The team name or id to deploy to (not needed when using token/accesstoken)",{required:!1,validator:Vr.STRING}).option("--org <org>","The organization name or id to deloy to (not needed when using token/accesstoken)",{required:!1,validator:Vr.STRING,hidden:!0}).option("--name <name>","The project name. This name will also be used in your website URL",{required:!1,validator:Vr.STRING}).option("--entrypoint <entrypoint>",'The entrypoint file to use (e.g. "index.html"). This is useful if you want to deploy a folder with multiple HTML files and you want to configure which file to load initially or if you have multiple model files in one folder',{required:!1,validator:Vr.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Vr.STRING,hidden:!0}).option("--open","Open the deployment in the default browser",{default:!0,validator:Vr.BOOLEAN}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Vr.BOOLEAN,default:!1,hidden:!0}).option("--experimental","Use the experimental upload API. Mostly used for debugging (default: false)",{required:!1,validator:Vr.BOOLEAN,default:!1,hidden:!0}).option("--raw","Use raw to disallow modifications like gzip compression on upload",{required:!1,validator:Vr.BOOLEAN,default:!1,hidden:!0}).action(async({args:e,options:n,logger:t})=>{var o,i,a;const s=n.open,{accessToken:r,org_id:c}=await Kr(n.token,n.team||n.org),l=n.verbose.valueOf(),p=n.experimental.valueOf()||!1,u=n.raw.valueOf()||!1;await Ea({logger:t,endpoint:(null==(o=n.endpoint)?void 0:o.toString())||void 0,token:r,org_id:c,directory:e.directory.toString(),name:(null==(i=n.name)?void 0:i.toString())||void 0,entrypoint:(null==(a=n.entrypoint)?void 0:a.toString())||void 0,open:s,verbose:l||!1,experimental:p||!1,raw:u||!1})}),Vr.command("optimize","Optimize glTF, GLB, VRM, FBX, USD files").help("").option("--token <token>",Hr,{validator:Vr.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Vr.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Vr.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be optimized",{validator:Vr.STRING}).option("--outdir <outdir>","The output directory for the optimized file(s). If set your optimized asset files will automatically be downloaded to this directory.",{required:!1,validator:Vr.STRING}).option("--name <name>","The optimization project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Vr.STRING}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Vr.BOOLEAN,default:!1}).option("--progressive","Use Needle progressive loading",{required:!1,validator:Vr.BOOLEAN,default:!0}).action(async({args:e,options:n,logger:t})=>{var o,i,a;const c=n.verbose.valueOf(),{accessToken:l,org_id:p}=await Kr(n.token,n.team||n.org);if(l!=n.token){const e=await is();null!=e&&e.isAuthenticated?p||($("Please provide an organization id to optimize files...").fail(),process.exit(1)):($("Please login to optimize files...").fail(),process.exit(1));const n=await async function(e,n){const t=e.baseUrl+de.account.get_licenses,o={...{...n},...me(e)},i=await fetch(t,{...fe,method:"GET",headers:o}).catch(e=>(console.error(e),null));return i?i.ok?(await i.json()).licenses:(console.error(i.statusText,await i.text()),[]):[]}({baseUrl:"https://cloud.needle.tools/api",authToken:l,org:p},{type:"org",org_id:p});(!n||n.length<=0||!n.find(e=>"Needle Engine"===e.type&&("pro"===e.license||"enterprise"===e.license)))&&($("Update to Needle PRO or Enterprise required to optimize files via CLI. Visit https://cloud.needle.tools/get-pro").fail(),process.exit(1))}const u=(null==(o=n.progressive)?void 0:o.valueOf())||!0,d=await async function(e){if(e.outDir){var n;if((null==(n=e.outDir)?void 0:n.length)<=0){const e="Output Directory is invalid";return $().fail(e),{error:e}}if(s(e.outDir)&&r(e.outDir).isFile()){const e="The output directory is a file - it must be a directory";return $().fail(e),{error:e}}}const t=e.fileOrDirectory;if(!s(t))return $().fail(`File not found: ${t}`),{error:"File not found"};if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${ua()}`};if(void 0!==e.name&&e.name&&(e.name.length<=0||"true"===e.name||"false"===e.name))return{error:`Name is not valid: "${e.name}". Please provide a valid name`};e.fileOrDirectory=y(e.fileOrDirectory);const o=$(`Gathering files ${e.fileOrDirectory}`).start();let i=null;try{i=ha("optimization",e.fileOrDirectory)}catch(n){return $().fail(`${n.message||`Failed to collect files in ${e.fileOrDirectory}`}`),{error:"Failed to collect files"}}o.text=`Uploading ${i.files.length} files for optimization:\n- ${i.files.map(e=>e.path||e.name).join("\n -")}`;const a="https://cloud.needle.tools/api";e.verbose&&console.log("Using endpoint:",a);const c=function(e){var n,t;if(function(e){return e.some(e=>{let n=e.name.toLowerCase();return!!(n.endsWith(".html")||n.endsWith(".htm")||n.endsWith(".html.gz")||n.endsWith(".html.br"))||"mimetype"in e&&"text/html"===e.mimetype})}(e))return{kind:"deployment",contentType:void 0,uploadType:"deployment",canOptimize:!1,canConvertToGLB:!1};if(function(e){if(!e||1!==e.length)return!1;const n=e[0].name;return"string"==typeof(t=n)&&0!==t.length&&t.toLowerCase().endsWith(".exr")||function(e){if("string"!=typeof e||0===e.length)return!1;const n=e.toLowerCase();return n.endsWith(".hdr")||n.endsWith(".hdri")}(n)||function(e){return"string"==typeof e&&0!==e.length&&/\.pmrem(\d+x\d+)?\.ktx2$/i.test(e)}(n);var t}(e))return{kind:"environment-texture",contentType:"hdri",uploadType:void 0,canOptimize:!1,canConvertToGLB:!1};const o=null!=(n=null==(t=e[0])||null==(t=t.name.split(".").pop())?void 0:t.toLowerCase())?n:"";return{kind:"asset",contentType:"3d-asset",uploadType:void 0,canOptimize:e.some(e=>{var n;const t=null==(n=e.name.split(".").pop())?void 0:n.toLowerCase();return null!=t&&Ki.has(t)}),canConvertToGLB:Vi.has(o)}}(i.files);let l=c.contentType;if("asset"===c.kind&&1===i.files.length){const n=i.files[0].name.toLowerCase();if(n.endsWith(".glb")||n.endsWith(".gltf"))try{const n=i.files[0].path||i.files[0].name,t=await async function(e){return e.toLowerCase().endsWith(".gltf")?async function(e){const{readFile:n}=await import("node:fs/promises"),t=await n(e,"utf-8");return JSON.parse(t)}(e):async function(e){const{open:n}=await import("node:fs/promises"),t=await n(e,"r");try{const e=Buffer.alloc(20),{bytesRead:n}=await t.read(e,0,e.length,0);if(n<e.length)throw new Error("File too small to be a GLB");const o=new DataView(e.buffer,e.byteOffset,e.byteLength);if(o.getUint32(0,!0)!==aa)throw new Error("Not a GLB (magic mismatch)");const i=o.getUint32(12,!0);if(o.getUint32(16,!0)!==sa)throw new Error("First chunk is not JSON");const a=20+i,s=Buffer.alloc(a),{bytesRead:r}=await t.read(s,0,a,0);if(r<a)throw new Error("File truncated — JSON chunk could not be read in full");return function(e){const n=e instanceof Uint8Array?e:new Uint8Array(e);if(n.byteLength<20)throw new Error("Buffer too small to be a GLB");const t=new DataView(n.buffer,n.byteOffset,n.byteLength);if(t.getUint32(0,!0)!==aa)throw new Error("Not a GLB (magic mismatch)");const o=t.getUint32(12,!0);if(t.getUint32(16,!0)!==sa)throw new Error("First chunk is not JSON");const i=20+o;if(i>n.byteLength)throw new Error("JSON chunk exceeds buffer length");const a=n.subarray(20,i),s=(new TextDecoder).decode(a);return JSON.parse(s)}(s)}finally{await t.close()}}(e)}(n);"material"===function(e){return function(e){if(!e)return!1;const n=!e.nodes||0===e.nodes.length,t=!e.meshes||0===e.meshes.length,o=Array.isArray(e.materials)&&1===e.materials.length;return n&&t&&o}(e)?"material":"3d-asset"}(t)&&(l="material",e.verbose&&console.log(`Detected material-only asset: ${n}`))}catch(n){e.verbose&&console.warn("Failed to inspect asset for material detection:",n.message)}}const p=await Qi({baseUrl:a,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:i.files,entrypoint:i.entrypoint},{type:c.uploadType||"upload",name:e.name,content_type:l,loglevel:e.verbose?"debug":"none",progress:e=>{o.text=`Uploading ${e.fileName} - finished in approx. ${e.estimatedTimeLeftDisplay}, ${100*e.progress01}%`}});if(0==p.success){const e=`${p.error||"Unknown error: could not start upload"}`;return o.fail(e),{error:e,noprint:!0}}if(p.success){const n=`${da()}/${p.content_id}?select_team=1`;o.succeed(p.uploadSkipped?`Files have already been uploaded to ${n}`:`Uploaded ${i.files.length} files for optimization to ${n}`);const t=await async function(e,n={progressive:!0}){const t=e.baseUrl+de.jobs.create,o={...me(e),"content-type":"application/json"},i={type:"optimization",job_id:e.id,triggered_by:e.trigger_type,parameters:{...n}},a=await fetch(t,{...fe,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request optimization (${a.status}): ${e} `),null}return await a.json().catch(e=>(console.error(e),null))}({baseUrl:a,authToken:e.token,org:e.org_id,id:p.id,trigger_type:"cli"},{progressive:e.progressive,pipeline_version:"latest"});if(!t)return{error:"Failed to send optimization request"};if("error"in t){const e=`Failed to optimize: ${t.error}`;return console.error(e),{error:e}}{const n=t.job,o=$(`Optimization requested for ${n.name||n.identifier}`).start();let i=!1;for(o.color="gray";;){if("completed"===t.job.status){var u;i=!0,o.succeed(`${null!=(u=t.message)?u:"Optimization completed"}`);break}let s=2e3;const r=await ki(n.identifier,{baseUrl:a,authToken:e.token,org:t.job.org});if("new"!==(null==r?void 0:r.status)&&"pending"!==(null==r?void 0:r.status)||(o.text="Your asset is queued - waiting for optimization to start",o.color="yellow",s=2e3),"running"===(null==r?void 0:r.status))o.text=`Your asset is being optimized: ${r.progress?`${r.progress}%`:""} ${r.status_message?`— ${r.status_message}`:""}`,o.color="cyan",s=1e3;else if("stalled"===(null==r?void 0:r.status))s=2500;else{if("completed"===(null==r?void 0:r.status)){i=!0,o.succeed(`Your asset has finished optimizing: ${r.status_message}`);break}if("canceled"===(null==r?void 0:r.status))return o.fail(`Optimization cancelled: ${r.error}`),{error:r.error||"Optimization cancelled"};if("failed"===(null==r?void 0:r.status))return o.fail(`Optimization failed: ${r.error}`),console.error(`Optimization failed: ${r.error}`),{error:r.error||"Optimization failed"}}await Di(s)}if(i){if(e.outDir){const t=await Oa({baseUrl:a,authToken:e.token,org:e.org_id,identifier:n.identifier,outDir:e.outDir,verbose:e.verbose});if("error"in t)return{error:t.error}}else $().succeed(`Asset successfully optimized: https://cloud.needle.tools/edit/${n.content_id} (To download optimized files, use the --outdir option)`);return{success:!0}}}}return{error:"Unknown error"}}({logger:t,token:l,org_id:p,fileOrDirectory:e.path.toString(),name:(null==(i=n.name)?void 0:i.toString())||void 0,progressive:u,outDir:(null==(a=n.outdir)?void 0:a.toString())||void 0,verbose:c||!1}).catch(e=>{console.error(e),process.exit(1)});Array.isArray(d)?process.exit(0):"error"in d&&(d.noprint||console.error(d.error),process.exit(1))}),Vr.command("generate-material","Generate a PBR material from a text prompt").help("").argument("<prompt>","The text prompt describing the material to generate",{validator:Vr.STRING}).option("--token <token>",Hr,{validator:Vr.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Vr.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Vr.STRING,hidden:!0}).option("--resolution <resolution>","The material texture resolution (256, 512, 1k, 2k, 4k)",{default:"512",required:!1,validator:Vr.STRING}).option("--name <name>","Output filename",{required:!1,validator:Vr.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:Vr.STRING}).action(async({args:e,options:n,logger:t})=>{var o,i,a;const{accessToken:s,org_id:r}=await Kr(n.token,n.team||n.org),c=e.prompt.toString(),l=null==(o=n.resolution)?void 0:o.toString(),p=null==(i=n.outdir)?void 0:i.toString(),u=null==(a=n.name)?void 0:a.toString(),d=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${ua()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const n="https://cloud.needle.tools/api";$a(`[generate-material] Starting request to ${n}, prompt="${e.prompt}", resolution=${e.resolution||512}`,{emptyLineBefore:!0});const t=$("Requesting material generation...").start(),o=await Promise.race([ta({baseUrl:n,authToken:e.token,org:e.org_id,trigger_type:"cli"},{prompt:e.prompt,resolution:e.resolution||512}).catch(e=>({error:e.message||"Request failed"})),new Promise(e=>setTimeout(()=>e({error:"Request timed out after 30s. Please try again."}),3e4))]);if("error"in o)return $a(`[generate-material] Request failed: ${o.error}`),t.fail(o.error),{error:o.error};const i=o.job;if($a(`[generate-material] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return $a(`[generate-material] Job canceled: ${i.status_message||"quota exceeded"}`),t.fail(i.status_message||"Material generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};t.succeed(`Material generation requested: ${i.identifier}`);const a=$("Waiting for material generation...").start();for(a.color="gray";;){if("completed"===i.status){a.succeed("Material generation completed");break}let t=2e3;const o=await ki(i.identifier,{baseUrl:n,authToken:e.token,org:i.org});if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your material is queued - waiting for generation to start",a.color="yellow",t=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating material: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",t=1e3;else{if("completed"===(null==o?void 0:o.status)){$a(`[generate-material] Job completed: ${i.identifier}`),a.succeed(`Material generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return $a(`[generate-material] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`Material generation canceled: ${o.error||""}`),{error:o.error||"Material generation canceled"};if("failed"===(null==o?void 0:o.status))return $a(`[generate-material] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`Material generation failed: ${o.error||""}`),{error:o.error||"Material generation failed"}}await Di(t)}if(e.outDir){const t=await Oa({baseUrl:n,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in t)return{error:t.error}}return{success:!0,identifier:i.identifier}}({logger:t,token:s,org_id:r,prompt:c,resolution:l,outputName:u,outDir:p});"error"in d&&(d.error&&t.error(d.error),process.exit(1)),!p&&d.identifier&&console.log(d.identifier),process.exit(0)}),Vr.command("ask","Send a message to the Needle Cloud AI").help("Send a message to the Needle Cloud AI chat.\n\nWithout a message argument, starts an interactive session.\nBy default streams the response to the terminal. Use --no-stream for a single JSON response.\nUse --slug to continue an existing chat conversation.\nDefault slug is <your-user-id>-cli (persistent across sessions).").argument("[message...]","The message to send (omit for interactive mode)").option("--token <token>",Hr,{validator:Vr.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:Vr.STRING}).option("--slug <slug>","Chat slug to continue an existing conversation",{required:!1,validator:Vr.STRING}).option("--no-stream","Disable streaming (returns full response at once)",{required:!1,validator:Vr.BOOLEAN,default:!1}).action(async({args:e,options:n})=>{var t,o;const{accessToken:i,org_id:a}=await Kr(n.token,n.org),s=Array.isArray(e.message)?e.message:e.message?[e.message]:[],r=s.length?s.join(" "):void 0,c=(null==(t=n.slug)?void 0:t.toString())||void 0,l=(null==(o=n.noStream)?void 0:o.valueOf())||!1;await async function(e){const{token:n,org_id:t,message:o,slug:i,stream:a}=e,s=i||function(e){try{const n=e.split(".")[1],t=JSON.parse(Buffer.from(n,"base64url").toString());if(t.sub)return t.sub+"-cli"}catch{}return"cli-"+Math.random().toString(36).slice(2,10)}(n);await async function(e){const{token:n,org_id:t,slug:o,stream:i,initialMessage:a}=e,s=ne({input:process.stdin,output:process.stdout});console.log(`Needle Cloud AI (chat: ${o})`),console.log('Type your message. Press Ctrl+C or type "exit" to quit.\n');try{for(a&&(console.log(`> ${a}`),await Ra({token:n,org_id:t,slug:o,message:a,stream:i}),console.log(""));;){const e=(await s.question("> ")).trim();if(e){if("exit"===e||"quit"===e)break;await Ra({token:n,org_id:t,slug:o,message:e,stream:i}),console.log("")}}}finally{s.close()}}({token:n,org_id:t,slug:s,stream:a,initialMessage:o})}({token:i,org_id:a,message:r,slug:c,stream:!l}),process.exit(0)});export{Vr as program};
|