@next-bricks/ai-portal 0.50.1 → 0.50.3
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/dist/bricks.json +41 -41
- package/dist/chunks/1334.aae33a33.js +2 -0
- package/dist/chunks/1334.aae33a33.js.map +1 -0
- package/dist/chunks/2142.c02a98d9.js +2 -0
- package/dist/chunks/{2142.44c752fe.js.map → 2142.c02a98d9.js.map} +1 -1
- package/dist/chunks/3199.0220cf6e.js +3 -0
- package/dist/chunks/3199.0220cf6e.js.map +1 -0
- package/dist/chunks/3735.8c1d82e7.js +15 -0
- package/dist/chunks/3735.8c1d82e7.js.LICENSE.txt +5 -0
- package/dist/chunks/3735.8c1d82e7.js.map +1 -0
- package/dist/chunks/4317.d0f5904b.js +3 -0
- package/dist/chunks/{3151.d1fdecfb.js.LICENSE.txt → 4317.d0f5904b.js.LICENSE.txt} +8 -0
- package/dist/chunks/4317.d0f5904b.js.map +1 -0
- package/dist/chunks/6201.993201cb.js +2 -0
- package/dist/chunks/6201.993201cb.js.map +1 -0
- package/dist/chunks/6593.f25cfd6b.js +2 -0
- package/dist/chunks/6593.f25cfd6b.js.map +1 -0
- package/dist/chunks/8135.3255c5ba.js +2 -0
- package/dist/chunks/8135.3255c5ba.js.map +1 -0
- package/dist/chunks/8717.feabd75d.js +2 -0
- package/dist/chunks/8717.feabd75d.js.map +1 -0
- package/dist/chunks/8889.bcfc6cab.js +3 -0
- package/dist/chunks/8889.bcfc6cab.js.map +1 -0
- package/dist/chunks/{ai-employees.941aaa1b.js → ai-employees.b8e937d4.js} +3 -3
- package/dist/chunks/{ai-employees.941aaa1b.js.map → ai-employees.b8e937d4.js.map} +1 -1
- package/dist/chunks/elevo-sidebar.e53ce03a.js +3 -0
- package/dist/chunks/elevo-sidebar.e53ce03a.js.map +1 -0
- package/dist/chunks/{main.a75af455.js → main.c5d23a2b.js} +2 -2
- package/dist/chunks/{main.a75af455.js.map → main.c5d23a2b.js.map} +1 -1
- package/dist/chunks/page-container.bfb9337e.js +2 -0
- package/dist/chunks/page-container.bfb9337e.js.map +1 -0
- package/dist/chunks/preview-container.6b29ee97.js +2 -0
- package/dist/chunks/preview-container.6b29ee97.js.map +1 -0
- package/dist/chunks/show-case.be5d82fd.js +2 -0
- package/dist/chunks/show-case.be5d82fd.js.map +1 -0
- package/dist/examples.json +15 -15
- package/dist/index.e0156b47.js +2 -0
- package/dist/index.e0156b47.js.map +1 -0
- package/dist/manifest.json +307 -307
- package/dist/types.json +322 -313
- package/dist-types/elevo-sidebar/bricks.d.ts +3 -1
- package/dist-types/elevo-sidebar/index.d.ts +0 -2
- package/dist-types/page-container/index.d.ts +2 -0
- package/dist-types/shared/interfaces.d.ts +2 -2
- package/dist-types/shared/workers/tsxParser.d.ts +2 -2
- package/package.json +2 -2
- package/dist/chunks/2142.44c752fe.js +0 -2
- package/dist/chunks/3151.d1fdecfb.js +0 -3
- package/dist/chunks/3151.d1fdecfb.js.map +0 -1
- package/dist/chunks/3735.0389cba2.js +0 -15
- package/dist/chunks/3735.0389cba2.js.map +0 -1
- package/dist/chunks/3832.9b48b5f5.js +0 -2
- package/dist/chunks/3832.9b48b5f5.js.map +0 -1
- package/dist/chunks/6201.01557568.js +0 -2
- package/dist/chunks/6201.01557568.js.map +0 -1
- package/dist/chunks/7580.5dca4f97.js +0 -3
- package/dist/chunks/7580.5dca4f97.js.LICENSE.txt +0 -9
- package/dist/chunks/7580.5dca4f97.js.map +0 -1
- package/dist/chunks/8414.8b8390cb.js +0 -2
- package/dist/chunks/8414.8b8390cb.js.map +0 -1
- package/dist/chunks/8717.4f49d4f6.js +0 -2
- package/dist/chunks/8717.4f49d4f6.js.map +0 -1
- package/dist/chunks/8889.0e3616d2.js +0 -3
- package/dist/chunks/8889.0e3616d2.js.map +0 -1
- package/dist/chunks/elevo-sidebar.d95cf869.js +0 -3
- package/dist/chunks/elevo-sidebar.d95cf869.js.map +0 -1
- package/dist/chunks/page-container.e187d00a.js +0 -2
- package/dist/chunks/page-container.e187d00a.js.map +0 -1
- package/dist/chunks/preview-container.631389f7.js +0 -2
- package/dist/chunks/preview-container.631389f7.js.map +0 -1
- package/dist/chunks/show-case.22cdff4b.js +0 -2
- package/dist/chunks/show-case.22cdff4b.js.map +0 -1
- package/dist/index.a8d6d207.js +0 -2
- package/dist/index.a8d6d207.js.map +0 -1
- /package/dist/chunks/{3735.0389cba2.js.LICENSE.txt → 3199.0220cf6e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{8889.0e3616d2.js.LICENSE.txt → 8889.bcfc6cab.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{ai-employees.941aaa1b.js.LICENSE.txt → ai-employees.b8e937d4.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{elevo-sidebar.d95cf869.js.LICENSE.txt → elevo-sidebar.e53ce03a.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
"id": "bricks/ai-portal",
|
|
3
3
|
"bricks": [
|
|
4
4
|
"ai-portal.chat-box",
|
|
5
|
-
"ai-portal.home-container",
|
|
6
|
-
"ai-portal.stat-with-mini-chart",
|
|
7
|
-
"ai-portal.cruise-canvas",
|
|
8
5
|
"ai-portal.elevo-sidebar",
|
|
6
|
+
"ai-portal.icon-button",
|
|
9
7
|
"ai-portal.show-cases",
|
|
8
|
+
"ai-portal.mcp-tools",
|
|
10
9
|
"ai-portal.chat-stream",
|
|
11
10
|
"ai-portal.ai-employees",
|
|
12
|
-
"ai-portal.
|
|
11
|
+
"ai-portal.cruise-canvas",
|
|
13
12
|
"ai-portal.ai-agents",
|
|
14
|
-
"ai-portal.page-container",
|
|
15
13
|
"ai-portal.call-tool",
|
|
16
14
|
"ai-portal.save-request-store",
|
|
17
15
|
"ai-portal.load-request-store",
|
|
18
16
|
"ai-portal.clear-request-store",
|
|
17
|
+
"ai-portal.page-container",
|
|
19
18
|
"ai-portal.tab-list",
|
|
20
|
-
"ai-portal.icon-button",
|
|
21
|
-
"ai-portal.preview-container",
|
|
22
19
|
"ai-portal.dropdown-select",
|
|
23
20
|
"ai-portal.action-buttons",
|
|
24
21
|
"ai-portal.goal-card-list",
|
|
22
|
+
"ai-portal.home-container",
|
|
25
23
|
"ai-portal.project-conversations",
|
|
26
24
|
"ai-portal.project-knowledges",
|
|
27
25
|
"ai-portal.activity-timeline",
|
|
26
|
+
"ai-portal.preview-container",
|
|
28
27
|
"ai-portal.chat-input",
|
|
29
28
|
"ai-portal.elevo-logo",
|
|
30
29
|
"ai-portal.show-case",
|
|
30
|
+
"ai-portal.stat-with-mini-chart",
|
|
31
31
|
"ai-portal.blank-state",
|
|
32
32
|
"ai-portal.sticky-container"
|
|
33
33
|
],
|
|
@@ -39,26 +39,6 @@
|
|
|
39
39
|
"eo-icon",
|
|
40
40
|
"eo-actions"
|
|
41
41
|
],
|
|
42
|
-
"ai-portal.stat-with-mini-chart": [
|
|
43
|
-
"eo-mini-line-chart"
|
|
44
|
-
],
|
|
45
|
-
"ai-portal.cruise-canvas": [
|
|
46
|
-
"eo-icon",
|
|
47
|
-
"eo-button",
|
|
48
|
-
"eo-link",
|
|
49
|
-
"eo-tooltip",
|
|
50
|
-
"eo-popover",
|
|
51
|
-
"eo-drawer",
|
|
52
|
-
"ai-portal.icon-button",
|
|
53
|
-
"ai-portal.chat-input",
|
|
54
|
-
"ai-portal.show-case",
|
|
55
|
-
"eo-code-block",
|
|
56
|
-
"basic.show-dialog",
|
|
57
|
-
"basic.copy-to-clipboard",
|
|
58
|
-
"eo-easyops-avatar",
|
|
59
|
-
"presentational.code-wrapper",
|
|
60
|
-
"eo-avatar"
|
|
61
|
-
],
|
|
62
42
|
"ai-portal.elevo-sidebar": [
|
|
63
43
|
"ai-portal.elevo-logo",
|
|
64
44
|
"eo-icon",
|
|
@@ -68,10 +48,19 @@
|
|
|
68
48
|
"eo-mini-actions",
|
|
69
49
|
"ai-portal.icon-button"
|
|
70
50
|
],
|
|
51
|
+
"ai-portal.icon-button": [
|
|
52
|
+
"eo-icon",
|
|
53
|
+
"eo-tooltip"
|
|
54
|
+
],
|
|
71
55
|
"ai-portal.show-cases": [
|
|
72
56
|
"ai-portal.show-case",
|
|
73
57
|
"ai-portal.tab-list"
|
|
74
58
|
],
|
|
59
|
+
"ai-portal.mcp-tools": [
|
|
60
|
+
"eo-icon",
|
|
61
|
+
"ai-portal.tab-list",
|
|
62
|
+
"ai-portal.sticky-container"
|
|
63
|
+
],
|
|
75
64
|
"ai-portal.chat-stream": [
|
|
76
65
|
"eo-icon",
|
|
77
66
|
"eo-button",
|
|
@@ -92,10 +81,22 @@
|
|
|
92
81
|
"eo-icon",
|
|
93
82
|
"ai-portal.tab-list"
|
|
94
83
|
],
|
|
95
|
-
"ai-portal.
|
|
84
|
+
"ai-portal.cruise-canvas": [
|
|
96
85
|
"eo-icon",
|
|
97
|
-
"
|
|
98
|
-
"
|
|
86
|
+
"eo-button",
|
|
87
|
+
"eo-link",
|
|
88
|
+
"eo-tooltip",
|
|
89
|
+
"eo-popover",
|
|
90
|
+
"eo-drawer",
|
|
91
|
+
"ai-portal.icon-button",
|
|
92
|
+
"ai-portal.chat-input",
|
|
93
|
+
"ai-portal.show-case",
|
|
94
|
+
"eo-code-block",
|
|
95
|
+
"basic.show-dialog",
|
|
96
|
+
"basic.copy-to-clipboard",
|
|
97
|
+
"eo-easyops-avatar",
|
|
98
|
+
"presentational.code-wrapper",
|
|
99
|
+
"eo-avatar"
|
|
99
100
|
],
|
|
100
101
|
"ai-portal.ai-agents": [
|
|
101
102
|
"eo-icon",
|
|
@@ -105,16 +106,6 @@
|
|
|
105
106
|
"eo-link",
|
|
106
107
|
"ai-portal.sticky-container"
|
|
107
108
|
],
|
|
108
|
-
"ai-portal.icon-button": [
|
|
109
|
-
"eo-icon",
|
|
110
|
-
"eo-tooltip"
|
|
111
|
-
],
|
|
112
|
-
"ai-portal.preview-container": [
|
|
113
|
-
"eo-icon",
|
|
114
|
-
"eo-page-title",
|
|
115
|
-
"eo-main-view",
|
|
116
|
-
"eo-narrow-view"
|
|
117
|
-
],
|
|
118
109
|
"ai-portal.dropdown-select": [
|
|
119
110
|
"eo-popover",
|
|
120
111
|
"eo-icon",
|
|
@@ -150,6 +141,12 @@
|
|
|
150
141
|
"eo-icon",
|
|
151
142
|
"eo-easyops-avatar"
|
|
152
143
|
],
|
|
144
|
+
"ai-portal.preview-container": [
|
|
145
|
+
"eo-icon",
|
|
146
|
+
"eo-page-title",
|
|
147
|
+
"eo-main-view",
|
|
148
|
+
"eo-narrow-view"
|
|
149
|
+
],
|
|
153
150
|
"ai-portal.chat-input": [
|
|
154
151
|
"eo-icon",
|
|
155
152
|
"ai-portal.icon-button"
|
|
@@ -157,7 +154,10 @@
|
|
|
157
154
|
"ai-portal.show-case": [
|
|
158
155
|
"eo-icon",
|
|
159
156
|
"eo-link"
|
|
157
|
+
],
|
|
158
|
+
"ai-portal.stat-with-mini-chart": [
|
|
159
|
+
"eo-mini-line-chart"
|
|
160
160
|
]
|
|
161
161
|
},
|
|
162
|
-
"filePath": "bricks/ai-portal/dist/index.
|
|
162
|
+
"filePath": "bricks/ai-portal/dist/index.e0156b47.js"
|
|
163
163
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e,n,t,r,o,s,i,a,d,l,u,p,c,f,m,g,h,y,v,b={41334:(e,n,t)=>{var r=t(40580),o=t(58135),s=t(80004);const i="next-tsx",a=["callApi","callHttp","callTool"];function d(e,n){return!e.async&&!e.generator||(n.errors.push({message:"Function cannot be async or generator",node:e,severity:"error"}),!1)}function l(e,n){return!!e.referencesImport(i,n)||e.node.name===n&&!e.scope.getBinding(e.node.name)}function u(e,n){let t=null;return o.traverse(e,{enter(e,n){var r;!t&&(o.isFunctionExpression(e)||o.isStatement(e)||o.isAwaitExpression(e)||o.isYieldExpression(e)||o.isJSX(e)||o.isArrowFunctionExpression(e)&&(e.async||e.generator||o.isBlockStatement(e.body)||o.isObjectProperty(null===(r=n[n.length-1])||void 0===r?void 0:r.node)))&&(t=e)}}),!t||(null==n||n.errors.push({message:`Unsupported expression type: ${t.type}`,node:t,severity:"error"}),!1)}function p(e){return e.isNullLiteral()||e.isIdentifier()&&"undefined"===e.node.name&&void 0===e.scope.getBinding("undefined")}const c=/^<%=?\s/,f=/\s%>$/;function m(e){if("string"!=typeof e)return!1;const n=e.trim();return c.test(n)&&f.test(n)}function g(e,n,t,r){var o;const s=[],i={TSTypeAnnotation(e){s.push({type:"annotation",start:e.node.start,end:e.node.end}),e.skip()},TSTypeParameterInstantiation(e){s.push({type:"annotation",start:e.node.start,end:e.node.end}),e.skip()},TSAsExpression(e){s.push({type:"annotation",start:e.node.expression.end,end:e.node.end}),e.skip()},Identifier(e){var r,o,i,a,d,l;if(!e.isReferencedIdentifier())return;const u=e.parentPath.isObjectProperty()&&e.parentPath.node.shorthand,p=e.node.name,c=e.scope.getBindingIdentifier(p);if(c){var f,m;let l;switch(c){case null===(r=t.eventBinding)||void 0===r?void 0:r.id:l=null!==(o=t.eventBinding)&&void 0!==o&&o.isCallback?"EVENT.detail":"EVENT";break;case null===(i=t.forEachBinding)||void 0===i?void 0:i.item:l="ITEM";break;case null===(a=t.forEachBinding)||void 0===a?void 0:a.index:l="INDEX";break;case null===(d=t.dataBinding)||void 0===d?void 0:d.id:l="DATA"}if(l)return void s.push({type:"id",start:e.node.start,end:e.node.end,replacement:l,shorthand:u?p:void 0});const g=null===(f=t.component)||void 0===f?void 0:f.bindingMap.get(c);g?"state"===g.kind||"resource"===g.kind||"constant"===g.kind||"param"===g.kind||"query"===g.kind?s.push({type:"id",start:e.node.start,end:e.node.end,replacement:"query"===g.kind?"QUERY":`${"template"===t.component.type?"STATE":"CTX"}.${c.name}`,shorthand:u?p:void 0}):n.errors.push({message:`Invalid usage of ${g.kind} variable "${c.name}"`,node:e.node,severity:"error"}):null!==(m=t.functionBindings)&&void 0!==m&&m.has(c)&&s.push({type:"id",start:e.node.start,end:e.node.end,replacement:`FN.${p}`,shorthand:u?p:void 0})}else null!==(l=t.contextBindings)&&void 0!==l&&l.includes(p)&&s.push({type:"id",start:e.node.start,end:e.node.end,replacement:`CTX.${p}`,shorthand:u?p:void 0})}};e.isIdentifier()&&i.Identifier(e),e.traverse(i),s.sort(((e,n)=>e.start-n.start));const a=[];let d=e.node.start;for(const e of s)a.push(n.source.substring(d,e.start),"annotation"===e.type?"":`${e.shorthand?`${e.shorthand}:`:""}${e.replacement}`),d=e.end;a.push(n.source.substring(d,e.node.end));const l=a.join("");return r?l:`<%${null!==(o=t.modifier)&&void 0!==o?o:""} ${l} %>`}const h=Symbol("ambiguous");function y(e,n,t){if(e.isTSAsExpression())return y(e.get("expression"),n,t);if(e.isObjectExpression())return function(e,n,t){const r=e.get("properties");if(r.some((e=>e.isSpreadElement()||e.isObjectProperty()&&(e.node.computed||e.node.shorthand)))&&u(e.node,n))return t.ambiguous?h:g(e,n,t);const o={};for(const e of r){if(!e.isObjectProperty()){n.errors.push({message:`Unsupported property type: ${e.type}`,node:e.node,severity:"error"});continue}if(e.node.computed||e.node.shorthand){n.errors.push({message:"Unsupported computed or shorthand object property",node:e.node.key,severity:"error"});continue}const r=e.get("key");let s;if(r.isIdentifier())s=r.node.name;else{if(!r.isStringLiteral()){n.errors.push({message:`Unsupported object key type: ${r.node.type}`,node:r.node,severity:"error"});continue}s=r.node.value}o[s]=y(e.get("value"),n,t)}return o}(e,n,t);if(e.isArrayExpression())return function(e,n,t){const r=e.get("elements");if(r.some((e=>!e||e.isSpreadElement()))&&u(e.node,n))return t.ambiguous?h:g(e,n,t);const o=[];for(const s of r)s.node?s.isSpreadElement()?n.errors.push({message:"Spread elements are not supported in array",node:s.node,severity:"error"}):o.push(y(s,n,t)):n.errors.push({message:"Array elements cannot be empty",node:e.node,severity:"error"});return o}(e,n,t);if(e.isStringLiteral()||e.isNumericLiteral()||e.isBooleanLiteral())return e.node.value;if(e.isNullLiteral())return null;if(!e.isIdentifier()||"undefined"!==e.node.name||void 0!==e.scope.getBinding("undefined")){if(t.allowUseBrick&&e.isArrowFunctionExpression()){const r=e.get("body");if(r.isBlockStatement())return n.errors.push({message:"Block statements are not supported in render callback",node:r.node,severity:"error"}),null;const o=[];for(const t of e.get("params")){if(!t.isIdentifier())return n.errors.push({message:`Unsupported parameter type: ${t.type}`,node:t.node,severity:"error"}),null;o.push(t.node.name)}return{params:o,children:A(r,n,t)}}return e.isExpression()?u(e.node,n)?t.ambiguous?h:g(e,n,t):null:(n.errors.push({message:`Unsupported value type: ${e.node.type}`,node:e.node,severity:"error"}),null)}}function v(e,n,t){let r=!1;return o.traverse(e.node,{enter(e,n){var t;let s;r||o.isStringLiteral(e)||o.isNumericLiteral(e)||o.isBooleanLiteral(e)||o.isNullLiteral(e)||o.isObjectExpression(e)||o.isArrayExpression(e)||o.isObjectProperty(e)||o.isIdentifier(e)&&(s=null===(t=n[n.length-1])||void 0===t?void 0:t.node,1)&&(s&&o.isObjectProperty(s)?!s.computed&&!s.shorthand:"undefined"===e.name)||(r=!0)}}),r&&u(e.node,null)?g(e,n,t):y(e,n,t)}const b={callApi:[2,3],callHttp:[1,2],callTool:[2,3]};function x(e,n,t){if(!e.isCallExpression()&&!e.isOptionalCallExpression())return n.errors.push({message:`Await expression must be a call expression, received ${e.node.type}`,node:e.node,severity:"error"}),null;const r=e.get("callee");let o;if(!r.isIdentifier())return n.errors.push({message:`Await expression must call an identifier, received ${r.type}`,node:r.node,severity:"error"}),null;for(const e of a)if(l(r,e)){o=e;break}if(!o)return n.errors.push({message:`Await expression must call "callApi", "callHttp" or "callTool", received "${r.node.name}"`,node:r.node,severity:"error"}),null;const s=b[o],i=e.get("arguments"),d=i.length<s[0];if((d||!s.includes(i.length))&&(n.errors.push({message:`"${o}()" expects ${s.join(" or ")} arguments, but got ${i.length}`,node:e.node,severity:d?"error":"warning"}),d))return null;let u;const c=i[0];if("callHttp"===o){const e=y(c,n,t);if("string"!=typeof e)return n.errors.push({message:`"${o}()" expects a string value as the first argument, but got ${typeof e}`,node:c.node,severity:"error"}),null;u={api:e,http:!0}}else if("callApi"===o){if(!c.isStringLiteral())return n.errors.push({message:`"${o}()" expects a string literal as the first argument, but got ${c.type}`,node:c.node,severity:"error"}),null;u={api:c.node.value}}else{const e=y(c,n,t);if("string"!=typeof e)return n.errors.push({message:`"${o}()" expects a string value as the first argument, but got ${typeof e}`,node:c.node,severity:"error"}),null;const r=i[1],s=y(r,n,t);if("string"!=typeof s)return n.errors.push({message:`"${o}()" expects a string value as the second argument, but got ${typeof s}`,node:r.node,severity:"error"}),null;const a=i[2];let d;a&&(d=y(a,n,t)),u={api:o,tool:{conversationId:e,stepId:s},params:d}}if("callApi"===o||"callHttp"===o){const e=i[1];if(e&&!p(e)){e.isObjectExpression()||n.errors.push({message:`Data source "params" prefers an object literal, but got ${e.type}`,node:e.node,severity:"notice"});const r=y(e,n,t);m(r)||"object"==typeof r&&null!==r?u.params=r:n.errors.push({message:"API params expects an object or expression, but got "+typeof r,node:e.node,severity:"error"})}}if("callApi"===o){const e=i[2];if(e&&!p(e))if(e.isObjectExpression()){const t=e.get("properties");for(const e of t){if(!e.isObjectProperty()){n.errors.push({message:`"callApi()" third param "meta" expects object properties, but got ${e.type}`,node:e.node,severity:"error"});continue}const t=e.get("key");if(!t.isIdentifier()){n.errors.push({message:`"callApi()" third param "meta" property key must be an identifier, but got ${t.type}`,node:t.node,severity:"error"});continue}if("objectId"!==t.node.name){n.errors.push({message:`"callApi()" third param "meta" property key must be "objectId", but got "${t.node.name}"`,node:t.node,severity:"error"});continue}const r=e.get("value");if(!p(r)){if(!r.isStringLiteral()){n.errors.push({message:`"callApi()" third param "meta" property "${t.node.name}" expects a string literal, but got ${r.type}`,node:r.node,severity:"error"});continue}u.objectId=r.node.value}}}else n.errors.push({message:`"callApi()" third param "meta" expects an object literal, but got ${e.type}`,node:e.node,severity:"error"})}return u}function $(e,n,t,r){if(!e.isArrowFunctionExpression())return n.errors.push({message:`Event handler must be an arrow function expression, but got ${e.type}`,node:e.node,severity:"error"}),null;const o=e.get("params");if(o.length>1)return n.errors.push({message:`Event handler arrow function must have at most one parameter, but got ${o.length}`,node:e.node,severity:"error"}),null;const s=o[0],i={...t,modifier:void 0,eventBinding:void 0};if(s){if(!s.isIdentifier())return n.errors.push({message:`Event handler arrow function parameter must be an identifier, but got ${s.type}`,node:s.node,severity:"error"}),null;i.eventBinding={id:s.node,isCallback:r}}const a=E(e.get("body"),n,i);return a?[].concat(a):null}function E(e,n,t){if(e.isBlockStatement())return e.get("body").flatMap((e=>E(e,n,t))).filter((e=>null!==e));if(e.isIfStatement())return{action:"conditional",payload:{test:y(e.get("test"),n,t),consequent:E(e.get("consequent"),n,t),alternate:e.node.alternate?E(e.get("alternate"),n,t):null}};if(e.isExpressionStatement())return E(e.get("expression"),n,t);if(e.isCallExpression()||e.isOptionalCallExpression()){const i=e.get("callee"),d=e.get("arguments");if(i.isIdentifier()){if(l(i,"showMessage"))return 1!==d.length?(n.errors.push({message:`"showMessage()" expects exactly 1 argument, but got ${d.length}`,node:e.node,severity:"error"}),null):{action:"show_message",payload:y(d[0],n,t)};if(l(i,"pushQuery"))return 1!==d.length&&2!==d.length?(n.errors.push({message:`"pushQuery()" expects 1 or 2 arguments, but got ${d.length}`,node:e.node,severity:"error"}),null):{action:"update_query",payload:{method:"push",args:d.map((e=>y(e,n,t)))}};for(const r of a)if(l(i,r)){const r=x(e,n,t);return r?(n.contracts.add(r.api),{action:"call_api",payload:r}):null}const o=i.scope.getBindingIdentifier(i.node.name);let s;var r;return o&&(s=null===(r=t.component)||void 0===r?void 0:r.bindingMap.get(o)),s?"setState"===s.kind?{action:"update_variable",payload:{name:s.id.name,value:void 0===d[0]?void 0:y(d[0],n,{...t,modifier:void 0})}}:(n.errors.push({message:`"${i.node.name}" is not callable`,node:i.node,severity:"error"}),null):(n.errors.push({message:`Function "${i.node.name}" is not defined`,node:i.node,severity:"error"}),null)}if(i.isMemberExpression()||i.isOptionalMemberExpression()){if(i.node.computed)return n.errors.push({message:"Event handler call expression with computed member expression is not supported",node:i.node,severity:"error"}),null;const e=i.get("object");if(e.isMemberExpression()||e.isOptionalMemberExpression()){const r=e.get("property");if(!e.node.computed&&r.isIdentifier()&&"current"===r.node.name){const r=e.get("object");if(r.isIdentifier()){var o;const e=r.scope.getBindingIdentifier(r.node.name);let a;var s;if(e&&(a=null===(s=t.component)||void 0===s?void 0:s.bindingMap.get(e)),!a)return n.errors.push({message:`Variable "${r.node.name}" is not defined`,node:r.node,severity:"error"}),null;if("ref"!==a.kind)return n.errors.push({message:`Variable "${r.node.name}" is not a ref, but a ${a.kind}`,node:r.node,severity:"error"}),null;const l=i.get("property");return l.isIdentifier()?{action:"call_ref",payload:{ref:a.id.name,method:l.node.name,args:d.map((e=>y(e,n,t))),scope:"template"===(null===(o=t.component)||void 0===o?void 0:o.type)?"template":"global"}}:(n.errors.push({message:"Event handler call expression with non-identifier property is not supported",node:l.node,severity:"error"}),null)}}}if(!e.isCallExpression())return n.errors.push({message:`Member expression in event handler expects a call expression as object, but got ${e.type}`,node:e.node,severity:"error"}),null;const r=e.get("callee");if(!r.isIdentifier())return n.errors.push({message:`Member expression in event handler expects an identifier as callee, but got ${r.type}`,node:r.node,severity:"error"}),null;const u=i.get("property");if(!u.isIdentifier())return n.errors.push({message:`Member expression in event handler expects an identifier as property, but got ${u.type}`,node:u.node,severity:"error"}),null;let p;for(const e of a)if(l(r,e)){p=e;break}if(p){if("then"!==u.node.name)return n.errors.push({message:`"${p}()" expects "then" as its method, but got ${u.node.name}`,node:u.node,severity:"error"}),null;if(1!==d.length)return n.errors.push({message:`"${p}().then()" expects exactly 1 argument, but got ${d.length}`,node:u.node,severity:"error"}),null;const r=x(e,n,t);if(!r)return null;n.contracts.add(r.api);const o=$(d[0],n,t,!0);return{action:"call_api",payload:r,callback:o?{success:o}:void 0}}return n.errors.push({message:`Unsupported action in event handler: ${r.node.name}`,node:r.node,severity:"error"}),null}}return n.errors.push({message:"Unsupported event handler",node:e.node,severity:"error"}),null}function S(e,n,t){var r;if(!e.isReferencedIdentifier())return null;const o=e.node.name,s=e.scope.getBinding(o);if(!s)return null;if(null!==(r=t.componentBindings)&&void 0!==r&&r.has(s.identifier))return{type:"local",name:o};if("module"===s.kind){if(s.path.isImportSpecifier()&&s.path.parentPath.isImportDeclaration()){const e=s.path.get("imported");if(!e.isIdentifier())return n.errors.push({message:`Unsupported import specifier type: ${e.type}`,node:e.node,severity:"error"}),null;const t=s.path.parentPath.get("source");return{type:"imported",name:e.node.name,importSource:t.node.value}}if(s.path.isImportDefaultSpecifier()&&s.path.parentPath.isImportDeclaration())return{type:"imported",importSource:s.path.parentPath.get("source").node.value}}return n.errors.push({message:`Unsupported component binding for "${o}"`,node:s.identifier,severity:"error"}),null}function w(e,n,t){var r,o;if(!e.isJSXExpressionContainer())return void n.errors.push({message:`The "ref" attribute in component expects a JSXExpressionContainer, but got ${null===(r=e.node)||void 0===r?void 0:r.type}`,node:null!==(o=e.node)&&void 0!==o?o:e.parent,severity:"error"});const s=e.get("expression");if(!s.isIdentifier())return void n.errors.push({message:`The "ref" attribute in component expects an identifier, but got ${s.node.type}`,node:s.node,severity:"error"});const i=s.node.name,a=s.scope.getBindingIdentifier(i);let d;var l;if(a&&(d=null===(l=t.component)||void 0===l?void 0:l.bindingMap.get(a)),d){if("ref"===d.kind)return d.id.name;n.errors.push({message:`The variable "${i}" is not a ref, but a ${d.kind}`,node:e.node,severity:"error"})}else n.errors.push({message:`The ref "${i}" is not defined`,node:e.node,severity:"error"})}function I(e){return e.slice(2).replace(/([a-z])([A-Z])/g,"$1.$2").toLowerCase()}function k(e,n,t){if(e.isJSXFragment())return e.get("children").flatMap((e=>k(e,n,t)));if(e.isJSXText())return e.node.value.trim()?{type:"text",text:e.node.value}:null;if(e.isJSXExpressionContainer())return k(e.get("expression"),n,t);if(e.isJSXEmptyExpression())return null;if(e.isJSXElement())return function(e,n,t){const r=e.get("openingElement"),s=r.get("name");if(!s.isJSXIdentifier())return n.errors.push({message:`Unsupported JSX element name type: ${s.type}`,node:s.node,severity:"error"}),null;if(l(s,"Fragment")){for(const e of r.node.attributes)o.isJSXAttribute(e)&&o.isJSXIdentifier(e.name)&&"key"===e.name.name||n.errors.push({message:"Invalid attribute for Fragment",node:e,severity:"error"});return e.get("children").flatMap((e=>k(e,n,t)))}const i=S(s,n,t),a={};let d,u;const p=l(s,"Route");for(const e of r.get("attributes")){if(e.isJSXSpreadAttribute()){n.errors.push({message:"Spread attributes are not supported in component",node:e.node,severity:"error"});continue}const r=e.get("name");if(!r.isJSXIdentifier()){n.errors.push({message:`Expected JSXIdentifier, but got ${r.node.type}`,node:r.node,severity:"error"});continue}const o=r.node.name;if("key"===o)continue;const s=e.get("value");if(p)if("component"===o){if(!s.isJSXExpressionContainer()){var c,f;n.errors.push({message:`The "component" attribute in Route expects a JSXExpressionContainer, but got ${null===(c=s.node)||void 0===c?void 0:c.type}`,node:null!==(f=s.node)&&void 0!==f?f:s.parent,severity:"error"});continue}const e=s.get("expression");if(!e.isIdentifier()){n.errors.push({message:`The "component" attribute in Route expects an identifier, but got ${e.node.type}`,node:e.node,severity:"error"});continue}const r=S(e,n,t);if(!r){n.errors.push({message:`The component "${e.node.name}" is not defined`,node:e.node,severity:"error"});continue}a.component={name:e.node.name,reference:r}}else if("path"===o){if(!s.isStringLiteral()){var m,g;n.errors.push({message:`The "path" attribute in Route expects a string literal, but got ${null===(m=s.node)||void 0===m?void 0:m.type}`,node:null!==(g=s.node)&&void 0!==g?g:s.parent,severity:"error"});continue}a.path=s.node.value}else n.errors.push({message:`Unsupported attribute "${o}" in Route`,node:r.node,severity:"error"});else if("ref"!==o)if(/^on[A-Z]/.test(o)){if(!s.isJSXExpressionContainer()){var h,y;n.errors.push({message:`Event handler "${o}" expects a JSXExpressionContainer, but got ${null===(h=s.node)||void 0===h?void 0:h.type}`,node:null!==(y=s.node)&&void 0!==y?y:s.parent,severity:"error"});continue}const e=s.get("expression");if(e.isJSXEmptyExpression()){n.errors.push({message:"Empty expression in events is not allowed",node:e.node,severity:"warning"});continue}let r=null;if(e.isIdentifier()){const n=e.scope.getBindingIdentifier(e.node.name);if(n){var b;const e=null===(b=t.component)||void 0===b?void 0:b.bindingMap.get(n);e&&"eventHandler"===e.kind&&(r=[{action:"dispatch_event",payload:{type:I(e.id.name),detail:"<% EVENT.detail %>"}}])}}r||(r=$(e,n,t)),r&&(null!=d||(d={}),d[I(o)]=r)}else if(null==s.node)a[o]=!0;else if(s.isStringLiteral())a[o]=s.node.value;else if(s.isJSXExpressionContainer()){const e=s.get("expression");e.isJSXEmptyExpression()?n.errors.push({message:`Empty expression in JSX attribute "${o}" is not allowed`,node:e.node,severity:"warning"}):a[o]=v(e,n,{...t,allowUseBrick:!0,modifier:"="})}else n.errors.push({message:`Unsupported attribute value type in component: ${s.node.type}`,node:s.node,severity:"error"});else u=w(s,n,t)}const{textContent:x,children:E}=j(e.get("children"),n,t);return x&&(a.textContent=x),{type:"component",component:{name:s.node.name,reference:i,properties:a,ref:u,events:d,children:E}}}(e,n,t);if(e.isCallExpression()){const r=e.get("callee");if(r.isMemberExpression()||r.isOptionalMemberExpression()){const o=r.get("property");if(o.isIdentifier()&&"map"===o.node.name){const o=e.get("arguments");if(o.length>0){const e=o[0];if(e.isArrowFunctionExpression()){const o=e.get("body");if(o.isExpression()&&T(o.node)){const o=r.get("object");if(!u(o.node,n))return null;const s=e.get("params");if(s.length>2)return n.errors.push({message:`Array map function with JSX elements must have at most two parameters, but got ${s.length}`,node:s[2].node,severity:"error"}),null;const i=s.find((e=>!e.isIdentifier()));if(i)return n.errors.push({message:`Array map function with JSX elements must have identifier parameters, but got ${i.type}`,node:i.node,severity:"error"}),null;const a={...t,forEachBinding:void 0};if(s.length>0){const[e,n]=s;a.forEachBinding={item:e.node,index:null==n?void 0:n.node}}return{type:"component",component:{name:"ForEach",properties:{dataSource:v(o,n,{...t,modifier:"="})},children:A(e.get("body"),n,a)}}}}}}}}else if(e.isConditionalExpression()){const r=e.get("test"),o=e.get("consequent"),s=e.get("alternate");if(T(o.node)||T(s.node))return u(r.node,n)?{type:"component",component:{name:"If",properties:{dataSource:v(r,n,{...t,modifier:"="})},children:[...A(o,n,t),...A(s,n,t).map((e=>({...e,slot:"else"})))]}}:null}else if(e.isLogicalExpression()){const r=e.get("left"),o=e.get("right"),s=e.node.operator;if(("&&"===s||"||"===s)&&T(o.node)){if(!u(r.node,n))return null;const e=A(o,n,t);return{type:"component",component:{name:"If",properties:{dataSource:v(r,n,{...t,modifier:"="})},children:"&&"===s?e:e.map((e=>({...e,slot:"else"})))}}}}return e.isExpression()?u(e.node,n)?{type:"expression",expression:e}:null:(n.errors.push({message:`Unsupported node type in JSX children: ${e.type}`,node:e.node,severity:"error"}),null)}function T(e){let n=!1;return o.traverse(e,{enter(e){n||!o.isJSXElement(e)&&!o.isJSXFragment(e)||(n=!0)}}),n}function j(e,n,t){let r=e.flatMap((e=>k(e,n,t))),o=r.every((e=>"text"===(null==e?void 0:e.type)));if(!o){let e=null;const n=[];for(const t of r){if(null===t);else if("text"===t.type||"expression"===t.type){var s,i,a;if("text"===(null===(s=e)||void 0===s?void 0:s.type)||"expression"===(null===(i=e)||void 0===i?void 0:i.type)){e={type:"merged",children:[e,t]},n.splice(n.length-1,1,e);continue}if("merged"===(null===(a=e)||void 0===a?void 0:a.type)){e.children.push(t);continue}}e=t,n.push(t)}r=n,o=r.every((e=>"text"===(null==e?void 0:e.type)||"merged"===(null==e?void 0:e.type)&&e.children.every((e=>"text"===e.type))))}return o?{textContent:r.flatMap((e=>"text"===e.type?e.text:e.children.map((e=>e.text)))).join("").trim()}:r.every((e=>!!e&&"component"!==e.type))?{textContent:P(r.flatMap((e=>"merged"===e.type?e.children:e)),n,t)}:{children:r.filter((e=>!!e)).map((e=>"component"===e.type?e.component:{name:"Plaintext",properties:{textContent:"text"===e.type?e.text:"expression"===e.type?g(e.expression,n,{...t,modifier:"="}):P(e.children,n,t)}}))}}function P(e,n,t){return n.usedHelpers.add("_helper_mergeTexts"),`<%= FN._helper_mergeTexts(${e.map((e=>"text"===e.type?JSON.stringify(e):`{type:"expression",value:(${g(e.expression,n,t,!0)})}`)).join(", ")}) %>`}function A(e,n,t){const{textContent:r,children:o}=j([e],n,t);return null!=o?o:[{name:"Plaintext",properties:{textContent:r}}]}function C(e){var n,t;const r=null===(n=e.children)||void 0===n?void 0:n.find((e=>{return t="View",function(e){return!e.reference||"imported"===e.reference.type&&e.reference.importSource===i}(n=e)&&(n.reference?n.reference.name===t:n.name===t);var n,t})),o=null==r||null===(t=r.properties)||void 0===t?void 0:t.title;if("string"==typeof o&&!m(o))return o}const B=s.default;function O(e,n,t,r,o,s,i){const a=x(e,n,t);if(!a)return null;n.contracts.add(a.api);const d={name:r,config:o,...a};if(s){var l;if(s.length>("catch"===i?1:2))return n.errors.push({message:`".${i}()" expects no more than 2 arguments, but got ${s.length}`,node:null===(l=s[1])||void 0===l?void 0:l.node,severity:"error"}),null;if(s.length>0){const e=X(s[0],n,t);e&&(d["catch"===i?"rejectTransform":"transform"]=e)}if("catch"!==i&&s.length>1){const e=X(s[1],n,t);e&&(d.rejectTransform=e)}}return d}function X(e,n,t){if(!e.isArrowFunctionExpression())return n.errors.push({message:`".then()" callback expects an arrow function, but got ${e.type}`,node:e.node,severity:"error"}),null;const r=e.get("body");if(!r.isExpression())return n.errors.push({message:`".then()" callback function body expects an expression, but got ${r.type}`,node:r.node,severity:"error"}),null;const o=e.get("params");var s,i;if(o.length>1)return n.errors.push({message:`".then()" callback function expects exactly 0 or 1 parameter, but got ${o.length}`,node:null!==(s=null===(i=o[1])||void 0===i?void 0:i.node)&&void 0!==s?s:e,severity:"error"}),null;const a={...t,dataBinding:void 0},d=o[0];if(o.length>0){if(!d.isIdentifier())return n.errors.push({message:`".then()" callback function parameter expects an identifier, but got ${d.type}`,node:d.node,severity:"error"}),null;a.dataBinding={id:d.node}}return g(r,n,a)}function J(e,n,t,r){const o=e.get("id");if(!o.isArrayPattern())return null;const s=o.get("elements");if(1!==s.length&&2!==s.length)return null;const i=s[0];if(!i.isIdentifier())return null;if(1!==n.length&&2!==n.length)return null;const a=n[0];if(!a.isArrowFunctionExpression())return null;if(!d(a.node,t))return null;const l=a.get("body");if(l.isBlockStatement())return null;if(!l.isCallExpression())return null;const u=l.get("callee");if(!u.isIdentifier()&&!u.isMemberExpression())return null;const p=n[1];let c;if(p){if(!p.isObjectExpression())return t.errors.push({message:`"useResource()" second argument must be an object expression, but got ${p.type}`,node:p.node,severity:"error"}),null;for(const e of p.get("properties")){if(!e.isObjectProperty())return t.errors.push({message:`Unsupported property type in "useResource()" second argument: ${e.type}`,node:e.node,severity:"error"}),null;const n=e.get("key");if(!n.isIdentifier())return t.errors.push({message:`"useResource()" second argument property key must be an identifier, but got ${n.type}`,node:n.node,severity:"error"}),null;if(e.node.computed)return t.errors.push({message:'"useResource()" second argument property key cannot be computed',node:n.node,severity:"error"}),null;if("enabled"!==n.node.name&&"fallback"!==n.node.name)return t.errors.push({message:`"useResource()" second argument property key must be "enabled" or "fallback", but got "${n.node.name}"`,node:n.node,severity:"error"}),null;null!=c||(c={}),c[n.node.name]=y(e.get("value"),t,r)}}let f=null;if(u.isMemberExpression()){const e=u.get("property");if(!e.isIdentifier()||u.node.computed||"then"!==e.node.name&&"catch"!==e.node.name)return t.errors.push({message:"Unexpected awaited expression",node:e.node,severity:"error"}),null;f=O(u.get("object"),t,r,i.node.name,c,l.get("arguments"),e.node.name)}else f=O(l,t,r,i.node.name,c);return f?{id:i.node,kind:"resource",resource:f}:null}function D(e,n,t,r){if(!d(e.node,n))return null;const o=new Map,s={bindingMap:o,type:t,id:e.node.id},i={...r,component:s},a=e.get("params");if("template"===t){if(a.length>1)return n.errors.push({message:`Component function can only have zero or one parameter, received ${a.length}`,node:e.node,severity:"error"}),null;if(a.length>0){const e=a[0];if(!e.isObjectPattern())return n.errors.push({message:`Component function parameter must be an object pattern, received ${e.type}`,node:e.node,severity:"error"}),null;for(const t of e.get("properties")){if(t.isRestElement())return n.errors.push({message:"Component function parameter rest element is not allowed",node:t.node,severity:"error"}),null;const e=t.node;if(e.computed||!e.shorthand)return n.errors.push({message:"Component function parameter properties must be shorthand and not computed",node:t.node,severity:"error"}),null;const r=t.get("key"),s=t.get("value");if(!r.isIdentifier())return n.errors.push({message:`Component function parameter property key must be an identifier, received ${r.type}`,node:r.node,severity:"error"}),null;const a=r.node.name;if(/^on[A-Z]/.test(a)){if(!s.isIdentifier())return n.errors.push({message:`Event handler parameter "${a}" must be an identifier, received ${s.type}`,node:s.node,severity:"error"}),null;o.set(s.node,{id:s.node,kind:"eventHandler"})}else{let e,t;if(s.isAssignmentPattern()){const r=s.get("left");r.isIdentifier()&&(e=r.node,t=y(s.get("right"),n,i))}else s.isIdentifier()&&(e=s.node);if(!e){n.errors.push({message:`Component function parameter property value must be an identifier or assignment pattern, received ${s.type}`,node:s.node,severity:"error"});continue}const r={id:e,kind:"param",initialValue:t};o.set(e,r)}}}}else if(a.length>0)return n.errors.push({message:`Page function cannot have parameters, received ${a.length}`,node:a[0].node,severity:"error"}),null;const u=e.get("body").get("body");for(const e of u)if(e.isVariableDeclaration()){if("const"!==e.node.kind){n.errors.push({message:`Only "const" variable declaration is allowed, received "${e.node.kind}"`,node:e.node,severity:"error"});continue}for(const t of e.get("declarations")){const e=t.get("init");if(e.isCallExpression()){const r=e.get("callee");if(r.isIdentifier()){const s=e.get("arguments");if(l(r,"useState")){const e=t.get("id");if(!e.isArrayPattern())continue;const r=e.get("elements");if(2!==r.length){n.errors.push({message:`useState() destructuring must have exactly two elements, received ${r.length}`,node:e.node,severity:"error"});continue}const a=r[0],d=r[1];if(!a.isIdentifier()||!d.isIdentifier()){n.errors.push({message:`useState() destructuring must have identifiers as elements, received ${r.map((e=>e.type)).join(", ")}`,node:e.node,severity:"error"});continue}const l={id:a.node,kind:"state"};o.set(a.node,l),o.set(d.node,{id:a.node,kind:"setState"}),s.length>0&&(l.initialValue=y(s[0],n,i)),s.length>1&&n.errors.push({message:`useState() only accepts at most one argument, received ${s.length}`,node:s[1].node,severity:"warning"});continue}if(l(r,"useResource")){const e=J(t,s,n,i);e&&o.set(e.id,e);continue}if(l(r,"useRef")){const e=t.get("id");if(!e.isIdentifier()){n.errors.push({message:`useRef() must be assigned to an identifier, received ${e.type}`,node:e.node,severity:"error"});continue}s.length>1&&n.errors.push({message:`useRef() only accepts at most one argument, received ${s.length}`,node:s[1].node,severity:"warning"});const r=s[0];r&&!r.isNullLiteral()&&n.errors.push({message:`useRef() first argument must be null, received ${r.type}`,node:r.node,severity:"warning"}),o.set(e.node,{id:e.node,kind:"ref"});continue}if(l(r,"useQuery")){const e=t.get("id");if(!e.isIdentifier()){n.errors.push({message:`useQuery() must be assigned to an identifier, received ${e.type}`,node:e.node,severity:"error"});continue}s.length>0&&n.errors.push({message:`useQuery() does not accept any arguments, received ${s.length}`,node:s[0].node,severity:"warning"}),o.set(e.node,{id:e.node,kind:"query"});continue}}}const r=t.get("id");if(!r.isIdentifier()){n.errors.push({message:`Expect an identifier as the variable name, received ${r.type}`,node:r.node,severity:"error"});continue}const s={id:r.node,kind:"constant"};o.set(r.node,s),e.node&&(s.initialValue=y(e,n,i))}}else if(e.isReturnStatement()){const t=e.get("argument");if(!t.isJSXElement()&&!t.isJSXFragment()){n.errors.push({message:`Expect JSX element or fragment as the return value, received ${t.type}`,node:t.node,severity:"error"});continue}s.children=A(t,n,i)}else e.isTSInterfaceDeclaration()||e.isTSTypeAliasDeclaration()||n.errors.push({message:`Unsupported top level statement type: ${e.type}`,node:e.node,severity:"error"});return s}function M(e,n,t){if(!d(e.node,n))return null;const r=[];e.traverse({Identifier(n){if(!n.isReferencedIdentifier())return;const o=n.parentPath.isObjectProperty()&&n.parentPath.node.shorthand,s=n.scope.getBindingIdentifier(n.node.name);var i;s&&s!==e.node.id&&null!==(i=t.functionBindings)&&void 0!==i&&i.has(s)&&r.push({type:"id",start:n.node.start,end:n.node.end,replacement:`FN.${s.name}`,shorthand:o?n.node.name:void 0})}}),r.sort(((e,n)=>e.start-n.start));const o=[];let s=e.node.start;for(const e of r)o.push(n.source.substring(s,e.start),`${e.shorthand?`${e.shorthand}:`:""}${e.replacement}`),s=e.end;return o.push(n.source.substring(s,e.node.end)),{name:e.node.id.name,source:o.join(""),typescript:!0}}const U=[".js",".jsx",".ts",".tsx"];function F(e,n,t){if(e.startsWith("/"))return R(e.slice(1),t);const r=n.substring(0,n.lastIndexOf("/")),o=r?r.split("/"):[],s=e.split("/");for(const e of s)"."!==e&&(".."===e?o.length>0&&o.pop():o.push(e));return R(o.join("/"),t)}function R(e,n){if(n.some((n=>n.filePath===e)))return e;for(const t of U)if(n.some((n=>n.filePath===`${e}${t}`)))return`${e}${t}`;return e}const N=s.default;var L=function(e){return e.TopLevelStatement="top level statement",e.NamedExportDeclaration="named export declaration",e.DefaultExportDeclaration="default export declaration",e}(L||{});function _(e){return e.name[0]>="A"&&e.name[0]<="Z"}function V(e,n,t,o){var s;const i=n.files.find((n=>n.filePath===e));if(!i)throw new Error(`File not found: ${e}`);if(n.modules.has(e))return;n.modules.set(e,null),t||(t=(0,r.parse)(i.content,{plugins:["jsx","typescript"],sourceType:"module",errorRecovery:!0}));const a=!n.entry,d=a?"entry":i.filePath.startsWith("Pages/")?"page":i.filePath.startsWith("Components/")?"template":"unknown",u={source:i.content,filePath:e,moduleType:d,defaultExport:null,namedExports:new Map,internals:[],errors:[],contracts:new Set,usedHelpers:new Set};if(null!==(s=t.errors)&&void 0!==s&&s.length)for(const e of t.errors)u.errors.push({message:`${e.code}: ${e.reasonCode}`,node:null,severity:"error"});a&&(n.entry=u),n.modules.set(e,u),function(e,n,t,r){const o=new Set,s=new Set,i={functionBindings:o,componentBindings:s,contextBindings:null==r?void 0:r.withContexts};N(t,{Program(t){const a=t.get("body"),d=[];let u=null,p=null;const c=[],f=(t,r)=>{if(t.isFunctionDeclaration()){const i=t.node.id;if(i&&(_(i)?s.add(i):o.add(i)),r===L.DefaultExportDeclaration)return void("app"===n.appType&&"entry"===e.moduleType?e.errors.push({message:"The entry module in an app cannot have a default export declaration.",node:t.node,severity:"error"}):u=t);if(!i)return void e.errors.push({message:"Function declaration must have a name",node:t.node,severity:"error"});r===L.NamedExportDeclaration?d.push({func:t,exported:!0}):d.push({func:t})}else if(t.isExportDefaultDeclaration()){const e=t.get("declaration");f(e,L.DefaultExportDeclaration)}else if(t.isExportNamedDeclaration()){const e=t.get("declaration");f(e,L.NamedExportDeclaration)}else if(t.isImportDeclaration()){const e=t.node.source.value;(e.startsWith(".")||e.startsWith("/"))&&c.push(e)}else t.isTSInterfaceDeclaration||t.isTSTypeAliasDeclaration()||e.errors.push({message:`Unsupported ${r} type: ${t.type}`,node:t.node,severity:"error"})};for(const t of a){if("app"===n.appType&&e===n.entry&&t.isExpressionStatement()){const n=t.get("expression");if(n.isCallExpression()){const t=n.get("callee");if(t.isIdentifier()&&l(t,"render")){const t=n.get("arguments");if(1!==t.length){e.errors.push({message:`render() expects exactly one argument, received: ${t.length}`,node:n.node,severity:"error"});continue}p=t[0];continue}}}f(t,L.TopLevelStatement)}for(const t of c)V(F(t,e.filePath,n.files),n,void 0,r);for(const{func:t,exported:r}of d){const o=t.node.id;if(_(o)){const s="app"===n.appType&&"entry"===e.moduleType?"page":"template",a=D(t,e,s,i);if(a){const n={type:s,component:a};r?e.namedExports.set(o.name,n):e.internals.push(n)}}else{const n=M(t,e,i);if(n){const t={type:"function",function:n};r?e.namedExports.set(o.name,t):e.internals.push(t)}}}if(u){const n="entry"===e.moduleType?"view":"page"===e.moduleType?"page":"template",t=D(u,e,n,i);t&&(e.defaultExport={type:n,component:t,..."view"===n?{title:C(t)}:{}})}if(p){const n=A(p,e,i);e.render={type:"render",children:n}}t.stop()}})}(u,n,t,o)}(0,t(47695).p)(class{parseView(e,n){return function(e,n){const t={appType:"view",modules:new Map,files:[{filePath:"View.tsx",content:e}],errors:[]};let s;try{s=(0,r.parse)(e,{plugins:["jsx","typescript"],sourceType:"module",errorRecovery:!0})}catch(e){return t.errors.push({message:`Failed to parse TSX: ${e}`,node:null,severity:"fatal"}),t}for(const e of s.program.body)if(o.isExportDefaultDeclaration(e)){if(o.isFunctionDeclaration(e.declaration))return V("View.tsx",t,s,n),t;break}return function(e,n,t,r){var o;const s=[];if(null!==(o=t.errors)&&void 0!==o&&o.length)for(const e of t.errors)s.push({message:`${e.code}: ${e.reasonCode}`,node:null,severity:"error"});const i=new Map,a={type:"view",bindingMap:i},d={component:a,contextBindings:null==r?void 0:r.withContexts},l={source:n.files.find((n=>n.filePath===e)).content,filePath:e,moduleType:"entry",defaultExport:{type:"view",component:a},internals:[],namedExports:new Map,errors:s,contracts:new Set,usedHelpers:new Set};B(t,{Program(e){const n=e.get("body");let t=!1;for(const e of n)if(e.isVariableDeclaration()){if(t){s.push({message:"Unexpected variable declaration after export",node:e.node,severity:"error"});continue}if("const"!==e.node.kind){s.push({message:`Only "const" variable declaration is allowed, received: ${e.node.kind}`,node:e.node,severity:"error"});continue}for(const n of e.get("declarations")){const e=n.get("id");if(!e.isIdentifier()){s.push({message:`Unsupported variable declaration pattern, expected: Identifier, received: ${e.type}`,node:e.node,severity:"error"});continue}const t={id:e.node,kind:"constant"},r=n.get("init");r.node&&(t.initialValue=y(r,l,d)),i.set(e.node,t)}}else if(e.isExportDefaultDeclaration()){t=!0;const n=e.get("declaration");n.isJSXElement()?a.children=A(n,l,d):s.push({message:`Default export must be a JSX element, received: ${n.type}`,node:e.node,severity:"error"});break}e.stop()}}),l.defaultExport.title=C(a),n.entry=l}("View.tsx",t,s,n),t}(e,n)}})}},x={};function $(e){var n=x[e];if(void 0!==n)return n.exports;var t=x[e]={exports:{}};return b[e].call(t.exports,t,t.exports,$),t.exports}$.m=b,$.c=x,$.x=()=>{var e=$.O(void 0,[8135,3735,580],(()=>$(41334)));return $.O(e)},e=[],$.O=(n,t,r,o)=>{if(!t){var s=1/0;for(l=0;l<e.length;l++){for(var[t,r,o]=e[l],i=!0,a=0;a<t.length;a++)(!1&o||s>=o)&&Object.keys($.O).every((e=>$.O[e](t[a])))?t.splice(a--,1):(i=!1,o<s&&(s=o));if(i){e.splice(l--,1);var d=r();void 0!==d&&(n=d)}}return n}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[t,r,o]},$.d=(e,n)=>{for(var t in n)$.o(n,t)&&!$.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},$.f={},$.e=e=>Promise.all(Object.keys($.f).reduce(((n,t)=>($.f[t](e,n),n)),[])),$.u=e=>"chunks/"+e+"."+{3735:"8c1d82e7",6773:"afd27a30",8135:"3255c5ba"}[e]+".js",$.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),$.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{$.S={};var e={},n={};$.I=(t,r)=>{r||(r=[]);var o=n[t];if(o||(o=n[t]={}),!(r.indexOf(o)>=0)){if(r.push(o),e[t])return e[t];$.o($.S,t)||($.S[t]={}),$.S[t];var s=[];return e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;$.g.importScripts&&(e=$.g.location+"");var n=$.g.document;if(!e&&n&&(n.currentScript&&"SCRIPT"===n.currentScript.tagName.toUpperCase()&&(e=n.currentScript.src),!e)){var t=n.getElementsByTagName("script");if(t.length)for(var r=t.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=t[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),$.p=e+"../"})(),n=e=>{var n=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),r=t[1]?n(t[1]):[];return t[2]&&(r.length++,r.push.apply(r,n(t[2]))),t[3]&&(r.push([]),r.push.apply(r,n(t[3]))),r},t=(e,t)=>{e=n(e),t=n(t);for(var r=0;;){if(r>=e.length)return r<t.length&&"u"!=(typeof t[r])[0];var o=e[r],s=(typeof o)[0];if(r>=t.length)return"u"==s;var i=t[r],a=(typeof i)[0];if(s!=a)return"o"==s&&"n"==a||"s"==a||"u"==s;if("o"!=s&&"u"!=s&&o!=i)return o<i;r++}},r=e=>{var n=e[0],t="";if(1===e.length)return"*";if(n+.5){t+=0==n?">=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var o=1,s=1;s<e.length;s++)o--,t+="u"==(typeof(a=e[s]))[0]?"-":(o>0?".":"")+(o=2,a);return t}var i=[];for(s=1;s<e.length;s++){var a=e[s];i.push(0===a?"not("+d()+")":1===a?"("+d()+" || "+d()+")":2===a?i.pop()+" "+i.pop():r(a))}return d();function d(){return i.pop().replace(/^\((.+)\)$/,"$1")}},o=(e,t)=>{if(0 in e){t=n(t);var r=e[0],s=r<0;s&&(r=-r-1);for(var i=0,a=1,d=!0;;a++,i++){var l,u,p=a<e.length?(typeof e[a])[0]:"";if(i>=t.length||"o"==(u=(typeof(l=t[i]))[0]))return!d||("u"==p?a>r&&!s:""==p!=s);if("u"==u){if(!d||"u"!=p)return!1}else if(d)if(p==u)if(a<=r){if(l!=e[a])return!1}else{if(s?l>e[a]:l<e[a])return!1;l!=e[a]&&(d=!1)}else if("s"!=p&&"n"!=p){if(s||a<=r)return!1;d=!1,a--}else{if(a<=r||u<p!=s)return!1;d=!1}else"s"!=p&&"n"!=p&&(d=!1,a--)}}var c=[],f=c.pop.bind(c);for(i=1;i<e.length;i++){var m=e[i];c.push(1==m?f()|f():2==m?f()&f():m?o(m,t):!f())}return!!f()},s=(e,n)=>e&&$.o(e,n),i=e=>(e.loaded=1,e.get()),a=e=>Object.keys(e).reduce(((n,t)=>(e[t].eager&&(n[t]=e[t]),n)),{}),d=(e,n,r)=>{var o=r?a(e[n]):e[n];return Object.keys(o).reduce(((e,n)=>!e||!o[e].loaded&&t(e,n)?n:e),0)},l=(e,n,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[n][t].from)+" of shared singleton module "+n+" (required "+r(o)+")",u=e=>{throw new Error(e)},p=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},c=(e,n,t)=>t?t():((e,n)=>u("Shared module "+n+" doesn't exist in shared scope "+e))(e,n),f=(e=>function(n,t,r,o,s){var i=$.I(n);return i&&i.then&&!r?i.then(e.bind(e,n,$.S[n],t,!1,o,s)):e(n,$.S[n],t,r,o,s)})(((e,n,t,r,a,u)=>{if(!s(n,t))return c(e,t,u);var f=d(n,t,r);return o(a,f)||p(l(n,t,f,a)),i(n[t][f])})),m={},g={40580:()=>f("default","@babel/parser",!1,[0],(()=>$.e(6773).then((()=>()=>$(46773)))))},h={580:[40580]},y={},$.f.consumes=(e,n)=>{$.o(h,e)&&h[e].forEach((e=>{if($.o(m,e))return n.push(m[e]);if(!y[e]){var t=n=>{m[e]=0,$.m[e]=t=>{delete $.c[e],t.exports=n()}};y[e]=!0;var r=n=>{delete m[e],$.m[e]=t=>{throw delete $.c[e],n}};try{var o=g[e]();o.then?n.push(m[e]=o.then(t).catch(r)):t(o)}catch(e){r(e)}}}))},(()=>{var e={1334:1};$.f.i=(n,t)=>{e[n]||580!=n&&importScripts($.p+$.u(n))};var n=globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[],t=n.push.bind(n);n.push=n=>{var[r,o,s]=n;for(var i in o)$.o(o,i)&&($.m[i]=o[i]);for(s&&s($);r.length;)e[r.pop()]=1;t(n)}})(),v=$.x,$.x=()=>Promise.all([8135,3735,580].map($.e,$)).then(v),$.x()})();
|
|
2
|
+
//# sourceMappingURL=1334.aae33a33.js.map
|