@fugood/bricks-cli 2.25.0-beta.61 → 2.25.0-beta.62

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/387.js ADDED
@@ -0,0 +1,35 @@
1
+ export const __rspack_esm_id=387;export const __rspack_esm_ids=[387];export const __webpack_modules__={68089(t,e,r){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};let n=r(24434),s=o(r(3680)),i=o(r(9873)),a=s.default("agent-base");function l(){let{stack:t}=Error();return"string"==typeof t&&t.split("\n").some(t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:"))}function p(t,e){return new p.Agent(t,e)}var u=p||(p={});class c extends n.EventEmitter{constructor(t,e){super();let r=e;"function"==typeof t?this.callback=t:t&&(r=t),this.timeout=null,r&&"number"==typeof r.timeout&&(this.timeout=r.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:l()?443:80}set defaultPort(t){this.explicitDefaultPort=t}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:l()?"https:":"http:"}set protocol(t){this.explicitProtocol=t}callback(t,e,r){throw Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(t,e){let r=Object.assign({},e);"boolean"!=typeof r.secureEndpoint&&(r.secureEndpoint=l()),null==r.host&&(r.host="localhost"),null==r.port&&(r.port=r.secureEndpoint?443:80),null==r.protocol&&(r.protocol=r.secureEndpoint?"https:":"http:"),r.host&&r.path&&delete r.path,delete r.agent,delete r.hostname,delete r._defaultAgent,delete r.defaultPort,delete r.createConnection,t._last=!0,t.shouldKeepAlive=!1;let o=!1,n=null,s=r.timeout||this.timeout,p=e=>{t._hadError||(t.emit("error",e),t._hadError=!0)},u=t=>{o||(null!==n&&(clearTimeout(n),n=null),p(t))},c=e=>{if(!o){if(null!=n&&(clearTimeout(n),n=null),e&&"function"==typeof e.addRequest){a("Callback returned another Agent instance %o",e.constructor.name),e.addRequest(t,r);return}if(e){e.once("free",()=>{this.freeSocket(e,r)}),t.onSocket(e);return}p(Error(`no Duplex stream was returned to agent-base for \`${t.method} ${t.path}\``))}};if("function"!=typeof this.callback)return void p(Error("`callback` is not defined"));this.promisifiedCallback||(this.callback.length>=3?(a("Converting legacy callback function to promise"),this.promisifiedCallback=i.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof s&&s>0&&(n=setTimeout(()=>{n=null,o=!0;let t=Error(`A "socket" was not created for HTTP request before ${s}ms`);t.code="ETIMEOUT",p(t)},s)),"port"in r&&"number"!=typeof r.port&&(r.port=Number(r.port));try{a("Resolving socket for %o request: %o",r.protocol,`${t.method} ${t.path}`),Promise.resolve(this.promisifiedCallback(t,r)).then(c,u)}catch(t){Promise.reject(t).catch(u)}}freeSocket(t,e){a("Freeing socket %o %o",t.constructor.name,e),t.destroy()}destroy(){a("Destroying agent %o",this.constructor.name)}}u.Agent=c,u.prototype=u.Agent.prototype,t.exports=p},9873(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(e,r){return new Promise((o,n)=>{t.call(this,e,r,(t,e)=>{t?n(t):o(e)})})}}},35646(t,e,r){var o=this&&this.__awaiter||function(t,e,r,o){return new(r||(r=Promise))(function(n,s){function i(t){try{l(o.next(t))}catch(t){s(t)}}function a(t){try{l(o.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(i,a)}l((o=o.apply(t,e||[])).next())})},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});let s=n(r(69278)),i=n(r(64756)),a=n(r(87016)),l=n(r(42613)),p=n(r(3680)),u=r(68089),c=n(r(36981)),d=p.default("https-proxy-agent:agent");class f extends u.Agent{constructor(t){var e;let r;if(!(r="string"==typeof t?a.default.parse(t):t))throw Error("an HTTP(S) proxy server `host` and `port` must be specified!");d("creating new HttpsProxyAgent instance: %o",r),super(r);let o=Object.assign({},r);this.secureProxy=r.secureProxy||"string"==typeof(e=o.protocol)&&/^https:?$/i.test(e),o.host=o.hostname||o.host,"string"==typeof o.port&&(o.port=parseInt(o.port,10)),!o.port&&o.host&&(o.port=this.secureProxy?443:80),!this.secureProxy||"ALPNProtocols"in o||(o.ALPNProtocols=["http 1.1"]),o.host&&o.path&&(delete o.path,delete o.pathname),this.proxy=o}callback(t,e){return o(this,void 0,void 0,function*(){var r,o;let n,{proxy:a,secureProxy:p}=this;p?(d("Creating `tls.Socket`: %o",a),n=i.default.connect(a)):(d("Creating `net.Socket`: %o",a),n=s.default.connect(a));let u=Object.assign({},a.headers),f=`${e.host}:${e.port}`,y=`CONNECT ${f} HTTP/1.1\r
2
+ `;a.auth&&(u["Proxy-Authorization"]=`Basic ${Buffer.from(a.auth).toString("base64")}`);let{host:m,port:v,secureEndpoint:g}=e;for(let t of(r=v,((o=g)||80!==r)&&(!o||443!==r)&&(m+=`:${v}`),u.Host=m,u.Connection="close",Object.keys(u)))y+=`${t}: ${u[t]}\r
3
+ `;let P=c.default(n);n.write(`${y}\r
4
+ `);let{statusCode:b,buffered:k}=yield P;if(200===b){if(t.once("socket",h),e.secureEndpoint){d("Upgrading socket connection to TLS");let t=e.servername||e.host;return i.default.connect(Object.assign(Object.assign({},function(t,...e){let r,o={};for(r in t)e.includes(r)||(o[r]=t[r]);return o}(e,"host","hostname","path","port")),{socket:n,servername:t}))}return n}n.destroy();let _=new s.default.Socket({writable:!1});return _.readable=!0,t.once("socket",t=>{d("replaying proxy buffer for failed request"),l.default(t.listenerCount("data")>0),t.push(k),t.push(null)}),_})}}function h(t){t.resume()}e.default=f},64007(t,e,r){var o;let n=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(r(35646));function s(t){return new n.default(t)}(o=s||(s={})).HttpsProxyAgent=n.default,o.prototype=n.default.prototype,t.exports=s},36981(t,e,r){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});let n=o(r(3680)).default("https-proxy-agent:parse-proxy-response");e.default=function(t){return new Promise((e,r)=>{let o=0,s=[];function i(){let r=t.read();r?function(t){s.push(t),o+=t.length;let r=Buffer.concat(s,o);if(-1===r.indexOf("\r\n\r\n")){n("have not received end of HTTP headers yet..."),i();return}let a=r.toString("ascii",0,r.indexOf("\r\n")),l=+a.split(" ")[1];n("got proxy server response: %o",a),e({statusCode:l,buffered:r})}(r):t.once("readable",i)}function a(t){n("onclose had error %o",t)}function l(){n("onend")}t.on("error",function e(o){t.removeListener("end",l),t.removeListener("error",e),t.removeListener("close",a),t.removeListener("readable",i),n("onerror %o",o),r(o)}),t.on("close",a),t.on("end",l),i()})}},75149(t,e,r){r.d(e,{P:()=>s});var o=r(79657),n=r(64007);function s(t){var e=process.env.HTTPS_PROXY||process.env.https_proxy;if(!e||!t.startsWith("https://"))return o.Ay;var r=new n(e);return(t,e={})=>(0,o.Ay)(t,{...e,agent:r})}},30182(t,e,r){r.r(e),r.d(e,{BANK_PROPERTY_META_VALUES:()=>s.YC,createBankClient:()=>p,resolveBankEndpoint:()=>a,validateBankPropertyMeta:()=>s.jR});var o=r(99436),n=r(75149),s=r(31596),i={"https://display.bricks.tools":"https://bank.bricks.tools","https://display-beta.bricks.tools":"https://bank-beta.bricks.tools"},a=t=>{if(process.env.BRICKS_BANK_ENDPOINT)return process.env.BRICKS_BANK_ENDPOINT;var e=i[t];if(e)return e;try{var r=new URL(t).hostname;if("localhost"===r||"127.0.0.1"===r)return"http://localhost:8080"}catch{}throw Error(`Cannot derive the Data Bank endpoint from ${t}; set BRICKS_BANK_ENDPOINT to override`)},l=`
5
+ propertyId
6
+ meta
7
+ definition
8
+ value
9
+ tags
10
+ lastUpdateHash
11
+ lastUpdateNote
12
+ lastUpdateKey
13
+ createAt
14
+ updateAt
15
+ `,p=({endpoint:t,spacename:e,spacekey:r})=>{var i,a=`${t}/api/graphql`,p=(0,n.P)(t),u=(i=o(function*(t,o){var n,s=yield p(a,{method:"POST",headers:{"content-type":"application/json",SPACENAME:e,SPACEKEY:r},body:JSON.stringify({query:t,variables:o})}),i=yield s.text();try{n=JSON.parse(i)}catch{n=null}if(n?.errors?.length)throw Error(n.errors.map(({message:t})=>t).join("\n"));if(!s.ok){var l=Error(`Data Bank API error (${s.status}): ${i.trim()}`);throw 403===s.status&&(l.isBankAuthError=!0),l}return n?.data||{}}),function(t,e){return i.apply(this,arguments)});return{listProperties(){return o(function*({keyword:t,meta:e,ids:r}={}){return(0,s.jR)(e),(yield u(`#graphql
16
+ query(
17
+ $filterUpdateHashes: [PropertyFilterUpdateHash!]
18
+ $filterMeta: String
19
+ $filterKeyword: String
20
+ ) {
21
+ properties(
22
+ filterUpdateHashes: $filterUpdateHashes
23
+ filterMeta: $filterMeta
24
+ filterKeyword: $filterKeyword
25
+ ) { ${l} }
26
+ }
27
+ `,{filterUpdateHashes:r?.map(t=>({propertyId:t,value:""})),filterMeta:e,filterKeyword:t})).properties||[]}).apply(this,arguments)},getProperty(t){var e=this;return o(function*(){return(yield e.listProperties({ids:[t]})).find(e=>e.propertyId===t)||null})()},updateProperties:(t,e)=>o(function*(){if(!t?.length)throw Error("No properties to update.");var r=t.map(t=>{var e=t.meta||"InSubspace";return(0,s.jR)(e),{propertyId:t.propertyId,meta:e,definition:t.definition,newDefinitionFallback:t.newDefinitionFallback,value:t.value,updateNote:t.updateNote||"Updated via bricks-cli",upsert:!1!==t.upsert,tags:t.tags}});return(yield u(`#graphql
28
+ mutation($properties: [PropertyInput!]!, $dontNotify: Boolean) {
29
+ updateProperty(properties: $properties, dontNotify: $dontNotify) { ${l} }
30
+ }
31
+ `,{properties:r,dontNotify:e})).updateProperty||[]})(),removeProperty:t=>o(function*(){return(yield u(`#graphql
32
+ mutation($propertyId: String!) {
33
+ removeProperty(propertyId: $propertyId)
34
+ }
35
+ `,{propertyId:t})).removeProperty??!1})()}}}};
package/lib/405.js ADDED
@@ -0,0 +1 @@
1
+ export const __rspack_esm_id=405;export const __rspack_esm_ids=[405];export const __webpack_modules__={21068(r,t,n){n.r(t),n.d(t,{fetchLatestVersionInfo:()=>g,fetchNpmVersionInfo:()=>v,fetchVersionInfo:()=>k,isWindows:()=>m,runUpdateForMethod:()=>F,updateBinary:()=>x,updateBun:()=>j,updateNpm:()=>N});var i,e,o,s,a,u,l,p=n(68832),c=n(99436),f=n(31421),d=n(51455),h=n(48161),y=n(76760),$="@fugood/bricks-cli",m="win32"===process.platform,b=(r,t)=>`https://cdn.bricks.tools/bricks-cli/${r}/${t}`,w=r=>"beta"===r?"beta":"latest",_=(i=c(function*(r){var t=yield fetch(r);if(!t.ok)throw Error(`Failed to fetch ${r}: HTTP ${t.status}`);return t}),function(r){return i.apply(this,arguments)}),k=(e=c(function*(r){return(yield _(b(r,"version.json"))).json()}),function(r){return e.apply(this,arguments)}),v=(o=c(function*(r){var t=w(r),n=yield _(`https://registry.npmjs.org/-/package/${$}/dist-tags`),i=(yield n.json())[t];if(!i)throw Error(`No '${t}' dist-tag for ${$}`);return{version:i}}),function(r){return o.apply(this,arguments)}),g=(s=c(function*(r,t){return"npm"===t||"bun"===t?v(r):k(r)}),function(r,t){return s.apply(this,arguments)}),E=(r,t,n={})=>{var i=(0,f.spawnSync)(r,t,{stdio:"inherit",...n});if(i.error){if("ENOENT"===i.error.code)throw Error(`Command not found: ${r}`);throw i.error}if(0!==i.status){var e=Error(`${r} exited with code ${i.status}`);throw e.code=i.status,e}},B=(a=c(function*(r,t){var n=yield _(r),i=Buffer.from((yield n.arrayBuffer())),e=y.join(h.tmpdir(),`bricks-cli-update-${process.pid}-${t}`);return yield d.writeFile(e,i),m||(yield d.chmod(e,493)),e}),function(r,t){return a.apply(this,arguments)}),N=r=>{E("npm",["install","-g",`${$}@${w(r)}`])},j=r=>{E("bun",["install","-g",`${$}@${w(r)}`])},x=(u=c(function*(r,{installDir:t}={}){var n=m?"install.ps1":"install.sh",i=yield B(b(r,n),n);try{var e=m?["powershell",["-NoProfile","-ExecutionPolicy","Bypass","-File",i,..."beta"===r?["-Beta"]:[],...t?["-InstallDir",t]:[]]]:["sh",[i,..."beta"===r?["--beta"]:[],...t?[`--dir=${t}`]:[]]],o=p(e,2),s=o[0],a=o[1];E(s,a)}finally{yield d.unlink(i).catch(()=>{})}}),function(r){return u.apply(this,arguments)}),F=(l=c(function*(r,t,n={}){if("npm"===r)return N(t);if("bun"===r)return j(t);if("binary"===r)return x(t,{installDir:n.installDir});throw Error(`Unsupported update method: ${r}`)}),function(r,t){return l.apply(this,arguments)})}};
package/lib/456.js CHANGED
@@ -1,3 +1,3 @@
1
- export const __rspack_esm_id=456;export const __rspack_esm_ids=[456];export const __webpack_modules__={65650(e,t,r){e.exports=r(78942).Symbol},65111(e){e.exports=function(e,t){for(var r=-1,i=null==e?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}},44187(e){e.exports=function(e,t,r,i){var o=-1,n=null==e?0:e.length;for(i&&n&&(r=e[++o]);++o<n;)r=t(r,e[o],o,e);return r}},39546(e){var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},87379(e,t,r){var i=r(65650),o=r(8870),n=r(29005),u=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?o(e):n(e)}},51035(e){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},52291(e,t,r){var i=r(65650),o=r(65111),n=r(53142),u=r(51187),a=1/0,l=i?i.prototype:void 0,c=l?l.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(n(t))return o(t,e)+"";if(u(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-a?"-0":r}},93640(e,t,r){var i=r(44187),o=r(45881),n=r(39850),u=RegExp("['’]","g");e.exports=function(e){return function(t){return i(n(o(t).replace(u,"")),e,"")}}},69968(e,t,r){e.exports=r(51035)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"})},74967(e){e.exports="object"==typeof global&&global&&global.Object===Object&&global},8870(e,t,r){var i=r(65650),o=Object.prototype,n=o.hasOwnProperty,u=o.toString,a=i?i.toStringTag:void 0;e.exports=function(e){var t=n.call(e,a),r=e[a];try{e[a]=void 0;var i=!0}catch(e){}var o=u.call(e);return i&&(t?e[a]=r:delete e[a]),o}},15813(e){var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},29005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},78942(e,t,r){var i=r(74967),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=i||o||Function("return this")()},10482(e){var t="\\ud800-\\udfff",r="\\u2700-\\u27bf",i="a-z\\xdf-\\xf6\\xf8-\\xff",o="A-Z\\xc0-\\xd6\\xd8-\\xde",n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",u="['’]",a="["+n+"]",l="["+i+"]",c="[^"+t+n+"\\d+"+r+i+o+"]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",f="["+o+"]",p="(?:"+l+"|"+c+")",g="(?:"+f+"|"+c+")",y="(?:"+u+"(?:d|ll|m|re|s|t|ve))?",x="(?:"+u+"(?:D|LL|M|RE|S|T|VE))?",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",m="[\\ufe0e\\ufe0f]?",v="(?:\\u200d(?:"+["[^"+t+"]",s,d].join("|")+")"+m+h+")*",b="(?:"+["["+r+"]",s,d].join("|")+")"+(m+h+v),A=RegExp([f+"?"+l+"+"+y+"(?="+[a,f,"$"].join("|")+")",g+"+"+x+"(?="+[a,f+p,"$"].join("|")+")",f+"?"+p+"+"+y,f+"+"+x,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",b].join("|"),"g");e.exports=function(e){return e.match(A)||[]}},45881(e,t,r){var i=r(69968),o=r(95243),n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(n,i).replace(u,"")}},53142(e){e.exports=Array.isArray},80547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},51187(e,t,r){var i=r(87379),o=r(80547);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==i(e)}},10750(e,t,r){e.exports=r(93640)(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})},95243(e,t,r){var i=r(52291);e.exports=function(e){return null==e?"":i(e)}},39850(e,t,r){var i=r(39546),o=r(15813),n=r(95243),u=r(10482);e.exports=function(e,t,r){return(e=n(e),void 0===(t=r?void 0:t))?o(e)?u(e):i(e):e.match(t)||[]}},58891(e,t,r){r.r(t),r.d(t,{initProject:()=>p});var i,o,n=r(99436),u=r(16928),a=r(73284),l=r(30155),c=r(196),s=r(56493),d=r(77768),f=(i=n(function*(e,t){console.log(a.Ay.bold.cyan(`
1
+ export const __rspack_esm_id=456;export const __rspack_esm_ids=[456];export const __webpack_modules__={65650(e,t,r){e.exports=r(78942).Symbol},65111(e){e.exports=function(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}},44187(e){e.exports=function(e,t,r,i){var n=-1,o=null==e?0:e.length;for(i&&o&&(r=e[++n]);++n<o;)r=t(r,e[n],n,e);return r}},39546(e){var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},87379(e,t,r){var i=r(65650),n=r(8870),o=r(29005),u=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?n(e):o(e)}},51035(e){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},52291(e,t,r){var i=r(65650),n=r(65111),o=r(53142),u=r(51187),a=1/0,l=i?i.prototype:void 0,c=l?l.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return n(t,e)+"";if(u(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-a?"-0":r}},93640(e,t,r){var i=r(44187),n=r(45881),o=r(39850),u=RegExp("['’]","g");e.exports=function(e){return function(t){return i(o(n(t).replace(u,"")),e,"")}}},69968(e,t,r){e.exports=r(51035)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"})},74967(e){e.exports="object"==typeof global&&global&&global.Object===Object&&global},8870(e,t,r){var i=r(65650),n=Object.prototype,o=n.hasOwnProperty,u=n.toString,a=i?i.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var i=!0}catch(e){}var n=u.call(e);return i&&(t?e[a]=r:delete e[a]),n}},15813(e){var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},29005(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},78942(e,t,r){var i=r(74967),n="object"==typeof self&&self&&self.Object===Object&&self;e.exports=i||n||Function("return this")()},10482(e){var t="\\ud800-\\udfff",r="\\u2700-\\u27bf",i="a-z\\xdf-\\xf6\\xf8-\\xff",n="A-Z\\xc0-\\xd6\\xd8-\\xde",o="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",u="['’]",a="["+o+"]",l="["+i+"]",c="[^"+t+o+"\\d+"+r+i+n+"]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",f="["+n+"]",p="(?:"+l+"|"+c+")",g="(?:"+f+"|"+c+")",y="(?:"+u+"(?:d|ll|m|re|s|t|ve))?",x="(?:"+u+"(?:D|LL|M|RE|S|T|VE))?",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",m="[\\ufe0e\\ufe0f]?",b="(?:\\u200d(?:"+["[^"+t+"]",s,d].join("|")+")"+m+h+")*",v="(?:"+["["+r+"]",s,d].join("|")+")"+(m+h+b),j=RegExp([f+"?"+l+"+"+y+"(?="+[a,f,"$"].join("|")+")",g+"+"+x+"(?="+[a,f+p,"$"].join("|")+")",f+"?"+p+"+"+y,f+"+"+x,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",v].join("|"),"g");e.exports=function(e){return e.match(j)||[]}},45881(e,t,r){var i=r(69968),n=r(95243),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=n(e))&&e.replace(o,i).replace(u,"")}},53142(e){e.exports=Array.isArray},80547(e){e.exports=function(e){return null!=e&&"object"==typeof e}},51187(e,t,r){var i=r(87379),n=r(80547);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},10750(e,t,r){e.exports=r(93640)(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})},95243(e,t,r){var i=r(52291);e.exports=function(e){return null==e?"":i(e)}},39850(e,t,r){var i=r(39546),n=r(15813),o=r(95243),u=r(10482);e.exports=function(e,t,r){return(e=o(e),void 0===(t=r?void 0:t))?n(e)?u(e):i(e):e.match(t)||[]}},58891(e,t,r){r.r(t),r.d(t,{initProject:()=>p});var i,n,o=r(99436),u=r(16928),a=r(73284),l=r(30155),c=r(27521),s=r(56493),d=r(77768),f=(i=o(function*(e,t){console.log(a.default.bold.cyan(`
2
2
  Initialize BRICKS Project: ${t}
3
- `));var r=yield(0,c.kv)({message:"Select files to include:",choices:[{name:"GitHub Actions workflow (.github/workflows/ci.yml)",value:"githubActions",checked:!1!==e.githubActions},{name:"AGENTS.md",value:"agents",checked:!1!==e.agents},{name:"CLAUDE.md",value:"claude",checked:!1!==e.claude},{name:"GEMINI.md",value:"gemini",checked:!0===e.gemini}]}),i=yield(0,c.kv)({message:"Select post-generation steps:",choices:[{name:"Run bun install",value:"install",checked:!1!==e.install},{name:"Initialize git repository",value:"git",checked:!1!==e.git}]}),o=e.output?u.resolve(e.output):u.join(process.cwd(),t),n=yield(0,c.hF)({message:"Output directory:",default:o});return{githubActions:r.includes("githubActions"),agents:r.includes("agents"),claude:r.includes("claude"),gemini:r.includes("gemini"),install:i.includes("install"),git:i.includes("git"),output:n,outputAsTarget:!0}}),function(e,t){return i.apply(this,arguments)}),p=(o=n(function*(e,t,r){var i=(0,s.o)(),o=r.json,n=r.yes||o,c="application"===e,p=c?i.queries.applicationProject:i.queries.moduleProject,g=o?null:(0,l.default)(`Fetching ${e} info...`).start(),y="bricks-ctor";try{var x=(yield i.query(p,{id:t,buildApplicationOnly:!0}))[c?"applicationProject":"moduleProject"];x?.files&&(y=(0,d.kU)(x.files)),g&&g.stop()}catch{g&&g.stop()}var h={...r};if(!n)try{var m=yield f(r,y);h={...r,...m}}catch{console.log(a.Ay.yellow("\nCancelled")),process.exit(0)}g=o?null:(0,l.default)(`Fetching ${e} project...`).start();var v=!!h.output;try{var b=yield(0,d.BZ)(e,t,{client:i,output:v?h.output:process.cwd(),outputAsTarget:v||!0===h.outputAsTarget,install:h.install,git:h.git,githubActions:h.githubActions,agents:h.agents,claude:h.claude,gemini:h.gemini});g&&g.succeed(`Project created: ${a.Ay.green(b.path)} (${b.files} files)`),o?console.log(JSON.stringify(b)):(console.log(""),console.log(a.Ay.bold.green("Project initialized successfully!")),console.log(""),console.log(a.Ay.bold("Next steps:")),console.log(a.Ay.gray(` cd ${u.basename(b.path)}`)),b.bunInstalled||console.log(a.Ay.gray(" bun install")),console.log(a.Ay.gray(" bun invoke-simulator")),console.log(""),console.log(a.Ay.gray(`For more information, see ${u.basename(b.path)}/README.md`)))}catch(t){o?console.error(JSON.stringify({error:t.message})):g?g.fail(`Failed to initialize ${e} project: ${t.message}`):console.error(a.Ay.red(`Failed to initialize ${e} project: ${t.message}`)),process.exit(1)}}),function(e,t,r){return o.apply(this,arguments)})},77768(e,t,r){r.d(t,{BZ:()=>v,KN:()=>x,kU:()=>y,o0:()=>m,oz:()=>h});var i,o,n,u,a=r(99436),l=r(16928),c=r(79896),s=r(35317),d=r(10750),f=e=>{try{return(0,s.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},p=(e,t,r)=>new Promise((i,o)=>{var n=[e,...t].join(" "),u=(0,s.spawn)(n,[],{cwd:r,stdio:"pipe",shell:!0}),a=[];u.stderr.on("data",e=>a.push(e)),u.on("close",e=>{0===e?i():o(Error(Buffer.concat(a).toString().trim()||`Command failed with code ${e}`))}),u.on("error",o)}),g=(i=a(function*(e,t){try{var i=(yield r.e(75).then(r.bind(r,79491))).format;return(yield i(t,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,t){return i.apply(this,arguments)}),y=(e=[])=>{var t=e.find(e=>"application.json"===e.name);if(!t)return"bricks-ctor";try{var r=JSON.parse(t.input);return d(r.name||"bricks-ctor")}catch{return"bricks-ctor"}},x=(o=a(function*(e,t){var r;return Promise.all(e.map((r=a(function*(e){var r=l.join(t,e.name),i=e.input;return e.formatable&&(i=yield g(i,r)),{...e,filePath:r,content:i}}),function(e){return r.apply(this,arguments)})))}),function(e,t){return o.apply(this,arguments)}),h=e=>{e.forEach(e=>{c.mkdirSync(l.dirname(e.filePath),{recursive:!0}),c.writeFileSync(e.filePath,e.content)})},m=(n=a(function*(e,t={}){var r="function"==typeof t.onStatus?t.onStatus:()=>{},i=!1,o=!1;if(!1!==t.install&&f("bun")){r("Installing dependencies (bun install)...");try{yield p("bun",["install"],e),i=!0}catch{}}if(!1!==t.git&&f("git")){r("Initializing git repository...");try{yield p("git",["init"],e),yield p("git",["add","."],e),yield p("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],e),o=!0}catch{}}return{bunInstalled:i,gitInitialized:o}}),function(e){return n.apply(this,arguments)}),v=(u=a(function*(e,t,r){var i=r.client,o=r.output,n=r.outputAsTarget;if(!i)throw Error("client is required");if(!o)throw Error("output directory is required");var u=(e=>{for(var t=l.resolve(e);;){if(c.existsSync(l.join(t,"application.json"))||c.existsSync(l.join(t,"module.json")))return t;var r=l.dirname(t);if(r===t)return null;t=r}})(n?l.dirname(l.resolve(o)):o);if(u)throw Error(`Cannot initialize a new BRICKS project inside an existing project (${u}). Choose a directory outside the project.`);var a="application"===e,s=a?i.queries.applicationProject:i.queries.moduleProject,d=(yield i.query(s,{id:t,buildApplicationOnly:!1,setupGitHubActions:!1!==r.githubActions,setupAgents:!1!==r.agents,setupClaudeCode:!1!==r.claude,setupGeminiCLI:!0===r.gemini}))[a?"applicationProject":"moduleProject"];if(!d?.files)throw Error(`${e} project not found`);var f=y(d.files),p=n?l.resolve(o):l.resolve(o,f);if(c.existsSync(p))throw Error(`Directory already exists: ${p}`);c.mkdirSync(p,{recursive:!0}),h((yield x(d.files,p)));var g=yield m(p,r),v=g.bunInstalled,b=g.gitInitialized;return{success:!0,path:p,files:d.files.length,bunInstalled:v,gitInitialized:b}}),function(e,t,r){return u.apply(this,arguments)})}};
3
+ `));var r=yield(0,c.checkbox)({message:"Select files to include:",choices:[{name:"GitHub Actions workflow (.github/workflows/ci.yml)",value:"githubActions",checked:!1!==e.githubActions},{name:"AGENTS.md",value:"agents",checked:!1!==e.agents},{name:"CLAUDE.md",value:"claude",checked:!1!==e.claude},{name:"GEMINI.md",value:"gemini",checked:!0===e.gemini}]}),i=yield(0,c.checkbox)({message:"Select post-generation steps:",choices:[{name:"Run bun install",value:"install",checked:!1!==e.install},{name:"Initialize git repository",value:"git",checked:!1!==e.git}]}),n=e.output?u.resolve(e.output):u.join(process.cwd(),t),o=yield(0,c.input)({message:"Output directory:",default:n});return{githubActions:r.includes("githubActions"),agents:r.includes("agents"),claude:r.includes("claude"),gemini:r.includes("gemini"),install:i.includes("install"),git:i.includes("git"),output:o,outputAsTarget:!0}}),function(e,t){return i.apply(this,arguments)}),p=(n=o(function*(e,t,r){var i=(0,s.requireAuth)(),n=r.json,o=r.yes||n,c="application"===e?i.applicationProject:i.moduleProject,p=n?null:(0,l.default)(`Fetching ${e} info...`).start(),g="bricks-ctor";try{var y=yield c({id:t,buildApplicationOnly:!0});y?.files&&(g=(0,d.kU)(y.files)),p&&p.stop()}catch{p&&p.stop()}var x={...r};if(!o)try{var h=yield f(r,g);x={...r,...h}}catch{console.log(a.default.yellow("\nCancelled")),process.exit(0)}p=n?null:(0,l.default)(`Fetching ${e} project...`).start();var m=!!x.output;try{var b=yield(0,d.BZ)(e,t,{client:i,output:m?x.output:process.cwd(),outputAsTarget:m||!0===x.outputAsTarget,install:x.install,git:x.git,githubActions:x.githubActions,agents:x.agents,claude:x.claude,gemini:x.gemini});p&&p.succeed(`Project created: ${a.default.green(b.path)} (${b.files} files)`),n?console.log(JSON.stringify(b)):(console.log(""),console.log(a.default.bold.green("Project initialized successfully!")),console.log(""),console.log(a.default.bold("Next steps:")),console.log(a.default.gray(` cd ${u.basename(b.path)}`)),b.bunInstalled||console.log(a.default.gray(" bun install")),console.log(a.default.gray(" bun invoke-simulator")),console.log(""),console.log(a.default.gray(`For more information, see ${u.basename(b.path)}/README.md`)))}catch(t){n?console.error(JSON.stringify({error:t.message})):p?p.fail(`Failed to initialize ${e} project: ${t.message}`):console.error(a.default.red(`Failed to initialize ${e} project: ${t.message}`)),process.exit(1)}}),function(e,t,r){return n.apply(this,arguments)})},77768(e,t,r){r.d(t,{BZ:()=>b,KN:()=>x,kU:()=>y,o0:()=>m,oz:()=>h});var i,n,o,u,a=r(99436),l=r(16928),c=r(79896),s=r(35317),d=r(10750),f=e=>{try{return(0,s.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},p=(e,t,r)=>new Promise((i,n)=>{var o=[e,...t].join(" "),u=(0,s.spawn)(o,[],{cwd:r,stdio:"pipe",shell:!0}),a=[];u.stderr.on("data",e=>a.push(e)),u.on("close",e=>{0===e?i():n(Error(Buffer.concat(a).toString().trim()||`Command failed with code ${e}`))}),u.on("error",n)}),g=(i=a(function*(e,t){try{var i=(yield r.e(75).then(r.bind(r,79491))).format;return(yield i(t,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,t){return i.apply(this,arguments)}),y=(e=[])=>{var t=e.find(e=>"application.json"===e.name);if(!t)return"bricks-ctor";try{var r=JSON.parse(t.input);return d(r.name||"bricks-ctor")}catch{return"bricks-ctor"}},x=(n=a(function*(e,t){var r;return Promise.all(e.map((r=a(function*(e){var r=l.join(t,e.name),i=e.input;return e.formatable&&(i=yield g(i,r)),{...e,filePath:r,content:i}}),function(e){return r.apply(this,arguments)})))}),function(e,t){return n.apply(this,arguments)}),h=e=>{e.forEach(e=>{c.mkdirSync(l.dirname(e.filePath),{recursive:!0}),c.writeFileSync(e.filePath,e.content)})},m=(o=a(function*(e,t={}){var r="function"==typeof t.onStatus?t.onStatus:()=>{},i=!1,n=!1;if(!1!==t.install&&f("bun")){r("Installing dependencies (bun install)...");try{yield p("bun",["install"],e),i=!0}catch{}}if(!1!==t.git&&f("git")){r("Initializing git repository...");try{yield p("git",["init"],e),yield p("git",["add","."],e),yield p("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],e),n=!0}catch{}}return{bunInstalled:i,gitInitialized:n}}),function(e){return o.apply(this,arguments)}),b=(u=a(function*(e,t,r){var i=r.client,n=r.output,o=r.outputAsTarget;if(!i)throw Error("client is required");if(!n)throw Error("output directory is required");var u=(e=>{for(var t=l.resolve(e);;){if(c.existsSync(l.join(t,"application.json"))||c.existsSync(l.join(t,"module.json")))return t;var r=l.dirname(t);if(r===t)return null;t=r}})(o?l.dirname(l.resolve(n)):n);if(u)throw Error(`Cannot initialize a new BRICKS project inside an existing project (${u}). Choose a directory outside the project.`);var a="application"===e?i.applicationProject:i.moduleProject,s=yield a({id:t,buildApplicationOnly:!1,setupGitHubActions:!1!==r.githubActions,setupAgents:!1!==r.agents,setupClaudeCode:!1!==r.claude,setupGeminiCLI:!0===r.gemini});if(!s?.files)throw Error(`${e} project not found`);var d=y(s.files),f=o?l.resolve(n):l.resolve(n,d);if(c.existsSync(f))throw Error(`Directory already exists: ${f}`);c.mkdirSync(f,{recursive:!0}),h((yield x(s.files,f)));var p=yield m(f,r),g=p.bunInstalled,b=p.gitInitialized;return{success:!0,path:f,files:s.files.length,bunInstalled:g,gitInitialized:b}}),function(e,t,r){return u.apply(this,arguments)})}};
package/lib/486.js ADDED
@@ -0,0 +1 @@
1
+ export const __rspack_esm_id=486;export const __rspack_esm_ids=[486];export const __webpack_modules__={421(e,r,a){a.r(r),a.d(r,{buildDoctorReport:()=>k,renderDoctorReport:()=>v});var o,i,t=a(99436),s=a(85382),n=a(8479),c=a(7586),p=a(47988),l=(o=t(function*(){try{return yield Promise.all([a.e(866),a.e(645),a.e(192),a.e(648),a.e(306),a.e(10),a.e(117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return o.apply(this,arguments)}),u=(e,r,a)=>({severity:e,code:r,message:a}),k=(i=t(function*({version:e="2.25.0-beta.62",mcpCheck:r=l}={}){var a=(0,p.getCurrentProfile)(),o=(0,p.getCurrentProfileSource)(),i=(0,p.getTokenInfo)(a),t=(0,p.getBaseUrl)(),k=(0,p.getActivityLogBaseUrl)(),h=[],v={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:o},config:{path:p.CONFIG_PATH,baseUrl:t,activityLogBaseUrl:k},auth:{available:!!i?.token,source:i?.token?"config":"missing",workspaceId:i?.workspaceId||null,workspaceName:i?.workspaceName||null,createdAt:i?.createdAt||null,tokenPreview:(0,c.$l)(i?.token)},connectivity:{workspace:{ok:!1,skipped:!i?.token,error:null}},capabilities:{zeroArgMode:(0,n.isInteractiveTerminal)()?"interactive":"help",mcp:{available:!1,error:null}},issues:h};if(i?.token)try{var d=yield(0,s.createClient)(t,i.token).workspace();v.connectivity.workspace={ok:!0,skipped:!1,error:null,id:d?._id||i.workspaceId||null,name:d?.name||i.workspaceName||null},v.auth.workspaceId=d?._id||v.auth.workspaceId,v.auth.workspaceName=d?.name||v.auth.workspaceName}catch(e){v.connectivity.workspace={ok:!1,skipped:!1,error:e.message},h.push(u("error","workspace_unreachable",`Workspace query failed for ${t}: ${e.message}`))}else h.push(u("warning","auth_missing","No saved token for the current profile."));var m=yield r();return v.capabilities.mcp={available:m.available,error:m.error||null},m.available||h.push(u("warning","mcp_unavailable",`MCP stdio server is unavailable: ${m.error||"Unknown error"}`)),v.ok=0===h.length,v}),function(){return i.apply(this,arguments)}),h=(e,r,a)=>`${e.padEnd(14)} ${r}${a?` ${a}`:""}`,v=e=>{var r=[];if(r.push("BRICKS CLI Doctor"),r.push("─".repeat(60)),r.push(h("CLI","OK",`bricks v${e.cli.version}`)),r.push(h("Profile","OK",`${e.profile.name} (${e.profile.source})`)),r.push(h("BRICKS API","OK",e.config.baseUrl)),r.push(h("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace";r.push(h("Auth","OK",`${a} (${e.auth.source}, ${e.auth.tokenPreview})`))}else r.push(h("Auth","WARN","No saved token for the current profile"));if(e.connectivity.workspace.skipped)r.push(h("Workspace","WARN","Skipped because no token is available"));else if(e.connectivity.workspace.ok){var o=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";r.push(h("Workspace","OK",o))}else r.push(h("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?r.push(h("MCP","OK","STDIO server import is available")):r.push(h("MCP","WARN",e.capabilities.mcp.error)),r.push(h("Zero-arg mode",((e,r=!1)=>e?"OK":r?"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&&(r.push("─".repeat(60)),r.push("Issues"),e.issues.forEach(e=>{r.push(`- [${e.severity}] ${e.message}`)})),r.join("\n")}}};
package/lib/511.js CHANGED
@@ -1 +1 @@
1
- export const __rspack_esm_id=511;export const __rspack_esm_ids=[511];export const __webpack_modules__={18501(e,t,r){let{docs:a}=r(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,r)=>{let i=e[r];if(!t.isCommand(i))return null;let n=a[i.type.replace("command-node-","")]?.commands?.[i.properties?.command];return n?.iterateeFrom||n?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command),t.findCircularReferenceIds=e=>{let r,a=(r=new Map,Object.keys(e).reduce((a,i)=>{let n=[];return Object.values(e[i]?.out||{}).forEach(a=>{t.getPorts(a).forEach(a=>{((e,r,a)=>{var i;return!!r&&!!e[r.id]&&!(r.port===(i=r.id,a.has(i)||a.set(i,t.getCommandCallbackFromPort(e,i)),a.get(i))||t.checkDisableTriggerCommand(e,r))})(e,a,r)&&n.push(a.id)})}),a[i]=n,a},{})),i=new Map;return Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(e=>((e,t,r)=>{if(r.has(e))return r.get(e);let a=[{id:e,edgeIndex:0,reachesCycle:!1}],i=new Set([e]);for(;a.length>0;){let e=a[a.length-1],n=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=n.length){i.delete(e.id),r.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}let s=n[e.edgeIndex];if(e.edgeIndex+=1,r.has(s)){r.get(s)&&(e.reachesCycle=!0);continue}if(i.has(s)){e.reachesCycle=!0;continue}i.add(s),a.push({id:s,edgeIndex:0,reachesCycle:!1})}return r.get(e)||!1})(e,a,i))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;let i=(e={})=>Object.entries(e).reduce((e,[t,r])=>(e[t]=Array.isArray(r)?r.slice():r,e),{}),n=new WeakSet,s=(e,t,r)=>{if(!r)return;let a=((e,t)=>{let r=e[t];if(!r)return e[t]=[],e[t];if(!Array.isArray(r))return e[t]=[r],e[t];if(!n.has(r)){let e=0;for(let t of r)t&&(r[e]=t,e+=1);r.length=e,n.add(r)}return r})(e,t);(Array.isArray(r)?r:[r]).forEach(e=>{e&&a.push(e)})};t.getCalcMap=e=>e?.script_map||e?.scriptMap||e?.map||{},t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(t.getCalcMap(r)).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${r}`);let i=e[r];Object.keys(a?.in||{}).forEach(e=>{s(i.in,e,a.in[e])}),Object.keys(a?.out||{}).forEach(e=>{s(i.out,e,a.out[e])})}else e[r]={...a,in:i(a?.in),out:i(a?.out)};return e},e),{})},86343(e,t,r){let{v4:a}=r(45620),i=r(95479),n=r(56005),{nameMap:s,brickMapping:o,generatorMapping:l}=r(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{let r;if(!e)return!1;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","mlx-model-asset","binary-asset","scene3d-objects"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,r,a)=>{let n;if(!r)return e.toUpperCase();if(r.title)return r.title;switch(e){case"bank":n="BANK";break;case"subspace":n="SUBSPACE";break;case"canvas":n="CANVAS";break;case"animation":n=`<${i(t.getAnimationType(r))}>`;break;case"property_bank":n="<Data>";break;case"property_bank_calc":n="<Map>";break;case"state_group":n="<Switch Case>";break;default:n=`<${s[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?n+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(n+=` (${a})`),n},t.getEventLabel=(e,{templateKey:t,itemType:r}={})=>{if(!e)return"";let a=e;return"subspace"===r?a=e.replace("SUBSPACE_ACTION_",""):t&&(a=e.replace(`${t}_`,"").replace("CANVAS_","")),i(n(i(a)))},t.getCallInternalActions=e=>{let t=o[e]||l[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,i])=>(r.push({id:a,...i,title:t.getBrickName(e,i,a)}),r),[]);let c={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},d={};t.mapToListForDerivedState=(e,r,a,i)=>{let n=a[e]||d;return n!==i[e]?{[e]:n,[r]:t.mapToList(c[e],n)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{let r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},37517(e,t,r){let{composeMap:a,findCircularReferenceIds:i}=r(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;let n=r.property_bank_calc_map;if(!n||0===Object.keys(n).length)return;let s=`subspace_map.${e}.property_bank_calc_map`;try{let e=a(n),r=i(e);if(r.length>0){let a=r.slice(0,5).map(t=>e[t].title||t),i=r.length>5?` and ${r.length-5} more`:"";t.push({field:s,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${i}. Please check the data connections for loops.`})}}catch(e){t.push({field:s,message:e.message})}}),t}},41900(e){e.exports={expressionFoldAcornOptions:{ecmaVersion:2020,allowReturnOutsideFunction:!0},getUnfoldableStatementDescription:(e,t=null)=>{for(let t=0;t<e.length;t+=1){let r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==r.type)return`an unsupported ${r.type}`}}return t}}},78078(e,t,r){let{parse:a}=r(89236),{expressionFoldAcornOptions:i,getUnfoldableStatementDescription:n}=r(41900),s=(e,t,r)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,a)=>s(e,`${t}[${a}]`,r));Object.entries(e).forEach(([e,o])=>{("event_map"===e||"eventMap"===e)&&o&&"object"==typeof o?Object.entries(o).forEach(([s,o])=>{Array.isArray(o)&&o.forEach((o,l)=>{if(o?.action!=="PROPERTY_BANK_EXPRESSION")return;let c=(e=>{let t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;let r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(o);if("string"!=typeof c||c.startsWith("PROPERTY_BANK#"))return;let d=(e=>{let t;if(!e.trim())return"Expression is empty";try{t=a(e,i)}catch(e){return`Expression does not parse: ${e.message}`}let r=n(t.body);return r?`Expression contains ${r}; statements must fold into a single expression (expression statements, simple const/let declarations, and a final return only). Use ternaries instead of if/for/while, or move branching logic to a DataCalculationScript.`:null})(c);d&&r.push({field:`${t}.${e}.${s}[${l}]`,message:d})})}):o&&"object"==typeof o&&s(o,`${t}.${e}`,r)})}};e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||s(r,`subspace_map.${e}`,t)}),t}},38890(e,t,r){let{getDocByTemplateKey:a}=r(63981),i=r(80211),n=r(45907),s=r(37517),o=r(78078),{lintConfig:l,lintRuleCodes:c}=r(9098),{getBrickName:d}=r(86343);t.lintConfig=l,t.lintRuleCodes=c,t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([i,n])=>{(void 0!==n.property?.borderLeftWidth||void 0!==n.property?.borderRightWidth||void 0!==n.property?.borderTopWidth||void 0!==n.property?.borderBottomWidth)&&t.push({id:i,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${d("brick",n,i)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})}),Object.entries(r.generator_map||{}).forEach(([i,n])=>{let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})})}),t},t.checkConfig=(e,t={})=>{let r={schema:i(e),ref:n(e,t),calc:t.checkCalc?s(e):[],expression:t.checkExpressions?o(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{let a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}},27899(e){let t=["x","y","width","height"],r=e=>"string"==typeof e&&e.startsWith("PROPERTY_BANK_"),a=/PROPERTY_BANK#(PROPERTY_BANK_[A-Za-z0-9_-]+)/g,i=/(?:BRICK|ANIMATION|SUBSPACE)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g,n=(e,t=new Set)=>{if("string"==typeof e){let r;for(a.lastIndex=0;r=a.exec(e);)t.add(r[1])}else Array.isArray(e)?e.forEach(e=>n(e,t)):e&&"object"==typeof e&&(r(e.id)&&t.add(e.id),Object.values(e).forEach(e=>n(e,t)));return t},s=(e,t)=>{if("string"==typeof e){let r;for(i.lastIndex=0;r=i.exec(e);)t.add(r[0])}else Array.isArray(e)?e.forEach(e=>s(e,t)):e&&"object"==typeof e&&Object.values(e).forEach(e=>s(e,t));return t},o=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,r])=>{!r||"object"!=typeof r||r.module?.link||t(e,r)})},l=[["brick_map","brick"],["generator_map","generator"],["property_bank_map","property_bank"],["canvas_map","canvas"]],c=(e,t,r)=>{l.forEach(([a,i])=>{Object.entries(t[a]||{}).forEach(([t,n])=>{Object.entries(n?.event_map||{}).forEach(([n,s])=>{Array.isArray(s)&&r({ownerType:i,ownerId:t,eventKey:n,list:s,path:`subspace_map.${e}.${a}.${t}.event_map.${n}`})})})})},d=(e,t)=>(e.parameter_list||[]).find(e=>e?.input_to_receiver===t)?.result_from_sender;e.exports={FRAME_KEYS:t,isBankNodeId:r,collectBankReads:n,forEachSubspace:o,forEachEventList:c,getParamValue:d,hasParamValue:(e,t)=>{let r=d(e,t);return null!=r&&""!==r},collectDynamicallyReferencedIds:e=>{let t=new Set;return o(e,(e,r)=>{c(e,r,({list:e})=>{e.forEach(e=>s(e?.parameter_list,t))})}),s(e.automation_map,t),s(e.test_map,t),t},frameIsNumeric:e=>!!e&&t.every(t=>"number"==typeof e[t]),framesAlmostEqual:(e,r,a=.01)=>t.every(t=>Math.abs(e[t]-r[t])<=a),frameContains:(e,t,r=.01)=>e.x<=t.x+r&&e.y<=t.y+r&&e.x+e.width>=t.x+t.width-r&&e.y+e.height>=t.y+t.height-r,framesIntersect:(e,t)=>!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y),getItemId:e=>e?.brick_id||e?.subspace_id||null,itemHasAnimations:e=>!!e?.animations&&Object.keys(e.animations).length>0}},9098(e,t,r){let{collectDynamicallyReferencedIds:a}=r(27899),i=[r(98632),r(84223),r(92260),r(96810),r(60760),r(40566),r(31172),r(59707),r(39425)],n=i.map(e=>e.code),s=e=>Array.isArray(e)?e:"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null;e.exports={lintConfig:(e,t={})=>{let r,o=s(t.only),l=s(t.ignore),c=[...o||[],...l||[]].filter(e=>!n.includes(e));if(c.length>0)throw Error(`Unknown lint rule code(s): ${c.join(", ")}. Valid codes: ${n.join(", ")}`);if(!e||"object"!=typeof e)return[];let d=i.filter(e=>(!o||o.includes(e.code))&&(!l||!l.includes(e.code)));if(0===d.length)return[];let p={configType:"module"===t.configType?"module":"app",gridStep:"number"==typeof t.gridStep&&t.gridStep>0?t.gridStep:.5,get dynamicRefIds(){return r||(r=a(e)),r}},h=[];return d.forEach(t=>{try{t.check(e,p,e=>h.push({severity:t.severity,code:t.code,path:"",subspaceId:null,itemId:null,hint:null,...e}))}catch(e){h.push({severity:"warning",code:t.code,path:"",subspaceId:null,itemId:null,message:`Lint rule crashed: ${e.message}`,hint:null})}}),h},lintRuleCodes:n}},98632(e,t,r){let{composeMap:a}=r(18501),{forEachSubspace:i,forEachEventList:n,collectBankReads:s,isBankNodeId:o,getParamValue:l}=r(27899),c=(e,t)=>t.map(t=>l(e,t)).filter(o),d={PROPERTY_BANK:{waitable:!0,targets:e=>(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o)},PROPERTY_BANK_EXPRESSION:{waitable:!0,targets:e=>c(e,["RESULT","ERROR_RESULT"])},PROPERTY_BANK_COMMAND:{waitable:!0,targets:(e,t)=>((e,t)=>{let r=t();if(!r)return[];let a=[],i=new Set,n=(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o);for(let e=0;e<n.length;e+=1){let t=n[e];if(i.has(t))continue;i.add(t);let s=r[t];s&&Object.values(s.out||{}).forEach(e=>{(e||[]).forEach(e=>{e?.id&&(e.id.includes("DATA_NODE")&&a.push(e.id),n.push(e.id))})})}return a})(e,t)},STORAGE_RETRIEVE:{waitable:!0,targets:e=>c(e,["STORAGE_RETRIEVE_RESULT"])},OPEN_FILE:{waitable:!0,targets:e=>c(e,["SAVE_PROPERTY","SAVE_DETAIL_PROPERTY","ERROR_SAVE_PROPERTY"])},SAVE_UPDATE_SNAPSHOT:{waitable:!0,targets:e=>c(e,["SNAPSHOT_SAVE_RESULT","SNAPSHOT_ERROR_RESULT"])},TRIGGER_APPLICATION_FILTER:{waitable:!0,targets:e=>c(e,["RESULT","ERROR_RESULT"])},TAKE_SCREENSHOT:{waitable:!1,targets:e=>c(e,["TAKE_SCREENSHOT_SAVE_PROPERTY"])}},p=/(^|_)RESULT$|_SAVE_PROPERTY$/;e.exports={code:"data-update-race",severity:"warning",description:"A data node is written without wait_async and read by a later action in the same event",check(e,t,r){i(e,(e,t)=>{let i,l=()=>{if(void 0===i)try{i=a(t.property_bank_calc_map||{})}catch{i=null}return i};n(e,t,({path:t,list:a})=>{let i=new Map;a.forEach((a,n)=>{if(!a||"object"!=typeof a)return;if("SYSTEM"===a.handler&&"DELAY"===a.action)return void i.clear();let c=new Set;(a.parameter_list||[]).forEach(e=>s(e?.result_from_sender,c)),c.forEach(s=>{let o=i.get(s);o&&(r({path:`${t}.${n}`,subspaceId:e,itemId:s,message:`\`${s}\` is written by action #${o.index} (${o.action}) without waiting, then read by action #${n} (${a.action}) — the read can still see the previous value.`,hint:o.waitable?`Set \`wait_async: true\` on action #${o.index} (${o.action}).`:`${o.action} ignores \`wait_async\` for its data write — insert a SYSTEM DELAY action between the two, or move the read into the data node's value-change event.`}),i.delete(s))});let h=((e,t)=>{if("SYSTEM"===e.handler){let r=d[e.action];if(!r)return null;let a=r.targets(e,t);return a.length>0?{targets:a,waitable:r.waitable}:null}let r=(e.parameter_list||[]).filter(e=>"string"==typeof e?.input_to_receiver&&p.test(e.input_to_receiver)&&o(e.result_from_sender)).map(e=>e.result_from_sender);return r.length>0?{targets:r,waitable:!0}:null})(a,l);if(!h)return;let m=!0===a.wait_async&&h.waitable;h.targets.forEach(e=>{m?i.delete(e):i.set(e,{index:n,action:a.action,waitable:h.waitable})})})})})}}},39425(e,t,r){let{forEachSubspace:a,forEachEventList:i,getParamValue:n}=r(27899),s=new Set(["Math","Date","Object","Array","Number","String","Boolean","JSON","RegExp","Intl","isNaN","isFinite","parseInt","parseFloat"]);e.exports={code:"expression-global-variable",severity:"error",description:"A PROPERTY_BANK_EXPRESSION variable is named after a JS global and is silently ignored at runtime",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM"||"PROPERTY_BANK_EXPRESSION"!==a.action)return;let o=n(a,"VARIABLES");Array.isArray(o)&&o.forEach(a=>{let n=a?.key;"string"==typeof n&&s.has(n)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:`Expression variable "${n}" is named after the JS global \`${n}\` and is silently ignored — the global takes precedence in the expression scope, so the bound value is never used.`,hint:`Rename the variable (e.g. "${n}Value") so the expression reads the bound value.`})})})})})}}},40566(e,t,r){let{forEachSubspace:a,forEachEventList:i,hasParamValue:n}=r(27899),s=[{action:"STORAGE_RETRIEVE",severity:"error",isMissing:e=>!n(e,"STORAGE_RETRIEVE_RESULT"),message:"STORAGE_RETRIEVE requires a STORAGE_RETRIEVE_RESULT parameter — without it the action throws at runtime.",hint:"Add a STORAGE_RETRIEVE_RESULT parameter pointing at a data node."},{action:"TAKE_SCREENSHOT",severity:"warning",isMissing:e=>!n(e,"TAKE_SCREENSHOT_SAVE_PROPERTY"),message:"TAKE_SCREENSHOT without TAKE_SCREENSHOT_SAVE_PROPERTY is silently skipped at runtime.",hint:"Add a TAKE_SCREENSHOT_SAVE_PROPERTY parameter pointing at a data node."},{action:"OPEN_FILE",severity:"warning",isMissing:e=>!n(e,"SAVE_PROPERTY")&&!n(e,"SAVE_DETAIL_PROPERTY"),message:"OPEN_FILE has no SAVE_PROPERTY / SAVE_DETAIL_PROPERTY — the picked file is discarded.",hint:"Add SAVE_PROPERTY (file uri) or SAVE_DETAIL_PROPERTY (file detail) parameters."},{action:"OPEN_URL",severity:"warning",isMissing:e=>!n(e,"URL"),message:"OPEN_URL has no URL parameter — the action does nothing.",hint:"Add a URL parameter."}];e.exports={code:"missing-result-param",severity:"warning",description:"An action is missing the parameter that receives or drives its effect",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM")return;let n=s.find(e=>e.action===a.action);n&&n.isMissing(a)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,severity:n.severity,message:n.message,hint:n.hint})})})})}}},92260(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,getItemId:n,FRAME_KEYS:s}=r(27899),o=["width","height"];e.exports={code:"off-grid-frame",severity:"warning",description:"Frame values should be multiples of the 0.5 grid step",check(e,t,r){let l=t.gridStep;a(e,(e,t)=>{Object.entries(t.canvas_map||{}).forEach(([t,a])=>{(Array.isArray(a?.item_list)?a.item_list:[]).forEach((a,c)=>{let d=a?.frame;if(!i(d))return;let p=s.filter(e=>{let t=d[e];return(!o.includes(e)||!(t<=l))&&Math.abs(t-Math.round(t/l)*l)>.001});0!==p.length&&r({path:`subspace_map.${e}.canvas_map.${t}.item_list.${c}.frame`,subspaceId:e,itemId:n(a),message:`Frame ${p.map(e=>`${e}=${d[e]}`).join(", ")} ${1===p.length?"is":"are"} not aligned to the ${l} grid step.`,hint:`Round frame values to multiples of ${l}.`})})})})}}},96810(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,getItemId:n,itemHasAnimations:s}=r(27899);e.exports={code:"out-of-bounds-frame",severity:"warning",description:"An element is fully outside the subspace layout or has a non-positive size",check(e,t,r){a(e,(a,o)=>{let l=o.layout;"number"!=typeof l?.width||"number"!=typeof l?.height||l.width<=0||l.height<=0||Object.entries(o.canvas_map||{}).forEach(([o,c])=>{(Array.isArray(c?.item_list)?c.item_list:[]).forEach((c,d)=>{let p=c?.frame;if(!i(p)||!0===p.exceed_boundary||p.standby_frame||s(c))return;let h=n(c);if(h&&t.dynamicRefIds.has(h))return;let m=`subspace_map.${a}.canvas_map.${o}.item_list.${d}.frame`;if(p.width<=0||p.height<=0)return void r({path:m,subspaceId:a,itemId:h,message:`Frame has a non-positive size (width=${p.width}, height=${p.height}) — the element renders nothing.`,hint:"Give the element a positive size, or remove it if unused."});let u=a===e.root_subspace_id,f=p.x>=l.width||p.x+p.width<=0,_=p.y>=l.height||p.y+p.height<=0;(f||!u&&_)&&r({path:m,subspaceId:a,itemId:h,message:`Frame (x=${p.x}, y=${p.y}, width=${p.width}, height=${p.height}) is fully outside the ${l.width}\xd7${l.height} layout — nothing is visible.`,hint:"Move the element back into the layout, or set `exceed_boundary` if the placement is intentional."})})})})}}},84223(e,t,r){let{FRAME_KEYS:a,forEachSubspace:i,frameIsNumeric:n,framesAlmostEqual:s,framesIntersect:o,itemHasAnimations:l}=r(27899),c=new Set(["BRICK_TEXT","BRICK_RICH_TEXT"]),d=["linearGradientEnabled","blurEnabled"],p=/^backgroundColor$|^border/,h=(e,t)=>{if(e?.type!=="brick")return null;let r=t[e.brick_id];return c.has(r?.template_key)?r:null},m=e=>a.map(t=>Math.floor(e[t]/.01)),u=e=>e.join(":"),f=(e,t,r,a)=>{if(!n(t?.frame)||!h(t,r))return;let i=u(m(t.frame)),s=(e.get(i)||0)+a;s>0?e.set(i,s):e.delete(i)};e.exports={code:"redundant-rect-overlay",severity:"info",description:"A plain Rect behind a same-frame Text/RichText can be folded into the text brick",check(e,t,r){i(e,(e,a)=>{let i=a.brick_map||{};Object.entries(a.canvas_map||{}).forEach(([a,c])=>{let _,y=Array.isArray(c?.item_list)?c.item_list:[],b=(_=new Map,y.forEach(e=>f(_,e,i,1)),_);y.forEach((c,_)=>{if(f(b,c,i,-1),c?.type!=="brick"||!n(c.frame))return;let E=i[c.brick_id];if(E?.template_key!=="BRICK_RECT"||Object.values(E?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||l(c)||t.dynamicRefIds.has(c.brick_id))return;let g={...E.property,...c.property};if(!d.some(e=>g[e])&&((e,t)=>{let[r,a,i,n]=m(t);for(let t=-1;t<=1;t+=1)for(let s=-1;s<=1;s+=1)for(let o=-1;o<=1;o+=1)for(let l=-1;l<=1;l+=1)if(e.has(u([r+t,a+s,i+o,n+l])))return!0;return!1})(b,c.frame))for(let t=_+1;t<y.length;t+=1){let l=y[t];if(!n(l?.frame))continue;let d=h(l,i);if(d&&s(c.frame,l.frame,.01)){let t={...d.property,...l.property};if(Object.keys(t).some(e=>p.test(e)&&void 0!==t[e]))return;r({path:`subspace_map.${e}.canvas_map.${a}.item_list.${_}`,subspaceId:e,itemId:c.brick_id,message:`Rect \`${E.title||c.brick_id}\` has the same frame as the ${d.template_key} above it and only uses base styles.`,hint:"Set backgroundColor / border / radius directly on the text brick and remove the Rect."});return}if(o(c.frame,l.frame))return}})})})}}},31172(e,t,r){let{autoGeneratedItemIdKind:a}=r(99470),{forEachSubspace:i}=r(27899),n="PROPERTY_BANK_",s=()=>({children:Object.create(null),ids:null}),o=(e,t)=>{let r=e;for(let e of t)r.children[e]||(r.children[e]=s()),r=r.children[e];r.ids||(r.ids=[]),r.ids.push(t)},l=(e,t,r,a)=>{let i=r.children[e[a]];if(i){i.ids&&i.ids.forEach(e=>{t.set(e,t.get(e)+1)});for(let r=a+1;r<e.length&&(i=i.children[e[r]]);r+=1)i.ids&&i.ids.forEach(e=>{t.set(e,t.get(e)+1)})}};e.exports={code:"unused-data-node",severity:"info",description:"A data node is defined but never referenced anywhere in the config",check(e,t,r){let c=JSON.stringify(e),d=[];i(e,(r,i)=>{("module"!==t.configType||r!==e.root_subspace_id)&&Object.entries(i.property_bank_map||{}).forEach(([e,t])=>{!(!t||"object"!=typeof t||t.kind===a||t.enable_remote_update||t.global_remote_update_prop||t.linkedFrom||t.alias||t.preload||i.routing?.[e]?.enabled_routing)&&(Object.values(t?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||d.push({subspaceId:r,nodeId:e,node:t}))})});let p=((e,t)=>{let r=[...new Set(t)];if(0===r.length)return new Map;let a=new Map(r.map(e=>[e,0])),i=s(),c=s(),d=!1,p=!1;if(r.forEach(e=>{e.startsWith(n)?(o(i,e),d=!0):(o(c,e),p=!0)}),d){let t=e.indexOf(n);for(;-1!==t;)l(e,a,i,t),t=e.indexOf(n,t+1)}if(p)for(let t=0;t<e.length;t+=1)l(e,a,c,t);return a})(c,d.map(({nodeId:e})=>e));d.forEach(({subspaceId:e,nodeId:t,node:a})=>{(p.get(t)||0)>1||r({path:`subspace_map.${e}.property_bank_map.${t}`,subspaceId:e,itemId:t,message:`Data node \`${a.title||t}\` is never referenced in the config.`,hint:"Remove it, or keep it if external tooling depends on it."})})}}},60760(e,t,r){let{forEachSubspace:a,forEachEventList:i}=r(27899),n=new Set(["MESSAGE","ALERT","POPUP_RESET","TAKE_SCREENSHOT","THROW_EXCEPTION","RESTART_FOUNDATION","DYNAMIC_BRICK","DYNAMIC_BRICK_RESET","DYNAMIC_ANIMATION","DYNAMIC_ANIMATION_RESET","DYNAMIC_ANIMATION_STOP","CHANNEL_SUBSCRIBE","CHANNEL_UNSUBSCRIBE","CHANNEL_PUBLISH","DISMISS_KEYBOARD","STORAGE_SET","STORAGE_DELETE","DELAY","USE_SHARE_APPLICATION","AUTH_IN_DEVICE","REFRESH_BINDCODE","STOP_APPLICATION_FILTER"]);e.exports={code:"wait-async-no-op",severity:"info",description:"wait_async is set on an action that ignores it",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{a?.handler!=="SYSTEM"||!0!==a.wait_async||n.has(a.action)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:"DELAY"===a.action?"DELAY always waits for its timeout — `wait_async: true` is redundant.":`\`wait_async: true\` has no effect on ${a.action}; the action does not block the chain.`,hint:"DELAY"===a.action?"Remove the redundant flag.":"Remove the flag, or restructure if you relied on it for sequencing."})})})})}}},59707(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,frameContains:n,itemHasAnimations:s}=r(27899);e.exports={code:"z-order-cover",severity:"info",description:"A later opaque element fully covers an earlier pressable element",check(e,t,r){a(e,(e,a)=>{let o=a.brick_map||{};Object.entries(a.canvas_map||{}).forEach(([a,l])=>{let c=Array.isArray(l?.item_list)?l.item_list:[],d=[];if(c.forEach((e,t)=>{if(e?.type!=="brick"||!i(e.frame))return;let r=o[e.brick_id];r&&Object.entries(r?.event_map||{}).some(([e,t])=>e.includes("_ON_PRESS")&&Array.isArray(t)&&t.length>0)&&d.push({item:e,index:t,brick:r})}),0===d.length)return;let p=t.dynamicRefIds,h=c.map((e,t)=>((e,t,r,a)=>{let n;if(e?.type!=="brick"||!i(e.frame)||s(e)||a.has(e.brick_id))return null;let o=r[e.brick_id],l={...o?.property,...e.property};return"string"==typeof(n=l.backgroundColor)&&(/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*1(?:\.0+)?\s*\)$/.test(n)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(n)||/^#[0-9a-fA-F]{6}$/.test(n))&&(void 0===l.opacity||1===l.opacity)?{index:t,item:e,brick:o,frame:e.frame}:null})(e,t,o,p)).filter(Boolean),m=(e=>{let t=Array(e.length),r=1/0,a=1/0,i=-1/0,n=-1/0,s=-1/0,o=-1/0;for(let l=e.length-1;l>=0;l-=1){let{frame:c}=e[l];r=Math.min(r,c.x),a=Math.min(a,c.y),i=Math.max(i,c.x+c.width),n=Math.max(n,c.y+c.height),s=Math.max(s,c.width),o=Math.max(o,c.height),t[l]={minX:r,minY:a,maxRight:i,maxBottom:n,maxWidth:s,maxHeight:o}}return t})(h),u=0;d.forEach(({item:t,index:i,brick:o})=>{let l,c;if(!(s(t)||p.has(t.brick_id))){for(;u<h.length&&h[u].index<=i;)u+=1;if(l=m[u],c=t.frame,l&&l.minX<=c.x+.01&&l.minY<=c.y+.01&&l.maxRight>=c.x+c.width-.01&&l.maxBottom>=c.y+c.height-.01&&l.maxWidth>=c.width-.02&&l.maxHeight>=c.height-.02)for(let s=u;s<h.length;s+=1){let l=h[s];if(n(l.frame,t.frame))return void r({path:`subspace_map.${e}.canvas_map.${a}.item_list.${i}`,subspaceId:e,itemId:t.brick_id,message:`Pressable \`${o.title||t.brick_id}\` is fully covered by the opaque \`${l.brick?.title||l.item.brick_id}\` later in the item list — it is invisible and untappable.`,hint:"Reorder the items, shrink the covering element, or remove the hidden one."})}}})})})}}}};
1
+ export const __rspack_esm_id=511;export const __rspack_esm_ids=[511];export const __webpack_modules__={18501(e,t,r){let{docs:a}=r(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,r)=>{let i=e[r];if(!t.isCommand(i))return null;let n=a[i.type.replace("command-node-","")]?.commands?.[i.properties?.command];return n?.iterateeFrom||n?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command),t.findCircularReferenceIds=e=>{let r,a=(r=new Map,Object.keys(e).reduce((a,i)=>{let n=[];return Object.values(e[i]?.out||{}).forEach(a=>{t.getPorts(a).forEach(a=>{((e,r,a)=>{var i;return!!r&&!!e[r.id]&&!(r.port===(i=r.id,a.has(i)||a.set(i,t.getCommandCallbackFromPort(e,i)),a.get(i))||t.checkDisableTriggerCommand(e,r))})(e,a,r)&&n.push(a.id)})}),a[i]=n,a},{})),i=new Map;return Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(e=>((e,t,r)=>{if(r.has(e))return r.get(e);let a=[{id:e,edgeIndex:0,reachesCycle:!1}],i=new Set([e]);for(;a.length>0;){let e=a[a.length-1],n=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=n.length){i.delete(e.id),r.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}let s=n[e.edgeIndex];if(e.edgeIndex+=1,r.has(s)){r.get(s)&&(e.reachesCycle=!0);continue}if(i.has(s)){e.reachesCycle=!0;continue}i.add(s),a.push({id:s,edgeIndex:0,reachesCycle:!1})}return r.get(e)||!1})(e,a,i))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;let i=(e={})=>Object.entries(e).reduce((e,[t,r])=>(e[t]=Array.isArray(r)?r.slice():r,e),{}),n=new WeakSet,s=(e,t,r)=>{if(!r)return;let a=((e,t)=>{let r=e[t];if(!r)return e[t]=[],e[t];if(!Array.isArray(r))return e[t]=[r],e[t];if(!n.has(r)){let e=0;for(let t of r)t&&(r[e]=t,e+=1);r.length=e,n.add(r)}return r})(e,t);(Array.isArray(r)?r:[r]).forEach(e=>{e&&a.push(e)})};t.getCalcMap=e=>e?.script_map||e?.scriptMap||e?.map||{},t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(t.getCalcMap(r)).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${r}`);let i=e[r];Object.keys(a?.in||{}).forEach(e=>{s(i.in,e,a.in[e])}),Object.keys(a?.out||{}).forEach(e=>{s(i.out,e,a.out[e])})}else e[r]={...a,in:i(a?.in),out:i(a?.out)};return e},e),{})},86343(e,t,r){let{v4:a}=r(45620),i=r(95479),n=r(56005),{nameMap:s,brickMapping:o,generatorMapping:l}=r(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{let r;if(!e)return!1;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","mlx-model-asset","binary-asset","scene3d-objects"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,r,a)=>{let n;if(!r)return e.toUpperCase();if(r.title)return r.title;switch(e){case"bank":n="BANK";break;case"subspace":n="SUBSPACE";break;case"canvas":n="CANVAS";break;case"animation":n=`<${i(t.getAnimationType(r))}>`;break;case"property_bank":n="<Data>";break;case"property_bank_calc":n="<Map>";break;case"state_group":n="<Switch Case>";break;default:n=`<${s[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?n+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(n+=` (${a})`),n},t.getEventLabel=(e,{templateKey:t,itemType:r}={})=>{if(!e)return"";let a=e;return"subspace"===r?a=e.replace("SUBSPACE_ACTION_",""):t&&(a=e.replace(`${t}_`,"").replace("CANVAS_","")),i(n(i(a)))},t.getCallInternalActions=e=>{let t=o[e]||l[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,i])=>(r.push({id:a,...i,title:t.getBrickName(e,i,a)}),r),[]);let c={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},d={};t.mapToListForDerivedState=(e,r,a,i)=>{let n=a[e]||d;return n!==i[e]?{[e]:n,[r]:t.mapToList(c[e],n)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{let r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},37517(e,t,r){let{composeMap:a,findCircularReferenceIds:i}=r(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;let n=r.property_bank_calc_map;if(!n||0===Object.keys(n).length)return;let s=`subspace_map.${e}.property_bank_calc_map`;try{let e=a(n),r=i(e);if(r.length>0){let a=r.slice(0,5).map(t=>e[t].title||t),i=r.length>5?` and ${r.length-5} more`:"";t.push({field:s,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${i}. Please check the data connections for loops.`})}}catch(e){t.push({field:s,message:e.message})}}),t}},41900(e){e.exports={expressionFoldAcornOptions:{ecmaVersion:2020,allowReturnOutsideFunction:!0},getUnfoldableStatementDescription:(e,t=null)=>{for(let t=0;t<e.length;t+=1){let r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==r.type)return`an unsupported ${r.type}`}}return t}}},78078(e,t,r){let{parse:a}=r(89236),{expressionFoldAcornOptions:i,getUnfoldableStatementDescription:n}=r(41900),s=(e,t,r)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,a)=>s(e,`${t}[${a}]`,r));Object.entries(e).forEach(([e,o])=>{("event_map"===e||"eventMap"===e)&&o&&"object"==typeof o?Object.entries(o).forEach(([s,o])=>{Array.isArray(o)&&o.forEach((o,l)=>{if(o?.action!=="PROPERTY_BANK_EXPRESSION")return;let c=(e=>{let t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;let r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(o);if("string"!=typeof c||c.startsWith("PROPERTY_BANK#"))return;let d=(e=>{let t;if(!e.trim())return"Expression is empty";try{t=a(e,i)}catch(e){return`Expression does not parse: ${e.message}`}let r=n(t.body);return r?`Expression contains ${r}; statements must fold into a single expression (expression statements, simple const/let declarations, and a final return only). Use ternaries instead of if/for/while, or move branching logic to a DataCalculationScript.`:null})(c);d&&r.push({field:`${t}.${e}.${s}[${l}]`,message:d})})}):o&&"object"==typeof o&&s(o,`${t}.${e}`,r)})}};e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||s(r,`subspace_map.${e}`,t)}),t}},38890(e,t,r){let{getDocByTemplateKey:a}=r(63981),i=r(80211),n=r(45907),s=r(37517),o=r(78078),{lintConfig:l,lintRuleCodes:c}=r(9098),{getBrickName:d}=r(86343);t.lintConfig=l,t.lintRuleCodes=c,t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([i,n])=>{(void 0!==n.property?.borderLeftWidth||void 0!==n.property?.borderRightWidth||void 0!==n.property?.borderTopWidth||void 0!==n.property?.borderBottomWidth)&&t.push({id:i,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${d("brick",n,i)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})}),Object.entries(r.generator_map||{}).forEach(([i,n])=>{let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})})}),t},t.checkConfig=(e,t={})=>{let r={schema:i(e),ref:n(e,t),calc:t.checkCalc?s(e):[],expression:t.checkExpressions?o(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{let a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}},27899(e){let t=["x","y","width","height"],r=e=>"string"==typeof e&&e.startsWith("PROPERTY_BANK_"),a=/PROPERTY_BANK#(PROPERTY_BANK_[A-Za-z0-9_-]+)/g,i=/(?:BRICK|ANIMATION|SUBSPACE)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g,n=(e,t=new Set)=>{if("string"==typeof e){let r;for(a.lastIndex=0;r=a.exec(e);)t.add(r[1])}else Array.isArray(e)?e.forEach(e=>n(e,t)):e&&"object"==typeof e&&(r(e.id)&&t.add(e.id),Object.values(e).forEach(e=>n(e,t)));return t},s=(e,t)=>{if("string"==typeof e){let r;for(i.lastIndex=0;r=i.exec(e);)t.add(r[0])}else Array.isArray(e)?e.forEach(e=>s(e,t)):e&&"object"==typeof e&&Object.values(e).forEach(e=>s(e,t));return t},o=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,r])=>{!r||"object"!=typeof r||r.module?.link||t(e,r)})},l=(e,t)=>{o(e,(e,r)=>{Object.entries(r.canvas_map||{}).forEach(([a,i])=>{let n=Array.isArray(i?.item_list)?i.item_list:[];t({subspaceId:e,subspace:r,canvasId:a,canvas:i,items:n})})})},c=[["brick_map","brick"],["generator_map","generator"],["property_bank_map","property_bank"],["canvas_map","canvas"]],d=(e,t,r)=>{c.forEach(([a,i])=>{Object.entries(t[a]||{}).forEach(([t,n])=>{Object.entries(n?.event_map||{}).forEach(([n,s])=>{Array.isArray(s)&&r({ownerType:i,ownerId:t,eventKey:n,list:s,path:`subspace_map.${e}.${a}.${t}.event_map.${n}`})})})})},p=(e,t)=>(e.parameter_list||[]).find(e=>e?.input_to_receiver===t)?.result_from_sender;e.exports={FRAME_KEYS:t,isBankNodeId:r,collectBankReads:n,forEachSubspace:o,forEachCanvas:l,forEachCanvasItem:(e,t)=>{l(e,e=>{e.items.forEach((r,a)=>{t({...e,item:r,index:a})})})},forEachEventList:d,getParamValue:p,hasParamValue:(e,t)=>{let r=p(e,t);return null!=r&&""!==r},collectDynamicallyReferencedIds:e=>{let t=new Set;return o(e,(e,r)=>{d(e,r,({list:e})=>{e.forEach(e=>s(e?.parameter_list,t))})}),s(e.automation_map,t),s(e.test_map,t),t},frameIsNumeric:e=>!!e&&t.every(t=>"number"==typeof e[t]),framesAlmostEqual:(e,r,a=.01)=>t.every(t=>Math.abs(e[t]-r[t])<=a),frameContains:(e,t,r=.01)=>e.x<=t.x+r&&e.y<=t.y+r&&e.x+e.width>=t.x+t.width-r&&e.y+e.height>=t.y+t.height-r,framesIntersect:(e,t)=>!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y),getItemId:e=>e?.brick_id||e?.subspace_id||null,itemHasAnimations:e=>!!e?.animations&&Object.keys(e.animations).length>0}},9098(e,t,r){let{collectDynamicallyReferencedIds:a}=r(27899),i=[r(98632),r(84223),r(92260),r(96810),r(60760),r(40566),r(31172),r(59707),r(39425)],n=i.map(e=>e.code),s=e=>Array.isArray(e)?e:"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null;e.exports={lintConfig:(e,t={})=>{let r,o=s(t.only),l=s(t.ignore),c=[...o||[],...l||[]].filter(e=>!n.includes(e));if(c.length>0)throw Error(`Unknown lint rule code(s): ${c.join(", ")}. Valid codes: ${n.join(", ")}`);if(!e||"object"!=typeof e)return[];let d=i.filter(e=>(!o||o.includes(e.code))&&(!l||!l.includes(e.code)));if(0===d.length)return[];let p={configType:"module"===t.configType?"module":"app",gridStep:"number"==typeof t.gridStep&&t.gridStep>0?t.gridStep:.5,get dynamicRefIds(){return r||(r=a(e)),r}},h=[];return d.forEach(t=>{try{t.check(e,p,e=>h.push({severity:t.severity,code:t.code,path:"",subspaceId:null,itemId:null,hint:null,...e}))}catch(e){h.push({severity:"warning",code:t.code,path:"",subspaceId:null,itemId:null,message:`Lint rule crashed: ${e.message}`,hint:null})}}),h},lintRuleCodes:n}},98632(e,t,r){let{composeMap:a}=r(18501),{forEachSubspace:i,forEachEventList:n,collectBankReads:s,isBankNodeId:o,getParamValue:l}=r(27899),c=(e,t)=>t.map(t=>l(e,t)).filter(o),d={PROPERTY_BANK:{waitable:!0,targets:e=>(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o)},PROPERTY_BANK_EXPRESSION:{waitable:!0,targets:e=>c(e,["RESULT","ERROR_RESULT"])},PROPERTY_BANK_COMMAND:{waitable:!0,targets:(e,t)=>((e,t)=>{let r=t();if(!r)return[];let a=[],i=new Set,n=(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o);for(let e=0;e<n.length;e+=1){let t=n[e];if(i.has(t))continue;i.add(t);let s=r[t];s&&Object.values(s.out||{}).forEach(e=>{(e||[]).forEach(e=>{e?.id&&(e.id.includes("DATA_NODE")&&a.push(e.id),n.push(e.id))})})}return a})(e,t)},STORAGE_RETRIEVE:{waitable:!0,targets:e=>c(e,["STORAGE_RETRIEVE_RESULT"])},OPEN_FILE:{waitable:!0,targets:e=>c(e,["SAVE_PROPERTY","SAVE_DETAIL_PROPERTY","ERROR_SAVE_PROPERTY"])},SAVE_UPDATE_SNAPSHOT:{waitable:!0,targets:e=>c(e,["SNAPSHOT_SAVE_RESULT","SNAPSHOT_ERROR_RESULT"])},TRIGGER_APPLICATION_FILTER:{waitable:!0,targets:e=>c(e,["RESULT","ERROR_RESULT"])},TAKE_SCREENSHOT:{waitable:!1,targets:e=>c(e,["TAKE_SCREENSHOT_SAVE_PROPERTY"])}},p=/(^|_)RESULT$|_SAVE_PROPERTY$/;e.exports={code:"data-update-race",severity:"warning",description:"A data node is written without wait_async and read by a later action in the same event",check(e,t,r){i(e,(e,t)=>{let i,l=()=>{if(void 0===i)try{i=a(t.property_bank_calc_map||{})}catch{i=null}return i};n(e,t,({path:t,list:a})=>{let i=new Map;a.forEach((a,n)=>{if(!a||"object"!=typeof a)return;if("SYSTEM"===a.handler&&"DELAY"===a.action)return void i.clear();let c=new Set;(a.parameter_list||[]).forEach(e=>s(e?.result_from_sender,c)),c.forEach(s=>{let o=i.get(s);o&&(r({path:`${t}.${n}`,subspaceId:e,itemId:s,message:`\`${s}\` is written by action #${o.index} (${o.action}) without waiting, then read by action #${n} (${a.action}) — the read can still see the previous value.`,hint:o.waitable?`Set \`wait_async: true\` on action #${o.index} (${o.action}).`:`${o.action} ignores \`wait_async\` for its data write — insert a SYSTEM DELAY action between the two, or move the read into the data node's value-change event.`}),i.delete(s))});let h=((e,t)=>{if("SYSTEM"===e.handler){let r=d[e.action];if(!r)return null;let a=r.targets(e,t);return a.length>0?{targets:a,waitable:r.waitable}:null}let r=(e.parameter_list||[]).filter(e=>"string"==typeof e?.input_to_receiver&&p.test(e.input_to_receiver)&&o(e.result_from_sender)).map(e=>e.result_from_sender);return r.length>0?{targets:r,waitable:!0}:null})(a,l);if(!h)return;let u=!0===a.wait_async&&h.waitable;h.targets.forEach(e=>{u?i.delete(e):i.set(e,{index:n,action:a.action,waitable:h.waitable})})})})})}}},39425(e,t,r){let{forEachSubspace:a,forEachEventList:i,getParamValue:n}=r(27899),s=new Set(["Math","Date","Object","Array","Number","String","Boolean","JSON","RegExp","Intl","isNaN","isFinite","parseInt","parseFloat"]);e.exports={code:"expression-global-variable",severity:"error",description:"A PROPERTY_BANK_EXPRESSION variable is named after a JS global and is silently ignored at runtime",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM"||"PROPERTY_BANK_EXPRESSION"!==a.action)return;let o=n(a,"VARIABLES");Array.isArray(o)&&o.forEach(a=>{let n=a?.key;"string"==typeof n&&s.has(n)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:`Expression variable "${n}" is named after the JS global \`${n}\` and is silently ignored — the global takes precedence in the expression scope, so the bound value is never used.`,hint:`Rename the variable (e.g. "${n}Value") so the expression reads the bound value.`})})})})})}}},40566(e,t,r){let{forEachSubspace:a,forEachEventList:i,hasParamValue:n}=r(27899),s=[{action:"STORAGE_RETRIEVE",severity:"error",isMissing:e=>!n(e,"STORAGE_RETRIEVE_RESULT"),message:"STORAGE_RETRIEVE requires a STORAGE_RETRIEVE_RESULT parameter — without it the action throws at runtime.",hint:"Add a STORAGE_RETRIEVE_RESULT parameter pointing at a data node."},{action:"TAKE_SCREENSHOT",severity:"warning",isMissing:e=>!n(e,"TAKE_SCREENSHOT_SAVE_PROPERTY"),message:"TAKE_SCREENSHOT without TAKE_SCREENSHOT_SAVE_PROPERTY is silently skipped at runtime.",hint:"Add a TAKE_SCREENSHOT_SAVE_PROPERTY parameter pointing at a data node."},{action:"OPEN_FILE",severity:"warning",isMissing:e=>!n(e,"SAVE_PROPERTY")&&!n(e,"SAVE_DETAIL_PROPERTY"),message:"OPEN_FILE has no SAVE_PROPERTY / SAVE_DETAIL_PROPERTY — the picked file is discarded.",hint:"Add SAVE_PROPERTY (file uri) or SAVE_DETAIL_PROPERTY (file detail) parameters."},{action:"OPEN_URL",severity:"warning",isMissing:e=>!n(e,"URL"),message:"OPEN_URL has no URL parameter — the action does nothing.",hint:"Add a URL parameter."}];e.exports={code:"missing-result-param",severity:"warning",description:"An action is missing the parameter that receives or drives its effect",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM")return;let n=s.find(e=>e.action===a.action);n&&n.isMissing(a)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,severity:n.severity,message:n.message,hint:n.hint})})})})}}},92260(e,t,r){let{forEachCanvasItem:a,frameIsNumeric:i,getItemId:n,FRAME_KEYS:s}=r(27899),o=["width","height"];e.exports={code:"off-grid-frame",severity:"warning",description:"Frame values should be multiples of the 0.5 grid step",check(e,t,r){let l=t.gridStep;a(e,({subspaceId:e,canvasId:t,item:a,index:c})=>{let d=a?.frame;if(!i(d))return;let p=s.filter(e=>{let t=d[e];return(!o.includes(e)||!(t<=l))&&Math.abs(t-Math.round(t/l)*l)>.001});0!==p.length&&r({path:`subspace_map.${e}.canvas_map.${t}.item_list.${c}.frame`,subspaceId:e,itemId:n(a),message:`Frame ${p.map(e=>`${e}=${d[e]}`).join(", ")} ${1===p.length?"is":"are"} not aligned to the ${l} grid step.`,hint:`Round frame values to multiples of ${l}.`})})}}},96810(e,t,r){let{forEachCanvasItem:a,frameIsNumeric:i,getItemId:n,itemHasAnimations:s}=r(27899);e.exports={code:"out-of-bounds-frame",severity:"warning",description:"An element is fully outside the subspace layout or has a non-positive size",check(e,t,r){a(e,({subspaceId:a,subspace:o,canvasId:l,item:c,index:d})=>{let p=o.layout;if("number"!=typeof p?.width||"number"!=typeof p?.height||p.width<=0||p.height<=0)return;let h=c?.frame;if(!i(h)||!0===h.exceed_boundary||h.standby_frame||s(c))return;let u=n(c);if(u&&t.dynamicRefIds.has(u))return;let m=`subspace_map.${a}.canvas_map.${l}.item_list.${d}.frame`;if(h.width<=0||h.height<=0)return void r({path:m,subspaceId:a,itemId:u,message:`Frame has a non-positive size (width=${h.width}, height=${h.height}) — the element renders nothing.`,hint:"Give the element a positive size, or remove it if unused."});let f=a===e.root_subspace_id,_=h.x>=p.width||h.x+h.width<=0,y=h.y>=p.height||h.y+h.height<=0;(_||!f&&y)&&r({path:m,subspaceId:a,itemId:u,message:`Frame (x=${h.x}, y=${h.y}, width=${h.width}, height=${h.height}) is fully outside the ${p.width}\xd7${p.height} layout — nothing is visible.`,hint:"Move the element back into the layout, or set `exceed_boundary` if the placement is intentional."})})}}},84223(e,t,r){let{FRAME_KEYS:a,forEachCanvas:i,frameIsNumeric:n,framesAlmostEqual:s,framesIntersect:o,itemHasAnimations:l}=r(27899),c=new Set(["BRICK_TEXT","BRICK_RICH_TEXT"]),d=["linearGradientEnabled","blurEnabled"],p=e=>Object.values(e?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0),h=/^backgroundColor$|^border/,u=(e,t)=>{if(e?.type!=="brick")return null;let r=t[e.brick_id];return c.has(r?.template_key)?r:null},m=e=>a.map(t=>Math.floor(e[t]/.01)),f=e=>e.join(":"),_=(e,t,r,a)=>{if(!n(t?.frame)||!u(t,r))return;let i=f(m(t.frame)),s=(e.get(i)||0)+a;s>0?e.set(i,s):e.delete(i)};e.exports={code:"redundant-rect-overlay",severity:"info",description:"A plain Rect behind a same-frame Text/RichText can be folded into the text brick",check(e,t,r){i(e,({subspaceId:e,subspace:a,canvasId:i,items:c})=>{let y,b=a.brick_map||{},E=(y=new Map,c.forEach(e=>_(y,e,b,1)),y);c.forEach((a,y)=>{if(_(E,a,b,-1),a?.type!=="brick"||!n(a.frame))return;let g=b[a.brick_id];if(g?.template_key!=="BRICK_RECT"||l(a)||t.dynamicRefIds.has(a.brick_id))return;let R={...g.property,...a.property};if(d.some(e=>R[e])||!((e,t)=>{let[r,a,i,n]=m(t);for(let t=-1;t<=1;t+=1)for(let s=-1;s<=1;s+=1)for(let o=-1;o<=1;o+=1)for(let l=-1;l<=1;l+=1)if(e.has(f([r+t,a+s,i+o,n+l])))return!0;return!1})(E,a.frame))return;let A=p(g);for(let t=y+1;t<c.length;t+=1){let l=c[t];if(!n(l?.frame))continue;let d=u(l,b);if(d&&s(a.frame,l.frame,.01)){let t={...d.property,...l.property};if(Object.keys(t).some(e=>h.test(e)&&void 0!==t[e])||A&&p(d))return;r({path:`subspace_map.${e}.canvas_map.${i}.item_list.${y}`,subspaceId:e,itemId:a.brick_id,message:`Rect \`${g.title||a.brick_id}\` has the same frame as the ${d.template_key} above it and only uses base styles`+(A?", behind its press handler.":"."),hint:A?"Make the Text brick pressable, move backgroundColor / border / radius and the press handler onto it, then remove the Rect.":"Set backgroundColor / border / radius directly on the text brick and remove the Rect."});return}if(o(a.frame,l.frame))return}})})}}},31172(e,t,r){let{autoGeneratedItemIdKind:a}=r(99470),{forEachSubspace:i}=r(27899),n="PROPERTY_BANK_",s=()=>({children:Object.create(null),ids:null}),o=(e,t)=>{let r=e;for(let e of t)r.children[e]||(r.children[e]=s()),r=r.children[e];r.ids||(r.ids=[]),r.ids.push(t)},l=(e,t,r,a)=>{let i=r.children[e[a]];if(i){i.ids&&i.ids.forEach(e=>{t.set(e,t.get(e)+1)});for(let r=a+1;r<e.length&&(i=i.children[e[r]]);r+=1)i.ids&&i.ids.forEach(e=>{t.set(e,t.get(e)+1)})}};e.exports={code:"unused-data-node",severity:"info",description:"A data node is defined but never referenced anywhere in the config",check(e,t,r){let c=JSON.stringify(e),d=[];i(e,(r,i)=>{("module"!==t.configType||r!==e.root_subspace_id)&&Object.entries(i.property_bank_map||{}).forEach(([e,t])=>{!(!t||"object"!=typeof t||t.kind===a||t.enable_remote_update||t.global_remote_update_prop||t.linkedFrom||t.alias||t.preload||i.routing?.[e]?.enabled_routing)&&(Object.values(t?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||d.push({subspaceId:r,nodeId:e,node:t}))})});let p=((e,t)=>{let r=[...new Set(t)];if(0===r.length)return new Map;let a=new Map(r.map(e=>[e,0])),i=s(),c=s(),d=!1,p=!1;if(r.forEach(e=>{e.startsWith(n)?(o(i,e),d=!0):(o(c,e),p=!0)}),d){let t=e.indexOf(n);for(;-1!==t;)l(e,a,i,t),t=e.indexOf(n,t+1)}if(p)for(let t=0;t<e.length;t+=1)l(e,a,c,t);return a})(c,d.map(({nodeId:e})=>e));d.forEach(({subspaceId:e,nodeId:t,node:a})=>{(p.get(t)||0)>1||r({path:`subspace_map.${e}.property_bank_map.${t}`,subspaceId:e,itemId:t,message:`Data node \`${a.title||t}\` is never referenced in the config.`,hint:"Remove it, or keep it if external tooling depends on it."})})}}},60760(e,t,r){let{forEachSubspace:a,forEachEventList:i}=r(27899),n=new Set(["MESSAGE","ALERT","POPUP_RESET","TAKE_SCREENSHOT","THROW_EXCEPTION","RESTART_FOUNDATION","DYNAMIC_BRICK","DYNAMIC_BRICK_RESET","DYNAMIC_ANIMATION","DYNAMIC_ANIMATION_RESET","DYNAMIC_ANIMATION_STOP","CHANNEL_SUBSCRIBE","CHANNEL_UNSUBSCRIBE","CHANNEL_PUBLISH","DISMISS_KEYBOARD","STORAGE_SET","STORAGE_DELETE","DELAY","USE_SHARE_APPLICATION","AUTH_IN_DEVICE","REFRESH_BINDCODE","STOP_APPLICATION_FILTER"]);e.exports={code:"wait-async-no-op",severity:"info",description:"wait_async is set on an action that ignores it",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{a?.handler!=="SYSTEM"||!0!==a.wait_async||n.has(a.action)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:"DELAY"===a.action?"DELAY always waits for its timeout — `wait_async: true` is redundant.":`\`wait_async: true\` has no effect on ${a.action}; the action does not block the chain.`,hint:"DELAY"===a.action?"Remove the redundant flag.":"Remove the flag, or restructure if you relied on it for sequencing."})})})})}}},59707(e,t,r){let{forEachCanvas:a,frameIsNumeric:i,frameContains:n,itemHasAnimations:s}=r(27899);e.exports={code:"z-order-cover",severity:"info",description:"A later opaque element fully covers an earlier pressable element",check(e,t,r){a(e,({subspaceId:e,subspace:a,canvasId:o,items:l})=>{let c=a.brick_map||{},d=[];if(l.forEach((e,t)=>{if(e?.type!=="brick"||!i(e.frame))return;let r=c[e.brick_id];r&&Object.entries(r?.event_map||{}).some(([e,t])=>e.includes("_ON_PRESS")&&Array.isArray(t)&&t.length>0)&&d.push({item:e,index:t,brick:r})}),0===d.length)return;let p=t.dynamicRefIds,h=l.map((e,t)=>((e,t,r,a)=>{let n;if(e?.type!=="brick"||!i(e.frame)||s(e)||a.has(e.brick_id))return null;let o=r[e.brick_id],l={...o?.property,...e.property};return"string"==typeof(n=l.backgroundColor)&&(/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*1(?:\.0+)?\s*\)$/.test(n)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(n)||/^#[0-9a-fA-F]{6}$/.test(n))&&(void 0===l.opacity||1===l.opacity)?{index:t,item:e,brick:o,frame:e.frame}:null})(e,t,c,p)).filter(Boolean),u=(e=>{let t=Array(e.length),r=1/0,a=1/0,i=-1/0,n=-1/0,s=-1/0,o=-1/0;for(let l=e.length-1;l>=0;l-=1){let{frame:c}=e[l];r=Math.min(r,c.x),a=Math.min(a,c.y),i=Math.max(i,c.x+c.width),n=Math.max(n,c.y+c.height),s=Math.max(s,c.width),o=Math.max(o,c.height),t[l]={minX:r,minY:a,maxRight:i,maxBottom:n,maxWidth:s,maxHeight:o}}return t})(h),m=0;d.forEach(({item:t,index:a,brick:i})=>{let l,c;if(!(s(t)||p.has(t.brick_id))){for(;m<h.length&&h[m].index<=a;)m+=1;if(l=u[m],c=t.frame,l&&l.minX<=c.x+.01&&l.minY<=c.y+.01&&l.maxRight>=c.x+c.width-.01&&l.maxBottom>=c.y+c.height-.01&&l.maxWidth>=c.width-.02&&l.maxHeight>=c.height-.02)for(let s=m;s<h.length;s+=1){let l=h[s];if(n(l.frame,t.frame))return void r({path:`subspace_map.${e}.canvas_map.${o}.item_list.${a}`,subspaceId:e,itemId:t.brick_id,message:`Pressable \`${i.title||t.brick_id}\` is fully covered by the opaque \`${l.brick?.title||l.item.brick_id}\` later in the item list — it is invisible and untappable.`,hint:"Reorder the items, shrink the covering element, or remove the hidden one."})}}})})}}}};
package/lib/557.js CHANGED
@@ -1 +1 @@
1
- export const __rspack_esm_id=557;export const __rspack_esm_ids=[557];export const __webpack_modules__={70604(t){t.exports=function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},90250(t,e,r){var i=r(3634),n=r(70604),o=r(78243),s=r(5523);t.exports=function(t){return i(t)||n(t)||o(t)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},69995(t,e,r){r.d(e,{H:()=>i});function i(t,e){try{var r=JSON.parse(t).error,i=r?.message??r;if("string"==typeof i&&i)return i}catch{}return t||e}},42208(t,e,r){r.d(e,{RP:()=>c});var i=r(99436),n=r(75720),o="CTOR",s="ctor@bricks.tools",u=`Co-authored-by: ${o} <${s}>`;function a(){return(a=i(function*(t){return!!(yield(0,n.sh)`cd ${t} && git config user.email`.quiet().nothrow().text()).trim()})).apply(this,arguments)}function c(t,e){return d.apply(this,arguments)}function d(){return(d=i(function*(t,e,r=[]){var i=yield function(t){return a.apply(this,arguments)}(t),n=i?[]:["-c",`user.name=${o}`,"-c",`user.email=${s}`],c=[];for(var d of e)c.push("-m",d);return i&&c.push("-m",u),[...n,"commit",...r,...c]})).apply(this,arguments)}},13376(t,e,r){r.d(e,{a:()=>a,p:()=>s});var i=r(99436),n=r(51455),o=".bricks/.last-pushed-commit";function s(t){return u.apply(this,arguments)}function u(){return(u=i(function*(t){try{return(yield(0,n.readFile)(`${t}/${o}`,"utf8")).trim()||null}catch{return null}})).apply(this,arguments)}function a(t,e){return c.apply(this,arguments)}function c(){return(c=i(function*(t,e){e&&(yield(0,n.mkdir)(`${t}/.bricks`,{recursive:!0}),yield(0,n.writeFile)(`${t}/${o}`,e))})).apply(this,arguments)}},69070(t,e,r){r.d(e,{k:()=>s,q:()=>a});var i=r(99436),n=r(26848),o=r(1708);function s(t){return u.apply(this,arguments)}function u(){return(u=i(function*(t){if(!o.stdin.isTTY)return"";var e=(0,n.createInterface)({input:o.stdin,output:o.stdout});try{return(yield e.question(`${t} `)).trim()}finally{e.close()}})).apply(this,arguments)}function a(t){return c.apply(this,arguments)}function c(){return(c=i(function*(t){return(yield s(t))==="y"})).apply(this,arguments)}},75720(t,e,r){r.d(e,{p:()=>l,sh:()=>f});var i,n,o=r(90250),s=r(99436),u=r(5018),a=r(44668),c=r(31421),d=r(73024),l=()=>{var t=process.argv[1];return t&&(0,d.existsSync)(t)?[process.execPath,t]:[process.execPath]},p=a(function t(e){u(this,t),this._cwd=void 0,this._mode="default",this._throw=!0,this._env=void 0,this._promise=null,this.args=e},[{key:"cwd",value:function(t){return this._cwd=t,this}},{key:"quiet",value:function(){return this._mode="quiet",this}},{key:"nothrow",value:function(){return this._throw=!1,this}},{key:"env",value:function(t){return this._env={...this._env,...t},this}},{key:"text",value:(i=s(function*(){return"default"===this._mode&&(this._mode="text"),(yield this.run()).stdout.toString("utf8")}),function(){return i.apply(this,arguments)})},{key:"then",value:function(t,e){return this.run().then(t,e)}},{key:"run",value:function(){return this._promise||(this._promise=this.exec()),this._promise}},{key:"exec",value:(n=s(function*(){var t=o(this.args),e=t[0],r=(function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i})(t).slice(1);if(!e)throw Error("sh: empty command");var i="default"===this._mode?["inherit","pipe","pipe"]:"quiet"===this._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],n=this._env?{...process.env,...this._env}:void 0,s=(0,c.spawn)(e,r,{cwd:this._cwd,stdio:i,env:n}),u=[],a=[];s.stdout?.on("data",t=>{u.push(t),"default"===this._mode&&process.stdout.write(t)}),s.stderr?.on("data",t=>{a.push(t),"default"===this._mode&&process.stderr.write(t)});var d=yield new Promise((t,e)=>{s.on("error",e),s.on("close",e=>t(e??0))}),l=Buffer.concat(u),p=Buffer.concat(a);if(0!==d&&this._throw){var h=Error(`sh: command failed with exit ${d}: ${this.args.join(" ")}`);throw h.exitCode=d,h.stdout=l,h.stderr=p,h}return{exitCode:d,stdout:l,stderr:p}}),function(){return n.apply(this,arguments)})}]),h=/\s/;function f(t,...e){var r,i,n,o,s,u=(r=[],i="",n=!1,o=()=>{n&&(r.push(i),i="",n=!1)},s=t=>{i+=t,n=!0},(t.forEach((t,r)=>{for(var i=0;i<t.length;i++){var n=t[i];h.test(n)?o():s(n)}r<e.length&&(t=>{if(null!=t){if(Array.isArray(t))return t.forEach((t,e)=>{e>0&&o(),s(String(t))});s(String(t))}})(e[r])}),o(),r.length>=3&&"cd"===r[0]&&"&&"===r[2])?{tokens:r.slice(3),initialCwd:r[1]}:{tokens:r}),a=u.tokens,c=u.initialCwd,d=new p(a);return c&&d.cwd(c),d}},71772(t,e,r){r.r(e),r.d(e,{push:()=>p});var i,n=r(99436),o=r(51455),s=r(75720),u=r(69995),a=r(42208),c=r(13376),d=r(69070),l=(i=n(function*(t){return JSON.parse((yield(0,o.readFile)(t,"utf8")))}),function(t){return i.apply(this,arguments)});function p(){return h.apply(this,arguments)}function h(){return(h=n(function*(t={}){var e,r=process.cwd(),i=t.autoCommit,n=t.check,p=t.validate,h=t.yes,f=0===(yield(0,s.sh)`cd ${r} && git status`.quiet().nothrow()).exitCode;if(!f&&!h&&!(yield(0,d.q)("No git repository found, continue? (y/n)")))throw Error("Update cancelled");var y=yield l(`${r}/application.json`),v=yield l(`${r}/.bricks/build/application-config.json`),m="",_="";if(f){if(yield(0,s.sh)`cd ${r} && git diff --name-only --diff-filter=ACMR`.text())if(i){_=(yield(0,s.sh)`cd ${r} && git rev-parse HEAD`.nothrow().text()).trim(),yield(0,s.sh)`cd ${r} && git add -A`;var g=yield(0,a.RP)(r,["chore: update bricks config"]);yield(0,s.sh)`cd ${r} && git ${g}`}else throw Error("Unstaged changes found, please commit or stash your changes before updating");m=(yield(0,s.sh)`cd ${r} && git rev-parse HEAD`.text()).trim()}if((void 0===n||n)&&(_?e=_:m&&(e=m)),!h&&!(yield(0,d.q)("Are you sure you want to push the new config? (y/n)")))throw Error("Update cancelled");var w="module"===y.type,x={...v,bricks_project_last_commit_id:m||void 0},$=`${r}/.bricks/build/push-config.json`;yield(0,o.writeFile)($,JSON.stringify(x));var k=["bricks",w?"module":"app","update",y.id,"-f",$,"--json"];void 0===p||p||k.push("--no-validate"),e&&k.push("--last-commit-id",e);var b=yield(0,s.sh)`${k}`.quiet().nothrow();if(0!==b.exitCode){var S=b.stderr.toString()||b.stdout.toString();throw Error((0,u.H)(S,"Update failed"))}var q=JSON.parse(b.stdout.toString());m&&(yield(0,c.a)(r,m)),console.log(`${w?"Module":"App"} config updated: ${q.target?.name||y.name}`)})).apply(this,arguments)}}};
1
+ export const __rspack_esm_id=557;export const __rspack_esm_ids=[557];export const __webpack_modules__={5018(t){t.exports=function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},44668(t,e,r){var i=r(56347);function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,i(o.key),o)}}t.exports=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},70604(t){t.exports=function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},90250(t,e,r){var i=r(3634),o=r(70604),n=r(78243),s=r(5523);t.exports=function(t){return i(t)||o(t)||n(t)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},23878(t,e,r){var i=r(14319).default;t.exports=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=i(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},56347(t,e,r){var i=r(14319).default,o=r(23878);t.exports=function(t){var e=o(t,"string");return"symbol"==i(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},14319(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},69995(t,e,r){r.d(e,{H:()=>i});function i(t,e){try{var r=JSON.parse(t).error,i=r?.message??r;if("string"==typeof i&&i)return i}catch{}return t||e}},42208(t,e,r){r.d(e,{RP:()=>l});var i=r(99436),o=r(75720),n="CTOR",s="ctor@bricks.tools",u=`Co-authored-by: ${n} <${s}>`;function a(){return(a=i(function*(t){return!!(yield(0,o.sh)`cd ${t} && git config user.email`.quiet().nothrow().text()).trim()})).apply(this,arguments)}function l(t,e){return p.apply(this,arguments)}function p(){return(p=i(function*(t,e,r=[]){var i=yield function(t){return a.apply(this,arguments)}(t),o=i?[]:["-c",`user.name=${n}`,"-c",`user.email=${s}`],l=[];for(var p of e)l.push("-m",p);return i&&l.push("-m",u),[...o,"commit",...r,...l]})).apply(this,arguments)}},13376(t,e,r){r.d(e,{a:()=>a,p:()=>s});var i=r(99436),o=r(51455),n=".bricks/.last-pushed-commit";function s(t){return u.apply(this,arguments)}function u(){return(u=i(function*(t){try{return(yield(0,o.readFile)(`${t}/${n}`,"utf8")).trim()||null}catch{return null}})).apply(this,arguments)}function a(t,e){return l.apply(this,arguments)}function l(){return(l=i(function*(t,e){e&&(yield(0,o.mkdir)(`${t}/.bricks`,{recursive:!0}),yield(0,o.writeFile)(`${t}/${n}`,e))})).apply(this,arguments)}},69070(t,e,r){r.d(e,{k:()=>s,q:()=>a});var i=r(99436),o=r(26848),n=r(1708);function s(t){return u.apply(this,arguments)}function u(){return(u=i(function*(t){if(!n.stdin.isTTY)return"";var e=(0,o.createInterface)({input:n.stdin,output:n.stdout});try{return(yield e.question(`${t} `)).trim()}finally{e.close()}})).apply(this,arguments)}function a(t){return l.apply(this,arguments)}function l(){return(l=i(function*(t){return(yield s(t))==="y"})).apply(this,arguments)}},75720(t,e,r){r.d(e,{p:()=>c,sh:()=>h});var i,o,n=r(90250),s=r(99436),u=r(5018),a=r(44668),l=r(31421),p=r(73024),c=()=>{var t=process.argv[1];return t&&(0,p.existsSync)(t)?[process.execPath,t]:[process.execPath]},d=a(function t(e){u(this,t),this._cwd=void 0,this._mode="default",this._throw=!0,this._env=void 0,this._promise=null,this.args=e},[{key:"cwd",value:function(t){return this._cwd=t,this}},{key:"quiet",value:function(){return this._mode="quiet",this}},{key:"nothrow",value:function(){return this._throw=!1,this}},{key:"env",value:function(t){return this._env={...this._env,...t},this}},{key:"text",value:(i=s(function*(){return"default"===this._mode&&(this._mode="text"),(yield this.run()).stdout.toString("utf8")}),function(){return i.apply(this,arguments)})},{key:"then",value:function(t,e){return this.run().then(t,e)}},{key:"run",value:function(){return this._promise||(this._promise=this.exec()),this._promise}},{key:"exec",value:(o=s(function*(){var t=n(this.args),e=t[0],r=(function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i})(t).slice(1);if(!e)throw Error("sh: empty command");var i="default"===this._mode?["inherit","pipe","pipe"]:"quiet"===this._mode?["ignore","pipe","pipe"]:["inherit","pipe","pipe"],o=this._env?{...process.env,...this._env}:void 0,s=(0,l.spawn)(e,r,{cwd:this._cwd,stdio:i,env:o}),u=[],a=[];s.stdout?.on("data",t=>{u.push(t),"default"===this._mode&&process.stdout.write(t)}),s.stderr?.on("data",t=>{a.push(t),"default"===this._mode&&process.stderr.write(t)});var p=yield new Promise((t,e)=>{s.on("error",e),s.on("close",e=>t(e??0))}),c=Buffer.concat(u),d=Buffer.concat(a);if(0!==p&&this._throw){var f=Error(`sh: command failed with exit ${p}: ${this.args.join(" ")}`);throw f.exitCode=p,f.stdout=c,f.stderr=d,f}return{exitCode:p,stdout:c,stderr:d}}),function(){return o.apply(this,arguments)})}]),f=/\s/;function h(t,...e){var r,i,o,n,s,u=(r=[],i="",o=!1,n=()=>{o&&(r.push(i),i="",o=!1)},s=t=>{i+=t,o=!0},(t.forEach((t,r)=>{for(var i=0;i<t.length;i++){var o=t[i];f.test(o)?n():s(o)}r<e.length&&(t=>{if(null!=t){if(Array.isArray(t))return t.forEach((t,e)=>{e>0&&n(),s(String(t))});s(String(t))}})(e[r])}),n(),r.length>=3&&"cd"===r[0]&&"&&"===r[2])?{tokens:r.slice(3),initialCwd:r[1]}:{tokens:r}),a=u.tokens,l=u.initialCwd,p=new d(a);return l&&p.cwd(l),p}},71772(t,e,r){r.r(e),r.d(e,{push:()=>d});var i,o=r(99436),n=r(51455),s=r(75720),u=r(69995),a=r(42208),l=r(13376),p=r(69070),c=(i=o(function*(t){return JSON.parse((yield(0,n.readFile)(t,"utf8")))}),function(t){return i.apply(this,arguments)});function d(){return f.apply(this,arguments)}function f(){return(f=o(function*(t={}){var e,r=process.cwd(),i=t.autoCommit,o=t.check,d=t.validate,f=t.yes,h=0===(yield(0,s.sh)`cd ${r} && git status`.quiet().nothrow()).exitCode;if(!h&&!f&&!(yield(0,p.q)("No git repository found, continue? (y/n)")))throw Error("Update cancelled");var y=yield c(`${r}/application.json`),m=yield c(`${r}/.bricks/build/application-config.json`),v="",_="";if(h){if(yield(0,s.sh)`cd ${r} && git diff --name-only --diff-filter=ACMR`.text())if(i){_=(yield(0,s.sh)`cd ${r} && git rev-parse HEAD`.nothrow().text()).trim(),yield(0,s.sh)`cd ${r} && git add -A`;var x=yield(0,a.RP)(r,["chore: update bricks config"]);yield(0,s.sh)`cd ${r} && git ${x}`}else throw Error("Unstaged changes found, please commit or stash your changes before updating");v=(yield(0,s.sh)`cd ${r} && git rev-parse HEAD`.text()).trim()}if((void 0===o||o)&&(_?e=_:v&&(e=v)),!f&&!(yield(0,p.q)("Are you sure you want to push the new config? (y/n)")))throw Error("Update cancelled");var g="module"===y.type,w={...m,bricks_project_last_commit_id:v||void 0},b=`${r}/.bricks/build/push-config.json`;yield(0,n.writeFile)(b,JSON.stringify(w));var $=["bricks",g?"module":"app","update",y.id,"-f",b,"--json"];void 0===d||d||$.push("--no-validate"),e&&$.push("--last-commit-id",e);var k=yield(0,s.sh)`${$}`.quiet().nothrow();if(0!==k.exitCode){var S=k.stderr.toString()||k.stdout.toString();throw Error((0,u.H)(S,"Update failed"))}var E=JSON.parse(k.stdout.toString());v&&(yield(0,l.a)(r,v)),console.log(`${g?"Module":"App"} config updated: ${E.target?.name||y.name}`)})).apply(this,arguments)}}};
package/lib/563.js CHANGED
@@ -1,4 +1,4 @@
1
- export const __rspack_esm_id=563;export const __rspack_esm_ids=[563];export const __webpack_modules__={56005(r,e,o){var t=o(95243),n=o(5485);r.exports=function(r){return n(t(r).toLowerCase())}},63322(r,e,o){o.r(e),o.d(e,{BUILTIN_ISSUE_CODES:()=>l,buildConfigDoctorReport:()=>g,getDoctorExitCode:()=>m,loadConfigForDoctor:()=>h,parseCodesOption:()=>f,renderConfigDoctorReport:()=>y,runConfigDoctor:()=>$});var t,n,i,s=o(99436),a=o(79896),c=o(38890),p=o(56493),l=["schema-error","ref-error","calc-error","expression-error","deprecated-feature"],u={error:0,warning:1,info:2},f=r=>"string"==typeof r&&r?r.split(",").map(r=>r.trim()).filter(Boolean):null,d=r=>{if(!r)throw Error("The fetched record has no config");return"string"==typeof r?JSON.parse(r):r},h=(t=s(function*(r,e,{composed:o=!1}={}){if(a.existsSync(e))return{config:JSON.parse(a.readFileSync(e,"utf-8")),target:{type:r,source:"file",path:e}};var t=(0,p.o)();if("app"===r){var n=yield t.application({id:e,composed:o});if(!n)throw Error(`Application not found: ${e}`);return{config:d(n.config),target:{type:r,source:"remote",id:e,composed:o}}}var i=yield t.module({id:e});if(!i)throw Error(`Module not found: ${e}`);return{config:d(i.config),target:{type:r,source:"remote",id:e}}}),function(r,e){return t.apply(this,arguments)}),g=(n=s(function*(r,{type:e="app",only:o=null,ignore:t=null,checkAutomation:n=!1}={}){var i=[...l,...c.lintRuleCodes],s=[...o||[],...t||[]].filter(r=>!i.includes(r));if(s.length>0)throw Error(`Unknown rule code(s): ${s.join(", ")}
1
+ export const __rspack_esm_id=563;export const __rspack_esm_ids=[563];export const __webpack_modules__={56005(r,e,o){var t=o(95243),n=o(5485);r.exports=function(r){return n(t(r).toLowerCase())}},63322(r,e,o){o.r(e),o.d(e,{BUILTIN_ISSUE_CODES:()=>l,buildConfigDoctorReport:()=>g,getDoctorExitCode:()=>m,loadConfigForDoctor:()=>h,parseCodesOption:()=>f,renderConfigDoctorReport:()=>y,runConfigDoctor:()=>$});var t,n,i,s=o(99436),a=o(79896),c=o(38890),p=o(56493),l=["schema-error","ref-error","calc-error","expression-error","deprecated-feature"],u={error:0,warning:1,info:2},f=r=>"string"==typeof r&&r?r.split(",").map(r=>r.trim()).filter(Boolean):null,d=r=>{if(!r)throw Error("The fetched record has no config");return"string"==typeof r?JSON.parse(r):r},h=(t=s(function*(r,e,{composed:o=!1}={}){if(a.existsSync(e))return{config:JSON.parse(a.readFileSync(e,"utf-8")),target:{type:r,source:"file",path:e}};var t=(0,p.requireAuth)();if("app"===r){var n=yield t.application({id:e,composed:o});if(!n)throw Error(`Application not found: ${e}`);return{config:d(n.config),target:{type:r,source:"remote",id:e,composed:o}}}var i=yield t.module({id:e});if(!i)throw Error(`Module not found: ${e}`);return{config:d(i.config),target:{type:r,source:"remote",id:e}}}),function(r,e){return t.apply(this,arguments)}),g=(n=s(function*(r,{type:e="app",only:o=null,ignore:t=null,checkAutomation:n=!1}={}){var i=[...l,...c.lintRuleCodes],s=[...o||[],...t||[]].filter(r=>!i.includes(r));if(s.length>0)throw Error(`Unknown rule code(s): ${s.join(", ")}
2
2
  Valid codes: ${i.join(", ")}`);var a=r=>(!o||o.includes(r))&&(!t||!t.includes(r)),p=[],f=(0,c.checkConfig)(r,{checkCalc:!0,checkExpressions:!0,checkAutomation:n}),d=(r,e,o)=>{a(e)&&(r||[]).forEach(r=>p.push({hint:null,...o(r)}))};d(f.schema,"schema-error",r=>({severity:"error",code:"schema-error",path:r.instancePath||r.dataPath||"/",message:r.message,hint:r.params?.pattern?`pattern: ${r.params.pattern}`:null})),d(f.ref,"ref-error",r=>({severity:"error",code:"ref-error",path:r.field,message:r.message})),d(f.calc,"calc-error",r=>({severity:"error",code:"calc-error",path:r.field,message:r.message})),d(f.expression,"expression-error",r=>({severity:"error",code:"expression-error",path:r.field,message:r.message})),a("deprecated-feature")&&(0,c.checkConfigDeprecatedFeatures)(r).forEach(r=>p.push({severity:"warning",code:"deprecated-feature",path:r.id,message:r.data,hint:null}));var h=!f.valid;if(!h){var g=o?o.filter(r=>c.lintRuleCodes.includes(r)):null,m=t?t.filter(r=>c.lintRuleCodes.includes(r)):null;(!g||g.length>0)&&p.push(...(0,c.lintConfig)(r,{configType:e,only:g,ignore:m}))}p.sort((r,e)=>u[r.severity]-u[e.severity]);var v={errors:p.filter(r=>"error"===r.severity).length,warnings:p.filter(r=>"warning"===r.severity).length,infos:p.filter(r=>"info"===r.severity).length};return{ok:0===v.errors,valid:f.valid,lintSkipped:h,summary:v,issues:p}}),function(r){return n.apply(this,arguments)}),m=(r,{strict:e=!1}={})=>r.summary.errors>0||e&&r.summary.warnings>0?1:0,v=[["error","Errors"],["warning","Warnings"],["info","Info"]],y=r=>{var e=[];e.push("\nConfig Doctor Report");var o=r.target;if(o){var t="file"===o.source?`${o.type} config: ${o.path}`:`${o.type}: ${o.id}${o.composed?" (composed)":""}`;e.push(t)}if(e.push("─".repeat(60)),0===r.issues.length)return e.push("✓ No issues found"),e.join("\n");v.forEach(([o,t])=>{var n=r.issues.filter(r=>r.severity===o);0!==n.length&&(e.push(`
3
3
  ${t} (${n.length})
4
4
  `),n.forEach((r,o)=>{e.push(` ${o+1}. [${r.code}] ${r.path||""}`),e.push(` ${r.message}`),r.hint&&e.push(` ↳ ${r.hint}`)}))}),r.lintSkipped&&e.push("\n ⚠ Lint rules skipped — fix schema/reference errors first"),e.push("\n"+"─".repeat(60));var n=r.summary,i=n.errors,s=n.warnings,a=n.infos,c=[];return i>0&&c.push(`✗ ${i} error(s)`),s>0&&c.push(`⚠ ${s} warning(s)`),a>0&&c.push(`ℹ ${a} info`),e.push(c.join(" ")),e.join("\n")},$=(i=s(function*(r,e,o){var t=f(o.only),n=f(o.ignore),i=yield h(r,e,{composed:!!o.composed}),s=i.config,a=i.target,c=yield g(s,{type:r,only:t,ignore:n,checkAutomation:!!o.validateAutomation});return c.target=a,{report:c,exitCode:m(c,{strict:!!o.strict})}}),function(r,e,o){return i.apply(this,arguments)})}};
package/lib/583.js ADDED
@@ -0,0 +1,22 @@
1
+ export const __rspack_esm_id=583;export const __rspack_esm_ids=[583];export const __webpack_modules__={68089(e,t,r){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};let n=r(24434),i=o(r(3680)),s=o(r(9873)),a=i.default("agent-base");function u(){let{stack:e}=Error();return"string"==typeof e&&e.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}function l(e,t){return new l.Agent(e,t)}var c=l||(l={});class f extends n.EventEmitter{constructor(e,t){super();let r=t;"function"==typeof e?this.callback=e:e&&(r=e),this.timeout=null,r&&"number"==typeof r.timeout&&(this.timeout=r.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:u()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:u()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,r){throw Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){let r=Object.assign({},t);"boolean"!=typeof r.secureEndpoint&&(r.secureEndpoint=u()),null==r.host&&(r.host="localhost"),null==r.port&&(r.port=r.secureEndpoint?443:80),null==r.protocol&&(r.protocol=r.secureEndpoint?"https:":"http:"),r.host&&r.path&&delete r.path,delete r.agent,delete r.hostname,delete r._defaultAgent,delete r.defaultPort,delete r.createConnection,e._last=!0,e.shouldKeepAlive=!1;let o=!1,n=null,i=r.timeout||this.timeout,l=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},c=e=>{o||(null!==n&&(clearTimeout(n),n=null),l(e))},f=t=>{if(!o){if(null!=n&&(clearTimeout(n),n=null),t&&"function"==typeof t.addRequest){a("Callback returned another Agent instance %o",t.constructor.name),t.addRequest(e,r);return}if(t){t.once("free",()=>{this.freeSocket(t,r)}),e.onSocket(t);return}l(Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``))}};if("function"!=typeof this.callback)return void l(Error("`callback` is not defined"));this.promisifiedCallback||(this.callback.length>=3?(a("Converting legacy callback function to promise"),this.promisifiedCallback=s.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof i&&i>0&&(n=setTimeout(()=>{n=null,o=!0;let e=Error(`A "socket" was not created for HTTP request before ${i}ms`);e.code="ETIMEOUT",l(e)},i)),"port"in r&&"number"!=typeof r.port&&(r.port=Number(r.port));try{a("Resolving socket for %o request: %o",r.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,r)).then(f,c)}catch(e){Promise.reject(e).catch(c)}}freeSocket(e,t){a("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){a("Destroying agent %o",this.constructor.name)}}c.Agent=f,c.prototype=c.Agent.prototype,e.exports=l},9873(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r){return new Promise((o,n)=>{e.call(this,t,r,(e,t)=>{e?n(e):o(t)})})}}},35646(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))(function(n,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((o=o.apply(e,t||[])).next())})},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let i=n(r(69278)),s=n(r(64756)),a=n(r(87016)),u=n(r(42613)),l=n(r(3680)),c=r(68089),f=n(r(36981)),p=l.default("https-proxy-agent:agent");class h extends c.Agent{constructor(e){var t;let r;if(!(r="string"==typeof e?a.default.parse(e):e))throw Error("an HTTP(S) proxy server `host` and `port` must be specified!");p("creating new HttpsProxyAgent instance: %o",r),super(r);let o=Object.assign({},r);this.secureProxy=r.secureProxy||"string"==typeof(t=o.protocol)&&/^https:?$/i.test(t),o.host=o.hostname||o.host,"string"==typeof o.port&&(o.port=parseInt(o.port,10)),!o.port&&o.host&&(o.port=this.secureProxy?443:80),!this.secureProxy||"ALPNProtocols"in o||(o.ALPNProtocols=["http 1.1"]),o.host&&o.path&&(delete o.path,delete o.pathname),this.proxy=o}callback(e,t){return o(this,void 0,void 0,function*(){var r,o;let n,{proxy:a,secureProxy:l}=this;l?(p("Creating `tls.Socket`: %o",a),n=s.default.connect(a)):(p("Creating `net.Socket`: %o",a),n=i.default.connect(a));let c=Object.assign({},a.headers),h=`${t.host}:${t.port}`,y=`CONNECT ${h} HTTP/1.1\r
2
+ `;a.auth&&(c["Proxy-Authorization"]=`Basic ${Buffer.from(a.auth).toString("base64")}`);let{host:v,port:m,secureEndpoint:x}=t;for(let e of(r=m,((o=x)||80!==r)&&(!o||443!==r)&&(v+=`:${m}`),c.Host=v,c.Connection="close",Object.keys(c)))y+=`${e}: ${c[e]}\r
3
+ `;let b=f.default(n);n.write(`${y}\r
4
+ `);let{statusCode:_,buffered:g}=yield b;if(200===_){if(e.once("socket",d),t.secureEndpoint){p("Upgrading socket connection to TLS");let e=t.servername||t.host;return s.default.connect(Object.assign(Object.assign({},function(e,...t){let r,o={};for(r in e)t.includes(r)||(o[r]=e[r]);return o}(t,"host","hostname","path","port")),{socket:n,servername:e}))}return n}n.destroy();let k=new i.default.Socket({writable:!1});return k.readable=!0,e.once("socket",e=>{p("replaying proxy buffer for failed request"),u.default(e.listenerCount("data")>0),e.push(g),e.push(null)}),k})}}function d(e){e.resume()}t.default=h},64007(e,t,r){var o;let n=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(35646));function i(e){return new n.default(e)}(o=i||(i={})).HttpsProxyAgent=n.default,o.prototype=n.default.prototype,e.exports=i},36981(e,t,r){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let n=o(r(3680)).default("https-proxy-agent:parse-proxy-response");t.default=function(e){return new Promise((t,r)=>{let o=0,i=[];function s(){let r=e.read();r?function(e){i.push(e),o+=e.length;let r=Buffer.concat(i,o);if(-1===r.indexOf("\r\n\r\n")){n("have not received end of HTTP headers yet..."),s();return}let a=r.toString("ascii",0,r.indexOf("\r\n")),u=+a.split(" ")[1];n("got proxy server response: %o",a),t({statusCode:u,buffered:r})}(r):e.once("readable",s)}function a(e){n("onclose had error %o",e)}function u(){n("onend")}e.on("error",function t(o){e.removeListener("end",u),e.removeListener("error",t),e.removeListener("close",a),e.removeListener("readable",s),n("onerror %o",o),r(o)}),e.on("close",a),e.on("end",u),s()})}},16699(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},62192(e,t,r){var o=r(16699);e.exports=function(e){var t={},r=!1;function n(t,n){return r=!0,{done:!1,value:new o(n=new Promise(function(r){r(e[t](n))}),1)}}return t["u">typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return r?(r=!1,e):n("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(r)throw r=!1,e;return n("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return r?(r=!1,e):n("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},32235(e,t,r){var o=r(16699);e.exports=function(e){return new o(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},5018(e){e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},44668(e,t,r){var o=r(56347);function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},23878(e,t,r){var o=r(14319).default;e.exports=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},56347(e,t,r){var o=r(14319).default,n=r(23878);e.exports=function(e){var t=n(e,"string");return"symbol"==o(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},14319(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4275(e,t,r){var o=r(16699);function n(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,u=a instanceof o;Promise.resolve(u?a.v:a).then(function(r){if(u){var o="return"===t?"return":"next";if(!a.k||r.done)return n(o,r);r=e[o](r).value}i(s.done?"return":"normal",r)},function(e){n("throw",e)})}catch(e){i("throw",e)}}function i(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise(function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}n.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},n.prototype.next=function(e){return this._invoke("next",e)},n.prototype.throw=function(e){return this._invoke("throw",e)},n.prototype.return=function(e){return this._invoke("return",e)},e.exports=function(e){return function(){return new n(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},92642(e,t,r){r.r(t),r.d(t,{ActivityLogClient:()=>k,createActivityLogClient:()=>w});var o,n,i,s=r(99436),a=r(5018),u=r(44668),l=r(4275),c=r(32235),f=r(62192),p=r(79657),h=r(64007);function d(e){var t,r,o,n=2;for("u">typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);n--;){if(r&&null!=(t=e[r]))return t.call(e);if(o&&null!=(t=e[o]))return new y(t.call(e));r="@@asyncIterator",o="@@iterator"}throw TypeError("Object is not async iterable")}function y(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(y=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 r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new y(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 r of t)yield r}if(Array.isArray(e.incremental)){for(var o of e.incremental)if(Array.isArray(o.items))for(var n of o.items)yield n}}function m(){return(m=l(function*(e){var t=e.headers.get("content-type")||"";if(t.includes("application/json")){var r=yield c(e.json());if(r.errors?.length)throw Error(r.errors.map(e=>e.message).join("\n"));var o=Object.keys(r.data||{})[0];if(o&&Array.isArray(r.data[o]))for(var n of r.data[o])yield n;return}var i=t.match(/boundary="?([^";]+)"?/),s=i?i[1]:"-",a=`--${s}`,u="",l=!1,p=new TextDecoder,h=e=>{for(var t=0;-1!==(t=e.indexOf(a,t));){if(0===t||"\n"===e[t-1])return t;t+=a.length}return -1},y=function*(){for(var e;-1!==(e=h(u));){var t=u.slice(0,e);(u=u.slice(e+a.length)).startsWith("\r\n")?u=u.slice(2):u.startsWith("\n")&&(u=u.slice(1));var r=t.indexOf("\r\n\r\n"),o=-1!==r?t.slice(r+4).trim():t.trim();if(o){var n=void 0;try{n=JSON.parse(o)}catch{continue}if(yield*v(n),!1===n.hasNext){l=!0;return}}}};try{var m=!1,x=!1;try{for(var b,_,g=d(e.body);m=!(_=yield c(g.next())).done;m=!1){var k=_.value;if(u+=p.decode(k,{stream:!0}),yield*f(d(y()),c),l)break}}catch(e){x=!0,b=e}finally{try{m&&null!=g.return&&(yield c(g.return()))}finally{if(x)throw b}}}catch(e){if(!e.message?.includes("Premature close")||!l)throw e}if(!l&&u.trim()){var w,P=u.indexOf("\r\n\r\n"),S=-1!==P?u.slice(P+4).trim():u.trim();if(S&&!S.startsWith("--")){try{w=JSON.parse(S)}catch{}w&&(yield*f(d(v(w)),c),!1===w.hasNext&&(l=!0))}}e.body?.destroy()})).apply(this,arguments)}var x=`
5
+ query AL_events($filter: EventsFilter!) {
6
+ events(filter: $filter) @stream {
7
+ device_id
8
+ event_type
9
+ event_name
10
+ subspace_id
11
+ sender
12
+ payload
13
+ timestamp
14
+ }
15
+ }
16
+ `,b=`
17
+ query AL_screenshots($filter: ScreenshotFilter!) {
18
+ screenshots(filter: $filter) @stream {
19
+ timestamp
20
+ }
21
+ }
22
+ `;function _(e){var t,r,o,n=2;for("u">typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);n--;){if(r&&null!=(t=e[r]))return t.call(e);if(o&&null!=(t=e[o]))return new g(t.call(e));r="@@asyncIterator",o="@@iterator"}throw TypeError("Object is not async iterable")}function g(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(g=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 r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new g(e)}var k=u(function e(t,r){a(this,e),this.baseUrl=t,this.token=r,this.graphqlUrl=`${t}/api/graphql`,this.fetch=function(e){var t=process.env.HTTPS_PROXY||process.env.https_proxy;if(!t||!e.startsWith("https://"))return p.Ay;var r=new h(t);return(e,t={})=>(0,p.Ay)(e,{...t,agent:r})}(t)},[{key:"streamQuery",value:function(e,t){var r=this;return l(function*(e,t,{signal:o}={}){var n=yield c(r.fetch(r.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.token}`,Accept:'multipart/mixed; boundary="-", application/json'},body:JSON.stringify({query:e,variables:t}),signal:o}));if(!n.ok){var i=yield c(n.text().catch(()=>""));throw Error(`Activity-log query failed (${n.status}): ${i}`)}yield*f(_(function(e){return m.apply(this,arguments)}(n)),c)}).apply(this,arguments)}},{key:"events",value:function(e,t){var r=this;return l(function*(){yield*f(_(r.streamQuery(x,{filter:e},t)),c)})()}},{key:"screenshots",value:function(e,t){var r=this;return l(function*(){yield*f(_(r.streamQuery(b,{filter:e},t)),c)})()}},{key:"collectEvents",value:(o=s(function*(e,{limit:t,signal:r}={}){var o=[],n=!1,i=!1;try{for(var s,a,u=_(this.events(e,{signal:r}));n=!(a=yield u.next()).done;n=!1){var l=a.value;if(o.push(l),t&&o.length>=t)break}}catch(e){i=!0,s=e}finally{try{n&&null!=u.return&&(yield u.return())}finally{if(i)throw s}}return o}),function(e){return o.apply(this,arguments)})},{key:"collectScreenshots",value:(n=s(function*(e,{signal:t}={}){var r=[],o=!1,n=!1;try{for(var i,s,a=_(this.screenshots(e,{signal:t}));o=!(s=yield a.next()).done;o=!1){var u=s.value;r.push(u)}}catch(e){n=!0,i=e}finally{try{o&&null!=a.return&&(yield a.return())}finally{if(n)throw i}}return r}),function(e){return n.apply(this,arguments)})},{key:"downloadScreenshot",value:(i=s(function*(e,t,r,{signal:o}={}){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(t)}/screenshot?ts=${encodeURIComponent(r)}`,i=yield this.fetch(n,{headers:{Authorization:`Bearer ${this.token}`},signal:o});if(!i.ok){var s=yield i.text().catch(()=>"");throw Error(`Screenshot fetch failed (${i.status}): ${s}`)}return Buffer.from((yield i.arrayBuffer()))}),function(e,t,r){return i.apply(this,arguments)})}]),w=(e,t)=>new k(e,t)}};