Various improvements and fixes to setup-bun (#40)

* Do not save cache on hit
* Support Windows (canary only)
* Support `registry-url` and `scope`
This commit is contained in:
Ashcon Partovi authored and GitHub committed 2023-11-17 15:58:17 -08:00
1 parent 830e319e28
commit a93230df19
14 files changed
+994 -78881

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
name: autofix.ci # Must be named this for autofix.ci to work
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: npm install
- name: Format
run: |
npm run format
npm run build
- name: Commit
uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc
@@ -1,37 +1,48 @@
name: Setup Bun
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
setup-bun:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
include:
- os: windows-latest
bun-version: canary
os:
- ubuntu-latest
- macos-latest
bun-version:
- latest
- canary
- "0.5.6"
- "9be68ac2350b965037f408ce4d47c3b9d9a76b63"
- "0.8.1" # last version before 1.0
- "0.x"
- "1.0.0"
- "1.x"
- "1"
- "> 1.0.0"
- "< 2"
# Disable <sha> support for now. This is because Github Artifacts
# expire after 90 days, and we don't have another source of truth yet.
# - "822a00c4d508b54f650933a73ca5f4a3af9a7983" # 1.0.0 commit
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: setup-bun
name: Setup Bun
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: ./
with:
bun-version: ${{ matrix.bun-version }}
- id: verify-bun
name: Verify Bun
- name: Run Bun
run: |
bun --version
setup-bun-from-package-json-version:
@@ -49,6 +60,6 @@ jobs:
echo "$(jq '. += {"packageManager": "bun@1.0.0"}' package.json)" > package.json
- name: Setup Bun
uses: ./
- name: Verify Bun
- name: Run Bun
run: |
bun --version
+13 -13
View File
@@ -10,36 +10,36 @@ Download, install, and setup [Bun](https://bun.sh) in GitHub Actions.
bun-version: latest
```
### Setup custom registry-url and scope (for private packages)
### Using a custom NPM registry
```yaml
- uses: oven-sh/setup-bun@v1
with:
registry-url: "https://npm.pkg.github.com/"
scope: "@foo-bar"
scope: "@foo"
```
After setting up the registry-url and scope, when installing step comes, inject the env to authenticate and install all packages from the private registry
If you need to authenticate with a private registry, you can set the `BUN_AUTH_TOKEN` environment variable.
```yaml
- name: Installing dependencies
- name: Install Dependencies
env:
BUN_AUTH_TOKEN: ${{ secrets.MY_SUPER_SECRET_PAT }}
run: bun i
BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bun install
```
## Inputs
| Name | Description | Default | Examples |
| -------------- | -------------------------------------------------- | ----------- | ------------------------------- |
| `bun-version` | The version of Bun to download and install. | `latest` | `canary`, `1.0.0`, `<sha>` |
| `bun-version` | The version of Bun to download and install. | `latest` | `canary`, `1.0.0`, `1.0.x` |
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
| `scope` | Scope for private pacakages | `undefined` | `"@foo-bar"`, `"@orgname"` |
| `scope` | Scope for private pacakages. | `undefined` | `"@foo"`, `"@orgname"` |
## Outputs
| Name | Description | Example |
| -------------- | ------------------------------------------ | ------------------------------------------------ |
| `cache-hit` | If the Bun executable was read from cache. | `true` |
| `bun-version` | The output from `bun --version`. | `1.0.0` |
| `bun-revision` | The output from `bun --revision`. | `1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983` |
| Name | Description | Example |
| -------------- | ------------------------------------------ | ---------------- |
| `cache-hit` | If the Bun executable was read from cache. | `true` |
| `bun-version` | The output from `bun --version`. | `1.0.0` |
| `bun-revision` | The output from `bun --revision`. | `1.0.0+822a00c4` |
+6 -4
View File
@@ -6,20 +6,22 @@ branding:
color: white
inputs:
bun-version:
description: 'The version of Bun to install. (e.g. "latest", "canary", "0.5.6", <sha>)'
description: 'The version of Bun to install. (e.g. "latest", "canary", "1.0.0", "1.0.x", <sha>)'
default: latest
required: false
registry-url:
required: false
description: "Optional registry to set up for auth. Will set the registry in a project level build.toml file, and set up auth to read in from env.BUN_AUTH_TOKEN."
description: "The URL of the package registry to use for installing Bun. Set the $BUN_AUTH_TOKEN environment variable to authenticate with the registry."
scope:
required: false
description: "Optional scope for authenticating against scoped registries."
description: "The scope for authenticating with the package registry."
outputs:
bun-version:
description: The version of Bun that was installed.
bun-revision:
description: The revision of Bun that was installed.
cache-hit:
description: If the version of Bun was cached.
runs:
using: node20
main: dist/action.js
main: dist/index.js
Generated Vendored
-78594
View File
File diff suppressed because it is too large. Load diff
Generated Vendored
+69
View File
@@ -0,0 +1,69 @@
var Zv=Object.create;var po=Object.defineProperty;var Jv=Object.getOwnPropertyDescriptor;var ex=Object.getOwnPropertyNames;var tx=Object.getPrototypeOf,ax=Object.prototype.hasOwnProperty;var ge=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ml=(t,e)=>{for(var a in e)po(t,a,{get:e[a],enumerable:!0})},q0=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ex(e))!ax.call(t,r)&&r!==a&&po(t,r,{get:()=>e[r],enumerable:!(i=Jv(e,r))||i.enumerable});return t};var Kt=(t,e,a)=>(a=t!=null?Zv(tx(t)):{},q0(e||!t||!t.__esModule?po(a,"default",{value:t,enumerable:!0}):a,t)),An=t=>q0(po({},"__esModule",{value:!0}),t);var lo=T(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.toCommandProperties=Cr.toCommandValue=void 0;function ix(t){return t==null?"":typeof t=="string"||t instanceof String?t:JSON.stringify(t)}Cr.toCommandValue=ix;function rx(t){return Object.keys(t).length?{title:t.title,file:t.file,line:t.startLine,endLine:t.endLine,col:t.startColumn,endColumn:t.endColumn}:{}}Cr.toCommandProperties=rx});var H0=T(Qt=>{"use strict";var nx=Qt&&Qt.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),sx=Qt&&Qt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ox=Qt&&Qt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&nx(e,t,a);return sx(e,t),e};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.issue=Qt.issueCommand=void 0;var px=ox(require("os")),j0=lo();function k0(t,e,a){let i=new ul(t,e,a);process.stdout.write(i.toString()+px.EOL)}Qt.issueCommand=k0;function dx(t,e=""){k0(t,{},e)}Qt.issue=dx;var L0="::",ul=class{constructor(e,a,i){e||(e="missing.command"),this.command=e,this.properties=a,this.message=i}toString(){let e=L0+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let a=!0;for(let i in this.properties)if(this.properties.hasOwnProperty(i)){let r=this.properties[i];r&&(a?a=!1:e+=",",e+=`${i}=${cx(r)}`)}}return e+=`${L0}${lx(this.message)}`,e}};function lx(t){return j0.toCommandValue(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function cx(t){return j0.toCommandValue(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});function zn(){return co>mo.length-16&&(U0.default.randomFillSync(mo),co=0),mo.slice(co,co+=16)}var U0,mo,co,fl=ge(()=>{U0=Kt(require("crypto")),mo=new Uint8Array(256),co=mo.length});var F0,V0=ge(()=>{F0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function mx(t){return typeof t=="string"&&F0.test(t)}var ci,Mn=ge(()=>{V0();ci=mx});function ux(t,e=0){let a=(ht[t[e+0]]+ht[t[e+1]]+ht[t[e+2]]+ht[t[e+3]]+"-"+ht[t[e+4]]+ht[t[e+5]]+"-"+ht[t[e+6]]+ht[t[e+7]]+"-"+ht[t[e+8]]+ht[t[e+9]]+"-"+ht[t[e+10]]+ht[t[e+11]]+ht[t[e+12]]+ht[t[e+13]]+ht[t[e+14]]+ht[t[e+15]]).toLowerCase();if(!ci(a))throw TypeError("Stringified UUID is invalid");return a}var ht,mi,qn=ge(()=>{Mn();ht=[];for(let t=0;t<256;++t)ht.push((t+256).toString(16).substr(1));mi=ux});function fx(t,e,a){let i=e&&a||0,r=e||new Array(16);t=t||{};let n=t.node||$0,s=t.clockseq!==void 0?t.clockseq:hl;if(n==null||s==null){let m=t.random||(t.rng||zn)();n==null&&(n=$0=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]),s==null&&(s=hl=(m[6]<<8|m[7])&16383)}let o=t.msecs!==void 0?t.msecs:Date.now(),p=t.nsecs!==void 0?t.nsecs:yl+1,d=o-gl+(p-yl)/1e4;if(d<0&&t.clockseq===void 0&&(s=s+1&16383),(d<0||o>gl)&&t.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");gl=o,yl=p,hl=s,o+=122192928e5;let l=((o&268435455)*1e4+p)%4294967296;r[i++]=l>>>24&255,r[i++]=l>>>16&255,r[i++]=l>>>8&255,r[i++]=l&255;let c=o/4294967296*1e4&268435455;r[i++]=c>>>8&255,r[i++]=c&255,r[i++]=c>>>24&15|16,r[i++]=c>>>16&255,r[i++]=s>>>8|128,r[i++]=s&255;for(let m=0;m<6;++m)r[i+m]=n[m];return e||mi(r)}var $0,hl,gl,yl,G0,X0=ge(()=>{fl();qn();gl=0,yl=0;G0=fx});function hx(t){if(!ci(t))throw TypeError("Invalid UUID");let e,a=new Uint8Array(16);return a[0]=(e=parseInt(t.slice(0,8),16))>>>24,a[1]=e>>>16&255,a[2]=e>>>8&255,a[3]=e&255,a[4]=(e=parseInt(t.slice(9,13),16))>>>8,a[5]=e&255,a[6]=(e=parseInt(t.slice(14,18),16))>>>8,a[7]=e&255,a[8]=(e=parseInt(t.slice(19,23),16))>>>8,a[9]=e&255,a[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,a[11]=e/4294967296&255,a[12]=e>>>24&255,a[13]=e>>>16&255,a[14]=e>>>8&255,a[15]=e&255,a}var uo,vl=ge(()=>{Mn();uo=hx});function gx(t){t=unescape(encodeURIComponent(t));let e=[];for(let a=0;a<t.length;++a)e.push(t.charCodeAt(a));return e}function fo(t,e,a){function i(r,n,s,o){if(typeof r=="string"&&(r=gx(r)),typeof n=="string"&&(n=uo(n)),n.length!==16)throw TypeError("Namespace must be aLine truncated
`,c.message,c.stack);var m=new Error("tunneling socket could not be established, cause="+c.message);m.code="ECONNRESET",e.request.emit("error",m),i.removeSocket(r)}};Fa.prototype.removeSocket=function(e){var a=this.sockets.indexOf(e);if(a!==-1){this.sockets.splice(a,1);var i=this.requests.shift();i&&this.createSocket(i,function(r){i.request.onSocket(r)})}};function x2(t,e){var a=this;Fa.prototype.createSocket.call(a,t,function(i){var r=t.request.getHeader("host"),n=Nl({},a.options,{socket:i,servername:r?r.replace(/:.*$/,""):t.host}),s=Ix.connect(0,n);a.sockets[a.sockets.indexOf(i)]=s,e(s)})}function b2(t,e,a){return typeof t=="string"?{host:t,port:e,localAddress:a}:t}function Nl(t){for(var e=1,a=arguments.length;e<a;++e){var i=arguments[e];if(typeof i=="object")for(var r=Object.keys(i),n=0,s=r.length;n<s;++n){var o=r[n];i[o]!==void 0&&(t[o]=i[o])}}return t}var ui;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?ui=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:ui=function(){};Pr.debug=ui});var _l=T((NM,N2)=>{N2.exports=w2()});var Or=T(Ce=>{"use strict";var jx=Ce&&Ce.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),kx=Ce&&Ce.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bo=Ce&&Ce.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&jx(e,t,a);return kx(e,t),e},Xe=Ce&&Ce.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.HttpClient=Ce.isHttps=Ce.HttpClientResponse=Ce.HttpClientError=Ce.getProxyUrl=Ce.MediaTypes=Ce.Headers=Ce.HttpCodes=void 0;var ho=bo(require("http")),Sl=bo(require("https")),_2=bo(y2()),go=bo(_l()),ma;(function(t){t[t.OK=200]="OK",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.ResourceMoved=302]="ResourceMoved",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.UseProxy=305]="UseProxy",t[t.SwitchProxy=306]="SwitchProxy",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.TooManyRequests=429]="TooManyRequests",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout"})(ma=Ce.HttpCodes||(Ce.HttpCodes={}));var Et;(function(t){t.Accept="accept",t.ContentType="content-type"})(Et=Ce.Headers||(Ce.Headers={}));var fi;(function(t){t.ApplicationJson="application/json"})(fi=Ce.MediaTypes||(Ce.MediaTypes={}));function Hx(t){let e=_2.getProxyUrl(new URL(t));return e?e.href:""}Ce.getProxyUrl=Hx;var Ux=[ma.MovedPermanently,ma.ResourceMoved,ma.SeeOther,ma.TemporaryRedirect,ma.PermanentRedirect],Fx=[ma.BadGateway,ma.ServiceUnavailable,ma.GatewayTimeout],Vx=["OPTIONS","GET","DELETE","HEAD"],$x=10,Gx=5,vo=class t extends Error{constructor(e,a){super(e),this.name="HttpClientError",this.statusCode=a,Object.setPrototypeOf(this,t.prototype)}};Ce.HttpClientError=vo;var xo=class{constructor(e){this.message=e}readBody(){return Xe(this,void 0,void 0,function*(){return new Promise(e=>Xe(this,void 0,void 0,function*(){let a=Buffer.alloc(0);this.message.on("data",i=>{a=Buffer.concat([a,i])}),this.message.on("end",()=>{e(a.toString())})}))})}readBodyBuffer(){return Xe(this,void 0,void 0,function*(){return new Promise(e=>Xe(this,void 0,void 0,function*(){let a=[];this.message.on("data",i=>{a.push(i)}),this.message.on("end",()=>{e(Buffer.concat(a))})}))})}};Ce.HttpClientResponse=xo;function Xx(t){return new URL(t).protocol==="https:"}Ce.isHttps=Xx;var El=class{constructor(e,a,i){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=a||[],this.requestOptions=i,i&&(i.ignoreSslError!=null&&(this._ignoreSslError=i.ignoreSslError),this._socketTimeout=i.socketTimeout,i.allow Line truncated
Error Code : ${s.statusCode}
Error Message: ${s.message}`)})).result)===null||a===void 0?void 0:a.value;if(!n)throw new Error("Response json body do not have ID Token field");return n})}static getIDToken(e){return S2(this,void 0,void 0,function*(){try{let a=t.getIDTokenUrl();if(e){let r=encodeURIComponent(e);a=`${a}&audience=${r}`}E2.debug(`ID token url is ${a}`);let i=yield t.getCall(a);return E2.setSecret(i),i}catch(a){throw new Error(`Error message: ${a.message}`)}})}};Rr.OidcClient=Dl});var zl=T(Rt=>{"use strict";var Il=Rt&&Rt.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.summary=Rt.markdownSummary=Rt.SUMMARY_DOCS_URL=Rt.SUMMARY_ENV_VAR=void 0;var Qx=require("os"),Bl=require("fs"),{access:Yx,appendFile:Zx,writeFile:Jx}=Bl.promises;Rt.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";Rt.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var Al=class{constructor(){this._buffer=""}filePath(){return Il(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[Rt.SUMMARY_ENV_VAR];if(!e)throw new Error(`Unable to find environment variable for $${Rt.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield Yx(e,Bl.constants.R_OK|Bl.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,a,i={}){let r=Object.entries(i).map(([n,s])=>` ${n}="${s}"`).join("");return a?`<${e}${r}>${a}</${e}>`:`<${e}${r}>`}write(e){return Il(this,void 0,void 0,function*(){let a=!!e?.overwrite,i=yield this.filePath();return yield(a?Jx:Zx)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Il(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(e,a=!1){return this._buffer+=e,a?this.addEOL():this}addEOL(){return this.addRaw(Qx.EOL)}addCodeBlock(e,a){let i=Object.assign({},a&&{lang:a}),r=this.wrap("pre",this.wrap("code",e),i);return this.addRaw(r).addEOL()}addList(e,a=!1){let i=a?"ol":"ul",r=e.map(s=>this.wrap("li",s)).join(""),n=this.wrap(i,r);return this.addRaw(n).addEOL()}addTable(e){let a=e.map(r=>{let n=r.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:o,data:p,colspan:d,rowspan:l}=s,c=o?"th":"td",m=Object.assign(Object.assign({},d&&{colspan:d}),l&&{rowspan:l});return this.wrap(c,p,m)}).join("");return this.wrap("tr",n)}).join(""),i=this.wrap("table",a);return this.addRaw(i).addEOL()}addDetails(e,a){let i=this.wrap("details",this.wrap("summary",e)+a);return this.addRaw(i).addEOL()}addImage(e,a,i){let{width:r,height:n}=i||{},s=Object.assign(Object.assign({},r&&{width:r}),n&&{height:n}),o=this.wrap("img",null,Object.assign({src:e,alt:a},s));return this.addRaw(o).addEOL()}addHeading(e,a){let i=`h${a}`,r=["h1","h2","h3","h4","h5","h6"].includes(i)?i:"h1",n=this.wrap(r,e);return this.addRaw(n).addEOL()}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,a){let i=Object.assign({},a&&{cite:a}),r=this.wrap("blockquote",e,i);return this.addRaw(r).addEOL()}addLink(e,a){let i=this.wrap("a",e,{href:a});return this.addRaw(i).addEOL()}},T2=new Al;Rt.markdownSummary=T2;Rt.summary=T2});var P2=T(Dt=>{"use strict";var eb=Dt&&Dt.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),tb=Dt&&Dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ab=Dt&&Dt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&eb(e,t,a);return tb(e,t),e};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.toPlatformPath=Dt.toWin32Path=Dt.toPosixPath=void 0;var ib=ab(require("path"));function rb(t){return t.replace(/[\\]/g,"/")}Dt.toPosixPath=rb;function nb(t){return t.replace(/[/]/g,"\\")}Dt.toWin32Path=nb;function sb(t){return t.replace(/[/\\]/g,ib.sep)}Dt.toPlatformPath=sb});var wt=T(Z=>{"use strict";var ob=Z&&Z.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),pb=Z&&Z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),O2=Z&&ZLine truncated
`).filter(i=>i!=="");return e&&e.trimWhitespace===!1?a:a.map(i=>i.trim())}Z.getMultilineInput=fb;function hb(t,e){let a=["true","True","TRUE"],i=["false","False","FALSE"],r=Ml(t,e);if(a.includes(r))return!0;if(i.includes(r))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${t}
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}Z.getBooleanInput=hb;function gb(t,e){if(process.env.GITHUB_OUTPUT||"")return Ki.issueFileCommand("OUTPUT",Ki.prepareKeyValueMessage(t,e));process.stdout.write(D2.EOL),Zt.issueCommand("set-output",{name:t},Dr.toCommandValue(e))}Z.setOutput=gb;function yb(t){Zt.issue("echo",t?"on":"off")}Z.setCommandEcho=yb;function vb(t){process.exitCode=I2.Failure,B2(t)}Z.setFailed=vb;function xb(){return process.env.RUNNER_DEBUG==="1"}Z.isDebug=xb;function bb(t){Zt.issueCommand("debug",{},t)}Z.debug=bb;function B2(t,e={}){Zt.issueCommand("error",Dr.toCommandProperties(e),t instanceof Error?t.toString():t)}Z.error=B2;function wb(t,e={}){Zt.issueCommand("warning",Dr.toCommandProperties(e),t instanceof Error?t.toString():t)}Z.warning=wb;function Nb(t,e={}){Zt.issueCommand("notice",Dr.toCommandProperties(e),t instanceof Error?t.toString():t)}Z.notice=Nb;function _b(t){process.stdout.write(t+D2.EOL)}Z.info=_b;function A2(t){Zt.issue("group",t)}Z.startGroup=A2;function z2(){Zt.issue("endgroup")}Z.endGroup=z2;function Sb(t,e){return R2(this,void 0,void 0,function*(){A2(t);let a;try{a=yield e()}finally{z2()}return a})}Z.group=Sb;function Eb(t,e){if(process.env.GITHUB_STATE||"")return Ki.issueFileCommand("STATE",Ki.prepareKeyValueMessage(t,e));Zt.issueCommand("save-state",{name:t},Dr.toCommandValue(e))}Z.saveState=Eb;function Cb(t){return process.env[`STATE_${t}`]||""}Z.getState=Cb;function Tb(t){return R2(this,void 0,void 0,function*(){return yield lb.OidcClient.getIDToken(t)})}Z.getIDToken=Tb;var Pb=zl();Object.defineProperty(Z,"summary",{enumerable:!0,get:function(){return Pb.summary}});var Ob=zl();Object.defineProperty(Z,"markdownSummary",{enumerable:!0,get:function(){return Ob.markdownSummary}});var ql=P2();Object.defineProperty(Z,"toPosixPath",{enumerable:!0,get:function(){return ql.toPosixPath}});Object.defineProperty(Z,"toWin32Path",{enumerable:!0,get:function(){return ql.toWin32Path}});Object.defineProperty(Z,"toPlatformPath",{enumerable:!0,get:function(){return ql.toPlatformPath}})});var jl=T(Q=>{"use strict";var Rb=Q&&Q.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),Db=Q&&Q.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),q2=Q&&Q.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&Rb(e,t,a);return Db(e,t),e},Ll=Q&&Q.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})},It;Object.defineProperty(Q,"__esModule",{value:!0});Q.getCmdPath=Q.tryGetExecutablePath=Q.isRooted=Q.isDirectory=Q.exists=Q.READONLY=Q.UV_FS_O_EXLOCK=Q.IS_WINDOWS=Q.unlink=Q.symlink=Q.stat=Q.rmdir=Q.rm=Q.rename=Q.readlink=Q.readdir=Q.open=Q.mkdir=Q.lstat=Q.copyFile=Q.chmod=void 0;var L2=q2(require("fs")),wo=q2(require("path"));It=L2.promises,Q.chmod=It.chmod,Q.copyFile=It.copyFile,Q.lstat=It.lstat,Q.mkdir=It.mkdir,Q.open=It.open,Q.readdir=It.readdir,Q.readlink=It.readlink,Q.rename=It.rename,Q.rm=It.rm,Q.rmdir=It.rmdir,Q.stat=It.stat,Q.symlink=It.symlink,Q.unlink=It.unlink;Q.IS_WINDOWS=process.platform==="win32";Q.UV_FS_O_EXLOCK=268435456;Q.READONLY=L2.constants.O_RDONLY;function Ib(t){return Ll(this,void 0,void 0,function*(){try{yield Q.stat(t)}catch(e){if(e.code==="ENOENT")return!1;throw e}return!0})}Q.exists=Ib;function Bb(t,e=!1){return Ll(this,void 0,void 0,function*(){return(e?yield Q.stat(t):yield Q.lstat(t)).isDirectory()})}Q.isDirectory=Bb;function Ab(t){if(t=Mb(t),!t)throw new Error('isRooted() parameter "p" cannot be empty');return Q.IS_WINDOWS?t.startsWith("\\")||/^[A-Z]:/i.test(t):t.startsWith("/")}Q.isRooted=Ab;function zb(t,e){return Ll(this,void 0,void 0,function*(){let a;try{a=yield Q.stat(t)}catch(r){r.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${t}': ${r}`)}if(a&&a.isFile()){if(Q.IS_WINDOWS){let r=wo.extname(t).toUpperCase();if(e.some(n=>n.toUpperCase()===r))return t}else if(M2(a))return t}let i=t;for(let r of e){t=i+r,a=void 0;try{a=yield Q.stat(t)}catch(n){n.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${t}': ${n}`)}if(a&&a.isFile()){if(Q.IS_WINDOWS){try{let n=wo.dirname(t),s=wo.basename(t).toUpperCase();for(let o of yield Q.readdir(n))if(s===o.toUpperCase()){t=wo.join(n,o);break}}catch(n){console.log(`Unexpected error attempting to determine the actual case of the file '${t}': ${n}`)}return t}else if(M2(a))return t}}return""})}Q.tryGetExecutablePath=zb;function Mb(t){return t=t||"",Q.IS_WINLine truncated
%s`,f,f,R,i);var N=R.type==="*"?Kl:R.type==="?"?Wl:"\\"+R.type;r=!0,i=i.slice(0,R.reStart)+N+"\\("+f}h(),n&&(i+="\\\\");var C=!1;switch(i.charAt(0)){case"[":case".":case"(":C=!0}for(var w=o.length-1;w>-1;w--){var D=o[w],_=i.slice(0,D.reStart),O=i.slice(D.reStart,D.reEnd-8),B=i.slice(D.reEnd-8,D.reEnd),j=i.slice(D.reEnd);B+=j;var ne=_.split("(").length-1,me=j;for(v=0;v<ne;v++)me=me.replace(/\)[+*?]?/,"");j=me;var K="";j===""&&e!==To&&(K="$");var Ge=_+O+j+K+B;i=Ge}if(i!==""&&r&&(i="(?=.)"+i),C&&(i=m+i),e===To)return[i,r];if(!r)return jw(t);var ce=a.nocase?"i":"";try{var ca=new RegExp("^"+i+"$",ce)}catch{return new RegExp("$.")}return ca._glob=t,ca._src=i,ca}kt.makeRe=function(t,e){return new gt(t,e||{}).makeRe()};gt.prototype.makeRe=Lw;function Lw(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,a=e.noglobstar?Kl:e.dot?Rw:Dw,i=e.nocase?"i":"",r=t.map(function(n){return n.map(function(s){return s===Ql?a:typeof s=="string"?kw(s):s._src}).join("\\/")}).join("|");r="^(?:"+r+")$",this.negate&&(r="^(?!"+r+").*$");try{this.regexp=new RegExp(r,i)}catch{this.regexp=!1}return this.regexp}kt.match=function(t,e,a){a=a||{};var i=new gt(e,a);return t=t.filter(function(r){return i.match(r)}),i.options.nonull&&!t.length&&t.push(e),t};gt.prototype.match=function(e,a){if(typeof a>"u"&&(a=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&a)return!0;var i=this.options;Un.sep!=="/"&&(e=e.split(Un.sep).join("/")),e=e.split(wf),this.debug(this.pattern,"split",e);var r=this.set;this.debug(this.pattern,"set",r);var n,s;for(s=e.length-1;s>=0&&(n=e[s],!n);s--);for(s=0;s<r.length;s++){var o=r[s],p=e;i.matchBase&&o.length===1&&(p=[n]);var d=this.matchOne(p,o,a);if(d)return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate};gt.prototype.matchOne=function(t,e,a){var i=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var r=0,n=0,s=t.length,o=e.length;r<s&&n<o;r++,n++){this.debug("matchOne loop");var p=e[n],d=t[r];if(this.debug(e,p,d),p===!1)return!1;if(p===Ql){this.debug("GLOBSTAR",[e,p,d]);var l=r,c=n+1;if(c===o){for(this.debug("** at the end");r<s;r++)if(t[r]==="."||t[r]===".."||!i.dot&&t[r].charAt(0)===".")return!1;return!0}for(;l<s;){var m=t[l];if(this.debug(`
globstar while`,t,l,e,c,m),this.matchOne(t.slice(l),e.slice(c),a))return this.debug("globstar found match!",l,s,m),!0;if(m==="."||m===".."||!i.dot&&m.charAt(0)==="."){this.debug("dot detected!",t,l,e,c);break}this.debug("globstar swallow a segment, and continue"),l++}return!!(a&&(this.debug(`
>>> no match, partial?`,t,l,e,c),l===s))}var u;if(typeof p=="string"?(u=d===p,this.debug("string match",p,d,u)):(u=d.match(p),this.debug("pattern match",p,d,u)),!u)return!1}if(r===s&&n===o)return!0;if(r===s)return a;if(n===o)return r===s-1&&t[r]==="";throw new Error("wtf?")};function jw(t){return t.replace(/\\(.)/g,"$1")}function kw(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var Cf=T(Jt=>{"use strict";var Hw=Jt&&Jt.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),Uw=Jt&&Jt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ef=Jt&&Jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&Hw(e,t,a);return Uw(e,t),e},Fw=Jt&&Jt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.Path=void 0;var Fn=Ef(require("path")),vi=Ef(Eo()),Vn=Fw(require("assert")),Vw=process.platform==="win32",Yl=class{constructor(e){if(this.segments=[],typeof e=="string")if(Vn.default(e,"Parameter 'itemPath' must not be empty"),e=vi.safeTrimTrailingSeparator(e),!vi.hasRoot(e))this.segments=e.split(Fn.sep);else{let a=e,i=vi.dirname(a);for(;i!==a;){let r=Fn.basename(a);this.segments.unshift(r),a=i,i=vi.dirname(a)}this.segments.unshift(a)}else{Vn.default(e.length>0,"Parameter 'itemPath' must not be an empty array");for(let a=0;a<e.length;a++){let i=e[a];Vn.default(i,"Parameter 'itemPath' must not contain any empty segments"),i=vi.normalizeSeparators(e[a]),a===0&&vi.hasRoot(i)?(i=vi.safeTrimTrailingSeparator(i),Vn.default(i===vi.dirname(i),"Parameter 'itemPath' root segment contains information for multiple segments"),this.segments.push(i)):(Vn.default(!i.includes(Fn.sep),"Parameter 'itemPath' contains unexpected path separators"),this.segments.push(i))}}}toString(){let e=this.segments[0],a=e.endsWith(Fn.sep)||Vw&&/^[A-Z]:$/i.test(e);for(let i=1;i<this.segments.length;i++)a?a=!1:e+=Fn.sep,e+=this.segments[i];return e}};Jt.Path=Yl});var Tf=T(ea=>{"use strict";var $w=ea&&ea.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),Gw=ea&&ea.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ec=ea&&ea.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&$w(e,t,a);return Gw(e,t),e},Xw=ea&&ea.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ea,"__esModule",{value:!0});ea.Pattern=void 0;var Ww=ec(require("os")),$n=ec(require("path")),Mt=ec(Eo()),Yi=Xw(require("assert")),Kw=Sf(),Zl=Co(),Oo=Cf(),Va=process.platform==="win32",Jl=class t{constructor(e,a=!1,i,r){this.negate=!1;let n;if(typeof e=="string")n=e.trim();else{i=i||[],Yi.default(i.length,"Parameter 'segments' must not empty");let d=t.getLiteral(i[0]);Yi.default(d&&Mt.hasAbsoluteRoot(d),"Parameter 'segments' first element must be a root path"),n=new Oo.Path(i).toString().trim(),e&&(n=`!${n}`)}for(;n.startsWith("!");)this.negate=!this.negate,n=n.substr(1).trim();n=t.fixupPattern(n,r),this.segments=new Oo.Path(n).segments,this.trailingSeparator=Mt.normalizeSeparators(n).endsWith($n.sep),n=Mt.safeTrimTrailingSeparator(n);let s=!1,o=this.segments.map(d=>t.getLiteral(d)).filter(d=>!s&&!(s=d===""));this.searchPath=new Oo.Path(o).toString(),this.rootRegExp=new RegExp(t.regExpEscape(o[0]),Va?"i":""),this.isImplicitPattern=a;let p={dot:!0,nobrace:!0,nocase:Va,nocomment:!0,noext:!0,nonegate:!0};n=Va?n.replace(/\\/g,"/"):n,this.minimatch=new Kw.Minimatch(n,p)}match(e){return this.segments[this.segments.length-1]==="**"?(e=Mt.normalizeSeparators(e),!e.endsWith($n.sep)&&this.isImplicitPattern===!1&&(e=`${e}${$n.sep}`)):e=Mt.safeTrimTrailingSeparator(e),this.minimatch.match(e)?this.trailingSeparator?Zl.MatchKind.Directory:Zl.MatchKind.All:Zl.MatchKind.None}partialMatch(e){return e=Mt.safeTrimTrailingSeparator(e),Mt.dirname(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(Va?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(Va?e:e.replace(/\\/g,"\\\\")).replace(/(\[)(?=[^/]+\])/g,"[[]").replace(/\?/g,"[?]").replace(/\*/g,"[*]")}static fixupPattern(e,a){Yi.default(e,"pattern cannot be empty");let i=new Oo.Path(e).segments.map(r=>t.getLiteral(r));if(Yi.default(i.every((r,n)=>(r!=="."||n===0)&&r!==".."),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),Yi.default(!Mt.hasRoot(e)||i[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),e=Mt.normalizeSeparators(e),e==="."||e.startsWith(`.${$n.sep}`))e=t.globEscape(process.cwd())+e. Line truncated
`),e=e.replace(/\r/g,`
`));let r=e.split(`
`).map(n=>n.trim());for(let n of r)!n||n.startsWith("#")||i.patterns.push(new Df.Pattern(n));return i.searchPaths.push(...Do.getSearchPaths(i.patterns)),i})}static stat(e,a,i){return ac(this,void 0,void 0,function*(){let r;if(a.followSymbolicLinks)try{r=yield Gn.promises.stat(e.path)}catch(n){if(n.code==="ENOENT"){if(a.omitBrokenSymbolicLinks){ic.debug(`Broken symlink '${e.path}'`);return}throw new Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`)}throw n}else r=yield Gn.promises.lstat(e.path);if(r.isDirectory()&&a.followSymbolicLinks){let n=yield Gn.promises.realpath(e.path);for(;i.length>=e.level;)i.pop();if(i.some(s=>s===n)){ic.debug(`Symlink cycle detected for path '${e.path}' and realpath '${n}'`);return}i.push(n)}return r})}};nt.DefaultGlobber=rc});var Af=T(Ar=>{"use strict";var aN=Ar&&Ar.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.create=void 0;var iN=Bf();function rN(t,e){return aN(this,void 0,void 0,function*(){return yield iN.DefaultGlobber.create(t,e)})}Ar.create=rN});var Mo=T((te,jf)=>{te=jf.exports=ie;var be;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?be=function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:be=function(){};te.SEMVER_SPEC_VERSION="2.0.0";var Wn=256,Io=Number.MAX_SAFE_INTEGER||9007199254740991,nc=16,nN=Wn-6,zr=te.re=[],xe=te.safeRe=[],A=te.src=[],I=te.tokens={},qf=0;function se(t){I[t]=qf++}var oc="[a-zA-Z0-9-]",sc=[["\\s",1],["\\d",Wn],[oc,nN]];function Qn(t){for(var e=0;e<sc.length;e++){var a=sc[e][0],i=sc[e][1];t=t.split(a+"*").join(a+"{0,"+i+"}").split(a+"+").join(a+"{1,"+i+"}")}return t}se("NUMERICIDENTIFIER");A[I.NUMERICIDENTIFIER]="0|[1-9]\\d*";se("NUMERICIDENTIFIERLOOSE");A[I.NUMERICIDENTIFIERLOOSE]="\\d+";se("NONNUMERICIDENTIFIER");A[I.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+oc+"*";se("MAINVERSION");A[I.MAINVERSION]="("+A[I.NUMERICIDENTIFIER]+")\\.("+A[I.NUMERICIDENTIFIER]+")\\.("+A[I.NUMERICIDENTIFIER]+")";se("MAINVERSIONLOOSE");A[I.MAINVERSIONLOOSE]="("+A[I.NUMERICIDENTIFIERLOOSE]+")\\.("+A[I.NUMERICIDENTIFIERLOOSE]+")\\.("+A[I.NUMERICIDENTIFIERLOOSE]+")";se("PRERELEASEIDENTIFIER");A[I.PRERELEASEIDENTIFIER]="(?:"+A[I.NUMERICIDENTIFIER]+"|"+A[I.NONNUMERICIDENTIFIER]+")";se("PRERELEASEIDENTIFIERLOOSE");A[I.PRERELEASEIDENTIFIERLOOSE]="(?:"+A[I.NUMERICIDENTIFIERLOOSE]+"|"+A[I.NONNUMERICIDENTIFIER]+")";se("PRERELEASE");A[I.PRERELEASE]="(?:-("+A[I.PRERELEASEIDENTIFIER]+"(?:\\."+A[I.PRERELEASEIDENTIFIER]+")*))";se("PRERELEASELOOSE");A[I.PRERELEASELOOSE]="(?:-?("+A[I.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+A[I.PRERELEASEIDENTIFIERLOOSE]+")*))";se("BUILDIDENTIFIER");A[I.BUILDIDENTIFIER]=oc+"+";se("BUILD");A[I.BUILD]="(?:\\+("+A[I.BUILDIDENTIFIER]+"(?:\\."+A[I.BUILDIDENTIFIER]+")*))";se("FULL");se("FULLPLAIN");A[I.FULLPLAIN]="v?"+A[I.MAINVERSION]+A[I.PRERELEASE]+"?"+A[I.BUILD]+"?";A[I.FULL]="^"+A[I.FULLPLAIN]+"$";se("LOOSEPLAIN");A[I.LOOSEPLAIN]="[v=\\s]*"+A[I.MAINVERSIONLOOSE]+A[I.PRERELEASELOOSE]+"?"+A[I.BUILD]+"?";se("LOOSE");A[I.LOOSE]="^"+A[I.LOOSEPLAIN]+"$";se("GTLT");A[I.GTLT]="((?:<|>)?=?)";se("XRANGEIDENTIFIERLOOSE");A[I.XRANGEIDENTIFIERLOOSE]=A[I.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";se("XRANGEIDENTIFIER");A[I.XRANGEIDENTIFIER]=A[I.NUMERICIDENTIFIER]+"|x|X|\\*";se("XRANGEPLAIN");A[I.XRANGEPLAIN]="[v=\\s]*("+A[I.XRANGEIDENTIFIER]+")(?:\\.("+A[I.XRANGEIDENTIFIER]+")(?:\\.("+A[I.XRANGEIDENTIFIER]+")(?:"+A[I.PRERELEASE]+")?"+A[I.BUILD]+"?)?)?";se("XRANGEPLAINLOOSE");A[I.XRANGEPLAINLOOSE]="[v=\\s]*("+A[I.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+A[I.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+A[I.XRANGEIDENTIFIERLOOSE]+")(?:"+A[I.PRERELEASELOOSE]+")?"+A[I.BUILD]+"?)?)?";se("XRANGE");A[I.XRANGE]="^"+A[I.GTLT]+"\\s*"+A[I.XRANGEPLAIN]+"$";se("XRANGELOOSE");A[I.XRANGELOOSE]="^"+A[I.GTLT]+"\\s*"+A[I.XRANGEPLAINLOOSE]+"$";se("COERCE");A[I.COERCE]="(^|[^\\d])(\\d{1,"+nc+"})(?:\\.(\\d{1,"+nc+"}))?(?:\\.(\\d{1,"+nc+"}))?(?:$|[^\\d])";se("COERCERTL");zr[I.COERCERTL]=new RegExp(A[I.COERCE],"g");xe[I.COERCERTL]=new RegExp(Qn(A[I.COERCE]),"g");se("LONETILDE");A[I.LONETILDE]="(?:~>?)";se("TILDETRIM");A[I.TILDETRIM]="(\\s*)"+A[I.LONETILDE]+"\\s+";zr[I.TILDETRIM]=new RegExp(A[I.TILDETRIM],"g");xe[I.TILDETRIM]=new RegExp(Qn(A[I.TILDETRIM]),"g");var sN="$1~";se("TILDE");A[I.TILDE]="^"+A[I.LONETILDE]+A[I.XRANGEPLAIN]+"$";se("TILDELOOSE");A[I.TILDELOOSE]="^"+A[I.LONETILDE]+A[I.XRANGEPLAINLOOSE]+"$";se("LONECARET");A[I.LONECARET]="(?:\\^)";se("CARETTRIM");A[I.CARETTRIM]="(\\s*)"+A[I.LONECARET]+"\\s+";zr[I.CARETTRIM]=new RegExp(A[I.CARETTRIM],"g");xe[I.CARETTRIM]=new RegExp(Qn(A[I.CARETTRIM]),"g");var oN="$1^";se("CARET");A[I.CARET]="^"+A[I.LONE Line truncated
`),{implicitDescendants:!1});try{for(var d=!0,l=a_(p.globGenerator()),c;c=yield l.next(),e=c.done,!e;){r=c.value,d=!1;try{let m=r,u=qo.relative(o,m).replace(new RegExp(`\\${qo.sep}`,"g"),"/");Jn.debug(`Matched: ${u}`),u===""?s.push("."):s.push(`${u}`)}finally{d=!0}}}catch(m){a={error:m}}finally{try{!d&&!e&&(i=l.return)&&(yield i.call(l))}finally{if(a)throw a.error}}return s})}we.resolvePaths=l_;function c_(t){return qr(this,void 0,void 0,function*(){return s_.promisify(xc.unlink)(t)})}we.unlinkFile=c_;function Yf(t,e=[]){return qr(this,void 0,void 0,function*(){let a="";e.push("--version"),Jn.debug(`Checking ${t} ${e.join(" ")}`);try{yield i_.exec(`${t}`,e,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:i=>a+=i.toString(),stderr:i=>a+=i.toString()}})}catch(i){Jn.debug(i.message)}return a=a.trim(),Jn.debug(a),a})}function m_(){return qr(this,void 0,void 0,function*(){let t=yield Yf("zstd",["--quiet"]),e=n_.clean(t);return Jn.debug(`zstd version: ${e}`),t===""?er.CompressionMethod.Gzip:er.CompressionMethod.ZstdWithoutLong})}we.getCompressionMethod=m_;function u_(t){return t===er.CompressionMethod.Gzip?er.CacheFilename.Gzip:er.CacheFilename.Zstd}we.getCacheFileName=u_;function f_(){return qr(this,void 0,void 0,function*(){return xc.existsSync(er.GnuTarPathOnWindows)?er.GnuTarPathOnWindows:(yield Yf("tar")).toLowerCase().includes("gnu tar")?Qf.which("tar"):""})}we.getGnuTarPathOnWindows=f_;function h_(t,e){if(e===void 0)throw Error(`Expected ${t} but value was undefiend`);return e}we.assertDefined=h_;function g_(){return new URL(process.env.GITHUB_SERVER_URL||"https://github.com").hostname.toUpperCase()!=="GITHUB.COM"}we.isGhes=g_});function ts(){return Lo>jo.length-16&&(Zf.default.randomFillSync(jo),Lo=0),jo.slice(Lo,Lo+=16)}var Zf,jo,Lo,bc=ge(()=>{Zf=Kt(require("crypto")),jo=new Uint8Array(256),Lo=jo.length});var Jf,e6=ge(()=>{Jf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function y_(t){return typeof t=="string"&&Jf.test(t)}var wi,as=ge(()=>{e6();wi=y_});function v_(t,e=0){let a=(yt[t[e+0]]+yt[t[e+1]]+yt[t[e+2]]+yt[t[e+3]]+"-"+yt[t[e+4]]+yt[t[e+5]]+"-"+yt[t[e+6]]+yt[t[e+7]]+"-"+yt[t[e+8]]+yt[t[e+9]]+"-"+yt[t[e+10]]+yt[t[e+11]]+yt[t[e+12]]+yt[t[e+13]]+yt[t[e+14]]+yt[t[e+15]]).toLowerCase();if(!wi(a))throw TypeError("Stringified UUID is invalid");return a}var yt,Ni,is=ge(()=>{as();yt=[];for(let t=0;t<256;++t)yt.push((t+256).toString(16).substr(1));Ni=v_});function x_(t,e,a){let i=e&&a||0,r=e||new Array(16);t=t||{};let n=t.node||t6,s=t.clockseq!==void 0?t.clockseq:wc;if(n==null||s==null){let m=t.random||(t.rng||ts)();n==null&&(n=t6=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]),s==null&&(s=wc=(m[6]<<8|m[7])&16383)}let o=t.msecs!==void 0?t.msecs:Date.now(),p=t.nsecs!==void 0?t.nsecs:_c+1,d=o-Nc+(p-_c)/1e4;if(d<0&&t.clockseq===void 0&&(s=s+1&16383),(d<0||o>Nc)&&t.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Nc=o,_c=p,wc=s,o+=122192928e5;let l=((o&268435455)*1e4+p)%4294967296;r[i++]=l>>>24&255,r[i++]=l>>>16&255,r[i++]=l>>>8&255,r[i++]=l&255;let c=o/4294967296*1e4&268435455;r[i++]=c>>>8&255,r[i++]=c&255,r[i++]=c>>>24&15|16,r[i++]=c>>>16&255,r[i++]=s>>>8|128,r[i++]=s&255;for(let m=0;m<6;++m)r[i+m]=n[m];return e||Ni(r)}var t6,wc,Nc,_c,a6,i6=ge(()=>{bc();is();Nc=0,_c=0;a6=x_});function b_(t){if(!wi(t))throw TypeError("Invalid UUID");let e,a=new Uint8Array(16);return a[0]=(e=parseInt(t.slice(0,8),16))>>>24,a[1]=e>>>16&255,a[2]=e>>>8&255,a[3]=e&255,a[4]=(e=parseInt(t.slice(9,13),16))>>>8,a[5]=e&255,a[6]=(e=parseInt(t.slice(14,18),16))>>>8,a[7]=e&255,a[8]=(e=parseInt(t.slice(19,23),16))>>>8,a[9]=e&255,a[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,a[11]=e/4294967296&255,a[12]=e>>>24&255,a[13]=e>>>16&255,a[14]=e>>>8&255,a[15]=e&255,a}var ko,Sc=ge(()=>{as();ko=b_});function w_(t){t=unescape(encodeURIComponent(t));let e=[];for(let a=0;a<t.length;++a)e.push(t.charCodeAt(a));return e}function Ho(t,e,a){function i(r,n,s,o){if(typeof r=="string"&&(r=w_(r)),typeof n=="string"&&(n=ko(n)),n.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+r.length);if(p.set(n),p.set(r,n.length),p=a(p),p[6]=p[6]&15|e,p[8]=p[8]&63|128,s){o=o||0;for(let d=0;d<16;++d)s[o+d]=p[d];return s}return Ni(p)}try{i.name=t}catch{}return i.DNS=N_,i.URL=__,i}var N_,__,Ec=ge(()=>{is();Sc();N_="6ba7b810-9dad-11d1-80b4-00c04fd430c8",__="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function S_(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),r6.default.createHash("md5").update(t).digest()}var r6,n6,s6=ge(()=>{r6=Kt(require("crypto"));n6=S_});var E_,o6,p6=ge(()=>{Ec();s6();E_=Ho("v3",48,n6),o6=E_});function C_(t,e,a){t=t||{};let i=t.random||(t.rng||ts)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){a=a||0;for(let r=0;r<16;++r)e[a+r]=i[r];return e}return Ni(i)}var d6,l6=ge(()=>{bc();is();d6=C_});function T_(t){return Array.isArray(t)?t=Buffer.fro Line truncated
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(Pc)});var Oa=T((V6,_i)=>{(function(){var t,e,a,i,r,n,s,o=[].slice,p={}.hasOwnProperty;t=function(){var d,l,c,m,u,h;if(h=arguments[0],u=2<=arguments.length?o.call(arguments,1):[],r(Object.assign))Object.assign.apply(null,arguments);else for(d=0,c=u.length;d<c;d++)if(m=u[d],m!=null)for(l in m)p.call(m,l)&&(h[l]=m[l]);return h},r=function(d){return!!d&&Object.prototype.toString.call(d)==="[object Function]"},n=function(d){var l;return!!d&&((l=typeof d)=="function"||l==="object")},a=function(d){return r(Array.isArray)?Array.isArray(d):Object.prototype.toString.call(d)==="[object Array]"},i=function(d){var l;if(a(d))return!d.length;for(l in d)if(p.call(d,l))return!1;return!0},s=function(d){var l,c;return n(d)&&(c=Object.getPrototypeOf(d))&&(l=c.constructor)&&typeof l=="function"&&l instanceof l&&Function.prototype.toString.call(l)===Function.prototype.toString.call(Object)},e=function(d){return r(d.valueOf)?d.valueOf():d},_i.exports.assign=t,_i.exports.isFunction=r,_i.exports.isObject=n,_i.exports.isArray=a,_i.exports.isEmpty=i,_i.exports.isPlainObject=s,_i.exports.getValue=e}).call(V6)});var Oc=T(($6,G6)=>{(function(){var t;G6.exports=t=function(){function e(){}return e.prototype.hasFeature=function(a,i){return!0},e.prototype.createDocumentType=function(a,i,r){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(a,i,r){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(a){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(a,i){throw new Error("This DOM method is not implemented.")},e}()}).call($6)});var K6=T((X6,W6)=>{(function(){var t;W6.exports=t=function(){function e(){}return e.prototype.handleError=function(a){throw new Error(a)},e}()}).call(X6)});var Z6=T((Q6,Y6)=>{(function(){var t;Y6.exports=t=function(){function e(a){this.arr=a||[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}}),e.prototype.item=function(a){return this.arr[a]||null},e.prototype.contains=function(a){return this.arr.indexOf(a)!==-1},e}()}).call(Q6)});var th=T((J6,eh)=>{(function(){var t,e,a;e=K6(),a=Z6(),eh.exports=t=function(){function i(){var r;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=r=Object.create(this.defaultParams)}return Object.defineProperty(i.prototype,"parameterNames",{get:function(){return new a(Object.keys(this.defaultParams))}}),i.prototype.getParameter=function(r){return this.params.hasOwnProperty(r)?this.params[r]:null},i.prototype.canSetParameter=function(r,n){return!0},i.prototype.setParameter=function(r,n){return n!=null?this.params[r]=n:delete this.params[r]},i}()}).call(J6)});var We=T((ah,ih)=>{(function(){ih.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(ah)});var Rc=T((rh,nh)=>{(function(){var t,e,a;t=We(),a=Ht(),nh.exports=e=function(){function i(r,n,s){if(this.parent=r,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),n==null)throw new Error("Missing attribute name. "+this.debugInfo(n));this.name=this.stringify.name(n),this.value=this.stringify.attValue(s),this.type=t.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(i.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(i.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(i.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(i.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(i.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(i.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"specified",{get:function(){return!0}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))},i.prototype.debugInfo=function(r){return r=r||this.name,r==null?"parent: <"+this.parent.name+">":"attribute: {"+r+"}, parent: <"+this.parent.name+">"},i.prototype.isEqualNode=function(r){return!(r.namespaceURI!==this.namespaceURI||r.prefix!==this.prefix||r.localName!==this.localName||r.value!==this.value)},i}()}).call(rh)});var Wo=T((sh,oh)=>{(function(){var t;oh.exports=t=function(){function e(a){this.nodes=a}return Object.definePropert Line truncated
`,g.offset=(C=b.offset)!=null?C:0,g.dontPrettyTextNodes=(w=(D=b.dontPrettyTextNodes)!=null?D:b.dontprettytextnodes)!=null?w:0,g.spaceBeforeSlash=(_=(O=b.spaceBeforeSlash)!=null?O:b.spacebeforeslash)!=null?_:"",g.spaceBeforeSlash===!0&&(g.spaceBeforeSlash=" "),g.suppressPrettyCount=0,g.user={},g.state=e.None,g},R.prototype.indent=function(b,g,f){var N;return!g.pretty||g.suppressPrettyCount?"":g.pretty&&(N=(f||0)+g.offset+1,N>0)?new Array(N).join(g.indent):""},R.prototype.endline=function(b,g,f){return!g.pretty||g.suppressPrettyCount?"":g.newline},R.prototype.attribute=function(b,g,f){var N;return this.openAttribute(b,g,f),N=" "+b.name+'="'+b.value+'"',this.closeAttribute(b,g,f),N},R.prototype.cdata=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f)+"<![CDATA[",g.state=e.InsideTag,N+=b.value,g.state=e.CloseTag,N+="]]>"+this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),N},R.prototype.comment=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f)+"<!-- ",g.state=e.InsideTag,N+=b.value,g.state=e.CloseTag,N+=" -->"+this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),N},R.prototype.declaration=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f)+"<?xml",g.state=e.InsideTag,N+=' version="'+b.version+'"',b.encoding!=null&&(N+=' encoding="'+b.encoding+'"'),b.standalone!=null&&(N+=' standalone="'+b.standalone+'"'),g.state=e.CloseTag,N+=g.spaceBeforeSlash+"?>",N+=this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),N},R.prototype.docType=function(b,g,f){var N,C,w,D,_;if(f||(f=0),this.openNode(b,g,f),g.state=e.OpenTag,D=this.indent(b,g,f),D+="<!DOCTYPE "+b.root().name,b.pubID&&b.sysID?D+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(D+=' SYSTEM "'+b.sysID+'"'),b.children.length>0){for(D+=" [",D+=this.endline(b,g,f),g.state=e.InsideTag,_=b.children,C=0,w=_.length;C<w;C++)N=_[C],D+=this.writeChildNode(N,g,f+1);g.state=e.CloseTag,D+="]"}return g.state=e.CloseTag,D+=g.spaceBeforeSlash+">",D+=this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),D},R.prototype.element=function(b,g,f){var N,C,w,D,_,O,B,j,ne,me,K,Ge,ce,ca;f||(f=0),me=!1,K="",this.openNode(b,g,f),g.state=e.OpenTag,K+=this.indent(b,g,f)+"<"+b.name,Ge=b.attribs;for(ne in Ge)S.call(Ge,ne)&&(N=Ge[ne],K+=this.attribute(N,g,f));if(w=b.children.length,D=w===0?null:b.children[0],w===0||b.children.every(function(Pt){return(Pt.type===t.Text||Pt.type===t.Raw)&&Pt.value===""}))g.allowEmpty?(K+=">",g.state=e.CloseTag,K+="</"+b.name+">"+this.endline(b,g,f)):(g.state=e.CloseTag,K+=g.spaceBeforeSlash+"/>"+this.endline(b,g,f));else if(g.pretty&&w===1&&(D.type===t.Text||D.type===t.Raw)&&D.value!=null)K+=">",g.state=e.InsideTag,g.suppressPrettyCount++,me=!0,K+=this.writeChildNode(D,g,f+1),g.suppressPrettyCount--,me=!1,g.state=e.CloseTag,K+="</"+b.name+">"+this.endline(b,g,f);else{if(g.dontPrettyTextNodes){for(ce=b.children,_=0,B=ce.length;_<B;_++)if(C=ce[_],(C.type===t.Text||C.type===t.Raw)&&C.value!=null){g.suppressPrettyCount++,me=!0;break}}for(K+=">"+this.endline(b,g,f),g.state=e.InsideTag,ca=b.children,O=0,j=ca.length;O<j;O++)C=ca[O],K+=this.writeChildNode(C,g,f+1);g.state=e.CloseTag,K+=this.indent(b,g,f)+"</"+b.name+">",me&&g.suppressPrettyCount--,K+=this.endline(b,g,f),g.state=e.None}return this.closeNode(b,g,f),K},R.prototype.writeChildNode=function(b,g,f){switch(b.type){case t.CData:return this.cdata(b,g,f);case t.Comment:return this.comment(b,g,f);case t.Element:return this.element(b,g,f);case t.Raw:return this.raw(b,g,f);case t.Text:return this.text(b,g,f);case t.ProcessingInstruction:return this.processingInstruction(b,g,f);case t.Dummy:return"";case t.Declaration:return this.declaration(b,g,f);case t.DocType:return this.docType(b,g,f);case t.AttributeDeclaration:return this.dtdAttList(b,g,f);case t.ElementDeclaration:return this.dtdElement(b,g,f);case t.EntityDeclaration:return this.dtdEntity(b,g,f);case t.NotationDeclaration:return this.dtdNotation(b,g,f);default:throw new Error("Unknown XML node type: "+b.constructor.name)}},R.prototype.processingInstruction=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f)+"<?",g.state=e.InsideTag,N+=b.target,b.value&&(N+=" "+b.value),g.state=e.CloseTag,N+=g.spaceBeforeSlash+"?>",N+=this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),N},R.prototype.raw=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f),g.state=e.InsideTag,N+=b.value,g.state=e.CloseTag,N+=this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),N},R.prototype.text=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f),g.state=e.InsideTag,N+=b.value,g.state=e.CloseTag,N+=this.endline(b,g,f),g.state=e.None,this.closeNode(b,g,f),N},R.prototype.dtdAttList=function(b,g,f){var N;return this.openNode(b,g,f),g.state=e.OpenTag,N=this.indent(b,g,f)+"<!ATTLIST",g.state=e.InsideTag,N+=" "+b.elementName+" "+b.attributeName+" "+b.attribut Line truncated
`||x==="\r"||x===" "}function g(x){return x==='"'||x==="'"}function f(x){return x===">"||b(x)}function N(x,y){return x.test(y)}function C(x,y){return!N(x,y)}var w=0;t.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(x){var y=t.ENTITIES[x],z=typeof y=="number"?String.fromCharCode(y):y;t.ENTITIES[x]=z});for(var D in t.STATE)t.STATE[t.STATE[D]]=D;w=t.STATE;function _(x,y,z){x[y]&&x[y](z)}function O(x,y,z){x.textNode&&B(x),_(x,y,z)}function B(x){x.textNode=j(x.opt,x.textNode),x.textNode&&_(x,"ontext",x.textNode),x.textNode=""}function j(x,y){return x.trim&&(y=y.trim()),x.normalize&&(y=y.replace(/\s+/g," ")),y}function ne(x,y){return B(x),x.trackPosition&&(y+=`
Line: `+x.line+`
Column: `+x.column+`
Char: `+x.c),y=new Error(y),x.error=y,_(x,"onerror",y),x}function me(x){return x.sawRoot&&!x.closedRoot&&K(x,"Unclosed root tag"),x.state!==w.BEGIN&&x.state!==w.BEGIN_WHITESPACE&&x.state!==w.TEXT&&ne(x,"Unexpected end"),B(x),x.c="",x.closed=!0,_(x,"onend"),a.call(x,x.strict,x.opt),x}function K(x,y){if(typeof x!="object"||!(x instanceof a))throw new Error("bad call to strictFail");x.strict&&ne(x,y)}function Ge(x){x.strict||(x.tagName=x.tagName[x.looseCase]());var y=x.tags[x.tags.length-1]||x,z=x.tag={name:x.tagName,attributes:{}};x.opt.xmlns&&(z.ns=y.ns),x.attribList.length=0,O(x,"onopentagstart",z)}function ce(x,y){var z=x.indexOf(":"),P=z<0?["",x]:x.split(":"),Ee=P[0],Ze=P[1];return y&&x==="xmlns"&&(Ee="xmlns",Ze=""),{prefix:Ee,local:Ze}}function ca(x){if(x.strict||(x.attribName=x.attribName[x.looseCase]()),x.attribList.indexOf(x.attribName)!==-1||x.tag.attributes.hasOwnProperty(x.attribName)){x.attribName=x.attribValue="";return}if(x.opt.xmlns){var y=ce(x.attribName,!0),z=y.prefix,P=y.local;if(z==="xmlns")if(P==="xml"&&x.attribValue!==m)K(x,"xml: prefix must be bound to "+m+`
Actual: `+x.attribValue);else if(P==="xmlns"&&x.attribValue!==u)K(x,"xmlns: prefix must be bound to "+u+`
Actual: `+x.attribValue);else{var Ee=x.tag,Ze=x.tags[x.tags.length-1]||x;Ee.ns===Ze.ns&&(Ee.ns=Object.create(Ze.ns)),Ee.ns[P]=x.attribValue}x.attribList.push([x.attribName,x.attribValue])}else x.tag.attributes[x.attribName]=x.attribValue,O(x,"onattribute",{name:x.attribName,value:x.attribValue});x.attribName=x.attribValue=""}function Pt(x,y){if(x.opt.xmlns){var z=x.tag,P=ce(x.tagName);z.prefix=P.prefix,z.local=P.local,z.uri=z.ns[P.prefix]||"",z.prefix&&!z.uri&&(K(x,"Unbound namespace prefix: "+JSON.stringify(x.tagName)),z.uri=P.prefix);var Ee=x.tags[x.tags.length-1]||x;z.ns&&Ee.ns!==z.ns&&Object.keys(z.ns).forEach(function(M0){O(x,"onopennamespace",{prefix:M0,uri:z.ns[M0]})});for(var Ze=0,rt=x.attribList.length;Ze<rt;Ze++){var Ot=x.attribList[Ze],Sa=Ot[0],Er=Ot[1],ft=ce(Sa,!0),Ua=ft.prefix,Yv=ft.local,z0=Ua===""?"":z.ns[Ua]||"",cl={name:Sa,value:Er,prefix:Ua,local:Yv,uri:z0};Ua&&Ua!=="xmlns"&&!z0&&(K(x,"Unbound namespace prefix: "+JSON.stringify(Ua)),cl.uri=Ua),x.tag.attributes[Sa]=cl,O(x,"onattribute",cl)}x.attribList.length=0}x.tag.isSelfClosing=!!y,x.sawRoot=!0,x.tags.push(x.tag),O(x,"onopentag",x.tag),y||(!x.noscript&&x.tagName.toLowerCase()==="script"?x.state=w.SCRIPT:x.state=w.TEXT,x.tag=null,x.tagName=""),x.attribName=x.attribValue="",x.attribList.length=0}function Sr(x){if(!x.tagName){K(x,"Weird empty close tag."),x.textNode+="</>",x.state=w.TEXT;return}if(x.script){if(x.tagName!=="script"){x.script+="</"+x.tagName+">",x.tagName="",x.state=w.SCRIPT;return}O(x,"onscript",x.script),x.script=""}var y=x.tags.length,z=x.tagName;x.strict||(z=z[x.looseCase]());for(var P=z;y--;){var Ee=x.tags[y];if(Ee.name!==P)K(x,"Unexpected close tag");else break}if(y<0){K(x,"Unmatched closing tag: "+x.tagName),x.textNode+="</"+x.tagName+">",x.state=w.TEXT;return}x.tagName=z;for(var Ze=x.tags.length;Ze-- >y;){var rt=x.tag=x.tags.pop();x.tagName=x.tag.name,O(x,"onclosetag",x.tagName);var Ot={};for(var Sa in rt.ns)Ot[Sa]=rt.ns[Sa];var Er=x.tags[x.tags.length-1]||x;x.opt.xmlns&&rt.ns!==Er.ns&&Object.keys(rt.ns).forEach(function(ft){var Ua=rt.ns[ft];O(x,"onclosenamespace",{prefix:ft,uri:Ua})})}y===0&&(x.closedRoot=!0),x.tagName=x.attribValue=x.attribName="",x.attribList.length=0,x.state=w.TEXT}function Bn(x){var y=x.entity,z=y.toLowerCase(),P,Ee="";return x.ENTITIES[y]?x.ENTITIES[y]:x.ENTITIES[z]?x.ENTITIES[z]:(y=z,y.charAt(0)==="#"&&(y.charAt(1)==="x"?(y=y.slice(2),P=parseInt(y,16),Ee=P.toString(16)):(y=y.slice(1),P=parseInt(y,10),Ee=P.toString(10))),y=y.replace(/^0+/,""),isNaN(P)||Ee.toLowerCase()!==y?(K(x,"Invalid character entity"),"&"+x.entity+";"):String.fromCodePoint(P))}function B0(x,y){y==="<"?(x.state=w.OPEN_WAKA,x.startTagPosition=x.position):b(y)||(K(x,"Non-whitespace before first tag."),x.textNode=y,x.state=w.TEXT)}function A0(x,y){var z="";return y<x.length&&(z=x.charAt(y)),z}function Qv(x){var y=this;if(this.error)throw this.error;if(y.closed)return ne(y,"Cannot write after close. Assign an onready handler.");if(x===null)return me(y);typeof x=="object"&&(x=x.toString());for(var z=0,P="";P=A0(x,z++),y.c=P,!!P;)switch(y.trackPosition&&(y.position++,P===`
`?(y.line++,y.column=0):y.column++),y.state){case w.BEGIN:if(y.state=w.BEGIN_WHITESPACE,P==="\uFEFF")continue;B0(y,P);continue;case w.BEGIN_WHITESPACE:B0(y,P);continue;case w.TEXT:if(y.sawRoot&&!y.closedRoot){for(var Ee=z-1;P&&P!=="<"&&P!=="&";)P=A0(x,z++),P&&y.trackPosition&&(y.position++,P===`
`?(y.line++,y.column=0):y.column++);y.textNode+=x.substring(Ee,z-1)}P==="<"&&!(y.sawRoot&&y.closedRoot&&!y.strict)?(y.state=w.OPEN_WAKA,y.startTagPosition=y.position):(!b(P)&&(!y.sawRoot||y.closedRoot)&&K(y,"Text data outside of root node."),P==="&"?y.state=w.TEXT_ENTITY:y.textNode+=P);continue;case w.SCRIPT:P==="<"?y.state=w.SCRIPT_ENDING:y.script+=P;continue;case w.SCRIPT_ENDING:P==="/"?y.state=w.CLOSE_TAG:(y.script+="<"+P,y.state=w.SCRIPT);continue;case w.OPEN_WAKA:if(P==="!")y.state=w.SGML_DECL,y.sgmlDecl="";else if(!b(P))if(N(v,P))y.state=w.OPEN_TAG,y.tagName=P;else if(P==="/")y.state=w.CLOSE_TAG,y.tagName="";else if(P==="?")y.state=w.PROC_INST,y.procInstName=y.procInstBody="";else{if(K(y,"Unencoded <"),y.startTagPosition+1<y.position){var Ze=y.position-y.startTagPosition;P=new Array(Ze).join(" ")+P}y.textNode+="<"+P,y.state=w.TEXT}continue;case w.SGML_DECL:(y.sgmlDecl+P).toUpperCase()===l?(O(y,"onopencdata"),y.state=w.CDATA,y.sgmlDecl="",y.cdata=""):y.sgmlDecl+P==="--"?(y.state=w.COMMENT,y.comment="",y.sgmlDecl=""):(y.sgmlDecl+P).toUpperCase()===c?(y.state=w.DOCTYPE,(y.doctype||y.sawRoot)&&K(y,"Inappropriately located doctype declaration"),y.doctype="",y.sgmlDecl=""):P===">"?(O(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=w.TEXT):(g(P)&&(y.state=w.SGML_DECL_QUOTED),y.sgmlDecl+=P);continue;case w.SGML_DECL_QUOTED:P===y.q&&(y.state=w.SGML_DECL,y.q=""),y.sgmlDecl+=P;continue;case w.DOCTYPE:P===">"?(y.state=w.TEXT,O(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=P,P==="["?y.state=w.DOCTYPE_DTD:g(P)&&(y.state=w.DOCTYPE_QUOTED,y.q=P));continue;case w.DOCTYPE_QUOTED:y.doctype+=P,P===y.q&&(y.q="",y.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:y.doctype+=P,P==="]"?y.state=w.DOCTYPE:g(P)&&(y.state=w.DOCTYPE_DTD_QUOTED,y.q=P);continue;case w.DOCTYPE_DTD_QUOTED:y.doctype+=P,P===y.q&&(y.state=w.DOCTYPE_DTD,y.q="");continue;case w.COMMENT:P==="-"?y.state=w.COMMENT_ENDING:y.comment+=P;continue;case w.COMMENT_ENDING:P==="-"?(y.state=w.COMMENT_ENDED,y.comment=j(y.opt,y.comment),y.comment&&O(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+P,y.state=w.COMMENT);continue;case w.COMMENT_ENDED:P!==">"?(K(y,"Malformed comment"),y.comment+="--"+P,y.state=w.COMMENT):y.state=w.TEXT;continue;case w.CDATA:P==="]"?y.state=w.CDATA_ENDING:y.cdata+=P;continue;case w.CDATA_ENDING:P==="]"?y.state=w.CDATA_ENDING_2:(y.cdata+="]"+P,y.state=w.CDATA);continue;case w.CDATA_ENDING_2:P===">"?(y.cdata&&O(y,"oncdata",y.cdata),O(y,"onclosecdata"),y.cdata="",y.state=w.TEXT):P==="]"?y.cdata+="]":(y.cdata+="]]"+P,y.state=w.CDATA);continue;case w.PROC_INST:P==="?"?y.state=w.PROC_INST_ENDING:b(P)?y.state=w.PROC_INST_BODY:y.procInstName+=P;continue;case w.PROC_INST_BODY:if(!y.procInstBody&&b(P))continue;P==="?"?y.state=w.PROC_INST_ENDING:y.procInstBody+=P;continue;case w.PROC_INST_ENDING:P===">"?(O(y,"onprocessinginstruction",{name:y.procInstName,body:y.procInstBody}),y.procInstName=y.procInstBody="",y.state=w.TEXT):(y.procInstBody+="?"+P,y.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:N(E,P)?y.tagName+=P:(Ge(y),P===">"?Pt(y):P==="/"?y.state=w.OPEN_TAG_SLASH:(b(P)||K(y,"Invalid character in tag name"),y.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:P===">"?(Pt(y,!0),Sr(y)):(K(y,"Forward-slash in opening tag not followed by >"),y.state=w.ATTRIB);continue;case w.ATTRIB:if(b(P))continue;P===">"?Pt(y):P==="/"?y.state=w.OPEN_TAG_SLASH:N(v,P)?(y.attribName=P,y.attribValue="",y.state=w.ATTRIB_NAME):K(y,"Invalid attribute name");continue;case w.ATTRIB_NAME:P==="="?y.state=w.ATTRIB_VALUE:P===">"?(K(y,"Attribute without value"),y.attribValue=y.attribName,ca(y),Pt(y)):b(P)?y.state=w.ATTRIB_NAME_SAW_WHITE:N(E,P)?y.attribName+=P:K(y,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if(P==="=")y.state=w.ATTRIB_VALUE;else{if(b(P))continue;K(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",O(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",P===">"?Pt(y):N(v,P)?(y.attribName=P,y.state=w.ATTRIB_NAME):(K(y,"Invalid attribute name"),y.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(b(P))continue;g(P)?(y.q=P,y.state=w.ATTRIB_VALUE_QUOTED):(K(y,"Unquoted attribute value"),y.state=w.ATTRIB_VALUE_UNQUOTED,y.attribValue=P);continue;case w.ATTRIB_VALUE_QUOTED:if(P!==y.q){P==="&"?y.state=w.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=P;continue}ca(y),y.q="",y.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:b(P)?y.state=w.ATTRIB:P===">"?Pt(y):P==="/"?y.state=w.OPEN_TAG_SLASH:N(v,P)?(K(y,"No whitespace between attributes"),y.attribName=P,y.attribValue="",y.state=w.ATTRIB_NAME):K(y,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(!f(P)){P==="&"?y.state=w.ATTRIB_VALUE_ENTITY_U:y.attribValue+=P;continue}ca(y),P===">"?Pt(y):y.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(y.tagName)P===">"?Sr(y):N(E,P)?y.tagName+=P:y.script?(y.script+="</"+y.tagName,y.tagName="",y.state=w.SCRIPT):(b(P)||K(y,"Invalid tagname in closing tag"),y.state=w.CLOSE_TAG_SAW_WHITE);else{if(b(P))continue;C Line truncated
`;ue.DEFAULT_CONTENT_TYPE="application/octet-stream";ue.prototype.append=function(t,e,a){a=a||{},typeof a=="string"&&(a={filename:a});var i=cm.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),p3.isArray(e)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(t,e,a),n=this._multiPartFooter();i(r),i(e),i(n),this._trackLength(r,e,a)};ue.prototype._trackLength=function(t,e,a){var i=0;a.knownLength!=null?i+=+a.knownLength:Buffer.isBuffer(e)?i=e.length:typeof e=="string"&&(i=Buffer.byteLength(e)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(t)+ue.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof eE))&&(a.knownLength||this._valuesToMeasure.push(e))};ue.prototype._lengthRetriever=function(t,e){t.hasOwnProperty("fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):JS.stat(t.path,function(a,i){var r;if(a){e(a);return}r=i.size-(t.start?t.start:0),e(null,r)}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(a){t.pause(),e(null,+a.headers["content-length"])}),t.resume()):e("Unknown stream")};ue.prototype._multiPartHeader=function(t,e,a){if(typeof a.header=="string")return a.header;var i=this._getContentDisposition(e,a),r=this._getContentType(e,a),n="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(i||[]),"Content-Type":[].concat(r||[])};typeof a.header=="object"&&lm(s,a.header);var o;for(var p in s)s.hasOwnProperty(p)&&(o=s[p],o!=null&&(Array.isArray(o)||(o=[o]),o.length&&(n+=p+": "+o.join("; ")+ue.LINE_BREAK)));return"--"+this.getBoundary()+ue.LINE_BREAK+n+ue.LINE_BREAK};ue.prototype._getContentDisposition=function(t,e){var a,i;return typeof e.filepath=="string"?a=pm.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?a=pm.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(a=pm.basename(t.client._httpMessage.path||"")),a&&(i='filename="'+a+'"'),i};ue.prototype._getContentType=function(t,e){var a=e.contentType;return!a&&t.name&&(a=dm.lookup(t.name)),!a&&t.path&&(a=dm.lookup(t.path)),!a&&t.readable&&t.hasOwnProperty("httpVersion")&&(a=t.headers["content-type"]),!a&&(e.filepath||e.filename)&&(a=dm.lookup(e.filepath||e.filename)),!a&&typeof t=="object"&&(a=ue.DEFAULT_CONTENT_TYPE),a};ue.prototype._multiPartFooter=function(){return function(t){var e=ue.LINE_BREAK,a=this._streams.length===0;a&&(e+=this._lastBoundary()),t(e)}.bind(this)};ue.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+ue.LINE_BREAK};ue.prototype.getHeaders=function(t){var e,a={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)t.hasOwnProperty(e)&&(a[e.toLowerCase()]=t[e]);return a};ue.prototype.setBoundary=function(t){this._boundary=t};ue.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};ue.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),a=0,i=this._streams.length;a<i;a++)typeof this._streams[a]!="function"&&(Buffer.isBuffer(this._streams[a])?t=Buffer.concat([t,this._streams[a]]):t=Buffer.concat([t,Buffer.from(this._streams[a])]),(typeof this._streams[a]!="string"||this._streams[a].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(ue.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};ue.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t};ue.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};ue.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};ue.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}tE.parallel(this._valuesToMeasure,this._lengthRetriever,function(a,i){if(a){t(a);return}i.forEach(function(r){e+=r}),t(null,e)})};ue.prototype.submit=function(t,e){var a,i,r={method:"post"};return typeof t=="string"?(t=ZS(t),i=lm({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},r)):(i=lm(t,r),i.port||(i.port=i.protocol=="https:"?443:80)),i.headers=this.getHeaders(t.headers),i.protocol=="https:"?a=YS.request(i):a=QS.request(i),this.getLength(function(n,s){if(n&&n!=="Unknown stream"){this._error(n);return}if(s&&a.setHeader("Content-Length",s),this.pipe(a),e){var o,p=function(d,l){return a.removeListener("error",p),a.removeListener("response",o),e.call(this,d,l)};o=p.bind(this,null),a.on("error",p),a.on("response",o)}}.bind(this)),a};ue.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))}; Line truncated
${WP.sanitize(this)}`}};Ft.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";Ft.PARSE_ERROR="PARSE_ERROR";var va=GT.createClientLogger("core-http");function d5(t,e){return t?e.httpsAgent:e.httpAgent}var vd=class extends YT.Transform{constructor(e){super(),this.progressCallback=e,this.loadedBytes=0}_transform(e,a,i){this.push(e),this.loadedBytes+=e.length,this.progressCallback({loadedBytes:this.loadedBytes}),i(void 0)}};function cd(t){return t&&typeof t.pipe=="function"}function l5(t,e){return new Promise(a=>{t.once("close",()=>{e?.abort(),a()}),t.once("end",a),t.once("error",a)})}function KP(t){let e=new Ii;return t.forEach((a,i)=>{e.set(i,a)}),e}var xd=class{constructor(){this.proxyAgentMap=new Map,this.keepAliveAgents={}}async sendRequest(e){var a;if(!e&&typeof e!="object")throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object.");let i=new md.AbortController,r;if(e.abortSignal){if(e.abortSignal.aborted)throw new md.AbortError("The operation was aborted.");r=d=>{d.type==="abort"&&i.abort()},e.abortSignal.addEventListener("abort",r)}if(e.timeout&&setTimeout(()=>{i.abort()},e.timeout),e.formData){let d=e.formData,l=new eP.default,c=(u,h)=>{typeof h=="function"&&(h=h()),h&&Object.prototype.hasOwnProperty.call(h,"value")&&Object.prototype.hasOwnProperty.call(h,"options")?l.append(u,h.value,h.options):l.append(u,h)};for(let u of Object.keys(d)){let h=d[u];if(Array.isArray(h))for(let v=0;v<h.length;v++)c(u,h[v]);else c(u,h)}e.body=l,e.formData=void 0;let m=e.headers.get("Content-Type");m&&m.indexOf("multipart/form-data")!==-1&&(typeof l.getBoundary=="function"?e.headers.set("Content-Type",`multipart/form-data; boundary=${l.getBoundary()}`):e.headers.remove("Content-Type"))}let n=e.body?typeof e.body=="function"?e.body():e.body:void 0;if(e.onUploadProgress&&e.body){let d=e.onUploadProgress,l=new vd(d);cd(n)?n.pipe(l):l.end(n),n=l}let s=await this.prepareRequest(e),o=Object.assign({body:n,headers:e.headers.rawHeaders(),method:e.method,signal:i.signal,redirect:"manual"},s),p;try{let d=await this.fetch(e.url,o),l=KP(d.headers),c=((a=e.streamResponseStatusCodes)===null||a===void 0?void 0:a.has(d.status))||e.streamResponseBody;p={headers:l,request:e,status:d.status,readableStreamBody:c?d.body:void 0,bodyAsText:c?void 0:await d.text()};let m=e.onDownloadProgress;if(m){let u=d.body||void 0;if(cd(u)){let h=new vd(m);u.pipe(h),p.readableStreamBody=h}else{let h=parseInt(l.get("Content-Length"))||void 0;h&&m({loadedBytes:h})}}return await this.processRequest(p),p}catch(d){let l=d;throw l.code==="ENOTFOUND"?new Ft(l.message,Ft.REQUEST_SEND_ERROR,void 0,e):l.type==="aborted"?new md.AbortError("The operation was aborted."):l}finally{if(e.abortSignal&&r){let d=Promise.resolve();cd(n)&&(d=l5(n));let l=Promise.resolve();cd(p?.readableStreamBody)&&(l=l5(p.readableStreamBody,i)),Promise.all([d,l]).then(()=>{var c;(c=e.abortSignal)===null||c===void 0||c.removeEventListener("abort",r)}).catch(c=>{va.warning("Error when cleaning up abortListener on httpRequest",c)})}}}getOrCreateAgent(e){var a;let i=b1(e.url);if(e.proxySettings){let{host:r,port:n,username:s,password:o}=e.proxySettings,p=`${r}:${n}:${s}:${o}`,d=(a=this.proxyAgentMap.get(p))!==null&&a!==void 0?a:{},l=d5(i,d);if(l)return l;let c=VP(e.url,e.proxySettings,e.headers);return l=c.agent,c.isHttps?d.httpsAgent=c.agent:d.httpAgent=c.agent,this.proxyAgentMap.set(p,d),l}else if(e.keepAlive){let r=d5(i,this.keepAliveAgents);if(r)return r;let n={keepAlive:e.keepAlive};return i?r=this.keepAliveAgents.httpsAgent=new r5.Agent(n):r=this.keepAliveAgents.httpAgent=new i5.Agent(n),r}else return i?r5.globalAgent:i5.globalAgent}async fetch(e,a){return tP.default(e,a)}async prepareRequest(e){let a={};return a.agent=this.getOrCreateAgent(e),a.compress=e.decompressResponse,a}async processRequest(e){}};U.HttpPipelineLogLevel=void 0;(function(t){t[t.OFF=0]="OFF",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INFO=3]="INFO"})(U.HttpPipelineLogLevel||(U.HttpPipelineLogLevel={}));function QP(t){let{requestOptions:e,tracingOptions:a}=t,r=VT.__rest(t,["requestOptions","tracingOptions"]);return e&&(r=Object.assign(Object.assign({},r),e)),a&&(r.tracingContext=a.tracingContext,r.spanOptions=a?.spanOptions),r}var tt=class{constructor(e,a){this._nextPolicy=e,this._options=a}shouldLog(e){return this._options.shouldLog(e)}log(e,a){this._options.log(e,a)}},bd=class{constructor(e){this._logger=e}shouldLog(e){return!!this._logger&&e!==U.HttpPipelineLogLevel.OFF&&e<=this._logger.minimumLogLevel}log(e,a){this._logger&&this.shouldLog(e)&&this._logger.log(e,a)}},R5={explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:et,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:void 0,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:void 0,attrValueProcessors:void 0,tagNameProcessors:void 0,valueProcessors:void 0,rootName:"root",xmldec:{version:"1.0", Line truncated
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1},fd=Object.assign({},R5);fd.explicitArray=!1;var Os=Object.assign({},R5);Os.explicitArray=!1;Os.renderOpts={pretty:!1};function w1(t,e={}){var a;return Os.rootName=e.rootName,Os.charkey=(a=e.xmlCharKey)!==null&&a!==void 0?a:ei,new x5.Builder(Os).buildObject(t)}function D5(t,e={}){var a;fd.explicitRoot=!!e.includeRoot,fd.charkey=(a=e.xmlCharKey)!==null&&a!==void 0?a:ei;let i=new x5.Parser(fd);return new Promise((r,n)=>{t?i.parseString(t,(s,o)=>{s?n(s):r(o)}):n(new Error("Document is empty"))})}function $1(t,e){return{create:(a,i)=>new N1(a,i,t,e)}}var I5=["application/json","text/json"],B5=["application/xml","application/atom+xml"],YP={expectedContentTypes:{json:I5,xml:B5}},N1=class extends tt{constructor(e,a,i,r={}){var n;super(e,a),this.jsonContentTypes=i&&i.json||I5,this.xmlContentTypes=i&&i.xml||B5,this.xmlCharKey=(n=r.xmlCharKey)!==null&&n!==void 0?n:ei}async sendRequest(e){return this._nextPolicy.sendRequest(e).then(a=>A5(this.jsonContentTypes,this.xmlContentTypes,a,{xmlCharKey:this.xmlCharKey}))}};function ZP(t){let e,a=t.request,i=a.operationSpec;if(i){let r=a.operationResponseGetter;r?e=r(i,t):e=i.responses[t.status]}return e}function JP(t){let e=t.request.shouldDeserialize,a;return e===void 0?a=!0:typeof e=="boolean"?a=e:a=e(t),a}function A5(t,e,a,i={}){var r,n,s;let o={rootName:(r=i.rootName)!==null&&r!==void 0?r:"",includeRoot:(n=i.includeRoot)!==null&&n!==void 0?n:!1,xmlCharKey:(s=i.xmlCharKey)!==null&&s!==void 0?s:ei};return aO(t,e,a,o).then(p=>{if(!JP(p))return p;let d=p.request.operationSpec;if(!d||!d.responses)return p;let l=ZP(p),{error:c,shouldReturnResponse:m}=tO(p,d,l);if(c)throw c;if(m)return p;if(l){if(l.bodyMapper){let u=p.parsedBody;d.isXML&&l.bodyMapper.type.name===lr.Sequence&&(u=typeof u=="object"?u[l.bodyMapper.xmlElementName]:[]);try{p.parsedBody=d.serializer.deserialize(l.bodyMapper,u,"operationRes.parsedBody",i)}catch(h){throw new Ft(`Error ${h} occurred in deserializing the responseBody - ${p.bodyAsText}`,void 0,p.status,p.request,p)}}else d.httpMethod==="HEAD"&&(p.parsedBody=a.status>=200&&a.status<300);l.headersMapper&&(p.parsedHeaders=d.serializer.deserialize(l.headersMapper,p.headers.toJson(),"operationRes.parsedHeaders",i))}return p})}function eO(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}function tO(t,e,a){var i;let r=200<=t.status&&t.status<300;if(eO(e)?r:!!a)if(a){if(!a.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let s=a??e.responses.default,p=((i=t.request.streamResponseStatusCodes)===null||i===void 0?void 0:i.has(t.status))||t.request.streamResponseBody?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new Ft(p,void 0,t.status,t.request,t);if(!s)throw d;let l=s.bodyMapper,c=s.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,u;if(l){let v=m;e.isXML&&l.type.name===lr.Sequence&&(v=typeof m=="object"?m[l.xmlElementName]:[]),u=e.serializer.deserialize(l,v,"error.response.parsedBody")}let h=m.error||u||m;d.code=h.code,h.message&&(d.message=h.message),l&&(d.response.parsedBody=u)}t.headers&&c&&(d.response.parsedHeaders=e.serializer.deserialize(c,t.headers.toJson(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}function aO(t,e,a,i){var r;let n=o=>{let p=`Error "${o}" occurred while parsing the response body - ${a.bodyAsText}.`,d=o.code||Ft.PARSE_ERROR,l=new Ft(p,d,a.status,a.request,a);return Promise.reject(l)};if(!(((r=a.request.streamResponseStatusCodes)===null||r===void 0?void 0:r.has(a.status))||a.request.streamResponseBody)&&a.bodyAsText){let o=a.bodyAsText,p=a.headers.get("Content-Type")||"",d=p?p.split(";").map(l=>l.toLowerCase()):[];if(d.length===0||d.some(l=>t.indexOf(l)!==-1))return new Promise(l=>{a.parsedBody=JSON.parse(o),l(a)}).catch(n);if(d.some(l=>e.indexOf(l)!==-1))return D5(o,i).then(l=>(a.parsedBody=l,a)).catch(n)}return Promise.resolve(a)}var z5={enable:!0};function M5(t){return{create:(e,a)=>new _1(e,a,t||z5)}}var _1=class extends tt{constructor(e,a,i){super(e,a),this.keepAliveOptions=i}async sendRequest(e){return e.keepAlive=this.keepAliveOptions.enable,this._nextPolicy.sendRequest(e)}},c5=["GET","HEAD"],iO={handleRedirects:!0,maxRetries:20};function G1(t=20){return{create:(e,a)=>new S1(e,a,t)}}var S1=class extends tt{constructor(e,a,i=20){super(e,a),this.maxRetries=i}sendRequest(e){return this._nextPolicy.sendRequest(e).then(a=>q5(this,a,0))}};function q5(t,e,a){let{request:i,status:r}=e,n=e.headers.get("location");if(n&&(r===300||r===301&&c5.includes(i.method)||r===302&&c5.includes(i.method)||r===303&&i.method==="POST"||r===307)&&(!t.maxRetries||a<t.maxRetries)){let s=Ma.parse(i.url);return s.setPath(n),i.url=s.toString(),r===303&&(i.method="GET",delete i.body),t._nextPolicy.sendRequest(i).then(o=>q5(t,o,a+1))}return Promise.resolve(e)}var X1=3 Line truncated
`).join(""))}return this._nextPolicy.sendRequest(e)}},F5=[],V5=!1,gO=new Map;function yO(){if(!process)return;let t=ud(na.HTTPS_PROXY),e=ud(na.ALL_PROXY),a=ud(na.HTTP_PROXY);return t||e||a}function vO(t,e,a){if(e.length===0)return!1;let i=Ma.parse(t).getHost();if(a?.has(i))return a.get(i);let r=!1;for(let n of e)n[0]==="."?(i.endsWith(n)||i.length===n.length-1&&i===n.slice(1))&&(r=!0):i===n&&(r=!0);return a?.set(i,r),r}function xO(){let t=ud(na.NO_PROXY);return V5=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}function $5(t){if(!t&&(t=yO(),!t))return;let{username:e,password:a,urlWithoutAuth:i}=bO(t),r=Ma.parse(i);return{host:(r.getScheme()?r.getScheme()+"://":"")+r.getHost(),port:Number.parseInt(r.getPort()||"80"),username:e,password:a}}function eu(t,e){return t||(t=$5()),V5||F5.push(...xO()),{create:(a,i)=>new I1(a,i,t,e?.customNoProxyList)}}function bO(t){let e=t.indexOf("@");if(e===-1)return{urlWithoutAuth:t};let a=t.indexOf("://"),i=a!==-1?a+3:0,r=t.substring(i,e),n=r.indexOf(":"),s=n!==-1,o=s?r.substring(0,n):r,p=s?r.substring(n+1):void 0,d=t.substring(0,i)+t.substring(e+1);return{username:o,password:p,urlWithoutAuth:d}}var I1=class extends tt{constructor(e,a,i,r){super(e,a),this.proxySettings=i,this.customNoProxyList=r}sendRequest(e){var a;return!e.proxySettings&&!vO(e.url,(a=this.customNoProxyList)!==null&&a!==void 0?a:F5,this.customNoProxyList?void 0:gO)&&(e.proxySettings=this.proxySettings),this._nextPolicy.sendRequest(e)}};function wO(t=30){return{create:(e,a)=>new B1(e,a,t)}}var B1=class extends tt{constructor(e,a,i=30){super(e,a),this._retryTimeout=i}sendRequest(e){return this._nextPolicy.sendRequest(e.clone()).then(a=>NO(this,e,a))}};function NO(t,e,a){if(a.status===409){let i=_O(a.bodyAsText);if(i){let r=SO(e.url);return EO(t,r,i,e).catch(()=>!1).then(n=>n?(e.headers.set("x-ms-client-request-id",_d()),t._nextPolicy.sendRequest(e.clone())):a)}}return Promise.resolve(a)}function G5(t,e=!1){let a=t.clone();return e&&(a.url=t.url),a.headers.set("x-ms-client-request-id",_d()),a.headers.set("Content-Type","application/json; charset=utf-8"),a}function _O(t){let e,a;if(t){try{a=JSON.parse(t)}catch{}if(a&&a.error&&a.error.message&&a.error.code&&a.error.code==="MissingSubscriptionRegistration"){let i=a.error.message.match(/.*'(.*)'/i);i&&(e=i.pop())}}return e}function SO(t){let e,a=t.match(/.*\/subscriptions\/[a-f0-9-]+\//gi);if(a&&a[0])e=a[0];else throw new Error(`Unable to extract subscriptionId from the given url - ${t}.`);return e}async function EO(t,e,a,i){let r=`${e}providers/${a}/register?api-version=2016-02-01`,n=`${e}providers/${a}?api-version=2016-02-01`,s=G5(i);if(s.method="POST",s.url=r,(await t._nextPolicy.sendRequest(s)).status!==200)throw new Error(`Autoregistration of ${a} failed. Please try registering manually.`);return X5(t,n,i)}async function X5(t,e,a){let i=G5(a);i.url=e,i.method="GET";let r=await t._nextPolicy.sendRequest(i),n=r.parsedBody;return r.parsedBody&&n.registrationState&&n.registrationState==="Registered"?!0:(await za.delay(t._retryTimeout*1e3),X5(t,e,a))}function W5(t){return{create:(e,a)=>new A1(e,a,t)}}var A1=class extends tt{constructor(e,a,i){super(e,a),this.authenticationProvider=i}signRequest(e){return this.authenticationProvider.signRequest(e)}sendRequest(e){return this.signRequest(e).then(a=>this._nextPolicy.sendRequest(a))}};function tu(t,e,a,i){return{create:(r,n)=>new z1(r,n,t,e,a,i)}}var z1=class extends tt{constructor(e,a,i,r,n,s){super(e,a),this.retryCount=dr(i)?i:X1,this.retryInterval=dr(r)?r:W1,this.minRetryInterval=dr(n)?n:rO,this.maxRetryInterval=dr(s)?s:K1}sendRequest(e){return this._nextPolicy.sendRequest(e.clone()).catch(a=>K5(this,e,a.response,a))}};async function K5(t,e,a,i,r){r=j5(t,r,i);function n(s,o){return!!(o&&o.code&&(o.code==="ETIMEDOUT"||o.code==="ESOCKETTIMEDOUT"||o.code==="ECONNREFUSED"||o.code==="ECONNRESET"||o.code==="ENOENT"))}if(L5(t.retryCount,n,r,a,i))try{return await za.delay(r.retryInterval),t._nextPolicy.sendRequest(e.clone())}catch(s){return K5(t,e,a,s,r)}else return i?Promise.reject(r.error):a}var CO=3,m5=na.HttpConstants.StatusCodes;function au(){return{create:(t,e)=>new M1(t,e)}}var u5="The operation was aborted.",M1=class t extends tt{constructor(e,a,i){super(e,a),this.numberOfRetries=0,this._handleResponse=i||this._defaultResponseHandler}async sendRequest(e){let a=await this._nextPolicy.sendRequest(e.clone());return a.status!==m5.TooManyRequests&&a.status!==m5.ServiceUnavailable?a:this._handleResponse(e,a)}async _defaultResponseHandler(e,a){var i;let r=a.headers.get(na.HeaderConstants.RETRY_AFTER);if(r){let n=t.parseRetryAfterHeader(r);if(n){if(this.numberOfRetries+=1,await za.delay(n,{abortSignal:e.abortSignal,abortErrorMsg:u5}),!((i=e.abortSignal)===null||i===void 0)&&i.aborted)throw new md.AbortError(u5);return this.numberOfRetries<CO?this.sendRequest(e):this._nextPolicy.sendRequest(e)}}return a}static parseRetryAfterHeader(e){let a=Number(e);return Number.isNaN(a)?t.parseDateRetryAfterHeader(e):a*1e3}static Line truncated
Polling from: ${a.config.operationLocation}
Operation status: ${l}
Polling status: ${r8.includes(l)?"Stopped":"Running"}`),l==="succeeded"){let c=s(d,a);if(c!==void 0)return{response:await e(c).catch(a8({state:a,stateProxy:i,isOperationError:o})),status:l}}return{response:d,status:l}}async function p8(t){let{poll:e,state:a,stateProxy:i,options:r,getOperationStatus:n,getResourceLocation:s,getOperationLocation:o,isOperationError:p,withOperationLocation:d,getPollingInterval:l,processResult:c,getError:m,updateState:u,setDelay:h,isDone:v,setErrorAsResult:E}=t,{operationLocation:S}=a.config;if(S!==void 0){let{response:R,status:b}=await FO({poll:e,getOperationStatus:n,state:a,stateProxy:i,operationLocation:S,getResourceLocation:s,isOperationError:p,options:r});if(s8({status:b,response:R,state:a,stateProxy:i,isDone:v,processResult:c,getError:m,setErrorAsResult:E}),!r8.includes(b)){let g=l?.(R);g&&h(g);let f=o?.(R,a);if(f!==void 0){let N=S!==f;a.config.operationLocation=f,d?.(f,N)}else d?.(S,!1)}u?.(a,R)}}function d8(t){let{azureAsyncOperation:e,operationLocation:a}=t;return a??e}function l8(t){return t.headers.location}function c8(t){return t.headers["operation-location"]}function m8(t){return t.headers["azure-asyncoperation"]}function VO(t){var e;let{location:a,requestMethod:i,requestPath:r,resourceLocationConfig:n}=t;switch(i){case"PUT":return r;case"DELETE":return;case"PATCH":return(e=s())!==null&&e!==void 0?e:r;default:return s()}function s(){switch(n){case"azure-async-operation":return;case"original-uri":return r;case"location":default:return a}}}function u8(t){let{rawResponse:e,requestMethod:a,requestPath:i,resourceLocationConfig:r}=t,n=c8(e),s=m8(e),o=d8({operationLocation:n,azureAsyncOperation:s}),p=l8(e),d=a?.toLocaleUpperCase();return o!==void 0?{mode:"OperationLocation",operationLocation:o,resourceLocation:VO({requestMethod:d,location:p,requestPath:i,resourceLocationConfig:r})}:p!==void 0?{mode:"ResourceLocation",operationLocation:p}:d==="PUT"&&i?{mode:"Body",operationLocation:i}:void 0}function f8(t){let{status:e,statusCode:a}=t;if(typeof e!="string"&&e!==void 0)throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${e}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);switch(e?.toLocaleLowerCase()){case void 0:return su(a);case"succeeded":return"succeeded";case"failed":return"failed";case"running":case"accepted":case"started":case"canceling":case"cancelling":return"running";case"canceled":case"cancelled":return"canceled";default:return mr.verbose(`LRO: unrecognized operation status: ${e}`),e}}function $O(t){var e;let{status:a}=(e=t.body)!==null&&e!==void 0?e:{};return f8({status:a,statusCode:t.statusCode})}function GO(t){var e,a;let{properties:i,provisioningState:r}=(e=t.body)!==null&&e!==void 0?e:{},n=(a=i?.provisioningState)!==null&&a!==void 0?a:r;return f8({status:n,statusCode:t.statusCode})}function su(t){return t===202?"running":t<300?"succeeded":"failed"}function h8({rawResponse:t}){let e=t.headers["retry-after"];if(e!==void 0){let a=parseInt(e);return isNaN(a)?XO(new Date(e)):a*1e3}}function g8(t){let e=t.flatResponse.error;if(!e){mr.warning("The long-running operation failed but there is no error property in the response's body");return}if(!e.code||!e.message){mr.warning("The long-running operation failed but the error property in the response's body doesn't contain code or message");return}return e}function XO(t){let e=Math.floor(new Date().getTime()),a=t.getTime();if(e<a)return a-e}function y8(t){let{response:e,state:a,operationLocation:i}=t;function r(){var s;switch((s=a.config.metadata)===null||s===void 0?void 0:s.mode){case void 0:return su(e.rawResponse.statusCode);case"Body":return ou(e,a);default:return"running"}}let n=r();return n==="running"&&i===void 0?"succeeded":n}async function WO(t){let{stateProxy:e,resourceLocationConfig:a,processResult:i,lro:r,setErrorAsResult:n}=t;return o8({init:async()=>{let s=await r.sendInitialRequest(),o=u8({rawResponse:s.rawResponse,requestPath:r.requestPath,requestMethod:r.requestMethod,resourceLocationConfig:a});return Object.assign({response:s,operationLocation:o?.operationLocation,resourceLocation:o?.resourceLocation},o?.mode?{metadata:{mode:o.mode}}:{})},stateProxy:e,processResult:i?({flatResponse:s},o)=>i(s,o):({flatResponse:s})=>s,getOperationStatus:y8,setErrorAsResult:n})}function v8({rawResponse:t},e){var a;switch((a=e.config.metadata)===null||a===void 0?void 0:a.mode){case"OperationLocation":return d8({operationLocation:c8(t),azureAsyncOperation:m8(t)});case"ResourceLocation":return l8(t);case"Body":default:return}}function ou({rawResponse:t},e){var a;let i=(a=e.config.metadata)===null||a===void 0?void 0:a.mode;switch(i){case"OperationLocation":return $O(t);case"ResourceLocation":return su(t.statusCode);case"Body":return GO(t);default:throw new Error(`Internal error: Unexpected operation mode: ${i}`)}}function x8({flatResponse:t},e){if(typeof t=="object"){let a=t.resLine truncated
`,av="HTTP/1.1",QI="AES256",YI="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;",ZI=["Access-Control-Allow-Origin","Cache-Control","Content-Length","Content-Type","Date","Request-Id","traceparent","Transfer-Encoding","User-Agent","x-ms-client-request-id","x-ms-date","x-ms-error-code","x-ms-request-id","x-ms-return-client-request-id","x-ms-version","Accept-Ranges","Content-Disposition","Content-Encoding","Content-Language","Content-MD5","Content-Range","ETag","Last-Modified","Server","Vary","x-ms-content-crc64","x-ms-copy-action","x-ms-copy-completion-time","x-ms-copy-id","x-ms-copy-progress","x-ms-copy-status","x-ms-has-immutability-policy","x-ms-has-legal-hold","x-ms-lease-state","x-ms-lease-status","x-ms-range","x-ms-request-server-encrypted","x-ms-server-encrypted","x-ms-snapshot","x-ms-source-range","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","x-ms-access-tier","x-ms-access-tier-change-time","x-ms-access-tier-inferred","x-ms-account-kind","x-ms-archive-status","x-ms-blob-append-offset","x-ms-blob-cache-control","x-ms-blob-committed-block-count","x-ms-blob-condition-appendpos","x-ms-blob-condition-maxsize","x-ms-blob-content-disposition","x-ms-blob-content-encoding","x-ms-blob-content-language","x-ms-blob-content-length","x-ms-blob-content-md5","x-ms-blob-content-type","x-ms-blob-public-access","x-ms-blob-sequence-number","x-ms-blob-type","x-ms-copy-destination-snapshot","x-ms-creation-time","x-ms-default-encryption-scope","x-ms-delete-snapshots","x-ms-delete-type-permanent","x-ms-deny-encryption-scope-override","x-ms-encryption-algorithm","x-ms-if-sequence-number-eq","x-ms-if-sequence-number-le","x-ms-if-sequence-number-lt","x-ms-incremental-copy","x-ms-lease-action","x-ms-lease-break-period","x-ms-lease-duration","x-ms-lease-id","x-ms-lease-time","x-ms-page-write","x-ms-proposed-lease-id","x-ms-range-get-content-md5","x-ms-rehydrate-priority","x-ms-sequence-number-action","x-ms-sku-name","x-ms-source-content-md5","x-ms-source-if-match","x-ms-source-if-modified-since","x-ms-source-if-none-match","x-ms-source-if-unmodified-since","x-ms-tag-count","x-ms-encryption-key-sha256","x-ms-if-tags","x-ms-source-if-tags"],JI=["comp","maxresults","rscc","rscd","rsce","rscl","rsct","se","si","sip","sp","spr","sr","srt","ss","st","sv","include","marker","prefix","copyid","restype","blockid","blocklisttype","delimiter","prevsnapshot","ske","skoid","sks","skt","sktid","skv","snapshot"],eB="BlobUsesCustomerSpecifiedEncryption",tB="BlobDoesNotUseCustomerSpecifiedEncryption",aB=["10000","10001","10002","10003","10004","10100","10101","10102","10103","10104","11000","11001","11002","11003","11004","11100","11101","11102","11103","11104"];function iB(t){let e=M.URLBuilder.parse(t),a=e.getPath();return a=a||"/",a=nB(a),e.setPath(a),e.toString()}function rB(t){let e="";if(t.search("DevelopmentStorageProxyUri=")!==-1){let a=t.split(";");for(let i of a)i.trim().startsWith("DevelopmentStorageProxyUri=")&&(e=i.trim().match("DevelopmentStorageProxyUri=(.*)")[1])}return e}function nn(t,e){let a=t.split(";");for(let i of a)if(i.trim().startsWith(e))return i.trim().match(e+"=(.*)")[1];return""}function En(t){let e="";t.startsWith("UseDevelopmentStorage=true")&&(e=rB(t),t=YI);let a=nn(t,"BlobEndpoint");if(a=a.endsWith("/")?a.slice(0,-1):a,t.search("DefaultEndpointsProtocol=")!==-1&&t.search("AccountKey=")!==-1){let i="",r="",n=Buffer.from("accountKey","base64"),s="";if(r=nn(t,"AccountName"),n=Buffer.from(nn(t,"AccountKey"),"base64"),!a){i=nn(t,"DefaultEndpointsProtocol");let o=i.toLowerCase();if(o!=="https"&&o!=="http")throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");if(s=nn(t,"EndpointSuffix"),!s)throw new Error("Invalid EndpointSuffix in the provided Connection String");a=`${i}://${r}.blob.${s}`}if(r){if(n.length===0)throw new Error("Invalid AccountKey in the provided Connection String")}else throw new Error("Invalid AccountName in the provided Connection String");return{kind:"AccountConnString",url:a,accountName:r,accountKey:n,proxyUri:e}}else{let i=nn(t,"SharedAccessSignature"),r=rv(a);if(a){if(!i)throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String")}else throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");return{kind:"SASConnString",url:a,accountName:r,accountSas:i}}}function nB(t){return encodeURIComponent(t).replace(/%2F/g,"/").replace(/'/g,"%27").replace(/\+/g,"%20").replace(/%25/g,"%")}function ze(t,e){let a=M.URLBuilder.parse(t),i=a.getPath();return i=i?i.endsWith("/")?`${i}${e}`:`${i}/${e}`:e,a.setPath(i),new URL(a.toString()).toString()}function vr(t,e,a){let i=M.URLBuilder.parse(t);return i.setQueryParameter(e,a),i.toString()}function _8(t,e){return M.URLBuilder.parse(t).getQueryParameterValue(e)}function sB(t,e Line truncated
`)+`
`+this.getCanonicalizedHeadersString(e)+this.getCanonicalizedResourceString(e),i=this.factory.computeHMACSHA256(a);return e.headers.set(Re.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${i}`),e}getHeaderValueToSign(e,a){let i=e.headers.get(a);return!i||a===Re.CONTENT_LENGTH&&i==="0"?"":i}getCanonicalizedHeadersString(e){let a=e.headers.headersArray().filter(r=>r.name.toLowerCase().startsWith(Re.PREFIX_FOR_STORAGE));a.sort((r,n)=>r.name.toLowerCase().localeCompare(n.name.toLowerCase())),a=a.filter((r,n,s)=>!(n>0&&r.name.toLowerCase()===s[n-1].name.toLowerCase()));let i="";return a.forEach(r=>{i+=`${r.name.toLowerCase().trimRight()}:${r.value.trimLeft()}
`}),i}getCanonicalizedResourceString(e){let a=c0(e.url)||"/",i="";i+=`/${this.factory.accountName}${a}`;let r=dB(e.url),n={};if(r){let s=[];for(let o in r)if(Object.prototype.hasOwnProperty.call(r,o)){let p=o.toLowerCase();n[p]=r[o],s.push(p)}s.sort();for(let o of s)i+=`
${o}:${decodeURIComponent(n[o])}`}return i}},Ve=class extends js{constructor(e,a){super(),this.accountName=e,this.accountKey=Buffer.from(a,"base64")}create(e,a){return new Hd(e,a,this)}computeHMACSHA256(e){return z8.createHmac("sha256",this.accountKey).update(e,"utf8").digest("base64")}},SB="azure-storage-blob",EB="12.15.0",Hs=class extends H.ServiceClient{constructor(e,a){if(e===void 0)throw new Error("'url' cannot be null");if(a||(a={}),!a.userAgent){let i=H.getDefaultUserAgentValue();a.userAgent=`${SB}/${EB} ${i}`}super(void 0,a),this.requestContentType="application/json; charset=utf-8",this.baseUri=a.endpoint||"{url}",this.url=e,this.version=a.version||"2023-01-03"}},Us=class{constructor(e,a){this.url=iB(e),this.accountName=rv(e),this.pipeline=a,this.storageClientContext=new Hs(this.url,a.toServiceClientOptions()),this.isHttps=iv(oB(this.url)||"","https"),this.credential=new Te;for(let r of this.pipeline.factories)M.isNode&&r instanceof Ve||r instanceof Te?this.credential=r:M.isTokenCredential(r.credential)&&(this.credential=r.credential);let i=this.storageClientContext;i.requestContentType=void 0}},L=q.createSpanFunction({packagePrefix:"Azure.Storage.Blob",namespace:"Microsoft.Storage"});function G(t){var e,a;return{spanOptions:(e=t?.tracingOptions)===null||e===void 0?void 0:e.spanOptions,tracingContext:(a=t?.tracingOptions)===null||a===void 0?void 0:a.tracingContext}}var ii=class t{constructor(){this.read=!1,this.add=!1,this.create=!1,this.write=!1,this.delete=!1,this.deleteVersion=!1,this.tag=!1,this.move=!1,this.execute=!1,this.setImmutabilityPolicy=!1,this.permanentDelete=!1}static parse(e){let a=new t;for(let i of e)switch(i){case"r":a.read=!0;break;case"a":a.add=!0;break;case"c":a.create=!0;break;case"w":a.write=!0;break;case"d":a.delete=!0;break;case"x":a.deleteVersion=!0;break;case"t":a.tag=!0;break;case"m":a.move=!0;break;case"e":a.execute=!0;break;case"i":a.setImmutabilityPolicy=!0;break;case"y":a.permanentDelete=!0;break;default:throw new RangeError(`Invalid permission: ${i}`)}return a}static from(e){let a=new t;return e.read&&(a.read=!0),e.add&&(a.add=!0),e.create&&(a.create=!0),e.write&&(a.write=!0),e.delete&&(a.delete=!0),e.deleteVersion&&(a.deleteVersion=!0),e.tag&&(a.tag=!0),e.move&&(a.move=!0),e.execute&&(a.execute=!0),e.setImmutabilityPolicy&&(a.setImmutabilityPolicy=!0),e.permanentDelete&&(a.permanentDelete=!0),a}toString(){let e=[];return this.read&&e.push("r"),this.add&&e.push("a"),this.create&&e.push("c"),this.write&&e.push("w"),this.delete&&e.push("d"),this.deleteVersion&&e.push("x"),this.tag&&e.push("t"),this.move&&e.push("m"),this.execute&&e.push("e"),this.setImmutabilityPolicy&&e.push("i"),this.permanentDelete&&e.push("y"),e.join("")}},ri=class t{constructor(){this.read=!1,this.add=!1,this.create=!1,this.write=!1,this.delete=!1,this.deleteVersion=!1,this.list=!1,this.tag=!1,this.move=!1,this.execute=!1,this.setImmutabilityPolicy=!1,this.permanentDelete=!1,this.filterByTags=!1}static parse(e){let a=new t;for(let i of e)switch(i){case"r":a.read=!0;break;case"a":a.add=!0;break;case"c":a.create=!0;break;case"w":a.write=!0;break;case"d":a.delete=!0;break;case"l":a.list=!0;break;case"t":a.tag=!0;break;case"x":a.deleteVersion=!0;break;case"m":a.move=!0;break;case"e":a.execute=!0;break;case"i":a.setImmutabilityPolicy=!0;break;case"y":a.permanentDelete=!0;break;case"f":a.filterByTags=!0;break;default:throw new RangeError(`Invalid permission ${i}`)}return a}static from(e){let a=new t;return e.read&&(a.read=!0),e.add&&(a.add=!0),e.create&&(a.create=!0),e.write&&(a.write=!0),e.delete&&(a.delete=!0),e.list&&(a.list=!0),e.deleteVersion&&(a.deleteVersion=!0),e.tag&&(a.tag=!0),e.move&&(a.move=!0),e.execute&&(a.execute=!0),e.setImmutabilityPolicy&&(a.setImmutabilityPolicy=!0),e.permanentDelete&&(a.permanentDelete=!0),e.filterByTags&&(a.filterByTags=!0),a}toString(){let e=[];return this.read&&e.push("r"),this.add&&e.push("a"),this.create&&e.push("c"),this.write&&e.push("w"),this.delete&&e.push("d"),this.deleteVersion&&e.push("x"),this.list&&e.push("l"),this.tag&&e.push("t"),this.move&&e.push("m"),this.execute&&e.push("e"),this.setImmutabilityPolicy&&e.push("i"),this.permanentDelete&&e.push("y"),this.filterByTags&&e.push("f"),e.join("")}},Nu=class{constructor(e,a){this.accountName=e,this.userDelegationKey=a,this.key=Buffer.from(a.value,"base64")}computeHMACSHA256(e){return z8.createHmac("sha256",this.key).update(e,"utf8").digest("base64")}};function ni(t){return t.end?`${t.start}-${t.end}`:t.start}Y.SASProtocol=void 0;(function(t){t.Https="https",t.HttpsAndHttp="https,http"})(Y.SASProtocol||(Y.SASProtocol={}));var La=class{constructor(e,a,i,r,n,s,o,p,d,l,c,m,u,h,v,E,S,R,b,g){this.version=e,this.signature=a,i!==void 0&&typeof i!="string"?(this.permissions=i.permissions,this.services=i.services,this.resourceTypes=i.resourceTypes,this.protocol=i.protocol,this.startsOn=i.startsOn,this.expiresOn=i.expiresOn,this.ipRangeInner=i.ipRange,this.identifier=i.identifier,this.encryptionScope=i.encryptionSco Line truncated
`),n=e.computeHMACSHA256(r);return new La(t.version,n,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,a,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType)}function TB(t,e){if(t=Tn(t),!t.identifier&&!(t.permissions&&t.expiresOn))throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let a="c",i=t.snapshotTime;t.blobName&&(a="b",t.snapshotTime?a="bs":t.versionId&&(a="bv",i=t.versionId));let r;t.permissions&&(t.blobName?r=ii.parse(t.permissions.toString()).toString():r=ri.parse(t.permissions.toString()).toString());let n=[r||"",t.startsOn?Ne(t.startsOn,!1):"",t.expiresOn?Ne(t.expiresOn,!1):"",Cn(e.accountName,t.containerName,t.blobName),t.identifier,t.ipRange?ni(t.ipRange):"",t.protocol?t.protocol:"",t.version,a,i,t.cacheControl?t.cacheControl:"",t.contentDisposition?t.contentDisposition:"",t.contentEncoding?t.contentEncoding:"",t.contentLanguage?t.contentLanguage:"",t.contentType?t.contentType:""].join(`
`),s=e.computeHMACSHA256(n);return new La(t.version,s,r,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,a,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType)}function PB(t,e){if(t=Tn(t),!t.identifier&&!(t.permissions&&t.expiresOn))throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let a="c",i=t.snapshotTime;t.blobName&&(a="b",t.snapshotTime?a="bs":t.versionId&&(a="bv",i=t.versionId));let r;t.permissions&&(t.blobName?r=ii.parse(t.permissions.toString()).toString():r=ri.parse(t.permissions.toString()).toString());let n=[r||"",t.startsOn?Ne(t.startsOn,!1):"",t.expiresOn?Ne(t.expiresOn,!1):"",Cn(e.accountName,t.containerName,t.blobName),t.identifier,t.ipRange?ni(t.ipRange):"",t.protocol?t.protocol:"",t.version,a,i,t.encryptionScope,t.cacheControl?t.cacheControl:"",t.contentDisposition?t.contentDisposition:"",t.contentEncoding?t.contentEncoding:"",t.contentLanguage?t.contentLanguage:"",t.contentType?t.contentType:""].join(`
`),s=e.computeHMACSHA256(n);return new La(t.version,s,r,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,a,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,void 0,void 0,void 0,t.encryptionScope)}function OB(t,e){if(t=Tn(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let a="c",i=t.snapshotTime;t.blobName&&(a="b",t.snapshotTime?a="bs":t.versionId&&(a="bv",i=t.versionId));let r;t.permissions&&(t.blobName?r=ii.parse(t.permissions.toString()).toString():r=ri.parse(t.permissions.toString()).toString());let n=[r||"",t.startsOn?Ne(t.startsOn,!1):"",t.expiresOn?Ne(t.expiresOn,!1):"",Cn(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Ne(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Ne(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.ipRange?ni(t.ipRange):"",t.protocol?t.protocol:"",t.version,a,i,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),s=e.computeHMACSHA256(n);return new La(t.version,s,r,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,a,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey)}function RB(t,e){if(t=Tn(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let a="c",i=t.snapshotTime;t.blobName&&(a="b",t.snapshotTime?a="bs":t.versionId&&(a="bv",i=t.versionId));let r;t.permissions&&(t.blobName?r=ii.parse(t.permissions.toString()).toString():r=ri.parse(t.permissions.toString()).toString());let n=[r||"",t.startsOn?Ne(t.startsOn,!1):"",t.expiresOn?Ne(t.expiresOn,!1):"",Cn(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Ne(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Ne(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,t.ipRange?ni(t.ipRange):"",t.protocol?t.protocol:"",t.version,a,i,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),s=e.computeHMACSHA256(n);return new La(t.version,s,r,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,a,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId)}function DB(t,e){if(t=Tn(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let a="c",i=t.snapshotTime;t.blobName&&(a="b",t.snapshotTime?a="bs":t.versionId&&(a="bv",i=t.versionId));let r;t.permissions&&(t.blobName?r=ii.parse(t.permissions.toString()).toString():r=ri.parse(t.permissions.toString()).toString());let n=[r||"",t.startsOn?Ne(t.startsOn,!1):"",t.expiresOn?Ne(t.expiresOn,!1):"",Cn(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Ne(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Ne(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,t.ipRange?ni(t.ipRange):"",t.protocol?t.protocol:"",t.version,a,i,t.encryptionScope,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),s=e.computeHMACSHA256(n);return new La(t.version,s,r,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,a,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId,t.encryptionScope)}function Cn(t,e,a){let i=[`/blob/${t}/${e}`];return a&&i.push(`/${a}`),i.join("")}function Tn(t){let e=t.version?t.version:d0;if(t.snapshotTime&&e<"2018-11-09")throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.");if(t.blobName===void 0&&t.snapshotTime)throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.");if(t.versionId&&e<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.");if(t.blobName===void 0&&t.versionId)throw RangeError("Must provide 'blobName' when providing 'versionId'.");if(t.permissions&&t.permissions.setImmutabilityPolicy&&e<"2020-08-04")throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.");if(t.permissions&&t.permissions.deleteVersion&&e<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");if(t.permissions&&t.permissions.permanentDelete&&e<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");if(t.permissions&&t.permissions.tag&&e<"2019-12-12")throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.");if(e<"2020-02-10"&&t.permissions&&(t.permissions.move||t.permissions.execute))throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");if(e<"2021-04-10"&&t.permissions&&t.permissions.filterByTags)throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");if(e<"2020-02-10"&&(t.preauthorizedAgentObjectId||t.correlationId))throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");if(t.encryptionScope&&e<"2020-12-06")throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");return t.version=e,t}var Fs=class{constructor(e,a){let i=new Hs(e.url,e.pipeline.toServiceClientOptions());this._url=e.url,e.name===void 0?(this._isContainer=!0,this._containerOrBlobOperation=new yr(i)):(this._isContainer=!1,this._containerOrBlobOperation=new Ms(i)),a||(a=M.generateUuid()),this._leaseId=a}get leaseId(){return this._leaseId}get url(){return this._url}async acquireLease(e,a={}){var i,r,n,s,o,p;let{span:d,updatedOptions:l}=L("BlobLeaseClient-acquireLease",a);if(this._isContainer&&(!((i=a.conditions)===null||i===void 0)&&i.ifMatch&&((r=a.conditions)===null||r===void 0?void 0:r.ifMatch)!==qa||!((n=a.conditions)===null||n===void 0)&&n.ifNoneMatch&&((s=a.conditions)===null||s===void 0?void 0:s.ifNoneMatch)!==qa||!((o=a.conditions)===null||o===void 0)&&o.tagConditions))throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{return await this._containerOrBlobOperation.acquireLease(Object.assign({abortSignal:a.abortSignal,duration:e,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(p=a.conditions)===null||p===void 0?void 0:p.tagConditions}),proposedLeaseId:this._leaseId},G(l)))}catch(c){throw d.setStatus({code:q.SpanStatusCode.ERROR,message:c.message}),c}finally{d.end()}}async changeLease(e,a={}){var i,r,n,s,o,p;let{span:d,updatedOptions:l}=L("BlobLeaseClient-changeLease",a);if(this._isContainer&&(!((i=a.conditions)===null||i===void 0)&&i.ifMatch&&((r=a.conditions)===null||r===void 0?void 0:r.ifMatch)!==qa||!((n=a.conditions)===null||n===void 0)&&n.ifNoneMatch&&((s=a.conditions)===null||s===void 0?void 0:s.ifNoneMatch)!==qa||!((o=a.conditions)===null||o===void 0)&&o.tagConditions))throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");try{let c=await this._containerOrBlobOperation.changeLease(this._leaseId,e,Object.assign({abortSignal:a.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(p=a.conditions)===null||p===void 0?void 0:p.tagConditions})},G(l)));return this._leaseId=e,c}catch(c){throw d.setStatus({code:q.SpanStatusCode.ERROR,message:c.message}),c}finally{d.end()}}async releaseLease(e={}){var a,i,r,n,s,o;let{span:p,updatedOptions:d}=L("BlobLeaseClient-releaseLease",e);if(this._isContainer&&(!((a=e.conditions)===null||a===void 0)&&a.ifMatch&&((i=e.conditions)===null||i===void 0?void 0:i.ifMatch)!==qa||!((r=e.conditions)===null||r===void 0)&&r.ifNoneMatch&&((n=e.conditions)===null||n===void 0?void 0:n.ifNoneMatch)!==qa||!((s=e.conditions)===null||s===void 0)&&s.tagConditions))throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default v Line truncated
`):s=[e.accountName,i,r,n,t.startsOn?Ne(t.startsOn,!1):"",Ne(t.expiresOn,!1),t.ipRange?ni(t.ipRange):"",t.protocol?t.protocol:"",a,""].join(`
`);let o=e.computeHMACSHA256(s);return new La(a,o,i.toString(),r,n,t.protocol,t.startsOn,t.expiresOn,t.ipRange,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,t.encryptionScope)}var $u=class t extends Us{constructor(e,a,i){let r;Fi(a)?r=a:M.isNode&&a instanceof Ve||a instanceof Te||M.isTokenCredential(a)?r=Oe(a,i):r=Oe(new Te,i),super(e,r),this.serviceContext=new Ad(this.storageClientContext)}static fromConnectionString(e,a){a=a||{};let i=En(e);if(i.kind==="AccountConnString")if(M.isNode){let r=new Ve(i.accountName,i.accountKey);a.proxyOptions||(a.proxyOptions=M.getDefaultProxySettings(i.proxyUri));let n=Oe(r,a);return new t(i.url,n)}else throw new Error("Account connection string is only supported in Node.js environment");else if(i.kind==="SASConnString"){let r=Oe(new Te,a);return new t(i.url+"?"+i.accountSas,r)}else throw new Error("Connection string must be either an Account connection string or a SAS connection string")}getContainerClient(e){return new Fd(ze(this.url,encodeURIComponent(e)),this.pipeline)}async createContainer(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-createContainer",a);try{let n=this.getContainerClient(e),s=await n.create(r);return{containerClient:n,containerCreateResponse:s}}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async deleteContainer(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-deleteContainer",a);try{return await this.getContainerClient(e).delete(r)}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async undeleteContainer(e,a,i={}){let{span:r,updatedOptions:n}=L("BlobServiceClient-undeleteContainer",i);try{let s=this.getContainerClient(i.destinationContainerName||e),p=await new yr(s.storageClientContext).restore(Object.assign({deletedContainerName:e,deletedContainerVersion:a},n));return{containerClient:s,containerUndeleteResponse:p}}catch(s){throw r.setStatus({code:q.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}async renameContainer(e,a,i={}){var r;let{span:n,updatedOptions:s}=L("BlobServiceClient-renameContainer",i);try{let o=this.getContainerClient(a),d=await new yr(o.storageClientContext).rename(e,Object.assign(Object.assign({},s),{sourceLeaseId:(r=i.sourceCondition)===null||r===void 0?void 0:r.leaseId}));return{containerClient:o,containerRenameResponse:d}}catch(o){throw n.setStatus({code:q.SpanStatusCode.ERROR,message:o.message}),o}finally{n.end()}}async getProperties(e={}){let{span:a,updatedOptions:i}=L("BlobServiceClient-getProperties",e);try{return await this.serviceContext.getProperties(Object.assign({abortSignal:e.abortSignal},G(i)))}catch(r){throw a.setStatus({code:q.SpanStatusCode.ERROR,message:r.message}),r}finally{a.end()}}async setProperties(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-setProperties",a);try{return await this.serviceContext.setProperties(e,Object.assign({abortSignal:a.abortSignal},G(r)))}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async getStatistics(e={}){let{span:a,updatedOptions:i}=L("BlobServiceClient-getStatistics",e);try{return await this.serviceContext.getStatistics(Object.assign({abortSignal:e.abortSignal},G(i)))}catch(r){throw a.setStatus({code:q.SpanStatusCode.ERROR,message:r.message}),r}finally{a.end()}}async getAccountInfo(e={}){let{span:a,updatedOptions:i}=L("BlobServiceClient-getAccountInfo",e);try{return await this.serviceContext.getAccountInfo(Object.assign({abortSignal:e.abortSignal},G(i)))}catch(r){throw a.setStatus({code:q.SpanStatusCode.ERROR,message:r.message}),r}finally{a.end()}}async listContainersSegment(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-listContainersSegment",a);try{return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({abortSignal:a.abortSignal,marker:e},a),{include:typeof a.include=="string"?[a.include]:a.include}),G(r)))}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async findBlobsByTagsSegment(e,a,i={}){let{span:r,updatedOptions:n}=L("BlobServiceClient-findBlobsByTagsSegment",i);try{let s=await this.serviceContext.filterBlobs(Object.assign({abortSignal:i.abortSignal,where:e,marker:a,maxPageSize:i.maxPageSize},G(n)));return Object.assign(Object.assign({},s),{_response:s._response,blobs:s.blobs.map(p=>{var d;let l="";return((d=p.tags)===null||d===void 0?void 0:d.blobTagSet.length)===1&&(l=p.tags.blobTagSet[0].value),Object.assign(Object.assign({},p),{tags:Bs(p.tags),tagValue:l})})})}catch(s){throw r.setStatus({code:q.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}findBlobsByTagsSegments(e,a,i={}){return k.__asyncGenerator(this,arguments,function*(){let n;if(a||a===void 0)do n=yield k.__await(this.findBlobsByTagsSegment(e,a,i)),n.blobs=n.blobs||[],a=n.continuationToken,yield yield k.__await(n);while(a)})}findBlobsByTagsItems(e,a={}){return k.__asyncGenerator(this,arguments, Line truncated
Other caches with similar key:`);for(let o of n?.artifactCaches||[])Gt.debug(`Cache Key: ${o?.cacheKey}, Cache Version: ${o?.cacheVersion}, Cache Scope: ${o?.scope}, Cache Created: ${o?.creationTime}`)}}})}function CA(t,e,a){return jt(this,void 0,void 0,function*(){let i=new bA.URL(t),r=(0,vv.getDownloadOptions)(a);i.hostname.endsWith(".blob.core.windows.net")?r.useAzureSdk?yield(0,el.downloadCacheStorageSDK)(t,e,r):r.concurrentBlobDownloads?yield(0,el.downloadCacheHttpClientConcurrent)(t,e,r):yield(0,el.downloadCacheHttpClient)(t,e):yield(0,el.downloadCacheHttpClient)(t,e)})}Qe.downloadCache=CA;function TA(t,e,a){return jt(this,void 0,void 0,function*(){let i=x0(),r=b0(e,a?.compressionMethod,a?.enableCrossOsArchive),n={key:t,version:r,cacheSize:a?.cacheSize};return yield(0,$i.retryTypedResponse)("reserveCache",()=>jt(this,void 0,void 0,function*(){return i.postJson(ao("caches"),n)}))})}Qe.reserveCache=TA;function yv(t,e){return`bytes ${t}-${e}/*`}function PA(t,e,a,i,r){return jt(this,void 0,void 0,function*(){Gt.debug(`Uploading chunk of size ${r-i+1} bytes at offset ${i} with content range: ${yv(i,r)}`);let n={"Content-Type":"application/octet-stream","Content-Range":yv(i,r)},s=yield(0,$i.retryHttpClientResponse)(`uploadChunk (start: ${i}, end: ${r})`,()=>jt(this,void 0,void 0,function*(){return t.sendStream("PATCH",e,a(),n)}));if(!(0,$i.isSuccessStatusCode)(s.message.statusCode))throw new Error(`Cache service responded with ${s.message.statusCode} during upload chunk.`)})}function OA(t,e,a,i){return jt(this,void 0,void 0,function*(){let r=tl.getArchiveFileSizeInBytes(a),n=ao(`caches/${e.toString()}`),s=v0.openSync(a,"r"),o=(0,vv.getUploadOptions)(i),p=tl.assertDefined("uploadConcurrency",o.uploadConcurrency),d=tl.assertDefined("uploadChunkSize",o.uploadChunkSize),l=[...new Array(p).keys()];Gt.debug("Awaiting all uploads");let c=0;try{yield Promise.all(l.map(()=>jt(this,void 0,void 0,function*(){for(;c<r;){let m=Math.min(r-c,d),u=c,h=c+m-1;c+=d,yield PA(t,n,()=>v0.createReadStream(a,{fd:s,start:u,end:h,autoClose:!1}).on("error",v=>{throw new Error(`Cache upload failed because file read failed with ${v.message}`)}),u,h)}})))}finally{v0.closeSync(s)}})}function RA(t,e,a){return jt(this,void 0,void 0,function*(){let i={size:a};return yield(0,$i.retryTypedResponse)("commitCache",()=>jt(this,void 0,void 0,function*(){return t.postJson(ao(`caches/${e.toString()}`),i)}))})}function DA(t,e,a){return jt(this,void 0,void 0,function*(){let i=x0();Gt.debug("Upload cache"),yield OA(i,t,e,a),Gt.debug("Commiting cache");let r=tl.getArchiveFileSizeInBytes(e);Gt.info(`Cache Size: ~${Math.round(r/(1024*1024))} MB (${r} B)`);let n=yield RA(i,t,r);if(!(0,$i.isSuccessStatusCode)(n.statusCode))throw new Error(`Cache service responded with ${n.statusCode} during commit cache.`);Gt.info("Cache saved successfully")})}Qe.saveCache=DA});var Nv=T(_t=>{"use strict";var IA=_t&&_t.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),BA=_t&&_t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w0=_t&&_t.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&IA(e,t,a);return BA(e,t),e},pi=_t&&_t.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(_t,"__esModule",{value:!0});_t.createTar=_t.extractTar=_t.listTar=void 0;var AA=jn(),il=w0(Ln()),bv=require("fs"),Na=w0(require("path")),N0=w0(es()),Ie=Zn(),Gi=process.platform==="win32";function zA(){return pi(this,void 0,void 0,function*(){switch(process.platform){case"win32":{let t=yield N0.getGnuTarPathOnWindows(),e=Ie.SystemTarPathOnWindows;if(t)return{path:t,type:Ie.ArchiveToolType.GNU};if((0,bv.existsSync)(e))return{path:e,type:Ie.ArchiveToolType.BSD};break}case"darwin":{let t=yield il.which("gtar",!1);return t?{path:t,type:Ie.ArchiveToolType.GNU}:{path:yield il.which("tar",!0),type:Ie.ArchiveToolType.BSD}}default:break}return{path:yield il.which("tar",!0),type:Ie.ArchiveToolType.GNU}})}function MA(t,e,a,i=""){return pi(this,void 0,void 0,function*(){let r=[`"${t.path}"`],n=N0.getCacheFileName(e),s="cache.tar",o=wv(),p=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(a){case"create":r.push("--posix","-cf",p?s:n.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"--exclude",p?s:n.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"--f Line truncated
`));let i=yield _0(a,"create");yield S0(i,t)})}_t.createTar=HA});var Tv=T(Ye=>{"use strict";var UA=Ye&&Ye.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),FA=Ye&&Ye.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sl=Ye&&Ye.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&UA(e,t,a);return FA(e,t),e},_v=Ye&&Ye.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.saveCache=Ye.restoreCache=Ye.isFeatureAvailable=Ye.ReserveCacheError=Ye.ValidationError=void 0;var it=sl(wt()),Sv=sl(require("path")),pa=sl(es()),rl=sl(xv()),nl=Nv(),di=class t extends Error{constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}};Ye.ValidationError=di;var io=class t extends Error{constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}};Ye.ReserveCacheError=io;function Ev(t){if(!t||t.length===0)throw new di("Path Validation Error: At least one directory or file path is required")}function Cv(t){if(t.length>512)throw new di(`Key Validation Error: ${t} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(t))throw new di(`Key Validation Error: ${t} cannot contain commas.`)}function VA(){return!!process.env.ACTIONS_CACHE_URL}Ye.isFeatureAvailable=VA;function $A(t,e,a,i,r=!1){return _v(this,void 0,void 0,function*(){Ev(t),a=a||[];let n=[e,...a];if(it.debug("Resolved Keys:"),it.debug(JSON.stringify(n)),n.length>10)throw new di("Key Validation Error: Keys are limited to a maximum of 10.");for(let p of n)Cv(p);let s=yield pa.getCompressionMethod(),o="";try{let p=yield rl.getCacheEntry(n,t,{compressionMethod:s,enableCrossOsArchive:r});if(!p?.archiveLocation)return;if(i?.lookupOnly)return it.info("Lookup only - skipping download"),p.cacheKey;o=Sv.join(yield pa.createTempDirectory(),pa.getCacheFileName(s)),it.debug(`Archive Path: ${o}`),yield rl.downloadCache(p.archiveLocation,o,i),it.isDebug()&&(yield(0,nl.listTar)(o,s));let d=pa.getArchiveFileSizeInBytes(o);return it.info(`Cache Size: ~${Math.round(d/(1024*1024))} MB (${d} B)`),yield(0,nl.extractTar)(o,s),it.info("Cache restored successfully"),p.cacheKey}catch(p){if(p.name===di.name)throw p;it.warning(`Failed to restore: ${p.message}`)}finally{try{yield pa.unlinkFile(o)}catch(p){it.debug(`Failed to delete archive: ${p}`)}}})}Ye.restoreCache=$A;function GA(t,e,a,i=!1){var r,n,s,o,p;return _v(this,void 0,void 0,function*(){Ev(t),Cv(e);let d=yield pa.getCompressionMethod(),l=-1,c=yield pa.resolvePaths(t);if(it.debug("Cache Paths:"),it.debug(`${JSON.stringify(c)}`),c.length===0)throw new Error("Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.");let m=yield pa.createTempDirectory(),u=Sv.join(m,pa.getCacheFileName(d));it.debug(`Archive Path: ${u}`);try{yield(0,nl.createTar)(m,c,d),it.isDebug()&&(yield(0,nl.listTar)(u,d));let h=10*1024*1024*1024,v=pa.getArchiveFileSizeInBytes(u);if(it.debug(`File Size: ${v}`),v>h&&!pa.isGhes())throw new Error(`Cache size of ~${Math.round(v/(1024*1024))} MB (${v} B) is over the 10GB limit, not saving cache.`);it.debug("Reserving Cache");let E=yield rl.reserveCache(e,t,{compressionMethod:d,enableCrossOsArchive:i,cacheSize:v});if(!((r=E?.result)===null||r===void 0)&&r.cacheId)l=(n=E?.result)===null||n===void 0?void 0:n.cacheId;else throw E?.statusCode===400?new Error((o=(s=E?.error)===null||s===void 0?void 0:s.message)!==null&&o!==void 0?o:`Cache size of ~${Math.round(v/(1024*1024))} MB (${v} B) is over the data cap limit, not saving cache.`):new io(`Unable to reserve cache with key ${e}, another job may be creating this cache. More details: ${(p=E?.error)===null||p===void 0?void 0:p.message}`);it.debug(`Saving Cache (ID: ${l})`),yield rl.saveCache(l,u,a)}catch(h){let v=h;if(v.name===di.name)throw h;v.name===io.name?it.info(`Failed to save: ${v.message}`):it.warning(`Failed to save: ${v.message}`)}finally{try{yield pa.unlinkFile(u)}catch(h){it.debug(`Failed to delete archive: ${h}`)}}return l})}Ye.saveCache=GA});var Rv=T((St,C0)=>{"use strict";var XA=St&&St.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),WA=St&&St.__setModuleDefault||(Object.create?fun Line truncated
`);for(let r of i){let n=r.split("=");if(n.length===2&&(n[0].trim()==="VERSION_ID"||n[0].trim()==="DISTRIB_RELEASE")){e=n[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}St._getOsVersion=JA;function ez(){let t="/etc/lsb-release",e="/etc/os-release",a="";return ol.existsSync(t)?a=ol.readFileSync(t).toString():ol.existsSync(e)&&(a=ol.readFileSync(e).toString()),a}St._readLinuxVersionFile=ez});var Bv=T(da=>{"use strict";var tz=da&&da.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),az=da&&da.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iz=da&&da.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&tz(e,t,a);return az(e,t),e},Dv=da&&da.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(da,"__esModule",{value:!0});da.RetryHelper=void 0;var Iv=iz(wt()),T0=class{constructor(e,a,i){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(a),this.maxSeconds=Math.floor(i),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,a){return Dv(this,void 0,void 0,function*(){let i=1;for(;i<this.maxAttempts;){try{return yield e()}catch(n){if(a&&!a(n))throw n;Iv.info(n.message)}let r=this.getSleepAmount();Iv.info(`Waiting ${r} seconds before trying again`),yield this.sleep(r),i++}return yield e()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return Dv(this,void 0,void 0,function*(){return new Promise(a=>setTimeout(a,e*1e3))})}};da.RetryHelper=T0});var Hv=T(re=>{"use strict";var rz=re&&re.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),nz=re&&re.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ka=re&&re.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&rz(e,t,a);return nz(e,t),e},Tt=re&&re.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})},sz=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.evaluateVersions=re.isExplicitVersion=re.findFromManifest=re.getManifestFromRepo=re.findAllVersions=re.find=re.cacheFile=re.cacheDir=re.extractZip=re.extractXar=re.extractTar=re.extract7z=re.downloadTool=re.HTTPError=void 0;var he=ka(wt()),Xt=ka(Ln()),la=ka(require("fs")),oz=ka(Rv()),no=ka(require("os")),_a=ka(require("path")),Av=ka(Or()),li=ka(Mo()),pz=ka(require("stream")),dz=ka(require("util")),Rn=require("assert"),zv=sz(yc()),Xi=jn(),lz=Bv(),ro=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};re.HTTPError=ro;var O0=process.platform==="win32",cz=process.platform==="darwin",mz="actions/tool-cache";function uz(t,e,a,i){return Tt(this,void 0,void 0,function*(){e=e||_a.join(kv(),zv.default()),yield Xt.mkdirP(_a.dirname(e)),he.debug(`Downloading ${t}`),he.debug(`Destination ${e}`);let r=3,n=P0("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),s=P0("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new lz.RetryHelper(r,n,s).execute(()=>Tt(this,void 0,void 0,function*(){return yield fz(t,e||"",a,i)}),p=>!(p instanceof ro&&p.httpStatusCode&&p.httpStatusCode<500&&p.httpStatusCode!==408&&p.httpStatusCode!==429))})}re.downloadTool=uz;function fz(t,e,a,i){return Tt(this,void 0,void 0,function*(){if(la.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let r=new Av.HttpClient(mz,[],{allowRetries:!1});a&&(he.debug("set auth"),i===void 0&&(i={}),i.authorization=a);let n=yield r.get(t,i);if(n.message.statusCode!==200){let l=new ro(n.message.statusCode);throw he.debug(`Failed to download from "${t}". Code(${n.message.statusCode}) Message(${n.message.statusMessage})`),l}let s=dz.promisify(pz.pipeline),p=P0("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>n.message)(),d=!1;try{return yield s(p,la.c Line truncated
/*! Bundled license information:
sax/lib/sax.js:
(*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
mime-types/index.js:
(*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
*/
+577
View File
@@ -0,0 +1,577 @@
{
"name": "setup-bun",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "setup-bun",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.1.4",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/glob": "^0.4.0",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@types/node": "^20.8.2",
"esbuild": "^0.19.2",
"prettier": "^2.8.4",
"typescript": "^4.9.5"
}
},
"node_modules/@actions/cache": {
"version": "3.2.2",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1",
"@actions/glob": "^0.1.0",
"@actions/http-client": "^2.1.1",
"@actions/io": "^1.0.1",
"@azure/abort-controller": "^1.1.0",
"@azure/ms-rest-js": "^2.6.0",
"@azure/storage-blob": "^12.13.0",
"semver": "^6.1.0",
"uuid": "^3.3.3"
}
},
"node_modules/@actions/cache/node_modules/@actions/glob": {
"version": "0.1.2",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
"minimatch": "^3.0.4"
}
},
"node_modules/@actions/core": {
"version": "1.10.1",
"license": "MIT",
"dependencies": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/core/node_modules/uuid": {
"version": "8.3.2",
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@actions/exec": {
"version": "1.1.1",
"license": "MIT",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"node_modules/@actions/glob": {
"version": "0.4.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.9.1",
"minimatch": "^3.0.4"
}
},
"node_modules/@actions/http-client": {
"version": "2.1.1",
"license": "MIT",
"dependencies": {
"tunnel": "^0.0.6"
}
},
"node_modules/@actions/io": {
"version": "1.1.3",
"license": "MIT"
},
"node_modules/@actions/tool-cache": {
"version": "2.0.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.0",
"@actions/http-client": "^2.0.1",
"@actions/io": "^1.1.1",
"semver": "^6.1.0",
"uuid": "^3.3.2"
}
},
"node_modules/@azure/abort-controller": {
"version": "1.1.0",
"license": "MIT",
"dependencies": {
"tslib": "^2.2.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@azure/core-auth": {
"version": "1.5.0",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-util": "^1.1.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-http": {
"version": "3.0.3",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/core-util": "^1.1.1",
"@azure/logger": "^1.0.0",
"@types/node-fetch": "^2.5.0",
"@types/tunnel": "^0.0.3",
"form-data": "^4.0.0",
"node-fetch": "^2.6.7",
"process": "^0.11.10",
"tslib": "^2.2.0",
"tunnel": "^0.0.6",
"uuid": "^8.3.0",
"xml2js": "^0.5.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-http/node_modules/form-data": {
"version": "4.0.0",
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@azure/core-http/node_modules/uuid": {
"version": "8.3.2",
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@azure/core-lro": {
"version": "2.5.4",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-util": "^1.2.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-paging": {
"version": "1.5.0",
"license": "MIT",
"dependencies": {
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/core-tracing": {
"version": "1.0.0-preview.13",
"license": "MIT",
"dependencies": {
"@opentelemetry/api": "^1.0.1",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@azure/core-util": {
"version": "1.4.0",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/logger": {
"version": "1.0.4",
"license": "MIT",
"dependencies": {
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@azure/ms-rest-js": {
"version": "2.7.0",
"license": "MIT",
"dependencies": {
"@azure/core-auth": "^1.1.4",
"abort-controller": "^3.0.0",
"form-data": "^2.5.0",
"node-fetch": "^2.6.7",
"tslib": "^1.10.0",
"tunnel": "0.0.6",
"uuid": "^8.3.2",
"xml2js": "^0.5.0"
}
},
"node_modules/@azure/ms-rest-js/node_modules/tslib": {
"version": "1.14.1",
"license": "0BSD"
},
"node_modules/@azure/ms-rest-js/node_modules/uuid": {
"version": "8.3.2",
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@azure/storage-blob": {
"version": "12.15.0",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-http": "^3.0.0",
"@azure/core-lro": "^2.2.0",
"@azure/core-paging": "^1.1.1",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",
"events": "^3.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.19.2",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@opentelemetry/api": {
"version": "1.5.0",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/@types/node": {
"version": "20.9.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.1.tgz",
"integrity": "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA==",
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/@types/node-fetch": {
"version": "2.6.4",
"license": "MIT",
"dependencies": {
"@types/node": "*",
"form-data": "^3.0.0"
}
},
"node_modules/@types/node-fetch/node_modules/form-data": {
"version": "3.0.1",
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@types/tunnel": {
"version": "0.0.3",
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/abort-controller": {
"version": "3.0.0",
"license": "MIT",
"dependencies": {
"event-target-shim": "^5.0.0"
},
"engines": {
"node": ">=6.5"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"license": "MIT"
},
"node_modules/balanced-match": {
"version": "1.0.2",
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"license": "MIT"
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"license": "MIT",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/esbuild": {
"version": "0.19.2",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.19.2",
"@esbuild/android-arm64": "0.19.2",
"@esbuild/android-x64": "0.19.2",
"@esbuild/darwin-arm64": "0.19.2",
"@esbuild/darwin-x64": "0.19.2",
"@esbuild/freebsd-arm64": "0.19.2",
"@esbuild/freebsd-x64": "0.19.2",
"@esbuild/linux-arm": "0.19.2",
"@esbuild/linux-arm64": "0.19.2",
"@esbuild/linux-ia32": "0.19.2",
"@esbuild/linux-loong64": "0.19.2",
"@esbuild/linux-mips64el": "0.19.2",
"@esbuild/linux-ppc64": "0.19.2",
"@esbuild/linux-riscv64": "0.19.2",
"@esbuild/linux-s390x": "0.19.2",
"@esbuild/linux-x64": "0.19.2",
"@esbuild/netbsd-x64": "0.19.2",
"@esbuild/openbsd-x64": "0.19.2",
"@esbuild/sunos-x64": "0.19.2",
"@esbuild/win32-arm64": "0.19.2",
"@esbuild/win32-ia32": "0.19.2",
"@esbuild/win32-x64": "0.19.2"
}
},
"node_modules/event-target-shim": {
"version": "5.0.1",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/events": {
"version": "3.3.0",
"license": "MIT",
"engines": {
"node": ">=0.8.x"
}
},
"node_modules/form-data": {
"version": "2.5.1",
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 0.12"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/minimatch": {
"version": "3.0.8",
"license": "ISC",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/node-fetch": {
"version": "2.7.0",
"license": "MIT",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/prettier": {
"version": "2.8.8",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/process": {
"version": "0.11.10",
"license": "MIT",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/sax": {
"version": "1.2.4",
"license": "ISC"
},
"node_modules/semver": {
"version": "6.3.1",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"license": "MIT"
},
"node_modules/tslib": {
"version": "2.6.2",
"license": "0BSD"
},
"node_modules/tunnel": {
"version": "0.0.6",
"license": "MIT",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/typescript": {
"version": "4.9.5",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
},
"node_modules/uuid": {
"version": "3.4.0",
"license": "MIT",
"bin": {
"uuid": "bin/uuid"
}
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"license": "BSD-2-Clause"
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"license": "MIT",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/xml2js": {
"version": "0.5.0",
"license": "MIT",
"dependencies": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/xmlbuilder": {
"version": "11.0.1",
"license": "MIT",
"engines": {
"node": ">=4.0"
}
}
}
}
+4 -4
View File
@@ -10,16 +10,16 @@
"actions",
"setup"
],
"homepage": "https://bun.sh",
"main": "dist/action.js",
"homepage": "https://bun.sh/",
"main": "dist/index.js",
"repository": "git@github.com:oven-sh/setup-bun.git",
"bugs": "https://github.com/oven-sh/setup-bun/issues",
"license": "MIT",
"author": "xHyroM",
"scripts": {
"format": "prettier --write src *.yml *.json *.md",
"build": "esbuild --target=node16 --outdir=dist --bundle --platform=node --format=cjs src/action.ts",
"start": "bun run build && node dist/action.js"
"build": "esbuild --target=node20 --outdir=dist --bundle --minify --platform=node --format=cjs src/index.ts",
"start": "npm run build && node dist/index.js"
},
"dependencies": {
"@actions/cache": "^3.1.4",
+171 -35
View File
@@ -1,42 +1,178 @@
import { tmpdir } from "node:os";
import * as action from "@actions/core";
import setup from "./setup.js";
import { existsSync, readFileSync } from "fs";
import * as path from "path";
import { homedir } from "node:os";
import { join } from "node:path";
import {
mkdirSync,
readdirSync,
symlinkSync,
renameSync,
copyFileSync,
} from "node:fs";
import { addPath, info, warning } from "@actions/core";
import { isFeatureAvailable, restoreCache, saveCache } from "@actions/cache";
import { downloadTool, extractZip } from "@actions/tool-cache";
import { getExecOutput } from "@actions/exec";
import { writeBunfig } from "./bunfig";
if (!process.env.RUNNER_TEMP) {
process.env.RUNNER_TEMP = tmpdir();
export type Input = {
customUrl?: string;
version?: string;
os?: string;
arch?: string;
avx2?: boolean;
profile?: boolean;
scope?: string;
registryUrl?: string;
};
export type Output = {
version: string;
revision: string;
cacheHit: boolean;
};
export default async (options: Input): Promise<Output> => {
const bunfigPath = join(process.cwd(), "bunfig.toml");
writeBunfig(bunfigPath, options);
const url = getDownloadUrl(options);
const cacheEnabled = isCacheEnabled(options);
const binPath = join(homedir(), ".bun", "bin");
try {
mkdirSync(binPath, { recursive: true });
} catch (error) {
if (error.code !== "EEXIST") {
throw error;
}
}
addPath(binPath);
const exe = (name: string) =>
process.platform === "win32" ? `${name}.exe` : name;
const bunPath = join(binPath, exe("bun"));
try {
symlinkSync(bunPath, join(binPath, exe("bunx")));
} catch (error) {
if (error.code !== "EEXIST") {
throw error;
}
}
let revision: string | undefined;
let cacheHit = false;
if (cacheEnabled) {
const cacheRestored = await restoreCache([bunPath], url);
if (cacheRestored) {
revision = await getRevision(bunPath);
if (revision) {
cacheHit = true;
info(`Using a cached version of Bun: ${revision}`);
} else {
warning(
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`
);
}
}
}
if (!cacheHit) {
info(`Downloading a new version of Bun: ${url}`);
const zipPath = await downloadTool(url);
const extractedZipPath = await extractZip(zipPath);
const extractedBunPath = await extractBun(extractedZipPath);
try {
renameSync(extractedBunPath, bunPath);
} catch {
// If mv does not work, try to copy the file instead.
// For example: EXDEV: cross-device link not permitted
copyFileSync(extractedBunPath, bunPath);
}
revision = await getRevision(bunPath);
}
if (!revision) {
throw new Error(
"Downloaded a new version of Bun, but failed to check its version? Try again."
);
}
if (cacheEnabled && !cacheHit) {
try {
await saveCache([bunPath], url);
} catch (error) {
warning("Failed to save Bun to cache.");
}
}
const [version] = revision.split("+");
return {
version,
revision,
cacheHit,
};
};
function isCacheEnabled(options: Input): boolean {
const { customUrl, version } = options;
if (customUrl) {
return false;
}
if (!version || /latest|canary|action/i.test(version)) {
return false;
}
return isFeatureAvailable();
}
function readVersionFromPackageJson(): string | undefined {
const { GITHUB_WORKSPACE } = process.env;
if (!GITHUB_WORKSPACE) {
return;
function getDownloadUrl(options: Input): string {
const { customUrl } = options;
if (customUrl) {
return customUrl;
}
const pathToPackageJson = path.join(GITHUB_WORKSPACE, "package.json");
if (!existsSync(pathToPackageJson)) {
return;
}
const { packageManager } = JSON.parse(
readFileSync(pathToPackageJson, "utf8")
) as { packageManager?: string };
return packageManager?.split("bun@")[1];
const { version, os, arch, avx2, profile } = options;
const eversion = encodeURIComponent(version ?? "latest");
const eos = encodeURIComponent(os ?? process.platform);
const earch = encodeURIComponent(arch ?? process.arch);
const eavx2 = encodeURIComponent(avx2 ?? true);
const eprofile = encodeURIComponent(profile ?? false);
const { href } = new URL(
`${eversion}/${eos}/${earch}?avx2=${eavx2}&profile=${eprofile}`,
"https://bun.sh/download/"
);
return href;
}
setup({
version:
readVersionFromPackageJson() || action.getInput("bun-version") || undefined,
customUrl: action.getInput("bun-download-url") || undefined,
registryUrl: action.getInput("registry-url") || undefined,
scope: action.getInput("scope") || undefined,
})
.then(({ version, revision, cacheHit, registryUrl, scope }) => {
action.setOutput("bun-version", version);
action.setOutput("bun-revision", revision);
action.setOutput("cache-hit", cacheHit);
action.setOutput("registry-url", registryUrl);
action.setOutput("scope", scope);
})
.catch((error) => {
action.setFailed(error);
async function extractBun(path: string): Promise<string> {
for (const entry of readdirSync(path, { withFileTypes: true })) {
const { name } = entry;
const entryPath = join(path, name);
if (entry.isFile()) {
if (name === "bun" || name === "bun.exe") {
return entryPath;
}
if (/^bun.*\.zip/.test(name)) {
const extractedPath = await extractZip(entryPath);
return extractBun(extractedPath);
}
}
if (/^bun/.test(name) && entry.isDirectory()) {
return extractBun(entryPath);
}
}
throw new Error("Could not find executable: bun");
}
async function getRevision(exe: string): Promise<string | undefined> {
const revision = await getExecOutput(exe, ["--revision"], {
ignoreReturnCode: true,
});
if (revision.exitCode === 0 && /^\d+\.\d+\.\d+/.test(revision.stdout)) {
return revision.stdout.trim();
}
const version = await getExecOutput(exe, ["--version"], {
ignoreReturnCode: true,
});
if (version.exitCode === 0 && /^\d+\.\d+\.\d+/.test(version.stdout)) {
return version.stdout.trim();
}
return undefined;
}
-57
View File
@@ -1,57 +0,0 @@
import { EOL } from "node:os";
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";
import * as core from "@actions/core";
export function configureAuthentication(registryUrl: string, scope: string) {
const bunfigPath = resolve(process.cwd(), "bunfig.toml");
if (!registryUrl.endsWith("/")) {
registryUrl += "/";
}
writeRegistryToConfigFile({ registryUrl, fileLocation: bunfigPath, scope });
}
type WriteRegistryToConfigFile = {
registryUrl: string;
fileLocation: string;
scope: string;
};
function writeRegistryToConfigFile({
registryUrl,
fileLocation,
scope,
}: WriteRegistryToConfigFile) {
if (scope && scope[0] !== "@") {
scope = "@" + scope;
}
if (scope) {
scope = scope.toLocaleLowerCase();
}
core.info(`Setting auth in ${fileLocation}`);
let newContents = "";
if (existsSync(fileLocation)) {
const curContents = readFileSync(fileLocation, "utf8");
curContents.split(EOL).forEach((line: string) => {
// Add current contents unless they are setting the registry
if (!line.toLowerCase().startsWith(scope)) {
newContents += line + EOL;
}
});
newContents += EOL;
}
const bunRegistryString = `'${scope}' = { token = "$BUN_AUTH_TOKEN", url = "${registryUrl}"}`;
newContents += `[install.scopes]${EOL}${EOL}${bunRegistryString}${EOL}`;
writeFileSync("./bunfig.toml", newContents);
}
+50
View File
@@ -0,0 +1,50 @@
import { EOL } from "node:os";
import { appendFileSync } from "node:fs";
import { info } from "@actions/core";
type BunfigOptions = {
registryUrl?: string;
scope?: string;
};
export function createBunfig(options: BunfigOptions): string | null {
const { registryUrl, scope } = options;
let url: URL | undefined;
if (registryUrl) {
try {
url = new URL(registryUrl);
} catch {
throw new Error(`Invalid registry-url: ${registryUrl}`);
}
}
let owner: string | undefined;
if (scope) {
owner = scope.startsWith("@")
? scope.toLocaleLowerCase()
: `@${scope.toLocaleLowerCase()}`;
}
if (url && owner) {
return `[install.scopes]${EOL}'${owner}' = { token = "$BUN_AUTH_TOKEN", url = "${url}"}${EOL}`;
}
if (url && !owner) {
return `[install]${EOL}registry = "${url}"${EOL}`;
}
return null;
}
export function writeBunfig(path: string, options: BunfigOptions): void {
const bunfig = createBunfig(options);
if (!bunfig) {
return;
}
info(`Writing bunfig.toml to '${path}'.`);
appendFileSync(path, bunfig, {
encoding: "utf8",
});
}
+46
View File
@@ -0,0 +1,46 @@
import { tmpdir } from "node:os";
import { join } from "node:path";
import { existsSync, readFileSync } from "node:fs";
import { getInput, setOutput, setFailed, warning } from "@actions/core";
import runAction from "./action.js";
if (!process.env.RUNNER_TEMP) {
process.env.RUNNER_TEMP = tmpdir();
}
function readVersionFromPackageJson(): string | undefined {
const cwd = process.env.GITHUB_WORKSPACE;
if (!cwd) {
return;
}
const path = join(cwd, "package.json");
try {
if (!existsSync(path)) {
return;
}
const { packageManager } = JSON.parse(readFileSync(path, "utf8"));
if (!packageManager?.startsWith("bun@")) {
return;
}
const [_, version] = packageManager.split("bun@");
return version;
} catch (error) {
const { message } = error as Error;
warning(`Failed to read package.json: ${message}`);
}
}
runAction({
version: getInput("bun-version") || readVersionFromPackageJson() || undefined,
customUrl: getInput("bun-download-url") || undefined,
registryUrl: getInput("registry-url") || undefined,
scope: getInput("scope") || undefined,
})
.then(({ version, revision, cacheHit }) => {
setOutput("bun-version", version);
setOutput("bun-revision", revision);
setOutput("cache-hit", cacheHit);
})
.catch((error) => {
setFailed(error);
});
-158
View File
@@ -1,158 +0,0 @@
import { homedir } from "node:os";
import { join } from "node:path";
import { readdir, symlink } from "node:fs/promises";
import * as action from "@actions/core";
import * as cache from "@actions/cache";
import { downloadTool, extractZip } from "@actions/tool-cache";
import { cp, mkdirP, rmRF } from "@actions/io";
import { getExecOutput } from "@actions/exec";
import { configureAuthentication } from "./auth";
export default async (options?: {
version?: string;
customUrl?: string;
scope?: string;
registryUrl?: string;
}): Promise<{
version: string;
revision: string;
cacheHit: boolean;
scope?: string;
registryUrl?: string;
}> => {
const { url, cacheKey } = getDownloadUrl(options);
const cacheEnabled = cacheKey && cache.isFeatureAvailable();
const dir = join(homedir(), ".bun", "bin");
action.addPath(dir);
const path = join(dir, "bun");
let revision: string | undefined;
let cacheHit = false;
if (cacheEnabled) {
const cacheRestored = await cache.restoreCache([path], cacheKey);
if (cacheRestored) {
revision = await verifyBun(path);
if (revision) {
cacheHit = true;
action.info("Using a cached version of Bun.");
} else {
action.warning(
"Found a cached version of Bun, but it appears to be corrupted? Attempting to download a new version."
);
}
}
}
if (!cacheHit) {
action.info(`Downloading a new version of Bun: ${url}`);
const zipPath = await downloadTool(url);
const extractedPath = await extractZip(zipPath);
const exePath = await extractBun(extractedPath);
await mkdirP(dir);
await cp(exePath, path);
await rmRF(exePath);
revision = await verifyBun(path);
}
try {
await symlink(path, join(dir, "bunx"));
} catch (error) {
if (error.code !== "EEXIST") {
throw error;
}
}
if (!revision) {
throw new Error(
"Downloaded a new version of Bun, but failed to check its version? Try again in debug mode."
);
}
if (cacheEnabled) {
try {
await cache.saveCache([path], cacheKey);
} catch (error) {
action.warning("Failed to save Bun to cache.");
}
}
const [version] = revision.split("+");
const { registryUrl, scope } = options;
if (!!registryUrl && !!scope) {
configureAuthentication(registryUrl, scope);
}
return {
version,
revision,
cacheHit,
registryUrl,
scope,
};
};
function getDownloadUrl(options?: {
customUrl?: string;
version?: string;
os?: string;
arch?: string;
avx2?: boolean;
profile?: boolean;
}): {
url: string;
cacheKey: string | null;
} {
if (options?.customUrl) {
return {
url: options.customUrl,
cacheKey: null,
};
}
const release = encodeURIComponent(options?.version ?? "latest");
const os = encodeURIComponent(options?.os ?? process.platform);
const arch = encodeURIComponent(options?.arch ?? process.arch);
const avx2 = encodeURIComponent(options?.avx2 ?? true);
const profile = encodeURIComponent(options?.profile ?? false);
const { href } = new URL(
`${release}/${os}/${arch}?avx2=${avx2}&profile=${profile}`,
"https://bun.sh/download/"
);
return {
url: href,
cacheKey: /^latest|canary|action/i.test(release)
? null
: `bun-${release}-${os}-${arch}-${avx2}-${profile}`,
};
}
async function extractBun(path: string): Promise<string> {
for (const entry of await readdir(path, { withFileTypes: true })) {
const { name } = entry;
const entryPath = join(path, name);
if (entry.isFile()) {
if (name === "bun") {
return entryPath;
}
if (/^bun.*\.zip/.test(name)) {
const extractedPath = await extractZip(entryPath);
return extractBun(extractedPath);
}
}
if (/^bun/.test(name) && entry.isDirectory()) {
return extractBun(entryPath);
}
}
throw new Error("Could not find executable: bun");
}
async function verifyBun(path: string): Promise<string | undefined> {
const revision = await getExecOutput(path, ["--revision"], {
ignoreReturnCode: true,
});
if (revision.exitCode === 0 && /^\d+\.\d+\.\d+/.test(revision.stdout)) {
return revision.stdout.trim();
}
const version = await getExecOutput(path, ["--version"], {
ignoreReturnCode: true,
});
if (version.exitCode === 0 && /^\d+\.\d+\.\d+/.test(version.stdout)) {
return version.stdout.trim();
}
return undefined;
}
+2 -1
View File
@@ -5,6 +5,7 @@
"module": "ES2020",
"target": "ES2020",
"moduleResolution": "node",
"skipLibCheck": true
"skipLibCheck": true,
"types": ["node"]
}
}