@next-bricks/diagram 0.54.0 → 0.54.2
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 +3 -3
- package/dist/chunks/{114.f896f1cd.js → 114.7840025a.js} +2 -2
- package/dist/chunks/{114.f896f1cd.js.map → 114.7840025a.js.map} +1 -1
- package/dist/chunks/{1940.8bf79e2e.js → 1940.e4afab06.js} +2 -2
- package/dist/chunks/{9559.4fa7ccb4.js.map → 1940.e4afab06.js.map} +1 -1
- package/dist/chunks/{2277.f1be2d12.js → 2277.b9489bc0.js} +2 -2
- package/dist/chunks/{2277.f1be2d12.js.map → 2277.b9489bc0.js.map} +1 -1
- package/dist/chunks/3171.46fd5b05.js +2 -0
- package/dist/chunks/{3171.587855c6.js.map → 3171.46fd5b05.js.map} +1 -1
- package/dist/chunks/{7745.17f40d57.js → 3210.199861ac.js} +2 -2
- package/dist/chunks/{7745.17f40d57.js.map → 3210.199861ac.js.map} +1 -1
- package/dist/chunks/3233.289bdcbe.js +3 -0
- package/dist/chunks/{3233.2fa18575.js.map → 3233.289bdcbe.js.map} +1 -1
- package/dist/chunks/3933.42989e69.js +2 -0
- package/dist/chunks/{3933.8706ce70.js.map → 3933.42989e69.js.map} +1 -1
- package/dist/chunks/{4658.edd08dfb.js → 4658.1c3c99dd.js} +2 -2
- package/dist/chunks/{4658.edd08dfb.js.map → 4658.1c3c99dd.js.map} +1 -1
- package/dist/chunks/{4837.faa6e35a.js → 4837.d99cfcee.js} +2 -2
- package/dist/chunks/{4837.faa6e35a.js.map → 4837.d99cfcee.js.map} +1 -1
- package/dist/chunks/{5443.c6bfe64e.js → 5443.e0be670a.js} +3 -3
- package/dist/chunks/{5443.c6bfe64e.js.map → 5443.e0be670a.js.map} +1 -1
- package/dist/chunks/5552.244a17f6.js +2 -0
- package/dist/chunks/{5552.e14bec19.js.map → 5552.244a17f6.js.map} +1 -1
- package/dist/chunks/5582.863f6bfa.js +3 -0
- package/dist/chunks/5582.863f6bfa.js.map +1 -0
- package/dist/chunks/6314.57b02e4b.js +2 -0
- package/dist/chunks/{6314.44bc553f.js.map → 6314.57b02e4b.js.map} +1 -1
- package/dist/chunks/{7218.66f13c1c.js → 7218.7e726731.js} +2 -2
- package/dist/chunks/{7218.66f13c1c.js.map → 7218.7e726731.js.map} +1 -1
- package/dist/chunks/{7733.a6b0e93e.js → 7733.a2f6f661.js} +2 -2
- package/dist/chunks/{7733.a6b0e93e.js.map → 7733.a2f6f661.js.map} +1 -1
- package/dist/chunks/8552.fbd1edb9.js +2 -0
- package/dist/chunks/8552.fbd1edb9.js.map +1 -0
- package/dist/chunks/{9559.4fa7ccb4.js → 9559.588b7ac2.js} +2 -2
- package/dist/chunks/{1940.8bf79e2e.js.map → 9559.588b7ac2.js.map} +1 -1
- package/dist/chunks/{9711.65e18e90.js → 9711.85eea38c.js} +2 -2
- package/dist/chunks/{9711.65e18e90.js.map → 9711.85eea38c.js.map} +1 -1
- package/dist/chunks/{editable-label.1b844769.js → editable-label.3cec419e.js} +3 -3
- package/dist/chunks/{editable-label.1b844769.js.map → editable-label.3cec419e.js.map} +1 -1
- package/dist/chunks/{eo-diagram.66a5cc84.js → eo-diagram.b1a87a4b.js} +2 -2
- package/dist/chunks/{eo-diagram.66a5cc84.js.map → eo-diagram.b1a87a4b.js.map} +1 -1
- package/dist/chunks/{eo-display-canvas.b3f66027.js → eo-display-canvas.37483d85.js} +2 -2
- package/dist/chunks/{eo-display-canvas.b3f66027.js.map → eo-display-canvas.37483d85.js.map} +1 -1
- package/dist/chunks/eo-draw-canvas.d7cca02f.js +2 -0
- package/dist/chunks/{eo-draw-canvas.f0e6fadc.js.map → eo-draw-canvas.d7cca02f.js.map} +1 -1
- package/dist/chunks/{experimental-node.adb9fe17.js → experimental-node.3e7326f2.js} +2 -2
- package/dist/chunks/{experimental-node.adb9fe17.js.map → experimental-node.3e7326f2.js.map} +1 -1
- package/dist/chunks/main.94660dd0.js +2 -0
- package/dist/chunks/{main.2047ffaa.js.map → main.94660dd0.js.map} +1 -1
- package/dist/examples.json +5 -5
- package/dist/index.7d84a372.js +2 -0
- package/dist/{index.47dd40b9.js.map → index.7d84a372.js.map} +1 -1
- package/dist/manifest.json +156 -156
- package/dist/types.json +4307 -4307
- package/package.json +3 -3
- package/dist/chunks/3171.587855c6.js +0 -2
- package/dist/chunks/3233.2fa18575.js +0 -3
- package/dist/chunks/3933.8706ce70.js +0 -2
- package/dist/chunks/5552.e14bec19.js +0 -2
- package/dist/chunks/5582.9e7b28a7.js +0 -3
- package/dist/chunks/5582.9e7b28a7.js.map +0 -1
- package/dist/chunks/6314.44bc553f.js +0 -2
- package/dist/chunks/8552.f62a8135.js +0 -2
- package/dist/chunks/8552.f62a8135.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.f0e6fadc.js +0 -2
- package/dist/chunks/main.2047ffaa.js +0 -2
- package/dist/index.47dd40b9.js +0 -2
- /package/dist/chunks/{3233.2fa18575.js.LICENSE.txt → 3233.289bdcbe.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{5443.c6bfe64e.js.LICENSE.txt → 5443.e0be670a.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{5582.9e7b28a7.js.LICENSE.txt → 5582.863f6bfa.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{editable-label.1b844769.js.LICENSE.txt → editable-label.3cec419e.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/diagram",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.2",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/diagram",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"postpublish": "mv package.json.bak package.json"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@next-core/build-next-bricks": "^1.23.
|
|
38
|
+
"@next-core/build-next-bricks": "^1.23.8",
|
|
39
39
|
"@next-core/test-next": "^1.1.7"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@next-bricks/basic": "*"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "61f7df5abe941b15ae1fed6a231764fedb105db7"
|
|
45
45
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[3171,5552],{5552:(n,e,t)=>{t.r(e),t.d(e,{i18n:()=>d,i18nText:()=>l,initializeI18n:()=>u});var i=t(2350),s=t(1590),r=t(7072);let a=!1;const o=new Set;function u(n,e){if(a||(a=!0,s.i18n.use(r.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),n&&e&&!o.has(n)){o.add(n);for(const[t,i]of Object.entries(e))s.i18n.addResourceBundle(t,n,i)}}var c=t(532);function l(n){var e;if(!n)return;const t=null!==(e=s.i18n.language)&&void 0!==e?e:"zh-CN";if((0,c.hasOwnProperty)(n,t))return n[t];const i=t.split("-")[0];if(i!==t)return(0,c.hasOwnProperty)(n,i)?n[i]:void 0;const r=`${i}-`;for(const e of Object.keys(n))if(e.startsWith(r))return n[e]}const d=i.default}}]);
|
|
2
|
-
//# sourceMappingURL=3171.587855c6.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 3233.2fa18575.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[3233],{6671:(e,t,n)=>{n.d(t,{w:()=>s});var o=n(8769),a=n.n(o),i=n(3373),l=n.n(i),r=n(3739);function s(e){let{connectLineState:t,connectLineTo:n,markerPrefix:o}=e;return a().createElement("svg",{width:"100%",height:"100%",className:l()("connect-line",{connecting:!!t&&(n[0]-t.from[0])**2+(n[1]-t.from[1])**2>25})},a().createElement("defs",null,a().createElement(r.c,{type:"arrow",id:`${o}connect-line`,strokeColor:null==t?void 0:t.options.strokeColor})),a().createElement("path",{d:t?`M${t.from.join(" ")}L${n.join(" ")}`:"",fill:"none",stroke:null==t?void 0:t.options.strokeColor,strokeWidth:null==t?void 0:t.options.strokeWidth,markerEnd:null!=t&&t.options.arrow?`url(#${o}connect-line)`:void 0}))}},1803:(e,t,n)=>{n.d(t,{m:()=>r});var o=n(8769),a=n.n(o),i=n(3373),l=n.n(i);function r(e){var t,n;let{line:{line:o,edge:i,d:r,markers:s},linePaths:d,lineMaskRects:c,maskPrefix:u,markerPrefix:f,activeLineMarkerPrefix:p,active:m,activeRelated:h,onLineClick:v,onLineDoubleClick:g}=e;const y=c.has(o.$id)?`url(#${u}${o.$id})`:void 0,{strokeColor:k,strokeWidth:b,interactStrokeWidth:w}={...o,...m?null===(t=o.overrides)||void 0===t?void 0:t.active:h?null===(n=o.overrides)||void 0===n?void 0:n.activeRelated:null},x=m?"active":h?"active-related":"default";let M,R;for(const e of s)e.variant===x&&("start"===e.placement?M=`url(#${f}${e.index})`:R=`url(#${f}${e.index})`);return a().createElement("g",{className:l()("line",{interactable:o.interactable,active:m,"active-related":h}),onClick:o.interactable?()=>{null==v||v({id:o.$id,edge:i})}:void 0,onDoubleClick:o.interactable?e=>{e.preventDefault(),e.stopPropagation(),null==g||g({id:o.$id,edge:i})}:void 0,style:{cursor:o.cursor}},o.interactable&&a().createElement("path",{d:r,fill:"none",stroke:"transparent",strokeWidth:w}),a().createElement("path",{ref:e=>d.set(o.$id,e),stroke:k,strokeWidth:b,d:r,fill:"none",markerStart:M,markerEnd:R,mask:y}),a().createElement("path",{stroke:"var(--palette-blue-3)",strokeWidth:b,d:r,fill:"none",className:"active-bg",markerStart:`url(#${p}start)`,markerEnd:`url(#${p}end)`,mask:y}))}},2547:(e,t,n)=>{n.d(t,{d2:()=>r});var o=n(8769),a=n.n(o),i=n(7549),l=n(7353);function r(e){let{labels:t,onRendered:n}=e;const[i,l]=(0,o.useState)(!1),[r,c]=(0,o.useState)([]),u=(0,o.useMemo)((()=>new Map),[]),f=(0,o.useCallback)(((e,t)=>{t&&u.set(e,t),c((t=>t.includes(e)?t:t.concat(e)))}),[u]),p=(0,o.useCallback)((e=>{c((t=>{const n=t.indexOf(e);return-1===n?t:t.slice(0,n).concat(t.slice(n+1))})),u.delete(e)}),[u]);return(0,o.useEffect)((()=>{l(!(null!=t&&t.some((e=>!r.includes(e.id)))))}),[t,r]),(0,o.useEffect)((()=>{null==n||n(i?u:null)}),[u,i]),a().createElement(a().Fragment,null,null==t?void 0:t.map((e=>{let{text:t,label:n,id:o,edge:i}=e;return n?a().createElement("div",{key:o,className:"line-label"},a().createElement(d,{id:o,edge:i,label:n,onRendered:f,onUnmount:p})):a().createElement(s,{key:o,id:o,text:t,onRendered:f})})))}function s(e){let{id:t,text:n,onRendered:i}=e;const l=(0,o.useCallback)((e=>{null==i||i(t,e)}),[t,i]);return a().createElement("div",{className:"line-label",ref:l,style:n.style},n.content)}function d(e){let{id:t,edge:n,label:r,onRendered:s,onUnmount:d}=e;const c=(0,o.useMemo)((()=>(0,l.checkIfByTransform)(r,{edge:n})?r.useBrick:null),[n,r]),u=(0,o.useMemo)((()=>({edge:n})),[n]);(0,o.useEffect)((()=>{c||setTimeout((()=>{null==s||s(t,null)}))}),[t,s,c]),(0,o.useEffect)((()=>()=>{null==d||d(t)}),[]);const f=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==s||s(t,e.parentElement)}))}),[t,s]),p=(0,o.useCallback)((()=>{setTimeout((()=>{null==s||s(t,null)}))}),[t,s]);return c?a().createElement(i.ReactUseBrick,{refCallback:f,ignoredCallback:p,useBrick:c,data:u}):null}},9191:(e,t,n)=>{n.d(t,{y:()=>i});var o=n(8769),a=n.n(o);function i(e){let{lineId:t,rects:n,maskPrefix:o,renderedLineLabels:i}=e;const l=i.find((e=>e.lineId===t&&"center"===e.placement));if(!l)return null;const{lineRect:r}=l,s=(c=1e3,{left:(d=r).left-c,top:d.top-c,width:d.width+2e3,height:d.height+2e3});var d,c;return a().createElement("mask",{id:`${o}${t}`,x:s.left,y:s.top,width:s.width,height:s.height},a().createElement("rect",{x:s.left,y:s.top,width:s.width,height:s.height,fill:"white"}),n.map(((e,t)=>a().createElement("rect",{key:t,x:e.left,y:e.top,width:e.width,height:e.height,fill:"black"}))))}},8892:(e,t,n)=>{n.d(t,{p:()=>r});var o=n(8769),a=n.n(o),i=n(7549),l=n(7353);function r(e){let{nodes:t,nodeBricks:n,onRendered:i}=e;const[l,r]=(0,o.useState)(!1),[d,c]=(0,o.useState)([]),u=(0,o.useMemo)((()=>new Map),[]),f=(0,o.useCallback)(((e,t)=>{t&&u.set(e,t),c((t=>t.includes(e)?t:t.concat(e)))}),[u]),p=(0,o.useCallback)((e=>{c((t=>{const n=t.indexOf(e);return-1===n?t:t.slice(0,n).concat(t.slice(n+1))})),u.delete(e)}),[u]);return(0,o.useEffect)((()=>{r(!(null!=t&&t.some((e=>!d.includes(e.id)))))}),[t,d]),(0,o.useEffect)((()=>{null==i||i(l?u:null)}),[u,l]),a().createElement(a().Fragment,null,null==t?void 0:t.map((e=>a().createElement("div",{key:e.id,className:"node"},a().createElement(s,{nodeBricks:n,node:e,onRendered:f,onUnmount:p})))))}function s(e){let{node:t,nodeBricks:n,onRendered:r,onUnmount:s}=e;const d=(0,o.useMemo)((()=>{var e;return null===(e=function(e,t){return null==t?void 0:t.find((t=>t.nodeType?[].concat(t.nodeType).includes(e.type):(0,l.checkIfByTransform)(t,{node:e})))}(t,n))||void 0===e?void 0:e.useBrick}),[t,n]),c=(0,o.useMemo)((()=>({node:t})),[t]);(0,o.useEffect)((()=>{d||setTimeout((()=>{null==r||r(t.id,null)}))}),[t.id,r,d]),(0,o.useEffect)((()=>()=>{null==s||s(t.id)}),[]);const u=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==r||r(t.id,e)}))}),[t.id,r]),f=(0,o.useCallback)((()=>{setTimeout((()=>{null==r||r(t.id,null)}))}),[t.id,r]);return d?a().createElement(i.ReactUseBrick,{refCallback:u,ignoredCallback:f,useBrick:d,data:c}):null}},8657:(e,t,n)=>{n.d(t,{Ie:()=>l,KP:()=>i,VO:()=>a,Yt:()=>s,mF:()=>o,sS:()=>r});const o="var(--palette-gray-5)",a=1,i="curveBasis",l=20,r=.5,s=2},8069:(e,t,n)=>{n.d(t,{o:()=>k});var o=n(8769),a=n(7586),i=n.n(a),l=n(1030);function r(e,t,n){for(const i of e){var o,a;const e=t.get(i.id);i.width=Math.max(null!==(o=null==e?void 0:e.offsetWidth)&&void 0!==o?o:0,10)+n[1]+n[3],i.height=Math.max(null!==(a=null==e?void 0:e.offsetHeight)&&void 0!==a?a:0,10)+n[0]+n[2]}}function s(e,t,n){for(const a of e){var o;const e=a.x-a.width/2+n[3],i=a.y-a.height/2+n[0],l=null===(o=t.get(a.id))||void 0===o?void 0:o.parentElement;l&&(l.style.left=`${e}px`,l.style.top=`${i}px`,l.style.visibility="visible")}}var d=n(8802),c=n(6149),u=n(4842),f=n(1945),p=n(9418),m=n(3854),h=n(7931);function v(e,t){var n;let{normalizedLinesMap:o,lineLabelsRefRepository:a}=t;return null!==(n=null==e?void 0:e.map((e=>{const t=o.get(e),n={};if(t)for(const e of["start","end"]){const o=a.get(`${t}-${e}`);o&&(n[e]=[o.offsetWidth,o.offsetHeight])}return{data:e,labelSize:n}})))&&void 0!==n?n:[]}function g(e,t){return new Array(t).fill(null).map(((t,n)=>({dummy:!0,id:`$dummy-${e.source}-${e.target}-${n}`})))}function y(e,t){return new Array(t+1).fill(null).map(((n,o)=>({dummy:!0,source:0===o?e.source:`$dummy-${e.source}-${e.target}-${o-1}`,target:o===t?e.target:`$dummy-${e.source}-${e.target}-${o}`})))}function k(e){let{layout:t,nodes:n,edges:a,manualLayoutStatus:k,userViewReady:b,userViewNodesMap:w,nodeMovement:x,nodesRefRepository:M,lineLabelsRefRepository:R,normalizedLinesMap:E,nodesRenderId:L,lineLabelsRenderId:$,layoutOptions:C}=e;const P="initial"===k?t:"manual",[S,I]=(0,o.useState)(null),[T,N]=(0,o.useState)({nodes:[],edges:[]});return(0,o.useEffect)((()=>{b&&I((e=>"dagre"===P?function(e,t,n,o){const{nodePadding:a,...c}={nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50,...(0,l.pick)(o,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])},u=(0,d.D)(a),f=new(i().graphlib.Graph);f.setGraph(c),f.setDefaultEdgeLabel((function(){return{}}));for(const n of null!=t?t:[]){const t=null==e?void 0:e.getNode(n.id);f.setNode(n.id,(null==t?void 0:t.data)===n?t:{id:n.id,data:n})}for(const e of null!=n?n:[])f.setEdge(e.source,e.target,{data:e});return{layout:"dagre",getNode:e=>f.node(e),applyLayout(e){let{nodesRefRepository:t,lineLabelsRefRepository:n,normalizedLinesMap:o}=e;const a=[];for(const e of f.nodes()){const t=f.node(e);t?a.push(t):console.error("Diagram node not found: %s",e)}if(0===a.length)return null;r(a,t,u);const l=f.edges().map((e=>f.edge(e)));for(const e of l){const t=o.get(e.data);if(t)for(const o of["center","start","end"]){const a=n.get(`${t}-${o}`);if(a){var d;const{offsetWidth:t,offsetHeight:n}=a;"center"===o&&(e.labelpos="c",e.width=t,e.height=n),null!==(d=e.labelSize)&&void 0!==d||(e.labelSize={}),e.labelSize[o]=[t,n]}}}return i().layout(f),s(a,t,u),{nodes:a,edges:l}}}}(e,n,a,C):"force"===P?function(e,t,n,o,a){const{nodePadding:i,dummyNodesOnEdges:k,collide:b}={nodePadding:0,dummyNodesOnEdges:0,...(0,l.pick)(a,["nodePadding","dummyNodesOnEdges"]),collide:!1!==(null==a?void 0:a.collide)&&{dummyRadius:1,radiusDiff:5,strength:1,iterations:1,...!0===(null==a?void 0:a.collide)?null:null==a?void 0:a.collide}},w=(0,d.D)(i),x=[];for(const n of null!=t?t:[]){const t=null==e?void 0:e.getNode(n.id);if((null==t?void 0:t.data)===n)x.push(t);else{const e={id:n.id,data:n},t=null==o?void 0:o.get(n.id);t&&(e.fx=t.x,e.fy=t.y),x.push(e)}}return{layout:"force",getNode:function(e){return x.find((t=>t.data.id===e))},applyLayout(e){let{nodesRefRepository:t,lineLabelsRefRepository:o,normalizedLinesMap:a}=e;if(0===x.length)return null;r(x,t,w);const i=x.slice(),l=[];for(const e of null!=n?n:[])l.push({...e}),k>0&&(i.push(...g(e,k)),l.push(...y(e,k)));const d=(0,c.A)(l).id((e=>e.id));k>0&&d.distance((e=>e.dummy?30/(k+1):30)).strength((e=>e.dummy?.5:1));const M=(0,u.A)(i).force("link",d).force("x",(0,f.A)()).force("y",(0,p.A)()).force("charge",(0,m.A)());b&&M.force("collide",(0,h.A)().radius((e=>e.dummy?b.dummyRadius:Math.sqrt(e.width**2+e.height**2)/2+b.radiusDiff)).strength(b.strength).iterations(b.iterations)),M.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(M),s(x,t,w);const R=v(n,{normalizedLinesMap:a,lineLabelsRefRepository:o});return{nodes:x,edges:R}}}}(e,n,a,w,C):"manual"===P?function(e,t,n,o){const{nodePadding:a}={nodePadding:0,...(0,l.pick)(o,["nodePadding"])},i=(0,d.D)(a),c=[];for(const n of null!=t?t:[]){const t=null==e?void 0:e.getNode(n.id);(null==t?void 0:t.data)===n?(c.push(t),t.x0=t.x,t.y0=t.y):c.push({id:n.id,data:n})}let u;return{layout:"manual",getNode:function(e){return c.find((t=>t.data.id===e))},applyLayout(e){let{manualLayoutStatus:t,nodesRefRepository:o,lineLabelsRefRepository:a,normalizedLinesMap:l,nodeMovement:d}=e;if(0===c.length)return null;var f,p;r(c,o,i),d&&(u=c.find((e=>e.id===d.id)),u&&(u.x=(null!==(f=u.x0)&&void 0!==f?f:0)+d.move[0],u.y=(null!==(p=u.y0)&&void 0!==p?p:0)+d.move[1])),"finished"===t&&u&&(u.x0=u.x,u.y0=u.y),s(c,o,i);const m=v(n,{normalizedLinesMap:l,lineLabelsRefRepository:a});return{nodes:c,edges:m}}}}(e,n,a,C):null))}),[a,n,P,C,b,w]),(0,o.useEffect)((()=>{if(!M||!R||P!==(null==S?void 0:S.layout))return;const e=null==S?void 0:S.applyLayout({manualLayoutStatus:k,nodesRefRepository:M,lineLabelsRefRepository:R,normalizedLinesMap:E,nodeMovement:x});e&&N(e)}),[P,k,S,x,M,R,L,$,E]),T}},6753:(e,t,n)=>{n.d(t,{_:()=>u});var o=n(8769),a=n(7353),i=n(6330),l=n(3496),r=function(){var e=(0,i.A)((function*(e,t,n){return(yield l.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,o){return e.apply(this,arguments)}}(),s=function(){var e=(0,i.A)((function*(e,t,n,o){return(yield l.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,o)).data}));return function(t,n,o,a){return e.apply(this,arguments)}}(),d=function(){var e=(0,i.A)((function*(e,t,n){return(yield l.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,o){return e.apply(this,arguments)}}();const c="GRAPH_USER_VIEW@EASYOPS";function u(e){const[t,n]=(0,o.useState)(!e),i=(0,o.useRef)(),[l,u]=(0,o.useState)(null),f=(0,o.useMemo)((()=>function(){let e=!1;const t=[];return async function(n){if(t.push(n),!e){let n;for(e=!0;n=t.shift();)try{await n()}catch(e){console.error(e)}e=!1}}}()),[]);return(0,o.useEffect)((()=>{!async function(){if(!e)return void n(!0);const{namespace:t,key:o}=e;if(!t||!o)return console.error("Namespace and key are required to save graph user view"),void n(!0);try{const e=(await r(c,{fields:["nodes"],query:{namespace:{$eq:t},key:{$eq:o}},page:1,page_size:30})).list;if(e.length>0){var l;const t=e[0],n=new Map(null===(l=t.nodes)||void 0===l?void 0:l.map((e=>[e.id,e])));i.current=t.instanceId,u(n)}else u(null)}catch(e){(0,a.handleHttpError)(e)}finally{n(!0)}}()}),[e]),{userViewReady:t,userViewNodesMap:l,saveUserView:(0,o.useCallback)((t=>{const{namespace:n,key:o}=null!=e?e:{};n&&o&&f((async()=>{const e={namespace:n,key:o,nodes:t};try{if(i.current)await s(c,i.current,e,{interceptorParams:{ignoreLoadingBar:!0}});else{const t=await d(c,e,{interceptorParams:{ignoreLoadingBar:!0}});i.current=t.instanceId}}catch(e){(0,a.handleHttpError)(e)}}))}),[e,f])}}},1324:(e,t,n)=>{function o(e,t){for(const{id:n,position:o,placement:a,angle:i,size:l}of e){const e=t.get(n);if(e&&(e.style.left=`${o[0]}px`,e.style.top=`${o[1]}px`,e.style.visibility="visible","center"!==a&&void 0!==i)){const[t,n]=null!=l?l:[0,0],o=Math.floor((i<0?2*Math.PI+i:i)/Math.PI*4),r="start"===a?o:(o+4)%8,s=Math.tan(i),d=i+("start"===a?1:-1)*Math.PI/2,c=2,u=Math.sin(d)*c,f=Math.cos(d)*c;let p;switch(r){case 0:p=`translate(0,${t*s+u}px)`;break;case 1:p=`translate(${n/s-f}px,0)`;break;case 2:p=`translate(calc(${n/s+f}px - 100%),0)`;break;case 3:p=`translate(-100%,${-t*s-u}px)`;break;case 4:p=`translate(-100%,calc(${-t*s+u}px - 100%))`;break;case 5:p=`translate(calc(${-n/s-f}px - 100%),-100%)`;break;case 6:p=`translate(${-n/s+f}px,-100%)`;break;default:p=`translate(0,calc(${t*s-u}px - 100%))`}e.style.transform=p}}}n.d(t,{F:()=>o})},5987:(e,t,n)=>{function o(e,t){const n=new Map;for(const{id:o,lineId:a,placement:i}of e){if(!t||"center"!==i)continue;const e=t.get(o);if(!e)continue;const{offsetWidth:l,offsetHeight:r}=e;if(0===l||0===r)continue;const s=3;n.set(a,[{left:e.offsetLeft-l/2-s,top:e.offsetTop-r/2-s,width:l+2*s,height:r+2*s}])}return n}n.d(t,{G:()=>o})},8060:(e,t,n)=>{function o(e,t,n){return 0===e.length&&0===t.length?e:t.flatMap((e=>{let{line:{text:t,label:o,$id:a},edge:i,labelSize:l,angle:r}=e;const s=n.get(a);if(!t&&!o||!s||!s.getAttribute("d"))return[];let d,c;o?(d="label",c=[].concat(o)):(d="text",c=[].concat(t));const{x:u,y:f,width:p,height:m}=s.getBBox(),h=s.getTotalLength();return c.map((e=>{var t;const n=null!==(t=e.placement)&&void 0!==t?t:"center",o=s.getPointAtLength("start"===n?Math.min(0,h/2):"end"===n?Math.max(h-0,h/2):h/2);return{[d]:e,edge:i,position:[o.x,o.y],lineRect:{left:u,top:f,width:p,height:m},id:`${a}-${n}`,lineId:a,placement:n,angle:r,size:null==l?void 0:l[n]}}))}))}n.d(t,{z:()=>o})},1518:(e,t,n)=>{n.d(t,{R:()=>r});var o=n(8653),a=n(3188),i=n(4059),l=n(733);function r(e,t,n){const r=new WeakMap,c=new Map,u=new Map;for(const e of t)c.set(e.id,e);for(const t of e){const{data:e}=t;r.set(e,t)}let f=!1;return n.map((t=>{var n,p,m,h;let{line:v,edge:g,markers:y,...k}=t;const b=r.get(g);if(!b)return;const w=null!==(n=null===(p=y.find((e=>"default"===e.variant&&"start"===e.placement)))||void 0===p?void 0:p.offset)&&void 0!==n?n:0,x=null!==(m=null===(h=y.find((e=>"default"===e.variant&&"end"===e.placement)))||void 0===h?void 0:h.offset)&&void 0!==m?m:0;let M,{points:R}=b;if(!R){const t=c.get(g.source),n=c.get(g.target);if(t&&n&&t!==n){if("polyline"===v.type){if(!(0,l.w)(t,n,w,x)){var E,L;(()=>{if(f)return;f=!0;const t=(e,t)=>{let n=u.get(e);n||u.set(e,n=new Set);const o=c.get(t);o&&n.add(o)};for(const{data:{source:n,target:o}}of e)n!==o&&(t(n,o),t(o,n))})();const o=s(t,n,w),a=s(n,t,x),l=d(null!==(E=u.get(g.source))&&void 0!==E?E:[],t,o,w),r=d(null!==(L=u.get(g.target))&&void 0!==L?L:[],n,a,x),p=(l.indexOf(n)+1)/(l.length+1),m=(r.indexOf(t)+1)/(r.length+1);R=(0,i.o)(t,n,o,a,p,m)}}else R=(0,a.h)(t,n);if(R){const e=R[0],t=R[R.length-1];M=Math.atan2(t.y-e.y,t.x-e.x)}}}return{...k,markers:y,line:v,edge:g,d:(0,o.S)(R,v.curveType,w,x),angle:M,labelSize:b.labelSize}})).filter(Boolean)}function s(e,t,n){const o=Math.atan2(e.height+2*n,e.width+2*n),{x:a,y:i}=e,{x:l,y:r}=t,s=Math.atan2(r-i,l-a),d=s<0?2*Math.PI+s:s;switch(Math.floor(d/Math.PI*2)){case 0:return d<o?"right":"bottom";case 1:return d<Math.PI-o?"bottom":"left";case 2:return d<Math.PI+o?"left":"top";default:return d<2*Math.PI-o?"top":"right"}}function d(e,t,n,o){return[...e].filter((e=>s(t,e,o)===n)).sort(((e,t)=>{const{x:o,y:a}=e,{x:i,y:l}=t;return"top"===n||"bottom"===n?o-i:a-l}))}},5157:(e,t,n)=>{n.d(t,{a:()=>a});var o=n(1030);function a(e,t){let{renderedNodes:n,activeTarget:o}=t;const a="node"===(null==o?void 0:o.type)?n.find((e=>e.id===o.nodeId)):void 0,l="edge"===(null==o?void 0:o.type)?o.edge:void 0;if(!a&&!l)return;const r=e.key||e.keyCode||e.which;let s,d,c;switch(r){case"Backspace":case 8:case"Delete":case 46:a?(s="delete-node",d=a):(s="delete-edge",c=l);break;default:if(!a)return;switch(r){case"ArrowLeft":case 37:d=i("x",n,a,-1),s="switch-active-node";break;case"ArrowUp":case 38:d=i("y",n,a,-1),s="switch-active-node";break;case"ArrowRight":case 39:d=i("x",n,a,1),s="switch-active-node";break;case"ArrowDown":case 40:d=i("y",n,a,1),s="switch-active-node"}}var u;return s?(e.preventDefault(),e.stopPropagation(),{action:s,node:null===(u=d)||void 0===u?void 0:u.data,edge:c}):void 0}function i(e,t,n,a){const i="x"===e?"y":"x";let l;const r=t.filter((t=>t!==n&&(l=(t[e]-n[e])*a,l>0)&&l>Math.abs(n[i]-t[i])));return(0,o.minBy)(r,(t=>(n[i]-t[i])**2+(n[e]-t[e])**2))}},2448:(e,t,n)=>{n.d(t,{P:()=>i});var o=n(7353),a=n(8657);function i(e,t){let{nodes:n,nodesRefRepository:i,connectNodes:l,dragNodes:r,scale:s,setConnectLineState:d,setConnectLineTo:c,setManualLayoutStatus:u,setNodeMovement:f,onSwitchActiveTarget:p,onNodesConnect:m}=t;function h(e){if(i)for(const[t,o]of i)if(e(o))return null==n?void 0:n.find((e=>e.id===t))}if(!l&&!r)return;const v=h((t=>t.contains(e.target)));if(!v)return;if(!function(e,t){return e.sourceType?[].concat(e.sourceType).includes(t.type):(0,o.checkIfByTransform)(e,{source:t})}(l||r,v))return;e.stopPropagation();const g=[e.clientX,e.clientY];if(l){d({from:g,options:{strokeColor:a.mF,strokeWidth:a.VO,...o.__secret_internals.legacyDoTransform({source:v},l)}}),c(g),null==p||p({type:"node",nodeId:v.id});const e=e=>{c([e.clientX,e.clientY])},t=n=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),d(null);const o=n.composedPath(),a=h((e=>o.includes(e)));a&&v!==a&&(null==m||m({source:v,target:a}))};return document.addEventListener("mousemove",e),void document.addEventListener("mouseup",t)}null==p||p({type:"node",nodeId:v.id});let y=!1;const k=e=>{const t=[(e.clientX-g[0])/s,(e.clientY-g[1])/s];y||(y=t[0]**2+t[1]**2>=9,y&&u("started")),y&&f({id:v.id,move:t})},b=()=>{y=!1,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",b),f(null),u("finished")};document.addEventListener("mousemove",k),document.addEventListener("mouseup",b)}},9137:(e,t,n)=>{n.d(t,{t:()=>r});var o=n(1030),a=n(7353);function i(e,t){return!!t&&(t.edgeType?[].concat(t.edgeType).includes(e.type):(0,a.checkIfByTransform)(t,{edge:e}))}var l=n(8657);function r(e,t){const n=[],r=new WeakMap,d=[];for(const v of null!=e?e:[]){var c,u;const{label:e,...g}=null!==(c=null==t?void 0:t.find((e=>i(v,e))))&&void 0!==c?c:{},y=a.__secret_internals.legacyDoTransform({edge:v},g);if(!1===(null==y?void 0:y.draw))continue;const k=(0,o.uniqueId)("line-"),b={strokeColor:l.mF,strokeWidth:l.VO,curveType:"polyline"===(null==y?void 0:y.type)?"curveLinear":l.KP,interactStrokeWidth:l.Ie,type:"auto",...y,label:e,$id:k};r.set(v,k);const w=[],x=null!==(u=b.markers)&&void 0!==u?u:b.arrow?[{placement:"end",type:"arrow"}]:[];for(const e of x){var f,p,m,h;const{placement:t,type:n}=e,o=null!=t?t:"end";let a,i;switch(n){case"0..1":case"0..N":i=21,a=n;break;default:i=1,a="arrow"}const l=i*b.strokeWidth,r=s({type:a,strokeColor:b.strokeColor},d);w.push({index:r,placement:o,type:a,variant:"default",offset:l});const c=s({type:a,strokeColor:null!==(f=null===(p=b.overrides)||void 0===p||null===(p=p.active)||void 0===p?void 0:p.strokeColor)&&void 0!==f?f:b.strokeColor},d);w.push({index:c,placement:o,type:a,variant:"active",offset:l});const u=s({type:a,strokeColor:null!==(m=null===(h=b.overrides)||void 0===h||null===(h=h.activeRelated)||void 0===h?void 0:h.strokeColor)&&void 0!==m?m:b.strokeColor},d);w.push({index:u,placement:o,type:a,variant:"active-related",offset:l})}n.push({line:b,markers:w,edge:v})}return{normalizedLines:n,normalizedLinesMap:r,markers:d}}function s(e,t){let n=(0,o.findIndex)(t,e);return-1===n&&(n=t.push(e)-1),n}},2673:(e,t,n)=>{function o(e,t){return e?!!t&&e.type===t.type&&("node"===e.type?e.nodeId===t.nodeId:e.edge.source===t.edge.source&&e.edge.target===t.edge.target):!t}n.d(t,{c:()=>o})},8308:(e,t,n)=>{function o(e,t){let{canvasWidth:n,canvasHeight:o,scaleRange:a}=t,i=1/0,l=1/0,r=-1/0,s=-1/0;for(const t of e){const e=t.width/2,n=t.height/2,o=t.x-e,a=t.x+e,d=t.y-n,c=t.y+n;o<i&&(i=o),a>r&&(r=a),d<l&&(l=d),c>s&&(s=c)}const d=r-i,c=s-l,u=a&&(d>n||c>o)?Math.max(Math.min(n/d,o/c,a[1]),a[0]):1;return{x:(n-d*u)/2-i*u,y:(o-c*u)/2-l*u,k:u}}n.d(t,{r:()=>o})},821:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(6758),a=n.n(o),i=n(935),l=n.n(i)()(a());l.push([e.id,":host{display:block;width:100%;height:100%;overflow:hidden}:host([hidden]){display:none}*{box-sizing:border-box}.diagram{width:100%;height:100%;position:relative;opacity:0}.diagram:focus{outline:none}.lines,\n.line-labels,\n.nodes{position:absolute;top:0;left:0}.line-labels{opacity:0}.ready{opacity:1}.diagram.ready.pannable{cursor:grab}.diagram.pannable.grabbing{cursor:grabbing}.nodes,\n.lines{transform-origin:0 0}.node,\n.line-label{position:absolute;visibility:hidden}.line-label{transform:translate(-50%,-50%);white-space:pre-line;width:max-content;text-align:center;line-height:1}.lines{pointer-events:none}.line.interactable{pointer-events:auto;cursor:default}.connect-line{position:fixed;top:0;left:0;right:0;bottom:0;pointer-events:none}.connect-line:not(.connecting){display:none}.line:not(.active) .active-bg{display:none}",""]);const r=l.toString()}}]);
|
|
3
|
-
//# sourceMappingURL=3233.2fa18575.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[3933,6314],{3933:(e,t,o)=>{function n(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(r,s){if("string"==typeof t?r.name===t:t.includes(r.name)){const t=[];for(let i=1;i<=o;i++){const o=s[s.length-i];if("MemberExpression"===(null==o?void 0:o.node.type)&&"object"===o.key){const s=o.node;s.computed||"Identifier"!==s.property.type?s.computed&&"Literal"===s.property.type&&"string"==typeof s.property.value?t.push(n?`${r.name}.${s.property.value}`:s.property.value):e.hasNonStaticUsage=!0:t.push(n?`${r.name}.${s.property.name}`:s.property.name)}else e.hasNonStaticUsage=!0}t.length===o&&e.usedProperties.add(t.join("."))}}}function r(e,t){return function(o,n,r){if(n.name===e){const e=r[r.length-1],n=r[r.length-2];if("CallExpression"===(null==n?void 0:n.node.type)&&"callee"===(null==n?void 0:n.key)&&"MemberExpression"===(null==e?void 0:e.node.type)&&"object"===e.key&&(e.node.computed?"Literal"===e.node.property.type&&e.node.property.value===t:"Identifier"===e.node.property.type&&e.node.property.name===t)){const e=n.node.arguments;if(e.length>0){const t=e[0];"Literal"===t.type&&"string"==typeof t.value?o.usedArgs.add(t.value):o.hasNonStaticUsage=!0}}}}}o.r(t),o.d(t,{beforeVisitGlobalMember:()=>n,collectAppGetMenuUsage:()=>s,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>S,createProviderClass:()=>c.createProviderClass,scanPermissionActionsInAny:()=>P,scanPermissionActionsInStoryboard:()=>v,strictCollectMemberUsage:()=>l,track:()=>f,trackAll:()=>y,traverseStoryboardExpressions:()=>u,traverseStoryboardFunction:()=>g,traverseStoryboardFunctions:()=>h,unwrapProvider:()=>c.unwrapProvider});const s=r("APP","getMenu"),i=r("INSTALLED_APPS","has");var a=o(8256),c=o(532);function u(e,t,o){const n=new WeakSet,{matchExpressionString:r,visitNotMatchedExpressionString:s,visitNonExpressionString:i,visitObject:u}="string"==typeof o?{matchExpressionString:e=>e.includes(o)}:o;!function e(o){if("string"==typeof o)if((0,a.isEvaluable)(o))if(r(o))try{(0,a.preevaluate)(o,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,n){t(e,n,o)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==s||s(o);else null==i||i(o);else if((0,c.isObject)(o)){if(n.has(o))return;n.add(o),null==u||u(o);for(const t of Array.isArray(o)?o:Object.values(o))e(t)}}(e)}function l(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{hasNonStaticUsage:n,nonStaticUsage:r,usedProperties:s}=p(e,t,o);if(n)throw new Error(`Non-static usage of ${t} is prohibited, check your expression: "${r}"`);return s}function p(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r={usedProperties:new Set,hasNonStaticUsage:!1},s=n(r,t,o);return u(e,((e,t,o)=>{s(e,t),r.hasNonStaticUsage&&(r.nonStaticUsage=o)}),t),r}const d=["CTX","STATE","FORM_STATE"];function f(e,t,o){if(e.includes(t)){const r={usedProperties:new Set,hasNonStaticUsage:!1},{expression:s}=(0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:n(r,o)}});let i;if("SequenceExpression"===s.type&&(i=s.expressions[0])&&"Literal"===i.type&&i.value===t){if(r.usedProperties.size>0)return r.usedProperties;console.warn(`You are using "${t}" but no \`${o}\` usage found in your expression: ${JSON.stringify(e)}`)}}return!1}function y(e){if(d.some((t=>e.includes(t)))){const t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:n(t,d,1,!0)}}),t.usedProperties.size>0){const e=[...t.usedProperties],o={context:!1,state:!1,formState:!1},n={CTX:"context",STATE:"state",FORM_STATE:"formState"};return e.forEach((e=>{const[t,r]=e.split(".");o[n[t]]||(o[n[t]]=[]),o[n[t]].push(r)})),o}console.warn(`You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: ${JSON.stringify(e)}`)}return!1}function h(e,t,o){if(Array.isArray(e))for(const n of e)null!=o&&o.matchSource&&!o.matchSource(n.source)||g(n,t)}function g(e,t,o){try{(0,a.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t},cacheKey:e})}catch(t){o||console.error(`Parse storyboard function "${e.name}" failed:`,t)}}function S(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const s={usedProperties:new Set,hasNonStaticUsage:!1};if(e.source.includes(t)&&g(e,n(s,t,r),o),s.hasNonStaticUsage&&!o)throw new Error(`Non-static usage of ${t} is prohibited, check your function: "${e.name}"`);return s.usedProperties.delete(e.name),s.usedProperties}const m="PERMISSIONS",b="check";function v(e){var t;const o=new Set,n=k(o),{customTemplates:r,functions:s}=null!==(t=e.meta)&&void 0!==t?t:{};return u([e.routes,r],n,m),h(s,n,{matchSource:e=>e.includes(m)}),Array.from(o)}function P(e){const t=new Set;return u(e,k(t),m),Array.from(t)}function k(e){return function(t,o){if(t.name===m){const t=o[o.length-1],n=o[o.length-2];if("CallExpression"===(null==n?void 0:n.node.type)&&"callee"===(null==n?void 0:n.key)&&"MemberExpression"===(null==t?void 0:t.node.type)&&"object"===t.key&&(t.node.computed?"Literal"===t.node.property.type&&t.node.property.value===b:"Identifier"===t.node.property.type&&t.node.property.name===b))for(const t of n.node.arguments)"Literal"===t.type&&"string"==typeof t.value&&e.add(t.value)}}}}}]);
|
|
2
|
-
//# sourceMappingURL=3933.8706ce70.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[5552,3171],{5552:(n,e,t)=>{t.r(e),t.d(e,{i18n:()=>d,i18nText:()=>l,initializeI18n:()=>u});var i=t(2350),s=t(1590),r=t(7072);let a=!1;const o=new Set;function u(n,e){if(a||(a=!0,s.i18n.use(r.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),n&&e&&!o.has(n)){o.add(n);for(const[t,i]of Object.entries(e))s.i18n.addResourceBundle(t,n,i)}}var c=t(532);function l(n){var e;if(!n)return;const t=null!==(e=s.i18n.language)&&void 0!==e?e:"zh-CN";if((0,c.hasOwnProperty)(n,t))return n[t];const i=t.split("-")[0];if(i!==t)return(0,c.hasOwnProperty)(n,i)?n[i]:void 0;const r=`${i}-`;for(const e of Object.keys(n))if(e.startsWith(r))return n[e]}const d=i.default}}]);
|
|
2
|
-
//# sourceMappingURL=5552.e14bec19.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 5582.9e7b28a7.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[5582],{5582:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>Xt,Notification:()=>on,StoryboardFunctionRegistryFactory:()=>fe,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>Ri,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>St,checkIfOfComputed:()=>bt,createHistory:()=>A,createRuntime:()=>mi,customEditors:()=>Mi,customProcessors:()=>x,customTemplates:()=>Pe,fetchByProvider:()=>xi,getAuth:()=>Oi,getBasePath:()=>f,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>ee,getHistory:()=>k,getPageInfo:()=>po,getRealValue:()=>$i,getRuntime:()=>gi,getV2RuntimeFromDll:()=>S,handleHttpError:()=>rn,httpErrorToString:()=>Qt,instantiateModalStack:()=>Ni,isLoggedIn:()=>_i,isNetworkError:()=>mo,isUnauthenticatedError:()=>Zt,logout:()=>Ti,matchPath:()=>Bt,registerWidgetFunctions:()=>Be,registerWidgetI18n:()=>N,resetReloadForError:()=>Eo,setUIVersion:()=>ho,shouldReloadForError:()=>yo,unstable_createRoot:()=>Li});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>Pr,debugDataValue:()=>Cr,getAddedContracts:()=>Ir,getAllContextValues:()=>Er,getBrickPackagesById:()=>br,getContextValue:()=>yr,getLegalRuntimeValue:()=>Rr,getRenderId:()=>kr,legacyDoTransform:()=>ur,loadBricks:()=>Sr,loadEditors:()=>Ar,mountUseBrick:()=>cr,renderUseBrick:()=>ar,setRealTimeDataInspectRoot:()=>_r,symbolForRootRuntimeContext:()=>sr,unmountUseBrick:()=>lr,updateSnippetPreviewSettings:()=>gr,updateStoryboard:()=>dr,updateStoryboardByRoute:()=>pr,updateStoryboardBySnippet:()=>mr,updateStoryboardByTemplate:()=>fr,updateTemplatePreviewSettings:()=>hr});var o=n(4586),i=n(918),s=n(6121),a=n(829),c=n(1590),l=n(8419),u=n(532),d=n(1302),p=(n(6036),n(2890));function f(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=n(1030);function v(e,t){const n=(0,h.orderBy)(e,(e=>{var t,n;return null!==(t=null===(n=e.app.homepage)||void 0===n?void 0:n.length)&&void 0!==t?t:0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&m(n,t))return e}}function m(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function g(e){var t;return!e||(null===(t=gi().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let w,y=!1;function E(e,t){y=!confirm(e),t(!y)}function b(e){const{push:t,replace:n}=e;function r(r){return function(o,i,s){let a;const c="string"==typeof o;return a=c?(0,p.parsePath)(o).pathname:o.pathname,"string"==typeof a&&a.startsWith("/")&&g(function(e){var t,n;return v(null!==(t=null===(n=pi)||void 0===n?void 0:n.storyboards)&&void 0!==t?t:[],e)}(a))?location["push"===r?"assign":"replace"](c?f()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,i,s)}}return{push:r("push"),replace:r("replace")}}function S(){var e;const{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function A(){if(!w){const e=(0,p.createBrowserHistory)({basename:f().replace(/\/$/,""),getUserConfirmation:E});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){y=!1,t(e,n),null==r||r(y)}function o(e,t,r){y=!1,n(e,t),null==r||r(y)}function i(t){return function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;const{extraQuery:a,clear:c,keepHash:l,...u}=i,d=new URLSearchParams(c?"":e.location.search),p={};Object.assign(p,n,a);for(const[e,t]of Object.entries(p))if(Array.isArray(t)){d.delete(e);for(const n of t)d.append(e,n)}else null==t||""===t?d.delete(e):d.set(e,t);("push"===t?r:o)(`?${d.toString()}${l?e.location.hash:""}`,u,s)}}let s;return{pushQuery:i("push"),replaceQuery:i("replace"),pushAnchor:function(t,n,o){r({...e.location,key:void 0,hash:t,state:{notify:!1,...n}},void 0,o)},reload:function(t){o({...e.location,state:{...e.location.state,notify:!0,noIncremental:!0}},void 0,t)},setBlockMessage:function(e){s=e},getBlockMessage:function(){return s},unblock:function(){s=void 0},...b({...e,push:r,replace:o})}}(e)),w=e}return w}const k=function(){const e=S();if(e)return e.getHistory}()||function(){return w};var I=n(4635),C=n(2559),R=n(6589),O=n(8256),T=n(7216),_=n(7933),P=n(5967),M=new WeakMap;const x=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,i.A)(this,M,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,a.A)(M,this).get(n);if(o||(o=new Map,(0,a.A)(M,this).set(n,o)),o.has(r))throw new Error(`Custom processor of "${e}" already registered`);o.set(r,t)}get(e){return(0,a.A)(M,this).get(e)}};function L(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=$("app",t.id),r=[];return Object.entries(n.i18n).forEach((t=>{let[n,o]=t;c.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)c.i18n.removeResourceBundle(t,e)}}}function $(e,t){return`${e}/${t}`}function B(e){return c.i18n.getFixedT(null,$("widget",e))}const N=function(){const e=S();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=$("widget",e);Object.entries(t).forEach((e=>{let[t,r]=e;c.i18n.addResourceBundle(t,n,r)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",D="devtools-panel-change";let j,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||j&&"Evaluations"!==j))return;const r=()=>{var r;null===(r=n.emit)||void 0===r||r.call(n,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(r):setTimeout(r,0)}function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}const H=()=>{throw new Error("Can't modify read-only proxy object")},z={set:H,defineProperty:H,deleteProperty:H,setPrototypeOf:H};function G(e){return new Proxy(e,z)}function q(e){let{get:t,ownKeys:n}=e;return W()?G(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let Y="light";const X=new u.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);Y=e}function Z(){return Y}function ee(){return document.documentElement.dataset.theme}function te(e){e?Q(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){X.setItem(J,{...re(),...e})}function re(){var e;let t;try{t=X.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}let oe="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);oe=e}function se(){return document.documentElement.dataset.mode}function ae(e){e?ie(e):e=oe,e!==se()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return n&&(null===(t=window.getComputedStyle(n))||void 0===t?void 0:t.getPropertyValue(e))||""}function le(e,t){const n={};for(const r of e){const e=ue(r,t);void 0!==e&&(n[r]=e)}return n}function ue(e,t){var n,r,o;let{collectCoverage:i,widgetId:s,widgetVersion:a,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return i?"/next":f().replace(/\/$/,"");case"FN":return d;case"IMG":return i?{get:e=>`mock/images/${e}`}:s?null==vi||null===(n=vi.images)||void 0===n?void 0:n.widgetImagesFactory(s,a):null==vi||null===(r=vi.images)||void 0===r?void 0:r.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return i?h.identity:s?B(s):c.i18n.getFixedT(null,[u,$("app",l.id)].filter(Boolean));case"I18N_TEXT":return i?de:c.i18nText;case"PERMISSIONS":return G({check:i?pe:null==vi||null===(o=vi.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return G({getTheme:i?()=>"light":Z,getCssPropertyValue:i?()=>"":ce});case"console":return p?G(console):void 0;case"location":return i?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function de(e){return null==e?void 0:e.en}function pe(){return!0}function fe(){let{widgetId:e,widgetVersion:t,collectCoverage:n,debuggerOverrides:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=new Map,i=null==r?void 0:r({precookFunction:O.precookFunction,cook:O.cook,supply:P.supply}),s=new Proxy(Object.freeze({}),{get:(e,t)=>function(e){const t=o.get(e);if(!t)return;if(t.processed)return t.cooked;let s;n&&(s=n.createCollector(e));const a=!i&&!s&&t.transformed;if(a){const e=c(a.globals);t.cooked=new Function(...a.globals,`"use strict";return (${a.source})`)(...a.globals.map((t=>(0,u.hasOwnProperty)(e,t)?e[t]:void 0)))}else{const e=(0,O.precookFunction)(t.source,{typescript:t.typescript,hooks:s&&{beforeVisit:s.beforeVisit},cacheKey:t}),n=c(e.attemptToVisitGlobals);t.cooked=(0,O.cook)(e.function,t.source,{rules:{noVar:!0},globalVariables:i?{...n,...null!=i&&i.LodashWithStaticFields&&e.attemptToVisitGlobals.has("_")?{_:{...n._,...i.LodashWithStaticFields}}:null,...null!=i&&i.ArrayConstructor&&e.attemptToVisitGlobals.has("Array")?{Array:i.ArrayConstructor}:null,...null!=i&&i.ObjectWithStaticFields&&e.attemptToVisitGlobals.has("Object")?{Object:{...n.Object,...i.ObjectWithStaticFields}}:null}:n,ArrayConstructor:null==i?void 0:i.ArrayConstructor,hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch},debug:!!r})}return t.processed=!0,t.cooked}(t)});let a;function c(r){return(0,P.supply)(r,le(r,{collectCoverage:n,widgetId:e,widgetVersion:t,app:a,storyboardFunctions:s,isStoryboardFunction:!0}),!!n)}return{storyboardFunctions:s,registerStoryboardFunctions:function(e,t){if(t&&(a=t),o.clear(),Array.isArray(e))for(const t of e){var r;let e=t.deps;null==e&&(e=(0,T.collectMemberUsageInFunction)(t,"FN",!!n),e.delete(t.name));const i=null!==(r=t.perm)&&void 0!==r?r:(0,T.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");o.set(t.name,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:e,hasPermissionsCheck:i})}},updateStoryboardFunction(e,t){const n={...t,name:e},r=(0,T.collectMemberUsageInFunction)(n,"FN",!0),i=(0,T.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:r,hasPermissionsCheck:i})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const r=o.get(e);return!!r&&(r.hasPermissionsCheck||[...r.deps].some(n))}return!1};return e.some(n)},clearGlobalExecutionContextStack(){(0,O.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,O.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:he,registerStoryboardFunctions:ve,checkPermissionsUsage:me}=fe();var ge={};try{ge.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,r=e.defineProperty,o=i.prototype;function i(){t.set(this,n(null))}function s(e,t,n){r(e,t,{configurable:!0,writable:!0,value:n})}function a(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}s(o,"addEventListener",(function(e,n,r){for(var o=t.get(this),i=o[e]||(o[e]=[]),s=0,a=i.length;s<a;s++)if(i[s].listener===n)return;i.push({target:this,listener:n,options:r})})),s(o,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(s(e,"target",this),s(e,"currentTarget",this),n.slice(0).some(a,e),delete e.currentTarget,delete e.target),!0})),s(o,"removeEventListener",(function(e,n){for(var r=t.get(this),o=r[e]||(r[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===n)return void o.splice(i,1)})),ge.EventTarget=i}(Object,new WeakMap)}const we=ge.EventTarget;let ye=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const Ee=new Map([[ye.xLarge,"1920px"],[ye.large,"1600px"],[ye.medium,"1280px"],[ye.small,"1024px"],[ye.xSmall,0]]),be=new we,Se={},Ae={};function ke(e,t){let n=!1;Se[t]=e.matches;for(const[e]of Ee)if(Se[e]&&Ae.breakpoint!==e){Ae.breakpoint=e,n=!0;break}n&&be.dispatchEvent(new CustomEvent("change",{detail:Ae}))}Ee.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);ke(n,t),n.addEventListener?n.addEventListener("change",(e=>{ke(e,t)})):n.addListener((e=>{ke(e,t)}))}));const Ie=()=>Ae;function Ce(e){return function(t){var n;const r="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(n=r.getItem(t))&&void 0!==n?n:"null")}}function Re(e){var t,n;return!(null===(t=e?e.flags:null===(n=gi())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Oe(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];const i=0===r.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${i}`,...r):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${i}`,...r)}const Te=new Set(["prefix"]);var _e=new WeakMap;const Pe=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,i.A)(this,_e,new Map)}define(e,t){var n,r,o,i;let s=(0,a.A)(_e,this).has(e);s?console.warn(`Custom template of "${e}" already registered.`):(s=!!customElements.get(e),s&&console.warn(`Custom template of "${e}" already defined by customElements.`));const c=Re(),l=null!==(n=null===(r=t.proxy)||void 0===r?void 0:r.properties)&&void 0!==n?n:{},u=[],d=[];for(const[t,n]of Object.entries(l))n.asVariable?(Oe(c,"Template `asVariable`",e,t),c||d.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&u.push([t,n]);const p={...t,proxy:{...t.proxy,properties:Object.fromEntries(u)},state:(t.state?c?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(d.map((e=>({name:e,expose:!0}))))};(0,a.A)(_e,this).set(e,{...p,name:e});const f=(v=p.state,(0,h.uniq)(null!==(m=null==v?void 0:v.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==m?m:[]));var v,m;const g=Object.entries(null!==(o=null===(i=p.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),w=f.concat(u.map((e=>e[0]))),y=g.map((e=>e[0])),E=w.concat(y).filter((e=>e in HTMLElement.prototype&&!Te.has(e)));if(E.length>0&&(Oe(c,"Using native HTMLElement properties as template properties or methods",e,...E),c))throw new Error(`In custom template "${e}", ${E.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!s){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return w}static get _dev_only_definedMethods(){return y}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){let e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));const t=document.createDocumentFragment(),n=document.createElement("style");n.textContent=":host{display:block}:host([hidden]){display:none}";const r=document.createElement("slot");t.appendChild(n),t.appendChild(r),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}for(const n of f)u.some((e=>e[0]===n))?console.error(`Cannot define an exposed state that is also a proxy property: "${n}" in ${e}`):Object.defineProperty(t.prototype,n,{get(){return this.$$tplStateStore.getValue(n)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(n,e,"replace")},enumerable:!0});for(const[e,n]of u)Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refProperty)&&void 0!==t?t:e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);var i;o&&(o[null!==(i=n.refProperty)&&void 0!==i?i:e]=t)},enumerable:!0});for(const[e,n]of g)Object.defineProperty(t.prototype,e,{value(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,a.A)(_e,this).get(e)}};function Me(e,t,n){let{tplStateStoreId:r,tplStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of a custom template${null!=n?n:""}`);const i=o.get(r);if(!i)throw new Error(`Template state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return i}function xe(e,t,n){const r=Me(e,t,n).hostBrick.element;if(!r)throw new Error(`Template host element is gone when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return r}const Le=new Map,$e=new Proxy(Object.freeze({}),{get:(e,t)=>Le.get(t)}),Be=function(){const e=S();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Le.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=fe({widgetId:e,widgetVersion:n});Le.set(e,r),o(t)},Ne=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ue=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(Ne);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Fe=e=>"*"===e||"x"===e||"X"===e,De=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},je=(e,t)=>{if(Fe(e)||Fe(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(De(e),De(t));return n>r?1:n<r?-1:0},Ke=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=je(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},Ve=(e,t,n)=>{ze(n);const r=((e,t)=>{const n=Ue(e),r=Ue(t),o=n.pop(),i=r.pop(),s=Ke(n,r);return 0!==s?s:o&&i?Ke(o.split("."),i.split(".")):o||i?o?-1:1:0})(e,t);return We[n].includes(r)},We={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},He=Object.keys(We),ze=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===He.indexOf(e))throw new Error(`Invalid operator, expected one of ${He.join("|")}`)};function Ge(e,t){let n=Ci(e);if(!n&&null!=vi&&vi.checkInstalledApps&&(n=vi.checkInstalledApps.getCheckedApp(e)),!n||"running"===n.installStatus)return!1;if(!t||!n.currentVersion)return!0;const r=t.match(/^([><]=?|=)(.*)$/);try{if(!r)throw new TypeError(`Invalid match version: ${t}`);return Ve(n.currentVersion,r[2],r[1])}catch(e){console.error(e)}return!1}function qe(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${null!=n?n:""}`);const i=o.get(r);if(!i)throw new Error(`Form state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return i}const Ye=new Map;async function Xe(e){var t;const n=null==vi||null===(t=vi.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=vi.flowApi.FLOW_API_PROVIDER);let r=Ye.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)vi.flowApi.registerFlowApiProvider();else if(await(0,l.loadBricksImperatively)([e],bi()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return r=document.createElement(e),Ye.set(e,r),r}let Je=new WeakSet;function Qe(e){if((0,u.isObject)(e)&&!Ze(e))if(Je.add(e),Array.isArray(e))e.forEach(Qe);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Qe)}}function Ze(e){return Je.has(e)}const et=new Map;async function tt(e,t,n){const{useProvider:r,method:o="resolve",args:i=[],onReject:s}=e,{provider:a,field:c}=e;if(a&&!r)throw new Error(`You're using "provider: ${a}" which is dropped in v3, please use "useProvider" instead`);const l=null!=c;if(l){const e=Re();if(Oe(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const[u,d]=await Promise.all([Xe(r),vt(i,t)]),p=null==n?void 0:n.renderId,f=nt(u,r,o,d,n,i,!!p&&p!==Ai());let v,{transform:m}=e;try{const e=await f;v=l?(0,h.get)(e,c):e,Qe(v)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;m=s.transform,v=e}return m?"string"==typeof m?{[m]:v}:vt(m,{...t,data:v}):v}async function nt(e,t,n,r,o,i,s){let a,c;try{a=JSON.stringify({useProvider:t,method:n,args:r})}catch(e){if(!i)throw e;a=JSON.stringify({useProvider:t,method:n,originalArgs:i})}return"reload"!==(null==o?void 0:o.cache)&&(c=et.get(a)),c||(c=(async o=>{const i=null!=vi&&null!==(o=vi.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await vi.flowApi.getArgsOfFlowApi(t,r,n):r;return e[n](...i)})(),s||et.set(a,c)),c}const rt=Symbol.for("pre.evaluated.raw"),ot=Symbol.for("pre.evaluated.context");function it(e){return!(null==e||!e[rt])}function st(e){return e[rt]}function at(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[rt])}const ct=new WeakSet([SyntaxError,TypeError,ReferenceError]);function lt(e){return ct.has(e.constructor)?e.constructor:TypeError}function ut(e,t,n){const{run:r}=dt(e,t,n,!1);return r()}function dt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const o=[];if("string"!=typeof e){const n=(0,h.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[ot],...n},e=e[rt]}const i={usedArgs:new Set},s={usedArgs:new Set};let a;try{a=(0,O.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,T.collectAppGetMenuUsage)(i,e,t),(0,T.collectInstalledAppsHasUsage)(s,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}if(i.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(s.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const c={},{attemptToVisitGlobals:d}=a;if(n.lazy||d.has("EVENT")&&!(0,u.hasOwnProperty)(t,"event")||d.has("DATA")&&!(0,u.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[rt]:e,[ot]:t}:e};let p,f,v,m;const g=Re(t);let w,y;(d.has("STATE")||!g&&d.has("TPL"))&&(m=Me(t,"STATE",`: "${e}"`)),d.has("FORM_STATE")&&(y=qe(t,"FORM_STATE",`: "${e}"`));const E=W();if(r||E){if(d.has("CTX")&&(p=(0,T.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(p))),m){if(v=(0,T.strictCollectMemberUsage)(e,"STATE"),!g){const t=(0,T.strictCollectMemberUsage)(e,"TPL");for(const e of t)v.add(e)}r&&o.push(m.waitFor(v))}y&&(w=(0,T.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(y.waitFor(w))),d.has("PROCESSORS")&&(f=(0,T.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,l.loadProcessorsImperatively)(f,bi())))}if(r){let n=d.has("PERMISSIONS");if(!n&&d.has("FN")){const t=[...(0,T.strictCollectMemberUsage)(e,"FN")];n=me(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),i.usedArgs.size>0&&null!=vi&&vi.menu){const e=[...i.usedArgs];o.push(Promise.all(e.map((e=>vi.menu.fetchMenuById(e,t,{getStoryboardByAppId:Ii,resolveData:tt,asyncComputeRealValue:vt})))))}var b;s.usedArgs.size>0&&o.push(null==vi||null===(b=vi.checkInstalledApps)||void 0===b?void 0:b.waitForCheckingApps([...s.usedArgs]))}return{blockingList:o,run(){var n,r,o,i;const{app:s,location:l,query:E,match:b,flags:S,sys:A,ctxStore:k,data:I,event:C}=t,R=null!==(n=t.overrideApp)&&void 0!==n?n:s;for(const n of d)switch(n){case"ANCHOR":c[n]=l.hash?l.hash.substring(1):null;break;case"APP":if(null==R)throw new ReferenceError(`APP is not defined, in "${e}"`);c[n]={...(0,h.cloneDeep)(R),getMenu:null==vi||null===(r=vi.menu)||void 0===r?void 0:r.getMenuById};break;case"CTX":c[n]=q({get:(e,t)=>k.getValue(t),ownKeys:()=>Array.from(p)});break;case"DATA":c[n]=I;break;case"EVENT":c[n]=C;break;case"FLAGS":c[n]=G(S);break;case"FORM_STATE":c[n]=q({get:(e,t)=>y.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":c[n]=l.hash;break;case"INSTALLED_APPS":c[n]=G({has:Ge});break;case"ITEM":case"INDEX":case"SIZE":{const r="ITEM"===n?"forEachItem":"INDEX"===n?"forEachIndex":"forEachSize";(0,u.hasOwnProperty)(t,r)?c[n]=t[r]:console.error(`Using \`${n}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[n]=G({getItem:Ce("local")});break;case"MEDIA":c[n]=G(Ie());break;case"MISC":c[n]=gi().getMiscSettings();break;case"PARAMS":if(null==E)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[n]=new URLSearchParams(E);break;case"PATH":c[n]=G(null!==(o=null==b?void 0:b.params)&&void 0!==o?o:{});break;case"PATH_NAME":c[n]=l.pathname;break;case"PROCESSORS":c[n]=q({get(e,t){const n=x.get(t);if(!n)throw new Error(`'PROCESSORS.${t}' is not registered! Have you installed the relevant brick package?`);return q({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of f){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==E)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[n]=Object.fromEntries(Array.from(E.keys()).map((e=>[e,E.get(e)])));break;case"QUERY_ARRAY":if(null==E)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[n]=Object.fromEntries(Array.from(E.keys()).map((e=>[e,E.getAll(e)])));break;case"SESSION_STORAGE":c[n]=G({getItem:Ce("session")});break;case"TPL":if(Oe(g,'Using "TPL" in expression',`check your expression: "${e}"`),g)break;case"STATE":c[n]=q({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(v)});break;case"SYS":c[n]=G(null!=A?A:{});break;case"__WIDGET_FN__":c[n]=$e;break;case"__WIDGET_IMG__":c[n]=null==vi||null===(i=vi.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":c[n]=B}Object.assign(c,le(a.attemptToVisitGlobals,{storyboardFunctions:he,app:R,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,O.cook)(a.expression,a.source,{globalVariables:(0,P.supply)(a.attemptToVisitGlobals,c)});return V("evaluation",{raw:e,context:c,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}}}}let pt=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function ft(e){switch(e){case pt.USE_BRICK_PROPERTIES:case pt.USE_BRICK_TRANSFORM:case pt.USE_BRICK_EVENTS:case pt.USE_BRICK_IF:case pt.USE_BRICK_LIFECYCLE:case pt.USE_BRICK_DATA_SOURCE:return!0}return!1}function ht(e,t,n){if(ft(e))return e;if(t)switch(e){case pt.USE_BRICK:return pt.USE_BRICK_ITEM;case pt.USE_BRICK_SLOTS_ITEM_BRICKS:return pt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case pt.INITIAL:if("useBrick"===n)return pt.USE_BRICK;break;case pt.USE_BRICK:case pt.USE_BRICK_ITEM:case pt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return pt.USE_BRICK_PROPERTIES;case"transform":return pt.USE_BRICK_TRANSFORM;case"dataSource":return pt.USE_BRICK_DATA_SOURCE;case"events":return pt.USE_BRICK_EVENTS;case"slots":return pt.USE_BRICK_SLOTS;case"children":return pt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return pt.USE_BRICK_IF;case"lifeCycle":return pt.USE_BRICK_LIFECYCLE}break;case pt.USE_BRICK_SLOTS:return pt.USE_BRICK_SLOTS_ITEM;case pt.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return pt.USE_BRICK_SLOTS_ITEM_BRICKS}return pt.INITIAL}async function vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=it(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&ft(n.$$stateOfUseBrick);let i,s=o;return r||(0,O.isEvaluable)(e)?(i=await async function(e,t,n){const{blockingList:r,run:o}=dt(e,t,n,!0);return await Promise.all(r),o()}(e,t,{lazy:o}),s=at(e)):i=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?wt:_.inject)(e,t),s||Qe(i),i}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=gt(n,!0);return Promise.all(e.map((e=>vt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([vt(r,t),vt(o,t,gt(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=it(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&ft(n.$$stateOfUseBrick);let i,s=o;return r||(0,O.isEvaluable)(e)?(i=ut(e,t),s=at(e)):i=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?wt:_.inject)(e,t),s||Qe(i),i}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=gt(n,!0);return e.map((e=>mt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[mt(r,t),mt(o,t,gt(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function gt(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:ht(e.$$stateOfUseBrick,t,n)}:e}function wt(e){return e}async function yt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?await vt(e.if,t):e.if)}function Et(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?mt(e.if,t):e.if)}function bt(e){return!(0,u.hasOwnProperty)(e,"if")||!!e.if}const St=function(){const e=S();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Et(e,{data:t})};function At(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,O.isEvaluable)(e):it(e)){const o="string"==typeof e?e:st(e);if((0,O.isTrackAll)(o)){const e=(0,T.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,T.track)(o,"track context","CTX"),n=(0,T.track)(o,"track state","STATE"),r=(0,T.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:r}}async function kt(e,t){for(const[n,r,o]of e)if(n===t){const e=await r;if(void 0!==e||!o)return e}}async function It(e){const t={};for(const[n,r,o]of e){const e=await r;void 0===e&&o||!("style"!==n&&"dataset"!==n||(0,u.isObject)(e))||(t[n]=e)}return t}function Ct(e,t){if(t)for(const[n,r]of Object.entries(t))switch(n){case"style":case"dataset":for(const[t,o]of Object.entries(r))e[n][t]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error(`set \`${n}\` is prohibited`);default:e[n]=r}}function Rt(e,t,n){const r=function(e,t){return(0,u.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=mt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?pt.USE_BRICK:pt.INITIAL});if("style"!==n&&"dataset"!==n||(0,u.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ct(e,r)}))}function Ot(e,t,n){if(n)for(const{contextNames:r,stateNames:o,propValue:i}of t){if(r)for(const t of r)n.disposes.push(e.ctxStore.onChange(t,n.listener));if(o)for(const t of o){const r=Me(e,"STATE",`: "${i}"`);n.disposes.push(r.onChange(t,n.listener))}}}function Tt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _t(e){return e&&e.sensitive?"":"i"}function Pt(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var r=n.strict,o=void 0!==r&&r,i=n.start,s=void 0===i||i,a=n.end,c=void 0===a||a,l=n.encode,u=void 0===l?function(e){return e}:l,d=n.delimiter,p=void 0===d?"/#?":d,f=n.endsWith,h="[".concat(Tt(void 0===f?"":f),"]|$"),v="[".concat(Tt(p),"]"),m=s?"^":"",g=0,w=e;g<w.length;g++){var y=w[g];if("string"==typeof y)m+=Tt(u(y));else{var E=Tt(u(y.prefix)),b=Tt(u(y.suffix));if(y.pattern)if(t&&t.push(y),E||b)if("+"===y.modifier||"*"===y.modifier){var S="*"===y.modifier?"?":"";m+="(?:".concat(E,"((?:").concat(y.pattern,")(?:").concat(b).concat(E,"(?:").concat(y.pattern,"))*)").concat(b,")").concat(S)}else m+="(?:".concat(E,"(").concat(y.pattern,")").concat(b,")").concat(y.modifier);else{if("+"===y.modifier||"*"===y.modifier)throw new TypeError('Can not repeat "'.concat(y.name,'" without a prefix and suffix'));m+="(".concat(y.pattern,")").concat(y.modifier)}else m+="(?:".concat(E).concat(b,")").concat(y.modifier)}}if(c)o||(m+="".concat(v,"?")),m+=n.endsWith?"(?=".concat(h,")"):"$";else{var A=e[e.length-1],k="string"==typeof A?v.indexOf(A[A.length-1])>-1:void 0===A;o||(m+="(?:".concat(v,"(?=").concat(h,"))?")),k||(m+="(?=".concat(v,"|").concat(h,")"))}return new RegExp(m,_t(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));i+=e[a++]}else i+=e[a++]+e[a++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<e.length;){var c=e.charCodeAt(a);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i=t.delimiter,s=void 0===i?"/#?":i,a=[],c=0,l=0,u="",d=function(e){if(l<n.length&&n[l].type===e)return n[l++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var r=n[l],o=r.type,i=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(i,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},h=function(e){var t=a[a.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=s;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1}(n)?"[^".concat(Tt(s),"]+?"):"(?:(?!".concat(Tt(n),")[^").concat(Tt(s),"])+?")};l<n.length;){var v=d("CHAR"),m=d("NAME"),g=d("PATTERN");if(m||g){var w=v||"";-1===o.indexOf(w)&&(u+=w,w=""),u&&(a.push(u),u=""),a.push({name:m||c++,prefix:w,suffix:"",pattern:g||h(w),modifier:d("MODIFIER")||""})}else{var y=v||d("ESCAPED_CHAR");if(y)u+=y;else if(u&&(a.push(u),u=""),d("OPEN")){w=f();var E=d("NAME")||"",b=d("PATTERN")||"",S=f();p("CLOSE"),a.push({name:E||(b?c++:""),pattern:E&&!b?h(w):b,prefix:w,suffix:S,modifier:d("MODIFIER")||""})}else p("END")}}return a}(e,n),t,n)}function Mt(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return Mt(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),_t(n))}(e,t,n):Pt(e,t,n)}const xt=new Map,Lt=1e4;let $t=0;function Bt(e,t){const{path:n,exact:r=!1,strict:o=!1,sensitive:i=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:s,keys:a}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let r=xt.get(n);r||xt.set(n,r=new Map);const o=r.get(e);if(o)return o;const i=[],s={regexp:Mt(e,i,t),keys:i};return $t<Lt&&(r.set(e,s),$t++),s}(n,{end:r,strict:o,sensitive:i}),c=s.exec(e);if(!c)return null;const[l,...u]=c,d=e===l;return r&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function Nt(e,t,n){return Bt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Ut=Symbol.for("tpl.asyncComputedPropsFromHost"),Ft=Symbol.for("tpl.stateStoreId"),Dt=Symbol.for("tpl.externalForEachItem"),jt=Symbol.for("tpl.externalForEachIndex"),Kt=Symbol.for("tpl.externalForEachSize"),Vt=new Set;let Wt=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e.LICENSE_EXPIRED="LICENSE_EXPIRED",e.NO_PERMISSION="NO_PERMISSION",e.PAGE_NOT_FOUND="PAGE_NOT_FOUND",e.APP_NOT_FOUND="APP_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.GO_BACK_TO_PREVIOUS_PAGE="GO_BACK_TO_PREVIOUS_PAGE",e.GO_BACK_HOME="GO_BACK_HOME",e.RELOAD="RELOAD",e}({});const Ht={[Wt.REQUEST_FAILED]:"Request Failed",[Wt.SOMETHING_WENT_WRONG]:"Something went wrong!",[Wt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[Wt.NETWORK_ERROR]:"Network error, please check your network.",[Wt.LICENSE_EXPIRED]:"The license authorization has expired, please contact the platform administrator",[Wt.NO_PERMISSION]:"Unauthorized access, unable to retrieve the required resources for this page",[Wt.PAGE_NOT_FOUND]:"Page not found, please check the URL",[Wt.APP_NOT_FOUND]:"App not found, maybe the URL is wrong or you don't have permission to access",[Wt.UNKNOWN_ERROR]:"Oops! Something went wrong",[Wt.GO_BACK_TO_PREVIOUS_PAGE]:"Go back to previous page",[Wt.GO_BACK_HOME]:"Go back to home page",[Wt.RELOAD]:"Reload"},zt={[Wt.REQUEST_FAILED]:"请求失败",[Wt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[Wt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[Wt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。",[Wt.LICENSE_EXPIRED]:"License 授权失效,请联系平台管理员",[Wt.NO_PERMISSION]:"没有权限,无法获取页面所需要的资源",[Wt.PAGE_NOT_FOUND]:"请求的页面未找到,请确认 URL 是否正确",[Wt.APP_NOT_FOUND]:"请求的微应用无法找到, 可能是 URL 错误或者无权限访问",[Wt.UNKNOWN_ERROR]:"糟糕!页面出现了一些问题",[Wt.GO_BACK_TO_PREVIOUS_PAGE]:"回到上一页",[Wt.GO_BACK_HOME]:"回到首页",[Wt.RELOAD]:"刷新"},Gt="core/runtime",qt={en:Ht,zh:zt};let Yt;const Xt=Object.freeze({show:function(e){if(Yt)return Yt.resolve(e);if("confirm"===e.type){const t=confirm(e.content);return new Promise(((e,n)=>setTimeout((()=>{(t?e:n)()}),1)))}return alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1)))}});function Jt(e){const{search:t,pathname:n}=e,r=n?window.btoa(encodeURIComponent(n)):"",o=t?window.btoa(encodeURIComponent(t)):"";document.cookie=`SALOGINPATH=${r}; path=/`,document.cookie=`SALOGINQUERY=${o}; path=/`}function Qt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return c.i18n.t(`${Gt}:${Wt.NETWORK_ERROR}`);if(e instanceof R.HttpResponseError&&e.responseJson){if("string"==typeof e.responseJson.error)return e.responseJson.error;if("string"==typeof e.responseJson.msg)return e.responseJson.msg}return null==e?"Unknown error":e.toString()}function Zt(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let en,tn,nn=!1;function rn(e){if(e instanceof R.HttpAbortError)return;if(Zt(e)&&!window.NO_AUTH_GUARD){if(nn)return;return nn=!0,void Xt.show({type:"confirm",content:c.i18n.t(`${Gt}:${Wt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=gi().getFeatureFlags()["sso-enabled"],t=k();Jt(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),nn=!1}),(()=>{nn=!1}))}console.error(e);const t=Qt(e);t!==en&&(en=t,Xt.show({type:"error",title:c.i18n.t(`${Gt}:${Wt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{en=void 0})))}const on=Object.freeze({show:function(e){tn?tn.resolve(e):alert(e.message)}});function sn(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const i=dn(o,n,{element:e});e.addEventListener(r,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([r,i]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(o))e.$$eventListeners.push([r,null,t])}))}function an(e){return"string"==typeof e.action}function cn(e){return"string"==typeof e.useProvider}function ln(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function un(e){return!!e.then}function dn(e,t,n){return function(r){var o,i;for(const s of[].concat(e))if(Et(s,{...t,event:r}))if(un(s))dn(s.then,t,n)(r);else if(an(s)){const[e,a]=s.action.split(".");switch(s.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":vn(r,a,s.args,s.callback,t);break;case"window.open":mn(r,s.args,t);break;case"window.postMessage":gn(r,s.args,t);break;case"parent.postMessage":wn(r,s.args,t);break;case"location.reload":case"location.assign":An(r,a,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":kn(r,e,a,s.args,t);break;case"event.preventDefault":r.preventDefault();break;case"event.stopPropagation":r.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":In(r,a,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Cn(r,a,s.args,t);break;case"handleHttpError":rn(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":En(r,a,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":bn(r,a,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=Tn(s.args,t,r);xe(t,s.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":Sn(r,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Rn(r,a,s.args,t,n,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":{const[e]=Tn(s.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":ae("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else cn(s)?pn(r,s,t,n):ln(s)?fn(r,s,t,n):console.error("unknown event handler:",s);else s.else&&dn(s.else,t,n)(r)}}function pn(e,t,n,r){const o="saveAs"!==t.method?"resolve":"saveAs";hn(e,t.useProvider,t,o,n,r)}function fn(e,t,n,r){let o=[];const i=t.target,s=t.targetRef;let a=i;if(("string"==typeof i?(0,O.isEvaluable)(i):it(i))&&(a=mt(i,{...n,event:e})),"string"==typeof a)if("_self"===a)o.push(r.element);else if(t.multiple)o=Array.from(document.querySelectorAll(a));else{const e=document.querySelector(a);null!==e&&o.push(e)}else if(a)a instanceof HTMLElement?o.push(a):console.error("unexpected target:",a);else if(s){let t=s;("string"==typeof s?(0,O.isEvaluable)(s):it(s))&&(t=mt(s,{...n,event:e}));const r=[].concat(t),i=xe(n,"targetRef",`: ${r.join(", ")}`);o.push(...r.map((e=>{var t;return null===(t=i.$$getElementByRef)||void 0===t?void 0:t.call(i,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((o=>{hn(e,o,t,t.method,n,r,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Rt(o,t.properties,{...n,event:e}):console.error("target not found:",i||s)}async function hn(e,t,n,r,o,i,s){const a=cn(n),c=async()=>{var i;const c=a?await Xe(t):t;if("function"!=typeof c[r])throw new Error(`target <${c.tagName.toLowerCase()}> has no method: ${r}`);let l=Tn(n.args,o,e,s);var u;return cn(n)&&null!=vi&&null!==(i=vi.flowApi)&&void 0!==i&&i.isFlowApiProvider(n.useProvider)&&(l=await vi.flowApi.getArgsOfFlowApi(n.useProvider,l,r,null===(u=n.sse)||void 0===u?void 0:u.stream)),c[r](...l)};if(!n.callback)return void c();const l=On(n.callback,o,i),u={progress:l("progress"),success:l("success"),error:l("error"),finally:l("finally")};if(a){var d,p;const t={...o,event:e};if(mt(null===(d=n.sse)||void 0===d?void 0:d.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:i}=t;const s=Ai();try{const t=await e();for await(const e of t){if(s!==Ai())return;null==n||n(e)}if(s!==Ai())return;null==r||r()}catch(e){if(s!==Ai())return;null==o||o(e)}finally{null==i||i()}}(c,u);if(mt(null===(p=n.poll)||void 0===p?void 0:p.enabled,t))return void function(e,t,n,r){let{progress:o,success:i,error:s,finally:a}=t;const{expectPollStopImmediately:c,expectPollEnd:l}=n,{interval:u,leadingRequestDelay:d,continueOnError:p,delegateLoadingBar:f}=mt((0,h.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),v=Ai();let m;async function g(){let t;Vt.delete(m);try{var n;if(t=null===(n=mt(c,r))||void 0===n?void 0:n(),t)null==a||a();else{var d;const n=await e(),s=null===(d=mt(c,r))||void 0===d?void 0:d();var h;t=s||v!==Ai(),t?s&&(null==a||a()):(null==o||o(n),null!==(h=mt(l,r))&&void 0!==h&&h(n)?(f&&window.dispatchEvent(new Event("request.end")),null==i||i(n),null==a||a()):w(null!=u?u:3e3))}}catch(e){var g;const n=null===(g=mt(c,r))||void 0===g?void 0:g();t=n||v!==Ai(),t?n&&(null==a||a()):(null==s||s(e),p?w(null!=u?u:3e3):null==a||a())}finally{f&&t&&window.dispatchEvent(new Event("request.end"))}}function w(e){m=setTimeout(g,e),Vt.add(m)}w(null!=d?d:0),f&&window.dispatchEvent(new Event("request.start"))}(c,u,n.poll,t)}try{const e=await c();u.success(e)}catch(e){u.error(e)}finally{u.finally()}}function vn(e,t,n,r,o){let i=0,s=!1,a=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,s=!0;break;case"reload":s=!0;break;case"block":i=1,a="setBlockMessage"}let c=[];if(i>0&&(c=Tn(n,o,e,{useEventDetailAsDefault:!0}),c.length=i),s&&r){const e=On(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}k()[a](...c)}function mn(e,t,n){const[r,o,i]=Tn(t,n,e);window.open(r,o||"_self",i)}function gn(e,t,n){const r=Tn(t,n,e);1===r.length&&r.push(location.origin),window.postMessage(...r)}function wn(e,t,n){if(parent===window)throw new Error("parent is the window itself");const r=Tn(t,n,e);parent.postMessage(...r)}function yn(e,t,n,r,o,i){t?r.updateValues(e,n,(e=>Tn(e,o,i)[0])):e.forEach((e=>{const{name:t,value:s}=Tn([e],o,i)[0];r.updateValue(t,s,n)}))}function En(e,t,n,r,o,i){if(!Array.isArray(n)||!n.every(u.isObject)||"assign"!==t&&"replace"!==t){const[r,s]=Tn(n,i,e);i.ctxStore.updateValue(r,s,t,o,i)}else yn(n,r,t,i.ctxStore,i,e)}function bn(e,t,n,r,o,i){if(Array.isArray(n)&&n.every(u.isObject)&&"update"===t)yn(n,r,"replace",Me(i,`state.${t}`,`: ${JSON.stringify(n)}`),i,e);else{const[r,s]=Tn(n,i,e);Me(i,`state.${t}`,`: ${r}`).updateValue(r,s,"update"===t?"replace":t,o,i)}}function Sn(e,t,n,r){const[o,i]=Tn(t,r,e);qe(r,"formstate.update",`: ${o}`).updateValue(o,i,"replace",n,r)}function An(e,t,n,r){if("assign"===t){const[t]=Tn(n,r,e);location.assign(t)}else location[t]()}function kn(e,t,n,r,o){const i="localStorage"===t?localStorage:sessionStorage,[s,a]=Tn(r,o,e);"setItem"===n?void 0!==a&&i.setItem(s,JSON.stringify(a)):i.removeItem(s)}function In(e,t,n,r){console[t](...Tn(n,r,e,{useEventAsDefault:!0}))}function Cn(e,t,n,r){const o=Tn(n,r,e,{useEventAsDefault:!0});on.show({type:t,message:o[0]})}async function Rn(e,t,n,r,o,i){const s=()=>{var o;const i=Tn(n,r,e);return null==vi||null===(o=vi.messageDispatcher)||void 0===o?void 0:o[t](...i)};if(!i)return void s();const a=On(i,r,o);try{const e=await s();a("success")(e)}catch(e){a("error")(e)}finally{a("finally")()}}function On(e,t,n){return function(r){return function(o){const i=null==e?void 0:e[r];if(i)try{const e=new CustomEvent(`callback.${r}`,{detail:o});dn(i,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function Tn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?mt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function _n(e){var t;const{ref:n,runtimeContext:r,element:o}=e;if(!n||!r.tplStateStoreId)return;const{hostBrick:i}=Me(r,"bindTemplateProxy"),s=i.tplHostMetadata;s.internalBricksByRef.set(n,e);const a=null===(t=s.proxy)||void 0===t?void 0:t.events;if(a)for(const[e,t]of Object.entries(a))if(t.ref===n){var c,l,u;const n=t=>{t.bubbles&&t.stopPropagation(),i.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},r=null!==(c=t.refEvent)&&void 0!==c?c:e;o.addEventListener(r,n),null!==(u=(l=o).$$proxyListeners)&&void 0!==u||(l.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function Pn(e){const{ref:t,runtimeContext:n,element:r}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:o}=Me(n,"unbindTemplateProxy");o.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of null!==(i=r.$$proxyListeners)&&void 0!==i?i:[]){var i;r.removeEventListener(e,t)}delete r.$$proxyListeners}let Mn=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function xn(e){e.replaceChildren()}function Ln(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.tag===Mn.BRICK){var o;const i=n.type;i.includes("-")&&!customElements.get(i)&&console.error(`Undefined custom element: ${i}`),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const s=t&&n===e.child?t:document.createElement(i);n.element=s,n.slotId&&s.setAttribute("slot",n.slotId),n.iid&&(s.dataset.iid=n.iid),null!==(o=n.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(s.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),Ct(s,n.properties),sn(s,n.events,n.runtimeContext),n.tplHostMetadata&&(s.$$tplStateStore=Me({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),_n(n),n.portal?r.push(s):n.return&&(n.return.childElements||(n.return.childElements=[]),n.return.childElements.push(s))}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var i;let e=n.return;for(;e;){var s;if(e.childElements)e.tag===Mn.ROOT?null===(s=e.container)||void 0===s||s.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===Mn.ROOT&&r.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...r),e.sibling)break;e=e.return}n=null===(i=e)||void 0===i?void 0:i.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const $n=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Bn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var Nn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Kn=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,Hn=new WeakMap,zn=new WeakSet;class Gn{constructor(e,t){var n;(0,I.A)(this,zn),(0,o.A)(this,"scope",void 0),(0,o.A)(this,"unknownBricks",void 0),(0,o.A)(this,"renderId",void 0),(0,i.A)(this,Nn,void 0),(0,i.A)(this,Un,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,i.A)(this,Fn,new Map),(0,i.A)(this,Dn,void 0),(0,i.A)(this,jn,new Map),(0,i.A)(this,Kn,void 0),(0,i.A)(this,Vn,void 0),(0,i.A)(this,Wn,new WeakMap),(0,i.A)(this,Hn,new Map),this.scope=e,this.unknownBricks=null!==(n=null==t?void 0:t.unknownBricks)&&void 0!==n?n:"throw",(0,s.A)(Nn,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,s.A)(Vn,this,e)}memoizeMenuRequestNode(e,t){(0,a.A)(Wn,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,a.A)(Vn,this);for(;t;)if(t.request&&e.push(t.request),t.child)t=t.child;else{for(var n;t&&!t.sibling;)t=t.return;t=null===(n=t)||void 0===n?void 0:n.sibling}return e}async reMergeMenuRequestNodes(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(0,a.A)(Wn,this).get(t);(0,a.A)(Wn,this).set(t,n);let o,i=e.child;for(;i&&i!==r;)o=i,i=i.sibling;o?(o.sibling=n,n.sibling=null==r?void 0:r.sibling):e.child=n,await(0,a.A)(Nn,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,a.A)(Nn,this).bailout(e)}reCatch(e,t){return(0,a.A)(Nn,this).catch(e,t,!1,!0)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:i}of[...(0,a.A)(Hn,this).values()].reverse()){const s=o[o.length-1];if(r.includes(s))continue;const a=await i(e,t);a&&r.push(...o.slice(0,-1)),!1!==a&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,a.A)(Hn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[...$n,..."page"===this.scope?Bn:[]];for(const r of n){const n=t[r];n&&(0,a.A)(Un,this)[r].push({brick:e,handlers:n})}(0,h.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,a.A)(jn,this).get(e);n?n.add(t):(0,a.A)(jn,this).set(e,new Set([t]))}memoize(e,t,n,r){(0,a.A)(Kn,this)||(0,s.A)(Kn,this,new WeakMap);const o=[null!=e?e:"",...t].join(".");let i=(0,a.A)(Kn,this).get(r);i||(i=new Map,(0,a.A)(Kn,this).set(r,i)),i.set(o,{node:n,last:Qn(n),lastNormal:Zn(n),lastPortal:tr(n)})}reRender(e,t,n,r){const o=[null!=e?e:"",...t].join("."),i=(0,a.A)(Kn,this).get(r).get(o),{node:s,last:c,lastNormal:l,lastPortal:u}=i;let d;const p=[];if((null==s?void 0:s.tag)===Mn.PLACEHOLDER){var f,h,v;d=null!==(f=null===(h=function(e){return er(e,!0)}(s))||void 0===h?void 0:h.element)&&void 0!==f?f:null;const e=null===(v=function(e){return nr(e,!0)}(s))||void 0===v?void 0:v.element;e&&p.push(e)}else{var m,g,w;d=null!==(m=null==l||null===(g=l.element)||void 0===g?void 0:g.nextSibling)&&void 0!==m?m:null;let e=null==u||null===(w=u.element)||void 0===w?void 0:w.nextSibling;for(;e&&(p.push(e),e instanceof HTMLElement&&"DIV"===e.tagName);)e=e.nextSibling}const y=Qn(n);let E;i.node=n,i.last=y,i.lastNormal=Zn(n),i.lastPortal=tr(n);let b=r.child;for(;b&&b!==c;){if(b.sibling===s){E=b;break}b=b.sibling}const S=document.createDocumentFragment(),A=document.createDocumentFragment(),k={tag:Mn.ROOT,container:S,createPortal:A,child:n};for(b=n;b;)b.return=k,b=b.sibling;const I=rr(s,c);for((0,C.A)(zn,this,qn).call(this,I),Ln(k),E?E.sibling=n:r.child=n,y&&(y.sibling=null==c?void 0:c.sibling),b=n;b;)b.return=r,b=b.sibling;var R,O;if(S.hasChildNodes()&&(r.tag===Mn.ROOT?null===(R=r.container)||void 0===R||R.insertBefore(S,d):null===(O=r.element)||void 0===O||O.insertBefore(S,d)),A.hasChildNodes()){var T;let e=n;for(;e&&e.return;)e=e.return;if((null===(T=e)||void 0===T?void 0:T.tag)!==Mn.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const t="function"==typeof e.createPortal?e.createPortal():e.createPortal;let r=null;for(const e of p)if(t.contains(e)){r=e;break}t.insertBefore(A,r)}const _=rr(n,y);(0,C.A)(zn,this,Yn).call(this,_)}dispose(){for(const e of Object.values((0,a.A)(Un,this)))e.length=0;for(const e of(0,a.A)(Fn,this).values()){for(const t of e)t.disconnect();e.length=0}(0,a.A)(Fn,this).clear(),(0,a.A)(Dn,this)&&(be.removeEventListener("change",(0,a.A)(Dn,this)),(0,s.A)(Dn,this,void 0)),(0,s.A)(Kn,this,void 0),(0,a.A)(jn,this).clear(),(0,a.A)(Hn,this).clear(),(0,s.A)(Wn,this,void 0)}dispatchBeforePageLoad(){(0,C.A)(zn,this,Xn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,C.A)(zn,this,Xn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,C.A)(zn,this,Xn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,C.A)(zn,this,Xn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=k().location;e&&"#"!==e?(0,C.A)(zn,this,Xn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,C.A)(zn,this,Xn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,a.A)(Un,this).onScrollIntoView)(0,C.A)(zn,this,Jn).call(this,e,t)}initializeMediaChange(){(0,s.A)(Dn,this,(e=>{(0,C.A)(zn,this,Xn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:G(e.detail)}))})),be.addEventListener("change",(0,a.A)(Dn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,a.A)(Un,this).onMessage)for(const r of[].concat(n)){var t;null==vi||null===(t=vi.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{dn(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==vi||null===(e=vi.messageDispatcher)||void 0===e||e.onClose((()=>{(0,C.A)(zn,this,Xn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,C.A)(zn,this,Xn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,C.A)(zn,this,Xn).call(this,"onUnmount",new CustomEvent("unmount"))}}function qn(e){const t=[...$n,..."page"===this.scope?Bn:[]],n=[];for(const r of t){const t=(0,h.remove)((0,a.A)(Un,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o,i;const e=(0,a.A)(Fn,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,a.A)(Fn,this).delete(t)}Pn(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove(),null===(i=t.disposes)||void 0===i||i.forEach((e=>e())),delete t.disposes}const s=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)dn(t,e.runtimeContext,e)(s)}function Yn(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,a.A)(Un,this).onMount)e.has(n)&&dn(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,a.A)(Un,this).onScrollIntoView)e.has(t)&&(0,C.A)(zn,this,Jn).call(this,t,n)}function Xn(e,t){for(const{brick:n,handlers:r}of(0,a.A)(Un,this)[e])dn(r,n.runtimeContext,n)(t);const n=(0,a.A)(jn,this).get(e);if(n)for(const e of n)e()}function Jn(e,t){var n;const r=null!==(n=t.threshold)&&void 0!==n?n:.1,o=new IntersectionObserver(((n,o)=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=r&&(dn(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:r});o.observe(e.element);let i=(0,a.A)(Fn,this).get(e);i||(i=[],(0,a.A)(Fn,this).set(e,i)),i.push(o)}function Qn(e){let t=e;for(;null!==(n=t)&&void 0!==n&&n.sibling;){var n;t=t.sibling}return t}function Zn(e){return er(e,!1)}function er(e,t){let n,r=e;for(;r;){if(r.tag===Mn.BRICK&&!r.portal){if(t)return r;n=r}r=r.sibling}return n}function tr(e){return nr(e,!1)}function nr(e,t){let n,r=e;for(;r;){if(r.tag===Mn.BRICK&&r.portal){if(t)return r;n=r}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&!e.sibling;)e=e.return;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}function rr(e,t){const n=new Set;let r=e;for(;r;)if(r.tag===Mn.BRICK&&n.add(r),r.child)r=r.child;else{if(r===t)break;if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&e!==t&&!e.sibling;)e=e.return;if(e===t)break;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}const or=new Map;function ir(e){return or.get(e)}const sr=Symbol.for("root.runtimeContext");async function ar(e,t,n){var r,o,i,s,a;const[c,l,u]=ro({...null!==(r=e[sr])&&void 0!==r?r:ki(),data:t,pendingPermissionsPreCheck:[]});c.inUseBrick=!0,null!==(o=c.tplStateStoreMap)&&void 0!==o||(c.tplStateStoreMap=new Map),null!==(i=c.formStateStoreMap)&&void 0!==i||(c.formStateStoreMap=new Map);const d=new Gn("fragment"),p={tag:Mn.ROOT,createPortal:null},f=Re(),h=await eo(p,f&&!n?e:{errorBoundary:n,...e},c,d,[],{}),v=[...l,...u];if(await no(h,c,v),(null===(s=h.node)||void 0===s?void 0:s.tag)===Mn.PLACEHOLDER){if(h.node.tracking)throw new Error("The root brick of useBrick cannot be an ignored tracking control node");h.node=void 0}if(null!==(a=h.node)&&void 0!==a&&a.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return p.child=h.node,{tagName:h.node?h.node.type:null,renderRoot:p,rendererContext:d,scopedStores:v}}function cr(e,t){let n,{renderRoot:r,rendererContext:o,scopedStores:i}=e;r.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},Ln(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of i)e.mountAsyncData();return{portal:n}}function lr(e,t){let{rendererContext:n}=e;t.portal&&(xn(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function ur(e,t,n){if(n)throw new Error("Legacy doTransform does not support options in v3");return mt(t,{...ki(),data:e},{noInject:!0})}function dr(e,t){const n=Ii(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),L(n)}function pr(e,t){const n=Ii(e);let r=!1;function o(e){e.forEach(((n,s)=>{"routes"===n.type?o(n.routes):function(e){return e.path===t.path&&!e.exact==!t.exact}(n)?(r=!0,e[s]=t):Array.isArray(n.bricks)&&i(n.bricks)}))}function i(e){e.forEach((e=>{if(e.slots)for(const t of Object.values(e.slots))"routes"===t.type?o(t.routes):i(t.bricks)}))}o(n.routes),r||n.routes.unshift(t)}function fr(e,t,n){const r=`${e}.${t.name}`;Pe.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),hr(e,t.name,n)}function hr(e,t,n){wr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,h.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function vr(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function mr(e,t){var n;wr(e,vr(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const gr=mr;function wr(e,t,n,r){const{routes:o}=Ii(e),i=o.findIndex((e=>e.path===t)),s={path:t,bricks:n,context:r,menu:!1,exact:!0};-1===i?o.unshift(s):o.splice(i,1,s)}function yr(e,t){let{tplStateStoreId:n}=t;const r=ki();return n?Me({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function Er(e){let{tplStateStoreId:t}=e;const n=ki();return t?Me({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function br(e){return bi().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function Sr(e){return(0,l.loadBricksImperatively)(e,bi())}function Ar(e,t){return(0,l.loadEditorsImperatively)(e,null!=t?t:bi())}function kr(){return Ai()}async function Ir(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const i=Ii(n);let s;if("route"===r)s={routes:[e]};else if("template"===r)s={meta:{customTemplates:[e]}};else if("snippet"===r){var a;const t=vr(e.snippetId);s={routes:[null==i||null===(a=i.routes)||void 0===a?void 0:a.find((e=>e.path===t))]}}const c=[];return s&&o&&(await o(s)).forEach((e=>{var t;const[n,r,o]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===r&&e.name===o))||c.push(e)})),c}async function Cr(e,t){let{tplStateStoreId:n,routeId:r}=t;const o={...ki(),tplStateStoreId:n,match:ir(r)};return e.resolve?tt(e.resolve,o,{cache:"reload"}):vt(e.value,o)}function Rr(e){var t;const n=ki();return{app:null!==(t=null==n?void 0:n.overrideApp)&&void 0!==t?t:null==n?void 0:n.app,location:(0,h.pick)(location,["href","origin","hostname","host"]),...(0,h.pick)(n,["query","sys"]),match:ir(null==e?void 0:e.routeId)}}let Or;const Tr=[];function _r(e){Or=e;const t=Er({tplStateStoreId:e.tplStateStoreId});Mr({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Pr(e){Tr.push(e)}function Mr(e){setTimeout((()=>{for(const t of Tr)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const xr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Lr{constructor(e,t,n,r){(0,o.A)(this,"type",void 0),(0,o.A)(this,"data",new Map),(0,o.A)(this,"changeEventType",void 0),(0,o.A)(this,"pendingStack",[]),(0,o.A)(this,"hostBrick",void 0),(0,o.A)(this,"stateStoreId",void 0),(0,o.A)(this,"batchUpdate",!1),(0,o.A)(this,"batchUpdateContextsNames",[]),(0,o.A)(this,"rendererContext",void 0),(0,o.A)(this,"routeMap",new WeakMap),(0,o.A)(this,"routeStackMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=n,this.stateStoreId=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{let[t,{value:n}]=e;return[t,n]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Or){const{tplStateStoreId:n}=Or;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&Mr({changeType:"update",tplStateStoreId:n,detail:{name:e,value:t}})}}getAffectListByContext(e){const t=[e];return this.data.forEach(((e,n)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(n)&&t.push(...this.getAffectListByContext(n))})),t.shift(),[...new Set(t)]}updateValues(e,t,n){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");const r={},o={},i=[];e.forEach((e=>{const{name:o,value:s}=n([e]),a=this.data.get(o);i.push(...this.getAffectListByContext(o)),a&&(r[o]=a),this.updateValue(o,s,t)})),i.filter((e=>!r[e])).forEach((e=>{const t=this.data.get(e);t&&(o[e]=t)}));const s=e=>{for(const n in e){var t;const r=e[n];null===(t=r.eventTarget)||void 0===t||t.dispatchEvent(new CustomEvent(this.changeEventType,{detail:r.value}))}};s(r),s(o),this.batchUpdate=!1}updateValue(e,t,n,r,o){const i=this.data.get(e);if(!i)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n)"replace"===n?i.value=t:(0,u.isObject)(i.value)?Object.assign(i.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let s;"load"===n&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));const a=e=>{var t;let n;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(n=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&n!==Ai()};if(s||(s=i.loading=i.load({cache:"load"===n?"default":"reload",...t}),s.then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||a(e)||null!=r&&r.error||rn(e)}))),r){const e=On(r,o);s.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!a(t)&&r.error&&e("error")(t),e("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,n,r){if(Array.isArray(e)&&e.length>0){const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX";const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",n=arguments.length>2?arguments[2]:void 0;const r=new Map;for(const o of e){const e=[o.if,o.value,o.resolve],i=(0,T.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,T.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)i.usedProperties.add(e);t.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}r.set(o,i)}return r}(e,n,arguments.length>3?arguments[3]:void 0),o=new Map;for(const e of Array.from(r.keys()).map((e=>e.name))){var i;o.set(e,(null!==(i=o.get(e))&&void 0!==i?i:0)+1)}const s=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),a=new WeakSet,c=new Map,l=new Map([...new Set(e.map((e=>e.name)))].map((e=>{const t=new Promise(((t,n)=>{c.set(e,{resolve:t,reject:n})}));return t.catch((()=>{})),[e,t]}))),u=async e=>{var n;a.add(e);const i=await t(e);r.delete(e);const s=null!==(n=o.get(e.name))&&void 0!==n?n:0;if(i){if(c.get(e.name).resolve(),o.delete(e.name),0===s)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===s?(c.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,s-1);await p()};let d=s;async function p(){const e=Array.from(r.entries()).filter(function(e,t){return(n,r)=>t?0===r:![...n[1].usedProperties].some((t=>e.has(t)))}(o,d)).map((e=>e[0])).filter((e=>!a.has(e)));await Promise.all(e.map(u))}const f=p().then((async()=>{r.size>0&&(function(e,t){const n=new Map(e),r=new Set(Array.from(n.keys()).map((e=>e.name))),o=()=>{let e=!1;for(const[t,o]of n.entries())[...o.usedProperties].some((e=>r.has(e)))||(n.delete(t),r.delete(t.name),e=!0);e&&o()};if(o(),n.size>0)throw new ReferenceError(`Circular ${t} detected: ${Array.from(n.keys()).map((e=>e.name)).join(", ")}`)}(r,n),d=!0,await p());for(const e of c.values())e.resolve()})).catch((e=>{for(const t of c.values())t.reject(e);throw e}));return f.catch((()=>{})),{pendingResult:f,pendingContexts:l}}(e,(e=>this.resolve(e,t,n,r)),this.type,Re(t));if(Array.isArray(r))for(const e of r){const t=this.routeStackMap.get(e);t?t.add(o):this.routeStackMap.set(e,new Set([o]))}this.pendingStack.push(o)}}onChange(e,t){var n;const r=null===(n=this.data.get(e))||void 0===n?void 0:n.eventTarget;return null==r||r.addEventListener(this.changeEventType,t),()=>{null==r||r.removeEventListener(this.changeEventType,t)}}async waitFor(e){for(const{pendingContexts:t}of this.pendingStack)await Promise.all([...e].map((e=>t.get(e))))}async waitForAll(){for(const{pendingResult:e}of this.pendingStack)await e}mountAsyncData(e){this.data.forEach((t=>{var n;if(t.async&&(!e||null!==(n=this.routeMap.get(e))&&void 0!==n&&n.has(t.name))){if(t.asyncMounted)return void console.error(`Async data "${t.name}" already mounted. This is a bug of Brick Next, please report it.`);t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}async resolve(e,t,n,r){if(!await yt(e,t))return!1;let o,i,s,a,c,l;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(o=await kt(n,e.name)),void 0===o){if(e.resolve){const n=(0,u.hasOwnProperty)(e,"value");c=e.track&&n&&(0,u.hasOwnProperty)(e.resolve,"if")&&(0,T.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(a=await yt(e.resolve,t),(a||c)&&(i=async e=>{var n;return(await tt(r,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),a)l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===l?o=await i():"async"===l&&(s=i());else if(!n)return!1}a&&"eager"===l||void 0===e.value||(o=await vt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const d={name:e.name,value:o,eventTarget:new we,useResolve:a,load:i,loaded:"eager"===l,loading:s,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var p;t&&xr.includes(t)&&(null===(p=this.rendererContext)||void 0===p||p.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(this.changeEventType,dn(e.onChange,t)),e.track){const n=(0,T.strictCollectMemberUsage)(c?[e.resolve,e.value]:i?e.resolve:e.value,this.type);!i&&(d.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{d.useResolve=c?Et(e.resolve,t):!!i,d.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,mt(e.value,t),"replace")}),e))}if(d.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,d),Array.isArray(r))for(const t of r){const n=this.routeMap.get(t);n?n.add(e.name):this.routeMap.set(t,new Set([e.name]))}return!0}disposeDataInRoutes(e){for(const t of e){const e=this.routeMap.get(t);if(void 0!==e){for(const t of e)this.data.delete(t);this.routeMap.delete(t)}const n=this.routeStackMap.get(t);void 0!==n&&((0,h.pull)(this.pendingStack,...n),this.routeStackMap.delete(t))}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function $r(e,t,n,r){const{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:a,hostBrick:c}=e;let l;if(t&&o){const e=o.properties.get(t);e&&(m=i,l=e.map((e=>{let{from:t,to:n}=e;const r=m.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,kt(r,t),!0]})).filter(Boolean));const a=o.slots.get(t);if(a&&r)throw new Error(`Can not have proxied slot ref when the ref target has a slot element child, check your template "${c.type}" and ref "${t}"`);if(a&&s){const e=new Map;for(const{from:t,to:r}of a){var d,p,f,v;const o=null!==(d=null===(p=s[t])||void 0===p?void 0:p.bricks)&&void 0!==d?d:[];if(!o.length)continue;const i=null!==(f=r.refSlot)&&void 0!==f?f:t;let a=e.get(i);if(!a){a=[];const t=(0,u.hasOwnProperty)(n,i)?n[i].bricks.length+1:1;for(let e=0;e<t;e+=1)a.push([]);e.set(i,a)}const l=null!==(v=r.refPosition)&&void 0!==v?v:-1,m=(0,u.hasOwnProperty)(c.runtimeContext,"forEachItem");a[(0,h.clamp)(l<0?a.length+l:l,0,a.length-1)].push(...m?Br(o,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex,c.runtimeContext.forEachSize):o)}for(const[t,r]of e.entries()){(0,u.hasOwnProperty)(n,t)||(n[t]={type:"bricks",bricks:[]});const e=n[t];e.bricks=r.flatMap(((t,n)=>n<e.bricks.length?t.concat(e.bricks[n]):t)),0===e.bricks.length&&delete n[t]}}}var m;return{[Ut]:l,[Ft]:a}}function Br(e,t,n,r){return e.map((e=>{var o;let{children:i,slots:s,...a}=e;return{...a,[Dt]:t,[jt]:n,[Kt]:r,slots:":forEach"===a.brick?so(i,s):Object.fromEntries(Object.entries(null!==(o=so(i,s))&&void 0!==o?o:{}).map((e=>{let[o,i]=e;return[o,"routes"===i.type?{type:"routes",routes:Nr(i.routes,t,n,r)}:{type:"bricks",bricks:Br(i.bricks,t,n,r)}]})))}}))}function Nr(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:Nr(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:Br(e.bricks,t,n,r)}))}function Ur(e,t,n){var r,o,i,s;if(null!=e.if&&!e.if||"string"==typeof e.if)throw new Error(`Can not use "if" in a slot currently, check your template "${t.hostBrick.type}"`);const a=String(null!==(r=null===(o=e.properties)||void 0===o?void 0:o.name)&&void 0!==r?r:"");if((0,O.isEvaluable)(a))throw new Error(`Can not use an expression as slot name "${a}" currently, check your template "${t.hostBrick.type}"`);if(t.usedSlots.has(a))throw new Error(`Can not have multiple slots with the same name "${a}", check your template "${t.hostBrick.type}"`);if(t.usedSlots.add(a),t.externalSlots&&(0,u.hasOwnProperty)(t.externalSlots,a)){var c;const e=null!==(c=t.externalSlots[a].bricks)&&void 0!==c?c:[];if(e.length>0){const n=t.hostBrick.runtimeContext;return(0,u.hasOwnProperty)(n,"forEachItem")?Br(e,n.forEachItem,n.forEachIndex,n.forEachSize):e}}const l=so(e.children,e.slots);return(null!==(i=null==l||null===(s=l[""])||void 0===s?void 0:s.bricks)&&void 0!==i?i:[]).flatMap((e=>n(e,t)))}function Fr(e,t){function n(e){return(0,u.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.flatMap((e=>r(e)))]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e,o){if("slot"===e.brick)return null==o||o(),Ur(e,t,(e=>r(e)));const{properties:i,slots:s,children:a,...c}=e,l=so(a,s);let u=!1;const d=()=>{u=!0},p=Object.fromEntries(Object.entries(null!=l?l:{}).map((e=>{var t;let[n,o]=e;return[n,{type:"bricks",bricks:(null!==(t=o.bricks)&&void 0!==t?t:[]).flatMap((e=>r(e,d)))}]})));return{...c,properties:n(i),slots:p,...$r(t,c.ref,p,u)}}return n(e)}function Dr(e,t,n){if(null===e.if&&delete e.if,"slot"===e.brick)return null==n||n(),Ur(e,t,Dr);const{properties:r,slots:o,children:i,...s}=e,a=so(i,o);let c=!1;const l=()=>{c=!0},u=Object.fromEntries(Object.entries(null!=a?a:{}).map((e=>{var n;let[r,o]=e;return[r,{type:"bricks",bricks:(null!==(n=o.bricks)&&void 0!==n?n:[]).flatMap((e=>Dr(e,t,l)))}]})));return{...s,properties:Fr(r,t),slots:u,...$r(t,s.ref,u,c)}}const jr="form-renderer.form-renderer",Kr=Symbol.for("form.stateStoreId"),Vr=["forms.general-form","form.general-form","eo-form"];function Wr(e,t,n){const{id:r,bricks:o,events:i,context:s,mountPoint:a,instanceId:c}=e;let{brick:l,properties:d}=e;const p=t.find((e=>e.fieldId===r));if(p){const e=function(e){let t;const n={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},r=()=>{var t,n;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(n=e.limit)||void 0===n?void 0:n.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}}};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:{...n,...r()}};break;case"FLOAT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUM":t={brick:"forms.general-select",properties:{...n,...r(),options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUMS":t={brick:"forms.general-select",properties:{...n,...r(),mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:{...n,...r(),placeholder:e.description}};break;case"IP":t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}}};break;case"JSON":t={brick:"forms.general-textarea",properties:{...n}};break;case"ARRAY":t={brick:"forms.general-select",properties:{...n}};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:{...n,...r()}};break;default:t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description}}}return t}(p);l||(l=e.brick),d={...e.properties,...d}}const f={brick:l,properties:d,iid:c,slot:a,events:i,context:s,children:Hr(o,t,n),[Kr]:n};return(0,u.hasOwnProperty)(e,"if")&&(f.if=e.if),f}function Hr(e,t,n){if(Array.isArray(e))return e.map((e=>Wr(e,t,n)))}var zr=new WeakSet;class Gr extends HTMLElement{constructor(){super(...arguments),(0,I.A)(this,zr),(0,o.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,C.A)(zr,this,qr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(zr,this,qr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(zr,this,qr).call(this,"resetFields",t)}getFieldsValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,C.A)(zr,this,qr).call(this,"getFieldsValue",t)}}function qr(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=!1!==this.renderRoot?null===(t=this.firstElementChild)||void 0===t?void 0:t.firstElementChild:this.firstElementChild,i=null==o||null===(n=o.tagName)||void 0===n?void 0:n.toLowerCase();if(Vr.includes(i))return o[e](...r);console.error(`no ${e} method in the container element`,{container:i})}class Yr extends Error{constructor(e){super(e),this.name="PageNotFoundError",Error.captureStackTrace&&Error.captureStackTrace(this,l.BrickLoadError)}}async function Xr(e,t,n){const{title:r,variant:o,showLink:i,showDescription:s}=function(e){var t,n;return e instanceof Yr?"app not found"===e.message?{showLink:"home",title:c.i18n.t(`${Gt}:${Wt.APP_NOT_FOUND}`),variant:"no-permission"}:{showLink:"home",variant:"not-found",title:c.i18n.t(`${Gt}:${Wt.PAGE_NOT_FOUND}`)}:e instanceof l.BrickLoadError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement?{showDescription:!0,title:c.i18n.t(`${Gt}:${Wt.NETWORK_ERROR}`),variant:"internet-disconnected",showLink:"reload"}:e instanceof R.HttpResponseError&&403===(null===(t=e.response)||void 0===t?void 0:t.status)?{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Gt}:${Wt.NO_PERMISSION}`),variant:"no-permission"}:e instanceof R.HttpResponseError&&"200000"===(null===(n=e.responseJson)||void 0===n?void 0:n.code)?{showDescription:!0,title:c.i18n.t(`${Gt}:${Wt.LICENSE_EXPIRED}`),variant:"license-expired"}:{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Gt}:${Wt.UNKNOWN_ERROR}`),variant:"unknown-error"}}(e);if(n){var a;const n=null!==(a=Si().error)&&void 0!==a?a:"illustrations.error-message";if(!1!==n){const a="eo-link",c=(i?[n,a]:[n]).filter((e=>!customElements.get(e)));try{await Promise.race([(0,l.loadBricksImperatively)(c,bi()),new Promise(((e,t)=>setTimeout((()=>{t(new Error("timeout"))}),3e3)))]);const u={tag:Mn.BRICK,type:n,properties:{errorTitle:r,description:s?Qt(e):void 0,variant:o,dataset:{errorBoundary:""}},runtimeContext:null,return:t};return i&&(u.child=Jr(i,a,u,"")),u}catch(e){console.error("Failed to load brick:",c.join(", "),e)}}}const u=n&&!!customElements.get("easyops-default-error"),d={tag:Mn.BRICK,type:u?"easyops-default-error":"div",properties:{errorTitle:r,dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:t},p={tag:Mn.BRICK,type:"div",properties:{textContent:u?s?Qt(e):"":s?`${r}: ${Qt(e)}`:r},runtimeContext:null,return:d};return d.child=p,n&&i&&(p.sibling=Jr(i,"a",d,u?"link":"")),d}function Jr(e,t,n,r){return{tag:Mn.BRICK,type:t,slotId:r,properties:{textContent:"home"===e?c.i18n.t(`${Gt}:${Wt.GO_BACK_HOME}`):"reload"===e?c.i18n.t(`${Gt}:${Wt.RELOAD}`):c.i18n.t(`${Gt}:${Wt.GO_BACK_TO_PREVIOUS_PAGE}`),href:"home"===e?f():"reload"===e?location.href:void 0},events:"previous"===e?{click:{action:"history.goBack"}}:void 0,runtimeContext:null,return:n}}async function Qr(e,t,n,r,o,i,s,a,c){const u=await async function(e,t){for(const n of e){if("string"!=typeof n.path)throw console.error("Invalid route with invalid path:",n),new Error("Invalid route with invalid type of path: "+typeof n.path);const e=Nt(n,t.app.homepage,t.location.pathname);if(e&&await yt(n,t))return t.app.noAuthGuard||n.public||null==vi||!vi.auth||vi.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),d={blockingList:[]},p=d.menuRequestNode={return:i};switch(u){case"missed":break;case"unauthenticated":d.unauthenticated=!0;break;default:{var f;const i=d.route=u.route;d.path=u.match.path;const m={...n,match:u.match};i.iid&&(h=i.iid,v=u.match,or.set(h,v)),a&&m.ctxStore.disposeDataInRoutes(t);const g=o.concat(i);m.ctxStore.define(i.context,m,void 0,g),m.pendingPermissionsPreCheck.push(null==vi||null===(f=vi.checkPermissions)||void 0===f?void 0:f.preCheckPermissionsForBrickOrRoute(i,(e=>vt(e,m))));const{preLoadBricks:w}=i;if(Array.isArray(w)&&d.blockingList.push((0,l.loadBricksImperatively)(w,bi())),"redirect"===i.type){let e;if(e="string"==typeof i.redirect?await vt(i.redirect,m):(await tt({transform:"redirect",...i.redirect},m)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);d.redirect={path:e}}else{const n=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return vt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(i.menu,m);n&&(p.request=n),a||r.memoizeMenuRequestNode(t,p);const o=(0,T.strictCollectMemberUsage)(i.context,"PROCESSORS",2);let u;o.size>0&&d.blockingList.push(ao((0,l.loadProcessorsImperatively)(o,bi()),"processors",[...o].join(", "),r.unknownBricks)),u="routes"===i.type?await Qr(e,i.routes,m,r,g,p,s,void 0,c):await Zr(e,i.bricks,m,r,g,p,s,void 0,void 0,c),oo(d,u),io(p,u.menuRequestNode)}}}var h,v;return d}async function Zr(e,t,n,r,o,i,s,a,c,l){!function(e,t,n){function r(e){if((0,u.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(const[t,n]of Object.entries(e))(0,u.isObject)(n)&&"useBrick"===t?Array.isArray(n)?n.forEach((e=>o(e,!0))):o(n,!0,!0):r(n)}function o(e,i,s){if(i&&(e[sr]=t),r(e.properties),n&&!s)return;const a=so(e.children,e.slots);for(const e of Object.values(null!=a?a:{}))for(const t of null!==(c=e.bricks)&&void 0!==c?c:[]){var c;o(t,i)}}for(const t of e)o(t)}(t,n,!0);const d={blockingList:[]},p=null!=c?c:[];return(await Promise.all(t.map(((t,c)=>eo(e,t,n,r,o,i,s,p.concat(c),a&&new Map(a),l))))).forEach(((t,n)=>{t.hasTrackingControls&&r.memoize(s,p.concat(n),t.node,e),oo(d,t)})),d}async function eo(e,t,n,r,o,i,s){let a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:new Map,d=arguments.length>9?arguments[9]:void 0;try{return await async function(e,t,n,r,o,i,s,a,c,d){var p,f;const v={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),v;const{if:g,permissionsPreCheck:w,...y}=t;if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):it(e)&&(0,O.isTrackAll)(st(e))}(g))return eo(e,{brick:":if",dataSource:g,permissionsPreCheck:w,slots:{"":{type:"bricks",bricks:[y]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,i,s,a,c,d);const E=t[Ft],b=t[Kr],S={...n,tplStateStoreId:E,formStateStoreId:b};(0,u.hasOwnProperty)(t,Dt)&&(S.forEachItem=t[Dt],S.forEachIndex=t[jt],S.forEachSize=t[Kt]);const A=Re(S),{context:k}=t;if(Array.isArray(k)&&k.length>0&&(Oe(A,"Defining context on bricks","check your brick:",t),A||S.ctxStore.define(k,S)),S.pendingPermissionsPreCheck.push(null==vi||null===(p=vi.checkPermissions)||void 0===p?void 0:p.preCheckPermissionsForBrickOrRoute(t,(e=>vt(e,S)))),!await async function(e,t){return(0,u.isObject)(e.if)&&!it(e.if)?bt(await tt(e.if,t)):yt(e,t)}(t,S))return v;const I=t.brick;if(I.startsWith(":")){var C;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(I);const{dataSource:n}=t,{contextNames:l,stateNames:d}=At(n),p=!(!l&&!d),f=async(p,f,h)=>{var v;const m=await vt(n,p);h&&Ot(p,[{contextNames:l,stateNames:d,propValue:n}],f);const g=":forEach"===I?"":":switch"===I?String(m):m?"":"else",w=so(t.children,t.slots),y=w&&(0,u.hasOwnProperty)(w,g)&&(null===(v=w[g])||void 0===v?void 0:v.bricks);if(!Array.isArray(y))return{blockingList:[]};switch(I){case":forEach":return Array.isArray(m)?async function(e,t,n,r,o,i,s,a,c,l,u){const d={blockingList:[]},p=t.length,f=await Promise.all(t.map(((t,d)=>Promise.all(n.map(((n,f)=>eo(e,n,{...r,forEachItem:t,forEachIndex:d,forEachSize:p},o,i,s,a,l.concat(d*p+f),c&&new Map(c),u)))))));return f.flat().forEach(((t,n)=>{t.hasTrackingControls&&o.memoize(a,l.concat(n),t.node,e),oo(d,t)})),d}(e,m,y,p,r,o,i,s,c,a,f):{blockingList:[]};case":if":case":switch":return Zr(e,y,p,r,o,i,s,c,a,f)}},v=async n=>{var r,o;let{type:i,runtimeContext:s,tplStateStoreScope:a,formStateStoreScope:c}=n,l=!1;const u={disposes:[],listener:()=>{l=!0}};let d,h=0,v=!0;for(;v||l;){if(l=!1,d=await f(s,u,v&&"initial"===i),!l&&"rerender"===i){const e=[...a,...c];await no(d,s,[s.ctxStore,...e])}if(u.disposes.forEach((e=>e())),u.disposes.length=0,v=!1,++h>10)throw new Error(`Maximum rerender stack overflowed (iid: ${t.iid})`)}return null!==(o=(r=d).node)&&void 0!==o||(r.node={tag:Mn.PLACEHOLDER,return:e,tracking:p}),d},m=await v({type:"initial",runtimeContext:S}),{onMount:g,onUnmount:w}=null!==(C=t.lifeCycle)&&void 0!==C?C:{};if(p){var R;m.hasTrackingControls=!0;let t=0;const o=async()=>{const n=++t,[o,i,c]=ro(S),l=await v({type:"rerender",runtimeContext:o,tplStateStoreScope:i,formStateStoreScope:c});if(t===n){w&&dn(w,S)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(s,a,l.node,e),g&&dn(g,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of[...i,...c])e.mountAsyncData()}},i=(0,h.debounce)(o,0,{leading:!0,trailing:!0}),c=e.tag===Mn.BRICK?e:null,u=c?null!==(R=c.disposes)&&void 0!==R?R:c.disposes=[]:[];if(l)for(const e of l)u.push(S.ctxStore.onChange(e,i));if(d)for(const e of d){const t=Me(S,"STATE",`: "${n}"`);u.push(t.onChange(e,i))}}return g&&r.registerArbitraryLifeCycle("onMount",(()=>{dn(g,S)(new CustomEvent("mount",{detail:{rerender:!1}}))})),w&&r.registerArbitraryLifeCycle("onUnmount",(()=>{dn(w,S)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),m}/\.tpl-/.test(I)&&!Pe.get(I)&&await ao((0,l.loadBricksImperatively)([I],bi()),"brick",I,r.unknownBricks);const _=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(Pe.get(n))return n}return!!Pe.get(e)&&e}(I,null===(f=S.app)||void 0===f?void 0:f.id);if(_){var P;const e=null!==(P=c.get(_))&&void 0!==P?P:0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${_}"`);c.set(_,e+1)}else I.includes("-")&&!customElements.get(I)&&(I===jr?customElements.get(jr)||customElements.define(jr,Gr):v.blockingList.push(ao((0,l.enqueueStableLoadBricks)([I],bi()),"brick",I,r.unknownBricks)));let M,x;if(I===jr){var L,$;({formData:M,...x}=null!==(L=t.properties)&&void 0!==L?L:{}),null!==($=t.properties)&&void 0!==$&&$.compute&&(M=await vt(M,S))}else{var B;if(S.inUseBrick){const e=t.transform;e&&(Oe(A,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',t),A||(x={...t.properties,...e}))}null!==(B=x)&&void 0!==B||(x=t.properties)}const N=[],U=function(e,t,n){return(0,u.isObject)(e)?Object.entries(e).map((e=>{let[r,o]=e;const{contextNames:i,stateNames:s,formStateNames:a}=At(o);return(i||s||a)&&n.push({contextNames:i,stateNames:s,formStateNames:a,propName:r,propValue:o}),[r,vt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?pt.USE_BRICK:pt.INITIAL})]})):[]}(x,S,N),F=t[Ut];F&&U.push(...F);const D="script"===I;if(D||"link"===I){const e=await It(U);if(D?e.src:"stylesheet"===e.rel&&e.href){var j;const t=null!==(j=window.PUBLIC_ROOT)&&void 0!==j?j:"";if(D){const{src:n,...r}=e;await ao((0,l.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await ao((0,l.loadStyle)(n,t,r),"stylesheet",n,"silent")}return v}}const K={tag:Mn.BRICK,type:_||I,return:e,slotId:s,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};v.node=K;const V=(0,T.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);V.size>0&&v.blockingList.push(ao((0,l.loadProcessorsImperatively)(V,bi()),"processors",[...V].join(", "),r.unknownBricks));const W=[];Ot(S,N,d);W.push((async()=>{K.properties=await It(U),function(e,t){for(const r of t){var n;const t=()=>{e.element&&Rt(e.element,{[r.propName]:r.propValue},e.runtimeContext)};if(null!==(n=e.disposes)&&void 0!==n||(e.disposes=[]),r.contextNames)for(const n of r.contextNames)e.disposes.push(e.runtimeContext.ctxStore.onChange(n,t));if(r.stateNames){const n=Me(e.runtimeContext,"STATE",`: "${r.propValue}"`);for(const o of r.stateNames)e.disposes.push(n.onChange(o,t))}if(r.formStateNames){const n=qe(e.runtimeContext,"FORM_STATE",`: "${r.propValue}"`);for(const o of r.formStateNames)e.disposes.push(n.onChange(o,t))}}}(K,N)})()),r.registerBrickLifeCycle(K,t.lifeCycle);let H,z=t;_?z=function(e,t,n,r,o){var i;const s=(0,h.uniqueId)("tpl-state-"),a={...n.runtimeContext,tplStateStoreId:s};delete a.forEachItem,delete a.forEachIndex,delete a.forEachSize,delete a.formStateStoreId;const c=new Lr("STATE",n,o,s);a.tplStateStoreMap.set(s,c),a.tplStateStoreScope&&a.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:p}=Pe.get(e);null==vi||null===(i=vi.flowApi)||void 0===i||i.collectWidgetContract(p),c.define(d,a,r);const{slots:f,children:v,...m}=t,g={...m,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:u};const w={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=w.properties.get(t.ref);n||(n=[],w.properties.set(t.ref,n)),n.push({from:e,to:t})}if(null!=u&&u.slots)for(const[e,t]of Object.entries(u.slots)){let n=w.slots.get(t.ref);n||(n=[],w.slots.set(t.ref,n)),n.push({from:e,to:t})}const y={reversedProxies:w,asyncHostPropertyEntries:r,externalSlots:so(v,f),tplStateStoreId:s,hostBrick:n,usedSlots:new Set};return g.slots={"":{type:"bricks",bricks:l.flatMap((e=>Dr(e,y)))}},g}(_,t,K,U,r):I===jr&&(z=function(e,t,n,r,o){var i,s;const a="string"==typeof e?JSON.parse(e):e,c=(0,h.uniqueId)("form-state-"),l={...n.runtimeContext,formStateStoreId:c};delete l.forEachItem,delete l.forEachIndex,delete l.forEachSize,delete l.tplStateStoreId;const d=new Lr("FORM_STATE",void 0,o,c);l.formStateStoreMap.set(c,d),l.formStateStoreScope&&l.formStateStoreScope.push(d);const p=null!==(i=a.context)&&void 0!==i?i:[];p.some((e=>"params"===e.name))||p.push({name:"params"}),d.define(p,l,r);const f=Wr(a.formSchema,a.fields,c);return Vr.includes(f.brick)&&t.events&&(f.events=function(e,t){const n=null!=e?e:{};for(const[e,r]of Object.entries(t))n[e]=(0,u.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(f.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[f]}]}:{...t,slots:void 0,children:[f]}}(M,t,K,U,r)),z.portal&&(K.slotId=void 0),_?(H={...S},delete H.forEachItem,delete H.forEachIndex,delete H.forEachSize):H=S;return W.push((async()=>{const e=so(z.children,z.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map(((e,n)=>{let[s,a]=e;if("routes"!==a.type)return Zr(K,a.bricks,H,r,o,i,s,c,void 0,d);const l=o[o.length-1];return null!=l&&l.incrementalSubRoutes&&(t.set(n,s),r.performIncrementalRender(a,o,(async(e,t)=>{const{homepage:n}=H.app,{pathname:c}=e;if(!m(n,c)||!o.every((e=>{let r,o;return(r=Nt(e,n,t.pathname))&&(o=Nt(e,n,c))&&(e!==l||(0,h.isEqual)(r.params,o.params))})))return!1;const[u,d,p]=ro({...H,location:e,query:new URLSearchParams(e.search)});let f,v=!1,g=[];try{if(f=await Qr(K,a.routes,u,r,o,i,s,!0),f.route){if(r.reBailout(f))return!0;g=[...d,...p],await no(f,u,[u.ctxStore,...g])}await r.reMergeMenuRequestNodes(i,a.routes,f.menuRequestNode)}catch(e){console.error("Incremental sub-router failed:",e);const t=await r.reCatch(e,K);if(!t)return!0;({failed:v,output:f}=t),await r.reMergeMenuRequestNodes(i,a.routes,f.menuRequestNode)}if(r.reRender(s,[],f.node,K),!v){u.ctxStore.mountAsyncData(f.route);for(const e of g)e.mountAsyncData()}return!0}))),Qr(K,a.routes,H,r,o,i,s,void 0,d)}))),s={...v,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach(((e,n)=>{t.has(n)&&r.memoize(t.get(n),[],e.node,K),oo(s,e),function(e,t){const n=t.menuRequestNode;if(n)if(e.menuRequestNode){let t=e.menuRequestNode;for(;t.sibling;)t=t.sibling;t.sibling=n}else e.menuRequestNode=n}(s,e)})),s.node&&(K.child=s.node),oo(v,{...s,node:void 0}),io(i,v.menuRequestNode=s.menuRequestNode)})()),await Promise.all(W),v}(e,t,n,r,o,i,s,a,c,d)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:await Xr(n,e),blockingList:[]};throw n}}function to(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function no(e,t,n){return(0,l.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function ro(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function oo(e,t){const{blockingList:n,node:r,menuRequestNode:o,hasTrackingControls:i,...s}=t;if(e.blockingList.push(...n),r)if(e.node){let t=e.node;for(;t.sibling;)t=t.sibling;t.sibling=r}else e.node=r;Object.assign(e,s)}function io(e,t){if(t)if(e.child){let n=e.child;for(;n.sibling;)n=n.sibling;n.sibling=t}else e.child=t}function so(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const{slot:t,...r}of e){const e=null!=t?t:"";(0,u.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(r)}}return n}function ao(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let co,lo,uo;function po(){if(!co){if(co={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){co.isInIframe=!0;try{if(window.origin===window.parent.origin){co.isInIframeOfSameSite=!0;const e="/next/"===f(),t=window.parent.location.pathname,n=t.startsWith("/next/");co.isInIframeOfNext=0==(Number(e)^Number(n));const r=n?"/next":"";co.isInIframeOfVisualBuilder=t.startsWith(`${r}/visual-builder/`)||t.startsWith(`${r}/visual-builder-`),co.isInIframeOfLegacyConsole=e&&!n}}catch{}}Object.freeze(co)}return co}function fo(e){var t;if(e.$$registerCustomTemplateProcessed)return;e.$$registerCustomTemplateProcessed=!0;const n=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(n))for(const t of n){const n=t.name.includes(".")?t.name:`${e.app.id}.${t.name}`;Pe.define(n,t)}}function ho(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const vo="basic.show-watermark";function mo(e){return!!e&&(e instanceof l.BrickLoadError||e instanceof R.HttpFetchError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement)}const go="reload-for-error-count",wo=2;function yo(e){if(/upchat/i.test(navigator.userAgent)&&mo(e)){var t;const e=+(null!==(t=sessionStorage.getItem(go))&&void 0!==t?t:0);if(e<wo)return sessionStorage.setItem(go,String(e+1)),!0;Eo()}return!1}function Eo(){sessionStorage.removeItem(go)}var bo=new WeakMap,So=new WeakMap,Ao=new WeakMap,ko=new WeakMap,Io=new WeakMap,Co=new WeakMap,Ro=new WeakMap,Oo=new WeakMap,To=new WeakMap,_o=new WeakMap,Po=new WeakMap,Mo=new WeakMap,xo=new WeakSet;class Lo{constructor(e){(0,I.A)(this,xo),(0,i.A)(this,bo,void 0),(0,i.A)(this,So,!1),(0,i.A)(this,Ao,void 0),(0,i.A)(this,ko,void 0),(0,i.A)(this,Io,void 0),(0,i.A)(this,Co,new Set),(0,i.A)(this,Ro,0),(0,i.A)(this,Oo,void 0),(0,i.A)(this,To,void 0),(0,i.A)(this,_o,void 0),(0,i.A)(this,Po,void 0),(0,i.A)(this,Mo,!1),(0,s.A)(bo,this,e);const t=k();window.addEventListener("beforeunload",(e=>{(0,C.A)(xo,this,$o).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,C.A)(xo,this,$o).call(this,{location:e,action:t})))}getRenderId(){return(0,a.A)(Oo,this)}getRuntimeContext(){return(0,a.A)(ko,this)}getRecentApps(){return{currentApp:(0,a.A)(To,this),previousApp:(0,a.A)(_o,this)}}getNavConfig(){return(0,a.A)(Po,this)}bootstrap(){window.AbortController&&(lo=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{...e.options,signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:lo.signal}}})));const e=k();let t=e.location;return e.listen(((e,n)=>{const r=t;t=e,(0,a.A)(So,this)?(0,s.A)(Ao,this,{location:e,prevLocation:r,action:n}):(0,C.A)(xo,this,No).call(this,{location:e,prevLocation:r,action:n}).catch(rn)})),(0,C.A)(xo,this,No).call(this,{location:e.location})}}function $o(e){var t;const n=k(),r=n.getBlockMessage();null===(t=(0,a.A)(Io,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function Bo(e,t,n){var r,o;if((0,s.A)(Ro,this,(r=(0,a.A)(Ro,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}k().replace(e,t)}async function No(e){(0,s.A)(So,this,!0);try{await(0,C.A)(xo,this,Uo).call(this,e)}finally{if((0,s.A)(So,this,!1),(0,a.A)(Ao,this)){const e=(0,a.A)(Ao,this);(0,s.A)(Ao,this,void 0),await(0,C.A)(xo,this,No).call(this,e)}}}async function Uo(e){let{location:t,prevLocation:n,action:r}=e;if(n){var o,i,s,c;let e;const u={hash:void 0,state:void 0};var l;if(void 0!==t.key&&("POP"!==r||void 0!==n.key&&!1!==(null===(o=n.state)||void 0===o?void 0:o.notify))||(u.key=void 0),((0,p.locationsAreEqual)({...n,...u},{...t,...u})||"POP"!==r&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(e=!0),e||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(0,a.A)(Mo,this)||(e=await(null===(l=(0,a.A)(Io,this))||void 0===l?void 0:l.didPerformIncrementalRender(t,n))),e)return;if(lo&&(lo.abort(),lo=new AbortController),null===(c=(0,a.A)(Io,this))||void 0===c||c.dispatchPageLeave(),"POP"===r&&g(v((0,a.A)(bo,this),t.pathname)))return void window.location.reload();V("locationChange")}return(0,C.A)(xo,this,Fo).call(this,t,!n)}async function Fo(e,t){var n,r,o,i;const c=(0,s.A)(Oo,this,(0,h.uniqueId)("render-id-"));Je=new WeakSet,et.clear(),null==vi||null===(n=vi.flowApi)||void 0===n||n.clearCollectWidgetContract(),k().unblock();const u=null==vi||null===(r=vi.pageView)||void 0===r?void 0:r.create(),d=v((0,a.A)(bo,this),e.pathname),p=null===(o=(0,a.A)(ko,this))||void 0===o?void 0:o.app,f=null==d||null===(i=d.app)||void 0===i?void 0:i.id;window.BOOTSTRAP_UNION_FILE&&f&&f!==(null==p?void 0:p.id)&&function(e){const{appId:t,version:n}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",n))}({appId:f,version:d.app.currentVersion}),null!=d&&d.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==vi||null===(t=vi.fulfilStoryboard)||void 0===t?void 0:t.call(vi,e)),L(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(d);const m=(0,s.A)(To,this,null==d?void 0:d.app);!function(){var e,t,n,r,o,i,s,a;const c=gi().getFeatureFlags(),u=gi().getMiscSettings();if(!c["show-watermark"])return;const d="0.0.0"===(null===(e=window.APP_ROOT)||void 0===e||null===(e=e.match(/versions\/([^/]+)\//))||void 0===e?void 0:e[1])||"0.0.0"===(null===(t=window.APP_ROOT)||void 0===t||null===(t=t.match(/micro-apps\/(?:v2|v3)\/[^/]+\/([^/]+)/))||void 0===t?void 0:t[1]),p=null!==(n=null==vi||null===(r=vi.auth)||void 0===r||null===(r=r.getAuth())||void 0===r?void 0:r.username)&&void 0!==n?n:"",f=null!==(o=u.watermarkConfig)&&void 0!==o?o:{flags:{}},v=[..."string"==typeof f.content?[f.content]:null!==(i=f.content)&&void 0!==i?i:[],null!==(s=f.flags)&&void 0!==s&&s["show-development"]&&d?"Development":"",null!==(a=f.flags)&&void 0!==a&&a["show-user"]?p:""].filter(Boolean);if(0===v.length)return;const m={content:v,zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,h.omit)(f,["content","flags"])};uo?uo.resolve(m):(0,l.loadBricksImperatively)([vo],bi()).then((()=>{uo=document.createElement(vo),uo.resolve(m)}),(e=>{console.error("Load watermark service failed:",e)}))}();const g=p&&m?p.id!==m.id:p!==m;(0,O.clearExpressionASTCache)(),g&&(0,O.clearFunctionASTCache)();const w=gi().getFeatureFlags(),y=(0,a.A)(Io,this),E=(t,n)=>{null==u||u({status:"redirected"}),(0,a.A)(Co,this).add(y),(0,C.A)(xo,this,Bo).call(this,t,n,e)},b=()=>{const t=w["sso-enabled"]?"/sso-auth/login":"/auth/login";Jt(e),E(t,{from:e})},S=document.querySelector("#main-mount-point"),A=document.querySelector("#portal-mount-point"),I={tag:Mn.ROOT,container:S,createPortal:A},T=()=>{var e;xn(S),xn(A),(0,a.A)(Co,this).add(y);for(const e of(0,a.A)(Co,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,a.A)(Co,this).clear(),null==vi||null===(e=vi.messageDispatcher)||void 0===e||e.reset(),g&&((0,s.A)(_o,this,p),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:p,currentApp:m}})))};if(Q(m&&(re()[m.id]||m.theme)||"light"),ie("default"),m){var _,P,M,x,$,B;null==vi||null===(_=vi.checkInstalledApps)||void 0===_||_.preCheckInstalledApps(d,(e=>!!Ci(e)));const n={bailout:e=>e.unauthenticated?(b(),!0):e.redirect?(E(e.redirect.path,e.redirect.state),!0):void(0,s.A)(Ro,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,s.A)(Po,this,function(e){const t={breadcrumb:[]};for(const n of e){const{breadcrumb:e}=n;e&&(e.overwrite?t.breadcrumb=e.items:t.breadcrumb.push(...e.items))}return t}(t)),window.dispatchEvent(new CustomEvent("navConfig.change",{detail:(0,a.A)(Po,this)}))},catch:async(t,n,r,o)=>{if(!Zt(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const i=gi().getMiscSettings().noAuthGuardLoginPath;if(Zt(t)&&i)return void E(i,{from:e});if(r)throw t;return!o&&yo(t)?void window.location.reload():{failed:!0,output:{node:await Xr(t,n,!o),blockingList:[]}}}(0,a.A)(Co,this).add(y)}else b()}},r=(0,s.A)(Io,this,new Gn("page",{routeHelper:n,renderId:c})),o=(0,s.A)(ko,this,{app:m,location:e,query:new URLSearchParams(e.search),flags:w,sys:{...null==vi||null===(P=vi.auth)||void 0===P?void 0:P.getAuth(),...po(),settings:{brand:gi().getBrandSettings()}},ctxStore:new Lr("CTX",void 0,r),pendingPermissionsPreCheck:[null==vi||null===(M=vi.checkPermissions)||void 0===M?void 0:M.preCheckPermissions(d)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.A)(Po,this,void 0),fo(d),ve(null===(x=d.meta)||void 0===x?void 0:x.functions,m),null==vi||null===($=vi.flowApi)||void 0===$||$.collectContract(null===(B=d.meta)||void 0===B?void 0:B.contracts);let i,l=!1,p=[];try{or.clear();const e={};if(i=await Qr(I,function(e){if(window.parent===window)return e;let t=e;const n=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)];const r=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)],t}(d.routes),o,r,[],e),n.bailout(i))return;p=to(o),await no(i,o,p),e.child=i.menuRequestNode,r.setInitialMenuRequestNode(e),await n.mergeMenus(r.getMenuRequests())}catch(e){console.error("Router failed:",e),t&&(0,s.A)(Mo,this,!0);const r=await n.catch(e,I,t);if(!r)return;({failed:l,output:i}=r)}if(Eo(),I.child=i.node,(0,s.A)(Mo,this,!1),T(),i.route&&"routes"!==i.route.type||l){if(l||r.dispatchBeforePageLoad(),te(),ae(),ho(null==m?void 0:m.uiVersion),Ln(I),window.scrollTo(0,0),l)null==u||u({status:"failed"});else{r.dispatchPageLoad(),r.dispatchAnchorLoad(),r.dispatchOnMount(),r.initializeScrollIntoView(),r.initializeMediaChange(),r.initializeMessageDispatcher();for(const e of p)e.mountAsyncData();null==u||u({status:"ok",path:i.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=vi&&vi.auth&&!vi.auth.isLoggedIn())return void b();T()}te(),ae();const N=await Xr(new Yr(m?"page not found":"app not found"),I,!0);I.child=N,Ln(I),window.scrollTo(0,0),null==u||u({status:"not-found"}),V("rendered")}const Do="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;var jo=n(4579),Ko=n(4501),Vo=2,Wo=.16,Ho=.05,zo=.05,Go=.15,qo=5,Yo=4,Xo=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Jo(e){var t=e.r,n=e.g,r=e.b,o=(0,jo.wE)(t,n,r);return{h:360*o.h,s:o.s,v:o.v}}function Qo(e){var t=e.r,n=e.g,r=e.b;return"#".concat((0,jo.Ob)(t,n,r,!1))}function Zo(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-Vo*t:Math.round(e.h)+Vo*t:n?Math.round(e.h)+Vo*t:Math.round(e.h)-Vo*t)<0?r+=360:r>=360&&(r-=360),r}function ei(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-Wo*t:t===Yo?e.s+Wo:e.s+Ho*t)>1&&(r=1),n&&t===qo&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function ti(e,t,n){var r;return(r=n?e.v+zo*t:e.v-Go*t)>1&&(r=1),Number(r.toFixed(2))}function ni(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,Ko.RO)(e),o=qo;o>0;o-=1){var i=Jo(r),s=Qo((0,Ko.RO)({h:Zo(i,o,!0),s:ei(i,o,!0),v:ti(i,o,!0)}));n.push(s)}n.push(Qo(r));for(var a=1;a<=Yo;a+=1){var c=Jo(r),l=Qo((0,Ko.RO)({h:Zo(c,a),s:ei(c,a),v:ti(c,a)}));n.push(l)}return"dark"===t.theme?Xo.map((function(e){var r,o,i,s=e.index,a=e.opacity;return Qo((r=(0,Ko.RO)(t.backgroundColor||"#141414"),i=100*a/100,{r:((o=(0,Ko.RO)(n[s])).r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b}))})):n}var ri={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},oi={},ii={};function si(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function ai(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function ci(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function li(e,t,n){return"dark"===t?ni(e,{theme:t,backgroundColor:n})[5]:e}function ui(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?ai:si)("string"==typeof(n=t)?" --color-brand: ".concat(n,";\n"):[" --color-brand: ".concat(n.default,";")," --color-brand-hover: ".concat(n.hover,";")," --color-brand-active: ".concat(n.active,";"),""].join("\n"));var n}(n,e[n]));break;case"baseColors":t.push(function(e,t,n){return("dark"===e?ai:si)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[n,r]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(n),r.map(((e,r)=>[" --palette-".concat(n,"-").concat(r+1,"-channel: ").concat(ci(e),";")].concat("dark"===t?[]:" --palette-".concat(n,"-").concat(r+1,": rgb(var(--palette-").concat(n,"-").concat(r+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,n){return Object.fromEntries(Object.entries(e).map((e=>{var[r,o]=e;return[r,ni(o,"dark"===t?{theme:t,backgroundColor:n}:void 0)]})))}(t,e,n),e),"\n").concat(function(e,t,n){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((r=>{var[o,i]=r;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(ci(li(t[i],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(i,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(i,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(i,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,n)))}(n,e[n],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?ai:si)(function(e){return Object.entries(e).map((e=>{var[t,n]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(n,";")})).concat("").join("\n")}(t))}(n,e[n]))}})),t.length>0){const e=document.createElement("style");return e.textContent=t.join("\n\n"),document.head.appendChild(e),()=>{e.remove()}}}let di,pi,fi,hi,vi;function mi(e){if(di)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{let{data:t}=e;if((null==t?void 0:t.source)!==U)return;const n=t.payload;switch(null==n?void 0:n.type){case F:K=n.active;break;case D:j=n.panel}})),vi=null==e?void 0:e.hooks,(0,c.initializeI18n)(Gt,qt),d.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{d.locale(c.i18n.language)})),A(),di=new Ei,di}Object.keys(ri).forEach((function(e){oi[e]=ni(ri[e]),oi[e].primary=oi[e][5],ii[e]=ni(ri[e],{theme:"dark",backgroundColor:"#141414"}),ii[e].primary=ii[e][5]})),oi.red,oi.volcano,oi.gold,oi.orange,oi.yellow,oi.lime,oi.green,oi.cyan,oi.blue,oi.geekblue,oi.purple,oi.magenta,oi.grey;const gi=function(){const e=S();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return di};var wi=new WeakMap,yi=new WeakMap;class Ei{constructor(){(0,i.A)(this,wi,!1),(0,i.A)(this,yi,!1),(0,o.A)(this,"version",3)}initialize(e){var t;if((0,a.A)(wi,this))throw new Error("The runtime cannot be initialized more than once");(0,s.A)(wi,this,!0),function(e){(0,u.isObject)(e.settings)&&(0,u.deepFreeze)(e.settings),e.brickPackages&&(0,u.deepFreeze)(e.brickPackages)}(e),pi=e;const{notification:n,dialog:r}=Si();var o;!1!==n&&(o=null!=n?n:"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{tn=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{Yt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=r?r:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?ui({type:"brandColor",...e.brandColor}):e.baseColors?ui({type:"baseColors",...e.baseColors}):e.variables&&ui({type:"variables",...e.variables}))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}async bootstrap(e){if(e&&this.initialize(e),(0,a.A)(yi,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.A)(yi,this,!0),fi=new Lo(pi.storyboards),await fi.bootstrap()}getRecentApps(){var e,t;return null!==(e=null===(t=fi)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=fi)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Ge(e,t)}getFeatureFlags(){var e,t;return{...null===(e=pi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=fi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags,"migrate-to-brick-next-v3":!0}}getMiscSettings(){var e,t;return{...null===(e=pi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=fi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc}}getBrandSettings(){var e;return{base_title:"DevOps 管理专家",...null===(e=pi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=pi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e,t;return null!==(e=null===(t=pi)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=pi)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=fi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t?void 0:t.localeTitle)||(e?`${e} - ${n}`:n)}getNavConfig(){var e;return null===(e=fi)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,l.loadBricksImperatively)(e,bi())}}function bi(){var e,t,n,r,o;return null!==(e=hi)&&void 0!==e?e:hi=function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...t,...e].forEach((e=>{const t=e.filePath.split("/")[1];n.has(t)||n.set(t,e)})),Array.from(n.values())}(null!==(t=null!==(n=null!==(r=null===(o=pi)||void 0===o?void 0:o.brickPackages)&&void 0!==r?r:Do)&&void 0!==n?n:window.STANDALONE_BRICK_PACKAGES)&&void 0!==t?t:[],window.PUBLIC_DEPS)}function Si(){var e,t;return null!==(e=null===(t=pi)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function Ai(){var e;return null===(e=fi)||void 0===e?void 0:e.getRenderId()}function ki(){var e;return null===(e=fi)||void 0===e?void 0:e.getRuntimeContext()}function Ii(e){var t;return null===(t=pi)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Ci(e){var t;return null===(t=Ii(e))||void 0===t?void 0:t.app}function Ri(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==vi||null===(e=vi.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function Oi(){var e;return null==vi||null===(e=vi.auth)||void 0===e?void 0:e.getAuth()}function Ti(){var e,t;return null==vi||null===(e=vi.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function _i(){var e;return null==vi||null===(e=vi.auth)||void 0===e?void 0:e.isLoggedIn()}var Pi=new WeakMap;const Mi=new class{constructor(){(0,i.A)(this,Pi,new Map)}define(e,t){(0,a.A)(Pi,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,a.A)(Pi,this).set(e,t)}get(e){return(0,a.A)(Pi,this).get(e)}};async function xi(e,t,n){return nt(await Xe(e),e,"resolve",t,n)}function Li(e){let t,{portal:n,scope:r="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n;t=n||(()=>(i=document.createElement("div"),i.style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));let s,a,l=!1;return{async render(n){let{theme:u,uiVersion:d,language:p,context:f,functions:v,templates:m,i18n:g,url:w,app:y}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l)throw new Error("The root is unmounted and cannot be rendered any more");const E=[].concat(n),b=s,S=(0,h.uniqueId)("render-id-");s=new Gn(r,{unknownBricks:o,renderId:S});const A={ctxStore:new Lr("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map};if(w){const e=new URL(w);A.query=e.searchParams,A.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const k={tag:Mn.ROOT,container:e,createPortal:t};if("page"===r){var I,C;Q(null!=u?u:"light"),ie("default"),ho(d),p&&await c.i18n.changeLanguage(p),null!==(I=y)&&void 0!==I||(y={id:"demo",homepage:"/demo"}),A.app=y;const e={app:y,meta:{i18n:g,customTemplates:m}};null===(C=a)||void 0===C||C(),a=L(e),fo(e),ve(v,y)}A.ctxStore.define(f,A);let R,O=!1,T=[];try{R=await Zr(k,E,A,s,[],{}),T=to(A),await no(R,A,T)}catch(e){O=!0,R={node:await Xr(e,k,"page"===r),blockingList:[]}}if(k.child=R.node,null==b||b.dispatchOnUnmount(),null==b||b.dispose(),xn(e),i&&xn(i),"page"===r&&(O||s.dispatchBeforePageLoad(),te(),ae()),Ln(k),"page"===r&&window.scrollTo(0,0),!O){for(const e of T)e.mountAsyncData();"page"===r&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}},unmount(){l||(l=!0,xn(e),i&&(xn(i),n||i.remove()))}}}function $i(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...ki()};t&&(n.query=new URLSearchParams(k().location.search));const r=t=>{if("string"==typeof t){if((0,O.isEvaluable)(t)){const e=ut(t,n);return Qe(e),e}return(0,_.inject)(t,n)}return!(0,u.isObject)(t)||Ze(e)?t:Array.isArray(t)?t.map((e=>r(e))):Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[r(t),r(n)]})))};return r(e)}const Bi=[];function Ni(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=-1;const n=()=>{if(t>-1){const e=Bi.indexOf(t);e>-1&&Bi.splice(e,1)}};return{push:()=>{var r;return n(),t=(null!==(r=Bi[Bi.length-1])&&void 0!==r?r:-1)+1,Bi.push(t),t+e},pull:n}}}}]);
|
|
3
|
-
//# sourceMappingURL=5582.9e7b28a7.js.map
|