jpegxl 8.4.0 → 8.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +294 -229
- package/dist/animation.browser.mjs +2 -2
- package/dist/animation.mjs +2 -2
- package/dist/capture-complete.browser.mjs +2 -2
- package/dist/capture-complete.mjs +2 -2
- package/dist/capture-groups.mjs +2 -2
- package/dist/capture.browser.mjs +2 -2
- package/dist/capture.mjs +2 -2
- package/dist/cli-add.mjs +2 -2
- package/dist/cli-astro.mjs +2 -2
- package/dist/cli-cloudflare.mjs +2 -2
- package/dist/cli-emdash.mjs +2 -2
- package/dist/cli-places.mjs +2 -2
- package/dist/cli-selftest.mjs +2 -2
- package/dist/cli-workers.mjs +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/decode.browser.mjs +2 -2
- package/dist/decode.mjs +2 -2
- package/dist/decode.node.mjs +2 -2
- package/dist/format.browser.mjs +2 -2
- package/dist/format.mjs +2 -2
- package/dist/hdr.mjs +2 -2
- package/dist/helpers.mjs +2 -2
- package/dist/index.browser.mjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/jpeg.browser.mjs +2 -2
- package/dist/jpeg.mjs +2 -2
- package/dist/jpeg.node.mjs +2 -2
- package/dist/metadata.mjs +2 -2
- package/dist/polyfill.mjs +2 -2
- package/dist/resumable.mjs +2 -2
- package/dist/resumable.node.mjs +2 -2
- package/dist/serve.mjs +2 -2
- package/dist/serve.node.mjs +2 -2
- package/dist/upload.browser.mjs +2 -2
- package/dist/upload.mjs +2 -2
- package/dist/verify.mjs +2 -2
- package/dist/verify.node.mjs +2 -2
- package/dist/wasm-modules.mjs +2 -2
- package/examples/agents/jxl-tools.mjs +8 -8
- package/examples/android/prepare-assets.mjs +2 -2
- package/examples/capacitor/prepare-assets.mjs +2 -2
- package/examples/emdash/admin-work.mjs +1 -1
- package/examples/emdash/backfill.mjs +4 -4
- package/examples/emdash/background.mjs +5 -5
- package/examples/emdash/browser-candidate.mjs +1 -1
- package/examples/emdash/deliver.mjs +2 -2
- package/examples/emdash/host-policy.mjs +6 -6
- package/examples/emdash/index.mjs +3 -3
- package/examples/emdash/job-runner.mjs +31 -31
- package/examples/emdash/job-store.mjs +21 -21
- package/examples/emdash/jpeg-source.mjs +2 -2
- package/examples/emdash/library-jobs.mjs +21 -21
- package/examples/emdash/local-store.mjs +16 -16
- package/examples/emdash/media-admin.mjs +9 -9
- package/examples/emdash/media-plugin.mjs +62 -62
- package/examples/emdash/media-storage.mjs +55 -55
- package/examples/emdash/media-words.mjs +89 -89
- package/examples/emdash/media-worker.mjs +1 -1
- package/examples/emdash/original-envelope.mjs +2 -2
- package/examples/emdash/originals.mjs +77 -77
- package/examples/emdash/r2-store.mjs +3 -3
- package/examples/emdash/read-all.mjs +14 -14
- package/examples/emdash/server-only.mjs +1 -1
- package/examples/emdash/storage.mjs +1 -1
- package/examples/emdash/structural-delivery.mjs +42 -42
- package/examples/emdash/thread-driver.mjs +15 -15
- package/examples/emdash/thread-worker.mjs +3 -3
- package/examples/emdash/work-queue.mjs +11 -11
- package/examples/flutter/prepare-assets.mjs +3 -3
- package/examples/ios/prepare-assets.mjs +3 -3
- package/examples/page-rects.js +14 -14
- package/examples/react-native/src/JXLProvider.tsx +19 -9
- package/examples/snapdom/jxl.js +3 -2
- package/examples/svg-jxl.js +10 -10
- package/package.json +1 -1
- package/types/animation.d.mts +2 -2
- package/types/capture-complete.d.mts +5 -5
- package/types/capture.d.mts +1 -1
- package/types/format.d.mts +2 -2
- package/types/index.d.mts +6 -6
- package/types/jpeg.d.mts +1 -1
- package/types/result.d.mts +5 -4
- package/types/resumable.d.mts +7 -7
- package/types/serve.d.mts +1 -1
- package/types/types.d.mts +19 -18
- package/types/upload.d.mts +1 -1
- package/types/verify.d.mts +4 -4
package/dist/cli-add.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! rapier-jxl 8.4.
|
|
2
|
-
import{readFile as t,access as e}from"node:fs/promises";import{lstat as i,mkdir as s,readFile as r,readlink as n,realpath as a,rename as o,rm as h,writeFile as l}from"node:fs/promises";import{randomBytes as p}from"node:crypto";import{basename as c,dirname as u,isAbsolute as d,join as f,relative as m,resolve as x,sep as g}from"node:path";var y=t=>process.platform==="win32"?t.toLowerCase():t,b=(t,e)=>{let i=m(y(t),y(e));return i===""||i!==".."&&!i.startsWith(".."+g)&&!d(i)},w=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;import{readFile as C,stat as E,rm as A,rmdir as I,chmod as P}from"node:fs/promises";import{dirname as j,join as N,sep as T}from"node:path";import{createHash as V}from"node:crypto";var L=(t,e,i)=>Object.assign(new Error(`${e}; ${i}.`),{code:t,fix:i});import{readFile as O}from"node:fs/promises";var D=["jpegxl","rapier-jxl"],M=D[0];var B=(t,e)=>!!(t?.dependencies?.[e]||t?.devDependencies?.[e]),$=(t,e)=>t.replace(/\b(from\s*|import\s*\(\s*|import\s+|require(?:\.resolve)?\s*\(\s*|module:\s*)(['"])(?:jpegxl|rapier-jxl)(?=[/'"])/g,`$1$2${e}`);import{stat as U}from"node:fs/promises";import{dirname as F,join as q}from"node:path";var G=[["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"]],W=["package.json",...G.map(([t])=>t)];var H=t=>t==="emdash"?".rapier-jxl-emdash.json":".rapier-jxl-add.json",J=t=>V("sha256").update(t).digest("hex"),z=t=>L("JXL_SETUP",t,"restore the files recorded by add, then try again"),K=t=>C(t).catch(t=>{if(t.code==="ENOENT")return null;throw t}),X=t=>t===null?null:J(t),Q=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Y=(t,e)=>e.map(e=>t+".config."+e),Z=["rapier-jxl-files.mjs"],tt=[...Z,"rapier-jxl-vite.mjs","rapier-jxl-vite.d.mts","rapier-jxl-images.d.ts","src/rapier-jxl-images.d.ts"],et={vite:[...tt,...Y("vite",["ts","mts","js","mjs"])],sveltekit:[...tt,...Y("vite",["ts","mts","js","mjs"])],nuxt:[...tt,...Y("nuxt",["ts","mts","js","mjs"])],webpack:[...Z,"rapier-jxl-webpack.mjs","rapier-jxl-webpack.d.mts",...["webpack","rspack"].flatMap(t=>Y(t,["js","mjs","cjs","ts"]))],next:[...Z,"rapier-jxl-next.mjs","rapier-jxl-next-proxy.mjs","rapier-jxl-next-loader.mjs","package.json",".gitignore",...["","src/"].flatMap(t=>["proxy","middleware"].flatMap(e=>["js","mjs","ts"].map(i=>t+e+"."+i)))],netlify:["netlify.toml",...["index.mjs","edge.mjs","manifest.yml","package.json","rapier-jxl-files.mjs"].map(t=>"netlify/plugins/rapier-jxl/"+t)],astro:[...Y("astro",["mjs","js","ts","mts","cjs","cts"]),"src/jxl/service.mjs","src/jxl/service-workers.mjs","src/jxl/index.mjs","src/jxl/options.mjs","package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],workers:["jxl-worker.mjs","wrangler.json","wrangler.jsonc","wrangler.toml","package.json"],emdash:["astro.config.mjs","wrangler.json","wrangler.jsonc",...W]},it=(t,e)=>Object.hasOwn(et,t)&&et[t].includes(e),st=(t,e)=>typeof e=="string"&&et[t]?.some(t=>t.startsWith(e+"/"));import{dirname as ot,join as ht}from"node:path";import{createHash as lt}from"node:crypto";import*as pt from"node:module";var ct=Object.defineProperty,ut=(t,e)=>{for(var i in e)ct(t,i,{get:e[i],enumerable:!0})},dt={};ut(dt,{Node:()=>Ve,Parser:()=>he,Position:()=>zt,SourceLocation:()=>Kt,TokContext:()=>Se,Token:()=>Ei,TokenType:()=>At,defaultOptions:()=>Qt,getLineInfo:()=>Xt,isIdentifierChar:()=>Et,isIdentifierStart:()=>Ct,isNewLine:()=>Ot,keywordTypes:()=>Nt,lineBreak:()=>Lt,lineBreakG:()=>Rt,nonASCIIwhitespace:()=>Mt,parse:()=>Ti,parseExpressionAt:()=>Vi,tokContexts:()=>ve,tokTypes:()=>Vt,tokenizer:()=>Li,version:()=>Ni});var ft=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],mt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],xt="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",gt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",yt={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},bt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",wt={5:bt,"5module":bt+" export import",6:bt+" const class extends export import super"},kt=/^in(stanceof)?$/,_t=new RegExp("["+gt+"]"),St=new RegExp("["+gt+xt+"]");var At=class{constructor(t,e={}){this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null}};var Pt={beforeExpr:!0},jt={startsExpr:!0},Nt={};var Vt={num:new At("num",jt),regexp:new At("regexp",jt),string:new At("string",jt),name:new At("name",jt),privateId:new At("privateId",jt),eof:new At("eof"),bracketL:new At("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new At("]"),braceL:new At("{",{beforeExpr:!0,startsExpr:!0}),braceR:new At("}"),parenL:new At("(",{beforeExpr:!0,startsExpr:!0}),parenR:new At(")"),comma:new At(",",Pt),semi:new At(";",Pt),colon:new At(":",Pt),dot:new At("."),question:new At("?",Pt),questionDot:new At("?."),arrow:new At("=>",Pt),template:new At("template"),invalidTemplate:new At("invalidTemplate"),ellipsis:new At("...",Pt),backQuote:new At("`",jt),dollarBraceL:new At("${",{beforeExpr:!0,startsExpr:!0}),eq:new At("=",{beforeExpr:!0,isAssign:!0}),assign:new At("_=",{beforeExpr:!0,isAssign:!0}),incDec:new At("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new At("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:It("||",1),logicalAND:It("&&",2),bitwiseOR:It("|",3),bitwiseXOR:It("^",4),bitwiseAND:It("&",5),equality:It("==/!=/===/!==",6),relational:It("</>/<=/>=",7),bitShift:It("<</>>/>>>",8),plusMin:new At("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:It("%",10),star:It("*",10),slash:It("/",10),starstar:new At("**",{beforeExpr:!0}),coalesce:It("??",1),_break:Tt("break"),_case:Tt("case",Pt),_catch:Tt("catch"),_continue:Tt("continue"),_debugger:Tt("debugger"),_default:Tt("default",Pt),_do:Tt("do",{isLoop:!0,beforeExpr:!0}),_else:Tt("else",Pt),_finally:Tt("finally"),_for:Tt("for",{isLoop:!0}),_function:Tt("function",jt),_if:Tt("if"),_return:Tt("return",Pt),_switch:Tt("switch"),_throw:Tt("throw",Pt),_try:Tt("try"),_var:Tt("var"),_const:Tt("const"),_while:Tt("while",{isLoop:!0}),_with:Tt("with"),_new:Tt("new",{beforeExpr:!0,startsExpr:!0}),_this:Tt("this",jt),_super:Tt("super",jt),_class:Tt("class",jt),_extends:Tt("extends",Pt),_export:Tt("export"),_import:Tt("import",jt),_null:Tt("null",jt),_true:Tt("true",jt),_false:Tt("false",jt),_in:Tt("in",{beforeExpr:!0,binop:7}),_instanceof:Tt("instanceof",{beforeExpr:!0,binop:7}),_typeof:Tt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Tt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Tt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Lt=/\r\n?|\n|\u2028|\u2029/,Rt=new RegExp(Lt.source,"g");var Mt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Bt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,{hasOwnProperty:$t,toString:Ut}=Object.prototype,Ft=Object.hasOwn,qt=Array.isArray,Gt=Object.create(null);var Jt=/[\uD800-\uDFFF]/u,zt=class t{constructor(t,e){this.line=t,this.column=e}offset(e){return new t(this.line,this.column+e)}},Kt=class{constructor(t,e,i){this.start=e,this.end=i,t.sourceFile!==null&&(this.source=t.sourceFile)}};var Qt={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Yt=!1;var ie=0,se=1,re=2,ne=3,ae=4,oe=5,he=class{constructor(t,e,i){this.options=t=Zt(t),this.sourceFile=t.sourceFile,this.keywords=Wt(wt[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);let s="";t.allowReserved!==!0&&(s=yt[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=Wt(s);let r=(s?s+" ":"")+yt.strict;this.reservedWordsStrict=Wt(r),this.reservedWordsStrictBind=Wt(r+" "+yt.strictBind),this.input=String(e),this.containsEsc=!1,this.pos=i||0,this.curLine=1,t.startLocation?(this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line):i?(this.lineStart=this.input.lastIndexOf(`\n`,i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(Lt).length)):this.lineStart=0,this.type=Vt.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||t.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]}parse(){let t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(()=>this.parseTopLevel(t))}get inFunction(){return(this.currentVarScope().flags&2)>0}get inGenerator(){return(this.currentVarScope().flags&8)>0}get inAsync(){return(this.currentVarScope().flags&4)>0}get canAwait(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768)return!1;if(e&2)return(e&4)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction}get allowReturn(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&1)}get allowSuper(){let{flags:t}=this.currentThisScope();return(t&64)>0||this.options.allowSuperOutsideMethod}get allowDirectSuper(){return(this.currentThisScope().flags&128)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}get allowNewDotTarget(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768||e&2&&!(e&16))return!0}return!1}get allowUsing(){let{flags:t}=this.currentScope();return!(t&1024||!this.inModule&&t&1)}get inClassStaticBlock(){return(this.currentVarScope().flags&256)>0}static extend(...t){let e=this;for(let i=0;i<t.length;i++)e=t[i](e);return e}static parse(t,e){return new this(e,t).parse()}static parseExpressionAt(t,e,i){let s=new this(i,t,e);return s.nextToken(),s.parseExpression()}static tokenizer(t,e){return new this(e,t)}},le=he.prototype,pe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;le.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){Bt.lastIndex=t,t+=Bt.exec(this.input)[0].length;let e=pe.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){Bt.lastIndex=t+e[0].length;let i=Bt.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Lt.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="="||r==="i"&&ce(this,s))}t+=e[0].length,Bt.lastIndex=t,t+=Bt.exec(this.input)[0].length,this.input[t]===";"&&t++}};le.eat=function(t){return this.type===t?(this.next(),!0):!1};le.isContextual=function(t){return this.type===Vt.name&&this.value===t&&!this.containsEsc};le.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};le.catchStackOverflow=function(t){try{return t()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};le.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};le.canInsertSemicolon=function(){return this.type===Vt.eof||this.type===Vt.braceR||Lt.test(this.input.slice(this.lastTokEnd,this.start))};le.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};le.semicolon=function(){!this.eat(Vt.semi)&&!this.insertSemicolon()&&this.unexpected()};le.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};le.expect=function(t){this.eat(t)||this.unexpected()};le.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};var ue=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};le.checkPatternErrors=function(t,e){if(!t)return;t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");let i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")};le.checkExpressionErrors=function(t,e){if(!t)return!1;let{shorthandAssign:i,doubleProto:s}=t;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};le.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};le.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var de=he.prototype;de.parseTopLevel=function(t){let e=Object.create(null);for(t.body||(t.body=[]);this.type!==Vt.eof;){let i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(let t of Object.keys(this.undefinedExports))this.raiseRecoverable(this.undefinedExports[t].start,`Export '${t}' is not defined`);return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(t,"Program")};var fe={kind:"loop"},me={kind:"switch"};de.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Bt.lastIndex=this.pos;let e=Bt.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(t)return!1;if(s===123)return!0;if(Ct(s)){let t=i;do{i+=s<=65535?1:2}while(Et(s=this.fullCharCodeAt(i)));if(s===92)return!0;let e=this.input.slice(t,i);if(!kt.test(e))return!0}return!1};de.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Bt.lastIndex=this.pos;let t=Bt.exec(this.input),e=this.pos+t[0].length,i;return!Lt.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Et(i=this.fullCharCodeAt(e+8))||i===92))};de.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;Bt.lastIndex=this.pos;let i=Bt.exec(this.input),s=this.pos+i[0].length;if(Lt.test(this.input.slice(this.pos,s)))return!1;if(t){let t=s+5,e;if(this.input.slice(s,t)!=="using"||t===this.input.length||Et(e=this.fullCharCodeAt(t))||e===92)return!1;Bt.lastIndex=t;let i=Bt.exec(this.input);if(s=t+i[0].length,i&&Lt.test(this.input.slice(t,s)))return!1}let r=this.fullCharCodeAt(s);if(!Ct(r)&&r!==92)return!1;let n=s;do{s+=r<=65535?1:2}while(Et(r=this.fullCharCodeAt(s)));if(r===92)return!0;let a=this.input.slice(n,s);if(kt.test(a))return!1;if(e&&!t&&a==="of"){Bt.lastIndex=s;let t=Bt.exec(this.input);if(s=s+t[0].length,this.input.charCodeAt(s)!==61||(r=this.input.charCodeAt(s+1))===61||r===62)return!1}return!0};de.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)};de.isUsing=function(t){return this.isUsingKeyword(!1,t)};de.parseStatement=function(t,e,i){let s=this.type,r=this.startNode(),n;switch(this.isLet(t)&&(s=Vt._var,n="let"),s){case Vt._break:case Vt._continue:return this.parseBreakContinueStatement(r,s.keyword);case Vt._debugger:return this.parseDebuggerStatement(r);case Vt._do:return this.parseDoStatement(r);case Vt._for:return this.parseForStatement(r);case Vt._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case Vt._class:return t&&this.unexpected(),this.parseClass(r,!0);case Vt._if:return this.parseIfStatement(r);case Vt._return:return this.parseReturnStatement(r);case Vt._switch:return this.parseSwitchStatement(r);case Vt._throw:return this.parseThrowStatement(r);case Vt._try:return this.parseTryStatement(r);case Vt._const:case Vt._var:return n=n||this.value,t&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case Vt._while:return this.parseWhileStatement(r);case Vt._with:return this.parseWithStatement(r);case Vt.braceL:return this.parseBlock(!0,r);case Vt.semi:return this.parseEmptyStatement(r);case Vt._export:case Vt._import:if(this.options.ecmaVersion>10&&s===Vt._import){Bt.lastIndex=this.pos;let t=Bt.exec(this.input),e=this.pos+t[0].length,i=this.input.charCodeAt(e);if(i===40||i===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===Vt._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);let a=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(a)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),t&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),a==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,a),this.semicolon(),this.finishNode(r,"VariableDeclaration");let o=this.value,h=this.parseExpression();return s===Vt.name&&h.type==="Identifier"&&this.eat(Vt.colon)?this.parseLabeledStatement(r,o,h,t):this.parseExpressionStatement(r,h)}};de.parseBreakContinueStatement=function(t,e){let i=e==="break";this.next(),this.eat(Vt.semi)||this.insertSemicolon()?t.label=null:this.type!==Vt.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());let s=0;for(;s<this.labels.length;++s){let e=this.labels[s];if((t.label==null||e.name===t.label.name)&&(e.kind!=null&&(i||e.kind==="loop")||t.label&&i))break}return s===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")};de.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};de.parseDoStatement=function(t){return this.next(),this.labels.push(fe),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(Vt._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Vt.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};de.parseForStatement=function(t){this.next();let e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(fe),this.enterScope(0),this.expect(Vt.parenL),this.type===Vt.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);let i=this.isLet();if(this.type===Vt._var||this.type===Vt._const||i){let s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}let s=this.isContextual("let"),r=!1,n=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(n){let i=this.startNode();return this.next(),n==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(t,i,e)}let a=this.containsEsc,o=new ue,h=this.start,l=e>-1?this.parseExprSubscripts(o,"await"):this.parseExpression(!0,o);return this.type===Vt._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===Vt._in&&this.unexpected(e),t.await=!0):r&&this.options.ecmaVersion>=8&&(l.start===h&&!a&&l.type==="Identifier"&&l.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),s&&r&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,o),this.checkLValPattern(l),this.parseForIn(t,l)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,l))};de.parseForAfterInit=function(t,e,i){return(this.type===Vt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&e.declarations.length===1?(this.type===Vt._in?((e.kind==="using"||e.kind==="await using")&&!e.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(t.await=i>-1),this.parseForIn(t,e)):(i>-1&&this.unexpected(i),this.parseFor(t,e))};de.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,ge|(i?0:ye),!1,e)};de.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(Vt._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};de.parseReturnStatement=function(t){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Vt.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};de.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(Vt.braceL),this.labels.push(me),this.enterScope(1024);let e;for(let i=!1;this.type!==Vt.braceR;)if(this.type===Vt._case||this.type===Vt._default){let s=this.type===Vt._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(Vt.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};de.parseThrowStatement=function(t){return this.next(),Lt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var xe=[];de.parseCatchClauseParam=function(){let t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?32:0),this.checkLValPattern(t,e?ae:re),this.expect(Vt.parenR),t};de.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===Vt._catch){let e=this.startNode();this.next(),this.eat(Vt.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(Vt._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};de.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};de.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(fe),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};de.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};de.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};de.parseLabeledStatement=function(t,e,i,s){for(let t of this.labels)t.name===e&&this.raise(i.start,"Label '"+e+"' is already declared");let r=this.type.isLoop?"loop":this.type===Vt._switch?"switch":null;for(let e=this.labels.length-1;e>=0;e--){let i=this.labels[e];if(i.statementStart===t.start)i.statementStart=this.start,i.kind=r;else break}return this.labels.push({name:e,kind:r,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};de.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};de.parseBlock=function(t=!0,e=this.startNode(),i){for(e.body=[],this.expect(Vt.braceL),t&&this.enterScope(0);this.type!==Vt.braceR;){let t=this.parseStatement(null);e.body.push(t)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};de.parseFor=function(t,e){return t.init=e,this.expect(Vt.semi),t.test=this.type===Vt.semi?null:this.parseExpression(),this.expect(Vt.semi),t.update=this.type===Vt.parenR?null:this.parseExpression(),this.expect(Vt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};de.parseForIn=function(t,e){let i=this.type===Vt._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,`${i?"for-in":"for-of"} loop variable declaration may not have an initializer`),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Vt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};de.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),this.eat(Vt.eq)?r.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===Vt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==Vt._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,`Missing initializer in ${i} declaration`):!s&&r.id.type!=="Identifier"&&!(e&&(this.type===Vt._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(Vt.comma))break}return t};de.parseVarId=function(t,e){t.id=e==="using"||e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?se:re,!1)};var ge=1,ye=2,be=4;de.parseFunction=function(t,e,i,s,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===Vt.star&&e&ye&&this.unexpected(),t.generator=this.eat(Vt.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&ge&&(t.id=e&be&&this.type!==Vt.name?null:this.parseIdent(),t.id&&!(e&ye)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?se:re:ne));let n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ee(t.async,t.generator)),e&ge||(t.id=this.type===Vt.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,r),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(t,e&ge?"FunctionDeclaration":"FunctionExpression")};de.parseFunctionParams=function(t){this.expect(Vt.parenL),t.params=this.parseBindingList(Vt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};de.parseClass=function(t,e){this.next();let i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);let s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(Vt.braceL);this.type!==Vt.braceR;){let e=this.parseClassElement(t.superClass!==null);e&&(r.body.push(e),e.type==="MethodDefinition"&&e.kind==="constructor"?(n&&this.raiseRecoverable(e.start,"Duplicate constructor in the same class"),n=!0):e.key&&e.key.type==="PrivateIdentifier"&&we(s,e)&&this.raiseRecoverable(e.key.start,`Identifier '#${e.key.name}' has already been declared`))}return this.strict=i,this.next(),t.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};de.parseClassElement=function(t){if(this.eat(Vt.semi))return null;let e=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(Vt.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===Vt.star?o=!0:s="static"}if(i.static=o,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===Vt.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(e>=9||!n)&&this.eat(Vt.star)&&(r=!0),!s&&!n&&!r){let t=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=t:s=t)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===Vt.parenL||a!=="method"||r||n){let e=!i.static&&ke(i,"constructor"),s=e&&t;e&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=e?"constructor":a,this.parseClassMethod(i,r,n,s)}else this.parseClassField(i);return i};de.isClassElementNameStart=function(){return this.type===Vt.name||this.type===Vt.privateId||this.type===Vt.num||this.type===Vt.string||this.type===Vt.bracketL||this.type.keyword};de.parseClassElementName=function(t){this.type===Vt.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};de.parseClassMethod=function(t,e,i,s){let r=t.key;t.kind==="constructor"?(e&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):t.static&&ke(t,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");let n=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),t.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),t.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};de.parseClassField=function(t){return ke(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&ke(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(Vt.eq)?(this.enterScope(576),t.value=this.parseMaybeAssign(),this.exitScope()):t.value=null,this.semicolon(),this.finishNode(t,"PropertyDefinition")};de.parseClassStaticBlock=function(t){t.body=[];let e=this.labels;for(this.labels=[],this.enterScope(320);this.type!==Vt.braceR;){let e=this.parseStatement(null);t.body.push(e)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};de.parseClassId=function(t,e){this.type===Vt.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,re,!1)):(e===!0&&this.unexpected(),t.id=null)};de.parseClassSuper=function(t){t.superClass=this.eat(Vt._extends)?this.parseExprSubscripts(null,!1):null};de.enterClassBody=function(){let t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};de.exitClassBody=function(){let{declared:t,used:e}=this.privateNameStack.pop();if(!this.options.checkPrivateFields)return;let i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1];for(let i=0;i<e.length;++i){let r=e[i];Ft(t,r.name)||(s?s.used.push(r):this.raiseRecoverable(r.start,`Private field '#${r.name}' must be declared in an enclosing class`))}};de.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==Vt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};de.parseExport=function(t,e){if(this.next(),this.eat(Vt.star))return this.parseExportAllDeclaration(t,e);if(this.eat(Vt._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[]);else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==Vt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause());else{for(let e of t.specifiers)this.checkUnreserved(e.local),this.checkLocalExport(e.local),e.local.type==="Literal"&&this.raise(e.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[])}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};de.parseExportDeclaration=function(t){return this.parseStatement(null)};de.parseExportDefaultDeclaration=function(){let t;if(this.type===Vt._function||(t=this.isAsyncFunction())){let e=this.startNode();return this.next(),t&&this.next(),this.parseFunction(e,ge|be,!1,t)}else if(this.type===Vt._class){let t=this.startNode();return this.parseClass(t,"nullableID")}else{let t=this.parseMaybeAssign();return this.semicolon(),t}};de.checkExport=function(t,e,i){t&&(typeof e!="string"&&(e=e.type==="Identifier"?e.name:e.value),Ft(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)};de.checkPatternExport=function(t,e){let i=e.type;if(i==="Identifier")this.checkExport(t,e,e.start);else if(i==="ObjectPattern")for(let i of e.properties)this.checkPatternExport(t,i);else if(i==="ArrayPattern")for(let i of e.elements)i&&this.checkPatternExport(t,i);else i==="Property"?this.checkPatternExport(t,e.value):i==="AssignmentPattern"?this.checkPatternExport(t,e.left):i==="RestElement"&&this.checkPatternExport(t,e.argument)};de.checkVariableExport=function(t,e){if(t)for(let i of e)this.checkPatternExport(t,i.id)};de.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};de.parseExportSpecifier=function(t){let e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")};de.parseExportSpecifiers=function(t){let e=[],i=!0;for(this.expect(Vt.braceL);!this.eat(Vt.braceR);){if(i)i=!1;else if(this.expect(Vt.comma),this.afterTrailingComma(Vt.braceR))break;e.push(this.parseExportSpecifier(t))}return e};de.parseImport=function(t){return this.next(),this.type===Vt.string?(t.specifiers=xe,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===Vt.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ImportDeclaration")};de.parseImportSpecifier=function(){let t=this.startNode();return t.imported=this.parseModuleExportName(),this.eatContextual("as")?t.local=this.parseIdent():(this.checkUnreserved(t.imported),t.local=t.imported),this.checkLValSimple(t.local,re),this.finishNode(t,"ImportSpecifier")};de.parseImportDefaultSpecifier=function(){let t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,re),this.finishNode(t,"ImportDefaultSpecifier")};de.parseImportNamespaceSpecifier=function(){let t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,re),this.finishNode(t,"ImportNamespaceSpecifier")};de.parseImportSpecifiers=function(){let t=[],e=!0;if(this.type===Vt.name&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(Vt.comma)))return t;if(this.type===Vt.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(Vt.braceL);!this.eat(Vt.braceR);){if(e)e=!1;else if(this.expect(Vt.comma),this.afterTrailingComma(Vt.braceR))break;t.push(this.parseImportSpecifier())}return t};de.parseWithClause=function(){let t=[];if(!this.eat(Vt._with))return t;this.expect(Vt.braceL);let e={},i=!0;for(;!this.eat(Vt.braceR);){if(i)i=!1;else if(this.expect(Vt.comma),this.afterTrailingComma(Vt.braceR))break;let s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;Ft(e,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),e[r]=!0,t.push(s)}return t};de.parseImportAttribute=function(){let t=this.startNode();return t.key=this.type===Vt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Vt.colon),this.type!==Vt.string&&this.unexpected(),t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")};de.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Vt.string){let t=this.parseLiteral(this.value);return Jt.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};de.adaptDirectivePrologue=function(t){for(let e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};de.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var _e=he.prototype;_e.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(let i of t.properties)this.toAssignable(i,e),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token");break;case"Property":t.kind!=="init"&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern"&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":t.operator!=="="&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t};_e.toAssignableList=function(t,e){let i=t.length;for(let s=0;s<i;s++){let i=t[s];i&&this.toAssignable(i,e)}if(i){let s=t[i-1];this.options.ecmaVersion===6&&e&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return t};_e.parseSpread=function(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};_e.parseRestBinding=function(){let t=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==Vt.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};_e.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Vt.bracketL:let t=this.startNode();return this.next(),t.elements=this.parseBindingList(Vt.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case Vt.braceL:return this.parseObj(!0)}return this.parseIdent()};_e.parseBindingList=function(t,e,i,s){let r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(Vt.comma),e&&this.type===Vt.comma)r.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===Vt.ellipsis){let e=this.parseRestBinding();this.parseBindingListItem(e),r.push(e),this.type===Vt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else r.push(this.parseAssignableListItem(s))}return r};_e.parseAssignableListItem=function(t){let e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e};_e.parseBindingListItem=function(t){return t};_e.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Vt.eq))return i;let s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};_e.checkLValSimple=function(t,e=ie,i){let s=e!==ie;switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(e===re&&t.name==="let"&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),i&&(Ft(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),e!==oe&&this.declareName(t.name,e,t.start));break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(t.start,"Binding parenthesized expression"),this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}};_e.checkLValPattern=function(t,e=ie,i){switch(t.type){case"ObjectPattern":for(let s of t.properties)this.checkLValInnerPattern(s,e,i);break;case"ArrayPattern":for(let s of t.elements)s&&this.checkLValInnerPattern(s,e,i);break;default:this.checkLValSimple(t,e,i)}};_e.checkLValInnerPattern=function(t,e=ie,i){switch(t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var Se=class{constructor(t,e,i,s,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!r}},ve={b_stat:new Se("{",!1),b_expr:new Se("{",!0),b_tmpl:new Se("${",!1),p_stat:new Se("(",!1),p_expr:new Se("(",!0),q_tmpl:new Se("`",!0,!0,t=>t.tryReadTemplateToken()),f_stat:new Se("function",!1),f_expr:new Se("function",!0),f_expr_gen:new Se("function",!0,!1,null,!0),f_gen:new Se("function",!1,!1,null,!0)},Ce=he.prototype;Ce.initialContext=function(){return[ve.b_stat]};Ce.curContext=function(){return this.context[this.context.length-1]};Ce.braceIsBlock=function(t){let e=this.curContext();return e===ve.f_expr||e===ve.f_stat?!0:t===Vt.colon&&(e===ve.b_stat||e===ve.b_expr)?!e.isExpr:t===Vt._return||t===Vt.name&&this.exprAllowed?Lt.test(this.input.slice(this.lastTokEnd,this.start)):t===Vt._else||t===Vt.semi||t===Vt.eof||t===Vt.parenR||t===Vt.arrow?!0:t===Vt.braceL?e===ve.b_stat:t===Vt._var||t===Vt._const||t===Vt.name?!1:!this.exprAllowed};Ce.inGeneratorContext=function(){for(let t=this.context.length-1;t>=1;t--){let e=this.context[t];if(e.token==="function")return e.generator}return!1};Ce.updateContext=function(t){let e,i=this.type;i.keyword&&t===Vt.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr};Ce.overrideContext=function(t){this.curContext()!==t&&(this.context[this.context.length-1]=t)};Vt.parenR.updateContext=Vt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}let t=this.context.pop();t===ve.b_stat&&this.curContext().token==="function"&&(t=this.context.pop()),this.exprAllowed=!t.isExpr};Vt.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?ve.b_stat:ve.b_expr),this.exprAllowed=!0};Vt.dollarBraceL.updateContext=function(){this.context.push(ve.b_tmpl),this.exprAllowed=!0};Vt.parenL.updateContext=function(t){let e=t===Vt._if||t===Vt._for||t===Vt._with||t===Vt._while;this.context.push(e?ve.p_stat:ve.p_expr),this.exprAllowed=!0};Vt.incDec.updateContext=function(){};Vt._function.updateContext=Vt._class.updateContext=function(t){t.beforeExpr&&t!==Vt._else&&!(t===Vt.semi&&this.curContext()!==ve.p_stat)&&!(t===Vt._return&&Lt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===Vt.colon||t===Vt.braceL)&&this.curContext()===ve.b_stat)?this.context.push(ve.f_expr):this.context.push(ve.f_stat),this.exprAllowed=!1};Vt.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};Vt.backQuote.updateContext=function(){this.curContext()===ve.q_tmpl?this.context.pop():this.context.push(ve.q_tmpl),this.exprAllowed=!1};Vt.star.updateContext=function(t){if(t===Vt._function){let t=this.context.length-1;this.context[t]===ve.f_expr?this.context[t]=ve.f_expr_gen:this.context[t]=ve.f_gen}this.exprAllowed=!0};Vt.name.updateContext=function(t){let e=!1;this.options.ecmaVersion>=6&&t!==Vt.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Ee=he.prototype;Ee.checkPropClash=function(t,e,i){if(this.options.ecmaVersion>=9&&t.type==="SpreadElement"||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))return;let{key:s}=t,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}let{kind:n}=t;if(this.options.ecmaVersion>=6){r==="__proto__"&&n==="init"&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),e.proto=!0);return}r="$"+r;let a=e[r];if(a){let t;n==="init"?t=this.strict&&a.init||a.get||a.set:t=a.init||a[n],t&&this.raiseRecoverable(s.start,"Redefinition of property")}else a=e[r]={init:!1,get:!1,set:!1};a[n]=!0};Ee.parseExpression=function(t,e){return this.catchStackOverflow(()=>{let i=this.start,s=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type===Vt.comma){let n=this.startNodeAt(i,s);for(n.expressions=[r];this.eat(Vt.comma);)n.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(n,"SequenceExpression")}return r})};Ee.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}let s=!1,r=-1,n=-1,a=-1;e?(r=e.parenthesizedAssign,n=e.trailingComma,a=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new ue,s=!0);let o=this.start,h=this.startLoc;(this.type===Vt.parenL||this.type===Vt.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=t==="await");let l=this.parseMaybeConditional(t,e);if(i&&(l=i.call(this,l,o,h)),this.type.isAssign){let i=this.startNodeAt(o,h);return i.operator=this.value,this.type===Vt.eq&&(l=this.toAssignable(l,!1,e)),s||(e.parenthesizedAssign=e.trailingComma=-1,e.shorthandAssign>=l.start&&(e.shorthandAssign=-1),e.doubleProto>=l.start&&(e.doubleProto=-1)),this.type===Vt.eq?this.checkLValPattern(l):this.checkLValSimple(l),i.left=l,this.next(),i.right=this.parseMaybeAssign(t),a>-1&&(e.doubleProto=a),this.finishNode(i,"AssignmentExpression")}else s&&this.checkExpressionErrors(e,!0);return r>-1&&(e.parenthesizedAssign=r),n>-1&&(e.trailingComma=n),l};Ee.parseMaybeConditional=function(t,e){let i=this.start,s=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===i)&&this.eat(Vt.question)){let e=this.startNodeAt(i,s);return e.test=r,e.consequent=this.parseMaybeAssign(),this.expect(Vt.colon),e.alternate=this.parseMaybeAssign(t),this.finishNode(e,"ConditionalExpression")}return r};Ee.parseExprOps=function(t,e){let i=this.start,s=this.startLoc,r=this.parseMaybeUnary(e,!1,!1,t);return this.checkExpressionErrors(e)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,t)};Ee.parseExprOp=function(t,e,i,s,r){let n=this.type.binop;if(n!=null&&(!r||this.type!==Vt._in)&&n>s){let a=this.type===Vt.logicalOR||this.type===Vt.logicalAND,o=this.type===Vt.coalesce;o&&(n=Vt.logicalAND.binop);let h=this.value;this.next();let l=this.start,p=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),l,p,n,r),u=this.buildBinary(e,i,t,c,h,a||o);return(a&&this.type===Vt.coalesce||o&&(this.type===Vt.logicalOR||this.type===Vt.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,e,i,s,r)}return t};Ee.buildBinary=function(t,e,i,s,r,n){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");let a=this.startNodeAt(t,e);return a.left=i,a.operator=r,a.right=s,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};Ee.parseMaybeUnary=function(t,e,i,s){let r=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(s),e=!0;else if(this.type.prefix){let i=this.startNode(),r=this.type===Vt.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0,r,s),this.checkExpressionErrors(t,!0),r?this.checkLValSimple(i.argument):this.strict&&i.operator==="delete"&&Ae(i.argument)?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):i.operator==="delete"&&Ie(i.argument)?this.raiseRecoverable(i.start,"Private fields can not be deleted"):e=!0,a=this.finishNode(i,r?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===Vt.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==Vt._in&&this.unexpected();else{if(a=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){let t=this.startNodeAt(r,n);t.operator=this.value,t.prefix=!1,t.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(t,"UpdateExpression")}}if(!i&&!(a.type==="ArrowFunctionExpression"&&a.start===r)&&this.eat(Vt.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(r,n,a,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return a};Ee.parseExprSubscripts=function(t,e){let i=this.start,s=this.startLoc,r=-1,n=-1;t&&(r=t.doubleProto,n=t.shorthandAssign,t.doubleProto=t.shorthandAssign=-1);let a=this.parseExprAtom(t,e);if(a.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return a;let o=this.parseSubscripts(a,i,s,!1,e);return t&&(o.end>a.end&&(this.checkExpressionErrors(t,!0),t.parenthesizedAssign>=o.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=o.start&&(t.parenthesizedBind=-1),t.trailingComma>=o.start&&(t.trailingComma=-1)),r>-1&&(t.doubleProto=r),n>-1&&(t.shorthandAssign=n)),o};Ee.parseSubscripts=function(t,e,i,s,r){let n=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,a=!1;for(;;){let o=this.parseSubscript(t,e,i,s,n,a,r);if(o.optional&&(a=!0),o.end===t.end||o.type==="ArrowFunctionExpression"){if(a){let t=this.startNodeAt(e,i);t.expression=o,o=this.finishNode(t,"ChainExpression")}return o}t=o,n=!1}};Ee.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Vt.arrow)};Ee.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)};Ee.parseSubscript=function(t,e,i,s,r,n,a){let o=this.options.ecmaVersion>=11,h=o&&this.eat(Vt.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let l=this.eat(Vt.bracketL);if(l||h&&this.type!==Vt.parenL&&this.type!==Vt.backQuote||this.eat(Vt.dot)){let s=this.startNodeAt(e,i);s.object=t,l?(s.property=this.parseExpression(),this.expect(Vt.bracketR)):this.type===Vt.privateId&&t.type!=="Super"?s.property=this.parsePrivateIdent():s.property=this.parseIdent(this.options.allowReserved!=="never"),s.computed=!!l,o&&(s.optional=h),t=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(Vt.parenL)){let s=new ue,n=this.yieldPos,l=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let c=this.parseExprList(Vt.parenR,this.options.ecmaVersion>=8,!1,s);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=n,this.awaitPos=l,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(e,i,c,a);this.checkExpressionErrors(s,!0),this.yieldPos=n||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;let u=this.startNodeAt(e,i);u.callee=t,u.arguments=c,o&&(u.optional=h),t=this.finishNode(u,"CallExpression")}else if(this.type===Vt.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(e,i);s.tag=t,s.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(s,"TaggedTemplateExpression")}return t};Ee.parseExprAtom=function(t,e,i){this.type===Vt.slash&&this.readRegexp();let s,r=this.potentialArrowAt===this.start;switch(this.type){case Vt._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===Vt.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==Vt.dot&&this.type!==Vt.bracketL&&this.type!==Vt.parenL&&this.unexpected(),this.finishNode(s,"Super");case Vt._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case Vt.name:let n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(Vt._function))return this.overrideContext(ve.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,e);if(r&&!this.canInsertSemicolon()){if(this.eat(Vt.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,e);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===Vt.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(Vt.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,e)}return h;case Vt.regexp:let l=this.value;return s=this.parseLiteral(l.value),s.regex={pattern:l.pattern,flags:l.flags},s;case Vt.num:case Vt.string:return this.parseLiteral(this.value);case Vt._null:case Vt._true:case Vt._false:return s=this.startNode(),s.value=this.type===Vt._null?null:this.type===Vt._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case Vt.parenL:let p=this.start,c=this.parseParenAndDistinguishExpression(r,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(t.parenthesizedAssign=p),t.parenthesizedBind<0&&(t.parenthesizedBind=p)),c;case Vt.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(Vt.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case Vt.braceL:return this.overrideContext(ve.b_expr),this.parseObj(!1,t);case Vt._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case Vt._class:return this.parseClass(this.startNode(),!1);case Vt._new:return this.parseNew();case Vt.backQuote:return this.parseTemplate();case Vt._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};Ee.parseExprAtomDefault=function(){this.unexpected()};Ee.parseExprImport=function(t){let e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===Vt.parenL&&!t)return this.parseDynamicImport(e);if(this.type===Vt.dot){let t=this.startNodeAt(e.start,e.loc&&e.loc.start);return t.name="import",e.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};Ee.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(Vt.parenR)?t.options=null:(this.expect(Vt.comma),this.afterTrailingComma(Vt.parenR)?t.options=null:(t.options=this.parseMaybeAssign(),this.eat(Vt.parenR)||(this.expect(Vt.comma),this.afterTrailingComma(Vt.parenR)||this.unexpected())));else if(!this.eat(Vt.parenR)){let t=this.start;this.eat(Vt.comma)&&this.eat(Vt.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(t,"ImportExpression")};Ee.parseImportMeta=function(t){this.next();let e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};Ee.parseLiteral=function(t){let e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.value!=null?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};Ee.parseParenExpression=function(){this.expect(Vt.parenL);let t=this.parseExpression();return this.expect(Vt.parenR),t};Ee.shouldParseArrow=function(t){return!this.canInsertSemicolon()};Ee.parseParenAndDistinguishExpression=function(t,e){let i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();let a=this.start,o=this.startLoc,h=[],l=!0,p=!1,c=new ue,u=this.yieldPos,d=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==Vt.parenR;)if(l?l=!1:this.expect(Vt.comma),n&&this.afterTrailingComma(Vt.parenR,!0)){p=!0;break}else if(this.type===Vt.ellipsis){f=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Vt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,c,this.parseParenItem));let m=this.lastTokEnd,x=this.lastTokEndLoc;if(this.expect(Vt.parenR),t&&this.shouldParseArrow(h)&&this.eat(Vt.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(i,s,h,e);(!h.length||p)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?(r=this.startNodeAt(a,o),r.expressions=h,this.finishNodeAt(r,"SequenceExpression",m,x)):r=h[0]}else r=this.parseParenExpression();if(this.options.preserveParens){let t=this.startNodeAt(i,s);return t.expression=r,this.finishNode(t,"ParenthesizedExpression")}else return r};Ee.parseParenItem=function(t){return t};Ee.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var Pe=[];Ee.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Vt.dot){let e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();let i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}let e=this.start,i=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),e,i,!0,!1),t.callee.type==="Super"&&this.raiseRecoverable(e,"Invalid use of 'super'"),this.eat(Vt.parenL)?t.arguments=this.parseExprList(Vt.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Pe,this.finishNode(t,"NewExpression")};Ee.parseTemplateElement=function({isTagged:t}){let e=this.startNode();return this.type===Vt.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),e.value={raw:this.value.replace(/\r\n?/g,`\n`),cooked:null}):e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`\n`),cooked:this.value},this.next(),e.tail=this.type===Vt.backQuote,this.finishNode(e,"TemplateElement")};Ee.parseTemplate=function({isTagged:t=!1}={}){let e=this.startNode();this.next(),e.expressions=[];let i=this.parseTemplateElement({isTagged:t});for(e.quasis=[i];!i.tail;)this.type===Vt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Vt.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(Vt.braceR),e.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(e,"TemplateLiteral")};Ee.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===Vt.name||this.type===Vt.num||this.type===Vt.string||this.type===Vt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Vt.star)&&!Lt.test(this.input.slice(this.lastTokEnd,this.start))};Ee.parseObj=function(t,e){let i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(Vt.braceR);){if(s)s=!1;else if(this.expect(Vt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Vt.braceR))break;let n=this.parseProperty(t,e);t||this.checkPropClash(n,r,e),i.properties.push(n)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};Ee.parseProperty=function(t,e){let i=this.startNode(),s,r,n,a;if(this.options.ecmaVersion>=9&&this.eat(Vt.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===Vt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===Vt.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(n=this.start,a=this.startLoc),t||(s=this.eat(Vt.star)));let o=this.containsEsc;return this.parsePropertyName(i),!t&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(Vt.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,t,s,r,n,a,e,o),this.finishNode(i,"Property")};Ee.parseGetterSetter=function(t){let e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;let i=t.kind==="get"?0:1;if(t.value.params.length!==i){let e=t.value.start;t.kind==="get"?this.raiseRecoverable(e,"getter should have no params"):this.raiseRecoverable(e,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};Ee.parsePropertyValue=function(t,e,i,s,r,n,a,o){(i||s)&&this.type===Vt.colon&&this.unexpected(),this.eat(Vt.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init"):this.options.ecmaVersion>=6&&this.type===Vt.parenL?(e&&this.unexpected(),t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"):!e&&!o&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==Vt.comma&&this.type!==Vt.braceR&&this.type!==Vt.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e?t.value=this.parseMaybeDefault(r,n,this.copyNode(t.key)):this.type===Vt.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,n,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.kind="init",t.shorthand=!0):this.unexpected()};Ee.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(Vt.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(Vt.bracketR),t.key;t.computed=!1}return t.key=this.type===Vt.num||this.type===Vt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Ee.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};Ee.parseMethod=function(t,e,i){let s=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ee(e,s.generator)|64|(i?128:0)),this.expect(Vt.parenL),s.params=this.parseBindingList(Vt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")};Ee.parseArrowExpression=function(t,e,i,s){let r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(ee(i,!1)|16),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(t,"ArrowFunctionExpression")};Ee.parseFunctionBody=function(t,e,i,s){let r=e&&this.type!==Vt.braceL,n=this.strict,a=!1;if(r)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{let s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!n||s)&&(a=this.strictDirective(this.end),a&&s&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));let r=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(t,!n&&!a&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,oe),t.body=this.parseBlock(!1,void 0,a&&!n),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=r}this.exitScope()};Ee.isSimpleParamList=function(t){for(let e of t)if(e.type!=="Identifier")return!1;return!0};Ee.checkParams=function(t,e){let i=Object.create(null);for(let s of t.params)this.checkLValInnerPattern(s,se,e?null:i)};Ee.parseExprList=function(t,e,i,s){let r=[],n=!0;for(;!this.eat(t);){if(n)n=!1;else if(this.expect(Vt.comma),e&&this.afterTrailingComma(t))break;let a;i&&this.type===Vt.comma?a=null:this.type===Vt.ellipsis?(a=this.parseSpread(s),s&&this.type===Vt.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):a=this.parseMaybeAssign(!1,s),r.push(a)}return r};Ee.checkUnreserved=function({start:t,end:e,name:i}){this.inGenerator&&i==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&259)&&i==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(t,`Cannot use ${i} in class static initialization block`),this.keywords.test(i)&&this.raise(t,`Unexpected keyword '${i}'`),!(this.options.ecmaVersion<6&&this.input.slice(t,e).indexOf("\\")!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,`The keyword '${i}' is reserved`))};Ee.parseIdent=function(t){let e=this.parseIdentNode();return this.next(!!t),this.finishNode(e,"Identifier"),t||(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=e.start)),e};Ee.parseIdentNode=function(){let t=this.startNode();return this.type===Vt.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=Vt.name):this.unexpected(),t};Ee.parsePrivateIdent=function(){let t=this.startNode();return this.type===Vt.privateId?t.name=this.value:this.unexpected(),this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(t.start,`Private field '#${t.name}' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(t)),t};Ee.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);let e=this.startNode();return this.next(),this.type===Vt.semi||this.canInsertSemicolon()||this.type!==Vt.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(Vt.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")};Ee.parseAwait=function(t){this.awaitPos||(this.awaitPos=this.start);let e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var je=he.prototype;je.raise=function(t,e){let i=Xt(this.input,t);e+=" ("+i.line+":"+i.column+")",this.sourceFile&&(e+=" in "+this.sourceFile);let s=new SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s};je.raiseRecoverable=je.raise;je.curPosition=function(){if(this.options.locations)return new zt(this.curLine,this.pos-this.lineStart)};var Ne=he.prototype,Te=class{constructor(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]}};Ne.enterScope=function(t){this.scopeStack.push(new Te(t))};Ne.exitScope=function(){this.scopeStack.pop()};Ne.treatFunctionsAsVarInScope=function(t){return t.flags&2||!this.inModule&&t.flags&1};Ne.declareName=function(t,e,i){let s=!1;if(e===re){let e=this.currentScope();s=e.lexical.indexOf(t)>-1||e.functions.indexOf(t)>-1||e.var.indexOf(t)>-1,e.lexical.push(t),this.inModule&&e.flags&1&&delete this.undefinedExports[t]}else if(e===ae)this.currentScope().lexical.push(t);else if(e===ne){let e=this.currentScope();this.treatFunctionsAsVar?s=e.lexical.indexOf(t)>-1:s=e.lexical.indexOf(t)>-1||e.var.indexOf(t)>-1,e.functions.push(t)}else for(let e=this.scopeStack.length-1;e>=0;--e){let i=this.scopeStack[e];if(i.lexical.indexOf(t)>-1&&!(i.flags&32&&i.lexical[0]===t)||!this.treatFunctionsAsVarInScope(i)&&i.functions.indexOf(t)>-1){s=!0;break}if(i.var.push(t),this.inModule&&i.flags&1&&delete this.undefinedExports[t],i.flags&259)break}s&&this.raiseRecoverable(i,`Identifier '${t}' has already been declared`)};Ne.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Ne.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Ne.currentVarScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771)return e}};Ne.currentThisScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771&&!(e.flags&16))return e}};var Ve=class{constructor(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new Kt(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])}},Le=he.prototype;Le.startNode=function(){return new Ve(this,this.start,this.startLoc)};Le.startNodeAt=function(t,e){return new Ve(this,t,e)};Le.finishNode=function(t,e){return Re.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Le.finishNodeAt=function(t,e,i,s){return Re.call(this,t,e,i,s)};Le.copyNode=function(t){let e=new Ve(this,t.start,this.startLoc);for(let i in t)e[i]=t[i];return e};var Oe="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",De="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Me=De+" Extended_Pictographic",Be=Me,$e=Be+" EBase EComp EMod EPres ExtPict",Ue=$e,Fe=Ue,qe={9:De,10:Me,11:Be,12:$e,13:Ue,14:Fe},Ge="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",We={9:"",10:"",11:"",12:"",13:"",14:Ge},He="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Je="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ze=Je+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ke=ze+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Xe=Ke+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Qe=Xe+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ye=Qe+" "+Oe,Ze={9:Je,10:ze,11:Ke,12:Xe,13:Qe,14:Ye},ti={};for(let t of[9,10,11,12,13,14])ei(t);var ii=ti,si=he.prototype,ri=class t{constructor(t,e){this.parent=t,this.base=e||this}separatedFrom(t){for(let e=this;e;e=e.parent)for(let i=t;i;i=i.parent)if(e.base===i.base&&e!==i)return!0;return!1}sibling(){return new t(this.parent,this.base)}},ni=class{constructor(t){this.parser=t,this.validFlags=`gim${t.options.ecmaVersion>=6?"uy":""}${t.options.ecmaVersion>=9?"s":""}${t.options.ecmaVersion>=13?"d":""}${t.options.ecmaVersion>=15?"v":""}`,this.unicodeProperties=ii[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null}reset(t,e,i){let s=i.indexOf("v")!==-1,r=i.indexOf("u")!==-1;this.start=t|0,this.source=e+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)}raise(t){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /${this.source}/: ${t}`)}at(t,e=!1){let i=this.source,s=i.length;if(t>=s)return-1;let r=i.charCodeAt(t);if(!(e||this.switchU)||r<=55295||r>=57344||t+1>=s)return r;let n=i.charCodeAt(t+1);return n>=56320&&n<=57343?(r<<10)+n-56613888:r}nextIndex(t,e=!1){let i=this.source,s=i.length;if(t>=s)return s;let r=i.charCodeAt(t),n;return!(e||this.switchU)||r<=55295||r>=57344||t+1>=s||(n=i.charCodeAt(t+1))<56320||n>57343?t+1:t+2}current(t=!1){return this.at(this.pos,t)}lookahead(t=!1){return this.at(this.nextIndex(this.pos,t),t)}advance(t=!1){this.pos=this.nextIndex(this.pos,t)}eat(t,e=!1){return this.current(e)===t?(this.advance(e),!0):!1}eatChars(t,e=!1){let i=this.pos;for(let s of t){let t=this.at(i,e);if(t===-1||t!==s)return!1;i=this.nextIndex(i,e)}return this.pos=i,!0}};si.validateRegExpFlags=function(t){let e=t.validFlags,i=t.flags,s=!1,r=!1;for(let n=0;n<i.length;n++){let a=i.charAt(n);e.indexOf(a)===-1&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(t.start,"Duplicate regular expression flag"),a==="u"&&(s=!0),a==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(t.start,"Invalid regular expression flag")};si.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&ai(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};si.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(let e of t.backReferenceNames)t.groupNames[e]||t.raise("Invalid named capture referenced")};si.regexp_disjunction=function(t){let e=this.options.ecmaVersion>=16;for(e&&(t.branchID=new ri(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};si.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};si.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))?(this.regexp_eatQuantifier(t),!0):!1};si.regexp_eatAssertion=function(t){let e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){let e=!1;if(this.options.ecmaVersion>=9&&(e=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!e,!0}return t.pos=e,!1};si.regexp_eatQuantifier=function(t,e=!1){return this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};si.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};si.regexp_eatBracedQuantifier=function(t,e){let i=t.pos;if(t.eat(123)){let s=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r<s&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1};si.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)};si.regexp_eatReverseSolidusAtomEscape=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};si.regexp_eatUncapturingGroup=function(t){let e=t.pos;if(t.eat(40)){if(t.eat(63)){if(this.options.ecmaVersion>=16){let e=this.regexp_eatModifiers(t),i=t.eat(45);if(e||i){for(let i=0;i<e.length;i++){let s=e.charAt(i);e.indexOf(s,i+1)>-1&&t.raise("Duplicate regular expression modifiers")}if(i){let i=this.regexp_eatModifiers(t);!e&&!i&&t.current()===58&&t.raise("Invalid regular expression modifiers");for(let s=0;s<i.length;s++){let r=i.charAt(s);(i.indexOf(r,s+1)>-1||e.indexOf(r)>-1)&&t.raise("Duplicate regular expression modifiers")}}}}if(t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}}t.pos=e}return!1};si.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};si.regexp_eatModifiers=function(t){let e="",i=0;for(;(i=t.current())!==-1&&oi(i);)e+=Ht(i),t.advance();return e};si.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};si.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};si.regexp_eatSyntaxCharacter=function(t){let e=t.current();return hi(e)?(t.lastIntValue=e,t.advance(),!0):!1};si.regexp_eatPatternCharacters=function(t){let e=t.pos,i=0;for(;(i=t.current())!==-1&&!hi(i);)t.advance();return t.pos!==e};si.regexp_eatExtendedPatternCharacter=function(t){let e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};si.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");let e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(let e of i)e.separatedFrom(t.branchID)||t.raise("Duplicate capture group name");else t.raise("Duplicate capture group name");e?(i||(t.groupNames[t.lastStringValue]=[])).push(t.branchID):t.groupNames[t.lastStringValue]=!0}};si.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1};si.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Ht(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Ht(t.lastIntValue);return!0}return!1};si.regexp_eatRegExpIdentifierStart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),li(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};si.regexp_eatRegExpIdentifierPart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),pi(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};si.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};si.regexp_eatBackReference=function(t){let e=t.pos;if(this.regexp_eatDecimalEscape(t)){let i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};si.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};si.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};si.regexp_eatCControlLetter=function(t){let e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};si.regexp_eatZero=function(t){return t.current()===48&&!_i(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};si.regexp_eatControlEscape=function(t){let e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};si.regexp_eatControlLetter=function(t){let e=t.current();return ci(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};si.regexp_eatRegExpUnicodeEscapeSequence=function(t,e=!1){let i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){let e=t.lastIntValue;if(s&&e>=55296&&e<=56319){let i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){let i=t.lastIntValue;if(i>=56320&&i<=57343)return t.lastIntValue=(e-55296)*1024+(i-56320)+65536,!0}t.pos=i,t.lastIntValue=e}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&ui(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};si.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;let e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};si.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;let e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1};var di=0,fi=1,mi=2;si.regexp_eatCharacterClassEscape=function(t){let e=t.current();if(xi(e))return t.lastIntValue=-1,t.advance(),fi;let i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();let e;if(t.eat(123)&&(e=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&e===mi&&t.raise("Invalid property name"),e;t.raise("Invalid property name")}return di};si.regexp_eatUnicodePropertyValueExpression=function(t){let e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){let e=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){let i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,e,i),fi}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){let e=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,e)}return di};si.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Ft(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};si.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return fi;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return mi;t.raise("Invalid property name")};si.regexp_eatUnicodePropertyName=function(t){let e=0;for(t.lastStringValue="";gi(e=t.current());)t.lastStringValue+=Ht(e),t.advance();return t.lastStringValue!==""};si.regexp_eatUnicodePropertyValue=function(t){let e=0;for(t.lastStringValue="";yi(e=t.current());)t.lastStringValue+=Ht(e),t.advance();return t.lastStringValue!==""};si.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};si.regexp_eatCharacterClass=function(t){if(t.eat(91)){let e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===mi&&t.raise("Negated character class may contain strings"),!0}return!1};si.regexp_classContents=function(t){return t.current()===93?fi:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),fi)};si.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){let e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){let i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};si.regexp_eatClassAtom=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){let e=t.current();(e===99||Ci(e))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}let i=t.current();return i!==93?(t.lastIntValue=i,t.advance(),!0):!1};si.regexp_eatClassEscape=function(t){let e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};si.regexp_classSetExpression=function(t){let e=fi,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===mi&&(e=mi);let s=t.pos;for(;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==mi&&(e=fi);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===mi&&(e=mi)}};si.regexp_eatClassSetRange=function(t){let e=t.pos;if(this.regexp_eatClassSetCharacter(t)){let i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){let e=t.lastIntValue;return i!==-1&&e!==-1&&i>e&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};si.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?fi:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};si.regexp_eatNestedClass=function(t){let e=t.pos;if(t.eat(91)){let i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===mi&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){let i=this.regexp_eatCharacterClassEscape(t);if(i)return i;t.pos=e}return null};si.regexp_eatClassStringDisjunction=function(t){let e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){let e=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return e}else t.raise("Invalid escape");t.pos=e}return null};si.regexp_classStringDisjunctionContents=function(t){let e=this.regexp_classString(t);for(;t.eat(124);)this.regexp_classString(t)===mi&&(e=mi);return e};si.regexp_classString=function(t){let e=0;for(;this.regexp_eatClassSetCharacter(t);)e++;return e===1?fi:mi};si.regexp_eatClassSetCharacter=function(t){let e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);let i=t.current();return i<0||i===t.lookahead()&&bi(i)||wi(i)?!1:(t.advance(),t.lastIntValue=i,!0)};si.regexp_eatClassSetReservedPunctuator=function(t){let e=t.current();return ki(e)?(t.lastIntValue=e,t.advance(),!0):!1};si.regexp_eatClassControlLetter=function(t){let e=t.current();return _i(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};si.regexp_eatHexEscapeSequence=function(t){let e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};si.regexp_eatDecimalDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;_i(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};si.regexp_eatHexDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;Si(i=t.current());)t.lastIntValue=16*t.lastIntValue+vi(i),t.advance();return t.pos!==e};si.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){let e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){let i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};si.regexp_eatOctalDigit=function(t){let e=t.current();return Ci(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};si.regexp_eatFixedHexDigits=function(t,e){let i=t.pos;t.lastIntValue=0;for(let s=0;s<e;++s){let e=t.current();if(!Si(e))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+vi(e),t.advance()}return!0};var Ei=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Kt(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])}},Ai=he.prototype;Ai.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ei(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Ai.getToken=function(){return this.next(),new Ei(this)};typeof Symbol<"u"&&(Ai[Symbol.iterator]=function(){return{next:()=>{let t=this.getToken();return{done:t.type===Vt.eof,value:t}}}});Ai.nextToken=function(){let t=this.curContext();if((!t||!t.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(Vt.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};Ai.readToken=function(t){return Ct(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};Ai.fullCharCodeAt=function(t){let e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;let i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888};Ai.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Ai.skipBlockComment=function(){let t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(let t,i=e;(t=Dt(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=t;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};Ai.skipLineComment=function(t){let e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);for(;this.pos<this.input.length&&!Ot(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())};Ai.skipSpace=function(){t:for(;this.pos<this.input.length;){let t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(t>8&&t<14||t>=5760&&Mt.test(String.fromCharCode(t)))++this.pos;else break t}}};Ai.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let i=this.type;this.type=t,this.value=e,this.updateContext(i)};Ai.readToken_dot=function(){let t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);let e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(Vt.ellipsis)):(++this.pos,this.finishToken(Vt.dot))};Ai.readToken_slash=function(){let t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(Vt.assign,2):this.finishOp(Vt.slash,1)};Ai.readToken_mult_modulo_exp=function(t){let e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?Vt.star:Vt.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=Vt.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(Vt.assign,i+1):this.finishOp(s,i)};Ai.readToken_pipe_amp=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Vt.assign,3):this.finishOp(t===124?Vt.logicalOR:Vt.logicalAND,2):e===61?this.finishOp(Vt.assign,2):this.finishOp(t===124?Vt.bitwiseOR:Vt.bitwiseAND,1)};Ai.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(Vt.assign,2):this.finishOp(Vt.bitwiseXOR,1)};Ai.readToken_plus_min=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Lt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(Vt.incDec,2):e===61?this.finishOp(Vt.assign,2):this.finishOp(Vt.plusMin,1)};Ai.readToken_lt_gt=function(t){let e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(Vt.assign,i+1):this.finishOp(Vt.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(Vt.relational,i))};Ai.readToken_eq_excl=function(t){let e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(Vt.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Vt.arrow)):this.finishOp(t===61?Vt.eq:Vt.prefix,1)};Ai.readToken_question=function(){let t=this.options.ecmaVersion;if(t>=11){let e=this.input.charCodeAt(this.pos+1);if(e===46){let t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(Vt.questionDot,2)}if(e===63)return t>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Vt.assign,3):this.finishOp(Vt.coalesce,2)}return this.finishOp(Vt.question,1)};Ai.readToken_numberSign=function(){let t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),Ct(e,!0)||e===92))return this.finishToken(Vt.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Ht(e)+"'")};Ai.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Vt.parenL);case 41:return++this.pos,this.finishToken(Vt.parenR);case 59:return++this.pos,this.finishToken(Vt.semi);case 44:return++this.pos,this.finishToken(Vt.comma);case 91:return++this.pos,this.finishToken(Vt.bracketL);case 93:return++this.pos,this.finishToken(Vt.bracketR);case 123:return++this.pos,this.finishToken(Vt.braceL);case 125:return++this.pos,this.finishToken(Vt.braceR);case 58:return++this.pos,this.finishToken(Vt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Vt.backQuote);case 48:let e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(Vt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Ht(t)+"'")};Ai.finishOp=function(t,e){let i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};Ai.readRegexp=function(){let t,e,i=this.pos;for(;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");let s=this.input.charAt(this.pos);if(Lt.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}let s=this.input.slice(i,this.pos);++this.pos;let r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);let a=this.regexpState||(this.regexpState=new ni(this));a.reset(i,s,n),this.validateRegExpFlags(a),this.validateRegExpPattern(a);let o=null;try{o=new RegExp(s,n)}catch{}return this.finishToken(Vt.regexp,{pattern:s,flags:n,value:o})};Ai.readInt=function(t,e,i){let s=this.options.ecmaVersion>=12&&e===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0;for(let i=0,n=e??1/0;i<n;++i,++this.pos){let e=this.input.charCodeAt(this.pos),n;if(s&&e===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=e;continue}if(e>=97?n=e-97+10:e>=65?n=e-65+10:e>=48&&e<=57?n=e-48:n=1/0,n>=t)break;o=e,a=a*t+n}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||e!=null&&this.pos-n!==e?null:a};Ai.readRadixNumber=function(t){let e=this.pos;this.pos+=2;let i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Pi(this.input.slice(e,this.pos)),++this.pos):Ct(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Vt.num,i)};Ai.readNumber=function(t){let e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");let i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){let t=Pi(this.input.slice(e,this.pos));return++this.pos,Ct(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Vt.num,t)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),Ct(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let r=Ii(this.input.slice(e,this.pos),i);return this.finishToken(Vt.num,r)};Ai.readCodePoint=function(){let t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();let t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e};Ai.readString=function(t){let e="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ot(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(Vt.string,e)};var ji={};Ai.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===ji)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};Ai.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ji;this.raise(t,e)};Ai.readTmplToken=function(){let t="",e=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");let i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===Vt.template||this.type===Vt.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(Vt.dollarBraceL)):(++this.pos,this.finishToken(Vt.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(Vt.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Ot(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=`\n`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};Ai.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(Vt.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`\n`&&++this.pos;case`\n`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Ai.readEscapedChar=function(t){let e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`\n`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ht(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){let t=this.pos-1;this.invalidStringToken(t,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){let i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),(i!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-i.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Ot(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};Ai.readHexChar=function(t){let e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};Ai.readWord1=function(){this.containsEsc=!1;let t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;for(;this.pos<this.input.length;){let r=this.fullCharCodeAtPos();if(Et(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,t+=this.input.slice(i,this.pos);let r=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;let n=this.readCodePoint();(e?Ct:Et)(n,s)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=Ht(n),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)};Ai.readWord=function(){let t=this.readWord1(),e=Vt.name;return this.keywords.test(t)&&(e=Nt[t]),this.finishToken(e,t)};var Ni="8.19.0";he.acorn={Parser:he,version:Ni,defaultOptions:Qt,Position:zt,SourceLocation:Kt,getLineInfo:Xt,Node:Ve,TokenType:At,tokTypes:Vt,keywordTypes:Nt,TokContext:Se,tokContexts:ve,isIdentifierChar:Et,isIdentifierStart:Ct,Token:Ei,isNewLine:Ot,lineBreak:Lt,lineBreakG:Rt,nonASCIIwhitespace:Mt};var Ri={...dt};var Bi=["vite","webpack","next","netlify"],$i={sveltekit:"SvelteKit",nuxt:"Nuxt"},Ui={sveltekit:"@sveltejs/kit",nuxt:"nuxt"},Fi={vite:` rapier-jxl-vite.mjs the plug-in (and its types with a tsconfig.json)\n vite.config.* imports it and adds jxl() to plugins\nThen import hero from './hero.jpg?jxl' gives a JPEG XL file's URL.`,webpack:` rapier-jxl-webpack.mjs the plug-in and its loader (webpack 5 and Rspack)\n webpack.config.* imports it and adds jxl() to plugins (or rspack.config.*)\nThen import hero from './hero.jpg?jxl' gives a JPEG XL file's URL.`,next:` rapier-jxl-next.mjs writes the JPEG XL files after next build (the postbuild script)\n rapier-jxl-next-proxy.mjs answers next/image with them where the browser accepts JPEG XL\n proxy.js (Next 16) or middleware.js (Next 15) uses it, unless the project has one\nThen <Image> serves JPEG XL to browsers that show it, and Next's own image to the rest.`,netlify:` netlify/plugins/rapier-jxl/ the build plug-in: a .jxl beside each JPEG and PNG it publishes\n netlify.toml lists the plug-in\nThen the site serves JPEG XL to browsers that send Accept: image/jxl, and the originals to the rest.`},qi=(t,e=t)=>`Usage: ${M} add ${e} [--dry-run] [--json]\n\nAdds JPEG XL images to the ${$i[e]??(t==="next"?"Next.js":t==="netlify"?"Netlify":t[0].toUpperCase()+t.slice(1))} project in this folder:\n${e==="nuxt"?Fi.vite.replace(" vite.config.* imports it and adds jxl() to plugins"," nuxt.config.* imports it and adds jxl() to vite.plugins"):Fi[t]}\nRunning it again changes nothing; a file you edited is left as it is.`,Gi="rapier-jxl-files.mjs",Wi=(...t)=>t.flatMap(t=>["js","mjs","cjs","ts","mts","cts"].map(e=>`${t}.config.${e}`)),Hi={vite:{name:"a Vite",packages:["vite"],files:Wi("vite")},webpack:{name:"a webpack or Rspack",packages:["webpack","@rspack/core","@rspack/cli"],files:Wi("webpack","rspack")},next:{name:"a Next.js",packages:["next"],files:Wi("next")},netlify:{name:"a Netlify",packages:["@netlify/build","netlify-cli"],files:["netlify.toml"]}},Ji=t=>e(t).then(()=>!0,()=>!1),zi=t=>lt("sha256").update(t).digest("hex"),Ki=async(t,e)=>(await Promise.all(e.map(e=>Ji(ht(t,e))))).map((t,i)=>t&&e[i]).find(Boolean);var ss=(t,e,i)=>at(i.as??t,e,i);var ns={async vite(t,e){let i=await Ki(t,["vite.config.ts","vite.config.mts","vite.config.js","vite.config.mjs"]);if(i)await rs(t,[i],null,"./rapier-jxl-vite.mjs",e);else{let t=e.pkg.type==="module"?"vite.config.js":"vite.config.mjs";await e.write(t,`import {defineConfig} from 'vite';\nimport {jxl} from './rapier-jxl-vite.mjs';\n\nexport default defineConfig({\n plugins: [jxl()],\n});\n`),e.changes.push({file:t,action:"created"})}e.next.push((e.as==="sveltekit"?"in a .svelte file: ":"")+`import hero, {original} from './hero.jpg?jxl'; then <picture><source srcset={hero} type="image/jxl"><img src={original}></picture>`)},async nuxt(t,e){await rs(t,["nuxt.config.ts","nuxt.config.mts","nuxt.config.js","nuxt.config.mjs"],()=>"nuxt.config.ts","./rapier-jxl-vite.mjs",e,{edit:{define:/^defineNuxtConfig$/,inside:"vite"},fresh:()=>`import {jxl} from './rapier-jxl-vite.mjs';\n\nexport default defineNuxtConfig({\n vite: {plugins: [jxl()]},\n});\n`}),e.next.push(`import hero, {original} from './hero.jpg?jxl'; then <picture><source :srcset="hero" type="image/jxl"><img :src="original"></picture>`)},async webpack(t,e){let i=["webpack.config.js","webpack.config.mjs","webpack.config.cjs","rspack.config.js","rspack.config.mjs","rspack.config.cjs","webpack.config.ts","rspack.config.ts"],s=!!(e.pkg.dependencies?.["@rspack/core"]||e.pkg.devDependencies?.["@rspack/core"]||e.pkg.devDependencies?.["@rspack/cli"]);await rs(t,i,t=>(s?"rspack":"webpack")+(t.type==="module"?".config.js":".config.mjs"),"./rapier-jxl-webpack.mjs",e),e.next.push(`import hero, {original} from './hero.jpg?jxl'; then <picture><source srcset={hero} type="image/jxl"><img src={original}></picture>`),e.next.push("jxl({beside: true}) also writes a .jxl beside every JPEG and PNG the build emits, for a server that picks by Accept.")},async next(e,{pkg:i,pkgText:s,write:r,changes:n,next:a}){let o="node rapier-jxl-next.mjs",h=i.scripts?.postbuild;if(h?.includes(o))n.push({file:"package.json",action:"unchanged"});else if(h)n.push({file:"package.json",action:"left (has a postbuild script)"}),a.push(`add && ${o} to the end of the postbuild script in package.json.`);else{let t=JSON.parse(s);t.scripts={...t.scripts,postbuild:o};let e=s.match(/^\{\r?\n([ \t]+)/)?.[1]??" ";await r("package.json",JSON.stringify(t,null,e)+(s.endsWith(`\n`)?`\n`:"")),n.push({file:"package.json",action:`updated: postbuild runs ${o}`})}let l=Number((i.dependencies?.next??i.devDependencies?.next??"").match(/(\d+)/)?.[1])||16;for(let i=e;;i=ot(i))try{l=Number(JSON.parse(await t(ht(i,"node_modules","next","package.json"),"utf8")).version.split(".")[0])||l;break}catch{if(ot(i)===i)break}let p=await Ji(ht(e,"src","app"))||await Ji(ht(e,"src","pages"))?"src/":"",c=await Ki(e,["proxy","middleware"].flatMap(t=>["js","mjs","ts"].map(e=>p+t+"."+e))),u=await Ki(e,["next.config.js","next.config.mjs","next.config.ts","next.config.cjs"]),d=t=>t.replace(/\/\*[\s\S]*?\*\/|(?<!:)\/\/[^\n]*/g,""),f=u&&/output\s*:\s*['"]export['"]/.test(d(await t(ht(e,u),"utf8"))),m=(p?"../":"./")+"rapier-jxl-next-proxy.mjs";if(f)a.push(`a static export has no server to choose by Accept: use rapier-jxl-next-loader.mjs as a <picture>'s <source type="image/jxl">, as its first lines show, or serve out/ from a host that picks by Accept.`);else if(c&&(await t(ht(e,c),"utf8")).includes("rapier-jxl-next-proxy.mjs"))n.push({file:c,action:"unchanged"});else if(c)n.push({file:c,action:"left (the project has its own)"}),a.push(`in ${c}, return jxlProxy(request) first when it gives a response: import {jxlProxy} from '${m}'; and add '/_next/image' to its matcher.`);else{let t=p+(l>=16?"proxy.js":"middleware.js");await r(t,`export {jxlProxy as ${l>=16?"proxy":"middleware"}} from '${m}';\nexport const config = {matcher: '/_next/image'};\n`),n.push({file:t,action:"created"})}let x=await t(ht(e,".gitignore"),"utf8").catch(()=>null);x?.split(/\r?\n/).some(t=>/^\/?public\/_jxl\/?$/.test(t.trim()))?n.push({file:".gitignore",action:"unchanged"}):(await r(".gitignore",(x===null?"":x.replace(/\n*$/,`\n`))+`/public/_jxl/\n`),n.push({file:".gitignore",action:x===null?"created":"updated: ignores public/_jxl/"})),a.push("npm run build: the postbuild step lists the pictures it wrote; npx next start serves them.")},async netlify(e,{write:i,changes:s,next:r}){let n="netlify.toml",a='package = "./netlify/plugins/rapier-jxl"',o=await t(ht(e,n),"utf8").catch(()=>null);o?.split(/\r?\n/).some(t=>t.replace(/#.*$/,"").includes(a))?s.push({file:n,action:"unchanged"}):(await i(n,(o===null?"":o.replace(/\n*$/,`\n\n`))+`[[plugins]]\n ${a}\n`),s.push({file:n,action:o===null?"created":"updated: lists the plug-in"})),r.push("netlify build (or a deploy) writes a .jxl beside each published JPEG and PNG and the edge function that serves them.")}};export{Bi as ADD_HOSTS,$i as VITE_FRAMEWORKS,qi as addHelp,ts as configEdit,is as runAdd,ss as runRemove};async function k(t,e=0){if(e>40)throw Object.assign(new Error("Symbolic link loop"),{code:"ELOOP"});try{return await a(t)}catch(t){if(!["ENOENT","ENOTDIR"].includes(t.code))throw t}if((await i(t).catch(()=>null))?.isSymbolicLink())return k(x(u(t),await n(t)),e+1);let s=u(t);return s===t?t:f(await k(s,e),c(t))}async function _(t,e,i){let s=await a(t),r=[];for(let n of e){if(typeof n!="string"||n.includes("\0"))throw i("A project file path is invalid","use a plain relative path inside this folder");let e;try{e=await k(x(t,n))}catch(e){throw e?.code==="ELOOP"?i(`${m(t,x(t,n))||n} has a symbolic link loop`,"replace the link with a folder or file"):e}if(!b(s,e))throw i(`${m(t,x(t,n))||n} leads outside this folder, to ${e}`,"replace the link with the file itself, or run it in the folder the file is in");let a=m(s,e);if(process.platform==="win32"&&a.split(/[\\/]/).some(t=>w.test(t)||/[ .]$/.test(t)))throw i(`${a} uses a reserved Windows file name`,"rename the file or folder");r.push(e)}return r}async function S(t,e){let[i]=await _(t,["package.json"],e),s=await r(i,"utf8").catch(t=>{if(t.code==="ENOENT")return null;throw t});if(s===null)return null;let n;try{n=JSON.parse(s)}catch(t){throw e(`package.json is not JSON (${t.message})`,"correct package.json")}if(!n||typeof n!="object"||Array.isArray(n))throw e("package.json is not a JSON object","correct package.json");return{text:s,manifest:n}}async function v(t,e){await s(u(t),{recursive:!0});let i=f(u(t),`.${c(t)}.${p(6).toString("hex")}.tmp`);try{await l(i,e,{flag:"wx"}),await o(i,t)}catch(t){throw await h(i,{force:!0}).catch(()=>{}),t}}function R(t){if(!Array.isArray(t))throw L("JXL_OPTIONS","Command arguments are not an array of text values","pass an array of strings");let e=[];for(let i=0;i<t.length;i++){let s=t[i];if(typeof s!="string")throw L("JXL_OPTIONS","A command argument is not text","pass each argument as a string");e.push(s)}return e}async function rt(t,e){let[i]=await _(t,[H(e)],z),s=await K(i);if(s===null)return null;let r;try{r=JSON.parse(s)}catch{throw z("The add record is not JSON")}if(!Q(r)||r.place!==e||r.schema!==1||!Q(r.files)||!Array.isArray(r.dirs)||!r.dirs.every(t=>st(e,t)))throw z("The add record does not describe this place");for(let[t,i]of Object.entries(r.files))if(!it(e,t)||!Q(i)||!(i.before===null||typeof i.before=="string"&&Buffer.from(i.before,"base64").toString("base64")===i.before)||!(i.after===null||typeof i.after=="string"&&/^[a-f0-9]{64}$/.test(i.after))||!(i.mode===null||Number.isInteger(i.mode)&&i.mode>=0&&i.mode<=511))throw z("The add record names an invalid file");if(r.pending)throw z("An earlier add did not finish installing its dependencies");return await _(t,[...Object.keys(r.files),...r.dirs],z),r}async function nt(t,e,i,s,{dryRun:r=!1,install:n,beforeWrite:a}={}){let o=await rt(t,e),h=[...new Set([...s.keys(),...n?.files??[]])];if(h.some(t=>!it(e,t)))throw z("The setup names a file outside its place");let l=await _(t,[H(e),...h],z),p=new Map,c={...o?.files},u=new Set(o?.dirs??[]);for(let[e,i]of h.entries()){let r=await K(l[e+1]);if(p.set(i,r),c[i]&&X(r)!==c[i].after)throw z(`${i} changed after add wrote it`);c[i]={before:c[i]?c[i].before:r===null?null:r.toString("base64"),mode:c[i]?c[i].mode:r===null?null:(await E(l[e+1])).mode&511,after:s.has(i)?J(s.get(i)):X(r)};for(let e=j(i);e!==".";e=j(e))try{await E(N(t,e))}catch(t){if(t.code==="ENOENT")u.add(e.split(T).join("/"));else throw t}}if(r)return;if(!h.length){await(a?.());return}let d={schema:1,place:e,version:i,files:c,dirs:[...u]},f=t=>v(l[0],JSON.stringify({...d,...t&&{pending:!0}},null,2)+`\n`);if(await f(!!n),n){await n.run(),await _(t,[H(e),...h],z);for(let e of n.files)c[e].after=X(await K(N(t,e)));await f(!1)}await(a?.());let m=await _(t,[...s.keys()],z);for(let e of s.keys())if(X(await K(N(t,e)))!==X(p.get(e)))throw z(`${e} changed while add ran`);for(let[t,[e,i]]of[...s].entries())await v(m[t],i),c[e].mode!==null&&await P(m[t],c[e].mode)}async function at(t,e,{cwd:i,stdout:s}){if(e=R(e),e.length===1&&["--help","-h"].includes(e[0])){s(`Usage: ${M} remove ${t} [--dry-run] [--json]`);return}if(e.some(t=>!["--dry-run","--json"].includes(t)))throw L("JXL_OPTIONS","Unknown remove option",`run npx ${M} remove ${t} --help`);let r=e.includes("--dry-run"),n=await rt(i,t);if(!n)throw z(`There is no add record for ${t}`);let a=Object.keys(n.files),o=await _(i,[...a,H(t),...n.dirs],z),h=[];for(let[t,e]of a.entries()){let i=n.files[e],s=await K(o[t]),r=i.before===null?null:Buffer.from(i.before,"base64");if(X(s)!==X(r)){if(X(s)!==i.after)throw z(`${e} changed after add wrote it; no files were removed`);h.push({file:e,action:r===null?"removed":"restored",original:r,index:t})}}if(!r){for(let t of h){let e=o[t.index],i=n.files[t.file];t.original===null?await A(e):(await v(e,t.original),i.mode!==null&&await P(e,i.mode))}for(let t of[...n.dirs].sort((t,e)=>e.length-t.length))await I(N(i,t)).catch(t=>{if(!["ENOENT","ENOTEMPTY","EEXIST"].includes(t.code))throw t});await A(o[a.length])}let l=h.map(({file:t,action:e})=>({file:t,action:e}));if(e.includes("--json"))s(JSON.stringify({type:"remove",host:t,dryRun:r,changes:l}));else for(let{file:t,action:e}of l)s(`${t}: ${r?"would be ":""}${e}`)}function vt(t,e){let i=65536;for(let s=0;s<e.length;s+=2){if(i+=e[s],i>t)return!1;if(i+=e[s+1],i>=t)return!0}return!1}function Ct(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&_t.test(String.fromCharCode(t)):e===!1?!1:vt(t,mt)}function Et(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&St.test(String.fromCharCode(t)):e===!1?!1:vt(t,mt)||vt(t,ft)}function It(t,e){return new At(t,{beforeExpr:!0,binop:e})}function Tt(t,e={}){return e.keyword=t,Nt[t]=new At(t,e)}function Ot(t){return t===10||t===13||t===8232||t===8233}function Dt(t,e,i=t.length){for(let s=e;s<i;s++){let e=t.charCodeAt(s);if(Ot(e))return s<i-1&&e===13&&t.charCodeAt(s+1)===10?s+2:s+1}return-1}function Wt(t){return Gt[t]||(Gt[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function Ht(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Xt(t,e){for(let i=1,s=0;;){let r=Dt(t,s,e);if(r<0)return new zt(i,e-s);++i,s=r}}function Zt(t){let e={};for(let i in Qt)e[i]=t&&Ft(t,i)?t[i]:Qt[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!Yt&&typeof console=="object"&&console.warn&&(Yt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),qt(e.onToken)){let t=e.onToken;e.onToken=e=>t.push(e)}if(qt(e.onComment)&&(e.onComment=te(e,e.onComment)),e.sourceType==="commonjs"&&e.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}function te(t,e){return function(i,s,r,n,a,o){let h={type:i?"Block":"Line",value:s,start:r,end:n};t.locations&&(h.loc=new Kt(this,a,o)),t.ranges&&(h.range=[r,n]),e.push(h)}}function ee(t,e){return 2|(t?4:0)|(e?8:0)}function ce(t,e){let i=e+1,s=Math.min(t.input.length,e+11);for(;i<s;){let e=t.fullCharCodeAt(i);if(!Et(e,!0))break;i+=e<=65535?1:2}return i===e+2&&t.input.slice(e,i)==="in"||i===e+10&&t.input.slice(e,i)==="instanceof"}function we(t,e){let i=e.key.name,s=t[i],r="true";return e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set")&&(r=(e.static?"s":"i")+e.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(t[i]="true",!1):s?!0:(t[i]=r,!1)}function ke(t,e){let{computed:i,key:s}=t;return!i&&(s.type==="Identifier"&&s.name===e||s.type==="Literal"&&s.value===e)}function Ae(t){return t.type==="Identifier"||t.type==="ParenthesizedExpression"&&Ae(t.expression)}function Ie(t){return t.type==="MemberExpression"&&t.property.type==="PrivateIdentifier"||t.type==="ChainExpression"&&Ie(t.expression)||t.type==="ParenthesizedExpression"&&Ie(t.expression)}function Re(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}function ei(t){let e=ti[t]={binary:Wt(qe[t]+" "+He),binaryOfStrings:Wt(We[t]),nonBinary:{General_Category:Wt(He),Script:Wt(Ze[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}function ai(t){for(let e in t)return!0;return!1}function oi(t){return t===105||t===109||t===115}function hi(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}function li(t){return Ct(t,!0)||t===36||t===95}function pi(t){return Et(t,!0)||t===36||t===95||t===8204||t===8205}function ci(t){return t>=65&&t<=90||t>=97&&t<=122}function ui(t){return t>=0&&t<=1114111}function xi(t){return t===100||t===68||t===115||t===83||t===119||t===87}function gi(t){return ci(t)||t===95}function yi(t){return gi(t)||_i(t)}function bi(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}function wi(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}function ki(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}function _i(t){return t>=48&&t<=57}function Si(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function vi(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function Ci(t){return t>=48&&t<=55}function Ii(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function Pi(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}function Ti(t,e){return he.parse(t,e)}function Vi(t,e,i){return he.parseExpressionAt(t,e,i)}function Li(t,e){return he.tokenizer(t,e)}function Oi(t){let e={sourceType:"module",ecmaVersion:"latest"},i=t.startsWith("\ufeff#!")?"//!"+t.slice(3):t;try{return Ri.parse(i,e)}catch(t){let{stripTypeScriptTypes:s}=pt;if(typeof s!="function")throw t;let r=process.emitWarning,n;try{process.emitWarning=()=>{},n=s(i,{mode:"strip"})}catch{throw t}finally{process.emitWarning=r}if(n.length!==i.length)throw t;return Ri.parse(n,e)}}function Di(t,e,i){let s=0,r=e,n=-1;for(let a=e;a<i;a++){let e=t[a],o=t[a+1];if(e==="/"&&o==="/"){if(a=t.indexOf(`\n`,a+2),a<0)break;continue}if(e==="/"&&o==="*"){let e=t.indexOf("*/",a+2);if(e<0)break;a=e+1;continue}if(e==="'"||e==='"'||e==="`"){for(a++;a<i&&t[a]!==e;a++)t[a]==="\\"&&a++;r=a+1;continue}if(e==="("||e==="["||e==="{")s++;else if(e===")"||e==="]"||e==="}"){if(s===0)break;s--,r=a+1}else if(e===","&&s===0){n=a;break}else/\s/.test(e)||(r=a+1)}return{end:r,comma:n}}function Mi(t,e){let i=t.startsWith("\ufeff")?1:0;if(t.startsWith("#!",i)){let e=t.indexOf(`\n`,i);i=e<0?t.length:e+1}for(let s of e?.body??[])if(s.type==="ExpressionStatement"&&typeof s.directive=="string"){let e=/^\r?\n/.exec(t.slice(s.end))?.[0].length??0;i=Math.max(i,s.end+e)}else break;return i}async function Xi(e){for(let i of[new URL("../examples/"+e,import.meta.url),new URL("./examples/"+e,import.meta.url)])try{return await t(i,"utf8")}catch{}throw L("JXL_SETUP","The installed jpegxl package is incomplete",`reinstall ${M}`)}function Qi(t,e,i){return`// rapier-jxl ${t}. npx ${M} add ${e} updates this file while it is unchanged; edit it freely. sha256:${zi(i)}\n`+i}function Yi(t,e){if(t===null)return"create";let i=t.replace(/\r\n/g,`\n`);if(i===e)return"unchanged";let[s,...r]=i.split(`\n`),n=s.match(/sha256:([0-9a-f]{64})$/);return n&&zi(r.join(`\n`))===n[1]?"update":"edited"}function Zi(t,e){if(!["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"].includes(t?.type)||t.async||t.generator)return null;let i=t.body,s=i,r=(t,e,i=null,s=null)=>{if(!(!t||typeof t!="object")&&!(typeof t.type=="string"&&e(t,i,s)===!1))for(let s of Object.values(t))if(Array.isArray(s))for(let n of s)r(n,e,t,i);else s&&typeof s=="object"&&r(s,e,t,i)};if(i.type==="BlockStatement"){let t=[];if(r(i,e=>{if(/^(?:ArrowFunctionExpression|FunctionExpression|FunctionDeclaration)$/.test(e.type))return!1;e.type==="ReturnStatement"&&t.push(e)}),t.length!==1||i.body.at(-1)!==t[0])return null;s=t[0].argument}if(s?.type==="ObjectExpression")return s;if(s?.type!=="Identifier")return null;let n=s.name,a=[...e.body,...i.type==="BlockStatement"?i.body:[]].filter(t=>t.type==="VariableDeclaration"&&t.kind==="const").flatMap(t=>t.declarations).filter(t=>t.id.type==="Identifier"&&t.id.name===n&&t.init?.type==="ObjectExpression");if(a.length!==1)return null;let o=a[0],h=!0;return r(e,(t,e,i)=>{if(t===o.init)return!1;t.type!=="Identifier"||t.name!==n||t===o.id||t===s||e?.type==="MemberExpression"&&e.object===t&&!e.computed&&e.property.name!=="plugins"&&i?.type==="AssignmentExpression"&&i.left===e&&i.operator==="="||e?.type==="Property"&&e.key===t&&!e.computed&&!e.shorthand||(h=!1)}),h?o.init:null}function ts(t,e,{importPath:i,name:s="jxl",define:r=/^define(Config)?$/,inside:n}){let a=`import {jxl} from '${i}' in ${e}, then add jxl() to ${n?n+".":""}plugins`,o;try{o=Oi(t)}catch{if(t.includes(i))return null;throw L("JXL_SETUP",`${e} could not be read as JavaScript or TypeScript, so it was not changed`,a)}let h=t=>t?.type==="CallExpression"&&t.callee.name==="require"&&t.arguments[0]?.value===i,l=o.body.filter(t=>t.type==="ImportDeclaration"||t.type==="VariableDeclaration"&&t.declarations.some(t=>t.init?.type==="CallExpression"&&t.init.callee.name==="require")),p=o.body.find(t=>t.type==="ImportDeclaration"&&t.source.value===i||t.type==="VariableDeclaration"&&t.declarations.some(t=>h(t.init))),c=p?.type==="VariableDeclaration"?p.declarations.find(t=>h(t.init))?.id:null,u=p?.type==="ImportDeclaration"?p.specifiers.find(t=>t.type==="ImportSpecifier"&&(t.imported.name??t.imported.value)==="jxl"||t.type==="ImportDefaultSpecifier")?.local.name:c?.type==="ObjectPattern"?c.properties.find(t=>t.type==="Property"&&!t.computed&&(t.key.name??t.key.value)==="jxl"&&t.value.type==="Identifier")?.value.name:void 0,d=!o.body.some(t=>t.type==="ImportDeclaration"||t.type==="ExportDefaultDeclaration"),f=d?o.body.find(t=>t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.left.type==="MemberExpression"&&t.expression.left.object.name==="module"&&t.expression.left.property.name==="exports")?.expression.right:o.body.find(t=>t.type==="ExportDefaultDeclaration")?.declaration,m=f?.type==="ObjectExpression"?f:f?.type==="CallExpression"&&r.test(f.callee.name??f.callee.property?.name??"")&&f.arguments[0]?.type==="ObjectExpression"?f.arguments[0]:Zi(f,o);if(!m&&p)return null;if(!m)throw L("JXL_SETUP",`${e} does not export one object, defineConfig({...}) or a factory returning one object, so it was not changed`,a);let x=null;if(n){let t=m.properties.filter(t=>t.type==="Property"&&!t.computed&&(t.key.name??t.key.value)===n);if(t.length>1||t[0]&&t[0].value.type!=="ObjectExpression")throw L("JXL_SETUP",`${n} in ${e} is not one object, so it was not changed`,a);t[0]?m=t[0].value:(x=m,m={properties:[]})}let g=m.properties.filter(t=>t.type==="Property"&&!t.computed&&(t.key.name??t.key.value)==="plugins");if(g.length>1||g[0]&&g[0].value.type!=="ArrayExpression")throw L("JXL_SETUP",`plugins in ${e} is not one array, so it was not changed`,a);let y=g[0]?.value,b=u??s,w=1;if(!u)for(;new RegExp(`\\b${b}\\b`).test(t);)b=w===1?"rapierJxl":`rapierJxl${w}`,w++;if(u&&y?.elements.some(t=>t?.type==="CallExpression"&&t.callee.name===u))return null;let k=[];if(!u){let e=l.pop(),s=d?`const {${b==="jxl"?"jxl":"jxl: "+b}} = require('${i}');`:`import {${b==="jxl"?"jxl":"jxl as "+b}} from '${i}';`,r=Mi(t,o);k.push(e?{at:e.end,text:`\n`+s}:{at:r,text:(r===t.length&&r&&!t.endsWith(`\n`)?`\n`:"")+s+`\n`})}let _=b+"()";if(x)k.push({at:x.start+1,text:`\n ${n}: {plugins: [${_}]},`});else if(y)if(y.elements.at(-1)){let{end:e,comma:i}=Di(t,y.elements.at(-1).end,y.end-1);k.push(i>=0?{at:i+1,text:" "+_+","}:{at:e,text:", "+_})}else y.elements.length?k.push({at:y.end-1,text:" "+_}):k.push({at:y.start+1,text:_});else{let e=m.properties.at(-1);if(!e)k.push({at:m.start+1,text:`\n plugins: [${_}],`});else{let{end:i,comma:s}=Di(t,e.end,m.end-1),r=t.slice(m.start,m.end).includes(`\n`),n=t.slice(t.lastIndexOf(`\n`,e.start)+1,e.start).match(/^\s*/)?.[0]??" ";k.push(s>=0?{at:s+1,text:r?`\n${n}plugins: [${_}],`:` plugins: [${_}]`}:{at:i,text:r?`,\n${n}plugins: [${_}]`:`, plugins: [${_}]`})}}let S=k.sort((t,e)=>e.at-t.at).reduce((t,e)=>t.slice(0,e.at)+e.text+t.slice(e.at),t);try{Oi(S)}catch{throw L("JXL_SETUP",`${e} could not be updated safely, so it was not changed`,a)}return S}async function es(t,e,i){let s=await Ji(ht(e,"tsconfig.json"));return t==="vite"?{dir:"",files:[["rapier-jxl-vite.mjs","vite/index.mjs"],...s?[["rapier-jxl-vite.d.mts","vite/index.d.ts"],[(await Ji(ht(e,"src"))?"src/":"")+"rapier-jxl-images.d.ts","vite/client.d.ts"]]:[]]}:t==="webpack"?{dir:"",files:[["rapier-jxl-webpack.mjs","webpack/index.mjs"],...s?[["rapier-jxl-webpack.d.mts","webpack/index.d.ts"]]:[]]}:t==="next"?{dir:"",files:[["rapier-jxl-next.mjs","next/index.mjs"],["rapier-jxl-next-proxy.mjs","next/proxy.mjs"],["rapier-jxl-next-loader.mjs","next/loader.mjs"]]}:{dir:"netlify/plugins/rapier-jxl/",files:[["index.mjs","netlify/index.mjs"],["edge.mjs","netlify/edge.mjs"],["manifest.yml","netlify/manifest.yml"],["package.json","netlify/package.json"]]}}async function is(e,i,{cwd:s,version:r,name:n="rapier-jxl",stdout:a,as:o=e}){if(i=R(i),i.length===1&&["--help","-h"].includes(i[0])){a(qi(e,o));return}let h=i.includes("--dry-run"),l=i.includes("--json"),p=i.find(t=>t!=="--dry-run"&&t!=="--json");if(p)throw L("JXL_OPTIONS",`add ${o} takes --dry-run and --json, not ${p}`,`run npx ${M} add ${o} --help`);let c=(t,e)=>L("JXL_SETUP",t,e),u=await S(s,c);if(!u)throw L("JXL_SETUP","There is no package.json here",`run npx ${M} add ${o} in the project's folder`);let{text:d,manifest:f}=u,m=[],x=[],g=Ui[o],y=Hi[e];if(g&&!B(f,g))throw c(`This folder is not a ${$i[o]} project: looked for ${g} in package.json`,`run npx ${M} add ${o} in the ${$i[o]} project's folder`);if(!g&&!y.packages.some(t=>B(f,t))&&!await Ki(s,y.files))throw c(`This folder is not ${y.name} project: looked for ${[...y.packages,...y.files].join(", ")}`,`run npx ${M} add ${o} in the project's folder`);let b=new Map,w=async(t,e)=>{b.set(t,e)},k=async(e,i)=>{let r=await t(ht(s,e),"utf8").catch(()=>null),n=Yi(r,i);(n==="create"||n==="update")&&await w(e,i),m.push({file:e,action:n==="edited"?"left (edited)":n==="create"?"created":n==="update"?"updated":"unchanged"})},{dir:_,files:v}=await es(e,s,f),C=n;for(let[t,e]of v){let i=$((await Xi(e)).replaceAll("'../files/index.mjs'",`'./${Gi}'`),C);await k(_+t,/\.(json|yml)$/.test(t)?i:Qi(r,o,i))}if(await k(_+Gi,Qi(r,o,$(await Xi("files/index.mjs"),C))),await ns[o==="nuxt"?"nuxt":e](s,{pkg:f,pkgText:d,write:w,changes:m,next:x,as:o}),B(f,n)||x.unshift(`npm install --save-dev ${n}@${r}`),await nt(s,o,r,b,{dryRun:h}),l){a(JSON.stringify({type:"add",host:o,dryRun:h,changes:m,next:x}));return}for(let t of m)a(`${t.file}: ${h&&!/^(unchanged|left)/.test(t.action)?"would be ":""}${t.action}`);for(let t of x)a("next: "+t)}async function rs(e,i,s,r,{pkg:n,write:a,changes:o},{edit:h,fresh:l}={}){let p=await Ki(e,i);if(!p){let t=s(n);await a(t,l?l(t):t.endsWith(".js")&&n.type!=="module"?`const {jxl} = require('${r}');\n\nmodule.exports = {\n plugins: [jxl()],\n};\n`:`import {jxl} from '${r}';\n\nexport default {\n plugins: [jxl()],\n};\n`),o.push({file:t,action:"created"});return}let c=await t(ht(e,p),"utf8"),u=ts(c,p,{importPath:r,...h});u!==null&&await a(p,u),o.push({file:p,action:u===null?"unchanged":`updated: imports the plug-in, adds jxl() to ${h?.inside?h.inside+".":""}plugins`})}
|
|
1
|
+
/*! rapier-jxl 8.4.1 | MIT */
|
|
2
|
+
async function k(t,e=0){if(e>40)throw Object.assign(new Error("Symbolic link loop"),{code:"ELOOP"});try{return await a(t)}catch(t){if(!["ENOENT","ENOTDIR"].includes(t.code))throw t}if((await i(t).catch(()=>null))?.isSymbolicLink())return k(x(u(t),await n(t)),e+1);let s=u(t);return s===t?t:f(await k(s,e),c(t))}async function _(t,e,i){let s=await a(t),r=[];for(let n of e){if(typeof n!="string"||n.includes("\0"))throw i("A project file path is invalid","use a plain relative path inside this folder");let e;try{e=await k(x(t,n))}catch(e){throw e?.code==="ELOOP"?i(`${m(t,x(t,n))||n} has a symbolic link loop`,"replace the link with a folder or file"):e}if(!b(s,e))throw i(`${m(t,x(t,n))||n}: outside folder (${e})`,"replace symlink or run in target folder");let a=m(s,e);if(process.platform==="win32"&&a.split(/[\\/]/).some(t=>w.test(t)||/[ .]$/.test(t)))throw i(`${a} uses a reserved Windows file name`,"rename the file or folder");r.push(e)}return r}async function S(t,e){let[i]=await _(t,["package.json"],e),s=await r(i,"utf8").catch(t=>{if(t.code==="ENOENT")return null;throw t});if(s===null)return null;let n;try{n=JSON.parse(s)}catch(t){throw e(`package.json: invalid JSON (${t.message})`,"fix package.json")}if(!n||typeof n!="object"||Array.isArray(n))throw e("package.json is not a JSON object","correct package.json");return{text:s,manifest:n}}async function v(t,e){await s(u(t),{recursive:!0});let i=f(u(t),`.${c(t)}.${p(6).toString("hex")}.tmp`);try{await l(i,e,{flag:"wx"}),await o(i,t)}catch(t){throw await h(i,{force:!0}).catch(()=>{}),t}}function R(t){if(!Array.isArray(t))throw L("JXL_OPTIONS","args: array of strings","use: string[]");let e=[];for(let i=0;i<t.length;i++){let s=t[i];if(typeof s!="string")throw L("JXL_OPTIONS","arg: string","each: string");e.push(s)}return e}async function nt(t,e){let[i]=await _(t,[H(e)],z),s=await K(i);if(s===null)return null;let r;try{r=JSON.parse(s)}catch{throw z("The add record is not JSON")}if(!Y(r)||r.place!==e||r.schema!==1||!Y(r.files)||!Array.isArray(r.dirs)||!r.dirs.every(t=>rt(e,t)))throw z("The add record does not describe this place");for(let[t,i]of Object.entries(r.files))if(!st(e,t)||!Y(i)||!(i.before===null||typeof i.before=="string"&&Buffer.from(i.before,"base64").toString("base64")===i.before)||!(i.after===null||typeof i.after=="string"&&/^[a-f0-9]{64}$/.test(i.after))||!(i.mode===null||Number.isInteger(i.mode)&&i.mode>=0&&i.mode<=511))throw z("The add record names an invalid file");if(r.pending)throw z("An earlier add did not finish installing its dependencies");return await _(t,[...Object.keys(r.files),...r.dirs],z),r}async function at(t,e,i,s,{dryRun:r=!1,install:n,beforeWrite:a}={}){let o=await nt(t,e),h=[...new Set([...s.keys(),...n?.files??[]])];if(h.some(t=>!st(e,t)))throw z("The setup names a file outside its place");let l=await _(t,[H(e),...h],z),p=new Map,c={...o?.files},u=new Set(o?.dirs??[]);for(let[e,i]of h.entries()){let r=await K(l[e+1]);if(p.set(i,r),c[i]&&!Q(r,c[i].after))throw z(`${i} changed after add wrote it`);c[i]={before:c[i]?c[i].before:r===null?null:r.toString("base64"),mode:c[i]?c[i].mode:r===null?null:(await E(l[e+1])).mode&511,after:s.has(i)?J(s.get(i)):X(r)};for(let e=j(i);e!==".";e=j(e))try{await E(N(t,e))}catch(t){if(t.code==="ENOENT")u.add(e.split(T).join("/"));else throw t}}if(r)return;if(!h.length){await(a?.());return}let d={schema:1,place:e,version:i,files:c,dirs:[...u]},f=t=>v(l[0],JSON.stringify({...d,...t&&{pending:!0}},null,2)+`\n`);if(await f(!!n),n){await n.run(),await _(t,[H(e),...h],z);for(let e of n.files)c[e].after=X(await K(N(t,e)));await f(!1)}await(a?.());let m=await _(t,[...s.keys()],z);for(let e of s.keys())if(X(await K(N(t,e)))!==X(p.get(e)))throw z(`${e} changed while add ran`);for(let[t,[e,i]]of[...s].entries())await v(m[t],i),c[e].mode!==null&&await P(m[t],c[e].mode)}async function ot(t,e,{cwd:i,stdout:s}){if(e=R(e),e.length===1&&["--help","-h"].includes(e[0])){s(`Usage: ${M} remove ${t} [--dry-run] [--json]`);return}if(e.some(t=>!["--dry-run","--json"].includes(t)))throw L("JXL_OPTIONS","Unknown remove option",`run npx ${M} remove ${t} --help`);let r=e.includes("--dry-run"),n=await nt(i,t);if(!n)throw z(`There is no add record for ${t}`);let a=Object.keys(n.files),o=await _(i,[...a,H(t),...n.dirs],z),h=[];for(let[t,e]of a.entries()){let i=n.files[e],s=await K(o[t]),r=i.before===null?null:Buffer.from(i.before,"base64");if(X(s)!==X(r)){if(!Q(s,i.after))throw z(`${e} changed after add wrote it; no files were removed`);h.push({file:e,action:r===null?"removed":"restored",original:r,index:t})}}if(!r){for(let t of h){let e=o[t.index],i=n.files[t.file];t.original===null?await A(e):(await v(e,t.original),i.mode!==null&&await P(e,i.mode))}for(let t of[...n.dirs].sort((t,e)=>e.length-t.length))await I(N(i,t)).catch(t=>{if(!["ENOENT","ENOTEMPTY","EEXIST"].includes(t.code))throw t});await A(o[a.length])}let l=h.map(({file:t,action:e})=>({file:t,action:e}));if(e.includes("--json"))s(JSON.stringify({type:"remove",host:t,dryRun:r,changes:l}));else for(let{file:t,action:e}of l)s(`${t}: ${r?"would be ":""}${e}`)}function Ct(t,e){let i=65536;for(let s=0;s<e.length;s+=2){if(i+=e[s],i>t)return!1;if(i+=e[s+1],i>=t)return!0}return!1}function Et(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&St.test(String.fromCharCode(t)):e===!1?!1:Ct(t,xt)}function At(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&vt.test(String.fromCharCode(t)):e===!1?!1:Ct(t,xt)||Ct(t,mt)}function Pt(t,e){return new It(t,{beforeExpr:!0,binop:e})}function Vt(t,e={}){return e.keyword=t,Tt[t]=new It(t,e)}function Dt(t){return t===10||t===13||t===8232||t===8233}function Mt(t,e,i=t.length){for(let s=e;s<i;s++){let e=t.charCodeAt(s);if(Dt(e))return s<i-1&&e===13&&t.charCodeAt(s+1)===10?s+2:s+1}return-1}function Ht(t){return Wt[t]||(Wt[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function Jt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Qt(t,e){for(let i=1,s=0;;){let r=Mt(t,s,e);if(r<0)return new Kt(i,e-s);++i,s=r}}function te(t){let e={};for(let i in Yt)e[i]=t&&qt(t,i)?t[i]:Yt[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!Zt&&typeof console=="object"&&console.warn&&(Zt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),Gt(e.onToken)){let t=e.onToken;e.onToken=e=>t.push(e)}if(Gt(e.onComment)&&(e.onComment=ee(e,e.onComment)),e.sourceType==="commonjs"&&e.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}function ee(t,e){return function(i,s,r,n,a,o){let h={type:i?"Block":"Line",value:s,start:r,end:n};t.locations&&(h.loc=new Xt(this,a,o)),t.ranges&&(h.range=[r,n]),e.push(h)}}function ie(t,e){return 2|(t?4:0)|(e?8:0)}function ue(t,e){let i=e+1,s=Math.min(t.input.length,e+11);for(;i<s;){let e=t.fullCharCodeAt(i);if(!At(e,!0))break;i+=e<=65535?1:2}return i===e+2&&t.input.slice(e,i)==="in"||i===e+10&&t.input.slice(e,i)==="instanceof"}function ke(t,e){let i=e.key.name,s=t[i],r="true";return e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set")&&(r=(e.static?"s":"i")+e.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(t[i]="true",!1):s?!0:(t[i]=r,!1)}function _e(t,e){let{computed:i,key:s}=t;return!i&&(s.type==="Identifier"&&s.name===e||s.type==="Literal"&&s.value===e)}function Ie(t){return t.type==="Identifier"||t.type==="ParenthesizedExpression"&&Ie(t.expression)}function Pe(t){return t.type==="MemberExpression"&&t.property.type==="PrivateIdentifier"||t.type==="ChainExpression"&&Pe(t.expression)||t.type==="ParenthesizedExpression"&&Pe(t.expression)}function Oe(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}function ii(t){let e=ei[t]={binary:Ht(Ge[t]+" "+Je),binaryOfStrings:Ht(He[t]),nonBinary:{General_Category:Ht(Je),Script:Ht(ti[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}function oi(t){for(let e in t)return!0;return!1}function hi(t){return t===105||t===109||t===115}function li(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}function pi(t){return Et(t,!0)||t===36||t===95}function ci(t){return At(t,!0)||t===36||t===95||t===8204||t===8205}function ui(t){return t>=65&&t<=90||t>=97&&t<=122}function di(t){return t>=0&&t<=1114111}function gi(t){return t===100||t===68||t===115||t===83||t===119||t===87}function yi(t){return ui(t)||t===95}function bi(t){return yi(t)||Si(t)}function wi(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}function ki(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}function _i(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}function Si(t){return t>=48&&t<=57}function vi(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Ci(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function Ei(t){return t>=48&&t<=55}function Pi(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function ji(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}function Vi(t,e){return le.parse(t,e)}function Li(t,e,i){return le.parseExpressionAt(t,e,i)}function Ri(t,e){return le.tokenizer(t,e)}function Di(t){let e={sourceType:"module",ecmaVersion:"latest"},i=t.startsWith("\ufeff#!")?"//!"+t.slice(3):t;try{return Oi.parse(i,e)}catch(t){let{stripTypeScriptTypes:s}=ct;if(typeof s!="function")throw t;let r=process.emitWarning,n;try{process.emitWarning=()=>{},n=s(i,{mode:"strip"})}catch{throw t}finally{process.emitWarning=r}if(n.length!==i.length)throw t;return Oi.parse(n,e)}}function Mi(t,e,i){let s=0,r=e,n=-1;for(let a=e;a<i;a++){let e=t[a],o=t[a+1];if(e==="/"&&o==="/"){if(a=t.indexOf(`\n`,a+2),a<0)break;continue}if(e==="/"&&o==="*"){let e=t.indexOf("*/",a+2);if(e<0)break;a=e+1;continue}if(e==="'"||e==='"'||e==="`"){for(a++;a<i&&t[a]!==e;a++)t[a]==="\\"&&a++;r=a+1;continue}if(e==="("||e==="["||e==="{")s++;else if(e===")"||e==="]"||e==="}"){if(s===0)break;s--,r=a+1}else if(e===","&&s===0){n=a;break}else/\s/.test(e)||(r=a+1)}return{end:r,comma:n}}function Bi(t,e){let i=t.startsWith("\ufeff")?1:0;if(t.startsWith("#!",i)){let e=t.indexOf(`\n`,i);i=e<0?t.length:e+1}for(let s of e?.body??[])if(s.type==="ExpressionStatement"&&typeof s.directive=="string"){let e=/^\r?\n/.exec(t.slice(s.end))?.[0].length??0;i=Math.max(i,s.end+e)}else break;return i}async function Qi(e){for(let i of[new URL("../examples/"+e,import.meta.url),new URL("./examples/"+e,import.meta.url)])try{return await t(i,"utf8")}catch{}throw L("JXL_SETUP","package: incomplete",`reinstall: ${M}`)}function Yi(t,e,i){return`// rapier-jxl ${t}. npx ${M} add ${e} updates this file while it is unchanged; edit it freely. sha256:${Ki(i)}\n`+i}function Zi(t,e){if(t===null)return"create";let i=t.replace(/\r\n/g,`\n`);if(i===e)return"unchanged";let[s,...r]=i.split(`\n`),n=s.match(/sha256:([0-9a-f]{64})$/);return n&&Ki(r.join(`\n`))===n[1]?"update":"edited"}function ts(t,e){if(!["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration"].includes(t?.type)||t.async||t.generator)return null;let i=t.body,s=i,r=(t,e,i=null,s=null)=>{if(!(!t||typeof t!="object")&&!(typeof t.type=="string"&&e(t,i,s)===!1))for(let s of Object.values(t))if(Array.isArray(s))for(let n of s)r(n,e,t,i);else s&&typeof s=="object"&&r(s,e,t,i)};if(i.type==="BlockStatement"){let t=[];if(r(i,e=>{if(/^(?:ArrowFunctionExpression|FunctionExpression|FunctionDeclaration)$/.test(e.type))return!1;e.type==="ReturnStatement"&&t.push(e)}),t.length!==1||i.body.at(-1)!==t[0])return null;s=t[0].argument}if(s?.type==="ObjectExpression")return s;if(s?.type!=="Identifier")return null;let n=s.name,a=[...e.body,...i.type==="BlockStatement"?i.body:[]].filter(t=>t.type==="VariableDeclaration"&&t.kind==="const").flatMap(t=>t.declarations).filter(t=>t.id.type==="Identifier"&&t.id.name===n&&t.init?.type==="ObjectExpression");if(a.length!==1)return null;let o=a[0],h=!0;return r(e,(t,e,i)=>{if(t===o.init)return!1;t.type!=="Identifier"||t.name!==n||t===o.id||t===s||e?.type==="MemberExpression"&&e.object===t&&!e.computed&&e.property.name!=="plugins"&&i?.type==="AssignmentExpression"&&i.left===e&&i.operator==="="||e?.type==="Property"&&e.key===t&&!e.computed&&!e.shorthand||(h=!1)}),h?o.init:null}function es(t,e,{importPath:i,name:s="jxl",define:r=/^define(Config)?$/,inside:n}){let a=`add: import {jxl} from '${i}'; ${n?n+".":""}plugins: [jxl()]`,o;try{o=Di(t)}catch{if(t.includes(i))return null;throw L("JXL_SETUP",`${e}: JS/TS parse failed`,a)}let h=t=>t?.type==="CallExpression"&&t.callee.name==="require"&&t.arguments[0]?.value===i,l=o.body.filter(t=>t.type==="ImportDeclaration"||t.type==="VariableDeclaration"&&t.declarations.some(t=>t.init?.type==="CallExpression"&&t.init.callee.name==="require")),p=o.body.find(t=>t.type==="ImportDeclaration"&&t.source.value===i||t.type==="VariableDeclaration"&&t.declarations.some(t=>h(t.init))),c=p?.type==="VariableDeclaration"?p.declarations.find(t=>h(t.init))?.id:null,u=p?.type==="ImportDeclaration"?p.specifiers.find(t=>t.type==="ImportSpecifier"&&(t.imported.name??t.imported.value)==="jxl"||t.type==="ImportDefaultSpecifier")?.local.name:c?.type==="ObjectPattern"?c.properties.find(t=>t.type==="Property"&&!t.computed&&(t.key.name??t.key.value)==="jxl"&&t.value.type==="Identifier")?.value.name:void 0,d=!o.body.some(t=>t.type==="ImportDeclaration"||t.type==="ExportDefaultDeclaration"),f=d?o.body.find(t=>t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.left.type==="MemberExpression"&&t.expression.left.object.name==="module"&&t.expression.left.property.name==="exports")?.expression.right:o.body.find(t=>t.type==="ExportDefaultDeclaration")?.declaration,m=f?.type==="ObjectExpression"?f:f?.type==="CallExpression"&&r.test(f.callee.name??f.callee.property?.name??"")&&f.arguments[0]?.type==="ObjectExpression"?f.arguments[0]:ts(f,o);if(!m&&p)return null;if(!m)throw L("JXL_SETUP",`${e}: object, defineConfig({...}) or factory`,a);let x=null;if(n){let t=m.properties.filter(t=>t.type==="Property"&&!t.computed&&(t.key.name??t.key.value)===n);if(t.length>1||t[0]&&t[0].value.type!=="ObjectExpression")throw L("JXL_SETUP",`${n} in ${e}: one object`,a);t[0]?m=t[0].value:(x=m,m={properties:[]})}let g=m.properties.filter(t=>t.type==="Property"&&!t.computed&&(t.key.name??t.key.value)==="plugins");if(g.length>1||g[0]&&g[0].value.type!=="ArrayExpression")throw L("JXL_SETUP",`plugins in ${e}: array`,a);let y=g[0]?.value,b=u??s,w=1;if(!u)for(;new RegExp(`\\b${b}\\b`).test(t);)b=w===1?"rapierJxl":`rapierJxl${w}`,w++;if(u&&y?.elements.some(t=>t?.type==="CallExpression"&&t.callee.name===u))return null;let k=[];if(!u){let e=l.pop(),s=d?`const {${b==="jxl"?"jxl":"jxl: "+b}} = require('${i}');`:`import {${b==="jxl"?"jxl":"jxl as "+b}} from '${i}';`,r=Bi(t,o);k.push(e?{at:e.end,text:`\n`+s}:{at:r,text:(r===t.length&&r&&!t.endsWith(`\n`)?`\n`:"")+s+`\n`})}let _=b+"()";if(x)k.push({at:x.start+1,text:`\n ${n}: {plugins: [${_}]},`});else if(y)if(y.elements.at(-1)){let{end:e,comma:i}=Mi(t,y.elements.at(-1).end,y.end-1);k.push(i>=0?{at:i+1,text:" "+_+","}:{at:e,text:", "+_})}else y.elements.length?k.push({at:y.end-1,text:" "+_}):k.push({at:y.start+1,text:_});else{let e=m.properties.at(-1);if(!e)k.push({at:m.start+1,text:`\n plugins: [${_}],`});else{let{end:i,comma:s}=Mi(t,e.end,m.end-1),r=t.slice(m.start,m.end).includes(`\n`),n=t.slice(t.lastIndexOf(`\n`,e.start)+1,e.start).match(/^\s*/)?.[0]??" ";k.push(s>=0?{at:s+1,text:r?`\n${n}plugins: [${_}],`:` plugins: [${_}]`}:{at:i,text:r?`,\n${n}plugins: [${_}]`:`, plugins: [${_}]`})}}let S=t.includes(`\r\n`)?`\r\n`:`\n`,v=k.sort((t,e)=>e.at-t.at).reduce((t,e)=>t.slice(0,e.at)+e.text.replace(/\r?\n/g,S)+t.slice(e.at),t);try{Di(v)}catch{throw L("JXL_SETUP",`${e} could not be updated safely, so it was not changed`,a)}return v}async function is(t,e,i){let s=await zi(lt(e,"tsconfig.json"));return t==="vite"?{dir:"",files:[["rapier-jxl-vite.mjs","vite/index.mjs"],...s?[["rapier-jxl-vite.d.mts","vite/index.d.ts"],[(await zi(lt(e,"src"))?"src/":"")+"rapier-jxl-images.d.ts","vite/client.d.ts"]]:[]]}:t==="webpack"?{dir:"",files:[["rapier-jxl-webpack.mjs","webpack/index.mjs"],...s?[["rapier-jxl-webpack.d.mts","webpack/index.d.ts"]]:[]]}:t==="next"?{dir:"",files:[["rapier-jxl-next.mjs","next/index.mjs"],["rapier-jxl-next-proxy.mjs","next/proxy.mjs"],["rapier-jxl-next-loader.mjs","next/loader.mjs"]]}:{dir:"netlify/plugins/rapier-jxl/",files:[["index.mjs","netlify/index.mjs"],["edge.mjs","netlify/edge.mjs"],["manifest.yml","netlify/manifest.yml"],["package.json","netlify/package.json"]]}}async function ss(e,i,{cwd:s,version:r,name:n="rapier-jxl",stdout:a,as:o=e}){if(i=R(i),i.length===1&&["--help","-h"].includes(i[0])){a(Gi(e,o));return}let h=i.includes("--dry-run"),l=i.includes("--json"),p=i.find(t=>t!=="--dry-run"&&t!=="--json");if(p)throw L("JXL_OPTIONS",`add ${o}: unknown option ${p}`,`run: npx ${M} add ${o} --help`);let c=(t,e)=>L("JXL_SETUP",t,e),u=await S(s,c);if(!u)throw L("JXL_SETUP","package.json: missing",`run: npx ${M} add ${o} in the project folder`);let{text:d,manifest:f}=u,m=[],x=[],g=Fi[o],y=Ji[e];if(g&&!B(f,g))throw c(`${Ui[o]}: missing ${g} in package.json`,`run: npx ${M} add ${o} in the ${Ui[o]} project folder`);if(!g&&!y.packages.some(t=>B(f,t))&&!await Xi(s,y.files))throw c(`This folder is not ${y.name} project: looked for ${[...y.packages,...y.files].join(", ")}`,`run npx ${M} add ${o} in the project's folder`);let b=new Map,w=async(t,e)=>{b.set(t,e)},k=async(e,i)=>{let r=await t(lt(s,e),"utf8").catch(()=>null),n=Zi(r,i);(n==="create"||n==="update")&&await w(e,i),m.push({file:e,action:n==="edited"?"left (edited)":n==="create"?"created":n==="update"?"updated":"unchanged"})},{dir:_,files:v}=await is(e,s,f),C=n;for(let[t,e]of v){let i=$((await Qi(e)).replaceAll("'../files/index.mjs'",`'./${Wi}'`),C);await k(_+t,/\.(json|yml)$/.test(t)?i:Yi(r,o,i))}if(await k(_+Wi,Yi(r,o,$(await Qi("files/index.mjs"),C))),await as[o==="nuxt"?"nuxt":e](s,{pkg:f,pkgText:d,write:w,changes:m,next:x,as:o}),B(f,n)||x.unshift(`npm install --save-dev ${n}@${r}`),await at(s,o,r,b,{dryRun:h}),l){a(JSON.stringify({type:"add",host:o,dryRun:h,changes:m,next:x}));return}for(let t of m)a(`${t.file}: ${h&&!/^(unchanged|left)/.test(t.action)?"would be ":""}${t.action}`);for(let t of x)a("next: "+t)}async function ns(e,i,s,r,{pkg:n,write:a,changes:o},{edit:h,fresh:l}={}){let p=await Xi(e,i);if(!p){let t=s(n);await a(t,l?l(t):t.endsWith(".js")&&n.type!=="module"?`const {jxl} = require('${r}');\n\nmodule.exports = {\n plugins: [jxl()],\n};\n`:`import {jxl} from '${r}';\n\nexport default {\n plugins: [jxl()],\n};\n`),o.push({file:t,action:"created"});return}let c=await t(lt(e,p),"utf8"),u=es(c,p,{importPath:r,...h});u!==null&&await a(p,u),o.push({file:p,action:u===null?"unchanged":`updated: imports the plug-in, adds jxl() to ${h?.inside?h.inside+".":""}plugins`})}import{readFile as t,access as e}from"node:fs/promises";import{lstat as i,mkdir as s,readFile as r,readlink as n,realpath as a,rename as o,rm as h,writeFile as l}from"node:fs/promises";import{randomBytes as p}from"node:crypto";import{basename as c,dirname as u,isAbsolute as d,join as f,relative as m,resolve as x,sep as g}from"node:path";var y=t=>process.platform==="win32"?t.toLowerCase():t,b=(t,e)=>{let i=m(y(t),y(e));return i===""||i!==".."&&!i.startsWith(".."+g)&&!d(i)},w=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;import{readFile as C,stat as E,rm as A,rmdir as I,chmod as P}from"node:fs/promises";import{dirname as j,join as N,sep as T}from"node:path";import{createHash as V}from"node:crypto";var L=(t,e,i)=>Object.assign(new Error(`${e}; ${i}`),{code:t,fix:i});import{readFile as O}from"node:fs/promises";var D=["jpegxl","rapier-jxl"],M=D[0];var B=(t,e)=>!!(t?.dependencies?.[e]||t?.devDependencies?.[e]),$=(t,e)=>t.replace(/\b(from\s*|import\s*\(\s*|import\s+|require(?:\.resolve)?\s*\(\s*|module:\s*)(['"])(?:jpegxl|rapier-jxl)(?=[/'"])/g,`$1$2${e}`);import{stat as U}from"node:fs/promises";import{dirname as F,join as q}from"node:path";var G=[["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"]],W=["package.json",...G.map(([t])=>t)];var H=t=>t==="emdash"?".rapier-jxl-emdash.json":".rapier-jxl-add.json",J=t=>V("sha256").update(t).digest("hex"),z=t=>L("JXL_SETUP",t,"restore the files recorded by add, then try again"),K=t=>C(t).catch(t=>{if(t.code==="ENOENT")return null;throw t}),X=t=>t===null?null:J(t),Q=(t,e)=>X(t)===e||t!==null&&J(Buffer.from(t.toString("latin1").replace(/\r\n/g,`\n`),"latin1"))===e,Y=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Z=(t,e)=>e.map(e=>t+".config."+e),tt=["rapier-jxl-files.mjs"],et=[...tt,"rapier-jxl-vite.mjs","rapier-jxl-vite.d.mts","rapier-jxl-images.d.ts","src/rapier-jxl-images.d.ts"],it={vite:[...et,...Z("vite",["ts","mts","js","mjs"])],sveltekit:[...et,...Z("vite",["ts","mts","js","mjs"])],nuxt:[...et,...Z("nuxt",["ts","mts","js","mjs"])],webpack:[...tt,"rapier-jxl-webpack.mjs","rapier-jxl-webpack.d.mts",...["webpack","rspack"].flatMap(t=>Z(t,["js","mjs","cjs","ts"]))],next:[...tt,"rapier-jxl-next.mjs","rapier-jxl-next-proxy.mjs","rapier-jxl-next-loader.mjs","package.json",".gitignore",...["","src/"].flatMap(t=>["proxy","middleware"].flatMap(e=>["js","mjs","ts"].map(i=>t+e+"."+i)))],netlify:["netlify.toml",...["index.mjs","edge.mjs","manifest.yml","package.json","rapier-jxl-files.mjs"].map(t=>"netlify/plugins/rapier-jxl/"+t)],astro:[...Z("astro",["mjs","js","ts","mts","cjs","cts"]),"src/jxl/service.mjs","src/jxl/service-workers.mjs","src/jxl/index.mjs","src/jxl/options.mjs","package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],workers:["jxl-worker.mjs","wrangler.json","wrangler.jsonc","wrangler.toml","package.json"],emdash:["astro.config.mjs","wrangler.json","wrangler.jsonc",...W]},st=(t,e)=>Object.hasOwn(it,t)&&it[t].includes(e),rt=(t,e)=>typeof e=="string"&&it[t]?.some(t=>t.startsWith(e+"/"));import{dirname as ht,join as lt}from"node:path";import{createHash as pt}from"node:crypto";import*as ct from"node:module";var ut=Object.defineProperty,dt=(t,e)=>{for(var i in e)ut(t,i,{get:e[i],enumerable:!0})},ft={};dt(ft,{Node:()=>Le,Parser:()=>le,Position:()=>Kt,SourceLocation:()=>Xt,TokContext:()=>ve,Token:()=>Ai,TokenType:()=>It,defaultOptions:()=>Yt,getLineInfo:()=>Qt,isIdentifierChar:()=>At,isIdentifierStart:()=>Et,isNewLine:()=>Dt,keywordTypes:()=>Tt,lineBreak:()=>Rt,lineBreakG:()=>Ot,nonASCIIwhitespace:()=>Bt,parse:()=>Vi,parseExpressionAt:()=>Li,tokContexts:()=>Ce,tokTypes:()=>Lt,tokenizer:()=>Ri,version:()=>Ti});var mt=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],xt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],gt="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",yt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ-ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",bt={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},wt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",kt={5:wt,"5module":wt+" export import",6:wt+" const class extends export import super"},_t=/^in(stanceof)?$/,St=new RegExp("["+yt+"]"),vt=new RegExp("["+yt+gt+"]");var It=class{constructor(t,e={}){this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null}};var jt={beforeExpr:!0},Nt={startsExpr:!0},Tt={};var Lt={num:new It("num",Nt),regexp:new It("regexp",Nt),string:new It("string",Nt),name:new It("name",Nt),privateId:new It("privateId",Nt),eof:new It("eof"),bracketL:new It("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new It("]"),braceL:new It("{",{beforeExpr:!0,startsExpr:!0}),braceR:new It("}"),parenL:new It("(",{beforeExpr:!0,startsExpr:!0}),parenR:new It(")"),comma:new It(",",jt),semi:new It(";",jt),colon:new It(":",jt),dot:new It("."),question:new It("?",jt),questionDot:new It("?."),arrow:new It("=>",jt),template:new It("template"),invalidTemplate:new It("invalidTemplate"),ellipsis:new It("...",jt),backQuote:new It("`",Nt),dollarBraceL:new It("${",{beforeExpr:!0,startsExpr:!0}),eq:new It("=",{beforeExpr:!0,isAssign:!0}),assign:new It("_=",{beforeExpr:!0,isAssign:!0}),incDec:new It("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new It("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Pt("||",1),logicalAND:Pt("&&",2),bitwiseOR:Pt("|",3),bitwiseXOR:Pt("^",4),bitwiseAND:Pt("&",5),equality:Pt("==/!=/===/!==",6),relational:Pt("</>/<=/>=",7),bitShift:Pt("<</>>/>>>",8),plusMin:new It("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Pt("%",10),star:Pt("*",10),slash:Pt("/",10),starstar:new It("**",{beforeExpr:!0}),coalesce:Pt("??",1),_break:Vt("break"),_case:Vt("case",jt),_catch:Vt("catch"),_continue:Vt("continue"),_debugger:Vt("debugger"),_default:Vt("default",jt),_do:Vt("do",{isLoop:!0,beforeExpr:!0}),_else:Vt("else",jt),_finally:Vt("finally"),_for:Vt("for",{isLoop:!0}),_function:Vt("function",Nt),_if:Vt("if"),_return:Vt("return",jt),_switch:Vt("switch"),_throw:Vt("throw",jt),_try:Vt("try"),_var:Vt("var"),_const:Vt("const"),_while:Vt("while",{isLoop:!0}),_with:Vt("with"),_new:Vt("new",{beforeExpr:!0,startsExpr:!0}),_this:Vt("this",Nt),_super:Vt("super",Nt),_class:Vt("class",Nt),_extends:Vt("extends",jt),_export:Vt("export"),_import:Vt("import",Nt),_null:Vt("null",Nt),_true:Vt("true",Nt),_false:Vt("false",Nt),_in:Vt("in",{beforeExpr:!0,binop:7}),_instanceof:Vt("instanceof",{beforeExpr:!0,binop:7}),_typeof:Vt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Vt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Vt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Rt=/\r\n?|\n|\u2028|\u2029/,Ot=new RegExp(Rt.source,"g");var Bt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,$t=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,{hasOwnProperty:Ut,toString:Ft}=Object.prototype,qt=Object.hasOwn,Gt=Array.isArray,Wt=Object.create(null);var zt=/[\uD800-\uDFFF]/u,Kt=class t{constructor(t,e){this.line=t,this.column=e}offset(e){return new t(this.line,this.column+e)}},Xt=class{constructor(t,e,i){this.start=e,this.end=i,t.sourceFile!==null&&(this.source=t.sourceFile)}};var Yt={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Zt=!1;var se=0,re=1,ne=2,ae=3,oe=4,he=5,le=class{constructor(t,e,i){this.options=t=te(t),this.sourceFile=t.sourceFile,this.keywords=Ht(kt[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);let s="";t.allowReserved!==!0&&(s=bt[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=Ht(s);let r=(s?s+" ":"")+bt.strict;this.reservedWordsStrict=Ht(r),this.reservedWordsStrictBind=Ht(r+" "+bt.strictBind),this.input=String(e),this.containsEsc=!1,this.pos=i||0,this.curLine=1,t.startLocation?(this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line):i?(this.lineStart=this.input.lastIndexOf(`\n`,i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(Rt).length)):this.lineStart=0,this.type=Lt.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||t.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]}parse(){let t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(()=>this.parseTopLevel(t))}get inFunction(){return(this.currentVarScope().flags&2)>0}get inGenerator(){return(this.currentVarScope().flags&8)>0}get inAsync(){return(this.currentVarScope().flags&4)>0}get canAwait(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768)return!1;if(e&2)return(e&4)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction}get allowReturn(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&1)}get allowSuper(){let{flags:t}=this.currentThisScope();return(t&64)>0||this.options.allowSuperOutsideMethod}get allowDirectSuper(){return(this.currentThisScope().flags&128)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}get allowNewDotTarget(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768||e&2&&!(e&16))return!0}return!1}get allowUsing(){let{flags:t}=this.currentScope();return!(t&1024||!this.inModule&&t&1)}get inClassStaticBlock(){return(this.currentVarScope().flags&256)>0}static extend(...t){let e=this;for(let i=0;i<t.length;i++)e=t[i](e);return e}static parse(t,e){return new this(e,t).parse()}static parseExpressionAt(t,e,i){let s=new this(i,t,e);return s.nextToken(),s.parseExpression()}static tokenizer(t,e){return new this(e,t)}},pe=le.prototype,ce=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;pe.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){$t.lastIndex=t,t+=$t.exec(this.input)[0].length;let e=ce.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){$t.lastIndex=t+e[0].length;let i=$t.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Rt.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="="||r==="i"&&ue(this,s))}t+=e[0].length,$t.lastIndex=t,t+=$t.exec(this.input)[0].length,this.input[t]===";"&&t++}};pe.eat=function(t){return this.type===t?(this.next(),!0):!1};pe.isContextual=function(t){return this.type===Lt.name&&this.value===t&&!this.containsEsc};pe.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};pe.catchStackOverflow=function(t){try{return t()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};pe.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};pe.canInsertSemicolon=function(){return this.type===Lt.eof||this.type===Lt.braceR||Rt.test(this.input.slice(this.lastTokEnd,this.start))};pe.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};pe.semicolon=function(){!this.eat(Lt.semi)&&!this.insertSemicolon()&&this.unexpected()};pe.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};pe.expect=function(t){this.eat(t)||this.unexpected()};pe.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};var de=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};pe.checkPatternErrors=function(t,e){if(!t)return;t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");let i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")};pe.checkExpressionErrors=function(t,e){if(!t)return!1;let{shorthandAssign:i,doubleProto:s}=t;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};pe.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};pe.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var fe=le.prototype;fe.parseTopLevel=function(t){let e=Object.create(null);for(t.body||(t.body=[]);this.type!==Lt.eof;){let i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(let t of Object.keys(this.undefinedExports))this.raiseRecoverable(this.undefinedExports[t].start,`Export '${t}' is not defined`);return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(t,"Program")};var me={kind:"loop"},xe={kind:"switch"};fe.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;$t.lastIndex=this.pos;let e=$t.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(t)return!1;if(s===123)return!0;if(Et(s)){let t=i;do{i+=s<=65535?1:2}while(At(s=this.fullCharCodeAt(i)));if(s===92)return!0;let e=this.input.slice(t,i);if(!_t.test(e))return!0}return!1};fe.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;$t.lastIndex=this.pos;let t=$t.exec(this.input),e=this.pos+t[0].length,i;return!Rt.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(At(i=this.fullCharCodeAt(e+8))||i===92))};fe.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;$t.lastIndex=this.pos;let i=$t.exec(this.input),s=this.pos+i[0].length;if(Rt.test(this.input.slice(this.pos,s)))return!1;if(t){let t=s+5,e;if(this.input.slice(s,t)!=="using"||t===this.input.length||At(e=this.fullCharCodeAt(t))||e===92)return!1;$t.lastIndex=t;let i=$t.exec(this.input);if(s=t+i[0].length,i&&Rt.test(this.input.slice(t,s)))return!1}let r=this.fullCharCodeAt(s);if(!Et(r)&&r!==92)return!1;let n=s;do{s+=r<=65535?1:2}while(At(r=this.fullCharCodeAt(s)));if(r===92)return!0;let a=this.input.slice(n,s);if(_t.test(a))return!1;if(e&&!t&&a==="of"){$t.lastIndex=s;let t=$t.exec(this.input);if(s=s+t[0].length,this.input.charCodeAt(s)!==61||(r=this.input.charCodeAt(s+1))===61||r===62)return!1}return!0};fe.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)};fe.isUsing=function(t){return this.isUsingKeyword(!1,t)};fe.parseStatement=function(t,e,i){let s=this.type,r=this.startNode(),n;switch(this.isLet(t)&&(s=Lt._var,n="let"),s){case Lt._break:case Lt._continue:return this.parseBreakContinueStatement(r,s.keyword);case Lt._debugger:return this.parseDebuggerStatement(r);case Lt._do:return this.parseDoStatement(r);case Lt._for:return this.parseForStatement(r);case Lt._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case Lt._class:return t&&this.unexpected(),this.parseClass(r,!0);case Lt._if:return this.parseIfStatement(r);case Lt._return:return this.parseReturnStatement(r);case Lt._switch:return this.parseSwitchStatement(r);case Lt._throw:return this.parseThrowStatement(r);case Lt._try:return this.parseTryStatement(r);case Lt._const:case Lt._var:return n=n||this.value,t&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case Lt._while:return this.parseWhileStatement(r);case Lt._with:return this.parseWithStatement(r);case Lt.braceL:return this.parseBlock(!0,r);case Lt.semi:return this.parseEmptyStatement(r);case Lt._export:case Lt._import:if(this.options.ecmaVersion>10&&s===Lt._import){$t.lastIndex=this.pos;let t=$t.exec(this.input),e=this.pos+t[0].length,i=this.input.charCodeAt(e);if(i===40||i===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===Lt._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);let a=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(a)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),t&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),a==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,a),this.semicolon(),this.finishNode(r,"VariableDeclaration");let o=this.value,h=this.parseExpression();return s===Lt.name&&h.type==="Identifier"&&this.eat(Lt.colon)?this.parseLabeledStatement(r,o,h,t):this.parseExpressionStatement(r,h)}};fe.parseBreakContinueStatement=function(t,e){let i=e==="break";this.next(),this.eat(Lt.semi)||this.insertSemicolon()?t.label=null:this.type!==Lt.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());let s=0;for(;s<this.labels.length;++s){let e=this.labels[s];if((t.label==null||e.name===t.label.name)&&(e.kind!=null&&(i||e.kind==="loop")||t.label&&i))break}return s===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")};fe.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};fe.parseDoStatement=function(t){return this.next(),this.labels.push(me),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(Lt._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Lt.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};fe.parseForStatement=function(t){this.next();let e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(me),this.enterScope(0),this.expect(Lt.parenL),this.type===Lt.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);let i=this.isLet();if(this.type===Lt._var||this.type===Lt._const||i){let s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}let s=this.isContextual("let"),r=!1,n=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(n){let i=this.startNode();return this.next(),n==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(t,i,e)}let a=this.containsEsc,o=new de,h=this.start,l=e>-1?this.parseExprSubscripts(o,"await"):this.parseExpression(!0,o);return this.type===Lt._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===Lt._in&&this.unexpected(e),t.await=!0):r&&this.options.ecmaVersion>=8&&(l.start===h&&!a&&l.type==="Identifier"&&l.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),s&&r&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,o),this.checkLValPattern(l),this.parseForIn(t,l)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,l))};fe.parseForAfterInit=function(t,e,i){return(this.type===Lt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&e.declarations.length===1?(this.type===Lt._in?((e.kind==="using"||e.kind==="await using")&&!e.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(t.await=i>-1),this.parseForIn(t,e)):(i>-1&&this.unexpected(i),this.parseFor(t,e))};fe.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,ye|(i?0:be),!1,e)};fe.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(Lt._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};fe.parseReturnStatement=function(t){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Lt.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};fe.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(Lt.braceL),this.labels.push(xe),this.enterScope(1024);let e;for(let i=!1;this.type!==Lt.braceR;)if(this.type===Lt._case||this.type===Lt._default){let s=this.type===Lt._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(Lt.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};fe.parseThrowStatement=function(t){return this.next(),Rt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var ge=[];fe.parseCatchClauseParam=function(){let t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?32:0),this.checkLValPattern(t,e?oe:ne),this.expect(Lt.parenR),t};fe.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===Lt._catch){let e=this.startNode();this.next(),this.eat(Lt.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(Lt._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};fe.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};fe.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(me),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};fe.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};fe.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};fe.parseLabeledStatement=function(t,e,i,s){for(let t of this.labels)t.name===e&&this.raise(i.start,"Label '"+e+"' is already declared");let r=this.type.isLoop?"loop":this.type===Lt._switch?"switch":null;for(let e=this.labels.length-1;e>=0;e--){let i=this.labels[e];if(i.statementStart===t.start)i.statementStart=this.start,i.kind=r;else break}return this.labels.push({name:e,kind:r,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};fe.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};fe.parseBlock=function(t=!0,e=this.startNode(),i){for(e.body=[],this.expect(Lt.braceL),t&&this.enterScope(0);this.type!==Lt.braceR;){let t=this.parseStatement(null);e.body.push(t)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};fe.parseFor=function(t,e){return t.init=e,this.expect(Lt.semi),t.test=this.type===Lt.semi?null:this.parseExpression(),this.expect(Lt.semi),t.update=this.type===Lt.parenR?null:this.parseExpression(),this.expect(Lt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};fe.parseForIn=function(t,e){let i=this.type===Lt._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,`${i?"for-in":"for-of"} loop variable declaration may not have an initializer`),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Lt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};fe.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),this.eat(Lt.eq)?r.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===Lt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==Lt._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,`Missing initializer in ${i} declaration`):!s&&r.id.type!=="Identifier"&&!(e&&(this.type===Lt._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(Lt.comma))break}return t};fe.parseVarId=function(t,e){t.id=e==="using"||e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?re:ne,!1)};var ye=1,be=2,we=4;fe.parseFunction=function(t,e,i,s,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===Lt.star&&e&be&&this.unexpected(),t.generator=this.eat(Lt.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&ye&&(t.id=e&we&&this.type!==Lt.name?null:this.parseIdent(),t.id&&!(e&be)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?re:ne:ae));let n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ie(t.async,t.generator)),e&ye||(t.id=this.type===Lt.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,r),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(t,e&ye?"FunctionDeclaration":"FunctionExpression")};fe.parseFunctionParams=function(t){this.expect(Lt.parenL),t.params=this.parseBindingList(Lt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};fe.parseClass=function(t,e){this.next();let i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);let s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(Lt.braceL);this.type!==Lt.braceR;){let e=this.parseClassElement(t.superClass!==null);e&&(r.body.push(e),e.type==="MethodDefinition"&&e.kind==="constructor"?(n&&this.raiseRecoverable(e.start,"Duplicate constructor in the same class"),n=!0):e.key&&e.key.type==="PrivateIdentifier"&&ke(s,e)&&this.raiseRecoverable(e.key.start,`Identifier '#${e.key.name}' has already been declared`))}return this.strict=i,this.next(),t.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};fe.parseClassElement=function(t){if(this.eat(Lt.semi))return null;let e=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(Lt.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===Lt.star?o=!0:s="static"}if(i.static=o,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===Lt.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(e>=9||!n)&&this.eat(Lt.star)&&(r=!0),!s&&!n&&!r){let t=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=t:s=t)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===Lt.parenL||a!=="method"||r||n){let e=!i.static&&_e(i,"constructor"),s=e&&t;e&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=e?"constructor":a,this.parseClassMethod(i,r,n,s)}else this.parseClassField(i);return i};fe.isClassElementNameStart=function(){return this.type===Lt.name||this.type===Lt.privateId||this.type===Lt.num||this.type===Lt.string||this.type===Lt.bracketL||this.type.keyword};fe.parseClassElementName=function(t){this.type===Lt.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};fe.parseClassMethod=function(t,e,i,s){let r=t.key;t.kind==="constructor"?(e&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):t.static&&_e(t,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");let n=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),t.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),t.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};fe.parseClassField=function(t){return _e(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&_e(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(Lt.eq)?(this.enterScope(576),t.value=this.parseMaybeAssign(),this.exitScope()):t.value=null,this.semicolon(),this.finishNode(t,"PropertyDefinition")};fe.parseClassStaticBlock=function(t){t.body=[];let e=this.labels;for(this.labels=[],this.enterScope(320);this.type!==Lt.braceR;){let e=this.parseStatement(null);t.body.push(e)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};fe.parseClassId=function(t,e){this.type===Lt.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,ne,!1)):(e===!0&&this.unexpected(),t.id=null)};fe.parseClassSuper=function(t){t.superClass=this.eat(Lt._extends)?this.parseExprSubscripts(null,!1):null};fe.enterClassBody=function(){let t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};fe.exitClassBody=function(){let{declared:t,used:e}=this.privateNameStack.pop();if(!this.options.checkPrivateFields)return;let i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1];for(let i=0;i<e.length;++i){let r=e[i];qt(t,r.name)||(s?s.used.push(r):this.raiseRecoverable(r.start,`Private field '#${r.name}' must be declared in an enclosing class`))}};fe.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==Lt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};fe.parseExport=function(t,e){if(this.next(),this.eat(Lt.star))return this.parseExportAllDeclaration(t,e);if(this.eat(Lt._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[]);else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==Lt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause());else{for(let e of t.specifiers)this.checkUnreserved(e.local),this.checkLocalExport(e.local),e.local.type==="Literal"&&this.raise(e.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[])}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};fe.parseExportDeclaration=function(t){return this.parseStatement(null)};fe.parseExportDefaultDeclaration=function(){let t;if(this.type===Lt._function||(t=this.isAsyncFunction())){let e=this.startNode();return this.next(),t&&this.next(),this.parseFunction(e,ye|we,!1,t)}else if(this.type===Lt._class){let t=this.startNode();return this.parseClass(t,"nullableID")}else{let t=this.parseMaybeAssign();return this.semicolon(),t}};fe.checkExport=function(t,e,i){t&&(typeof e!="string"&&(e=e.type==="Identifier"?e.name:e.value),qt(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)};fe.checkPatternExport=function(t,e){let i=e.type;if(i==="Identifier")this.checkExport(t,e,e.start);else if(i==="ObjectPattern")for(let i of e.properties)this.checkPatternExport(t,i);else if(i==="ArrayPattern")for(let i of e.elements)i&&this.checkPatternExport(t,i);else i==="Property"?this.checkPatternExport(t,e.value):i==="AssignmentPattern"?this.checkPatternExport(t,e.left):i==="RestElement"&&this.checkPatternExport(t,e.argument)};fe.checkVariableExport=function(t,e){if(t)for(let i of e)this.checkPatternExport(t,i.id)};fe.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};fe.parseExportSpecifier=function(t){let e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")};fe.parseExportSpecifiers=function(t){let e=[],i=!0;for(this.expect(Lt.braceL);!this.eat(Lt.braceR);){if(i)i=!1;else if(this.expect(Lt.comma),this.afterTrailingComma(Lt.braceR))break;e.push(this.parseExportSpecifier(t))}return e};fe.parseImport=function(t){return this.next(),this.type===Lt.string?(t.specifiers=ge,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===Lt.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ImportDeclaration")};fe.parseImportSpecifier=function(){let t=this.startNode();return t.imported=this.parseModuleExportName(),this.eatContextual("as")?t.local=this.parseIdent():(this.checkUnreserved(t.imported),t.local=t.imported),this.checkLValSimple(t.local,ne),this.finishNode(t,"ImportSpecifier")};fe.parseImportDefaultSpecifier=function(){let t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,ne),this.finishNode(t,"ImportDefaultSpecifier")};fe.parseImportNamespaceSpecifier=function(){let t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,ne),this.finishNode(t,"ImportNamespaceSpecifier")};fe.parseImportSpecifiers=function(){let t=[],e=!0;if(this.type===Lt.name&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(Lt.comma)))return t;if(this.type===Lt.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(Lt.braceL);!this.eat(Lt.braceR);){if(e)e=!1;else if(this.expect(Lt.comma),this.afterTrailingComma(Lt.braceR))break;t.push(this.parseImportSpecifier())}return t};fe.parseWithClause=function(){let t=[];if(!this.eat(Lt._with))return t;this.expect(Lt.braceL);let e={},i=!0;for(;!this.eat(Lt.braceR);){if(i)i=!1;else if(this.expect(Lt.comma),this.afterTrailingComma(Lt.braceR))break;let s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;qt(e,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),e[r]=!0,t.push(s)}return t};fe.parseImportAttribute=function(){let t=this.startNode();return t.key=this.type===Lt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Lt.colon),this.type!==Lt.string&&this.unexpected(),t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")};fe.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Lt.string){let t=this.parseLiteral(this.value);return zt.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};fe.adaptDirectivePrologue=function(t){for(let e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};fe.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var Se=le.prototype;Se.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(let i of t.properties)this.toAssignable(i,e),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token");break;case"Property":t.kind!=="init"&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern"&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":t.operator!=="="&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t};Se.toAssignableList=function(t,e){let i=t.length;for(let s=0;s<i;s++){let i=t[s];i&&this.toAssignable(i,e)}if(i){let s=t[i-1];this.options.ecmaVersion===6&&e&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return t};Se.parseSpread=function(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};Se.parseRestBinding=function(){let t=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==Lt.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};Se.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Lt.bracketL:let t=this.startNode();return this.next(),t.elements=this.parseBindingList(Lt.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case Lt.braceL:return this.parseObj(!0)}return this.parseIdent()};Se.parseBindingList=function(t,e,i,s){let r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(Lt.comma),e&&this.type===Lt.comma)r.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===Lt.ellipsis){let e=this.parseRestBinding();this.parseBindingListItem(e),r.push(e),this.type===Lt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else r.push(this.parseAssignableListItem(s))}return r};Se.parseAssignableListItem=function(t){let e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e};Se.parseBindingListItem=function(t){return t};Se.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Lt.eq))return i;let s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};Se.checkLValSimple=function(t,e=se,i){let s=e!==se;switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(e===ne&&t.name==="let"&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),i&&(qt(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),e!==he&&this.declareName(t.name,e,t.start));break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(t.start,"Binding parenthesized expression"),this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}};Se.checkLValPattern=function(t,e=se,i){switch(t.type){case"ObjectPattern":for(let s of t.properties)this.checkLValInnerPattern(s,e,i);break;case"ArrayPattern":for(let s of t.elements)s&&this.checkLValInnerPattern(s,e,i);break;default:this.checkLValSimple(t,e,i)}};Se.checkLValInnerPattern=function(t,e=se,i){switch(t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var ve=class{constructor(t,e,i,s,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!r}},Ce={b_stat:new ve("{",!1),b_expr:new ve("{",!0),b_tmpl:new ve("${",!1),p_stat:new ve("(",!1),p_expr:new ve("(",!0),q_tmpl:new ve("`",!0,!0,t=>t.tryReadTemplateToken()),f_stat:new ve("function",!1),f_expr:new ve("function",!0),f_expr_gen:new ve("function",!0,!1,null,!0),f_gen:new ve("function",!1,!1,null,!0)},Ee=le.prototype;Ee.initialContext=function(){return[Ce.b_stat]};Ee.curContext=function(){return this.context[this.context.length-1]};Ee.braceIsBlock=function(t){let e=this.curContext();return e===Ce.f_expr||e===Ce.f_stat?!0:t===Lt.colon&&(e===Ce.b_stat||e===Ce.b_expr)?!e.isExpr:t===Lt._return||t===Lt.name&&this.exprAllowed?Rt.test(this.input.slice(this.lastTokEnd,this.start)):t===Lt._else||t===Lt.semi||t===Lt.eof||t===Lt.parenR||t===Lt.arrow?!0:t===Lt.braceL?e===Ce.b_stat:t===Lt._var||t===Lt._const||t===Lt.name?!1:!this.exprAllowed};Ee.inGeneratorContext=function(){for(let t=this.context.length-1;t>=1;t--){let e=this.context[t];if(e.token==="function")return e.generator}return!1};Ee.updateContext=function(t){let e,i=this.type;i.keyword&&t===Lt.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr};Ee.overrideContext=function(t){this.curContext()!==t&&(this.context[this.context.length-1]=t)};Lt.parenR.updateContext=Lt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}let t=this.context.pop();t===Ce.b_stat&&this.curContext().token==="function"&&(t=this.context.pop()),this.exprAllowed=!t.isExpr};Lt.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?Ce.b_stat:Ce.b_expr),this.exprAllowed=!0};Lt.dollarBraceL.updateContext=function(){this.context.push(Ce.b_tmpl),this.exprAllowed=!0};Lt.parenL.updateContext=function(t){let e=t===Lt._if||t===Lt._for||t===Lt._with||t===Lt._while;this.context.push(e?Ce.p_stat:Ce.p_expr),this.exprAllowed=!0};Lt.incDec.updateContext=function(){};Lt._function.updateContext=Lt._class.updateContext=function(t){t.beforeExpr&&t!==Lt._else&&!(t===Lt.semi&&this.curContext()!==Ce.p_stat)&&!(t===Lt._return&&Rt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===Lt.colon||t===Lt.braceL)&&this.curContext()===Ce.b_stat)?this.context.push(Ce.f_expr):this.context.push(Ce.f_stat),this.exprAllowed=!1};Lt.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};Lt.backQuote.updateContext=function(){this.curContext()===Ce.q_tmpl?this.context.pop():this.context.push(Ce.q_tmpl),this.exprAllowed=!1};Lt.star.updateContext=function(t){if(t===Lt._function){let t=this.context.length-1;this.context[t]===Ce.f_expr?this.context[t]=Ce.f_expr_gen:this.context[t]=Ce.f_gen}this.exprAllowed=!0};Lt.name.updateContext=function(t){let e=!1;this.options.ecmaVersion>=6&&t!==Lt.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Ae=le.prototype;Ae.checkPropClash=function(t,e,i){if(this.options.ecmaVersion>=9&&t.type==="SpreadElement"||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))return;let{key:s}=t,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}let{kind:n}=t;if(this.options.ecmaVersion>=6){r==="__proto__"&&n==="init"&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),e.proto=!0);return}r="$"+r;let a=e[r];if(a){let t;n==="init"?t=this.strict&&a.init||a.get||a.set:t=a.init||a[n],t&&this.raiseRecoverable(s.start,"Redefinition of property")}else a=e[r]={init:!1,get:!1,set:!1};a[n]=!0};Ae.parseExpression=function(t,e){return this.catchStackOverflow(()=>{let i=this.start,s=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type===Lt.comma){let n=this.startNodeAt(i,s);for(n.expressions=[r];this.eat(Lt.comma);)n.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(n,"SequenceExpression")}return r})};Ae.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}let s=!1,r=-1,n=-1,a=-1;e?(r=e.parenthesizedAssign,n=e.trailingComma,a=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new de,s=!0);let o=this.start,h=this.startLoc;(this.type===Lt.parenL||this.type===Lt.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=t==="await");let l=this.parseMaybeConditional(t,e);if(i&&(l=i.call(this,l,o,h)),this.type.isAssign){let i=this.startNodeAt(o,h);return i.operator=this.value,this.type===Lt.eq&&(l=this.toAssignable(l,!1,e)),s||(e.parenthesizedAssign=e.trailingComma=-1,e.shorthandAssign>=l.start&&(e.shorthandAssign=-1),e.doubleProto>=l.start&&(e.doubleProto=-1)),this.type===Lt.eq?this.checkLValPattern(l):this.checkLValSimple(l),i.left=l,this.next(),i.right=this.parseMaybeAssign(t),a>-1&&(e.doubleProto=a),this.finishNode(i,"AssignmentExpression")}else s&&this.checkExpressionErrors(e,!0);return r>-1&&(e.parenthesizedAssign=r),n>-1&&(e.trailingComma=n),l};Ae.parseMaybeConditional=function(t,e){let i=this.start,s=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===i)&&this.eat(Lt.question)){let e=this.startNodeAt(i,s);return e.test=r,e.consequent=this.parseMaybeAssign(),this.expect(Lt.colon),e.alternate=this.parseMaybeAssign(t),this.finishNode(e,"ConditionalExpression")}return r};Ae.parseExprOps=function(t,e){let i=this.start,s=this.startLoc,r=this.parseMaybeUnary(e,!1,!1,t);return this.checkExpressionErrors(e)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,t)};Ae.parseExprOp=function(t,e,i,s,r){let n=this.type.binop;if(n!=null&&(!r||this.type!==Lt._in)&&n>s){let a=this.type===Lt.logicalOR||this.type===Lt.logicalAND,o=this.type===Lt.coalesce;o&&(n=Lt.logicalAND.binop);let h=this.value;this.next();let l=this.start,p=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),l,p,n,r),u=this.buildBinary(e,i,t,c,h,a||o);return(a&&this.type===Lt.coalesce||o&&(this.type===Lt.logicalOR||this.type===Lt.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,e,i,s,r)}return t};Ae.buildBinary=function(t,e,i,s,r,n){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");let a=this.startNodeAt(t,e);return a.left=i,a.operator=r,a.right=s,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};Ae.parseMaybeUnary=function(t,e,i,s){let r=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(s),e=!0;else if(this.type.prefix){let i=this.startNode(),r=this.type===Lt.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0,r,s),this.checkExpressionErrors(t,!0),r?this.checkLValSimple(i.argument):this.strict&&i.operator==="delete"&&Ie(i.argument)?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):i.operator==="delete"&&Pe(i.argument)?this.raiseRecoverable(i.start,"Private fields can not be deleted"):e=!0,a=this.finishNode(i,r?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===Lt.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==Lt._in&&this.unexpected();else{if(a=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){let t=this.startNodeAt(r,n);t.operator=this.value,t.prefix=!1,t.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(t,"UpdateExpression")}}if(!i&&!(a.type==="ArrowFunctionExpression"&&a.start===r)&&this.eat(Lt.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(r,n,a,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return a};Ae.parseExprSubscripts=function(t,e){let i=this.start,s=this.startLoc,r=-1,n=-1;t&&(r=t.doubleProto,n=t.shorthandAssign,t.doubleProto=t.shorthandAssign=-1);let a=this.parseExprAtom(t,e);if(a.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return a;let o=this.parseSubscripts(a,i,s,!1,e);return t&&(o.end>a.end&&(this.checkExpressionErrors(t,!0),t.parenthesizedAssign>=o.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=o.start&&(t.parenthesizedBind=-1),t.trailingComma>=o.start&&(t.trailingComma=-1)),r>-1&&(t.doubleProto=r),n>-1&&(t.shorthandAssign=n)),o};Ae.parseSubscripts=function(t,e,i,s,r){let n=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,a=!1;for(;;){let o=this.parseSubscript(t,e,i,s,n,a,r);if(o.optional&&(a=!0),o.end===t.end||o.type==="ArrowFunctionExpression"){if(a){let t=this.startNodeAt(e,i);t.expression=o,o=this.finishNode(t,"ChainExpression")}return o}t=o,n=!1}};Ae.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Lt.arrow)};Ae.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)};Ae.parseSubscript=function(t,e,i,s,r,n,a){let o=this.options.ecmaVersion>=11,h=o&&this.eat(Lt.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let l=this.eat(Lt.bracketL);if(l||h&&this.type!==Lt.parenL&&this.type!==Lt.backQuote||this.eat(Lt.dot)){let s=this.startNodeAt(e,i);s.object=t,l?(s.property=this.parseExpression(),this.expect(Lt.bracketR)):this.type===Lt.privateId&&t.type!=="Super"?s.property=this.parsePrivateIdent():s.property=this.parseIdent(this.options.allowReserved!=="never"),s.computed=!!l,o&&(s.optional=h),t=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(Lt.parenL)){let s=new de,n=this.yieldPos,l=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let c=this.parseExprList(Lt.parenR,this.options.ecmaVersion>=8,!1,s);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=n,this.awaitPos=l,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(e,i,c,a);this.checkExpressionErrors(s,!0),this.yieldPos=n||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;let u=this.startNodeAt(e,i);u.callee=t,u.arguments=c,o&&(u.optional=h),t=this.finishNode(u,"CallExpression")}else if(this.type===Lt.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(e,i);s.tag=t,s.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(s,"TaggedTemplateExpression")}return t};Ae.parseExprAtom=function(t,e,i){this.type===Lt.slash&&this.readRegexp();let s,r=this.potentialArrowAt===this.start;switch(this.type){case Lt._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===Lt.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==Lt.dot&&this.type!==Lt.bracketL&&this.type!==Lt.parenL&&this.unexpected(),this.finishNode(s,"Super");case Lt._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case Lt.name:let n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(Lt._function))return this.overrideContext(Ce.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,e);if(r&&!this.canInsertSemicolon()){if(this.eat(Lt.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,e);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===Lt.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(Lt.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,e)}return h;case Lt.regexp:let l=this.value;return s=this.parseLiteral(l.value),s.regex={pattern:l.pattern,flags:l.flags},s;case Lt.num:case Lt.string:return this.parseLiteral(this.value);case Lt._null:case Lt._true:case Lt._false:return s=this.startNode(),s.value=this.type===Lt._null?null:this.type===Lt._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case Lt.parenL:let p=this.start,c=this.parseParenAndDistinguishExpression(r,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(t.parenthesizedAssign=p),t.parenthesizedBind<0&&(t.parenthesizedBind=p)),c;case Lt.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(Lt.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case Lt.braceL:return this.overrideContext(Ce.b_expr),this.parseObj(!1,t);case Lt._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case Lt._class:return this.parseClass(this.startNode(),!1);case Lt._new:return this.parseNew();case Lt.backQuote:return this.parseTemplate();case Lt._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};Ae.parseExprAtomDefault=function(){this.unexpected()};Ae.parseExprImport=function(t){let e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===Lt.parenL&&!t)return this.parseDynamicImport(e);if(this.type===Lt.dot){let t=this.startNodeAt(e.start,e.loc&&e.loc.start);return t.name="import",e.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};Ae.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(Lt.parenR)?t.options=null:(this.expect(Lt.comma),this.afterTrailingComma(Lt.parenR)?t.options=null:(t.options=this.parseMaybeAssign(),this.eat(Lt.parenR)||(this.expect(Lt.comma),this.afterTrailingComma(Lt.parenR)||this.unexpected())));else if(!this.eat(Lt.parenR)){let t=this.start;this.eat(Lt.comma)&&this.eat(Lt.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(t,"ImportExpression")};Ae.parseImportMeta=function(t){this.next();let e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};Ae.parseLiteral=function(t){let e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.value!=null?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};Ae.parseParenExpression=function(){this.expect(Lt.parenL);let t=this.parseExpression();return this.expect(Lt.parenR),t};Ae.shouldParseArrow=function(t){return!this.canInsertSemicolon()};Ae.parseParenAndDistinguishExpression=function(t,e){let i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();let a=this.start,o=this.startLoc,h=[],l=!0,p=!1,c=new de,u=this.yieldPos,d=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==Lt.parenR;)if(l?l=!1:this.expect(Lt.comma),n&&this.afterTrailingComma(Lt.parenR,!0)){p=!0;break}else if(this.type===Lt.ellipsis){f=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Lt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,c,this.parseParenItem));let m=this.lastTokEnd,x=this.lastTokEndLoc;if(this.expect(Lt.parenR),t&&this.shouldParseArrow(h)&&this.eat(Lt.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(i,s,h,e);(!h.length||p)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?(r=this.startNodeAt(a,o),r.expressions=h,this.finishNodeAt(r,"SequenceExpression",m,x)):r=h[0]}else r=this.parseParenExpression();if(this.options.preserveParens){let t=this.startNodeAt(i,s);return t.expression=r,this.finishNode(t,"ParenthesizedExpression")}else return r};Ae.parseParenItem=function(t){return t};Ae.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var je=[];Ae.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Lt.dot){let e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();let i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}let e=this.start,i=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),e,i,!0,!1),t.callee.type==="Super"&&this.raiseRecoverable(e,"Invalid use of 'super'"),this.eat(Lt.parenL)?t.arguments=this.parseExprList(Lt.parenR,this.options.ecmaVersion>=8,!1):t.arguments=je,this.finishNode(t,"NewExpression")};Ae.parseTemplateElement=function({isTagged:t}){let e=this.startNode();return this.type===Lt.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),e.value={raw:this.value.replace(/\r\n?/g,`\n`),cooked:null}):e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`\n`),cooked:this.value},this.next(),e.tail=this.type===Lt.backQuote,this.finishNode(e,"TemplateElement")};Ae.parseTemplate=function({isTagged:t=!1}={}){let e=this.startNode();this.next(),e.expressions=[];let i=this.parseTemplateElement({isTagged:t});for(e.quasis=[i];!i.tail;)this.type===Lt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Lt.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(Lt.braceR),e.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(e,"TemplateLiteral")};Ae.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===Lt.name||this.type===Lt.num||this.type===Lt.string||this.type===Lt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Lt.star)&&!Rt.test(this.input.slice(this.lastTokEnd,this.start))};Ae.parseObj=function(t,e){let i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(Lt.braceR);){if(s)s=!1;else if(this.expect(Lt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Lt.braceR))break;let n=this.parseProperty(t,e);t||this.checkPropClash(n,r,e),i.properties.push(n)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};Ae.parseProperty=function(t,e){let i=this.startNode(),s,r,n,a;if(this.options.ecmaVersion>=9&&this.eat(Lt.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===Lt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===Lt.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(n=this.start,a=this.startLoc),t||(s=this.eat(Lt.star)));let o=this.containsEsc;return this.parsePropertyName(i),!t&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(Lt.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,t,s,r,n,a,e,o),this.finishNode(i,"Property")};Ae.parseGetterSetter=function(t){let e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;let i=t.kind==="get"?0:1;if(t.value.params.length!==i){let e=t.value.start;t.kind==="get"?this.raiseRecoverable(e,"getter should have no params"):this.raiseRecoverable(e,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};Ae.parsePropertyValue=function(t,e,i,s,r,n,a,o){(i||s)&&this.type===Lt.colon&&this.unexpected(),this.eat(Lt.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init"):this.options.ecmaVersion>=6&&this.type===Lt.parenL?(e&&this.unexpected(),t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"):!e&&!o&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==Lt.comma&&this.type!==Lt.braceR&&this.type!==Lt.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e?t.value=this.parseMaybeDefault(r,n,this.copyNode(t.key)):this.type===Lt.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,n,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.kind="init",t.shorthand=!0):this.unexpected()};Ae.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(Lt.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(Lt.bracketR),t.key;t.computed=!1}return t.key=this.type===Lt.num||this.type===Lt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Ae.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};Ae.parseMethod=function(t,e,i){let s=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ie(e,s.generator)|64|(i?128:0)),this.expect(Lt.parenL),s.params=this.parseBindingList(Lt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")};Ae.parseArrowExpression=function(t,e,i,s){let r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(ie(i,!1)|16),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(t,"ArrowFunctionExpression")};Ae.parseFunctionBody=function(t,e,i,s){let r=e&&this.type!==Lt.braceL,n=this.strict,a=!1;if(r)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{let s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!n||s)&&(a=this.strictDirective(this.end),a&&s&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));let r=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(t,!n&&!a&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,he),t.body=this.parseBlock(!1,void 0,a&&!n),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=r}this.exitScope()};Ae.isSimpleParamList=function(t){for(let e of t)if(e.type!=="Identifier")return!1;return!0};Ae.checkParams=function(t,e){let i=Object.create(null);for(let s of t.params)this.checkLValInnerPattern(s,re,e?null:i)};Ae.parseExprList=function(t,e,i,s){let r=[],n=!0;for(;!this.eat(t);){if(n)n=!1;else if(this.expect(Lt.comma),e&&this.afterTrailingComma(t))break;let a;i&&this.type===Lt.comma?a=null:this.type===Lt.ellipsis?(a=this.parseSpread(s),s&&this.type===Lt.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):a=this.parseMaybeAssign(!1,s),r.push(a)}return r};Ae.checkUnreserved=function({start:t,end:e,name:i}){this.inGenerator&&i==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&259)&&i==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(t,`Cannot use ${i} in class static initialization block`),this.keywords.test(i)&&this.raise(t,`Unexpected keyword '${i}'`),!(this.options.ecmaVersion<6&&this.input.slice(t,e).indexOf("\\")!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,`The keyword '${i}' is reserved`))};Ae.parseIdent=function(t){let e=this.parseIdentNode();return this.next(!!t),this.finishNode(e,"Identifier"),t||(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=e.start)),e};Ae.parseIdentNode=function(){let t=this.startNode();return this.type===Lt.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=Lt.name):this.unexpected(),t};Ae.parsePrivateIdent=function(){let t=this.startNode();return this.type===Lt.privateId?t.name=this.value:this.unexpected(),this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(t.start,`Private field '#${t.name}' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(t)),t};Ae.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);let e=this.startNode();return this.next(),this.type===Lt.semi||this.canInsertSemicolon()||this.type!==Lt.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(Lt.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")};Ae.parseAwait=function(t){this.awaitPos||(this.awaitPos=this.start);let e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var Ne=le.prototype;Ne.raise=function(t,e){let i=Qt(this.input,t);e+=" ("+i.line+":"+i.column+")",this.sourceFile&&(e+=" in "+this.sourceFile);let s=new SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s};Ne.raiseRecoverable=Ne.raise;Ne.curPosition=function(){if(this.options.locations)return new Kt(this.curLine,this.pos-this.lineStart)};var Te=le.prototype,Ve=class{constructor(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]}};Te.enterScope=function(t){this.scopeStack.push(new Ve(t))};Te.exitScope=function(){this.scopeStack.pop()};Te.treatFunctionsAsVarInScope=function(t){return t.flags&2||!this.inModule&&t.flags&1};Te.declareName=function(t,e,i){let s=!1;if(e===ne){let e=this.currentScope();s=e.lexical.indexOf(t)>-1||e.functions.indexOf(t)>-1||e.var.indexOf(t)>-1,e.lexical.push(t),this.inModule&&e.flags&1&&delete this.undefinedExports[t]}else if(e===oe)this.currentScope().lexical.push(t);else if(e===ae){let e=this.currentScope();this.treatFunctionsAsVar?s=e.lexical.indexOf(t)>-1:s=e.lexical.indexOf(t)>-1||e.var.indexOf(t)>-1,e.functions.push(t)}else for(let e=this.scopeStack.length-1;e>=0;--e){let i=this.scopeStack[e];if(i.lexical.indexOf(t)>-1&&!(i.flags&32&&i.lexical[0]===t)||!this.treatFunctionsAsVarInScope(i)&&i.functions.indexOf(t)>-1){s=!0;break}if(i.var.push(t),this.inModule&&i.flags&1&&delete this.undefinedExports[t],i.flags&259)break}s&&this.raiseRecoverable(i,`Identifier '${t}' has already been declared`)};Te.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Te.currentVarScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771)return e}};Te.currentThisScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771&&!(e.flags&16))return e}};var Le=class{constructor(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new Xt(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])}},Re=le.prototype;Re.startNode=function(){return new Le(this,this.start,this.startLoc)};Re.startNodeAt=function(t,e){return new Le(this,t,e)};Re.finishNode=function(t,e){return Oe.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Re.finishNodeAt=function(t,e,i,s){return Oe.call(this,t,e,i,s)};Re.copyNode=function(t){let e=new Le(this,t.start,this.startLoc);for(let i in t)e[i]=t[i];return e};var De="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Me="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Be=Me+" Extended_Pictographic",$e=Be,Ue=$e+" EBase EComp EMod EPres ExtPict",Fe=Ue,qe=Fe,Ge={9:Me,10:Be,11:$e,12:Ue,13:Fe,14:qe},We="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",He={9:"",10:"",11:"",12:"",13:"",14:We},Je="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ze="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ke=ze+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Xe=Ke+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Qe=Xe+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ye=Qe+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ze=Ye+" "+De,ti={9:ze,10:Ke,11:Xe,12:Qe,13:Ye,14:Ze},ei={};for(let t of[9,10,11,12,13,14])ii(t);var si=ei,ri=le.prototype,ni=class t{constructor(t,e){this.parent=t,this.base=e||this}separatedFrom(t){for(let e=this;e;e=e.parent)for(let i=t;i;i=i.parent)if(e.base===i.base&&e!==i)return!0;return!1}sibling(){return new t(this.parent,this.base)}},ai=class{constructor(t){this.parser=t,this.validFlags=`gim${t.options.ecmaVersion>=6?"uy":""}${t.options.ecmaVersion>=9?"s":""}${t.options.ecmaVersion>=13?"d":""}${t.options.ecmaVersion>=15?"v":""}`,this.unicodeProperties=si[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null}reset(t,e,i){let s=i.indexOf("v")!==-1,r=i.indexOf("u")!==-1;this.start=t|0,this.source=e+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)}raise(t){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /${this.source}/: ${t}`)}at(t,e=!1){let i=this.source,s=i.length;if(t>=s)return-1;let r=i.charCodeAt(t);if(!(e||this.switchU)||r<=55295||r>=57344||t+1>=s)return r;let n=i.charCodeAt(t+1);return n>=56320&&n<=57343?(r<<10)+n-56613888:r}nextIndex(t,e=!1){let i=this.source,s=i.length;if(t>=s)return s;let r=i.charCodeAt(t),n;return!(e||this.switchU)||r<=55295||r>=57344||t+1>=s||(n=i.charCodeAt(t+1))<56320||n>57343?t+1:t+2}current(t=!1){return this.at(this.pos,t)}lookahead(t=!1){return this.at(this.nextIndex(this.pos,t),t)}advance(t=!1){this.pos=this.nextIndex(this.pos,t)}eat(t,e=!1){return this.current(e)===t?(this.advance(e),!0):!1}eatChars(t,e=!1){let i=this.pos;for(let s of t){let t=this.at(i,e);if(t===-1||t!==s)return!1;i=this.nextIndex(i,e)}return this.pos=i,!0}};ri.validateRegExpFlags=function(t){let e=t.validFlags,i=t.flags,s=!1,r=!1;for(let n=0;n<i.length;n++){let a=i.charAt(n);e.indexOf(a)===-1&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(t.start,"Duplicate regular expression flag"),a==="u"&&(s=!0),a==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(t.start,"Invalid regular expression flag")};ri.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&oi(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};ri.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(let e of t.backReferenceNames)t.groupNames[e]||t.raise("Invalid named capture referenced")};ri.regexp_disjunction=function(t){let e=this.options.ecmaVersion>=16;for(e&&(t.branchID=new ni(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};ri.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};ri.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))?(this.regexp_eatQuantifier(t),!0):!1};ri.regexp_eatAssertion=function(t){let e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){let e=!1;if(this.options.ecmaVersion>=9&&(e=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!e,!0}return t.pos=e,!1};ri.regexp_eatQuantifier=function(t,e=!1){return this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};ri.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};ri.regexp_eatBracedQuantifier=function(t,e){let i=t.pos;if(t.eat(123)){let s=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r<s&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1};ri.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)};ri.regexp_eatReverseSolidusAtomEscape=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};ri.regexp_eatUncapturingGroup=function(t){let e=t.pos;if(t.eat(40)){if(t.eat(63)){if(this.options.ecmaVersion>=16){let e=this.regexp_eatModifiers(t),i=t.eat(45);if(e||i){for(let i=0;i<e.length;i++){let s=e.charAt(i);e.indexOf(s,i+1)>-1&&t.raise("Duplicate regular expression modifiers")}if(i){let i=this.regexp_eatModifiers(t);!e&&!i&&t.current()===58&&t.raise("Invalid regular expression modifiers");for(let s=0;s<i.length;s++){let r=i.charAt(s);(i.indexOf(r,s+1)>-1||e.indexOf(r)>-1)&&t.raise("Duplicate regular expression modifiers")}}}}if(t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}}t.pos=e}return!1};ri.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};ri.regexp_eatModifiers=function(t){let e="",i=0;for(;(i=t.current())!==-1&&hi(i);)e+=Jt(i),t.advance();return e};ri.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};ri.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};ri.regexp_eatSyntaxCharacter=function(t){let e=t.current();return li(e)?(t.lastIntValue=e,t.advance(),!0):!1};ri.regexp_eatPatternCharacters=function(t){let e=t.pos,i=0;for(;(i=t.current())!==-1&&!li(i);)t.advance();return t.pos!==e};ri.regexp_eatExtendedPatternCharacter=function(t){let e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};ri.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");let e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(let e of i)e.separatedFrom(t.branchID)||t.raise("Duplicate capture group name");else t.raise("Duplicate capture group name");e?(i||(t.groupNames[t.lastStringValue]=[])).push(t.branchID):t.groupNames[t.lastStringValue]=!0}};ri.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1};ri.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Jt(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Jt(t.lastIntValue);return!0}return!1};ri.regexp_eatRegExpIdentifierStart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),pi(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};ri.regexp_eatRegExpIdentifierPart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),ci(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};ri.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};ri.regexp_eatBackReference=function(t){let e=t.pos;if(this.regexp_eatDecimalEscape(t)){let i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};ri.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};ri.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};ri.regexp_eatCControlLetter=function(t){let e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};ri.regexp_eatZero=function(t){return t.current()===48&&!Si(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};ri.regexp_eatControlEscape=function(t){let e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};ri.regexp_eatControlLetter=function(t){let e=t.current();return ui(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};ri.regexp_eatRegExpUnicodeEscapeSequence=function(t,e=!1){let i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){let e=t.lastIntValue;if(s&&e>=55296&&e<=56319){let i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){let i=t.lastIntValue;if(i>=56320&&i<=57343)return t.lastIntValue=(e-55296)*1024+(i-56320)+65536,!0}t.pos=i,t.lastIntValue=e}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&di(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};ri.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;let e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};ri.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;let e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1};var fi=0,mi=1,xi=2;ri.regexp_eatCharacterClassEscape=function(t){let e=t.current();if(gi(e))return t.lastIntValue=-1,t.advance(),mi;let i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();let e;if(t.eat(123)&&(e=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&e===xi&&t.raise("Invalid property name"),e;t.raise("Invalid property name")}return fi};ri.regexp_eatUnicodePropertyValueExpression=function(t){let e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){let e=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){let i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,e,i),mi}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){let e=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,e)}return fi};ri.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){qt(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};ri.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return mi;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return xi;t.raise("Invalid property name")};ri.regexp_eatUnicodePropertyName=function(t){let e=0;for(t.lastStringValue="";yi(e=t.current());)t.lastStringValue+=Jt(e),t.advance();return t.lastStringValue!==""};ri.regexp_eatUnicodePropertyValue=function(t){let e=0;for(t.lastStringValue="";bi(e=t.current());)t.lastStringValue+=Jt(e),t.advance();return t.lastStringValue!==""};ri.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};ri.regexp_eatCharacterClass=function(t){if(t.eat(91)){let e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===xi&&t.raise("Negated character class may contain strings"),!0}return!1};ri.regexp_classContents=function(t){return t.current()===93?mi:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),mi)};ri.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){let e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){let i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};ri.regexp_eatClassAtom=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){let e=t.current();(e===99||Ei(e))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}let i=t.current();return i!==93?(t.lastIntValue=i,t.advance(),!0):!1};ri.regexp_eatClassEscape=function(t){let e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};ri.regexp_classSetExpression=function(t){let e=mi,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===xi&&(e=xi);let s=t.pos;for(;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==xi&&(e=mi);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===xi&&(e=xi)}};ri.regexp_eatClassSetRange=function(t){let e=t.pos;if(this.regexp_eatClassSetCharacter(t)){let i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){let e=t.lastIntValue;return i!==-1&&e!==-1&&i>e&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};ri.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?mi:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};ri.regexp_eatNestedClass=function(t){let e=t.pos;if(t.eat(91)){let i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===xi&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){let i=this.regexp_eatCharacterClassEscape(t);if(i)return i;t.pos=e}return null};ri.regexp_eatClassStringDisjunction=function(t){let e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){let e=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return e}else t.raise("Invalid escape");t.pos=e}return null};ri.regexp_classStringDisjunctionContents=function(t){let e=this.regexp_classString(t);for(;t.eat(124);)this.regexp_classString(t)===xi&&(e=xi);return e};ri.regexp_classString=function(t){let e=0;for(;this.regexp_eatClassSetCharacter(t);)e++;return e===1?mi:xi};ri.regexp_eatClassSetCharacter=function(t){let e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);let i=t.current();return i<0||i===t.lookahead()&&wi(i)||ki(i)?!1:(t.advance(),t.lastIntValue=i,!0)};ri.regexp_eatClassSetReservedPunctuator=function(t){let e=t.current();return _i(e)?(t.lastIntValue=e,t.advance(),!0):!1};ri.regexp_eatClassControlLetter=function(t){let e=t.current();return Si(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};ri.regexp_eatHexEscapeSequence=function(t){let e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};ri.regexp_eatDecimalDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;Si(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};ri.regexp_eatHexDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;vi(i=t.current());)t.lastIntValue=16*t.lastIntValue+Ci(i),t.advance();return t.pos!==e};ri.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){let e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){let i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};ri.regexp_eatOctalDigit=function(t){let e=t.current();return Ei(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};ri.regexp_eatFixedHexDigits=function(t,e){let i=t.pos;t.lastIntValue=0;for(let s=0;s<e;++s){let e=t.current();if(!vi(e))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+Ci(e),t.advance()}return!0};var Ai=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Xt(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])}},Ii=le.prototype;Ii.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ai(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Ii.getToken=function(){return this.next(),new Ai(this)};typeof Symbol<"u"&&(Ii[Symbol.iterator]=function(){return{next:()=>{let t=this.getToken();return{done:t.type===Lt.eof,value:t}}}});Ii.nextToken=function(){let t=this.curContext();if((!t||!t.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(Lt.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};Ii.readToken=function(t){return Et(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};Ii.fullCharCodeAt=function(t){let e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;let i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888};Ii.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Ii.skipBlockComment=function(){let t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(let t,i=e;(t=Mt(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=t;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};Ii.skipLineComment=function(t){let e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);for(;this.pos<this.input.length&&!Dt(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())};Ii.skipSpace=function(){t:for(;this.pos<this.input.length;){let t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(t>8&&t<14||t>=5760&&Bt.test(String.fromCharCode(t)))++this.pos;else break t}}};Ii.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let i=this.type;this.type=t,this.value=e,this.updateContext(i)};Ii.readToken_dot=function(){let t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);let e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(Lt.ellipsis)):(++this.pos,this.finishToken(Lt.dot))};Ii.readToken_slash=function(){let t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(Lt.assign,2):this.finishOp(Lt.slash,1)};Ii.readToken_mult_modulo_exp=function(t){let e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?Lt.star:Lt.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=Lt.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(Lt.assign,i+1):this.finishOp(s,i)};Ii.readToken_pipe_amp=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Lt.assign,3):this.finishOp(t===124?Lt.logicalOR:Lt.logicalAND,2):e===61?this.finishOp(Lt.assign,2):this.finishOp(t===124?Lt.bitwiseOR:Lt.bitwiseAND,1)};Ii.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(Lt.assign,2):this.finishOp(Lt.bitwiseXOR,1)};Ii.readToken_plus_min=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Rt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(Lt.incDec,2):e===61?this.finishOp(Lt.assign,2):this.finishOp(Lt.plusMin,1)};Ii.readToken_lt_gt=function(t){let e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(Lt.assign,i+1):this.finishOp(Lt.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(Lt.relational,i))};Ii.readToken_eq_excl=function(t){let e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(Lt.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Lt.arrow)):this.finishOp(t===61?Lt.eq:Lt.prefix,1)};Ii.readToken_question=function(){let t=this.options.ecmaVersion;if(t>=11){let e=this.input.charCodeAt(this.pos+1);if(e===46){let t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(Lt.questionDot,2)}if(e===63)return t>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Lt.assign,3):this.finishOp(Lt.coalesce,2)}return this.finishOp(Lt.question,1)};Ii.readToken_numberSign=function(){let t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),Et(e,!0)||e===92))return this.finishToken(Lt.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Jt(e)+"'")};Ii.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Lt.parenL);case 41:return++this.pos,this.finishToken(Lt.parenR);case 59:return++this.pos,this.finishToken(Lt.semi);case 44:return++this.pos,this.finishToken(Lt.comma);case 91:return++this.pos,this.finishToken(Lt.bracketL);case 93:return++this.pos,this.finishToken(Lt.bracketR);case 123:return++this.pos,this.finishToken(Lt.braceL);case 125:return++this.pos,this.finishToken(Lt.braceR);case 58:return++this.pos,this.finishToken(Lt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Lt.backQuote);case 48:let e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(Lt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Jt(t)+"'")};Ii.finishOp=function(t,e){let i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};Ii.readRegexp=function(){let t,e,i=this.pos;for(;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");let s=this.input.charAt(this.pos);if(Rt.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}let s=this.input.slice(i,this.pos);++this.pos;let r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);let a=this.regexpState||(this.regexpState=new ai(this));a.reset(i,s,n),this.validateRegExpFlags(a),this.validateRegExpPattern(a);let o=null;try{o=new RegExp(s,n)}catch{}return this.finishToken(Lt.regexp,{pattern:s,flags:n,value:o})};Ii.readInt=function(t,e,i){let s=this.options.ecmaVersion>=12&&e===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0;for(let i=0,n=e??1/0;i<n;++i,++this.pos){let e=this.input.charCodeAt(this.pos),n;if(s&&e===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=e;continue}if(e>=97?n=e-97+10:e>=65?n=e-65+10:e>=48&&e<=57?n=e-48:n=1/0,n>=t)break;o=e,a=a*t+n}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||e!=null&&this.pos-n!==e?null:a};Ii.readRadixNumber=function(t){let e=this.pos;this.pos+=2;let i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=ji(this.input.slice(e,this.pos)),++this.pos):Et(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Lt.num,i)};Ii.readNumber=function(t){let e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");let i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){let t=ji(this.input.slice(e,this.pos));return++this.pos,Et(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Lt.num,t)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),Et(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let r=Pi(this.input.slice(e,this.pos),i);return this.finishToken(Lt.num,r)};Ii.readCodePoint=function(){let t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();let t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e};Ii.readString=function(t){let e="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Dt(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(Lt.string,e)};var Ni={};Ii.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Ni)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};Ii.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ni;this.raise(t,e)};Ii.readTmplToken=function(){let t="",e=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");let i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===Lt.template||this.type===Lt.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(Lt.dollarBraceL)):(++this.pos,this.finishToken(Lt.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(Lt.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Dt(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=`\n`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};Ii.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(Lt.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`\n`&&++this.pos;case`\n`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Ii.readEscapedChar=function(t){let e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`\n`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Jt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){let t=this.pos-1;this.invalidStringToken(t,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){let i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),(i!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-i.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Dt(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};Ii.readHexChar=function(t){let e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};Ii.readWord1=function(){this.containsEsc=!1;let t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;for(;this.pos<this.input.length;){let r=this.fullCharCodeAtPos();if(At(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,t+=this.input.slice(i,this.pos);let r=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;let n=this.readCodePoint();(e?Et:At)(n,s)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=Jt(n),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)};Ii.readWord=function(){let t=this.readWord1(),e=Lt.name;return this.keywords.test(t)&&(e=Tt[t]),this.finishToken(e,t)};var Ti="8.19.0";le.acorn={Parser:le,version:Ti,defaultOptions:Yt,Position:Kt,SourceLocation:Xt,getLineInfo:Qt,Node:Le,TokenType:It,tokTypes:Lt,keywordTypes:Tt,TokContext:ve,tokContexts:Ce,isIdentifierChar:At,isIdentifierStart:Et,Token:Ai,isNewLine:Dt,lineBreak:Rt,lineBreakG:Ot,nonASCIIwhitespace:Bt};var Oi={...ft};var $i=["vite","webpack","next","netlify"],Ui={sveltekit:"SvelteKit",nuxt:"Nuxt"},Fi={sveltekit:"@sveltejs/kit",nuxt:"nuxt"},qi={vite:` rapier-jxl-vite.mjs the plug-in (and its types with a tsconfig.json)\n vite.config.* imports it and adds jxl() to plugins\nThen import hero from './hero.jpg?jxl' gives a JPEG XL file's URL.`,webpack:` rapier-jxl-webpack.mjs the plug-in and its loader (webpack 5 and Rspack)\n webpack.config.* imports it and adds jxl() to plugins (or rspack.config.*)\nThen import hero from './hero.jpg?jxl' gives a JPEG XL file's URL.`,next:` rapier-jxl-next.mjs writes the JPEG XL files after next build (the postbuild script)\n rapier-jxl-next-proxy.mjs answers next/image with them where the browser accepts JPEG XL\n proxy.js (Next 16) or middleware.js (Next 15) uses it, unless the project has one\nThen <Image> serves JPEG XL to browsers that show it, and Next's own image to the rest.`,netlify:` netlify/plugins/rapier-jxl/ the build plug-in: a .jxl beside each JPEG and PNG it publishes\n netlify.toml lists the plug-in\nThen the site serves JPEG XL to browsers that send Accept: image/jxl, and the originals to the rest.`},Gi=(t,e=t)=>`Usage: ${M} add ${e} [--dry-run] [--json]\n\nAdds JPEG XL images to the ${Ui[e]??(t==="next"?"Next.js":t==="netlify"?"Netlify":t[0].toUpperCase()+t.slice(1))} project in this folder:\n${e==="nuxt"?qi.vite.replace(" vite.config.* imports it and adds jxl() to plugins"," nuxt.config.* imports it and adds jxl() to vite.plugins"):qi[t]}\nRunning it again changes nothing; a file you edited is left as it is.`,Wi="rapier-jxl-files.mjs",Hi=(...t)=>t.flatMap(t=>["js","mjs","cjs","ts","mts","cts"].map(e=>`${t}.config.${e}`)),Ji={vite:{name:"a Vite",packages:["vite"],files:Hi("vite")},webpack:{name:"a webpack or Rspack",packages:["webpack","@rspack/core","@rspack/cli"],files:Hi("webpack","rspack")},next:{name:"a Next.js",packages:["next"],files:Hi("next")},netlify:{name:"a Netlify",packages:["@netlify/build","netlify-cli"],files:["netlify.toml"]}},zi=t=>e(t).then(()=>!0,()=>!1),Ki=t=>pt("sha256").update(t).digest("hex"),Xi=async(t,e)=>(await Promise.all(e.map(e=>zi(lt(t,e))))).map((t,i)=>t&&e[i]).find(Boolean);var rs=(t,e,i)=>ot(i.as??t,e,i);var as={async vite(t,e){let i=await Xi(t,["vite.config.ts","vite.config.mts","vite.config.js","vite.config.mjs"]);if(i)await ns(t,[i],null,"./rapier-jxl-vite.mjs",e);else{let t=e.pkg.type==="module"?"vite.config.js":"vite.config.mjs";await e.write(t,`import {defineConfig} from 'vite';\nimport {jxl} from './rapier-jxl-vite.mjs';\n\nexport default defineConfig({\n plugins: [jxl()],\n});\n`),e.changes.push({file:t,action:"created"})}e.next.push((e.as==="sveltekit"?"in a .svelte file: ":"")+`import hero, {original} from './hero.jpg?jxl'; then <picture><source srcset={hero} type="image/jxl"><img src={original}></picture>`)},async nuxt(t,e){await ns(t,["nuxt.config.ts","nuxt.config.mts","nuxt.config.js","nuxt.config.mjs"],()=>"nuxt.config.ts","./rapier-jxl-vite.mjs",e,{edit:{define:/^defineNuxtConfig$/,inside:"vite"},fresh:()=>`import {jxl} from './rapier-jxl-vite.mjs';\n\nexport default defineNuxtConfig({\n vite: {plugins: [jxl()]},\n});\n`}),e.next.push(`import hero, {original} from './hero.jpg?jxl'; then <picture><source :srcset="hero" type="image/jxl"><img :src="original"></picture>`)},async webpack(t,e){let i=["webpack.config.js","webpack.config.mjs","webpack.config.cjs","rspack.config.js","rspack.config.mjs","rspack.config.cjs","webpack.config.ts","rspack.config.ts"],s=!!(e.pkg.dependencies?.["@rspack/core"]||e.pkg.devDependencies?.["@rspack/core"]||e.pkg.devDependencies?.["@rspack/cli"]);await ns(t,i,t=>(s?"rspack":"webpack")+(t.type==="module"?".config.js":".config.mjs"),"./rapier-jxl-webpack.mjs",e),e.next.push(`import hero, {original} from './hero.jpg?jxl'; then <picture><source srcset={hero} type="image/jxl"><img src={original}></picture>`),e.next.push("jxl({beside: true}) also writes a .jxl beside every JPEG and PNG the build emits, for a server that picks by Accept.")},async next(e,{pkg:i,pkgText:s,write:r,changes:n,next:a}){let o="node rapier-jxl-next.mjs",h=i.scripts?.postbuild;if(h?.includes(o))n.push({file:"package.json",action:"unchanged"});else if(h)n.push({file:"package.json",action:"left (has a postbuild script)"}),a.push(`add && ${o} to the end of the postbuild script in package.json.`);else{let t=JSON.parse(s);t.scripts={...t.scripts,postbuild:o};let e=s.match(/^\{\r?\n([ \t]+)/)?.[1]??" ";await r("package.json",JSON.stringify(t,null,e)+(s.endsWith(`\n`)?`\n`:"")),n.push({file:"package.json",action:`updated: postbuild runs ${o}`})}let l=Number((i.dependencies?.next??i.devDependencies?.next??"").match(/(\d+)/)?.[1])||16;for(let i=e;;i=ht(i))try{l=Number(JSON.parse(await t(lt(i,"node_modules","next","package.json"),"utf8")).version.split(".")[0])||l;break}catch{if(ht(i)===i)break}let p=await zi(lt(e,"src","app"))||await zi(lt(e,"src","pages"))?"src/":"",c=await Xi(e,["proxy","middleware"].flatMap(t=>["js","mjs","ts"].map(e=>p+t+"."+e))),u=await Xi(e,["next.config.js","next.config.mjs","next.config.ts","next.config.cjs"]),d=t=>t.replace(/\/\*[\s\S]*?\*\/|(?<!:)\/\/[^\n]*/g,""),f=u&&/output\s*:\s*['"]export['"]/.test(d(await t(lt(e,u),"utf8"))),m=(p?"../":"./")+"rapier-jxl-next-proxy.mjs";if(f)a.push(`a static export has no server to choose by Accept: use rapier-jxl-next-loader.mjs as a <picture>'s <source type="image/jxl">, as its first lines show, or serve out/ from a host that picks by Accept.`);else if(c&&(await t(lt(e,c),"utf8")).includes("rapier-jxl-next-proxy.mjs"))n.push({file:c,action:"unchanged"});else if(c)n.push({file:c,action:"left (the project has its own)"}),a.push(`in ${c}, return jxlProxy(request) first when it gives a response: import {jxlProxy} from '${m}'; and add '/_next/image' to its matcher.`);else{let t=p+(l>=16?"proxy.js":"middleware.js");await r(t,`export {jxlProxy as ${l>=16?"proxy":"middleware"}} from '${m}';\nexport const config = {matcher: '/_next/image'};\n`),n.push({file:t,action:"created"})}let x=await t(lt(e,".gitignore"),"utf8").catch(()=>null);x?.split(/\r?\n/).some(t=>/^\/?public\/_jxl\/?$/.test(t.trim()))?n.push({file:".gitignore",action:"unchanged"}):(await r(".gitignore",(x===null?"":x.replace(/\n*$/,`\n`))+`/public/_jxl/\n`),n.push({file:".gitignore",action:x===null?"created":"updated: ignores public/_jxl/"})),a.push("npm run build: the postbuild step lists the pictures it wrote; npx next start serves them.")},async netlify(e,{write:i,changes:s,next:r}){let n="netlify.toml",a='package = "./netlify/plugins/rapier-jxl"',o=await t(lt(e,n),"utf8").catch(()=>null);o?.split(/\r?\n/).some(t=>t.replace(/#.*$/,"").includes(a))?s.push({file:n,action:"unchanged"}):(await i(n,(o===null?"":o.replace(/\n*$/,`\n\n`))+`[[plugins]]\n ${a}\n`),s.push({file:n,action:o===null?"created":"updated: lists the plug-in"})),r.push("netlify build (or a deploy) writes a .jxl beside each published JPEG and PNG and the edge function that serves them.")}};export{$i as ADD_HOSTS,Ui as VITE_FRAMEWORKS,Gi as addHelp,es as configEdit,ss as runAdd,rs as runRemove};
|