@fugood/bricks-cli 2.25.0-beta.58 → 2.25.0-beta.60
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/lib/10.js +1 -1
- package/lib/117.js +6 -6
- package/lib/index.js +11 -11
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -27,7 +27,7 @@ ${w.Ay.bold("Version")}`),n.current_version){if(console.log(`Current: v${n.
|
|
|
27
27
|
${w.Ay.bold("Features")}`),console.log(`Short Edit: ${n.short_edit?.enabled?w.Ay.green("Enabled"):w.Ay.gray("Disabled")}`),n.short_edit?.enabled&&n.short_edit.ref_map){var o=Object.keys(n.short_edit.ref_map).length;console.log(` References: ${o} editable properties`)}console.log(`Automation: ${n.canvas_control?.enable_schedule?w.Ay.green("Scheduled"):w.Ay.gray("No schedule")}`),n.lock?.enabled&&console.log(`Locked: ${w.Ay.yellow("Yes")}`),n.sync_key&&console.log(`Sync Key: ${w.Ay.gray(n.sync_key)}`),n.devices?.length>0?(console.log(`
|
|
28
28
|
${w.Ay.bold("Bound Devices")} (${n.devices.length})`),n.devices.forEach(e=>{var t="active"===e.status?w.Ay.green("●"):w.Ay.gray("○"),a=e.frame?w.Ay.gray(` [${e.frame.x||0},${e.frame.y||0} ${e.frame.width}x${e.frame.height}]`):"";console.log(` ${t} ${e.device_id}${a}`)})):console.log(`
|
|
29
29
|
${w.Ay.bold("Bound Devices")}: ${w.Ay.gray("None")}`),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get application: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),O.command("resolve <query>").description("Resolve an application name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((p=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Resolving application...").start();try{var n=yield(0,S.Y)(()=>a.application({id:e})),r=n?[n]:yield a.applications({keyword:e,paginate:{limit:t.limit}}),o=(0,S.K)({resource:"application",query:e,items:r||[],fields:["_id","name"],selectedBy:n?"id":null});if(i&&i.stop(),t.json)return void(0,A.GF)(o);if(o.resolved){var s=o.resolved;console.log(w.Ay.bold("\nResolved Application")),console.log("─".repeat(60)),console.log(`Name: ${w.Ay.cyan(s.name||"Unnamed")}`),console.log(`ID: ${w.Ay.gray(s._id)}`),console.log(`Selected By: ${o.selectedBy}`),console.log("─".repeat(60));return}if(0===o.matches.length)return void console.log(w.Ay.yellow(`No applications matched "${e}"`));console.log(w.Ay.bold(`
|
|
30
|
-
Matching Applications (${o.matches.length})`)),console.log("─".repeat(80)),o.matches.forEach(e=>{console.log(`${w.Ay.cyan(e.name||"Unnamed")} ${w.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve application: ${t.message}`):(0,A.OW)(t.message,{resource:"application",query:e}),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),O.command("update <id>").description("Update application name, description, and/or configuration").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("-c, --config <json>","Application config as JSON string").option("-f, --file <path>","Application config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((l=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Updating application...").start();try{var n=
|
|
30
|
+
Matching Applications (${o.matches.length})`)),console.log("─".repeat(80)),o.matches.forEach(e=>{console.log(`${w.Ay.cyan(e.name||"Unnamed")} ${w.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve application: ${t.message}`):(0,A.OW)(t.message,{resource:"application",query:e}),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),O.command("update <id>").description("Update application name, description, and/or configuration").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("-c, --config <json>","Application config as JSON string").option("-f, --file <path>","Application config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((l=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Updating application...").start();try{var n=yield a.updateApplication((0,k.jB)(e,t));t.json?(0,k.yd)({action:"application.update",target:N(n,e),result:{lastCommitId:t.lastCommitId||null},json:!0}):(i.succeed(`Application updated: ${w.Ay.green(n.name)}`),n.has_unreleased_changes&&console.log(w.Ay.yellow("Note: Application has unreleased changes")))}catch(a){t.json?(0,A.OW)(a.message,{action:"application.update",target:{id:e}}):i.fail(`Failed to update application: ${a.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),O.command("short-edit <id>").description("Short edit application properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action((d=D(function*(e,t){var a=(0,C.o)(),i=(0,_.default)("Applying short edit...").start();try{var n=JSON.parse(t.list);Array.isArray(n)||(i.fail("List must be a JSON array"),process.exit(1));var r=yield a.shortEditApplication({id:e,list:n});i.succeed(`Short edit applied to: ${w.Ay.green(r.name)}`)}catch(e){i.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),O.command("short-refs <id>").description("List short edit references for an application").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((u=D(function*(e,t){var a=(0,C.o)(),i=(0,_.default)("Fetching short edit references...").start();try{var n=yield a.application({id:e});if(i.stop(),!n?.short_edit?.enabled)return void console.log(w.Ay.yellow("Short Edit is not enabled for this application"));var r=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],o=(0,F.V)(n.short_edit.ref_map,{keyword:t.keyword,types:r});if(t.json)return void console.log(JSON.stringify(o,null,2));if(0===o.length)return void console.log(w.Ay.yellow("No short edit references found"));console.log(w.Ay.bold(`
|
|
31
31
|
Short Edit References: ${n.name}`)),o.forEach(e=>{console.log(w.Ay.cyan(`
|
|
32
32
|
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?w.Ay.gray(`- ${t.title}`):"";console.log(` ${w.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),O.command("bind <id>").description("Bind devices to application").option("-b, --bind <devices>","Device IDs to bind (comma-separated)").option("-u, --unbind <devices>","Device IDs to unbind (comma-separated)").option("--dry-run","Validate inputs and show the binding plan without applying it").option("-j, --json","Output as JSON").action((c=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Updating device bindings...").start();try{var n=yield a.application({id:e});if(!n)throw Error("Application not found");var r=t.bind?t.bind.split(",").map(e=>e.trim()):[],o=t.unbind?t.unbind.split(",").map(e=>e.trim()):[],s={id:e};if(r.length>0&&(s.bindDevices=r),o.length>0&&(s.unbindDevices=o),t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.bind",target:N(n,e),request:{bindDevices:r,unbindDevices:o},checks:[(0,k.Iy)("application exists",!0,`${n.name} (${n._id})`),(0,k.Iy)("device changes provided",r.length+o.length>0,`bind=${r.length}, unbind=${o.length}`)],json:t.json});return}yield a.bindApplication(s),t.json?(0,k.yd)({action:"application.bind",target:N(n,e),result:{bindDevices:r,unbindDevices:o},json:!0}):i.succeed("Device bindings updated")}catch(a){t.json?(0,A.OW)(a.message,{action:"application.bind",target:{id:e}}):i.fail(`Failed to update bindings: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),O.command("remove <id>").description("Remove an application").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((m=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Removing application...").start();try{var n=yield a.application({id:e});if(!n)throw Error("Application not found");var r=N(n,e);if(t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.remove",target:r,request:{id:e},checks:[(0,k.Iy)("application exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeApplication({id:e});t.json?(0,k.yd)({action:"application.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Application removed: ${w.Ay.green(r.name)}`)}catch(a){t.json?(0,A.OW)(a.message,{action:"application.remove",target:{id:e}}):i.fail(`Failed to remove application: ${a.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),O.command("trigger <id> <testId>").description("Trigger automation test on application").option("--play","Play the test",!0).option("--stop","Stop the test").option("--setup-at-launch","Setup to run at app launch").option("-g, --match-group <group>","Match group").action((f=D(function*(e,t,a){var i=(0,C.o)(),n=(0,_.default)("Triggering automation...").start();try{yield i.triggerApplicationCanvasControl({id:e,testId:t,play:!a.stop&&a.play,setupAtLaunch:a.setupAtLaunch,matchGroup:a.matchGroup}),n.succeed(`Automation triggered: ${w.Ay.green(t)}`)}catch(e){n.fail(`Failed to trigger automation: ${e.message}`),process.exit(1)}}),function(e,t,a){return f.apply(this,arguments)})),O.command("release <id>").description("Release application to BRICKS platform").requiredOption("-c, --config <path|json>","Application config file path or JSON string").option("-n, --name <name>","Update application name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((h=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Releasing application...").start();try{var n=(0,T.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.application({id:e});if(!p)throw Error("Application not found");if(p.lock?.enabled)throw Error("Application is locked");var l=t.version||t.name||p.name||"Untitled",d=(0,T.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.release",target:N(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,k.Iy)("application exists",!0,`${p.name} (${p._id})`),(0,k.Iy)("application is unlocked",!p.lock?.enabled),(0,k.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseApplication({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,k.yd)({action:"application.release",target:N(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Application released: ${w.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,A.OW)(a.message,{action:"application.release",target:{id:e}}):i.fail(`Failed to release application: ${a.message}`),process.exit(1)}}),function(e,t){return h.apply(this,arguments)})),O.command("project-pull <id>").description("Pull application source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((v=D(function*(e,t){var a=(0,C.o)(),i=t.json?null:(0,_.default)("Pulling application project...").start();try{var n=yield a.applicationProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Application project not found"):console.error(JSON.stringify({error:"Application project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Application project fetched: ${w.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull application project: ${e.message}`),process.exit(1)}}),function(e,t){return v.apply(this,arguments)})),O.command("check-config <path>").description("Validate application config against BRICKS schema").option("-j, --json","Output as JSON").option("--validate-automation","Also validate automation_map and test_map references (skips commented/unfinished steps)").option("--no-validate-expressions","Skip validating PROPERTY_BANK_EXPRESSION strings against the runtime expression rules").action((g=D(function*(e,t){E.existsSync(e)||(console.error(w.Ay.red(`Config file not found: ${e}`)),process.exit(1));var i=(0,_.default)("Validating config...").start();try{var n=E.readFileSync(e,"utf-8"),r=JSON.parse(n),o=yield Promise.all([a.e(587),a.e(249),a.e(10),a.e(511)]).then(a.t.bind(a,38890,19)),s=o.checkConfig,p=o.checkConfigDeprecatedFeatures,l=s(r,{checkAutomation:!!t.validateAutomation,checkCalc:!0,checkExpressions:!1!==t.validateExpressions}),d=p(r);if(i.stop(),t.json){console.log(JSON.stringify({...l,deprecations:d},null,2)),l.valid||process.exit(1);return}if(l.valid&&0===d.length)return void console.log(w.Ay.green("✓ Config is valid"));console.log(w.Ay.bold("\nConfig Validation Report")),console.log("─".repeat(60)),l.schema.length>0&&(console.log(w.Ay.red(`
|
|
33
33
|
Schema Errors (${l.schema.length})
|
|
@@ -103,7 +103,7 @@ ${b.Ay.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(b.Ay.red(`Error: $
|
|
|
103
103
|
Found ${p.length} DevTools server(s)`)),console.log("─".repeat(80));var c=function*(e){var t=!1===e.verified?R.Ay.red("unverified"):R.Ay.green("online"),a=H(e),i=K(a),n=(e.protocols||[]).map(e=>R.Ay.cyan(e)).join(", "),r=e.workspaceId&&u&&e.workspaceId===u,o=e.addresses||[e.address],s=o.filter(t=>t!==e.address),p=s.length>0?`${e.address}:${e.port} +${s.length} more`:`${e.address}:${e.port}`;if(console.log(` ${R.Ay.bold(e.name||"Unknown")} ${R.Ay.gray(`(${p})`)} [${t}]`),s.length>0&&console.log(` Addresses: ${o.map(e=>R.Ay.gray(e)).join(", ")}`),e.version&&console.log(` Version: ${R.Ay.green(e.version)}`),e.chromeInspect){var l=e.passcode?R.Ay.cyan(e.passcode):R.Ay.gray("no passcode");console.log(` Chrome Inspect: ${R.Ay.green("supported")} (passcode: ${l})`)}var d=` Protocols: ${n||R.Ay.gray("none")} Auth: ${i}`;if(e.deviceId&&(d+=` Device: ${R.Ay.gray(e.deviceId)}`),console.log(d),e.workspaceId){var c=r?R.Ay.green(`${e.workspaceId} (current profile)`):R.Ay.gray(e.workspaceId);console.log(` Workspace: ${c}`)}};for(var m of p)yield*c(m);console.log("─".repeat(80));var f=p[0],h=`${f.address}:${f.port||19851}`,v=H(f),g=f.passcode?`/ws/${encodeURIComponent(f.passcode)}`:"workspace-jwt"===v?"/ws/<workspace-token>":"/ws/<passcode>";console.log(R.Ay.gray(`
|
|
104
104
|
Connect via: http://${h}/devtools-frontend/inspector.html?ws=${h}${g}`)),console.log(R.Ay.gray(`Legacy: devtools://devtools/bundled/inspector.html?ws=${h}${g}`)),process.exit(0)}catch(e){s.fail(`Scan failed: ${e.message}`),process.exit(1)}}),function(e){return l.apply(this,arguments)})),Z.command("open <address>").description("Show DevTools server information").option("-p, --port <port>",`Server port (default: ${Y})`).option("--info","Show connection URLs").action((d=j(function*(e,t){var i=(yield Promise.resolve().then(a.bind(a,30155))).default,n=(yield Promise.resolve().then(a.bind(a,75646))).verifyDevToolsServer,r=Q(e),o=r.host??J,s=parseInt(t.port??r.port??Y,10),p=`${o}:${s}`,l=i(`Fetching server info from ${p}...`).start(),d=yield n(o,s);d||(l.fail(`Could not reach DevTools server at ${p}`),process.exit(1)),l.stop();var u=yield M(o,s),c=u?U(u?.[0]?.webSocketDebuggerUrl):null,m=H(d),f=c?`/ws/${encodeURIComponent(c)}`:"workspace-jwt"===m?"/ws/<workspace-token>":"/ws/<passcode>";if(t.info){console.log(R.Ay.bold("Connection URLs")),console.log("─".repeat(60)),console.log(` Web UI: ${R.Ay.cyan(`http://${p}`)}`),console.log(` CDP: ${R.Ay.cyan(`http://${p}/devtools-frontend/inspector.html?ws=${p}${f}`)}`),console.log(` CDP legacy: ${R.Ay.cyan(`devtools://devtools/bundled/inspector.html?ws=${p}${f}`)}`),console.log(` MCP: ${R.Ay.cyan(`http://${p}/mcp`)}`),console.log(` MCP SSE: ${R.Ay.cyan(`http://${p}/sse`)}`),console.log(` Info: ${R.Ay.cyan(`http://${p}/devtools/info`)}`),console.log("─".repeat(60)),console.log(),console.log(R.Ay.bold("Authorization")),d.auth?.workspaceJwt?.enabled&&console.log(` Workspace JWT: ${R.Ay.green("enabled")} (kid: ${d.auth.workspaceJwt.kid})`),c&&console.log(` Passcode: ${R.Ay.cyan(c)}`),console.log(" MCP and MCP SSE require a Bearer token header:"),console.log(` ${R.Ay.gray(`Authorization: Bearer ${d.auth?.workspaceJwt?.enabled?"<workspace-token>":c||"<passcode>"}`)}`);return}if(console.log(R.Ay.bold("DevTools Server")),console.log("─".repeat(60)),console.log(` Name: ${R.Ay.cyan(d.name||"Unknown")}`),console.log(` Version: ${d.version?R.Ay.green(d.version):R.Ay.gray("N/A")}`),console.log(` Device ID: ${R.Ay.gray(d.deviceId||"N/A")}`),console.log(` Workspace: ${R.Ay.gray(d.workspaceId||"N/A")}`),console.log(` Protocols: ${(d.protocols||[]).map(e=>R.Ay.cyan(e)).join(", ")||R.Ay.gray("none")}`),console.log(` Auth: ${K(m)}`),console.log(` Port: ${d.port}`),u){var h=c?R.Ay.cyan(c):R.Ay.gray("no passcode");console.log(` Inspect: ${R.Ay.green("chrome://inspect supported")} (passcode: ${h})`)}else console.log(` Inspect: ${R.Ay.gray("chrome://inspect not available")}`);console.log("─".repeat(60)),d.version&&!W(d.version)&&console.log(R.Ay.yellow(`
|
|
105
105
|
CDP commands require version >= ${z}`)),console.log(R.Ay.gray(`
|
|
106
|
-
Use --info to see connection URLs`))}),function(e,t){return d.apply(this,arguments)})),ee(Z.command("screenshot").description("Capture device screenshot").option("-o, --output <path>","Output file path")).action((u=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Page.captureScreenshot",{format:"png"});i.data||(console.error(R.Ay.red("No screenshot data received")),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`screenshot-${Date.now()}.png`,s=r.resolve(o);n.writeFileSync(s,Buffer.from(i.data,"base64")),console.log(R.Ay.green(`Screenshot saved to ${s}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return u.apply(this,arguments)}));var er=Z.command("brick").description("Brick component inspection");ee(er.command("tree").description("Print brick component tree").option("-d, --depth <depth>","Max depth (-1 for full)","3")).action((c=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e.depth,10),i=(yield t.send("DOM.getDocument",{depth:a})).root;e.json?console.log(JSON.stringify(i,null,2)):console.log(en(i).join("\n"))}),function(e){return t.apply(this,arguments)}))}),function(e){return c.apply(this,arguments)})),ee(er.command("query <selector>").description("Find brick by CSS selector")).action((m=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelector",{nodeId:i.nodeId,selector:e})).nodeId;if(0===n)return void console.log(R.Ay.yellow("No element found"));var r=yield a.send("DOM.describeNode",{nodeId:n}),o=ea((yield a.send("DOM.getAttributes",{nodeId:n})).attributes);if(t.json)return void console.log(JSON.stringify({nodeId:n,...r.node,attributes:o},null,2));if(console.log(R.Ay.bold(`Node ${n}: ${r.node?.nodeName||"unknown"}`)),Object.keys(o).length>0)for(var s of(console.log(R.Ay.bold("Attributes:")),Object.entries(o))){var p=$(s,2),l=p[0],d=p[1];console.log(` ${R.Ay.cyan(l)}: ${d}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return m.apply(this,arguments)})),ee(er.command("query-all <selector>").description("Find all bricks matching CSS selector")).action((f=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelectorAll",{nodeId:i.nodeId,selector:e})).nodeIds;if(t.json)return void console.log(JSON.stringify({nodeIds:n,count:n.length},null,2));for(var r of(console.log(R.Ay.bold(`Found ${n.length} element(s)`)),n)){var o=yield a.send("DOM.describeNode",{nodeId:r}),s=ea((yield a.send("DOM.getAttributes",{nodeId:r})).attributes),p=s.id||s["short-id"]||"";console.log(` ${r}: ${o.node?.nodeName}${p?R.Ay.gray(`#${p}`):""}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return f.apply(this,arguments)})),ee(er.command("attributes <nodeId>").description("Get brick attributes")).action((h=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=ea((yield a.send("DOM.getAttributes",{nodeId:i})).attributes);if(t.json)return void console.log(JSON.stringify(n,null,2));if(0===Object.keys(n).length)return void console.log(R.Ay.gray("No attributes"));for(var r of Object.entries(n)){var o=$(r,2),s=o[0],p=o[1];console.log(` ${R.Ay.cyan(s)}: ${p}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return h.apply(this,arguments)})),ee(er.command("box-model <nodeId>").description("Get brick dimensions and position")).action((v=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.getBoxModel",{nodeId:i})).model;t.json?console.log(JSON.stringify(n,null,2)):(console.log(R.Ay.bold(`Box Model for node ${i}`)),console.log(` Width: ${n.width}`),console.log(` Height: ${n.height}`),n.content&&console.log(` Content: [${n.content.join(", ")}]`),n.padding&&console.log(` Padding: [${n.padding.join(", ")}]`),n.border&&console.log(` Border: [${n.border.join(", ")}]`),n.margin&&console.log(` Margin: [${n.margin.join(", ")}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return v.apply(this,arguments)})),ee(er.command("resolve <nodeId>").description("Resolve brick to JavaScript object with properties")).action((g=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.resolveNode",{nodeId:i})).object;if(t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Resolved node ${i}`)),console.log(` Type: ${n.type}`),n.className&&console.log(` Class: ${n.className}`),n.description&&console.log(` Description: ${n.description}`),n.objectId&&console.log(` Object ID: ${R.Ay.gray(n.objectId)}`),n.preview?.properties)for(var r of(console.log(R.Ay.bold(" Properties:")),n.preview.properties))console.log(` ${R.Ay.cyan(r.name)}: ${r.value}`)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return g.apply(this,arguments)})),ee(er.command("focus <nodeId>").description("Focus a brick element")).action((y=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e,10);yield t.send("DOM.focus",{nodeId:a}),console.log(R.Ay.green(`Focused node ${a}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return y.apply(this,arguments)}));var eo=Z.command("input").description("Input emulation");ee(eo.command("tap <x> <y>").description("Tap/click at coordinates")).action((b=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){var n=parseFloat(e),r=parseFloat(t),o=yield i.send("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:r,button:"left",clickCount:1});yield i.send("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:r,button:"left",clickCount:1}),(({x:e,y:t,tapResult:a,json:i})=>{if(i)return console.log(JSON.stringify({x:e,y:t,...a||{}},null,2));console.log(R.Ay.green(`Tapped at (${e}, ${t})`));var n=ei(a?.element||a?.tappedElement||a?.hitElement);if(!n)return console.log(R.Ay.yellow(" Element: none"));console.log(` Element: ${n}`);var r=a?.hitElement,o=a?.tappedElement;if(r&&o&&r.nodeId!==o.nodeId){var s=ei(r);s&&console.log(` Hit: ${s}`)}a&&!1===a.dispatched&&console.log(R.Ay.yellow(" Action: no pressable handler"))})({x:n,y:r,tapResult:o,json:a.json})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return b.apply(this,arguments)})),ee(eo.command("type <text>").description("Insert text into focused element")).action((D=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.insertText",{text:e}),console.log(R.Ay.green(`Typed: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return D.apply(this,arguments)})),ee(eo.command("key <key>").description("Dispatch key event (e.g., Enter, Escape, Tab)")).action((x=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.dispatchKeyEvent",{type:"keyDown",key:e}),yield t.send("Input.dispatchKeyEvent",{type:"keyUp",key:e}),console.log(R.Ay.green(`Key: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return x.apply(this,arguments)}));var es=Z.command("network").description("Network inspection");ee(es.command("list").description("Capture snapshot of network activity").option("--duration <ms>","Capture duration in milliseconds","2000")).action((w=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=new Map,i=parseInt(e.duration,10);t.on("Network.requestWillBeSent",e=>{a.set(e.requestId,{method:e.request.method,url:e.request.url,requestId:e.requestId,timestamp:e.timestamp})}),t.on("Network.responseReceived",e=>{var t=a.get(e.requestId);t&&(t.status=e.response.status,t.mimeType=e.response.mimeType)}),t.on("Network.loadingFailed",e=>{var t=a.get(e.requestId);t&&(t.error=e.errorText)}),yield t.send("Network.enable"),yield new Promise(e=>setTimeout(e,i)),yield t.send("Network.disable");var n=[...a.values()];if(e.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Network Activity (captured ${(i/1e3).toFixed(1)}s, ${n.length} requests)`)),0===n.length)return void console.log(R.Ay.gray(" No network activity captured"));for(var r of n){var o=r.error?R.Ay.red("ERR"):r.status?r.status<300?R.Ay.green(r.status):r.status<400?R.Ay.yellow(r.status):R.Ay.red(r.status):R.Ay.gray("..."),s=r.url.length>60?r.url.substring(0,57)+"...":r.url;console.log(` ${o} ${R.Ay.bold(r.method.padEnd(6))} ${s} ${R.Ay.gray(`(${r.requestId})`)}`)}}),function(e){return t.apply(this,arguments)}))}),function(e){return w.apply(this,arguments)})),ee(es.command("get <requestId>").description("Get response body for a network request")).action((_=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Network.enable");var i=yield a.send("Network.getResponseBody",{requestId:e}),n=i.body,r=i.base64Encoded;t.json?console.log(JSON.stringify({body:n,base64Encoded:r},null,2)):r?console.log(R.Ay.gray(`[base64 encoded, ${n.length} chars]`)):console.log(n)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return _.apply(this,arguments)}));var ep="bricks://app",el="DATA-",ed="properties",eu="entries",ec=e=>{if(null==e||"object"!=typeof e)return{value:e};if("value"in e)return{value:e.value};if("unserializableValue"in e)return{value:e.unserializableValue};if(e.objectId){var t=e.preview?.properties;return Array.isArray(t)&&t.length>0?{value:t.reduce((e,t)=>(e[t.name]=t.value,e),{}),byRef:!0}:{value:e.description||`[${e.type}]`,byRef:!0}}return{value:"undefined"===e.type?void 0:e.description}},em=e=>{var t=e.startsWith(el)?e.slice(el.length):e,a=t.indexOf(":");return a<0?{shortId:t,title:null}:{shortId:t.slice(0,a),title:t.slice(a+1)}},ef=e=>{if(e.startsWith("global:"))return{scope:"global",name:e.slice(7)};if(e.startsWith("subspace:")){var t=e.slice(9),a=t.indexOf(":");return a>0?{scope:"subspace",subspaceUuid:t.slice(0,a),name:t.slice(a+1)}:{scope:"subspace",subspaceUuid:t,name:""}}return{scope:null,name:e}},eh=(e=[])=>{var t=new Map,a=new Map,i=new Set;for(var n of e||[])if(n&&"object"==typeof n){var r=n.shortId,o=n.uuid;r&&i.add(r),o&&(i.add(o),t.set(o,n),a.set(o,o),r&&a.set(r,o))}return{byUuid:t,uuidByScope:a,knownScopes:i}},ev=(e=[])=>e?.byUuid&&e?.uuidByScope&&e?.knownScopes?e:eh(e),eg=(E=j(function*(e){try{var t=yield e.send("Runtime.evaluate",{expression:"JSON.stringify(Object.values(system.subspaces()).map((s) => ({ shortId: s.shortId, uuid: s.uuid, title: s.title })))",objectGroup:"console",returnByValue:!0}),a=t.result;if(t.exceptionDetails||"string"!=typeof a?.value)return[];return JSON.parse(a.value)}catch{return[]}}),function(e){return E.apply(this,arguments)}),ey=(e,{full:t=!1,width:a=100}={})=>{var i="string"==typeof e?e:JSON.stringify(e);return void 0===i?R.Ay.gray("undefined"):t||i.length<=a?i:`${i.substring(0,a)}…`},eb=(e,t)=>{var a=ev(t),i=e.subspaceUuid?a.byUuid.get(e.subspaceUuid):null;return{key:e.rawKey,scope:e.scope,...e.subspaceUuid?{subspaceUuid:e.subspaceUuid}:{},...i?.shortId?{subspaceShortId:i.shortId}:{},name:e.name,value:e.value}},eD=(F=j(function*(e,{databaseName:t,objectStoreName:a,options:i}){var n=parseInt(i.skip??"0",10)||0,r=parseInt(i.limit??"25",10)||25,o=null;try{o=(yield e.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:t,objectStoreName:a})).entriesCount}catch{}var s=yield e.send("IndexedDB.requestData",{securityOrigin:ep,databaseName:t,objectStoreName:a,indexName:"",skipCount:n,pageSize:r,returnByValue:!0}),p=s.objectStoreDataEntries,l=s.hasMore,d=!1,u=p.map(e=>{var t=ec(e.key).value,a=ec(e.value),i=a.value;return a.byRef&&(d=!0),{key:t,value:i}});if(i.json)return void console.log(JSON.stringify({database:t,objectStore:a,skip:n,limit:r,total:o,hasMore:!!l,entries:u},null,2));var c=null==o?"":` of ${o}`,m=n>0?`, skipped ${n}`:"";for(var f of(console.log(R.Ay.bold(`${t} / ${a} (${u.length}${c} entries${m})`)),console.log("─".repeat(60)),0===u.length&&console.log(R.Ay.gray(" No entries")),u)){var h=f.key,v=f.value,g="string"==typeof h?h:JSON.stringify(h);console.log(` ${R.Ay.cyan(g)}: ${ey(v,{full:!!i.full})}`)}l&&console.log(R.Ay.gray(" …more entries available — use -l/--limit and -s/--skip")),d&&console.log(R.Ay.yellow("\n Some values came back as object handles (device app without by-value reads).\n Update the device app to see full values."))}),function(e,t){return F.apply(this,arguments)}),ex=e=>e.option("-l, --limit <count>","Max items to fetch","25").option("-s, --skip <count>","Items to skip","0").option("--full","Do not truncate values"),ew=Z.command("storage").description("Storage inspection (read-only — CDP cannot mutate device storage)");ee(ew.command("list").description("Overview of all storage stores with entry counts")).action((A=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOMStorage.enable"),yield t.send("IndexedDB.enable");var a,i=(a=j(function*(e){return(yield t.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries.length}),function(e){return a.apply(this,arguments)}),n=yield i(!0),r=yield i(!1),o=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,s=[];for(var p of o){var l=p.startsWith(el)?ed:eu,d=null;try{d=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:p,objectStoreName:l})).entriesCount}catch{}s.push({name:p,objectStoreName:l,entriesCount:d})}var u=s.filter(e=>e.name.startsWith(el)).map(e=>({...e,...em(e.name)})),c=s.filter(e=>!e.name.startsWith(el));if(e.json)return void console.log(JSON.stringify({system:{persist:n,memory:r},dataBanks:u,caches:c},null,2));var m=e=>null==e?R.Ay.gray("? entries"):`${e} entries`;for(var f of(console.log(R.Ay.bold("Storage Overview")+R.Ay.gray(" (read-only)")),console.log("─".repeat(60)),console.log(` ${R.Ay.bold("System storage")}${R.Ay.gray(" → storage system persist|memory")}`),console.log(` persist ${m(n)}`),console.log(` memory ${m(r)}`),console.log(` ${R.Ay.bold("Data banks")}${R.Ay.gray(" → storage data-bank get <S_xxxx|title>")}`),0===u.length&&console.log(R.Ay.gray(" none")),u)){var h=f.title?` "${f.title}"`:"";console.log(` ${R.Ay.cyan(f.shortId)}${h} ${m(f.entriesCount)}`)}for(var v of(console.log(` ${R.Ay.bold("Caches")}${R.Ay.gray(" → storage cache generator|generative-media")}`),0===c.length&&console.log(R.Ay.gray(" none")),c))console.log(` ${R.Ay.cyan(v.name)} ${m(v.entriesCount)}`);console.log("─".repeat(60))}),function(e){return t.apply(this,arguments)}))}),function(e){return A.apply(this,arguments)}));var e_=ew.command("system").description("System key-value storage"),eE=e=>e.option("--scope <scope>","Filter by scope: global or a subspace S_xxxx/UUID").option("--prefix <prefix>","Filter by key-name prefix (within the scope)").option("--full","Do not truncate values"),eF=(e,t)=>{var a;return a=j(function*(a){var i;yield et(a,(i=j(function*(i){yield i.send("DOMStorage.enable");var n=(yield i.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries,r=yield eg(i),o=eh(r),s=((e,{scope:t,prefix:a,subspaceIndex:i=[]}={})=>{var n=ev(i),r=t&&"global"!==t?n.uuidByScope.get(t)||t:null;return e.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).filter(e=>("global"!==t||"global"===e.scope)&&(!r||"subspace"===e.scope&&e.subspaceUuid===r)&&(!a||!!e.name.startsWith(a)))})(n,{scope:a.scope,prefix:a.prefix,subspaceIndex:o});if(a.json)return void console.log(JSON.stringify(s.map(e=>eb(e,o)),null,2));if(((e,{label:t,subspaceIndex:a,full:i})=>{var n=ev(a);if(console.log(R.Ay.bold(`${t} (${e.length} items)`)),console.log("─".repeat(60)),0===e.length)return console.log(R.Ay.gray(" No entries"));var r=null;for(var o of e){var s="subspace"===o.scope?`subspace:${o.subspaceUuid}`:o.scope;if(s!==r)if(r=s,"subspace"===o.scope){var p=n.byUuid.get(o.subspaceUuid),l=p?`${p.shortId}${p.title?` "${p.title}"`:""} `:"";console.log(` ${R.Ay.bold(`subspace ${l}`)}${R.Ay.gray(`(${o.subspaceUuid})`)}`)}else console.log(` ${R.Ay.bold(o.scope||"other")}`);var d=o.name||o.rawKey;console.log(` ${R.Ay.cyan(d)}: ${ey(o.value,{full:i,width:80})}`)}})(s,{label:t,subspaceIndex:o,full:!!a.full}),0===s.length&&a.scope&&"global"!==a.scope&&!o.knownScopes.has(a.scope)){var p=r.map(e=>e.shortId).join(", ");console.log(R.Ay.yellow(` Scope "${a.scope}" did not match a known subspace${p?` (known: ${p})`:""}`))}}),function(e){return i.apply(this,arguments)}))}),function(e){return a.apply(this,arguments)}};eE(ee(e_.command("persist").description("Show persistent system storage entries"))).action(eF(!0,"Persistent Storage")),eE(ee(e_.command("memory").description("Show in-memory system storage entries"))).action(eF(!1,"Memory Storage")),ee(e_.command("get <key>").description("Show a single system storage value (full, untruncated)").option("--scope <scope>","Key scope: global (default) or a subspace S_xxxx/UUID","global").option("--memory","Read from in-memory storage instead of persistent")).action((C=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOMStorage.enable");var i=(yield a.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:!t.memory}})).entries,n=eh((yield eg(a))),r=[e];if("global"===t.scope)r.push(`global:${e}`);else{var o=n.uuidByScope.get(t.scope)||t.scope;r.push(`subspace:${o}:${e}`)}var s=i.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).find(e=>r.includes(e.rawKey));if(!s){var p=i.map(([e])=>e).filter(t=>t.toLowerCase().includes(e.toLowerCase())).slice(0,5);if(p.length>0)for(var l of(console.error(R.Ay.yellow("Similar keys:")),p))console.error(` ${l}`);throw Error(`Key not found: ${r[r.length-1]}`)}if(t.json)return void console.log(JSON.stringify(eb(s,n),null,2));if("string"==typeof s.value)try{console.log(JSON.stringify(JSON.parse(s.value),null,2));return}catch{}console.log("string"==typeof s.value?s.value:JSON.stringify(s.value,null,2))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return C.apply(this,arguments)}));var eA=ew.command("data-bank").description("Data bank (Property Bank) stores");ee(eA.command("list").description("List data banks")).action((S=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("IndexedDB.enable");var a=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,i=[];for(var n of a.filter(e=>e.startsWith(el))){var r=null;try{r=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:n,objectStoreName:ed})).entriesCount}catch{}i.push({name:n,...em(n),entriesCount:r})}if(e.json)return void console.log(JSON.stringify(i,null,2));for(var o of(console.log(R.Ay.bold(`Data Banks (${i.length})`)),console.log("─".repeat(60)),0===i.length&&console.log(R.Ay.gray(" No data banks")),i)){var s=o.title?` ${R.Ay.green(`"${o.title}"`)}`:"",p=null===o.entriesCount||void 0===o.entriesCount?"":R.Ay.gray(` ${o.entriesCount} entries`);console.log(` ${R.Ay.cyan(o.shortId)}${s}${p}`)}console.log(R.Ay.gray("\nInspect: bricks devtools storage data-bank get <S_xxxx|title>"))}),function(e){return t.apply(this,arguments)}))}),function(e){return S.apply(this,arguments)})),ex(ee(eA.command("get <bank> [store]").description(`Show data bank entries — <bank> accepts a subspace S_xxxx, a title keyword, or the full DATA-* database name; [store] defaults to "${ed}"`))).action((T=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){yield i.send("IndexedDB.enable");var n=(yield i.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,r=((e,t)=>{var a=e.filter(e=>e.startsWith(el)),i=a.find(e=>e===t||e===`${el}${t}`);if(i)return{match:i};if(t.startsWith("S_")){var n=a.filter(e=>em(e).shortId===t);if(1===n.length)return{match:n[0]};if(n.length>1)return{candidates:n}}var r=t.toLowerCase(),o=a.filter(e=>e.slice(el.length).toLowerCase().includes(r));return 1===o.length?{match:o[0]}:{candidates:o}})(n,e);if(!r.match){var o=n.filter(e=>e.startsWith(el)),s=(r.candidates?.length||0)>1,p=s?r.candidates:o;for(var l of(console.error(R.Ay.yellow(s?`Data bank "${e}" is ambiguous. Candidates:`:`Data bank "${e}" not found. Available:`)),p)){var d=em(l),u=d.shortId,c=d.title;console.error(` ${u}${c?` "${c}"`:""}`)}process.exit(1)}yield eD(i,{databaseName:r.match,objectStoreName:t||ed,options:a})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return T.apply(this,arguments)}));var eC=ew.command("cache").description("Cache stores (generator, generative-media)"),eS=e=>{var t;return t=j(function*(t){var a;yield et(t,(a=j(function*(a){yield a.send("IndexedDB.enable"),yield eD(a,{databaseName:e,objectStoreName:eu,options:t})}),function(e){return a.apply(this,arguments)}))}),function(e){return t.apply(this,arguments)}};ex(ee(eC.command("generator").description("Show generator cache entries"))).action(eS("GENERATOR_CACHE")),ex(ee(eC.command("generative-media").description("Show generative media cache entries"))).action(eS("GENERATIVE_MEDIA_CACHE")),ex(ee(ew.command("generator-cache",{hidden:!0}).description("Alias of `storage cache generator`"))).action(eS("GENERATOR_CACHE"));var eT=Z.command("runtime").description("Runtime and evaluation");ee(eT.command("eval <expression>").description("Evaluate JavaScript expression").option("--await","Await promise result")).action((k=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Runtime.enable");var i=yield a.send("Runtime.evaluate",{expression:e,objectGroup:"console",returnByValue:!0,awaitPromise:!!t.await,generatePreview:!0});if(t.json)return void console.log(JSON.stringify(i,null,2));i.exceptionDetails&&(console.error(R.Ay.red(`Error: ${i.exceptionDetails.text}`)),i.exceptionDetails.exception?.description&&console.error(R.Ay.red(i.exceptionDetails.exception.description)),process.exit(1));var n=i.result;"undefined"===n.type?console.log(R.Ay.gray("undefined")):void 0!==n.value?console.log("object"==typeof n.value?JSON.stringify(n.value,null,2):String(n.value)):n.description?console.log(n.description):console.log(R.Ay.gray(`[${n.type}${n.subtype?`:${n.subtype}`:""}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return k.apply(this,arguments)})),ee(eT.command("properties <objectId>").description("Get properties of a remote object")).action((N=j(function*(e,t){var a;yield et(t,(a=j(function*(a){var i=(yield a.send("Runtime.getProperties",{objectId:e,ownProperties:!0})).result;if(t.json)return void console.log(JSON.stringify(i,null,2));for(var n of(console.log(R.Ay.bold(`Properties of ${e}`)),i))if(n.enumerable){var r=n.value,o=r?.description||r?.value?.toString()||R.Ay.gray(`[${r?.type}]`);console.log(` ${R.Ay.cyan(n.name)}: ${o}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return N.apply(this,arguments)}));var ek=Z.command("simulator").description("Inspect simulated peripherals (Application Simulator / web preview servers only)").command("thermal-printer").description("Simulated thermal printers and their print results"),eN="This DevTools server does not expose simulator inspection. Connect to an Application Simulator preview (e.g. the CTOR project simulator) running a preview build with the Simulator CDP domain.",eO=e=>{if(!e)return"unknown time";var t=new Date(e);return Number.isNaN(t.getTime())?"unknown time":t.toLocaleString()},eI=e=>{if(e.raw)return"raw data";var t=(e=>{if(!e?.length)return"";var t=[];for(var a of e){var i=t[t.length-1];i&&i.type===a?i.count+=1:t.push({type:a,count:1})}return t.map(({type:e,count:t})=>t>1?`${e}\xd7${t}`:e).join(", ")})(e.commandTypes);return`${e.commandCount} command(s)${t?`: ${t}`:""}`};ee(ek.command("list").description("List simulated thermal printers and their print history").option("--commands","Include full print command payloads (use with -j)")).action((O=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=yield t.send("Simulator.listThermalPrinters",{includeCommands:!!e.commands}),i=a?.printers;if(Array.isArray(i)||(console.error(R.Ay.red(eN)),process.exit(1)),e.json)return void console.log(JSON.stringify(i,null,2));if(0===i.length){console.log(R.Ay.yellow("No simulated thermal printers registered.")),console.log(R.Ay.gray("A printer appears once the application configures GENERATOR_THERMAL_PRINTER."));return}for(var n of(console.log(R.Ay.bold(`Simulated Thermal Printers (${i.length})`)),console.log("─".repeat(60)),i)){var r=n.errored?R.Ay.red("fault"):n.connected?R.Ay.green("connected"):R.Ay.gray("idle");console.log(` ${R.Ay.bold(n.label||n.driver)} ${R.Ay.gray(`(${n.driver})`)} [${r}]`),console.log(` Printer ID: ${R.Ay.cyan(n.id)}`),n.connectString&&console.log(` Connect: ${R.Ay.gray(n.connectString)}`);var o=n.printHistory||[];if(0===o.length){console.log(R.Ay.gray(" No print results yet."));continue}var s="memory"===n.printHistorySource?R.Ay.gray(" (restored from memory)"):"";for(var p of(console.log(` Print results, newest first${s}:`),o))console.log(` --index ${p.index} ${eO(p.printedAt)} ${R.Ay.gray(eI(p))}`)}console.log("─".repeat(60)),console.log(R.Ay.gray("Save one as PNG: bricks devtools simulator thermal-printer print-result"))}),function(e){return t.apply(this,arguments)}))}),function(e){return O.apply(this,arguments)})),ee(ek.command("print-result").description("Render a simulated print result to a PNG image").option("--printer <id>","Printer ID (see `list`; defaults to the only registered printer)").option("-i, --index <n>","Print history index, 0 = latest","0").option("--scale <factor>","Image scale factor (1-4)","2").option("-o, --output <path>","Output file path")).action((I=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Simulator.captureThermalPrinterPrintResult",{id:e.printer,index:parseInt(e.index,10)||0,scale:parseFloat(e.scale)||2},3e4);i?.data||(console.error(R.Ay.red(eN)),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`print-result-${Date.now()}.png`,s=r.resolve(o);(n.writeFileSync(s,Buffer.from(i.data,"base64")),e.json)?console.log(JSON.stringify({path:s,id:i.id,driver:i.driver,label:i.label,index:i.index,printedAt:i.printedAt,width:i.width,height:i.height},null,2)):(console.log(R.Ay.green(`Print result saved to ${s}`)),console.log(` Printer: ${i.label} ${R.Ay.gray(`(${i.driver}, ${i.id})`)}`),console.log(` Printed: ${eO(i.printedAt)} (--index ${i.index})`),i.width&&i.height&&console.log(` Size: ${i.width}\xd7${i.height}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return I.apply(this,arguments)}))},11405(e,t,a){a.d(t,{l:()=>v});var i,n,r,o=a(99436),s=a(35679),p=a(7586),l=a(85382),d=a(8479),u=a(47988),c=(i=o(function*(){try{return yield Promise.all([a.e(587),a.e(647),a.e(10),a.e(117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return i.apply(this,arguments)}),m=(e,t,a)=>({severity:e,code:t,message:a}),f=(n=o(function*({version:e="2.25.0-beta.58",mcpCheck:t=c}={}){var a=(0,u.getCurrentProfile)(),i=(0,u.getCurrentProfileSource)(),n=(0,u.getTokenInfo)(a),r=(0,u.getBaseUrl)(),o=(0,u.getActivityLogBaseUrl)(),s=[],f={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:i},config:{path:u.CONFIG_PATH,baseUrl:r,activityLogBaseUrl:o},auth:{available:!!n?.token,source:n?.token?"config":"missing",workspaceId:n?.workspaceId||null,workspaceName:n?.workspaceName||null,createdAt:n?.createdAt||null,tokenPreview:(0,p.$l)(n?.token)},connectivity:{workspace:{ok:!1,skipped:!n?.token,error:null}},capabilities:{zeroArgMode:(0,d.z)()?"interactive":"help",mcp:{available:!1,error:null}},issues:s};if(n?.token)try{var h=yield(0,l.createClient)(r,n.token).workspace();f.connectivity.workspace={ok:!0,skipped:!1,error:null,id:h?._id||n.workspaceId||null,name:h?.name||n.workspaceName||null},f.auth.workspaceId=h?._id||f.auth.workspaceId,f.auth.workspaceName=h?.name||f.auth.workspaceName}catch(e){f.connectivity.workspace={ok:!1,skipped:!1,error:e.message},s.push(m("error","workspace_unreachable",`Workspace query failed for ${r}: ${e.message}`))}else s.push(m("warning","auth_missing","No saved token for the current profile."));var v=yield t();return f.capabilities.mcp={available:v.available,error:v.error||null},v.available||s.push(m("warning","mcp_unavailable",`MCP stdio server is unavailable: ${v.error||"Unknown error"}`)),f.ok=0===s.length,f}),function(){return n.apply(this,arguments)}),h=(e,t,a)=>`${e.padEnd(14)} ${t}${a?` ${a}`:""}`,v=new s.uB("doctor").description("Check CLI configuration, auth state, and workspace reachability").option("-j, --json","Output as JSON").action((r=o(function*(e){try{var t=yield f();if(e.json)return void(0,p.GF)(t);console.log((e=>{var t=[];if(t.push("BRICKS CLI Doctor"),t.push("─".repeat(60)),t.push(h("CLI","OK",`bricks v${e.cli.version}`)),t.push(h("Profile","OK",`${e.profile.name} (${e.profile.source})`)),t.push(h("BRICKS API","OK",e.config.baseUrl)),t.push(h("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace";t.push(h("Auth","OK",`${a} (${e.auth.source}, ${e.auth.tokenPreview})`))}else t.push(h("Auth","WARN","No saved token for the current profile"));if(e.connectivity.workspace.skipped)t.push(h("Workspace","WARN","Skipped because no token is available"));else if(e.connectivity.workspace.ok){var i=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";t.push(h("Workspace","OK",i))}else t.push(h("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?t.push(h("MCP","OK","STDIO server import is available")):t.push(h("MCP","WARN",e.capabilities.mcp.error)),t.push(h("Zero-arg mode",((e,t=!1)=>e?"OK":t?"WARN":"FAIL")("interactive"===e.capabilities.zeroArgMode,"help"===e.capabilities.zeroArgMode),"interactive"===e.capabilities.zeroArgMode?"Starts Ink interactive mode on TTY":"Shows help outside TTY contexts")),e.issues.length>0&&(t.push("─".repeat(60)),t.push("Issues"),e.issues.forEach(e=>{t.push(`- [${e.severity}] ${e.message}`)})),t.join("\n")})(t))}catch(t){e.json?(0,p.OW)(t.message):console.error(`Doctor failed: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},28634(e,t,a){a.d(t,{p:()=>w});var i,n,r,o,s,p,l,d=a(68832),u=a(99436),c=a(35679),m=a(73284),f=a(30155),h=a(7586),v=a(56493),g=a(68168),y=a(98593),b=e=>{if(!e)return m.Ay.gray("○");var t=Date.now()-new Date(e).getTime();return t<=3e5?m.Ay.green("●"):60>Math.floor(t/6e4)?m.Ay.yellow("○"):m.Ay.red("○")},D=(e,t)=>(0,y.H_)(e,t,{deviceCount:e?.devices?.length||0}),x=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"],w=new c.uB("group").description("Device Group management");w.command("list").description("List all device groups").option("-j, --json","Output as JSON").action((i=u(function*(e){var t=(0,v.o)(),a=(0,f.default)("Fetching device groups...").start();try{var i=yield t.deviceGroups({});if(a.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(m.Ay.yellow("No device groups found"));console.log(m.Ay.bold("\nDevice Groups")),console.log("─".repeat(80)),i.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${m.Ay.cyan(e.name)} ${m.Ay.gray(`(${t} devices)`)}`),console.log(` ID: ${m.Ay.gray(e._id)}`),e.description&&console.log(` ${m.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list groups: ${e.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),w.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action((n=u(function*(e,t){var a=(0,v.o)(),i=(0,f.default)("Fetching device group...").start();try{var n=yield a.deviceGroup({id:e});if(i.stop(),n||(console.log(m.Ay.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(m.Ay.bold(`
|
|
106
|
+
Use --info to see connection URLs`))}),function(e,t){return d.apply(this,arguments)})),ee(Z.command("screenshot").description("Capture device screenshot").option("-o, --output <path>","Output file path")).action((u=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Page.captureScreenshot",{format:"png"});i.data||(console.error(R.Ay.red("No screenshot data received")),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`screenshot-${Date.now()}.png`,s=r.resolve(o);n.writeFileSync(s,Buffer.from(i.data,"base64")),console.log(R.Ay.green(`Screenshot saved to ${s}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return u.apply(this,arguments)}));var er=Z.command("brick").description("Brick component inspection");ee(er.command("tree").description("Print brick component tree").option("-d, --depth <depth>","Max depth (-1 for full)","3")).action((c=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e.depth,10),i=(yield t.send("DOM.getDocument",{depth:a})).root;e.json?console.log(JSON.stringify(i,null,2)):console.log(en(i).join("\n"))}),function(e){return t.apply(this,arguments)}))}),function(e){return c.apply(this,arguments)})),ee(er.command("query <selector>").description("Find brick by CSS selector")).action((m=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelector",{nodeId:i.nodeId,selector:e})).nodeId;if(0===n)return void console.log(R.Ay.yellow("No element found"));var r=yield a.send("DOM.describeNode",{nodeId:n}),o=ea((yield a.send("DOM.getAttributes",{nodeId:n})).attributes);if(t.json)return void console.log(JSON.stringify({nodeId:n,...r.node,attributes:o},null,2));if(console.log(R.Ay.bold(`Node ${n}: ${r.node?.nodeName||"unknown"}`)),Object.keys(o).length>0)for(var s of(console.log(R.Ay.bold("Attributes:")),Object.entries(o))){var p=$(s,2),l=p[0],d=p[1];console.log(` ${R.Ay.cyan(l)}: ${d}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return m.apply(this,arguments)})),ee(er.command("query-all <selector>").description("Find all bricks matching CSS selector")).action((f=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelectorAll",{nodeId:i.nodeId,selector:e})).nodeIds;if(t.json)return void console.log(JSON.stringify({nodeIds:n,count:n.length},null,2));for(var r of(console.log(R.Ay.bold(`Found ${n.length} element(s)`)),n)){var o=yield a.send("DOM.describeNode",{nodeId:r}),s=ea((yield a.send("DOM.getAttributes",{nodeId:r})).attributes),p=s.id||s["short-id"]||"";console.log(` ${r}: ${o.node?.nodeName}${p?R.Ay.gray(`#${p}`):""}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return f.apply(this,arguments)})),ee(er.command("attributes <nodeId>").description("Get brick attributes")).action((h=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=ea((yield a.send("DOM.getAttributes",{nodeId:i})).attributes);if(t.json)return void console.log(JSON.stringify(n,null,2));if(0===Object.keys(n).length)return void console.log(R.Ay.gray("No attributes"));for(var r of Object.entries(n)){var o=$(r,2),s=o[0],p=o[1];console.log(` ${R.Ay.cyan(s)}: ${p}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return h.apply(this,arguments)})),ee(er.command("box-model <nodeId>").description("Get brick dimensions and position")).action((v=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.getBoxModel",{nodeId:i})).model;t.json?console.log(JSON.stringify(n,null,2)):(console.log(R.Ay.bold(`Box Model for node ${i}`)),console.log(` Width: ${n.width}`),console.log(` Height: ${n.height}`),n.content&&console.log(` Content: [${n.content.join(", ")}]`),n.padding&&console.log(` Padding: [${n.padding.join(", ")}]`),n.border&&console.log(` Border: [${n.border.join(", ")}]`),n.margin&&console.log(` Margin: [${n.margin.join(", ")}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return v.apply(this,arguments)})),ee(er.command("resolve <nodeId>").description("Resolve brick to JavaScript object with properties")).action((g=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.resolveNode",{nodeId:i})).object;if(t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Resolved node ${i}`)),console.log(` Type: ${n.type}`),n.className&&console.log(` Class: ${n.className}`),n.description&&console.log(` Description: ${n.description}`),n.objectId&&console.log(` Object ID: ${R.Ay.gray(n.objectId)}`),n.preview?.properties)for(var r of(console.log(R.Ay.bold(" Properties:")),n.preview.properties))console.log(` ${R.Ay.cyan(r.name)}: ${r.value}`)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return g.apply(this,arguments)})),ee(er.command("focus <nodeId>").description("Focus a brick element")).action((y=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e,10);yield t.send("DOM.focus",{nodeId:a}),console.log(R.Ay.green(`Focused node ${a}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return y.apply(this,arguments)}));var eo=Z.command("input").description("Input emulation");ee(eo.command("tap <x> <y>").description("Tap/click at coordinates")).action((b=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){var n=parseFloat(e),r=parseFloat(t),o=yield i.send("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:r,button:"left",clickCount:1});yield i.send("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:r,button:"left",clickCount:1}),(({x:e,y:t,tapResult:a,json:i})=>{if(i)return console.log(JSON.stringify({x:e,y:t,...a||{}},null,2));console.log(R.Ay.green(`Tapped at (${e}, ${t})`));var n=ei(a?.element||a?.tappedElement||a?.hitElement);if(!n)return console.log(R.Ay.yellow(" Element: none"));console.log(` Element: ${n}`);var r=a?.hitElement,o=a?.tappedElement;if(r&&o&&r.nodeId!==o.nodeId){var s=ei(r);s&&console.log(` Hit: ${s}`)}a&&!1===a.dispatched&&console.log(R.Ay.yellow(" Action: no pressable handler"))})({x:n,y:r,tapResult:o,json:a.json})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return b.apply(this,arguments)})),ee(eo.command("type <text>").description("Insert text into focused element")).action((D=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.insertText",{text:e}),console.log(R.Ay.green(`Typed: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return D.apply(this,arguments)})),ee(eo.command("key <key>").description("Dispatch key event (e.g., Enter, Escape, Tab)")).action((x=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.dispatchKeyEvent",{type:"keyDown",key:e}),yield t.send("Input.dispatchKeyEvent",{type:"keyUp",key:e}),console.log(R.Ay.green(`Key: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return x.apply(this,arguments)}));var es=Z.command("network").description("Network inspection");ee(es.command("list").description("Capture snapshot of network activity").option("--duration <ms>","Capture duration in milliseconds","2000")).action((w=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=new Map,i=parseInt(e.duration,10);t.on("Network.requestWillBeSent",e=>{a.set(e.requestId,{method:e.request.method,url:e.request.url,requestId:e.requestId,timestamp:e.timestamp})}),t.on("Network.responseReceived",e=>{var t=a.get(e.requestId);t&&(t.status=e.response.status,t.mimeType=e.response.mimeType)}),t.on("Network.loadingFailed",e=>{var t=a.get(e.requestId);t&&(t.error=e.errorText)}),yield t.send("Network.enable"),yield new Promise(e=>setTimeout(e,i)),yield t.send("Network.disable");var n=[...a.values()];if(e.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Network Activity (captured ${(i/1e3).toFixed(1)}s, ${n.length} requests)`)),0===n.length)return void console.log(R.Ay.gray(" No network activity captured"));for(var r of n){var o=r.error?R.Ay.red("ERR"):r.status?r.status<300?R.Ay.green(r.status):r.status<400?R.Ay.yellow(r.status):R.Ay.red(r.status):R.Ay.gray("..."),s=r.url.length>60?r.url.substring(0,57)+"...":r.url;console.log(` ${o} ${R.Ay.bold(r.method.padEnd(6))} ${s} ${R.Ay.gray(`(${r.requestId})`)}`)}}),function(e){return t.apply(this,arguments)}))}),function(e){return w.apply(this,arguments)})),ee(es.command("get <requestId>").description("Get response body for a network request")).action((_=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Network.enable");var i=yield a.send("Network.getResponseBody",{requestId:e}),n=i.body,r=i.base64Encoded;t.json?console.log(JSON.stringify({body:n,base64Encoded:r},null,2)):r?console.log(R.Ay.gray(`[base64 encoded, ${n.length} chars]`)):console.log(n)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return _.apply(this,arguments)}));var ep="bricks://app",el="DATA-",ed="properties",eu="entries",ec=e=>{if(null==e||"object"!=typeof e)return{value:e};if("value"in e)return{value:e.value};if("unserializableValue"in e)return{value:e.unserializableValue};if(e.objectId){var t=e.preview?.properties;return Array.isArray(t)&&t.length>0?{value:t.reduce((e,t)=>(e[t.name]=t.value,e),{}),byRef:!0}:{value:e.description||`[${e.type}]`,byRef:!0}}return{value:"undefined"===e.type?void 0:e.description}},em=e=>{var t=e.startsWith(el)?e.slice(el.length):e,a=t.indexOf(":");return a<0?{shortId:t,title:null}:{shortId:t.slice(0,a),title:t.slice(a+1)}},ef=e=>{if(e.startsWith("global:"))return{scope:"global",name:e.slice(7)};if(e.startsWith("subspace:")){var t=e.slice(9),a=t.indexOf(":");return a>0?{scope:"subspace",subspaceUuid:t.slice(0,a),name:t.slice(a+1)}:{scope:"subspace",subspaceUuid:t,name:""}}return{scope:null,name:e}},eh=(e=[])=>{var t=new Map,a=new Map,i=new Set;for(var n of e||[])if(n&&"object"==typeof n){var r=n.shortId,o=n.uuid;r&&i.add(r),o&&(i.add(o),t.set(o,n),a.set(o,o),r&&a.set(r,o))}return{byUuid:t,uuidByScope:a,knownScopes:i}},ev=(e=[])=>e?.byUuid&&e?.uuidByScope&&e?.knownScopes?e:eh(e),eg=(E=j(function*(e){try{var t=yield e.send("Runtime.evaluate",{expression:"JSON.stringify(Object.values(system.subspaces()).map((s) => ({ shortId: s.shortId, uuid: s.uuid, title: s.title })))",objectGroup:"console",returnByValue:!0}),a=t.result;if(t.exceptionDetails||"string"!=typeof a?.value)return[];return JSON.parse(a.value)}catch{return[]}}),function(e){return E.apply(this,arguments)}),ey=(e,{full:t=!1,width:a=100}={})=>{var i="string"==typeof e?e:JSON.stringify(e);return void 0===i?R.Ay.gray("undefined"):t||i.length<=a?i:`${i.substring(0,a)}…`},eb=(e,t)=>{var a=ev(t),i=e.subspaceUuid?a.byUuid.get(e.subspaceUuid):null;return{key:e.rawKey,scope:e.scope,...e.subspaceUuid?{subspaceUuid:e.subspaceUuid}:{},...i?.shortId?{subspaceShortId:i.shortId}:{},name:e.name,value:e.value}},eD=(F=j(function*(e,{databaseName:t,objectStoreName:a,options:i}){var n=parseInt(i.skip??"0",10)||0,r=parseInt(i.limit??"25",10)||25,o=null;try{o=(yield e.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:t,objectStoreName:a})).entriesCount}catch{}var s=yield e.send("IndexedDB.requestData",{securityOrigin:ep,databaseName:t,objectStoreName:a,indexName:"",skipCount:n,pageSize:r,returnByValue:!0}),p=s.objectStoreDataEntries,l=s.hasMore,d=!1,u=p.map(e=>{var t=ec(e.key).value,a=ec(e.value),i=a.value;return a.byRef&&(d=!0),{key:t,value:i}});if(i.json)return void console.log(JSON.stringify({database:t,objectStore:a,skip:n,limit:r,total:o,hasMore:!!l,entries:u},null,2));var c=null==o?"":` of ${o}`,m=n>0?`, skipped ${n}`:"";for(var f of(console.log(R.Ay.bold(`${t} / ${a} (${u.length}${c} entries${m})`)),console.log("─".repeat(60)),0===u.length&&console.log(R.Ay.gray(" No entries")),u)){var h=f.key,v=f.value,g="string"==typeof h?h:JSON.stringify(h);console.log(` ${R.Ay.cyan(g)}: ${ey(v,{full:!!i.full})}`)}l&&console.log(R.Ay.gray(" …more entries available — use -l/--limit and -s/--skip")),d&&console.log(R.Ay.yellow("\n Some values came back as object handles (device app without by-value reads).\n Update the device app to see full values."))}),function(e,t){return F.apply(this,arguments)}),ex=e=>e.option("-l, --limit <count>","Max items to fetch","25").option("-s, --skip <count>","Items to skip","0").option("--full","Do not truncate values"),ew=Z.command("storage").description("Storage inspection (read-only — CDP cannot mutate device storage)");ee(ew.command("list").description("Overview of all storage stores with entry counts")).action((A=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOMStorage.enable"),yield t.send("IndexedDB.enable");var a,i=(a=j(function*(e){return(yield t.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries.length}),function(e){return a.apply(this,arguments)}),n=yield i(!0),r=yield i(!1),o=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,s=[];for(var p of o){var l=p.startsWith(el)?ed:eu,d=null;try{d=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:p,objectStoreName:l})).entriesCount}catch{}s.push({name:p,objectStoreName:l,entriesCount:d})}var u=s.filter(e=>e.name.startsWith(el)).map(e=>({...e,...em(e.name)})),c=s.filter(e=>!e.name.startsWith(el));if(e.json)return void console.log(JSON.stringify({system:{persist:n,memory:r},dataBanks:u,caches:c},null,2));var m=e=>null==e?R.Ay.gray("? entries"):`${e} entries`;for(var f of(console.log(R.Ay.bold("Storage Overview")+R.Ay.gray(" (read-only)")),console.log("─".repeat(60)),console.log(` ${R.Ay.bold("System storage")}${R.Ay.gray(" → storage system persist|memory")}`),console.log(` persist ${m(n)}`),console.log(` memory ${m(r)}`),console.log(` ${R.Ay.bold("Data banks")}${R.Ay.gray(" → storage data-bank get <S_xxxx|title>")}`),0===u.length&&console.log(R.Ay.gray(" none")),u)){var h=f.title?` "${f.title}"`:"";console.log(` ${R.Ay.cyan(f.shortId)}${h} ${m(f.entriesCount)}`)}for(var v of(console.log(` ${R.Ay.bold("Caches")}${R.Ay.gray(" → storage cache generator|generative-media")}`),0===c.length&&console.log(R.Ay.gray(" none")),c))console.log(` ${R.Ay.cyan(v.name)} ${m(v.entriesCount)}`);console.log("─".repeat(60))}),function(e){return t.apply(this,arguments)}))}),function(e){return A.apply(this,arguments)}));var e_=ew.command("system").description("System key-value storage"),eE=e=>e.option("--scope <scope>","Filter by scope: global or a subspace S_xxxx/UUID").option("--prefix <prefix>","Filter by key-name prefix (within the scope)").option("--full","Do not truncate values"),eF=(e,t)=>{var a;return a=j(function*(a){var i;yield et(a,(i=j(function*(i){yield i.send("DOMStorage.enable");var n=(yield i.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries,r=yield eg(i),o=eh(r),s=((e,{scope:t,prefix:a,subspaceIndex:i=[]}={})=>{var n=ev(i),r=t&&"global"!==t?n.uuidByScope.get(t)||t:null;return e.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).filter(e=>("global"!==t||"global"===e.scope)&&(!r||"subspace"===e.scope&&e.subspaceUuid===r)&&(!a||!!e.name.startsWith(a)))})(n,{scope:a.scope,prefix:a.prefix,subspaceIndex:o});if(a.json)return void console.log(JSON.stringify(s.map(e=>eb(e,o)),null,2));if(((e,{label:t,subspaceIndex:a,full:i})=>{var n=ev(a);if(console.log(R.Ay.bold(`${t} (${e.length} items)`)),console.log("─".repeat(60)),0===e.length)return console.log(R.Ay.gray(" No entries"));var r=null;for(var o of e){var s="subspace"===o.scope?`subspace:${o.subspaceUuid}`:o.scope;if(s!==r)if(r=s,"subspace"===o.scope){var p=n.byUuid.get(o.subspaceUuid),l=p?`${p.shortId}${p.title?` "${p.title}"`:""} `:"";console.log(` ${R.Ay.bold(`subspace ${l}`)}${R.Ay.gray(`(${o.subspaceUuid})`)}`)}else console.log(` ${R.Ay.bold(o.scope||"other")}`);var d=o.name||o.rawKey;console.log(` ${R.Ay.cyan(d)}: ${ey(o.value,{full:i,width:80})}`)}})(s,{label:t,subspaceIndex:o,full:!!a.full}),0===s.length&&a.scope&&"global"!==a.scope&&!o.knownScopes.has(a.scope)){var p=r.map(e=>e.shortId).join(", ");console.log(R.Ay.yellow(` Scope "${a.scope}" did not match a known subspace${p?` (known: ${p})`:""}`))}}),function(e){return i.apply(this,arguments)}))}),function(e){return a.apply(this,arguments)}};eE(ee(e_.command("persist").description("Show persistent system storage entries"))).action(eF(!0,"Persistent Storage")),eE(ee(e_.command("memory").description("Show in-memory system storage entries"))).action(eF(!1,"Memory Storage")),ee(e_.command("get <key>").description("Show a single system storage value (full, untruncated)").option("--scope <scope>","Key scope: global (default) or a subspace S_xxxx/UUID","global").option("--memory","Read from in-memory storage instead of persistent")).action((C=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOMStorage.enable");var i=(yield a.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:!t.memory}})).entries,n=eh((yield eg(a))),r=[e];if("global"===t.scope)r.push(`global:${e}`);else{var o=n.uuidByScope.get(t.scope)||t.scope;r.push(`subspace:${o}:${e}`)}var s=i.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).find(e=>r.includes(e.rawKey));if(!s){var p=i.map(([e])=>e).filter(t=>t.toLowerCase().includes(e.toLowerCase())).slice(0,5);if(p.length>0)for(var l of(console.error(R.Ay.yellow("Similar keys:")),p))console.error(` ${l}`);throw Error(`Key not found: ${r[r.length-1]}`)}if(t.json)return void console.log(JSON.stringify(eb(s,n),null,2));if("string"==typeof s.value)try{console.log(JSON.stringify(JSON.parse(s.value),null,2));return}catch{}console.log("string"==typeof s.value?s.value:JSON.stringify(s.value,null,2))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return C.apply(this,arguments)}));var eA=ew.command("data-bank").description("Data bank (Property Bank) stores");ee(eA.command("list").description("List data banks")).action((S=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("IndexedDB.enable");var a=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,i=[];for(var n of a.filter(e=>e.startsWith(el))){var r=null;try{r=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:n,objectStoreName:ed})).entriesCount}catch{}i.push({name:n,...em(n),entriesCount:r})}if(e.json)return void console.log(JSON.stringify(i,null,2));for(var o of(console.log(R.Ay.bold(`Data Banks (${i.length})`)),console.log("─".repeat(60)),0===i.length&&console.log(R.Ay.gray(" No data banks")),i)){var s=o.title?` ${R.Ay.green(`"${o.title}"`)}`:"",p=null===o.entriesCount||void 0===o.entriesCount?"":R.Ay.gray(` ${o.entriesCount} entries`);console.log(` ${R.Ay.cyan(o.shortId)}${s}${p}`)}console.log(R.Ay.gray("\nInspect: bricks devtools storage data-bank get <S_xxxx|title>"))}),function(e){return t.apply(this,arguments)}))}),function(e){return S.apply(this,arguments)})),ex(ee(eA.command("get <bank> [store]").description(`Show data bank entries — <bank> accepts a subspace S_xxxx, a title keyword, or the full DATA-* database name; [store] defaults to "${ed}"`))).action((T=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){yield i.send("IndexedDB.enable");var n=(yield i.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,r=((e,t)=>{var a=e.filter(e=>e.startsWith(el)),i=a.find(e=>e===t||e===`${el}${t}`);if(i)return{match:i};if(t.startsWith("S_")){var n=a.filter(e=>em(e).shortId===t);if(1===n.length)return{match:n[0]};if(n.length>1)return{candidates:n}}var r=t.toLowerCase(),o=a.filter(e=>e.slice(el.length).toLowerCase().includes(r));return 1===o.length?{match:o[0]}:{candidates:o}})(n,e);if(!r.match){var o=n.filter(e=>e.startsWith(el)),s=(r.candidates?.length||0)>1,p=s?r.candidates:o;for(var l of(console.error(R.Ay.yellow(s?`Data bank "${e}" is ambiguous. Candidates:`:`Data bank "${e}" not found. Available:`)),p)){var d=em(l),u=d.shortId,c=d.title;console.error(` ${u}${c?` "${c}"`:""}`)}process.exit(1)}yield eD(i,{databaseName:r.match,objectStoreName:t||ed,options:a})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return T.apply(this,arguments)}));var eC=ew.command("cache").description("Cache stores (generator, generative-media)"),eS=e=>{var t;return t=j(function*(t){var a;yield et(t,(a=j(function*(a){yield a.send("IndexedDB.enable"),yield eD(a,{databaseName:e,objectStoreName:eu,options:t})}),function(e){return a.apply(this,arguments)}))}),function(e){return t.apply(this,arguments)}};ex(ee(eC.command("generator").description("Show generator cache entries"))).action(eS("GENERATOR_CACHE")),ex(ee(eC.command("generative-media").description("Show generative media cache entries"))).action(eS("GENERATIVE_MEDIA_CACHE")),ex(ee(ew.command("generator-cache",{hidden:!0}).description("Alias of `storage cache generator`"))).action(eS("GENERATOR_CACHE"));var eT=Z.command("runtime").description("Runtime and evaluation");ee(eT.command("eval <expression>").description("Evaluate JavaScript expression").option("--await","Await promise result")).action((k=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Runtime.enable");var i=yield a.send("Runtime.evaluate",{expression:e,objectGroup:"console",returnByValue:!0,awaitPromise:!!t.await,generatePreview:!0});if(t.json)return void console.log(JSON.stringify(i,null,2));i.exceptionDetails&&(console.error(R.Ay.red(`Error: ${i.exceptionDetails.text}`)),i.exceptionDetails.exception?.description&&console.error(R.Ay.red(i.exceptionDetails.exception.description)),process.exit(1));var n=i.result;"undefined"===n.type?console.log(R.Ay.gray("undefined")):void 0!==n.value?console.log("object"==typeof n.value?JSON.stringify(n.value,null,2):String(n.value)):n.description?console.log(n.description):console.log(R.Ay.gray(`[${n.type}${n.subtype?`:${n.subtype}`:""}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return k.apply(this,arguments)})),ee(eT.command("properties <objectId>").description("Get properties of a remote object")).action((N=j(function*(e,t){var a;yield et(t,(a=j(function*(a){var i=(yield a.send("Runtime.getProperties",{objectId:e,ownProperties:!0})).result;if(t.json)return void console.log(JSON.stringify(i,null,2));for(var n of(console.log(R.Ay.bold(`Properties of ${e}`)),i))if(n.enumerable){var r=n.value,o=r?.description||r?.value?.toString()||R.Ay.gray(`[${r?.type}]`);console.log(` ${R.Ay.cyan(n.name)}: ${o}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return N.apply(this,arguments)}));var ek=Z.command("simulator").description("Inspect simulated peripherals (Application Simulator / web preview servers only)").command("thermal-printer").description("Simulated thermal printers and their print results"),eN="This DevTools server does not expose simulator inspection. Connect to an Application Simulator preview (e.g. the CTOR project simulator) running a preview build with the Simulator CDP domain.",eO=e=>{if(!e)return"unknown time";var t=new Date(e);return Number.isNaN(t.getTime())?"unknown time":t.toLocaleString()},eI=e=>{if(e.raw)return"raw data";var t=(e=>{if(!e?.length)return"";var t=[];for(var a of e){var i=t[t.length-1];i&&i.type===a?i.count+=1:t.push({type:a,count:1})}return t.map(({type:e,count:t})=>t>1?`${e}\xd7${t}`:e).join(", ")})(e.commandTypes);return`${e.commandCount} command(s)${t?`: ${t}`:""}`};ee(ek.command("list").description("List simulated thermal printers and their print history").option("--commands","Include full print command payloads (use with -j)")).action((O=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=yield t.send("Simulator.listThermalPrinters",{includeCommands:!!e.commands}),i=a?.printers;if(Array.isArray(i)||(console.error(R.Ay.red(eN)),process.exit(1)),e.json)return void console.log(JSON.stringify(i,null,2));if(0===i.length){console.log(R.Ay.yellow("No simulated thermal printers registered.")),console.log(R.Ay.gray("A printer appears once the application configures GENERATOR_THERMAL_PRINTER."));return}for(var n of(console.log(R.Ay.bold(`Simulated Thermal Printers (${i.length})`)),console.log("─".repeat(60)),i)){var r=n.errored?R.Ay.red("fault"):n.connected?R.Ay.green("connected"):R.Ay.gray("idle");console.log(` ${R.Ay.bold(n.label||n.driver)} ${R.Ay.gray(`(${n.driver})`)} [${r}]`),console.log(` Printer ID: ${R.Ay.cyan(n.id)}`),n.connectString&&console.log(` Connect: ${R.Ay.gray(n.connectString)}`);var o=n.printHistory||[];if(0===o.length){console.log(R.Ay.gray(" No print results yet."));continue}var s="memory"===n.printHistorySource?R.Ay.gray(" (restored from memory)"):"";for(var p of(console.log(` Print results, newest first${s}:`),o))console.log(` --index ${p.index} ${eO(p.printedAt)} ${R.Ay.gray(eI(p))}`)}console.log("─".repeat(60)),console.log(R.Ay.gray("Save one as PNG: bricks devtools simulator thermal-printer print-result"))}),function(e){return t.apply(this,arguments)}))}),function(e){return O.apply(this,arguments)})),ee(ek.command("print-result").description("Render a simulated print result to a PNG image").option("--printer <id>","Printer ID (see `list`; defaults to the only registered printer)").option("-i, --index <n>","Print history index, 0 = latest","0").option("--scale <factor>","Image scale factor (1-4)","2").option("-o, --output <path>","Output file path")).action((I=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Simulator.captureThermalPrinterPrintResult",{id:e.printer,index:parseInt(e.index,10)||0,scale:parseFloat(e.scale)||2},3e4);i?.data||(console.error(R.Ay.red(eN)),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`print-result-${Date.now()}.png`,s=r.resolve(o);(n.writeFileSync(s,Buffer.from(i.data,"base64")),e.json)?console.log(JSON.stringify({path:s,id:i.id,driver:i.driver,label:i.label,index:i.index,printedAt:i.printedAt,width:i.width,height:i.height},null,2)):(console.log(R.Ay.green(`Print result saved to ${s}`)),console.log(` Printer: ${i.label} ${R.Ay.gray(`(${i.driver}, ${i.id})`)}`),console.log(` Printed: ${eO(i.printedAt)} (--index ${i.index})`),i.width&&i.height&&console.log(` Size: ${i.width}\xd7${i.height}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return I.apply(this,arguments)}))},11405(e,t,a){a.d(t,{l:()=>v});var i,n,r,o=a(99436),s=a(35679),p=a(7586),l=a(85382),d=a(8479),u=a(47988),c=(i=o(function*(){try{return yield Promise.all([a.e(587),a.e(647),a.e(10),a.e(117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return i.apply(this,arguments)}),m=(e,t,a)=>({severity:e,code:t,message:a}),f=(n=o(function*({version:e="2.25.0-beta.60",mcpCheck:t=c}={}){var a=(0,u.getCurrentProfile)(),i=(0,u.getCurrentProfileSource)(),n=(0,u.getTokenInfo)(a),r=(0,u.getBaseUrl)(),o=(0,u.getActivityLogBaseUrl)(),s=[],f={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:i},config:{path:u.CONFIG_PATH,baseUrl:r,activityLogBaseUrl:o},auth:{available:!!n?.token,source:n?.token?"config":"missing",workspaceId:n?.workspaceId||null,workspaceName:n?.workspaceName||null,createdAt:n?.createdAt||null,tokenPreview:(0,p.$l)(n?.token)},connectivity:{workspace:{ok:!1,skipped:!n?.token,error:null}},capabilities:{zeroArgMode:(0,d.z)()?"interactive":"help",mcp:{available:!1,error:null}},issues:s};if(n?.token)try{var h=yield(0,l.createClient)(r,n.token).workspace();f.connectivity.workspace={ok:!0,skipped:!1,error:null,id:h?._id||n.workspaceId||null,name:h?.name||n.workspaceName||null},f.auth.workspaceId=h?._id||f.auth.workspaceId,f.auth.workspaceName=h?.name||f.auth.workspaceName}catch(e){f.connectivity.workspace={ok:!1,skipped:!1,error:e.message},s.push(m("error","workspace_unreachable",`Workspace query failed for ${r}: ${e.message}`))}else s.push(m("warning","auth_missing","No saved token for the current profile."));var v=yield t();return f.capabilities.mcp={available:v.available,error:v.error||null},v.available||s.push(m("warning","mcp_unavailable",`MCP stdio server is unavailable: ${v.error||"Unknown error"}`)),f.ok=0===s.length,f}),function(){return n.apply(this,arguments)}),h=(e,t,a)=>`${e.padEnd(14)} ${t}${a?` ${a}`:""}`,v=new s.uB("doctor").description("Check CLI configuration, auth state, and workspace reachability").option("-j, --json","Output as JSON").action((r=o(function*(e){try{var t=yield f();if(e.json)return void(0,p.GF)(t);console.log((e=>{var t=[];if(t.push("BRICKS CLI Doctor"),t.push("─".repeat(60)),t.push(h("CLI","OK",`bricks v${e.cli.version}`)),t.push(h("Profile","OK",`${e.profile.name} (${e.profile.source})`)),t.push(h("BRICKS API","OK",e.config.baseUrl)),t.push(h("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace";t.push(h("Auth","OK",`${a} (${e.auth.source}, ${e.auth.tokenPreview})`))}else t.push(h("Auth","WARN","No saved token for the current profile"));if(e.connectivity.workspace.skipped)t.push(h("Workspace","WARN","Skipped because no token is available"));else if(e.connectivity.workspace.ok){var i=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";t.push(h("Workspace","OK",i))}else t.push(h("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?t.push(h("MCP","OK","STDIO server import is available")):t.push(h("MCP","WARN",e.capabilities.mcp.error)),t.push(h("Zero-arg mode",((e,t=!1)=>e?"OK":t?"WARN":"FAIL")("interactive"===e.capabilities.zeroArgMode,"help"===e.capabilities.zeroArgMode),"interactive"===e.capabilities.zeroArgMode?"Starts Ink interactive mode on TTY":"Shows help outside TTY contexts")),e.issues.length>0&&(t.push("─".repeat(60)),t.push("Issues"),e.issues.forEach(e=>{t.push(`- [${e.severity}] ${e.message}`)})),t.join("\n")})(t))}catch(t){e.json?(0,p.OW)(t.message):console.error(`Doctor failed: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},28634(e,t,a){a.d(t,{p:()=>w});var i,n,r,o,s,p,l,d=a(68832),u=a(99436),c=a(35679),m=a(73284),f=a(30155),h=a(7586),v=a(56493),g=a(68168),y=a(98593),b=e=>{if(!e)return m.Ay.gray("○");var t=Date.now()-new Date(e).getTime();return t<=3e5?m.Ay.green("●"):60>Math.floor(t/6e4)?m.Ay.yellow("○"):m.Ay.red("○")},D=(e,t)=>(0,y.H_)(e,t,{deviceCount:e?.devices?.length||0}),x=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"],w=new c.uB("group").description("Device Group management");w.command("list").description("List all device groups").option("-j, --json","Output as JSON").action((i=u(function*(e){var t=(0,v.o)(),a=(0,f.default)("Fetching device groups...").start();try{var i=yield t.deviceGroups({});if(a.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(m.Ay.yellow("No device groups found"));console.log(m.Ay.bold("\nDevice Groups")),console.log("─".repeat(80)),i.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${m.Ay.cyan(e.name)} ${m.Ay.gray(`(${t} devices)`)}`),console.log(` ID: ${m.Ay.gray(e._id)}`),e.description&&console.log(` ${m.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list groups: ${e.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),w.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action((n=u(function*(e,t){var a=(0,v.o)(),i=(0,f.default)("Fetching device group...").start();try{var n=yield a.deviceGroup({id:e});if(i.stop(),n||(console.log(m.Ay.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(m.Ay.bold(`
|
|
107
107
|
Device Group: ${n.name}`)),console.log("─".repeat(60)),console.log(`ID: ${m.Ay.gray(n._id)}`),console.log(`Description: ${n.description||m.Ay.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||m.Ay.gray("None")}`),console.log(`Created: ${m.Ay.gray(n.create_datetime)}`),console.log(`Modified: ${m.Ay.gray(n.last_modify_datetime)}`),n.devices?.length>0&&(console.log(`
|
|
108
108
|
${m.Ay.bold("Devices")} (${n.devices.length})`),n.devices.forEach(e=>{var t=e.device_target_name||e.device_id;console.log(` - ${t} ${m.Ay.gray(`(${e.device_id})`)}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get group: ${e.message}`),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),w.command("resolve <query>").description("Resolve a device group name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((r=u(function*(e,t){var a=(0,v.o)(),i=t.json?null:(0,f.default)("Resolving device group...").start();try{var n=yield(0,g.Y)(()=>a.deviceGroup({id:e})),r=n?[n]:yield a.deviceGroups({paginate:{limit:t.limit}}),o=n?r:(r||[]).filter(t=>t.name?.toLowerCase().includes(e.trim().toLowerCase())),s=(0,g.K)({resource:"group",query:e,items:o||[],fields:["_id","name"],selectedBy:n?"id":null});if(i&&i.stop(),t.json)return void(0,h.GF)(s);if(s.resolved){var p=s.resolved;console.log(m.Ay.bold("\nResolved Device Group")),console.log("─".repeat(60)),console.log(`Name: ${m.Ay.cyan(p.name||"Unnamed")}`),console.log(`ID: ${m.Ay.gray(p._id)}`),console.log(`Selected By: ${s.selectedBy}`),console.log("─".repeat(60));return}if(0===s.matches.length)return void console.log(m.Ay.yellow(`No device groups matched "${e}"`));console.log(m.Ay.bold(`
|
|
109
109
|
Matching Device Groups (${s.matches.length})`)),console.log("─".repeat(80)),s.matches.forEach(e=>{console.log(`${m.Ay.cyan(e.name||"Unnamed")} ${m.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve device group: ${t.message}`):(0,h.OW)(t.message,{resource:"group",query:e}),process.exit(1)}}),function(e,t){return r.apply(this,arguments)})),w.command("devices <id>").description("List devices in a group with status").option("-j, --json","Output as JSON").action((o=u(function*(e,t){var a=(0,v.o)(),i=(0,f.default)("Fetching devices...").start();try{var n=yield a.devicesByGroup({id:e});if(i.stop(),t.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(m.Ay.yellow("No devices in this group"));console.log(m.Ay.bold("\nDevices in Group")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.device||{},a=t.entry_detail?.watch_dog_timer?.last_alive_time,i=b(a),n=t.name||t.device_name||e.target_name||t._id||"Unknown",r=t.entry_detail?.application?.name||m.Ay.gray("No app");console.log(`${i} ${m.Ay.cyan(n.padEnd(30))} ${r}`)}),console.log("─".repeat(80))}catch(e){i.fail(`Failed to get devices: ${e.message}`),process.exit(1)}}),function(e,t){return o.apply(this,arguments)})),w.command("dispatch <id> <action>").description("Dispatch action to all devices in group").option("--dry-run","Validate inputs and show the dispatch plan without sending it").option("-j, --json","Output as JSON").action((s=u(function*(e,t,a){var i=(0,v.o)(),n=a.json?null:(0,f.default)(`Dispatching ${t}...`).start();x.includes(t)||(a.json?(0,h.OW)(`Invalid action. Valid actions: ${x.join(", ")}`,{action:"group.dispatch",target:{id:e}}):n.fail(`Invalid action. Valid actions: ${x.join(", ")}`),process.exit(1));try{var r=yield i.deviceGroup({id:e});if(!r)throw Error("Device group not found");if(a.dryRun){n&&n.stop(),(0,y.S5)({action:"group.dispatch",target:D(r,e),request:{action:t},checks:[(0,y.Iy)("group exists",!0,`${r.name} (${r._id})`),(0,y.Iy)("action is valid",!0)],json:a.json});return}var o=yield i.dispatchDeviceGroupAction({id:e,action:t});a.json?(0,y.yd)({action:"group.dispatch",target:D(r,e),result:{action:t,dispatched:o?.dispatched||0,devices:o?.devices||0},json:!0}):(n.succeed(`Action dispatched: ${m.Ay.green(t)}`),o&&(console.log(`Dispatched: ${m.Ay.green(o.dispatched||0)}`),console.log(`Devices: ${m.Ay.gray(o.devices||0)}`)))}catch(t){a.json?(0,h.OW)(t.message,{action:"group.dispatch",target:{id:e}}):n.fail(`Failed to dispatch action: ${t.message}`),process.exit(1)}}),function(e,t,a){return s.apply(this,arguments)})),w.command("refresh <id>").description("Refresh all devices in group").option("--dry-run","Validate inputs and show the refresh plan without sending it").option("-j, --json","Output as JSON").action((p=u(function*(e,t){var a=(0,v.o)(),i=t.json?null:(0,f.default)("Refreshing devices...").start();try{var n=yield a.deviceGroup({id:e});if(!n)throw Error("Device group not found");if(t.dryRun){i&&i.stop(),(0,y.S5)({action:"group.refresh",target:D(n,e),request:{action:"refresh"},checks:[(0,y.Iy)("group exists",!0,`${n.name} (${n._id})`)],json:t.json});return}var r=yield a.dispatchDeviceGroupAction({id:e,action:"refresh"});t.json?(0,y.yd)({action:"group.refresh",target:D(n,e),result:{dispatched:r?.dispatched||0,devices:r?.devices||0},json:!0}):(i.succeed("Devices refreshed"),r&&(console.log(`Dispatched: ${m.Ay.green(r.dispatched||0)}`),console.log(`Devices: ${m.Ay.gray(r.devices||0)}`)))}catch(a){t.json?(0,h.OW)(a.message,{action:"group.refresh",target:{id:e}}):i.fail(`Failed to refresh: ${a.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),w.command("monitor <id>").description("Monitor devices in group (polls every 60s)").option("-i, --interval <seconds>","Polling interval in seconds","60").action((l=u(function*(e,t){var a,i=(0,v.o)(),n=1e3*parseInt(t.interval,10);console.log(m.Ay.bold("\nDevice Group Monitor")),console.log(m.Ay.gray(`Polling every ${t.interval}s. Press Ctrl+C to stop.
|
|
@@ -114,15 +114,15 @@ ${g.Ay.bold("Passcodes")}`),n.passcodes.forEach(e=>{console.log(`- ${e.name||"Pa
|
|
|
114
114
|
Media Files (${o.length})`)),console.log("─".repeat(100)),o.forEach(e=>{var t=_(e);console.log(`${g.Ay.cyan(e.name||"Unnamed")} ${g.Ay.gray(e.id)}`),console.log(` Type: ${e.fileType} Status: ${E(t)}`),e.userTags?.length&&console.log(` Tags: ${e.userTags.join(", ")}`),e.updatedAt&&console.log(` Updated: ${new Date(e.updatedAt).toLocaleString()}`),console.log()})}catch(e){i.fail(`Failed to list media files: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),F.command("file <id>").description("Get Media Flow file details").option("-j, --json","Output as JSON").action((p=m(function*(e,t){var a=(0,D.o)(),i=(0,y.default)("Fetching media file...").start();try{yield w(a);var n=yield a.mediaFile({id:e});if(i.stop(),n||(console.log(g.Ay.red("Media file not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));var r=_(n);console.log(g.Ay.bold(`
|
|
115
115
|
Media File: ${n.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${g.Ay.gray(n.id)}`),console.log(`Box ID: ${g.Ay.gray(n.boxId)}`),console.log(`Type: ${n.fileType}`),console.log(`Status: ${E(r)}`),console.log(`Description: ${n.description||g.Ay.gray("N/A")}`),console.log(`Tags: ${n.userTags?.join(", ")||g.Ay.gray("None")}`),console.log(`Created: ${g.Ay.gray(n.createdAt||"N/A")}`),console.log(`Updated: ${g.Ay.gray(n.updatedAt||"N/A")}`);var o=(0,x.Gu)(n),s=(0,x.Gu)(n,{preferThumbnail:!0});n.meta?.originalFileKey&&console.log(`Original Key: ${g.Ay.gray(n.meta.originalFileKey)}`),o&&console.log(`Original URL: ${g.Ay.gray(o)}`),s&&s!==o&&console.log(`Thumbnail URL: ${g.Ay.gray(s)}`),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get media file: ${e.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)}));var A=e=>{var t=e.match(/^(\d+)x(\d+)(?::(\w+))?$/);if(!t)throw Error(`Invalid image version spec: "${e}". Expected format: WxH or WxH:STRATEGY`);return{width:parseInt(t[1],10),height:parseInt(t[2],10),strategy:(t[3]||"FILL").toUpperCase(),copypreview:!1}},C=(l=m(function*(e,t,a,i,n){var r=new FormData;for(var o of Object.entries(t)){var s=c(o,2),p=s[0],l=s[1];r.append(p,l)}r.append("file",new Blob([a],{type:n}),i);var d=yield fetch(e,{method:"POST",body:r});if(!d.ok&&204!==d.status){var u=yield d.text().catch(()=>"");throw Error(`S3 upload failed (${d.status}): ${u}`)}}),function(e,t,a,i,n){return l.apply(this,arguments)}),S=(d=m(function*(e,t,a){var i,n=[],r=0,o=(i=m(function*(){for(;r<e.length;){var t=r++;n[t]=yield a(e[t],t)}}),function(){return i.apply(this,arguments)}),s=Array.from({length:Math.min(t,e.length)},()=>o());return yield Promise.all(s),n}),function(e,t,a){return d.apply(this,arguments)});F.command("upload <boxId> <files...>").description("Upload file(s) to a Media Flow box").option("-d, --description <text>","File description","").option("-t, --user-tag <tag>","User tag (repeatable, max 15)",(e,t)=>[...t,e],[]).option("--image-version <spec>","Image resize spec as WxH or WxH:STRATEGY (repeatable)",(e,t)=>[...t,e],[]).option("--image-version-type <type>","Image output format: jpg or png").option("--enable-ai-analysis","Enable AI analysis on uploaded files").option("--ai-instruction <text>","Custom AI analysis instruction").option("--concurrency <n>","Max concurrent uploads",e=>parseInt(e,10),3).option("-j, --json","Output as JSON").action((u=m(function*(e,t,a){var i=(0,D.o)(),n=(0,y.default)("Preparing upload...").start();try{if(yield w(i),a.userTag.length>15)throw Error("Maximum 15 user tags allowed");var r,o,s=a.imageVersion.map(A),p=a.enableAiAnalysis||!!a.aiInstruction,l=yield Promise.all(t.map((r=m(function*(e){var t=(0,h.resolve)(e),a=yield(0,f.stat)(t).catch(()=>null);if(!a||!a.isFile())throw Error(`Not a file: ${e}`);var i=(0,h.basename)(t),n=(0,b.lookup)(i)||"application/octet-stream";return{filePath:t,fileName:i,contentType:n,size:a.size}}),function(e){return r.apply(this,arguments)})));n.stop();var d=l.length;console.log(g.Ay.bold(`
|
|
116
116
|
Uploading ${d} file${d>1?"s":""} to box ${g.Ay.gray(e)}...
|
|
117
|
-
`));var u=[];yield S(l,a.concurrency,(o=m(function*(t,n){var r=`[${n+1}/${d}] ${t.fileName}`,o=(0,y.default)(`${r} — requesting upload...`).start();try{var l,c,m=(l=t.contentType)&&"image/svg+xml"!==l?l.startsWith("image/")?"IMAGE":l.startsWith("video/")?"VIDEO":l.startsWith("audio/")?"AUDIO":"FILE":"FILE",h={imageVersions:"IMAGE"===m?s:[],imageVersionType:"IMAGE"===m?a.imageVersionType:void 0,enableAiAnalysis:p,aiCustomInstruction:a.aiInstruction||void 0},v=yield i.createMediaFileUploadRequest({name:t.fileName,description:a.description,boxId:e,fileType:m,contentType:t.contentType,userTags:a.userTag.length?a.userTag:[],meta:h});o.text=`${r} — uploading to storage...`;var b=JSON.parse(v.meta.uploadInfo),D=yield(0,f.readFile)(t.filePath);yield C(b.url,{AWSAccessKeyId:b.AWSAccessKeyId,"Content-Type":b["Content-Type"],key:b.key,Signature:b.Signature,Policy:b.Policy,acl:b.acl},D,t.fileName,t.contentType),o.succeed(`${r} ${g.Ay.green("✓")} ${g.Ay.gray(`(${m}, ${(c=t.size)<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:c<0x40000000?`${(c/1048576).toFixed(1)} MB`:`${(c/0x40000000).toFixed(1)} GB`})`)}`),u.push({file:t.fileName,id:v.id,status:"success",fileType:m,size:t.size})}catch(e){o.fail(`${r} — ${e.message}`),u.push({file:t.fileName,id:null,status:"failed",error:e.message})}}),function(e,t){return o.apply(this,arguments)}));var c=u.filter(e=>"success"===e.status).length,v=u.filter(e=>"failed"===e.status).length;a.json?console.log(JSON.stringify({boxId:e,results:u,summary:{total:d,success:c,failed:v}},null,2)):(console.log(),0===v?console.log(g.Ay.green(`Uploaded ${c}/${d} files`)):console.log(g.Ay.yellow(`Uploaded ${c}/${d} files (${v} failed)`))),v>0&&process.exit(1)}catch(e){n.fail(`Upload failed: ${e.message}`),process.exit(1)}}),function(e,t,a){return u.apply(this,arguments)}))},32541(e,t,a){a.d(t,{A:()=>
|
|
117
|
+
`));var u=[];yield S(l,a.concurrency,(o=m(function*(t,n){var r=`[${n+1}/${d}] ${t.fileName}`,o=(0,y.default)(`${r} — requesting upload...`).start();try{var l,c,m=(l=t.contentType)&&"image/svg+xml"!==l?l.startsWith("image/")?"IMAGE":l.startsWith("video/")?"VIDEO":l.startsWith("audio/")?"AUDIO":"FILE":"FILE",h={imageVersions:"IMAGE"===m?s:[],imageVersionType:"IMAGE"===m?a.imageVersionType:void 0,enableAiAnalysis:p,aiCustomInstruction:a.aiInstruction||void 0},v=yield i.createMediaFileUploadRequest({name:t.fileName,description:a.description,boxId:e,fileType:m,contentType:t.contentType,userTags:a.userTag.length?a.userTag:[],meta:h});o.text=`${r} — uploading to storage...`;var b=JSON.parse(v.meta.uploadInfo),D=yield(0,f.readFile)(t.filePath);yield C(b.url,{AWSAccessKeyId:b.AWSAccessKeyId,"Content-Type":b["Content-Type"],key:b.key,Signature:b.Signature,Policy:b.Policy,acl:b.acl},D,t.fileName,t.contentType),o.succeed(`${r} ${g.Ay.green("✓")} ${g.Ay.gray(`(${m}, ${(c=t.size)<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:c<0x40000000?`${(c/1048576).toFixed(1)} MB`:`${(c/0x40000000).toFixed(1)} GB`})`)}`),u.push({file:t.fileName,id:v.id,status:"success",fileType:m,size:t.size})}catch(e){o.fail(`${r} — ${e.message}`),u.push({file:t.fileName,id:null,status:"failed",error:e.message})}}),function(e,t){return o.apply(this,arguments)}));var c=u.filter(e=>"success"===e.status).length,v=u.filter(e=>"failed"===e.status).length;a.json?console.log(JSON.stringify({boxId:e,results:u,summary:{total:d,success:c,failed:v}},null,2)):(console.log(),0===v?console.log(g.Ay.green(`Uploaded ${c}/${d} files`)):console.log(g.Ay.yellow(`Uploaded ${c}/${d} files (${v} failed)`))),v>0&&process.exit(1)}catch(e){n.fail(`Upload failed: ${e.message}`),process.exit(1)}}),function(e,t,a){return u.apply(this,arguments)}))},32541(e,t,a){a.d(t,{A:()=>T});var i,n,r,o,s,p,l,d,u,c,m,f,h,v=a(99436),g=a(35679),y=a(73284),b=a(30155),D=a(47988),x=a(85382),w=a(44618),_=a(7586),E=a(56493),F=a(68168),A=a(74049),C=a(98593),S=(e,t)=>(0,C.H_)(e,t,{currentVersion:e?.current_version||null,public:!!e?.is_public}),T=new g.uB("module").description("Module management");T.command("new").description("Create a new module").requiredOption("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("--layout-width <width>","Layout width",parseInt).option("--layout-height <height>","Layout height",parseInt).option("--public","Make module available to all users").option("--allow-modify","Allow users to modify imported module config").option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((i=v(function*(e){var t=(0,E.o)(),i=e.json?null:(0,b.default)("Creating module...").start();try{var n={name:e.name};e.description&&(n.description=e.description),e.layoutWidth&&(n.layoutWidth=e.layoutWidth),e.layoutHeight&&(n.layoutHeight=e.layoutHeight),e.public&&(n.isPublic=!0),e.allowModify&&(n.isAllowModify=!0);var r=yield t.createModule(n);if(e.json&&!e.init?console.log(JSON.stringify(r,null,2)):e.json||(i.succeed(`Module created: ${y.Ay.green(r.name)}`),console.log(` ID: ${y.Ay.gray(r._id)}`),r.description&&console.log(` ${y.Ay.gray(r.description)}`),console.log(` Public: ${r.is_public?y.Ay.green("Yes"):y.Ay.gray("No")}`),console.log(` Allow Modify: ${r.is_allow_modify?y.Ay.green("Yes"):y.Ay.gray("No")}`)),e.init){i&&i.stop();var o=(yield a.e(456).then(a.bind(a,58891))).initProject;yield o("module",r._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):i.fail(`Failed to create module: ${t.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),T.command("list").description("List all modules").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action((n=v(function*(e){var t=(0,E.o)(),a=(0,b.default)("Fetching modules...").start();try{var i=yield t.modules({keyword:e.keyword});if(a.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(y.Ay.yellow("No modules found"));console.log(y.Ay.bold("\nModules")),console.log("─".repeat(80)),i.forEach(e=>{var t=e.current_version?`v${e.current_version}`:y.Ay.gray("no version");console.log(`● ${y.Ay.cyan(e.name)} ${y.Ay.gray(t)}`),console.log(` ID: ${y.Ay.gray(e._id)}`),e.description&&console.log(` ${y.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list modules: ${e.message}`),process.exit(1)}}),function(e){return n.apply(this,arguments)})),T.command("list-public").description("Search public modules").requiredOption("-k, --keyword <keyword>","Search keyword (min 2 characters)").option("-j, --json","Output as JSON").action((r=v(function*(e){var t=(0,x.createClient)((0,D.getBaseUrl)()),a=(0,b.default)("Searching public modules...").start();try{var i=yield t.publicModules({keyword:e.keyword});if(a.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(y.Ay.yellow("No public modules found"));console.log(y.Ay.bold("\nPublic Modules")),console.log("─".repeat(80)),i.forEach(e=>{var t=e.current_version?`v${e.current_version}`:y.Ay.gray("no version");console.log(`● ${y.Ay.cyan(e.name)} ${y.Ay.gray(t)}`),console.log(` ID: ${y.Ay.gray(e._id)}`),e.description&&console.log(` ${y.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to search public modules: ${e.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),T.command("get <id>").description("Get module details").option("-j, --json","Output as JSON").action((o=v(function*(e,t){var a=(0,E.o)(),i=(0,b.default)("Fetching module...").start();try{var n=yield a.module({id:e});if(i.stop(),n||(console.log(y.Ay.red("Module not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(y.Ay.bold(`
|
|
118
118
|
Module: ${n.name}`)),console.log("─".repeat(60)),console.log(`ID: ${y.Ay.gray(n._id)}`),console.log(`Description: ${n.description||y.Ay.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||y.Ay.gray("None")}`),console.log(`Created: ${y.Ay.gray(n.create_datetime)}`),console.log(`Modified: ${y.Ay.gray(n.last_modify_datetime)}`),console.log(`
|
|
119
119
|
${y.Ay.bold("Version")}`),console.log(`Current: ${n.current_version?`v${n.current_version}`:y.Ay.gray("No version")}`),console.log(`Unreleased: ${n.has_unreleased_changes?y.Ay.yellow("Yes"):y.Ay.green("No")}`),console.log(`
|
|
120
120
|
${y.Ay.bold("Settings")}`),console.log(`Public: ${n.is_public?y.Ay.green("Yes"):y.Ay.gray("No")}`),console.log(`Allow Modify: ${n.is_allow_modify?y.Ay.green("Yes"):y.Ay.gray("No")}`),console.log(`Short Edit: ${n.short_edit?.enabled?y.Ay.green("Enabled"):y.Ay.gray("Disabled")}`),n.short_edit?.enabled&&n.short_edit.ref_map){var r=Object.keys(n.short_edit.ref_map).length;console.log(` References: ${r} editable properties`)}n.use_count?.total_count!=null&&(console.log(`
|
|
121
121
|
${y.Ay.bold("Usage")}`),console.log(`Used In: ${n.use_count.total_count} application(s)`)),n.expose_properties?.length>0&&(console.log(`
|
|
122
|
-
${y.Ay.bold("Exposed Properties")} (${n.expose_properties.length})`),n.expose_properties.forEach(e=>{console.log(` - ${y.Ay.cyan(e)}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get module: ${e.message}`),process.exit(1)}}),function(e,t){return o.apply(this,arguments)})),
|
|
123
|
-
Matching Modules (${o.matches.length})`)),console.log("─".repeat(80)),o.matches.forEach(e=>{console.log(`${y.Ay.cyan(e.name||"Unnamed")} ${y.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve module: ${t.message}`):(0,
|
|
122
|
+
${y.Ay.bold("Exposed Properties")} (${n.expose_properties.length})`),n.expose_properties.forEach(e=>{console.log(` - ${y.Ay.cyan(e)}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get module: ${e.message}`),process.exit(1)}}),function(e,t){return o.apply(this,arguments)})),T.command("resolve <query>").description("Resolve a module name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((s=v(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,b.default)("Resolving module...").start();try{var n=yield(0,F.Y)(()=>a.module({id:e})),r=n?[n]:yield a.modules({keyword:e,paginate:{limit:t.limit}}),o=(0,F.K)({resource:"module",query:e,items:r||[],fields:["_id","name"],selectedBy:n?"id":null});if(i&&i.stop(),t.json)return void(0,_.GF)(o);if(o.resolved){var s=o.resolved;console.log(y.Ay.bold("\nResolved Module")),console.log("─".repeat(60)),console.log(`Name: ${y.Ay.cyan(s.name||"Unnamed")}`),console.log(`ID: ${y.Ay.gray(s._id)}`),console.log(`Selected By: ${o.selectedBy}`),console.log("─".repeat(60));return}if(0===o.matches.length)return void console.log(y.Ay.yellow(`No modules matched "${e}"`));console.log(y.Ay.bold(`
|
|
123
|
+
Matching Modules (${o.matches.length})`)),console.log("─".repeat(80)),o.matches.forEach(e=>{console.log(`${y.Ay.cyan(e.name||"Unnamed")} ${y.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve module: ${t.message}`):(0,_.OW)(t.message,{resource:"module",query:e}),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),T.command("update <id>").description("Update module name, description, and/or configuration").option("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("-c, --config <json>","Module config as JSON string").option("-f, --file <path>","Module config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((p=v(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,b.default)("Updating module...").start();try{var n=yield a.updateModule((0,C.jB)(e,t));t.json?(0,C.yd)({action:"module.update",target:S(n,e),result:{lastCommitId:t.lastCommitId||null},json:!0}):(i.succeed(`Module updated: ${y.Ay.green(n.name)}`),n.has_unreleased_changes&&console.log(y.Ay.yellow("Note: Module has unreleased changes")))}catch(a){t.json?(0,_.OW)(a.message,{action:"module.update",target:{id:e}}):i.fail(`Failed to update module: ${a.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),T.command("short-edit <id>").description("Short edit module properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action((l=v(function*(e,t){var a=(0,E.o)(),i=(0,b.default)("Applying short edit...").start();try{var n=JSON.parse(t.list);Array.isArray(n)||(i.fail("List must be a JSON array"),process.exit(1));var r=yield a.shortEditModule({id:e,list:n});i.succeed(`Short edit applied to: ${y.Ay.green(r.name)}`)}catch(e){i.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),T.command("short-refs <id>").description("List short edit references for a module").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((d=v(function*(e,t){var a=(0,E.o)(),i=(0,b.default)("Fetching short edit references...").start();try{var n=yield a.module({id:e});if(i.stop(),!n?.short_edit?.enabled)return void console.log(y.Ay.yellow("Short Edit is not enabled for this module"));var r=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],o=(0,w.V)(n.short_edit.ref_map,{keyword:t.keyword,types:r});if(t.json)return void console.log(JSON.stringify(o,null,2));if(0===o.length)return void console.log(y.Ay.yellow("No short edit references found"));console.log(y.Ay.bold(`
|
|
124
124
|
Short Edit References: ${n.name}`)),o.forEach(e=>{console.log(y.Ay.cyan(`
|
|
125
|
-
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?y.Ay.gray(`- ${t.title}`):"";console.log(` ${y.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),k.command("remove <id>").description("Remove a module").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((u=v(function*(e,t){var a=(0,F.o)(),i=t.json?null:(0,b.default)("Removing module...").start();try{var n=yield a.module({id:e});if(!n)throw Error("Module not found");var r=T(n,e);if(t.dryRun){i&&i.stop(),(0,S.S5)({action:"module.remove",target:r,request:{id:e},checks:[(0,S.Iy)("module exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeModule({id:e});t.json?(0,S.yd)({action:"module.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Module removed: ${y.Ay.green(r.name)}`)}catch(a){t.json?(0,E.OW)(a.message,{action:"module.remove",target:{id:e}}):i.fail(`Failed to remove module: ${a.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),k.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("-n, --name <name>","Update module name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((c=v(function*(e,t){var a=(0,F.o)(),i=t.json?null:(0,b.default)("Releasing module...").start();try{var n=(0,C.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.module({id:e});if(!p)throw Error("Module not found");if(p.is_public)throw Error("Public module deployment is temporarily not recommended");var l=t.version||t.name||p.name||"Untitled",d=(0,C.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,S.S5)({action:"module.release",target:T(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,S.Iy)("module exists",!0,`${p.name} (${p._id})`),(0,S.Iy)("module is private",!p.is_public),(0,S.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseModule({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,S.yd)({action:"module.release",target:T(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Module released: ${y.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,E.OW)(a.message,{action:"module.release",target:{id:e}}):i.fail(`Failed to release module: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),k.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((m=v(function*(e,t){var a=(0,F.o)(),i=t.json?null:(0,b.default)("Pulling module project...").start();try{var n=yield a.moduleProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Module project fetched: ${y.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),k.command("doctor <idOrPath>").description("Diagnose a module config: schema validation plus semantic lint rules (data races, layout mistakes, dead config)").option("-j, --json","Output as JSON").option("--strict","Exit with code 1 when warnings are found").option("--only <codes>","Run only these rule codes (comma-separated)").option("--ignore <codes>","Skip these rule codes (comma-separated)").option("--validate-automation","Also validate automation_map and test_map references").action((f=v(function*(e,t){var i=t.json?null:(0,b.default)("Running config doctor...").start();try{var n=yield Promise.all([a.e(587),a.e(249),a.e(10),a.e(511),a.e(223)]).then(a.bind(a,63322)),r=n.runConfigDoctor,o=n.renderConfigDoctorReport,s=yield r("module",e,t),p=s.report,l=s.exitCode;i?.stop(),t.json?(0,E.GF)({...p,exitCode:l}):console.log(o(p)),0!==l&&process.exit(l)}catch(e){i?i.fail(`Config doctor failed: ${e.message}`):(0,E.OW)(e.message),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),k.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from a module").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((h=v(function*(e,t){var i=(yield a.e(456).then(a.bind(a,58891))).initProject;yield i("module",e,t)}),function(e,t){return h.apply(this,arguments)}))},86141(e,t,a){a.d(t,{D:()=>V});var i,n,r,o,s,p,l,d,u,c=a(99436),m=a(35679),f=a(73284),h=a(30155),v=a(88958),g=a(73024),y=a(76760),b=a(48161),D=e=>{if(!e)return e;try{return g.realpathSync(e)}catch{return e}},x=a(68832),w=a(31421),_=a(51455),E="@fugood/bricks-cli",F="win32"===process.platform,A=(e,t)=>`https://cdn.bricks.tools/bricks-cli/${e}/${t}`,C=e=>"beta"===e?"beta":"latest",S=(i=c(function*(e){var t=yield fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: HTTP ${t.status}`);return t}),function(e){return i.apply(this,arguments)}),T=(n=c(function*(e){return(yield S(A(e,"version.json"))).json()}),function(e){return n.apply(this,arguments)}),k=(r=c(function*(e){var t=C(e),a=yield S(`https://registry.npmjs.org/-/package/${E}/dist-tags`),i=(yield a.json())[t];if(!i)throw Error(`No '${t}' dist-tag for ${E}`);return{version:i}}),function(e){return r.apply(this,arguments)}),N=(o=c(function*(e,t){return"npm"===t||"bun"===t?k(e):T(e)}),function(e,t){return o.apply(this,arguments)}),O=(e,t,a={})=>{var i=(0,w.spawnSync)(e,t,{stdio:"inherit",...a});if(i.error){if("ENOENT"===i.error.code)throw Error(`Command not found: ${e}`);throw i.error}if(0!==i.status){var n=Error(`${e} exited with code ${i.status}`);throw n.code=i.status,n}},I=(s=c(function*(e,t){var a=yield S(e),i=Buffer.from((yield a.arrayBuffer())),n=y.join(b.tmpdir(),`bricks-cli-update-${process.pid}-${t}`);return yield _.writeFile(n,i),F||(yield _.chmod(n,493)),n}),function(e,t){return s.apply(this,arguments)}),$=(p=c(function*(e,{installDir:t}={}){var a=F?"install.ps1":"install.sh",i=yield I(A(e,a),a);try{var n=F?["powershell",["-NoProfile","-ExecutionPolicy","Bypass","-File",i,..."beta"===e?["-Beta"]:[],...t?["-InstallDir",t]:[]]]:["sh",[i,..."beta"===e?["--beta"]:[],...t?[`--dir=${t}`]:[]]],r=x(n,2),o=r[0],s=r[1];O(o,s)}finally{yield _.unlink(i).catch(()=>{})}}),function(e){return p.apply(this,arguments)}),j=(l=c(function*(e,t,a={}){if("npm"===e)return void O("npm",["install","-g",`${E}@${C(t)}`]);if("bun"===e)return void O("bun",["install","-g",`${E}@${C(t)}`]);if("binary"===e)return $(t,{installDir:a.installDir});throw Error(`Unsupported update method: ${e}`)}),function(e,t){return l.apply(this,arguments)}),B=a(8479),R=(d=c(function*({message:e,defaultValue:t,autoYes:a}){if(a)return!0;(0,B.z)()||(console.error(f.Ay.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{return yield(0,v.lJ)({message:e,default:t})}catch{return!1}}),function(e){return d.apply(this,arguments)}),V=new m.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((u=c(function*(e){var t,a="2.25.0-beta.58",i=(({execPath:e=process.execPath,scriptPath:t=process.argv[1],homeDir:a=b.homedir(),realpath:i=D}={})=>{let n;var r=(n=e)?y.basename(n).replace(/\.exe$/i,""):"";if("bricks"===r||"bricks-beta"===r)return{method:"binary",execPath:e,installDir:y.dirname(e)};var o=i(t),s=((e,t)=>{if(!e)return null;var a=y.sep,i=`${a}node_modules${a}${t.replace(/\//g,a)}${a}`,n=e.indexOf(i);return -1===n?null:e.slice(0,n)})(o,"@fugood/bricks-cli");if(s){var p=y.sep,l=y.join(a,".bun","install","global");return s===l||s.startsWith(l+p)?{method:"bun",installRoot:s}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(s)?{method:"pnpm",installRoot:s}:/[\\/](?:\.yarn|yarn[\\/]global)[\\/]/.test(s)?{method:"yarn",installRoot:s}:{method:"npm",installRoot:s.endsWith(`${p}lib`)?s.slice(0,-`${p}lib`.length):s}}return{method:"unknown",execPath:e,scriptPath:o}})(),n=e.channel||(({version:e,execPath:t}={})=>{var a=t||process.execPath;return a&&/[\\/]bricks-beta(?:\.exe)?$/i.test(a)||/-(beta|alpha|rc|next)\b/i.test(e||"2.25.0-beta.58")?"beta":"release"})({version:a,execPath:i.execPath});console.log(f.Ay.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${f.Ay.cyan(a)}`),console.log(`Channel : ${f.Ay.cyan(n)}`),console.log(`Detected method : ${f.Ay.cyan(i.method)}`),i.execPath&&"binary"===i.method&&console.log(`Binary path : ${f.Ay.gray(i.execPath)}`),i.installRoot&&console.log(`Install root : ${f.Ay.gray(i.installRoot)}`);var r="npm"===i.method||"bun"===i.method?"npm":"cdn",o=(0,h.default)(`Fetching latest version info (${r})...`).start(),s=null,p=null;try{s=(yield N(n,i.method)).version,o.succeed(`Latest ${n} (${r}): ${f.Ay.green(s)}`)}catch(e){p=e,o.warn(`Could not fetch version info: ${e.message}`)}var l=s&&s===a;if(e.checkUpdate){if(p&&process.exit(2),l)return void console.log(f.Ay.green("\nUp to date."));s&&(console.log(f.Ay.yellow(`
|
|
125
|
+
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?y.Ay.gray(`- ${t.title}`):"";console.log(` ${y.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),T.command("remove <id>").description("Remove a module").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((u=v(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,b.default)("Removing module...").start();try{var n=yield a.module({id:e});if(!n)throw Error("Module not found");var r=S(n,e);if(t.dryRun){i&&i.stop(),(0,C.S5)({action:"module.remove",target:r,request:{id:e},checks:[(0,C.Iy)("module exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeModule({id:e});t.json?(0,C.yd)({action:"module.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Module removed: ${y.Ay.green(r.name)}`)}catch(a){t.json?(0,_.OW)(a.message,{action:"module.remove",target:{id:e}}):i.fail(`Failed to remove module: ${a.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),T.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("-n, --name <name>","Update module name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((c=v(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,b.default)("Releasing module...").start();try{var n=(0,A.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.module({id:e});if(!p)throw Error("Module not found");if(p.is_public)throw Error("Public module deployment is temporarily not recommended");var l=t.version||t.name||p.name||"Untitled",d=(0,A.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,C.S5)({action:"module.release",target:S(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,C.Iy)("module exists",!0,`${p.name} (${p._id})`),(0,C.Iy)("module is private",!p.is_public),(0,C.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseModule({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,C.yd)({action:"module.release",target:S(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Module released: ${y.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,_.OW)(a.message,{action:"module.release",target:{id:e}}):i.fail(`Failed to release module: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),T.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((m=v(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,b.default)("Pulling module project...").start();try{var n=yield a.moduleProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Module project fetched: ${y.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),T.command("doctor <idOrPath>").description("Diagnose a module config: schema validation plus semantic lint rules (data races, layout mistakes, dead config)").option("-j, --json","Output as JSON").option("--strict","Exit with code 1 when warnings are found").option("--only <codes>","Run only these rule codes (comma-separated)").option("--ignore <codes>","Skip these rule codes (comma-separated)").option("--validate-automation","Also validate automation_map and test_map references").action((f=v(function*(e,t){var i=t.json?null:(0,b.default)("Running config doctor...").start();try{var n=yield Promise.all([a.e(587),a.e(249),a.e(10),a.e(511),a.e(223)]).then(a.bind(a,63322)),r=n.runConfigDoctor,o=n.renderConfigDoctorReport,s=yield r("module",e,t),p=s.report,l=s.exitCode;i?.stop(),t.json?(0,_.GF)({...p,exitCode:l}):console.log(o(p)),0!==l&&process.exit(l)}catch(e){i?i.fail(`Config doctor failed: ${e.message}`):(0,_.OW)(e.message),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),T.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from a module").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((h=v(function*(e,t){var i=(yield a.e(456).then(a.bind(a,58891))).initProject;yield i("module",e,t)}),function(e,t){return h.apply(this,arguments)}))},86141(e,t,a){a.d(t,{D:()=>V});var i,n,r,o,s,p,l,d,u,c=a(99436),m=a(35679),f=a(73284),h=a(30155),v=a(88958),g=a(73024),y=a(76760),b=a(48161),D=e=>{if(!e)return e;try{return g.realpathSync(e)}catch{return e}},x=a(68832),w=a(31421),_=a(51455),E="@fugood/bricks-cli",F="win32"===process.platform,A=(e,t)=>`https://cdn.bricks.tools/bricks-cli/${e}/${t}`,C=e=>"beta"===e?"beta":"latest",S=(i=c(function*(e){var t=yield fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: HTTP ${t.status}`);return t}),function(e){return i.apply(this,arguments)}),T=(n=c(function*(e){return(yield S(A(e,"version.json"))).json()}),function(e){return n.apply(this,arguments)}),k=(r=c(function*(e){var t=C(e),a=yield S(`https://registry.npmjs.org/-/package/${E}/dist-tags`),i=(yield a.json())[t];if(!i)throw Error(`No '${t}' dist-tag for ${E}`);return{version:i}}),function(e){return r.apply(this,arguments)}),N=(o=c(function*(e,t){return"npm"===t||"bun"===t?k(e):T(e)}),function(e,t){return o.apply(this,arguments)}),O=(e,t,a={})=>{var i=(0,w.spawnSync)(e,t,{stdio:"inherit",...a});if(i.error){if("ENOENT"===i.error.code)throw Error(`Command not found: ${e}`);throw i.error}if(0!==i.status){var n=Error(`${e} exited with code ${i.status}`);throw n.code=i.status,n}},I=(s=c(function*(e,t){var a=yield S(e),i=Buffer.from((yield a.arrayBuffer())),n=y.join(b.tmpdir(),`bricks-cli-update-${process.pid}-${t}`);return yield _.writeFile(n,i),F||(yield _.chmod(n,493)),n}),function(e,t){return s.apply(this,arguments)}),$=(p=c(function*(e,{installDir:t}={}){var a=F?"install.ps1":"install.sh",i=yield I(A(e,a),a);try{var n=F?["powershell",["-NoProfile","-ExecutionPolicy","Bypass","-File",i,..."beta"===e?["-Beta"]:[],...t?["-InstallDir",t]:[]]]:["sh",[i,..."beta"===e?["--beta"]:[],...t?[`--dir=${t}`]:[]]],r=x(n,2),o=r[0],s=r[1];O(o,s)}finally{yield _.unlink(i).catch(()=>{})}}),function(e){return p.apply(this,arguments)}),j=(l=c(function*(e,t,a={}){if("npm"===e)return void O("npm",["install","-g",`${E}@${C(t)}`]);if("bun"===e)return void O("bun",["install","-g",`${E}@${C(t)}`]);if("binary"===e)return $(t,{installDir:a.installDir});throw Error(`Unsupported update method: ${e}`)}),function(e,t){return l.apply(this,arguments)}),B=a(8479),R=(d=c(function*({message:e,defaultValue:t,autoYes:a}){if(a)return!0;(0,B.z)()||(console.error(f.Ay.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{return yield(0,v.lJ)({message:e,default:t})}catch{return!1}}),function(e){return d.apply(this,arguments)}),V=new m.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((u=c(function*(e){var t,a="2.25.0-beta.60",i=(({execPath:e=process.execPath,scriptPath:t=process.argv[1],homeDir:a=b.homedir(),realpath:i=D}={})=>{let n;var r=(n=e)?y.basename(n).replace(/\.exe$/i,""):"";if("bricks"===r||"bricks-beta"===r)return{method:"binary",execPath:e,installDir:y.dirname(e)};var o=i(t),s=((e,t)=>{if(!e)return null;var a=y.sep,i=`${a}node_modules${a}${t.replace(/\//g,a)}${a}`,n=e.indexOf(i);return -1===n?null:e.slice(0,n)})(o,"@fugood/bricks-cli");if(s){var p=y.sep,l=y.join(a,".bun","install","global");return s===l||s.startsWith(l+p)?{method:"bun",installRoot:s}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(s)?{method:"pnpm",installRoot:s}:/[\\/](?:\.yarn|yarn[\\/]global)[\\/]/.test(s)?{method:"yarn",installRoot:s}:{method:"npm",installRoot:s.endsWith(`${p}lib`)?s.slice(0,-`${p}lib`.length):s}}return{method:"unknown",execPath:e,scriptPath:o}})(),n=e.channel||(({version:e,execPath:t}={})=>{var a=t||process.execPath;return a&&/[\\/]bricks-beta(?:\.exe)?$/i.test(a)||/-(beta|alpha|rc|next)\b/i.test(e||"2.25.0-beta.60")?"beta":"release"})({version:a,execPath:i.execPath});console.log(f.Ay.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${f.Ay.cyan(a)}`),console.log(`Channel : ${f.Ay.cyan(n)}`),console.log(`Detected method : ${f.Ay.cyan(i.method)}`),i.execPath&&"binary"===i.method&&console.log(`Binary path : ${f.Ay.gray(i.execPath)}`),i.installRoot&&console.log(`Install root : ${f.Ay.gray(i.installRoot)}`);var r="npm"===i.method||"bun"===i.method?"npm":"cdn",o=(0,h.default)(`Fetching latest version info (${r})...`).start(),s=null,p=null;try{s=(yield N(n,i.method)).version,o.succeed(`Latest ${n} (${r}): ${f.Ay.green(s)}`)}catch(e){p=e,o.warn(`Could not fetch version info: ${e.message}`)}var l=s&&s===a;if(e.checkUpdate){if(p&&process.exit(2),l)return void console.log(f.Ay.green("\nUp to date."));s&&(console.log(f.Ay.yellow(`
|
|
126
126
|
Update available: ${a} → ${s}. Run 'bricks update-cli' to install.`)),process.exit(1)),console.log(f.Ay.yellow("\nCould not determine current version.")),process.exit(2)}if(l&&(console.log(f.Ay.green("\nAlready running the latest version.")),!(yield R({message:"Reinstall anyway?",defaultValue:!1,autoYes:e.yes}))))return void console.log(f.Ay.gray("Skipped."));var d=["npm","bun","binary"].includes(i.method);d||console.log(f.Ay.yellow(`Cannot auto-detect installer (method: ${i.method}); falling back to binary install.`));var u=d?i.method:"binary";if(!(yield R({message:`Update CLI using "${u}" method?`,defaultValue:!0,autoYes:e.yes})))return void console.log(f.Ay.yellow("Cancelled."));var m=(t=c(function*(e){console.log(f.Ay.cyan(`
|
|
127
127
|
→ Running ${e} update...`));try{return yield j(e,n,i),!0}catch(t){return console.error(f.Ay.yellow(`
|
|
128
128
|
${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,arguments)}),v=yield m(u);!v&&"binary"!==u&&(console.log(f.Ay.cyan("\nFalling back to binary install (same method used by the desktop app).")),(yield R({message:"Try the binary installer as a fallback?",defaultValue:!0,autoYes:e.yes}))&&(v=yield m("binary"))),v||(console.error(f.Ay.red("\nUpdate failed. See messages above.")),process.exit(1)),console.log(f.Ay.green("\nUpdate complete."))}),function(e){return u.apply(this,arguments)}))},92642(e,t,a){a.d(t,{W:()=>_});var i,n,r,o=a(99436),s=a(5018),p=a(44668),l=a(4275),d=a(32235),u=a(62192),c=a(79657),m=a(64007);function f(e){var t,a,i,n=2;for("u">typeof Symbol&&(a=Symbol.asyncIterator,i=Symbol.iterator);n--;){if(a&&null!=(t=e[a]))return t.call(e);if(i&&null!=(t=e[i]))return new h(t.call(e));a="@@asyncIterator",i="@@iterator"}throw TypeError("Object is not async iterable")}function h(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(h=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var a=this.s.return;return void 0===a?Promise.resolve({value:e,done:!0}):t(a.apply(this.s,arguments))},throw:function(e){var a=this.s.return;return void 0===a?Promise.reject(e):t(a.apply(this.s,arguments))}},new h(e)}function*v(e){if(e.errors?.length)throw Error(e.errors.map(e=>e.message).join("\n"));if(e.data){for(var t of Object.values(e.data))if(Array.isArray(t))for(var a of t)yield a}if(Array.isArray(e.incremental)){for(var i of e.incremental)if(Array.isArray(i.items))for(var n of i.items)yield n}}function g(){return(g=l(function*(e){var t=e.headers.get("content-type")||"";if(t.includes("application/json")){var a=yield d(e.json());if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));var i=Object.keys(a.data||{})[0];if(i&&Array.isArray(a.data[i]))for(var n of a.data[i])yield n;return}var r=t.match(/boundary="?([^";]+)"?/),o=r?r[1]:"-",s=`--${o}`,p="",l=!1,c=new TextDecoder,m=e=>{for(var t=0;-1!==(t=e.indexOf(s,t));){if(0===t||"\n"===e[t-1])return t;t+=s.length}return -1},h=function*(){for(var e;-1!==(e=m(p));){var t=p.slice(0,e);(p=p.slice(e+s.length)).startsWith("\r\n")?p=p.slice(2):p.startsWith("\n")&&(p=p.slice(1));var a=t.indexOf("\r\n\r\n"),i=-1!==a?t.slice(a+4).trim():t.trim();if(i){var n=void 0;try{n=JSON.parse(i)}catch{continue}if(yield*v(n),!1===n.hasNext){l=!0;return}}}};try{var g=!1,y=!1;try{for(var b,D,x=f(e.body);g=!(D=yield d(x.next())).done;g=!1){var w=D.value;if(p+=c.decode(w,{stream:!0}),yield*u(f(h()),d),l)break}}catch(e){y=!0,b=e}finally{try{g&&null!=x.return&&(yield d(x.return()))}finally{if(y)throw b}}}catch(e){if(!e.message?.includes("Premature close")||!l)throw e}if(!l&&p.trim()){var _,E=p.indexOf("\r\n\r\n"),F=-1!==E?p.slice(E+4).trim():p.trim();if(F&&!F.startsWith("--")){try{_=JSON.parse(F)}catch{}_&&(yield*u(f(v(_)),d),!1===_.hasNext&&(l=!0))}}e.body?.destroy()})).apply(this,arguments)}var y=`
|
|
@@ -1014,13 +1014,13 @@ ${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,argume
|
|
|
1014
1014
|
lastSeenAt
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
`},1878(e,t,a){a.a(e,async function(e,i){try{a.d(t,{A:()=>C,e:()=>A});var n,r=a(99436),o=a(35679),s=a(73284),p=a(47988),l=a(8479),d=a(55614),u=a(1983),c=a(17422),m=a(32541),f=a(28634),h=a(37818),v=a(23699),g=a(71335),y=a(429),b=a(80274),D=a(42400),x=a(98247),w=a(11405),_=a(86141),E=a(59845),F=e([D]);D=(F.then?(await F)():F)[0];var A=(n=r(function*(){var e,t=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);-1!==t&&process.argv[t+1]&&((0,p.setProfileOverride)(process.argv[t+1]),process.argv.splice(t,2)),o.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.25.0-beta.
|
|
1017
|
+
`},1878(e,t,a){a.a(e,async function(e,i){try{a.d(t,{A:()=>C,e:()=>A});var n,r=a(99436),o=a(35679),s=a(73284),p=a(47988),l=a(8479),d=a(55614),u=a(1983),c=a(17422),m=a(32541),f=a(28634),h=a(37818),v=a(23699),g=a(71335),y=a(429),b=a(80274),D=a(42400),x=a(98247),w=a(11405),_=a(86141),E=a(59845),F=e([D]);D=(F.then?(await F)():F)[0];var A=(n=r(function*(){var e,t=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);-1!==t&&process.argv[t+1]&&((0,p.setProfileOverride)(process.argv[t+1]),process.argv.splice(t,2)),o.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.25.0-beta.60","-v, --version","output the version number").enablePositionalOptions(),o.DM.addCommand(d.s),o.DM.addCommand(u._),o.DM.addCommand(c.B),o.DM.addCommand(m.A),o.DM.addCommand(f.p),o.DM.addCommand(h.u),o.DM.addCommand(v.E),o.DM.addCommand(g.oT),o.DM.addCommand(y.K),o.DM.addCommand(b.gf),o.DM.addCommand(D.D),o.DM.addCommand(x.v),o.DM.addCommand(w.l),o.DM.addCommand(_.D),o.DM.addCommand(E.Q),o.DM.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(r(function*(){try{var e=(yield Promise.all([a.e(3),a.e(940)]).then(a.bind(a,92319))).runInteractiveMode;yield e()}catch(e){console.error(s.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),o.DM.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action((e=r(function*(e){var t=yield Promise.resolve().then(a.bind(a,47988)),i=t.getToken,n=t.getBaseUrl,r=t.getCurrentProfile,o=(yield Promise.resolve().then(a.bind(a,85382))).createClient,p=(yield Promise.resolve().then(a.bind(a,30155))).default,l=r(),d=i(l);d||(console.error(s.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var u=p("Fetching workspace info...").start();try{var c=o(n(),d),m=yield c.workspace();if(u.stop(),e.json)return void console.log(JSON.stringify(m,null,2));console.log(s.Ay.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${s.Ay.green(m.name)}`),console.log(`ID: ${s.Ay.gray(m._id)}`),console.log(`Description: ${m.description||s.Ay.gray("N/A")}`),console.log(`
|
|
1018
1018
|
${s.Ay.bold("Data")}`),console.log(`Remote Update: ${m.bank?.enable_remote_update?s.Ay.green("Enabled"):s.Ay.gray("Disabled")}`),console.log(`Spacename: ${m.bank?.spacename||s.Ay.gray("N/A")}`),console.log("─".repeat(60))}catch(e){u.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}}),function(t){return e.apply(this,arguments)})),o.DM.on("--help",()=>{console.log(""),console.log(s.Ay.bold("Examples:")),console.log(""),console.log(s.Ay.gray(" # Login with a one-time passcode (recommended)")),console.log(" $ bricks auth login <passcode>"),console.log(""),console.log(s.Ay.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(s.Ay.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(s.Ay.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(s.Ay.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(s.Ay.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(s.Ay.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(s.Ay.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(s.Ay.gray("Get workspace token from BRICKS Controller:")),console.log(s.Ay.cyan(" https://control.bricks.tools")),console.log(s.Ay.gray(" Go to Workspace Settings > API Token"))});var i=process.argv.slice(2);if(0===i.length){if((0,l.b)(i))try{var n=(yield Promise.all([a.e(3),a.e(940)]).then(a.bind(a,92319))).runInteractiveMode;yield n();return}catch(e){console.error(s.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}console.error(s.Ay.gray("No command provided. Interactive mode requires a TTY, so showing help instead.\n")),o.DM.outputHelp();return}yield o.DM.parseAsync(process.argv)}),function(){return n.apply(this,arguments)});let C=A;i()}catch(e){i(e)}})},56493(e,t,a){a.d(t,{o:()=>o});var i=a(73284),n=a(47988),r=a(85382),o=()=>{var e=(0,n.getCurrentProfile)(),t=(0,n.getToken)(e);return t||(console.error(i.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,r.createClient)((0,n.getBaseUrl)(),t)}},7586(e,t,a){a.d(t,{$l:()=>r,GF:()=>i,OW:()=>n});var i=e=>{console.log(JSON.stringify(e,null,2))},n=(e,t={})=>{console.error(JSON.stringify({ok:!1,error:{message:e,...t}},null,2))},r=(e,t=4)=>e?e.length<=2*t?"*".repeat(e.length):`${e.slice(0,t)}…${e.slice(-t)}`:null},8479(e,t,a){a.d(t,{b:()=>n,z:()=>i});var i=()=>!!(process.stdin.isTTY&&process.stdout.isTTY&&"function"==typeof process.stdin.setRawMode),n=(e=[])=>0===e.length&&i()},47988(e,t,a){a.r(t),a.d(t,{CONFIG_DIR:()=>o,CONFIG_PATH:()=>s,clearBankCredentials:()=>E,clearConfig:()=>C,default:()=>S,getActivityLogBaseUrl:()=>F,getBankCredentials:()=>w,getBaseUrl:()=>l,getCurrentProfile:()=>y,getCurrentProfileSource:()=>b,getToken:()=>c,getTokenInfo:()=>m,getTokens:()=>u,listProfiles:()=>x,removeToken:()=>h,setActivityLogBaseUrl:()=>A,setBankCredentials:()=>_,setBaseUrl:()=>d,setCurrentProfile:()=>D,setProfileOverride:()=>g,setToken:()=>f});var i=a(83440),n=a(16928),r=a(70857),o=n.join(r.homedir(),".bricks-cli"),s=n.join(o,"config.json"),p=new i.default({projectName:"bricks-cli",cwd:o,schema:{tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},workspaceBilling:{type:"object"},createdAt:{type:"string"},baseUrl:{type:"string"},bank:{type:"object"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"},activityLogBaseUrl:{type:"string",default:"https://activity-log.bricks.tools"},devtoolsTokens:{type:"object",default:{},additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{token:{type:"string"},expiresAt:{type:"string"},jti:{type:"string"},workspaceId:{type:"string"}}}}}}}),l=()=>{var e=y(),t=p.get("tokens");return t[e]?.baseUrl||p.get("baseUrl")},d=(e,t)=>{if(!t)return void p.set("baseUrl",e);var a=p.get("tokens");a[t]||(a[t]={}),a[t].baseUrl=e,p.set("tokens",a)},u=()=>p.get("tokens"),c=(e="default")=>{var t=p.get("tokens");return t[e]?.token},m=(e="default")=>p.get("tokens")[e],f=(e,t)=>{var a=p.get("tokens"),i=a[e];a[e]={...i?.baseUrl?{baseUrl:i.baseUrl}:{},...i?.activityLogBaseUrl?{activityLogBaseUrl:i.activityLogBaseUrl}:{},...t,createdAt:new Date().toISOString()},p.set("tokens",a)},h=e=>{var t=p.get("tokens");delete t[e],p.set("tokens",t)},v=null,g=e=>{v=e},y=()=>v||process.env.BRICKS_PROFILE||p.get("currentProfile"),b=()=>v?"override":process.env.BRICKS_PROFILE?"env":"config",D=e=>p.set("currentProfile",e),x=()=>{var e=p.get("tokens"),t=p.get("currentProfile");return Object.keys(e).map(a=>({...e[a],name:a,current:a===t}))},w=(e="default")=>{var t=p.get("tokens");return t[e]?.bank||null},_=(e,t)=>{var a=p.get("tokens");a[e]||(a[e]={}),a[e].bank=t,p.set("tokens",a)},E=e=>{var t=p.get("tokens");return!!t[e]?.bank&&(delete t[e].bank,p.set("tokens",t),!0)},F=()=>{var e=y(),t=p.get("tokens");return t[e]?.activityLogBaseUrl||p.get("activityLogBaseUrl")},A=(e,t)=>{if(!t)return void p.set("activityLogBaseUrl",e);var a=p.get("tokens");a[t]||(a[t]={}),a[t].activityLogBaseUrl=e,p.set("tokens",a)},C=()=>{p.clear()};let S=p},75646(e,t,a){a.r(t),a.d(t,{discoverDevToolsServers:()=>p,httpProbeSubnet:()=>l,verifyDevToolsServer:()=>d});var i,n,r=a(99436),o=a(19557),s="bricks-devtools",p=({timeout:e=3e3,idleTimeout:t=0}={})=>(0,o.YH)({port:19900,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"1.0",s:s,d:{id:`cli-${(0,o.BW)()}`}})),parseMessage:(e,t)=>{var a=JSON.parse(e.toString());if(a.s!==s||"ANNOUNCE"!==a.t&&"RESPONSE"!==a.t)return null;var i=a.d?.info;if(!i)return null;var n=t.address;return{key:`${n}:${i.port}`,value:{...i,address:n}}}}),l=(i=r(function*({port:e=19851,connectTimeout:t=500,concurrency:a=50,timeout:i=0}={}){var n=(0,o.r9)();if(0===n.length)return[];var s=[],p=i>0?Date.now()+i:0,l=[],u=new Set;for(var c of n){var m=c.address.split(".").slice(0,3).join(".");if(!u.has(m)){u.add(m);for(var f=1;f<255;f++)l.push(`${m}.${f}`)}}for(var h=0;h<l.length&&!(p&&Date.now()>=p);h+=a){var v=l.slice(h,h+a);yield Promise.allSettled(v.map(function(){var a=r(function*(a){var i=yield d(a,e,t);i&&s.push({...i,address:a,port:e})});return function(e){return a.apply(this,arguments)}}()))}return s}),function(){return i.apply(this,arguments)}),d=(n=r(function*(e,t,a=3e3){return(0,o.uE)(`http://${e}:${t}/devtools/info`,a)}),function(e,t){return n.apply(this,arguments)})},19557(e,t,a){a.d(t,{BW:()=>s,YH:()=>l,r9:()=>p,uE:()=>d});var i,n=a(99436),r=a(41314),o=a(48161),s=()=>Math.random().toString(36).slice(2,9),p=()=>{var e=[];for(var t of Object.values(o.networkInterfaces()))for(var a of t)if(function(){if("IPv4"!==a.family||a.internal)return 1;var t=a.address.split(".").map(Number),i=a.netmask.split(".").map(Number),n=t.map((e,t)=>(e|255&~i[t]).toString()).join(".");e.push({address:a.address,broadcast:n})}())continue;return e},l=({port:e,timeout:t=3e3,idleTimeout:a=0,buildQuery:i,parseMessage:n})=>new Promise((o,s)=>{var l=new Map,d=r.createSocket("udp4"),u=null,c=null,m=!1,f=()=>{if(!m){m=!0,clearTimeout(u),clearTimeout(c);try{d.close()}catch{}o([...l.values()])}};d.on("error",e=>{if(!m){m=!0,clearTimeout(u),clearTimeout(c);try{d.close()}catch{}s(e)}}),d.on("message",(e,t)=>{try{var i=n(e,t);if(!i||l.has(i.key))return;l.set(i.key,i.value),a&&!m&&(clearTimeout(c),c=setTimeout(f,a))}catch{}}),d.bind(()=>{d.setBroadcast(!0);var a=i();for(var n of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of p())e.add(t.broadcast);return[...e]})())d.send(a,0,a.length,e,n);u=setTimeout(f,t)})}),d=(i=n(function*(e,t=3e3){var a;try{var i=new AbortController;a=setTimeout(()=>i.abort(),t);var n=yield fetch(e,{signal:i.signal});if(!n.ok)return null;return yield n.json()}catch{return null}finally{void 0!==a&&clearTimeout(a)}}),function(e){return i.apply(this,arguments)})},74049(e,t,a){a.d(t,{Ku:()=>s,w9:()=>o});var i=a(79896),n=a(16928),r=new Set(["CTOR","CTOR Desktop"]),o=e=>{var t,a=`Release by ${(t=process.env.BRICKS_RELEASE_SIGN)&&r.has(t)?t:"BRICKS CLI"}`;return e?`${e}
|
|
1019
1019
|
|
|
1020
|
-
${a}`:a},s=e=>{if(e.endsWith(".json")||e.includes("/")){if(!i.existsSync(e))throw Error(`Config file not found: ${e}`);var t=i.readFileSync(e,"utf-8");return{config:t,source:{type:"file",path:n.resolve(e)},sizeBytes:Buffer.byteLength(t)}}return{config:e,source:{type:"inline"},sizeBytes:Buffer.byteLength(e)}}},68168(e,t,a){a.d(t,{K:()=>o,Y:()=>s});var i,n=a(99436),r=e=>String(e||"").trim().toLowerCase(),o=({resource:e,query:t,items:a,fields:i,selectedBy:n=null})=>{var o=r(t),s=a.filter(e=>i.some(t=>r(t.split(".").reduce((e,t)=>e?.[t],e)??null)===o)),p=null,l=n;return"id"===n?p=a[0]||null:1===s.length?(p=s[0],l="exact"):1===a.length&&(p=a[0],l="single"),{resource:e,query:t,exactMatchCount:s.length,matchCount:a.length,selectedBy:l,ambiguous:a.length>1&&!p,resolved:p,matches:a}},s=(i=n(function*(e){try{return yield e()}catch(e){if(/not found/i.test(e.message))return null;throw e}}),function(e){return i.apply(this,arguments)})},60450(e,t,a){a.d(t,{Gu:()=>m,he:()=>h,wR:()=>u});var i,n,r,o=a(99436),s=a(79657),p=a(73024),l=a(76760),d=a(48161),u=e=>e?.media_resource?.enable_media_workspace===!0,c=(i=o(function*(e,t,a){var i=yield e.mediaFiles({boxId:t,userTags:[`bricks_screenshot_${a}`],limit:1});return i?.[0]||null}),function(e,t,a){return i.apply(this,arguments)}),m=(e,{preferThumbnail:t=!1}={})=>{if(!e?.meta?.storageEndpoint)return null;var a=e.meta,i=a.storageEndpoint,n=a.originalFileKey,r=(t?(e=>{var t=e?.meta;if(!t)return null;if("Video"===e.fileType&&t.videoThumbOriginalFileKey)return t.videoThumbOriginalFileKey;var a=t.imageVersions||[];if(!Array.isArray(a)||0===a.length)return null;var i=a.filter(e=>e?.strategy==="BOUNDED"&&"number"==typeof e.width).sort((e,t)=>e.width-t.width);return(i[0]||a[0])?.key||null})(e):null)||n;return r?`${i}/${r}`:null},f=(n=o(function*(e,t=null){var a=yield(0,s.Ay)(e);if(!a.ok)throw Error(`Failed to download screenshot: ${a.statusText}`);var i=yield a.buffer(),n=t||l.join(d.tmpdir(),`bricks-screenshot-${Date.now()}.png`),r=l.dirname(n);return p.existsSync(r)||p.mkdirSync(r,{recursive:!0}),p.writeFileSync(n,i),n}),function(e){return n.apply(this,arguments)}),h=(r=o(function*(e,t,a,i=null,n={}){var r=u(t)&&t.media_resource?.system_media_box_id||null;if(!r)return{error:"Media workspace not enabled for this workspace"};var o=yield c(e,r,a);if(!o)return{error:"No screenshot available for this device"};var s=m(o,n);return s?{path:yield f(s,i),file:o,url:s}:{error:"Could not build screenshot URL"}}),function(e,t,a){return r.apply(this,arguments)})},44618(e,t,a){a.d(t,{V:()=>r});var i={S:"Subspace",B:"Brick",C:"Canvas",A:"Animation",G:"Generator",D:"Data",F:"Data Calc",N:"Calc Node",T:"Test",TC:"Test Case",AT:"Automation Map"},n=e=>e?.split("_")?.[0]||"",r=(e,{keyword:t,types:a}={})=>{var r=t?.trim().toLowerCase()||"",o=a?.length>0?new Set(a.flatMap(e=>{var t=String(e).trim().toUpperCase();return t?[t]:[]})):null;return Object.entries(Object.entries(e||{}).filter(([,e])=>e&&!e.hide).filter(([e,t])=>{var a=n(e);if(o&&!o.has(a))return!1;if(!r)return!0;var i=t?.title?String(t.title).toLowerCase():"";return e.toLowerCase().includes(r)||i.includes(r)}).reduce((e,[t,a])=>{var i=n(t);return e[i]||(e[i]=[]),e[i].push({shortId:t,ref:a}),e},{})).map(([e,t])=>({prefix:e,label:i[e]||e,refs:t.sort((e,t)=>{var a=e.ref?.title||e.shortId,i=t.ref?.title||t.shortId;return String(a).localeCompare(String(i))})})).sort((e,t)=>e.label.localeCompare(t.label))}},94979(e,t,a){a.d(t,{p:()=>r});var i=/^(\d+)(s|m|h|d|w)$/,n={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function r(e){var t=e.match(i);if(t){var a=parseInt(t[1],10),r=n[t[2]];return new Date(Date.now()-a*r).toISOString()}var o=new Date(e);if(isNaN(o.getTime()))throw Error(`Invalid time format: "${e}". Use ISO 8601 or relative (e.g. 1h, 30m, 2d)`);return o.toISOString()}},98593(e,t,a){a.d(t,{H_:()=>
|
|
1021
|
-
Dry Run: ${e}`)),console.log("─".repeat(60)),t&&(console.log(i.Ay.bold("Target")),Object.entries(t).forEach(([e,t])=>{console.log(`${e}: ${
|
|
1022
|
-
${i.Ay.bold("Request")}`),Object.entries(a).forEach(([e,t])=>{console.log(`${e}: ${
|
|
1023
|
-
${i.Ay.bold("Checks")}`),r.forEach(e=>{var t=e.ok?i.Ay.green("OK"):i.Ay.red("FAIL"),a=e.detail?` ${e.detail}`:"";console.log(`${t} ${e.label}${a}`)})),console.log("─".repeat(60)))},l=({action:e,target:t,result:a=null,json:i=!1,message:r})=>{i?(0,n.GF)({ok:!0,dryRun:!1,action:e,target:t||null,result:a}):r&&console.log(r)}},73284(e,t,a){let i;a.d(t,{Ay:()=>T});let n=(e=0)=>t=>`\u001B[${t+e}m`,r=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,o=(e=0)=>(t,a,i)=>`\u001B[${38+e};2;${t};${a};${i}m`,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(s.modifier),[...Object.keys(s.color),...Object.keys(s.bgColor)];let p=function(){let e=new Map;for(let[t,a]of Object.entries(s)){for(let[t,i]of Object.entries(a))s[t]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},a[t]=s[t],e.set(i[0],i[1]);Object.defineProperty(s,t,{value:a,enumerable:!1})}return Object.defineProperty(s,"codes",{value:e,enumerable:!1}),s.color.close="\x1b[39m",s.bgColor.close="\x1b[49m",s.color.ansi=n(),s.color.ansi256=r(),s.color.ansi16m=o(),s.bgColor.ansi=n(10),s.bgColor.ansi256=r(10),s.bgColor.ansi16m=o(10),Object.defineProperties(s,{rgbToAnsi256:{value:(e,t,a)=>e===t&&t===a?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(a/255*5),enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[a]=t;3===a.length&&(a=[...a].map(e=>e+e).join(""));let i=Number.parseInt(a,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:e=>s.rgbToAnsi256(...s.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){let t,a,i;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)a=t=((e-232)*10+8)/255,i=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,a=Math.floor(n/6)/5,i=n%6/5}let n=2*Math.max(t,a,i);if(0===n)return 30;let r=30+(Math.round(i)<<2|Math.round(a)<<1|Math.round(t));return 2===n&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(e,t,a)=>s.ansi256ToAnsi(s.rgbToAnsi256(e,t,a)),enumerable:!1},hexToAnsi:{value:e=>s.ansi256ToAnsi(s.hexToAnsi256(e)),enumerable:!1}}),s}();var l=a(1708),d=a(48161),u=a(7066);function c(e,t=globalThis.Deno?globalThis.Deno.args:l.argv){let a=e.startsWith("-")?"":1===e.length?"-":"--",i=t.indexOf(a+e),n=t.indexOf("--");return -1!==i&&(-1===n||i<n)}let{env:m}=l;function f(e,t={}){var a;return 0!==(a=function(e,{streamIsTTY:t,sniffFlags:a=!0}={}){let n=function(){if("FORCE_COLOR"in m)return"true"===m.FORCE_COLOR?1:"false"===m.FORCE_COLOR?0:0===m.FORCE_COLOR.length?1:Math.min(Number.parseInt(m.FORCE_COLOR,10),3)}();void 0!==n&&(i=n);let r=a?i:n;if(0===r)return 0;if(a){if(c("color=16m")||c("color=full")||c("color=truecolor"))return 3;if(c("color=256"))return 2}if("TF_BUILD"in m&&"AGENT_NAME"in m)return 1;if(e&&!t&&void 0===r)return 0;let o=r||0;if("dumb"===m.TERM)return o;if("win32"===l.platform){let e=d.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in m)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in m)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in m)||"codeship"===m.CI_NAME?1:o;if("TEAMCITY_VERSION"in m)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(m.TEAMCITY_VERSION);if("truecolor"===m.COLORTERM||"xterm-kitty"===m.TERM||"xterm-ghostty"===m.TERM||"wezterm"===m.TERM)return 3;if("TERM_PROGRAM"in m){let e=Number.parseInt((m.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(m.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(m.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(m.TERM)||"COLORTERM"in m?1:o}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}c("no-color")||c("no-colors")||c("color=false")||c("color=never")?i=0:(c("color")||c("colors")||c("color=true")||c("color=always"))&&(i=1);let{stdout:h,stderr:v}={stdout:f({isTTY:u.isatty(1)}),stderr:f({isTTY:u.isatty(2)})},g=Symbol("GENERATOR"),y=Symbol("STYLER"),b=Symbol("IS_EMPTY"),D=["ansi","ansi","ansi256","ansi16m"],x=Object.create(null);function w(e){let t;return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let a=h?h.level:0;e.level=void 0===t.level?a:t.level})(t=(...e)=>e.join(" "),e),Object.setPrototypeOf(t,w.prototype),t}for(let[e,t]of(Object.setPrototypeOf(w.prototype,Function.prototype),Object.entries(p)))x[e]={get(){let a=A(this,F(t.open,t.close,this[y]),this[b]);return Object.defineProperty(this,e,{value:a}),a}};x.visible={get(){let e=A(this,this[y],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let _=(e,t,a,...i)=>"rgb"===e?"ansi16m"===t?p[a].ansi16m(...i):"ansi256"===t?p[a].ansi256(p.rgbToAnsi256(...i)):p[a].ansi(p.rgbToAnsi(...i)):"hex"===e?_("rgb",t,a,...p.hexToRgb(...i)):p[a][e](...i);for(let e of["rgb","hex","ansi256"])x[e]={get(){let{level:t}=this;return function(...a){return A(this,F(_(e,D[t],"color",...a),p.color.close,this[y]),this[b])}}},x["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...a){return A(this,F(_(e,D[t],"bgColor",...a),p.bgColor.close,this[y]),this[b])}}};let E=Object.defineProperties(()=>{},{...x,level:{enumerable:!0,get(){return this[g].level},set(e){this[g].level=e}}}),F=(e,t,a)=>{let i,n;return void 0===a?(i=e,n=t):(i=a.openAll+e,n=t+a.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:a}},A=(e,t,a)=>{let i=(...e)=>C(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,E),i[g]=e,i[y]=t,i[b]=a,i},C=(e,t)=>{if(e.level<=0||!t)return e[b]?"":t;let a=e[y];if(void 0===a)return t;let{openAll:i,closeAll:n}=a;if(t.includes("\x1b"))for(;void 0!==a;)t=function(e,t,a){let i=e.indexOf(t);if(-1===i)return e;let n=t.length,r=0,o="";do o+=e.slice(r,i)+t+a,r=i+n,i=e.indexOf(t,r);while(-1!==i);return o+e.slice(r)}(t,a.close,a.open),a=a.parent;let r=t.indexOf("\n");return -1!==r&&(t=function(e,t,a,i){let n=0,r="";do{let o="\r"===e[i-1];r+=e.slice(n,o?i-1:i)+t+(o?"\r\n":"\n")+a,n=i+1,i=e.indexOf("\n",n)}while(-1!==i);return r+e.slice(n)}(t,n,i,r)),i+t+n};Object.defineProperties(w.prototype,x);let S=w();w({level:v?v.level:0});let T=S},35679(e,t,a){a.d(t,{DM:()=>i,uB:()=>d});let{DM:i,gu:n,er:r,Ww:o,b7:s,Di:p,a2:l,uB:d,ef:u,c$:c,_V:m}=a(65181)},48255(e,t,a){a.d(t,{Wk:()=>l,eO:()=>o,yJ:()=>p});var i=a(91070),n=a(73971),r=a(8238);class o extends Error{constructor(e,...t){var a,r,p;let l,{nodes:d,source:u,positions:c,path:m,originalError:f,extensions:h}=null==(l=t[0])||"kind"in l||"length"in l?{nodes:l,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:l;super(e),this.name="GraphQLError",this.path=null!=m?m:void 0,this.originalError=null!=f?f:void 0,this.nodes=s(Array.isArray(d)?d:d?[d]:void 0);let v=s(null==(a=this.nodes)?void 0:a.map(e=>e.loc).filter(e=>null!=e));this.source=null!=u?u:null==v||null==(r=v[0])?void 0:r.source,this.positions=null!=c?c:null==v?void 0:v.map(e=>e.start),this.locations=c&&u?c.map(e=>(0,n.g)(u,e)):null==v?void 0:v.map(e=>(0,n.g)(e.source,e.start));let g=(0,i.Z)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!=(p=null!=h?h:g)?p:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+="\n\n"+(0,r.V)(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+(0,r.C)(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}function p(e){return e.toString()}function l(e){return e.toJSON()}},59841(e,t,a){a.d(t,{I:()=>n});var i=a(48255);function n(e,t,a){return new i.eO(`Syntax Error: ${a}`,{source:e,positions:[t]})}},36869(e,t,a){let i;a.r(t),a.d(t,{VariablesAreInputTypesRule:()=>aP,SingleFieldSubscriptionsRule:()=>a_,UniqueVariableNamesRule:()=>aB,GraphQLDeprecatedDirective:()=>e7,GraphQLNonNull:()=>ef,__InputValue:()=>tm,createSourceEventStream:()=>ig,execute:()=>aZ,isDefinitionNode:()=>tV.MD,isInterfaceType:()=>z,isRequiredArgument:()=>eI,isValidNameError:()=>i0,parseValue:()=>h.$x,valueFromAST:()=>am,NoUnusedVariablesRule:()=>t1,__DirectiveLocation:()=>td,findDangerousChanges:()=>i4,__TypeKind:()=>th,isSchema:()=>tx,UniqueTypeNamesRule:()=>aj,NoSchemaIntrospectionCustomRule:()=>iD,defaultTypeResolver:()=>ia,isType:()=>P,syntaxError:()=>ix.I,version:()=>n,UniqueFragmentNamesRule:()=>aN,assertWrappingType:()=>ev,getNullableType:()=>eb,isObjectType:()=>q,visitWithTypeInfo:()=>tR,assertEnumValueName:()=>V,printSchema:()=>iP,validate:()=>aJ,BREAK:()=>tI.sP,assertNonNullType:()=>ea,assertNullableType:()=>ey,executeSync:()=>a1,isLeafType:()=>es,resolveSchemaCoordinate:()=>ne,assertOutputType:()=>eo,buildASTSchema:()=>iO,astFromValue:()=>to,Kind:()=>I.b,ProvidedRequiredArgumentsRule:()=>an,UniqueDirectiveNamesRule:()=>aC,KnownDirectivesRule:()=>tG,DEFAULT_DEPRECATION_REASON:()=>e9,TypeKind:()=>d,assertInterfaceType:()=>Y,isValueNode:()=>tV.aR,GraphQLSpecifiedByDirective:()=>te,GraphQLFloat:()=>eH,UniqueFieldDefinitionNamesRule:()=>ak,LoneAnonymousOperationRule:()=>tQ,VariablesInAllowedPositionRule:()=>aL,assertInputType:()=>en,formatError:()=>g.Wk,assertInputObjectType:()=>X,isOutputType:()=>er,isWrappingType:()=>eh,assertLeafType:()=>ep,assertValidSchema:()=>tA,FragmentsOnCompositeTypesRule:()=>tM,graphql:()=>io,UniqueOperationTypesRule:()=>a$,parseSchemaCoordinate:()=>h.Ng,UniqueEnumValueNamesRule:()=>aT,isNonNullType:()=>et,isSelectionNode:()=>tV.VK,printError:()=>g.yJ,specifiedDirectives:()=>ta,visit:()=>tI.YR,GraphQLScalarType:()=>eF,assertEnumType:()=>H,UniqueDirectivesPerLocationRule:()=>aS,assertName:()=>R,getDirectiveValues:()=>ag,isConstValueNode:()=>tV.TZ,isEqualType:()=>eq,isNamedType:()=>eD,isTypeDefinitionNode:()=>tV.a6,validateSchema:()=>tF,parse:()=>h.qg,__Schema:()=>tp,isTypeSystemDefinitionNode:()=>tV.xu,valueFromASTUntyped:()=>j,LoneSchemaDefinitionRule:()=>tW,isTypeSubTypeOf:()=>eG,UniqueArgumentNamesRule:()=>aA,UniqueInputFieldNamesRule:()=>aO,locatedError:()=>aK,typeFromAST:()=>t$,printLocation:()=>iu.V,assertUnionType:()=>Q,separateOperations:()=>iX,getVariableValues:()=>ah,Location:()=>y.aZ,GraphQLObjectType:()=>eA,UniqueArgumentDefinitionNamesRule:()=>aF,stripIgnoredCharacters:()=>i1,GRAPHQL_MAX_INT:()=>eJ,visitInParallel:()=>tI.oP,parseType:()=>h.Mb,isTypeNode:()=>tV.dI,PossibleTypeExtensionsRule:()=>aa,graphqlSync:()=>is,isSchemaCoordinateNode:()=>tV.gj,DirectiveLocation:()=>eY.H,TypeNameMetaFieldDef:()=>ty,coerceInputValue:()=>au,GraphQLInt:()=>eW,resolveObjMapThunk:()=>eE,GraphQLInterfaceType:()=>e$,UniqueOperationNamesRule:()=>aI,GraphQLSkipDirective:()=>e5,isEnumType:()=>W,assertValidName:()=>i2,buildClientSchema:()=>iA,KnownArgumentNamesRule:()=>tU,ValuesOfCorrectTypeRule:()=>aR,isInputObjectType:()=>K,GraphQLID:()=>eZ,NoUnusedFragmentsRule:()=>tZ,isUnionType:()=>J,isSpecifiedScalarType:()=>e2,getArgumentValues:()=>av,printSourceLocation:()=>iu.C,__EnumValue:()=>tf,getOperationAST:()=>i_,isExecutableDefinitionNode:()=>tV._m,isAbstractType:()=>eu,assertAbstractType:()=>ec,isTypeExtensionNode:()=>tV.i7,GraphQLInputObjectType:()=>eL,getNamedType:()=>ew,parseConstValue:()=>h.u8,KnownFragmentNamesRule:()=>tz,isListType:()=>Z,Lexer:()=>ic.JG,isSpecifiedDirective:()=>ti,responsePathAsArray:()=>ad,isDirective:()=>e6,TypeInfo:()=>tj,assertScalarType:()=>U,extendSchema:()=>iC,isIntrospectionType:()=>tD,print:()=>$.y,getIntrospectionQuery:()=>iw,GraphQLBoolean:()=>eX,KnownTypeNamesRule:()=>tY,assertListType:()=>ee,concatAST:()=>iK,NoDeprecatedCustomRule:()=>ib,defaultFieldResolver:()=>ii,GraphQLDirective:()=>e3,getLocation:()=>id.g,TypeMetaFieldDef:()=>tg,GRAPHQL_MIN_INT:()=>eQ,GraphQLIncludeDirective:()=>e8,ScalarLeafsRule:()=>as,assertSchema:()=>tw,lexicographicSortSchema:()=>i$,GraphQLList:()=>em,isTypeSystemExtensionNode:()=>tV.fT,specifiedScalarTypes:()=>e1,BreakingChangeType:()=>u,ExecutableDefinitionsRule:()=>tP,assertDirective:()=>e4,__Field:()=>tc,getVisitFn:()=>tI.UY,recommendedRules:()=>aM,SchemaMetaFieldDef:()=>tv,assertCompositeType:()=>ed,isRequiredInputField:()=>eU,Token:()=>y.ou,specifiedRules:()=>aU,DangerousChangeType:()=>c,GraphQLUnionType:()=>ej,isCompositeType:()=>el,versionInfo:()=>r,FieldsOnCorrectTypeRule:()=>tL,GraphQLString:()=>eK,assertType:()=>L,introspectionFromSchema:()=>iF,doTypesOverlap:()=>ez,GraphQLEnumType:()=>eR,resolveReadonlyArrayThunk:()=>e_,GraphQLOneOfDirective:()=>tt,NoFragmentCyclesRule:()=>tK,findBreakingChanges:()=>i6,ValidationContext:()=>aY,OverlappingFieldsCanBeMergedRule:()=>t0,isScalarType:()=>M,MaxIntrospectionDepthRule:()=>tH,NoUndefinedVariablesRule:()=>tX,assertObjectType:()=>G,getOperationRootType:()=>iE,printType:()=>iq,OperationTypeNode:()=>y.cE,isInputType:()=>ei,__Directive:()=>tl,GraphQLSchema:()=>t_,Source:()=>il.k,resolveASTSchemaCoordinate:()=>nt,GraphQLError:()=>g.eO,assertNamedType:()=>ex,buildSchema:()=>iI,introspectionTypes:()=>tb,PossibleFragmentSpreadsRule:()=>at,__Type:()=>tu,getEnterLeaveForKind:()=>tI.XO,TokenKind:()=>im.Y,printIntrospectionSchema:()=>iL,isNullableType:()=>eg,subscribe:()=>iv});let n="16.12.0",r=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});var o,s,p,l,d,u,c,m=a(93217);function f(e){return"function"==typeof(null==e?void 0:e.then)}var h=a(20186),v=a(35198),g=a(48255),y=a(59762);function b(e,t){let[a,i]=t?[e,t]:[void 0,e],n=" Did you mean ";a&&(n+=a+" ");let r=i.map(e=>`"${e}"`);switch(r.length){case 0:return"";case 1:return n+r[0]+"?";case 2:return n+r[0]+" or "+r[1]+"?"}let o=r.slice(0,5),s=o.pop();return n+o.join(", ")+", or "+s+"?"}function D(e){return e}var x=a(50792),w=a(91070);function _(e,t){let a=Object.create(null);for(let i of e)a[t(i)]=i;return a}function E(e,t,a){let i=Object.create(null);for(let n of e)i[t(n)]=a(n);return i}function F(e,t){let a=Object.create(null);for(let i of Object.keys(e))a[i]=t(e[i],i);return a}function A(e,t){let a=0,i=0;for(;a<e.length&&i<t.length;){let n=e.charCodeAt(a),r=t.charCodeAt(i);if(S(n)&&S(r)){let o=0;do++a,o=10*o+n-C,n=e.charCodeAt(a);while(S(n)&&o>0);let s=0;do++i,s=10*s+r-C,r=t.charCodeAt(i);while(S(r)&&s>0);if(o<s)return -1;if(o>s)return 1}else{if(n<r)return -1;if(n>r)return 1;++a,++i}}return e.length-t.length}let C=48;function S(e){return!isNaN(e)&&C<=e&&e<=57}function T(e,t){let a=Object.create(null),i=new k(e),n=Math.floor(.4*e.length)+1;for(let e of t){let t=i.measure(e,n);void 0!==t&&(a[e]=t)}return Object.keys(a).sort((e,t)=>{let i=a[e]-a[t];return 0!==i?i:A(e,t)})}class k{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=N(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let a=e.toLowerCase();if(this._inputLowerCase===a)return 1;let i=N(a),n=this._inputArray;if(i.length<n.length){let e=i;i=n,n=e}let r=i.length,o=n.length;if(r-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=r;e++){let a=s[(e-1)%3],r=s[e%3],p=r[0]=e;for(let t=1;t<=o;t++){let o=+(i[e-1]!==n[t-1]),l=Math.min(a[t]+1,r[t-1]+1,a[t-1]+o);e>1&&t>1&&i[e-1]===n[t-2]&&i[e-2]===n[t-1]&&(l=Math.min(l,s[(e-2)%3][t-2]+1)),l<p&&(p=l),r[t]=l}if(p>t)return}let p=s[r%3][o];return p<=t?p:void 0}}function N(e){let t=e.length,a=Array(t);for(let i=0;i<t;++i)a[i]=e.charCodeAt(i);return a}function O(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);for(let[a,i]of Object.entries(e))t[a]=i;return t}var I=a(42455),$=a(95818);function j(e,t){switch(e.kind){case I.b.NULL:return null;case I.b.INT:return parseInt(e.value,10);case I.b.FLOAT:return parseFloat(e.value);case I.b.STRING:case I.b.ENUM:case I.b.BOOLEAN:return e.value;case I.b.LIST:return e.values.map(e=>j(e,t));case I.b.OBJECT:return E(e.fields,e=>e.name.value,e=>j(e.value,t));case I.b.VARIABLE:return null==t?void 0:t[e.name.value]}}var B=a(25881);function R(e){if(null!=e||(0,m.U)(!1,"Must provide name."),"string"==typeof e||(0,m.U)(!1,"Expected name to be a string."),0===e.length)throw new g.eO("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,B.xr)(e.charCodeAt(t)))throw new g.eO(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,B.un)(e.charCodeAt(0)))throw new g.eO(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function V(e){if("true"===e||"false"===e||"null"===e)throw new g.eO(`Enum values cannot be named: ${e}`);return R(e)}function P(e){return M(e)||q(e)||z(e)||J(e)||W(e)||K(e)||Z(e)||et(e)}function L(e){if(!P(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL type.`);return e}function M(e){return(0,x.h)(e,eF)}function U(e){if(!M(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Scalar type.`);return e}function q(e){return(0,x.h)(e,eA)}function G(e){if(!q(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Object type.`);return e}function z(e){return(0,x.h)(e,e$)}function Y(e){if(!z(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Interface type.`);return e}function J(e){return(0,x.h)(e,ej)}function Q(e){if(!J(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Union type.`);return e}function W(e){return(0,x.h)(e,eR)}function H(e){if(!W(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Enum type.`);return e}function K(e){return(0,x.h)(e,eL)}function X(e){if(!K(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Input Object type.`);return e}function Z(e){return(0,x.h)(e,em)}function ee(e){if(!Z(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL List type.`);return e}function et(e){return(0,x.h)(e,ef)}function ea(e){if(!et(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Non-Null type.`);return e}function ei(e){return M(e)||W(e)||K(e)||eh(e)&&ei(e.ofType)}function en(e){if(!ei(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL input type.`);return e}function er(e){return M(e)||q(e)||z(e)||J(e)||W(e)||eh(e)&&er(e.ofType)}function eo(e){if(!er(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL output type.`);return e}function es(e){return M(e)||W(e)}function ep(e){if(!es(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL leaf type.`);return e}function el(e){return q(e)||z(e)||J(e)}function ed(e){if(!el(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL composite type.`);return e}function eu(e){return z(e)||J(e)}function ec(e){if(!eu(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL abstract type.`);return e}class em{constructor(e){P(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class ef{constructor(e){eg(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function eh(e){return Z(e)||et(e)}function ev(e){if(!eh(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL wrapping type.`);return e}function eg(e){return P(e)&&!et(e)}function ey(e){if(!eg(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`);return e}function eb(e){if(e)return et(e)?e.ofType:e}function eD(e){return M(e)||q(e)||z(e)||J(e)||W(e)||K(e)}function ex(e){if(!eD(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL named type.`);return e}function ew(e){if(e){let t=e;for(;eh(t);)t=t.ofType;return t}}function e_(e){return"function"==typeof e?e():e}function eE(e){return"function"==typeof e?e():e}class eF{constructor(e){var t,a,i,n;let r=null!=(t=e.parseValue)?t:D;this.name=R(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(a=e.serialize)?a:D,this.parseValue=r,this.parseLiteral=null!=(i=e.parseLiteral)?i:(e,t)=>r(j(e,t)),this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(n=e.extensionASTNodes)?n:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,m.U)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,v.N)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,m.U)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,m.U)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class eA{constructor(e){var t;this.name=R(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>eS(e),this._interfaces=()=>eC(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,m.U)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,v.N)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:eN(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eC(e){var t;let a=e_(null!=(t=e.interfaces)?t:[]);return Array.isArray(a)||(0,m.U)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),a}function eS(e){let t=eE(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),F(t,(t,a)=>{var i;ek(t)||(0,m.U)(!1,`${e.name}.${a} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,m.U)(!1,`${e.name}.${a} field resolver must be a function if provided, but got: ${(0,v.N)(t.resolve)}.`);let n=null!=(i=t.args)?i:{};return ek(n)||(0,m.U)(!1,`${e.name}.${a} args must be an object with argument names as keys.`),{name:R(a),description:t.description,type:t.type,args:eT(n),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:O(t.extensions),astNode:t.astNode}})}function eT(e){return Object.entries(e).map(([e,t])=>({name:R(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:O(t.extensions),astNode:t.astNode}))}function ek(e){return(0,w.Z)(e)&&!Array.isArray(e)}function eN(e){return F(e,e=>({description:e.description,type:e.type,args:eO(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eO(e){return E(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eI(e){return et(e.type)&&void 0===e.defaultValue}class e${constructor(e){var t;this.name=R(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=eS.bind(void 0,e),this._interfaces=eC.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:eN(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ej{constructor(e){var t;this.name=R(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=eB.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eB(e){let t=e_(e.types);return Array.isArray(t)||(0,m.U)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class eR{constructor(e){var t;this.name=R(e.name),this.description=e.description,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:eP(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=eP(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=_(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(void 0===t)throw new g.eO(`Enum "${this.name}" cannot represent value: ${(0,v.N)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){let t=(0,v.N)(e);throw new g.eO(`Enum "${this.name}" cannot represent non-string value: ${t}.`+eV(this,t))}let t=this.getValue(e);if(null==t)throw new g.eO(`Value "${e}" does not exist in "${this.name}" enum.`+eV(this,e));return t.value}parseLiteral(e,t){if(e.kind!==I.b.ENUM){let t=(0,$.y)(e);throw new g.eO(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+eV(this,t),{nodes:e})}let a=this.getValue(e.value);if(null==a){let t=(0,$.y)(e);throw new g.eO(`Value "${t}" does not exist in "${this.name}" enum.`+eV(this,t),{nodes:e})}return a.value}toConfig(){let e=E(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eV(e,t){return b("the enum value",T(t,e.getValues().map(e=>e.name)))}function eP(e,t){return ek(t)||(0,m.U)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,a])=>(ek(a)||(0,m.U)(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${(0,v.N)(a)}.`),{name:V(t),description:a.description,value:void 0!==a.value?a.value:t,deprecationReason:a.deprecationReason,extensions:O(a.extensions),astNode:a.astNode}))}class eL{constructor(e){var t,a;this.name=R(e.name),this.description=e.description,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(a=e.isOneOf)&&a,this._fields=eM.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){let e=F(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function eM(e){let t=eE(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),F(t,(t,a)=>("resolve"in t&&(0,m.U)(!1,`${e.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:R(a),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:O(t.extensions),astNode:t.astNode}))}function eU(e){return et(e.type)&&void 0===e.defaultValue}function eq(e,t){return e===t||!!(et(e)&&et(t)||Z(e)&&Z(t))&&eq(e.ofType,t.ofType)}function eG(e,t,a){return t===a||(et(a)?!!et(t)&&eG(e,t.ofType,a.ofType):et(t)?eG(e,t.ofType,a):Z(a)?!!Z(t)&&eG(e,t.ofType,a.ofType):!Z(t)&&eu(a)&&(z(t)||q(t))&&e.isSubType(a,t))}function ez(e,t,a){return t===a||(eu(t)?eu(a)?e.getPossibleTypes(t).some(t=>e.isSubType(a,t)):e.isSubType(t,a):!!eu(a)&&e.isSubType(a,t))}var eY=a(42868);let eJ=0x7fffffff,eQ=-0x80000000,eW=new eF({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=e0(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isInteger(a))throw new g.eO(`Int cannot represent non-integer value: ${(0,v.N)(t)}`);if(a>eJ||a<eQ)throw new g.eO("Int cannot represent non 32-bit signed integer value: "+(0,v.N)(t));return a},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new g.eO(`Int cannot represent non-integer value: ${(0,v.N)(e)}`);if(e>eJ||e<eQ)throw new g.eO(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==I.b.INT)throw new g.eO(`Int cannot represent non-integer value: ${(0,$.y)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>eJ||t<eQ)throw new g.eO(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),eH=new eF({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=e0(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isFinite(a))throw new g.eO(`Float cannot represent non numeric value: ${(0,v.N)(t)}`);return a},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new g.eO(`Float cannot represent non numeric value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==I.b.FLOAT&&e.kind!==I.b.INT)throw new g.eO(`Float cannot represent non numeric value: ${(0,$.y)(e)}`,e);return parseFloat(e.value)}}),eK=new eF({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=e0(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new g.eO(`String cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"!=typeof e)throw new g.eO(`String cannot represent a non string value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==I.b.STRING)throw new g.eO(`String cannot represent a non string value: ${(0,$.y)(e)}`,{nodes:e});return e.value}}),eX=new eF({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=e0(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new g.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new g.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==I.b.BOOLEAN)throw new g.eO(`Boolean cannot represent a non boolean value: ${(0,$.y)(e)}`,{nodes:e});return e.value}}),eZ=new eF({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=e0(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new g.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new g.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseLiteral(e){if(e.kind!==I.b.STRING&&e.kind!==I.b.INT)throw new g.eO("ID cannot represent a non-string and non-integer value: "+(0,$.y)(e),{nodes:e});return e.value}}),e1=Object.freeze([eK,eW,eH,eX,eZ]);function e2(e){return e1.some(({name:t})=>e.name===t)}function e0(e){if((0,w.Z)(e)){if("function"==typeof e.valueOf){let t=e.valueOf();if(!(0,w.Z)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function e6(e){return(0,x.h)(e,e3)}function e4(e){if(!e6(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL directive.`);return e}class e3{constructor(e){var t,a;this.name=R(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.extensions=O(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,m.U)(!1,`@${e.name} locations must be an Array.`);let i=null!=(a=e.args)?a:{};(0,w.Z)(i)&&!Array.isArray(i)||(0,m.U)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=eT(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:eO(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}let e8=new e3({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[eY.H.FIELD,eY.H.FRAGMENT_SPREAD,eY.H.INLINE_FRAGMENT],args:{if:{type:new ef(eX),description:"Included when true."}}}),e5=new e3({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[eY.H.FIELD,eY.H.FRAGMENT_SPREAD,eY.H.INLINE_FRAGMENT],args:{if:{type:new ef(eX),description:"Skipped when true."}}}),e9="No longer supported",e7=new e3({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[eY.H.FIELD_DEFINITION,eY.H.ARGUMENT_DEFINITION,eY.H.INPUT_FIELD_DEFINITION,eY.H.ENUM_VALUE],args:{reason:{type:eK,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:e9}}}),te=new e3({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[eY.H.SCALAR],args:{url:{type:new ef(eK),description:"The URL that specifies the behavior of this scalar."}}}),tt=new e3({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[eY.H.INPUT_OBJECT],args:{}}),ta=Object.freeze([e8,e5,e7,te,tt]);function ti(e){return ta.some(({name:t})=>t===e.name)}var tn=a(71306);function tr(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function to(e,t){if(et(t)){let a=to(e,t.ofType);return(null==a?void 0:a.kind)===I.b.NULL?null:a}if(null===e)return{kind:I.b.NULL};if(void 0===e)return null;if(Z(t)){let a=t.ofType;if(tr(e)){let t=[];for(let i of e){let e=to(i,a);null!=e&&t.push(e)}return{kind:I.b.LIST,values:t}}return to(e,a)}if(K(t)){if(!(0,w.Z)(e))return null;let a=[];for(let i of Object.values(t.getFields())){let t=to(e[i.name],i.type);t&&a.push({kind:I.b.OBJECT_FIELD,name:{kind:I.b.NAME,value:i.name},value:t})}return{kind:I.b.OBJECT,fields:a}}if(es(t)){let a=t.serialize(e);if(null==a)return null;if("boolean"==typeof a)return{kind:I.b.BOOLEAN,value:a};if("number"==typeof a&&Number.isFinite(a)){let e=String(a);return ts.test(e)?{kind:I.b.INT,value:e}:{kind:I.b.FLOAT,value:e}}if("string"==typeof a)return W(t)?{kind:I.b.ENUM,value:a}:t===eZ&&ts.test(a)?{kind:I.b.INT,value:a}:{kind:I.b.STRING,value:a};throw TypeError(`Cannot convert value to AST: ${(0,v.N)(a)}.`)}(0,tn.V)(!1,"Unexpected input type: "+(0,v.N)(t))}let ts=/^-?(?:0|[1-9][0-9]*)$/,tp=new eA({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:eK,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ef(new em(new ef(tu))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new ef(tu),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:tu,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:tu,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ef(new em(new ef(tl))),resolve:e=>e.getDirectives()}})}),tl=new eA({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},isRepeatable:{type:new ef(eX),resolve:e=>e.isRepeatable},locations:{type:new ef(new em(new ef(td))),resolve:e=>e.locations},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),td=new eR({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:eY.H.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:eY.H.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:eY.H.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:eY.H.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:eY.H.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:eY.H.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:eY.H.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:eY.H.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:eY.H.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:eY.H.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:eY.H.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:eY.H.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:eY.H.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:eY.H.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:eY.H.UNION,description:"Location adjacent to a union definition."},ENUM:{value:eY.H.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:eY.H.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:eY.H.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:eY.H.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),tu=new eA({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new ef(th),resolve:e=>M(e)?d.SCALAR:q(e)?d.OBJECT:z(e)?d.INTERFACE:J(e)?d.UNION:W(e)?d.ENUM:K(e)?d.INPUT_OBJECT:Z(e)?d.LIST:et(e)?d.NON_NULL:void(0,tn.V)(!1,`Unexpected type: "${(0,v.N)(e)}".`)},name:{type:eK,resolve:e=>"name"in e?e.name:void 0},description:{type:eK,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:eK,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new em(new ef(tc)),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(q(e)||z(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new em(new ef(tu)),resolve(e){if(q(e)||z(e))return e.getInterfaces()}},possibleTypes:{type:new em(new ef(tu)),resolve(e,t,a,{schema:i}){if(eu(e))return i.getPossibleTypes(e)}},enumValues:{type:new em(new ef(tf)),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(W(e)){let a=e.getValues();return t?a:a.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new em(new ef(tm)),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(K(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},ofType:{type:tu,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:eX,resolve:e=>{if(K(e))return e.isOneOf}}})}),tc=new eA({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new ef(tu),resolve:e=>e.type},isDeprecated:{type:new ef(eX),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eK,resolve:e=>e.deprecationReason}})}),tm=new eA({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},type:{type:new ef(tu),resolve:e=>e.type},defaultValue:{type:eK,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:a}=e,i=to(a,t);return i?(0,$.y)(i):null}},isDeprecated:{type:new ef(eX),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eK,resolve:e=>e.deprecationReason}})}),tf=new eA({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},isDeprecated:{type:new ef(eX),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eK,resolve:e=>e.deprecationReason}})});(o=d||(d={})).SCALAR="SCALAR",o.OBJECT="OBJECT",o.INTERFACE="INTERFACE",o.UNION="UNION",o.ENUM="ENUM",o.INPUT_OBJECT="INPUT_OBJECT",o.LIST="LIST",o.NON_NULL="NON_NULL";let th=new eR({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:d.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:d.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:d.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:d.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:d.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:d.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:d.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:d.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),tv={name:"__schema",type:new ef(tp),description:"Access the current type schema of this server.",args:[],resolve:(e,t,a,{schema:i})=>i,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tg={name:"__type",type:tu,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new ef(eK),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},a,{schema:i})=>i.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ty={name:"__typename",type:new ef(eK),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,a,{parentType:i})=>i.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tb=Object.freeze([tp,tl,td,tu,tc,tm,tf,th]);function tD(e){return tb.some(({name:t})=>e.name===t)}function tx(e){return(0,x.h)(e,t_)}function tw(e){if(!tx(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL schema.`);return e}class t_{constructor(e){var t,a;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,w.Z)(e)||(0,m.U)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,m.U)(!1,`"types" must be Array if provided but got: ${(0,v.N)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,m.U)(!1,`"directives" must be Array if provided but got: ${(0,v.N)(e.directives)}.`),this.description=e.description,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(a=e.directives)?a:ta;let i=new Set(e.types);if(null!=e.types)for(let t of e.types)i.delete(t),tE(t,i);for(let e of(null!=this._queryType&&tE(this._queryType,i),null!=this._mutationType&&tE(this._mutationType,i),null!=this._subscriptionType&&tE(this._subscriptionType,i),this._directives))if(e6(e))for(let t of e.args)tE(t.type,i);for(let e of(tE(tp,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null),i)){if(null==e)continue;let t=e.name;if(t||(0,m.U)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,z(e)){for(let t of e.getInterfaces())if(z(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.interfaces.push(e)}}else if(q(e)){for(let t of e.getInterfaces())if(z(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.objects.push(e)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case y.cE.QUERY:return this.getQueryType();case y.cE.MUTATION:return this.getMutationType();case y.cE.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return J(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){let t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let a=this._subTypeMap[e.name];if(void 0===a){if(a=Object.create(null),J(e))for(let t of e.getTypes())a[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)a[e.name]=!0;for(let e of t.interfaces)a[e.name]=!0}this._subTypeMap[e.name]=a}return void 0!==a[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function tE(e,t){let a=ew(e);if(!t.has(a)){if(t.add(a),J(a))for(let e of a.getTypes())tE(e,t);else if(q(a)||z(a)){for(let e of a.getInterfaces())tE(e,t);for(let e of Object.values(a.getFields()))for(let a of(tE(e.type,t),e.args))tE(a.type,t)}else if(K(a))for(let e of Object.values(a.getFields()))tE(e.type,t)}return t}function tF(e){var t,a,i,n;let r,o,s,p;if(tw(e),e.__validationErrors)return e.__validationErrors;let l=new tC(e);(o=(r=(t=l).schema).getQueryType())?q(o)||t.reportError(`Query root type must be Object type, it cannot be ${(0,v.N)(o)}.`,null!=(a=tS(r,y.cE.QUERY))?a:o.astNode):t.reportError("Query root type must be provided.",r.astNode),(s=r.getMutationType())&&!q(s)&&t.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,v.N)(s)}.`,null!=(i=tS(r,y.cE.MUTATION))?i:s.astNode),(p=r.getSubscriptionType())&&!q(p)&&t.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,v.N)(p)}.`,null!=(n=tS(r,y.cE.SUBSCRIPTION))?n:p.astNode),function(e){for(let a of e.schema.getDirectives()){if(!e6(a)){e.reportError(`Expected directive but got: ${(0,v.N)(a)}.`,null==a?void 0:a.astNode);continue}for(let i of(tT(e,a),0===a.locations.length&&e.reportError(`Directive @${a.name} must include 1 or more locations.`,a.astNode),a.args))if(tT(e,i),ei(i.type)||e.reportError(`The type of @${a.name}(${i.name}:) must be Input Type but got: ${(0,v.N)(i.type)}.`,i.astNode),eI(i)&&null!=i.deprecationReason){var t;e.reportError(`Required argument @${a.name}(${i.name}:) cannot be deprecated.`,[tO(i.astNode),null==(t=i.astNode)?void 0:t.type])}}}(l),function(e){var t;let a,i,n,r=(t=e,a=Object.create(null),i=[],n=Object.create(null),function e(r){if(!a[r.name]){for(let o of(a[r.name]=!0,n[r.name]=i.length,Object.values(r.getFields())))if(et(o.type)&&K(o.type.ofType)){let a=o.type.ofType,r=n[a.name];if(i.push(o),void 0===r)e(a);else{let e=i.slice(r),n=e.map(e=>e.name).join(".");t.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${n}".`,e.map(e=>e.astNode))}i.pop()}n[r.name]=void 0}});for(let t of Object.values(e.schema.getTypeMap())){if(!eD(t)){e.reportError(`Expected GraphQL named type but got: ${(0,v.N)(t)}.`,t.astNode);continue}tD(t)||tT(e,t),q(t)||z(t)?(function(e,t){let a=Object.values(t.getFields());for(let o of(0===a.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var i,n,r;for(let a of(tT(e,o),er(o.type)||e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${(0,v.N)(o.type)}.`,null==(i=o.astNode)?void 0:i.type),o.args)){let i=a.name;tT(e,a),ei(a.type)||e.reportError(`The type of ${t.name}.${o.name}(${i}:) must be Input Type but got: ${(0,v.N)(a.type)}.`,null==(n=a.astNode)?void 0:n.type),eI(a)&&null!=a.deprecationReason&&e.reportError(`Required argument ${t.name}.${o.name}(${i}:) cannot be deprecated.`,[tO(a.astNode),null==(r=a.astNode)?void 0:r.type])}}}(e,t),function(e,t){let a=Object.create(null);for(let i of t.getInterfaces()){if(!z(i)){e.reportError(`Type ${(0,v.N)(t)} must only implement Interface types, it cannot implement ${(0,v.N)(i)}.`,tk(t,i));continue}if(t===i){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,tk(t,i));continue}if(a[i.name]){e.reportError(`Type ${t.name} can only implement ${i.name} once.`,tk(t,i));continue}a[i.name]=!0,function(e,t,a){let i=t.getInterfaces();for(let n of a.getInterfaces())i.includes(n)||e.reportError(n===t?`Type ${t.name} cannot implement ${a.name} because it would create a circular reference.`:`Type ${t.name} must implement ${n.name} because it is implemented by ${a.name}.`,[...tk(a,n),...tk(t,a)])}(e,t,i),function(e,t,a){let i=t.getFields();for(let p of Object.values(a.getFields())){var n,r,o,s;let l=p.name,d=i[l];if(!d){e.reportError(`Interface field ${a.name}.${l} expected but ${t.name} does not provide it.`,[p.astNode,t.astNode,...t.extensionASTNodes]);continue}for(let i of(eG(e.schema,d.type,p.type)||e.reportError(`Interface field ${a.name}.${l} expects type ${(0,v.N)(p.type)} but ${t.name}.${l} is type ${(0,v.N)(d.type)}.`,[null==(n=p.astNode)?void 0:n.type,null==(r=d.astNode)?void 0:r.type]),p.args)){let n=i.name,r=d.args.find(e=>e.name===n);if(!r){e.reportError(`Interface field argument ${a.name}.${l}(${n}:) expected but ${t.name}.${l} does not provide it.`,[i.astNode,d.astNode]);continue}eq(i.type,r.type)||e.reportError(`Interface field argument ${a.name}.${l}(${n}:) expects type ${(0,v.N)(i.type)} but ${t.name}.${l}(${n}:) is type ${(0,v.N)(r.type)}.`,[null==(o=i.astNode)?void 0:o.type,null==(s=r.astNode)?void 0:s.type])}for(let i of d.args){let n=i.name;!p.args.find(e=>e.name===n)&&eI(i)&&e.reportError(`Object field ${t.name}.${l} includes required argument ${n} that is missing from the Interface field ${a.name}.${l}.`,[i.astNode,p.astNode])}}}(e,t,i)}}(e,t)):J(t)?function(e,t){let a=t.getTypes();0===a.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let i=Object.create(null);for(let n of a){if(i[n.name]){e.reportError(`Union type ${t.name} can only include type ${n.name} once.`,tN(t,n.name));continue}i[n.name]=!0,q(n)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,v.N)(n)}.`,tN(t,String(n)))}}(e,t):W(t)?function(e,t){let a=t.getValues();for(let i of(0===a.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]),a))tT(e,i)}(e,t):K(t)&&(function(e,t){let a=Object.values(t.getFields());for(let r of(0===a.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var i,n;tT(e,r),ei(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${(0,v.N)(r.type)}.`,null==(i=r.astNode)?void 0:i.type),eU(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[tO(r.astNode),null==(n=r.astNode)?void 0:n.type]),t.isOneOf&&function(e,t,a){if(et(t.type)){var i;a.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(i=t.astNode)?void 0:i.type)}void 0!==t.defaultValue&&a.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}(t,r,e)}}(e,t),r(t))}}(l);let d=l.getErrors();return e.__validationErrors=d,d}function tA(e){let t=tF(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))}class tC{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let a=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new g.eO(e,{nodes:a}))}getErrors(){return this._errors}}function tS(e,t){var a;return null==(a=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.operationTypes)?t:[]}).find(e=>e.operation===t))?void 0:a.type}function tT(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function tk(e,t){let{astNode:a,extensionASTNodes:i}=e;return(null!=a?[a,...i]:i).flatMap(e=>{var t;return null!=(t=e.interfaces)?t:[]}).filter(e=>e.name.value===t.name)}function tN(e,t){let{astNode:a,extensionASTNodes:i}=e;return(null!=a?[a,...i]:i).flatMap(e=>{var t;return null!=(t=e.types)?t:[]}).filter(e=>e.name.value===t)}function tO(e){var t;return null==e||null==(t=e.directives)?void 0:t.find(e=>e.name.value===e7.name)}var tI=a(90424);function t$(e,t){switch(t.kind){case I.b.LIST_TYPE:{let a=t$(e,t.type);return a&&new em(a)}case I.b.NON_NULL_TYPE:{let a=t$(e,t.type);return a&&new ef(a)}case I.b.NAMED_TYPE:return e.getType(t.name.value)}}class tj{constructor(e,t,a){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=a?a:tB,t&&(ei(t)&&this._inputTypeStack.push(t),el(t)&&this._parentTypeStack.push(t),er(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case I.b.SELECTION_SET:{let e=ew(this.getType());this._parentTypeStack.push(el(e)?e:void 0);break}case I.b.FIELD:{let a,i,n=this.getParentType();n&&(a=this._getFieldDef(t,n,e))&&(i=a.type),this._fieldDefStack.push(a),this._typeStack.push(er(i)?i:void 0);break}case I.b.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case I.b.OPERATION_DEFINITION:{let a=t.getRootType(e.operation);this._typeStack.push(q(a)?a:void 0);break}case I.b.INLINE_FRAGMENT:case I.b.FRAGMENT_DEFINITION:{let a=e.typeCondition,i=a?t$(t,a):ew(this.getType());this._typeStack.push(er(i)?i:void 0);break}case I.b.VARIABLE_DEFINITION:{let a=t$(t,e.type);this._inputTypeStack.push(ei(a)?a:void 0);break}case I.b.ARGUMENT:{var a;let t,i,n=null!=(a=this.getDirective())?a:this.getFieldDef();n&&(t=n.args.find(t=>t.name===e.name.value))&&(i=t.type),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(ei(i)?i:void 0);break}case I.b.LIST:{let e=eb(this.getInputType()),t=Z(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ei(t)?t:void 0);break}case I.b.OBJECT_FIELD:{let t,a,i=ew(this.getInputType());K(i)&&(a=i.getFields()[e.name.value])&&(t=a.type),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(ei(t)?t:void 0);break}case I.b.ENUM:{let t,a=ew(this.getInputType());W(a)&&(t=a.getValue(e.value)),this._enumValue=t}}}leave(e){switch(e.kind){case I.b.SELECTION_SET:this._parentTypeStack.pop();break;case I.b.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case I.b.DIRECTIVE:this._directive=null;break;case I.b.OPERATION_DEFINITION:case I.b.INLINE_FRAGMENT:case I.b.FRAGMENT_DEFINITION:this._typeStack.pop();break;case I.b.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case I.b.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case I.b.LIST:case I.b.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case I.b.ENUM:this._enumValue=null}}}function tB(e,t,a){let i=a.name.value;return i===tv.name&&e.getQueryType()===t?tv:i===tg.name&&e.getQueryType()===t?tg:i===ty.name&&el(t)?ty:q(t)||z(t)?t.getFields()[i]:void 0}function tR(e,t){return{enter(...a){let i=a[0];e.enter(i);let n=(0,tI.XO)(t,i.kind).enter;if(n){let r=n.apply(t,a);return void 0!==r&&(e.leave(i),(0,y.Ll)(r)&&e.enter(r)),r}},leave(...a){let i,n=a[0],r=(0,tI.XO)(t,n.kind).leave;return r&&(i=r.apply(t,a)),e.leave(n),i}}}var tV=a(3420);function tP(e){return{Document(t){for(let a of t.definitions)if(!(0,tV._m)(a)){let t=a.kind===I.b.SCHEMA_DEFINITION||a.kind===I.b.SCHEMA_EXTENSION?"schema":'"'+a.name.value+'"';e.reportError(new g.eO(`The ${t} definition is not executable.`,{nodes:a}))}return!1}}}function tL(e){return{Field(t){let a=e.getParentType();if(a&&!e.getFieldDef()){var i,n;let r=e.getSchema(),o=t.name.value,s=b("to use an inline fragment on",function(e,t,a){if(!eu(t))return[];let i=new Set,n=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[a])for(let e of(i.add(o),n[o.name]=1,o.getInterfaces())){var r;e.getFields()[a]&&(i.add(e),n[e.name]=(null!=(r=n[e.name])?r:0)+1)}return[...i].sort((t,a)=>{let i=n[a.name]-n[t.name];return 0!==i?i:z(t)&&e.isSubType(t,a)?-1:z(a)&&e.isSubType(a,t)?1:A(t.name,a.name)}).map(e=>e.name)}(r,a,o));""===s&&(s=b((i=a,n=o,q(i)||z(i)?T(n,Object.keys(i.getFields())):[]))),e.reportError(new g.eO(`Cannot query field "${o}" on type "${a.name}".`+s,{nodes:t}))}}}}function tM(e){return{InlineFragment(t){let a=t.typeCondition;if(a){let t=t$(e.getSchema(),a);if(t&&!el(t)){let t=(0,$.y)(a);e.reportError(new g.eO(`Fragment cannot condition on non composite type "${t}".`,{nodes:a}))}}},FragmentDefinition(t){let a=t$(e.getSchema(),t.typeCondition);if(a&&!el(a)){let a=(0,$.y)(t.typeCondition);e.reportError(new g.eO(`Fragment "${t.name.value}" cannot condition on non composite type "${a}".`,{nodes:t.typeCondition}))}}}}function tU(e){return{...tq(e),Argument(t){let a=e.getArgument(),i=e.getFieldDef(),n=e.getParentType();if(!a&&i&&n){let a=t.name.value,r=T(a,i.args.map(e=>e.name));e.reportError(new g.eO(`Unknown argument "${a}" on field "${n.name}.${i.name}".`+b(r),{nodes:t}))}}}}function tq(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.args.map(e=>e.name);for(let a of e.getDocument().definitions)if(a.kind===I.b.DIRECTIVE_DEFINITION){var i;let e=null!=(i=a.arguments)?i:[];t[a.name.value]=e.map(e=>e.name.value)}return{Directive(a){let i=a.name.value,n=t[i];if(a.arguments&&n)for(let t of a.arguments){let a=t.name.value;if(!n.includes(a)){let r=T(a,n);e.reportError(new g.eO(`Unknown argument "${a}" on directive "@${i}".`+b(r),{nodes:t}))}}return!1}}}function tG(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.locations;for(let a of e.getDocument().definitions)a.kind===I.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=a.locations.map(e=>e.value));return{Directive(a,i,n,r,o){let s=a.name.value,p=t[s];if(!p)return void e.reportError(new g.eO(`Unknown directive "@${s}".`,{nodes:a}));let l=function(e){let t=e[e.length-1];switch("kind"in t||(0,tn.V)(!1),t.kind){case I.b.OPERATION_DEFINITION:var a=t.operation;switch(a){case y.cE.QUERY:return eY.H.QUERY;case y.cE.MUTATION:return eY.H.MUTATION;case y.cE.SUBSCRIPTION:return eY.H.SUBSCRIPTION}return;case I.b.FIELD:return eY.H.FIELD;case I.b.FRAGMENT_SPREAD:return eY.H.FRAGMENT_SPREAD;case I.b.INLINE_FRAGMENT:return eY.H.INLINE_FRAGMENT;case I.b.FRAGMENT_DEFINITION:return eY.H.FRAGMENT_DEFINITION;case I.b.VARIABLE_DEFINITION:return eY.H.VARIABLE_DEFINITION;case I.b.SCHEMA_DEFINITION:case I.b.SCHEMA_EXTENSION:return eY.H.SCHEMA;case I.b.SCALAR_TYPE_DEFINITION:case I.b.SCALAR_TYPE_EXTENSION:return eY.H.SCALAR;case I.b.OBJECT_TYPE_DEFINITION:case I.b.OBJECT_TYPE_EXTENSION:return eY.H.OBJECT;case I.b.FIELD_DEFINITION:return eY.H.FIELD_DEFINITION;case I.b.INTERFACE_TYPE_DEFINITION:case I.b.INTERFACE_TYPE_EXTENSION:return eY.H.INTERFACE;case I.b.UNION_TYPE_DEFINITION:case I.b.UNION_TYPE_EXTENSION:return eY.H.UNION;case I.b.ENUM_TYPE_DEFINITION:case I.b.ENUM_TYPE_EXTENSION:return eY.H.ENUM;case I.b.ENUM_VALUE_DEFINITION:return eY.H.ENUM_VALUE;case I.b.INPUT_OBJECT_TYPE_DEFINITION:case I.b.INPUT_OBJECT_TYPE_EXTENSION:return eY.H.INPUT_OBJECT;case I.b.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return"kind"in t||(0,tn.V)(!1),t.kind===I.b.INPUT_OBJECT_TYPE_DEFINITION?eY.H.INPUT_FIELD_DEFINITION:eY.H.ARGUMENT_DEFINITION}default:(0,tn.V)(!1,"Unexpected kind: "+(0,v.N)(t.kind))}}(o);l&&!p.includes(l)&&e.reportError(new g.eO(`Directive "@${s}" may not be used on ${l}.`,{nodes:a}))}}}function tz(e){return{FragmentSpread(t){let a=t.name.value;e.getFragment(a)||e.reportError(new g.eO(`Unknown fragment "${a}".`,{nodes:t.name}))}}}function tY(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),i=Object.create(null);for(let t of e.getDocument().definitions)(0,tV.a6)(t)&&(i[t.name.value]=!0);let n=[...Object.keys(a),...Object.keys(i)];return{NamedType(t,r,o,s,p){let l=t.name.value;if(!a[l]&&!i[l]){var d,u;let a=null!=(d=p[2])?d:o,i=null!=a&&"kind"in(u=a)&&((0,tV.xu)(u)||(0,tV.fT)(u));if(i&&tJ.includes(l))return;let r=T(l,i?tJ.concat(n):n);e.reportError(new g.eO(`Unknown type "${l}".`+b(r),{nodes:t}))}}}}let tJ=[...e1,...tb].map(e=>e.name);function tQ(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===I.b.OPERATION_DEFINITION).length},OperationDefinition(a){!a.name&&t>1&&e.reportError(new g.eO("This anonymous operation must be the only defined operation.",{nodes:a}))}}}function tW(e){var t,a,i;let n=e.getSchema(),r=null!=(t=null!=(a=null!=(i=null==n?void 0:n.astNode)?i:null==n?void 0:n.getQueryType())?a:null==n?void 0:n.getMutationType())?t:null==n?void 0:n.getSubscriptionType(),o=0;return{SchemaDefinition(t){r?e.reportError(new g.eO("Cannot define a new schema within a schema extension.",{nodes:t})):(o>0&&e.reportError(new g.eO("Must provide only one schema definition.",{nodes:t})),++o)}}}function tH(e){return{Field(t){if(("__schema"===t.name.value||"__type"===t.name.value)&&function t(a,i=Object.create(null),n=0){if(a.kind===I.b.FRAGMENT_SPREAD){let r=a.name.value;if(!0===i[r])return!1;let o=e.getFragment(r);if(!o)return!1;try{return i[r]=!0,t(o,i,n)}finally{i[r]=void 0}}if(a.kind===I.b.FIELD&&("fields"===a.name.value||"interfaces"===a.name.value||"possibleTypes"===a.name.value||"inputFields"===a.name.value)&&++n>=3)return!0;if("selectionSet"in a&&a.selectionSet){for(let e of a.selectionSet.selections)if(t(e,i,n))return!0}return!1}(t))return e.reportError(new g.eO("Maximum introspection depth exceeded",{nodes:[t]})),!1}}}function tK(e){let t=Object.create(null),a=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:n=>((function n(r){if(t[r.name.value])return;let o=r.name.value;t[o]=!0;let s=e.getFragmentSpreads(r.selectionSet);if(0!==s.length){for(let t of(i[o]=a.length,s)){let r=t.name.value,o=i[r];if(a.push(t),void 0===o){let t=e.getFragment(r);t&&n(t)}else{let t=a.slice(o),i=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new g.eO(`Cannot spread fragment "${r}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:t}))}a.pop()}i[o]=void 0}})(n),!1)}}function tX(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:i}of e.getRecursiveVariableUsages(a)){let n=i.name.value;!0!==t[n]&&e.reportError(new g.eO(a.name?`Variable "$${n}" is not defined by operation "${a.name.value}".`:`Variable "$${n}" is not defined.`,{nodes:[i,a]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function tZ(e){let t=[],a=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(a.push(e),!1),Document:{leave(){let i=Object.create(null);for(let a of t)for(let t of e.getRecursivelyReferencedFragments(a))i[t.name.value]=!0;for(let t of a){let a=t.name.value;!0!==i[a]&&e.reportError(new g.eO(`Fragment "${a}" is never used.`,{nodes:t}))}}}}}function t1(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(a){let i=Object.create(null);for(let{node:t}of e.getRecursiveVariableUsages(a))i[t.name.value]=!0;for(let n of t){let t=n.variable.name.value;!0!==i[t]&&e.reportError(new g.eO(a.name?`Variable "$${t}" is never used in operation "${a.name.value}".`:`Variable "$${t}" is never used.`,{nodes:n}))}}},VariableDefinition(e){t.push(e)}}}function t2(e){switch(e.kind){case I.b.OBJECT:return{...e,fields:e.fields.map(e=>({...e,value:t2(e.value)})).sort((e,t)=>A(e.name.value,t.name.value))};case I.b.LIST:return{...e,values:e.values.map(t2)};case I.b.INT:case I.b.FLOAT:case I.b.STRING:case I.b.BOOLEAN:case I.b.NULL:case I.b.ENUM:case I.b.VARIABLE:return e}}function t0(e){let t=new t7,a=new ae,i=new Map;return{SelectionSet(n){for(let[[r,o],s,p]of function(e,t,a,i,n,r){let o=[],[s,p]=t5(e,t,n,r);if(function(e,t,a,i,n,r){for(let[o,s]of Object.entries(r))if(s.length>1)for(let r=0;r<s.length;r++)for(let p=r+1;p<s.length;p++){let l=t8(e,a,i,n,!1,o,s[r],s[p]);l&&t.push(l)}}(e,o,t,a,i,s),0!==p.length)for(let n=0;n<p.length;n++){t6(e,o,t,a,i,!1,s,p[n]);for(let r=n+1;r<p.length;r++)t4(e,o,t,a,i,!1,p[n],p[r])}return o}(e,i,t,a,e.getParentType(),n)){let t=function e(t){return Array.isArray(t)?t.map(([t,a])=>`subfields "${t}" conflict because `+e(a)).join(" and "):t}(o);e.reportError(new g.eO(`Fields "${r}" conflict because ${t}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:s.concat(p)}))}}}}function t6(e,t,a,i,n,r,o,s){if(i.has(o,s,r))return;i.add(o,s,r);let p=e.getFragment(s);if(!p)return;let[l,d]=t9(e,a,p);if(o!==l)for(let s of(t3(e,t,a,i,n,r,o,l),d))t6(e,t,a,i,n,r,o,s)}function t4(e,t,a,i,n,r,o,s){if(o===s||n.has(o,s,r))return;n.add(o,s,r);let p=e.getFragment(o),l=e.getFragment(s);if(!p||!l)return;let[d,u]=t9(e,a,p),[c,m]=t9(e,a,l);for(let s of(t3(e,t,a,i,n,r,d,c),m))t4(e,t,a,i,n,r,o,s);for(let o of u)t4(e,t,a,i,n,r,o,s)}function t3(e,t,a,i,n,r,o,s){for(let[p,l]of Object.entries(o)){let o=s[p];if(o)for(let s of l)for(let l of o){let o=t8(e,a,i,n,r,p,s,l);o&&t.push(o)}}}function t8(e,t,a,i,n,r,o,s){let[p,l,d]=o,[u,c,m]=s,f=n||p!==u&&q(p)&&q(u);if(!f){let e=l.name.value,t=c.name.value;if(e!==t)return[[r,`"${e}" and "${t}" are different fields`],[l],[c]];if(!function(e,t){let a=e.arguments,i=t.arguments;if(void 0===a||0===a.length)return void 0===i||0===i.length;if(void 0===i||0===i.length||a.length!==i.length)return!1;let n=new Map(i.map(({name:e,value:t})=>[e.value,t]));return a.every(e=>{let t=e.value,a=n.get(e.name.value);return void 0!==a&&function(e){return(0,$.y)(t2(e))}(t)===function(e){return(0,$.y)(t2(e))}(a)})}(l,c))return[[r,"they have differing arguments"],[l],[c]]}let h=null==d?void 0:d.type,g=null==m?void 0:m.type;if(h&&g&&function e(t,a){return Z(t)?!Z(a)||e(t.ofType,a.ofType):!!Z(a)||(et(t)?!et(a)||e(t.ofType,a.ofType):!!et(a)||!!(es(t)||es(a))&&t!==a)}(h,g))return[[r,`they return conflicting types "${(0,v.N)(h)}" and "${(0,v.N)(g)}"`],[l],[c]];let y=l.selectionSet,b=c.selectionSet;if(y&&b){var D=function(e,t,a,i,n,r,o,s,p){let l=[],[d,u]=t5(e,t,r,o),[c,m]=t5(e,t,s,p);for(let r of(t3(e,l,t,a,i,n,d,c),m))t6(e,l,t,a,i,n,d,r);for(let r of u)t6(e,l,t,a,i,n,c,r);for(let r of u)for(let o of m)t4(e,l,t,a,i,n,r,o);return l}(e,t,a,i,f,ew(h),y,ew(g),b),x=r,w=l,_=c;return D.length>0?[[x,D.map(([e])=>e)],[w,...D.map(([,e])=>e).flat()],[_,...D.map(([,,e])=>e).flat()]]:void 0}}function t5(e,t,a,i){let n=t.get(i);if(n)return n;let r=Object.create(null),o=Object.create(null);!function e(t,a,i,n,r){for(let o of i.selections)switch(o.kind){case I.b.FIELD:{let e,t=o.name.value;(q(a)||z(a))&&(e=a.getFields()[t]);let i=o.alias?o.alias.value:t;n[i]||(n[i]=[]),n[i].push([a,o,e]);break}case I.b.FRAGMENT_SPREAD:r[o.name.value]=!0;break;case I.b.INLINE_FRAGMENT:{let i=o.typeCondition,s=i?t$(t.getSchema(),i):a;e(t,s,o.selectionSet,n,r)}}}(e,a,i,r,o);let s=[r,Object.keys(o)];return t.set(i,s),s}function t9(e,t,a){let i=t.get(a.selectionSet);if(i)return i;let n=t$(e.getSchema(),a.typeCondition);return t5(e,t,n,a.selectionSet)}class t7{constructor(){this._data=new Map}has(e,t,a){var i;let n=null==(i=this._data.get(e))?void 0:i.get(t);return void 0!==n&&(!!a||a===n)}add(e,t,a){let i=this._data.get(e);void 0===i?this._data.set(e,new Map([[t,a]])):i.set(t,a)}}class ae{constructor(){this._orderedPairSet=new t7}has(e,t,a){return e<t?this._orderedPairSet.has(e,t,a):this._orderedPairSet.has(t,e,a)}add(e,t,a){e<t?this._orderedPairSet.add(e,t,a):this._orderedPairSet.add(t,e,a)}}function at(e){return{InlineFragment(t){let a=e.getType(),i=e.getParentType();if(el(a)&&el(i)&&!ez(e.getSchema(),a,i)){let n=(0,v.N)(i),r=(0,v.N)(a);e.reportError(new g.eO(`Fragment cannot be spread here as objects of type "${n}" can never be of type "${r}".`,{nodes:t}))}},FragmentSpread(t){let a=t.name.value,i=function(e,t){let a=e.getFragment(t);if(a){let t=t$(e.getSchema(),a.typeCondition);if(el(t))return t}}(e,a),n=e.getParentType();if(i&&n&&!ez(e.getSchema(),i,n)){let r=(0,v.N)(n),o=(0,v.N)(i);e.reportError(new g.eO(`Fragment "${a}" cannot be spread here as objects of type "${r}" can never be of type "${o}".`,{nodes:t}))}}}}function aa(e){let t=e.getSchema(),a=Object.create(null);for(let t of e.getDocument().definitions)(0,tV.a6)(t)&&(a[t.name.value]=t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){var n;let r,o=i.name.value,s=a[o],p=null==t?void 0:t.getType(o);if(s?r=ai[s.kind]:p&&(r=M(n=p)?I.b.SCALAR_TYPE_EXTENSION:q(n)?I.b.OBJECT_TYPE_EXTENSION:z(n)?I.b.INTERFACE_TYPE_EXTENSION:J(n)?I.b.UNION_TYPE_EXTENSION:W(n)?I.b.ENUM_TYPE_EXTENSION:K(n)?I.b.INPUT_OBJECT_TYPE_EXTENSION:void(0,tn.V)(!1,"Unexpected type: "+(0,v.N)(n))),r){if(r!==i.kind){let t=function(e){switch(e){case I.b.SCALAR_TYPE_EXTENSION:return"scalar";case I.b.OBJECT_TYPE_EXTENSION:return"object";case I.b.INTERFACE_TYPE_EXTENSION:return"interface";case I.b.UNION_TYPE_EXTENSION:return"union";case I.b.ENUM_TYPE_EXTENSION:return"enum";case I.b.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,tn.V)(!1,"Unexpected kind: "+(0,v.N)(e))}}(i.kind);e.reportError(new g.eO(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{let n=T(o,Object.keys({...a,...null==t?void 0:t.getTypeMap()}));e.reportError(new g.eO(`Cannot extend type "${o}" because it is not defined.`+b(n),{nodes:i.name}))}}}let ai={[I.b.SCALAR_TYPE_DEFINITION]:I.b.SCALAR_TYPE_EXTENSION,[I.b.OBJECT_TYPE_DEFINITION]:I.b.OBJECT_TYPE_EXTENSION,[I.b.INTERFACE_TYPE_DEFINITION]:I.b.INTERFACE_TYPE_EXTENSION,[I.b.UNION_TYPE_DEFINITION]:I.b.UNION_TYPE_EXTENSION,[I.b.ENUM_TYPE_DEFINITION]:I.b.ENUM_TYPE_EXTENSION,[I.b.INPUT_OBJECT_TYPE_DEFINITION]:I.b.INPUT_OBJECT_TYPE_EXTENSION};function an(e){return{...ar(e),Field:{leave(t){var a;let i=e.getFieldDef();if(!i)return!1;let n=new Set(null==(a=t.arguments)?void 0:a.map(e=>e.name.value));for(let a of i.args)if(!n.has(a.name)&&eI(a)){let n=(0,v.N)(a.type);e.reportError(new g.eO(`Field "${i.name}" argument "${a.name}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}}function ar(e){var t,a;let i=Object.create(null),n=e.getSchema();for(let e of null!=(t=null==n?void 0:n.getDirectives())?t:ta)i[e.name]=_(e.args.filter(eI),e=>e.name);for(let t of e.getDocument().definitions)if(t.kind===I.b.DIRECTIVE_DEFINITION){let e=null!=(a=t.arguments)?a:[];i[t.name.value]=_(e.filter(ao),e=>e.name.value)}return{Directive:{leave(t){let a=t.name.value,n=i[a];if(n){var r;let i=new Set((null!=(r=t.arguments)?r:[]).map(e=>e.name.value));for(let[r,o]of Object.entries(n))if(!i.has(r)){let i=P(o.type)?(0,v.N)(o.type):(0,$.y)(o.type);e.reportError(new g.eO(`Directive "@${a}" argument "${r}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}}function ao(e){return e.type.kind===I.b.NON_NULL_TYPE&&null==e.defaultValue}function as(e){return{Field(t){let a=e.getType(),i=t.selectionSet;if(a)if(es(ew(a))){if(i){let n=t.name.value,r=(0,v.N)(a);e.reportError(new g.eO(`Field "${n}" must not have a selection since type "${r}" has no subfields.`,{nodes:i}))}}else if(i){if(0===i.selections.length){let i=t.name.value,n=(0,v.N)(a);e.reportError(new g.eO(`Field "${i}" of type "${n}" must have at least one field selected.`,{nodes:t}))}}else{let i=t.name.value,n=(0,v.N)(a);e.reportError(new g.eO(`Field "${i}" of type "${n}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}function ap(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function al(e,t,a){return{prev:e,key:t,typename:a}}function ad(e){let t=[],a=e;for(;a;)t.push(a.key),a=a.prev;return t.reverse()}function au(e,t,a=ac){return function e(t,a,i,n){if(et(a))return null!=t?e(t,a.ofType,i,n):void i(ad(n),t,new g.eO(`Expected non-nullable type "${(0,v.N)(a)}" not to be null.`));if(null==t)return null;if(Z(a)){let r=a.ofType;return tr(t)?Array.from(t,(t,a)=>e(t,r,i,al(n,a,void 0))):[e(t,r,i,n)]}if(K(a)){if(!(0,w.Z)(t)||Array.isArray(t))return void i(ad(n),t,new g.eO(`Expected type "${a.name}" to be an object.`));let r={},o=a.getFields();for(let s of Object.values(o)){let o=t[s.name];if(void 0===o){if(void 0!==s.defaultValue)r[s.name]=s.defaultValue;else if(et(s.type)){let e=(0,v.N)(s.type);i(ad(n),t,new g.eO(`Field "${s.name}" of required type "${e}" was not provided.`))}continue}r[s.name]=e(o,s.type,i,al(n,s.name,a.name))}for(let e of Object.keys(t))if(!o[e]){let r=T(e,Object.keys(a.getFields()));i(ad(n),t,new g.eO(`Field "${e}" is not defined by type "${a.name}".`+b(r)))}if(a.isOneOf){let e=Object.keys(r);1!==e.length&&i(ad(n),t,new g.eO(`Exactly one key must be specified for OneOf type "${a.name}".`));let o=e[0],s=r[o];null===s&&i(ad(n).concat(o),s,new g.eO(`Field "${o}" must be non-null.`))}return r}if(es(a)){let e;try{e=a.parseValue(t)}catch(e){e instanceof g.eO?i(ad(n),t,e):i(ad(n),t,new g.eO(`Expected type "${a.name}". `+e.message,{originalError:e}));return}return void 0===e&&i(ad(n),t,new g.eO(`Expected type "${a.name}".`)),e}(0,tn.V)(!1,"Unexpected input type: "+(0,v.N)(a))}(e,t,a,void 0)}function ac(e,t,a){let i="Invalid value "+(0,v.N)(t);throw e.length>0&&(i+=` at "value${ap(e)}"`),a.message=i+": "+a.message,a}function am(e,t,a){if(e){if(e.kind===I.b.VARIABLE){let i=e.name.value;if(null==a||void 0===a[i])return;let n=a[i];if(null===n&&et(t))return;return n}if(et(t)){if(e.kind===I.b.NULL)return;return am(e,t.ofType,a)}if(e.kind===I.b.NULL)return null;if(Z(t)){let i=t.ofType;if(e.kind===I.b.LIST){let t=[];for(let n of e.values)if(af(n,a)){if(et(i))return;t.push(null)}else{let e=am(n,i,a);if(void 0===e)return;t.push(e)}return t}let n=am(e,i,a);if(void 0===n)return;return[n]}if(K(t)){if(e.kind!==I.b.OBJECT)return;let i=Object.create(null),n=_(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=n[e.name];if(!t||af(t.value,a)){if(void 0!==e.defaultValue)i[e.name]=e.defaultValue;else if(et(e.type))return;continue}let r=am(t.value,e.type,a);if(void 0===r)return;i[e.name]=r}if(t.isOneOf){let e=Object.keys(i);if(1!==e.length||null===i[e[0]])return}return i}if(es(t)){let i;try{i=t.parseLiteral(e,a)}catch(e){return}if(void 0===i)return;return i}(0,tn.V)(!1,"Unexpected input type: "+(0,v.N)(t))}}function af(e,t){return e.kind===I.b.VARIABLE&&(null==t||void 0===t[e.name.value])}function ah(e,t,a,i){let n=[],r=null==i?void 0:i.maxErrors;try{let i=function(e,t,a,i){let n={};for(let r of t){let t=r.variable.name.value,o=t$(e,r.type);if(!ei(o)){let e=(0,$.y)(r.type);i(new g.eO(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:r.type}));continue}if(!ay(a,t)){if(r.defaultValue)n[t]=am(r.defaultValue,o);else if(et(o)){let e=(0,v.N)(o);i(new g.eO(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:r}))}continue}let s=a[t];if(null===s&&et(o)){let e=(0,v.N)(o);i(new g.eO(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:r}));continue}n[t]=au(s,o,(e,a,n)=>{let o=`Variable "$${t}" got invalid value `+(0,v.N)(a);e.length>0&&(o+=` at "${t}${ap(e)}"`),i(new g.eO(o+"; "+n.message,{nodes:r,originalError:n}))})}return n}(e,t,a,e=>{if(null!=r&&n.length>=r)throw new g.eO("Too many errors processing variables, error limit reached. Execution aborted.");n.push(e)});if(0===n.length)return{coerced:i}}catch(e){n.push(e)}return{errors:n}}function av(e,t,a){var i;let n={},r=_(null!=(i=t.arguments)?i:[],e=>e.name.value);for(let i of e.args){let e=i.name,o=i.type,s=r[e];if(!s){if(void 0!==i.defaultValue)n[e]=i.defaultValue;else if(et(o))throw new g.eO(`Argument "${e}" of required type "${(0,v.N)(o)}" was not provided.`,{nodes:t});continue}let p=s.value,l=p.kind===I.b.NULL;if(p.kind===I.b.VARIABLE){let t=p.name.value;if(null==a||!ay(a,t)){if(void 0!==i.defaultValue)n[e]=i.defaultValue;else if(et(o))throw new g.eO(`Argument "${e}" of required type "${(0,v.N)(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:p});continue}l=null==a[t]}if(l&&et(o))throw new g.eO(`Argument "${e}" of non-null type "${(0,v.N)(o)}" must not be null.`,{nodes:p});let d=am(p,o,a);if(void 0===d)throw new g.eO(`Argument "${e}" has invalid value ${(0,$.y)(p)}.`,{nodes:p});n[e]=d}return n}function ag(e,t,a){var i;let n=null==(i=t.directives)?void 0:i.find(t=>t.name.value===e.name);if(n)return av(e,n,a)}function ay(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ab(e,t,a,i,n){let r=new Map;return aD(e,t,a,i,n,r,new Set),r}function aD(e,t,a,i,n,r,o){for(let p of n.selections)switch(p.kind){case I.b.FIELD:{var s;if(!ax(a,p))continue;let e=(s=p).alias?s.alias.value:s.name.value,t=r.get(e);void 0!==t?t.push(p):r.set(e,[p]);break}case I.b.INLINE_FRAGMENT:if(!ax(a,p)||!aw(e,p,i))continue;aD(e,t,a,i,p.selectionSet,r,o);break;case I.b.FRAGMENT_SPREAD:{let n=p.name.value;if(o.has(n)||!ax(a,p))continue;o.add(n);let s=t[n];if(!s||!aw(e,s,i))continue;aD(e,t,a,i,s.selectionSet,r,o)}}}function ax(e,t){let a=ag(e5,t,e);if((null==a?void 0:a.if)===!0)return!1;let i=ag(e8,t,e);return(null==i?void 0:i.if)!==!1}function aw(e,t,a){let i=t.typeCondition;if(!i)return!0;let n=t$(e,i);return n===a||!!eu(n)&&e.isSubType(n,a)}function a_(e){return{OperationDefinition(t){if("subscription"===t.operation){let a=e.getSchema(),i=a.getSubscriptionType();if(i){let n=t.name?t.name.value:null,r=Object.create(null),o=e.getDocument(),s=Object.create(null);for(let e of o.definitions)e.kind===I.b.FRAGMENT_DEFINITION&&(s[e.name.value]=e);let p=ab(a,s,r,i,t.selectionSet);if(p.size>1){let t=[...p.values()].slice(1).flat();e.reportError(new g.eO(null!=n?`Subscription "${n}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(let t of p.values())t[0].name.value.startsWith("__")&&e.reportError(new g.eO(null!=n?`Subscription "${n}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}function aE(e,t){let a=new Map;for(let i of e){let e=t(i),n=a.get(e);void 0===n?a.set(e,[i]):n.push(i)}return a}function aF(e){return{DirectiveDefinition(e){var t;let i=null!=(t=e.arguments)?t:[];return a(`@${e.name.value}`,i)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t,i;let n=e.name.value;for(let r of null!=(t=e.fields)?t:[]){let e=r.name.value;a(`${n}.${e}`,null!=(i=r.arguments)?i:[])}return!1}function a(t,a){for(let[i,n]of aE(a,e=>e.name.value))n.length>1&&e.reportError(new g.eO(`Argument "${t}(${i}:)" can only be defined once.`,{nodes:n.map(e=>e.name)}));return!1}}function aA(e){return{Field:t,Directive:t};function t(t){var a;for(let[i,n]of aE(null!=(a=t.arguments)?a:[],e=>e.name.value))n.length>1&&e.reportError(new g.eO(`There can be only one argument named "${i}".`,{nodes:n.map(e=>e.name)}))}}function aC(e){let t=Object.create(null),a=e.getSchema();return{DirectiveDefinition(i){let n=i.name.value;return null!=a&&a.getDirective(n)?void e.reportError(new g.eO(`Directive "@${n}" already exists in the schema. It cannot be redefined.`,{nodes:i.name})):(t[n]?e.reportError(new g.eO(`There can be only one directive named "@${n}".`,{nodes:[t[n],i.name]})):t[n]=i.name,!1)}}}function aS(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=!e.isRepeatable;for(let a of e.getDocument().definitions)a.kind===I.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let i=Object.create(null),n=Object.create(null);return{enter(a){let r;if("directives"in a&&a.directives){if(a.kind===I.b.SCHEMA_DEFINITION||a.kind===I.b.SCHEMA_EXTENSION)r=i;else if((0,tV.a6)(a)||(0,tV.i7)(a)){let e=a.name.value;void 0===(r=n[e])&&(n[e]=r=Object.create(null))}else r=Object.create(null);for(let i of a.directives){let a=i.name.value;t[a]&&(r[a]?e.reportError(new g.eO(`The directive "@${a}" can only be used once at this location.`,{nodes:[r[a],i]})):r[a]=i)}}}}}function aT(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{EnumTypeDefinition:n,EnumTypeExtension:n};function n(t){var n;let r=t.name.value;i[r]||(i[r]=Object.create(null));let o=null!=(n=t.values)?n:[],s=i[r];for(let t of o){let i=t.name.value,n=a[r];W(n)&&n.getValue(i)?e.reportError(new g.eO(`Enum value "${r}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[i]?e.reportError(new g.eO(`Enum value "${r}.${i}" can only be defined once.`,{nodes:[s[i],t.name]})):s[i]=t.name}return!1}}function ak(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:n,InputObjectTypeExtension:n,InterfaceTypeDefinition:n,InterfaceTypeExtension:n,ObjectTypeDefinition:n,ObjectTypeExtension:n};function n(t){var n,r,o;let s=t.name.value;i[s]||(i[s]=Object.create(null));let p=null!=(n=t.fields)?n:[],l=i[s];for(let t of p){let i=t.name.value;(r=a[s],o=i,(q(r)||z(r)||K(r))&&null!=r.getFields()[o])?e.reportError(new g.eO(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):l[i]?e.reportError(new g.eO(`Field "${s}.${i}" can only be defined once.`,{nodes:[l[i],t.name]})):l[i]=t.name}return!1}}function aN(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(a){let i=a.name.value;return t[i]?e.reportError(new g.eO(`There can be only one fragment named "${i}".`,{nodes:[t[i],a.name]})):t[i]=a.name,!1}}}function aO(e){let t=[],a=Object.create(null);return{ObjectValue:{enter(){t.push(a),a=Object.create(null)},leave(){let e=t.pop();e||(0,tn.V)(!1),a=e}},ObjectField(t){let i=t.name.value;a[i]?e.reportError(new g.eO(`There can be only one input field named "${i}".`,{nodes:[a[i],t.name]})):a[i]=t.name}}}function aI(e){let t=Object.create(null);return{OperationDefinition(a){let i=a.name;return i&&(t[i.value]?e.reportError(new g.eO(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}}function a$(e){let t=e.getSchema(),a=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:n,SchemaExtension:n};function n(t){var n;for(let r of null!=(n=t.operationTypes)?n:[]){let t=r.operation,n=a[t];i[t]?e.reportError(new g.eO(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:r})):n?e.reportError(new g.eO(`There can be only one ${t} type in schema.`,{nodes:[n,r]})):a[t]=r}return!1}}function aj(e){let t=Object.create(null),a=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){let n=i.name.value;return null!=a&&a.getType(n)?void e.reportError(new g.eO(`Type "${n}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name})):(t[n]?e.reportError(new g.eO(`There can be only one type named "${n}".`,{nodes:[t[n],i.name]})):t[n]=i.name,!1)}}function aB(e){return{OperationDefinition(t){var a;for(let[i,n]of aE(null!=(a=t.variableDefinitions)?a:[],e=>e.variable.name.value))n.length>1&&e.reportError(new g.eO(`There can be only one variable named "$${i}".`,{nodes:n.map(e=>e.variable.name)}))}}}function aR(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!Z(eb(e.getParentInputType())))return aV(e,t),!1},ObjectValue(t){let a=ew(e.getInputType());if(!K(a))return aV(e,t),!1;let i=_(t.fields,e=>e.name.value);for(let n of Object.values(a.getFields()))if(!i[n.name]&&eU(n)){let i=(0,v.N)(n.type);e.reportError(new g.eO(`Field "${a.name}.${n.name}" of required type "${i}" was not provided.`,{nodes:t}))}a.isOneOf&&function(e,t,a,i){var n;let r=Object.keys(i);if(1!==r.length)return e.reportError(new g.eO(`OneOf Input Object "${a.name}" must specify exactly one key.`,{nodes:[t]}));let o=null==(n=i[r[0]])?void 0:n.value;o&&o.kind!==I.b.NULL||e.reportError(new g.eO(`Field "${a.name}.${r[0]}" must be non-null.`,{nodes:[t]}))}(e,t,a,i)},ObjectField(t){let a=ew(e.getParentInputType());if(!e.getInputType()&&K(a)){let i=T(t.name.value,Object.keys(a.getFields()));e.reportError(new g.eO(`Field "${t.name.value}" is not defined by type "${a.name}".`+b(i),{nodes:t}))}},NullValue(t){let a=e.getInputType();et(a)&&e.reportError(new g.eO(`Expected value of type "${(0,v.N)(a)}", found ${(0,$.y)(t)}.`,{nodes:t}))},EnumValue:t=>aV(e,t),IntValue:t=>aV(e,t),FloatValue:t=>aV(e,t),StringValue:t=>aV(e,t),BooleanValue:t=>aV(e,t)}}function aV(e,t){let a=e.getInputType();if(!a)return;let i=ew(a);if(!es(i)){let i=(0,v.N)(a);e.reportError(new g.eO(`Expected value of type "${i}", found ${(0,$.y)(t)}.`,{nodes:t}));return}try{let n=i.parseLiteral(t,void 0);if(void 0===n){let i=(0,v.N)(a);e.reportError(new g.eO(`Expected value of type "${i}", found ${(0,$.y)(t)}.`,{nodes:t}))}}catch(n){let i=(0,v.N)(a);n instanceof g.eO?e.reportError(n):e.reportError(new g.eO(`Expected value of type "${i}", found ${(0,$.y)(t)}; `+n.message,{nodes:t,originalError:n}))}}function aP(e){return{VariableDefinition(t){let a=t$(e.getSchema(),t.type);if(void 0!==a&&!ei(a)){let a=t.variable.name.value,i=(0,$.y)(t.type);e.reportError(new g.eO(`Variable "$${a}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function aL(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:p,type:l,defaultValue:d,parentType:u}of e.getRecursiveVariableUsages(a)){let a=p.name.value,c=t[a];if(c&&l){var i,n,r,o,s;let t=e.getSchema(),m=t$(t,c.type);if(m&&(i=t,n=m,r=c.defaultValue,o=l,s=d,et(o)&&!et(n)?!((null!=r&&r.kind!==I.b.NULL||void 0!==s)&&eG(i,n,o.ofType)):!eG(i,n,o))){let t=(0,v.N)(m),i=(0,v.N)(l);e.reportError(new g.eO(`Variable "$${a}" of type "${t}" used in position expecting type "${i}".`,{nodes:[c,p]}))}K(u)&&u.isOneOf&&eg(m)&&e.reportError(new g.eO(`Variable "$${a}" is of type "${m}" but must be non-nullable to be used for OneOf Input Object "${u}".`,{nodes:[c,p]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}let aM=Object.freeze([tH]),aU=Object.freeze([tP,aI,tQ,a_,tY,tM,aP,as,tL,aN,tz,tZ,at,tK,aB,tX,t1,tG,aS,tU,aA,aR,an,aL,t0,aO,...aM]),aq=Object.freeze([tW,a$,aj,aT,ak,aF,aC,tY,tG,aS,aa,tq,aA,aO,ar]);class aG{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{for(let e of(t=Object.create(null),this.getDocument().definitions))e.kind===I.b.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){let a;t=[];let i=[e];for(;a=i.pop();)for(let e of a.selections)e.kind===I.b.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&i.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){let a;t=[];let i=Object.create(null),n=[e.selectionSet];for(;a=n.pop();)for(let e of this.getFragmentSpreads(a)){let a=e.name.value;if(!0!==i[a]){i[a]=!0;let e=this.getFragment(a);e&&(t.push(e),n.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class az extends aG{constructor(e,t,a){super(e,a),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class aY extends aG{constructor(e,t,a,i){super(t,i),this._schema=e,this._typeInfo=a,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let a=[],i=new tj(this._schema);(0,tI.YR)(e,tR(i,{VariableDefinition:()=>!1,Variable(e){a.push({node:e,type:i.getInputType(),defaultValue:i.getDefaultValue(),parentType:i.getParentInputType()})}})),t=a,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){for(let a of(t=this.getVariableUsages(e),this.getRecursivelyReferencedFragments(e)))t=t.concat(this.getVariableUsages(a));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function aJ(e,t,a=aU,i,n=new tj(e)){var r;let o=null!=(r=null==i?void 0:i.maxErrors)?r:100;t||(0,m.U)(!1,"Must provide document."),tA(e);let s=Object.freeze({}),p=[],l=new aY(e,t,n,e=>{if(p.length>=o)throw p.push(new g.eO("Too many validation errors, error limit reached. Validation aborted.")),s;p.push(e)}),d=(0,tI.oP)(a.map(e=>e(l)));try{(0,tI.YR)(t,tR(n,d))}catch(e){if(e!==s)throw e}return p}function aQ(e,t,a=aq){let i=[],n=new az(e,t,e=>{i.push(e)}),r=a.map(e=>e(n));return(0,tI.YR)(e,(0,tI.oP)(r)),i}function aW(e){return Promise.all(Object.values(e)).then(t=>{let a=Object.create(null);for(let[i,n]of Object.keys(e).entries())a[n]=t[i];return a})}class aH extends Error{constructor(e){super("Unexpected error value: "+(0,v.N)(e)),this.name="NonErrorThrown",this.thrownValue=e}}function aK(e,t,a){var i;let n=e instanceof Error?e:new aH(e);return Array.isArray(n.path)?n:new g.eO(n.message,{nodes:null!=(i=n.nodes)?i:t,source:n.source,positions:n.positions,path:a,originalError:n})}let aX=(s=(e,t,a)=>(function(e,t,a,i,n){let r=new Map,o=new Set;for(let s of n)s.selectionSet&&aD(e,t,a,i,s.selectionSet,r,o);return r})(e.schema,e.fragments,e.variableValues,t,a),function(e,t,a){void 0===i&&(i=new WeakMap);let n=i.get(e);void 0===n&&(n=new WeakMap,i.set(e,n));let r=n.get(t);void 0===r&&(r=new WeakMap,n.set(t,r));let o=r.get(a);return void 0===o&&(o=s(e,t,a),r.set(a,o)),o});function aZ(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:a,variableValues:i,rootValue:n}=e;a0(t,a,i);let r=a6(e);if(!("schema"in r))return{errors:r};try{let{operation:e}=r,t=function(e,t,a){let i=e.schema.getRootType(t.operation);if(null==i)throw new g.eO(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let n=ab(e.schema,e.fragments,e.variableValues,i,t.selectionSet),r;switch(t.operation){case y.cE.QUERY:return a4(e,i,a,r,n);case y.cE.MUTATION:var o,s,p,l,d;return o=e,s=i,p=a,l=r,d=n,function(e,t,a){let i=a;for(let a of e)i=f(i)?i.then(e=>t(e,a)):t(i,a);return i}(d.entries(),(e,[t,a])=>{let i=al(l,t,s.name),n=a3(o,s,p,a,i);return void 0===n?e:f(n)?n.then(a=>(e[t]=a,e)):(e[t]=n,e)},Object.create(null));case y.cE.SUBSCRIPTION:return a4(e,i,a,r,n)}}(r,e,n);if(f(t))return t.then(e=>a2(e,r.errors),e=>(r.errors.push(e),a2(null,r.errors)));return a2(t,r.errors)}catch(e){return r.errors.push(e),a2(null,r.errors)}}function a1(e){let t=aZ(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function a2(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function a0(e,t,a){t||(0,m.U)(!1,"Must provide document."),tA(e),null==a||(0,w.Z)(a)||(0,m.U)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function a6(e){var t,a,i;let n,{schema:r,document:o,rootValue:s,contextValue:p,variableValues:l,operationName:d,fieldResolver:u,typeResolver:c,subscribeFieldResolver:m,options:f}=e,h=Object.create(null);for(let e of o.definitions)switch(e.kind){case I.b.OPERATION_DEFINITION:if(null==d){if(void 0!==n)return[new g.eO("Must provide operation name if query contains multiple operations.")];n=e}else(null==(t=e.name)?void 0:t.value)===d&&(n=e);break;case I.b.FRAGMENT_DEFINITION:h[e.name.value]=e}if(!n)return null!=d?[new g.eO(`Unknown operation named "${d}".`)]:[new g.eO("Must provide an operation.")];let v=ah(r,null!=(a=n.variableDefinitions)?a:[],null!=l?l:{},{maxErrors:null!=(i=null==f?void 0:f.maxCoercionErrors)?i:50});return v.errors?v.errors:{schema:r,fragments:h,rootValue:s,contextValue:p,operation:n,variableValues:v.coerced,fieldResolver:null!=u?u:ii,typeResolver:null!=c?c:ia,subscribeFieldResolver:null!=m?m:ii,errors:[]}}function a4(e,t,a,i,n){let r=Object.create(null),o=!1;try{for(let[s,p]of n.entries()){let n=al(i,s,t.name),l=a3(e,t,a,p,n);void 0!==l&&(r[s]=l,f(l)&&(o=!0))}}catch(e){if(o)return aW(r).finally(()=>{throw e});throw e}return o?aW(r):r}function a3(e,t,a,i,n){var r;let o=ir(e.schema,t,i[0]);if(!o)return;let s=o.type,p=null!=(r=o.resolve)?r:e.fieldResolver,l=a8(e,o,i,t,n);try{let t,r=av(o,i[0],e.variableValues),d=e.contextValue,u=p(a,r,d,l);if(t=f(u)?u.then(t=>a9(e,s,i,l,n,t)):a9(e,s,i,l,n,u),f(t))return t.then(void 0,t=>{let a=aK(t,i,ad(n));return a5(a,s,e)});return t}catch(t){return a5(aK(t,i,ad(n)),s,e)}}function a8(e,t,a,i,n){return{fieldName:t.name,fieldNodes:a,returnType:t.type,parentType:i,path:n,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function a5(e,t,a){if(et(t))throw e;return a.errors.push(e),null}function a9(e,t,a,i,n,r){var o,s,p,l,d,u,c;let m;if(r instanceof Error)throw r;if(et(t)){let o=a9(e,t.ofType,a,i,n,r);if(null===o)throw Error(`Cannot return null for non-nullable field ${i.parentType.name}.${i.fieldName}.`);return o}return null==r?null:Z(t)?function(e,t,a,i,n,r){if(!tr(r))throw new g.eO(`Expected Iterable, but did not find one for field "${i.parentType.name}.${i.fieldName}".`);let o=t.ofType,s=!1,p=Array.from(r,(t,r)=>{let p=al(n,r,void 0);try{let n;if(n=f(t)?t.then(t=>a9(e,o,a,i,p,t)):a9(e,o,a,i,p,t),f(n))return s=!0,n.then(void 0,t=>{let i=aK(t,a,ad(p));return a5(i,o,e)});return n}catch(t){return a5(aK(t,a,ad(p)),o,e)}});return s?Promise.all(p):p}(e,t,a,i,n,r):es(t)?function(e,t){let a=e.serialize(t);if(null==a)throw Error(`Expected \`${(0,v.N)(e)}.serialize(${(0,v.N)(t)})\` to return non-nullable value, returned: ${(0,v.N)(a)}`);return a}(t,r):eu(t)?(o=e,s=t,p=a,l=i,d=n,u=r,f(m=(null!=(c=s.resolveType)?c:o.typeResolver)(u,o.contextValue,l,s))?m.then(e=>ie(o,a7(e,o,s,p,l,u),p,l,d,u)):ie(o,a7(m,o,s,p,l,u),p,l,d,u)):q(t)?ie(e,t,a,i,n,r):void(0,tn.V)(!1,"Cannot complete value of unexpected output type: "+(0,v.N)(t))}function a7(e,t,a,i,n,r){if(null==e)throw new g.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${n.parentType.name}.${n.fieldName}". Either the "${a.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,i);if(q(e))throw new g.eO("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new g.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${n.parentType.name}.${n.fieldName}" with value ${(0,v.N)(r)}, received "${(0,v.N)(e)}".`);let o=t.schema.getType(e);if(null==o)throw new g.eO(`Abstract type "${a.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:i});if(!q(o))throw new g.eO(`Abstract type "${a.name}" was resolved to a non-object type "${e}".`,{nodes:i});if(!t.schema.isSubType(a,o))throw new g.eO(`Runtime Object type "${o.name}" is not a possible type for "${a.name}".`,{nodes:i});return o}function ie(e,t,a,i,n,r){let o=aX(e,t,a);if(t.isTypeOf){let s=t.isTypeOf(r,e.contextValue,i);if(f(s))return s.then(i=>{if(!i)throw it(t,r,a);return a4(e,t,r,n,o)});if(!s)throw it(t,r,a)}return a4(e,t,r,n,o)}function it(e,t,a){return new g.eO(`Expected value of type "${e.name}" but got: ${(0,v.N)(t)}.`,{nodes:a})}let ia=function(e,t,a,i){if((0,w.Z)(e)&&"string"==typeof e.__typename)return e.__typename;let n=a.schema.getPossibleTypes(i),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o.isTypeOf){let n=o.isTypeOf(e,t,a);if(f(n))r[i]=n;else if(n)return r.length&&Promise.allSettled(r).catch(()=>{}),o.name}}if(r.length)return Promise.all(r).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return n[t].name})},ii=function(e,t,a,i){if((0,w.Z)(e)||"function"==typeof e){let n=e[i.fieldName];return"function"==typeof n?e[i.fieldName](t,a,i):n}};function ir(e,t,a){let i=a.name.value;return i===tv.name&&e.getQueryType()===t?tv:i===tg.name&&e.getQueryType()===t?tg:i===ty.name?ty:t.getFields()[i]}function io(e){return new Promise(t=>t(ip(e)))}function is(e){let t=ip(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function ip(e){let t;arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:a,source:i,rootValue:n,contextValue:r,variableValues:o,operationName:s,fieldResolver:p,typeResolver:l}=e,d=tF(a);if(d.length>0)return{errors:d};try{t=(0,h.qg)(i)}catch(e){return{errors:[e]}}let u=aJ(a,t);return u.length>0?{errors:u}:aZ({schema:a,document:t,rootValue:n,contextValue:r,variableValues:o,operationName:s,fieldResolver:p,typeResolver:l})}var il=a(39537),id=a(73971),iu=a(8238),ic=a(98472),im=a(12039);function ih(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}async function iv(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await ig(e);if(!ih(t))return t;let a=t[Symbol.asyncIterator]();async function i(t){if(t.done)return t;try{let a;return{value:await (a=t.value,aZ({...e,rootValue:a})),done:!1}}catch(e){if("function"==typeof a.return)try{await a.return()}catch(e){}throw e}}return{next:async()=>i(await a.next()),return:async()=>"function"==typeof a.return?i(await a.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof a.throw)return i(await a.throw(e));throw e},[Symbol.asyncIterator](){return this}}}async function ig(...e){let t,a=(t=e[0])&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]},{schema:i,document:n,variableValues:r}=a;a0(i,n,r);let o=a6(a);if(!("schema"in o))return{errors:o};try{let e=await iy(o);if(!ih(e))throw Error(`Subscription field must return Async Iterable. Received: ${(0,v.N)(e)}.`);return e}catch(e){if(e instanceof g.eO)return{errors:[e]};throw e}}async function iy(e){let{schema:t,fragments:a,operation:i,variableValues:n,rootValue:r}=e,o=t.getSubscriptionType();if(null==o)throw new g.eO("Schema is not configured to execute subscription operation.",{nodes:i});let[s,p]=[...ab(t,a,n,o,i.selectionSet).entries()][0],l=ir(t,o,p[0]);if(!l){let e=p[0].name.value;throw new g.eO(`The subscription field "${e}" is not defined.`,{nodes:p})}let d=al(void 0,s,o.name),u=a8(e,l,p,o,d);try{var c;let t=av(l,p[0],n),a=e.contextValue,i=null!=(c=l.subscribe)?c:e.subscribeFieldResolver,o=await i(r,t,a,u);if(o instanceof Error)throw o;return o}catch(e){throw aK(e,p,ad(d))}}function ib(e){return{Field(t){let a=e.getFieldDef(),i=null==a?void 0:a.deprecationReason;if(a&&null!=i){let n=e.getParentType();null!=n||(0,tn.V)(!1),e.reportError(new g.eO(`The field ${n.name}.${a.name} is deprecated. ${i}`,{nodes:t}))}},Argument(t){let a=e.getArgument(),i=null==a?void 0:a.deprecationReason;if(a&&null!=i){let n=e.getDirective();if(null!=n)e.reportError(new g.eO(`Directive "@${n.name}" argument "${a.name}" is deprecated. ${i}`,{nodes:t}));else{let n=e.getParentType(),r=e.getFieldDef();null!=n&&null!=r||(0,tn.V)(!1),e.reportError(new g.eO(`Field "${n.name}.${r.name}" argument "${a.name}" is deprecated. ${i}`,{nodes:t}))}}},ObjectField(t){let a=ew(e.getParentInputType());if(K(a)){let i=a.getFields()[t.name.value],n=null==i?void 0:i.deprecationReason;null!=n&&e.reportError(new g.eO(`The input field ${a.name}.${i.name} is deprecated. ${n}`,{nodes:t}))}},EnumValue(t){let a=e.getEnumValue(),i=null==a?void 0:a.deprecationReason;if(a&&null!=i){let n=ew(e.getInputType());null!=n||(0,tn.V)(!1),e.reportError(new g.eO(`The enum value "${n.name}.${a.name}" is deprecated. ${i}`,{nodes:t}))}}}}function iD(e){return{Field(t){let a=ew(e.getType());a&&tD(a)&&e.reportError(new g.eO(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var ix=a(59841);function iw(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},a=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",n=t.directiveIsRepeatable?"isRepeatable":"",r=t.schemaDescription?a:"";function o(e){return t.inputValueDeprecation?e:""}let s=t.oneOf?"isOneOf":"";return`
|
|
1020
|
+
${a}`:a},s=e=>{if(e.endsWith(".json")||e.includes("/")){if(!i.existsSync(e))throw Error(`Config file not found: ${e}`);var t=i.readFileSync(e,"utf-8");return{config:t,source:{type:"file",path:n.resolve(e)},sizeBytes:Buffer.byteLength(t)}}return{config:e,source:{type:"inline"},sizeBytes:Buffer.byteLength(e)}}},68168(e,t,a){a.d(t,{K:()=>o,Y:()=>s});var i,n=a(99436),r=e=>String(e||"").trim().toLowerCase(),o=({resource:e,query:t,items:a,fields:i,selectedBy:n=null})=>{var o=r(t),s=a.filter(e=>i.some(t=>r(t.split(".").reduce((e,t)=>e?.[t],e)??null)===o)),p=null,l=n;return"id"===n?p=a[0]||null:1===s.length?(p=s[0],l="exact"):1===a.length&&(p=a[0],l="single"),{resource:e,query:t,exactMatchCount:s.length,matchCount:a.length,selectedBy:l,ambiguous:a.length>1&&!p,resolved:p,matches:a}},s=(i=n(function*(e){try{return yield e()}catch(e){if(/not found/i.test(e.message))return null;throw e}}),function(e){return i.apply(this,arguments)})},60450(e,t,a){a.d(t,{Gu:()=>m,he:()=>h,wR:()=>u});var i,n,r,o=a(99436),s=a(79657),p=a(73024),l=a(76760),d=a(48161),u=e=>e?.media_resource?.enable_media_workspace===!0,c=(i=o(function*(e,t,a){var i=yield e.mediaFiles({boxId:t,userTags:[`bricks_screenshot_${a}`],limit:1});return i?.[0]||null}),function(e,t,a){return i.apply(this,arguments)}),m=(e,{preferThumbnail:t=!1}={})=>{if(!e?.meta?.storageEndpoint)return null;var a=e.meta,i=a.storageEndpoint,n=a.originalFileKey,r=(t?(e=>{var t=e?.meta;if(!t)return null;if("Video"===e.fileType&&t.videoThumbOriginalFileKey)return t.videoThumbOriginalFileKey;var a=t.imageVersions||[];if(!Array.isArray(a)||0===a.length)return null;var i=a.filter(e=>e?.strategy==="BOUNDED"&&"number"==typeof e.width).sort((e,t)=>e.width-t.width);return(i[0]||a[0])?.key||null})(e):null)||n;return r?`${i}/${r}`:null},f=(n=o(function*(e,t=null){var a=yield(0,s.Ay)(e);if(!a.ok)throw Error(`Failed to download screenshot: ${a.statusText}`);var i=yield a.buffer(),n=t||l.join(d.tmpdir(),`bricks-screenshot-${Date.now()}.png`),r=l.dirname(n);return p.existsSync(r)||p.mkdirSync(r,{recursive:!0}),p.writeFileSync(n,i),n}),function(e){return n.apply(this,arguments)}),h=(r=o(function*(e,t,a,i=null,n={}){var r=u(t)&&t.media_resource?.system_media_box_id||null;if(!r)return{error:"Media workspace not enabled for this workspace"};var o=yield c(e,r,a);if(!o)return{error:"No screenshot available for this device"};var s=m(o,n);return s?{path:yield f(s,i),file:o,url:s}:{error:"Could not build screenshot URL"}}),function(e,t,a){return r.apply(this,arguments)})},44618(e,t,a){a.d(t,{V:()=>r});var i={S:"Subspace",B:"Brick",C:"Canvas",A:"Animation",G:"Generator",D:"Data",F:"Data Calc",N:"Calc Node",T:"Test",TC:"Test Case",AT:"Automation Map"},n=e=>e?.split("_")?.[0]||"",r=(e,{keyword:t,types:a}={})=>{var r=t?.trim().toLowerCase()||"",o=a?.length>0?new Set(a.flatMap(e=>{var t=String(e).trim().toUpperCase();return t?[t]:[]})):null;return Object.entries(Object.entries(e||{}).filter(([,e])=>e&&!e.hide).filter(([e,t])=>{var a=n(e);if(o&&!o.has(a))return!1;if(!r)return!0;var i=t?.title?String(t.title).toLowerCase():"";return e.toLowerCase().includes(r)||i.includes(r)}).reduce((e,[t,a])=>{var i=n(t);return e[i]||(e[i]=[]),e[i].push({shortId:t,ref:a}),e},{})).map(([e,t])=>({prefix:e,label:i[e]||e,refs:t.sort((e,t)=>{var a=e.ref?.title||e.shortId,i=t.ref?.title||t.shortId;return String(a).localeCompare(String(i))})})).sort((e,t)=>e.label.localeCompare(t.label))}},94979(e,t,a){a.d(t,{p:()=>r});var i=/^(\d+)(s|m|h|d|w)$/,n={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function r(e){var t=e.match(i);if(t){var a=parseInt(t[1],10),r=n[t[2]];return new Date(Date.now()-a*r).toISOString()}var o=new Date(e);if(isNaN(o.getTime()))throw Error(`Invalid time format: "${e}". Use ISO 8601 or relative (e.g. 1h, 30m, 2d)`);return o.toISOString()}},98593(e,t,a){a.d(t,{H_:()=>s,Iy:()=>o,S5:()=>d,jB:()=>p,yd:()=>u});var i=a(73284),n=a(79896),r=a(7586),o=(e,t,a)=>({label:e,ok:t,detail:a}),s=(e,t,{id:a,name:i,...n}={})=>({id:e?._id||t,name:i||e?.name||"Unnamed",...n}),p=(e,t)=>{var a={id:e};return t.name&&(a.name=t.name),t.description&&(a.description=t.description),t.config?a.config=t.config:t.file&&(a.config=n.readFileSync(t.file,"utf-8")),void 0!==a.config&&(a.validateConfig=!1!==t.validate),t.lastCommitId&&(a.lastCommitId=t.lastCommitId),a},l=e=>null==e?i.Ay.gray("N/A"):"object"==typeof e?i.Ay.gray(JSON.stringify(e,null,2)):String(e),d=({action:e,target:t,request:a,checks:n=[],json:o=!1})=>{o?(0,r.GF)({ok:!0,dryRun:!0,action:e,target:t||null,request:a||null,checks:n}):(console.log(i.Ay.bold(`
|
|
1021
|
+
Dry Run: ${e}`)),console.log("─".repeat(60)),t&&(console.log(i.Ay.bold("Target")),Object.entries(t).forEach(([e,t])=>{console.log(`${e}: ${l(t)}`)})),a&&(console.log(`
|
|
1022
|
+
${i.Ay.bold("Request")}`),Object.entries(a).forEach(([e,t])=>{console.log(`${e}: ${l(t)}`)})),n.length>0&&(console.log(`
|
|
1023
|
+
${i.Ay.bold("Checks")}`),n.forEach(e=>{var t=e.ok?i.Ay.green("OK"):i.Ay.red("FAIL"),a=e.detail?` ${e.detail}`:"";console.log(`${t} ${e.label}${a}`)})),console.log("─".repeat(60)))},u=({action:e,target:t,result:a=null,json:i=!1,message:n})=>{i?(0,r.GF)({ok:!0,dryRun:!1,action:e,target:t||null,result:a}):n&&console.log(n)}},73284(e,t,a){let i;a.d(t,{Ay:()=>T});let n=(e=0)=>t=>`\u001B[${t+e}m`,r=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,o=(e=0)=>(t,a,i)=>`\u001B[${38+e};2;${t};${a};${i}m`,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(s.modifier),[...Object.keys(s.color),...Object.keys(s.bgColor)];let p=function(){let e=new Map;for(let[t,a]of Object.entries(s)){for(let[t,i]of Object.entries(a))s[t]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},a[t]=s[t],e.set(i[0],i[1]);Object.defineProperty(s,t,{value:a,enumerable:!1})}return Object.defineProperty(s,"codes",{value:e,enumerable:!1}),s.color.close="\x1b[39m",s.bgColor.close="\x1b[49m",s.color.ansi=n(),s.color.ansi256=r(),s.color.ansi16m=o(),s.bgColor.ansi=n(10),s.bgColor.ansi256=r(10),s.bgColor.ansi16m=o(10),Object.defineProperties(s,{rgbToAnsi256:{value:(e,t,a)=>e===t&&t===a?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(a/255*5),enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[a]=t;3===a.length&&(a=[...a].map(e=>e+e).join(""));let i=Number.parseInt(a,16);return[i>>16&255,i>>8&255,255&i]},enumerable:!1},hexToAnsi256:{value:e=>s.rgbToAnsi256(...s.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){let t,a,i;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)a=t=((e-232)*10+8)/255,i=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,a=Math.floor(n/6)/5,i=n%6/5}let n=2*Math.max(t,a,i);if(0===n)return 30;let r=30+(Math.round(i)<<2|Math.round(a)<<1|Math.round(t));return 2===n&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(e,t,a)=>s.ansi256ToAnsi(s.rgbToAnsi256(e,t,a)),enumerable:!1},hexToAnsi:{value:e=>s.ansi256ToAnsi(s.hexToAnsi256(e)),enumerable:!1}}),s}();var l=a(1708),d=a(48161),u=a(7066);function c(e,t=globalThis.Deno?globalThis.Deno.args:l.argv){let a=e.startsWith("-")?"":1===e.length?"-":"--",i=t.indexOf(a+e),n=t.indexOf("--");return -1!==i&&(-1===n||i<n)}let{env:m}=l;function f(e,t={}){var a;return 0!==(a=function(e,{streamIsTTY:t,sniffFlags:a=!0}={}){let n=function(){if("FORCE_COLOR"in m)return"true"===m.FORCE_COLOR?1:"false"===m.FORCE_COLOR?0:0===m.FORCE_COLOR.length?1:Math.min(Number.parseInt(m.FORCE_COLOR,10),3)}();void 0!==n&&(i=n);let r=a?i:n;if(0===r)return 0;if(a){if(c("color=16m")||c("color=full")||c("color=truecolor"))return 3;if(c("color=256"))return 2}if("TF_BUILD"in m&&"AGENT_NAME"in m)return 1;if(e&&!t&&void 0===r)return 0;let o=r||0;if("dumb"===m.TERM)return o;if("win32"===l.platform){let e=d.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in m)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in m)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in m)||"codeship"===m.CI_NAME?1:o;if("TEAMCITY_VERSION"in m)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(m.TEAMCITY_VERSION);if("truecolor"===m.COLORTERM||"xterm-kitty"===m.TERM||"xterm-ghostty"===m.TERM||"wezterm"===m.TERM)return 3;if("TERM_PROGRAM"in m){let e=Number.parseInt((m.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(m.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(m.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(m.TERM)||"COLORTERM"in m?1:o}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}c("no-color")||c("no-colors")||c("color=false")||c("color=never")?i=0:(c("color")||c("colors")||c("color=true")||c("color=always"))&&(i=1);let{stdout:h,stderr:v}={stdout:f({isTTY:u.isatty(1)}),stderr:f({isTTY:u.isatty(2)})},g=Symbol("GENERATOR"),y=Symbol("STYLER"),b=Symbol("IS_EMPTY"),D=["ansi","ansi","ansi256","ansi16m"],x=Object.create(null);function w(e){let t;return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let a=h?h.level:0;e.level=void 0===t.level?a:t.level})(t=(...e)=>e.join(" "),e),Object.setPrototypeOf(t,w.prototype),t}for(let[e,t]of(Object.setPrototypeOf(w.prototype,Function.prototype),Object.entries(p)))x[e]={get(){let a=A(this,F(t.open,t.close,this[y]),this[b]);return Object.defineProperty(this,e,{value:a}),a}};x.visible={get(){let e=A(this,this[y],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let _=(e,t,a,...i)=>"rgb"===e?"ansi16m"===t?p[a].ansi16m(...i):"ansi256"===t?p[a].ansi256(p.rgbToAnsi256(...i)):p[a].ansi(p.rgbToAnsi(...i)):"hex"===e?_("rgb",t,a,...p.hexToRgb(...i)):p[a][e](...i);for(let e of["rgb","hex","ansi256"])x[e]={get(){let{level:t}=this;return function(...a){return A(this,F(_(e,D[t],"color",...a),p.color.close,this[y]),this[b])}}},x["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...a){return A(this,F(_(e,D[t],"bgColor",...a),p.bgColor.close,this[y]),this[b])}}};let E=Object.defineProperties(()=>{},{...x,level:{enumerable:!0,get(){return this[g].level},set(e){this[g].level=e}}}),F=(e,t,a)=>{let i,n;return void 0===a?(i=e,n=t):(i=a.openAll+e,n=t+a.closeAll),{open:e,close:t,openAll:i,closeAll:n,parent:a}},A=(e,t,a)=>{let i=(...e)=>C(i,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(i,E),i[g]=e,i[y]=t,i[b]=a,i},C=(e,t)=>{if(e.level<=0||!t)return e[b]?"":t;let a=e[y];if(void 0===a)return t;let{openAll:i,closeAll:n}=a;if(t.includes("\x1b"))for(;void 0!==a;)t=function(e,t,a){let i=e.indexOf(t);if(-1===i)return e;let n=t.length,r=0,o="";do o+=e.slice(r,i)+t+a,r=i+n,i=e.indexOf(t,r);while(-1!==i);return o+e.slice(r)}(t,a.close,a.open),a=a.parent;let r=t.indexOf("\n");return -1!==r&&(t=function(e,t,a,i){let n=0,r="";do{let o="\r"===e[i-1];r+=e.slice(n,o?i-1:i)+t+(o?"\r\n":"\n")+a,n=i+1,i=e.indexOf("\n",n)}while(-1!==i);return r+e.slice(n)}(t,n,i,r)),i+t+n};Object.defineProperties(w.prototype,x);let S=w();w({level:v?v.level:0});let T=S},35679(e,t,a){a.d(t,{DM:()=>i,uB:()=>d});let{DM:i,gu:n,er:r,Ww:o,b7:s,Di:p,a2:l,uB:d,ef:u,c$:c,_V:m}=a(65181)},48255(e,t,a){a.d(t,{Wk:()=>l,eO:()=>o,yJ:()=>p});var i=a(91070),n=a(73971),r=a(8238);class o extends Error{constructor(e,...t){var a,r,p;let l,{nodes:d,source:u,positions:c,path:m,originalError:f,extensions:h}=null==(l=t[0])||"kind"in l||"length"in l?{nodes:l,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:l;super(e),this.name="GraphQLError",this.path=null!=m?m:void 0,this.originalError=null!=f?f:void 0,this.nodes=s(Array.isArray(d)?d:d?[d]:void 0);let v=s(null==(a=this.nodes)?void 0:a.map(e=>e.loc).filter(e=>null!=e));this.source=null!=u?u:null==v||null==(r=v[0])?void 0:r.source,this.positions=null!=c?c:null==v?void 0:v.map(e=>e.start),this.locations=c&&u?c.map(e=>(0,n.g)(u,e)):null==v?void 0:v.map(e=>(0,n.g)(e.source,e.start));let g=(0,i.Z)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!=(p=null!=h?h:g)?p:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+="\n\n"+(0,r.V)(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+(0,r.C)(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}function p(e){return e.toString()}function l(e){return e.toJSON()}},59841(e,t,a){a.d(t,{I:()=>n});var i=a(48255);function n(e,t,a){return new i.eO(`Syntax Error: ${a}`,{source:e,positions:[t]})}},36869(e,t,a){let i;a.r(t),a.d(t,{VariablesAreInputTypesRule:()=>aP,SingleFieldSubscriptionsRule:()=>a_,UniqueVariableNamesRule:()=>aB,GraphQLDeprecatedDirective:()=>e7,GraphQLNonNull:()=>ef,__InputValue:()=>tm,createSourceEventStream:()=>ig,execute:()=>aZ,isDefinitionNode:()=>tV.MD,isInterfaceType:()=>z,isRequiredArgument:()=>eI,isValidNameError:()=>i0,parseValue:()=>h.$x,valueFromAST:()=>am,NoUnusedVariablesRule:()=>t1,__DirectiveLocation:()=>td,findDangerousChanges:()=>i4,__TypeKind:()=>th,isSchema:()=>tx,UniqueTypeNamesRule:()=>aj,NoSchemaIntrospectionCustomRule:()=>iD,defaultTypeResolver:()=>ia,isType:()=>P,syntaxError:()=>ix.I,version:()=>n,UniqueFragmentNamesRule:()=>aN,assertWrappingType:()=>ev,getNullableType:()=>eb,isObjectType:()=>q,visitWithTypeInfo:()=>tR,assertEnumValueName:()=>V,printSchema:()=>iP,validate:()=>aJ,BREAK:()=>tI.sP,assertNonNullType:()=>ea,assertNullableType:()=>ey,executeSync:()=>a1,isLeafType:()=>es,resolveSchemaCoordinate:()=>ne,assertOutputType:()=>eo,buildASTSchema:()=>iO,astFromValue:()=>to,Kind:()=>I.b,ProvidedRequiredArgumentsRule:()=>an,UniqueDirectiveNamesRule:()=>aC,KnownDirectivesRule:()=>tG,DEFAULT_DEPRECATION_REASON:()=>e9,TypeKind:()=>d,assertInterfaceType:()=>Y,isValueNode:()=>tV.aR,GraphQLSpecifiedByDirective:()=>te,GraphQLFloat:()=>eH,UniqueFieldDefinitionNamesRule:()=>ak,LoneAnonymousOperationRule:()=>tQ,VariablesInAllowedPositionRule:()=>aL,assertInputType:()=>en,formatError:()=>g.Wk,assertInputObjectType:()=>X,isOutputType:()=>er,isWrappingType:()=>eh,assertLeafType:()=>ep,assertValidSchema:()=>tA,FragmentsOnCompositeTypesRule:()=>tM,graphql:()=>io,UniqueOperationTypesRule:()=>a$,parseSchemaCoordinate:()=>h.Ng,UniqueEnumValueNamesRule:()=>aT,isNonNullType:()=>et,isSelectionNode:()=>tV.VK,printError:()=>g.yJ,specifiedDirectives:()=>ta,visit:()=>tI.YR,GraphQLScalarType:()=>eF,assertEnumType:()=>H,UniqueDirectivesPerLocationRule:()=>aS,assertName:()=>R,getDirectiveValues:()=>ag,isConstValueNode:()=>tV.TZ,isEqualType:()=>eq,isNamedType:()=>eD,isTypeDefinitionNode:()=>tV.a6,validateSchema:()=>tF,parse:()=>h.qg,__Schema:()=>tp,isTypeSystemDefinitionNode:()=>tV.xu,valueFromASTUntyped:()=>j,LoneSchemaDefinitionRule:()=>tW,isTypeSubTypeOf:()=>eG,UniqueArgumentNamesRule:()=>aA,UniqueInputFieldNamesRule:()=>aO,locatedError:()=>aK,typeFromAST:()=>t$,printLocation:()=>iu.V,assertUnionType:()=>Q,separateOperations:()=>iX,getVariableValues:()=>ah,Location:()=>y.aZ,GraphQLObjectType:()=>eA,UniqueArgumentDefinitionNamesRule:()=>aF,stripIgnoredCharacters:()=>i1,GRAPHQL_MAX_INT:()=>eJ,visitInParallel:()=>tI.oP,parseType:()=>h.Mb,isTypeNode:()=>tV.dI,PossibleTypeExtensionsRule:()=>aa,graphqlSync:()=>is,isSchemaCoordinateNode:()=>tV.gj,DirectiveLocation:()=>eY.H,TypeNameMetaFieldDef:()=>ty,coerceInputValue:()=>au,GraphQLInt:()=>eW,resolveObjMapThunk:()=>eE,GraphQLInterfaceType:()=>e$,UniqueOperationNamesRule:()=>aI,GraphQLSkipDirective:()=>e5,isEnumType:()=>W,assertValidName:()=>i2,buildClientSchema:()=>iA,KnownArgumentNamesRule:()=>tU,ValuesOfCorrectTypeRule:()=>aR,isInputObjectType:()=>K,GraphQLID:()=>eZ,NoUnusedFragmentsRule:()=>tZ,isUnionType:()=>J,isSpecifiedScalarType:()=>e2,getArgumentValues:()=>av,printSourceLocation:()=>iu.C,__EnumValue:()=>tf,getOperationAST:()=>i_,isExecutableDefinitionNode:()=>tV._m,isAbstractType:()=>eu,assertAbstractType:()=>ec,isTypeExtensionNode:()=>tV.i7,GraphQLInputObjectType:()=>eL,getNamedType:()=>ew,parseConstValue:()=>h.u8,KnownFragmentNamesRule:()=>tz,isListType:()=>Z,Lexer:()=>ic.JG,isSpecifiedDirective:()=>ti,responsePathAsArray:()=>ad,isDirective:()=>e6,TypeInfo:()=>tj,assertScalarType:()=>U,extendSchema:()=>iC,isIntrospectionType:()=>tD,print:()=>$.y,getIntrospectionQuery:()=>iw,GraphQLBoolean:()=>eX,KnownTypeNamesRule:()=>tY,assertListType:()=>ee,concatAST:()=>iK,NoDeprecatedCustomRule:()=>ib,defaultFieldResolver:()=>ii,GraphQLDirective:()=>e3,getLocation:()=>id.g,TypeMetaFieldDef:()=>tg,GRAPHQL_MIN_INT:()=>eQ,GraphQLIncludeDirective:()=>e8,ScalarLeafsRule:()=>as,assertSchema:()=>tw,lexicographicSortSchema:()=>i$,GraphQLList:()=>em,isTypeSystemExtensionNode:()=>tV.fT,specifiedScalarTypes:()=>e1,BreakingChangeType:()=>u,ExecutableDefinitionsRule:()=>tP,assertDirective:()=>e4,__Field:()=>tc,getVisitFn:()=>tI.UY,recommendedRules:()=>aM,SchemaMetaFieldDef:()=>tv,assertCompositeType:()=>ed,isRequiredInputField:()=>eU,Token:()=>y.ou,specifiedRules:()=>aU,DangerousChangeType:()=>c,GraphQLUnionType:()=>ej,isCompositeType:()=>el,versionInfo:()=>r,FieldsOnCorrectTypeRule:()=>tL,GraphQLString:()=>eK,assertType:()=>L,introspectionFromSchema:()=>iF,doTypesOverlap:()=>ez,GraphQLEnumType:()=>eR,resolveReadonlyArrayThunk:()=>e_,GraphQLOneOfDirective:()=>tt,NoFragmentCyclesRule:()=>tK,findBreakingChanges:()=>i6,ValidationContext:()=>aY,OverlappingFieldsCanBeMergedRule:()=>t0,isScalarType:()=>M,MaxIntrospectionDepthRule:()=>tH,NoUndefinedVariablesRule:()=>tX,assertObjectType:()=>G,getOperationRootType:()=>iE,printType:()=>iq,OperationTypeNode:()=>y.cE,isInputType:()=>ei,__Directive:()=>tl,GraphQLSchema:()=>t_,Source:()=>il.k,resolveASTSchemaCoordinate:()=>nt,GraphQLError:()=>g.eO,assertNamedType:()=>ex,buildSchema:()=>iI,introspectionTypes:()=>tb,PossibleFragmentSpreadsRule:()=>at,__Type:()=>tu,getEnterLeaveForKind:()=>tI.XO,TokenKind:()=>im.Y,printIntrospectionSchema:()=>iL,isNullableType:()=>eg,subscribe:()=>iv});let n="16.12.0",r=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});var o,s,p,l,d,u,c,m=a(93217);function f(e){return"function"==typeof(null==e?void 0:e.then)}var h=a(20186),v=a(35198),g=a(48255),y=a(59762);function b(e,t){let[a,i]=t?[e,t]:[void 0,e],n=" Did you mean ";a&&(n+=a+" ");let r=i.map(e=>`"${e}"`);switch(r.length){case 0:return"";case 1:return n+r[0]+"?";case 2:return n+r[0]+" or "+r[1]+"?"}let o=r.slice(0,5),s=o.pop();return n+o.join(", ")+", or "+s+"?"}function D(e){return e}var x=a(50792),w=a(91070);function _(e,t){let a=Object.create(null);for(let i of e)a[t(i)]=i;return a}function E(e,t,a){let i=Object.create(null);for(let n of e)i[t(n)]=a(n);return i}function F(e,t){let a=Object.create(null);for(let i of Object.keys(e))a[i]=t(e[i],i);return a}function A(e,t){let a=0,i=0;for(;a<e.length&&i<t.length;){let n=e.charCodeAt(a),r=t.charCodeAt(i);if(S(n)&&S(r)){let o=0;do++a,o=10*o+n-C,n=e.charCodeAt(a);while(S(n)&&o>0);let s=0;do++i,s=10*s+r-C,r=t.charCodeAt(i);while(S(r)&&s>0);if(o<s)return -1;if(o>s)return 1}else{if(n<r)return -1;if(n>r)return 1;++a,++i}}return e.length-t.length}let C=48;function S(e){return!isNaN(e)&&C<=e&&e<=57}function T(e,t){let a=Object.create(null),i=new k(e),n=Math.floor(.4*e.length)+1;for(let e of t){let t=i.measure(e,n);void 0!==t&&(a[e]=t)}return Object.keys(a).sort((e,t)=>{let i=a[e]-a[t];return 0!==i?i:A(e,t)})}class k{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=N(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let a=e.toLowerCase();if(this._inputLowerCase===a)return 1;let i=N(a),n=this._inputArray;if(i.length<n.length){let e=i;i=n,n=e}let r=i.length,o=n.length;if(r-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=r;e++){let a=s[(e-1)%3],r=s[e%3],p=r[0]=e;for(let t=1;t<=o;t++){let o=+(i[e-1]!==n[t-1]),l=Math.min(a[t]+1,r[t-1]+1,a[t-1]+o);e>1&&t>1&&i[e-1]===n[t-2]&&i[e-2]===n[t-1]&&(l=Math.min(l,s[(e-2)%3][t-2]+1)),l<p&&(p=l),r[t]=l}if(p>t)return}let p=s[r%3][o];return p<=t?p:void 0}}function N(e){let t=e.length,a=Array(t);for(let i=0;i<t;++i)a[i]=e.charCodeAt(i);return a}function O(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);for(let[a,i]of Object.entries(e))t[a]=i;return t}var I=a(42455),$=a(95818);function j(e,t){switch(e.kind){case I.b.NULL:return null;case I.b.INT:return parseInt(e.value,10);case I.b.FLOAT:return parseFloat(e.value);case I.b.STRING:case I.b.ENUM:case I.b.BOOLEAN:return e.value;case I.b.LIST:return e.values.map(e=>j(e,t));case I.b.OBJECT:return E(e.fields,e=>e.name.value,e=>j(e.value,t));case I.b.VARIABLE:return null==t?void 0:t[e.name.value]}}var B=a(25881);function R(e){if(null!=e||(0,m.U)(!1,"Must provide name."),"string"==typeof e||(0,m.U)(!1,"Expected name to be a string."),0===e.length)throw new g.eO("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,B.xr)(e.charCodeAt(t)))throw new g.eO(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,B.un)(e.charCodeAt(0)))throw new g.eO(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function V(e){if("true"===e||"false"===e||"null"===e)throw new g.eO(`Enum values cannot be named: ${e}`);return R(e)}function P(e){return M(e)||q(e)||z(e)||J(e)||W(e)||K(e)||Z(e)||et(e)}function L(e){if(!P(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL type.`);return e}function M(e){return(0,x.h)(e,eF)}function U(e){if(!M(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Scalar type.`);return e}function q(e){return(0,x.h)(e,eA)}function G(e){if(!q(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Object type.`);return e}function z(e){return(0,x.h)(e,e$)}function Y(e){if(!z(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Interface type.`);return e}function J(e){return(0,x.h)(e,ej)}function Q(e){if(!J(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Union type.`);return e}function W(e){return(0,x.h)(e,eR)}function H(e){if(!W(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Enum type.`);return e}function K(e){return(0,x.h)(e,eL)}function X(e){if(!K(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Input Object type.`);return e}function Z(e){return(0,x.h)(e,em)}function ee(e){if(!Z(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL List type.`);return e}function et(e){return(0,x.h)(e,ef)}function ea(e){if(!et(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL Non-Null type.`);return e}function ei(e){return M(e)||W(e)||K(e)||eh(e)&&ei(e.ofType)}function en(e){if(!ei(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL input type.`);return e}function er(e){return M(e)||q(e)||z(e)||J(e)||W(e)||eh(e)&&er(e.ofType)}function eo(e){if(!er(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL output type.`);return e}function es(e){return M(e)||W(e)}function ep(e){if(!es(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL leaf type.`);return e}function el(e){return q(e)||z(e)||J(e)}function ed(e){if(!el(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL composite type.`);return e}function eu(e){return z(e)||J(e)}function ec(e){if(!eu(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL abstract type.`);return e}class em{constructor(e){P(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class ef{constructor(e){eg(e)||(0,m.U)(!1,`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function eh(e){return Z(e)||et(e)}function ev(e){if(!eh(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL wrapping type.`);return e}function eg(e){return P(e)&&!et(e)}function ey(e){if(!eg(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL nullable type.`);return e}function eb(e){if(e)return et(e)?e.ofType:e}function eD(e){return M(e)||q(e)||z(e)||J(e)||W(e)||K(e)}function ex(e){if(!eD(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL named type.`);return e}function ew(e){if(e){let t=e;for(;eh(t);)t=t.ofType;return t}}function e_(e){return"function"==typeof e?e():e}function eE(e){return"function"==typeof e?e():e}class eF{constructor(e){var t,a,i,n;let r=null!=(t=e.parseValue)?t:D;this.name=R(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(a=e.serialize)?a:D,this.parseValue=r,this.parseLiteral=null!=(i=e.parseLiteral)?i:(e,t)=>r(j(e,t)),this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(n=e.extensionASTNodes)?n:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,m.U)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,v.N)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,m.U)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,m.U)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class eA{constructor(e){var t;this.name=R(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>eS(e),this._interfaces=()=>eC(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,m.U)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,v.N)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:eN(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eC(e){var t;let a=e_(null!=(t=e.interfaces)?t:[]);return Array.isArray(a)||(0,m.U)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),a}function eS(e){let t=eE(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),F(t,(t,a)=>{var i;ek(t)||(0,m.U)(!1,`${e.name}.${a} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,m.U)(!1,`${e.name}.${a} field resolver must be a function if provided, but got: ${(0,v.N)(t.resolve)}.`);let n=null!=(i=t.args)?i:{};return ek(n)||(0,m.U)(!1,`${e.name}.${a} args must be an object with argument names as keys.`),{name:R(a),description:t.description,type:t.type,args:eT(n),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:O(t.extensions),astNode:t.astNode}})}function eT(e){return Object.entries(e).map(([e,t])=>({name:R(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:O(t.extensions),astNode:t.astNode}))}function ek(e){return(0,w.Z)(e)&&!Array.isArray(e)}function eN(e){return F(e,e=>({description:e.description,type:e.type,args:eO(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eO(e){return E(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function eI(e){return et(e.type)&&void 0===e.defaultValue}class e${constructor(e){var t;this.name=R(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=eS.bind(void 0,e),this._interfaces=eC.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:eN(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ej{constructor(e){var t;this.name=R(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=eB.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,m.U)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,v.N)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eB(e){let t=e_(e.types);return Array.isArray(t)||(0,m.U)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class eR{constructor(e){var t;this.name=R(e.name),this.description=e.description,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:eP(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=eP(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=_(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(void 0===t)throw new g.eO(`Enum "${this.name}" cannot represent value: ${(0,v.N)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){let t=(0,v.N)(e);throw new g.eO(`Enum "${this.name}" cannot represent non-string value: ${t}.`+eV(this,t))}let t=this.getValue(e);if(null==t)throw new g.eO(`Value "${e}" does not exist in "${this.name}" enum.`+eV(this,e));return t.value}parseLiteral(e,t){if(e.kind!==I.b.ENUM){let t=(0,$.y)(e);throw new g.eO(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+eV(this,t),{nodes:e})}let a=this.getValue(e.value);if(null==a){let t=(0,$.y)(e);throw new g.eO(`Value "${t}" does not exist in "${this.name}" enum.`+eV(this,t),{nodes:e})}return a.value}toConfig(){let e=E(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function eV(e,t){return b("the enum value",T(t,e.getValues().map(e=>e.name)))}function eP(e,t){return ek(t)||(0,m.U)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,a])=>(ek(a)||(0,m.U)(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${(0,v.N)(a)}.`),{name:V(t),description:a.description,value:void 0!==a.value?a.value:t,deprecationReason:a.deprecationReason,extensions:O(a.extensions),astNode:a.astNode}))}class eL{constructor(e){var t,a;this.name=R(e.name),this.description=e.description,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(a=e.isOneOf)&&a,this._fields=eM.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){let e=F(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function eM(e){let t=eE(e.fields);return ek(t)||(0,m.U)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),F(t,(t,a)=>("resolve"in t&&(0,m.U)(!1,`${e.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:R(a),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:O(t.extensions),astNode:t.astNode}))}function eU(e){return et(e.type)&&void 0===e.defaultValue}function eq(e,t){return e===t||!!(et(e)&&et(t)||Z(e)&&Z(t))&&eq(e.ofType,t.ofType)}function eG(e,t,a){return t===a||(et(a)?!!et(t)&&eG(e,t.ofType,a.ofType):et(t)?eG(e,t.ofType,a):Z(a)?!!Z(t)&&eG(e,t.ofType,a.ofType):!Z(t)&&eu(a)&&(z(t)||q(t))&&e.isSubType(a,t))}function ez(e,t,a){return t===a||(eu(t)?eu(a)?e.getPossibleTypes(t).some(t=>e.isSubType(a,t)):e.isSubType(t,a):!!eu(a)&&e.isSubType(a,t))}var eY=a(42868);let eJ=0x7fffffff,eQ=-0x80000000,eW=new eF({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=e0(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isInteger(a))throw new g.eO(`Int cannot represent non-integer value: ${(0,v.N)(t)}`);if(a>eJ||a<eQ)throw new g.eO("Int cannot represent non 32-bit signed integer value: "+(0,v.N)(t));return a},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new g.eO(`Int cannot represent non-integer value: ${(0,v.N)(e)}`);if(e>eJ||e<eQ)throw new g.eO(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==I.b.INT)throw new g.eO(`Int cannot represent non-integer value: ${(0,$.y)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>eJ||t<eQ)throw new g.eO(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),eH=new eF({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=e0(e);if("boolean"==typeof t)return+!!t;let a=t;if("string"==typeof t&&""!==t&&(a=Number(t)),"number"!=typeof a||!Number.isFinite(a))throw new g.eO(`Float cannot represent non numeric value: ${(0,v.N)(t)}`);return a},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new g.eO(`Float cannot represent non numeric value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==I.b.FLOAT&&e.kind!==I.b.INT)throw new g.eO(`Float cannot represent non numeric value: ${(0,$.y)(e)}`,e);return parseFloat(e.value)}}),eK=new eF({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=e0(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new g.eO(`String cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"!=typeof e)throw new g.eO(`String cannot represent a non string value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==I.b.STRING)throw new g.eO(`String cannot represent a non string value: ${(0,$.y)(e)}`,{nodes:e});return e.value}}),eX=new eF({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=e0(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new g.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new g.eO(`Boolean cannot represent a non boolean value: ${(0,v.N)(e)}`);return e},parseLiteral(e){if(e.kind!==I.b.BOOLEAN)throw new g.eO(`Boolean cannot represent a non boolean value: ${(0,$.y)(e)}`,{nodes:e});return e.value}}),eZ=new eF({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=e0(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new g.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new g.eO(`ID cannot represent value: ${(0,v.N)(e)}`)},parseLiteral(e){if(e.kind!==I.b.STRING&&e.kind!==I.b.INT)throw new g.eO("ID cannot represent a non-string and non-integer value: "+(0,$.y)(e),{nodes:e});return e.value}}),e1=Object.freeze([eK,eW,eH,eX,eZ]);function e2(e){return e1.some(({name:t})=>e.name===t)}function e0(e){if((0,w.Z)(e)){if("function"==typeof e.valueOf){let t=e.valueOf();if(!(0,w.Z)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function e6(e){return(0,x.h)(e,e3)}function e4(e){if(!e6(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL directive.`);return e}class e3{constructor(e){var t,a;this.name=R(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.extensions=O(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,m.U)(!1,`@${e.name} locations must be an Array.`);let i=null!=(a=e.args)?a:{};(0,w.Z)(i)&&!Array.isArray(i)||(0,m.U)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=eT(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:eO(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}let e8=new e3({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[eY.H.FIELD,eY.H.FRAGMENT_SPREAD,eY.H.INLINE_FRAGMENT],args:{if:{type:new ef(eX),description:"Included when true."}}}),e5=new e3({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[eY.H.FIELD,eY.H.FRAGMENT_SPREAD,eY.H.INLINE_FRAGMENT],args:{if:{type:new ef(eX),description:"Skipped when true."}}}),e9="No longer supported",e7=new e3({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[eY.H.FIELD_DEFINITION,eY.H.ARGUMENT_DEFINITION,eY.H.INPUT_FIELD_DEFINITION,eY.H.ENUM_VALUE],args:{reason:{type:eK,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:e9}}}),te=new e3({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[eY.H.SCALAR],args:{url:{type:new ef(eK),description:"The URL that specifies the behavior of this scalar."}}}),tt=new e3({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[eY.H.INPUT_OBJECT],args:{}}),ta=Object.freeze([e8,e5,e7,te,tt]);function ti(e){return ta.some(({name:t})=>t===e.name)}var tn=a(71306);function tr(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function to(e,t){if(et(t)){let a=to(e,t.ofType);return(null==a?void 0:a.kind)===I.b.NULL?null:a}if(null===e)return{kind:I.b.NULL};if(void 0===e)return null;if(Z(t)){let a=t.ofType;if(tr(e)){let t=[];for(let i of e){let e=to(i,a);null!=e&&t.push(e)}return{kind:I.b.LIST,values:t}}return to(e,a)}if(K(t)){if(!(0,w.Z)(e))return null;let a=[];for(let i of Object.values(t.getFields())){let t=to(e[i.name],i.type);t&&a.push({kind:I.b.OBJECT_FIELD,name:{kind:I.b.NAME,value:i.name},value:t})}return{kind:I.b.OBJECT,fields:a}}if(es(t)){let a=t.serialize(e);if(null==a)return null;if("boolean"==typeof a)return{kind:I.b.BOOLEAN,value:a};if("number"==typeof a&&Number.isFinite(a)){let e=String(a);return ts.test(e)?{kind:I.b.INT,value:e}:{kind:I.b.FLOAT,value:e}}if("string"==typeof a)return W(t)?{kind:I.b.ENUM,value:a}:t===eZ&&ts.test(a)?{kind:I.b.INT,value:a}:{kind:I.b.STRING,value:a};throw TypeError(`Cannot convert value to AST: ${(0,v.N)(a)}.`)}(0,tn.V)(!1,"Unexpected input type: "+(0,v.N)(t))}let ts=/^-?(?:0|[1-9][0-9]*)$/,tp=new eA({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:eK,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ef(new em(new ef(tu))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new ef(tu),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:tu,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:tu,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ef(new em(new ef(tl))),resolve:e=>e.getDirectives()}})}),tl=new eA({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},isRepeatable:{type:new ef(eX),resolve:e=>e.isRepeatable},locations:{type:new ef(new em(new ef(td))),resolve:e=>e.locations},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),td=new eR({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:eY.H.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:eY.H.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:eY.H.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:eY.H.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:eY.H.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:eY.H.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:eY.H.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:eY.H.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:eY.H.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:eY.H.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:eY.H.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:eY.H.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:eY.H.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:eY.H.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:eY.H.UNION,description:"Location adjacent to a union definition."},ENUM:{value:eY.H.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:eY.H.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:eY.H.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:eY.H.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),tu=new eA({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new ef(th),resolve:e=>M(e)?d.SCALAR:q(e)?d.OBJECT:z(e)?d.INTERFACE:J(e)?d.UNION:W(e)?d.ENUM:K(e)?d.INPUT_OBJECT:Z(e)?d.LIST:et(e)?d.NON_NULL:void(0,tn.V)(!1,`Unexpected type: "${(0,v.N)(e)}".`)},name:{type:eK,resolve:e=>"name"in e?e.name:void 0},description:{type:eK,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:eK,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new em(new ef(tc)),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(q(e)||z(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new em(new ef(tu)),resolve(e){if(q(e)||z(e))return e.getInterfaces()}},possibleTypes:{type:new em(new ef(tu)),resolve(e,t,a,{schema:i}){if(eu(e))return i.getPossibleTypes(e)}},enumValues:{type:new em(new ef(tf)),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(W(e)){let a=e.getValues();return t?a:a.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new em(new ef(tm)),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(K(e)){let a=Object.values(e.getFields());return t?a:a.filter(e=>null==e.deprecationReason)}}},ofType:{type:tu,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:eX,resolve:e=>{if(K(e))return e.isOneOf}}})}),tc=new eA({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},args:{type:new ef(new em(new ef(tm))),args:{includeDeprecated:{type:eX,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new ef(tu),resolve:e=>e.type},isDeprecated:{type:new ef(eX),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eK,resolve:e=>e.deprecationReason}})}),tm=new eA({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},type:{type:new ef(tu),resolve:e=>e.type},defaultValue:{type:eK,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:a}=e,i=to(a,t);return i?(0,$.y)(i):null}},isDeprecated:{type:new ef(eX),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eK,resolve:e=>e.deprecationReason}})}),tf=new eA({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new ef(eK),resolve:e=>e.name},description:{type:eK,resolve:e=>e.description},isDeprecated:{type:new ef(eX),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:eK,resolve:e=>e.deprecationReason}})});(o=d||(d={})).SCALAR="SCALAR",o.OBJECT="OBJECT",o.INTERFACE="INTERFACE",o.UNION="UNION",o.ENUM="ENUM",o.INPUT_OBJECT="INPUT_OBJECT",o.LIST="LIST",o.NON_NULL="NON_NULL";let th=new eR({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:d.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:d.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:d.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:d.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:d.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:d.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:d.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:d.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),tv={name:"__schema",type:new ef(tp),description:"Access the current type schema of this server.",args:[],resolve:(e,t,a,{schema:i})=>i,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tg={name:"__type",type:tu,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new ef(eK),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},a,{schema:i})=>i.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ty={name:"__typename",type:new ef(eK),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,a,{parentType:i})=>i.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tb=Object.freeze([tp,tl,td,tu,tc,tm,tf,th]);function tD(e){return tb.some(({name:t})=>e.name===t)}function tx(e){return(0,x.h)(e,t_)}function tw(e){if(!tx(e))throw Error(`Expected ${(0,v.N)(e)} to be a GraphQL schema.`);return e}class t_{constructor(e){var t,a;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,w.Z)(e)||(0,m.U)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,m.U)(!1,`"types" must be Array if provided but got: ${(0,v.N)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,m.U)(!1,`"directives" must be Array if provided but got: ${(0,v.N)(e.directives)}.`),this.description=e.description,this.extensions=O(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(a=e.directives)?a:ta;let i=new Set(e.types);if(null!=e.types)for(let t of e.types)i.delete(t),tE(t,i);for(let e of(null!=this._queryType&&tE(this._queryType,i),null!=this._mutationType&&tE(this._mutationType,i),null!=this._subscriptionType&&tE(this._subscriptionType,i),this._directives))if(e6(e))for(let t of e.args)tE(t.type,i);for(let e of(tE(tp,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null),i)){if(null==e)continue;let t=e.name;if(t||(0,m.U)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,z(e)){for(let t of e.getInterfaces())if(z(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.interfaces.push(e)}}else if(q(e)){for(let t of e.getInterfaces())if(z(t)){let a=this._implementationsMap[t.name];void 0===a&&(a=this._implementationsMap[t.name]={objects:[],interfaces:[]}),a.objects.push(e)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case y.cE.QUERY:return this.getQueryType();case y.cE.MUTATION:return this.getMutationType();case y.cE.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return J(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){let t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let a=this._subTypeMap[e.name];if(void 0===a){if(a=Object.create(null),J(e))for(let t of e.getTypes())a[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)a[e.name]=!0;for(let e of t.interfaces)a[e.name]=!0}this._subTypeMap[e.name]=a}return void 0!==a[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function tE(e,t){let a=ew(e);if(!t.has(a)){if(t.add(a),J(a))for(let e of a.getTypes())tE(e,t);else if(q(a)||z(a)){for(let e of a.getInterfaces())tE(e,t);for(let e of Object.values(a.getFields()))for(let a of(tE(e.type,t),e.args))tE(a.type,t)}else if(K(a))for(let e of Object.values(a.getFields()))tE(e.type,t)}return t}function tF(e){var t,a,i,n;let r,o,s,p;if(tw(e),e.__validationErrors)return e.__validationErrors;let l=new tC(e);(o=(r=(t=l).schema).getQueryType())?q(o)||t.reportError(`Query root type must be Object type, it cannot be ${(0,v.N)(o)}.`,null!=(a=tS(r,y.cE.QUERY))?a:o.astNode):t.reportError("Query root type must be provided.",r.astNode),(s=r.getMutationType())&&!q(s)&&t.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,v.N)(s)}.`,null!=(i=tS(r,y.cE.MUTATION))?i:s.astNode),(p=r.getSubscriptionType())&&!q(p)&&t.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,v.N)(p)}.`,null!=(n=tS(r,y.cE.SUBSCRIPTION))?n:p.astNode),function(e){for(let a of e.schema.getDirectives()){if(!e6(a)){e.reportError(`Expected directive but got: ${(0,v.N)(a)}.`,null==a?void 0:a.astNode);continue}for(let i of(tT(e,a),0===a.locations.length&&e.reportError(`Directive @${a.name} must include 1 or more locations.`,a.astNode),a.args))if(tT(e,i),ei(i.type)||e.reportError(`The type of @${a.name}(${i.name}:) must be Input Type but got: ${(0,v.N)(i.type)}.`,i.astNode),eI(i)&&null!=i.deprecationReason){var t;e.reportError(`Required argument @${a.name}(${i.name}:) cannot be deprecated.`,[tO(i.astNode),null==(t=i.astNode)?void 0:t.type])}}}(l),function(e){var t;let a,i,n,r=(t=e,a=Object.create(null),i=[],n=Object.create(null),function e(r){if(!a[r.name]){for(let o of(a[r.name]=!0,n[r.name]=i.length,Object.values(r.getFields())))if(et(o.type)&&K(o.type.ofType)){let a=o.type.ofType,r=n[a.name];if(i.push(o),void 0===r)e(a);else{let e=i.slice(r),n=e.map(e=>e.name).join(".");t.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${n}".`,e.map(e=>e.astNode))}i.pop()}n[r.name]=void 0}});for(let t of Object.values(e.schema.getTypeMap())){if(!eD(t)){e.reportError(`Expected GraphQL named type but got: ${(0,v.N)(t)}.`,t.astNode);continue}tD(t)||tT(e,t),q(t)||z(t)?(function(e,t){let a=Object.values(t.getFields());for(let o of(0===a.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var i,n,r;for(let a of(tT(e,o),er(o.type)||e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${(0,v.N)(o.type)}.`,null==(i=o.astNode)?void 0:i.type),o.args)){let i=a.name;tT(e,a),ei(a.type)||e.reportError(`The type of ${t.name}.${o.name}(${i}:) must be Input Type but got: ${(0,v.N)(a.type)}.`,null==(n=a.astNode)?void 0:n.type),eI(a)&&null!=a.deprecationReason&&e.reportError(`Required argument ${t.name}.${o.name}(${i}:) cannot be deprecated.`,[tO(a.astNode),null==(r=a.astNode)?void 0:r.type])}}}(e,t),function(e,t){let a=Object.create(null);for(let i of t.getInterfaces()){if(!z(i)){e.reportError(`Type ${(0,v.N)(t)} must only implement Interface types, it cannot implement ${(0,v.N)(i)}.`,tk(t,i));continue}if(t===i){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,tk(t,i));continue}if(a[i.name]){e.reportError(`Type ${t.name} can only implement ${i.name} once.`,tk(t,i));continue}a[i.name]=!0,function(e,t,a){let i=t.getInterfaces();for(let n of a.getInterfaces())i.includes(n)||e.reportError(n===t?`Type ${t.name} cannot implement ${a.name} because it would create a circular reference.`:`Type ${t.name} must implement ${n.name} because it is implemented by ${a.name}.`,[...tk(a,n),...tk(t,a)])}(e,t,i),function(e,t,a){let i=t.getFields();for(let p of Object.values(a.getFields())){var n,r,o,s;let l=p.name,d=i[l];if(!d){e.reportError(`Interface field ${a.name}.${l} expected but ${t.name} does not provide it.`,[p.astNode,t.astNode,...t.extensionASTNodes]);continue}for(let i of(eG(e.schema,d.type,p.type)||e.reportError(`Interface field ${a.name}.${l} expects type ${(0,v.N)(p.type)} but ${t.name}.${l} is type ${(0,v.N)(d.type)}.`,[null==(n=p.astNode)?void 0:n.type,null==(r=d.astNode)?void 0:r.type]),p.args)){let n=i.name,r=d.args.find(e=>e.name===n);if(!r){e.reportError(`Interface field argument ${a.name}.${l}(${n}:) expected but ${t.name}.${l} does not provide it.`,[i.astNode,d.astNode]);continue}eq(i.type,r.type)||e.reportError(`Interface field argument ${a.name}.${l}(${n}:) expects type ${(0,v.N)(i.type)} but ${t.name}.${l}(${n}:) is type ${(0,v.N)(r.type)}.`,[null==(o=i.astNode)?void 0:o.type,null==(s=r.astNode)?void 0:s.type])}for(let i of d.args){let n=i.name;!p.args.find(e=>e.name===n)&&eI(i)&&e.reportError(`Object field ${t.name}.${l} includes required argument ${n} that is missing from the Interface field ${a.name}.${l}.`,[i.astNode,p.astNode])}}}(e,t,i)}}(e,t)):J(t)?function(e,t){let a=t.getTypes();0===a.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let i=Object.create(null);for(let n of a){if(i[n.name]){e.reportError(`Union type ${t.name} can only include type ${n.name} once.`,tN(t,n.name));continue}i[n.name]=!0,q(n)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,v.N)(n)}.`,tN(t,String(n)))}}(e,t):W(t)?function(e,t){let a=t.getValues();for(let i of(0===a.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]),a))tT(e,i)}(e,t):K(t)&&(function(e,t){let a=Object.values(t.getFields());for(let r of(0===a.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),a)){var i,n;tT(e,r),ei(r.type)||e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${(0,v.N)(r.type)}.`,null==(i=r.astNode)?void 0:i.type),eU(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[tO(r.astNode),null==(n=r.astNode)?void 0:n.type]),t.isOneOf&&function(e,t,a){if(et(t.type)){var i;a.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(i=t.astNode)?void 0:i.type)}void 0!==t.defaultValue&&a.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}(t,r,e)}}(e,t),r(t))}}(l);let d=l.getErrors();return e.__validationErrors=d,d}function tA(e){let t=tF(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))}class tC{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let a=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new g.eO(e,{nodes:a}))}getErrors(){return this._errors}}function tS(e,t){var a;return null==(a=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.operationTypes)?t:[]}).find(e=>e.operation===t))?void 0:a.type}function tT(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function tk(e,t){let{astNode:a,extensionASTNodes:i}=e;return(null!=a?[a,...i]:i).flatMap(e=>{var t;return null!=(t=e.interfaces)?t:[]}).filter(e=>e.name.value===t.name)}function tN(e,t){let{astNode:a,extensionASTNodes:i}=e;return(null!=a?[a,...i]:i).flatMap(e=>{var t;return null!=(t=e.types)?t:[]}).filter(e=>e.name.value===t)}function tO(e){var t;return null==e||null==(t=e.directives)?void 0:t.find(e=>e.name.value===e7.name)}var tI=a(90424);function t$(e,t){switch(t.kind){case I.b.LIST_TYPE:{let a=t$(e,t.type);return a&&new em(a)}case I.b.NON_NULL_TYPE:{let a=t$(e,t.type);return a&&new ef(a)}case I.b.NAMED_TYPE:return e.getType(t.name.value)}}class tj{constructor(e,t,a){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=a?a:tB,t&&(ei(t)&&this._inputTypeStack.push(t),el(t)&&this._parentTypeStack.push(t),er(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case I.b.SELECTION_SET:{let e=ew(this.getType());this._parentTypeStack.push(el(e)?e:void 0);break}case I.b.FIELD:{let a,i,n=this.getParentType();n&&(a=this._getFieldDef(t,n,e))&&(i=a.type),this._fieldDefStack.push(a),this._typeStack.push(er(i)?i:void 0);break}case I.b.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case I.b.OPERATION_DEFINITION:{let a=t.getRootType(e.operation);this._typeStack.push(q(a)?a:void 0);break}case I.b.INLINE_FRAGMENT:case I.b.FRAGMENT_DEFINITION:{let a=e.typeCondition,i=a?t$(t,a):ew(this.getType());this._typeStack.push(er(i)?i:void 0);break}case I.b.VARIABLE_DEFINITION:{let a=t$(t,e.type);this._inputTypeStack.push(ei(a)?a:void 0);break}case I.b.ARGUMENT:{var a;let t,i,n=null!=(a=this.getDirective())?a:this.getFieldDef();n&&(t=n.args.find(t=>t.name===e.name.value))&&(i=t.type),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(ei(i)?i:void 0);break}case I.b.LIST:{let e=eb(this.getInputType()),t=Z(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ei(t)?t:void 0);break}case I.b.OBJECT_FIELD:{let t,a,i=ew(this.getInputType());K(i)&&(a=i.getFields()[e.name.value])&&(t=a.type),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(ei(t)?t:void 0);break}case I.b.ENUM:{let t,a=ew(this.getInputType());W(a)&&(t=a.getValue(e.value)),this._enumValue=t}}}leave(e){switch(e.kind){case I.b.SELECTION_SET:this._parentTypeStack.pop();break;case I.b.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case I.b.DIRECTIVE:this._directive=null;break;case I.b.OPERATION_DEFINITION:case I.b.INLINE_FRAGMENT:case I.b.FRAGMENT_DEFINITION:this._typeStack.pop();break;case I.b.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case I.b.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case I.b.LIST:case I.b.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case I.b.ENUM:this._enumValue=null}}}function tB(e,t,a){let i=a.name.value;return i===tv.name&&e.getQueryType()===t?tv:i===tg.name&&e.getQueryType()===t?tg:i===ty.name&&el(t)?ty:q(t)||z(t)?t.getFields()[i]:void 0}function tR(e,t){return{enter(...a){let i=a[0];e.enter(i);let n=(0,tI.XO)(t,i.kind).enter;if(n){let r=n.apply(t,a);return void 0!==r&&(e.leave(i),(0,y.Ll)(r)&&e.enter(r)),r}},leave(...a){let i,n=a[0],r=(0,tI.XO)(t,n.kind).leave;return r&&(i=r.apply(t,a)),e.leave(n),i}}}var tV=a(3420);function tP(e){return{Document(t){for(let a of t.definitions)if(!(0,tV._m)(a)){let t=a.kind===I.b.SCHEMA_DEFINITION||a.kind===I.b.SCHEMA_EXTENSION?"schema":'"'+a.name.value+'"';e.reportError(new g.eO(`The ${t} definition is not executable.`,{nodes:a}))}return!1}}}function tL(e){return{Field(t){let a=e.getParentType();if(a&&!e.getFieldDef()){var i,n;let r=e.getSchema(),o=t.name.value,s=b("to use an inline fragment on",function(e,t,a){if(!eu(t))return[];let i=new Set,n=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[a])for(let e of(i.add(o),n[o.name]=1,o.getInterfaces())){var r;e.getFields()[a]&&(i.add(e),n[e.name]=(null!=(r=n[e.name])?r:0)+1)}return[...i].sort((t,a)=>{let i=n[a.name]-n[t.name];return 0!==i?i:z(t)&&e.isSubType(t,a)?-1:z(a)&&e.isSubType(a,t)?1:A(t.name,a.name)}).map(e=>e.name)}(r,a,o));""===s&&(s=b((i=a,n=o,q(i)||z(i)?T(n,Object.keys(i.getFields())):[]))),e.reportError(new g.eO(`Cannot query field "${o}" on type "${a.name}".`+s,{nodes:t}))}}}}function tM(e){return{InlineFragment(t){let a=t.typeCondition;if(a){let t=t$(e.getSchema(),a);if(t&&!el(t)){let t=(0,$.y)(a);e.reportError(new g.eO(`Fragment cannot condition on non composite type "${t}".`,{nodes:a}))}}},FragmentDefinition(t){let a=t$(e.getSchema(),t.typeCondition);if(a&&!el(a)){let a=(0,$.y)(t.typeCondition);e.reportError(new g.eO(`Fragment "${t.name.value}" cannot condition on non composite type "${a}".`,{nodes:t.typeCondition}))}}}}function tU(e){return{...tq(e),Argument(t){let a=e.getArgument(),i=e.getFieldDef(),n=e.getParentType();if(!a&&i&&n){let a=t.name.value,r=T(a,i.args.map(e=>e.name));e.reportError(new g.eO(`Unknown argument "${a}" on field "${n.name}.${i.name}".`+b(r),{nodes:t}))}}}}function tq(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.args.map(e=>e.name);for(let a of e.getDocument().definitions)if(a.kind===I.b.DIRECTIVE_DEFINITION){var i;let e=null!=(i=a.arguments)?i:[];t[a.name.value]=e.map(e=>e.name.value)}return{Directive(a){let i=a.name.value,n=t[i];if(a.arguments&&n)for(let t of a.arguments){let a=t.name.value;if(!n.includes(a)){let r=T(a,n);e.reportError(new g.eO(`Unknown argument "${a}" on directive "@${i}".`+b(r),{nodes:t}))}}return!1}}}function tG(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=e.locations;for(let a of e.getDocument().definitions)a.kind===I.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=a.locations.map(e=>e.value));return{Directive(a,i,n,r,o){let s=a.name.value,p=t[s];if(!p)return void e.reportError(new g.eO(`Unknown directive "@${s}".`,{nodes:a}));let l=function(e){let t=e[e.length-1];switch("kind"in t||(0,tn.V)(!1),t.kind){case I.b.OPERATION_DEFINITION:var a=t.operation;switch(a){case y.cE.QUERY:return eY.H.QUERY;case y.cE.MUTATION:return eY.H.MUTATION;case y.cE.SUBSCRIPTION:return eY.H.SUBSCRIPTION}return;case I.b.FIELD:return eY.H.FIELD;case I.b.FRAGMENT_SPREAD:return eY.H.FRAGMENT_SPREAD;case I.b.INLINE_FRAGMENT:return eY.H.INLINE_FRAGMENT;case I.b.FRAGMENT_DEFINITION:return eY.H.FRAGMENT_DEFINITION;case I.b.VARIABLE_DEFINITION:return eY.H.VARIABLE_DEFINITION;case I.b.SCHEMA_DEFINITION:case I.b.SCHEMA_EXTENSION:return eY.H.SCHEMA;case I.b.SCALAR_TYPE_DEFINITION:case I.b.SCALAR_TYPE_EXTENSION:return eY.H.SCALAR;case I.b.OBJECT_TYPE_DEFINITION:case I.b.OBJECT_TYPE_EXTENSION:return eY.H.OBJECT;case I.b.FIELD_DEFINITION:return eY.H.FIELD_DEFINITION;case I.b.INTERFACE_TYPE_DEFINITION:case I.b.INTERFACE_TYPE_EXTENSION:return eY.H.INTERFACE;case I.b.UNION_TYPE_DEFINITION:case I.b.UNION_TYPE_EXTENSION:return eY.H.UNION;case I.b.ENUM_TYPE_DEFINITION:case I.b.ENUM_TYPE_EXTENSION:return eY.H.ENUM;case I.b.ENUM_VALUE_DEFINITION:return eY.H.ENUM_VALUE;case I.b.INPUT_OBJECT_TYPE_DEFINITION:case I.b.INPUT_OBJECT_TYPE_EXTENSION:return eY.H.INPUT_OBJECT;case I.b.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return"kind"in t||(0,tn.V)(!1),t.kind===I.b.INPUT_OBJECT_TYPE_DEFINITION?eY.H.INPUT_FIELD_DEFINITION:eY.H.ARGUMENT_DEFINITION}default:(0,tn.V)(!1,"Unexpected kind: "+(0,v.N)(t.kind))}}(o);l&&!p.includes(l)&&e.reportError(new g.eO(`Directive "@${s}" may not be used on ${l}.`,{nodes:a}))}}}function tz(e){return{FragmentSpread(t){let a=t.name.value;e.getFragment(a)||e.reportError(new g.eO(`Unknown fragment "${a}".`,{nodes:t.name}))}}}function tY(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),i=Object.create(null);for(let t of e.getDocument().definitions)(0,tV.a6)(t)&&(i[t.name.value]=!0);let n=[...Object.keys(a),...Object.keys(i)];return{NamedType(t,r,o,s,p){let l=t.name.value;if(!a[l]&&!i[l]){var d,u;let a=null!=(d=p[2])?d:o,i=null!=a&&"kind"in(u=a)&&((0,tV.xu)(u)||(0,tV.fT)(u));if(i&&tJ.includes(l))return;let r=T(l,i?tJ.concat(n):n);e.reportError(new g.eO(`Unknown type "${l}".`+b(r),{nodes:t}))}}}}let tJ=[...e1,...tb].map(e=>e.name);function tQ(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===I.b.OPERATION_DEFINITION).length},OperationDefinition(a){!a.name&&t>1&&e.reportError(new g.eO("This anonymous operation must be the only defined operation.",{nodes:a}))}}}function tW(e){var t,a,i;let n=e.getSchema(),r=null!=(t=null!=(a=null!=(i=null==n?void 0:n.astNode)?i:null==n?void 0:n.getQueryType())?a:null==n?void 0:n.getMutationType())?t:null==n?void 0:n.getSubscriptionType(),o=0;return{SchemaDefinition(t){r?e.reportError(new g.eO("Cannot define a new schema within a schema extension.",{nodes:t})):(o>0&&e.reportError(new g.eO("Must provide only one schema definition.",{nodes:t})),++o)}}}function tH(e){return{Field(t){if(("__schema"===t.name.value||"__type"===t.name.value)&&function t(a,i=Object.create(null),n=0){if(a.kind===I.b.FRAGMENT_SPREAD){let r=a.name.value;if(!0===i[r])return!1;let o=e.getFragment(r);if(!o)return!1;try{return i[r]=!0,t(o,i,n)}finally{i[r]=void 0}}if(a.kind===I.b.FIELD&&("fields"===a.name.value||"interfaces"===a.name.value||"possibleTypes"===a.name.value||"inputFields"===a.name.value)&&++n>=3)return!0;if("selectionSet"in a&&a.selectionSet){for(let e of a.selectionSet.selections)if(t(e,i,n))return!0}return!1}(t))return e.reportError(new g.eO("Maximum introspection depth exceeded",{nodes:[t]})),!1}}}function tK(e){let t=Object.create(null),a=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:n=>((function n(r){if(t[r.name.value])return;let o=r.name.value;t[o]=!0;let s=e.getFragmentSpreads(r.selectionSet);if(0!==s.length){for(let t of(i[o]=a.length,s)){let r=t.name.value,o=i[r];if(a.push(t),void 0===o){let t=e.getFragment(r);t&&n(t)}else{let t=a.slice(o),i=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new g.eO(`Cannot spread fragment "${r}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:t}))}a.pop()}i[o]=void 0}})(n),!1)}}function tX(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:i}of e.getRecursiveVariableUsages(a)){let n=i.name.value;!0!==t[n]&&e.reportError(new g.eO(a.name?`Variable "$${n}" is not defined by operation "${a.name.value}".`:`Variable "$${n}" is not defined.`,{nodes:[i,a]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function tZ(e){let t=[],a=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(a.push(e),!1),Document:{leave(){let i=Object.create(null);for(let a of t)for(let t of e.getRecursivelyReferencedFragments(a))i[t.name.value]=!0;for(let t of a){let a=t.name.value;!0!==i[a]&&e.reportError(new g.eO(`Fragment "${a}" is never used.`,{nodes:t}))}}}}}function t1(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(a){let i=Object.create(null);for(let{node:t}of e.getRecursiveVariableUsages(a))i[t.name.value]=!0;for(let n of t){let t=n.variable.name.value;!0!==i[t]&&e.reportError(new g.eO(a.name?`Variable "$${t}" is never used in operation "${a.name.value}".`:`Variable "$${t}" is never used.`,{nodes:n}))}}},VariableDefinition(e){t.push(e)}}}function t2(e){switch(e.kind){case I.b.OBJECT:return{...e,fields:e.fields.map(e=>({...e,value:t2(e.value)})).sort((e,t)=>A(e.name.value,t.name.value))};case I.b.LIST:return{...e,values:e.values.map(t2)};case I.b.INT:case I.b.FLOAT:case I.b.STRING:case I.b.BOOLEAN:case I.b.NULL:case I.b.ENUM:case I.b.VARIABLE:return e}}function t0(e){let t=new t7,a=new ae,i=new Map;return{SelectionSet(n){for(let[[r,o],s,p]of function(e,t,a,i,n,r){let o=[],[s,p]=t5(e,t,n,r);if(function(e,t,a,i,n,r){for(let[o,s]of Object.entries(r))if(s.length>1)for(let r=0;r<s.length;r++)for(let p=r+1;p<s.length;p++){let l=t8(e,a,i,n,!1,o,s[r],s[p]);l&&t.push(l)}}(e,o,t,a,i,s),0!==p.length)for(let n=0;n<p.length;n++){t6(e,o,t,a,i,!1,s,p[n]);for(let r=n+1;r<p.length;r++)t4(e,o,t,a,i,!1,p[n],p[r])}return o}(e,i,t,a,e.getParentType(),n)){let t=function e(t){return Array.isArray(t)?t.map(([t,a])=>`subfields "${t}" conflict because `+e(a)).join(" and "):t}(o);e.reportError(new g.eO(`Fields "${r}" conflict because ${t}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:s.concat(p)}))}}}}function t6(e,t,a,i,n,r,o,s){if(i.has(o,s,r))return;i.add(o,s,r);let p=e.getFragment(s);if(!p)return;let[l,d]=t9(e,a,p);if(o!==l)for(let s of(t3(e,t,a,i,n,r,o,l),d))t6(e,t,a,i,n,r,o,s)}function t4(e,t,a,i,n,r,o,s){if(o===s||n.has(o,s,r))return;n.add(o,s,r);let p=e.getFragment(o),l=e.getFragment(s);if(!p||!l)return;let[d,u]=t9(e,a,p),[c,m]=t9(e,a,l);for(let s of(t3(e,t,a,i,n,r,d,c),m))t4(e,t,a,i,n,r,o,s);for(let o of u)t4(e,t,a,i,n,r,o,s)}function t3(e,t,a,i,n,r,o,s){for(let[p,l]of Object.entries(o)){let o=s[p];if(o)for(let s of l)for(let l of o){let o=t8(e,a,i,n,r,p,s,l);o&&t.push(o)}}}function t8(e,t,a,i,n,r,o,s){let[p,l,d]=o,[u,c,m]=s,f=n||p!==u&&q(p)&&q(u);if(!f){let e=l.name.value,t=c.name.value;if(e!==t)return[[r,`"${e}" and "${t}" are different fields`],[l],[c]];if(!function(e,t){let a=e.arguments,i=t.arguments;if(void 0===a||0===a.length)return void 0===i||0===i.length;if(void 0===i||0===i.length||a.length!==i.length)return!1;let n=new Map(i.map(({name:e,value:t})=>[e.value,t]));return a.every(e=>{let t=e.value,a=n.get(e.name.value);return void 0!==a&&function(e){return(0,$.y)(t2(e))}(t)===function(e){return(0,$.y)(t2(e))}(a)})}(l,c))return[[r,"they have differing arguments"],[l],[c]]}let h=null==d?void 0:d.type,g=null==m?void 0:m.type;if(h&&g&&function e(t,a){return Z(t)?!Z(a)||e(t.ofType,a.ofType):!!Z(a)||(et(t)?!et(a)||e(t.ofType,a.ofType):!!et(a)||!!(es(t)||es(a))&&t!==a)}(h,g))return[[r,`they return conflicting types "${(0,v.N)(h)}" and "${(0,v.N)(g)}"`],[l],[c]];let y=l.selectionSet,b=c.selectionSet;if(y&&b){var D=function(e,t,a,i,n,r,o,s,p){let l=[],[d,u]=t5(e,t,r,o),[c,m]=t5(e,t,s,p);for(let r of(t3(e,l,t,a,i,n,d,c),m))t6(e,l,t,a,i,n,d,r);for(let r of u)t6(e,l,t,a,i,n,c,r);for(let r of u)for(let o of m)t4(e,l,t,a,i,n,r,o);return l}(e,t,a,i,f,ew(h),y,ew(g),b),x=r,w=l,_=c;return D.length>0?[[x,D.map(([e])=>e)],[w,...D.map(([,e])=>e).flat()],[_,...D.map(([,,e])=>e).flat()]]:void 0}}function t5(e,t,a,i){let n=t.get(i);if(n)return n;let r=Object.create(null),o=Object.create(null);!function e(t,a,i,n,r){for(let o of i.selections)switch(o.kind){case I.b.FIELD:{let e,t=o.name.value;(q(a)||z(a))&&(e=a.getFields()[t]);let i=o.alias?o.alias.value:t;n[i]||(n[i]=[]),n[i].push([a,o,e]);break}case I.b.FRAGMENT_SPREAD:r[o.name.value]=!0;break;case I.b.INLINE_FRAGMENT:{let i=o.typeCondition,s=i?t$(t.getSchema(),i):a;e(t,s,o.selectionSet,n,r)}}}(e,a,i,r,o);let s=[r,Object.keys(o)];return t.set(i,s),s}function t9(e,t,a){let i=t.get(a.selectionSet);if(i)return i;let n=t$(e.getSchema(),a.typeCondition);return t5(e,t,n,a.selectionSet)}class t7{constructor(){this._data=new Map}has(e,t,a){var i;let n=null==(i=this._data.get(e))?void 0:i.get(t);return void 0!==n&&(!!a||a===n)}add(e,t,a){let i=this._data.get(e);void 0===i?this._data.set(e,new Map([[t,a]])):i.set(t,a)}}class ae{constructor(){this._orderedPairSet=new t7}has(e,t,a){return e<t?this._orderedPairSet.has(e,t,a):this._orderedPairSet.has(t,e,a)}add(e,t,a){e<t?this._orderedPairSet.add(e,t,a):this._orderedPairSet.add(t,e,a)}}function at(e){return{InlineFragment(t){let a=e.getType(),i=e.getParentType();if(el(a)&&el(i)&&!ez(e.getSchema(),a,i)){let n=(0,v.N)(i),r=(0,v.N)(a);e.reportError(new g.eO(`Fragment cannot be spread here as objects of type "${n}" can never be of type "${r}".`,{nodes:t}))}},FragmentSpread(t){let a=t.name.value,i=function(e,t){let a=e.getFragment(t);if(a){let t=t$(e.getSchema(),a.typeCondition);if(el(t))return t}}(e,a),n=e.getParentType();if(i&&n&&!ez(e.getSchema(),i,n)){let r=(0,v.N)(n),o=(0,v.N)(i);e.reportError(new g.eO(`Fragment "${a}" cannot be spread here as objects of type "${r}" can never be of type "${o}".`,{nodes:t}))}}}}function aa(e){let t=e.getSchema(),a=Object.create(null);for(let t of e.getDocument().definitions)(0,tV.a6)(t)&&(a[t.name.value]=t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){var n;let r,o=i.name.value,s=a[o],p=null==t?void 0:t.getType(o);if(s?r=ai[s.kind]:p&&(r=M(n=p)?I.b.SCALAR_TYPE_EXTENSION:q(n)?I.b.OBJECT_TYPE_EXTENSION:z(n)?I.b.INTERFACE_TYPE_EXTENSION:J(n)?I.b.UNION_TYPE_EXTENSION:W(n)?I.b.ENUM_TYPE_EXTENSION:K(n)?I.b.INPUT_OBJECT_TYPE_EXTENSION:void(0,tn.V)(!1,"Unexpected type: "+(0,v.N)(n))),r){if(r!==i.kind){let t=function(e){switch(e){case I.b.SCALAR_TYPE_EXTENSION:return"scalar";case I.b.OBJECT_TYPE_EXTENSION:return"object";case I.b.INTERFACE_TYPE_EXTENSION:return"interface";case I.b.UNION_TYPE_EXTENSION:return"union";case I.b.ENUM_TYPE_EXTENSION:return"enum";case I.b.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,tn.V)(!1,"Unexpected kind: "+(0,v.N)(e))}}(i.kind);e.reportError(new g.eO(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{let n=T(o,Object.keys({...a,...null==t?void 0:t.getTypeMap()}));e.reportError(new g.eO(`Cannot extend type "${o}" because it is not defined.`+b(n),{nodes:i.name}))}}}let ai={[I.b.SCALAR_TYPE_DEFINITION]:I.b.SCALAR_TYPE_EXTENSION,[I.b.OBJECT_TYPE_DEFINITION]:I.b.OBJECT_TYPE_EXTENSION,[I.b.INTERFACE_TYPE_DEFINITION]:I.b.INTERFACE_TYPE_EXTENSION,[I.b.UNION_TYPE_DEFINITION]:I.b.UNION_TYPE_EXTENSION,[I.b.ENUM_TYPE_DEFINITION]:I.b.ENUM_TYPE_EXTENSION,[I.b.INPUT_OBJECT_TYPE_DEFINITION]:I.b.INPUT_OBJECT_TYPE_EXTENSION};function an(e){return{...ar(e),Field:{leave(t){var a;let i=e.getFieldDef();if(!i)return!1;let n=new Set(null==(a=t.arguments)?void 0:a.map(e=>e.name.value));for(let a of i.args)if(!n.has(a.name)&&eI(a)){let n=(0,v.N)(a.type);e.reportError(new g.eO(`Field "${i.name}" argument "${a.name}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}}function ar(e){var t,a;let i=Object.create(null),n=e.getSchema();for(let e of null!=(t=null==n?void 0:n.getDirectives())?t:ta)i[e.name]=_(e.args.filter(eI),e=>e.name);for(let t of e.getDocument().definitions)if(t.kind===I.b.DIRECTIVE_DEFINITION){let e=null!=(a=t.arguments)?a:[];i[t.name.value]=_(e.filter(ao),e=>e.name.value)}return{Directive:{leave(t){let a=t.name.value,n=i[a];if(n){var r;let i=new Set((null!=(r=t.arguments)?r:[]).map(e=>e.name.value));for(let[r,o]of Object.entries(n))if(!i.has(r)){let i=P(o.type)?(0,v.N)(o.type):(0,$.y)(o.type);e.reportError(new g.eO(`Directive "@${a}" argument "${r}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}}function ao(e){return e.type.kind===I.b.NON_NULL_TYPE&&null==e.defaultValue}function as(e){return{Field(t){let a=e.getType(),i=t.selectionSet;if(a)if(es(ew(a))){if(i){let n=t.name.value,r=(0,v.N)(a);e.reportError(new g.eO(`Field "${n}" must not have a selection since type "${r}" has no subfields.`,{nodes:i}))}}else if(i){if(0===i.selections.length){let i=t.name.value,n=(0,v.N)(a);e.reportError(new g.eO(`Field "${i}" of type "${n}" must have at least one field selected.`,{nodes:t}))}}else{let i=t.name.value,n=(0,v.N)(a);e.reportError(new g.eO(`Field "${i}" of type "${n}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}function ap(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function al(e,t,a){return{prev:e,key:t,typename:a}}function ad(e){let t=[],a=e;for(;a;)t.push(a.key),a=a.prev;return t.reverse()}function au(e,t,a=ac){return function e(t,a,i,n){if(et(a))return null!=t?e(t,a.ofType,i,n):void i(ad(n),t,new g.eO(`Expected non-nullable type "${(0,v.N)(a)}" not to be null.`));if(null==t)return null;if(Z(a)){let r=a.ofType;return tr(t)?Array.from(t,(t,a)=>e(t,r,i,al(n,a,void 0))):[e(t,r,i,n)]}if(K(a)){if(!(0,w.Z)(t)||Array.isArray(t))return void i(ad(n),t,new g.eO(`Expected type "${a.name}" to be an object.`));let r={},o=a.getFields();for(let s of Object.values(o)){let o=t[s.name];if(void 0===o){if(void 0!==s.defaultValue)r[s.name]=s.defaultValue;else if(et(s.type)){let e=(0,v.N)(s.type);i(ad(n),t,new g.eO(`Field "${s.name}" of required type "${e}" was not provided.`))}continue}r[s.name]=e(o,s.type,i,al(n,s.name,a.name))}for(let e of Object.keys(t))if(!o[e]){let r=T(e,Object.keys(a.getFields()));i(ad(n),t,new g.eO(`Field "${e}" is not defined by type "${a.name}".`+b(r)))}if(a.isOneOf){let e=Object.keys(r);1!==e.length&&i(ad(n),t,new g.eO(`Exactly one key must be specified for OneOf type "${a.name}".`));let o=e[0],s=r[o];null===s&&i(ad(n).concat(o),s,new g.eO(`Field "${o}" must be non-null.`))}return r}if(es(a)){let e;try{e=a.parseValue(t)}catch(e){e instanceof g.eO?i(ad(n),t,e):i(ad(n),t,new g.eO(`Expected type "${a.name}". `+e.message,{originalError:e}));return}return void 0===e&&i(ad(n),t,new g.eO(`Expected type "${a.name}".`)),e}(0,tn.V)(!1,"Unexpected input type: "+(0,v.N)(a))}(e,t,a,void 0)}function ac(e,t,a){let i="Invalid value "+(0,v.N)(t);throw e.length>0&&(i+=` at "value${ap(e)}"`),a.message=i+": "+a.message,a}function am(e,t,a){if(e){if(e.kind===I.b.VARIABLE){let i=e.name.value;if(null==a||void 0===a[i])return;let n=a[i];if(null===n&&et(t))return;return n}if(et(t)){if(e.kind===I.b.NULL)return;return am(e,t.ofType,a)}if(e.kind===I.b.NULL)return null;if(Z(t)){let i=t.ofType;if(e.kind===I.b.LIST){let t=[];for(let n of e.values)if(af(n,a)){if(et(i))return;t.push(null)}else{let e=am(n,i,a);if(void 0===e)return;t.push(e)}return t}let n=am(e,i,a);if(void 0===n)return;return[n]}if(K(t)){if(e.kind!==I.b.OBJECT)return;let i=Object.create(null),n=_(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=n[e.name];if(!t||af(t.value,a)){if(void 0!==e.defaultValue)i[e.name]=e.defaultValue;else if(et(e.type))return;continue}let r=am(t.value,e.type,a);if(void 0===r)return;i[e.name]=r}if(t.isOneOf){let e=Object.keys(i);if(1!==e.length||null===i[e[0]])return}return i}if(es(t)){let i;try{i=t.parseLiteral(e,a)}catch(e){return}if(void 0===i)return;return i}(0,tn.V)(!1,"Unexpected input type: "+(0,v.N)(t))}}function af(e,t){return e.kind===I.b.VARIABLE&&(null==t||void 0===t[e.name.value])}function ah(e,t,a,i){let n=[],r=null==i?void 0:i.maxErrors;try{let i=function(e,t,a,i){let n={};for(let r of t){let t=r.variable.name.value,o=t$(e,r.type);if(!ei(o)){let e=(0,$.y)(r.type);i(new g.eO(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:r.type}));continue}if(!ay(a,t)){if(r.defaultValue)n[t]=am(r.defaultValue,o);else if(et(o)){let e=(0,v.N)(o);i(new g.eO(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:r}))}continue}let s=a[t];if(null===s&&et(o)){let e=(0,v.N)(o);i(new g.eO(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:r}));continue}n[t]=au(s,o,(e,a,n)=>{let o=`Variable "$${t}" got invalid value `+(0,v.N)(a);e.length>0&&(o+=` at "${t}${ap(e)}"`),i(new g.eO(o+"; "+n.message,{nodes:r,originalError:n}))})}return n}(e,t,a,e=>{if(null!=r&&n.length>=r)throw new g.eO("Too many errors processing variables, error limit reached. Execution aborted.");n.push(e)});if(0===n.length)return{coerced:i}}catch(e){n.push(e)}return{errors:n}}function av(e,t,a){var i;let n={},r=_(null!=(i=t.arguments)?i:[],e=>e.name.value);for(let i of e.args){let e=i.name,o=i.type,s=r[e];if(!s){if(void 0!==i.defaultValue)n[e]=i.defaultValue;else if(et(o))throw new g.eO(`Argument "${e}" of required type "${(0,v.N)(o)}" was not provided.`,{nodes:t});continue}let p=s.value,l=p.kind===I.b.NULL;if(p.kind===I.b.VARIABLE){let t=p.name.value;if(null==a||!ay(a,t)){if(void 0!==i.defaultValue)n[e]=i.defaultValue;else if(et(o))throw new g.eO(`Argument "${e}" of required type "${(0,v.N)(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:p});continue}l=null==a[t]}if(l&&et(o))throw new g.eO(`Argument "${e}" of non-null type "${(0,v.N)(o)}" must not be null.`,{nodes:p});let d=am(p,o,a);if(void 0===d)throw new g.eO(`Argument "${e}" has invalid value ${(0,$.y)(p)}.`,{nodes:p});n[e]=d}return n}function ag(e,t,a){var i;let n=null==(i=t.directives)?void 0:i.find(t=>t.name.value===e.name);if(n)return av(e,n,a)}function ay(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ab(e,t,a,i,n){let r=new Map;return aD(e,t,a,i,n,r,new Set),r}function aD(e,t,a,i,n,r,o){for(let p of n.selections)switch(p.kind){case I.b.FIELD:{var s;if(!ax(a,p))continue;let e=(s=p).alias?s.alias.value:s.name.value,t=r.get(e);void 0!==t?t.push(p):r.set(e,[p]);break}case I.b.INLINE_FRAGMENT:if(!ax(a,p)||!aw(e,p,i))continue;aD(e,t,a,i,p.selectionSet,r,o);break;case I.b.FRAGMENT_SPREAD:{let n=p.name.value;if(o.has(n)||!ax(a,p))continue;o.add(n);let s=t[n];if(!s||!aw(e,s,i))continue;aD(e,t,a,i,s.selectionSet,r,o)}}}function ax(e,t){let a=ag(e5,t,e);if((null==a?void 0:a.if)===!0)return!1;let i=ag(e8,t,e);return(null==i?void 0:i.if)!==!1}function aw(e,t,a){let i=t.typeCondition;if(!i)return!0;let n=t$(e,i);return n===a||!!eu(n)&&e.isSubType(n,a)}function a_(e){return{OperationDefinition(t){if("subscription"===t.operation){let a=e.getSchema(),i=a.getSubscriptionType();if(i){let n=t.name?t.name.value:null,r=Object.create(null),o=e.getDocument(),s=Object.create(null);for(let e of o.definitions)e.kind===I.b.FRAGMENT_DEFINITION&&(s[e.name.value]=e);let p=ab(a,s,r,i,t.selectionSet);if(p.size>1){let t=[...p.values()].slice(1).flat();e.reportError(new g.eO(null!=n?`Subscription "${n}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(let t of p.values())t[0].name.value.startsWith("__")&&e.reportError(new g.eO(null!=n?`Subscription "${n}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}function aE(e,t){let a=new Map;for(let i of e){let e=t(i),n=a.get(e);void 0===n?a.set(e,[i]):n.push(i)}return a}function aF(e){return{DirectiveDefinition(e){var t;let i=null!=(t=e.arguments)?t:[];return a(`@${e.name.value}`,i)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t,i;let n=e.name.value;for(let r of null!=(t=e.fields)?t:[]){let e=r.name.value;a(`${n}.${e}`,null!=(i=r.arguments)?i:[])}return!1}function a(t,a){for(let[i,n]of aE(a,e=>e.name.value))n.length>1&&e.reportError(new g.eO(`Argument "${t}(${i}:)" can only be defined once.`,{nodes:n.map(e=>e.name)}));return!1}}function aA(e){return{Field:t,Directive:t};function t(t){var a;for(let[i,n]of aE(null!=(a=t.arguments)?a:[],e=>e.name.value))n.length>1&&e.reportError(new g.eO(`There can be only one argument named "${i}".`,{nodes:n.map(e=>e.name)}))}}function aC(e){let t=Object.create(null),a=e.getSchema();return{DirectiveDefinition(i){let n=i.name.value;return null!=a&&a.getDirective(n)?void e.reportError(new g.eO(`Directive "@${n}" already exists in the schema. It cannot be redefined.`,{nodes:i.name})):(t[n]?e.reportError(new g.eO(`There can be only one directive named "@${n}".`,{nodes:[t[n],i.name]})):t[n]=i.name,!1)}}}function aS(e){let t=Object.create(null),a=e.getSchema();for(let e of a?a.getDirectives():ta)t[e.name]=!e.isRepeatable;for(let a of e.getDocument().definitions)a.kind===I.b.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let i=Object.create(null),n=Object.create(null);return{enter(a){let r;if("directives"in a&&a.directives){if(a.kind===I.b.SCHEMA_DEFINITION||a.kind===I.b.SCHEMA_EXTENSION)r=i;else if((0,tV.a6)(a)||(0,tV.i7)(a)){let e=a.name.value;void 0===(r=n[e])&&(n[e]=r=Object.create(null))}else r=Object.create(null);for(let i of a.directives){let a=i.name.value;t[a]&&(r[a]?e.reportError(new g.eO(`The directive "@${a}" can only be used once at this location.`,{nodes:[r[a],i]})):r[a]=i)}}}}}function aT(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{EnumTypeDefinition:n,EnumTypeExtension:n};function n(t){var n;let r=t.name.value;i[r]||(i[r]=Object.create(null));let o=null!=(n=t.values)?n:[],s=i[r];for(let t of o){let i=t.name.value,n=a[r];W(n)&&n.getValue(i)?e.reportError(new g.eO(`Enum value "${r}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[i]?e.reportError(new g.eO(`Enum value "${r}.${i}" can only be defined once.`,{nodes:[s[i],t.name]})):s[i]=t.name}return!1}}function ak(e){let t=e.getSchema(),a=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:n,InputObjectTypeExtension:n,InterfaceTypeDefinition:n,InterfaceTypeExtension:n,ObjectTypeDefinition:n,ObjectTypeExtension:n};function n(t){var n,r,o;let s=t.name.value;i[s]||(i[s]=Object.create(null));let p=null!=(n=t.fields)?n:[],l=i[s];for(let t of p){let i=t.name.value;(r=a[s],o=i,(q(r)||z(r)||K(r))&&null!=r.getFields()[o])?e.reportError(new g.eO(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):l[i]?e.reportError(new g.eO(`Field "${s}.${i}" can only be defined once.`,{nodes:[l[i],t.name]})):l[i]=t.name}return!1}}function aN(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(a){let i=a.name.value;return t[i]?e.reportError(new g.eO(`There can be only one fragment named "${i}".`,{nodes:[t[i],a.name]})):t[i]=a.name,!1}}}function aO(e){let t=[],a=Object.create(null);return{ObjectValue:{enter(){t.push(a),a=Object.create(null)},leave(){let e=t.pop();e||(0,tn.V)(!1),a=e}},ObjectField(t){let i=t.name.value;a[i]?e.reportError(new g.eO(`There can be only one input field named "${i}".`,{nodes:[a[i],t.name]})):a[i]=t.name}}}function aI(e){let t=Object.create(null);return{OperationDefinition(a){let i=a.name;return i&&(t[i.value]?e.reportError(new g.eO(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}}function a$(e){let t=e.getSchema(),a=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:n,SchemaExtension:n};function n(t){var n;for(let r of null!=(n=t.operationTypes)?n:[]){let t=r.operation,n=a[t];i[t]?e.reportError(new g.eO(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:r})):n?e.reportError(new g.eO(`There can be only one ${t} type in schema.`,{nodes:[n,r]})):a[t]=r}return!1}}function aj(e){let t=Object.create(null),a=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){let n=i.name.value;return null!=a&&a.getType(n)?void e.reportError(new g.eO(`Type "${n}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name})):(t[n]?e.reportError(new g.eO(`There can be only one type named "${n}".`,{nodes:[t[n],i.name]})):t[n]=i.name,!1)}}function aB(e){return{OperationDefinition(t){var a;for(let[i,n]of aE(null!=(a=t.variableDefinitions)?a:[],e=>e.variable.name.value))n.length>1&&e.reportError(new g.eO(`There can be only one variable named "$${i}".`,{nodes:n.map(e=>e.variable.name)}))}}}function aR(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!Z(eb(e.getParentInputType())))return aV(e,t),!1},ObjectValue(t){let a=ew(e.getInputType());if(!K(a))return aV(e,t),!1;let i=_(t.fields,e=>e.name.value);for(let n of Object.values(a.getFields()))if(!i[n.name]&&eU(n)){let i=(0,v.N)(n.type);e.reportError(new g.eO(`Field "${a.name}.${n.name}" of required type "${i}" was not provided.`,{nodes:t}))}a.isOneOf&&function(e,t,a,i){var n;let r=Object.keys(i);if(1!==r.length)return e.reportError(new g.eO(`OneOf Input Object "${a.name}" must specify exactly one key.`,{nodes:[t]}));let o=null==(n=i[r[0]])?void 0:n.value;o&&o.kind!==I.b.NULL||e.reportError(new g.eO(`Field "${a.name}.${r[0]}" must be non-null.`,{nodes:[t]}))}(e,t,a,i)},ObjectField(t){let a=ew(e.getParentInputType());if(!e.getInputType()&&K(a)){let i=T(t.name.value,Object.keys(a.getFields()));e.reportError(new g.eO(`Field "${t.name.value}" is not defined by type "${a.name}".`+b(i),{nodes:t}))}},NullValue(t){let a=e.getInputType();et(a)&&e.reportError(new g.eO(`Expected value of type "${(0,v.N)(a)}", found ${(0,$.y)(t)}.`,{nodes:t}))},EnumValue:t=>aV(e,t),IntValue:t=>aV(e,t),FloatValue:t=>aV(e,t),StringValue:t=>aV(e,t),BooleanValue:t=>aV(e,t)}}function aV(e,t){let a=e.getInputType();if(!a)return;let i=ew(a);if(!es(i)){let i=(0,v.N)(a);e.reportError(new g.eO(`Expected value of type "${i}", found ${(0,$.y)(t)}.`,{nodes:t}));return}try{let n=i.parseLiteral(t,void 0);if(void 0===n){let i=(0,v.N)(a);e.reportError(new g.eO(`Expected value of type "${i}", found ${(0,$.y)(t)}.`,{nodes:t}))}}catch(n){let i=(0,v.N)(a);n instanceof g.eO?e.reportError(n):e.reportError(new g.eO(`Expected value of type "${i}", found ${(0,$.y)(t)}; `+n.message,{nodes:t,originalError:n}))}}function aP(e){return{VariableDefinition(t){let a=t$(e.getSchema(),t.type);if(void 0!==a&&!ei(a)){let a=t.variable.name.value,i=(0,$.y)(t.type);e.reportError(new g.eO(`Variable "$${a}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function aL(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(a){for(let{node:p,type:l,defaultValue:d,parentType:u}of e.getRecursiveVariableUsages(a)){let a=p.name.value,c=t[a];if(c&&l){var i,n,r,o,s;let t=e.getSchema(),m=t$(t,c.type);if(m&&(i=t,n=m,r=c.defaultValue,o=l,s=d,et(o)&&!et(n)?!((null!=r&&r.kind!==I.b.NULL||void 0!==s)&&eG(i,n,o.ofType)):!eG(i,n,o))){let t=(0,v.N)(m),i=(0,v.N)(l);e.reportError(new g.eO(`Variable "$${a}" of type "${t}" used in position expecting type "${i}".`,{nodes:[c,p]}))}K(u)&&u.isOneOf&&eg(m)&&e.reportError(new g.eO(`Variable "$${a}" is of type "${m}" but must be non-nullable to be used for OneOf Input Object "${u}".`,{nodes:[c,p]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}let aM=Object.freeze([tH]),aU=Object.freeze([tP,aI,tQ,a_,tY,tM,aP,as,tL,aN,tz,tZ,at,tK,aB,tX,t1,tG,aS,tU,aA,aR,an,aL,t0,aO,...aM]),aq=Object.freeze([tW,a$,aj,aT,ak,aF,aC,tY,tG,aS,aa,tq,aA,aO,ar]);class aG{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{for(let e of(t=Object.create(null),this.getDocument().definitions))e.kind===I.b.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){let a;t=[];let i=[e];for(;a=i.pop();)for(let e of a.selections)e.kind===I.b.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&i.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){let a;t=[];let i=Object.create(null),n=[e.selectionSet];for(;a=n.pop();)for(let e of this.getFragmentSpreads(a)){let a=e.name.value;if(!0!==i[a]){i[a]=!0;let e=this.getFragment(a);e&&(t.push(e),n.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class az extends aG{constructor(e,t,a){super(e,a),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class aY extends aG{constructor(e,t,a,i){super(t,i),this._schema=e,this._typeInfo=a,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let a=[],i=new tj(this._schema);(0,tI.YR)(e,tR(i,{VariableDefinition:()=>!1,Variable(e){a.push({node:e,type:i.getInputType(),defaultValue:i.getDefaultValue(),parentType:i.getParentInputType()})}})),t=a,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){for(let a of(t=this.getVariableUsages(e),this.getRecursivelyReferencedFragments(e)))t=t.concat(this.getVariableUsages(a));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function aJ(e,t,a=aU,i,n=new tj(e)){var r;let o=null!=(r=null==i?void 0:i.maxErrors)?r:100;t||(0,m.U)(!1,"Must provide document."),tA(e);let s=Object.freeze({}),p=[],l=new aY(e,t,n,e=>{if(p.length>=o)throw p.push(new g.eO("Too many validation errors, error limit reached. Validation aborted.")),s;p.push(e)}),d=(0,tI.oP)(a.map(e=>e(l)));try{(0,tI.YR)(t,tR(n,d))}catch(e){if(e!==s)throw e}return p}function aQ(e,t,a=aq){let i=[],n=new az(e,t,e=>{i.push(e)}),r=a.map(e=>e(n));return(0,tI.YR)(e,(0,tI.oP)(r)),i}function aW(e){return Promise.all(Object.values(e)).then(t=>{let a=Object.create(null);for(let[i,n]of Object.keys(e).entries())a[n]=t[i];return a})}class aH extends Error{constructor(e){super("Unexpected error value: "+(0,v.N)(e)),this.name="NonErrorThrown",this.thrownValue=e}}function aK(e,t,a){var i;let n=e instanceof Error?e:new aH(e);return Array.isArray(n.path)?n:new g.eO(n.message,{nodes:null!=(i=n.nodes)?i:t,source:n.source,positions:n.positions,path:a,originalError:n})}let aX=(s=(e,t,a)=>(function(e,t,a,i,n){let r=new Map,o=new Set;for(let s of n)s.selectionSet&&aD(e,t,a,i,s.selectionSet,r,o);return r})(e.schema,e.fragments,e.variableValues,t,a),function(e,t,a){void 0===i&&(i=new WeakMap);let n=i.get(e);void 0===n&&(n=new WeakMap,i.set(e,n));let r=n.get(t);void 0===r&&(r=new WeakMap,n.set(t,r));let o=r.get(a);return void 0===o&&(o=s(e,t,a),r.set(a,o)),o});function aZ(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:a,variableValues:i,rootValue:n}=e;a0(t,a,i);let r=a6(e);if(!("schema"in r))return{errors:r};try{let{operation:e}=r,t=function(e,t,a){let i=e.schema.getRootType(t.operation);if(null==i)throw new g.eO(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let n=ab(e.schema,e.fragments,e.variableValues,i,t.selectionSet),r;switch(t.operation){case y.cE.QUERY:return a4(e,i,a,r,n);case y.cE.MUTATION:var o,s,p,l,d;return o=e,s=i,p=a,l=r,d=n,function(e,t,a){let i=a;for(let a of e)i=f(i)?i.then(e=>t(e,a)):t(i,a);return i}(d.entries(),(e,[t,a])=>{let i=al(l,t,s.name),n=a3(o,s,p,a,i);return void 0===n?e:f(n)?n.then(a=>(e[t]=a,e)):(e[t]=n,e)},Object.create(null));case y.cE.SUBSCRIPTION:return a4(e,i,a,r,n)}}(r,e,n);if(f(t))return t.then(e=>a2(e,r.errors),e=>(r.errors.push(e),a2(null,r.errors)));return a2(t,r.errors)}catch(e){return r.errors.push(e),a2(null,r.errors)}}function a1(e){let t=aZ(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function a2(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function a0(e,t,a){t||(0,m.U)(!1,"Must provide document."),tA(e),null==a||(0,w.Z)(a)||(0,m.U)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function a6(e){var t,a,i;let n,{schema:r,document:o,rootValue:s,contextValue:p,variableValues:l,operationName:d,fieldResolver:u,typeResolver:c,subscribeFieldResolver:m,options:f}=e,h=Object.create(null);for(let e of o.definitions)switch(e.kind){case I.b.OPERATION_DEFINITION:if(null==d){if(void 0!==n)return[new g.eO("Must provide operation name if query contains multiple operations.")];n=e}else(null==(t=e.name)?void 0:t.value)===d&&(n=e);break;case I.b.FRAGMENT_DEFINITION:h[e.name.value]=e}if(!n)return null!=d?[new g.eO(`Unknown operation named "${d}".`)]:[new g.eO("Must provide an operation.")];let v=ah(r,null!=(a=n.variableDefinitions)?a:[],null!=l?l:{},{maxErrors:null!=(i=null==f?void 0:f.maxCoercionErrors)?i:50});return v.errors?v.errors:{schema:r,fragments:h,rootValue:s,contextValue:p,operation:n,variableValues:v.coerced,fieldResolver:null!=u?u:ii,typeResolver:null!=c?c:ia,subscribeFieldResolver:null!=m?m:ii,errors:[]}}function a4(e,t,a,i,n){let r=Object.create(null),o=!1;try{for(let[s,p]of n.entries()){let n=al(i,s,t.name),l=a3(e,t,a,p,n);void 0!==l&&(r[s]=l,f(l)&&(o=!0))}}catch(e){if(o)return aW(r).finally(()=>{throw e});throw e}return o?aW(r):r}function a3(e,t,a,i,n){var r;let o=ir(e.schema,t,i[0]);if(!o)return;let s=o.type,p=null!=(r=o.resolve)?r:e.fieldResolver,l=a8(e,o,i,t,n);try{let t,r=av(o,i[0],e.variableValues),d=e.contextValue,u=p(a,r,d,l);if(t=f(u)?u.then(t=>a9(e,s,i,l,n,t)):a9(e,s,i,l,n,u),f(t))return t.then(void 0,t=>{let a=aK(t,i,ad(n));return a5(a,s,e)});return t}catch(t){return a5(aK(t,i,ad(n)),s,e)}}function a8(e,t,a,i,n){return{fieldName:t.name,fieldNodes:a,returnType:t.type,parentType:i,path:n,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function a5(e,t,a){if(et(t))throw e;return a.errors.push(e),null}function a9(e,t,a,i,n,r){var o,s,p,l,d,u,c;let m;if(r instanceof Error)throw r;if(et(t)){let o=a9(e,t.ofType,a,i,n,r);if(null===o)throw Error(`Cannot return null for non-nullable field ${i.parentType.name}.${i.fieldName}.`);return o}return null==r?null:Z(t)?function(e,t,a,i,n,r){if(!tr(r))throw new g.eO(`Expected Iterable, but did not find one for field "${i.parentType.name}.${i.fieldName}".`);let o=t.ofType,s=!1,p=Array.from(r,(t,r)=>{let p=al(n,r,void 0);try{let n;if(n=f(t)?t.then(t=>a9(e,o,a,i,p,t)):a9(e,o,a,i,p,t),f(n))return s=!0,n.then(void 0,t=>{let i=aK(t,a,ad(p));return a5(i,o,e)});return n}catch(t){return a5(aK(t,a,ad(p)),o,e)}});return s?Promise.all(p):p}(e,t,a,i,n,r):es(t)?function(e,t){let a=e.serialize(t);if(null==a)throw Error(`Expected \`${(0,v.N)(e)}.serialize(${(0,v.N)(t)})\` to return non-nullable value, returned: ${(0,v.N)(a)}`);return a}(t,r):eu(t)?(o=e,s=t,p=a,l=i,d=n,u=r,f(m=(null!=(c=s.resolveType)?c:o.typeResolver)(u,o.contextValue,l,s))?m.then(e=>ie(o,a7(e,o,s,p,l,u),p,l,d,u)):ie(o,a7(m,o,s,p,l,u),p,l,d,u)):q(t)?ie(e,t,a,i,n,r):void(0,tn.V)(!1,"Cannot complete value of unexpected output type: "+(0,v.N)(t))}function a7(e,t,a,i,n,r){if(null==e)throw new g.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${n.parentType.name}.${n.fieldName}". Either the "${a.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,i);if(q(e))throw new g.eO("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new g.eO(`Abstract type "${a.name}" must resolve to an Object type at runtime for field "${n.parentType.name}.${n.fieldName}" with value ${(0,v.N)(r)}, received "${(0,v.N)(e)}".`);let o=t.schema.getType(e);if(null==o)throw new g.eO(`Abstract type "${a.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:i});if(!q(o))throw new g.eO(`Abstract type "${a.name}" was resolved to a non-object type "${e}".`,{nodes:i});if(!t.schema.isSubType(a,o))throw new g.eO(`Runtime Object type "${o.name}" is not a possible type for "${a.name}".`,{nodes:i});return o}function ie(e,t,a,i,n,r){let o=aX(e,t,a);if(t.isTypeOf){let s=t.isTypeOf(r,e.contextValue,i);if(f(s))return s.then(i=>{if(!i)throw it(t,r,a);return a4(e,t,r,n,o)});if(!s)throw it(t,r,a)}return a4(e,t,r,n,o)}function it(e,t,a){return new g.eO(`Expected value of type "${e.name}" but got: ${(0,v.N)(t)}.`,{nodes:a})}let ia=function(e,t,a,i){if((0,w.Z)(e)&&"string"==typeof e.__typename)return e.__typename;let n=a.schema.getPossibleTypes(i),r=[];for(let i=0;i<n.length;i++){let o=n[i];if(o.isTypeOf){let n=o.isTypeOf(e,t,a);if(f(n))r[i]=n;else if(n)return r.length&&Promise.allSettled(r).catch(()=>{}),o.name}}if(r.length)return Promise.all(r).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return n[t].name})},ii=function(e,t,a,i){if((0,w.Z)(e)||"function"==typeof e){let n=e[i.fieldName];return"function"==typeof n?e[i.fieldName](t,a,i):n}};function ir(e,t,a){let i=a.name.value;return i===tv.name&&e.getQueryType()===t?tv:i===tg.name&&e.getQueryType()===t?tg:i===ty.name?ty:t.getFields()[i]}function io(e){return new Promise(t=>t(ip(e)))}function is(e){let t=ip(e);if(f(t))throw Error("GraphQL execution failed to complete synchronously.");return t}function ip(e){let t;arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:a,source:i,rootValue:n,contextValue:r,variableValues:o,operationName:s,fieldResolver:p,typeResolver:l}=e,d=tF(a);if(d.length>0)return{errors:d};try{t=(0,h.qg)(i)}catch(e){return{errors:[e]}}let u=aJ(a,t);return u.length>0?{errors:u}:aZ({schema:a,document:t,rootValue:n,contextValue:r,variableValues:o,operationName:s,fieldResolver:p,typeResolver:l})}var il=a(39537),id=a(73971),iu=a(8238),ic=a(98472),im=a(12039);function ih(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}async function iv(e){arguments.length<2||(0,m.U)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await ig(e);if(!ih(t))return t;let a=t[Symbol.asyncIterator]();async function i(t){if(t.done)return t;try{let a;return{value:await (a=t.value,aZ({...e,rootValue:a})),done:!1}}catch(e){if("function"==typeof a.return)try{await a.return()}catch(e){}throw e}}return{next:async()=>i(await a.next()),return:async()=>"function"==typeof a.return?i(await a.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof a.throw)return i(await a.throw(e));throw e},[Symbol.asyncIterator](){return this}}}async function ig(...e){let t,a=(t=e[0])&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]},{schema:i,document:n,variableValues:r}=a;a0(i,n,r);let o=a6(a);if(!("schema"in o))return{errors:o};try{let e=await iy(o);if(!ih(e))throw Error(`Subscription field must return Async Iterable. Received: ${(0,v.N)(e)}.`);return e}catch(e){if(e instanceof g.eO)return{errors:[e]};throw e}}async function iy(e){let{schema:t,fragments:a,operation:i,variableValues:n,rootValue:r}=e,o=t.getSubscriptionType();if(null==o)throw new g.eO("Schema is not configured to execute subscription operation.",{nodes:i});let[s,p]=[...ab(t,a,n,o,i.selectionSet).entries()][0],l=ir(t,o,p[0]);if(!l){let e=p[0].name.value;throw new g.eO(`The subscription field "${e}" is not defined.`,{nodes:p})}let d=al(void 0,s,o.name),u=a8(e,l,p,o,d);try{var c;let t=av(l,p[0],n),a=e.contextValue,i=null!=(c=l.subscribe)?c:e.subscribeFieldResolver,o=await i(r,t,a,u);if(o instanceof Error)throw o;return o}catch(e){throw aK(e,p,ad(d))}}function ib(e){return{Field(t){let a=e.getFieldDef(),i=null==a?void 0:a.deprecationReason;if(a&&null!=i){let n=e.getParentType();null!=n||(0,tn.V)(!1),e.reportError(new g.eO(`The field ${n.name}.${a.name} is deprecated. ${i}`,{nodes:t}))}},Argument(t){let a=e.getArgument(),i=null==a?void 0:a.deprecationReason;if(a&&null!=i){let n=e.getDirective();if(null!=n)e.reportError(new g.eO(`Directive "@${n.name}" argument "${a.name}" is deprecated. ${i}`,{nodes:t}));else{let n=e.getParentType(),r=e.getFieldDef();null!=n&&null!=r||(0,tn.V)(!1),e.reportError(new g.eO(`Field "${n.name}.${r.name}" argument "${a.name}" is deprecated. ${i}`,{nodes:t}))}}},ObjectField(t){let a=ew(e.getParentInputType());if(K(a)){let i=a.getFields()[t.name.value],n=null==i?void 0:i.deprecationReason;null!=n&&e.reportError(new g.eO(`The input field ${a.name}.${i.name} is deprecated. ${n}`,{nodes:t}))}},EnumValue(t){let a=e.getEnumValue(),i=null==a?void 0:a.deprecationReason;if(a&&null!=i){let n=ew(e.getInputType());null!=n||(0,tn.V)(!1),e.reportError(new g.eO(`The enum value "${n.name}.${a.name}" is deprecated. ${i}`,{nodes:t}))}}}}function iD(e){return{Field(t){let a=ew(e.getType());a&&tD(a)&&e.reportError(new g.eO(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var ix=a(59841);function iw(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},a=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",n=t.directiveIsRepeatable?"isRepeatable":"",r=t.schemaDescription?a:"";function o(e){return t.inputValueDeprecation?e:""}let s=t.oneOf?"isOneOf":"";return`
|
|
1024
1024
|
query IntrospectionQuery {
|
|
1025
1025
|
__schema {
|
|
1026
1026
|
${r}
|