@globus/sdk 5.5.0 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- var globus=(()=>{var kr=Object.create;var pe=Object.defineProperty;var Nr=Object.getOwnPropertyDescriptor;var Ir=Object.getOwnPropertyNames;var Fr=Object.getPrototypeOf,Gr=Object.prototype.hasOwnProperty;var qr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},zt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ir(t))!Gr.call(e,a)&&a!==r&&pe(e,a,{get:()=>t[a],enumerable:!(o=Nr(t,a))||o.enumerable});return e};var jr=(e,t,r)=>(r=e!=null?kr(Fr(e)):{},zt(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),Ur=e=>zt(pe({},"__esModule",{value:!0}),e);var ir=qr((F,nr)=>{var ye=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Se=function(){function e(){this.fetch=!1,this.DOMException=ye.DOMException}return e.prototype=ye,new e}();(function(e){var t=function(r){var o=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function d(n){return n&&DataView.prototype.isPrototypeOf(n)}if(a.arrayBuffer)var _=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],S=ArrayBuffer.isView||function(n){return n&&_.indexOf(Object.prototype.toString.call(n))>-1};function x(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function q(n){return typeof n!="string"&&(n=String(n)),n}function w(n){var i={next:function(){var l=n.shift();return{done:l===void 0,value:l}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function f(n){this.map={},n instanceof f?n.forEach(function(i,l){this.append(l,i)},this):Array.isArray(n)?n.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(i){this.append(i,n[i])},this)}f.prototype.append=function(n,i){n=x(n),i=q(i);var l=this.map[n];this.map[n]=l?l+", "+i:i},f.prototype.delete=function(n){delete this.map[x(n)]},f.prototype.get=function(n){return n=x(n),this.has(n)?this.map[n]:null},f.prototype.has=function(n){return this.map.hasOwnProperty(x(n))},f.prototype.set=function(n,i){this.map[x(n)]=q(i)},f.prototype.forEach=function(n,i){for(var l in this.map)this.map.hasOwnProperty(l)&&n.call(i,this.map[l],l,this)},f.prototype.keys=function(){var n=[];return this.forEach(function(i,l){n.push(l)}),w(n)},f.prototype.values=function(){var n=[];return this.forEach(function(i){n.push(i)}),w(n)},f.prototype.entries=function(){var n=[];return this.forEach(function(i,l){n.push([l,i])}),w(n)},a.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function M(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function $(n){return new Promise(function(i,l){n.onload=function(){i(n.result)},n.onerror=function(){l(n.error)}})}function Jt(n){var i=new FileReader,l=$(i);return i.readAsArrayBuffer(n),l}function j(n){var i=new FileReader,l=$(i),h=/charset=([A-Za-z0-9_-]+)/.exec(n.type),v=h?h[1]:"utf-8";return i.readAsText(n,v),l}function Dr(n){for(var i=new Uint8Array(n),l=new Array(i.length),h=0;h<i.length;h++)l[h]=String.fromCharCode(i[h]);return l.join("")}function Ht(n){if(n.slice)return n.slice(0);var i=new Uint8Array(n.byteLength);return i.set(new Uint8Array(n)),i.buffer}function $t(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:a.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:a.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():a.arrayBuffer&&a.blob&&d(n)?(this._bodyArrayBuffer=Ht(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||S(n))?this._bodyArrayBuffer=Ht(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var n=M(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=M(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(Jt);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=M(this);if(n)return n;if(this._bodyBlob)return j(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Dr(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(Mr)}),this.json=function(){return this.text().then(JSON.parse)},this}var Ar=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Cr(n){var i=n.toUpperCase();return Ar.indexOf(i)>-1?i:n}function k(n,i){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var l=i.body;if(n instanceof k){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,i.headers||(this.headers=new f(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!l&&n._bodyInit!=null&&(l=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new f(i.headers)),this.method=Cr(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in o){var m=new AbortController;return m.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&l)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(l),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var h=/([?&])_=[^&]*/;if(h.test(this.url))this.url=this.url.replace(h,"$1_="+new Date().getTime());else{var v=/\?/;this.url+=(v.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function Mr(n){var i=new FormData;return n.trim().split("&").forEach(function(l){if(l){var h=l.split("="),v=h.shift().replace(/\+/g," "),m=h.join("=").replace(/\+/g," ");i.append(decodeURIComponent(v),decodeURIComponent(m))}}),i}function wr(n){var i=new f,l=n.replace(/\r?\n[\t ]+/g," ");return l.split("\r").map(function(h){return h.indexOf(`
2
- `)===0?h.substr(1,h.length):h}).forEach(function(h){var v=h.split(":"),m=v.shift().trim();if(m){var ae=v.join(":").trim();try{i.append(m,ae)}catch(Ee){console.warn("Response "+Ee.message)}}}),i}$t.call(k.prototype);function A(n,i){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new f(i.headers),this.url=i.url||"",this._initBody(n)}$t.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var n=new A(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var Lr=[301,302,303,307,308];A.redirect=function(n,i){if(Lr.indexOf(i)===-1)throw new RangeError("Invalid status code");return new A(null,{status:i,headers:{location:n}})},r.DOMException=o.DOMException;try{new r.DOMException}catch{r.DOMException=function(i,l){this.message=i,this.name=l;var h=Error(i);this.stack=h.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function Re(n,i){return new Promise(function(l,h){var v=new k(n,i);if(v.signal&&v.signal.aborted)return h(new r.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function ae(){m.abort()}m.onload=function(){var b={statusText:m.statusText,headers:wr(m.getAllResponseHeaders()||"")};v.url.indexOf("file://")===0&&(m.status<200||m.status>599)?b.status=200:b.status=m.status,b.url="responseURL"in m?m.responseURL:b.headers.get("X-Request-URL");var U="response"in m?m.response:m.responseText;setTimeout(function(){l(new A(U,b))},0)},m.onerror=function(){setTimeout(function(){h(new TypeError("Network request failed"))},0)},m.ontimeout=function(){setTimeout(function(){h(new TypeError("Network request timed out"))},0)},m.onabort=function(){setTimeout(function(){h(new r.DOMException("Aborted","AbortError"))},0)};function Ee(b){try{return b===""&&o.location.href?o.location.href:b}catch{return b}}if(m.open(v.method,Ee(v.url),!0),v.credentials==="include"?m.withCredentials=!0:v.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&(a.blob?m.responseType="blob":a.arrayBuffer&&(m.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof f||o.Headers&&i.headers instanceof o.Headers)){var Bt=[];Object.getOwnPropertyNames(i.headers).forEach(function(b){Bt.push(x(b)),m.setRequestHeader(b,q(i.headers[b]))}),v.headers.forEach(function(b,U){Bt.indexOf(U)===-1&&m.setRequestHeader(U,b)})}else v.headers.forEach(function(b,U){m.setRequestHeader(U,b)});v.signal&&(v.signal.addEventListener("abort",ae),m.onreadystatechange=function(){m.readyState===4&&v.signal.removeEventListener("abort",ae)}),m.send(typeof v._bodyInit>"u"?null:v._bodyInit)})}return Re.polyfill=!0,o.fetch||(o.fetch=Re,o.Headers=f,o.Request=k,o.Response=A),r.Headers=f,r.Request=k,r.Response=A,r.fetch=Re,r}({})})(Se);Se.fetch.ponyfill=!0;delete Se.fetch.polyfill;var V=ye.fetch?ye:Se;F=V.fetch;F.default=V.fetch;F.fetch=V.fetch;F.Headers=V.Headers;F.Request=V.Request;F.Response=V.Response;nr.exports=F});var Vn={};u(Vn,{auth:()=>Ke,authorization:()=>Qe,compute:()=>jt,errors:()=>Ge,flows:()=>xt,gcs:()=>Ft,groups:()=>Et,info:()=>xe,logger:()=>De,search:()=>vt,timer:()=>Gt,transfer:()=>mt,webapp:()=>Ut});var xe={};u(xe,{CLIENT_INFO:()=>Xt,VERSION:()=>Qt,addClientInfo:()=>Br,getClientInfo:()=>Zt,getClientInfoRequestHeaders:()=>be});var Vt="X-Globus-Client-Info",Jr=!0;function Kt(){return Jr}var Hr=";",$r=",";function Wt(e){return(Array.isArray(e)?e:[e]).map(r=>Object.entries(r).map(([o,a])=>`${o}=${a}`).join($r)).join(Hr)}var Yt="5.5.0";var Qt=Yt,Xt={product:"javascript-sdk",version:Qt},Oe=[Xt];function Br(e){Oe=Oe.concat(e)}function Zt(){return Wt(Oe)}function be(){return Kt()?{[Vt]:Zt()}:{}}var De={};u(De,{log:()=>R,setLogLevel:()=>Vr,setLogger:()=>zr});var Pe=["debug","info","warn","error"],ce,er=Pe.indexOf("error");function zr(e){ce=e}function Vr(e){er=Pe.indexOf(e)}function R(e,...t){if(!ce||Pe.indexOf(e)<er)return;(ce[e]??ce.log)(...t)}var Qe={};u(Qe,{AuthorizationManager:()=>ne,create:()=>_o});var J=class extends Error{};J.prototype.name="InvalidTokenError";function Kr(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function Wr(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Kr(t)}catch{return atob(t)}}function tr(e,t){if(typeof e!="string")throw new J("Invalid token specified: must be a string");t||(t={});let r=t.header===!0?0:1,o=e.split(".")[r];if(typeof o!="string")throw new J(`Invalid token specified: missing part #${r+1}`);let a;try{a=Wr(o)}catch(d){throw new J(`Invalid token specified: invalid base64 for part #${r+1} (${d.message})`)}try{return JSON.parse(a)}catch(d){throw new J(`Invalid token specified: invalid json for part #${r+1} (${d.message})`)}}var Ke={};u(Ke,{CONFIG:()=>ze,getAuthorizationEndpoint:()=>Ve,getTokenEndpoint:()=>fo,identities:()=>Je,isGlobusAuthTokenResponse:()=>ve,isRefreshToken:()=>te,isToken:()=>K,oauth2:()=>G,utils:()=>Be});var ge={};u(ge,{HOSTS:()=>Ne,ID:()=>T,RESOURCE_SERVERS:()=>Q,SCOPES:()=>B});var ue={};u(ue,{HOSTS:()=>Ae,ID:()=>p,SCOPES:()=>c});var p="TRANSFER",c={ALL:"urn:globus:auth:scope:transfer.api.globus.org:all"},Ae={sandbox:"transfer.api.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var de={};u(de,{HOSTS:()=>Ce,ID:()=>E,SCOPES:()=>D});var E="FLOWS",Ce={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"},D={MANAGE_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/manage_flows",VIEW_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/view_flows",RUN:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run",RUN_STATUS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_status",RUN_MANAGE:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_manage"};var le={};u(le,{HOSTS:()=>Me,ID:()=>L});var L="TIMER",Me={sandbox:"sandbox.timer.automate.globus.org",production:"timer.automate.globus.org",staging:"staging.timer.automate.globus.org",integration:"integration.timer.automate.globus.org",test:"test.timer.automate.globus.org",preview:"preview.timer.automate.globus.org"};var me={};u(me,{HOSTS:()=>we,ID:()=>P,SCOPES:()=>N});var P="GROUPS",we={sandbox:"groups.api.sandbox.globuscs.info",production:"groups.api.globus.org",staging:"groups.api.staging.globuscs.info",integration:"groups.api.integration.globuscs.info",test:"groups.api.test.globuscs.info",preview:"groups.api.preview.globuscs.info"},N={ALL:"urn:globus:auth:scope:groups.api.globus.org:all",VIEW_MY:"urn:globus:auth:scope:groups.api.globus.org:view_my_groups_and_membership"};var he={};u(he,{HOSTS:()=>Le,ID:()=>g,SCOPES:()=>O});var g="SEARCH",Le={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},O={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var fe={};u(fe,{HOSTS:()=>ke,ID:()=>C,SCOPES:()=>Y});var C="COMPUTE",ke={sandbox:"compute.api.sandbox.globuscs.info",production:"compute.api.globus.org",staging:"compute.api.staging.globuscs.info",integration:"compute.api.integration.globuscs.info",test:"compute.api.test.globuscs.info",preview:"compute.api.preview.globus.org"},Y={ALL:"https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all"};var T="AUTH",Ne={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"},B={VIEW_IDENTITIES:"urn:globus:auth:scope:auth.globus.org:view_identities"},Q={[T]:"auth.globus.org",[p]:"transfer.api.globus.org",[E]:"flows.globus.org",[P]:"groups.api.globus.org",[g]:"search.api.globus.org",[L]:"524230d7-ea86-4a52-8312-86065a9e0417",[C]:"funcx_service"};var Ge={};u(Ge,{EnvironmentConfigurationError:()=>X,isAuthorizationRequirementsError:()=>Z,isConsentRequiredError:()=>Ie,isErrorWellFormed:()=>rr,toAuthorizationQueryParams:()=>Fe});var X=class extends Error{name="EnvironmentConfigurationError";constructor(t,r){super(),this.message=`Invalid configuration value provided for ${t} (${r}).`}};function rr(e){return typeof e=="object"&&e!==null&&"code"in e&&"message"in e}function Ie(e){return rr(e)&&e.code==="ConsentRequired"&&"required_scopes"in e&&Array.isArray(e.required_scopes)}var Yr=["required_scopes"];function Fe(e){let t={scope:e.authorization_parameters.required_scopes?.join(" "),...e.authorization_parameters};return Object.entries(t).reduce((r,[o,a])=>{if(Yr.includes(o)||a===void 0||a===null)return r;let d=a;return Array.isArray(d)?d=d.join(","):typeof a=="boolean"&&(d=d?"true":"false"),{...r,[o]:d}},{})}function Z(e){return typeof e=="object"&&e!==null&&"authorization_parameters"in e&&typeof e.authorization_parameters=="object"&&e.authorization_parameters!==null}function Qr(){return typeof window<"u"?window:process}function Xr(e){return typeof window==typeof e}function qe(e,t){let r=Qr(),o;return Xr(r)?o=r:o=r.env,e in o?o[e]:t}var or={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"},I={[T]:T,[p]:p,[E]:E,[P]:P,[g]:g,[L]:L,[C]:C},Zr={[T]:Ne,[p]:Ae,[E]:Ce,[P]:we,[g]:Le,[L]:Me,[C]:ke};function je(e){let t=qe("GLOBUS_SDK_OPTIONS",{});return typeof t=="string"&&(t=JSON.parse(t)),{...t,...e,fetch:{...t?.fetch,...e?.fetch,options:{...t?.fetch?.options,...e?.fetch?.options,headers:{...t?.fetch?.options?.headers,...e?.fetch?.options?.headers}}}}}function z(){let e=je(),t=qe("GLOBUS_SDK_ENVIRONMENT",e?.environment??or.PRODUCTION);if(e?.environment&&t!==e.environment&&R("debug","GLOBUS_SDK_ENVIRONMENT and GLOBUS_SDK_OPTIONS.environment are set to different values. GLOBUS_SDK_ENVIRONMENT will take precedence"),!t||!Object.values(or).includes(t))throw new X("GLOBUS_SDK_ENVIRONMENT",t);return t}function eo(e,t=z()){return Zr[e][t]}function sr(e,t=z()){let r=eo(e,t);return qe(`GLOBUS_SDK_SERVICE_URL_${e}`,r?`https://${r}`:void 0)}function to(e){let t=new URLSearchParams;return Array.from(Object.entries(e)).forEach(([r,o])=>{Array.isArray(o)?t.set(r,o.join(",")):o!==void 0&&t.set(r,String(o))}),t.toString()}function ro(e,t="",r=z()){let o=sr(e,r);return new URL(t,o)}function ee(e,t,r,o){let a;return typeof e=="object"?a=new URL(t,e.host):a=ro(e,t,o?.environment),r&&r.search&&(a.search=to(r.search)),a.toString()}var Je={};u(Je,{consents:()=>Ue,get:()=>so,getAll:()=>no});var ar=jr(ir());async function s(e,t,r){let o=je(r),a=o?.fetch?.options||{},d={...be(),...t?.headers,...a.headers},_=o?.manager,S;if(e.resource_server&&_&&(S=_.tokens.getByResourceServer(e.resource_server),S&&(d.Authorization=`Bearer ${S.access_token}`)),e.scope&&_&&(typeof e.service=="string"||"endpoint_id"in e.service)){let j=typeof e.service=="string"?Q[e.service]:e.service.endpoint_id;S=_.tokens.getByResourceServer(j),S&&(d.Authorization=`Bearer ${S.access_token}`)}let x=t?.body;!x&&t?.payload&&(x=JSON.stringify(t.payload)),!d?.["Content-Type"]&&x&&(d["Content-Type"]="application/json");let q=ee(e.service,e.path,{search:t?.query},o),w={method:e.method,body:x,...a,headers:d},f=ar.default;if(a?.__callable&&(f=a.__callable.bind(this),delete w.__callable),e.preventRetry||!_||!S||!te(S))return f(q,w);let M=await f(q,w);if(M.ok)return M;let $;try{$=Z(await M.clone().json())}catch{$=!1}if(M.status===401&&!$){let j=await _.refreshToken(S);return j?f(q,{...w,headers:{...w.headers,Authorization:`Bearer ${j.access_token}`}}):M}return M}var Ue={};u(Ue,{getAll:()=>oo});var oo=function(e,t={},r){return s({service:T,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}/consents`},t,r)};var so=function(e,t={},r){return s({service:T,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}`},t,r)},no=function(e={},t){return s({service:T,scope:B.VIEW_IDENTITIES,path:"/v2/api/identities"},e,t)};var G={};u(G,{token:()=>He,userinfo:()=>mo});var He={};u(He,{exchange:()=>ao,introspect:()=>po,refresh:()=>uo,revoke:()=>co,token:()=>pr,validate:()=>lo});function io(e){return new URLSearchParams(e)}function re(e){return{...e,body:e.payload?io(e.payload):void 0,headers:{...e?.headers||{},Accept:"application/json","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}}var pr=function(e={},t){return s({service:T,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},ao=pr,po=function(e,t){if(!e?.payload)throw new Error("'payload' is required for introspect");return s({service:T,scope:void 0,path:"/v2/oauth2/token/introspect",method:"POST",preventRetry:!0},re(e),t)},co=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return s({service:T,scope:void 0,path:"/v2/oauth2/token/revoke",method:"POST",preventRetry:!0},re(e),t)},uo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return s({service:T,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},lo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for validate");return s({service:T,scope:void 0,path:"/v2/oauth2/token/validate",method:"POST",preventRetry:!0},re(e),t)};var mo=function(e,t){return s({service:T,scope:void 0,path:"/v2/oauth2/userinfo",method:"GET"},e,t)};var Be={};u(Be,{hasConsentForScope:()=>ho,splitScopeString:()=>$e,toScopeTree:()=>ur});function $e(e){let t=[],r="",o=0;return e.split("").forEach((a,d)=>{r+=a,a==="["&&(o+=1),a==="]"&&(o-=1),(a===" "&&o===0||d===e.length-1&&r)&&(t.push(r.trim()),r="")}),t}function cr(e){let t=e,r=t.startsWith("*");r&&(t=t.replace(/^\*\s*/,""));let o=[],a=t.indexOf("[");if(a===-1)return{scope:t,atomically_revocable:r,children:[]};let d=t.slice(0,a),_=t.slice(a+1,-1);return o=$e(_).map(cr),{scope:d,atomically_revocable:r,children:o}}function ur(e){return $e(e).map(cr)}function ho(e,t){let r=ur(t);function o(a,d){let _=e.find(S=>S.scope_name===a.scope&&(d?S.dependency_path.join(",")===[...d,S.id].join(","):S.dependency_path.length===1));return _?a.children.length?a.children.every(S=>o(S,d?[...d,_.id]:[_.id])):_.status==="approved":!1}return r.every(a=>o(a))}var ze=ge;function Ve(){return ee(T,"/v2/oauth2/authorize")}function fo(){return ee(T,"/v2/oauth2/token")}function K(e){return typeof e=="object"&&e!==null&&"access_token"in e}function te(e){return K(e)&&e!==null&&"refresh_token"in e}function ve(e){return K(e)&&e!==null&&"resource_server"in e}var oe=class{constructor(t){this.name=t}#e=[];addListener(t){return this.#e.push(t),()=>this.removeListener(t)}removeListener(t){this.#e=this.#e.filter(r=>r!==t)}clearListeners(){this.#e=[]}async dispatch(t){await Promise.all(this.#e.map(r=>r(t)))}};function lr(){return"crypto"in globalThis}function Ye(){return"webcrypto"in globalThis.crypto?globalThis.crypto.webcrypto:globalThis.crypto}var go=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");async function yo(e){let t=await Ye().subtle.digest("SHA-256",new TextEncoder().encode(e));return String.fromCharCode(...new Uint8Array(t))}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",dr=`${We}-._~`;function mr(){return Array.from(Ye().getRandomValues(new Uint8Array(43))).map(e=>dr[e%dr.length]).join("")}async function hr(e){let t=await yo(e);return go(t)}function fr(){return Array.from(Ye().getRandomValues(new Uint8Array(16))).map(e=>We[e%We.length]).join("")}var W={PKCE_STATE:"pkce_state",PKCE_CODE_VERIFIER:"pkce_code_verifier"};function So(){sessionStorage.removeItem(W.PKCE_STATE),sessionStorage.removeItem(W.PKCE_CODE_VERIFIER)}var _e=class e{#e;constructor(t){if(this.#e=t,e.supported===!1)throw new Error("RedirectTransport is not supported in this environment.")}static supported=lr();async send(){let t=mr(),r=await hr(t),o=this.#e.params?.state??fr();sessionStorage.setItem(W.PKCE_CODE_VERIFIER,t),sessionStorage.setItem(W.PKCE_STATE,o);let a={response_type:"code",client_id:this.#e.client,scope:this.#e.scopes||"",redirect_uri:this.#e.redirect,state:o,code_challenge:r,code_challenge_method:"S256",...this.#e.params||{}},d=new URL(Ve());d.search=new URLSearchParams(a).toString(),window.location.assign(d.toString())}async getToken(t={shouldReplace:!0,includeConsentedScopes:!1}){let r=new URL(window.location.href),o=new URLSearchParams(r.search);if(o.get("error"))throw new Error(o.get("error_description")||"An error occurred during the authorization process.");let a=o.get("code");if(!a)return;let d=sessionStorage.getItem(W.PKCE_STATE),_=sessionStorage.getItem(W.PKCE_CODE_VERIFIER);if(So(),o.get("state")!==d)throw new Error('Invalid State. The received "state" parameter does not match the expected state.');if(!_)throw new Error("Invalid Code Verifier");let S={code:a,client_id:this.#e.client,code_verifier:_,redirect_uri:this.#e.redirect,grant_type:"authorization_code"},x=await(await G.token.exchange({query:t.includeConsentedScopes?{include_consented_scopes:!0}:void 0,payload:S})).json();return t.shouldReplace&&(o.delete("code"),o.delete("state"),r.search=o.toString(),window.location.replace(r)),x}};var Te=class{#e;constructor(t){this.#e=t.manager}#r(t){let r=this.#e.storage.getItem(t)||"null",o=null;try{let a=JSON.parse(r);K(a)&&(o=a)}catch{}return o}#t(t){let r=ze.RESOURCE_SERVERS?.[t];return this.getByResourceServer(r)}getByResourceServer(t){return this.#r(`${this.#e.storageKeyPrefix}${t}`)}get auth(){return this.#t(I.AUTH)}get transfer(){return this.#t(I.TRANSFER)}get flows(){return this.#t(I.FLOWS)}get groups(){return this.#t(I.GROUPS)}get search(){return this.#t(I.SEARCH)}get timer(){return this.#t(I.TIMER)}get compute(){return this.#t(I.COMPUTE)}gcs(t){return this.getByResourceServer(t)}getAll(){return Object.keys(this.#e.storage).reduce((r,o)=>(o.startsWith(this.#e.storageKeyPrefix)&&r.push(this.#r(o)),r),[]).filter(K)}add(t){let r=Date.now(),o=r+t.expires_in*1e3;this.#e.storage.setItem(`${this.#e.storageKeyPrefix}${t.resource_server}`,JSON.stringify({...t,__metadata:{created:r,expires:o}})),"other_tokens"in t&&t.other_tokens?.forEach(a=>{this.add(a)})}remove(t){this.#e.storage.removeItem(`${this.#e.storageKeyPrefix}${t.resource_server}`)}static isTokenExpired(t,r=0){if(!(!t||!t.__metadata||typeof t.__metadata.expires!="number"))return Date.now()+r>=t.__metadata.expires}};var se=class{#e={};getItem(t){return this.#e[t]!==void 0?this.#e[t]:null}setItem(t,r){this.#e[t]=r}removeItem(t){delete this.#e[t]}key(t){return Object.keys(this.#e)[t]}clear(){this.#e={}}get length(){return Object.keys(this.#e).length}};var vo={redirect:_e},gr={useRefreshTokens:!1,defaultScopes:"openid profile email",transport:"redirect"},yr={execute:!0,additionalParams:void 0},ne=class{#e;configuration;storage;#r=!1;get authenticated(){return this.#r}set authenticated(t){t!==this.#r&&(this.#r=t,this.#n())}tokens;events={authenticated:new oe("authenticated"),revoke:new oe("revoke")};constructor(t){if(!t.client)throw new Error("You must provide a `client` for your application.");let r=t.defaultScopes===!1?"":t.defaultScopes??gr.defaultScopes;this.configuration={...gr,...t,scopes:[t.scopes?t.scopes:"",r].filter(o=>o.length).join(" ")},this.storage=t.storage||new se,this.configuration.events&&Object.entries(this.configuration.events).forEach(([o,a])=>{o in this.events&&this.events[o].addListener(a)}),this.tokens=new Te({manager:this}),this.#t()}get storageKeyPrefix(){return`${this.configuration.client}:`}get user(){let t=this.getGlobusAuthToken();return t&&t.id_token?tr(t.id_token):null}async refreshTokens(){R("debug","AuthorizationManager.refreshTokens");let t=await Promise.allSettled(this.tokens.getAll().map(r=>te(r)?this.refreshToken(r):Promise.resolve(null)));return this.#t(),t}async refreshToken(t){R("debug",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`);try{let r=await(await G.token.refresh({payload:{client_id:this.configuration.client,refresh_token:t.refresh_token,grant_type:"refresh_token"}})).json();if(ve(r))return this.addTokenResponse(r),r}catch{R("error",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`)}return null}hasGlobusAuthToken(){return this.getGlobusAuthToken()!==null}getGlobusAuthToken(){let t=this.storage.getItem(`${this.storageKeyPrefix}${Q.AUTH}`);return t?JSON.parse(t):null}#t(){R("debug","AuthorizationManager.#checkAuthorizationState"),this.hasGlobusAuthToken()&&(this.authenticated=!0)}async#n(){let t=this.authenticated,r=this.getGlobusAuthToken()??void 0;await this.events.authenticated.dispatch({isAuthenticated:t,token:r})}reset(){Object.keys(this.storage).forEach(t=>{t.startsWith(this.storageKeyPrefix)&&this.storage.removeItem(t)}),this.authenticated=!1}#s(t){return`${t}${this.configuration.useRefreshTokens?" offline_access":""}`}#o(t){let{scopes:r,...o}=t??{},a=vo[this.configuration.transport||"redirect"],d=this.#s(r??(this.configuration.scopes||""));return this.storage instanceof se&&(d=[...new Set(d.split(" ").concat((this.configuration?.scopes||"").split(" ")))].join(" ")),new a({client:this.configuration.client,redirect:this.configuration.redirect,scopes:d,...o,params:{...o?.params}})}async login(t={additionalParams:{}}){R("debug","AuthorizationManager.login"),this.reset(),await this.#o({params:t?.additionalParams}).send()}async prompt(t){R("debug","AuthorizationManager.prompt"),await this.#o(t).send()}async handleCodeRedirect(t={shouldReplace:!0,additionalParams:{}}){R("debug","AuthorizationManager.handleCodeRedirect");let r=await this.#o({params:t?.additionalParams}).getToken({shouldReplace:t?.shouldReplace,includeConsentedScopes:t?.includeConsentedScopes});return ve(r)&&(R("debug",`AuthorizationManager.handleCodeRedirect | response=${JSON.stringify(r)}`),this.addTokenResponse(r)),r}async handleErrorResponse(t,r){let o=typeof r=="boolean"?{...yr,execute:r}:{...yr,...r};R("debug",`AuthorizationManager.handleErrorResponse | response=${JSON.stringify(t)} execute=${o.execute}`);let a=async()=>{};return Z(t)&&(R("debug","AuthorizationManager.handleErrorResponse | error=AuthorizationRequirementsError"),a=async()=>{await this.handleAuthorizationRequirementsError(t,{additionalParams:o.additionalParams})}),Ie(t)&&(R("debug","AuthorizationManager.handleErrorResponse | error=ConsentRequiredError"),a=async()=>{await this.handleConsentRequiredError(t,{additionalParams:o.additionalParams})}),"code"in t&&t.code==="AuthenticationFailed"&&(R("debug","AuthorizationManager.handleErrorResponse | error=AuthenticationFailed"),a=async()=>{await this.revoke()}),o.execute===!0?await a():a}async handleAuthorizationRequirementsError(t,r){this.#e=this.#o({params:{prompt:"login",...Fe(t),...r?.additionalParams}}),await this.#e.send()}async handleConsentRequiredError(t,r){this.#e=this.#o({scopes:this.#s(t.required_scopes.join(" ")),params:{...r?.additionalParams}}),await this.#e.send()}addTokenResponse=t=>{this.tokens.add(t),this.#t()};async revoke(){R("debug","AuthorizationManager.revoke");let t=Promise.all(this.tokens.getAll().map(this.#i.bind(this)));this.reset(),await t,await this.events.revoke.dispatch()}#i(t){return R("debug",`AuthorizationManager.revokeToken | resource_server=${t.resource_server}`),G.token.revoke({payload:{client_id:this.configuration.client,token:t.access_token}})}};function _o(e){return new ne(e)}var mt={};u(mt,{CONFIG:()=>Ts,access:()=>rt,collectionBookmarks:()=>ot,endpoint:()=>et,endpointManager:()=>at,endpointSearch:()=>Sr,fileOperations:()=>Xe,task:()=>tt,taskSubmission:()=>Ze,utils:()=>lt});var Sr=function(e,t){let r={...e,query:e?.query};return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_search"},r,t)};var Xe={};u(Xe,{ls:()=>To,mkdir:()=>Ro,rename:()=>Eo,stat:()=>bo,symlink:()=>Oo});function H(e){return e==="GET"?{}:{"Content-Type":"application/json"}}var To=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/ls`},t,r)},Ro=function(e,t,r){let o={payload:{DATA_TYPE:"mkdir",...t?.payload},headers:{...H("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/mkdir`,method:"POST"},o,r)},Eo=function(e,t,r){let o={payload:{DATA_TYPE:"rename",...t?.payload},headers:{...H("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/rename`,method:"POST"},o,r)},Oo=function(e,t,r){let o={payload:{DATA_TYPE:"symlink",...t?.payload},headers:{...H("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/symlink`,method:"POST"},o,r)},bo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/stat`},t,r)};var Ze={};u(Ze,{submissionId:()=>Do,submitDelete:()=>xo,submitTransfer:()=>Po});var xo=function(e,t){let r={payload:{DATA_TYPE:"delete",...e?.payload},headers:{...H("POST"),...e?.headers}};return s({service:p,scope:c.ALL,path:"/v0.10/delete",method:"POST"},r,t)},Po=function(e,t){let r={payload:{DATA_TYPE:"transfer",...e?.payload},headers:{...H("POST"),...e?.headers}};return s({service:p,scope:c.ALL,path:"/v0.10/transfer",method:"POST"},r,t)},Do=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/submission_id"},e,t)};var et={};u(et,{create:()=>Co,get:()=>Ao,remove:()=>wo,update:()=>Mo});var Ao=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`},t,r)},Co=function(e,t){return e?.payload&&Object.assign(e.payload,{DATA_TYPE:"shared_endpoint"}),s({service:p,scope:c.ALL,path:"/v0.10/shared_endpoint",method:"POST"},e,t)},Mo=function(e,t,r){return t?.payload&&Object.assign(t.payload,{DATA_TYPE:"endpoint"}),s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"PUT"},t,r)},wo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"DELETE"},t,r)};var tt={};u(tt,{cancel:()=>Io,get:()=>ko,getAll:()=>Lo,getEventList:()=>Go,getPauseInfo:()=>Uo,getSkippedErrors:()=>jo,getSuccessfulTransfers:()=>qo,remove:()=>Fo,update:()=>No});var Lo=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},ko=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}`},t,r)},No=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}`,method:"PUT"},t,r)},Io=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/cancel`,method:"POST"},t,r)},Fo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/remove`,method:"POST"},t,r)},Go=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/event_list`},t,r)},qo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/successful_transfers`},t,r)},jo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/skipped_errors`},t,r)},Uo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/pause_info`},t,r)};var rt={};u(rt,{create:()=>Ho,get:()=>$o,getAll:()=>Jo,remove:()=>zo,update:()=>Bo});var Jo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access_list`},t,r)},Ho=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access`,method:"POST"},t,r)},$o=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`},r,o)},Bo=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"PUT"},r,o)},zo=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"DELETE"},r,o)};var ot={};u(ot,{create:()=>Ko,get:()=>Wo,getAll:()=>Vo,remove:()=>Qo,update:()=>Yo});var Vo=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/bookmark_list"},e,t)},Ko=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/bookmark",method:"POST"},e,t)},Wo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`},t,r)},Yo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"PUT"},t,r)},Qo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"DELETE"},t,r)};var at={};u(at,{endpoint:()=>st,pauseRule:()=>nt,task:()=>it});var st={};u(st,{get:()=>Xo,getAccessList:()=>es,getHostedEndpoints:()=>Zo,getMonitoredEndpoints:()=>ts});var Xo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}`},t,r)},Zo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/hosted_endpoint_list`},t,r)},es=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/access_list`},t,r)},ts=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/monitored_endpoints"},e,t)};var nt={};u(nt,{create:()=>os,get:()=>ss,getAll:()=>rs,remove:()=>is,update:()=>ns});var rs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule_list"},e,t)},os=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule",method:"POST"},e,t)},ss=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`},t,r)},ns=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"PUT"},t,r)},is=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"DELETE"},t,r)};var it={};u(it,{cancel:()=>cs,get:()=>ps,getAdminCancel:()=>us,getAll:()=>as,getEventList:()=>ds,getPauseInfo:()=>gs,getSkippedErrors:()=>ms,getSuccessfulTransfers:()=>ls,pause:()=>hs,resume:()=>fs});var as=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},ps=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}`},t,r)},cs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_cancel",method:"POST"},e,t)},us=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/admin_cancel/${e}`,method:"POST"},t,r)},ds=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/event_list`},t,r)},ls=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/successful_transfers`},t,r)},ms=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/skipped_errors`},t,r)},hs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_pause",method:"POST"},e,t)},fs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_resume",method:"POST"},e,t)},gs=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/pause_info`},t,r)};var lt={};u(lt,{getDomainFromEndpoint:()=>_s,isDirectory:()=>ys,isFileDocument:()=>_r,readableBytes:()=>Ss});function _r(e){return typeof e=="object"&&e!==null&&"DATA_TYPE"in e&&e.DATA_TYPE==="file"}function ys(e){return _r(e)&&e.type==="dir"}var pt=1e3,ct=pt*1e3,ut=ct*1e3,dt=ut*1e3,vr=dt*1e3;function Ss(e,t=2){let r="B",o=1;if(e<pt)return`${e} ${r}`;e<ct?(r="KB",o=pt):e<ut?(r="MB",o=ct):e<dt?(r="GB",o=ut):e<vr?(r="TB",o=dt):(r="PB",o=vr);let a=e/o,[d,_]=`${a}`.split("."),S=`${d}`;if(_&&_.length){let x=_.slice(0,t);x.length&&(S=`${d}.${x}`)}return`${S} ${r}`}var vs=["dnsteam.globuscs.info","data.globus.org","dn.glob.us"];function _s(e){let{tlsftp_server:t}=e;if(!t||typeof t!="string")return null;let{hostname:r}=new URL(t.replace("tlsftp","https"));return!vs.find(d=>r.endsWith(d))&&/(?:[gm]-\w{6}.)?(\w+(\.\w+)+)$/.exec(r)?.[1]||r||null}var Ts=ue;var vt={};u(vt,{CONFIG:()=>Ns,entry:()=>gt,index:()=>St,query:()=>ht,subject:()=>ft});var ht={};u(ht,{get:()=>Rs,post:()=>Es});var Rs=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/search`},t,r)},Es=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/search`,method:"POST"},t,r)};var ft={};u(ft,{get:()=>Os});var Os=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/subject`},t,r)};var gt={};u(gt,{get:()=>bs});var bs=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/entry`},t,r)};var St={};u(St,{create:()=>Ms,get:()=>As,getAll:()=>Cs,ingest:()=>ks,remove:()=>ws,reopen:()=>Ls,roles:()=>yt});var yt={};u(yt,{create:()=>Ps,getAll:()=>xs,remove:()=>Ds});var xs=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/role_list`},t,r)},Ps=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/role`,method:"POST"},t,r)},Ds=function({index_id:e,role_id:t},r,o){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/role/${t}`,method:"DELETE"},r,o)};var As=function(e,t,r){return s({service:g,path:`/v1/index/${e}`},t,r)},Cs=function(e,t){return s({service:g,scope:O.ALL,path:"/v1/index_list"},e,t)},Ms=function(e,t){return s({service:g,scope:O.ALL,path:"/v1/index",method:"POST"},e,t)},ws=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}`,method:"DELETE"},t,r)},Ls=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/reopen`,method:"POST"},t,r)},ks=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/ingest`,method:"POST"},t,r)};var Ns=he;var Et={};u(Et,{CONFIG:()=>js,groups:()=>_t,membership:()=>Rt,policies:()=>Tt});var _t={};u(_t,{get:()=>Fs,getMyGroups:()=>Is});var Is=function(e,t){return s({scope:N.ALL,path:"/v2/groups/my_groups",service:P},e,t)},Fs=function(e,t,r){return s({service:P,scope:N.ALL,path:`/v2/groups/${e}`},t,r)};var Tt={};u(Tt,{get:()=>Gs});var Gs=function(e,t,r){return s({scope:N.ALL,path:`/v2/groups/${e}/policies`,service:P},t,r)};var Rt={};u(Rt,{act:()=>qs});var qs=function(e,t,r){if(!t?.payload)throw new Error("payload is required.");return s({service:P,scope:N.ALL,path:`/v2/groups/${e}`,method:"POST"},t,r)};var js=me;var xt={};u(xt,{CONFIG:()=>Ys,flows:()=>Ot,runs:()=>bt});var Ot={};u(Ot,{create:()=>Tr,deploy:()=>zs,get:()=>Js,getAll:()=>Us,remove:()=>Hs,run:()=>$s,validate:()=>Bs});var Us=function(e,t){return s({service:E,scope:D.VIEW_FLOWS,path:"/flows"},e,t)},Js=function(e,t,r){return s({service:E,scope:D.VIEW_FLOWS,path:`/flows/${e}`},t,r)},Hs=function(e,t,r){return s({scope:D.MANAGE_FLOWS,service:E,path:`/flows/${e}`,method:"DELETE"},t,r)},$s=function(e,t,r){return s({service:E,scope:D.VIEW_FLOWS,path:`/flows/${e}/run`,method:"POST"},t,r)},Bs=function(e,t){return s({service:E,scope:D.MANAGE_FLOWS,path:"/flows/validate",method:"POST"},e,t)},Tr=function(e,t){return s({service:E,scope:D.MANAGE_FLOWS,path:"/flows",method:"POST"},e,t)},zs=Tr;var bt={};u(bt,{cancel:()=>Ks,getAll:()=>Vs,getLog:()=>Ws});var Vs=function(e={},t){return s({service:E,scope:D.RUN_MANAGE,path:"/runs"},e,t)},Ks=function(e,t,r){return s({service:E,scope:D.RUN_MANAGE,path:`/runs/${e}/cancel`,method:"POST"},t,r)},Ws=function(e,t,r){return s({service:E,scope:D.RUN_MANAGE,path:`/runs/${e}/log`},t,r)};var Ys=de;var Ft={};u(Ft,{collections:()=>Pt,endpoint:()=>Dt,getScopes:()=>qn,https:()=>At,nodes:()=>Ct,roles:()=>Mt,storageGateways:()=>wt,userCredentials:()=>Lt,utils:()=>It,versioning:()=>Nt});var Pt={};u(Pt,{create:()=>en,get:()=>Xs,getAll:()=>Qs,patch:()=>rn,remove:()=>Zs,resetOwnerString:()=>sn,update:()=>tn,updateOwnerString:()=>on});var Qs=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/collections"},t,r)},Xs=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`},r,o)},Zs=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"DELETE"},r,o)},en=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/collections",method:"POST"},t,r)},tn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PUT"},r,o)},rn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PATCH"},r,o)},on=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"PUT"},r,o)},sn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"DELETE"},r,o)};var Dt={};u(Dt,{get:()=>nn,patch:()=>pn,resetOwnerString:()=>ln,update:()=>an,updateOwner:()=>un,updateOwnerString:()=>dn,updateSubscriptionId:()=>cn});var nn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint"},t,r)},an=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PUT"},t,r)},pn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PATCH"},t,r)},cn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/subscription_id",method:"PUT"},t,r)},un=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner",method:"PUT"},t,r)},dn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"PUT"},t,r)},ln=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"DELETE"},t,r)};var At={};u(At,{get:()=>mn,remove:()=>hn,update:()=>fn});var mn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t},r,o)},hn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t,method:"DELETE"},r,o)},fn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t,method:"PUT"},r,o)};var Ct={};u(Ct,{create:()=>vn,get:()=>yn,getAll:()=>gn,patch:()=>Tn,remove:()=>Sn,update:()=>_n});var gn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/nodes"},t,r)},yn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`},r,o)},Sn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"DELETE"},r,o)},vn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/nodes",method:"POST"},t,r)},_n=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PUT"},r,o)},Tn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PATCH"},r,o)};var Mt={};u(Mt,{create:()=>bn,get:()=>En,getAll:()=>Rn,remove:()=>On});var Rn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/roles"},t,r)},En=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`},r,o)},On=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`,method:"DELETE"},r,o)},bn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/roles",method:"POST"},t,r)};var wt={};u(wt,{create:()=>An,get:()=>Pn,getAll:()=>xn,patch:()=>Mn,remove:()=>Dn,update:()=>Cn});var xn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways"},t,r)},Pn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`},r,o)},Dn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"DELETE"},r,o)},An=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways",method:"POST"},t,r)},Cn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PUT"},r,o)},Mn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PATCH"},r,o)};var Lt={};u(Lt,{create:()=>Nn,get:()=>Ln,getAll:()=>wn,patch:()=>Fn,remove:()=>kn,update:()=>In});var wn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials"},t,r)},Ln=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`},r,o)},kn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"DELETE"},r,o)},Nn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials",method:"POST"},t,r)},In=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PUT"},r,o)},Fn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PATCH"},r,o)};var Nt={};u(Nt,{info:()=>kt});var kt=function(e,t,r){return s({service:e,path:"/api/info"},t,r)};var It={};u(It,{getEndpointIdFromURL:()=>Gn,getGCSDomainFromURL:()=>Rr});var ie="data.globus.org";function Rr(e){let{host:t}=typeof e=="string"?new URL(e):e;if(!t.endsWith(ie))return t;let[r]=t.split(`.${ie}`),o=r.split(".");return(o.length===2?[...o,ie]:[o[1],o[2],ie]).join(".")}async function Gn(e){let t=typeof e=="string"?new URL(e):e;if(!t.host.endsWith(ie))return null;let a=(await(await kt({host:`https://${Rr(t)}`})).json()).data?.filter(d=>d.DATA_TYPE.startsWith("info#"))[0];return a&&"endpoint_id"in a?a.endpoint_id:null}var Er={HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections",NON_HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections[*https://auth.globus.org/scopes/<MAPPED_COLLECTION_ID>/data_access]"};function qn(e,t){let{endpoint_id:r}=e;if(!r)throw new Error("An 'endpoint_id' is required to determine the required scopes");return t?Er[t].replace("<ENDPOINT_ID>",r):Object.entries(Er).reduce((o,[a,d])=>({...o,[a]:d.replace("<ENDPOINT_ID>",r)}),{})}var Gt={};u(Gt,{CONFIG:()=>jn,create:()=>Or});var Or=function(e,t){return s({service:L,scope:"https://auth.globus.org/scopes/524230d7-ea86-4a52-8312-86065a9e0417/timer",path:"/v2/timer",method:"POST"},e,t)};var jn=le;var jt={};u(jt,{CONFIG:()=>$n,endpoints:()=>qt});var qt={};u(qt,{get:()=>Jn,getAll:()=>Un,getStatus:()=>Hn});var Un=function(e,t){return s({service:C,scope:Y.ALL,path:"/v2/endpoints",method:"GET"},e,t)},Jn=function(e,t,r){return s({service:C,scope:Y.ALL,path:`/v2/endpoints/${e}`,method:"GET"},t,r)},Hn=function(e,t,r){return s({service:C,scope:Y.ALL,path:`/v2/endpoints/${e}/status`},t,r)};var $n=fe;var Ut={};u(Ut,{HOSTS:()=>br,host:()=>xr,url:()=>Pr,urlFor:()=>zn});var br={integration:"app.integration.globuscs.info",sandbox:"app.sandbox.globuscs.info",test:"app.test.globuscs.info",staging:"app.staging.globuscs.info",preview:"app.preview.globus.org",production:"app.globus.org"};function xr(e=z()){return br[e]}function Pr(e,t){return new URL(e||"",`https://${xr(t?.environment)}`)}var Bn={TASK:"/activity/%s/overview",COLLECTION:"/file-manager/collections/%s/overview",ENDPOINT:"/file-manager/collections/%s/overview"};function zn(e,t,r){let o=Bn[e].replace(/%s/g,t?.join("/")||"");return Pr(o,r)}return Ur(Vn);})();
1
+ var globus=(()=>{var Ir=Object.create;var pe=Object.defineProperty;var Fr=Object.getOwnPropertyDescriptor;var Gr=Object.getOwnPropertyNames;var qr=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty;var Ur=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},zt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Gr(t))!jr.call(e,a)&&a!==r&&pe(e,a,{get:()=>t[a],enumerable:!(o=Fr(t,a))||o.enumerable});return e};var Jr=(e,t,r)=>(r=e!=null?Ir(qr(e)):{},zt(t||!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),Hr=e=>zt(pe({},"__esModule",{value:!0}),e);var ir=Ur((F,nr)=>{var ye=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Se=function(){function e(){this.fetch=!1,this.DOMException=ye.DOMException}return e.prototype=ye,new e}();(function(e){var t=function(r){var o=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function d(n){return n&&DataView.prototype.isPrototypeOf(n)}if(a.arrayBuffer)var _=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],S=ArrayBuffer.isView||function(n){return n&&_.indexOf(Object.prototype.toString.call(n))>-1};function x(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function q(n){return typeof n!="string"&&(n=String(n)),n}function w(n){var i={next:function(){var l=n.shift();return{done:l===void 0,value:l}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function f(n){this.map={},n instanceof f?n.forEach(function(i,l){this.append(l,i)},this):Array.isArray(n)?n.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(i){this.append(i,n[i])},this)}f.prototype.append=function(n,i){n=x(n),i=q(i);var l=this.map[n];this.map[n]=l?l+", "+i:i},f.prototype.delete=function(n){delete this.map[x(n)]},f.prototype.get=function(n){return n=x(n),this.has(n)?this.map[n]:null},f.prototype.has=function(n){return this.map.hasOwnProperty(x(n))},f.prototype.set=function(n,i){this.map[x(n)]=q(i)},f.prototype.forEach=function(n,i){for(var l in this.map)this.map.hasOwnProperty(l)&&n.call(i,this.map[l],l,this)},f.prototype.keys=function(){var n=[];return this.forEach(function(i,l){n.push(l)}),w(n)},f.prototype.values=function(){var n=[];return this.forEach(function(i){n.push(i)}),w(n)},f.prototype.entries=function(){var n=[];return this.forEach(function(i,l){n.push([l,i])}),w(n)},a.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function M(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function $(n){return new Promise(function(i,l){n.onload=function(){i(n.result)},n.onerror=function(){l(n.error)}})}function Jt(n){var i=new FileReader,l=$(i);return i.readAsArrayBuffer(n),l}function j(n){var i=new FileReader,l=$(i),h=/charset=([A-Za-z0-9_-]+)/.exec(n.type),v=h?h[1]:"utf-8";return i.readAsText(n,v),l}function Cr(n){for(var i=new Uint8Array(n),l=new Array(i.length),h=0;h<i.length;h++)l[h]=String.fromCharCode(i[h]);return l.join("")}function Ht(n){if(n.slice)return n.slice(0);var i=new Uint8Array(n.byteLength);return i.set(new Uint8Array(n)),i.buffer}function $t(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:a.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:a.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():a.arrayBuffer&&a.blob&&d(n)?(this._bodyArrayBuffer=Ht(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||S(n))?this._bodyArrayBuffer=Ht(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var n=M(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=M(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(Jt);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=M(this);if(n)return n;if(this._bodyBlob)return j(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Cr(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(Lr)}),this.json=function(){return this.text().then(JSON.parse)},this}var Mr=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function wr(n){var i=n.toUpperCase();return Mr.indexOf(i)>-1?i:n}function k(n,i){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var l=i.body;if(n instanceof k){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,i.headers||(this.headers=new f(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!l&&n._bodyInit!=null&&(l=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new f(i.headers)),this.method=wr(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in o){var m=new AbortController;return m.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&l)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(l),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var h=/([?&])_=[^&]*/;if(h.test(this.url))this.url=this.url.replace(h,"$1_="+new Date().getTime());else{var v=/\?/;this.url+=(v.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function Lr(n){var i=new FormData;return n.trim().split("&").forEach(function(l){if(l){var h=l.split("="),v=h.shift().replace(/\+/g," "),m=h.join("=").replace(/\+/g," ");i.append(decodeURIComponent(v),decodeURIComponent(m))}}),i}function kr(n){var i=new f,l=n.replace(/\r?\n[\t ]+/g," ");return l.split("\r").map(function(h){return h.indexOf(`
2
+ `)===0?h.substr(1,h.length):h}).forEach(function(h){var v=h.split(":"),m=v.shift().trim();if(m){var ae=v.join(":").trim();try{i.append(m,ae)}catch(Ee){console.warn("Response "+Ee.message)}}}),i}$t.call(k.prototype);function A(n,i){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new f(i.headers),this.url=i.url||"",this._initBody(n)}$t.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var n=new A(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var Nr=[301,302,303,307,308];A.redirect=function(n,i){if(Nr.indexOf(i)===-1)throw new RangeError("Invalid status code");return new A(null,{status:i,headers:{location:n}})},r.DOMException=o.DOMException;try{new r.DOMException}catch{r.DOMException=function(i,l){this.message=i,this.name=l;var h=Error(i);this.stack=h.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function Re(n,i){return new Promise(function(l,h){var v=new k(n,i);if(v.signal&&v.signal.aborted)return h(new r.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function ae(){m.abort()}m.onload=function(){var b={statusText:m.statusText,headers:kr(m.getAllResponseHeaders()||"")};v.url.indexOf("file://")===0&&(m.status<200||m.status>599)?b.status=200:b.status=m.status,b.url="responseURL"in m?m.responseURL:b.headers.get("X-Request-URL");var U="response"in m?m.response:m.responseText;setTimeout(function(){l(new A(U,b))},0)},m.onerror=function(){setTimeout(function(){h(new TypeError("Network request failed"))},0)},m.ontimeout=function(){setTimeout(function(){h(new TypeError("Network request timed out"))},0)},m.onabort=function(){setTimeout(function(){h(new r.DOMException("Aborted","AbortError"))},0)};function Ee(b){try{return b===""&&o.location.href?o.location.href:b}catch{return b}}if(m.open(v.method,Ee(v.url),!0),v.credentials==="include"?m.withCredentials=!0:v.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&(a.blob?m.responseType="blob":a.arrayBuffer&&(m.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof f||o.Headers&&i.headers instanceof o.Headers)){var Bt=[];Object.getOwnPropertyNames(i.headers).forEach(function(b){Bt.push(x(b)),m.setRequestHeader(b,q(i.headers[b]))}),v.headers.forEach(function(b,U){Bt.indexOf(U)===-1&&m.setRequestHeader(U,b)})}else v.headers.forEach(function(b,U){m.setRequestHeader(U,b)});v.signal&&(v.signal.addEventListener("abort",ae),m.onreadystatechange=function(){m.readyState===4&&v.signal.removeEventListener("abort",ae)}),m.send(typeof v._bodyInit>"u"?null:v._bodyInit)})}return Re.polyfill=!0,o.fetch||(o.fetch=Re,o.Headers=f,o.Request=k,o.Response=A),r.Headers=f,r.Request=k,r.Response=A,r.fetch=Re,r}({})})(Se);Se.fetch.ponyfill=!0;delete Se.fetch.polyfill;var V=ye.fetch?ye:Se;F=V.fetch;F.default=V.fetch;F.fetch=V.fetch;F.Headers=V.Headers;F.Request=V.Request;F.Response=V.Response;nr.exports=F});var Kn={};u(Kn,{auth:()=>Ke,authorization:()=>Qe,compute:()=>jt,errors:()=>Ge,flows:()=>xt,gcs:()=>Ft,groups:()=>Et,info:()=>xe,logger:()=>De,search:()=>vt,timer:()=>Gt,transfer:()=>mt,webapp:()=>Ut});var xe={};u(xe,{CLIENT_INFO:()=>Xt,VERSION:()=>Qt,addClientInfo:()=>Vr,getClientInfo:()=>Zt,getClientInfoRequestHeaders:()=>be});var Vt="X-Globus-Client-Info",$r=!0;function Kt(){return $r}var Br=";",zr=",";function Wt(e){return(Array.isArray(e)?e:[e]).map(r=>Object.entries(r).map(([o,a])=>`${o}=${a}`).join(zr)).join(Br)}var Yt="5.6.0";var Qt=Yt,Xt={product:"javascript-sdk",version:Qt},Oe=[Xt];function Vr(e){Oe=Oe.concat(e)}function Zt(){return Wt(Oe)}function be(){return Kt()?{[Vt]:Zt()}:{}}var De={};u(De,{log:()=>R,setLogLevel:()=>Wr,setLogger:()=>Kr});var Pe=["debug","info","warn","error"],ce,er=Pe.indexOf("error");function Kr(e){ce=e}function Wr(e){er=Pe.indexOf(e)}function R(e,...t){if(!ce||Pe.indexOf(e)<er)return;(ce[e]??ce.log)(...t)}var Qe={};u(Qe,{AuthorizationManager:()=>ne,create:()=>Ro});var J=class extends Error{};J.prototype.name="InvalidTokenError";function Yr(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function Qr(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Yr(t)}catch{return atob(t)}}function tr(e,t){if(typeof e!="string")throw new J("Invalid token specified: must be a string");t||(t={});let r=t.header===!0?0:1,o=e.split(".")[r];if(typeof o!="string")throw new J(`Invalid token specified: missing part #${r+1}`);let a;try{a=Qr(o)}catch(d){throw new J(`Invalid token specified: invalid base64 for part #${r+1} (${d.message})`)}try{return JSON.parse(a)}catch(d){throw new J(`Invalid token specified: invalid json for part #${r+1} (${d.message})`)}}var Ke={};u(Ke,{CONFIG:()=>ze,getAuthorizationEndpoint:()=>Ve,getTokenEndpoint:()=>yo,identities:()=>Je,isGlobusAuthTokenResponse:()=>ve,isRefreshToken:()=>te,isToken:()=>K,oauth2:()=>G,utils:()=>Be});var ge={};u(ge,{HOSTS:()=>Ne,ID:()=>T,RESOURCE_SERVERS:()=>Q,SCOPES:()=>B});var ue={};u(ue,{HOSTS:()=>Ae,ID:()=>p,SCOPES:()=>c});var p="TRANSFER",c={ALL:"urn:globus:auth:scope:transfer.api.globus.org:all"},Ae={sandbox:"transfer.api.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var de={};u(de,{HOSTS:()=>Ce,ID:()=>E,SCOPES:()=>D});var E="FLOWS",Ce={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"},D={MANAGE_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/manage_flows",VIEW_FLOWS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/view_flows",RUN:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run",RUN_STATUS:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_status",RUN_MANAGE:"https://auth.globus.org/scopes/eec9b274-0c81-4334-bdc2-54e90e689b9a/run_manage"};var le={};u(le,{HOSTS:()=>Me,ID:()=>L});var L="TIMER",Me={sandbox:"sandbox.timer.automate.globus.org",production:"timer.automate.globus.org",staging:"staging.timer.automate.globus.org",integration:"integration.timer.automate.globus.org",test:"test.timer.automate.globus.org",preview:"preview.timer.automate.globus.org"};var me={};u(me,{HOSTS:()=>we,ID:()=>P,SCOPES:()=>N});var P="GROUPS",we={sandbox:"groups.api.sandbox.globuscs.info",production:"groups.api.globus.org",staging:"groups.api.staging.globuscs.info",integration:"groups.api.integration.globuscs.info",test:"groups.api.test.globuscs.info",preview:"groups.api.preview.globuscs.info"},N={ALL:"urn:globus:auth:scope:groups.api.globus.org:all",VIEW_MY:"urn:globus:auth:scope:groups.api.globus.org:view_my_groups_and_membership"};var he={};u(he,{HOSTS:()=>Le,ID:()=>g,SCOPES:()=>O});var g="SEARCH",Le={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},O={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var fe={};u(fe,{HOSTS:()=>ke,ID:()=>C,SCOPES:()=>Y});var C="COMPUTE",ke={sandbox:"compute.api.sandbox.globuscs.info",production:"compute.api.globus.org",staging:"compute.api.staging.globuscs.info",integration:"compute.api.integration.globuscs.info",test:"compute.api.test.globuscs.info",preview:"compute.api.preview.globus.org"},Y={ALL:"https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all"};var T="AUTH",Ne={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"},B={VIEW_IDENTITIES:"urn:globus:auth:scope:auth.globus.org:view_identities"},Q={[T]:"auth.globus.org",[p]:"transfer.api.globus.org",[E]:"flows.globus.org",[P]:"groups.api.globus.org",[g]:"search.api.globus.org",[L]:"524230d7-ea86-4a52-8312-86065a9e0417",[C]:"funcx_service"};var Ge={};u(Ge,{EnvironmentConfigurationError:()=>X,isAuthorizationRequirementsError:()=>Z,isConsentRequiredError:()=>Ie,isErrorWellFormed:()=>rr,toAuthorizationQueryParams:()=>Fe});var X=class extends Error{name="EnvironmentConfigurationError";constructor(t,r){super(),this.message=`Invalid configuration value provided for ${t} (${r}).`}};function rr(e){return typeof e=="object"&&e!==null&&"code"in e&&"message"in e}function Ie(e){return rr(e)&&e.code==="ConsentRequired"&&"required_scopes"in e&&Array.isArray(e.required_scopes)}var Xr=["required_scopes"];function Fe(e){let t={scope:e.authorization_parameters.required_scopes?.join(" "),...e.authorization_parameters};return Object.entries(t).reduce((r,[o,a])=>{if(Xr.includes(o)||a===void 0||a===null)return r;let d=a;return Array.isArray(d)?d=d.join(","):typeof a=="boolean"&&(d=d?"true":"false"),{...r,[o]:d}},{})}function Z(e){return typeof e=="object"&&e!==null&&"authorization_parameters"in e&&typeof e.authorization_parameters=="object"&&e.authorization_parameters!==null}function Zr(){return typeof window<"u"?window:process}function eo(e){return typeof window==typeof e}function qe(e,t){let r=Zr(),o;return eo(r)?o=r:o=r.env,e in o?o[e]:t}var or={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"},I={[T]:T,[p]:p,[E]:E,[P]:P,[g]:g,[L]:L,[C]:C},to={[T]:Ne,[p]:Ae,[E]:Ce,[P]:we,[g]:Le,[L]:Me,[C]:ke};function je(e){let t=qe("GLOBUS_SDK_OPTIONS",{});return typeof t=="string"&&(t=JSON.parse(t)),{...t,...e,fetch:{...t?.fetch,...e?.fetch,options:{...t?.fetch?.options,...e?.fetch?.options,headers:{...t?.fetch?.options?.headers,...e?.fetch?.options?.headers}}}}}function z(){let e=je(),t=qe("GLOBUS_SDK_ENVIRONMENT",e?.environment??or.PRODUCTION);if(e?.environment&&t!==e.environment&&R("debug","GLOBUS_SDK_ENVIRONMENT and GLOBUS_SDK_OPTIONS.environment are set to different values. GLOBUS_SDK_ENVIRONMENT will take precedence"),!t||!Object.values(or).includes(t))throw new X("GLOBUS_SDK_ENVIRONMENT",t);return t}function ro(e,t=z()){return to[e][t]}function sr(e,t=z()){let r=ro(e,t);return qe(`GLOBUS_SDK_SERVICE_URL_${e}`,r?`https://${r}`:void 0)}function oo(e){let t=new URLSearchParams;return Array.from(Object.entries(e)).forEach(([r,o])=>{Array.isArray(o)?t.set(r,o.join(",")):o!==void 0&&t.set(r,String(o))}),t.toString()}function so(e,t="",r=z()){let o=sr(e,r);return new URL(t,o)}function ee(e,t,r,o){let a;return typeof e=="object"?a=new URL(t,e.host):a=so(e,t,o?.environment),r&&r.search&&(a.search=oo(r.search)),a.toString()}var Je={};u(Je,{consents:()=>Ue,get:()=>io,getAll:()=>ao});var ar=Jr(ir());async function s(e,t,r){let o=je(r),a=o?.fetch?.options||{},d={...be(),...t?.headers,...a.headers},_=o?.manager,S;if(e.resource_server&&_&&(S=_.tokens.getByResourceServer(e.resource_server),S&&(d.Authorization=`Bearer ${S.access_token}`)),e.scope&&_&&(typeof e.service=="string"||"endpoint_id"in e.service)){let j=typeof e.service=="string"?Q[e.service]:e.service.endpoint_id;S=_.tokens.getByResourceServer(j),S&&(d.Authorization=`Bearer ${S.access_token}`)}let x=t?.body;!x&&t?.payload&&(x=JSON.stringify(t.payload)),!d?.["Content-Type"]&&x&&(d["Content-Type"]="application/json");let q=ee(e.service,e.path,{search:t?.query},o),w={method:e.method,body:x,...a,headers:d},f=ar.default;if(a?.__callable&&(f=a.__callable.bind(this),delete w.__callable),e.preventRetry||!_||!S||!te(S))return f(q,w);let M=await f(q,w);if(M.ok)return M;let $;try{$=Z(await M.clone().json())}catch{$=!1}if(M.status===401&&!$){let j=await _.refreshToken(S);return j?f(q,{...w,headers:{...w.headers,Authorization:`Bearer ${j.access_token}`}}):M}return M}var Ue={};u(Ue,{getAll:()=>no});var no=function(e,t={},r){return s({service:T,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}/consents`},t,r)};var io=function(e,t={},r){return s({service:T,scope:B.VIEW_IDENTITIES,path:`/v2/api/identities/${e}`},t,r)},ao=function(e={},t){return s({service:T,scope:B.VIEW_IDENTITIES,path:"/v2/api/identities"},e,t)};var G={};u(G,{token:()=>He,userinfo:()=>fo});var He={};u(He,{exchange:()=>co,introspect:()=>uo,refresh:()=>mo,revoke:()=>lo,token:()=>pr,validate:()=>ho});function po(e){return new URLSearchParams(e)}function re(e){return{...e,body:e.payload?po(e.payload):void 0,headers:{...e?.headers||{},Accept:"application/json","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}}var pr=function(e={},t){return s({service:T,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},co=pr,uo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for introspect");return s({service:T,scope:void 0,path:"/v2/oauth2/token/introspect",method:"POST",preventRetry:!0},re(e),t)},lo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return s({service:T,scope:void 0,path:"/v2/oauth2/token/revoke",method:"POST",preventRetry:!0},re(e),t)},mo=function(e,t){if(!e?.payload)throw new Error("'payload' is required for revoke");return s({service:T,scope:void 0,path:"/v2/oauth2/token",method:"POST",preventRetry:!0},re(e),t)},ho=function(e,t){if(!e?.payload)throw new Error("'payload' is required for validate");return s({service:T,scope:void 0,path:"/v2/oauth2/token/validate",method:"POST",preventRetry:!0},re(e),t)};var fo=function(e,t){return s({service:T,scope:void 0,path:"/v2/oauth2/userinfo",method:"GET"},e,t)};var Be={};u(Be,{hasConsentForScope:()=>go,splitScopeString:()=>$e,toScopeTree:()=>ur});function $e(e){let t=[],r="",o=0;return e.split("").forEach((a,d)=>{r+=a,a==="["&&(o+=1),a==="]"&&(o-=1),(a===" "&&o===0||d===e.length-1&&r)&&(t.push(r.trim()),r="")}),t}function cr(e){let t=e,r=t.startsWith("*");r&&(t=t.replace(/^\*\s*/,""));let o=[],a=t.indexOf("[");if(a===-1)return{scope:t,atomically_revocable:r,children:[]};let d=t.slice(0,a),_=t.slice(a+1,-1);return o=$e(_).map(cr),{scope:d,atomically_revocable:r,children:o}}function ur(e){return $e(e).map(cr)}function go(e,t){let r=ur(t);function o(a,d){let _=e.find(S=>S.scope_name===a.scope&&(d?S.dependency_path.join(",")===[...d,S.id].join(","):S.dependency_path.length===1));return _?a.children.length?a.children.every(S=>o(S,d?[...d,_.id]:[_.id])):_.status==="approved":!1}return r.every(a=>o(a))}var ze=ge;function Ve(){return ee(T,"/v2/oauth2/authorize")}function yo(){return ee(T,"/v2/oauth2/token")}function K(e){return typeof e=="object"&&e!==null&&"access_token"in e}function te(e){return K(e)&&e!==null&&"refresh_token"in e}function ve(e){return K(e)&&e!==null&&"resource_server"in e}var oe=class{constructor(t){this.name=t}#e=[];addListener(t){return this.#e.push(t),()=>this.removeListener(t)}removeListener(t){this.#e=this.#e.filter(r=>r!==t)}clearListeners(){this.#e=[]}async dispatch(t){await Promise.all(this.#e.map(r=>r(t)))}};function lr(){return"crypto"in globalThis}function Ye(){return"webcrypto"in globalThis.crypto?globalThis.crypto.webcrypto:globalThis.crypto}var So=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");async function vo(e){let t=await Ye().subtle.digest("SHA-256",new TextEncoder().encode(e));return String.fromCharCode(...new Uint8Array(t))}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",dr=`${We}-._~`;function mr(){return Array.from(Ye().getRandomValues(new Uint8Array(43))).map(e=>dr[e%dr.length]).join("")}async function hr(e){let t=await vo(e);return So(t)}function fr(){return Array.from(Ye().getRandomValues(new Uint8Array(16))).map(e=>We[e%We.length]).join("")}var W={PKCE_STATE:"pkce_state",PKCE_CODE_VERIFIER:"pkce_code_verifier"};function _o(){sessionStorage.removeItem(W.PKCE_STATE),sessionStorage.removeItem(W.PKCE_CODE_VERIFIER)}var _e=class e{#e;constructor(t){if(this.#e=t,e.supported===!1)throw new Error("RedirectTransport is not supported in this environment.")}static supported=lr();async send(){let t=mr(),r=await hr(t),o=this.#e.params?.state??fr();sessionStorage.setItem(W.PKCE_CODE_VERIFIER,t),sessionStorage.setItem(W.PKCE_STATE,o);let a={response_type:"code",client_id:this.#e.client,scope:this.#e.scopes||"",redirect_uri:this.#e.redirect,state:o,code_challenge:r,code_challenge_method:"S256",...this.#e.params||{}},d=new URL(Ve());d.search=new URLSearchParams(a).toString(),window.location.assign(d.toString())}async getToken(t={shouldReplace:!0,includeConsentedScopes:!1}){let r=new URL(window.location.href),o=new URLSearchParams(r.search);if(o.get("error"))throw new Error(o.get("error_description")||"An error occurred during the authorization process.");let a=o.get("code");if(!a)return;let d=sessionStorage.getItem(W.PKCE_STATE),_=sessionStorage.getItem(W.PKCE_CODE_VERIFIER);if(_o(),o.get("state")!==d)throw new Error('Invalid State. The received "state" parameter does not match the expected state.');if(!_)throw new Error("Invalid Code Verifier");let S={code:a,client_id:this.#e.client,code_verifier:_,redirect_uri:this.#e.redirect,grant_type:"authorization_code"},x=await(await G.token.exchange({query:t.includeConsentedScopes?{include_consented_scopes:!0}:void 0,payload:S})).json();return t.shouldReplace&&(o.delete("code"),o.delete("state"),r.search=o.toString(),window.location.replace(r)),x}};var Te=class{#e;constructor(t){this.#e=t.manager}#r(t){let r=this.#e.storage.getItem(t)||"null",o=null;try{let a=JSON.parse(r);K(a)&&(o=a)}catch{}return o}#t(t){let r=ze.RESOURCE_SERVERS?.[t];return this.getByResourceServer(r)}getByResourceServer(t){return this.#r(`${this.#e.storageKeyPrefix}${t}`)}get auth(){return this.#t(I.AUTH)}get transfer(){return this.#t(I.TRANSFER)}get flows(){return this.#t(I.FLOWS)}get groups(){return this.#t(I.GROUPS)}get search(){return this.#t(I.SEARCH)}get timer(){return this.#t(I.TIMER)}get compute(){return this.#t(I.COMPUTE)}gcs(t){return this.getByResourceServer(t)}getAll(){return Object.keys(this.#e.storage).reduce((r,o)=>(o.startsWith(this.#e.storageKeyPrefix)&&r.push(this.#r(o)),r),[]).filter(K)}add(t){let r=Date.now(),o=r+t.expires_in*1e3;this.#e.storage.setItem(`${this.#e.storageKeyPrefix}${t.resource_server}`,JSON.stringify({...t,__metadata:{created:r,expires:o}})),"other_tokens"in t&&t.other_tokens?.forEach(a=>{this.add(a)})}remove(t){this.#e.storage.removeItem(`${this.#e.storageKeyPrefix}${t.resource_server}`)}static isTokenExpired(t,r=0){if(!(!t||!t.__metadata||typeof t.__metadata.expires!="number"))return Date.now()+r>=t.__metadata.expires}};var se=class{#e={};getItem(t){return this.#e[t]!==void 0?this.#e[t]:null}setItem(t,r){this.#e[t]=r}removeItem(t){delete this.#e[t]}key(t){return Object.keys(this.#e)[t]}clear(){this.#e={}}get length(){return Object.keys(this.#e).length}};var To={redirect:_e},gr={useRefreshTokens:!1,defaultScopes:"openid profile email",transport:"redirect"},yr={execute:!0,additionalParams:void 0},ne=class{#e;configuration;storage;#r=!1;get authenticated(){return this.#r}set authenticated(t){t!==this.#r&&(this.#r=t,this.#n())}tokens;events={authenticated:new oe("authenticated"),revoke:new oe("revoke")};constructor(t){if(!t.client)throw new Error("You must provide a `client` for your application.");let r=t.defaultScopes===!1?"":t.defaultScopes??gr.defaultScopes;this.configuration={...gr,...t,scopes:[t.scopes?t.scopes:"",r].filter(o=>o.length).join(" ")},this.storage=t.storage||new se,this.configuration.events&&Object.entries(this.configuration.events).forEach(([o,a])=>{o in this.events&&this.events[o].addListener(a)}),this.tokens=new Te({manager:this}),this.#t()}get storageKeyPrefix(){return`${this.configuration.client}:`}get user(){let t=this.getGlobusAuthToken();return t&&t.id_token?tr(t.id_token):null}async refreshTokens(){R("debug","AuthorizationManager.refreshTokens");let t=await Promise.allSettled(this.tokens.getAll().map(r=>te(r)?this.refreshToken(r):Promise.resolve(null)));return this.#t(),t}async refreshToken(t){R("debug",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`);try{let r=await(await G.token.refresh({payload:{client_id:this.configuration.client,refresh_token:t.refresh_token,grant_type:"refresh_token"}})).json();if(ve(r))return this.addTokenResponse(r),r}catch{R("error",`AuthorizationManager.refreshToken | resource_server=${t.resource_server}`)}return null}hasGlobusAuthToken(){return this.getGlobusAuthToken()!==null}getGlobusAuthToken(){let t=this.storage.getItem(`${this.storageKeyPrefix}${Q.AUTH}`);return t?JSON.parse(t):null}#t(){R("debug","AuthorizationManager.#checkAuthorizationState"),this.hasGlobusAuthToken()&&(this.authenticated=!0)}async#n(){let t=this.authenticated,r=this.getGlobusAuthToken()??void 0;await this.events.authenticated.dispatch({isAuthenticated:t,token:r})}reset(){Object.keys(this.storage).forEach(t=>{t.startsWith(this.storageKeyPrefix)&&this.storage.removeItem(t)}),this.authenticated=!1}#s(t){return`${t}${this.configuration.useRefreshTokens?" offline_access":""}`}#o(t){let{scopes:r,...o}=t??{},a=To[this.configuration.transport||"redirect"],d=this.#s(r??(this.configuration.scopes||""));return this.storage instanceof se&&(d=[...new Set(d.split(" ").concat((this.configuration?.scopes||"").split(" ")))].join(" ")),new a({client:this.configuration.client,redirect:this.configuration.redirect,scopes:d,...o,params:{...o?.params}})}async login(t={additionalParams:{}}){R("debug","AuthorizationManager.login"),this.reset(),await this.#o({params:t?.additionalParams}).send()}async prompt(t){R("debug","AuthorizationManager.prompt"),await this.#o(t).send()}async handleCodeRedirect(t={shouldReplace:!0,additionalParams:{}}){R("debug","AuthorizationManager.handleCodeRedirect");let r=await this.#o({params:t?.additionalParams}).getToken({shouldReplace:t?.shouldReplace,includeConsentedScopes:t?.includeConsentedScopes});return ve(r)&&(R("debug",`AuthorizationManager.handleCodeRedirect | response=${JSON.stringify(r)}`),this.addTokenResponse(r)),r}async handleErrorResponse(t,r){let o=typeof r=="boolean"?{...yr,execute:r}:{...yr,...r};R("debug",`AuthorizationManager.handleErrorResponse | response=${JSON.stringify(t)} execute=${o.execute}`);let a=async()=>{};return Z(t)&&(R("debug","AuthorizationManager.handleErrorResponse | error=AuthorizationRequirementsError"),a=async()=>{await this.handleAuthorizationRequirementsError(t,{additionalParams:o.additionalParams})}),Ie(t)&&(R("debug","AuthorizationManager.handleErrorResponse | error=ConsentRequiredError"),a=async()=>{await this.handleConsentRequiredError(t,{additionalParams:o.additionalParams})}),"code"in t&&t.code==="AuthenticationFailed"&&(R("debug","AuthorizationManager.handleErrorResponse | error=AuthenticationFailed"),a=async()=>{await this.revoke()}),o.execute===!0?await a():a}async handleAuthorizationRequirementsError(t,r){this.#e=this.#o({params:{prompt:"login",...Fe(t),...r?.additionalParams}}),await this.#e.send()}async handleConsentRequiredError(t,r){this.#e=this.#o({scopes:this.#s(t.required_scopes.join(" ")),params:{...r?.additionalParams}}),await this.#e.send()}addTokenResponse=t=>{this.tokens.add(t),this.#t()};async revoke(){R("debug","AuthorizationManager.revoke");let t=Promise.all(this.tokens.getAll().map(this.#i.bind(this)));this.reset(),await t,await this.events.revoke.dispatch()}#i(t){return R("debug",`AuthorizationManager.revokeToken | resource_server=${t.resource_server}`),G.token.revoke({payload:{client_id:this.configuration.client,token:t.access_token}})}};function Ro(e){return new ne(e)}var mt={};u(mt,{CONFIG:()=>Rs,access:()=>rt,collectionBookmarks:()=>ot,endpoint:()=>et,endpointManager:()=>at,endpointSearch:()=>Sr,fileOperations:()=>Xe,task:()=>tt,taskSubmission:()=>Ze,utils:()=>lt});var Sr=function(e,t){let r={...e,query:e?.query};return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_search"},r,t)};var Xe={};u(Xe,{ls:()=>Eo,mkdir:()=>Oo,rename:()=>bo,stat:()=>Po,symlink:()=>xo});function H(e){return e==="GET"?{}:{"Content-Type":"application/json"}}var Eo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/ls`},t,r)},Oo=function(e,t,r){let o={payload:{DATA_TYPE:"mkdir",...t?.payload},headers:{...H("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/mkdir`,method:"POST"},o,r)},bo=function(e,t,r){let o={payload:{DATA_TYPE:"rename",...t?.payload},headers:{...H("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/rename`,method:"POST"},o,r)},xo=function(e,t,r){let o={payload:{DATA_TYPE:"symlink",...t?.payload},headers:{...H("POST"),...t?.headers}};return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/symlink`,method:"POST"},o,r)},Po=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/operation/endpoint/${e}/stat`},t,r)};var Ze={};u(Ze,{submissionId:()=>Co,submitDelete:()=>Do,submitTransfer:()=>Ao});var Do=function(e,t){let r={payload:{DATA_TYPE:"delete",...e?.payload},headers:{...H("POST"),...e?.headers}};return s({service:p,scope:c.ALL,path:"/v0.10/delete",method:"POST"},r,t)},Ao=function(e,t){let r={payload:{DATA_TYPE:"transfer",...e?.payload},headers:{...H("POST"),...e?.headers}};return s({service:p,scope:c.ALL,path:"/v0.10/transfer",method:"POST"},r,t)},Co=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/submission_id"},e,t)};var et={};u(et,{create:()=>wo,get:()=>Mo,remove:()=>ko,update:()=>Lo});var Mo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`},t,r)},wo=function(e,t){return e?.payload&&Object.assign(e.payload,{DATA_TYPE:"shared_endpoint"}),s({service:p,scope:c.ALL,path:"/v0.10/shared_endpoint",method:"POST"},e,t)},Lo=function(e,t,r){return t?.payload&&Object.assign(t.payload,{DATA_TYPE:"endpoint"}),s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"PUT"},t,r)},ko=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}`,method:"DELETE"},t,r)};var tt={};u(tt,{cancel:()=>Go,get:()=>Io,getAll:()=>No,getEventList:()=>jo,getPauseInfo:()=>Ho,getSkippedErrors:()=>Jo,getSuccessfulTransfers:()=>Uo,remove:()=>qo,update:()=>Fo});var No=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},Io=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}`},t,r)},Fo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}`,method:"PUT"},t,r)},Go=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/cancel`,method:"POST"},t,r)},qo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/remove`,method:"POST"},t,r)},jo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/event_list`},t,r)},Uo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/successful_transfers`},t,r)},Jo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/skipped_errors`},t,r)},Ho=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/task/${e}/pause_info`},t,r)};var rt={};u(rt,{create:()=>Bo,get:()=>zo,getAll:()=>$o,remove:()=>Ko,update:()=>Vo});var $o=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access_list`},t,r)},Bo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access`,method:"POST"},t,r)},zo=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`},r,o)},Vo=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"PUT"},r,o)},Ko=function({endpoint_xid:e,id:t},r,o){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint/${e}/access/${t}`,method:"DELETE"},r,o)};var ot={};u(ot,{create:()=>Yo,get:()=>Qo,getAll:()=>Wo,remove:()=>Zo,update:()=>Xo});var Wo=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/bookmark_list"},e,t)},Yo=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/bookmark",method:"POST"},e,t)},Qo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`},t,r)},Xo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"PUT"},t,r)},Zo=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/bookmark/${e}`,method:"DELETE"},t,r)};var at={};u(at,{endpoint:()=>st,pauseRule:()=>nt,task:()=>it});var st={};u(st,{get:()=>es,getAccessList:()=>rs,getHostedEndpoints:()=>ts,getMonitoredEndpoints:()=>os});var es=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}`},t,r)},ts=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/hosted_endpoint_list`},t,r)},rs=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/endpoint/${e}/access_list`},t,r)},os=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/monitored_endpoints"},e,t)};var nt={};u(nt,{create:()=>ns,get:()=>is,getAll:()=>ss,remove:()=>ps,update:()=>as});var ss=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule_list"},e,t)},ns=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/pause_rule",method:"POST"},e,t)},is=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`},t,r)},as=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"PUT"},t,r)},ps=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/pause_rule/${e}`,method:"DELETE"},t,r)};var it={};u(it,{cancel:()=>ds,get:()=>us,getAdminCancel:()=>ls,getAll:()=>cs,getEventList:()=>ms,getPauseInfo:()=>Ss,getSkippedErrors:()=>fs,getSuccessfulTransfers:()=>hs,pause:()=>gs,resume:()=>ys});var cs=function(e={},t){return s({service:p,scope:c.ALL,path:"/v0.10/task_list"},e,t)},us=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}`},t,r)},ds=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_cancel",method:"POST"},e,t)},ls=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/admin_cancel/${e}`,method:"POST"},t,r)},ms=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/event_list`},t,r)},hs=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/successful_transfers`},t,r)},fs=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/skipped_errors`},t,r)},gs=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_pause",method:"POST"},e,t)},ys=function(e,t){return s({service:p,scope:c.ALL,path:"/v0.10/endpoint_manager/admin_resume",method:"POST"},e,t)},Ss=function(e,t,r){return s({service:p,scope:c.ALL,path:`/v0.10/endpoint_manager/task/${e}/pause_info`},t,r)};var lt={};u(lt,{GLOBUS_DNS_DOMAINS:()=>Tr,getDomainFromEndpoint:()=>Ts,isDirectory:()=>vs,isFileDocument:()=>_r,isGlobusHostname:()=>Rr,readableBytes:()=>_s});function _r(e){return typeof e=="object"&&e!==null&&"DATA_TYPE"in e&&e.DATA_TYPE==="file"}function vs(e){return _r(e)&&e.type==="dir"}var pt=1e3,ct=pt*1e3,ut=ct*1e3,dt=ut*1e3,vr=dt*1e3;function _s(e,t=2){let r="B",o=1;if(e<pt)return`${e} ${r}`;e<ct?(r="KB",o=pt):e<ut?(r="MB",o=ct):e<dt?(r="GB",o=ut):e<vr?(r="TB",o=dt):(r="PB",o=vr);let a=e/o,[d,_]=`${a}`.split("."),S=`${d}`;if(_&&_.length){let x=_.slice(0,t);x.length&&(S=`${d}.${x}`)}return`${S} ${r}`}var Tr=["dnsteam.globuscs.info","data.globus.org","dn.glob.us"];function Rr(e){return!!Tr.find(t=>e.endsWith(t))}function Ts(e){let{tlsftp_server:t}=e;if(!t||typeof t!="string")return null;let{hostname:r}=new URL(t.replace("tlsftp","https"));return!Rr(r)&&/(?:[gm]-\w{6}.)?(\w+(\.\w+)+)$/.exec(r)?.[1]||r||null}var Rs=ue;var vt={};u(vt,{CONFIG:()=>Is,entry:()=>gt,index:()=>St,query:()=>ht,subject:()=>ft});var ht={};u(ht,{get:()=>Es,post:()=>Os});var Es=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/search`},t,r)},Os=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/search`,method:"POST"},t,r)};var ft={};u(ft,{get:()=>bs});var bs=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/subject`},t,r)};var gt={};u(gt,{get:()=>xs});var xs=function(e,t,r){return s({service:g,scope:O.SEARCH,path:`/v1/index/${e}/entry`},t,r)};var St={};u(St,{create:()=>ws,get:()=>Cs,getAll:()=>Ms,ingest:()=>Ns,remove:()=>Ls,reopen:()=>ks,roles:()=>yt});var yt={};u(yt,{create:()=>Ds,getAll:()=>Ps,remove:()=>As});var Ps=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/role_list`},t,r)},Ds=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/role`,method:"POST"},t,r)},As=function({index_id:e,role_id:t},r,o){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/role/${t}`,method:"DELETE"},r,o)};var Cs=function(e,t,r){return s({service:g,path:`/v1/index/${e}`},t,r)},Ms=function(e,t){return s({service:g,scope:O.ALL,path:"/v1/index_list"},e,t)},ws=function(e,t){return s({service:g,scope:O.ALL,path:"/v1/index",method:"POST"},e,t)},Ls=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}`,method:"DELETE"},t,r)},ks=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/reopen`,method:"POST"},t,r)},Ns=function(e,t,r){return s({service:g,scope:O.ALL,path:`/v1/index/${e}/ingest`,method:"POST"},t,r)};var Is=he;var Et={};u(Et,{CONFIG:()=>Us,groups:()=>_t,membership:()=>Rt,policies:()=>Tt});var _t={};u(_t,{get:()=>Gs,getMyGroups:()=>Fs});var Fs=function(e,t){return s({scope:N.ALL,path:"/v2/groups/my_groups",service:P},e,t)},Gs=function(e,t,r){return s({service:P,scope:N.ALL,path:`/v2/groups/${e}`},t,r)};var Tt={};u(Tt,{get:()=>qs});var qs=function(e,t,r){return s({scope:N.ALL,path:`/v2/groups/${e}/policies`,service:P},t,r)};var Rt={};u(Rt,{act:()=>js});var js=function(e,t,r){if(!t?.payload)throw new Error("payload is required.");return s({service:P,scope:N.ALL,path:`/v2/groups/${e}`,method:"POST"},t,r)};var Us=me;var xt={};u(xt,{CONFIG:()=>Qs,flows:()=>Ot,runs:()=>bt});var Ot={};u(Ot,{create:()=>Er,deploy:()=>Vs,get:()=>Hs,getAll:()=>Js,remove:()=>$s,run:()=>Bs,validate:()=>zs});var Js=function(e,t){return s({service:E,scope:D.VIEW_FLOWS,path:"/flows"},e,t)},Hs=function(e,t,r){return s({service:E,scope:D.VIEW_FLOWS,path:`/flows/${e}`},t,r)},$s=function(e,t,r){return s({scope:D.MANAGE_FLOWS,service:E,path:`/flows/${e}`,method:"DELETE"},t,r)},Bs=function(e,t,r){return s({service:E,scope:D.VIEW_FLOWS,path:`/flows/${e}/run`,method:"POST"},t,r)},zs=function(e,t){return s({service:E,scope:D.MANAGE_FLOWS,path:"/flows/validate",method:"POST"},e,t)},Er=function(e,t){return s({service:E,scope:D.MANAGE_FLOWS,path:"/flows",method:"POST"},e,t)},Vs=Er;var bt={};u(bt,{cancel:()=>Ws,getAll:()=>Ks,getLog:()=>Ys});var Ks=function(e={},t){return s({service:E,scope:D.RUN_MANAGE,path:"/runs"},e,t)},Ws=function(e,t,r){return s({service:E,scope:D.RUN_MANAGE,path:`/runs/${e}/cancel`,method:"POST"},t,r)},Ys=function(e,t,r){return s({service:E,scope:D.RUN_MANAGE,path:`/runs/${e}/log`},t,r)};var Qs=de;var Ft={};u(Ft,{collections:()=>Pt,endpoint:()=>Dt,getScopes:()=>jn,https:()=>At,nodes:()=>Ct,roles:()=>Mt,storageGateways:()=>wt,userCredentials:()=>Lt,utils:()=>It,versioning:()=>Nt});var Pt={};u(Pt,{create:()=>tn,get:()=>Zs,getAll:()=>Xs,patch:()=>on,remove:()=>en,resetOwnerString:()=>nn,update:()=>rn,updateOwnerString:()=>sn});var Xs=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/collections"},t,r)},Zs=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`},r,o)},en=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"DELETE"},r,o)},tn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/collections",method:"POST"},t,r)},rn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PUT"},r,o)},on=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}`,method:"PATCH"},r,o)},sn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"PUT"},r,o)},nn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/collections/${t}/owner_string`,method:"DELETE"},r,o)};var Dt={};u(Dt,{get:()=>an,patch:()=>cn,resetOwnerString:()=>mn,update:()=>pn,updateOwner:()=>dn,updateOwnerString:()=>ln,updateSubscriptionId:()=>un});var an=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint"},t,r)},pn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PUT"},t,r)},cn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint",method:"PATCH"},t,r)},un=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/subscription_id",method:"PUT"},t,r)},dn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner",method:"PUT"},t,r)},ln=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"PUT"},t,r)},mn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/endpoint/owner_string",method:"DELETE"},t,r)};var At={};u(At,{get:()=>hn,remove:()=>fn,update:()=>gn});var hn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t},r,o)},fn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t,method:"DELETE"},r,o)},gn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:t,method:"PUT"},r,o)};var Ct={};u(Ct,{create:()=>_n,get:()=>Sn,getAll:()=>yn,patch:()=>Rn,remove:()=>vn,update:()=>Tn});var yn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/nodes"},t,r)},Sn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`},r,o)},vn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"DELETE"},r,o)},_n=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/nodes",method:"POST"},t,r)},Tn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PUT"},r,o)},Rn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/nodes/${t}`,method:"PATCH"},r,o)};var Mt={};u(Mt,{create:()=>xn,get:()=>On,getAll:()=>En,remove:()=>bn});var En=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/roles"},t,r)},On=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`},r,o)},bn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/roles/${t}`,method:"DELETE"},r,o)},xn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/roles",method:"POST"},t,r)};var wt={};u(wt,{create:()=>Cn,get:()=>Dn,getAll:()=>Pn,patch:()=>wn,remove:()=>An,update:()=>Mn});var Pn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways"},t,r)},Dn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`},r,o)},An=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"DELETE"},r,o)},Cn=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/storage_gateways",method:"POST"},t,r)},Mn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PUT"},r,o)},wn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/storage_gateways/${t}`,method:"PATCH"},r,o)};var Lt={};u(Lt,{create:()=>In,get:()=>kn,getAll:()=>Ln,patch:()=>Gn,remove:()=>Nn,update:()=>Fn});var Ln=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials"},t,r)},kn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`},r,o)},Nn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"DELETE"},r,o)},In=function(e,t,r){return s({service:e,resource_server:e.endpoint_id,path:"/api/user_credentials",method:"POST"},t,r)},Fn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PUT"},r,o)},Gn=function(e,t,r,o){return s({service:e,resource_server:e.endpoint_id,path:`/api/user_credentials/${t}`,method:"PATCH"},r,o)};var Nt={};u(Nt,{info:()=>kt});var kt=function(e,t,r){return s({service:e,path:"/api/info"},t,r)};var It={};u(It,{getEndpointIdFromURL:()=>qn,getGCSDomainFromURL:()=>Or});var ie="data.globus.org";function Or(e){let{host:t}=typeof e=="string"?new URL(e):e;if(!t.endsWith(ie))return t;let[r]=t.split(`.${ie}`),o=r.split(".");return(o.length===2?[...o,ie]:[o[1],o[2],ie]).join(".")}async function qn(e){let t=typeof e=="string"?new URL(e):e;if(!t.host.endsWith(ie))return null;let a=(await(await kt({host:`https://${Or(t)}`})).json()).data?.filter(d=>d.DATA_TYPE.startsWith("info#"))[0];return a&&"endpoint_id"in a?a.endpoint_id:null}var br={HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections",NON_HIGH_ASSURANCE:"urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections[*https://auth.globus.org/scopes/<MAPPED_COLLECTION_ID>/data_access]"};function jn(e,t){let{endpoint_id:r}=e;if(!r)throw new Error("An 'endpoint_id' is required to determine the required scopes");return t?br[t].replace("<ENDPOINT_ID>",r):Object.entries(br).reduce((o,[a,d])=>({...o,[a]:d.replace("<ENDPOINT_ID>",r)}),{})}var Gt={};u(Gt,{CONFIG:()=>Un,create:()=>xr});var xr=function(e,t){return s({service:L,scope:"https://auth.globus.org/scopes/524230d7-ea86-4a52-8312-86065a9e0417/timer",path:"/v2/timer",method:"POST"},e,t)};var Un=le;var jt={};u(jt,{CONFIG:()=>Bn,endpoints:()=>qt});var qt={};u(qt,{get:()=>Hn,getAll:()=>Jn,getStatus:()=>$n});var Jn=function(e,t){return s({service:C,scope:Y.ALL,path:"/v2/endpoints",method:"GET"},e,t)},Hn=function(e,t,r){return s({service:C,scope:Y.ALL,path:`/v2/endpoints/${e}`,method:"GET"},t,r)},$n=function(e,t,r){return s({service:C,scope:Y.ALL,path:`/v2/endpoints/${e}/status`},t,r)};var Bn=fe;var Ut={};u(Ut,{HOSTS:()=>Pr,host:()=>Dr,url:()=>Ar,urlFor:()=>Vn});var Pr={integration:"app.integration.globuscs.info",sandbox:"app.sandbox.globuscs.info",test:"app.test.globuscs.info",staging:"app.staging.globuscs.info",preview:"app.preview.globus.org",production:"app.globus.org"};function Dr(e=z()){return Pr[e]}function Ar(e,t){return new URL(e||"",`https://${Dr(t?.environment)}`)}var zn={TASK:"/activity/%s/overview",COLLECTION:"/file-manager/collections/%s/overview",ENDPOINT:"/file-manager/collections/%s/overview"};function Vn(e,t,r){let o=zn[e].replace(/%s/g,t?.join("/")||"");return Ar(o,r)}return Hr(Kn);})();
3
3
  //# sourceMappingURL=globus.production.js.map