diff --git a/.github/actions/upload-turboyet-data/dist/index.js b/.github/actions/upload-turboyet-data/dist/index.js index fa49de5875a11..c09be9c02027c 100644 --- a/.github/actions/upload-turboyet-data/dist/index.js +++ b/.github/actions/upload-turboyet-data/dist/index.js @@ -1,25 +1,25 @@ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 42: +/***/ 194: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value: true})); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;var c=class extends Error{constructor(n){super(n),this.name="UpstashError"}};var ie=class{constructor(n){this.options={backend:_optionalChain([n, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.backend]),agent:n.agent,responseEncoding:_nullishCoalesce(n.responseEncoding, () => ("base64")),cache:n.cache},this.baseUrl=n.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...n.headers},this.options.responseEncoding==="base64"&&(this.headers["Upstash-Encoding"]="base64"),typeof _optionalChain([n, 'optionalAccess', _4 => _4.retry])=="boolean"&&_optionalChain([n, 'optionalAccess', _5 => _5.retry])===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _6 => _6.retry, 'optionalAccess', _7 => _7.retries]), () => (5)),backoff:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _8 => _8.retry, 'optionalAccess', _9 => _9.backoff]), () => ((t=>Math.exp(t)*50)))}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(","):o[m]=r),o}this.headers=t(this.headers,"Upstash-Telemetry-Runtime",n.runtime),this.headers=t(this.headers,"Upstash-Telemetry-Platform",n.platform),this.headers=t(this.headers,"Upstash-Telemetry-Sdk",n.sdk)}async request(n){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:_optionalChain([this, 'access', _10 => _10.options, 'optionalAccess', _11 => _11.agent]),backend:_optionalChain([this, 'access', _12 => _12.options, 'optionalAccess', _13 => _13.backend])},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,..._nullishCoalesce(n.path, () => ([]))].join("/"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw _nullishCoalesce(m, () => (new Error("Exhausted all retries")));let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return _optionalChain([this, 'access', _14 => _14.options, 'optionalAccess', _15 => _15.responseEncoding])==="base64"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:re(i),error:p})):{result:re(r.result),error:r.error}:r}};function pe(s){let n="";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;rtypeof t=="string"?pe(t):Array.isArray(t)?t.map(re):t):n=null;break}case"string":{n=s==="OK"?"OK":pe(s);break}default:break}return n}function de(s){let n=Array.isArray(s)?s.map(t=>{try{return de(t)}catch (e3){return t}}):JSON.parse(s);return typeof n=="number"&&n.toString()!==s?s:n}function ce(s){try{return de(s)}catch (e4){return s}}var he=s=>{switch(typeof s){case"string":case"number":case"boolean":return s;default:return JSON.stringify(s)}},e=class{constructor(n,t){this.serialize=he,this.deserialize=typeof _optionalChain([t, 'optionalAccess', _16 => _16.automaticDeserialization])>"u"||t.automaticDeserialization?_nullishCoalesce(_optionalChain([t, 'optionalAccess', _17 => _17.deserialize]), () => (ce)):o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>"u")throw new Error("Request did not return a result");return this.deserialize(t)}};var C=class extends e{constructor(n,t){super(["append",...n],t)}};var l=class extends e{constructor([n,t,o],m){let r=["bitcount",n];typeof t=="number"&&r.push(t),typeof o=="number"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super(["bitop",...n],t)}};var x=class extends e{constructor(n,t){super(["bitpos",...n],t)}};var f=class extends e{constructor([n,t,o],m){super(["COPY",n,t,..._optionalChain([o, 'optionalAccess', _18 => _18.replace])?["REPLACE"]:[]],{...m,deserialize(r){return r>0?"COPIED":"NOT_COPIED"}})}};var y=class extends e{constructor(n){super(["dbsize"],n)}};var b=class extends e{constructor(n,t){super(["decr",...n],t)}};var O=class extends e{constructor(n,t){super(["decrby",...n],t)}};var T=class extends e{constructor(n,t){super(["del",...n],t)}};var w=class extends e{constructor(n,t){super(["echo",...n],t)}};var D=class extends e{constructor([n,t,o],m){super(["eval",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var k=class extends e{constructor([n,t,o],m){super(["evalsha",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var A=class extends e{constructor(n,t){super(["exists",...n],t)}};var S=class extends e{constructor(n,t){super(["expire",...n],t)}};var R=class extends e{constructor(n,t){super(["expireat",...n],t)}};var M=class extends e{constructor(n,t){let o=["flushall"];n&&n.length>0&&n[0].async&&o.push("async"),super(o,t)}};var v=class extends e{constructor([n],t){let o=["flushdb"];_optionalChain([n, 'optionalAccess', _19 => _19.async])&&o.push("async"),super(o,t)}};var E=class extends e{constructor([n,t,...o],m){let r=["geoadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"latitude"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var z=class extends e{constructor([n,t,o,m="M"],r){super(["GEODIST",n,t,o,m],r)}};var J=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOPOS",o,...m],{deserialize:r=>Ce(r),...t})}};function Ce(s){let n=[];for(let t of s)!_optionalChain([t, 'optionalAccess', _20 => _20[0]])||!_optionalChain([t, 'optionalAccess', _21 => _21[1]])||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var P=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOHASH",o,...m],t)}};var I=class extends e{constructor([n,t,o,m,r],a){let i=["GEOSEARCH",n];(t.type==="FROMMEMBER"||t.type==="frommember")&&i.push(t.type,t.member),(t.type==="FROMLONLAT"||t.type==="fromlonlat")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type==="BYRADIUS"||o.type==="byradius")&&i.push(o.type,o.radius,o.radiusType),(o.type==="BYBOX"||o.type==="bybox")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),_optionalChain([r, 'optionalAccess', _22 => _22.count])&&i.push(r.count.limit,...r.count.any?["ANY"]:[]);let p=ae=>!_optionalChain([r, 'optionalAccess', _23 => _23.withCoord])&&!_optionalChain([r, 'optionalAccess', _24 => _24.withDist])&&!_optionalChain([r, 'optionalAccess', _25 => _25.withHash])?ae.map(d=>{try{return{member:JSON.parse(d)}}catch (e5){return{member:d}}}):ae.map(d=>{let ee=1,h={};try{h.member=JSON.parse(d[0])}catch (e6){h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[ee++])),r.withHash&&(h.hash=d[ee++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[ee][0]),lat:parseFloat(d[ee][1])}),h});super([...i,..._optionalChain([r, 'optionalAccess', _26 => _26.withCoord])?["WITHCOORD"]:[],..._optionalChain([r, 'optionalAccess', _27 => _27.withDist])?["WITHDIST"]:[],..._optionalChain([r, 'optionalAccess', _28 => _28.withHash])?["WITHHASH"]:[]],{...a,deserialize:p})}};var K=class extends e{constructor([n,t,o,m,r,a],i){let p=["GEOSEARCHSTORE",n,t];(o.type==="FROMMEMBER"||o.type==="frommember")&&p.push(o.type,o.member),(o.type==="FROMLONLAT"||o.type==="fromlonlat")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type==="BYRADIUS"||m.type==="byradius")&&p.push(m.type,m.radius,m.radiusType),(m.type==="BYBOX"||m.type==="bybox")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),_optionalChain([a, 'optionalAccess', _29 => _29.count])&&p.push(a.count.limit,...a.count.any?["ANY"]:[]),super([...p,..._optionalChain([a, 'optionalAccess', _30 => _30.storeDist])?["STOREDIST"]:[]],i)}};var L=class extends e{constructor(n,t){super(["get",...n],t)}};var Z=class extends e{constructor(n,t){super(["getbit",...n],t)}};var N=class extends e{constructor(n,t){super(["getdel",...n],t)}};var G=class extends e{constructor(n,t){super(["getrange",...n],t)}};var B=class extends e{constructor(n,t){super(["getset",...n],t)}};var U=class extends e{constructor(n,t){super(["hdel",...n],t)}};var H=class extends e{constructor(n,t){super(["hexists",...n],t)}};var F=class extends e{constructor(n,t){super(["hget",...n],t)}};function le(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch (e7){n[t]=o}}return n}var q=class extends e{constructor(n,t){super(["hgetall",...n],{deserialize:o=>le(o),...t})}};var $=class extends e{constructor(n,t){super(["hincrby",...n],t)}};var X=class extends e{constructor(n,t){super(["hincrbyfloat",...n],t)}};var j=class extends e{constructor([n],t){super(["hkeys",n],t)}};var Y=class extends e{constructor(n,t){super(["hlen",...n],t)}};function ge(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;oge(t,m),...o})}};var V=class extends e{constructor([n,t],o){super(["hmset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function xe(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch (e9){n[t]=o}}return n}var _=class extends e{constructor(n,t){let o=["hrandfield",n[0]];typeof n[1]=="number"&&o.push(n[1]),n[2]&&o.push("WITHVALUES"),super(o,{deserialize:n[2]?m=>xe(m):_optionalChain([t, 'optionalAccess', _31 => _31.deserialize]),...t})}};var Q=class extends e{constructor([n,t,o],m){let r=["hscan",n,t];_optionalChain([o, 'optionalAccess', _32 => _32.match])&&r.push("match",o.match),typeof _optionalChain([o, 'optionalAccess', _33 => _33.count])=="number"&&r.push("count",o.count),super(r,m)}};var nn=class extends e{constructor([n,t],o){super(["hset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var tn=class extends e{constructor(n,t){super(["hsetnx",...n],t)}};var en=class extends e{constructor(n,t){super(["hstrlen",...n],t)}};var on=class extends e{constructor(n,t){super(["hvals",...n],t)}};var sn=class extends e{constructor(n,t){super(["incr",...n],t)}};var mn=class extends e{constructor(n,t){super(["incrby",...n],t)}};var rn=class extends e{constructor(n,t){super(["incrbyfloat",...n],t)}};var an=class extends e{constructor(n,t){super(["JSON.ARRAPPEND",...n],t)}};var pn=class extends e{constructor(n,t){super(["JSON.ARRINDEX",...n],t)}};var dn=class extends e{constructor(n,t){super(["JSON.ARRINSERT",...n],t)}};var cn=class extends e{constructor(n,t){super(["JSON.ARRLEN",n[0],_nullishCoalesce(n[1], () => ("$"))],t)}};var un=class extends e{constructor(n,t){super(["JSON.ARRPOP",...n],t)}};var hn=class extends e{constructor(n,t){let o=_nullishCoalesce(n[1], () => ("$")),m=_nullishCoalesce(n[2], () => (0)),r=_nullishCoalesce(n[3], () => (0));super(["JSON.ARRTRIM",n[0],o,m,r],t)}};var Cn=class extends e{constructor(n,t){super(["JSON.CLEAR",...n],t)}};var ln=class extends e{constructor(n,t){super(["JSON.DEL",...n],t)}};var gn=class extends e{constructor(n,t){super(["JSON.FORGET",...n],t)}};var xn=class extends e{constructor(n,t){let o=["JSON.GET"];typeof n[1]=="string"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push("INDENT",n[1].indent),n[1].newline&&o.push("NEWLINE",n[1].newline),n[1].space&&o.push("SPACE",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var fn=class extends e{constructor(n,t){super(["JSON.MGET",...n[0],n[1]],t)}};var yn=class extends e{constructor(n,t){super(["JSON.NUMINCRBY",...n],t)}};var bn=class extends e{constructor(n,t){super(["JSON.NUMMULTBY",...n],t)}};var On=class extends e{constructor(n,t){super(["JSON.OBJKEYS",...n],t)}};var Tn=class extends e{constructor(n,t){super(["JSON.OBJLEN",...n],t)}};var wn=class extends e{constructor(n,t){super(["JSON.RESP",...n],t)}};var Dn=class extends e{constructor(n,t){let o=["JSON.SET",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push("NX"):n[3].xx&&o.push("XX")),super(o,t)}};var kn=class extends e{constructor(n,t){super(["JSON.STRAPPEND",...n],t)}};var An=class extends e{constructor(n,t){super(["JSON.STRLEN",...n],t)}};var Sn=class extends e{constructor(n,t){super(["JSON.TOGGLE",...n],t)}};var Rn=class extends e{constructor(n,t){super(["JSON.TYPE",...n],t)}};var Mn=class extends e{constructor(n,t){super(["keys",...n],t)}};var vn=class extends e{constructor(n,t){super(["lindex",...n],t)}};var En=class extends e{constructor(n,t){super(["linsert",...n],t)}};var zn=class extends e{constructor(n,t){super(["llen",...n],t)}};var Jn=class extends e{constructor(n,t){super(["lmove",...n],t)}};var Pn=class extends e{constructor(n,t){super(["lpop",...n],t)}};var In=class extends e{constructor(n,t){let o=["lpos",n[0],n[1]];typeof _optionalChain([n, 'access', _34 => _34[2], 'optionalAccess', _35 => _35.rank])=="number"&&o.push("rank",n[2].rank),typeof _optionalChain([n, 'access', _36 => _36[2], 'optionalAccess', _37 => _37.count])=="number"&&o.push("count",n[2].count),typeof _optionalChain([n, 'access', _38 => _38[2], 'optionalAccess', _39 => _39.maxLen])=="number"&&o.push("maxLen",n[2].maxLen),super(o,t)}};var Kn=class extends e{constructor(n,t){super(["lpush",...n],t)}};var Ln=class extends e{constructor(n,t){super(["lpushx",...n],t)}};var Zn=class extends e{constructor(n,t){super(["lrange",...n],t)}};var Nn=class extends e{constructor(n,t){super(["lrem",...n],t)}};var Gn=class extends e{constructor(n,t){super(["lset",...n],t)}};var Bn=class extends e{constructor(n,t){super(["ltrim",...n],t)}};var Un=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super(["mget",...o],t)}};var Hn=class extends e{constructor([n],t){super(["mset",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Fn=class extends e{constructor([n],t){super(["msetnx",...Object.entries(n).flatMap(o=>o)],t)}};var qn=class extends e{constructor(n,t){super(["persist",...n],t)}};var $n=class extends e{constructor(n,t){super(["pexpire",...n],t)}};var Xn=class extends e{constructor(n,t){super(["pexpireat",...n],t)}};var jn=class extends e{constructor(n,t){let o=["ping"];typeof n<"u"&&typeof n[0]<"u"&&o.push(n[0]),super(o,t)}};var Yn=class extends e{constructor(n,t){super(["psetex",...n],t)}};var Wn=class extends e{constructor(n,t){super(["pttl",...n],t)}};var Vn=class extends e{constructor(n,t){super(["publish",...n],t)}};var _n=class extends e{constructor(n){super(["randomkey"],n)}};var Qn=class extends e{constructor(n,t){super(["rename",...n],t)}};var nt=class extends e{constructor(n,t){super(["renamenx",...n],t)}};var tt=class extends e{constructor(n,t){super(["rpop",...n],t)}};var et=class extends e{constructor(n,t){super(["rpush",...n],t)}};var ot=class extends e{constructor(n,t){super(["rpushx",...n],t)}};var st=class extends e{constructor(n,t){super(["sadd",...n],t)}};var mt=class extends e{constructor([n,t],o){let m=["scan",n];_optionalChain([t, 'optionalAccess', _40 => _40.match])&&m.push("match",t.match),typeof _optionalChain([t, 'optionalAccess', _41 => _41.count])=="number"&&m.push("count",t.count),_optionalChain([t, 'optionalAccess', _42 => _42.type])&&t.type.length>0&&m.push("type",t.type),super(m,o)}};var rt=class extends e{constructor(n,t){super(["scard",...n],t)}};var at=class extends e{constructor(n,t){super(["script","exists",...n],{deserialize:o=>o,...t})}};var it=class extends e{constructor([n],t){let o=["script","flush"];_optionalChain([n, 'optionalAccess', _43 => _43.sync])?o.push("sync"):_optionalChain([n, 'optionalAccess', _44 => _44.async])&&o.push("async"),super(o,t)}};var pt=class extends e{constructor(n,t){super(["script","load",...n],t)}};var dt=class extends e{constructor(n,t){super(["sdiff",...n],t)}};var ct=class extends e{constructor(n,t){super(["sdiffstore",...n],t)}};var ut=class extends e{constructor([n,t,o],m){let r=["set",n,t];o&&("nx"in o&&o.nx?r.push("nx"):"xx"in o&&o.xx&&r.push("xx"),"get"in o&&o.get&&r.push("get"),"ex"in o&&typeof o.ex=="number"?r.push("ex",o.ex):"px"in o&&typeof o.px=="number"?r.push("px",o.px):"exat"in o&&typeof o.exat=="number"?r.push("exat",o.exat):"pxat"in o&&typeof o.pxat=="number"?r.push("pxat",o.pxat):"keepTtl"in o&&o.keepTtl&&r.push("keepTtl")),super(r,m)}};var ht=class extends e{constructor(n,t){super(["setbit",...n],t)}};var Ct=class extends e{constructor(n,t){super(["setex",...n],t)}};var lt=class extends e{constructor(n,t){super(["setnx",...n],t)}};var gt=class extends e{constructor(n,t){super(["setrange",...n],t)}};var xt=class extends e{constructor(n,t){super(["sinter",...n],t)}};var ft=class extends e{constructor(n,t){super(["sinterstore",...n],t)}};var yt=class extends e{constructor(n,t){super(["sismember",...n],t)}};var bt=class extends e{constructor(n,t){super(["smembers",...n],t)}};var Ot=class extends e{constructor(n,t){super(["smismember",n[0],...n[1]],t)}};var Tt=class extends e{constructor(n,t){super(["smove",...n],t)}};var wt=class extends e{constructor([n,t],o){let m=["spop",n];typeof t=="number"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor([n,t],o){let m=["srandmember",n];typeof t=="number"&&m.push(t),super(m,o)}};var kt=class extends e{constructor(n,t){super(["srem",...n],t)}};var At=class extends e{constructor([n,t,o],m){let r=["sscan",n,t];_optionalChain([o, 'optionalAccess', _45 => _45.match])&&r.push("match",o.match),typeof _optionalChain([o, 'optionalAccess', _46 => _46.count])=="number"&&r.push("count",o.count),super(r,m)}};var St=class extends e{constructor(n,t){super(["strlen",...n],t)}};var Rt=class extends e{constructor(n,t){super(["sunion",...n],t)}};var Mt=class extends e{constructor(n,t){super(["sunionstore",...n],t)}};var vt=class extends e{constructor(n){super(["time"],n)}};var Et=class extends e{constructor(n,t){super(["touch",...n],t)}};var zt=class extends e{constructor(n,t){super(["ttl",...n],t)}};var Jt=class extends e{constructor(n,t){super(["type",...n],t)}};var Pt=class extends e{constructor(n,t){super(["unlink",...n],t)}};var oe=class extends e{constructor([n,t,o,m],r){let a=["XADD",n];m&&(m.nomkStream&&a.push("NOMKSTREAM"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<"u"&&a.push("LIMIT",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function fe(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch (e10){n[o][r]=a}}}return n}var se=class extends e{constructor([n,t,o,m],r){let a=["XRANGE",n,t,o];typeof m=="number"&&a.push("COUNT",m),super(a,{deserialize:i=>fe(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=["zadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"incr"in t&&t.incr&&r.push("incr"),"score"in t&&"member"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var It=class extends e{constructor(n,t){super(["zcard",...n],t)}};var Kt=class extends e{constructor(n,t){super(["zcount",...n],t)}};var Lt=class extends e{constructor(n,t){super(["zincrby",...n],t)}};var Zt=class extends e{constructor([n,t,o,m],r){let a=["zinterstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Nt=class extends e{constructor(n,t){super(["zlexcount",...n],t)}};var Gt=class extends e{constructor([n,t],o){let m=["zpopmax",n];typeof t=="number"&&m.push(t),super(m,o)}};var Bt=class extends e{constructor([n,t],o){let m=["zpopmin",n];typeof t=="number"&&m.push(t),super(m,o)}};var Ut=class extends e{constructor([n,t,o,m],r){let a=["zrange",n,t,o];_optionalChain([m, 'optionalAccess', _47 => _47.byScore])&&a.push("byscore"),_optionalChain([m, 'optionalAccess', _48 => _48.byLex])&&a.push("bylex"),_optionalChain([m, 'optionalAccess', _49 => _49.rev])&&a.push("rev"),typeof _optionalChain([m, 'optionalAccess', _50 => _50.count])<"u"&&typeof _optionalChain([m, 'optionalAccess', _51 => _51.offset])<"u"&&a.push("limit",m.offset,m.count),_optionalChain([m, 'optionalAccess', _52 => _52.withScores])&&a.push("withscores"),super(a,r)}};var Ht=class extends e{constructor(n,t){super(["zrank",...n],t)}};var Ft=class extends e{constructor(n,t){super(["zrem",...n],t)}};var qt=class extends e{constructor(n,t){super(["zremrangebylex",...n],t)}};var $t=class extends e{constructor(n,t){super(["zremrangebyrank",...n],t)}};var Xt=class extends e{constructor(n,t){super(["zremrangebyscore",...n],t)}};var jt=class extends e{constructor(n,t){super(["zrevrank",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=["zscan",n,t];_optionalChain([o, 'optionalAccess', _53 => _53.match])&&r.push("match",o.match),typeof _optionalChain([o, 'optionalAccess', _54 => _54.count])=="number"&&r.push("count",o.count),super(r,m)}};var Wt=class extends e{constructor(n,t){super(["zscore",...n],t)}};var Vt=class extends e{constructor([n,t,o],m){let r=["zunion",n];Array.isArray(t)?r.push(...t):r.push(t),o&&("weights"in o&&o.weights?r.push("weights",...o.weights):"weight"in o&&typeof o.weight=="number"&&r.push("weights",o.weight),"aggregate"in o&&r.push("aggregate",o.aggregate),_optionalChain([o, 'optionalAccess', _55 => _55.withScores])&&r.push("withscores")),super(r,m)}};var _t=class extends e{constructor([n,t,o,m],r){let a=["zunionstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Qt=class extends e{constructor(n,t){super(["zdiffstore",...n],t)}};var ne=class extends e{constructor(n,t){let[o,m]=n;super(["zmscore",o,...m],t)}};var te= (_class =class{constructor(n){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);_class.prototype.__init11.call(this);_class.prototype.__init12.call(this);_class.prototype.__init13.call(this);_class.prototype.__init14.call(this);_class.prototype.__init15.call(this);_class.prototype.__init16.call(this);_class.prototype.__init17.call(this);_class.prototype.__init18.call(this);_class.prototype.__init19.call(this);_class.prototype.__init20.call(this);_class.prototype.__init21.call(this);_class.prototype.__init22.call(this);_class.prototype.__init23.call(this);_class.prototype.__init24.call(this);_class.prototype.__init25.call(this);_class.prototype.__init26.call(this);_class.prototype.__init27.call(this);_class.prototype.__init28.call(this);_class.prototype.__init29.call(this);_class.prototype.__init30.call(this);_class.prototype.__init31.call(this);_class.prototype.__init32.call(this);_class.prototype.__init33.call(this);_class.prototype.__init34.call(this);_class.prototype.__init35.call(this);_class.prototype.__init36.call(this);_class.prototype.__init37.call(this);_class.prototype.__init38.call(this);_class.prototype.__init39.call(this);_class.prototype.__init40.call(this);_class.prototype.__init41.call(this);_class.prototype.__init42.call(this);_class.prototype.__init43.call(this);_class.prototype.__init44.call(this);_class.prototype.__init45.call(this);_class.prototype.__init46.call(this);_class.prototype.__init47.call(this);_class.prototype.__init48.call(this);_class.prototype.__init49.call(this);_class.prototype.__init50.call(this);_class.prototype.__init51.call(this);_class.prototype.__init52.call(this);_class.prototype.__init53.call(this);_class.prototype.__init54.call(this);_class.prototype.__init55.call(this);_class.prototype.__init56.call(this);_class.prototype.__init57.call(this);_class.prototype.__init58.call(this);_class.prototype.__init59.call(this);_class.prototype.__init60.call(this);_class.prototype.__init61.call(this);_class.prototype.__init62.call(this);_class.prototype.__init63.call(this);_class.prototype.__init64.call(this);_class.prototype.__init65.call(this);_class.prototype.__init66.call(this);_class.prototype.__init67.call(this);_class.prototype.__init68.call(this);_class.prototype.__init69.call(this);_class.prototype.__init70.call(this);_class.prototype.__init71.call(this);_class.prototype.__init72.call(this);_class.prototype.__init73.call(this);_class.prototype.__init74.call(this);_class.prototype.__init75.call(this);_class.prototype.__init76.call(this);_class.prototype.__init77.call(this);_class.prototype.__init78.call(this);_class.prototype.__init79.call(this);_class.prototype.__init80.call(this);_class.prototype.__init81.call(this);_class.prototype.__init82.call(this);_class.prototype.__init83.call(this);_class.prototype.__init84.call(this);_class.prototype.__init85.call(this);_class.prototype.__init86.call(this);_class.prototype.__init87.call(this);_class.prototype.__init88.call(this);_class.prototype.__init89.call(this);_class.prototype.__init90.call(this);_class.prototype.__init91.call(this);_class.prototype.__init92.call(this);_class.prototype.__init93.call(this);_class.prototype.__init94.call(this);_class.prototype.__init95.call(this);_class.prototype.__init96.call(this);_class.prototype.__init97.call(this);_class.prototype.__init98.call(this);_class.prototype.__init99.call(this);_class.prototype.__init100.call(this);_class.prototype.__init101.call(this);_class.prototype.__init102.call(this);_class.prototype.__init103.call(this);_class.prototype.__init104.call(this);_class.prototype.__init105.call(this);_class.prototype.__init106.call(this);_class.prototype.__init107.call(this);_class.prototype.__init108.call(this);_class.prototype.__init109.call(this);_class.prototype.__init110.call(this);_class.prototype.__init111.call(this);_class.prototype.__init112.call(this);_class.prototype.__init113.call(this);_class.prototype.__init114.call(this);_class.prototype.__init115.call(this);_class.prototype.__init116.call(this);_class.prototype.__init117.call(this);_class.prototype.__init118.call(this);_class.prototype.__init119.call(this);_class.prototype.__init120.call(this);_class.prototype.__init121.call(this);_class.prototype.__init122.call(this);_class.prototype.__init123.call(this);this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=_nullishCoalesce(n.multiExec, () => (!1))}__init() {this.exec=async()=>{if(this.commands.length===0)throw new Error("Pipeline is empty");let n=this.multiExec?["multi-exec"]:["pipeline"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})}}length(){return this.commands.length}chain(n){return this.commands.push(n),this}__init2() {this.append=(...n)=>this.chain(new C(n,this.commandOptions))}__init3() {this.bitcount=(...n)=>this.chain(new l(n,this.commandOptions))}__init4() {this.bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions))}__init5() {this.bitpos=(...n)=>this.chain(new x(n,this.commandOptions))}__init6() {this.copy=(...n)=>this.chain(new f(n,this.commandOptions))}__init7() {this.zdiffstore=(...n)=>this.chain(new Qt(n,this.commandOptions))}__init8() {this.dbsize=()=>this.chain(new y(this.commandOptions))}__init9() {this.decr=(...n)=>this.chain(new b(n,this.commandOptions))}__init10() {this.decrby=(...n)=>this.chain(new O(n,this.commandOptions))}__init11() {this.del=(...n)=>this.chain(new T(n,this.commandOptions))}__init12() {this.echo=(...n)=>this.chain(new w(n,this.commandOptions))}__init13() {this.eval=(...n)=>this.chain(new D(n,this.commandOptions))}__init14() {this.evalsha=(...n)=>this.chain(new k(n,this.commandOptions))}__init15() {this.exists=(...n)=>this.chain(new A(n,this.commandOptions))}__init16() {this.expire=(...n)=>this.chain(new S(n,this.commandOptions))}__init17() {this.expireat=(...n)=>this.chain(new R(n,this.commandOptions))}__init18() {this.flushall=n=>this.chain(new M(n,this.commandOptions))}__init19() {this.flushdb=(...n)=>this.chain(new v(n,this.commandOptions))}__init20() {this.get=(...n)=>this.chain(new L(n,this.commandOptions))}__init21() {this.getbit=(...n)=>this.chain(new Z(n,this.commandOptions))}__init22() {this.getdel=(...n)=>this.chain(new N(n,this.commandOptions))}__init23() {this.getrange=(...n)=>this.chain(new G(n,this.commandOptions))}__init24() {this.getset=(n,t)=>this.chain(new B([n,t],this.commandOptions))}__init25() {this.hdel=(...n)=>this.chain(new U(n,this.commandOptions))}__init26() {this.hexists=(...n)=>this.chain(new H(n,this.commandOptions))}__init27() {this.hget=(...n)=>this.chain(new F(n,this.commandOptions))}__init28() {this.hgetall=(...n)=>this.chain(new q(n,this.commandOptions))}__init29() {this.hincrby=(...n)=>this.chain(new $(n,this.commandOptions))}__init30() {this.hincrbyfloat=(...n)=>this.chain(new X(n,this.commandOptions))}__init31() {this.hkeys=(...n)=>this.chain(new j(n,this.commandOptions))}__init32() {this.hlen=(...n)=>this.chain(new Y(n,this.commandOptions))}__init33() {this.hmget=(...n)=>this.chain(new W(n,this.commandOptions))}__init34() {this.hmset=(n,t)=>this.chain(new V([n,t],this.commandOptions))}__init35() {this.hrandfield=(n,t,o)=>this.chain(new _([n,t,o],this.commandOptions))}__init36() {this.hscan=(...n)=>this.chain(new Q(n,this.commandOptions))}__init37() {this.hset=(n,t)=>this.chain(new nn([n,t],this.commandOptions))}__init38() {this.hsetnx=(n,t,o)=>this.chain(new tn([n,t,o],this.commandOptions))}__init39() {this.hstrlen=(...n)=>this.chain(new en(n,this.commandOptions))}__init40() {this.hvals=(...n)=>this.chain(new on(n,this.commandOptions))}__init41() {this.incr=(...n)=>this.chain(new sn(n,this.commandOptions))}__init42() {this.incrby=(...n)=>this.chain(new mn(n,this.commandOptions))}__init43() {this.incrbyfloat=(...n)=>this.chain(new rn(n,this.commandOptions))}__init44() {this.keys=(...n)=>this.chain(new Mn(n,this.commandOptions))}__init45() {this.lindex=(...n)=>this.chain(new vn(n,this.commandOptions))}__init46() {this.linsert=(n,t,o,m)=>this.chain(new En([n,t,o,m],this.commandOptions))}__init47() {this.llen=(...n)=>this.chain(new zn(n,this.commandOptions))}__init48() {this.lmove=(...n)=>this.chain(new Jn(n,this.commandOptions))}__init49() {this.lpop=(...n)=>this.chain(new Pn(n,this.commandOptions))}__init50() {this.lpos=(...n)=>this.chain(new In(n,this.commandOptions))}__init51() {this.lpush=(n,...t)=>this.chain(new Kn([n,...t],this.commandOptions))}__init52() {this.lpushx=(n,...t)=>this.chain(new Ln([n,...t],this.commandOptions))}__init53() {this.lrange=(...n)=>this.chain(new Zn(n,this.commandOptions))}__init54() {this.lrem=(n,t,o)=>this.chain(new Nn([n,t,o],this.commandOptions))}__init55() {this.lset=(n,t,o)=>this.chain(new Gn([n,t,o],this.commandOptions))}__init56() {this.ltrim=(...n)=>this.chain(new Bn(n,this.commandOptions))}__init57() {this.mget=(...n)=>this.chain(new Un(n,this.commandOptions))}__init58() {this.mset=n=>this.chain(new Hn([n],this.commandOptions))}__init59() {this.msetnx=n=>this.chain(new Fn([n],this.commandOptions))}__init60() {this.persist=(...n)=>this.chain(new qn(n,this.commandOptions))}__init61() {this.pexpire=(...n)=>this.chain(new $n(n,this.commandOptions))}__init62() {this.pexpireat=(...n)=>this.chain(new Xn(n,this.commandOptions))}__init63() {this.ping=n=>this.chain(new jn(n,this.commandOptions))}__init64() {this.psetex=(n,t,o)=>this.chain(new Yn([n,t,o],this.commandOptions))}__init65() {this.pttl=(...n)=>this.chain(new Wn(n,this.commandOptions))}__init66() {this.publish=(...n)=>this.chain(new Vn(n,this.commandOptions))}__init67() {this.randomkey=()=>this.chain(new _n(this.commandOptions))}__init68() {this.rename=(...n)=>this.chain(new Qn(n,this.commandOptions))}__init69() {this.renamenx=(...n)=>this.chain(new nt(n,this.commandOptions))}__init70() {this.rpop=(...n)=>this.chain(new tt(n,this.commandOptions))}__init71() {this.rpush=(n,...t)=>this.chain(new et([n,...t],this.commandOptions))}__init72() {this.rpushx=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions))}__init73() {this.sadd=(n,...t)=>this.chain(new st([n,...t],this.commandOptions))}__init74() {this.scan=(...n)=>this.chain(new mt(n,this.commandOptions))}__init75() {this.scard=(...n)=>this.chain(new rt(n,this.commandOptions))}__init76() {this.scriptExists=(...n)=>this.chain(new at(n,this.commandOptions))}__init77() {this.scriptFlush=(...n)=>this.chain(new it(n,this.commandOptions))}__init78() {this.scriptLoad=(...n)=>this.chain(new pt(n,this.commandOptions))}__init79() {this.sdiff=(...n)=>this.chain(new dt(n,this.commandOptions))}__init80() {this.sdiffstore=(...n)=>this.chain(new ct(n,this.commandOptions))}__init81() {this.set=(n,t,o)=>this.chain(new ut([n,t,o],this.commandOptions))}__init82() {this.setbit=(...n)=>this.chain(new ht(n,this.commandOptions))}__init83() {this.setex=(n,t,o)=>this.chain(new Ct([n,t,o],this.commandOptions))}__init84() {this.setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions))}__init85() {this.setrange=(...n)=>this.chain(new gt(n,this.commandOptions))}__init86() {this.sinter=(...n)=>this.chain(new xt(n,this.commandOptions))}__init87() {this.sinterstore=(...n)=>this.chain(new ft(n,this.commandOptions))}__init88() {this.sismember=(n,t)=>this.chain(new yt([n,t],this.commandOptions))}__init89() {this.smembers=(...n)=>this.chain(new bt(n,this.commandOptions))}__init90() {this.smismember=(n,t)=>this.chain(new Ot([n,t],this.commandOptions))}__init91() {this.smove=(n,t,o)=>this.chain(new Tt([n,t,o],this.commandOptions))}__init92() {this.spop=(...n)=>this.chain(new wt(n,this.commandOptions))}__init93() {this.srandmember=(...n)=>this.chain(new Dt(n,this.commandOptions))}__init94() {this.srem=(n,...t)=>this.chain(new kt([n,...t],this.commandOptions))}__init95() {this.sscan=(...n)=>this.chain(new At(n,this.commandOptions))}__init96() {this.strlen=(...n)=>this.chain(new St(n,this.commandOptions))}__init97() {this.sunion=(...n)=>this.chain(new Rt(n,this.commandOptions))}__init98() {this.sunionstore=(...n)=>this.chain(new Mt(n,this.commandOptions))}__init99() {this.time=()=>this.chain(new vt(this.commandOptions))}__init100() {this.touch=(...n)=>this.chain(new Et(n,this.commandOptions))}__init101() {this.ttl=(...n)=>this.chain(new zt(n,this.commandOptions))}__init102() {this.type=(...n)=>this.chain(new Jt(n,this.commandOptions))}__init103() {this.unlink=(...n)=>this.chain(new Pt(n,this.commandOptions))}__init104() {this.zadd=(...n)=>"score"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions))}__init105() {this.zcard=(...n)=>this.chain(new It(n,this.commandOptions))}__init106() {this.zcount=(...n)=>this.chain(new Kt(n,this.commandOptions))}__init107() {this.zincrby=(n,t,o)=>this.chain(new Lt([n,t,o],this.commandOptions))}__init108() {this.zinterstore=(...n)=>this.chain(new Zt(n,this.commandOptions))}__init109() {this.zlexcount=(...n)=>this.chain(new Nt(n,this.commandOptions))}__init110() {this.zmscore=(...n)=>this.chain(new ne(n,this.commandOptions))}__init111() {this.zpopmax=(...n)=>this.chain(new Gt(n,this.commandOptions))}__init112() {this.zpopmin=(...n)=>this.chain(new Bt(n,this.commandOptions))}__init113() {this.zrange=(...n)=>this.chain(new Ut(n,this.commandOptions))}__init114() {this.zrank=(n,t)=>this.chain(new Ht([n,t],this.commandOptions))}__init115() {this.zrem=(n,...t)=>this.chain(new Ft([n,...t],this.commandOptions))}__init116() {this.zremrangebylex=(...n)=>this.chain(new qt(n,this.commandOptions))}__init117() {this.zremrangebyrank=(...n)=>this.chain(new $t(n,this.commandOptions))}__init118() {this.zremrangebyscore=(...n)=>this.chain(new Xt(n,this.commandOptions))}__init119() {this.zrevrank=(n,t)=>this.chain(new jt([n,t],this.commandOptions))}__init120() {this.zscan=(...n)=>this.chain(new Yt(n,this.commandOptions))}__init121() {this.zscore=(n,t)=>this.chain(new Wt([n,t],this.commandOptions))}__init122() {this.zunionstore=(...n)=>this.chain(new _t(n,this.commandOptions))}__init123() {this.zunion=(...n)=>this.chain(new Vt(n,this.commandOptions))}get json(){return{arrappend:(...n)=>this.chain(new an(n,this.commandOptions)),arrindex:(...n)=>this.chain(new pn(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new dn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new cn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new un(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new hn(n,this.commandOptions)),clear:(...n)=>this.chain(new Cn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new gn(n,this.commandOptions)),geoadd:(...n)=>this.chain(new E(n,this.commandOptions)),geodist:(...n)=>this.chain(new z(n,this.commandOptions)),geopos:(...n)=>this.chain(new J(n,this.commandOptions)),geohash:(...n)=>this.chain(new P(n,this.commandOptions)),geosearch:(...n)=>this.chain(new I(n,this.commandOptions)),geosearchstore:(...n)=>this.chain(new K(n,this.commandOptions)),get:(...n)=>this.chain(new xn(n,this.commandOptions)),mget:(...n)=>this.chain(new fn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new yn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new bn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new On(n,this.commandOptions)),objlen:(...n)=>this.chain(new Tn(n,this.commandOptions)),resp:(...n)=>this.chain(new wn(n,this.commandOptions)),set:(...n)=>this.chain(new Dn(n,this.commandOptions)),strappend:(...n)=>this.chain(new kn(n,this.commandOptions)),strlen:(...n)=>this.chain(new An(n,this.commandOptions)),toggle:(...n)=>this.chain(new Sn(n,this.commandOptions)),type:(...n)=>this.chain(new Rn(n,this.commandOptions))}}}, _class);var _enchex = __nccwpck_require__(680); var _enchex2 = _interopRequireDefault(_enchex);var _sha1 = __nccwpck_require__(595); var _sha12 = _interopRequireDefault(_sha1);var me=class{constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return _enchex2.default.stringify(_sha12.default.call(void 0, n))}};var ue= (_class2 =class{constructor(n,t){;_class2.prototype.__init124.call(this);_class2.prototype.__init125.call(this);_class2.prototype.__init126.call(this);_class2.prototype.__init127.call(this);_class2.prototype.__init128.call(this);_class2.prototype.__init129.call(this);_class2.prototype.__init130.call(this);_class2.prototype.__init131.call(this);_class2.prototype.__init132.call(this);_class2.prototype.__init133.call(this);_class2.prototype.__init134.call(this);_class2.prototype.__init135.call(this);_class2.prototype.__init136.call(this);_class2.prototype.__init137.call(this);_class2.prototype.__init138.call(this);_class2.prototype.__init139.call(this);_class2.prototype.__init140.call(this);_class2.prototype.__init141.call(this);_class2.prototype.__init142.call(this);_class2.prototype.__init143.call(this);_class2.prototype.__init144.call(this);_class2.prototype.__init145.call(this);_class2.prototype.__init146.call(this);_class2.prototype.__init147.call(this);_class2.prototype.__init148.call(this);_class2.prototype.__init149.call(this);_class2.prototype.__init150.call(this);_class2.prototype.__init151.call(this);_class2.prototype.__init152.call(this);_class2.prototype.__init153.call(this);_class2.prototype.__init154.call(this);_class2.prototype.__init155.call(this);_class2.prototype.__init156.call(this);_class2.prototype.__init157.call(this);_class2.prototype.__init158.call(this);_class2.prototype.__init159.call(this);_class2.prototype.__init160.call(this);_class2.prototype.__init161.call(this);_class2.prototype.__init162.call(this);_class2.prototype.__init163.call(this);_class2.prototype.__init164.call(this);_class2.prototype.__init165.call(this);_class2.prototype.__init166.call(this);_class2.prototype.__init167.call(this);_class2.prototype.__init168.call(this);_class2.prototype.__init169.call(this);_class2.prototype.__init170.call(this);_class2.prototype.__init171.call(this);_class2.prototype.__init172.call(this);_class2.prototype.__init173.call(this);_class2.prototype.__init174.call(this);_class2.prototype.__init175.call(this);_class2.prototype.__init176.call(this);_class2.prototype.__init177.call(this);_class2.prototype.__init178.call(this);_class2.prototype.__init179.call(this);_class2.prototype.__init180.call(this);_class2.prototype.__init181.call(this);_class2.prototype.__init182.call(this);_class2.prototype.__init183.call(this);_class2.prototype.__init184.call(this);_class2.prototype.__init185.call(this);_class2.prototype.__init186.call(this);_class2.prototype.__init187.call(this);_class2.prototype.__init188.call(this);_class2.prototype.__init189.call(this);_class2.prototype.__init190.call(this);_class2.prototype.__init191.call(this);_class2.prototype.__init192.call(this);_class2.prototype.__init193.call(this);_class2.prototype.__init194.call(this);_class2.prototype.__init195.call(this);_class2.prototype.__init196.call(this);_class2.prototype.__init197.call(this);_class2.prototype.__init198.call(this);_class2.prototype.__init199.call(this);_class2.prototype.__init200.call(this);_class2.prototype.__init201.call(this);_class2.prototype.__init202.call(this);_class2.prototype.__init203.call(this);_class2.prototype.__init204.call(this);_class2.prototype.__init205.call(this);_class2.prototype.__init206.call(this);_class2.prototype.__init207.call(this);_class2.prototype.__init208.call(this);_class2.prototype.__init209.call(this);_class2.prototype.__init210.call(this);_class2.prototype.__init211.call(this);_class2.prototype.__init212.call(this);_class2.prototype.__init213.call(this);_class2.prototype.__init214.call(this);_class2.prototype.__init215.call(this);_class2.prototype.__init216.call(this);_class2.prototype.__init217.call(this);_class2.prototype.__init218.call(this);_class2.prototype.__init219.call(this);_class2.prototype.__init220.call(this);_class2.prototype.__init221.call(this);_class2.prototype.__init222.call(this);_class2.prototype.__init223.call(this);_class2.prototype.__init224.call(this);_class2.prototype.__init225.call(this);_class2.prototype.__init226.call(this);_class2.prototype.__init227.call(this);_class2.prototype.__init228.call(this);_class2.prototype.__init229.call(this);_class2.prototype.__init230.call(this);_class2.prototype.__init231.call(this);_class2.prototype.__init232.call(this);_class2.prototype.__init233.call(this);_class2.prototype.__init234.call(this);_class2.prototype.__init235.call(this);_class2.prototype.__init236.call(this);_class2.prototype.__init237.call(this);_class2.prototype.__init238.call(this);_class2.prototype.__init239.call(this);_class2.prototype.__init240.call(this);_class2.prototype.__init241.call(this);_class2.prototype.__init242.call(this);_class2.prototype.__init243.call(this);_class2.prototype.__init244.call(this);_class2.prototype.__init245.call(this);_class2.prototype.__init246.call(this);_class2.prototype.__init247.call(this);_class2.prototype.__init248.call(this);_class2.prototype.__init249.call(this);_class2.prototype.__init250.call(this);_class2.prototype.__init251.call(this);this.client=n,this.opts=t,this.enableTelemetry=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _56 => _56.enableTelemetry]), () => (!0))}get json(){return{arrappend:(...n)=>new an(n,this.opts).exec(this.client),arrindex:(...n)=>new pn(n,this.opts).exec(this.client),arrinsert:(...n)=>new dn(n,this.opts).exec(this.client),arrlen:(...n)=>new cn(n,this.opts).exec(this.client),arrpop:(...n)=>new un(n,this.opts).exec(this.client),arrtrim:(...n)=>new hn(n,this.opts).exec(this.client),clear:(...n)=>new Cn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new gn(n,this.opts).exec(this.client),geoadd:(...n)=>new E(n,this.opts).exec(this.client),geopos:(...n)=>new J(n,this.opts).exec(this.client),geodist:(...n)=>new z(n,this.opts).exec(this.client),geohash:(...n)=>new P(n,this.opts).exec(this.client),geosearch:(...n)=>new I(n,this.opts).exec(this.client),geosearchstore:(...n)=>new K(n,this.opts).exec(this.client),get:(...n)=>new xn(n,this.opts).exec(this.client),mget:(...n)=>new fn(n,this.opts).exec(this.client),numincrby:(...n)=>new yn(n,this.opts).exec(this.client),nummultby:(...n)=>new bn(n,this.opts).exec(this.client),objkeys:(...n)=>new On(n,this.opts).exec(this.client),objlen:(...n)=>new Tn(n,this.opts).exec(this.client),resp:(...n)=>new wn(n,this.opts).exec(this.client),set:(...n)=>new Dn(n,this.opts).exec(this.client),strappend:(...n)=>new kn(n,this.opts).exec(this.client),strlen:(...n)=>new An(n,this.opts).exec(this.client),toggle:(...n)=>new Sn(n,this.opts).exec(this.client),type:(...n)=>new Rn(n,this.opts).exec(this.client)}}__init124() {this.use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)}}__init125() {this.addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch (e12){}}}createScript(n){return new me(this,n)}__init126() {this.pipeline=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!1})}__init127() {this.multi=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!0})}__init128() {this.append=(...n)=>new C(n,this.opts).exec(this.client)}__init129() {this.bitcount=(...n)=>new l(n,this.opts).exec(this.client)}__init130() {this.bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client)}__init131() {this.bitpos=(...n)=>new x(n,this.opts).exec(this.client)}__init132() {this.copy=(...n)=>new f(n,this.opts).exec(this.client)}__init133() {this.dbsize=()=>new y(this.opts).exec(this.client)}__init134() {this.decr=(...n)=>new b(n,this.opts).exec(this.client)}__init135() {this.decrby=(...n)=>new O(n,this.opts).exec(this.client)}__init136() {this.del=(...n)=>new T(n,this.opts).exec(this.client)}__init137() {this.echo=(...n)=>new w(n,this.opts).exec(this.client)}__init138() {this.eval=(...n)=>new D(n,this.opts).exec(this.client)}__init139() {this.evalsha=(...n)=>new k(n,this.opts).exec(this.client)}__init140() {this.exists=(...n)=>new A(n,this.opts).exec(this.client)}__init141() {this.expire=(...n)=>new S(n,this.opts).exec(this.client)}__init142() {this.expireat=(...n)=>new R(n,this.opts).exec(this.client)}__init143() {this.flushall=n=>new M(n,this.opts).exec(this.client)}__init144() {this.flushdb=(...n)=>new v(n,this.opts).exec(this.client)}__init145() {this.get=(...n)=>new L(n,this.opts).exec(this.client)}__init146() {this.getbit=(...n)=>new Z(n,this.opts).exec(this.client)}__init147() {this.getdel=(...n)=>new N(n,this.opts).exec(this.client)}__init148() {this.getrange=(...n)=>new G(n,this.opts).exec(this.client)}__init149() {this.getset=(n,t)=>new B([n,t],this.opts).exec(this.client)}__init150() {this.hdel=(...n)=>new U(n,this.opts).exec(this.client)}__init151() {this.hexists=(...n)=>new H(n,this.opts).exec(this.client)}__init152() {this.hget=(...n)=>new F(n,this.opts).exec(this.client)}__init153() {this.hgetall=(...n)=>new q(n,this.opts).exec(this.client)}__init154() {this.hincrby=(...n)=>new $(n,this.opts).exec(this.client)}__init155() {this.hincrbyfloat=(...n)=>new X(n,this.opts).exec(this.client)}__init156() {this.hkeys=(...n)=>new j(n,this.opts).exec(this.client)}__init157() {this.hlen=(...n)=>new Y(n,this.opts).exec(this.client)}__init158() {this.hmget=(...n)=>new W(n,this.opts).exec(this.client)}__init159() {this.hmset=(n,t)=>new V([n,t],this.opts).exec(this.client)}__init160() {this.hrandfield=(n,t,o)=>new _([n,t,o],this.opts).exec(this.client)}__init161() {this.hscan=(...n)=>new Q(n,this.opts).exec(this.client)}__init162() {this.hset=(n,t)=>new nn([n,t],this.opts).exec(this.client)}__init163() {this.hsetnx=(n,t,o)=>new tn([n,t,o],this.opts).exec(this.client)}__init164() {this.hstrlen=(...n)=>new en(n,this.opts).exec(this.client)}__init165() {this.hvals=(...n)=>new on(n,this.opts).exec(this.client)}__init166() {this.incr=(...n)=>new sn(n,this.opts).exec(this.client)}__init167() {this.incrby=(...n)=>new mn(n,this.opts).exec(this.client)}__init168() {this.incrbyfloat=(...n)=>new rn(n,this.opts).exec(this.client)}__init169() {this.keys=(...n)=>new Mn(n,this.opts).exec(this.client)}__init170() {this.lindex=(...n)=>new vn(n,this.opts).exec(this.client)}__init171() {this.linsert=(n,t,o,m)=>new En([n,t,o,m],this.opts).exec(this.client)}__init172() {this.llen=(...n)=>new zn(n,this.opts).exec(this.client)}__init173() {this.lmove=(...n)=>new Jn(n,this.opts).exec(this.client)}__init174() {this.lpop=(...n)=>new Pn(n,this.opts).exec(this.client)}__init175() {this.lpos=(...n)=>new In(n,this.opts).exec(this.client)}__init176() {this.lpush=(n,...t)=>new Kn([n,...t],this.opts).exec(this.client)}__init177() {this.lpushx=(n,...t)=>new Ln([n,...t],this.opts).exec(this.client)}__init178() {this.lrange=(...n)=>new Zn(n,this.opts).exec(this.client)}__init179() {this.lrem=(n,t,o)=>new Nn([n,t,o],this.opts).exec(this.client)}__init180() {this.lset=(n,t,o)=>new Gn([n,t,o],this.opts).exec(this.client)}__init181() {this.ltrim=(...n)=>new Bn(n,this.opts).exec(this.client)}__init182() {this.mget=(...n)=>new Un(n,this.opts).exec(this.client)}__init183() {this.mset=n=>new Hn([n],this.opts).exec(this.client)}__init184() {this.msetnx=n=>new Fn([n],this.opts).exec(this.client)}__init185() {this.persist=(...n)=>new qn(n,this.opts).exec(this.client)}__init186() {this.pexpire=(...n)=>new $n(n,this.opts).exec(this.client)}__init187() {this.pexpireat=(...n)=>new Xn(n,this.opts).exec(this.client)}__init188() {this.ping=n=>new jn(n,this.opts).exec(this.client)}__init189() {this.psetex=(n,t,o)=>new Yn([n,t,o],this.opts).exec(this.client)}__init190() {this.pttl=(...n)=>new Wn(n,this.opts).exec(this.client)}__init191() {this.publish=(...n)=>new Vn(n,this.opts).exec(this.client)}__init192() {this.randomkey=()=>new _n().exec(this.client)}__init193() {this.rename=(...n)=>new Qn(n,this.opts).exec(this.client)}__init194() {this.renamenx=(...n)=>new nt(n,this.opts).exec(this.client)}__init195() {this.rpop=(...n)=>new tt(n,this.opts).exec(this.client)}__init196() {this.rpush=(n,...t)=>new et([n,...t],this.opts).exec(this.client)}__init197() {this.rpushx=(n,...t)=>new ot([n,...t],this.opts).exec(this.client)}__init198() {this.sadd=(n,...t)=>new st([n,...t],this.opts).exec(this.client)}__init199() {this.scan=(...n)=>new mt(n,this.opts).exec(this.client)}__init200() {this.scard=(...n)=>new rt(n,this.opts).exec(this.client)}__init201() {this.scriptExists=(...n)=>new at(n,this.opts).exec(this.client)}__init202() {this.scriptFlush=(...n)=>new it(n,this.opts).exec(this.client)}__init203() {this.scriptLoad=(...n)=>new pt(n,this.opts).exec(this.client)}__init204() {this.sdiff=(...n)=>new dt(n,this.opts).exec(this.client)}__init205() {this.sdiffstore=(...n)=>new ct(n,this.opts).exec(this.client)}__init206() {this.set=(n,t,o)=>new ut([n,t,o],this.opts).exec(this.client)}__init207() {this.setbit=(...n)=>new ht(n,this.opts).exec(this.client)}__init208() {this.setex=(n,t,o)=>new Ct([n,t,o],this.opts).exec(this.client)}__init209() {this.setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client)}__init210() {this.setrange=(...n)=>new gt(n,this.opts).exec(this.client)}__init211() {this.sinter=(...n)=>new xt(n,this.opts).exec(this.client)}__init212() {this.sinterstore=(...n)=>new ft(n,this.opts).exec(this.client)}__init213() {this.sismember=(n,t)=>new yt([n,t],this.opts).exec(this.client)}__init214() {this.smismember=(n,t)=>new Ot([n,t],this.opts).exec(this.client)}__init215() {this.smembers=(...n)=>new bt(n,this.opts).exec(this.client)}__init216() {this.smove=(n,t,o)=>new Tt([n,t,o],this.opts).exec(this.client)}__init217() {this.spop=(...n)=>new wt(n,this.opts).exec(this.client)}__init218() {this.srandmember=(...n)=>new Dt(n,this.opts).exec(this.client)}__init219() {this.srem=(n,...t)=>new kt([n,...t],this.opts).exec(this.client)}__init220() {this.sscan=(...n)=>new At(n,this.opts).exec(this.client)}__init221() {this.strlen=(...n)=>new St(n,this.opts).exec(this.client)}__init222() {this.sunion=(...n)=>new Rt(n,this.opts).exec(this.client)}__init223() {this.sunionstore=(...n)=>new Mt(n,this.opts).exec(this.client)}__init224() {this.time=()=>new vt().exec(this.client)}__init225() {this.touch=(...n)=>new Et(n,this.opts).exec(this.client)}__init226() {this.ttl=(...n)=>new zt(n,this.opts).exec(this.client)}__init227() {this.type=(...n)=>new Jt(n,this.opts).exec(this.client)}__init228() {this.unlink=(...n)=>new Pt(n,this.opts).exec(this.client)}__init229() {this.xadd=(...n)=>new oe(n,this.opts).exec(this.client)}__init230() {this.xrange=(...n)=>new se(n,this.opts).exec(this.client)}__init231() {this.zadd=(...n)=>"score"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client)}__init232() {this.zcard=(...n)=>new It(n,this.opts).exec(this.client)}__init233() {this.zcount=(...n)=>new Kt(n,this.opts).exec(this.client)}__init234() {this.zdiffstore=(...n)=>new Qt(n,this.opts).exec(this.client)}__init235() {this.zincrby=(n,t,o)=>new Lt([n,t,o],this.opts).exec(this.client)}__init236() {this.zinterstore=(...n)=>new Zt(n,this.opts).exec(this.client)}__init237() {this.zlexcount=(...n)=>new Nt(n,this.opts).exec(this.client)}__init238() {this.zmscore=(...n)=>new ne(n,this.opts).exec(this.client)}__init239() {this.zpopmax=(...n)=>new Gt(n,this.opts).exec(this.client)}__init240() {this.zpopmin=(...n)=>new Bt(n,this.opts).exec(this.client)}__init241() {this.zrange=(...n)=>new Ut(n,this.opts).exec(this.client)}__init242() {this.zrank=(n,t)=>new Ht([n,t],this.opts).exec(this.client)}__init243() {this.zrem=(n,...t)=>new Ft([n,...t],this.opts).exec(this.client)}__init244() {this.zremrangebylex=(...n)=>new qt(n,this.opts).exec(this.client)}__init245() {this.zremrangebyrank=(...n)=>new $t(n,this.opts).exec(this.client)}__init246() {this.zremrangebyscore=(...n)=>new Xt(n,this.opts).exec(this.client)}__init247() {this.zrevrank=(n,t)=>new jt([n,t],this.opts).exec(this.client)}__init248() {this.zscan=(...n)=>new Yt(n,this.opts).exec(this.client)}__init249() {this.zscore=(n,t)=>new Wt([n,t],this.opts).exec(this.client)}__init250() {this.zunion=(...n)=>new Vt(n,this.opts).exec(this.client)}__init251() {this.zunionstore=(...n)=>new _t(n,this.opts).exec(this.client)}}, _class2);var cC="v1.24.3";exports.a = ie; exports.b = ue; exports.c = cC; +Object.defineProperty(exports, "__esModule", ({value: true})); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;var c=class extends Error{constructor(n){super(n),this.name="UpstashError"}};var ie=class{constructor(n){this.options={backend:_optionalChain([n, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.backend]),agent:n.agent,responseEncoding:_nullishCoalesce(n.responseEncoding, () => ("base64")),cache:n.cache},this.baseUrl=n.baseUrl.replace(/\/$/,""),this.headers={"Content-Type":"application/json",...n.headers},this.options.responseEncoding==="base64"&&(this.headers["Upstash-Encoding"]="base64"),typeof _optionalChain([n, 'optionalAccess', _4 => _4.retry])=="boolean"&&_optionalChain([n, 'optionalAccess', _5 => _5.retry])===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _6 => _6.retry, 'optionalAccess', _7 => _7.retries]), () => (5)),backoff:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _8 => _8.retry, 'optionalAccess', _9 => _9.backoff]), () => ((t=>Math.exp(t)*50)))}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(","):o[m]=r),o}this.headers=t(this.headers,"Upstash-Telemetry-Runtime",n.runtime),this.headers=t(this.headers,"Upstash-Telemetry-Platform",n.platform),this.headers=t(this.headers,"Upstash-Telemetry-Sdk",n.sdk)}async request(n){let t={cache:this.options.cache,method:"POST",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:_optionalChain([this, 'access', _10 => _10.options, 'optionalAccess', _11 => _11.agent]),backend:_optionalChain([this, 'access', _12 => _12.options, 'optionalAccess', _13 => _13.backend])},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,..._nullishCoalesce(n.path, () => ([]))].join("/"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw _nullishCoalesce(m, () => (new Error("Exhausted all retries")));let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return _optionalChain([this, 'access', _14 => _14.options, 'optionalAccess', _15 => _15.responseEncoding])==="base64"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:re(i),error:p})):{result:re(r.result),error:r.error}:r}};function pe(s){let n="";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;rtypeof t=="string"?pe(t):Array.isArray(t)?t.map(re):t):n=null;break}case"string":{n=s==="OK"?"OK":pe(s);break}default:break}return n}function de(s){let n=Array.isArray(s)?s.map(t=>{try{return de(t)}catch (e3){return t}}):JSON.parse(s);return typeof n=="number"&&n.toString()!==s?s:n}function ce(s){try{return de(s)}catch (e4){return s}}var he=s=>{switch(typeof s){case"string":case"number":case"boolean":return s;default:return JSON.stringify(s)}},e=class{constructor(n,t){this.serialize=he,this.deserialize=typeof _optionalChain([t, 'optionalAccess', _16 => _16.automaticDeserialization])>"u"||t.automaticDeserialization?_nullishCoalesce(_optionalChain([t, 'optionalAccess', _17 => _17.deserialize]), () => (ce)):o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>"u")throw new Error("Request did not return a result");return this.deserialize(t)}};var C=class extends e{constructor(n,t){super(["append",...n],t)}};var l=class extends e{constructor([n,t,o],m){let r=["bitcount",n];typeof t=="number"&&r.push(t),typeof o=="number"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super(["bitop",...n],t)}};var x=class extends e{constructor(n,t){super(["bitpos",...n],t)}};var f=class extends e{constructor([n,t,o],m){super(["COPY",n,t,..._optionalChain([o, 'optionalAccess', _18 => _18.replace])?["REPLACE"]:[]],{...m,deserialize(r){return r>0?"COPIED":"NOT_COPIED"}})}};var y=class extends e{constructor(n){super(["dbsize"],n)}};var b=class extends e{constructor(n,t){super(["decr",...n],t)}};var O=class extends e{constructor(n,t){super(["decrby",...n],t)}};var T=class extends e{constructor(n,t){super(["del",...n],t)}};var w=class extends e{constructor(n,t){super(["echo",...n],t)}};var D=class extends e{constructor([n,t,o],m){super(["eval",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var k=class extends e{constructor([n,t,o],m){super(["evalsha",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var A=class extends e{constructor(n,t){super(["exists",...n],t)}};var S=class extends e{constructor(n,t){super(["expire",...n],t)}};var R=class extends e{constructor(n,t){super(["expireat",...n],t)}};var M=class extends e{constructor(n,t){let o=["flushall"];n&&n.length>0&&n[0].async&&o.push("async"),super(o,t)}};var v=class extends e{constructor([n],t){let o=["flushdb"];_optionalChain([n, 'optionalAccess', _19 => _19.async])&&o.push("async"),super(o,t)}};var E=class extends e{constructor([n,t,...o],m){let r=["geoadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"latitude"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var z=class extends e{constructor([n,t,o,m="M"],r){super(["GEODIST",n,t,o,m],r)}};var J=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOPOS",o,...m],{deserialize:r=>Ce(r),...t})}};function Ce(s){let n=[];for(let t of s)!_optionalChain([t, 'optionalAccess', _20 => _20[0]])||!_optionalChain([t, 'optionalAccess', _21 => _21[1]])||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var P=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super(["GEOHASH",o,...m],t)}};var I=class extends e{constructor([n,t,o,m,r],a){let i=["GEOSEARCH",n];(t.type==="FROMMEMBER"||t.type==="frommember")&&i.push(t.type,t.member),(t.type==="FROMLONLAT"||t.type==="fromlonlat")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type==="BYRADIUS"||o.type==="byradius")&&i.push(o.type,o.radius,o.radiusType),(o.type==="BYBOX"||o.type==="bybox")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),_optionalChain([r, 'optionalAccess', _22 => _22.count])&&i.push(r.count.limit,...r.count.any?["ANY"]:[]);let p=ae=>!_optionalChain([r, 'optionalAccess', _23 => _23.withCoord])&&!_optionalChain([r, 'optionalAccess', _24 => _24.withDist])&&!_optionalChain([r, 'optionalAccess', _25 => _25.withHash])?ae.map(d=>{try{return{member:JSON.parse(d)}}catch (e5){return{member:d}}}):ae.map(d=>{let ee=1,h={};try{h.member=JSON.parse(d[0])}catch (e6){h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[ee++])),r.withHash&&(h.hash=d[ee++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[ee][0]),lat:parseFloat(d[ee][1])}),h});super([...i,..._optionalChain([r, 'optionalAccess', _26 => _26.withCoord])?["WITHCOORD"]:[],..._optionalChain([r, 'optionalAccess', _27 => _27.withDist])?["WITHDIST"]:[],..._optionalChain([r, 'optionalAccess', _28 => _28.withHash])?["WITHHASH"]:[]],{...a,deserialize:p})}};var K=class extends e{constructor([n,t,o,m,r,a],i){let p=["GEOSEARCHSTORE",n,t];(o.type==="FROMMEMBER"||o.type==="frommember")&&p.push(o.type,o.member),(o.type==="FROMLONLAT"||o.type==="fromlonlat")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type==="BYRADIUS"||m.type==="byradius")&&p.push(m.type,m.radius,m.radiusType),(m.type==="BYBOX"||m.type==="bybox")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),_optionalChain([a, 'optionalAccess', _29 => _29.count])&&p.push(a.count.limit,...a.count.any?["ANY"]:[]),super([...p,..._optionalChain([a, 'optionalAccess', _30 => _30.storeDist])?["STOREDIST"]:[]],i)}};var L=class extends e{constructor(n,t){super(["get",...n],t)}};var Z=class extends e{constructor(n,t){super(["getbit",...n],t)}};var N=class extends e{constructor(n,t){super(["getdel",...n],t)}};var G=class extends e{constructor(n,t){super(["getrange",...n],t)}};var B=class extends e{constructor(n,t){super(["getset",...n],t)}};var U=class extends e{constructor(n,t){super(["hdel",...n],t)}};var H=class extends e{constructor(n,t){super(["hexists",...n],t)}};var F=class extends e{constructor(n,t){super(["hget",...n],t)}};function le(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch (e7){n[t]=o}}return n}var q=class extends e{constructor(n,t){super(["hgetall",...n],{deserialize:o=>le(o),...t})}};var $=class extends e{constructor(n,t){super(["hincrby",...n],t)}};var X=class extends e{constructor(n,t){super(["hincrbyfloat",...n],t)}};var j=class extends e{constructor([n],t){super(["hkeys",n],t)}};var Y=class extends e{constructor(n,t){super(["hlen",...n],t)}};function ge(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;oge(t,m),...o})}};var V=class extends e{constructor([n,t],o){super(["hmset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function xe(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch (e9){n[t]=o}}return n}var _=class extends e{constructor(n,t){let o=["hrandfield",n[0]];typeof n[1]=="number"&&o.push(n[1]),n[2]&&o.push("WITHVALUES"),super(o,{deserialize:n[2]?m=>xe(m):_optionalChain([t, 'optionalAccess', _31 => _31.deserialize]),...t})}};var Q=class extends e{constructor([n,t,o],m){let r=["hscan",n,t];_optionalChain([o, 'optionalAccess', _32 => _32.match])&&r.push("match",o.match),typeof _optionalChain([o, 'optionalAccess', _33 => _33.count])=="number"&&r.push("count",o.count),super(r,m)}};var nn=class extends e{constructor([n,t],o){super(["hset",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var tn=class extends e{constructor(n,t){super(["hsetnx",...n],t)}};var en=class extends e{constructor(n,t){super(["hstrlen",...n],t)}};var on=class extends e{constructor(n,t){super(["hvals",...n],t)}};var sn=class extends e{constructor(n,t){super(["incr",...n],t)}};var mn=class extends e{constructor(n,t){super(["incrby",...n],t)}};var rn=class extends e{constructor(n,t){super(["incrbyfloat",...n],t)}};var an=class extends e{constructor(n,t){super(["JSON.ARRAPPEND",...n],t)}};var pn=class extends e{constructor(n,t){super(["JSON.ARRINDEX",...n],t)}};var dn=class extends e{constructor(n,t){super(["JSON.ARRINSERT",...n],t)}};var cn=class extends e{constructor(n,t){super(["JSON.ARRLEN",n[0],_nullishCoalesce(n[1], () => ("$"))],t)}};var un=class extends e{constructor(n,t){super(["JSON.ARRPOP",...n],t)}};var hn=class extends e{constructor(n,t){let o=_nullishCoalesce(n[1], () => ("$")),m=_nullishCoalesce(n[2], () => (0)),r=_nullishCoalesce(n[3], () => (0));super(["JSON.ARRTRIM",n[0],o,m,r],t)}};var Cn=class extends e{constructor(n,t){super(["JSON.CLEAR",...n],t)}};var ln=class extends e{constructor(n,t){super(["JSON.DEL",...n],t)}};var gn=class extends e{constructor(n,t){super(["JSON.FORGET",...n],t)}};var xn=class extends e{constructor(n,t){let o=["JSON.GET"];typeof n[1]=="string"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push("INDENT",n[1].indent),n[1].newline&&o.push("NEWLINE",n[1].newline),n[1].space&&o.push("SPACE",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var fn=class extends e{constructor(n,t){super(["JSON.MGET",...n[0],n[1]],t)}};var yn=class extends e{constructor(n,t){super(["JSON.NUMINCRBY",...n],t)}};var bn=class extends e{constructor(n,t){super(["JSON.NUMMULTBY",...n],t)}};var On=class extends e{constructor(n,t){super(["JSON.OBJKEYS",...n],t)}};var Tn=class extends e{constructor(n,t){super(["JSON.OBJLEN",...n],t)}};var wn=class extends e{constructor(n,t){super(["JSON.RESP",...n],t)}};var Dn=class extends e{constructor(n,t){let o=["JSON.SET",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push("NX"):n[3].xx&&o.push("XX")),super(o,t)}};var kn=class extends e{constructor(n,t){super(["JSON.STRAPPEND",...n],t)}};var An=class extends e{constructor(n,t){super(["JSON.STRLEN",...n],t)}};var Sn=class extends e{constructor(n,t){super(["JSON.TOGGLE",...n],t)}};var Rn=class extends e{constructor(n,t){super(["JSON.TYPE",...n],t)}};var Mn=class extends e{constructor(n,t){super(["keys",...n],t)}};var vn=class extends e{constructor(n,t){super(["lindex",...n],t)}};var En=class extends e{constructor(n,t){super(["linsert",...n],t)}};var zn=class extends e{constructor(n,t){super(["llen",...n],t)}};var Jn=class extends e{constructor(n,t){super(["lmove",...n],t)}};var Pn=class extends e{constructor(n,t){super(["lpop",...n],t)}};var In=class extends e{constructor(n,t){let o=["lpos",n[0],n[1]];typeof _optionalChain([n, 'access', _34 => _34[2], 'optionalAccess', _35 => _35.rank])=="number"&&o.push("rank",n[2].rank),typeof _optionalChain([n, 'access', _36 => _36[2], 'optionalAccess', _37 => _37.count])=="number"&&o.push("count",n[2].count),typeof _optionalChain([n, 'access', _38 => _38[2], 'optionalAccess', _39 => _39.maxLen])=="number"&&o.push("maxLen",n[2].maxLen),super(o,t)}};var Kn=class extends e{constructor(n,t){super(["lpush",...n],t)}};var Ln=class extends e{constructor(n,t){super(["lpushx",...n],t)}};var Zn=class extends e{constructor(n,t){super(["lrange",...n],t)}};var Nn=class extends e{constructor(n,t){super(["lrem",...n],t)}};var Gn=class extends e{constructor(n,t){super(["lset",...n],t)}};var Bn=class extends e{constructor(n,t){super(["ltrim",...n],t)}};var Un=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super(["mget",...o],t)}};var Hn=class extends e{constructor([n],t){super(["mset",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Fn=class extends e{constructor([n],t){super(["msetnx",...Object.entries(n).flatMap(o=>o)],t)}};var qn=class extends e{constructor(n,t){super(["persist",...n],t)}};var $n=class extends e{constructor(n,t){super(["pexpire",...n],t)}};var Xn=class extends e{constructor(n,t){super(["pexpireat",...n],t)}};var jn=class extends e{constructor(n,t){let o=["ping"];typeof n<"u"&&typeof n[0]<"u"&&o.push(n[0]),super(o,t)}};var Yn=class extends e{constructor(n,t){super(["psetex",...n],t)}};var Wn=class extends e{constructor(n,t){super(["pttl",...n],t)}};var Vn=class extends e{constructor(n,t){super(["publish",...n],t)}};var _n=class extends e{constructor(n){super(["randomkey"],n)}};var Qn=class extends e{constructor(n,t){super(["rename",...n],t)}};var nt=class extends e{constructor(n,t){super(["renamenx",...n],t)}};var tt=class extends e{constructor(n,t){super(["rpop",...n],t)}};var et=class extends e{constructor(n,t){super(["rpush",...n],t)}};var ot=class extends e{constructor(n,t){super(["rpushx",...n],t)}};var st=class extends e{constructor(n,t){super(["sadd",...n],t)}};var mt=class extends e{constructor([n,t],o){let m=["scan",n];_optionalChain([t, 'optionalAccess', _40 => _40.match])&&m.push("match",t.match),typeof _optionalChain([t, 'optionalAccess', _41 => _41.count])=="number"&&m.push("count",t.count),_optionalChain([t, 'optionalAccess', _42 => _42.type])&&t.type.length>0&&m.push("type",t.type),super(m,o)}};var rt=class extends e{constructor(n,t){super(["scard",...n],t)}};var at=class extends e{constructor(n,t){super(["script","exists",...n],{deserialize:o=>o,...t})}};var it=class extends e{constructor([n],t){let o=["script","flush"];_optionalChain([n, 'optionalAccess', _43 => _43.sync])?o.push("sync"):_optionalChain([n, 'optionalAccess', _44 => _44.async])&&o.push("async"),super(o,t)}};var pt=class extends e{constructor(n,t){super(["script","load",...n],t)}};var dt=class extends e{constructor(n,t){super(["sdiff",...n],t)}};var ct=class extends e{constructor(n,t){super(["sdiffstore",...n],t)}};var ut=class extends e{constructor([n,t,o],m){let r=["set",n,t];o&&("nx"in o&&o.nx?r.push("nx"):"xx"in o&&o.xx&&r.push("xx"),"get"in o&&o.get&&r.push("get"),"ex"in o&&typeof o.ex=="number"?r.push("ex",o.ex):"px"in o&&typeof o.px=="number"?r.push("px",o.px):"exat"in o&&typeof o.exat=="number"?r.push("exat",o.exat):"pxat"in o&&typeof o.pxat=="number"?r.push("pxat",o.pxat):"keepTtl"in o&&o.keepTtl&&r.push("keepTtl")),super(r,m)}};var ht=class extends e{constructor(n,t){super(["setbit",...n],t)}};var Ct=class extends e{constructor(n,t){super(["setex",...n],t)}};var lt=class extends e{constructor(n,t){super(["setnx",...n],t)}};var gt=class extends e{constructor(n,t){super(["setrange",...n],t)}};var xt=class extends e{constructor(n,t){super(["sinter",...n],t)}};var ft=class extends e{constructor(n,t){super(["sinterstore",...n],t)}};var yt=class extends e{constructor(n,t){super(["sismember",...n],t)}};var bt=class extends e{constructor(n,t){super(["smembers",...n],t)}};var Ot=class extends e{constructor(n,t){super(["smismember",n[0],...n[1]],t)}};var Tt=class extends e{constructor(n,t){super(["smove",...n],t)}};var wt=class extends e{constructor([n,t],o){let m=["spop",n];typeof t=="number"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor([n,t],o){let m=["srandmember",n];typeof t=="number"&&m.push(t),super(m,o)}};var kt=class extends e{constructor(n,t){super(["srem",...n],t)}};var At=class extends e{constructor([n,t,o],m){let r=["sscan",n,t];_optionalChain([o, 'optionalAccess', _45 => _45.match])&&r.push("match",o.match),typeof _optionalChain([o, 'optionalAccess', _46 => _46.count])=="number"&&r.push("count",o.count),super(r,m)}};var St=class extends e{constructor(n,t){super(["strlen",...n],t)}};var Rt=class extends e{constructor(n,t){super(["sunion",...n],t)}};var Mt=class extends e{constructor(n,t){super(["sunionstore",...n],t)}};var vt=class extends e{constructor(n){super(["time"],n)}};var Et=class extends e{constructor(n,t){super(["touch",...n],t)}};var zt=class extends e{constructor(n,t){super(["ttl",...n],t)}};var Jt=class extends e{constructor(n,t){super(["type",...n],t)}};var Pt=class extends e{constructor(n,t){super(["unlink",...n],t)}};var oe=class extends e{constructor([n,t,o,m],r){let a=["XADD",n];m&&(m.nomkStream&&a.push("NOMKSTREAM"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<"u"&&a.push("LIMIT",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function fe(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch (e10){n[o][r]=a}}}return n}var se=class extends e{constructor([n,t,o,m],r){let a=["XRANGE",n,t,o];typeof m=="number"&&a.push("COUNT",m),super(a,{deserialize:i=>fe(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=["zadd",n];"nx"in t&&t.nx?r.push("nx"):"xx"in t&&t.xx&&r.push("xx"),"ch"in t&&t.ch&&r.push("ch"),"incr"in t&&t.incr&&r.push("incr"),"score"in t&&"member"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var It=class extends e{constructor(n,t){super(["zcard",...n],t)}};var Kt=class extends e{constructor(n,t){super(["zcount",...n],t)}};var Lt=class extends e{constructor(n,t){super(["zincrby",...n],t)}};var Zt=class extends e{constructor([n,t,o,m],r){let a=["zinterstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Nt=class extends e{constructor(n,t){super(["zlexcount",...n],t)}};var Gt=class extends e{constructor([n,t],o){let m=["zpopmax",n];typeof t=="number"&&m.push(t),super(m,o)}};var Bt=class extends e{constructor([n,t],o){let m=["zpopmin",n];typeof t=="number"&&m.push(t),super(m,o)}};var Ut=class extends e{constructor([n,t,o,m],r){let a=["zrange",n,t,o];_optionalChain([m, 'optionalAccess', _47 => _47.byScore])&&a.push("byscore"),_optionalChain([m, 'optionalAccess', _48 => _48.byLex])&&a.push("bylex"),_optionalChain([m, 'optionalAccess', _49 => _49.rev])&&a.push("rev"),typeof _optionalChain([m, 'optionalAccess', _50 => _50.count])<"u"&&typeof _optionalChain([m, 'optionalAccess', _51 => _51.offset])<"u"&&a.push("limit",m.offset,m.count),_optionalChain([m, 'optionalAccess', _52 => _52.withScores])&&a.push("withscores"),super(a,r)}};var Ht=class extends e{constructor(n,t){super(["zrank",...n],t)}};var Ft=class extends e{constructor(n,t){super(["zrem",...n],t)}};var qt=class extends e{constructor(n,t){super(["zremrangebylex",...n],t)}};var $t=class extends e{constructor(n,t){super(["zremrangebyrank",...n],t)}};var Xt=class extends e{constructor(n,t){super(["zremrangebyscore",...n],t)}};var jt=class extends e{constructor(n,t){super(["zrevrank",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=["zscan",n,t];_optionalChain([o, 'optionalAccess', _53 => _53.match])&&r.push("match",o.match),typeof _optionalChain([o, 'optionalAccess', _54 => _54.count])=="number"&&r.push("count",o.count),super(r,m)}};var Wt=class extends e{constructor(n,t){super(["zscore",...n],t)}};var Vt=class extends e{constructor([n,t,o],m){let r=["zunion",n];Array.isArray(t)?r.push(...t):r.push(t),o&&("weights"in o&&o.weights?r.push("weights",...o.weights):"weight"in o&&typeof o.weight=="number"&&r.push("weights",o.weight),"aggregate"in o&&r.push("aggregate",o.aggregate),_optionalChain([o, 'optionalAccess', _55 => _55.withScores])&&r.push("withscores")),super(r,m)}};var _t=class extends e{constructor([n,t,o,m],r){let a=["zunionstore",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&("weights"in m&&m.weights?a.push("weights",...m.weights):"weight"in m&&typeof m.weight=="number"&&a.push("weights",m.weight),"aggregate"in m&&a.push("aggregate",m.aggregate)),super(a,r)}};var Qt=class extends e{constructor(n,t){super(["zdiffstore",...n],t)}};var ne=class extends e{constructor(n,t){let[o,m]=n;super(["zmscore",o,...m],t)}};var te= (_class =class{constructor(n){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);_class.prototype.__init11.call(this);_class.prototype.__init12.call(this);_class.prototype.__init13.call(this);_class.prototype.__init14.call(this);_class.prototype.__init15.call(this);_class.prototype.__init16.call(this);_class.prototype.__init17.call(this);_class.prototype.__init18.call(this);_class.prototype.__init19.call(this);_class.prototype.__init20.call(this);_class.prototype.__init21.call(this);_class.prototype.__init22.call(this);_class.prototype.__init23.call(this);_class.prototype.__init24.call(this);_class.prototype.__init25.call(this);_class.prototype.__init26.call(this);_class.prototype.__init27.call(this);_class.prototype.__init28.call(this);_class.prototype.__init29.call(this);_class.prototype.__init30.call(this);_class.prototype.__init31.call(this);_class.prototype.__init32.call(this);_class.prototype.__init33.call(this);_class.prototype.__init34.call(this);_class.prototype.__init35.call(this);_class.prototype.__init36.call(this);_class.prototype.__init37.call(this);_class.prototype.__init38.call(this);_class.prototype.__init39.call(this);_class.prototype.__init40.call(this);_class.prototype.__init41.call(this);_class.prototype.__init42.call(this);_class.prototype.__init43.call(this);_class.prototype.__init44.call(this);_class.prototype.__init45.call(this);_class.prototype.__init46.call(this);_class.prototype.__init47.call(this);_class.prototype.__init48.call(this);_class.prototype.__init49.call(this);_class.prototype.__init50.call(this);_class.prototype.__init51.call(this);_class.prototype.__init52.call(this);_class.prototype.__init53.call(this);_class.prototype.__init54.call(this);_class.prototype.__init55.call(this);_class.prototype.__init56.call(this);_class.prototype.__init57.call(this);_class.prototype.__init58.call(this);_class.prototype.__init59.call(this);_class.prototype.__init60.call(this);_class.prototype.__init61.call(this);_class.prototype.__init62.call(this);_class.prototype.__init63.call(this);_class.prototype.__init64.call(this);_class.prototype.__init65.call(this);_class.prototype.__init66.call(this);_class.prototype.__init67.call(this);_class.prototype.__init68.call(this);_class.prototype.__init69.call(this);_class.prototype.__init70.call(this);_class.prototype.__init71.call(this);_class.prototype.__init72.call(this);_class.prototype.__init73.call(this);_class.prototype.__init74.call(this);_class.prototype.__init75.call(this);_class.prototype.__init76.call(this);_class.prototype.__init77.call(this);_class.prototype.__init78.call(this);_class.prototype.__init79.call(this);_class.prototype.__init80.call(this);_class.prototype.__init81.call(this);_class.prototype.__init82.call(this);_class.prototype.__init83.call(this);_class.prototype.__init84.call(this);_class.prototype.__init85.call(this);_class.prototype.__init86.call(this);_class.prototype.__init87.call(this);_class.prototype.__init88.call(this);_class.prototype.__init89.call(this);_class.prototype.__init90.call(this);_class.prototype.__init91.call(this);_class.prototype.__init92.call(this);_class.prototype.__init93.call(this);_class.prototype.__init94.call(this);_class.prototype.__init95.call(this);_class.prototype.__init96.call(this);_class.prototype.__init97.call(this);_class.prototype.__init98.call(this);_class.prototype.__init99.call(this);_class.prototype.__init100.call(this);_class.prototype.__init101.call(this);_class.prototype.__init102.call(this);_class.prototype.__init103.call(this);_class.prototype.__init104.call(this);_class.prototype.__init105.call(this);_class.prototype.__init106.call(this);_class.prototype.__init107.call(this);_class.prototype.__init108.call(this);_class.prototype.__init109.call(this);_class.prototype.__init110.call(this);_class.prototype.__init111.call(this);_class.prototype.__init112.call(this);_class.prototype.__init113.call(this);_class.prototype.__init114.call(this);_class.prototype.__init115.call(this);_class.prototype.__init116.call(this);_class.prototype.__init117.call(this);_class.prototype.__init118.call(this);_class.prototype.__init119.call(this);_class.prototype.__init120.call(this);_class.prototype.__init121.call(this);_class.prototype.__init122.call(this);_class.prototype.__init123.call(this);this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=_nullishCoalesce(n.multiExec, () => (!1))}__init() {this.exec=async()=>{if(this.commands.length===0)throw new Error("Pipeline is empty");let n=this.multiExec?["multi-exec"]:["pipeline"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})}}length(){return this.commands.length}chain(n){return this.commands.push(n),this}__init2() {this.append=(...n)=>this.chain(new C(n,this.commandOptions))}__init3() {this.bitcount=(...n)=>this.chain(new l(n,this.commandOptions))}__init4() {this.bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions))}__init5() {this.bitpos=(...n)=>this.chain(new x(n,this.commandOptions))}__init6() {this.copy=(...n)=>this.chain(new f(n,this.commandOptions))}__init7() {this.zdiffstore=(...n)=>this.chain(new Qt(n,this.commandOptions))}__init8() {this.dbsize=()=>this.chain(new y(this.commandOptions))}__init9() {this.decr=(...n)=>this.chain(new b(n,this.commandOptions))}__init10() {this.decrby=(...n)=>this.chain(new O(n,this.commandOptions))}__init11() {this.del=(...n)=>this.chain(new T(n,this.commandOptions))}__init12() {this.echo=(...n)=>this.chain(new w(n,this.commandOptions))}__init13() {this.eval=(...n)=>this.chain(new D(n,this.commandOptions))}__init14() {this.evalsha=(...n)=>this.chain(new k(n,this.commandOptions))}__init15() {this.exists=(...n)=>this.chain(new A(n,this.commandOptions))}__init16() {this.expire=(...n)=>this.chain(new S(n,this.commandOptions))}__init17() {this.expireat=(...n)=>this.chain(new R(n,this.commandOptions))}__init18() {this.flushall=n=>this.chain(new M(n,this.commandOptions))}__init19() {this.flushdb=(...n)=>this.chain(new v(n,this.commandOptions))}__init20() {this.get=(...n)=>this.chain(new L(n,this.commandOptions))}__init21() {this.getbit=(...n)=>this.chain(new Z(n,this.commandOptions))}__init22() {this.getdel=(...n)=>this.chain(new N(n,this.commandOptions))}__init23() {this.getrange=(...n)=>this.chain(new G(n,this.commandOptions))}__init24() {this.getset=(n,t)=>this.chain(new B([n,t],this.commandOptions))}__init25() {this.hdel=(...n)=>this.chain(new U(n,this.commandOptions))}__init26() {this.hexists=(...n)=>this.chain(new H(n,this.commandOptions))}__init27() {this.hget=(...n)=>this.chain(new F(n,this.commandOptions))}__init28() {this.hgetall=(...n)=>this.chain(new q(n,this.commandOptions))}__init29() {this.hincrby=(...n)=>this.chain(new $(n,this.commandOptions))}__init30() {this.hincrbyfloat=(...n)=>this.chain(new X(n,this.commandOptions))}__init31() {this.hkeys=(...n)=>this.chain(new j(n,this.commandOptions))}__init32() {this.hlen=(...n)=>this.chain(new Y(n,this.commandOptions))}__init33() {this.hmget=(...n)=>this.chain(new W(n,this.commandOptions))}__init34() {this.hmset=(n,t)=>this.chain(new V([n,t],this.commandOptions))}__init35() {this.hrandfield=(n,t,o)=>this.chain(new _([n,t,o],this.commandOptions))}__init36() {this.hscan=(...n)=>this.chain(new Q(n,this.commandOptions))}__init37() {this.hset=(n,t)=>this.chain(new nn([n,t],this.commandOptions))}__init38() {this.hsetnx=(n,t,o)=>this.chain(new tn([n,t,o],this.commandOptions))}__init39() {this.hstrlen=(...n)=>this.chain(new en(n,this.commandOptions))}__init40() {this.hvals=(...n)=>this.chain(new on(n,this.commandOptions))}__init41() {this.incr=(...n)=>this.chain(new sn(n,this.commandOptions))}__init42() {this.incrby=(...n)=>this.chain(new mn(n,this.commandOptions))}__init43() {this.incrbyfloat=(...n)=>this.chain(new rn(n,this.commandOptions))}__init44() {this.keys=(...n)=>this.chain(new Mn(n,this.commandOptions))}__init45() {this.lindex=(...n)=>this.chain(new vn(n,this.commandOptions))}__init46() {this.linsert=(n,t,o,m)=>this.chain(new En([n,t,o,m],this.commandOptions))}__init47() {this.llen=(...n)=>this.chain(new zn(n,this.commandOptions))}__init48() {this.lmove=(...n)=>this.chain(new Jn(n,this.commandOptions))}__init49() {this.lpop=(...n)=>this.chain(new Pn(n,this.commandOptions))}__init50() {this.lpos=(...n)=>this.chain(new In(n,this.commandOptions))}__init51() {this.lpush=(n,...t)=>this.chain(new Kn([n,...t],this.commandOptions))}__init52() {this.lpushx=(n,...t)=>this.chain(new Ln([n,...t],this.commandOptions))}__init53() {this.lrange=(...n)=>this.chain(new Zn(n,this.commandOptions))}__init54() {this.lrem=(n,t,o)=>this.chain(new Nn([n,t,o],this.commandOptions))}__init55() {this.lset=(n,t,o)=>this.chain(new Gn([n,t,o],this.commandOptions))}__init56() {this.ltrim=(...n)=>this.chain(new Bn(n,this.commandOptions))}__init57() {this.mget=(...n)=>this.chain(new Un(n,this.commandOptions))}__init58() {this.mset=n=>this.chain(new Hn([n],this.commandOptions))}__init59() {this.msetnx=n=>this.chain(new Fn([n],this.commandOptions))}__init60() {this.persist=(...n)=>this.chain(new qn(n,this.commandOptions))}__init61() {this.pexpire=(...n)=>this.chain(new $n(n,this.commandOptions))}__init62() {this.pexpireat=(...n)=>this.chain(new Xn(n,this.commandOptions))}__init63() {this.ping=n=>this.chain(new jn(n,this.commandOptions))}__init64() {this.psetex=(n,t,o)=>this.chain(new Yn([n,t,o],this.commandOptions))}__init65() {this.pttl=(...n)=>this.chain(new Wn(n,this.commandOptions))}__init66() {this.publish=(...n)=>this.chain(new Vn(n,this.commandOptions))}__init67() {this.randomkey=()=>this.chain(new _n(this.commandOptions))}__init68() {this.rename=(...n)=>this.chain(new Qn(n,this.commandOptions))}__init69() {this.renamenx=(...n)=>this.chain(new nt(n,this.commandOptions))}__init70() {this.rpop=(...n)=>this.chain(new tt(n,this.commandOptions))}__init71() {this.rpush=(n,...t)=>this.chain(new et([n,...t],this.commandOptions))}__init72() {this.rpushx=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions))}__init73() {this.sadd=(n,...t)=>this.chain(new st([n,...t],this.commandOptions))}__init74() {this.scan=(...n)=>this.chain(new mt(n,this.commandOptions))}__init75() {this.scard=(...n)=>this.chain(new rt(n,this.commandOptions))}__init76() {this.scriptExists=(...n)=>this.chain(new at(n,this.commandOptions))}__init77() {this.scriptFlush=(...n)=>this.chain(new it(n,this.commandOptions))}__init78() {this.scriptLoad=(...n)=>this.chain(new pt(n,this.commandOptions))}__init79() {this.sdiff=(...n)=>this.chain(new dt(n,this.commandOptions))}__init80() {this.sdiffstore=(...n)=>this.chain(new ct(n,this.commandOptions))}__init81() {this.set=(n,t,o)=>this.chain(new ut([n,t,o],this.commandOptions))}__init82() {this.setbit=(...n)=>this.chain(new ht(n,this.commandOptions))}__init83() {this.setex=(n,t,o)=>this.chain(new Ct([n,t,o],this.commandOptions))}__init84() {this.setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions))}__init85() {this.setrange=(...n)=>this.chain(new gt(n,this.commandOptions))}__init86() {this.sinter=(...n)=>this.chain(new xt(n,this.commandOptions))}__init87() {this.sinterstore=(...n)=>this.chain(new ft(n,this.commandOptions))}__init88() {this.sismember=(n,t)=>this.chain(new yt([n,t],this.commandOptions))}__init89() {this.smembers=(...n)=>this.chain(new bt(n,this.commandOptions))}__init90() {this.smismember=(n,t)=>this.chain(new Ot([n,t],this.commandOptions))}__init91() {this.smove=(n,t,o)=>this.chain(new Tt([n,t,o],this.commandOptions))}__init92() {this.spop=(...n)=>this.chain(new wt(n,this.commandOptions))}__init93() {this.srandmember=(...n)=>this.chain(new Dt(n,this.commandOptions))}__init94() {this.srem=(n,...t)=>this.chain(new kt([n,...t],this.commandOptions))}__init95() {this.sscan=(...n)=>this.chain(new At(n,this.commandOptions))}__init96() {this.strlen=(...n)=>this.chain(new St(n,this.commandOptions))}__init97() {this.sunion=(...n)=>this.chain(new Rt(n,this.commandOptions))}__init98() {this.sunionstore=(...n)=>this.chain(new Mt(n,this.commandOptions))}__init99() {this.time=()=>this.chain(new vt(this.commandOptions))}__init100() {this.touch=(...n)=>this.chain(new Et(n,this.commandOptions))}__init101() {this.ttl=(...n)=>this.chain(new zt(n,this.commandOptions))}__init102() {this.type=(...n)=>this.chain(new Jt(n,this.commandOptions))}__init103() {this.unlink=(...n)=>this.chain(new Pt(n,this.commandOptions))}__init104() {this.zadd=(...n)=>"score"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions))}__init105() {this.zcard=(...n)=>this.chain(new It(n,this.commandOptions))}__init106() {this.zcount=(...n)=>this.chain(new Kt(n,this.commandOptions))}__init107() {this.zincrby=(n,t,o)=>this.chain(new Lt([n,t,o],this.commandOptions))}__init108() {this.zinterstore=(...n)=>this.chain(new Zt(n,this.commandOptions))}__init109() {this.zlexcount=(...n)=>this.chain(new Nt(n,this.commandOptions))}__init110() {this.zmscore=(...n)=>this.chain(new ne(n,this.commandOptions))}__init111() {this.zpopmax=(...n)=>this.chain(new Gt(n,this.commandOptions))}__init112() {this.zpopmin=(...n)=>this.chain(new Bt(n,this.commandOptions))}__init113() {this.zrange=(...n)=>this.chain(new Ut(n,this.commandOptions))}__init114() {this.zrank=(n,t)=>this.chain(new Ht([n,t],this.commandOptions))}__init115() {this.zrem=(n,...t)=>this.chain(new Ft([n,...t],this.commandOptions))}__init116() {this.zremrangebylex=(...n)=>this.chain(new qt(n,this.commandOptions))}__init117() {this.zremrangebyrank=(...n)=>this.chain(new $t(n,this.commandOptions))}__init118() {this.zremrangebyscore=(...n)=>this.chain(new Xt(n,this.commandOptions))}__init119() {this.zrevrank=(n,t)=>this.chain(new jt([n,t],this.commandOptions))}__init120() {this.zscan=(...n)=>this.chain(new Yt(n,this.commandOptions))}__init121() {this.zscore=(n,t)=>this.chain(new Wt([n,t],this.commandOptions))}__init122() {this.zunionstore=(...n)=>this.chain(new _t(n,this.commandOptions))}__init123() {this.zunion=(...n)=>this.chain(new Vt(n,this.commandOptions))}get json(){return{arrappend:(...n)=>this.chain(new an(n,this.commandOptions)),arrindex:(...n)=>this.chain(new pn(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new dn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new cn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new un(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new hn(n,this.commandOptions)),clear:(...n)=>this.chain(new Cn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new gn(n,this.commandOptions)),geoadd:(...n)=>this.chain(new E(n,this.commandOptions)),geodist:(...n)=>this.chain(new z(n,this.commandOptions)),geopos:(...n)=>this.chain(new J(n,this.commandOptions)),geohash:(...n)=>this.chain(new P(n,this.commandOptions)),geosearch:(...n)=>this.chain(new I(n,this.commandOptions)),geosearchstore:(...n)=>this.chain(new K(n,this.commandOptions)),get:(...n)=>this.chain(new xn(n,this.commandOptions)),mget:(...n)=>this.chain(new fn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new yn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new bn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new On(n,this.commandOptions)),objlen:(...n)=>this.chain(new Tn(n,this.commandOptions)),resp:(...n)=>this.chain(new wn(n,this.commandOptions)),set:(...n)=>this.chain(new Dn(n,this.commandOptions)),strappend:(...n)=>this.chain(new kn(n,this.commandOptions)),strlen:(...n)=>this.chain(new An(n,this.commandOptions)),toggle:(...n)=>this.chain(new Sn(n,this.commandOptions)),type:(...n)=>this.chain(new Rn(n,this.commandOptions))}}}, _class);var _enchex = __nccwpck_require__(934); var _enchex2 = _interopRequireDefault(_enchex);var _sha1 = __nccwpck_require__(156); var _sha12 = _interopRequireDefault(_sha1);var me=class{constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes("noscript"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return _enchex2.default.stringify(_sha12.default.call(void 0, n))}};var ue= (_class2 =class{constructor(n,t){;_class2.prototype.__init124.call(this);_class2.prototype.__init125.call(this);_class2.prototype.__init126.call(this);_class2.prototype.__init127.call(this);_class2.prototype.__init128.call(this);_class2.prototype.__init129.call(this);_class2.prototype.__init130.call(this);_class2.prototype.__init131.call(this);_class2.prototype.__init132.call(this);_class2.prototype.__init133.call(this);_class2.prototype.__init134.call(this);_class2.prototype.__init135.call(this);_class2.prototype.__init136.call(this);_class2.prototype.__init137.call(this);_class2.prototype.__init138.call(this);_class2.prototype.__init139.call(this);_class2.prototype.__init140.call(this);_class2.prototype.__init141.call(this);_class2.prototype.__init142.call(this);_class2.prototype.__init143.call(this);_class2.prototype.__init144.call(this);_class2.prototype.__init145.call(this);_class2.prototype.__init146.call(this);_class2.prototype.__init147.call(this);_class2.prototype.__init148.call(this);_class2.prototype.__init149.call(this);_class2.prototype.__init150.call(this);_class2.prototype.__init151.call(this);_class2.prototype.__init152.call(this);_class2.prototype.__init153.call(this);_class2.prototype.__init154.call(this);_class2.prototype.__init155.call(this);_class2.prototype.__init156.call(this);_class2.prototype.__init157.call(this);_class2.prototype.__init158.call(this);_class2.prototype.__init159.call(this);_class2.prototype.__init160.call(this);_class2.prototype.__init161.call(this);_class2.prototype.__init162.call(this);_class2.prototype.__init163.call(this);_class2.prototype.__init164.call(this);_class2.prototype.__init165.call(this);_class2.prototype.__init166.call(this);_class2.prototype.__init167.call(this);_class2.prototype.__init168.call(this);_class2.prototype.__init169.call(this);_class2.prototype.__init170.call(this);_class2.prototype.__init171.call(this);_class2.prototype.__init172.call(this);_class2.prototype.__init173.call(this);_class2.prototype.__init174.call(this);_class2.prototype.__init175.call(this);_class2.prototype.__init176.call(this);_class2.prototype.__init177.call(this);_class2.prototype.__init178.call(this);_class2.prototype.__init179.call(this);_class2.prototype.__init180.call(this);_class2.prototype.__init181.call(this);_class2.prototype.__init182.call(this);_class2.prototype.__init183.call(this);_class2.prototype.__init184.call(this);_class2.prototype.__init185.call(this);_class2.prototype.__init186.call(this);_class2.prototype.__init187.call(this);_class2.prototype.__init188.call(this);_class2.prototype.__init189.call(this);_class2.prototype.__init190.call(this);_class2.prototype.__init191.call(this);_class2.prototype.__init192.call(this);_class2.prototype.__init193.call(this);_class2.prototype.__init194.call(this);_class2.prototype.__init195.call(this);_class2.prototype.__init196.call(this);_class2.prototype.__init197.call(this);_class2.prototype.__init198.call(this);_class2.prototype.__init199.call(this);_class2.prototype.__init200.call(this);_class2.prototype.__init201.call(this);_class2.prototype.__init202.call(this);_class2.prototype.__init203.call(this);_class2.prototype.__init204.call(this);_class2.prototype.__init205.call(this);_class2.prototype.__init206.call(this);_class2.prototype.__init207.call(this);_class2.prototype.__init208.call(this);_class2.prototype.__init209.call(this);_class2.prototype.__init210.call(this);_class2.prototype.__init211.call(this);_class2.prototype.__init212.call(this);_class2.prototype.__init213.call(this);_class2.prototype.__init214.call(this);_class2.prototype.__init215.call(this);_class2.prototype.__init216.call(this);_class2.prototype.__init217.call(this);_class2.prototype.__init218.call(this);_class2.prototype.__init219.call(this);_class2.prototype.__init220.call(this);_class2.prototype.__init221.call(this);_class2.prototype.__init222.call(this);_class2.prototype.__init223.call(this);_class2.prototype.__init224.call(this);_class2.prototype.__init225.call(this);_class2.prototype.__init226.call(this);_class2.prototype.__init227.call(this);_class2.prototype.__init228.call(this);_class2.prototype.__init229.call(this);_class2.prototype.__init230.call(this);_class2.prototype.__init231.call(this);_class2.prototype.__init232.call(this);_class2.prototype.__init233.call(this);_class2.prototype.__init234.call(this);_class2.prototype.__init235.call(this);_class2.prototype.__init236.call(this);_class2.prototype.__init237.call(this);_class2.prototype.__init238.call(this);_class2.prototype.__init239.call(this);_class2.prototype.__init240.call(this);_class2.prototype.__init241.call(this);_class2.prototype.__init242.call(this);_class2.prototype.__init243.call(this);_class2.prototype.__init244.call(this);_class2.prototype.__init245.call(this);_class2.prototype.__init246.call(this);_class2.prototype.__init247.call(this);_class2.prototype.__init248.call(this);_class2.prototype.__init249.call(this);_class2.prototype.__init250.call(this);_class2.prototype.__init251.call(this);this.client=n,this.opts=t,this.enableTelemetry=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _56 => _56.enableTelemetry]), () => (!0))}get json(){return{arrappend:(...n)=>new an(n,this.opts).exec(this.client),arrindex:(...n)=>new pn(n,this.opts).exec(this.client),arrinsert:(...n)=>new dn(n,this.opts).exec(this.client),arrlen:(...n)=>new cn(n,this.opts).exec(this.client),arrpop:(...n)=>new un(n,this.opts).exec(this.client),arrtrim:(...n)=>new hn(n,this.opts).exec(this.client),clear:(...n)=>new Cn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new gn(n,this.opts).exec(this.client),geoadd:(...n)=>new E(n,this.opts).exec(this.client),geopos:(...n)=>new J(n,this.opts).exec(this.client),geodist:(...n)=>new z(n,this.opts).exec(this.client),geohash:(...n)=>new P(n,this.opts).exec(this.client),geosearch:(...n)=>new I(n,this.opts).exec(this.client),geosearchstore:(...n)=>new K(n,this.opts).exec(this.client),get:(...n)=>new xn(n,this.opts).exec(this.client),mget:(...n)=>new fn(n,this.opts).exec(this.client),numincrby:(...n)=>new yn(n,this.opts).exec(this.client),nummultby:(...n)=>new bn(n,this.opts).exec(this.client),objkeys:(...n)=>new On(n,this.opts).exec(this.client),objlen:(...n)=>new Tn(n,this.opts).exec(this.client),resp:(...n)=>new wn(n,this.opts).exec(this.client),set:(...n)=>new Dn(n,this.opts).exec(this.client),strappend:(...n)=>new kn(n,this.opts).exec(this.client),strlen:(...n)=>new An(n,this.opts).exec(this.client),toggle:(...n)=>new Sn(n,this.opts).exec(this.client),type:(...n)=>new Rn(n,this.opts).exec(this.client)}}__init124() {this.use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)}}__init125() {this.addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch (e12){}}}createScript(n){return new me(this,n)}__init126() {this.pipeline=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!1})}__init127() {this.multi=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!0})}__init128() {this.append=(...n)=>new C(n,this.opts).exec(this.client)}__init129() {this.bitcount=(...n)=>new l(n,this.opts).exec(this.client)}__init130() {this.bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client)}__init131() {this.bitpos=(...n)=>new x(n,this.opts).exec(this.client)}__init132() {this.copy=(...n)=>new f(n,this.opts).exec(this.client)}__init133() {this.dbsize=()=>new y(this.opts).exec(this.client)}__init134() {this.decr=(...n)=>new b(n,this.opts).exec(this.client)}__init135() {this.decrby=(...n)=>new O(n,this.opts).exec(this.client)}__init136() {this.del=(...n)=>new T(n,this.opts).exec(this.client)}__init137() {this.echo=(...n)=>new w(n,this.opts).exec(this.client)}__init138() {this.eval=(...n)=>new D(n,this.opts).exec(this.client)}__init139() {this.evalsha=(...n)=>new k(n,this.opts).exec(this.client)}__init140() {this.exists=(...n)=>new A(n,this.opts).exec(this.client)}__init141() {this.expire=(...n)=>new S(n,this.opts).exec(this.client)}__init142() {this.expireat=(...n)=>new R(n,this.opts).exec(this.client)}__init143() {this.flushall=n=>new M(n,this.opts).exec(this.client)}__init144() {this.flushdb=(...n)=>new v(n,this.opts).exec(this.client)}__init145() {this.get=(...n)=>new L(n,this.opts).exec(this.client)}__init146() {this.getbit=(...n)=>new Z(n,this.opts).exec(this.client)}__init147() {this.getdel=(...n)=>new N(n,this.opts).exec(this.client)}__init148() {this.getrange=(...n)=>new G(n,this.opts).exec(this.client)}__init149() {this.getset=(n,t)=>new B([n,t],this.opts).exec(this.client)}__init150() {this.hdel=(...n)=>new U(n,this.opts).exec(this.client)}__init151() {this.hexists=(...n)=>new H(n,this.opts).exec(this.client)}__init152() {this.hget=(...n)=>new F(n,this.opts).exec(this.client)}__init153() {this.hgetall=(...n)=>new q(n,this.opts).exec(this.client)}__init154() {this.hincrby=(...n)=>new $(n,this.opts).exec(this.client)}__init155() {this.hincrbyfloat=(...n)=>new X(n,this.opts).exec(this.client)}__init156() {this.hkeys=(...n)=>new j(n,this.opts).exec(this.client)}__init157() {this.hlen=(...n)=>new Y(n,this.opts).exec(this.client)}__init158() {this.hmget=(...n)=>new W(n,this.opts).exec(this.client)}__init159() {this.hmset=(n,t)=>new V([n,t],this.opts).exec(this.client)}__init160() {this.hrandfield=(n,t,o)=>new _([n,t,o],this.opts).exec(this.client)}__init161() {this.hscan=(...n)=>new Q(n,this.opts).exec(this.client)}__init162() {this.hset=(n,t)=>new nn([n,t],this.opts).exec(this.client)}__init163() {this.hsetnx=(n,t,o)=>new tn([n,t,o],this.opts).exec(this.client)}__init164() {this.hstrlen=(...n)=>new en(n,this.opts).exec(this.client)}__init165() {this.hvals=(...n)=>new on(n,this.opts).exec(this.client)}__init166() {this.incr=(...n)=>new sn(n,this.opts).exec(this.client)}__init167() {this.incrby=(...n)=>new mn(n,this.opts).exec(this.client)}__init168() {this.incrbyfloat=(...n)=>new rn(n,this.opts).exec(this.client)}__init169() {this.keys=(...n)=>new Mn(n,this.opts).exec(this.client)}__init170() {this.lindex=(...n)=>new vn(n,this.opts).exec(this.client)}__init171() {this.linsert=(n,t,o,m)=>new En([n,t,o,m],this.opts).exec(this.client)}__init172() {this.llen=(...n)=>new zn(n,this.opts).exec(this.client)}__init173() {this.lmove=(...n)=>new Jn(n,this.opts).exec(this.client)}__init174() {this.lpop=(...n)=>new Pn(n,this.opts).exec(this.client)}__init175() {this.lpos=(...n)=>new In(n,this.opts).exec(this.client)}__init176() {this.lpush=(n,...t)=>new Kn([n,...t],this.opts).exec(this.client)}__init177() {this.lpushx=(n,...t)=>new Ln([n,...t],this.opts).exec(this.client)}__init178() {this.lrange=(...n)=>new Zn(n,this.opts).exec(this.client)}__init179() {this.lrem=(n,t,o)=>new Nn([n,t,o],this.opts).exec(this.client)}__init180() {this.lset=(n,t,o)=>new Gn([n,t,o],this.opts).exec(this.client)}__init181() {this.ltrim=(...n)=>new Bn(n,this.opts).exec(this.client)}__init182() {this.mget=(...n)=>new Un(n,this.opts).exec(this.client)}__init183() {this.mset=n=>new Hn([n],this.opts).exec(this.client)}__init184() {this.msetnx=n=>new Fn([n],this.opts).exec(this.client)}__init185() {this.persist=(...n)=>new qn(n,this.opts).exec(this.client)}__init186() {this.pexpire=(...n)=>new $n(n,this.opts).exec(this.client)}__init187() {this.pexpireat=(...n)=>new Xn(n,this.opts).exec(this.client)}__init188() {this.ping=n=>new jn(n,this.opts).exec(this.client)}__init189() {this.psetex=(n,t,o)=>new Yn([n,t,o],this.opts).exec(this.client)}__init190() {this.pttl=(...n)=>new Wn(n,this.opts).exec(this.client)}__init191() {this.publish=(...n)=>new Vn(n,this.opts).exec(this.client)}__init192() {this.randomkey=()=>new _n().exec(this.client)}__init193() {this.rename=(...n)=>new Qn(n,this.opts).exec(this.client)}__init194() {this.renamenx=(...n)=>new nt(n,this.opts).exec(this.client)}__init195() {this.rpop=(...n)=>new tt(n,this.opts).exec(this.client)}__init196() {this.rpush=(n,...t)=>new et([n,...t],this.opts).exec(this.client)}__init197() {this.rpushx=(n,...t)=>new ot([n,...t],this.opts).exec(this.client)}__init198() {this.sadd=(n,...t)=>new st([n,...t],this.opts).exec(this.client)}__init199() {this.scan=(...n)=>new mt(n,this.opts).exec(this.client)}__init200() {this.scard=(...n)=>new rt(n,this.opts).exec(this.client)}__init201() {this.scriptExists=(...n)=>new at(n,this.opts).exec(this.client)}__init202() {this.scriptFlush=(...n)=>new it(n,this.opts).exec(this.client)}__init203() {this.scriptLoad=(...n)=>new pt(n,this.opts).exec(this.client)}__init204() {this.sdiff=(...n)=>new dt(n,this.opts).exec(this.client)}__init205() {this.sdiffstore=(...n)=>new ct(n,this.opts).exec(this.client)}__init206() {this.set=(n,t,o)=>new ut([n,t,o],this.opts).exec(this.client)}__init207() {this.setbit=(...n)=>new ht(n,this.opts).exec(this.client)}__init208() {this.setex=(n,t,o)=>new Ct([n,t,o],this.opts).exec(this.client)}__init209() {this.setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client)}__init210() {this.setrange=(...n)=>new gt(n,this.opts).exec(this.client)}__init211() {this.sinter=(...n)=>new xt(n,this.opts).exec(this.client)}__init212() {this.sinterstore=(...n)=>new ft(n,this.opts).exec(this.client)}__init213() {this.sismember=(n,t)=>new yt([n,t],this.opts).exec(this.client)}__init214() {this.smismember=(n,t)=>new Ot([n,t],this.opts).exec(this.client)}__init215() {this.smembers=(...n)=>new bt(n,this.opts).exec(this.client)}__init216() {this.smove=(n,t,o)=>new Tt([n,t,o],this.opts).exec(this.client)}__init217() {this.spop=(...n)=>new wt(n,this.opts).exec(this.client)}__init218() {this.srandmember=(...n)=>new Dt(n,this.opts).exec(this.client)}__init219() {this.srem=(n,...t)=>new kt([n,...t],this.opts).exec(this.client)}__init220() {this.sscan=(...n)=>new At(n,this.opts).exec(this.client)}__init221() {this.strlen=(...n)=>new St(n,this.opts).exec(this.client)}__init222() {this.sunion=(...n)=>new Rt(n,this.opts).exec(this.client)}__init223() {this.sunionstore=(...n)=>new Mt(n,this.opts).exec(this.client)}__init224() {this.time=()=>new vt().exec(this.client)}__init225() {this.touch=(...n)=>new Et(n,this.opts).exec(this.client)}__init226() {this.ttl=(...n)=>new zt(n,this.opts).exec(this.client)}__init227() {this.type=(...n)=>new Jt(n,this.opts).exec(this.client)}__init228() {this.unlink=(...n)=>new Pt(n,this.opts).exec(this.client)}__init229() {this.xadd=(...n)=>new oe(n,this.opts).exec(this.client)}__init230() {this.xrange=(...n)=>new se(n,this.opts).exec(this.client)}__init231() {this.zadd=(...n)=>"score"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client)}__init232() {this.zcard=(...n)=>new It(n,this.opts).exec(this.client)}__init233() {this.zcount=(...n)=>new Kt(n,this.opts).exec(this.client)}__init234() {this.zdiffstore=(...n)=>new Qt(n,this.opts).exec(this.client)}__init235() {this.zincrby=(n,t,o)=>new Lt([n,t,o],this.opts).exec(this.client)}__init236() {this.zinterstore=(...n)=>new Zt(n,this.opts).exec(this.client)}__init237() {this.zlexcount=(...n)=>new Nt(n,this.opts).exec(this.client)}__init238() {this.zmscore=(...n)=>new ne(n,this.opts).exec(this.client)}__init239() {this.zpopmax=(...n)=>new Gt(n,this.opts).exec(this.client)}__init240() {this.zpopmin=(...n)=>new Bt(n,this.opts).exec(this.client)}__init241() {this.zrange=(...n)=>new Ut(n,this.opts).exec(this.client)}__init242() {this.zrank=(n,t)=>new Ht([n,t],this.opts).exec(this.client)}__init243() {this.zrem=(n,...t)=>new Ft([n,...t],this.opts).exec(this.client)}__init244() {this.zremrangebylex=(...n)=>new qt(n,this.opts).exec(this.client)}__init245() {this.zremrangebyrank=(...n)=>new $t(n,this.opts).exec(this.client)}__init246() {this.zremrangebyscore=(...n)=>new Xt(n,this.opts).exec(this.client)}__init247() {this.zrevrank=(n,t)=>new jt([n,t],this.opts).exec(this.client)}__init248() {this.zscan=(...n)=>new Yt(n,this.opts).exec(this.client)}__init249() {this.zscore=(n,t)=>new Wt([n,t],this.opts).exec(this.client)}__init250() {this.zunion=(...n)=>new Vt(n,this.opts).exec(this.client)}__init251() {this.zunionstore=(...n)=>new _t(n,this.opts).exec(this.client)}}, _class2);var cC="v1.24.3";exports.a = ie; exports.b = ue; exports.c = cC; /***/ }), -/***/ 534: +/***/ 647: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value: true})); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJIU2S2DZjs = __nccwpck_require__(42);typeof atob>"u"&&(global.atob=function(n){return Buffer.from(n,"base64").toString("utf-8")});var a=class n extends _chunkJIU2S2DZjs.b{constructor(e){if("request"in e){super(e);return}(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new (0, _chunkJIU2S2DZjs.a)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache||"no-store"});super(t,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime=="string"?"edge-light":`node@${process.version}`,platform:process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:`@upstash/redis@${_chunkJIU2S2DZjs.c}`})}static fromEnv(e){if(typeof _optionalChain([process, 'optionalAccess', _ => _.env])>"u")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let t=_optionalChain([process, 'optionalAccess', _2 => _2.env, 'access', _3 => _3.UPSTASH_REDIS_REST_URL]);if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let s=_optionalChain([process, 'optionalAccess', _4 => _4.env, 'access', _5 => _5.UPSTASH_REDIS_REST_TOKEN]);if(!s)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");return new n({...e,url:t,token:s})}};exports.Redis = a; +Object.defineProperty(exports, "__esModule", ({value: true})); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJIU2S2DZjs = __nccwpck_require__(194);typeof atob>"u"&&(global.atob=function(n){return Buffer.from(n,"base64").toString("utf-8")});var a=class n extends _chunkJIU2S2DZjs.b{constructor(e){if("request"in e){super(e);return}(e.url.startsWith(" ")||e.url.endsWith(" ")||/\r|\n/.test(e.url))&&console.warn("The redis url contains whitespace or newline, which can cause errors!"),(e.token.startsWith(" ")||e.token.endsWith(" ")||/\r|\n/.test(e.token))&&console.warn("The redis token contains whitespace or newline, which can cause errors!");let t=new (0, _chunkJIU2S2DZjs.a)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache||"no-store"});super(t,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime=="string"?"edge-light":`node@${process.version}`,platform:process.env.VERCEL?"vercel":process.env.AWS_REGION?"aws":"unknown",sdk:`@upstash/redis@${_chunkJIU2S2DZjs.c}`})}static fromEnv(e){if(typeof _optionalChain([process, 'optionalAccess', _ => _.env])>"u")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead');let t=_optionalChain([process, 'optionalAccess', _2 => _2.env, 'access', _3 => _3.UPSTASH_REDIS_REST_URL]);if(!t)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");let s=_optionalChain([process, 'optionalAccess', _4 => _4.env, 'access', _5 => _5.UPSTASH_REDIS_REST_TOKEN]);if(!s)throw new Error("Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`");return new n({...e,url:t,token:s})}};exports.Redis = a; /***/ }), -/***/ 786: +/***/ 425: /***/ (function(module, exports, __nccwpck_require__) { ;(function (root, factory) { @@ -825,13 +825,13 @@ Object.defineProperty(exports, "__esModule", ({value: true})); function _optiona /***/ }), -/***/ 680: +/***/ 934: /***/ (function(module, exports, __nccwpck_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__nccwpck_require__(786)); + module.exports = exports = factory(__nccwpck_require__(425)); } else {} }(this, function (CryptoJS) { @@ -842,13 +842,13 @@ Object.defineProperty(exports, "__esModule", ({value: true})); function _optiona /***/ }), -/***/ 595: +/***/ 156: /***/ (function(module, exports, __nccwpck_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__nccwpck_require__(786)); + module.exports = exports = factory(__nccwpck_require__(425)); } else {} }(this, function (CryptoJS) { @@ -1015,12 +1015,12 @@ module.exports = require("path"); /***/ }), -/***/ 381: +/***/ 709: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({value: true}));// src/index.ts -var _redis = __nccwpck_require__(534); +var _redis = __nccwpck_require__(647); var _kv = null; process.env.UPSTASH_DISABLE_TELEMETRY = "1"; var VercelKV = class extends _redis.Redis { @@ -1179,14 +1179,11 @@ var __webpack_exports__ = {}; const fs = __nccwpck_require__(292) const path = __nccwpck_require__(17) -const { createClient } = __nccwpck_require__(381) +const { createClient } = __nccwpck_require__(709) async function main() { try { - const file = path.join( - process.cwd(), - './test-results/nextjs-test-results.json' - ) + const file = path.join(process.cwd(), 'test/turbopack-tests-manifest.json') let passingTests = '' let failingTests = '' @@ -1195,39 +1192,34 @@ async function main() { const contents = await fs.readFile(file, 'utf-8') const results = JSON.parse(contents) - let { ref } = results + const currentDate = new Date() const isoString = currentDate.toISOString() const timestamp = isoString.slice(0, 19).replace('T', ' ') - for (const result of results.result) { + for (const [testFileName, result] of Object.entries(results)) { let suitePassCount = 0 let suiteFailCount = 0 - suitePassCount += result.data.numPassedTests - suiteFailCount += result.data.numFailedTests + suitePassCount += result.passed.length + suiteFailCount += result.failed.length - let suiteName = result.data.testResults[0].name - // remove "/root/actions-runner/_work/next.js/next.js/" from the beginning of suiteName - suiteName = suiteName.slice( - '/root/actions-runner/_work/next.js/next.js/'.length - ) if (suitePassCount > 0) { - passingTests += `${suiteName}\n` + passingTests += `${testFileName}\n` } if (suiteFailCount > 0) { - failingTests += `${suiteName}\n` + failingTests += `${testFileName}\n` } - for (const assertionResult of result.data.testResults[0] - .assertionResults) { - let assertion = assertionResult.fullName.replaceAll('`', '\\`') - if (assertionResult.status === 'passed') { - passingTests += `* ${assertion}\n` - } else if (assertionResult.status === 'failed') { - failingTests += `* ${assertion}\n` - } + for (const passed of result.passed) { + const passedName = passed.replaceAll('`', '\\`') + passingTests += `* ${passedName}\n` + } + + for (const passed of result.failed) { + const failedName = passed.replaceAll('`', '\\`') + failingTests += `* ${failedName}\n` } passCount += suitePassCount @@ -1247,7 +1239,7 @@ async function main() { token: process.env.TURBOYET_KV_REST_API_TOKEN, }) - const testRun = `${ref}\t${timestamp}\t${passCount}/${ + const testRun = `${process.env.GITHUB_SHA}\t${timestamp}\t${passCount}/${ passCount + failCount }` diff --git a/.github/actions/upload-turboyet-data/dist/index.js.map b/.github/actions/upload-turboyet-data/dist/index.js.map index 0347561261a6b..504e0786b8bd8 100644 --- a/.github/actions/upload-turboyet-data/dist/index.js.map +++ b/.github/actions/upload-turboyet-data/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtyBA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrJA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["../webpack://upload-turboyet-data-action/../../node_modules/.pnpm/@upstash+redis@1.24.3/node_modules/@upstash/redis/chunk-JIU2S2DZ.js","../webpack://upload-turboyet-data-action/../../node_modules/.pnpm/@upstash+redis@1.24.3/node_modules/@upstash/redis/nodejs.js","../webpack://upload-turboyet-data-action/../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js","../webpack://upload-turboyet-data-action/../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-hex.js","../webpack://upload-turboyet-data-action/../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.js","../webpack://upload-turboyet-data-action/external node-commonjs \"crypto\"","../webpack://upload-turboyet-data-action/external node-commonjs \"fs/promises\"","../webpack://upload-turboyet-data-action/external node-commonjs \"path\"","../webpack://upload-turboyet-data-action/../../node_modules/.pnpm/@vercel+kv@0.2.4/node_modules/@vercel/kv/dist/index.cjs","../webpack://upload-turboyet-data-action/webpack/bootstrap","../webpack://upload-turboyet-data-action/webpack/runtime/compat","../webpack://upload-turboyet-data-action/./src/main.js"],"sourcesContent":["\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;var c=class extends Error{constructor(n){super(n),this.name=\"UpstashError\"}};var ie=class{constructor(n){this.options={backend:_optionalChain([n, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.backend]),agent:n.agent,responseEncoding:_nullishCoalesce(n.responseEncoding, () => (\"base64\")),cache:n.cache},this.baseUrl=n.baseUrl.replace(/\\/$/,\"\"),this.headers={\"Content-Type\":\"application/json\",...n.headers},this.options.responseEncoding===\"base64\"&&(this.headers[\"Upstash-Encoding\"]=\"base64\"),typeof _optionalChain([n, 'optionalAccess', _4 => _4.retry])==\"boolean\"&&_optionalChain([n, 'optionalAccess', _5 => _5.retry])===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _6 => _6.retry, 'optionalAccess', _7 => _7.retries]), () => (5)),backoff:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _8 => _8.retry, 'optionalAccess', _9 => _9.backoff]), () => ((t=>Math.exp(t)*50)))}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(\",\"):o[m]=r),o}this.headers=t(this.headers,\"Upstash-Telemetry-Runtime\",n.runtime),this.headers=t(this.headers,\"Upstash-Telemetry-Platform\",n.platform),this.headers=t(this.headers,\"Upstash-Telemetry-Sdk\",n.sdk)}async request(n){let t={cache:this.options.cache,method:\"POST\",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:_optionalChain([this, 'access', _10 => _10.options, 'optionalAccess', _11 => _11.agent]),backend:_optionalChain([this, 'access', _12 => _12.options, 'optionalAccess', _13 => _13.backend])},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,..._nullishCoalesce(n.path, () => ([]))].join(\"/\"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw _nullishCoalesce(m, () => (new Error(\"Exhausted all retries\")));let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return _optionalChain([this, 'access', _14 => _14.options, 'optionalAccess', _15 => _15.responseEncoding])===\"base64\"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:re(i),error:p})):{result:re(r.result),error:r.error}:r}};function pe(s){let n=\"\";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;rtypeof t==\"string\"?pe(t):Array.isArray(t)?t.map(re):t):n=null;break}case\"string\":{n=s===\"OK\"?\"OK\":pe(s);break}default:break}return n}function de(s){let n=Array.isArray(s)?s.map(t=>{try{return de(t)}catch (e3){return t}}):JSON.parse(s);return typeof n==\"number\"&&n.toString()!==s?s:n}function ce(s){try{return de(s)}catch (e4){return s}}var he=s=>{switch(typeof s){case\"string\":case\"number\":case\"boolean\":return s;default:return JSON.stringify(s)}},e=class{constructor(n,t){this.serialize=he,this.deserialize=typeof _optionalChain([t, 'optionalAccess', _16 => _16.automaticDeserialization])>\"u\"||t.automaticDeserialization?_nullishCoalesce(_optionalChain([t, 'optionalAccess', _17 => _17.deserialize]), () => (ce)):o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>\"u\")throw new Error(\"Request did not return a result\");return this.deserialize(t)}};var C=class extends e{constructor(n,t){super([\"append\",...n],t)}};var l=class extends e{constructor([n,t,o],m){let r=[\"bitcount\",n];typeof t==\"number\"&&r.push(t),typeof o==\"number\"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super([\"bitop\",...n],t)}};var x=class extends e{constructor(n,t){super([\"bitpos\",...n],t)}};var f=class extends e{constructor([n,t,o],m){super([\"COPY\",n,t,..._optionalChain([o, 'optionalAccess', _18 => _18.replace])?[\"REPLACE\"]:[]],{...m,deserialize(r){return r>0?\"COPIED\":\"NOT_COPIED\"}})}};var y=class extends e{constructor(n){super([\"dbsize\"],n)}};var b=class extends e{constructor(n,t){super([\"decr\",...n],t)}};var O=class extends e{constructor(n,t){super([\"decrby\",...n],t)}};var T=class extends e{constructor(n,t){super([\"del\",...n],t)}};var w=class extends e{constructor(n,t){super([\"echo\",...n],t)}};var D=class extends e{constructor([n,t,o],m){super([\"eval\",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var k=class extends e{constructor([n,t,o],m){super([\"evalsha\",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var A=class extends e{constructor(n,t){super([\"exists\",...n],t)}};var S=class extends e{constructor(n,t){super([\"expire\",...n],t)}};var R=class extends e{constructor(n,t){super([\"expireat\",...n],t)}};var M=class extends e{constructor(n,t){let o=[\"flushall\"];n&&n.length>0&&n[0].async&&o.push(\"async\"),super(o,t)}};var v=class extends e{constructor([n],t){let o=[\"flushdb\"];_optionalChain([n, 'optionalAccess', _19 => _19.async])&&o.push(\"async\"),super(o,t)}};var E=class extends e{constructor([n,t,...o],m){let r=[\"geoadd\",n];\"nx\"in t&&t.nx?r.push(\"nx\"):\"xx\"in t&&t.xx&&r.push(\"xx\"),\"ch\"in t&&t.ch&&r.push(\"ch\"),\"latitude\"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var z=class extends e{constructor([n,t,o,m=\"M\"],r){super([\"GEODIST\",n,t,o,m],r)}};var J=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super([\"GEOPOS\",o,...m],{deserialize:r=>Ce(r),...t})}};function Ce(s){let n=[];for(let t of s)!_optionalChain([t, 'optionalAccess', _20 => _20[0]])||!_optionalChain([t, 'optionalAccess', _21 => _21[1]])||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var P=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super([\"GEOHASH\",o,...m],t)}};var I=class extends e{constructor([n,t,o,m,r],a){let i=[\"GEOSEARCH\",n];(t.type===\"FROMMEMBER\"||t.type===\"frommember\")&&i.push(t.type,t.member),(t.type===\"FROMLONLAT\"||t.type===\"fromlonlat\")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type===\"BYRADIUS\"||o.type===\"byradius\")&&i.push(o.type,o.radius,o.radiusType),(o.type===\"BYBOX\"||o.type===\"bybox\")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),_optionalChain([r, 'optionalAccess', _22 => _22.count])&&i.push(r.count.limit,...r.count.any?[\"ANY\"]:[]);let p=ae=>!_optionalChain([r, 'optionalAccess', _23 => _23.withCoord])&&!_optionalChain([r, 'optionalAccess', _24 => _24.withDist])&&!_optionalChain([r, 'optionalAccess', _25 => _25.withHash])?ae.map(d=>{try{return{member:JSON.parse(d)}}catch (e5){return{member:d}}}):ae.map(d=>{let ee=1,h={};try{h.member=JSON.parse(d[0])}catch (e6){h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[ee++])),r.withHash&&(h.hash=d[ee++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[ee][0]),lat:parseFloat(d[ee][1])}),h});super([...i,..._optionalChain([r, 'optionalAccess', _26 => _26.withCoord])?[\"WITHCOORD\"]:[],..._optionalChain([r, 'optionalAccess', _27 => _27.withDist])?[\"WITHDIST\"]:[],..._optionalChain([r, 'optionalAccess', _28 => _28.withHash])?[\"WITHHASH\"]:[]],{...a,deserialize:p})}};var K=class extends e{constructor([n,t,o,m,r,a],i){let p=[\"GEOSEARCHSTORE\",n,t];(o.type===\"FROMMEMBER\"||o.type===\"frommember\")&&p.push(o.type,o.member),(o.type===\"FROMLONLAT\"||o.type===\"fromlonlat\")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type===\"BYRADIUS\"||m.type===\"byradius\")&&p.push(m.type,m.radius,m.radiusType),(m.type===\"BYBOX\"||m.type===\"bybox\")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),_optionalChain([a, 'optionalAccess', _29 => _29.count])&&p.push(a.count.limit,...a.count.any?[\"ANY\"]:[]),super([...p,..._optionalChain([a, 'optionalAccess', _30 => _30.storeDist])?[\"STOREDIST\"]:[]],i)}};var L=class extends e{constructor(n,t){super([\"get\",...n],t)}};var Z=class extends e{constructor(n,t){super([\"getbit\",...n],t)}};var N=class extends e{constructor(n,t){super([\"getdel\",...n],t)}};var G=class extends e{constructor(n,t){super([\"getrange\",...n],t)}};var B=class extends e{constructor(n,t){super([\"getset\",...n],t)}};var U=class extends e{constructor(n,t){super([\"hdel\",...n],t)}};var H=class extends e{constructor(n,t){super([\"hexists\",...n],t)}};var F=class extends e{constructor(n,t){super([\"hget\",...n],t)}};function le(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch (e7){n[t]=o}}return n}var q=class extends e{constructor(n,t){super([\"hgetall\",...n],{deserialize:o=>le(o),...t})}};var $=class extends e{constructor(n,t){super([\"hincrby\",...n],t)}};var X=class extends e{constructor(n,t){super([\"hincrbyfloat\",...n],t)}};var j=class extends e{constructor([n],t){super([\"hkeys\",n],t)}};var Y=class extends e{constructor(n,t){super([\"hlen\",...n],t)}};function ge(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;oge(t,m),...o})}};var V=class extends e{constructor([n,t],o){super([\"hmset\",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function xe(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch (e9){n[t]=o}}return n}var _=class extends e{constructor(n,t){let o=[\"hrandfield\",n[0]];typeof n[1]==\"number\"&&o.push(n[1]),n[2]&&o.push(\"WITHVALUES\"),super(o,{deserialize:n[2]?m=>xe(m):_optionalChain([t, 'optionalAccess', _31 => _31.deserialize]),...t})}};var Q=class extends e{constructor([n,t,o],m){let r=[\"hscan\",n,t];_optionalChain([o, 'optionalAccess', _32 => _32.match])&&r.push(\"match\",o.match),typeof _optionalChain([o, 'optionalAccess', _33 => _33.count])==\"number\"&&r.push(\"count\",o.count),super(r,m)}};var nn=class extends e{constructor([n,t],o){super([\"hset\",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var tn=class extends e{constructor(n,t){super([\"hsetnx\",...n],t)}};var en=class extends e{constructor(n,t){super([\"hstrlen\",...n],t)}};var on=class extends e{constructor(n,t){super([\"hvals\",...n],t)}};var sn=class extends e{constructor(n,t){super([\"incr\",...n],t)}};var mn=class extends e{constructor(n,t){super([\"incrby\",...n],t)}};var rn=class extends e{constructor(n,t){super([\"incrbyfloat\",...n],t)}};var an=class extends e{constructor(n,t){super([\"JSON.ARRAPPEND\",...n],t)}};var pn=class extends e{constructor(n,t){super([\"JSON.ARRINDEX\",...n],t)}};var dn=class extends e{constructor(n,t){super([\"JSON.ARRINSERT\",...n],t)}};var cn=class extends e{constructor(n,t){super([\"JSON.ARRLEN\",n[0],_nullishCoalesce(n[1], () => (\"$\"))],t)}};var un=class extends e{constructor(n,t){super([\"JSON.ARRPOP\",...n],t)}};var hn=class extends e{constructor(n,t){let o=_nullishCoalesce(n[1], () => (\"$\")),m=_nullishCoalesce(n[2], () => (0)),r=_nullishCoalesce(n[3], () => (0));super([\"JSON.ARRTRIM\",n[0],o,m,r],t)}};var Cn=class extends e{constructor(n,t){super([\"JSON.CLEAR\",...n],t)}};var ln=class extends e{constructor(n,t){super([\"JSON.DEL\",...n],t)}};var gn=class extends e{constructor(n,t){super([\"JSON.FORGET\",...n],t)}};var xn=class extends e{constructor(n,t){let o=[\"JSON.GET\"];typeof n[1]==\"string\"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push(\"INDENT\",n[1].indent),n[1].newline&&o.push(\"NEWLINE\",n[1].newline),n[1].space&&o.push(\"SPACE\",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var fn=class extends e{constructor(n,t){super([\"JSON.MGET\",...n[0],n[1]],t)}};var yn=class extends e{constructor(n,t){super([\"JSON.NUMINCRBY\",...n],t)}};var bn=class extends e{constructor(n,t){super([\"JSON.NUMMULTBY\",...n],t)}};var On=class extends e{constructor(n,t){super([\"JSON.OBJKEYS\",...n],t)}};var Tn=class extends e{constructor(n,t){super([\"JSON.OBJLEN\",...n],t)}};var wn=class extends e{constructor(n,t){super([\"JSON.RESP\",...n],t)}};var Dn=class extends e{constructor(n,t){let o=[\"JSON.SET\",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push(\"NX\"):n[3].xx&&o.push(\"XX\")),super(o,t)}};var kn=class extends e{constructor(n,t){super([\"JSON.STRAPPEND\",...n],t)}};var An=class extends e{constructor(n,t){super([\"JSON.STRLEN\",...n],t)}};var Sn=class extends e{constructor(n,t){super([\"JSON.TOGGLE\",...n],t)}};var Rn=class extends e{constructor(n,t){super([\"JSON.TYPE\",...n],t)}};var Mn=class extends e{constructor(n,t){super([\"keys\",...n],t)}};var vn=class extends e{constructor(n,t){super([\"lindex\",...n],t)}};var En=class extends e{constructor(n,t){super([\"linsert\",...n],t)}};var zn=class extends e{constructor(n,t){super([\"llen\",...n],t)}};var Jn=class extends e{constructor(n,t){super([\"lmove\",...n],t)}};var Pn=class extends e{constructor(n,t){super([\"lpop\",...n],t)}};var In=class extends e{constructor(n,t){let o=[\"lpos\",n[0],n[1]];typeof _optionalChain([n, 'access', _34 => _34[2], 'optionalAccess', _35 => _35.rank])==\"number\"&&o.push(\"rank\",n[2].rank),typeof _optionalChain([n, 'access', _36 => _36[2], 'optionalAccess', _37 => _37.count])==\"number\"&&o.push(\"count\",n[2].count),typeof _optionalChain([n, 'access', _38 => _38[2], 'optionalAccess', _39 => _39.maxLen])==\"number\"&&o.push(\"maxLen\",n[2].maxLen),super(o,t)}};var Kn=class extends e{constructor(n,t){super([\"lpush\",...n],t)}};var Ln=class extends e{constructor(n,t){super([\"lpushx\",...n],t)}};var Zn=class extends e{constructor(n,t){super([\"lrange\",...n],t)}};var Nn=class extends e{constructor(n,t){super([\"lrem\",...n],t)}};var Gn=class extends e{constructor(n,t){super([\"lset\",...n],t)}};var Bn=class extends e{constructor(n,t){super([\"ltrim\",...n],t)}};var Un=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super([\"mget\",...o],t)}};var Hn=class extends e{constructor([n],t){super([\"mset\",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Fn=class extends e{constructor([n],t){super([\"msetnx\",...Object.entries(n).flatMap(o=>o)],t)}};var qn=class extends e{constructor(n,t){super([\"persist\",...n],t)}};var $n=class extends e{constructor(n,t){super([\"pexpire\",...n],t)}};var Xn=class extends e{constructor(n,t){super([\"pexpireat\",...n],t)}};var jn=class extends e{constructor(n,t){let o=[\"ping\"];typeof n<\"u\"&&typeof n[0]<\"u\"&&o.push(n[0]),super(o,t)}};var Yn=class extends e{constructor(n,t){super([\"psetex\",...n],t)}};var Wn=class extends e{constructor(n,t){super([\"pttl\",...n],t)}};var Vn=class extends e{constructor(n,t){super([\"publish\",...n],t)}};var _n=class extends e{constructor(n){super([\"randomkey\"],n)}};var Qn=class extends e{constructor(n,t){super([\"rename\",...n],t)}};var nt=class extends e{constructor(n,t){super([\"renamenx\",...n],t)}};var tt=class extends e{constructor(n,t){super([\"rpop\",...n],t)}};var et=class extends e{constructor(n,t){super([\"rpush\",...n],t)}};var ot=class extends e{constructor(n,t){super([\"rpushx\",...n],t)}};var st=class extends e{constructor(n,t){super([\"sadd\",...n],t)}};var mt=class extends e{constructor([n,t],o){let m=[\"scan\",n];_optionalChain([t, 'optionalAccess', _40 => _40.match])&&m.push(\"match\",t.match),typeof _optionalChain([t, 'optionalAccess', _41 => _41.count])==\"number\"&&m.push(\"count\",t.count),_optionalChain([t, 'optionalAccess', _42 => _42.type])&&t.type.length>0&&m.push(\"type\",t.type),super(m,o)}};var rt=class extends e{constructor(n,t){super([\"scard\",...n],t)}};var at=class extends e{constructor(n,t){super([\"script\",\"exists\",...n],{deserialize:o=>o,...t})}};var it=class extends e{constructor([n],t){let o=[\"script\",\"flush\"];_optionalChain([n, 'optionalAccess', _43 => _43.sync])?o.push(\"sync\"):_optionalChain([n, 'optionalAccess', _44 => _44.async])&&o.push(\"async\"),super(o,t)}};var pt=class extends e{constructor(n,t){super([\"script\",\"load\",...n],t)}};var dt=class extends e{constructor(n,t){super([\"sdiff\",...n],t)}};var ct=class extends e{constructor(n,t){super([\"sdiffstore\",...n],t)}};var ut=class extends e{constructor([n,t,o],m){let r=[\"set\",n,t];o&&(\"nx\"in o&&o.nx?r.push(\"nx\"):\"xx\"in o&&o.xx&&r.push(\"xx\"),\"get\"in o&&o.get&&r.push(\"get\"),\"ex\"in o&&typeof o.ex==\"number\"?r.push(\"ex\",o.ex):\"px\"in o&&typeof o.px==\"number\"?r.push(\"px\",o.px):\"exat\"in o&&typeof o.exat==\"number\"?r.push(\"exat\",o.exat):\"pxat\"in o&&typeof o.pxat==\"number\"?r.push(\"pxat\",o.pxat):\"keepTtl\"in o&&o.keepTtl&&r.push(\"keepTtl\")),super(r,m)}};var ht=class extends e{constructor(n,t){super([\"setbit\",...n],t)}};var Ct=class extends e{constructor(n,t){super([\"setex\",...n],t)}};var lt=class extends e{constructor(n,t){super([\"setnx\",...n],t)}};var gt=class extends e{constructor(n,t){super([\"setrange\",...n],t)}};var xt=class extends e{constructor(n,t){super([\"sinter\",...n],t)}};var ft=class extends e{constructor(n,t){super([\"sinterstore\",...n],t)}};var yt=class extends e{constructor(n,t){super([\"sismember\",...n],t)}};var bt=class extends e{constructor(n,t){super([\"smembers\",...n],t)}};var Ot=class extends e{constructor(n,t){super([\"smismember\",n[0],...n[1]],t)}};var Tt=class extends e{constructor(n,t){super([\"smove\",...n],t)}};var wt=class extends e{constructor([n,t],o){let m=[\"spop\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor([n,t],o){let m=[\"srandmember\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var kt=class extends e{constructor(n,t){super([\"srem\",...n],t)}};var At=class extends e{constructor([n,t,o],m){let r=[\"sscan\",n,t];_optionalChain([o, 'optionalAccess', _45 => _45.match])&&r.push(\"match\",o.match),typeof _optionalChain([o, 'optionalAccess', _46 => _46.count])==\"number\"&&r.push(\"count\",o.count),super(r,m)}};var St=class extends e{constructor(n,t){super([\"strlen\",...n],t)}};var Rt=class extends e{constructor(n,t){super([\"sunion\",...n],t)}};var Mt=class extends e{constructor(n,t){super([\"sunionstore\",...n],t)}};var vt=class extends e{constructor(n){super([\"time\"],n)}};var Et=class extends e{constructor(n,t){super([\"touch\",...n],t)}};var zt=class extends e{constructor(n,t){super([\"ttl\",...n],t)}};var Jt=class extends e{constructor(n,t){super([\"type\",...n],t)}};var Pt=class extends e{constructor(n,t){super([\"unlink\",...n],t)}};var oe=class extends e{constructor([n,t,o,m],r){let a=[\"XADD\",n];m&&(m.nomkStream&&a.push(\"NOMKSTREAM\"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<\"u\"&&a.push(\"LIMIT\",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function fe(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch (e10){n[o][r]=a}}}return n}var se=class extends e{constructor([n,t,o,m],r){let a=[\"XRANGE\",n,t,o];typeof m==\"number\"&&a.push(\"COUNT\",m),super(a,{deserialize:i=>fe(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=[\"zadd\",n];\"nx\"in t&&t.nx?r.push(\"nx\"):\"xx\"in t&&t.xx&&r.push(\"xx\"),\"ch\"in t&&t.ch&&r.push(\"ch\"),\"incr\"in t&&t.incr&&r.push(\"incr\"),\"score\"in t&&\"member\"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var It=class extends e{constructor(n,t){super([\"zcard\",...n],t)}};var Kt=class extends e{constructor(n,t){super([\"zcount\",...n],t)}};var Lt=class extends e{constructor(n,t){super([\"zincrby\",...n],t)}};var Zt=class extends e{constructor([n,t,o,m],r){let a=[\"zinterstore\",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&(\"weights\"in m&&m.weights?a.push(\"weights\",...m.weights):\"weight\"in m&&typeof m.weight==\"number\"&&a.push(\"weights\",m.weight),\"aggregate\"in m&&a.push(\"aggregate\",m.aggregate)),super(a,r)}};var Nt=class extends e{constructor(n,t){super([\"zlexcount\",...n],t)}};var Gt=class extends e{constructor([n,t],o){let m=[\"zpopmax\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var Bt=class extends e{constructor([n,t],o){let m=[\"zpopmin\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var Ut=class extends e{constructor([n,t,o,m],r){let a=[\"zrange\",n,t,o];_optionalChain([m, 'optionalAccess', _47 => _47.byScore])&&a.push(\"byscore\"),_optionalChain([m, 'optionalAccess', _48 => _48.byLex])&&a.push(\"bylex\"),_optionalChain([m, 'optionalAccess', _49 => _49.rev])&&a.push(\"rev\"),typeof _optionalChain([m, 'optionalAccess', _50 => _50.count])<\"u\"&&typeof _optionalChain([m, 'optionalAccess', _51 => _51.offset])<\"u\"&&a.push(\"limit\",m.offset,m.count),_optionalChain([m, 'optionalAccess', _52 => _52.withScores])&&a.push(\"withscores\"),super(a,r)}};var Ht=class extends e{constructor(n,t){super([\"zrank\",...n],t)}};var Ft=class extends e{constructor(n,t){super([\"zrem\",...n],t)}};var qt=class extends e{constructor(n,t){super([\"zremrangebylex\",...n],t)}};var $t=class extends e{constructor(n,t){super([\"zremrangebyrank\",...n],t)}};var Xt=class extends e{constructor(n,t){super([\"zremrangebyscore\",...n],t)}};var jt=class extends e{constructor(n,t){super([\"zrevrank\",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=[\"zscan\",n,t];_optionalChain([o, 'optionalAccess', _53 => _53.match])&&r.push(\"match\",o.match),typeof _optionalChain([o, 'optionalAccess', _54 => _54.count])==\"number\"&&r.push(\"count\",o.count),super(r,m)}};var Wt=class extends e{constructor(n,t){super([\"zscore\",...n],t)}};var Vt=class extends e{constructor([n,t,o],m){let r=[\"zunion\",n];Array.isArray(t)?r.push(...t):r.push(t),o&&(\"weights\"in o&&o.weights?r.push(\"weights\",...o.weights):\"weight\"in o&&typeof o.weight==\"number\"&&r.push(\"weights\",o.weight),\"aggregate\"in o&&r.push(\"aggregate\",o.aggregate),_optionalChain([o, 'optionalAccess', _55 => _55.withScores])&&r.push(\"withscores\")),super(r,m)}};var _t=class extends e{constructor([n,t,o,m],r){let a=[\"zunionstore\",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&(\"weights\"in m&&m.weights?a.push(\"weights\",...m.weights):\"weight\"in m&&typeof m.weight==\"number\"&&a.push(\"weights\",m.weight),\"aggregate\"in m&&a.push(\"aggregate\",m.aggregate)),super(a,r)}};var Qt=class extends e{constructor(n,t){super([\"zdiffstore\",...n],t)}};var ne=class extends e{constructor(n,t){let[o,m]=n;super([\"zmscore\",o,...m],t)}};var te= (_class =class{constructor(n){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);_class.prototype.__init11.call(this);_class.prototype.__init12.call(this);_class.prototype.__init13.call(this);_class.prototype.__init14.call(this);_class.prototype.__init15.call(this);_class.prototype.__init16.call(this);_class.prototype.__init17.call(this);_class.prototype.__init18.call(this);_class.prototype.__init19.call(this);_class.prototype.__init20.call(this);_class.prototype.__init21.call(this);_class.prototype.__init22.call(this);_class.prototype.__init23.call(this);_class.prototype.__init24.call(this);_class.prototype.__init25.call(this);_class.prototype.__init26.call(this);_class.prototype.__init27.call(this);_class.prototype.__init28.call(this);_class.prototype.__init29.call(this);_class.prototype.__init30.call(this);_class.prototype.__init31.call(this);_class.prototype.__init32.call(this);_class.prototype.__init33.call(this);_class.prototype.__init34.call(this);_class.prototype.__init35.call(this);_class.prototype.__init36.call(this);_class.prototype.__init37.call(this);_class.prototype.__init38.call(this);_class.prototype.__init39.call(this);_class.prototype.__init40.call(this);_class.prototype.__init41.call(this);_class.prototype.__init42.call(this);_class.prototype.__init43.call(this);_class.prototype.__init44.call(this);_class.prototype.__init45.call(this);_class.prototype.__init46.call(this);_class.prototype.__init47.call(this);_class.prototype.__init48.call(this);_class.prototype.__init49.call(this);_class.prototype.__init50.call(this);_class.prototype.__init51.call(this);_class.prototype.__init52.call(this);_class.prototype.__init53.call(this);_class.prototype.__init54.call(this);_class.prototype.__init55.call(this);_class.prototype.__init56.call(this);_class.prototype.__init57.call(this);_class.prototype.__init58.call(this);_class.prototype.__init59.call(this);_class.prototype.__init60.call(this);_class.prototype.__init61.call(this);_class.prototype.__init62.call(this);_class.prototype.__init63.call(this);_class.prototype.__init64.call(this);_class.prototype.__init65.call(this);_class.prototype.__init66.call(this);_class.prototype.__init67.call(this);_class.prototype.__init68.call(this);_class.prototype.__init69.call(this);_class.prototype.__init70.call(this);_class.prototype.__init71.call(this);_class.prototype.__init72.call(this);_class.prototype.__init73.call(this);_class.prototype.__init74.call(this);_class.prototype.__init75.call(this);_class.prototype.__init76.call(this);_class.prototype.__init77.call(this);_class.prototype.__init78.call(this);_class.prototype.__init79.call(this);_class.prototype.__init80.call(this);_class.prototype.__init81.call(this);_class.prototype.__init82.call(this);_class.prototype.__init83.call(this);_class.prototype.__init84.call(this);_class.prototype.__init85.call(this);_class.prototype.__init86.call(this);_class.prototype.__init87.call(this);_class.prototype.__init88.call(this);_class.prototype.__init89.call(this);_class.prototype.__init90.call(this);_class.prototype.__init91.call(this);_class.prototype.__init92.call(this);_class.prototype.__init93.call(this);_class.prototype.__init94.call(this);_class.prototype.__init95.call(this);_class.prototype.__init96.call(this);_class.prototype.__init97.call(this);_class.prototype.__init98.call(this);_class.prototype.__init99.call(this);_class.prototype.__init100.call(this);_class.prototype.__init101.call(this);_class.prototype.__init102.call(this);_class.prototype.__init103.call(this);_class.prototype.__init104.call(this);_class.prototype.__init105.call(this);_class.prototype.__init106.call(this);_class.prototype.__init107.call(this);_class.prototype.__init108.call(this);_class.prototype.__init109.call(this);_class.prototype.__init110.call(this);_class.prototype.__init111.call(this);_class.prototype.__init112.call(this);_class.prototype.__init113.call(this);_class.prototype.__init114.call(this);_class.prototype.__init115.call(this);_class.prototype.__init116.call(this);_class.prototype.__init117.call(this);_class.prototype.__init118.call(this);_class.prototype.__init119.call(this);_class.prototype.__init120.call(this);_class.prototype.__init121.call(this);_class.prototype.__init122.call(this);_class.prototype.__init123.call(this);this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=_nullishCoalesce(n.multiExec, () => (!1))}__init() {this.exec=async()=>{if(this.commands.length===0)throw new Error(\"Pipeline is empty\");let n=this.multiExec?[\"multi-exec\"]:[\"pipeline\"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})}}length(){return this.commands.length}chain(n){return this.commands.push(n),this}__init2() {this.append=(...n)=>this.chain(new C(n,this.commandOptions))}__init3() {this.bitcount=(...n)=>this.chain(new l(n,this.commandOptions))}__init4() {this.bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions))}__init5() {this.bitpos=(...n)=>this.chain(new x(n,this.commandOptions))}__init6() {this.copy=(...n)=>this.chain(new f(n,this.commandOptions))}__init7() {this.zdiffstore=(...n)=>this.chain(new Qt(n,this.commandOptions))}__init8() {this.dbsize=()=>this.chain(new y(this.commandOptions))}__init9() {this.decr=(...n)=>this.chain(new b(n,this.commandOptions))}__init10() {this.decrby=(...n)=>this.chain(new O(n,this.commandOptions))}__init11() {this.del=(...n)=>this.chain(new T(n,this.commandOptions))}__init12() {this.echo=(...n)=>this.chain(new w(n,this.commandOptions))}__init13() {this.eval=(...n)=>this.chain(new D(n,this.commandOptions))}__init14() {this.evalsha=(...n)=>this.chain(new k(n,this.commandOptions))}__init15() {this.exists=(...n)=>this.chain(new A(n,this.commandOptions))}__init16() {this.expire=(...n)=>this.chain(new S(n,this.commandOptions))}__init17() {this.expireat=(...n)=>this.chain(new R(n,this.commandOptions))}__init18() {this.flushall=n=>this.chain(new M(n,this.commandOptions))}__init19() {this.flushdb=(...n)=>this.chain(new v(n,this.commandOptions))}__init20() {this.get=(...n)=>this.chain(new L(n,this.commandOptions))}__init21() {this.getbit=(...n)=>this.chain(new Z(n,this.commandOptions))}__init22() {this.getdel=(...n)=>this.chain(new N(n,this.commandOptions))}__init23() {this.getrange=(...n)=>this.chain(new G(n,this.commandOptions))}__init24() {this.getset=(n,t)=>this.chain(new B([n,t],this.commandOptions))}__init25() {this.hdel=(...n)=>this.chain(new U(n,this.commandOptions))}__init26() {this.hexists=(...n)=>this.chain(new H(n,this.commandOptions))}__init27() {this.hget=(...n)=>this.chain(new F(n,this.commandOptions))}__init28() {this.hgetall=(...n)=>this.chain(new q(n,this.commandOptions))}__init29() {this.hincrby=(...n)=>this.chain(new $(n,this.commandOptions))}__init30() {this.hincrbyfloat=(...n)=>this.chain(new X(n,this.commandOptions))}__init31() {this.hkeys=(...n)=>this.chain(new j(n,this.commandOptions))}__init32() {this.hlen=(...n)=>this.chain(new Y(n,this.commandOptions))}__init33() {this.hmget=(...n)=>this.chain(new W(n,this.commandOptions))}__init34() {this.hmset=(n,t)=>this.chain(new V([n,t],this.commandOptions))}__init35() {this.hrandfield=(n,t,o)=>this.chain(new _([n,t,o],this.commandOptions))}__init36() {this.hscan=(...n)=>this.chain(new Q(n,this.commandOptions))}__init37() {this.hset=(n,t)=>this.chain(new nn([n,t],this.commandOptions))}__init38() {this.hsetnx=(n,t,o)=>this.chain(new tn([n,t,o],this.commandOptions))}__init39() {this.hstrlen=(...n)=>this.chain(new en(n,this.commandOptions))}__init40() {this.hvals=(...n)=>this.chain(new on(n,this.commandOptions))}__init41() {this.incr=(...n)=>this.chain(new sn(n,this.commandOptions))}__init42() {this.incrby=(...n)=>this.chain(new mn(n,this.commandOptions))}__init43() {this.incrbyfloat=(...n)=>this.chain(new rn(n,this.commandOptions))}__init44() {this.keys=(...n)=>this.chain(new Mn(n,this.commandOptions))}__init45() {this.lindex=(...n)=>this.chain(new vn(n,this.commandOptions))}__init46() {this.linsert=(n,t,o,m)=>this.chain(new En([n,t,o,m],this.commandOptions))}__init47() {this.llen=(...n)=>this.chain(new zn(n,this.commandOptions))}__init48() {this.lmove=(...n)=>this.chain(new Jn(n,this.commandOptions))}__init49() {this.lpop=(...n)=>this.chain(new Pn(n,this.commandOptions))}__init50() {this.lpos=(...n)=>this.chain(new In(n,this.commandOptions))}__init51() {this.lpush=(n,...t)=>this.chain(new Kn([n,...t],this.commandOptions))}__init52() {this.lpushx=(n,...t)=>this.chain(new Ln([n,...t],this.commandOptions))}__init53() {this.lrange=(...n)=>this.chain(new Zn(n,this.commandOptions))}__init54() {this.lrem=(n,t,o)=>this.chain(new Nn([n,t,o],this.commandOptions))}__init55() {this.lset=(n,t,o)=>this.chain(new Gn([n,t,o],this.commandOptions))}__init56() {this.ltrim=(...n)=>this.chain(new Bn(n,this.commandOptions))}__init57() {this.mget=(...n)=>this.chain(new Un(n,this.commandOptions))}__init58() {this.mset=n=>this.chain(new Hn([n],this.commandOptions))}__init59() {this.msetnx=n=>this.chain(new Fn([n],this.commandOptions))}__init60() {this.persist=(...n)=>this.chain(new qn(n,this.commandOptions))}__init61() {this.pexpire=(...n)=>this.chain(new $n(n,this.commandOptions))}__init62() {this.pexpireat=(...n)=>this.chain(new Xn(n,this.commandOptions))}__init63() {this.ping=n=>this.chain(new jn(n,this.commandOptions))}__init64() {this.psetex=(n,t,o)=>this.chain(new Yn([n,t,o],this.commandOptions))}__init65() {this.pttl=(...n)=>this.chain(new Wn(n,this.commandOptions))}__init66() {this.publish=(...n)=>this.chain(new Vn(n,this.commandOptions))}__init67() {this.randomkey=()=>this.chain(new _n(this.commandOptions))}__init68() {this.rename=(...n)=>this.chain(new Qn(n,this.commandOptions))}__init69() {this.renamenx=(...n)=>this.chain(new nt(n,this.commandOptions))}__init70() {this.rpop=(...n)=>this.chain(new tt(n,this.commandOptions))}__init71() {this.rpush=(n,...t)=>this.chain(new et([n,...t],this.commandOptions))}__init72() {this.rpushx=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions))}__init73() {this.sadd=(n,...t)=>this.chain(new st([n,...t],this.commandOptions))}__init74() {this.scan=(...n)=>this.chain(new mt(n,this.commandOptions))}__init75() {this.scard=(...n)=>this.chain(new rt(n,this.commandOptions))}__init76() {this.scriptExists=(...n)=>this.chain(new at(n,this.commandOptions))}__init77() {this.scriptFlush=(...n)=>this.chain(new it(n,this.commandOptions))}__init78() {this.scriptLoad=(...n)=>this.chain(new pt(n,this.commandOptions))}__init79() {this.sdiff=(...n)=>this.chain(new dt(n,this.commandOptions))}__init80() {this.sdiffstore=(...n)=>this.chain(new ct(n,this.commandOptions))}__init81() {this.set=(n,t,o)=>this.chain(new ut([n,t,o],this.commandOptions))}__init82() {this.setbit=(...n)=>this.chain(new ht(n,this.commandOptions))}__init83() {this.setex=(n,t,o)=>this.chain(new Ct([n,t,o],this.commandOptions))}__init84() {this.setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions))}__init85() {this.setrange=(...n)=>this.chain(new gt(n,this.commandOptions))}__init86() {this.sinter=(...n)=>this.chain(new xt(n,this.commandOptions))}__init87() {this.sinterstore=(...n)=>this.chain(new ft(n,this.commandOptions))}__init88() {this.sismember=(n,t)=>this.chain(new yt([n,t],this.commandOptions))}__init89() {this.smembers=(...n)=>this.chain(new bt(n,this.commandOptions))}__init90() {this.smismember=(n,t)=>this.chain(new Ot([n,t],this.commandOptions))}__init91() {this.smove=(n,t,o)=>this.chain(new Tt([n,t,o],this.commandOptions))}__init92() {this.spop=(...n)=>this.chain(new wt(n,this.commandOptions))}__init93() {this.srandmember=(...n)=>this.chain(new Dt(n,this.commandOptions))}__init94() {this.srem=(n,...t)=>this.chain(new kt([n,...t],this.commandOptions))}__init95() {this.sscan=(...n)=>this.chain(new At(n,this.commandOptions))}__init96() {this.strlen=(...n)=>this.chain(new St(n,this.commandOptions))}__init97() {this.sunion=(...n)=>this.chain(new Rt(n,this.commandOptions))}__init98() {this.sunionstore=(...n)=>this.chain(new Mt(n,this.commandOptions))}__init99() {this.time=()=>this.chain(new vt(this.commandOptions))}__init100() {this.touch=(...n)=>this.chain(new Et(n,this.commandOptions))}__init101() {this.ttl=(...n)=>this.chain(new zt(n,this.commandOptions))}__init102() {this.type=(...n)=>this.chain(new Jt(n,this.commandOptions))}__init103() {this.unlink=(...n)=>this.chain(new Pt(n,this.commandOptions))}__init104() {this.zadd=(...n)=>\"score\"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions))}__init105() {this.zcard=(...n)=>this.chain(new It(n,this.commandOptions))}__init106() {this.zcount=(...n)=>this.chain(new Kt(n,this.commandOptions))}__init107() {this.zincrby=(n,t,o)=>this.chain(new Lt([n,t,o],this.commandOptions))}__init108() {this.zinterstore=(...n)=>this.chain(new Zt(n,this.commandOptions))}__init109() {this.zlexcount=(...n)=>this.chain(new Nt(n,this.commandOptions))}__init110() {this.zmscore=(...n)=>this.chain(new ne(n,this.commandOptions))}__init111() {this.zpopmax=(...n)=>this.chain(new Gt(n,this.commandOptions))}__init112() {this.zpopmin=(...n)=>this.chain(new Bt(n,this.commandOptions))}__init113() {this.zrange=(...n)=>this.chain(new Ut(n,this.commandOptions))}__init114() {this.zrank=(n,t)=>this.chain(new Ht([n,t],this.commandOptions))}__init115() {this.zrem=(n,...t)=>this.chain(new Ft([n,...t],this.commandOptions))}__init116() {this.zremrangebylex=(...n)=>this.chain(new qt(n,this.commandOptions))}__init117() {this.zremrangebyrank=(...n)=>this.chain(new $t(n,this.commandOptions))}__init118() {this.zremrangebyscore=(...n)=>this.chain(new Xt(n,this.commandOptions))}__init119() {this.zrevrank=(n,t)=>this.chain(new jt([n,t],this.commandOptions))}__init120() {this.zscan=(...n)=>this.chain(new Yt(n,this.commandOptions))}__init121() {this.zscore=(n,t)=>this.chain(new Wt([n,t],this.commandOptions))}__init122() {this.zunionstore=(...n)=>this.chain(new _t(n,this.commandOptions))}__init123() {this.zunion=(...n)=>this.chain(new Vt(n,this.commandOptions))}get json(){return{arrappend:(...n)=>this.chain(new an(n,this.commandOptions)),arrindex:(...n)=>this.chain(new pn(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new dn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new cn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new un(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new hn(n,this.commandOptions)),clear:(...n)=>this.chain(new Cn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new gn(n,this.commandOptions)),geoadd:(...n)=>this.chain(new E(n,this.commandOptions)),geodist:(...n)=>this.chain(new z(n,this.commandOptions)),geopos:(...n)=>this.chain(new J(n,this.commandOptions)),geohash:(...n)=>this.chain(new P(n,this.commandOptions)),geosearch:(...n)=>this.chain(new I(n,this.commandOptions)),geosearchstore:(...n)=>this.chain(new K(n,this.commandOptions)),get:(...n)=>this.chain(new xn(n,this.commandOptions)),mget:(...n)=>this.chain(new fn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new yn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new bn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new On(n,this.commandOptions)),objlen:(...n)=>this.chain(new Tn(n,this.commandOptions)),resp:(...n)=>this.chain(new wn(n,this.commandOptions)),set:(...n)=>this.chain(new Dn(n,this.commandOptions)),strappend:(...n)=>this.chain(new kn(n,this.commandOptions)),strlen:(...n)=>this.chain(new An(n,this.commandOptions)),toggle:(...n)=>this.chain(new Sn(n,this.commandOptions)),type:(...n)=>this.chain(new Rn(n,this.commandOptions))}}}, _class);var _enchex = require('crypto-js/enc-hex'); var _enchex2 = _interopRequireDefault(_enchex);var _sha1 = require('crypto-js/sha1'); var _sha12 = _interopRequireDefault(_sha1);var me=class{constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes(\"noscript\"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return _enchex2.default.stringify(_sha12.default.call(void 0, n))}};var ue= (_class2 =class{constructor(n,t){;_class2.prototype.__init124.call(this);_class2.prototype.__init125.call(this);_class2.prototype.__init126.call(this);_class2.prototype.__init127.call(this);_class2.prototype.__init128.call(this);_class2.prototype.__init129.call(this);_class2.prototype.__init130.call(this);_class2.prototype.__init131.call(this);_class2.prototype.__init132.call(this);_class2.prototype.__init133.call(this);_class2.prototype.__init134.call(this);_class2.prototype.__init135.call(this);_class2.prototype.__init136.call(this);_class2.prototype.__init137.call(this);_class2.prototype.__init138.call(this);_class2.prototype.__init139.call(this);_class2.prototype.__init140.call(this);_class2.prototype.__init141.call(this);_class2.prototype.__init142.call(this);_class2.prototype.__init143.call(this);_class2.prototype.__init144.call(this);_class2.prototype.__init145.call(this);_class2.prototype.__init146.call(this);_class2.prototype.__init147.call(this);_class2.prototype.__init148.call(this);_class2.prototype.__init149.call(this);_class2.prototype.__init150.call(this);_class2.prototype.__init151.call(this);_class2.prototype.__init152.call(this);_class2.prototype.__init153.call(this);_class2.prototype.__init154.call(this);_class2.prototype.__init155.call(this);_class2.prototype.__init156.call(this);_class2.prototype.__init157.call(this);_class2.prototype.__init158.call(this);_class2.prototype.__init159.call(this);_class2.prototype.__init160.call(this);_class2.prototype.__init161.call(this);_class2.prototype.__init162.call(this);_class2.prototype.__init163.call(this);_class2.prototype.__init164.call(this);_class2.prototype.__init165.call(this);_class2.prototype.__init166.call(this);_class2.prototype.__init167.call(this);_class2.prototype.__init168.call(this);_class2.prototype.__init169.call(this);_class2.prototype.__init170.call(this);_class2.prototype.__init171.call(this);_class2.prototype.__init172.call(this);_class2.prototype.__init173.call(this);_class2.prototype.__init174.call(this);_class2.prototype.__init175.call(this);_class2.prototype.__init176.call(this);_class2.prototype.__init177.call(this);_class2.prototype.__init178.call(this);_class2.prototype.__init179.call(this);_class2.prototype.__init180.call(this);_class2.prototype.__init181.call(this);_class2.prototype.__init182.call(this);_class2.prototype.__init183.call(this);_class2.prototype.__init184.call(this);_class2.prototype.__init185.call(this);_class2.prototype.__init186.call(this);_class2.prototype.__init187.call(this);_class2.prototype.__init188.call(this);_class2.prototype.__init189.call(this);_class2.prototype.__init190.call(this);_class2.prototype.__init191.call(this);_class2.prototype.__init192.call(this);_class2.prototype.__init193.call(this);_class2.prototype.__init194.call(this);_class2.prototype.__init195.call(this);_class2.prototype.__init196.call(this);_class2.prototype.__init197.call(this);_class2.prototype.__init198.call(this);_class2.prototype.__init199.call(this);_class2.prototype.__init200.call(this);_class2.prototype.__init201.call(this);_class2.prototype.__init202.call(this);_class2.prototype.__init203.call(this);_class2.prototype.__init204.call(this);_class2.prototype.__init205.call(this);_class2.prototype.__init206.call(this);_class2.prototype.__init207.call(this);_class2.prototype.__init208.call(this);_class2.prototype.__init209.call(this);_class2.prototype.__init210.call(this);_class2.prototype.__init211.call(this);_class2.prototype.__init212.call(this);_class2.prototype.__init213.call(this);_class2.prototype.__init214.call(this);_class2.prototype.__init215.call(this);_class2.prototype.__init216.call(this);_class2.prototype.__init217.call(this);_class2.prototype.__init218.call(this);_class2.prototype.__init219.call(this);_class2.prototype.__init220.call(this);_class2.prototype.__init221.call(this);_class2.prototype.__init222.call(this);_class2.prototype.__init223.call(this);_class2.prototype.__init224.call(this);_class2.prototype.__init225.call(this);_class2.prototype.__init226.call(this);_class2.prototype.__init227.call(this);_class2.prototype.__init228.call(this);_class2.prototype.__init229.call(this);_class2.prototype.__init230.call(this);_class2.prototype.__init231.call(this);_class2.prototype.__init232.call(this);_class2.prototype.__init233.call(this);_class2.prototype.__init234.call(this);_class2.prototype.__init235.call(this);_class2.prototype.__init236.call(this);_class2.prototype.__init237.call(this);_class2.prototype.__init238.call(this);_class2.prototype.__init239.call(this);_class2.prototype.__init240.call(this);_class2.prototype.__init241.call(this);_class2.prototype.__init242.call(this);_class2.prototype.__init243.call(this);_class2.prototype.__init244.call(this);_class2.prototype.__init245.call(this);_class2.prototype.__init246.call(this);_class2.prototype.__init247.call(this);_class2.prototype.__init248.call(this);_class2.prototype.__init249.call(this);_class2.prototype.__init250.call(this);_class2.prototype.__init251.call(this);this.client=n,this.opts=t,this.enableTelemetry=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _56 => _56.enableTelemetry]), () => (!0))}get json(){return{arrappend:(...n)=>new an(n,this.opts).exec(this.client),arrindex:(...n)=>new pn(n,this.opts).exec(this.client),arrinsert:(...n)=>new dn(n,this.opts).exec(this.client),arrlen:(...n)=>new cn(n,this.opts).exec(this.client),arrpop:(...n)=>new un(n,this.opts).exec(this.client),arrtrim:(...n)=>new hn(n,this.opts).exec(this.client),clear:(...n)=>new Cn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new gn(n,this.opts).exec(this.client),geoadd:(...n)=>new E(n,this.opts).exec(this.client),geopos:(...n)=>new J(n,this.opts).exec(this.client),geodist:(...n)=>new z(n,this.opts).exec(this.client),geohash:(...n)=>new P(n,this.opts).exec(this.client),geosearch:(...n)=>new I(n,this.opts).exec(this.client),geosearchstore:(...n)=>new K(n,this.opts).exec(this.client),get:(...n)=>new xn(n,this.opts).exec(this.client),mget:(...n)=>new fn(n,this.opts).exec(this.client),numincrby:(...n)=>new yn(n,this.opts).exec(this.client),nummultby:(...n)=>new bn(n,this.opts).exec(this.client),objkeys:(...n)=>new On(n,this.opts).exec(this.client),objlen:(...n)=>new Tn(n,this.opts).exec(this.client),resp:(...n)=>new wn(n,this.opts).exec(this.client),set:(...n)=>new Dn(n,this.opts).exec(this.client),strappend:(...n)=>new kn(n,this.opts).exec(this.client),strlen:(...n)=>new An(n,this.opts).exec(this.client),toggle:(...n)=>new Sn(n,this.opts).exec(this.client),type:(...n)=>new Rn(n,this.opts).exec(this.client)}}__init124() {this.use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)}}__init125() {this.addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch (e12){}}}createScript(n){return new me(this,n)}__init126() {this.pipeline=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!1})}__init127() {this.multi=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!0})}__init128() {this.append=(...n)=>new C(n,this.opts).exec(this.client)}__init129() {this.bitcount=(...n)=>new l(n,this.opts).exec(this.client)}__init130() {this.bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client)}__init131() {this.bitpos=(...n)=>new x(n,this.opts).exec(this.client)}__init132() {this.copy=(...n)=>new f(n,this.opts).exec(this.client)}__init133() {this.dbsize=()=>new y(this.opts).exec(this.client)}__init134() {this.decr=(...n)=>new b(n,this.opts).exec(this.client)}__init135() {this.decrby=(...n)=>new O(n,this.opts).exec(this.client)}__init136() {this.del=(...n)=>new T(n,this.opts).exec(this.client)}__init137() {this.echo=(...n)=>new w(n,this.opts).exec(this.client)}__init138() {this.eval=(...n)=>new D(n,this.opts).exec(this.client)}__init139() {this.evalsha=(...n)=>new k(n,this.opts).exec(this.client)}__init140() {this.exists=(...n)=>new A(n,this.opts).exec(this.client)}__init141() {this.expire=(...n)=>new S(n,this.opts).exec(this.client)}__init142() {this.expireat=(...n)=>new R(n,this.opts).exec(this.client)}__init143() {this.flushall=n=>new M(n,this.opts).exec(this.client)}__init144() {this.flushdb=(...n)=>new v(n,this.opts).exec(this.client)}__init145() {this.get=(...n)=>new L(n,this.opts).exec(this.client)}__init146() {this.getbit=(...n)=>new Z(n,this.opts).exec(this.client)}__init147() {this.getdel=(...n)=>new N(n,this.opts).exec(this.client)}__init148() {this.getrange=(...n)=>new G(n,this.opts).exec(this.client)}__init149() {this.getset=(n,t)=>new B([n,t],this.opts).exec(this.client)}__init150() {this.hdel=(...n)=>new U(n,this.opts).exec(this.client)}__init151() {this.hexists=(...n)=>new H(n,this.opts).exec(this.client)}__init152() {this.hget=(...n)=>new F(n,this.opts).exec(this.client)}__init153() {this.hgetall=(...n)=>new q(n,this.opts).exec(this.client)}__init154() {this.hincrby=(...n)=>new $(n,this.opts).exec(this.client)}__init155() {this.hincrbyfloat=(...n)=>new X(n,this.opts).exec(this.client)}__init156() {this.hkeys=(...n)=>new j(n,this.opts).exec(this.client)}__init157() {this.hlen=(...n)=>new Y(n,this.opts).exec(this.client)}__init158() {this.hmget=(...n)=>new W(n,this.opts).exec(this.client)}__init159() {this.hmset=(n,t)=>new V([n,t],this.opts).exec(this.client)}__init160() {this.hrandfield=(n,t,o)=>new _([n,t,o],this.opts).exec(this.client)}__init161() {this.hscan=(...n)=>new Q(n,this.opts).exec(this.client)}__init162() {this.hset=(n,t)=>new nn([n,t],this.opts).exec(this.client)}__init163() {this.hsetnx=(n,t,o)=>new tn([n,t,o],this.opts).exec(this.client)}__init164() {this.hstrlen=(...n)=>new en(n,this.opts).exec(this.client)}__init165() {this.hvals=(...n)=>new on(n,this.opts).exec(this.client)}__init166() {this.incr=(...n)=>new sn(n,this.opts).exec(this.client)}__init167() {this.incrby=(...n)=>new mn(n,this.opts).exec(this.client)}__init168() {this.incrbyfloat=(...n)=>new rn(n,this.opts).exec(this.client)}__init169() {this.keys=(...n)=>new Mn(n,this.opts).exec(this.client)}__init170() {this.lindex=(...n)=>new vn(n,this.opts).exec(this.client)}__init171() {this.linsert=(n,t,o,m)=>new En([n,t,o,m],this.opts).exec(this.client)}__init172() {this.llen=(...n)=>new zn(n,this.opts).exec(this.client)}__init173() {this.lmove=(...n)=>new Jn(n,this.opts).exec(this.client)}__init174() {this.lpop=(...n)=>new Pn(n,this.opts).exec(this.client)}__init175() {this.lpos=(...n)=>new In(n,this.opts).exec(this.client)}__init176() {this.lpush=(n,...t)=>new Kn([n,...t],this.opts).exec(this.client)}__init177() {this.lpushx=(n,...t)=>new Ln([n,...t],this.opts).exec(this.client)}__init178() {this.lrange=(...n)=>new Zn(n,this.opts).exec(this.client)}__init179() {this.lrem=(n,t,o)=>new Nn([n,t,o],this.opts).exec(this.client)}__init180() {this.lset=(n,t,o)=>new Gn([n,t,o],this.opts).exec(this.client)}__init181() {this.ltrim=(...n)=>new Bn(n,this.opts).exec(this.client)}__init182() {this.mget=(...n)=>new Un(n,this.opts).exec(this.client)}__init183() {this.mset=n=>new Hn([n],this.opts).exec(this.client)}__init184() {this.msetnx=n=>new Fn([n],this.opts).exec(this.client)}__init185() {this.persist=(...n)=>new qn(n,this.opts).exec(this.client)}__init186() {this.pexpire=(...n)=>new $n(n,this.opts).exec(this.client)}__init187() {this.pexpireat=(...n)=>new Xn(n,this.opts).exec(this.client)}__init188() {this.ping=n=>new jn(n,this.opts).exec(this.client)}__init189() {this.psetex=(n,t,o)=>new Yn([n,t,o],this.opts).exec(this.client)}__init190() {this.pttl=(...n)=>new Wn(n,this.opts).exec(this.client)}__init191() {this.publish=(...n)=>new Vn(n,this.opts).exec(this.client)}__init192() {this.randomkey=()=>new _n().exec(this.client)}__init193() {this.rename=(...n)=>new Qn(n,this.opts).exec(this.client)}__init194() {this.renamenx=(...n)=>new nt(n,this.opts).exec(this.client)}__init195() {this.rpop=(...n)=>new tt(n,this.opts).exec(this.client)}__init196() {this.rpush=(n,...t)=>new et([n,...t],this.opts).exec(this.client)}__init197() {this.rpushx=(n,...t)=>new ot([n,...t],this.opts).exec(this.client)}__init198() {this.sadd=(n,...t)=>new st([n,...t],this.opts).exec(this.client)}__init199() {this.scan=(...n)=>new mt(n,this.opts).exec(this.client)}__init200() {this.scard=(...n)=>new rt(n,this.opts).exec(this.client)}__init201() {this.scriptExists=(...n)=>new at(n,this.opts).exec(this.client)}__init202() {this.scriptFlush=(...n)=>new it(n,this.opts).exec(this.client)}__init203() {this.scriptLoad=(...n)=>new pt(n,this.opts).exec(this.client)}__init204() {this.sdiff=(...n)=>new dt(n,this.opts).exec(this.client)}__init205() {this.sdiffstore=(...n)=>new ct(n,this.opts).exec(this.client)}__init206() {this.set=(n,t,o)=>new ut([n,t,o],this.opts).exec(this.client)}__init207() {this.setbit=(...n)=>new ht(n,this.opts).exec(this.client)}__init208() {this.setex=(n,t,o)=>new Ct([n,t,o],this.opts).exec(this.client)}__init209() {this.setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client)}__init210() {this.setrange=(...n)=>new gt(n,this.opts).exec(this.client)}__init211() {this.sinter=(...n)=>new xt(n,this.opts).exec(this.client)}__init212() {this.sinterstore=(...n)=>new ft(n,this.opts).exec(this.client)}__init213() {this.sismember=(n,t)=>new yt([n,t],this.opts).exec(this.client)}__init214() {this.smismember=(n,t)=>new Ot([n,t],this.opts).exec(this.client)}__init215() {this.smembers=(...n)=>new bt(n,this.opts).exec(this.client)}__init216() {this.smove=(n,t,o)=>new Tt([n,t,o],this.opts).exec(this.client)}__init217() {this.spop=(...n)=>new wt(n,this.opts).exec(this.client)}__init218() {this.srandmember=(...n)=>new Dt(n,this.opts).exec(this.client)}__init219() {this.srem=(n,...t)=>new kt([n,...t],this.opts).exec(this.client)}__init220() {this.sscan=(...n)=>new At(n,this.opts).exec(this.client)}__init221() {this.strlen=(...n)=>new St(n,this.opts).exec(this.client)}__init222() {this.sunion=(...n)=>new Rt(n,this.opts).exec(this.client)}__init223() {this.sunionstore=(...n)=>new Mt(n,this.opts).exec(this.client)}__init224() {this.time=()=>new vt().exec(this.client)}__init225() {this.touch=(...n)=>new Et(n,this.opts).exec(this.client)}__init226() {this.ttl=(...n)=>new zt(n,this.opts).exec(this.client)}__init227() {this.type=(...n)=>new Jt(n,this.opts).exec(this.client)}__init228() {this.unlink=(...n)=>new Pt(n,this.opts).exec(this.client)}__init229() {this.xadd=(...n)=>new oe(n,this.opts).exec(this.client)}__init230() {this.xrange=(...n)=>new se(n,this.opts).exec(this.client)}__init231() {this.zadd=(...n)=>\"score\"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client)}__init232() {this.zcard=(...n)=>new It(n,this.opts).exec(this.client)}__init233() {this.zcount=(...n)=>new Kt(n,this.opts).exec(this.client)}__init234() {this.zdiffstore=(...n)=>new Qt(n,this.opts).exec(this.client)}__init235() {this.zincrby=(n,t,o)=>new Lt([n,t,o],this.opts).exec(this.client)}__init236() {this.zinterstore=(...n)=>new Zt(n,this.opts).exec(this.client)}__init237() {this.zlexcount=(...n)=>new Nt(n,this.opts).exec(this.client)}__init238() {this.zmscore=(...n)=>new ne(n,this.opts).exec(this.client)}__init239() {this.zpopmax=(...n)=>new Gt(n,this.opts).exec(this.client)}__init240() {this.zpopmin=(...n)=>new Bt(n,this.opts).exec(this.client)}__init241() {this.zrange=(...n)=>new Ut(n,this.opts).exec(this.client)}__init242() {this.zrank=(n,t)=>new Ht([n,t],this.opts).exec(this.client)}__init243() {this.zrem=(n,...t)=>new Ft([n,...t],this.opts).exec(this.client)}__init244() {this.zremrangebylex=(...n)=>new qt(n,this.opts).exec(this.client)}__init245() {this.zremrangebyrank=(...n)=>new $t(n,this.opts).exec(this.client)}__init246() {this.zremrangebyscore=(...n)=>new Xt(n,this.opts).exec(this.client)}__init247() {this.zrevrank=(n,t)=>new jt([n,t],this.opts).exec(this.client)}__init248() {this.zscan=(...n)=>new Yt(n,this.opts).exec(this.client)}__init249() {this.zscore=(n,t)=>new Wt([n,t],this.opts).exec(this.client)}__init250() {this.zunion=(...n)=>new Vt(n,this.opts).exec(this.client)}__init251() {this.zunionstore=(...n)=>new _t(n,this.opts).exec(this.client)}}, _class2);var cC=\"v1.24.3\";exports.a = ie; exports.b = ue; exports.c = cC;\n","\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJIU2S2DZjs = require('./chunk-JIU2S2DZ.js');typeof atob>\"u\"&&(global.atob=function(n){return Buffer.from(n,\"base64\").toString(\"utf-8\")});var a=class n extends _chunkJIU2S2DZjs.b{constructor(e){if(\"request\"in e){super(e);return}(e.url.startsWith(\" \")||e.url.endsWith(\" \")||/\\r|\\n/.test(e.url))&&console.warn(\"The redis url contains whitespace or newline, which can cause errors!\"),(e.token.startsWith(\" \")||e.token.endsWith(\" \")||/\\r|\\n/.test(e.token))&&console.warn(\"The redis token contains whitespace or newline, which can cause errors!\");let t=new (0, _chunkJIU2S2DZjs.a)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache||\"no-store\"});super(t,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime==\"string\"?\"edge-light\":`node@${process.version}`,platform:process.env.VERCEL?\"vercel\":process.env.AWS_REGION?\"aws\":\"unknown\",sdk:`@upstash/redis@${_chunkJIU2S2DZjs.c}`})}static fromEnv(e){if(typeof _optionalChain([process, 'optionalAccess', _ => _.env])>\"u\")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from \"@upstash/redis/cloudflare\" instead');let t=_optionalChain([process, 'optionalAccess', _2 => _2.env, 'access', _3 => _3.UPSTASH_REDIS_REST_URL]);if(!t)throw new Error(\"Unable to find environment variable: `UPSTASH_REDIS_REST_URL`\");let s=_optionalChain([process, 'optionalAccess', _4 => _4.env, 'access', _5 => _5.UPSTASH_REDIS_REST_TOKEN]);if(!s)throw new Error(\"Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`\");return new n({...e,url:t,token:s})}};exports.Redis = a;\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\treturn CryptoJS.enc.Hex;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-1 hash algorithm.\n\t */\n\t var SHA1 = C_algo.SHA1 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476,\n\t 0xc3d2e1f0\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\n\t // Computation\n\t for (var i = 0; i < 80; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t W[i] = (n << 1) | (n >>> 31);\n\t }\n\n\t var t = ((a << 5) | (a >>> 27)) + e + W[i];\n\t if (i < 20) {\n\t t += ((b & c) | (~b & d)) + 0x5a827999;\n\t } else if (i < 40) {\n\t t += (b ^ c ^ d) + 0x6ed9eba1;\n\t } else if (i < 60) {\n\t t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;\n\t } else /* if (i < 80) */ {\n\t t += (b ^ c ^ d) - 0x359d3e2a;\n\t }\n\n\t e = d;\n\t d = c;\n\t c = (b << 30) | (b >>> 2);\n\t b = a;\n\t a = t;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA1('message');\n\t * var hash = CryptoJS.SHA1(wordArray);\n\t */\n\t C.SHA1 = Hasher._createHelper(SHA1);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA1(message, key);\n\t */\n\t C.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t}());\n\n\n\treturn CryptoJS.SHA1;\n\n}));","module.exports = require(\"crypto\");","module.exports = require(\"fs/promises\");","module.exports = require(\"path\");","\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true});// src/index.ts\nvar _redis = require('@upstash/redis');\nvar _kv = null;\nprocess.env.UPSTASH_DISABLE_TELEMETRY = \"1\";\nvar VercelKV = class extends _redis.Redis {\n // This API is based on https://github.com/redis/node-redis#scan-iterator which is not supported in @upstash/redis\n /**\n * Same as `scan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *scanIterator(options) {\n let cursor = 0;\n let keys;\n do {\n [cursor, keys] = await this.scan(cursor, options);\n for (const key of keys) {\n yield key;\n }\n } while (cursor !== 0);\n }\n /**\n * Same as `hscan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *hscanIterator(key, options) {\n let cursor = 0;\n let items;\n do {\n [cursor, items] = await this.hscan(key, cursor, options);\n for (const item of items) {\n yield item;\n }\n } while (cursor !== 0);\n }\n /**\n * Same as `sscan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *sscanIterator(key, options) {\n let cursor = 0;\n let items;\n do {\n [cursor, items] = await this.sscan(key, cursor, options);\n for (const item of items) {\n yield item;\n }\n } while (cursor !== 0);\n }\n /**\n * Same as `zscan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *zscanIterator(key, options) {\n let cursor = 0;\n let items;\n do {\n [cursor, items] = await this.zscan(key, cursor, options);\n for (const item of items) {\n yield item;\n }\n } while (cursor !== 0);\n }\n};\nfunction createClient(config) {\n return new VercelKV(config);\n}\nvar src_default = new Proxy(\n {},\n {\n get(target, prop, receiver) {\n if (prop === \"then\" || prop === \"parse\") {\n return Reflect.get(target, prop, receiver);\n }\n if (!_kv) {\n if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) {\n throw new Error(\n \"@vercel/kv: Missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN\"\n );\n }\n console.warn(\n '\\x1B[33m\"The default export has been moved to a named export and it will be removed in version 1, change to import { kv }\\x1B[0m\"'\n );\n _kv = createClient({\n url: process.env.KV_REST_API_URL,\n token: process.env.KV_REST_API_TOKEN\n });\n }\n return Reflect.get(_kv, prop);\n }\n }\n);\nvar kv = new Proxy(\n {},\n {\n get(target, prop) {\n if (!_kv) {\n if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) {\n throw new Error(\n \"@vercel/kv: Missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN\"\n );\n }\n _kv = createClient({\n url: process.env.KV_REST_API_URL,\n token: process.env.KV_REST_API_TOKEN\n });\n }\n return Reflect.get(_kv, prop);\n }\n }\n);\n\n\n\n\n\nexports.VercelKV = VercelKV; exports.createClient = createClient; exports.default = src_default; exports.kv = kv;\n//# sourceMappingURL=index.cjs.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","const fs = require('fs/promises')\nconst path = require('path')\n\nconst { createClient } = require('@vercel/kv')\n\nasync function main() {\n try {\n const file = path.join(\n process.cwd(),\n './test-results/nextjs-test-results.json'\n )\n\n let passingTests = ''\n let failingTests = ''\n let passCount = 0\n let failCount = 0\n\n const contents = await fs.readFile(file, 'utf-8')\n const results = JSON.parse(contents)\n let { ref } = results\n const currentDate = new Date()\n const isoString = currentDate.toISOString()\n const timestamp = isoString.slice(0, 19).replace('T', ' ')\n\n for (const result of results.result) {\n let suitePassCount = 0\n let suiteFailCount = 0\n\n suitePassCount += result.data.numPassedTests\n suiteFailCount += result.data.numFailedTests\n\n let suiteName = result.data.testResults[0].name\n // remove \"/root/actions-runner/_work/next.js/next.js/\" from the beginning of suiteName\n suiteName = suiteName.slice(\n '/root/actions-runner/_work/next.js/next.js/'.length\n )\n if (suitePassCount > 0) {\n passingTests += `${suiteName}\\n`\n }\n\n if (suiteFailCount > 0) {\n failingTests += `${suiteName}\\n`\n }\n\n for (const assertionResult of result.data.testResults[0]\n .assertionResults) {\n let assertion = assertionResult.fullName.replaceAll('`', '\\\\`')\n if (assertionResult.status === 'passed') {\n passingTests += `* ${assertion}\\n`\n } else if (assertionResult.status === 'failed') {\n failingTests += `* ${assertion}\\n`\n }\n }\n\n passCount += suitePassCount\n failCount += suiteFailCount\n\n if (suitePassCount > 0) {\n passingTests += `\\n`\n }\n\n if (suiteFailCount > 0) {\n failingTests += `\\n`\n }\n }\n\n const kv = createClient({\n url: process.env.TURBOYET_KV_REST_API_URL,\n token: process.env.TURBOYET_KV_REST_API_TOKEN,\n })\n\n const testRun = `${ref}\\t${timestamp}\\t${passCount}/${\n passCount + failCount\n }`\n\n console.log('TEST RESULT')\n console.log(testRun)\n\n await kv.rpush('test-runs', testRun)\n console.log('SUCCESSFULLY SAVED RUNS')\n\n await kv.set('passing-tests', passingTests)\n console.log('SUCCESSFULLY SAVED PASSING')\n\n await kv.set('failing-tests', failingTests)\n console.log('SUCCESSFULLY SAVED FAILING')\n } catch (error) {\n console.log(error)\n }\n}\n\nmain()\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtyBA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrJA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["../webpack://upload-turboyet-data-action/./node_modules/@upstash/redis/chunk-JIU2S2DZ.js","../webpack://upload-turboyet-data-action/./node_modules/@upstash/redis/nodejs.js","../webpack://upload-turboyet-data-action/./node_modules/crypto-js/core.js","../webpack://upload-turboyet-data-action/./node_modules/crypto-js/enc-hex.js","../webpack://upload-turboyet-data-action/./node_modules/crypto-js/sha1.js","../webpack://upload-turboyet-data-action/external node-commonjs \"crypto\"","../webpack://upload-turboyet-data-action/external node-commonjs \"fs/promises\"","../webpack://upload-turboyet-data-action/external node-commonjs \"path\"","../webpack://upload-turboyet-data-action/./node_modules/@vercel/kv/dist/index.cjs","../webpack://upload-turboyet-data-action/webpack/bootstrap","../webpack://upload-turboyet-data-action/webpack/runtime/compat","../webpack://upload-turboyet-data-action/./src/main.js"],"sourcesContent":["\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;var c=class extends Error{constructor(n){super(n),this.name=\"UpstashError\"}};var ie=class{constructor(n){this.options={backend:_optionalChain([n, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.backend]),agent:n.agent,responseEncoding:_nullishCoalesce(n.responseEncoding, () => (\"base64\")),cache:n.cache},this.baseUrl=n.baseUrl.replace(/\\/$/,\"\"),this.headers={\"Content-Type\":\"application/json\",...n.headers},this.options.responseEncoding===\"base64\"&&(this.headers[\"Upstash-Encoding\"]=\"base64\"),typeof _optionalChain([n, 'optionalAccess', _4 => _4.retry])==\"boolean\"&&_optionalChain([n, 'optionalAccess', _5 => _5.retry])===!1?this.retry={attempts:1,backoff:()=>0}:this.retry={attempts:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _6 => _6.retry, 'optionalAccess', _7 => _7.retries]), () => (5)),backoff:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _8 => _8.retry, 'optionalAccess', _9 => _9.backoff]), () => ((t=>Math.exp(t)*50)))}}mergeTelemetry(n){function t(o,m,r){return r&&(o[m]?o[m]=[o[m],r].join(\",\"):o[m]=r),o}this.headers=t(this.headers,\"Upstash-Telemetry-Runtime\",n.runtime),this.headers=t(this.headers,\"Upstash-Telemetry-Platform\",n.platform),this.headers=t(this.headers,\"Upstash-Telemetry-Sdk\",n.sdk)}async request(n){let t={cache:this.options.cache,method:\"POST\",headers:this.headers,body:JSON.stringify(n.body),keepalive:!0,agent:_optionalChain([this, 'access', _10 => _10.options, 'optionalAccess', _11 => _11.agent]),backend:_optionalChain([this, 'access', _12 => _12.options, 'optionalAccess', _13 => _13.backend])},o=null,m=null;for(let a=0;a<=this.retry.attempts;a++)try{o=await fetch([this.baseUrl,..._nullishCoalesce(n.path, () => ([]))].join(\"/\"),t);break}catch(i){m=i,await new Promise(p=>setTimeout(p,this.retry.backoff(a)))}if(!o)throw _nullishCoalesce(m, () => (new Error(\"Exhausted all retries\")));let r=await o.json();if(!o.ok)throw new c(`${r.error}, command was: ${JSON.stringify(n.body)}`);return _optionalChain([this, 'access', _14 => _14.options, 'optionalAccess', _15 => _15.responseEncoding])===\"base64\"?Array.isArray(r)?r.map(({result:i,error:p})=>({result:re(i),error:p})):{result:re(r.result),error:r.error}:r}};function pe(s){let n=\"\";try{let t=atob(s),o=t.length,m=new Uint8Array(o);for(let r=0;rtypeof t==\"string\"?pe(t):Array.isArray(t)?t.map(re):t):n=null;break}case\"string\":{n=s===\"OK\"?\"OK\":pe(s);break}default:break}return n}function de(s){let n=Array.isArray(s)?s.map(t=>{try{return de(t)}catch (e3){return t}}):JSON.parse(s);return typeof n==\"number\"&&n.toString()!==s?s:n}function ce(s){try{return de(s)}catch (e4){return s}}var he=s=>{switch(typeof s){case\"string\":case\"number\":case\"boolean\":return s;default:return JSON.stringify(s)}},e=class{constructor(n,t){this.serialize=he,this.deserialize=typeof _optionalChain([t, 'optionalAccess', _16 => _16.automaticDeserialization])>\"u\"||t.automaticDeserialization?_nullishCoalesce(_optionalChain([t, 'optionalAccess', _17 => _17.deserialize]), () => (ce)):o=>o,this.command=n.map(o=>this.serialize(o))}async exec(n){let{result:t,error:o}=await n.request({body:this.command});if(o)throw new c(o);if(typeof t>\"u\")throw new Error(\"Request did not return a result\");return this.deserialize(t)}};var C=class extends e{constructor(n,t){super([\"append\",...n],t)}};var l=class extends e{constructor([n,t,o],m){let r=[\"bitcount\",n];typeof t==\"number\"&&r.push(t),typeof o==\"number\"&&r.push(o),super(r,m)}};var g=class extends e{constructor(n,t){super([\"bitop\",...n],t)}};var x=class extends e{constructor(n,t){super([\"bitpos\",...n],t)}};var f=class extends e{constructor([n,t,o],m){super([\"COPY\",n,t,..._optionalChain([o, 'optionalAccess', _18 => _18.replace])?[\"REPLACE\"]:[]],{...m,deserialize(r){return r>0?\"COPIED\":\"NOT_COPIED\"}})}};var y=class extends e{constructor(n){super([\"dbsize\"],n)}};var b=class extends e{constructor(n,t){super([\"decr\",...n],t)}};var O=class extends e{constructor(n,t){super([\"decrby\",...n],t)}};var T=class extends e{constructor(n,t){super([\"del\",...n],t)}};var w=class extends e{constructor(n,t){super([\"echo\",...n],t)}};var D=class extends e{constructor([n,t,o],m){super([\"eval\",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var k=class extends e{constructor([n,t,o],m){super([\"evalsha\",n,t.length,...t,..._nullishCoalesce(o, () => ([]))],m)}};var A=class extends e{constructor(n,t){super([\"exists\",...n],t)}};var S=class extends e{constructor(n,t){super([\"expire\",...n],t)}};var R=class extends e{constructor(n,t){super([\"expireat\",...n],t)}};var M=class extends e{constructor(n,t){let o=[\"flushall\"];n&&n.length>0&&n[0].async&&o.push(\"async\"),super(o,t)}};var v=class extends e{constructor([n],t){let o=[\"flushdb\"];_optionalChain([n, 'optionalAccess', _19 => _19.async])&&o.push(\"async\"),super(o,t)}};var E=class extends e{constructor([n,t,...o],m){let r=[\"geoadd\",n];\"nx\"in t&&t.nx?r.push(\"nx\"):\"xx\"in t&&t.xx&&r.push(\"xx\"),\"ch\"in t&&t.ch&&r.push(\"ch\"),\"latitude\"in t&&t.latitude&&r.push(t.longitude,t.latitude,t.member),r.push(...o.flatMap(({latitude:a,longitude:i,member:p})=>[i,a,p])),super(r,m)}};var z=class extends e{constructor([n,t,o,m=\"M\"],r){super([\"GEODIST\",n,t,o,m],r)}};var J=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super([\"GEOPOS\",o,...m],{deserialize:r=>Ce(r),...t})}};function Ce(s){let n=[];for(let t of s)!_optionalChain([t, 'optionalAccess', _20 => _20[0]])||!_optionalChain([t, 'optionalAccess', _21 => _21[1]])||n.push({lng:parseFloat(t[0]),lat:parseFloat(t[1])});return n}var P=class extends e{constructor(n,t){let[o]=n,m=Array.isArray(n[1])?n[1]:n.slice(1);super([\"GEOHASH\",o,...m],t)}};var I=class extends e{constructor([n,t,o,m,r],a){let i=[\"GEOSEARCH\",n];(t.type===\"FROMMEMBER\"||t.type===\"frommember\")&&i.push(t.type,t.member),(t.type===\"FROMLONLAT\"||t.type===\"fromlonlat\")&&i.push(t.type,t.coordinate.lon,t.coordinate.lat),(o.type===\"BYRADIUS\"||o.type===\"byradius\")&&i.push(o.type,o.radius,o.radiusType),(o.type===\"BYBOX\"||o.type===\"bybox\")&&i.push(o.type,o.rect.width,o.rect.height,o.rectType),i.push(m),_optionalChain([r, 'optionalAccess', _22 => _22.count])&&i.push(r.count.limit,...r.count.any?[\"ANY\"]:[]);let p=ae=>!_optionalChain([r, 'optionalAccess', _23 => _23.withCoord])&&!_optionalChain([r, 'optionalAccess', _24 => _24.withDist])&&!_optionalChain([r, 'optionalAccess', _25 => _25.withHash])?ae.map(d=>{try{return{member:JSON.parse(d)}}catch (e5){return{member:d}}}):ae.map(d=>{let ee=1,h={};try{h.member=JSON.parse(d[0])}catch (e6){h.member=d[0]}return r.withDist&&(h.dist=parseFloat(d[ee++])),r.withHash&&(h.hash=d[ee++].toString()),r.withCoord&&(h.coord={long:parseFloat(d[ee][0]),lat:parseFloat(d[ee][1])}),h});super([...i,..._optionalChain([r, 'optionalAccess', _26 => _26.withCoord])?[\"WITHCOORD\"]:[],..._optionalChain([r, 'optionalAccess', _27 => _27.withDist])?[\"WITHDIST\"]:[],..._optionalChain([r, 'optionalAccess', _28 => _28.withHash])?[\"WITHHASH\"]:[]],{...a,deserialize:p})}};var K=class extends e{constructor([n,t,o,m,r,a],i){let p=[\"GEOSEARCHSTORE\",n,t];(o.type===\"FROMMEMBER\"||o.type===\"frommember\")&&p.push(o.type,o.member),(o.type===\"FROMLONLAT\"||o.type===\"fromlonlat\")&&p.push(o.type,o.coordinate.lon,o.coordinate.lat),(m.type===\"BYRADIUS\"||m.type===\"byradius\")&&p.push(m.type,m.radius,m.radiusType),(m.type===\"BYBOX\"||m.type===\"bybox\")&&p.push(m.type,m.rect.width,m.rect.height,m.rectType),p.push(r),_optionalChain([a, 'optionalAccess', _29 => _29.count])&&p.push(a.count.limit,...a.count.any?[\"ANY\"]:[]),super([...p,..._optionalChain([a, 'optionalAccess', _30 => _30.storeDist])?[\"STOREDIST\"]:[]],i)}};var L=class extends e{constructor(n,t){super([\"get\",...n],t)}};var Z=class extends e{constructor(n,t){super([\"getbit\",...n],t)}};var N=class extends e{constructor(n,t){super([\"getdel\",...n],t)}};var G=class extends e{constructor(n,t){super([\"getrange\",...n],t)}};var B=class extends e{constructor(n,t){super([\"getset\",...n],t)}};var U=class extends e{constructor(n,t){super([\"hdel\",...n],t)}};var H=class extends e{constructor(n,t){super([\"hexists\",...n],t)}};var F=class extends e{constructor(n,t){super([\"hget\",...n],t)}};function le(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{!Number.isNaN(Number(o))&&!Number.isSafeInteger(o)?n[t]=o:n[t]=JSON.parse(o)}catch (e7){n[t]=o}}return n}var q=class extends e{constructor(n,t){super([\"hgetall\",...n],{deserialize:o=>le(o),...t})}};var $=class extends e{constructor(n,t){super([\"hincrby\",...n],t)}};var X=class extends e{constructor(n,t){super([\"hincrbyfloat\",...n],t)}};var j=class extends e{constructor([n],t){super([\"hkeys\",n],t)}};var Y=class extends e{constructor(n,t){super([\"hlen\",...n],t)}};function ge(s,n){if(n.length===0||n.every(o=>o===null))return null;let t={};for(let o=0;oge(t,m),...o})}};var V=class extends e{constructor([n,t],o){super([\"hmset\",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};function xe(s){if(s.length===0)return null;let n={};for(;s.length>=2;){let t=s.shift(),o=s.shift();try{n[t]=JSON.parse(o)}catch (e9){n[t]=o}}return n}var _=class extends e{constructor(n,t){let o=[\"hrandfield\",n[0]];typeof n[1]==\"number\"&&o.push(n[1]),n[2]&&o.push(\"WITHVALUES\"),super(o,{deserialize:n[2]?m=>xe(m):_optionalChain([t, 'optionalAccess', _31 => _31.deserialize]),...t})}};var Q=class extends e{constructor([n,t,o],m){let r=[\"hscan\",n,t];_optionalChain([o, 'optionalAccess', _32 => _32.match])&&r.push(\"match\",o.match),typeof _optionalChain([o, 'optionalAccess', _33 => _33.count])==\"number\"&&r.push(\"count\",o.count),super(r,m)}};var nn=class extends e{constructor([n,t],o){super([\"hset\",n,...Object.entries(t).flatMap(([m,r])=>[m,r])],o)}};var tn=class extends e{constructor(n,t){super([\"hsetnx\",...n],t)}};var en=class extends e{constructor(n,t){super([\"hstrlen\",...n],t)}};var on=class extends e{constructor(n,t){super([\"hvals\",...n],t)}};var sn=class extends e{constructor(n,t){super([\"incr\",...n],t)}};var mn=class extends e{constructor(n,t){super([\"incrby\",...n],t)}};var rn=class extends e{constructor(n,t){super([\"incrbyfloat\",...n],t)}};var an=class extends e{constructor(n,t){super([\"JSON.ARRAPPEND\",...n],t)}};var pn=class extends e{constructor(n,t){super([\"JSON.ARRINDEX\",...n],t)}};var dn=class extends e{constructor(n,t){super([\"JSON.ARRINSERT\",...n],t)}};var cn=class extends e{constructor(n,t){super([\"JSON.ARRLEN\",n[0],_nullishCoalesce(n[1], () => (\"$\"))],t)}};var un=class extends e{constructor(n,t){super([\"JSON.ARRPOP\",...n],t)}};var hn=class extends e{constructor(n,t){let o=_nullishCoalesce(n[1], () => (\"$\")),m=_nullishCoalesce(n[2], () => (0)),r=_nullishCoalesce(n[3], () => (0));super([\"JSON.ARRTRIM\",n[0],o,m,r],t)}};var Cn=class extends e{constructor(n,t){super([\"JSON.CLEAR\",...n],t)}};var ln=class extends e{constructor(n,t){super([\"JSON.DEL\",...n],t)}};var gn=class extends e{constructor(n,t){super([\"JSON.FORGET\",...n],t)}};var xn=class extends e{constructor(n,t){let o=[\"JSON.GET\"];typeof n[1]==\"string\"?o.push(...n):(o.push(n[0]),n[1]&&(n[1].indent&&o.push(\"INDENT\",n[1].indent),n[1].newline&&o.push(\"NEWLINE\",n[1].newline),n[1].space&&o.push(\"SPACE\",n[1].space)),o.push(...n.slice(2))),super(o,t)}};var fn=class extends e{constructor(n,t){super([\"JSON.MGET\",...n[0],n[1]],t)}};var yn=class extends e{constructor(n,t){super([\"JSON.NUMINCRBY\",...n],t)}};var bn=class extends e{constructor(n,t){super([\"JSON.NUMMULTBY\",...n],t)}};var On=class extends e{constructor(n,t){super([\"JSON.OBJKEYS\",...n],t)}};var Tn=class extends e{constructor(n,t){super([\"JSON.OBJLEN\",...n],t)}};var wn=class extends e{constructor(n,t){super([\"JSON.RESP\",...n],t)}};var Dn=class extends e{constructor(n,t){let o=[\"JSON.SET\",n[0],n[1],n[2]];n[3]&&(n[3].nx?o.push(\"NX\"):n[3].xx&&o.push(\"XX\")),super(o,t)}};var kn=class extends e{constructor(n,t){super([\"JSON.STRAPPEND\",...n],t)}};var An=class extends e{constructor(n,t){super([\"JSON.STRLEN\",...n],t)}};var Sn=class extends e{constructor(n,t){super([\"JSON.TOGGLE\",...n],t)}};var Rn=class extends e{constructor(n,t){super([\"JSON.TYPE\",...n],t)}};var Mn=class extends e{constructor(n,t){super([\"keys\",...n],t)}};var vn=class extends e{constructor(n,t){super([\"lindex\",...n],t)}};var En=class extends e{constructor(n,t){super([\"linsert\",...n],t)}};var zn=class extends e{constructor(n,t){super([\"llen\",...n],t)}};var Jn=class extends e{constructor(n,t){super([\"lmove\",...n],t)}};var Pn=class extends e{constructor(n,t){super([\"lpop\",...n],t)}};var In=class extends e{constructor(n,t){let o=[\"lpos\",n[0],n[1]];typeof _optionalChain([n, 'access', _34 => _34[2], 'optionalAccess', _35 => _35.rank])==\"number\"&&o.push(\"rank\",n[2].rank),typeof _optionalChain([n, 'access', _36 => _36[2], 'optionalAccess', _37 => _37.count])==\"number\"&&o.push(\"count\",n[2].count),typeof _optionalChain([n, 'access', _38 => _38[2], 'optionalAccess', _39 => _39.maxLen])==\"number\"&&o.push(\"maxLen\",n[2].maxLen),super(o,t)}};var Kn=class extends e{constructor(n,t){super([\"lpush\",...n],t)}};var Ln=class extends e{constructor(n,t){super([\"lpushx\",...n],t)}};var Zn=class extends e{constructor(n,t){super([\"lrange\",...n],t)}};var Nn=class extends e{constructor(n,t){super([\"lrem\",...n],t)}};var Gn=class extends e{constructor(n,t){super([\"lset\",...n],t)}};var Bn=class extends e{constructor(n,t){super([\"ltrim\",...n],t)}};var Un=class extends e{constructor(n,t){let o=Array.isArray(n[0])?n[0]:n;super([\"mget\",...o],t)}};var Hn=class extends e{constructor([n],t){super([\"mset\",...Object.entries(n).flatMap(([o,m])=>[o,m])],t)}};var Fn=class extends e{constructor([n],t){super([\"msetnx\",...Object.entries(n).flatMap(o=>o)],t)}};var qn=class extends e{constructor(n,t){super([\"persist\",...n],t)}};var $n=class extends e{constructor(n,t){super([\"pexpire\",...n],t)}};var Xn=class extends e{constructor(n,t){super([\"pexpireat\",...n],t)}};var jn=class extends e{constructor(n,t){let o=[\"ping\"];typeof n<\"u\"&&typeof n[0]<\"u\"&&o.push(n[0]),super(o,t)}};var Yn=class extends e{constructor(n,t){super([\"psetex\",...n],t)}};var Wn=class extends e{constructor(n,t){super([\"pttl\",...n],t)}};var Vn=class extends e{constructor(n,t){super([\"publish\",...n],t)}};var _n=class extends e{constructor(n){super([\"randomkey\"],n)}};var Qn=class extends e{constructor(n,t){super([\"rename\",...n],t)}};var nt=class extends e{constructor(n,t){super([\"renamenx\",...n],t)}};var tt=class extends e{constructor(n,t){super([\"rpop\",...n],t)}};var et=class extends e{constructor(n,t){super([\"rpush\",...n],t)}};var ot=class extends e{constructor(n,t){super([\"rpushx\",...n],t)}};var st=class extends e{constructor(n,t){super([\"sadd\",...n],t)}};var mt=class extends e{constructor([n,t],o){let m=[\"scan\",n];_optionalChain([t, 'optionalAccess', _40 => _40.match])&&m.push(\"match\",t.match),typeof _optionalChain([t, 'optionalAccess', _41 => _41.count])==\"number\"&&m.push(\"count\",t.count),_optionalChain([t, 'optionalAccess', _42 => _42.type])&&t.type.length>0&&m.push(\"type\",t.type),super(m,o)}};var rt=class extends e{constructor(n,t){super([\"scard\",...n],t)}};var at=class extends e{constructor(n,t){super([\"script\",\"exists\",...n],{deserialize:o=>o,...t})}};var it=class extends e{constructor([n],t){let o=[\"script\",\"flush\"];_optionalChain([n, 'optionalAccess', _43 => _43.sync])?o.push(\"sync\"):_optionalChain([n, 'optionalAccess', _44 => _44.async])&&o.push(\"async\"),super(o,t)}};var pt=class extends e{constructor(n,t){super([\"script\",\"load\",...n],t)}};var dt=class extends e{constructor(n,t){super([\"sdiff\",...n],t)}};var ct=class extends e{constructor(n,t){super([\"sdiffstore\",...n],t)}};var ut=class extends e{constructor([n,t,o],m){let r=[\"set\",n,t];o&&(\"nx\"in o&&o.nx?r.push(\"nx\"):\"xx\"in o&&o.xx&&r.push(\"xx\"),\"get\"in o&&o.get&&r.push(\"get\"),\"ex\"in o&&typeof o.ex==\"number\"?r.push(\"ex\",o.ex):\"px\"in o&&typeof o.px==\"number\"?r.push(\"px\",o.px):\"exat\"in o&&typeof o.exat==\"number\"?r.push(\"exat\",o.exat):\"pxat\"in o&&typeof o.pxat==\"number\"?r.push(\"pxat\",o.pxat):\"keepTtl\"in o&&o.keepTtl&&r.push(\"keepTtl\")),super(r,m)}};var ht=class extends e{constructor(n,t){super([\"setbit\",...n],t)}};var Ct=class extends e{constructor(n,t){super([\"setex\",...n],t)}};var lt=class extends e{constructor(n,t){super([\"setnx\",...n],t)}};var gt=class extends e{constructor(n,t){super([\"setrange\",...n],t)}};var xt=class extends e{constructor(n,t){super([\"sinter\",...n],t)}};var ft=class extends e{constructor(n,t){super([\"sinterstore\",...n],t)}};var yt=class extends e{constructor(n,t){super([\"sismember\",...n],t)}};var bt=class extends e{constructor(n,t){super([\"smembers\",...n],t)}};var Ot=class extends e{constructor(n,t){super([\"smismember\",n[0],...n[1]],t)}};var Tt=class extends e{constructor(n,t){super([\"smove\",...n],t)}};var wt=class extends e{constructor([n,t],o){let m=[\"spop\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var Dt=class extends e{constructor([n,t],o){let m=[\"srandmember\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var kt=class extends e{constructor(n,t){super([\"srem\",...n],t)}};var At=class extends e{constructor([n,t,o],m){let r=[\"sscan\",n,t];_optionalChain([o, 'optionalAccess', _45 => _45.match])&&r.push(\"match\",o.match),typeof _optionalChain([o, 'optionalAccess', _46 => _46.count])==\"number\"&&r.push(\"count\",o.count),super(r,m)}};var St=class extends e{constructor(n,t){super([\"strlen\",...n],t)}};var Rt=class extends e{constructor(n,t){super([\"sunion\",...n],t)}};var Mt=class extends e{constructor(n,t){super([\"sunionstore\",...n],t)}};var vt=class extends e{constructor(n){super([\"time\"],n)}};var Et=class extends e{constructor(n,t){super([\"touch\",...n],t)}};var zt=class extends e{constructor(n,t){super([\"ttl\",...n],t)}};var Jt=class extends e{constructor(n,t){super([\"type\",...n],t)}};var Pt=class extends e{constructor(n,t){super([\"unlink\",...n],t)}};var oe=class extends e{constructor([n,t,o,m],r){let a=[\"XADD\",n];m&&(m.nomkStream&&a.push(\"NOMKSTREAM\"),m.trim&&(a.push(m.trim.type,m.trim.comparison,m.trim.threshold),typeof m.trim.limit<\"u\"&&a.push(\"LIMIT\",m.trim.limit))),a.push(t);for(let[i,p]of Object.entries(o))a.push(i,p);super(a,r)}};function fe(s){let n={};for(let t of s)for(;t.length>=2;){let o=t.shift(),m=t.shift();for((o in n)||(n[o]={});m.length>=2;){let r=m.shift(),a=m.shift();try{n[o][r]=JSON.parse(a)}catch (e10){n[o][r]=a}}}return n}var se=class extends e{constructor([n,t,o,m],r){let a=[\"XRANGE\",n,t,o];typeof m==\"number\"&&a.push(\"COUNT\",m),super(a,{deserialize:i=>fe(i),...r})}};var u=class extends e{constructor([n,t,...o],m){let r=[\"zadd\",n];\"nx\"in t&&t.nx?r.push(\"nx\"):\"xx\"in t&&t.xx&&r.push(\"xx\"),\"ch\"in t&&t.ch&&r.push(\"ch\"),\"incr\"in t&&t.incr&&r.push(\"incr\"),\"score\"in t&&\"member\"in t&&r.push(t.score,t.member),r.push(...o.flatMap(({score:a,member:i})=>[a,i])),super(r,m)}};var It=class extends e{constructor(n,t){super([\"zcard\",...n],t)}};var Kt=class extends e{constructor(n,t){super([\"zcount\",...n],t)}};var Lt=class extends e{constructor(n,t){super([\"zincrby\",...n],t)}};var Zt=class extends e{constructor([n,t,o,m],r){let a=[\"zinterstore\",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&(\"weights\"in m&&m.weights?a.push(\"weights\",...m.weights):\"weight\"in m&&typeof m.weight==\"number\"&&a.push(\"weights\",m.weight),\"aggregate\"in m&&a.push(\"aggregate\",m.aggregate)),super(a,r)}};var Nt=class extends e{constructor(n,t){super([\"zlexcount\",...n],t)}};var Gt=class extends e{constructor([n,t],o){let m=[\"zpopmax\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var Bt=class extends e{constructor([n,t],o){let m=[\"zpopmin\",n];typeof t==\"number\"&&m.push(t),super(m,o)}};var Ut=class extends e{constructor([n,t,o,m],r){let a=[\"zrange\",n,t,o];_optionalChain([m, 'optionalAccess', _47 => _47.byScore])&&a.push(\"byscore\"),_optionalChain([m, 'optionalAccess', _48 => _48.byLex])&&a.push(\"bylex\"),_optionalChain([m, 'optionalAccess', _49 => _49.rev])&&a.push(\"rev\"),typeof _optionalChain([m, 'optionalAccess', _50 => _50.count])<\"u\"&&typeof _optionalChain([m, 'optionalAccess', _51 => _51.offset])<\"u\"&&a.push(\"limit\",m.offset,m.count),_optionalChain([m, 'optionalAccess', _52 => _52.withScores])&&a.push(\"withscores\"),super(a,r)}};var Ht=class extends e{constructor(n,t){super([\"zrank\",...n],t)}};var Ft=class extends e{constructor(n,t){super([\"zrem\",...n],t)}};var qt=class extends e{constructor(n,t){super([\"zremrangebylex\",...n],t)}};var $t=class extends e{constructor(n,t){super([\"zremrangebyrank\",...n],t)}};var Xt=class extends e{constructor(n,t){super([\"zremrangebyscore\",...n],t)}};var jt=class extends e{constructor(n,t){super([\"zrevrank\",...n],t)}};var Yt=class extends e{constructor([n,t,o],m){let r=[\"zscan\",n,t];_optionalChain([o, 'optionalAccess', _53 => _53.match])&&r.push(\"match\",o.match),typeof _optionalChain([o, 'optionalAccess', _54 => _54.count])==\"number\"&&r.push(\"count\",o.count),super(r,m)}};var Wt=class extends e{constructor(n,t){super([\"zscore\",...n],t)}};var Vt=class extends e{constructor([n,t,o],m){let r=[\"zunion\",n];Array.isArray(t)?r.push(...t):r.push(t),o&&(\"weights\"in o&&o.weights?r.push(\"weights\",...o.weights):\"weight\"in o&&typeof o.weight==\"number\"&&r.push(\"weights\",o.weight),\"aggregate\"in o&&r.push(\"aggregate\",o.aggregate),_optionalChain([o, 'optionalAccess', _55 => _55.withScores])&&r.push(\"withscores\")),super(r,m)}};var _t=class extends e{constructor([n,t,o,m],r){let a=[\"zunionstore\",n,t];Array.isArray(o)?a.push(...o):a.push(o),m&&(\"weights\"in m&&m.weights?a.push(\"weights\",...m.weights):\"weight\"in m&&typeof m.weight==\"number\"&&a.push(\"weights\",m.weight),\"aggregate\"in m&&a.push(\"aggregate\",m.aggregate)),super(a,r)}};var Qt=class extends e{constructor(n,t){super([\"zdiffstore\",...n],t)}};var ne=class extends e{constructor(n,t){let[o,m]=n;super([\"zmscore\",o,...m],t)}};var te= (_class =class{constructor(n){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);_class.prototype.__init11.call(this);_class.prototype.__init12.call(this);_class.prototype.__init13.call(this);_class.prototype.__init14.call(this);_class.prototype.__init15.call(this);_class.prototype.__init16.call(this);_class.prototype.__init17.call(this);_class.prototype.__init18.call(this);_class.prototype.__init19.call(this);_class.prototype.__init20.call(this);_class.prototype.__init21.call(this);_class.prototype.__init22.call(this);_class.prototype.__init23.call(this);_class.prototype.__init24.call(this);_class.prototype.__init25.call(this);_class.prototype.__init26.call(this);_class.prototype.__init27.call(this);_class.prototype.__init28.call(this);_class.prototype.__init29.call(this);_class.prototype.__init30.call(this);_class.prototype.__init31.call(this);_class.prototype.__init32.call(this);_class.prototype.__init33.call(this);_class.prototype.__init34.call(this);_class.prototype.__init35.call(this);_class.prototype.__init36.call(this);_class.prototype.__init37.call(this);_class.prototype.__init38.call(this);_class.prototype.__init39.call(this);_class.prototype.__init40.call(this);_class.prototype.__init41.call(this);_class.prototype.__init42.call(this);_class.prototype.__init43.call(this);_class.prototype.__init44.call(this);_class.prototype.__init45.call(this);_class.prototype.__init46.call(this);_class.prototype.__init47.call(this);_class.prototype.__init48.call(this);_class.prototype.__init49.call(this);_class.prototype.__init50.call(this);_class.prototype.__init51.call(this);_class.prototype.__init52.call(this);_class.prototype.__init53.call(this);_class.prototype.__init54.call(this);_class.prototype.__init55.call(this);_class.prototype.__init56.call(this);_class.prototype.__init57.call(this);_class.prototype.__init58.call(this);_class.prototype.__init59.call(this);_class.prototype.__init60.call(this);_class.prototype.__init61.call(this);_class.prototype.__init62.call(this);_class.prototype.__init63.call(this);_class.prototype.__init64.call(this);_class.prototype.__init65.call(this);_class.prototype.__init66.call(this);_class.prototype.__init67.call(this);_class.prototype.__init68.call(this);_class.prototype.__init69.call(this);_class.prototype.__init70.call(this);_class.prototype.__init71.call(this);_class.prototype.__init72.call(this);_class.prototype.__init73.call(this);_class.prototype.__init74.call(this);_class.prototype.__init75.call(this);_class.prototype.__init76.call(this);_class.prototype.__init77.call(this);_class.prototype.__init78.call(this);_class.prototype.__init79.call(this);_class.prototype.__init80.call(this);_class.prototype.__init81.call(this);_class.prototype.__init82.call(this);_class.prototype.__init83.call(this);_class.prototype.__init84.call(this);_class.prototype.__init85.call(this);_class.prototype.__init86.call(this);_class.prototype.__init87.call(this);_class.prototype.__init88.call(this);_class.prototype.__init89.call(this);_class.prototype.__init90.call(this);_class.prototype.__init91.call(this);_class.prototype.__init92.call(this);_class.prototype.__init93.call(this);_class.prototype.__init94.call(this);_class.prototype.__init95.call(this);_class.prototype.__init96.call(this);_class.prototype.__init97.call(this);_class.prototype.__init98.call(this);_class.prototype.__init99.call(this);_class.prototype.__init100.call(this);_class.prototype.__init101.call(this);_class.prototype.__init102.call(this);_class.prototype.__init103.call(this);_class.prototype.__init104.call(this);_class.prototype.__init105.call(this);_class.prototype.__init106.call(this);_class.prototype.__init107.call(this);_class.prototype.__init108.call(this);_class.prototype.__init109.call(this);_class.prototype.__init110.call(this);_class.prototype.__init111.call(this);_class.prototype.__init112.call(this);_class.prototype.__init113.call(this);_class.prototype.__init114.call(this);_class.prototype.__init115.call(this);_class.prototype.__init116.call(this);_class.prototype.__init117.call(this);_class.prototype.__init118.call(this);_class.prototype.__init119.call(this);_class.prototype.__init120.call(this);_class.prototype.__init121.call(this);_class.prototype.__init122.call(this);_class.prototype.__init123.call(this);this.client=n.client,this.commands=[],this.commandOptions=n.commandOptions,this.multiExec=_nullishCoalesce(n.multiExec, () => (!1))}__init() {this.exec=async()=>{if(this.commands.length===0)throw new Error(\"Pipeline is empty\");let n=this.multiExec?[\"multi-exec\"]:[\"pipeline\"];return(await this.client.request({path:n,body:Object.values(this.commands).map(o=>o.command)})).map(({error:o,result:m},r)=>{if(o)throw new c(`Command ${r+1} [ ${this.commands[r].command[0]} ] failed: ${o}`);return this.commands[r].deserialize(m)})}}length(){return this.commands.length}chain(n){return this.commands.push(n),this}__init2() {this.append=(...n)=>this.chain(new C(n,this.commandOptions))}__init3() {this.bitcount=(...n)=>this.chain(new l(n,this.commandOptions))}__init4() {this.bitop=(n,t,o,...m)=>this.chain(new g([n,t,o,...m],this.commandOptions))}__init5() {this.bitpos=(...n)=>this.chain(new x(n,this.commandOptions))}__init6() {this.copy=(...n)=>this.chain(new f(n,this.commandOptions))}__init7() {this.zdiffstore=(...n)=>this.chain(new Qt(n,this.commandOptions))}__init8() {this.dbsize=()=>this.chain(new y(this.commandOptions))}__init9() {this.decr=(...n)=>this.chain(new b(n,this.commandOptions))}__init10() {this.decrby=(...n)=>this.chain(new O(n,this.commandOptions))}__init11() {this.del=(...n)=>this.chain(new T(n,this.commandOptions))}__init12() {this.echo=(...n)=>this.chain(new w(n,this.commandOptions))}__init13() {this.eval=(...n)=>this.chain(new D(n,this.commandOptions))}__init14() {this.evalsha=(...n)=>this.chain(new k(n,this.commandOptions))}__init15() {this.exists=(...n)=>this.chain(new A(n,this.commandOptions))}__init16() {this.expire=(...n)=>this.chain(new S(n,this.commandOptions))}__init17() {this.expireat=(...n)=>this.chain(new R(n,this.commandOptions))}__init18() {this.flushall=n=>this.chain(new M(n,this.commandOptions))}__init19() {this.flushdb=(...n)=>this.chain(new v(n,this.commandOptions))}__init20() {this.get=(...n)=>this.chain(new L(n,this.commandOptions))}__init21() {this.getbit=(...n)=>this.chain(new Z(n,this.commandOptions))}__init22() {this.getdel=(...n)=>this.chain(new N(n,this.commandOptions))}__init23() {this.getrange=(...n)=>this.chain(new G(n,this.commandOptions))}__init24() {this.getset=(n,t)=>this.chain(new B([n,t],this.commandOptions))}__init25() {this.hdel=(...n)=>this.chain(new U(n,this.commandOptions))}__init26() {this.hexists=(...n)=>this.chain(new H(n,this.commandOptions))}__init27() {this.hget=(...n)=>this.chain(new F(n,this.commandOptions))}__init28() {this.hgetall=(...n)=>this.chain(new q(n,this.commandOptions))}__init29() {this.hincrby=(...n)=>this.chain(new $(n,this.commandOptions))}__init30() {this.hincrbyfloat=(...n)=>this.chain(new X(n,this.commandOptions))}__init31() {this.hkeys=(...n)=>this.chain(new j(n,this.commandOptions))}__init32() {this.hlen=(...n)=>this.chain(new Y(n,this.commandOptions))}__init33() {this.hmget=(...n)=>this.chain(new W(n,this.commandOptions))}__init34() {this.hmset=(n,t)=>this.chain(new V([n,t],this.commandOptions))}__init35() {this.hrandfield=(n,t,o)=>this.chain(new _([n,t,o],this.commandOptions))}__init36() {this.hscan=(...n)=>this.chain(new Q(n,this.commandOptions))}__init37() {this.hset=(n,t)=>this.chain(new nn([n,t],this.commandOptions))}__init38() {this.hsetnx=(n,t,o)=>this.chain(new tn([n,t,o],this.commandOptions))}__init39() {this.hstrlen=(...n)=>this.chain(new en(n,this.commandOptions))}__init40() {this.hvals=(...n)=>this.chain(new on(n,this.commandOptions))}__init41() {this.incr=(...n)=>this.chain(new sn(n,this.commandOptions))}__init42() {this.incrby=(...n)=>this.chain(new mn(n,this.commandOptions))}__init43() {this.incrbyfloat=(...n)=>this.chain(new rn(n,this.commandOptions))}__init44() {this.keys=(...n)=>this.chain(new Mn(n,this.commandOptions))}__init45() {this.lindex=(...n)=>this.chain(new vn(n,this.commandOptions))}__init46() {this.linsert=(n,t,o,m)=>this.chain(new En([n,t,o,m],this.commandOptions))}__init47() {this.llen=(...n)=>this.chain(new zn(n,this.commandOptions))}__init48() {this.lmove=(...n)=>this.chain(new Jn(n,this.commandOptions))}__init49() {this.lpop=(...n)=>this.chain(new Pn(n,this.commandOptions))}__init50() {this.lpos=(...n)=>this.chain(new In(n,this.commandOptions))}__init51() {this.lpush=(n,...t)=>this.chain(new Kn([n,...t],this.commandOptions))}__init52() {this.lpushx=(n,...t)=>this.chain(new Ln([n,...t],this.commandOptions))}__init53() {this.lrange=(...n)=>this.chain(new Zn(n,this.commandOptions))}__init54() {this.lrem=(n,t,o)=>this.chain(new Nn([n,t,o],this.commandOptions))}__init55() {this.lset=(n,t,o)=>this.chain(new Gn([n,t,o],this.commandOptions))}__init56() {this.ltrim=(...n)=>this.chain(new Bn(n,this.commandOptions))}__init57() {this.mget=(...n)=>this.chain(new Un(n,this.commandOptions))}__init58() {this.mset=n=>this.chain(new Hn([n],this.commandOptions))}__init59() {this.msetnx=n=>this.chain(new Fn([n],this.commandOptions))}__init60() {this.persist=(...n)=>this.chain(new qn(n,this.commandOptions))}__init61() {this.pexpire=(...n)=>this.chain(new $n(n,this.commandOptions))}__init62() {this.pexpireat=(...n)=>this.chain(new Xn(n,this.commandOptions))}__init63() {this.ping=n=>this.chain(new jn(n,this.commandOptions))}__init64() {this.psetex=(n,t,o)=>this.chain(new Yn([n,t,o],this.commandOptions))}__init65() {this.pttl=(...n)=>this.chain(new Wn(n,this.commandOptions))}__init66() {this.publish=(...n)=>this.chain(new Vn(n,this.commandOptions))}__init67() {this.randomkey=()=>this.chain(new _n(this.commandOptions))}__init68() {this.rename=(...n)=>this.chain(new Qn(n,this.commandOptions))}__init69() {this.renamenx=(...n)=>this.chain(new nt(n,this.commandOptions))}__init70() {this.rpop=(...n)=>this.chain(new tt(n,this.commandOptions))}__init71() {this.rpush=(n,...t)=>this.chain(new et([n,...t],this.commandOptions))}__init72() {this.rpushx=(n,...t)=>this.chain(new ot([n,...t],this.commandOptions))}__init73() {this.sadd=(n,...t)=>this.chain(new st([n,...t],this.commandOptions))}__init74() {this.scan=(...n)=>this.chain(new mt(n,this.commandOptions))}__init75() {this.scard=(...n)=>this.chain(new rt(n,this.commandOptions))}__init76() {this.scriptExists=(...n)=>this.chain(new at(n,this.commandOptions))}__init77() {this.scriptFlush=(...n)=>this.chain(new it(n,this.commandOptions))}__init78() {this.scriptLoad=(...n)=>this.chain(new pt(n,this.commandOptions))}__init79() {this.sdiff=(...n)=>this.chain(new dt(n,this.commandOptions))}__init80() {this.sdiffstore=(...n)=>this.chain(new ct(n,this.commandOptions))}__init81() {this.set=(n,t,o)=>this.chain(new ut([n,t,o],this.commandOptions))}__init82() {this.setbit=(...n)=>this.chain(new ht(n,this.commandOptions))}__init83() {this.setex=(n,t,o)=>this.chain(new Ct([n,t,o],this.commandOptions))}__init84() {this.setnx=(n,t)=>this.chain(new lt([n,t],this.commandOptions))}__init85() {this.setrange=(...n)=>this.chain(new gt(n,this.commandOptions))}__init86() {this.sinter=(...n)=>this.chain(new xt(n,this.commandOptions))}__init87() {this.sinterstore=(...n)=>this.chain(new ft(n,this.commandOptions))}__init88() {this.sismember=(n,t)=>this.chain(new yt([n,t],this.commandOptions))}__init89() {this.smembers=(...n)=>this.chain(new bt(n,this.commandOptions))}__init90() {this.smismember=(n,t)=>this.chain(new Ot([n,t],this.commandOptions))}__init91() {this.smove=(n,t,o)=>this.chain(new Tt([n,t,o],this.commandOptions))}__init92() {this.spop=(...n)=>this.chain(new wt(n,this.commandOptions))}__init93() {this.srandmember=(...n)=>this.chain(new Dt(n,this.commandOptions))}__init94() {this.srem=(n,...t)=>this.chain(new kt([n,...t],this.commandOptions))}__init95() {this.sscan=(...n)=>this.chain(new At(n,this.commandOptions))}__init96() {this.strlen=(...n)=>this.chain(new St(n,this.commandOptions))}__init97() {this.sunion=(...n)=>this.chain(new Rt(n,this.commandOptions))}__init98() {this.sunionstore=(...n)=>this.chain(new Mt(n,this.commandOptions))}__init99() {this.time=()=>this.chain(new vt(this.commandOptions))}__init100() {this.touch=(...n)=>this.chain(new Et(n,this.commandOptions))}__init101() {this.ttl=(...n)=>this.chain(new zt(n,this.commandOptions))}__init102() {this.type=(...n)=>this.chain(new Jt(n,this.commandOptions))}__init103() {this.unlink=(...n)=>this.chain(new Pt(n,this.commandOptions))}__init104() {this.zadd=(...n)=>\"score\"in n[1]?this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions)):this.chain(new u([n[0],n[1],...n.slice(2)],this.commandOptions))}__init105() {this.zcard=(...n)=>this.chain(new It(n,this.commandOptions))}__init106() {this.zcount=(...n)=>this.chain(new Kt(n,this.commandOptions))}__init107() {this.zincrby=(n,t,o)=>this.chain(new Lt([n,t,o],this.commandOptions))}__init108() {this.zinterstore=(...n)=>this.chain(new Zt(n,this.commandOptions))}__init109() {this.zlexcount=(...n)=>this.chain(new Nt(n,this.commandOptions))}__init110() {this.zmscore=(...n)=>this.chain(new ne(n,this.commandOptions))}__init111() {this.zpopmax=(...n)=>this.chain(new Gt(n,this.commandOptions))}__init112() {this.zpopmin=(...n)=>this.chain(new Bt(n,this.commandOptions))}__init113() {this.zrange=(...n)=>this.chain(new Ut(n,this.commandOptions))}__init114() {this.zrank=(n,t)=>this.chain(new Ht([n,t],this.commandOptions))}__init115() {this.zrem=(n,...t)=>this.chain(new Ft([n,...t],this.commandOptions))}__init116() {this.zremrangebylex=(...n)=>this.chain(new qt(n,this.commandOptions))}__init117() {this.zremrangebyrank=(...n)=>this.chain(new $t(n,this.commandOptions))}__init118() {this.zremrangebyscore=(...n)=>this.chain(new Xt(n,this.commandOptions))}__init119() {this.zrevrank=(n,t)=>this.chain(new jt([n,t],this.commandOptions))}__init120() {this.zscan=(...n)=>this.chain(new Yt(n,this.commandOptions))}__init121() {this.zscore=(n,t)=>this.chain(new Wt([n,t],this.commandOptions))}__init122() {this.zunionstore=(...n)=>this.chain(new _t(n,this.commandOptions))}__init123() {this.zunion=(...n)=>this.chain(new Vt(n,this.commandOptions))}get json(){return{arrappend:(...n)=>this.chain(new an(n,this.commandOptions)),arrindex:(...n)=>this.chain(new pn(n,this.commandOptions)),arrinsert:(...n)=>this.chain(new dn(n,this.commandOptions)),arrlen:(...n)=>this.chain(new cn(n,this.commandOptions)),arrpop:(...n)=>this.chain(new un(n,this.commandOptions)),arrtrim:(...n)=>this.chain(new hn(n,this.commandOptions)),clear:(...n)=>this.chain(new Cn(n,this.commandOptions)),del:(...n)=>this.chain(new ln(n,this.commandOptions)),forget:(...n)=>this.chain(new gn(n,this.commandOptions)),geoadd:(...n)=>this.chain(new E(n,this.commandOptions)),geodist:(...n)=>this.chain(new z(n,this.commandOptions)),geopos:(...n)=>this.chain(new J(n,this.commandOptions)),geohash:(...n)=>this.chain(new P(n,this.commandOptions)),geosearch:(...n)=>this.chain(new I(n,this.commandOptions)),geosearchstore:(...n)=>this.chain(new K(n,this.commandOptions)),get:(...n)=>this.chain(new xn(n,this.commandOptions)),mget:(...n)=>this.chain(new fn(n,this.commandOptions)),numincrby:(...n)=>this.chain(new yn(n,this.commandOptions)),nummultby:(...n)=>this.chain(new bn(n,this.commandOptions)),objkeys:(...n)=>this.chain(new On(n,this.commandOptions)),objlen:(...n)=>this.chain(new Tn(n,this.commandOptions)),resp:(...n)=>this.chain(new wn(n,this.commandOptions)),set:(...n)=>this.chain(new Dn(n,this.commandOptions)),strappend:(...n)=>this.chain(new kn(n,this.commandOptions)),strlen:(...n)=>this.chain(new An(n,this.commandOptions)),toggle:(...n)=>this.chain(new Sn(n,this.commandOptions)),type:(...n)=>this.chain(new Rn(n,this.commandOptions))}}}, _class);var _enchex = require('crypto-js/enc-hex'); var _enchex2 = _interopRequireDefault(_enchex);var _sha1 = require('crypto-js/sha1'); var _sha12 = _interopRequireDefault(_sha1);var me=class{constructor(n,t){this.redis=n,this.sha1=this.digest(t),this.script=t}async eval(n,t){return await this.redis.eval(this.script,n,t)}async evalsha(n,t){return await this.redis.evalsha(this.sha1,n,t)}async exec(n,t){return await this.redis.evalsha(this.sha1,n,t).catch(async m=>{if(m instanceof Error&&m.message.toLowerCase().includes(\"noscript\"))return await this.redis.eval(this.script,n,t);throw m})}digest(n){return _enchex2.default.stringify(_sha12.default.call(void 0, n))}};var ue= (_class2 =class{constructor(n,t){;_class2.prototype.__init124.call(this);_class2.prototype.__init125.call(this);_class2.prototype.__init126.call(this);_class2.prototype.__init127.call(this);_class2.prototype.__init128.call(this);_class2.prototype.__init129.call(this);_class2.prototype.__init130.call(this);_class2.prototype.__init131.call(this);_class2.prototype.__init132.call(this);_class2.prototype.__init133.call(this);_class2.prototype.__init134.call(this);_class2.prototype.__init135.call(this);_class2.prototype.__init136.call(this);_class2.prototype.__init137.call(this);_class2.prototype.__init138.call(this);_class2.prototype.__init139.call(this);_class2.prototype.__init140.call(this);_class2.prototype.__init141.call(this);_class2.prototype.__init142.call(this);_class2.prototype.__init143.call(this);_class2.prototype.__init144.call(this);_class2.prototype.__init145.call(this);_class2.prototype.__init146.call(this);_class2.prototype.__init147.call(this);_class2.prototype.__init148.call(this);_class2.prototype.__init149.call(this);_class2.prototype.__init150.call(this);_class2.prototype.__init151.call(this);_class2.prototype.__init152.call(this);_class2.prototype.__init153.call(this);_class2.prototype.__init154.call(this);_class2.prototype.__init155.call(this);_class2.prototype.__init156.call(this);_class2.prototype.__init157.call(this);_class2.prototype.__init158.call(this);_class2.prototype.__init159.call(this);_class2.prototype.__init160.call(this);_class2.prototype.__init161.call(this);_class2.prototype.__init162.call(this);_class2.prototype.__init163.call(this);_class2.prototype.__init164.call(this);_class2.prototype.__init165.call(this);_class2.prototype.__init166.call(this);_class2.prototype.__init167.call(this);_class2.prototype.__init168.call(this);_class2.prototype.__init169.call(this);_class2.prototype.__init170.call(this);_class2.prototype.__init171.call(this);_class2.prototype.__init172.call(this);_class2.prototype.__init173.call(this);_class2.prototype.__init174.call(this);_class2.prototype.__init175.call(this);_class2.prototype.__init176.call(this);_class2.prototype.__init177.call(this);_class2.prototype.__init178.call(this);_class2.prototype.__init179.call(this);_class2.prototype.__init180.call(this);_class2.prototype.__init181.call(this);_class2.prototype.__init182.call(this);_class2.prototype.__init183.call(this);_class2.prototype.__init184.call(this);_class2.prototype.__init185.call(this);_class2.prototype.__init186.call(this);_class2.prototype.__init187.call(this);_class2.prototype.__init188.call(this);_class2.prototype.__init189.call(this);_class2.prototype.__init190.call(this);_class2.prototype.__init191.call(this);_class2.prototype.__init192.call(this);_class2.prototype.__init193.call(this);_class2.prototype.__init194.call(this);_class2.prototype.__init195.call(this);_class2.prototype.__init196.call(this);_class2.prototype.__init197.call(this);_class2.prototype.__init198.call(this);_class2.prototype.__init199.call(this);_class2.prototype.__init200.call(this);_class2.prototype.__init201.call(this);_class2.prototype.__init202.call(this);_class2.prototype.__init203.call(this);_class2.prototype.__init204.call(this);_class2.prototype.__init205.call(this);_class2.prototype.__init206.call(this);_class2.prototype.__init207.call(this);_class2.prototype.__init208.call(this);_class2.prototype.__init209.call(this);_class2.prototype.__init210.call(this);_class2.prototype.__init211.call(this);_class2.prototype.__init212.call(this);_class2.prototype.__init213.call(this);_class2.prototype.__init214.call(this);_class2.prototype.__init215.call(this);_class2.prototype.__init216.call(this);_class2.prototype.__init217.call(this);_class2.prototype.__init218.call(this);_class2.prototype.__init219.call(this);_class2.prototype.__init220.call(this);_class2.prototype.__init221.call(this);_class2.prototype.__init222.call(this);_class2.prototype.__init223.call(this);_class2.prototype.__init224.call(this);_class2.prototype.__init225.call(this);_class2.prototype.__init226.call(this);_class2.prototype.__init227.call(this);_class2.prototype.__init228.call(this);_class2.prototype.__init229.call(this);_class2.prototype.__init230.call(this);_class2.prototype.__init231.call(this);_class2.prototype.__init232.call(this);_class2.prototype.__init233.call(this);_class2.prototype.__init234.call(this);_class2.prototype.__init235.call(this);_class2.prototype.__init236.call(this);_class2.prototype.__init237.call(this);_class2.prototype.__init238.call(this);_class2.prototype.__init239.call(this);_class2.prototype.__init240.call(this);_class2.prototype.__init241.call(this);_class2.prototype.__init242.call(this);_class2.prototype.__init243.call(this);_class2.prototype.__init244.call(this);_class2.prototype.__init245.call(this);_class2.prototype.__init246.call(this);_class2.prototype.__init247.call(this);_class2.prototype.__init248.call(this);_class2.prototype.__init249.call(this);_class2.prototype.__init250.call(this);_class2.prototype.__init251.call(this);this.client=n,this.opts=t,this.enableTelemetry=_nullishCoalesce(_optionalChain([t, 'optionalAccess', _56 => _56.enableTelemetry]), () => (!0))}get json(){return{arrappend:(...n)=>new an(n,this.opts).exec(this.client),arrindex:(...n)=>new pn(n,this.opts).exec(this.client),arrinsert:(...n)=>new dn(n,this.opts).exec(this.client),arrlen:(...n)=>new cn(n,this.opts).exec(this.client),arrpop:(...n)=>new un(n,this.opts).exec(this.client),arrtrim:(...n)=>new hn(n,this.opts).exec(this.client),clear:(...n)=>new Cn(n,this.opts).exec(this.client),del:(...n)=>new ln(n,this.opts).exec(this.client),forget:(...n)=>new gn(n,this.opts).exec(this.client),geoadd:(...n)=>new E(n,this.opts).exec(this.client),geopos:(...n)=>new J(n,this.opts).exec(this.client),geodist:(...n)=>new z(n,this.opts).exec(this.client),geohash:(...n)=>new P(n,this.opts).exec(this.client),geosearch:(...n)=>new I(n,this.opts).exec(this.client),geosearchstore:(...n)=>new K(n,this.opts).exec(this.client),get:(...n)=>new xn(n,this.opts).exec(this.client),mget:(...n)=>new fn(n,this.opts).exec(this.client),numincrby:(...n)=>new yn(n,this.opts).exec(this.client),nummultby:(...n)=>new bn(n,this.opts).exec(this.client),objkeys:(...n)=>new On(n,this.opts).exec(this.client),objlen:(...n)=>new Tn(n,this.opts).exec(this.client),resp:(...n)=>new wn(n,this.opts).exec(this.client),set:(...n)=>new Dn(n,this.opts).exec(this.client),strappend:(...n)=>new kn(n,this.opts).exec(this.client),strlen:(...n)=>new An(n,this.opts).exec(this.client),toggle:(...n)=>new Sn(n,this.opts).exec(this.client),type:(...n)=>new Rn(n,this.opts).exec(this.client)}}__init124() {this.use=n=>{let t=this.client.request.bind(this.client);this.client.request=o=>n(o,t)}}__init125() {this.addTelemetry=n=>{if(this.enableTelemetry)try{this.client.mergeTelemetry(n)}catch (e12){}}}createScript(n){return new me(this,n)}__init126() {this.pipeline=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!1})}__init127() {this.multi=()=>new te({client:this.client,commandOptions:this.opts,multiExec:!0})}__init128() {this.append=(...n)=>new C(n,this.opts).exec(this.client)}__init129() {this.bitcount=(...n)=>new l(n,this.opts).exec(this.client)}__init130() {this.bitop=(n,t,o,...m)=>new g([n,t,o,...m],this.opts).exec(this.client)}__init131() {this.bitpos=(...n)=>new x(n,this.opts).exec(this.client)}__init132() {this.copy=(...n)=>new f(n,this.opts).exec(this.client)}__init133() {this.dbsize=()=>new y(this.opts).exec(this.client)}__init134() {this.decr=(...n)=>new b(n,this.opts).exec(this.client)}__init135() {this.decrby=(...n)=>new O(n,this.opts).exec(this.client)}__init136() {this.del=(...n)=>new T(n,this.opts).exec(this.client)}__init137() {this.echo=(...n)=>new w(n,this.opts).exec(this.client)}__init138() {this.eval=(...n)=>new D(n,this.opts).exec(this.client)}__init139() {this.evalsha=(...n)=>new k(n,this.opts).exec(this.client)}__init140() {this.exists=(...n)=>new A(n,this.opts).exec(this.client)}__init141() {this.expire=(...n)=>new S(n,this.opts).exec(this.client)}__init142() {this.expireat=(...n)=>new R(n,this.opts).exec(this.client)}__init143() {this.flushall=n=>new M(n,this.opts).exec(this.client)}__init144() {this.flushdb=(...n)=>new v(n,this.opts).exec(this.client)}__init145() {this.get=(...n)=>new L(n,this.opts).exec(this.client)}__init146() {this.getbit=(...n)=>new Z(n,this.opts).exec(this.client)}__init147() {this.getdel=(...n)=>new N(n,this.opts).exec(this.client)}__init148() {this.getrange=(...n)=>new G(n,this.opts).exec(this.client)}__init149() {this.getset=(n,t)=>new B([n,t],this.opts).exec(this.client)}__init150() {this.hdel=(...n)=>new U(n,this.opts).exec(this.client)}__init151() {this.hexists=(...n)=>new H(n,this.opts).exec(this.client)}__init152() {this.hget=(...n)=>new F(n,this.opts).exec(this.client)}__init153() {this.hgetall=(...n)=>new q(n,this.opts).exec(this.client)}__init154() {this.hincrby=(...n)=>new $(n,this.opts).exec(this.client)}__init155() {this.hincrbyfloat=(...n)=>new X(n,this.opts).exec(this.client)}__init156() {this.hkeys=(...n)=>new j(n,this.opts).exec(this.client)}__init157() {this.hlen=(...n)=>new Y(n,this.opts).exec(this.client)}__init158() {this.hmget=(...n)=>new W(n,this.opts).exec(this.client)}__init159() {this.hmset=(n,t)=>new V([n,t],this.opts).exec(this.client)}__init160() {this.hrandfield=(n,t,o)=>new _([n,t,o],this.opts).exec(this.client)}__init161() {this.hscan=(...n)=>new Q(n,this.opts).exec(this.client)}__init162() {this.hset=(n,t)=>new nn([n,t],this.opts).exec(this.client)}__init163() {this.hsetnx=(n,t,o)=>new tn([n,t,o],this.opts).exec(this.client)}__init164() {this.hstrlen=(...n)=>new en(n,this.opts).exec(this.client)}__init165() {this.hvals=(...n)=>new on(n,this.opts).exec(this.client)}__init166() {this.incr=(...n)=>new sn(n,this.opts).exec(this.client)}__init167() {this.incrby=(...n)=>new mn(n,this.opts).exec(this.client)}__init168() {this.incrbyfloat=(...n)=>new rn(n,this.opts).exec(this.client)}__init169() {this.keys=(...n)=>new Mn(n,this.opts).exec(this.client)}__init170() {this.lindex=(...n)=>new vn(n,this.opts).exec(this.client)}__init171() {this.linsert=(n,t,o,m)=>new En([n,t,o,m],this.opts).exec(this.client)}__init172() {this.llen=(...n)=>new zn(n,this.opts).exec(this.client)}__init173() {this.lmove=(...n)=>new Jn(n,this.opts).exec(this.client)}__init174() {this.lpop=(...n)=>new Pn(n,this.opts).exec(this.client)}__init175() {this.lpos=(...n)=>new In(n,this.opts).exec(this.client)}__init176() {this.lpush=(n,...t)=>new Kn([n,...t],this.opts).exec(this.client)}__init177() {this.lpushx=(n,...t)=>new Ln([n,...t],this.opts).exec(this.client)}__init178() {this.lrange=(...n)=>new Zn(n,this.opts).exec(this.client)}__init179() {this.lrem=(n,t,o)=>new Nn([n,t,o],this.opts).exec(this.client)}__init180() {this.lset=(n,t,o)=>new Gn([n,t,o],this.opts).exec(this.client)}__init181() {this.ltrim=(...n)=>new Bn(n,this.opts).exec(this.client)}__init182() {this.mget=(...n)=>new Un(n,this.opts).exec(this.client)}__init183() {this.mset=n=>new Hn([n],this.opts).exec(this.client)}__init184() {this.msetnx=n=>new Fn([n],this.opts).exec(this.client)}__init185() {this.persist=(...n)=>new qn(n,this.opts).exec(this.client)}__init186() {this.pexpire=(...n)=>new $n(n,this.opts).exec(this.client)}__init187() {this.pexpireat=(...n)=>new Xn(n,this.opts).exec(this.client)}__init188() {this.ping=n=>new jn(n,this.opts).exec(this.client)}__init189() {this.psetex=(n,t,o)=>new Yn([n,t,o],this.opts).exec(this.client)}__init190() {this.pttl=(...n)=>new Wn(n,this.opts).exec(this.client)}__init191() {this.publish=(...n)=>new Vn(n,this.opts).exec(this.client)}__init192() {this.randomkey=()=>new _n().exec(this.client)}__init193() {this.rename=(...n)=>new Qn(n,this.opts).exec(this.client)}__init194() {this.renamenx=(...n)=>new nt(n,this.opts).exec(this.client)}__init195() {this.rpop=(...n)=>new tt(n,this.opts).exec(this.client)}__init196() {this.rpush=(n,...t)=>new et([n,...t],this.opts).exec(this.client)}__init197() {this.rpushx=(n,...t)=>new ot([n,...t],this.opts).exec(this.client)}__init198() {this.sadd=(n,...t)=>new st([n,...t],this.opts).exec(this.client)}__init199() {this.scan=(...n)=>new mt(n,this.opts).exec(this.client)}__init200() {this.scard=(...n)=>new rt(n,this.opts).exec(this.client)}__init201() {this.scriptExists=(...n)=>new at(n,this.opts).exec(this.client)}__init202() {this.scriptFlush=(...n)=>new it(n,this.opts).exec(this.client)}__init203() {this.scriptLoad=(...n)=>new pt(n,this.opts).exec(this.client)}__init204() {this.sdiff=(...n)=>new dt(n,this.opts).exec(this.client)}__init205() {this.sdiffstore=(...n)=>new ct(n,this.opts).exec(this.client)}__init206() {this.set=(n,t,o)=>new ut([n,t,o],this.opts).exec(this.client)}__init207() {this.setbit=(...n)=>new ht(n,this.opts).exec(this.client)}__init208() {this.setex=(n,t,o)=>new Ct([n,t,o],this.opts).exec(this.client)}__init209() {this.setnx=(n,t)=>new lt([n,t],this.opts).exec(this.client)}__init210() {this.setrange=(...n)=>new gt(n,this.opts).exec(this.client)}__init211() {this.sinter=(...n)=>new xt(n,this.opts).exec(this.client)}__init212() {this.sinterstore=(...n)=>new ft(n,this.opts).exec(this.client)}__init213() {this.sismember=(n,t)=>new yt([n,t],this.opts).exec(this.client)}__init214() {this.smismember=(n,t)=>new Ot([n,t],this.opts).exec(this.client)}__init215() {this.smembers=(...n)=>new bt(n,this.opts).exec(this.client)}__init216() {this.smove=(n,t,o)=>new Tt([n,t,o],this.opts).exec(this.client)}__init217() {this.spop=(...n)=>new wt(n,this.opts).exec(this.client)}__init218() {this.srandmember=(...n)=>new Dt(n,this.opts).exec(this.client)}__init219() {this.srem=(n,...t)=>new kt([n,...t],this.opts).exec(this.client)}__init220() {this.sscan=(...n)=>new At(n,this.opts).exec(this.client)}__init221() {this.strlen=(...n)=>new St(n,this.opts).exec(this.client)}__init222() {this.sunion=(...n)=>new Rt(n,this.opts).exec(this.client)}__init223() {this.sunionstore=(...n)=>new Mt(n,this.opts).exec(this.client)}__init224() {this.time=()=>new vt().exec(this.client)}__init225() {this.touch=(...n)=>new Et(n,this.opts).exec(this.client)}__init226() {this.ttl=(...n)=>new zt(n,this.opts).exec(this.client)}__init227() {this.type=(...n)=>new Jt(n,this.opts).exec(this.client)}__init228() {this.unlink=(...n)=>new Pt(n,this.opts).exec(this.client)}__init229() {this.xadd=(...n)=>new oe(n,this.opts).exec(this.client)}__init230() {this.xrange=(...n)=>new se(n,this.opts).exec(this.client)}__init231() {this.zadd=(...n)=>\"score\"in n[1]?new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client):new u([n[0],n[1],...n.slice(2)],this.opts).exec(this.client)}__init232() {this.zcard=(...n)=>new It(n,this.opts).exec(this.client)}__init233() {this.zcount=(...n)=>new Kt(n,this.opts).exec(this.client)}__init234() {this.zdiffstore=(...n)=>new Qt(n,this.opts).exec(this.client)}__init235() {this.zincrby=(n,t,o)=>new Lt([n,t,o],this.opts).exec(this.client)}__init236() {this.zinterstore=(...n)=>new Zt(n,this.opts).exec(this.client)}__init237() {this.zlexcount=(...n)=>new Nt(n,this.opts).exec(this.client)}__init238() {this.zmscore=(...n)=>new ne(n,this.opts).exec(this.client)}__init239() {this.zpopmax=(...n)=>new Gt(n,this.opts).exec(this.client)}__init240() {this.zpopmin=(...n)=>new Bt(n,this.opts).exec(this.client)}__init241() {this.zrange=(...n)=>new Ut(n,this.opts).exec(this.client)}__init242() {this.zrank=(n,t)=>new Ht([n,t],this.opts).exec(this.client)}__init243() {this.zrem=(n,...t)=>new Ft([n,...t],this.opts).exec(this.client)}__init244() {this.zremrangebylex=(...n)=>new qt(n,this.opts).exec(this.client)}__init245() {this.zremrangebyrank=(...n)=>new $t(n,this.opts).exec(this.client)}__init246() {this.zremrangebyscore=(...n)=>new Xt(n,this.opts).exec(this.client)}__init247() {this.zrevrank=(n,t)=>new jt([n,t],this.opts).exec(this.client)}__init248() {this.zscan=(...n)=>new Yt(n,this.opts).exec(this.client)}__init249() {this.zscore=(n,t)=>new Wt([n,t],this.opts).exec(this.client)}__init250() {this.zunion=(...n)=>new Vt(n,this.opts).exec(this.client)}__init251() {this.zunionstore=(...n)=>new _t(n,this.opts).exec(this.client)}}, _class2);var cC=\"v1.24.3\";exports.a = ie; exports.b = ue; exports.c = cC;\n","\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJIU2S2DZjs = require('./chunk-JIU2S2DZ.js');typeof atob>\"u\"&&(global.atob=function(n){return Buffer.from(n,\"base64\").toString(\"utf-8\")});var a=class n extends _chunkJIU2S2DZjs.b{constructor(e){if(\"request\"in e){super(e);return}(e.url.startsWith(\" \")||e.url.endsWith(\" \")||/\\r|\\n/.test(e.url))&&console.warn(\"The redis url contains whitespace or newline, which can cause errors!\"),(e.token.startsWith(\" \")||e.token.endsWith(\" \")||/\\r|\\n/.test(e.token))&&console.warn(\"The redis token contains whitespace or newline, which can cause errors!\");let t=new (0, _chunkJIU2S2DZjs.a)({baseUrl:e.url,retry:e.retry,headers:{authorization:`Bearer ${e.token}`},agent:e.agent,responseEncoding:e.responseEncoding,cache:e.cache||\"no-store\"});super(t,{automaticDeserialization:e.automaticDeserialization,enableTelemetry:!process.env.UPSTASH_DISABLE_TELEMETRY}),this.addTelemetry({runtime:typeof EdgeRuntime==\"string\"?\"edge-light\":`node@${process.version}`,platform:process.env.VERCEL?\"vercel\":process.env.AWS_REGION?\"aws\":\"unknown\",sdk:`@upstash/redis@${_chunkJIU2S2DZjs.c}`})}static fromEnv(e){if(typeof _optionalChain([process, 'optionalAccess', _ => _.env])>\"u\")throw new Error('Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from \"@upstash/redis/cloudflare\" instead');let t=_optionalChain([process, 'optionalAccess', _2 => _2.env, 'access', _3 => _3.UPSTASH_REDIS_REST_URL]);if(!t)throw new Error(\"Unable to find environment variable: `UPSTASH_REDIS_REST_URL`\");let s=_optionalChain([process, 'optionalAccess', _4 => _4.env, 'access', _5 => _5.UPSTASH_REDIS_REST_TOKEN]);if(!s)throw new Error(\"Unable to find environment variable: `UPSTASH_REDIS_REST_TOKEN`\");return new n({...e,url:t,token:s})}};exports.Redis = a;\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\treturn CryptoJS.enc.Hex;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-1 hash algorithm.\n\t */\n\t var SHA1 = C_algo.SHA1 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476,\n\t 0xc3d2e1f0\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\n\t // Computation\n\t for (var i = 0; i < 80; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t W[i] = (n << 1) | (n >>> 31);\n\t }\n\n\t var t = ((a << 5) | (a >>> 27)) + e + W[i];\n\t if (i < 20) {\n\t t += ((b & c) | (~b & d)) + 0x5a827999;\n\t } else if (i < 40) {\n\t t += (b ^ c ^ d) + 0x6ed9eba1;\n\t } else if (i < 60) {\n\t t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;\n\t } else /* if (i < 80) */ {\n\t t += (b ^ c ^ d) - 0x359d3e2a;\n\t }\n\n\t e = d;\n\t d = c;\n\t c = (b << 30) | (b >>> 2);\n\t b = a;\n\t a = t;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA1('message');\n\t * var hash = CryptoJS.SHA1(wordArray);\n\t */\n\t C.SHA1 = Hasher._createHelper(SHA1);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA1(message, key);\n\t */\n\t C.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t}());\n\n\n\treturn CryptoJS.SHA1;\n\n}));","module.exports = require(\"crypto\");","module.exports = require(\"fs/promises\");","module.exports = require(\"path\");","\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true});// src/index.ts\nvar _redis = require('@upstash/redis');\nvar _kv = null;\nprocess.env.UPSTASH_DISABLE_TELEMETRY = \"1\";\nvar VercelKV = class extends _redis.Redis {\n // This API is based on https://github.com/redis/node-redis#scan-iterator which is not supported in @upstash/redis\n /**\n * Same as `scan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *scanIterator(options) {\n let cursor = 0;\n let keys;\n do {\n [cursor, keys] = await this.scan(cursor, options);\n for (const key of keys) {\n yield key;\n }\n } while (cursor !== 0);\n }\n /**\n * Same as `hscan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *hscanIterator(key, options) {\n let cursor = 0;\n let items;\n do {\n [cursor, items] = await this.hscan(key, cursor, options);\n for (const item of items) {\n yield item;\n }\n } while (cursor !== 0);\n }\n /**\n * Same as `sscan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *sscanIterator(key, options) {\n let cursor = 0;\n let items;\n do {\n [cursor, items] = await this.sscan(key, cursor, options);\n for (const item of items) {\n yield item;\n }\n } while (cursor !== 0);\n }\n /**\n * Same as `zscan` but returns an AsyncIterator to allow iteration via `for await`.\n */\n async *zscanIterator(key, options) {\n let cursor = 0;\n let items;\n do {\n [cursor, items] = await this.zscan(key, cursor, options);\n for (const item of items) {\n yield item;\n }\n } while (cursor !== 0);\n }\n};\nfunction createClient(config) {\n return new VercelKV(config);\n}\nvar src_default = new Proxy(\n {},\n {\n get(target, prop, receiver) {\n if (prop === \"then\" || prop === \"parse\") {\n return Reflect.get(target, prop, receiver);\n }\n if (!_kv) {\n if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) {\n throw new Error(\n \"@vercel/kv: Missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN\"\n );\n }\n console.warn(\n '\\x1B[33m\"The default export has been moved to a named export and it will be removed in version 1, change to import { kv }\\x1B[0m\"'\n );\n _kv = createClient({\n url: process.env.KV_REST_API_URL,\n token: process.env.KV_REST_API_TOKEN\n });\n }\n return Reflect.get(_kv, prop);\n }\n }\n);\nvar kv = new Proxy(\n {},\n {\n get(target, prop) {\n if (!_kv) {\n if (!process.env.KV_REST_API_URL || !process.env.KV_REST_API_TOKEN) {\n throw new Error(\n \"@vercel/kv: Missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN\"\n );\n }\n _kv = createClient({\n url: process.env.KV_REST_API_URL,\n token: process.env.KV_REST_API_TOKEN\n });\n }\n return Reflect.get(_kv, prop);\n }\n }\n);\n\n\n\n\n\nexports.VercelKV = VercelKV; exports.createClient = createClient; exports.default = src_default; exports.kv = kv;\n//# sourceMappingURL=index.cjs.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","const fs = require('fs/promises')\nconst path = require('path')\n\nconst { createClient } = require('@vercel/kv')\n\nasync function main() {\n try {\n const file = path.join(process.cwd(), 'test/turbopack-tests-manifest.json')\n\n let passingTests = ''\n let failingTests = ''\n let passCount = 0\n let failCount = 0\n\n const contents = await fs.readFile(file, 'utf-8')\n const results = JSON.parse(contents)\n\n const currentDate = new Date()\n const isoString = currentDate.toISOString()\n const timestamp = isoString.slice(0, 19).replace('T', ' ')\n\n for (const [testFileName, result] of Object.entries(results)) {\n let suitePassCount = 0\n let suiteFailCount = 0\n\n suitePassCount += result.passed.length\n suiteFailCount += result.failed.length\n\n if (suitePassCount > 0) {\n passingTests += `${testFileName}\\n`\n }\n\n if (suiteFailCount > 0) {\n failingTests += `${testFileName}\\n`\n }\n\n for (const passed of result.passed) {\n const passedName = passed.replaceAll('`', '\\\\`')\n passingTests += `* ${passedName}\\n`\n }\n\n for (const passed of result.failed) {\n const failedName = passed.replaceAll('`', '\\\\`')\n failingTests += `* ${failedName}\\n`\n }\n\n passCount += suitePassCount\n failCount += suiteFailCount\n\n if (suitePassCount > 0) {\n passingTests += `\\n`\n }\n\n if (suiteFailCount > 0) {\n failingTests += `\\n`\n }\n }\n\n const kv = createClient({\n url: process.env.TURBOYET_KV_REST_API_URL,\n token: process.env.TURBOYET_KV_REST_API_TOKEN,\n })\n\n const testRun = `${process.env.GITHUB_SHA}\\t${timestamp}\\t${passCount}/${\n passCount + failCount\n }`\n\n console.log('TEST RESULT')\n console.log(testRun)\n\n await kv.rpush('test-runs', testRun)\n console.log('SUCCESSFULLY SAVED RUNS')\n\n await kv.set('passing-tests', passingTests)\n console.log('SUCCESSFULLY SAVED PASSING')\n\n await kv.set('failing-tests', failingTests)\n console.log('SUCCESSFULLY SAVED FAILING')\n } catch (error) {\n console.log(error)\n }\n}\n\nmain()\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/.github/actions/upload-turboyet-data/src/main.js b/.github/actions/upload-turboyet-data/src/main.js index 6ed33b52834a2..f6171e4c4e767 100644 --- a/.github/actions/upload-turboyet-data/src/main.js +++ b/.github/actions/upload-turboyet-data/src/main.js @@ -5,10 +5,7 @@ const { createClient } = require('@vercel/kv') async function main() { try { - const file = path.join( - process.cwd(), - './test-results/nextjs-test-results.json' - ) + const file = path.join(process.cwd(), 'test/turbopack-tests-manifest.json') let passingTests = '' let failingTests = '' @@ -17,39 +14,34 @@ async function main() { const contents = await fs.readFile(file, 'utf-8') const results = JSON.parse(contents) - let { ref } = results + const currentDate = new Date() const isoString = currentDate.toISOString() const timestamp = isoString.slice(0, 19).replace('T', ' ') - for (const result of results.result) { + for (const [testFileName, result] of Object.entries(results)) { let suitePassCount = 0 let suiteFailCount = 0 - suitePassCount += result.data.numPassedTests - suiteFailCount += result.data.numFailedTests + suitePassCount += result.passed.length + suiteFailCount += result.failed.length - let suiteName = result.data.testResults[0].name - // remove "/root/actions-runner/_work/next.js/next.js/" from the beginning of suiteName - suiteName = suiteName.slice( - '/root/actions-runner/_work/next.js/next.js/'.length - ) if (suitePassCount > 0) { - passingTests += `${suiteName}\n` + passingTests += `${testFileName}\n` } if (suiteFailCount > 0) { - failingTests += `${suiteName}\n` + failingTests += `${testFileName}\n` + } + + for (const passed of result.passed) { + const passedName = passed.replaceAll('`', '\\`') + passingTests += `* ${passedName}\n` } - for (const assertionResult of result.data.testResults[0] - .assertionResults) { - let assertion = assertionResult.fullName.replaceAll('`', '\\`') - if (assertionResult.status === 'passed') { - passingTests += `* ${assertion}\n` - } else if (assertionResult.status === 'failed') { - failingTests += `* ${assertion}\n` - } + for (const passed of result.failed) { + const failedName = passed.replaceAll('`', '\\`') + failingTests += `* ${failedName}\n` } passCount += suitePassCount @@ -69,7 +61,7 @@ async function main() { token: process.env.TURBOYET_KV_REST_API_TOKEN, }) - const testRun = `${ref}\t${timestamp}\t${passCount}/${ + const testRun = `${process.env.GITHUB_SHA}\t${timestamp}\t${passCount}/${ passCount + failCount }` diff --git a/.github/workflows/turbo-daily-integration-test.yml b/.github/workflows/turbo-daily-integration-test.yml index 4ec2ef7b0783b..9b660b57ed8a6 100644 --- a/.github/workflows/turbo-daily-integration-test.yml +++ b/.github/workflows/turbo-daily-integration-test.yml @@ -29,6 +29,7 @@ jobs: upload_test_results: name: Upload test results needs: [next_js_integration] - if: github.repository_owner == 'vercel' && ${{ github.event_name == 'schedule' }} && always() + # if: github.repository_owner == 'vercel' && ${{ github.event_name == 'schedule' }} && always() + if: always() uses: ./.github/workflows/upload-nextjs-integration-test-results.yml secrets: inherit diff --git a/.github/workflows/upload-nextjs-integration-test-results.yml b/.github/workflows/upload-nextjs-integration-test-results.yml index 630466161fb1e..980b9ac587a43 100644 --- a/.github/workflows/upload-nextjs-integration-test-results.yml +++ b/.github/workflows/upload-nextjs-integration-test-results.yml @@ -12,26 +12,26 @@ jobs: name: Upload test results runs-on: ubuntu-latest steps: + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_LTS_VERSION }} + check-latest: true + - name: Checkout uses: actions/checkout@v4 - # Download test results into the `test-results` directory from the artifact created by `nextjs-integration-test`. - - name: Download test results artifact - uses: actions/download-artifact@v4 - with: - name: test-results - path: test-results + - run: corepack enable - # Read next.js version from test results, set necessary environment variables. - - name: Print test results - run: | - echo "::group::Passed test paths" - cat ./test-results/passed-test-path-list.json - echo "::endgroup::" + - name: Install dependencies + shell: bash + run: pnpm i - echo "::group::Failed test paths" - cat ./test-results/failed-test-path-list.json - echo "::endgroup::" + # Always run build manifest script to get the latest value + - run: | + node ./test/build-turbopack-tests-manifest.js + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }} - name: 'Upload results to "Are We Turbo Yet" KV' env: diff --git a/Cargo.lock b/Cargo.lock index 802aecf8597c6..6258cbe4f8e0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "serde", "smallvec", @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "serde", @@ -7373,7 +7373,7 @@ dependencies = [ [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-trait", @@ -7405,7 +7405,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "cargo-lock", @@ -7417,7 +7417,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "bytes", @@ -7432,7 +7432,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "dotenvs", @@ -7446,7 +7446,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7463,7 +7463,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "auto-hash-map", @@ -7495,7 +7495,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "base16", "hex", @@ -7507,7 +7507,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7521,7 +7521,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "proc-macro2", "quote", @@ -7531,7 +7531,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "mimalloc", ] @@ -7539,7 +7539,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "auto-hash-map", @@ -7564,7 +7564,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-recursion", @@ -7597,7 +7597,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "auto-hash-map", "mdxjs", @@ -7619,10 +7619,9 @@ dependencies = [ "turbo-tasks-malloc", "turbo-tasks-memory", "turbopack", - "turbopack-build", + "turbopack-browser", "turbopack-cli-utils", "turbopack-core", - "turbopack-dev", "turbopack-ecmascript", "turbopack-ecmascript-hmr-protocol", "turbopack-ecmascript-plugins", @@ -7630,14 +7629,15 @@ dependencies = [ "turbopack-env", "turbopack-image", "turbopack-node", + "turbopack-nodejs", "turbopack-static", "turbopack-trace-utils", ] [[package]] -name = "turbopack-build" +name = "turbopack-browser" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7645,24 +7645,25 @@ dependencies = [ "serde", "serde_json", "serde_qs", - "sourcemap", "swc_core", "tracing", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", "turbo-tasks-hash", + "turbopack", "turbopack-core", "turbopack-css", "turbopack-ecmascript", "turbopack-ecmascript-runtime", + "turbopack-resolve", "urlencoding", ] [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "clap 4.4.2", @@ -7681,7 +7682,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-recursion", @@ -7712,7 +7713,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-trait", @@ -7737,36 +7738,10 @@ dependencies = [ "urlencoding", ] -[[package]] -name = "turbopack-dev" -version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" -dependencies = [ - "anyhow", - "indexmap 1.9.3", - "indoc", - "serde", - "serde_json", - "serde_qs", - "swc_core", - "tracing", - "turbo-tasks", - "turbo-tasks-build", - "turbo-tasks-fs", - "turbo-tasks-hash", - "turbopack", - "turbopack-core", - "turbopack-css", - "turbopack-ecmascript", - "turbopack-ecmascript-runtime", - "turbopack-resolve", - "urlencoding", -] - [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-compression", @@ -7803,7 +7778,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-trait", @@ -7835,12 +7810,13 @@ dependencies = [ "turbopack-resolve", "turbopack-swc-utils", "url", + "urlencoding", ] [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "serde", "serde_json", @@ -7851,7 +7827,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-trait", @@ -7876,7 +7852,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "indoc", @@ -7893,7 +7869,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7909,7 +7885,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "base64 0.21.4", @@ -7929,7 +7905,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "serde", @@ -7944,7 +7920,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "mdxjs", @@ -7959,7 +7935,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-stream", @@ -7994,10 +7970,34 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "turbopack-nodejs" +version = "0.1.0" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" +dependencies = [ + "anyhow", + "indexmap 1.9.3", + "indoc", + "serde", + "serde_json", + "serde_qs", + "sourcemap", + "tracing", + "turbo-tasks", + "turbo-tasks-build", + "turbo-tasks-fs", + "turbo-tasks-hash", + "turbopack-core", + "turbopack-css", + "turbopack-ecmascript", + "turbopack-ecmascript-runtime", + "urlencoding", +] + [[package]] name = "turbopack-resolve" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "async-recursion", @@ -8019,7 +8019,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "serde", @@ -8035,7 +8035,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "swc_core", "turbo-tasks", @@ -8046,7 +8046,7 @@ dependencies = [ [[package]] name = "turbopack-trace-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "crossbeam-channel", @@ -8062,7 +8062,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240307.1#703985d75d50dd187e1c9e1e4319fb7745269d8e" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240308.2#cf51c13e7be2ff4ab7f758e9cb3c8a6694c07009" dependencies = [ "anyhow", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index 3ad442f220a36..0304c7f978a5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,11 +37,11 @@ swc_core = { version = "0.90.17", features = [ testing = { version = "0.35.20" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240307.1" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240308.2" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240307.1" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240308.2" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240307.1" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240308.2" } # General Deps diff --git a/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx b/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx index b5efaca19276c..b73caa714bac4 100644 --- a/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx +++ b/docs/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx @@ -149,7 +149,7 @@ import { unstable_noStore as noStore } from 'next/cache' export default function Component() { noStore() // cookies(), headers(), and other dynamic functions - // will also opt into dynamic rendering, making + // will also opt into dynamic rendering, meaning // this env variable is evaluated at runtime const value = process.env.MY_VALUE // ... diff --git a/docs/02-app/01-building-your-application/11-upgrading/05-from-create-react-app.mdx b/docs/02-app/01-building-your-application/11-upgrading/05-from-create-react-app.mdx index 04656dc930e06..b5c407698f152 100644 --- a/docs/02-app/01-building-your-application/11-upgrading/05-from-create-react-app.mdx +++ b/docs/02-app/01-building-your-application/11-upgrading/05-from-create-react-app.mdx @@ -46,10 +46,7 @@ Depending on your needs, Next.js allows you to choose your data fetching strateg ## Migration Steps -Our goal with this migration is to get a working Next.js application as quickly as possible, so that -you can then adopt Next.js features incrementally. To begin with, we'll keep it as a purely -client-side application (SPA) without migrating your existing router. This helps minimize the -chances of encountering issues during the migration process and reduces merge conflicts. +Our goal with this migration is to get a working Next.js application as quickly as possible, so that you can then adopt Next.js features incrementally. To begin with, we'll keep it as a purely client-side application (SPA) without migrating your existing router. This helps minimize the chances of encountering issues during the migration process and reduces merge conflicts. ### Step 1: Install the Next.js Dependency @@ -61,8 +58,7 @@ npm install next@latest ### Step 2: Create the Next.js Configuration File -Create a `next.config.mjs` at the root of your project. This file will hold your -[Next.js configuration options](/docs/app/api-reference/next-config-js). +Create a `next.config.mjs` at the root of your project. This file will hold your [Next.js configuration options](/docs/app/api-reference/next-config-js). ```js filename="next.config.mjs" /** @type {import('next').NextConfig} */ @@ -74,8 +70,6 @@ const nextConfig = { export default nextConfig ``` -> **Good to know:** You can use either `.js` or `.mjs` for your Next.js configuration file. - ### Step 3: Update TypeScript Configuration If you're using TypeScript, you need to update your `tsconfig.json` file with the following changes to make it compatible with Next.js: @@ -116,16 +110,11 @@ If you're using TypeScript, you need to update your `tsconfig.json` file with th } ``` -You can find more information about configuring TypeScript on the -[Next.js docs](/docs/app/building-your-application/configuring/typescript#typescript-plugin). +You can find more information about configuring TypeScript on the [Next.js docs](/docs/app/building-your-application/configuring/typescript#typescript-plugin). ### Step 4: Create the Root Layout -A Next.js [App Router](/docs/app) application must include a -[root layout](/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required) -file, which is a [React Server Component](/docs/app/building-your-application/rendering/server-components) -that will wrap all pages in your application. This file is defined at the top level of the `app` -directory. +A Next.js [App Router](/docs/app) application must include a [root layout](/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required) file, which is a [React Server Component](/docs/app/building-your-application/rendering/server-components) that will wrap all pages in your application. This file is defined at the top level of the `app` directory. The closest equivalent to the root layout file in a CRA application is the `index.html` file, which contains your ``, ``, and `` tags. @@ -152,8 +141,7 @@ export default function RootLayout({ children }) { > **Good to know**: `.js`, `.jsx`, or `.tsx` extensions can be used for Layout files. -3. Copy the content of your `index.html` file into the previously created `` component while - replacing the `body.div#root` and `body.script` tags with `
{children}
`: +Copy the content of your `index.html` file into the previously created `` component while replacing the `body.div#root` and `body.script` tags with `
{children}
`: ```tsx filename="app/layout.tsx" switcher export default function RootLayout({ @@ -199,10 +187,9 @@ export default function RootLayout({ children }) { > **Good to know**: We'll ignore the [manifest file](/docs/app/api-reference/file-conventions/metadata), additional iconography other than the favicon, and [testing configuration](/docs/app/building-your-application/testing), but if these are requirements, Next.js also supports these options. -4. Next.js already includes by default the - [meta charset](https://developer.mozilla.org/docs/Web/HTML/Element/meta#charset) and - [meta viewport](https://developer.mozilla.org/docs/Web/HTML/Viewport_meta_tag) tags, so you - can safely remove those from your ``: +### Step 5: Metadata + +Next.js already includes by default the [meta charset](https://developer.mozilla.org/docs/Web/HTML/Element/meta#charset) and [meta viewport](https://developer.mozilla.org/docs/Web/HTML/Viewport_meta_tag) tags, so you can safely remove those from your ``: ```tsx filename="app/layout.tsx" switcher export default function RootLayout({ @@ -242,12 +229,7 @@ export default function RootLayout({ children }) { } ``` -5. Any [metadata files](/docs/app/building-your-application/optimizing/metadata#file-based-metadata) - such as `favicon.ico`, `icon.png`, `robots.txt` are automatically added to the application - `` tag as long as you have them placed into the top level of the `app` directory. After - moving - [all supported files](/docs/app/building-your-application/optimizing/metadata#file-based-metadata) - into the `app` directory you can safely delete their `` tags: +Any [metadata files](/docs/app/building-your-application/optimizing/metadata#file-based-metadata) such as `favicon.ico`, `icon.png`, `robots.txt` are automatically added to the application `` tag as long as you have them placed into the top level of the `app` directory. After moving [all supported files](/docs/app/building-your-application/optimizing/metadata#file-based-metadata) into the `app` directory you can safely delete their `` tags: ```tsx filename="app/layout.tsx" switcher export default function RootLayout({ @@ -285,10 +267,7 @@ export default function RootLayout({ children }) { } ``` -6. Finally, Next.js can manage your last `` tags with the - [Metadata API](/docs/app/building-your-application/optimizing/metadata). Move your final metadata - info into an exported - [`metadata` object](/docs/app/api-reference/functions/generate-metadata#metadata-object): +Finally, Next.js can manage your last `` tags with the [Metadata API](/docs/app/building-your-application/optimizing/metadata). Move your final metadata info into an exported [`metadata` object](/docs/app/api-reference/functions/generate-metadata#metadata-object): ```tsx filename="app/layout.tsx" switcher import type { Metadata } from 'next' @@ -330,34 +309,51 @@ export default function RootLayout({ children }) { } ``` -With the above changes, you shifted from declaring everything in your `index.html` to using Next.js' -convention-based approach built into the framework -([Metadata API](/docs/app/building-your-application/optimizing/metadata)). This approach enables you -to more easily improve your SEO and web shareability of your pages. +With the above changes, you shifted from declaring everything in your `index.html` to using Next.js' convention-based approach built into the framework ([Metadata API](/docs/app/building-your-application/optimizing/metadata)). This approach enables you to more easily improve your SEO and web shareability of your pages. + +### Step 6: Styles + +Like Create React App, Next.js has built-in support for [CSS Modules](/docs/app/building-your-application/styling/css-modules). + +If you're using a global CSS file, import it into your `app/layout.tsx` file: + +```tsx filename="app/layout.tsx" switcher +import '../index.css' + +// ... +``` + +If you're using Tailwind, you'll need to install `postcss` and `autoprefixer`: + +```bash filename="Terminal" +npm install postcss autoprefixer +``` + +Then, create a `postcss.config.js` file at the root of your project: -### Step 5: Create the Entrypoint Page +```js filename="postcss.config.js" +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} +``` -On Next.js you declare an entrypoint for your application by creating a `page.tsx` file. The -closest equivalent of this file on CRA is your `src/index.tsx` file. In this step, you’ll set up the -entrypoint of your application. +### Step 7: Create the Entrypoint Page -1. **Create a `[[...slug]]` directory in your `app` directory.** +On Next.js you declare an entrypoint for your application by creating a `page.tsx` file. The closest equivalent of this file on CRA is your `src/index.tsx` file. In this step, you’ll set up the entry point of your application. -Since this guide is aiming to first set up our Next.js as an SPA (Single Page Application), -you need your page entrypoint to catch all possible routes of your application. For that, create a -new `[[...slug]]` directory in your `app` directory. +**Create a `[[...slug]]` directory in your `app` directory.** -This directory is what is called an -[optional catch-all route segment](/docs/app/building-your-application/routing/dynamic-routes#optional-catch-all-segments). -Next.js uses a file-system based router where -[directories are used to define routes](/docs/app/building-your-application/routing/defining-routes#creating-routes). -This special directory will make sure that all routes of your application will be directed to its -containing `page.tsx` file. +Since this guide is aiming to first set up our Next.js as an SPA (Single Page Application), you need your page entry point to catch all possible routes of your application. For that, create a new `[[...slug]]` directory in your `app` directory. -2. **Create a new `page.tsx` file inside the `app/[[...slug]]` directory with the following content:** +This directory is what is called an [optional catch-all route segment](/docs/app/building-your-application/routing/dynamic-routes#optional-catch-all-segments). Next.js uses a file-system based router where [directories are used to define routes](/docs/app/building-your-application/routing/defining-routes#creating-routes). This special directory will make sure that all routes of your application will be directed to its containing `page.tsx` file. + +**Create a new `page.tsx` file inside the `app/[[...slug]]` directory with the following content:** ```tsx filename="app/[[...slug]]/page.tsx" switcher -import '../../src/index.css' +import '../../index.css' export function generateStaticParams() { return [{ slug: [''] }] @@ -369,7 +365,7 @@ export default function Page() { ``` ```jsx filename="app/[[...slug]]/page.js" switcher -import '../../src/index.css' +import '../../index.css' export function generateStaticParams() { return [{ slug: [''] }] @@ -380,8 +376,6 @@ export default function Page() { } ``` -> **Good to know**: `.js`, `.jsx`, or `.tsx` extensions can be used for Page files. - This file is a [Server Component](/docs/app/building-your-application/rendering/server-components). When you run `next build`, the file is prerendered into a static asset. It does _not_ require any dynamic code. This file imports our global CSS and tells [`generateStaticParams`](/docs/app/api-reference/functions/generate-static-params) we are only going to generate one route, the index route at `/`. @@ -394,7 +388,7 @@ Now, let's move the rest of our CRA application which will run client-only. import React from 'react' import dynamic from 'next/dynamic' -const App = dynamic(() => import('../../src/App'), { ssr: false }) +const App = dynamic(() => import('../../App'), { ssr: false }) export function ClientOnly() { return @@ -407,15 +401,14 @@ export function ClientOnly() { import React from 'react' import dynamic from 'next/dynamic' -const App = dynamic(() => import('../../src/App'), { ssr: false }) +const App = dynamic(() => import('../../App'), { ssr: false }) export function ClientOnly() { return } ``` -This file is a [Client Component](/docs/app/building-your-application/rendering/client-components), defined by the `'use client'` -directive. Client Components are still [prerendered to HTML](/docs/app/building-your-application/rendering/client-components#how-are-client-components-rendered) on the server before being sent to the client. +This file is a [Client Component](/docs/app/building-your-application/rendering/client-components), defined by the `'use client'` directive. Client Components are still [prerendered to HTML](/docs/app/building-your-application/rendering/client-components#how-are-client-components-rendered) on the server before being sent to the client. Since we want a client-only application to start, we can configure Next.js to disable prerendering from the `App` component down. @@ -426,7 +419,7 @@ const App = dynamic(() => import('../../App'), { ssr: false }) Now, update your entrypoint page to use the new component: ```tsx filename="app/[[...slug]]/page.tsx" switcher -import '../../src/index.css' +import '../../index.css' import { ClientOnly } from './client' export function generateStaticParams() { @@ -439,7 +432,7 @@ export default function Page() { ``` ```jsx filename="app/[[...slug]]/page.js" switcher -import '../../src/index.css' +import '../../index.css' import { ClientOnly } from './client' export function generateStaticParams() { @@ -451,10 +444,9 @@ export default function Page() { } ``` -### Step 6: Update Static Image Imports +### Step 8: Update Static Image Imports -Next.js handles static image imports slightly different from CRA. With CRA, importing an image -file will return its public URL as a string: +Next.js handles static image imports slightly different from CRA. With CRA, importing an image file will return its public URL as a string: ```tsx filename="App.tsx" import image from './img.png' @@ -464,22 +456,13 @@ export default function App() { } ``` -With Next.js, static image imports return an object. The object can then be used directly with the -Next.js [`` component](/docs/app/api-reference/components/image), or you can use the object's -`src` property with your existing `` tag. +With Next.js, static image imports return an object. The object can then be used directly with the Next.js [`` component](/docs/app/api-reference/components/image), or you can use the object's `src` property with your existing `` tag. -The `` component has the added benefits of -[automatic image optimization](/docs/app/building-your-application/optimizing/images). The `` -component automatically sets the `width` and `height` attributes of the resulting `` based on -the image's dimensions. This prevents layout shifts when the image loads. However, this can cause -issues if your app contains images with only one of their dimensions being styled without the other -styled to `auto`. When not styled to `auto`, the dimension will default to the `` dimension -attribute's value, which can cause the image to appear distorted. +The `` component has the added benefits of [automatic image optimization](/docs/app/building-your-application/optimizing/images). The `` component automatically sets the `width` and `height` attributes of the resulting `` based on the image's dimensions. This prevents layout shifts when the image loads. However, this can cause issues if your app contains images with only one of their dimensions being styled without the other styled to `auto`. When not styled to `auto`, the dimension will default to the `` dimension attribute's value, which can cause the image to appear distorted. -Keeping the `` tag will reduce the amount of changes in your application and prevent the above -issues. You can then optionally later migrate to the `` component to take advantage of optimizing images by [configuring a loader](/docs/app/building-your-application/optimizing/images#loaders), or moving to the default Next.js server which has automatic image optimization. +Keeping the `` tag will reduce the amount of changes in your application and prevent the above issues. You can then optionally later migrate to the `` component to take advantage of optimizing images by [configuring a loader](/docs/app/building-your-application/optimizing/images#loaders), or moving to the default Next.js server which has automatic image optimization. -1. **Convert absolute import paths for images imported from `/public` into relative imports:** +**Convert absolute import paths for images imported from `/public` into relative imports:** ```tsx // Before @@ -489,7 +472,7 @@ import logo from '/logo.png' import logo from '../public/logo.png' ``` -2. **Pass the image `src` property instead of the whole image object to your `` tag:** +**Pass the image `src` property instead of the whole image object to your `` tag:** ```tsx // Before @@ -501,23 +484,17 @@ import logo from '../public/logo.png' Alternatively, you can reference the public URL for the image asset based on the filename. For example, `public/logo.png` will serve the image at `/logo.png` for your application, which would be the `src` value. -> **Warning:** If you're using TypeScript, you might encounter type errors when accessing the `src` -> property. You can safely ignore those for now. They will be fixed by the end of this guide. +> **Warning:** If you're using TypeScript, you might encounter type errors when accessing the `src` property. You can safely ignore those for now. They will be fixed by the end of this guide. -### Step 7: Migrate the Environment Variables +### Step 9: Migrate the Environment Variables -Next.js has support for `.env` -[environment variables](/docs/app/building-your-application/configuring/environment-variables) -similar to CRA. +Next.js has support for `.env` [environment variables](/docs/app/building-your-application/configuring/environment-variables) similar to CRA. -The main difference is the prefix used to expose environment variables on the -client-side. Change all environment variables with the `REACT_APP_` prefix to `NEXT_PUBLIC_`. +The main difference is the prefix used to expose environment variables on the client-side. Change all environment variables with the `REACT_APP_` prefix to `NEXT_PUBLIC_`. -### Step 8: Update Scripts in `package.json` +### Step 10: Update Scripts in `package.json` -You should now be able to run your application to test if you successfully migrated to Next.js. But -before that, you need to update your `scripts` in your `package.json` with Next.js related commands, -and add `.next` and `next-env.d.ts` to your `.gitignore`: +You should now be able to run your application to test if you successfully migrated to Next.js. But before that, you need to update your `scripts` in your `package.json` with Next.js related commands, and add `.next`, `next-env.d.ts`, and `dist` to your `.gitignore` file: ```json filename="package.json" { @@ -538,9 +515,7 @@ dist Now run `npm run dev`, and open [`http://localhost:3000`](http://localhost:3000). You should see your application now running on Next.js. -> **Example:** Check out [this repository](https://github.com/vercel/cra-to-next) for a working example of a CRA application migrated to Next.js. - -### Step 9: Clean Up +### Step 11: Clean Up You can now clean up your codebase from Create React App related artifacts: @@ -559,10 +534,7 @@ Further, Next.js has support for [Turbopack](/docs/app/api-reference/next-config ## Next Steps -If everything went according to plan, you now have a functioning Next.js application running as a -single-page application. However, you aren't yet taking advantage of most of Next.js' benefits, but -you can now start making incremental changes to reap all the benefits. Here's what you might want to -do next: +If everything went according to plan, you now have a functioning Next.js application running as a single-page application. However, you aren't yet taking advantage of most of Next.js' benefits, but you can now start making incremental changes to reap all the benefits. Here's what you might want to do next: - Migrate from React Router to the [Next.js App Router](/docs/app/building-your-application/routing) to get: - Automatic code splitting diff --git a/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx b/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx index c3e3bb7d8d3f1..b15bc9e9316ae 100644 --- a/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx +++ b/docs/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx @@ -64,7 +64,7 @@ export const dynamic = 'auto' - **`'auto'`** (default): The default option to cache as much as possible without preventing any components from opting into dynamic behavior. - **`'force-dynamic'`**: Force [dynamic rendering](/docs/app/building-your-application/rendering/server-components#dynamic-rendering), which will result in routes being rendered for each user at request time. This option is equivalent to `getServerSideProps()` in the `pages` directory. -- **`'error'`**: Force static rendering and cache the data of a layout or page by causing an error if any components use [dynamic functions](/docs/app/building-your-application/rendering/server-components#server-rendering-strategies#dynamic-functions) or uncached data. This option is equivalent to: +- **`'error'`**: Force static rendering and cache the data of a layout or page by causing an error if any components use [dynamic functions](/docs/app/building-your-application/rendering/server-components#dynamic-functions) or uncached data. This option is equivalent to: - `getStaticProps()` in the `pages` directory. - Setting the option of every `fetch()` request in a layout or page to `{ cache: 'force-cache' }`. - Setting the segment config to `fetchCache = 'only-cache', dynamicParams = false`. diff --git a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx index 898d185c39a3d..ba4b4ed8b9b8f 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx @@ -6,11 +6,20 @@ description: Configure Next.js with Turbopack-specific options {/* The content of this doc is shared between the app and pages router. You can use the `Content` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} -> **Warning**: These features are experimental and will only work with `next --turbo`. +Turbopack can be customized to transform different files and change how modules are resolved. + +> **Good to know**: +> +> - These features are experimental and will only work with `next --turbo`. +> - Turbopack for Next.js does not require loaders nor loader configuration for built-in functionality. Turbopack has built-in support for css and compiling modern JavaScript, so there's no need for `css-loader`, `postcss-loader`, or `babel-loader` if you're using `@babel/preset-env`. ## webpack loaders -Currently, Turbopack supports a subset of webpack's loader API, allowing you to use some webpack loaders to transform code in Turbopack. +If you need loader support beyond what's built in, many webpack loaders already work with Turbopack. There are currently some limitations: + +- Only a core subset of the webpack loader API is implemented. Currently, there is enough coverage for some popular loaders, and we'll expand our API support in the future. +- Only loaders that return JavaScript code are supported. Loaders that transform files like stylesheets or images are not currently supported. +- Options passed to webpack loaders must be plain JavaScript primitives, objects, and arrays. For example, it's not possible to pass `require()`d plugin modules as option values. To configure loaders, add the names of the loaders you've installed and any options in `next.config.js`, mapping file extensions to a list of loaders: @@ -36,7 +45,7 @@ module.exports = { } ``` -Then, given the above configuration, you can use transformed code from your app: +Using the configuration above, you can use transformed code in your app: ```js import MyDoc from './my-doc.mdx' @@ -46,7 +55,58 @@ export default function Home() { } ``` -## Resolve Alias +> **Good to know**: Prior to Next.js version 13.4.4, `experimental.turbo.rules` was named `experimental.turbo.loaders` and only accepted file extensions like `.mdx` instead of `*.mdx`. + +### Supported loaders + +The following loaders have been tested to work with Turbopack's webpack loader implementation: + +- [`babel-loader`](https://www.npmjs.com/package/babel-loader) +- [`@mdx-js/loader`](https://www.npmjs.com/package/@mdx-js/loader) +- [`@svgr/webpack`](https://www.npmjs.com/package/@svgr/webpack) +- [`svg-inline-loader`](https://www.npmjs.com/package/svg-inline-loader) +- [`yaml-loader`](https://www.npmjs.com/package/yaml-loader) +- [`string-replace-loader`](https://www.npmjs.com/package/string-replace-loader) +- [`raw-loader`](https://www.npmjs.com/package/raw-loader) + +### Custom loaders + +If you need to pass something like the result of importing an external package as a loader option, it's possible to wrap the webpack loader with your own, specifying options there. **This is an interim solution and should not be necessary in the future.** + +This loader wraps `@mdx-js/loader` and configures the `rehypePrism` rehype plugin: + +```js filename="my-mdx-loader.js" +const mdxLoader = require('@mdx-js/loader') +const rehypePrism = require('@mapbox/rehype-prism') + +module.exports = function (code) { + const prevGetOptions = this.getOptions.bind(this) + this.getOptions = function getOptions(...args) { + return { + ...prevGetOptions(...args), + rehypePlugins: [rehypePrism], + } + } + + mdxLoader.call(this, code) +} +``` + +Then, configure Next.js to load the wrapper loader: + +```js filename="next.config.js" +module.exports = { + experimental: { + turbo: { + rules: { + '*.mdx': ['./my-mdx-loader'], + }, + }, + }, +} +``` + +## Resolve aliases Through `next.config.js`, Turbopack can be configured to modify module resolution through aliases, similar to webpack's [`resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias) configuration. @@ -69,11 +129,11 @@ This aliases imports of the `underscore` package to the `lodash` package. In oth Turbopack also supports conditional aliasing through this field, similar to Node.js's [conditional exports](https://nodejs.org/docs/latest-v18.x/api/packages.html#conditional-exports). At the moment only the `browser` condition is supported. In the case above, imports of the `mocha` module will be aliased to `mocha/browser-entry.js` when Turbopack targets browser environments. -## Resolve Extensions +## Resolve extensions Through `next.config.js`, Turbopack can be configured to resolve modules with custom extensions, similar to webpack's [`resolve.extensions`](https://webpack.js.org/configuration/resolve/#resolveextensions) configuration. -To configure resolve extension, use the `resolveExtensions` field in `next.config.js`: +To configure resolve extensions, use the `resolveExtensions` field in `next.config.js`: ```js filename="next.config.js" module.exports = { diff --git a/docs/04-architecture/turbopack.mdx b/docs/04-architecture/turbopack.mdx index d7a7795fac645..dd3e7c5b20f6e 100644 --- a/docs/04-architecture/turbopack.mdx +++ b/docs/04-architecture/turbopack.mdx @@ -20,10 +20,10 @@ Turbopack can be used in Next.js in both the `pages` and `app` directories for f } ``` -## Supported Features +## Supported features -To learn more about the currently supported features for Turbopack, view the [documentation](https://turbo.build/pack/docs/features). +Turbopack in Next.js requires zero-configuration for most users and can be extended for more advanced use cases. To learn more about the currently supported features for Turbopack, view the [API Reference](/docs/app/api-reference/next-config-js/turbo). -## Unsupported Features +## Unsupported features Turbopack currently only supports `next dev` and does not support `next build`. We are currently working on support for builds as we move closer towards stability. diff --git a/examples/reproduction-template-pages/.codesandbox/tasks.json b/examples/reproduction-template-pages/.codesandbox/tasks.json new file mode 100644 index 0000000000000..696ece15e8570 --- /dev/null +++ b/examples/reproduction-template-pages/.codesandbox/tasks.json @@ -0,0 +1,15 @@ +{ + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "pnpm install" + } + ], + "tasks": { + "dev": { + "name": "dev", + "command": "pnpm dev", + "runAtStart": true + } + } +} diff --git a/examples/reproduction-template/.codesandbox/tasks.json b/examples/reproduction-template/.codesandbox/tasks.json new file mode 100644 index 0000000000000..696ece15e8570 --- /dev/null +++ b/examples/reproduction-template/.codesandbox/tasks.json @@ -0,0 +1,15 @@ +{ + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "pnpm install" + } + ], + "tasks": { + "dev": { + "name": "dev", + "command": "pnpm dev", + "runAtStart": true + } + } +} diff --git a/lerna.json b/lerna.json index f757891ac2035..2d18cad70b41f 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "14.2.0-canary.8" + "version": "14.2.0-canary.10" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 9c62a57afab8e..c07369b4fd1ff 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "keywords": [ "react", "next", diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index 70f9ba76f3570..0209e4d64967f 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config", "dependencies": { - "@next/eslint-plugin-next": "14.2.0-canary.8", + "@next/eslint-plugin-next": "14.2.0-canary.10", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.1", "eslint-import-resolver-node": "^0.3.6", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index b435365ce11e4..e49af766b5f8f 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "license": "MIT", diff --git a/packages/font/package.json b/packages/font/package.json index 63c8535bdca72..323409bc14eb7 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,6 +1,6 @@ { "name": "@next/font", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 5cb468d78cdd2..3ba7af3056bae 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 2ffa5326edcf2..9fe675d8edfe6 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index fd0f3062cd7a0..57751a10f5472 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 0e637882f402e..0cce0ee27a966 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 158710212a9fc..f607f8a3a8688 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 8746cf6bea1a8..bea17e0c4edd3 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 891eee05406cc..95651cf8f2222 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-swc/crates/next-api/Cargo.toml b/packages/next-swc/crates/next-api/Cargo.toml index f23723339bf98..ef362476f0da4 100644 --- a/packages/next-swc/crates/next-api/Cargo.toml +++ b/packages/next-swc/crates/next-api/Cargo.toml @@ -28,9 +28,9 @@ turbopack-binding = { workspace = true, features = [ "__turbo_tasks_env", "__turbo_tasks_fs", "__turbopack", - "__turbopack_build", + "__turbopack_nodejs", "__turbopack_core", - "__turbopack_dev", + "__turbopack_browser", "__turbopack_env", "__turbopack_cli_utils", "__turbopack_node", diff --git a/packages/next-swc/crates/next-api/src/app.rs b/packages/next-swc/crates/next-api/src/app.rs index 1eb73fae9603d..9b0be3ff869c1 100644 --- a/packages/next-swc/crates/next-api/src/app.rs +++ b/packages/next-swc/crates/next-api/src/app.rs @@ -11,7 +11,7 @@ use next_core::{ get_edge_resolve_options_context, next_app::{ app_client_references_chunks::get_app_server_reference_modules, - get_app_client_references_chunks, get_app_client_shared_chunks, get_app_page_entry, + get_app_client_references_chunks, get_app_client_shared_chunk_group, get_app_page_entry, get_app_route_entry, metadata::route::get_app_metadata_route_entry, AppEntry, AppPage, }, next_client::{ @@ -41,7 +41,6 @@ use turbopack_binding::{ tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPath}, }, turbopack::{ - build::EntryChunkGroupResult, core::{ asset::{Asset, AssetContent}, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets}, @@ -50,9 +49,12 @@ use turbopack_binding::{ output::{OutputAsset, OutputAssets}, virtual_output::VirtualOutputAsset, }, + nodejs::EntryChunkGroupResult, turbopack::{ - module_options::ModuleOptionsContext, resolve_options_context::ResolveOptionsContext, - transition::ContextTransition, ModuleAssetContext, + module_options::ModuleOptionsContext, + resolve_options_context::ResolveOptionsContext, + transition::{ContextTransition, FullContextTransition}, + ModuleAssetContext, }, }, }; @@ -156,13 +158,9 @@ impl AppProject { } #[turbo_tasks::function] - fn client_transition(self: Vc) -> Vc { - ContextTransition::new( - self.project().client_compile_time_info(), - self.client_module_options_context(), - self.client_resolve_options_context(), - Vc::cell("app-client".to_string()), - ) + async fn client_transition(self: Vc) -> Result> { + let module_context = self.client_module_context(); + Ok(FullContextTransition::new(module_context)) } #[turbo_tasks::function] @@ -204,13 +202,15 @@ impl AppProject { ( ECMASCRIPT_CLIENT_TRANSITION_NAME.to_string(), Vc::upcast(NextEcmascriptClientReferenceTransition::new( - self.client_transition(), + Vc::upcast(self.client_transition()), self.ssr_transition(), )), ), ( "next-dynamic".to_string(), - Vc::upcast(NextDynamicTransition::new(self.client_transition())), + Vc::upcast(NextDynamicTransition::new(Vc::upcast( + self.client_transition(), + ))), ), ("next-ssr".to_string(), Vc::upcast(self.ssr_transition())), ] @@ -231,13 +231,15 @@ impl AppProject { ( ECMASCRIPT_CLIENT_TRANSITION_NAME.to_string(), Vc::upcast(NextEcmascriptClientReferenceTransition::new( - self.client_transition(), + Vc::upcast(self.client_transition()), self.edge_ssr_transition(), )), ), ( "next-dynamic".to_string(), - Vc::upcast(NextDynamicTransition::new(self.client_transition())), + Vc::upcast(NextDynamicTransition::new(Vc::upcast( + self.client_transition(), + ))), ), ( "next-ssr".to_string(), @@ -579,17 +581,18 @@ impl AppEndpoint { // .await?; let app_server_reference_modules = if process_client { - let client_shared_chunks = get_app_client_shared_chunks( + let client_shared_chunk_group = get_app_client_shared_chunk_group( app_entry .rsc_entry .ident() .with_modifier(Vc::cell("client_shared_chunks".to_string())), this.app_project.client_runtime_entries(), this.app_project.project().client_chunking_context(), - ); + ) + .await?; let mut client_shared_chunks_paths = vec![]; - for chunk in client_shared_chunks.await?.iter().copied() { + for chunk in client_shared_chunk_group.assets.await?.iter().copied() { client_assets.push(chunk); let chunk_path = chunk.ident().path().await?; @@ -599,6 +602,7 @@ impl AppEndpoint { } } } + let client_shared_availability_info = client_shared_chunk_group.availability_info; let client_reference_graph = ClientReferenceGraph::new(Vc::cell(vec![rsc_entry_asset])); let client_reference_types = client_reference_graph.types(); @@ -618,6 +622,7 @@ impl AppEndpoint { let client_references_chunks = get_app_client_references_chunks( client_references, this.app_project.project().client_chunking_context(), + Value::new(client_shared_availability_info), ssr_chunking_context, ); let client_references_chunks_ref = client_references_chunks.await?; diff --git a/packages/next-swc/crates/next-api/src/dynamic_imports.rs b/packages/next-swc/crates/next-api/src/dynamic_imports.rs index f54e2dd82871b..dfc3a987412dc 100644 --- a/packages/next-swc/crates/next-api/src/dynamic_imports.rs +++ b/packages/next-swc/crates/next-api/src/dynamic_imports.rs @@ -12,7 +12,6 @@ use turbopack_binding::{ visit::{Visit, VisitWith}, }, turbopack::{ - build::BuildChunkingContext, core::{ chunk::{ availability_info::AvailabilityInfo, ChunkableModule, ChunkingContextExt, @@ -31,6 +30,7 @@ use turbopack_binding::{ resolve::esm_resolve, EcmascriptModuleAsset, }, + nodejs::NodeJsChunkingContext, }, }; @@ -79,7 +79,7 @@ where } pub(crate) async fn collect_chunk_group( - chunking_context: Vc, + chunking_context: Vc, dynamic_import_entries: IndexMap>, DynamicImportedModules>, availability_info: Value, ) -> Result> { diff --git a/packages/next-swc/crates/next-api/src/instrumentation.rs b/packages/next-swc/crates/next-api/src/instrumentation.rs index fcdf7e176f5f0..f3cfba2c94a7b 100644 --- a/packages/next-swc/crates/next-api/src/instrumentation.rs +++ b/packages/next-swc/crates/next-api/src/instrumentation.rs @@ -10,7 +10,6 @@ use turbo_tasks::{Completion, Value, Vc}; use turbopack_binding::{ turbo::tasks_fs::{File, FileContent}, turbopack::{ - build::EntryChunkGroupResult, core::{ asset::AssetContent, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt}, @@ -22,6 +21,7 @@ use turbopack_binding::{ virtual_output::VirtualOutputAsset, }, ecmascript::chunk::EcmascriptChunkPlaceable, + nodejs::EntryChunkGroupResult, }, }; diff --git a/packages/next-swc/crates/next-api/src/lib.rs b/packages/next-swc/crates/next-api/src/lib.rs index 733d692921776..f5431f3619ab7 100644 --- a/packages/next-swc/crates/next-api/src/lib.rs +++ b/packages/next-swc/crates/next-api/src/lib.rs @@ -19,6 +19,6 @@ shadow_rs::shadow!(build); pub fn register() { next_core::register(); - turbopack_binding::turbopack::build::register(); + turbopack_binding::turbopack::nodejs::register(); include!(concat!(env!("OUT_DIR"), "/register.rs")); } diff --git a/packages/next-swc/crates/next-api/src/pages.rs b/packages/next-swc/crates/next-api/src/pages.rs index bc07c9369e0fc..b9bcf89d5baa1 100644 --- a/packages/next-swc/crates/next-api/src/pages.rs +++ b/packages/next-swc/crates/next-api/src/pages.rs @@ -36,7 +36,6 @@ use turbopack_binding::{ File, FileContent, FileSystem, FileSystemPath, FileSystemPathOption, VirtualFileSystem, }, turbopack::{ - build::{BuildChunkingContext, EntryChunkGroupResult}, core::{ asset::AssetContent, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets}, @@ -57,6 +56,7 @@ use turbopack_binding::{ resolve::esm_resolve, EcmascriptModuleAsset, }, + nodejs::{EntryChunkGroupResult, NodeJsChunkingContext}, turbopack::{ module_options::ModuleOptionsContext, resolve_options_context::ResolveOptionsContext, @@ -265,7 +265,9 @@ impl PagesProject { Vc::cell( [( "next-dynamic".to_string(), - Vc::upcast(NextDynamicTransition::new(self.client_transition())), + Vc::upcast(NextDynamicTransition::new(Vc::upcast( + self.client_transition(), + ))), )] .into_iter() .collect(), @@ -658,7 +660,7 @@ impl PageEndpoint { project_root: Vc, module_context: Vc, edge_module_context: Vc, - chunking_context: Vc, + chunking_context: Vc, edge_chunking_context: Vc>, runtime_entries: Vc, edge_runtime_entries: Vc, diff --git a/packages/next-swc/crates/next-api/src/project.rs b/packages/next-swc/crates/next-api/src/project.rs index b1ef555112185..1f4aa206e7993 100644 --- a/packages/next-swc/crates/next-api/src/project.rs +++ b/packages/next-swc/crates/next-api/src/project.rs @@ -33,7 +33,7 @@ use turbopack_binding::{ tasks_fs::{DiskFileSystem, FileSystem, FileSystemPath, VirtualFileSystem}, }, turbopack::{ - build::BuildChunkingContext, + browser::BrowserChunkingContext, core::{ changed::content_changed, compile_time_info::CompileTimeInfo, @@ -48,9 +48,9 @@ use turbopack_binding::{ version::{Update, Version, VersionState, VersionedContent}, PROJECT_FILESYSTEM_NAME, }, - dev::DevChunkingContext, ecmascript::chunk::EcmascriptChunkingContext, node::execution_context::ExecutionContext, + nodejs::NodeJsChunkingContext, turbopack::{evaluate_context::node_build_environment, ModuleAssetContext}, }, }; @@ -497,7 +497,7 @@ impl Project { let node_root = self.node_root(); let node_execution_chunking_context = Vc::upcast( - DevChunkingContext::builder( + BrowserChunkingContext::builder( self.project_path(), node_root, node_root, @@ -555,25 +555,31 @@ impl Project { } #[turbo_tasks::function] - pub(super) fn server_chunking_context(self: Vc) -> Vc { - get_server_chunking_context( + pub(super) async fn server_chunking_context( + self: Vc, + ) -> Result> { + Ok(get_server_chunking_context( + self.next_mode(), self.project_path(), self.node_root(), self.client_relative_path(), self.next_config().computed_asset_prefix(), self.server_compile_time_info().environment(), - ) + )) } #[turbo_tasks::function] - pub(super) fn edge_chunking_context(self: Vc) -> Vc> { - get_edge_chunking_context( + pub(super) fn edge_chunking_context( + self: Vc, + ) -> Result>> { + Ok(get_edge_chunking_context( + self.next_mode(), self.project_path(), self.node_root(), self.client_relative_path(), self.next_config().computed_asset_prefix(), self.edge_compile_time_info().environment(), - ) + )) } /// Emit a telemetry event corresponding to [webpack configuration telemetry](https://github.com/vercel/next.js/blob/9da305fe320b89ee2f8c3cfb7ecbf48856368913/packages/next/src/build/webpack-config.ts#L2516) diff --git a/packages/next-swc/crates/next-build/Cargo.toml b/packages/next-swc/crates/next-build/Cargo.toml index ff79ef62ecb68..2079887132035 100644 --- a/packages/next-swc/crates/next-build/Cargo.toml +++ b/packages/next-swc/crates/next-build/Cargo.toml @@ -27,9 +27,9 @@ turbopack-binding = { workspace = true, features = [ "__turbo_tasks_fs", "__turbo_tasks_memory", "__turbopack", - "__turbopack_build", + "__turbopack_nodejs", "__turbopack_core", - "__turbopack_dev", + "__turbopack_browser", "__turbopack_ecmascript", "__turbopack_ecmascript_runtime", "__turbopack_env", diff --git a/packages/next-swc/crates/next-build/src/lib.rs b/packages/next-swc/crates/next-build/src/lib.rs index 017a0ca6f8adb..51d9b6636184d 100644 --- a/packages/next-swc/crates/next-build/src/lib.rs +++ b/packages/next-swc/crates/next-build/src/lib.rs @@ -11,8 +11,8 @@ pub fn register() { turbopack_binding::turbopack::turbopack::register(); turbopack_binding::turbopack::core::register(); turbopack_binding::turbopack::node::register(); - turbopack_binding::turbopack::dev::register(); - turbopack_binding::turbopack::build::register(); + turbopack_binding::turbopack::browser::register(); + turbopack_binding::turbopack::nodejs::register(); next_core::register(); include!(concat!(env!("OUT_DIR"), "/register.rs")); } diff --git a/packages/next-swc/crates/next-core/Cargo.toml b/packages/next-swc/crates/next-core/Cargo.toml index b5d8dd104a469..01b18ce8424da 100644 --- a/packages/next-swc/crates/next-core/Cargo.toml +++ b/packages/next-swc/crates/next-core/Cargo.toml @@ -44,9 +44,9 @@ turbopack-binding = { workspace = true, features = [ "__turbo_tasks_fs", "__turbo_tasks_hash", "__turbopack", - "__turbopack_build", + "__turbopack_nodejs", "__turbopack_core", - "__turbopack_dev", + "__turbopack_browser", "__turbopack_ecmascript", "__turbopack_ecmascript_plugin", "__turbopack_ecmascript_runtime", @@ -74,5 +74,5 @@ image-avif = ["turbopack-binding/__turbopack_image_avif"] # enable "HMR" for embedded assets dynamic_embed_contents = [ "turbopack-binding/__turbo_tasks_fs_dynamic_embed_contents", - "turbopack-binding/__turbopack_dev_dynamic_embed_contents", + "turbopack-binding/__turbopack_browser_dynamic_embed_contents", ] diff --git a/packages/next-swc/crates/next-core/src/lib.rs b/packages/next-swc/crates/next-core/src/lib.rs index 7024a97710ce9..4523802bbf91a 100644 --- a/packages/next-swc/crates/next-core/src/lib.rs +++ b/packages/next-swc/crates/next-core/src/lib.rs @@ -57,7 +57,7 @@ pub fn register() { turbo::tasks_bytes::register(); turbo::tasks_fs::register(); turbo::tasks_fetch::register(); - turbopack::dev::register(); + turbopack::browser::register(); turbopack::node::register(); turbopack::turbopack::register(); turbopack::image::register(); diff --git a/packages/next-swc/crates/next-core/src/mode.rs b/packages/next-swc/crates/next-core/src/mode.rs index f0d45a56d8def..f9130ce8a5740 100644 --- a/packages/next-swc/crates/next-core/src/mode.rs +++ b/packages/next-swc/crates/next-core/src/mode.rs @@ -40,4 +40,11 @@ impl NextMode { NextMode::Build => true, } } + + pub fn should_minify(&self) -> bool { + match self { + NextMode::Development => false, + NextMode::Build => true, + } + } } diff --git a/packages/next-swc/crates/next-core/src/next_app/app_client_references_chunks.rs b/packages/next-swc/crates/next-core/src/next_app/app_client_references_chunks.rs index 85623a80713fc..d00d0fc491dec 100644 --- a/packages/next-swc/crates/next-core/src/next_app/app_client_references_chunks.rs +++ b/packages/next-swc/crates/next-core/src/next_app/app_client_references_chunks.rs @@ -45,6 +45,7 @@ pub struct ClientReferencesChunks { pub async fn get_app_client_references_chunks( app_client_references: Vc, client_chunking_context: Vc>, + client_availability_info: Value, ssr_chunking_context: Option>>, ) -> Result> { async move { @@ -130,7 +131,7 @@ pub async fn get_app_client_references_chunks( list.extend(framework_reference_types); } - let mut current_client_availability_info = AvailabilityInfo::Root; + let mut current_client_availability_info = client_availability_info.into_value(); let mut current_client_chunks = OutputAssets::empty(); let mut current_ssr_availability_info = AvailabilityInfo::Root; let mut current_ssr_chunks = OutputAssets::empty(); diff --git a/packages/next-swc/crates/next-core/src/next_app/app_client_shared_chunks.rs b/packages/next-swc/crates/next-core/src/next_app/app_client_shared_chunks.rs index 4dbccf7f057a7..5426e218528d7 100644 --- a/packages/next-swc/crates/next-core/src/next_app/app_client_shared_chunks.rs +++ b/packages/next-swc/crates/next-core/src/next_app/app_client_shared_chunks.rs @@ -2,7 +2,10 @@ use anyhow::Result; use turbo_tasks::{Value, Vc}; use turbopack_binding::turbopack::{ core::{ - chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets}, + chunk::{ + availability_info::AvailabilityInfo, ChunkGroupResult, ChunkingContext, + EvaluatableAssets, + }, ident::AssetIdent, output::OutputAssets, }, @@ -10,20 +13,24 @@ use turbopack_binding::turbopack::{ }; #[turbo_tasks::function] -pub async fn get_app_client_shared_chunks( +pub async fn get_app_client_shared_chunk_group( ident: Vc, app_client_runtime_entries: Vc, client_chunking_context: Vc>, -) -> Result> { +) -> Result> { if app_client_runtime_entries.await?.is_empty() { - return Ok(OutputAssets::empty()); + return Ok(ChunkGroupResult { + assets: OutputAssets::empty(), + availability_info: AvailabilityInfo::Root, + } + .cell()); } - let app_client_shared_chunks = client_chunking_context.evaluated_chunk_group_assets( + let app_client_shared_chunk_grou = client_chunking_context.evaluated_chunk_group( ident, app_client_runtime_entries, Value::new(AvailabilityInfo::Root), ); - Ok(app_client_shared_chunks) + Ok(app_client_shared_chunk_grou) } diff --git a/packages/next-swc/crates/next-core/src/next_app/mod.rs b/packages/next-swc/crates/next-core/src/next_app/mod.rs index 99d53825cd36a..9ee6dced2d91e 100644 --- a/packages/next-swc/crates/next-core/src/next_app/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_app/mod.rs @@ -18,7 +18,7 @@ use turbo_tasks::{trace::TraceRawVcs, TaskInput}; pub use crate::next_app::{ app_client_references_chunks::{get_app_client_references_chunks, ClientReferencesChunks}, - app_client_shared_chunks::get_app_client_shared_chunks, + app_client_shared_chunks::get_app_client_shared_chunk_group, app_entry::AppEntry, app_page_entry::get_app_page_entry, app_route_entry::get_app_route_entry, diff --git a/packages/next-swc/crates/next-core/src/next_client/context.rs b/packages/next-swc/crates/next-core/src/next_client/context.rs index 5b83f5430f18a..25cc910a4c06f 100644 --- a/packages/next-swc/crates/next-core/src/next_client/context.rs +++ b/packages/next-swc/crates/next-core/src/next_client/context.rs @@ -7,7 +7,9 @@ use turbo_tasks_fs::FileSystem; use turbopack_binding::{ turbo::{tasks_env::EnvMap, tasks_fs::FileSystemPath}, turbopack::{ + browser::{react_refresh::assert_can_resolve_react_refresh, BrowserChunkingContext}, core::{ + chunk::MinifyType, compile_time_info::{ CompileTimeDefineValue, CompileTimeDefines, CompileTimeInfo, FreeVarReference, FreeVarReferences, @@ -16,7 +18,6 @@ use turbopack_binding::{ free_var_references, resolve::{parse::Request, pattern::Pattern}, }, - dev::{react_refresh::assert_can_resolve_react_refresh, DevChunkingContext}, ecmascript::{chunk::EcmascriptChunkingContext, TreeShakingMode}, node::{ execution_context::ExecutionContext, @@ -336,7 +337,8 @@ pub async fn get_client_chunking_context( environment: Vc, mode: Vc, ) -> Result>> { - let mut builder = DevChunkingContext::builder( + let next_mode = mode.await?; + let mut builder = BrowserChunkingContext::builder( project_path, client_root, client_root, @@ -345,9 +347,14 @@ pub async fn get_client_chunking_context( environment, ) .chunk_base_path(asset_prefix) + .minify_type(if next_mode.should_minify() { + MinifyType::Minify + } else { + MinifyType::NoMinify + }) .asset_base_path(asset_prefix); - if mode.await?.is_development() { + if next_mode.is_development() { builder = builder.hot_module_replacement(); } diff --git a/packages/next-swc/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs b/packages/next-swc/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs index c2c38ffa5e209..50015aec39396 100644 --- a/packages/next-swc/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs +++ b/packages/next-swc/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs @@ -18,7 +18,7 @@ use super::ecmascript_client_reference_proxy_module::EcmascriptClientReferencePr #[turbo_tasks::value(shared)] pub struct NextEcmascriptClientReferenceTransition { - client_transition: Vc, + client_transition: Vc>, ssr_transition: Vc, } @@ -26,7 +26,7 @@ pub struct NextEcmascriptClientReferenceTransition { impl NextEcmascriptClientReferenceTransition { #[turbo_tasks::function] pub fn new( - client_transition: Vc, + client_transition: Vc>, ssr_transition: Vc, ) -> Vc { NextEcmascriptClientReferenceTransition { diff --git a/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_transition.rs b/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_transition.rs index 6ff27e070812b..53792575ca3b6 100644 --- a/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_transition.rs +++ b/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_transition.rs @@ -2,10 +2,7 @@ use anyhow::Result; use turbo_tasks::{Value, Vc}; use turbopack_binding::turbopack::{ core::{context::ProcessResult, reference_type::ReferenceType, source::Source}, - turbopack::{ - transition::{ContextTransition, Transition}, - ModuleAssetContext, - }, + turbopack::{transition::Transition, ModuleAssetContext}, }; use super::NextDynamicEntryModule; @@ -15,13 +12,13 @@ use super::NextDynamicEntryModule; /// create the dynamic entry, and the dynamic manifest entry. #[turbo_tasks::value] pub struct NextDynamicTransition { - client_transition: Vc, + client_transition: Vc>, } #[turbo_tasks::value_impl] impl NextDynamicTransition { #[turbo_tasks::function] - pub fn new(client_transition: Vc) -> Vc { + pub fn new(client_transition: Vc>) -> Vc { NextDynamicTransition { client_transition }.cell() } } diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 32aa54387dce4..1c0d2d708f799 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -4,7 +4,9 @@ use turbo_tasks::{Value, Vc}; use turbopack_binding::{ turbo::{tasks_env::EnvMap, tasks_fs::FileSystemPath}, turbopack::{ + browser::BrowserChunkingContext, core::{ + chunk::MinifyType, compile_time_info::{ CompileTimeDefineValue, CompileTimeDefines, CompileTimeInfo, FreeVarReference, FreeVarReferences, @@ -12,7 +14,6 @@ use turbopack_binding::{ environment::{EdgeWorkerEnvironment, Environment, ExecutionEnvironment}, free_var_references, }, - dev::DevChunkingContext, ecmascript::chunk::EcmascriptChunkingContext, node::{debug::should_debug, execution_context::ExecutionContext}, turbopack::resolve_options_context::ResolveOptionsContext, @@ -148,16 +149,17 @@ pub async fn get_edge_resolve_options_context( } #[turbo_tasks::function] -pub fn get_edge_chunking_context( +pub async fn get_edge_chunking_context( + mode: Vc, project_path: Vc, node_root: Vc, client_root: Vc, asset_prefix: Vc>, environment: Vc, -) -> Vc> { +) -> Result>> { let output_root = node_root.join("server/edge".to_string()); - Vc::upcast( - DevChunkingContext::builder( + Ok(Vc::upcast( + BrowserChunkingContext::builder( project_path, output_root, client_root, @@ -167,6 +169,11 @@ pub fn get_edge_chunking_context( ) .asset_base_path(asset_prefix) .reference_chunk_source_maps(should_debug("edge")) + .minify_type(if mode.await?.should_minify() { + MinifyType::Minify + } else { + MinifyType::NoMinify + }) .build(), - ) + )) } diff --git a/packages/next-swc/crates/next-core/src/next_server/context.rs b/packages/next-swc/crates/next-core/src/next_server/context.rs index 45332b3546f6a..f2460100a0903 100644 --- a/packages/next-swc/crates/next-core/src/next_server/context.rs +++ b/packages/next-swc/crates/next-core/src/next_server/context.rs @@ -8,8 +8,8 @@ use turbopack_binding::{ tasks_fs::FileSystemPath, }, turbopack::{ - build::{BuildChunkingContext, MinifyType}, core::{ + chunk::MinifyType, compile_time_info::{ CompileTimeDefineValue, CompileTimeDefines, CompileTimeInfo, FreeVarReferences, }, @@ -22,6 +22,7 @@ use turbopack_binding::{ execution_context::ExecutionContext, transforms::postcss::{PostCssConfigLocation, PostCssTransformOptions}, }, + nodejs::NodeJsChunkingContext, turbopack::{ condition::ContextCondition, module_options::{ @@ -725,7 +726,8 @@ pub fn get_server_runtime_entries( } #[turbo_tasks::function] -pub fn get_server_chunking_context( +pub async fn get_server_chunking_context( + mode: Vc, project_path: Vc, node_root: Vc, // TODO(alexkirsz) Is this even necessary? Are assets not always on the client chunking context @@ -733,11 +735,11 @@ pub fn get_server_chunking_context( client_root: Vc, asset_prefix: Vc>, environment: Vc, -) -> Vc { +) -> Result> { // TODO(alexkirsz) This should return a trait that can be implemented by the // different server chunking contexts. OR the build chunking context should // support both production and development modes. - BuildChunkingContext::builder( + Ok(NodeJsChunkingContext::builder( project_path, node_root, client_root, @@ -746,6 +748,10 @@ pub fn get_server_chunking_context( environment, ) .asset_prefix(asset_prefix) - .minify_type(MinifyType::NoMinify) - .build() + .minify_type(if mode.await?.should_minify() { + MinifyType::Minify + } else { + MinifyType::NoMinify + }) + .build()) } diff --git a/packages/next-swc/crates/next-core/src/transform_options.rs b/packages/next-swc/crates/next-core/src/transform_options.rs index 6cb70ef82686b..7b3c8d01fd166 100644 --- a/packages/next-swc/crates/next-core/src/transform_options.rs +++ b/packages/next-swc/crates/next-core/src/transform_options.rs @@ -3,12 +3,12 @@ use turbo_tasks::Vc; use turbopack_binding::{ turbo::tasks_fs::{FileJsonContent, FileSystemPath}, turbopack::{ + browser::react_refresh::assert_can_resolve_react_refresh, core::{ file_source::FileSource, resolve::{find_context_file, node::node_cjs_resolve_options, FindContextFileResult}, source::Source, }, - dev::react_refresh::assert_can_resolve_react_refresh, ecmascript::typescript::resolve::{read_from_tsconfigs, read_tsconfigs, tsconfig}, turbopack::{ module_options::{ diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index 079f541374479..c522c6802ebd2 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "private": true, "scripts": { "clean": "node ../../scripts/rm.mjs native", diff --git a/packages/next/package.json b/packages/next/package.json index 58d924d55abad..a1e5e53f7a2ec 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -92,7 +92,7 @@ ] }, "dependencies": { - "@next/env": "14.2.0-canary.8", + "@next/env": "14.2.0-canary.10", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -145,10 +145,10 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/polyfill-module": "14.2.0-canary.8", - "@next/polyfill-nomodule": "14.2.0-canary.8", - "@next/react-refresh-utils": "14.2.0-canary.8", - "@next/swc": "14.2.0-canary.8", + "@next/polyfill-module": "14.2.0-canary.10", + "@next/polyfill-nomodule": "14.2.0-canary.10", + "@next/react-refresh-utils": "14.2.0-canary.10", + "@next/swc": "14.2.0-canary.10", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.41.2", "@taskr/clear": "1.1.0", @@ -192,7 +192,7 @@ "@types/ws": "8.2.0", "@vercel/ncc": "0.34.0", "@vercel/nft": "0.26.4", - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240307.1", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240308.2", "acorn": "8.5.0", "amphtml-validator": "1.0.35", "anser": "1.4.9", diff --git a/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts b/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts index 532440d0c74a5..ca0478b798dc0 100644 --- a/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts +++ b/packages/next/src/lib/metadata/resolvers/resolve-url.test.ts @@ -1,4 +1,4 @@ -import { resolveUrl } from './resolve-url' +import { resolveUrl, resolveAbsoluteUrlWithPathname } from './resolve-url' // required to be resolved as URL with resolveUrl() describe('metadata: resolveUrl', () => { @@ -42,3 +42,67 @@ describe('metadata: resolveUrl', () => { ) }) }) + +describe('resolveAbsoluteUrlWithPathname', () => { + describe('trailingSlash is false', () => { + const metadataBase = new URL('https://example.com/') + const opts = { + trailingSlash: false, + pathname: '/', + } + const resolver = (url: string | URL) => + resolveAbsoluteUrlWithPathname(url, metadataBase, opts) + it('should resolve absolute internal url', () => { + expect(resolver('https://example.com/foo')).toBe( + 'https://example.com/foo' + ) + }) + }) + + describe('trailingSlash is true', () => { + const metadataBase = new URL('https://example.com/') + const opts = { + trailingSlash: true, + pathname: '/', + } + const resolver = (url: string | URL) => + resolveAbsoluteUrlWithPathname(url, metadataBase, opts) + it('should add trailing slash to relative url', () => { + expect(resolver('/foo')).toBe('https://example.com/foo/') + }) + + it('should add trailing slash to absolute internal url', () => { + expect(resolver('https://example.com/foo')).toBe( + 'https://example.com/foo/' + ) + expect(resolver(new URL('https://example.com/foo'))).toBe( + 'https://example.com/foo/' + ) + }) + + it('should not add trailing slash to external url', () => { + expect(resolver('https://external.org/foo')).toBe( + 'https://external.org/foo' + ) + expect(resolver(new URL('https://external.org/foo'))).toBe( + 'https://external.org/foo' + ) + }) + + it('should not add trailing slash to absolute internal url with query', () => { + expect(resolver('https://example.com/foo?bar')).toBe( + 'https://example.com/foo?bar' + ) + expect(resolver(new URL('https://example.com/foo?bar'))).toBe( + 'https://example.com/foo?bar' + ) + }) + + it('should not add trailing slash to relative url with query', () => { + expect(resolver('/foo?bar')).toBe('https://example.com/foo?bar') + expect(resolver(new URL('/foo?bar', metadataBase))).toBe( + 'https://example.com/foo?bar' + ) + }) + }) +}) diff --git a/packages/next/src/lib/metadata/resolvers/resolve-url.ts b/packages/next/src/lib/metadata/resolvers/resolve-url.ts index 8ddc6aa85c36c..49c888a40edd7 100644 --- a/packages/next/src/lib/metadata/resolvers/resolve-url.ts +++ b/packages/next/src/lib/metadata/resolvers/resolve-url.ts @@ -82,21 +82,40 @@ function resolveAbsoluteUrlWithPathname( metadataBase: URL | null, { trailingSlash, pathname }: MetadataContext ): string { + // Resolve url with pathname that always starts with `/` url = resolveRelativeUrl(url, pathname) - // Get canonicalUrl without trailing slash - let canonicalUrl = '' + // Convert string url or URL instance to absolute url string, + // if there's case needs to be resolved with metadataBase + let resolvedUrl = '' const result = metadataBase ? resolveUrl(url, metadataBase) : url if (typeof result === 'string') { - canonicalUrl = result + resolvedUrl = result } else { - canonicalUrl = result.pathname === '/' ? result.origin : result.href + resolvedUrl = result.pathname === '/' ? result.origin : result.href } - // Add trailing slash if it's enabled - return trailingSlash && !canonicalUrl.endsWith('/') - ? `${canonicalUrl}/` - : canonicalUrl + // Add trailing slash if it's enabled for urls matches the condition + // - Not external, same origin with metadataBase + // - Doesn't have query + if (trailingSlash && !resolvedUrl.endsWith('/')) { + let isRelative = resolvedUrl.startsWith('/') + let isExternal = false + let hasQuery = resolvedUrl.includes('?') + if (!isRelative) { + try { + const parsedUrl = new URL(resolvedUrl) + isExternal = + metadataBase != null && parsedUrl.origin !== metadataBase.origin + } catch { + // If it's not a valid URL, treat it as external + isExternal = true + } + if (!isExternal && !hasQuery) return `${resolvedUrl}/` + } + } + + return resolvedUrl } export { diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index 200ad57350c09..e9135eb942a9d 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -688,7 +688,7 @@ const staticGenerationRequestHandlers = { case 'arrayBuffer': case 'formData': throw new DynamicServerError( - `Route couldn't be rendered statically because it accessed \`request.${prop}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error` + `Route ${target.nextUrl.pathname} couldn't be rendered statically because it accessed \`request.${prop}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error` ) case 'clone': return ( @@ -733,7 +733,7 @@ const staticGenerationNextUrlHandlers = { case 'toString': case 'origin': throw new DynamicServerError( - `Route couldn't be rendered statically because it accessed \`nextUrl.${prop}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error` + `Route ${target.pathname} couldn't be rendered statically because it accessed \`nextUrl.${prop}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error` ) case 'clone': return ( @@ -776,7 +776,7 @@ const requireStaticRequestHandlers = { case 'arrayBuffer': case 'formData': throw new StaticGenBailoutError( - `Route with \`dynamic = "error"\` couldn't be rendered statically because it accessed \`request.${prop}\`.` + `Route ${target.nextUrl.pathname} with \`dynamic = "error"\` couldn't be rendered statically because it accessed \`request.${prop}\`.` ) case 'clone': return ( @@ -821,7 +821,7 @@ const requireStaticNextUrlHandlers = { case 'toString': case 'origin': throw new StaticGenBailoutError( - `Route with \`dynamic = "error"\` couldn't be rendered statically because it accessed \`nextUrl.${prop}\`.` + `Route ${target.pathname} with \`dynamic = "error"\` couldn't be rendered statically because it accessed \`nextUrl.${prop}\`.` ) case 'clone': return ( diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 0afdcac35df49..b46f53392e76f 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index 16a30f229a335..73903b4450cdd 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "14.2.0-canary.8", + "version": "14.2.0-canary.10", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "14.2.0-canary.8", + "next": "14.2.0-canary.10", "outdent": "0.8.0", "prettier": "2.5.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5995c3b8e38f1..2303a990b181d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -538,7 +538,7 @@ importers: version: 1.2.2 tsec: specifier: 0.2.1 - version: 0.2.1(@bazel/bazelisk@1.19.0)(typescript@5.2.2) + version: 0.2.1(@bazel/bazelisk@1.18.0)(typescript@5.2.2) turbo: specifier: 1.12.2 version: 1.12.2 @@ -747,7 +747,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.3.3 @@ -809,7 +809,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../next-env '@swc/helpers': specifier: 0.5.5 @@ -930,16 +930,16 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/polyfill-module': - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../react-refresh-utils '@next/swc': - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1071,8 +1071,8 @@ importers: specifier: 0.26.4 version: 0.26.4 '@vercel/turbopack-ecmascript-runtime': - specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240307.1 - version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240307.1' + specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240308.2 + version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240308.2' acorn: specifier: 8.5.0 version: 8.5.0 @@ -1554,7 +1554,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 14.2.0-canary.8 + specifier: 14.2.0-canary.10 version: link:../next outdent: specifier: 0.8.0 @@ -1667,7 +1667,7 @@ packages: slash: 2.0.0 optionalDependencies: '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 - chokidar: 3.6.0 + chokidar: 3.5.3 dev: true /@babel/code-frame@7.12.11: @@ -1680,7 +1680,7 @@ packages: resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.23.4 + '@babel/highlight': 7.22.20 dev: true /@babel/code-frame@7.22.13: @@ -1842,24 +1842,6 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 - /@babel/helper-create-class-features-plugin@7.24.0(@babel/core@7.22.5): - resolution: {integrity: sha512-QAH+vfvts51BCsNZ2PhY6HAggnlS6omLLFTsIpeqZk/MmJ6cW7tgz5yRv0fMJThcr6FmbMrENh1RgrWPTYA76g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': 7.22.5 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-member-expression-to-functions': 7.23.0 - '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-replace-supers': 7.22.20(@babel/core@7.22.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - semver: 6.3.1 - dev: true - /@babel/helper-create-regexp-features-plugin@7.22.1(@babel/core@7.22.5): resolution: {integrity: sha512-WWjdnfR3LPIe+0EY8td7WmjhytxXtjKAEpnAxun/hkNiyOaPlvGK+NZaBFIdi9ndYV3Gav7BpFvtUwnaJlwi1w==} engines: {node: '>=6.9.0'} @@ -1963,20 +1945,6 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 - /@babel/helper-module-transforms@7.23.3(@babel/core@7.22.5): - resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': 7.22.5 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - dev: true - /@babel/helper-optimise-call-expression@7.18.6: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} @@ -2001,11 +1969,6 @@ packages: resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} - /@babel/helper-plugin-utils@7.24.0: - resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} - engines: {node: '>=6.9.0'} - dev: true - /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.22.5): resolution: {integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==} engines: {node: '>=6.9.0'} @@ -2087,11 +2050,6 @@ packages: resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.23.5: - resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} - engines: {node: '>=6.9.0'} - dev: true - /@babel/helper-wrap-function@7.22.20: resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} engines: {node: '>=6.9.0'} @@ -2118,15 +2076,6 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/highlight@7.23.4: - resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.22.20 - chalk: 2.4.2 - js-tokens: 4.0.0 - dev: true - /@babel/parser@7.22.5: resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==} engines: {node: '>=6.0.0'} @@ -2185,8 +2134,8 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.22.5): @@ -2210,7 +2159,7 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.5) dev: true @@ -2222,7 +2171,7 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.5) dev: true @@ -2246,7 +2195,7 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.5) dev: true @@ -2268,7 +2217,7 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.5) dev: true @@ -2318,8 +2267,8 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-proposal-private-property-in-object@7.16.7(@babel/core@7.22.5): @@ -2331,8 +2280,8 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.0(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.5) dev: true @@ -2804,8 +2753,8 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-module-transforms': 7.23.0(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 babel-plugin-dynamic-import-node: 2.3.3 dev: true @@ -3029,7 +2978,7 @@ packages: '@babel/core': 7.22.5 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-module-imports': 7.22.15 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.5) '@babel/types': 7.22.5 dev: true @@ -3350,8 +3299,8 @@ packages: '@babel/core': 7.22.5 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-option': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.15 '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.22.5) dev: true @@ -3439,8 +3388,8 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - /@bazel/bazelisk@1.19.0: - resolution: {integrity: sha512-8PyRGRj/CN286IFHVILgYZ2lQ/JvgQ25ZEgoUAkpSnGmbPdQnKyHtTGEG+Sf0AISFqP5+PPzN162DcizZ/bR9w==} + /@bazel/bazelisk@1.18.0: + resolution: {integrity: sha512-WqlTatsGKypeHYidqe3/6W8dkqkgJ13sMCEers/vH7dNwxojHrMQcuaH26sOnQG1eVn8UfHo78fy34yGAF3zsw==} hasBin: true dev: true @@ -4233,7 +4182,7 @@ packages: '@jest/types': 29.6.3 '@types/node': 20.2.5 ansi-escapes: 4.3.2 - chalk: 4.1.2 + chalk: 4.0.0 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 @@ -4564,7 +4513,7 @@ packages: '@types/istanbul-reports': 3.0.1 '@types/node': 20.2.5 '@types/yargs': 17.0.10 - chalk: 4.1.2 + chalk: 4.0.0 dev: true /@jridgewell/gen-mapping@0.3.1: @@ -8557,7 +8506,7 @@ packages: glob: 7.1.7 pkg-up: 3.1.0 reselect: 4.1.8 - resolve: 1.22.8 + resolve: 1.22.4 dev: true /babel-plugin-polyfill-corejs2@0.4.3(@babel/core@7.22.5): @@ -9348,23 +9297,6 @@ packages: optionalDependencies: fsevents: 2.3.3 - /chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} - requiresBuild: true - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - dev: true - optional: true - /chownr@1.1.3: resolution: {integrity: sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==} dev: true @@ -13894,7 +13826,7 @@ packages: '@sidvind/better-ajv-errors': 0.6.10(ajv@6.12.6) acorn-walk: 8.2.0 ajv: 6.12.6 - chalk: 4.1.2 + chalk: 4.0.0 deepmerge: 4.2.2 eslint: 7.24.0 espree: 7.3.1 @@ -15250,7 +15182,7 @@ packages: '@jest/core': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - chalk: 4.1.2 + chalk: 4.0.0 create-jest: 29.7.0(@types/node@20.2.5) exit: 0.1.2 import-local: 3.0.2 @@ -15319,7 +15251,7 @@ packages: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - chalk: 4.1.2 + chalk: 4.0.0 diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 @@ -15456,7 +15388,7 @@ packages: fb-watchman: 2.0.1 graceful-fs: 4.2.11 jest-regex-util: 29.4.3 - jest-util: 29.7.0 + jest-util: 29.5.0 jest-worker: 29.5.0 micromatch: 4.0.5 walker: 1.0.8 @@ -15852,7 +15784,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/node': 20.2.5 - chalk: 4.1.2 + chalk: 4.0.0 ci-info: 3.8.0 graceful-fs: 4.2.11 picomatch: 2.3.1 @@ -21904,15 +21836,6 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - /resolve@1.22.8: - resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true - dependencies: - is-core-module: 2.13.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - /resolve@2.0.0-next.4: resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} hasBin: true @@ -24010,14 +23933,14 @@ packages: strip-bom: 3.0.0 dev: true - /tsec@0.2.1(@bazel/bazelisk@1.19.0)(typescript@5.2.2): + /tsec@0.2.1(@bazel/bazelisk@1.18.0)(typescript@5.2.2): resolution: {integrity: sha512-RP9vhbRbRI9VH4CfOlQvo5W9HdfiPKq0gdiUOWI5oKmLaZKNFN8CsPwBfT5ySmhnKNwmmAS/BtY3WoTfABwwig==} hasBin: true peerDependencies: '@bazel/bazelisk': '>=1.7.5' typescript: '>=3.9.2' dependencies: - '@bazel/bazelisk': 1.19.0 + '@bazel/bazelisk': 1.18.0 glob: 7.1.7 minimatch: 3.1.2 typescript: 5.2.2 @@ -25569,8 +25492,8 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240307.1': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240307.1} + '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240308.2': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240308.2} name: '@vercel/turbopack-ecmascript-runtime' version: 0.0.0 dependencies: diff --git a/test/e2e/app-dir/dynamic-data/dynamic-data.test.ts b/test/e2e/app-dir/dynamic-data/dynamic-data.test.ts index acde3316b6fb0..fa65348b8a346 100644 --- a/test/e2e/app-dir/dynamic-data/dynamic-data.test.ts +++ b/test/e2e/app-dir/dynamic-data/dynamic-data.test.ts @@ -159,6 +159,17 @@ createNextDescribe( expect($('#searchparams .foo').text()).toBe('foosearch') }) + + if (!isNextDev) { + it('should track dynamic apis when rendering app routes', async () => { + expect(next.cliOutput).toContain( + `Caught Error: Dynamic server usage: Route /routes/url couldn't be rendered statically because it accessed \`request.url\`.` + ) + expect(next.cliOutput).toContain( + `Caught Error: Dynamic server usage: Route /routes/next-url couldn't be rendered statically because it accessed \`nextUrl.toString\`.` + ) + }) + } } ) @@ -227,6 +238,12 @@ createNextDescribe( expect(next.cliOutput).toMatch( 'Error: Route /search with `dynamic = "error"` couldn\'t be rendered statically because it used `searchParams`.' ) + expect(next.cliOutput).toMatch( + 'Error: Route /routes/form-data/error with `dynamic = "error"` couldn\'t be rendered statically because it accessed `request.formData`.' + ) + expect(next.cliOutput).toMatch( + 'Error: Route /routes/next-url/error with `dynamic = "error"` couldn\'t be rendered statically because it accessed `nextUrl.toString`.' + ) }) } } diff --git a/test/e2e/app-dir/dynamic-data/fixtures/main/app/routes/next-url/route.js b/test/e2e/app-dir/dynamic-data/fixtures/main/app/routes/next-url/route.js new file mode 100644 index 0000000000000..89ba3da787bef --- /dev/null +++ b/test/e2e/app-dir/dynamic-data/fixtures/main/app/routes/next-url/route.js @@ -0,0 +1,13 @@ +export const GET = async (request) => { + try { + const body = JSON.stringify({ pathname: request.nextUrl.toString() }) + return new Response(body, { + headers: { + 'content-type': 'application/json', + }, + }) + } catch (err) { + console.log('Caught Error:', err.message) + return new Response(null, { status: 500 }) + } +} diff --git a/test/e2e/app-dir/dynamic-data/fixtures/main/app/routes/url/route.js b/test/e2e/app-dir/dynamic-data/fixtures/main/app/routes/url/route.js new file mode 100644 index 0000000000000..3ab9d243ff76b --- /dev/null +++ b/test/e2e/app-dir/dynamic-data/fixtures/main/app/routes/url/route.js @@ -0,0 +1,13 @@ +export const GET = async (request) => { + try { + const body = JSON.stringify({ url: request.url }) + return new Response(body, { + headers: { + 'content-type': 'application/json', + }, + }) + } catch (err) { + console.log('Caught Error:', err.message) + return new Response(null, { status: 500 }) + } +} diff --git a/test/e2e/app-dir/dynamic-data/fixtures/require-static/app/routes/form-data/error/route.js b/test/e2e/app-dir/dynamic-data/fixtures/require-static/app/routes/form-data/error/route.js new file mode 100644 index 0000000000000..0093d00c49368 --- /dev/null +++ b/test/e2e/app-dir/dynamic-data/fixtures/require-static/app/routes/form-data/error/route.js @@ -0,0 +1,12 @@ +export const dynamic = 'error' + +export const GET = async (request) => { + return new Response( + JSON.stringify({ query: request.formData.get('query') }), + { + headers: { + 'content-type': 'application/json', + }, + } + ) +} diff --git a/test/e2e/app-dir/dynamic-data/fixtures/require-static/app/routes/next-url/error/route.js b/test/e2e/app-dir/dynamic-data/fixtures/require-static/app/routes/next-url/error/route.js new file mode 100644 index 0000000000000..e0f26af6f9048 --- /dev/null +++ b/test/e2e/app-dir/dynamic-data/fixtures/require-static/app/routes/next-url/error/route.js @@ -0,0 +1,12 @@ +export const dynamic = 'error' + +export const GET = async (request) => { + return new Response( + JSON.stringify({ pathname: request.nextUrl.toString() }), + { + headers: { + 'content-type': 'application/json', + }, + } + ) +} diff --git a/test/e2e/app-dir/scss/multi-global-reversed/multi-global-reversed.test.ts b/test/e2e/app-dir/scss/multi-global-reversed/multi-global-reversed.test.ts index 19fe992dd1768..980776d2c956b 100644 --- a/test/e2e/app-dir/scss/multi-global-reversed/multi-global-reversed.test.ts +++ b/test/e2e/app-dir/scss/multi-global-reversed/multi-global-reversed.test.ts @@ -3,7 +3,7 @@ import { nextTestSetup } from 'e2e-utils' import { colorToRgb } from 'next-test-utils' -describe('Multi Global Support (reversed)', () => { +describe('(SCSS) Multi Global Support (reversed)', () => { const { next } = nextTestSetup({ files: __dirname, dependencies: { diff --git a/test/e2e/app-dir/trailingslash/app/metadata/page.js b/test/e2e/app-dir/trailingslash/app/metadata/page.js new file mode 100644 index 0000000000000..5b86d09b10339 --- /dev/null +++ b/test/e2e/app-dir/trailingslash/app/metadata/page.js @@ -0,0 +1,14 @@ +export default function Page() { + return 'page' +} + +export const metadata = { + openGraph: { + // external url with different domain + url: 'http://trailingslash-another.com/metadata', + }, + alternates: { + // relative url with query string + canonical: '/metadata?query=string', + }, +} diff --git a/test/e2e/app-dir/trailingslash/trailingslash.test.ts b/test/e2e/app-dir/trailingslash/trailingslash.test.ts index 2d71308630f4e..b1731aa254589 100644 --- a/test/e2e/app-dir/trailingslash/trailingslash.test.ts +++ b/test/e2e/app-dir/trailingslash/trailingslash.test.ts @@ -48,5 +48,15 @@ createNextDescribe( .waitForElementByCss('#a-page') expect(await browser.waitForElementByCss('#a-page').text()).toBe('A page') }) + + it('should not add trailing slash to external url or relative url with query', async () => { + const $ = await next.render$('/metadata') + expect($('[rel="canonical"]').attr('href')).toBe( + 'http://trailingslash.com/metadata?query=string' + ) + expect($('[property="og:url"]').attr('content')).toBe( + 'http://trailingslash-another.com/metadata' + ) + }) } ) diff --git a/test/integration/app-dir-export/test/dynamicpage-prod.test.ts b/test/integration/app-dir-export/test/dynamicpage-prod.test.ts index a5365ded2f12c..58e507b84e189 100644 --- a/test/integration/app-dir-export/test/dynamicpage-prod.test.ts +++ b/test/integration/app-dir-export/test/dynamicpage-prod.test.ts @@ -4,7 +4,7 @@ describe('app dir - with output export - dynamic api route prod', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { it.each([ { dynamicPage: 'undefined' }, - { dynadynamicPagemic: "'error'" }, + { dynamicPage: "'error'" }, { dynamicPage: "'force-static'" }, { dynamicPage: "'force-dynamic'", diff --git a/test/turbopack-tests-manifest.json b/test/turbopack-tests-manifest.json index 6897053f0b837..380487a1e5c99 100644 --- a/test/turbopack-tests-manifest.json +++ b/test/turbopack-tests-manifest.json @@ -375,7 +375,13 @@ "metadata: resolveUrl should compose with metadataBase when url is relative or absolute", "metadata: resolveUrl should ignore metadataBase when url is valid URL", "metadata: resolveUrl should return null when url is falsy", - "metadata: resolveUrl should return url itself when metadataBase is null or url is valid URL" + "metadata: resolveUrl should return url itself when metadataBase is null or url is valid URL", + "resolveAbsoluteUrlWithPathname trailingSlash is false should resolve absolute internal url", + "resolveAbsoluteUrlWithPathname trailingSlash is true should add trailing slash to absolute internal url", + "resolveAbsoluteUrlWithPathname trailingSlash is true should add trailing slash to relative url", + "resolveAbsoluteUrlWithPathname trailingSlash is true should not add trailing slash to absolute internal url with query", + "resolveAbsoluteUrlWithPathname trailingSlash is true should not add trailing slash to external url", + "resolveAbsoluteUrlWithPathname trailingSlash is true should not add trailing slash to relative url with query" ], "failed": [], "pending": [], @@ -1427,18 +1433,19 @@ "flakey": [], "runtimeError": false }, - "test/development/app-dir/multiple-compiles-single-route/multiple-compiles-single-route.test.ts": { + "test/development/app-dir/missing-required-html-tags/index.test.ts": { "passed": [ - "multiple-compiles-single-route should not compile additional matching paths" + "app-dir - missing required html tags should hmr when you fix the error", + "app-dir - missing required html tags should show error overlay" ], "failed": [], "pending": [], "flakey": [], "runtimeError": false }, - "test/development/app-dir/show-error-when-missing-html-or-body-in-root-layout/show-error-when-missing-html-or-body-in-root-layout.test.ts": { + "test/development/app-dir/multiple-compiles-single-route/multiple-compiles-single-route.test.ts": { "passed": [ - "show error when missing html or body in root layout should show error overlay" + "multiple-compiles-single-route should not compile additional matching paths" ], "failed": [], "pending": [], @@ -2385,12 +2392,12 @@ "test/e2e/app-dir/app-basepath/index.test.ts": { "passed": [ "app dir - basepath should handle redirect in dynamic in suspense boundary routes with basePath", + "app dir - basepath should prefix metadata og image with basePath", "app dir - basepath should prefix redirect() with basePath", "app dir - basepath should render usePathname without the basePath", "app dir - basepath should successfully hard navigate from pages -> app", "app dir - basepath should support Link with basePath prefixed", - "app dir - basepath should support `basePath`", - "app dir - basepath should prefix metadata og image with basePath" + "app dir - basepath should support `basePath`" ], "failed": [], "pending": [], @@ -4672,7 +4679,7 @@ "runtimeError": false }, "test/e2e/app-dir/scss/multi-global-reversed/multi-global-reversed.test.ts": { - "passed": ["Multi Global Support (reversed) should render the page"], + "passed": ["(SCSS) Multi Global Support (reversed) should render the page"], "failed": [], "pending": [], "flakey": [], @@ -4982,6 +4989,7 @@ "test/e2e/app-dir/trailingslash/trailingslash.test.ts": { "passed": [ "app-dir trailingSlash handling should contain trailing slash to canonical url", + "app-dir trailingSlash handling should not add trailing slash to external url or relative url with query", "app-dir trailingSlash handling should redirect route when clicking link", "app-dir trailingSlash handling should redirect route when requesting it directly", "app-dir trailingSlash handling should redirect route when requesting it directly by browser", @@ -7427,7 +7435,7 @@ "passed": [], "failed": [], "pending": [ - "app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage $dynamicPage", + "app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage 'error'", "app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage 'force-dynamic'", "app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage 'force-static'", "app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage undefined"