@next-bricks/visual-builder 1.33.6 → 1.33.8
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 +5 -5
- package/dist/chunks/{114.c25646f6.js → 114.fdfd0dd9.js} +2 -2
- package/dist/chunks/{114.c25646f6.js.map → 114.fdfd0dd9.js.map} +1 -1
- package/dist/chunks/2252.25422902.js +3 -0
- package/dist/chunks/2252.25422902.js.map +1 -0
- package/dist/chunks/{2980.4cc0f343.js → 2980.0e831600.js} +2 -2
- package/dist/chunks/{2980.4cc0f343.js.map → 2980.0e831600.js.map} +1 -1
- package/dist/chunks/{3171.78801e88.js → 3171.fb82432a.js} +2 -2
- package/dist/chunks/{3171.78801e88.js.map → 3171.fb82432a.js.map} +1 -1
- package/dist/chunks/3933.67a1dc9c.js +2 -0
- package/dist/chunks/{3933.661888e2.js.map → 3933.67a1dc9c.js.map} +1 -1
- package/dist/chunks/{4837.d6d3ee9e.js → 4837.cd50030b.js} +2 -2
- package/dist/chunks/{4837.d6d3ee9e.js.map → 4837.cd50030b.js.map} +1 -1
- package/dist/chunks/{5552.069f3ddb.js → 5552.07444449.js} +2 -2
- package/dist/chunks/{5552.069f3ddb.js.map → 5552.07444449.js.map} +1 -1
- package/dist/chunks/{5814.eb38f464.js → 5814.8ed8f39d.js} +3 -3
- package/dist/chunks/{5814.eb38f464.js.map → 5814.8ed8f39d.js.map} +1 -1
- package/dist/chunks/6314.fb0eb5d4.js +2 -0
- package/dist/chunks/{6314.2b8fa035.js.map → 6314.fb0eb5d4.js.map} +1 -1
- package/dist/chunks/7150.0e64cf9e.js +3 -0
- package/dist/chunks/{7150.4d8eda87.js.map → 7150.0e64cf9e.js.map} +1 -1
- package/dist/chunks/{7218.c98c7ce3.js → 7218.9e675e7d.js} +2 -2
- package/dist/chunks/{7218.c98c7ce3.js.map → 7218.9e675e7d.js.map} +1 -1
- package/dist/chunks/7426.4f61da8a.js +3 -0
- package/dist/chunks/7426.4f61da8a.js.map +1 -0
- package/dist/chunks/{7733.4fc7b710.js → 7733.dfa9b454.js} +2 -2
- package/dist/chunks/{7733.4fc7b710.js.map → 7733.dfa9b454.js.map} +1 -1
- package/dist/chunks/{790.7771a19d.js → 790.733521cc.js} +2 -2
- package/dist/chunks/{790.7771a19d.js.map → 790.733521cc.js.map} +1 -1
- package/dist/chunks/9027.58391f17.js +2 -0
- package/dist/chunks/{9027.04c9b690.js.map → 9027.58391f17.js.map} +1 -1
- package/dist/chunks/{chat-preview.1f47cd1b.js → chat-preview.bb6cd3b4.js} +3 -3
- package/dist/chunks/{chat-preview.1f47cd1b.js.map → chat-preview.bb6cd3b4.js.map} +1 -1
- package/dist/chunks/check-editor-by-name.2c85abd3.js +2 -0
- package/dist/chunks/{check-editor-by-name.a14a198d.js.map → check-editor-by-name.2c85abd3.js.map} +1 -1
- package/dist/chunks/{contract-select.3e4f994a.js → contract-select.5302ec7e.js} +3 -3
- package/dist/chunks/{contract-select.3e4f994a.js.map → contract-select.5302ec7e.js.map} +1 -1
- package/dist/chunks/generate-snippets-context-menu.63e8786f.js +2 -0
- package/dist/chunks/{generate-snippets-context-menu.61a7ebf6.js.map → generate-snippets-context-menu.63e8786f.js.map} +1 -1
- package/dist/chunks/get-data-deps.d278d3ae.js +2 -0
- package/dist/chunks/{get-data-deps.a0530f8f.js.map → get-data-deps.d278d3ae.js.map} +1 -1
- package/dist/chunks/get-dependency-tree.1441e3c8.js +2 -0
- package/dist/chunks/{get-dependency-tree.ef3c0721.js.map → get-dependency-tree.1441e3c8.js.map} +1 -1
- package/dist/chunks/{inject-chat-preview-agent.0ac2fdfe.js → inject-chat-preview-agent.73e5e6da.js} +2 -2
- package/dist/chunks/{inject-chat-preview-agent.0ac2fdfe.js.map → inject-chat-preview-agent.73e5e6da.js.map} +1 -1
- package/dist/chunks/inject-preview-agent.b12c08c4.js +2 -0
- package/dist/chunks/{inject-preview-agent.4e9f6d84.js.map → inject-preview-agent.b12c08c4.js.map} +1 -1
- package/dist/chunks/main.07bd0560.js +2 -0
- package/dist/chunks/main.07bd0560.js.map +1 -0
- package/dist/chunks/parse-path.e260969b.js +2 -0
- package/dist/chunks/{parse-path.14a688cd.js.map → parse-path.e260969b.js.map} +1 -1
- package/dist/chunks/{pre-generated-container.d06024ab.js → pre-generated-container.182db37b.js} +2 -2
- package/dist/chunks/{pre-generated-container.d06024ab.js.map → pre-generated-container.182db37b.js.map} +1 -1
- package/dist/chunks/{pre-generated-preview.2993025c.js → pre-generated-preview.9fe5a3d8.js} +3 -3
- package/dist/chunks/{pre-generated-preview.2993025c.js.map → pre-generated-preview.9fe5a3d8.js.map} +1 -1
- package/dist/chunks/{property-editor.57302589.js → property-editor.6f5b4896.js} +2 -2
- package/dist/chunks/{property-editor.57302589.js.map → property-editor.6f5b4896.js.map} +1 -1
- package/dist/chunks/{workbench-action-list.eafcad31.js → workbench-action-list.a319ba8f.js} +2 -2
- package/dist/chunks/{workbench-action-list.eafcad31.js.map → workbench-action-list.a319ba8f.js.map} +1 -1
- package/dist/chunks/{workbench-history-action.f31e6bda.js → workbench-history-action.e20b5e26.js} +3 -3
- package/dist/chunks/{workbench-history-action.f31e6bda.js.map → workbench-history-action.e20b5e26.js.map} +1 -1
- package/dist/index.b98e786d.js +2 -0
- package/dist/index.b98e786d.js.map +1 -0
- package/dist/manifest.json +32 -32
- package/dist/types.json +79 -79
- package/package.json +3 -3
- package/dist/chunks/2252.cc6071dd.js +0 -3
- package/dist/chunks/2252.cc6071dd.js.map +0 -1
- package/dist/chunks/3933.661888e2.js +0 -2
- package/dist/chunks/6314.2b8fa035.js +0 -2
- package/dist/chunks/7150.4d8eda87.js +0 -3
- package/dist/chunks/7426.70d95964.js +0 -3
- package/dist/chunks/7426.70d95964.js.map +0 -1
- package/dist/chunks/9027.04c9b690.js +0 -2
- package/dist/chunks/check-editor-by-name.a14a198d.js +0 -2
- package/dist/chunks/generate-snippets-context-menu.61a7ebf6.js +0 -2
- package/dist/chunks/get-data-deps.a0530f8f.js +0 -2
- package/dist/chunks/get-dependency-tree.ef3c0721.js +0 -2
- package/dist/chunks/inject-preview-agent.4e9f6d84.js +0 -2
- package/dist/chunks/main.6e0f9e0a.js +0 -2
- package/dist/chunks/main.6e0f9e0a.js.map +0 -1
- package/dist/chunks/parse-path.14a688cd.js +0 -2
- package/dist/index.e97e1f75.js +0 -2
- package/dist/index.e97e1f75.js.map +0 -1
- /package/dist/chunks/{2252.cc6071dd.js.LICENSE.txt → 2252.25422902.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{5814.eb38f464.js.LICENSE.txt → 5814.8ed8f39d.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7150.4d8eda87.js.LICENSE.txt → 7150.0e64cf9e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7426.70d95964.js.LICENSE.txt → 7426.4f61da8a.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-preview.1f47cd1b.js.LICENSE.txt → chat-preview.bb6cd3b4.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{contract-select.3e4f994a.js.LICENSE.txt → contract-select.5302ec7e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{pre-generated-preview.2993025c.js.LICENSE.txt → pre-generated-preview.9fe5a3d8.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-history-action.f31e6bda.js.LICENSE.txt → workbench-history-action.e20b5e26.js.LICENSE.txt} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 7150.4d8eda87.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[7150],{7150:(e,t,n)=>{n.r(t);var a,i=n(4635),o=n(918),r=n(6902),s=n(5536),l=n(6121),c=n(829),d=n(2740),h=n(8769),u=n.n(h),p=n(4782),m=n(1389),A=n(7180),g=n(9765),v=n(3373),b=n.n(v);let f,E,k,w,y,x,N,L,M,C,T,R,O,I,_;const S=(0,m.wrapBrick)("eo-icon"),{defineElement:D,property:P,event:W}=(0,p.createDecorators)();let F;var $=new WeakMap,B=new WeakMap,U=new WeakMap,K=new WeakMap,j=new WeakSet,z=new WeakMap,V=new WeakMap,H=new WeakMap;class q extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,j),(0,o.A)(this,$,E(this)),(0,o.A)(this,B,(k(this),w(this))),(0,o.A)(this,U,(y(this),x(this))),(0,o.A)(this,K,(N(this),L(this))),(0,o.A)(this,z,(T(this),e=>{e!==this.active&&(this.active=e,(0,s.A)(j,this,M).emit(e))})),(0,o.A)(this,V,R(this)),(0,o.A)(this,H,(_(this),()=>{(0,s.A)(j,this,O).emit()}))}get titleLabel(){return(0,c.A)($,this)}set titleLabel(e){(0,l.A)($,this,e)}get active(){return(0,c.A)(B,this)}set active(e){(0,l.A)(B,this,e)}get badge(){return(0,c.A)(U,this)}set badge(e){(0,l.A)(U,this,e)}render(){return u().createElement(Y,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:(0,c.A)(z,this),onFirstActivated:(0,c.A)(H,this)})}}function Y(e){let{titleLabel:t,active:n,badge:a,onActiveChange:i,onFirstActivated:o}=e;const[r,s]=(0,h.useState)(n),[l,c]=(0,h.useState)(!1);(0,h.useEffect)((()=>{s(n)}),[n]),(0,h.useEffect)((()=>{null==i||i(r)}),[r,i]);const d=(0,h.useCallback)((()=>{s((e=>!e)),l||r||(c(!0),null==o||o())}),[l,r,o]),p=(0,h.useRef)(),[m,A]=(0,h.useState)(!1),g=(0,h.useMemo)((()=>function(e){let t;const n=()=>cancelAnimationFrame(t),a=function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];t&&n(),t=requestAnimationFrame((()=>{(()=>{A(p.current.scrollTop>0)})(...a)}))};return a.cancel=n,a}()),[]);return u().createElement("div",{className:b()("pane",{scrolled:m})},u().createElement("div",{className:"pane-header",tabIndex:0,onClick:d},u().createElement("div",{className:"pane-title"},u().createElement("span",{className:"title-icon"},r?u().createElement(S,{lib:"antd",theme:"outlined",icon:"down"}):u().createElement(S,{lib:"antd",theme:"outlined",icon:"right"})),u().createElement("div",{className:"title-label"},t),u().createElement("slot",{name:"title"})),u().createElement("slot",{name:"actions"}),a&&u().createElement("div",{className:"badge"},a),u().createElement("div",{className:"pane-scroll-shadow"})),u().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:g,ref:p},u().createElement("slot",null,u().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}a=q,({e:[E,k,w,y,x,N,L,M,C,T,R,O,I,_],c:[F,f]}=(0,d.A)(a,[D("visual-builder.workbench-pane",{styleTexts:[A.A,g.A]})],[[P(),1,"titleLabel"],[P({type:Boolean}),1,"active"],[P({type:Number}),1,"badge"],[W({type:"active.change"}),1,"activeChangeEvent",e=>(0,c.A)(K,e),(e,t)=>(0,l.A)(K,e,t)],[W({type:"active.firstActivated"}),1,"activeFirstActivatedEvent",e=>(0,c.A)(V,e),(e,t)=>(0,l.A)(V,e,t)]],0,(e=>H.has((0,r.A)(e))),m.ReactNextElement)),f();var G,X=n(4586),J=n(2150);let Z,Q,ee;const{defineElement:te,property:ne}=(0,p.createDecorators)();let ae;var ie=new WeakMap,oe=new WeakMap,re=new WeakMap,se=new WeakMap;class le extends m.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,ie,Q(this)),(0,o.A)(this,oe,(ee(this),()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")})),(0,o.A)(this,re,(()=>{const e=(0,c.A)(oe,this).call(this).assignedNodes();for(const t of e)t.active?t.style.flex=String(t.activeFlex??"1"):t.style.flex="initial"})),(0,o.A)(this,se,(e=>{const t=e.target.assignedNodes();for(const e of t)e.addEventListener("active.change",(0,c.A)(re,this))})),(0,X.A)(this,"refCallback",(()=>{(0,c.A)(re,this).call(this);const e=(0,c.A)(oe,this).call(this);null==e||e.addEventListener("slotchange",(e=>{(0,c.A)(se,this).call(this,e)}))}))}get titleLabel(){return(0,c.A)(ie,this)}set titleLabel(e){(0,l.A)(ie,this,e)}render(){return u().createElement(ce,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function ce(e){let{titleLabel:t,refCallback:n}=e;return u().createElement("div",{className:"sidebar",ref:n},u().createElement("div",{className:"title-container"},u().createElement("div",{className:"title-label"},t),u().createElement("slot",{name:"titleToolbar"})),u().createElement("div",{className:"pane-container"},u().createElement("slot",null)))}G=le,({e:[Q,ee],c:[ae,Z]}=(0,d.A)(G,[te("visual-builder.workbench-sidebar",{styleTexts:[J.A]})],[[ne(),1,"titleLabel"]],0,void 0,m.ReactNextElement)),Z();var de,he=n(5292);let ue,pe,me,Ae,ge,ve,be,fe,Ee,ke,we;const{defineElement:ye,property:xe}=(0,p.createDecorators)(),Ne=(0,m.wrapBrick)("eo-link"),Le=(0,m.wrapBrick)("eo-icon");let Me;var Ce=new WeakMap,Te=new WeakMap,Re=new WeakMap,Oe=new WeakMap,Ie=new WeakMap;class _e extends m.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,Ce,pe(this)),(0,o.A)(this,Te,(me(this),Ae(this))),(0,o.A)(this,Re,(ge(this),ve(this))),(0,o.A)(this,Oe,(be(this),fe(this))),(0,o.A)(this,Ie,(Ee(this),ke(this))),we(this)}get icon(){return(0,c.A)(Ce,this)}set icon(e){(0,l.A)(Ce,this,e)}get to(){return(0,c.A)(Te,this)}set to(e){(0,l.A)(Te,this,e)}get active(){return(0,c.A)(Re,this)}set active(e){(0,l.A)(Re,this,e)}get href(){return(0,c.A)(Oe,this)}set href(e){(0,l.A)(Oe,this,e)}get target(){return(0,c.A)(Ie,this)}set target(e){(0,l.A)(Ie,this,e)}render(){return u().createElement(Se,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target})}}function Se(e){let{icon:t,to:n,active:a,href:i,target:o}=e;return u().createElement(Ne,{className:b()("action",{active:a}),url:n,href:i,target:o},u().createElement(Le,t))}de=_e,({e:[pe,me,Ae,ge,ve,be,fe,Ee,ke,we],c:[Me,ue]}=(0,d.A)(de,[ye("visual-builder.workbench-action",{styleTexts:[he.A]})],[[xe({attribute:!1}),1,"icon"],[xe(),1,"to"],[xe({type:Boolean}),1,"active"],[xe(),1,"href"],[xe(),1,"target"]],0,void 0,m.ReactNextElement)),ue();var De=n(9322),Pe=n(1201),We=n(1030);function Fe(e,t,n,a){const i=[],o=[],r=[];let s=0;return e&&e.forEach((e=>{if(e.key=""===a?`${s}`:`${a}.${s}`,function(e){return"group"===e.type}(e)||function(e,t){return Boolean("subMenu"===e.type||void 0)}(e)){const a=Fe(e.items,t,n,e.key);i.push(...a.selectedKeys),(a.selectedKeys.length||e.defaultExpanded)&&o.push(e.key),o.push(...a.openedKeys),r.push(...a.matchedKeys)}else if(function(e,t,n){if(!e.to)return!1;const a="object"==typeof e.to?e.to:(0,Pe.parsePath)(e.to),i=a.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");let o=!!(0,De.matchPath)(t,{path:i,exact:e.exact});if(o&&e.activeMatchSearch&&(o=$e(n,a.search)),!o&&Array.isArray(e.activeIncludes))for(const a of e.activeIncludes){let e,i=!0;(0,We.isObject)(a)?(e=Array.isArray(a.path)?a.path:[a.path],i=a.exact):e=[a];for(const a of e){var r;let e;const s=a.includes("?");if(s&&(e=(0,Pe.parsePath)(a)),o=!!(0,De.matchPath)(t,{path:s?e.pathname:a,exact:i}),o&&null!==(r=e)&&void 0!==r&&r.search&&(o=$e(n,e.search)),o)break}if(o)break}if(o&&Array.isArray(e.activeExcludes))for(const n of e.activeExcludes){let e,a=!0;(0,We.isObject)(n)?(e=Array.isArray(n.path)?n.path:[n.path],a=n.exact):e=[n];for(const n of e)if(o=!(0,De.matchPath)(t,{path:n,exact:a}),!o)break;if(!o)break}return o}(e,t,n)){i.push(String(e.key));const t=e.key.split(".");for(let e=0;e<t.length;e++)r.push(t.slice(0,e+1).join("."))}s+=1})),i.length&&""!==a&&o.push(a),{selectedKeys:i,openedKeys:o,matchedKeys:r}}function $e(e,t){const n=new URLSearchParams(e),a=new URLSearchParams(t);for(const[e,t]of a.entries())if((n.get(e)??"")!==t)return!1;return!0}var Be,Ue=n(3430);let Ke,je,ze,Ve,He;const qe=(0,m.wrapBrick)("visual-builder.workbench-action"),{defineElement:Ye,property:Ge}=(0,p.createDecorators)();let Xe;var Je=new WeakMap,Ze=new WeakMap;class Qe extends m.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,Je,je(this)),(0,o.A)(this,Ze,(ze(this),Ve(this))),He(this)}get appId(){return(0,c.A)(Je,this)}set appId(e){(0,l.A)(Je,this,e)}get menu(){return(0,c.A)(Ze,this)}set menu(e){(0,l.A)(Ze,this,e)}render(){return u().createElement(nt,{appId:this.appId,menu:this.menu})}}let et;Be=Qe,({e:[je,ze,Ve,He],c:[Xe,Ke]}=(0,d.A)(Be,[Ye("visual-builder.workbench-action-list",{styleTexts:[Ue.A]})],[[Ge(),1,"appId"],[Ge({attribute:!1}),1,"menu"]],0,void 0,m.ReactNextElement)),Ke();const tt=new Map;function nt(e){var t;let{appId:n,menu:a}=e;const i=(0,De.getHistory)(),[o,r]=(0,h.useState)(),[s,l]=(0,h.useState)(i.location);return(0,h.useEffect)((()=>{const e=i.listen((e=>{l(e)}));return e}),[i]),(0,h.useEffect)((()=>{et||(et=n),et!==n&&(tt.clear(),et=n)}),[n]),(0,h.useEffect)((()=>{const{pathname:e,search:t}=s,{selectedKeys:n}=Fe((null==a?void 0:a.menuItems)??[],e,t,"");r(Number(n[0]))}),[a,s]),u().createElement("div",{className:"workBenchActionList"},null==a||null===(t=a.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){let n=e.to;return o!==t&&tt.has(t)&&(n=tt.get(t)),u().createElement(qe,{key:t,icon:e.icon,to:n,href:e.href,target:e.target,active:o===t,onClick:()=>(e=>{e.href||tt.set(o,`${s.pathname}${s.search}`)})(e)})}})).filter(Boolean))}var at,it=n(4940),ot=n(7758),rt=n(9406),st=n(675),lt=n(7995),ct=n(6275);let dt,ht,ut,pt,mt,At,gt,vt,bt,ft,Et,kt,wt,yt,xt,Nt,Lt,Mt,Ct,Tt,Rt,Ot,It,_t,St,Dt,Pt,Wt,Ft,$t,Bt,Ut,Kt,jt,zt,Vt,Ht,qt,Yt,Gt,Xt,Jt,Zt,Qt,en,tn,nn,an,on,rn,sn,ln,cn,dn,hn,un,pn;function mn(e){return e.key}n(6477);const{defineElement:An,property:gn,event:vn}=(0,p.createDecorators)();let bn;var fn=new WeakMap,En=new WeakMap,kn=new WeakMap,wn=new WeakMap,yn=new WeakMap,xn=new WeakMap,Nn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,Cn=new WeakMap,Tn=new WeakMap,Rn=new WeakMap,On=new WeakMap,In=new WeakMap,_n=new WeakMap,Sn=new WeakMap,Dn=new WeakMap,Pn=new WeakMap,Wn=new WeakMap,Fn=new WeakSet,$n=new WeakMap,Bn=new WeakMap,Un=new WeakMap,Kn=new WeakMap,jn=new WeakMap,zn=new WeakMap,Vn=new WeakMap,Hn=new WeakMap,qn=new WeakMap;class Yn extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,Fn),(0,o.A)(this,fn,ht(this)),(0,o.A)(this,En,(ut(this),pt(this))),(0,o.A)(this,kn,(mt(this),At(this))),(0,o.A)(this,wn,(gt(this),vt(this))),(0,o.A)(this,yn,(bt(this),ft(this))),(0,o.A)(this,xn,(Et(this),kt(this))),(0,o.A)(this,Nn,(wt(this),yt(this))),(0,o.A)(this,Ln,(xt(this),Nt(this))),(0,o.A)(this,Mn,(Lt(this),Mt(this))),(0,o.A)(this,Cn,(Ct(this),Tt(this))),(0,o.A)(this,Tn,(Rt(this),Ot(this))),(0,o.A)(this,Rn,(It(this),_t(this))),(0,o.A)(this,On,(St(this),Dt(this))),(0,o.A)(this,In,(Pt(this),Wt(this))),(0,o.A)(this,_n,(Ft(this),$t(this))),(0,o.A)(this,Sn,(Bt(this),Ut(this))),(0,o.A)(this,Dn,(Kt(this),jt(this))),(0,o.A)(this,Pn,(zt(this),Vt(this))),(0,o.A)(this,Wn,(Ht(this),qt(this))),(0,o.A)(this,$n,(Xt(this),e=>{(0,s.A)(Fn,this,Yt).emit(e)})),(0,o.A)(this,Bn,Jt(this)),(0,o.A)(this,Un,(en(this),e=>()=>{(0,s.A)(Fn,this,Zt).emit(e.data)})),(0,o.A)(this,Kn,tn(this)),(0,o.A)(this,jn,(on(this),e=>{(0,s.A)(Fn,this,nn).emit(e)})),(0,o.A)(this,zn,rn(this)),(0,o.A)(this,Vn,(cn(this),e=>t=>{t.preventDefault(),(0,s.A)(Fn,this,sn).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})})),(0,o.A)(this,Hn,dn(this)),(0,o.A)(this,qn,(pn(this),(e,t)=>{(0,s.A)(Fn,this,hn).emit({nodeId:e,collapsed:t})}))}get nodes(){return(0,c.A)(fn,this)}set nodes(e){(0,l.A)(fn,this,e)}get actions(){return(0,c.A)(En,this)}set actions(e){(0,l.A)(En,this,e)}get actionsHidden(){return(0,c.A)(kn,this)}set actionsHidden(e){(0,l.A)(kn,this,e)}get placeholder(){return(0,c.A)(wn,this)}set placeholder(e){(0,l.A)(wn,this,e)}get isTransformName(){return(0,c.A)(yn,this)}set isTransformName(e){(0,l.A)(yn,this,e)}get searchPlaceholder(){return(0,c.A)(xn,this)}set searchPlaceholder(e){(0,l.A)(xn,this,e)}get noSearch(){return(0,c.A)(Nn,this)}set noSearch(e){(0,l.A)(Nn,this,e)}get activeKey(){return(0,c.A)(Ln,this)}set activeKey(e){(0,l.A)(Ln,this,e)}get showMatchedNodeOnly(){return(0,c.A)(Mn,this)}set showMatchedNodeOnly(e){(0,l.A)(Mn,this,e)}get matchNodeDataFields(){return(0,c.A)(Cn,this)}set matchNodeDataFields(e){(0,l.A)(Cn,this,e)}get fixedActionsFor(){return(0,c.A)(Tn,this)}set fixedActionsFor(e){(0,l.A)(Tn,this,e)}get collapsible(){return(0,c.A)(Rn,this)}set collapsible(e){(0,l.A)(Rn,this,e)}get collapsedNodes(){return(0,c.A)(On,this)}set collapsedNodes(e){(0,l.A)(On,this,e)}get allowDrag(){return(0,c.A)(In,this)}set allowDrag(e){(0,l.A)(In,this,e)}get allowDragToRoot(){return(0,c.A)(_n,this)}set allowDragToRoot(e){(0,l.A)(_n,this,e)}get allowDragToInside(){return(0,c.A)(Sn,this)}set allowDragToInside(e){(0,l.A)(Sn,this,e)}get nodeKey(){return(0,c.A)(Dn,this)}set nodeKey(e){(0,l.A)(Dn,this,e)}get skipNotify(){return(0,c.A)(Pn,this)}set skipNotify(e){(0,l.A)(Pn,this,e)}render(){return u().createElement(it.e.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,c.A)($n,this)}},u().createElement(rt.N.Provider,{value:{activeKey:this.activeKey,basePaddingLeft:5,showMatchedNodeOnly:this.showMatchedNodeOnly,isTransformName:this.isTransformName,fixedActionsFor:this.fixedActionsFor,nodeKey:this.nodeKey,collapsible:this.collapsible,collapsedNodes:this.collapsedNodes,getCollapsedId:mn,onNodeToggle:(0,c.A)(qn,this),skipNotify:this.skipNotify,clickFactory:(0,c.A)(Un,this),contextMenuFactory:(0,c.A)(Vn,this),matchNode:(e,t)=>{var n;return(0,st.U)(e.name,t)||!(null===(n=this.matchNodeDataFields)||void 0===n||!n.length)&&(0,st.U)("*"===this.matchNodeDataFields?e.data:(0,We.pick)(e.data,this.matchNodeDataFields),t)}}},u().createElement(ot.cU,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:(0,c.A)(jn,this),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}at=Yn,({e:[ht,ut,pt,mt,At,gt,vt,bt,ft,Et,kt,wt,yt,xt,Nt,Lt,Mt,Ct,Tt,Rt,Ot,It,_t,St,Dt,Pt,Wt,Ft,$t,Bt,Ut,Kt,jt,zt,Vt,Ht,qt,Yt,Gt,Xt,Jt,Zt,Qt,en,tn,nn,an,on,rn,sn,ln,cn,dn,hn,un,pn],c:[bn,dt]}=(0,d.A)(at,[An("visual-builder.workbench-tree",{styleTexts:[lt.A,ct.A]})],[[gn({attribute:!1}),1,"nodes"],[gn({attribute:!1}),1,"actions"],[gn({type:Boolean}),1,"actionsHidden"],[gn(),1,"placeholder"],[gn({type:Boolean}),1,"isTransformName"],[gn(),1,"searchPlaceholder"],[gn({type:Boolean}),1,"noSearch"],[gn({attribute:!1}),1,"activeKey"],[gn({type:Boolean}),1,"showMatchedNodeOnly"],[gn({attribute:!1}),1,"matchNodeDataFields"],[gn({attribute:!1}),1,"fixedActionsFor"],[gn({type:Boolean}),1,"collapsible"],[gn({attribute:!1}),1,"collapsedNodes"],[gn({type:Boolean}),1,"allowDrag"],[gn({type:Boolean}),1,"allowDragToRoot"],[gn({type:Boolean}),1,"allowDragToInside"],[gn({type:String}),1,"nodeKey"],[gn({type:Boolean}),1,"skipNotify"],[vn({type:"action.click"}),1,"actionClickEvent",e=>(0,c.A)(Wn,e),(e,t)=>(0,l.A)(Wn,e,t)],[vn({type:"node.click"}),1,"nodeClickEvent",e=>(0,c.A)(Bn,e),(e,t)=>(0,l.A)(Bn,e,t)],[vn({type:"node.drop"}),1,"nodeDropEvent",e=>(0,c.A)(Kn,e),(e,t)=>(0,l.A)(Kn,e,t)],[vn({type:"context.menu"}),1,"nodeContextMenuEvent",e=>(0,c.A)(zn,e),(e,t)=>(0,l.A)(zn,e,t)],[vn({type:"node.toggle"}),1,"nodeToggleEvent",e=>(0,c.A)(Hn,e),(e,t)=>(0,l.A)(Hn,e,t)]],0,(e=>qn.has((0,r.A)(e))),m.ReactNextElement)),dt();var Gn=n(1351),Xn=n(9027);n(6788),customElements.define("visual-builder.inject-preview-agent",(0,Gn.createProviderClass)((function(e,t){return(0,Xn.A)(e,t)})));var Jn=n(155),Zn=n.n(Jn),Qn=n(1361),ea=n(5502);let ta=function(e){return e.LOAD_MORE="LOAD_MORE",e.LOADING="LOADING",e.NO_DATA="NO_DATA",e.NODE="NODE",e.ADD="ADD",e.EDIT="EDIT",e.DELETE="DELETE",e.IMPORT="IMPORT",e.CLONE="CLONE",e.APPEND_RELATION="APPEND_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REMOVE_RELATION="REMOVE_RELATION",e.ROLLBACK="ROLLBACK",e.ROLLBACK_ALL="ROLLBACK_ALL",e.ADD_FULL="ADD_FULL",e.EDIT_FULL="EDIT_FULL",e.DELETE_FULL="DELETE_FULL",e.IMPORT_FULL="IMPORT_FULL",e.CLONE_FULL="CLONE_FULL",e.APPEND_RELATION_FULL="APPEND_RELATION_FULL",e.UPDATE_RELATION_FULL="UPDATE_RELATION_FULL",e.REMOVE_RELATION_FULL="REMOVE_RELATION_FULL",e.ROLLBACK_FULL="ROLLBACK_FULL",e.ROLLBACK_ALL_FULL="ROLLBACK_ALL_FULL",e.PROJECT="PROJECT",e.USER="USER",e.PERMISSION="PERMISSION",e.BRICK="BRICK",e.ROUTE="ROUTE",e.TEMPLATE="TEMPLATE",e.SNIPPET="SNIPPET",e.I18N="I18N",e.IMAGE="IMAGE",e.FUNCTION="FUNCTION",e.MENU="MENU",e.MENU_ITEM="MENU_ITEM",e.WORKFLOW="WORKFLOW",e}({});const na="bricks/visual-builder/workbench-history-action";var aa=n(9740),ia=n(6330),oa=n(9422),ra=function(){var e=(0,ia.A)((function*(e,t,n){return(yield oa.http.get("api/gateway/next_builder.workspace.GetChangeHistory/api/v1/next-builder/workspace/".concat(e,"/changes"),(0,aa.A)((0,aa.A)({},n),{},{params:t}))).data}));return function(t,n,a){return e.apply(this,arguments)}}(),sa=n(8799);const la={add:`${na}:${ta.ADD}`,edit:`${na}:${ta.EDIT}`,delete:`${na}:${ta.DELETE}`,batch_delete:`${na}:${ta.DELETE}`,import:`${na}:${ta.IMPORT}`,clone:`${na}:${ta.CLONE}`,append_relation:`${na}:${ta.APPEND_RELATION}`,update_relation:`${na}:${ta.UPDATE_RELATION}`,remove_relation:`${na}:${ta.REMOVE_RELATION}`,rollback:`${na}:${ta.ROLLBACK}`,rollback_all:`${na}:${ta.ROLLBACK_ALL}`},ca={add:`${na}:${ta.ADD_FULL}`,edit:`${na}:${ta.EDIT_FULL}`,delete:`${na}:${ta.DELETE_FULL}`,batch_delete:`${na}:${ta.DELETE_FULL}`,import:`${na}:${ta.IMPORT_FULL}`,clone:`${na}:${ta.CLONE_FULL}`,append_relation:`${na}:${ta.APPEND_RELATION_FULL}`,update_relation:`${na}:${ta.UPDATE_RELATION_FULL}`,remove_relation:`${na}:${ta.REMOVE_RELATION_FULL}`,rollback:`${na}:${ta.ROLLBACK_FULL}`,rollback_all:`${na}:${ta.ROLLBACK_ALL_FULL}`},da={project:`${na}:${ta.PROJECT}`,userGroup:`${na}:${ta.USER}`,permission:`${na}:${ta.PERMISSION}`,brick:`${na}:${ta.BRICK}`,route:`${na}:${ta.ROUTE}`,template:`${na}:${ta.TEMPLATE}`,snippet:`${na}:${ta.SNIPPET}`,i18n:`${na}:${ta.I18N}`,image:`${na}:${ta.IMAGE}`,function:`${na}:${ta.FUNCTION}`,menu:`${na}:${ta.MENU}`,menuItem:`${na}:${ta.MENU_ITEM}`,workflow:`${na}:${ta.WORKFLOW}`},ha={PROJECT_MICRO_APP:`${na}:${ta.PROJECT}`,"MICRO_APP_USER_GROUP@EASYOPS":`${na}:${ta.USER}`,MICRO_APP_RESOURCE_PERMISSION:`${na}:${ta.PERMISSION}`,STORYBOARD_BRICK:`${na}:${ta.BRICK}`,STORYBOARD_ROUTE:`${na}:${ta.ROUTE}`,STORYBOARD_TEMPLATE:`${na}:${ta.TEMPLATE}`,STORYBOARD_SNIPPET:`${na}:${ta.SNIPPET}`,STORYBOARD_I18N:`${na}:${ta.I18N}`,MICRO_APP_RESOURCE_IMAGE:`${na}:${ta.IMAGE}`,STORYBOARD_FUNCTION:`${na}:${ta.FUNCTION}`,MICRO_APP_RESOURCE_MENU:`${na}:${ta.MENU}`,MICRO_APP_RESOURCE_MENU_ITEM:`${na}:${ta.MENU_ITEM}`,"WORKFLOW_DEF@EASYOPS":`${na}:${ta.WORKFLOW}`};function ua(e){var t,n,a,i,o,r,s,l,c,d,h,u;const p="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",m=sa.i18n.t(da[e.category]??e.category),A=sa.i18n.t(la[p]??p),g=sa.i18n.t(ha[null===(t=e.abstract)||void 0===t?void 0:t.leftObjectId]??(null===(n=e.abstract)||void 0===n?void 0:n.leftObjectId)),v=sa.i18n.t(ha[null===(a=e.abstract)||void 0===a?void 0:a.rightObjectId]??(null===(i=e.abstract)||void 0===i?void 0:i.rightObjectId)),b=pa(null===(o=e.abstract)||void 0===o?void 0:o.nodes,null===(r=e.abstract)||void 0===r?void 0:r.nodesCount),f=pa(null===(s=e.abstract)||void 0===s?void 0:s.leftNodes,null===(l=e.abstract)||void 0===l?void 0:l.leftNodesCount),E=pa(null===(c=e.abstract)||void 0===c?void 0:c.rightNodes,null===(d=e.abstract)||void 0===d?void 0:d.rightNodesCount),k="rollback"===p?ua(e.rollBackIdInfo).abstract:null;return{category:m,action:A,leftObjectId:g,rightObjectId:v,nodes:b,leftNodes:f,rightNodes:E,abstract:sa.i18n.t(ca[p]??p,{category:m,nodes:b,leftNodes:f,rightNodes:E,nodeChanges:null===(h=e.abstract)||void 0===h||null===(h=h.nodeChanges)||void 0===h?void 0:h.join(", "),relationChanges:null===(u=e.abstract)||void 0===u||null===(u=u.relationChanges)||void 0===u?void 0:u.join(", "),leftObjectId:g,rightObjectId:v,rollbackAbstract:k}),rollbackAbstract:k}}function pa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return sa.i18n.t(`${na}:${ta.NODE}`,{nodes:e.join(n),context:t>e.length?"ellipsis":void 0,count:t})}var ma;let Aa,ga,va,ba,fa,Ea,ka,wa,ya,xa,Na,La,Ma,Ca,Ta,Ra,Oa;(0,ea.initializeReactI18n)(na,{en:{LOAD_MORE:"Load more",LOADING:"Loading",NO_DATA:"No data",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }} etc., a total of {{ count }} items",ADD:"Add node",EDIT:"Edit node",DELETE:"Delete node",IMPORT:"Batch import node",CLONE:"Clone node",APPEND_RELATION:"Append Relation",UPDATE_RELATION:"Update Relation",REMOVE_RELATION:"Remove Relation",ROLLBACK:"Rollback",ROLLBACK_ALL:"Rollback all operations",ADD_FULL:"Add {{ category }} ({{ nodes }})",EDIT_FULL:"Edit {{ nodeChanges }} of {{ category }} ({{ nodes }})",DELETE_FULL:"Delete {{ category }} ({{ nodes }})",IMPORT_FULL:"Batch Import {{ category }} ({{ nodes }})",CLONE_FULL:"Clone {{ category }} ({{ nodes }})",APPEND_RELATION_FULL:"Append the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",UPDATE_RELATION_FULL:"Update the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",REMOVE_RELATION_FULL:"Remove the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",ROLLBACK_FULL:"Rollback to [{{ rollbackAbstract }}]",ROLLBACK_ALL_FULL:"Rollback all operations",PROJECT:"Project",USER:"User Group",PERMISSION:"Permission",BRICK:"Brick",ROUTE:"Route",TEMPLATE:"Template",SNIPPET:"Snippet",I18N:"I18N",IMAGE:"Image",FUNCTION:"Function",MENU:"Menu",MENU_ITEM:"Menu item",WORKFLOW:"Workflow"},zh:{LOAD_MORE:"加载更多",LOADING:"加载中",NO_DATA:"没有数据",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }}等共{{ count }}项",ADD:"新增节点",EDIT:"编辑节点",DELETE:"删除节点",IMPORT:"批量导入节点",CLONE:"克隆节点",APPEND_RELATION:"添加关系",UPDATE_RELATION:"更新关系",REMOVE_RELATION:"移除关系",ROLLBACK:"回滚",ROLLBACK_ALL:"回滚全部操作",ADD_FULL:"新增{{ category }}({{ nodes }})",EDIT_FULL:"编辑{{ category }}({{ nodes }})的 {{ nodeChanges }}",DELETE_FULL:"删除{{ category }}({{ nodes }})",IMPORT_FULL:"批量导入{{ category }}({{ nodes }})",CLONE_FULL:"克隆{{ category }}({{ nodes }})",APPEND_RELATION_FULL:"添加{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",UPDATE_RELATION_FULL:"更新{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",REMOVE_RELATION_FULL:"移除{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",ROLLBACK_FULL:"回滚到【{{ rollbackAbstract }}】",ROLLBACK_ALL_FULL:"回滚全部操作",PROJECT:"项目",USER:"用户组",PERMISSION:"权限点",BRICK:"构件",ROUTE:"路由",TEMPLATE:"模版",SNIPPET:"片段",I18N:"国际化",IMAGE:"图片",FUNCTION:"函数",MENU:"菜单",MENU_ITEM:"菜单项",WORKFLOW:"工作流"}});const{defineElement:Ia,property:_a,event:Sa}=(0,p.createDecorators)(),Da=(0,m.wrapBrick)("eo-button"),Pa=(0,m.wrapBrick)("eo-link"),Wa=(0,m.wrapBrick)("eo-icon"),Fa=(0,m.wrapBrick)("eo-easyops-avatar"),$a=(0,m.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",beforeVisibleChange:"before.visible.change"});let Ba;var Ua=new WeakMap,Ka=new WeakMap,ja=new WeakMap,za=new WeakSet,Va=new WeakMap,Ha=new WeakMap,qa=new WeakMap,Ya=new WeakMap,Ga=new WeakMap;class Xa extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,za),(0,o.A)(this,Ua,ga(this)),(0,o.A)(this,Ka,(va(this),ba(this))),(0,o.A)(this,ja,(fa(this),Ea(this))),(0,o.A)(this,Va,(ya(this),e=>{(0,s.A)(za,this,ka).emit(e)})),(0,o.A)(this,Ha,xa(this)),(0,o.A)(this,qa,(Ma(this),e=>{(0,s.A)(za,this,Na).emit(e)})),(0,o.A)(this,Ya,Ca(this)),(0,o.A)(this,Ga,(Oa(this),()=>{(0,s.A)(za,this,Ta).emit()}))}get appId(){return(0,c.A)(Ua,this)}set appId(e){(0,l.A)(Ua,this,e)}get projectId(){return(0,c.A)(Ka,this)}set projectId(e){(0,l.A)(Ka,this,e)}render(){return u().createElement(Ja,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:(0,c.A)(Va,this),onRollback:(0,c.A)(qa,this),onRollbackAll:(0,c.A)(Ga,this)})}}function Ja(e){const{appId:t,onHistoryItemClick:n,onRollback:a,onRollbackAll:i}=e,{t:o}=(0,ea.useTranslation)(na),[r,s]=(0,h.useState)(!1),[l,c]=(0,h.useState)(!0),[d,p]=(0,h.useState)(!1),[m,A]=(0,h.useState)([]),g=(0,h.useRef)(""),v=e=>{s(!0),ra(t,{ts:g.current,limit:20}).then((t=>{A((n=>{const a=t.list.map((e=>({...e,translation:ua(e)})));return e?a:n.concat(a)})),g.current=t.ts,p(t.list.length<20),c(t.list.length<20)})).catch((e=>{(0,De.handleHttpError)(e)})).finally((()=>{s(!1)}))};return u().createElement($a,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",beforeVisibleChange:e=>{e.detail&&(c(!0),p(!1),A([]),g.current="",v(!0))}},u().createElement(Da,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),u().createElement("div",null,u().createElement("div",{className:"history-title"},"History"),u().createElement("div",{className:"history-list"},m.length?u().createElement(u().Fragment,null,m.map(((e,t)=>u().createElement(Za,{key:`${e.uniqueKey}-${e.ts}`,data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:n,onRollback:a}))),!l&&u().createElement("span",{className:"load-more-container"},u().createElement(Pa,{className:"load-more",disabled:r,onClick:()=>v()},o(ta.LOAD_MORE))),d&&u().createElement("span",{className:"end-container"},"The End",u().createElement(Wa,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>i()}))):u().createElement("div",{className:"empty"},o(r?ta.LOADING:ta.NO_DATA))),u().createElement("slot",null)))}function Za(e){const{data:t,enableRollback:n,current:a,onHistoryItemClick:i,onRollback:o}=e,r=Zn()(Number(t.ts)/1e6),s=Zn().duration(r.diff(Zn()())),l=s.days()<=-1?r.format("YYYY-MM-DD HH:mm:ss"):s.humanize(!0,{ss:0,s:60,m:60,h:24});return u().createElement("div",{className:"item-container"},u().createElement("div",{className:"item-title"},u().createElement("div",{className:"title-left",onClick:()=>i({...t,enableRollback:n})},u().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),a&&u().createElement("div",{className:"branch"},"(current)")),u().createElement("div",{className:"title-right"},n&&u().createElement(Wa,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>o(t)}))),u().createElement("div",{className:"item-info"},u().createElement(Fa,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),u().createElement("div",{className:"time"},l),u().createElement("div",{className:"operator"},t.user)))}ma=Xa,({e:[ga,va,ba,fa,Ea,ka,wa,ya,xa,Na,La,Ma,Ca,Ta,Ra,Oa],c:[Ba,Aa]}=(0,d.A)(ma,[Ia("visual-builder.workbench-history-action",{styleTexts:[Qn.A]})],[[_a(),1,"appId"],[_a(),1,"projectId"],[Sa({type:"history.item.click"}),1,"historyItemClickEvent",e=>(0,c.A)(ja,e),(e,t)=>(0,l.A)(ja,e,t)],[Sa({type:"rollback"}),1,"rollbackEvent",e=>(0,c.A)(Ha,e),(e,t)=>(0,l.A)(Ha,e,t)],[Sa({type:"rollback.all"}),1,"rollbackAllEvent",e=>(0,c.A)(Ya,e),(e,t)=>(0,l.A)(Ya,e,t)]],0,(e=>Ga.has((0,r.A)(e))),m.ReactNextElement)),Aa();var Qa,ei=n(2381);let ti,ni,ai,ii,oi,ri,si,li,ci,di,hi,ui,pi,mi,Ai,gi,vi,bi,fi,Ei,ki,wi,yi,xi,Ni,Li,Mi,Ci,Ti,Ri,Oi,Ii,_i,Si,Di,Pi,Wi,Fi,$i,Bi,Ui,Ki,ji,zi,Vi,Hi,qi,Yi,Gi,Xi,Ji,Zi,Qi;const{defineElement:eo,property:to,event:no}=(0,p.createDecorators)(),ao=(0,m.wrapBrick)("eo-icon"),io=(0,m.wrapBrick)("eo-tooltip"),oo=new Set;let ro;var so=new WeakMap,lo=new WeakMap,co=new WeakMap,ho=new WeakMap,uo=new WeakMap,po=new WeakMap,mo=new WeakMap,Ao=new WeakMap,go=new WeakMap,vo=new WeakSet,bo=new WeakMap,fo=new WeakMap,Eo=new WeakMap,ko=new WeakMap,wo=new WeakMap,yo=new WeakMap,xo=new WeakMap,No=new WeakMap,Lo=new WeakMap,Mo=new WeakMap,Co=new WeakMap,To=new WeakMap,Ro=new WeakMap,Oo=new WeakMap,Io=new WeakMap,_o=new WeakMap,So=new WeakMap;class Do extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,vo),(0,o.A)(this,so,ni(this)),(0,o.A)(this,lo,(ai(this),ii(this))),(0,o.A)(this,co,(oi(this),ri(this))),(0,o.A)(this,ho,(si(this),li(this))),(0,o.A)(this,uo,(ci(this),di(this))),(0,o.A)(this,po,(hi(this),ui(this))),(0,o.A)(this,mo,(pi(this),mi(this))),(0,o.A)(this,Ao,(Ai(this),gi(this))),(0,o.A)(this,go,(vi(this),bi(this))),(0,o.A)(this,bo,(ki(this),e=>{(0,s.A)(vo,this,fi).emit(e)})),(0,o.A)(this,fo,wi(this)),(0,o.A)(this,Eo,(Ni(this),e=>{(0,s.A)(vo,this,yi).emit(e)})),(0,o.A)(this,ko,Li(this)),(0,o.A)(this,wo,(Ti(this),()=>{(0,s.A)(vo,this,Mi).emit()})),(0,o.A)(this,yo,Ri(this)),(0,o.A)(this,xo,(_i(this),()=>{(0,s.A)(vo,this,Oi).emit()})),(0,o.A)(this,No,Si(this)),(0,o.A)(this,Lo,(Wi(this),e=>{(0,s.A)(vo,this,Di).emit(e)})),(0,o.A)(this,Mo,Fi(this)),(0,o.A)(this,Co,(Ui(this),()=>{(0,s.A)(vo,this,$i).emit()})),(0,o.A)(this,To,Ki(this)),(0,o.A)(this,Ro,(Vi(this),e=>{(0,s.A)(vo,this,ji).emit(e)})),(0,o.A)(this,Oo,Hi(this)),(0,o.A)(this,Io,(Gi(this),e=>{(0,s.A)(vo,this,qi).emit(e)})),(0,o.A)(this,_o,Xi(this)),(0,o.A)(this,So,(Qi(this),e=>{(0,s.A)(vo,this,Ji).emit(e)}))}get label(){return(0,c.A)(so,this)}set label(e){(0,l.A)(so,this,e)}get type(){return(0,c.A)(lo,this)}set type(e){(0,l.A)(lo,this,e)}get external(){return(0,c.A)(co,this)}set external(e){(0,l.A)(co,this,e)}get subNodes(){return(0,c.A)(ho,this)}set subNodes(e){(0,l.A)(ho,this,e)}get active(){return(0,c.A)(uo,this)}set active(e){(0,l.A)(uo,this,e)}get notSynced(){return(0,c.A)(po,this)}set notSynced(e){(0,l.A)(po,this,e)}get disableChildAppend(){return(0,c.A)(mo,this)}set disableChildAppend(e){(0,l.A)(mo,this,e)}get autoFocusOnce(){return(0,c.A)(Ao,this)}set autoFocusOnce(e){(0,l.A)(Ao,this,e)}render(){return u().createElement(Po,{label:this.label,type:this.type,external:this.external,subNodes:this.subNodes,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:(0,c.A)(bo,this),onLabelChange:(0,c.A)(Eo,this),onNodeClick:(0,c.A)(wo,this),onNodeDoubleClick:(0,c.A)(xo,this),onNodeContextMenu:(0,c.A)(Lo,this),onChildAppend:(0,c.A)(Co,this),onExternalClick:(0,c.A)(Ro,this),onSubNodeDoubleClick:(0,c.A)(Io,this),onSubNodeContextMenu:(0,c.A)(So,this)})}}function Po(e){let{label:t,type:n,external:a,subNodes:i,autoFocusOnce:o,onLabelEditingChange:r,onLabelChange:s,onNodeClick:l,onNodeDoubleClick:c,onNodeContextMenu:d,onChildAppend:p,onExternalClick:m,onSubNodeDoubleClick:A,onSubNodeContextMenu:g}=e;const v="board"===n?"board":"page",[f,E]=(0,h.useState)(t),[k,w]=(0,h.useState)(!1),y=(0,h.useRef)(!1),[x,N]=(0,h.useState)(!1),L=(0,h.useRef)(null);(0,h.useEffect)((()=>{E(t)}),[t]);const M=(0,h.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),w(!0)}),[]);(0,h.useEffect)((()=>{o&&!oo.has(o)&&(oo.add(o),setTimeout((()=>{w(!0)}),1))}),[o]),(0,h.useEffect)((()=>{var e,t;k&&(null===(e=L.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=L.current)||void 0===t||t.select())}),[k]),(0,h.useEffect)((()=>{y.current?null==r||r(k):y.current=!0}),[k,r]);const C=(0,h.useCallback)((e=>{E(e.target.value)}),[]),T=(0,h.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=L.current)||void 0===n||n.blur()}),[]),R=(0,h.useCallback)((()=>{w(!1),N(!0)}),[]);(0,h.useEffect)((()=>{x&&(null==s||s(f),N(!1))}),[f,s,x]);const O=(0,h.useCallback)((e=>{e.stopPropagation(),null==p||p()}),[p]),I=(0,h.useCallback)((e=>{e.stopPropagation(),null==m||m(a)}),[a,m]),_=(0,h.useCallback)((e=>{e.stopPropagation()}),[]),S=38*Math.max(0,Math.floor(((null==i?void 0:i.length)??0)-3));return u().createElement(u().Fragment,null,u().createElement("div",{className:b()("node",v,{"editing-label":k}),style:{height:"board"===v?70:130+S},onClick:l,onDoubleClick:c,onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==d||d({clientX:e.clientX,clientY:e.clientY})}},u().createElement("input",{className:"label-input",value:f,ref:L,onChange:C,onKeyDown:T,onBlur:R,onDoubleClick:_,onContextMenu:_,onMouseDown:_}),u().createElement("div",{className:"label",onDoubleClick:M,onMouseDown:_},f),"board"===v?u().createElement("div",{className:"icon-container"},u().createElement(ao,{lib:"antd",icon:"unordered-list"})):u().createElement("div",{className:"thumbnail-container",style:{height:98+S}},u().createElement("div",{className:"thumbnail-placeholder"},u().createElement(ao,{lib:"antd",icon:"ellipsis"})),a&&u().createElement("div",{className:"external",onClick:I,onDoubleClick:_,onMouseDown:_},u().createElement(ao,{lib:"antd",icon:"desktop"}),u().createElement("span",{className:"external-label"},a.label)),null!=i&&i.length?u().createElement("div",{className:"sub-nodes"},i.map((e=>u().createElement(Wo,{key:e.id,subNode:e,onSubNodeDoubleClick:A,onSubNodeContextMenu:g})))):null)),u().createElement("div",{className:"add-button",role:"button",onClick:O,onMouseDown:_},u().createElement(ao,{lib:"fa",icon:"plus"})))}function Wo(e){let{subNode:t,onSubNodeDoubleClick:n,onSubNodeContextMenu:a}=e;return u().createElement(io,{key:t.id,content:t.label},u().createElement("div",{className:"sub-node",onDoubleClick:e=>{e.stopPropagation(),null==n||n(t)},onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==a||a({node:t,clientX:e.clientX,clientY:e.clientY})}},u().createElement("div",{className:"sub-node-skeleton-title"}),u().createElement("div",{className:"sub-node-skeleton-content"}),u().createElement("div",{className:"sub-node-skeleton-button"})))}Qa=Do,({e:[ni,ai,ii,oi,ri,si,li,ci,di,hi,ui,pi,mi,Ai,gi,vi,bi,fi,Ei,ki,wi,yi,xi,Ni,Li,Mi,Ci,Ti,Ri,Oi,Ii,_i,Si,Di,Pi,Wi,Fi,$i,Bi,Ui,Ki,ji,zi,Vi,Hi,qi,Yi,Gi,Xi,Ji,Zi,Qi],c:[ro,ti]}=(0,d.A)(Qa,[eo("visual-builder.page-arch-node",{styleTexts:[ei.A]})],[[to(),1,"label"],[to(),1,"type"],[to({attribute:!1}),1,"external"],[to({attribute:!1}),1,"subNodes"],[to({type:Boolean,render:!1}),1,"active"],[to({type:Boolean,render:!1}),1,"notSynced"],[to({type:Boolean,render:!1}),1,"disableChildAppend"],[to(),1,"autoFocusOnce"],[no({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,c.A)(go,e),(e,t)=>(0,l.A)(go,e,t)],[no({type:"label.change"}),1,"labelChange",e=>(0,c.A)(fo,e),(e,t)=>(0,l.A)(fo,e,t)],[no({type:"node.click"}),1,"nodeClick",e=>(0,c.A)(ko,e),(e,t)=>(0,l.A)(ko,e,t)],[no({type:"node.dblclick"}),1,"nodeDoubleClick",e=>(0,c.A)(yo,e),(e,t)=>(0,l.A)(yo,e,t)],[no({type:"node.contextmenu"}),1,"nodeContextMenu",e=>(0,c.A)(No,e),(e,t)=>(0,l.A)(No,e,t)],[no({type:"child.append"}),1,"childAppend",e=>(0,c.A)(Mo,e),(e,t)=>(0,l.A)(Mo,e,t)],[no({type:"external.click"}),1,"externalClick",e=>(0,c.A)(To,e),(e,t)=>(0,l.A)(To,e,t)],[no({type:"subNode.dblclick"}),1,"subNodeDoubleClick",e=>(0,c.A)(Oo,e),(e,t)=>(0,l.A)(Oo,e,t)],[no({type:"subNode.contextmenu"}),1,"subNodeContextMenu",e=>(0,c.A)(_o,e),(e,t)=>(0,l.A)(_o,e,t)]],0,(e=>So.has((0,r.A)(e))),m.ReactNextElement)),ti();var Fo,$o=n(1242),Bo=n(6213),Uo=n(2559);function Ko(e,t,n,a){return t((0,Uo.A)(e,n),a),a}let jo,zo,Vo,Ho,qo,Yo,Go,Xo,Jo;const{method:Zo,property:Qo}=(0,p.createDecorators)();var er=new WeakMap,tr=new WeakSet,nr=new WeakMap,ar=new WeakMap,ir=new WeakMap,or=new WeakMap,rr=new WeakMap,sr=new WeakMap;class lr extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,tr),(0,o.A)(this,er,(jo(this),!1)),(0,o.A)(this,nr,"normal"),(0,o.A)(this,ar,!1),(0,o.A)(this,ir,zo(this)),(0,o.A)(this,or,(Vo(this),Ho(this))),(0,o.A)(this,rr,(qo(this),Yo(this))),(0,o.A)(this,sr,(Go(this),Xo(this))),Jo(this)}get isFormItemElement(){return!0}set validateState(e){Ko(tr,ur,this,e),this._render()}get validateState(){return(0,s.A)(tr,this,hr)}set notRender(e){this.hidden=e,Ko(tr,dr,this,e),this._render()}get notRender(){return(0,s.A)(tr,this,cr)}get $bindFormItem(){return(0,s.A)(tr,this,pr)}set $bindFormItem(e){Ko(tr,mr,this,e),this._render()}get helpBrick(){return(0,c.A)(ir,this)}set helpBrick(e){(0,l.A)(ir,this,e)}get labelBrick(){return(0,c.A)(or,this)}set labelBrick(e){(0,l.A)(or,this,e)}get labelCol(){return(0,c.A)(rr,this)}set labelCol(e){(0,l.A)(rr,this,e)}get wrapperCol(){return(0,c.A)(sr,this)}set wrapperCol(e){(0,l.A)(sr,this,e)}setNotRender(e){this.notRender=e}getFormElement(){let e=this;for(;(e=e.parentNode)&&e&&!e.isFormElement;);return e}}function cr(e){return(0,c.A)(er,e)}function dr(e,t){(0,l.A)(er,e,t)}function hr(e){return(0,c.A)(nr,e)}function ur(e,t){(0,l.A)(nr,e,t)}function pr(e){return(0,c.A)(ar,e)}function mr(e,t){(0,l.A)(ar,e,t)}Fo=lr,[zo,Vo,Ho,qo,Yo,Go,Xo,Jo,jo]=(0,d.A)(Fo,[],[[Qo({attribute:!1}),1,"helpBrick"],[Qo({attribute:!1}),1,"labelBrick"],[Qo({attribute:!1}),1,"labelCol"],[Qo({attribute:!1}),1,"wrapperCol"],[Zo(),2,"setNotRender"],[Zo(),2,"getFormElement"]],0,void 0,m.ReactNextElement).e;var Ar=function(){var e=(0,ia.A)((function*(e,t){return(yield oa.http.post("api/gateway/next_builder.contract_center.SearchContract/api/v1/contract/search",e,t)).data}));return function(t,n){return e.apply(this,arguments)}}();let gr=function(e){return e.CONTRACT_OPTIONS_TIPS_PREFIX="CONTRACT_OPTIONS_TIPS_PREFIX",e.CONTRACT_OPTIONS_TIPS_SUFFIX="CONTRACT_OPTIONS_TIPS_SUFFIX",e.CONTRACT_VALIDATE_MESSAGE="CONTRACT_VALIDATE_MESSAGE",e}({});const vr="bricks/visual-builder/contract-select",br={en:{CONTRACT_OPTIONS_TIPS_PREFIX:"Only the first",CONTRACT_OPTIONS_TIPS_SUFFIX:"items are displayed, please search for more results",CONTRACT_VALIDATE_MESSAGE:"Please fill in the correct contract name "},zh:{CONTRACT_OPTIONS_TIPS_PREFIX:"仅展示前",CONTRACT_OPTIONS_TIPS_SUFFIX:"项,更多结果请搜索",CONTRACT_VALIDATE_MESSAGE:"请填写正确的契约名称"}};(0,ea.initializeReactI18n)(vr,br);const fr=(0,m.wrapBrick)("eo-icon"),Er=(0,m.wrapBrick)("eo-input",{onChange:"change"});function kr(e){const{itemsCount:t=20,onBlur:n}=e,[a,i]=(0,h.useState)(t),{t:o}=(0,ea.useTranslation)(vr),[r,s]=(0,h.useState)(!1);return u().createElement("div",{className:"options-tips",slot:e.slot},o(gr.CONTRACT_OPTIONS_TIPS_PREFIX)," ",r?u().createElement(Er,{autoFocus:!0,inputStyle:{width:65},value:String(a),onBlur:()=>{s(!1),null==n||n(a)},onChange:e=>{i(Number(e.detail))}}):u().createElement("span",null,a," ",u().createElement(fr,{icon:"edit",lib:"antd",onClick:()=>{s(!0)}}))," ",o(gr.CONTRACT_OPTIONS_TIPS_SUFFIX))}var wr;let yr,xr,Nr,Lr,Mr,Cr,Tr,Rr,Or,Ir,_r,Sr,Dr,Pr,Wr;(0,ea.initializeReactI18n)(vr,br);const{defineElement:Fr,property:$r,event:Br}=(0,p.createDecorators)(),Ur=(0,m.wrapBrick)("eo-form-item"),Kr=(0,m.wrapBrick)("eo-auto-complete",{onChange:"change"});let jr;var zr=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,qr=new WeakMap,Yr=new WeakMap,Gr=new WeakMap,Xr=new WeakSet;function Jr(e){if("string"!=typeof e)return{name:"",version:""};const[t,n]=e.split(":");return{name:t,version:n}}function Zr(e){return/.*@.*:\d+\.\d+\.\d+/.test(e)}function Qr(e){return(0,We.isNil)(e)||Zr(e)?"":sa.i18n.t(`${vr}:${gr.CONTRACT_VALIDATE_MESSAGE}`)}function es(e){let{value:t,inputStyle:n,validateState:a,suffix:i,onChange:o}=e;const[r,s]=(0,h.useState)(),[l,c]=(0,h.useState)(20),d=function(e){let{pageSize:t=20,q:n=""}=e;const[a,i]=(0,h.useState)([]),[o,r]=(0,h.useState)(n),[s,l]=(0,h.useState)(t);return(0,h.useEffect)((()=>{r(n)}),[n]),(0,h.useEffect)((()=>{l(t)}),[t]),(0,h.useEffect)((()=>{(async()=>{try{const{list:e}=await Ar({page:1,pageSize:s,fullContractName:o},{interceptorParams:{ignoreLoadingBar:!0}});i(e)}catch(e){console.error(e),i([])}})()}),[o,s]),a}({q:r,pageSize:l}),[p,m]=(0,h.useState)(Jr(t)),[A,g]=(0,h.useState)([]);(0,h.useEffect)((()=>{m(Jr(t))}),[t]);const v=(0,h.useMemo)((()=>(0,We.debounce)((e=>{s(e)}),200)),[]);return u().createElement("div",{className:"contract-wrapper"},u().createElement(Kr,{className:"contract-selector",options:null==d?void 0:d.map((e=>({value:e.fullContractName,label:e.fullContractName}))),value:p.name,inputStyle:n,validateState:a,onChange:e=>{const t=e.detail;if(Zr(t))m(Jr(t)),null==o||o(t);else{var n;const e=null===(n=d.find((e=>e.fullContractName===t)))||void 0===n?void 0:n.version,a=(null==e?void 0:e[0])??"";g(e),m({name:t,version:a}),null==o||o(`${t}:${a}`)}v(t)}},u().createElement(kr,{onBlur:e=>c(e),slot:"options-toolbar"})),u().createElement(Kr,{className:"version-selector",value:p.version,validateState:a,options:null==A?void 0:A.map((e=>({value:e,label:e}))),onChange:e=>{const t=e.detail;m({name:p.name,version:t}),null==o||o(`${p.name}:${t}`)}}),null!=i&&i.useBrick?u().createElement($o.ReactUseMultipleBricks,i):null)}wr=class extends lr{constructor(){super(...arguments),(0,i.A)(this,Xr),(0,o.A)(this,zr,xr(this)),(0,o.A)(this,Vr,(Nr(this),Lr(this))),(0,o.A)(this,Hr,(Mr(this),Cr(this))),(0,o.A)(this,qr,(Tr(this),Rr(this))),(0,o.A)(this,Yr,(Or(this),Ir(this))),(0,o.A)(this,Gr,(_r(this),Sr(this))),(0,X.A)(this,"handleChange",(Wr(this),e=>{(0,s.A)(Xr,this,Dr).emit(e)}))}get name(){return(0,c.A)(zr,this)}set name(e){(0,l.A)(zr,this,e)}get required(){return(0,c.A)(Vr,this)}set required(e){(0,l.A)(Vr,this,e)}get label(){return(0,c.A)(Hr,this)}set label(e){(0,l.A)(Hr,this,e)}get value(){return(0,c.A)(qr,this)}set value(e){(0,l.A)(qr,this,e)}get suffix(){return(0,c.A)(Yr,this)}set suffix(e){(0,l.A)(Yr,this,e)}render(){return u().createElement(Ur,{exportparts:"message",curElement:this,formElement:this.getFormElement(),name:this.name,label:this.label,required:this.required,labelBrick:this.labelBrick,helpBrick:this.helpBrick,notRender:this.notRender,trigger:"handleChange",validator:Qr},u().createElement(es,{value:this.value,suffix:this.suffix,validateState:this.validateState,onChange:this.handleChange}))}},({e:[xr,Nr,Lr,Mr,Cr,Tr,Rr,Or,Ir,_r,Sr,Dr,Pr,Wr],c:[jr,yr]}=(0,d.A)(wr,[Fr("visual-builder.contract-select",{styleTexts:[Bo.A]})],[[$r(),1,"name"],[$r({type:Boolean}),1,"required"],[$r(),1,"label"],[$r({attribute:!1}),1,"value"],[$r({attribute:!1}),1,"suffix"],[Br({type:"change"}),1,"changeEvent",e=>(0,c.A)(Gr,e),(e,t)=>(0,l.A)(Gr,e,t)]],0,(e=>Xr.has((0,r.A)(e))),lr)),yr();var ts,ns=n(7540);let as,is,os,rs,ss,ls,cs,ds,hs,us,ps,ms,As,gs,vs,bs;const fs=(0,m.wrapBrick)("eo-menu"),Es=(0,m.wrapBrick)("eo-menu-item"),ks=(0,m.wrapBrick)("eo-tooltip"),ws=(0,Gn.unwrapProvider)("basic.lock-body-scroll");(0,ea.initializeReactI18n)("bricks/visual-builder/generate-snippets-context-menu",{en:{},zh:{}});const{defineElement:ys,property:xs,event:Ns,method:Ls}=(0,p.createDecorators)();let Ms;var Cs=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Os=new WeakMap,Is=new WeakSet,_s=new WeakMap,Ss=new WeakMap,Ds=new WeakMap;class Ps extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,Is),(0,o.A)(this,Cs,(as(this),os(this))),(0,o.A)(this,Ts,(rs(this),ss(this))),(0,o.A)(this,Rs,(ls(this),cs(this))),(0,o.A)(this,Os,(ds(this),hs(this))),(0,o.A)(this,_s,(ms(this),As(this))),(0,o.A)(this,Ss,(bs(this),e=>{(0,s.A)(Is,this,us).emit(e)})),(0,o.A)(this,Ds,(e=>{(0,s.A)(Is,this,gs).emit(e)}))}get options(){return(0,c.A)(Cs,this)}set options(e){(0,l.A)(Cs,this,e)}get active(){return(0,c.A)(Ts,this)}set active(e){(0,l.A)(Ts,this,e)}get position(){return(0,c.A)(Rs,this)}set position(e){(0,l.A)(Rs,this,e)}open(e){let{position:t}=e;this.active=!0,this.position=t}close(){this.active=!1,this.position=void 0}disconnectedCallback(){super.disconnectedCallback(),ws(this,!1)}render(){return u().createElement(Ws,{active:this.active,element:this,position:this.position,onItemDragStart:(0,c.A)(Ss,this),onItemDragEnd:(0,c.A)(Ds,this),options:this.options})}}function Ws(e){var t,n;let{element:a,active:i,onItemDragEnd:o,onItemDragStart:r,options:s,position:l}=e;const[c,d]=(0,h.useState)(!1),p=(0,h.useRef)(null),[m,A]=(0,h.useState)(null),g=(0,h.useCallback)((e=>{e.preventDefault(),null==a||a.close()}),[a]),v=(0,h.useCallback)(((e,t)=>{var n;d(!0),t.dragConf&&(null===(n=e.dataTransfer)||void 0===n||n.setData(t.dragConf.format,JSON.stringify(t.dragConf.data))),e.target.classList.add("dragging"),null==r||r(t)}),[r]),b=(0,h.useCallback)(((e,t)=>{d(!1),e.target.classList.remove("dragging"),null==a||a.close(),null==o||o(t)}),[a,o]);return(0,h.useEffect)((()=>{ws(a,i)}),[i,a]),(0,h.useEffect)((()=>{if(i&&p.current&&l){const e=p.current.getBoundingClientRect(),t=e.width+8,n=e.height+8,{clientWidth:a,clientHeight:i}=document.documentElement,o=[...l];a>t&&l[0]+t>a&&(o[0]=l[0]-t),i>n&&l[1]+n>i&&(o[1]=i-n),A(o)}else A(null)}),[i,l]),u().createElement(u().Fragment,null,!c&&u().createElement("div",{className:"mask",onClick:g,onContextMenu:g}),u().createElement("div",{className:"container",ref:p,style:{left:null===(t=m??l)||void 0===t?void 0:t[0],top:null===(n=m??l)||void 0===n?void 0:n[1],visibility:m?"visible":"hidden"}},null==s?void 0:s.map(((e,t)=>{var n,a;return u().createElement("div",{key:t},u().createElement("div",{className:"title"},e.title),(null===(n=e.children)||void 0===n?void 0:n.length)&&u().createElement(fs,null,null===(a=e.children)||void 0===a?void 0:a.map(((e,t)=>u().createElement(ks,{content:e.tooltip,hoist:!0,placement:"left",key:t},u().createElement(Es,{disabled:e.disabled,icon:e.icon,draggable:!e.disabled,onDragStart:t=>v(t,e),onDragEnd:t=>b(t,e)},e.text))))))}))))}ts=Ps,({e:[os,rs,ss,ls,cs,ds,hs,us,ps,ms,As,gs,vs,bs,as],c:[Ms,is]}=(0,d.A)(ts,[ys("visual-builder.generate-snippets-context-menu",{styleTexts:[ns.A]})],[[xs({attribute:!1}),1,"options"],[xs({type:Boolean}),1,"active"],[xs({attribute:!1}),1,"position"],[Ns({type:"item.drag.start"}),1,"itemDragStartEvent",e=>(0,c.A)(Os,e),(e,t)=>(0,l.A)(Os,e,t)],[Ns({type:"item.drag.end"}),1,"itemDragEndEvent",e=>(0,c.A)(_s,e),(e,t)=>(0,l.A)(_s,e,t)],[Ls(),2,"open"],[Ls(),2,"close"]],0,(e=>Ds.has((0,r.A)(e))),m.ReactNextElement)),is();var Fs=n(1085),$s=n(3091),Bs=n(7447),Us=n(3640),Ks=n(4360),js=n(3544),zs=n(4650),Vs=n(9830);function Hs(){function e(e,t,n){if(!n||"pre"!==n.tagName||"code"!==e.tagName)return;const a=function(e){const t=e.properties.className||[];for(const e of t)if("language-"===e.slice(0,9))return e.slice(9).toLowerCase();return null}(e);if(null===a)return;let i;try{n.properties.className=(n.properties.className||[]).concat("language-"+a),i=Vs.L.highlight((0,zs.d)(e),a)}catch{return}e.children=i.children}return t=>{(0,js.YR)(t,"element",e)}}const qs={Fragment:Fs.Fragment,jsx:Fs.jsx,jsxs:Fs.jsxs};function Ys(e){let{content:t}=e;const[n,a]=(0,h.useState)(null);return(0,h.useEffect)((()=>{let e=!1;return(0,$s.l)().use(Bs.A).use(Us.A).use([Hs]).use(Ks.A,qs).process(t).then((t=>{e||a(t.result)})).catch((t=>{e||(console.error("Convert markdown failed:",t),a(null))})),()=>{e=!0}}),[t]),n}const Gs=(0,m.wrapBrick)("eo-avatar");function Xs(e){let{message:t}=e;const n=(0,h.useMemo)((()=>{const e=[];if("assistant"===t.role){const n=/(?:^|\n)```(easy_cmd_\S+)\n([\s\S]*?)\n```(?:$|\n)/gm;let a,i=0;for(;a=n.exec(t.content);){const[o,r,s]=a,l=a.index,c=t.content.slice(i,l).trim();c.length>0&&e.push({type:"markdown",content:c}),e.push({type:"command",command:r,content:s.trim(),raw:o}),i=n.lastIndex}const o=t.content.slice(i).trim();o.length>0&&e.push({type:"markdown",content:o})}else e.push({type:"plain",content:t.content});return e}),[t.content,t.role]),a=(0,h.useRef)(null);return(0,h.useEffect)((()=>{const e=a.current;e&&setTimeout((()=>{const n=e.parentElement.querySelectorAll(".texting");for(const e of n)e.classList.remove("texting");if(!t.partial)return;let a=e;for(;a;){const e=a.lastChild;if((null==e?void 0:e.nodeType)!==Node.ELEMENT_NODE||"DETAILS"===(null==e?void 0:e.tagName)&&!e.open){var i;if((null==e?void 0:e.nodeType)!==Node.TEXT_NODE||0!==e.textContent.trim().length||(null===(i=e.previousSibling)||void 0===i?void 0:i.nodeType)!==Node.ELEMENT_NODE)break;a=e.previousSibling}else a=e}a.classList.add("texting")}),1)}),[t.partial,t.content]),u().createElement("div",{className:b()("message",{failed:t.failed})},u().createElement("div",{className:"avatar"},u().createElement(Gs,{icon:{lib:"easyops",icon:"assistant"===t.role?"robot":"account"},size:"small",className:`role-${t.role}`})),u().createElement("div",{className:"main"},u().createElement("div",{className:"label"},"assistant"===t.role?"Assistant":"You"),u().createElement("div",{className:"content",ref:a},n.map(((e,t)=>u().createElement(Js,{key:t,chunk:e}))))))}function Js(e){let{chunk:t}=e;return u().createElement(u().Fragment,null,"markdown"===t.type?u().createElement("div",{className:"markdown"},u().createElement(Ys,{content:t.content})):"command"===t.type?u().createElement(u().Fragment,null,u().createElement("details",{className:"command"},u().createElement("summary",null,"```",t.command),u().createElement("pre",null,u().createElement("code",null,t.content)))):u().createElement("div",{className:"plain"},t.content))}var Zs,Qs=n(7236);let el,tl,nl,al,il,ol,rl,sl,ll;const{defineElement:cl,property:dl,event:hl}=(0,p.createDecorators)();let ul;var pl=new WeakMap,ml=new WeakMap,Al=new WeakMap,gl=new WeakSet,vl=new WeakMap;class bl extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,gl),(0,o.A)(this,pl,tl(this)),(0,o.A)(this,ml,(nl(this),al(this))),(0,o.A)(this,Al,(il(this),ol(this))),(0,o.A)(this,vl,(ll(this),e=>{(0,s.A)(gl,this,rl).emit(e)}))}get messages(){return(0,c.A)(pl,this)}set messages(e){(0,l.A)(pl,this,e)}get errorBoundary(){return(0,c.A)(ml,this)}set errorBoundary(e){(0,l.A)(ml,this,e)}render(){return u().createElement(fl,{host:this,messages:this.messages,errorBoundary:this.errorBoundary,onStoryboardUpdate:(0,c.A)(vl,this)})}}function fl(e){let{messages:t,host:n,errorBoundary:a,onStoryboardUpdate:i}=e;const o=(0,h.useMemo)((()=>/(?:^|\n)```easy_cmd_vb_block_(page|storyboard)\n([\s\S]*?)\n```(?:$|\n)/gm),[]),r=(0,h.useRef)(new Map),[s,l]=(0,h.useState)([]),c=(0,h.useRef)(!1);(0,h.useEffect)((()=>{for(const e of t??[]){if("assistant"!==e.role)continue;let t;o.lastIndex=r.current.get(e.key)??0;const n=[];let a=!1;for(;t=o.exec(e.content);){r.current.set(e.key,o.lastIndex);const[,i,s]=t;try{const e=JSON.parse(s);"page"===i?(a=!0,n.push(...e)):n.push({...e,type:"item"})}catch(e){console.error("parse storyboard failed:",e)}}a?l(n):n.length>0&&l((e=>[...e,...n]))}}),[o,t]);const[d,p]=(0,h.useState)([]);(0,h.useEffect)((()=>{const e=[],t=new Map;for(const n of s)"block"===n.type?e.push(n):n.storyboard&&t.set(n.uuid,n.storyboard);e.sort(((e,t)=>e.seq-t.seq));const n={brick:"eo-content-layout",children:[]},i={brick:"eo-main-view",children:[{brick:"eo-page-title",slot:"pageTitle",properties:{pageTitle:"测试页面"}}]};let o=!1;for(const r of e)if("全局操作区"===r.name)for(const e of r.children){const n=t.get(e);n&&(i.children.push({...n,properties:{...n.properties,slot:void 0},errorBoundary:a,slot:"toolbar",iid:`item:${e}`,meta:{type:"item",uuid:e,block:{uuid:r.uuid,name:r.name}}}),o=!0)}else{const e=t.get(r.uuid);if(e){const i={...e,children:[],errorBoundary:a,iid:`block:${r.uuid}`,meta:{type:"block",uuid:r.uuid,name:r.name}};o=!0,n.children.push(i);for(const e of r.children){const n=t.get(e);n&&i.children.push({...n,errorBoundary:a,iid:`item:${e}`,meta:{type:"item",uuid:e}})}}else if(!r.hasContainer)for(const e of r.children){const i=t.get(e);i&&(n.children.push({...i,errorBoundary:a,iid:`item:${e}`,meta:{type:"item",uuid:e}}),o=!0)}}i.children.push(n),p((e=>o?[i]:0===e.length?e:[]))}),[s,a]),(0,h.useEffect)((()=>{null==i||i(d)}),[i,d]);const m=(0,h.useMemo)((()=>{let e=n;for(;e;){const t=getComputedStyle(e,null).getPropertyValue("overflow-y");if("auto"===t||"scroll"===t)return e;if(e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else{if(!(e.parentNode instanceof Element))break;e=e.parentNode}}return document.scrollingElement||document.documentElement}),[n]);return(0,h.useEffect)((()=>{c.current||setTimeout((()=>{m.scrollTo(0,m.scrollHeight)}),1)}),[t,m]),(0,h.useEffect)((()=>{const e=()=>{c.current=m.scrollTop+m.clientHeight+6<m.scrollHeight};return m.addEventListener("scroll",e),()=>{m.removeEventListener("scroll",e)}}),[m]),u().createElement(u().Fragment,null,null==t?void 0:t.map(((e,t)=>u().createElement(Xs,{key:e.key??`index-${t}`,message:e}))))}Zs=bl,({e:[tl,nl,al,il,ol,rl,sl,ll],c:[ul,el]}=(0,d.A)(Zs,[cl("visual-builder.chat-conversation",{styleTexts:[Qs.A]})],[[dl({attribute:!1}),1,"messages"],[dl({type:Boolean}),1,"errorBoundary"],[hl({type:"storyboard.update"}),1,"storyboardUpdate",e=>(0,c.A)(Al,e),(e,t)=>(0,l.A)(Al,e,t)]],0,(e=>vl.has((0,r.A)(e))),m.ReactNextElement)),el();var El=n(9575),kl=n(1732);function wl(e){let{variant:t,width:n,height:a,left:i,top:o,label:r}=e;return u().createElement("div",{className:"outline "+t,style:{width:n+8,height:a+8,left:i-4,top:o-4}},u().createElement("div",{className:"label"},r))}var yl,xl=n(1563);let Nl,Ll,Ml,Cl,Tl,Rl,Ol,Il,_l,Sl,Dl,Pl,Wl,Fl,$l,Bl;const{defineElement:Ul,property:Kl,event:jl,method:zl}=(0,p.createDecorators)();let Vl;var Hl=new WeakMap,ql=new WeakMap,Yl=new WeakMap,Gl=new WeakMap,Xl=new WeakMap,Jl=new WeakMap,Zl=new WeakSet,Ql=new WeakMap;class ec extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,Zl),(0,o.A)(this,Hl,(Nl(this),Ml(this))),(0,o.A)(this,ql,(Cl(this),Tl(this))),(0,o.A)(this,Yl,(Rl(this),Ol(this))),(0,o.A)(this,Gl,(Il(this),_l(this))),(0,o.A)(this,Xl,(Sl(this),Dl(this))),(0,o.A)(this,Jl,(Pl(this),Wl(this))),(0,o.A)(this,Ql,(Bl(this),e=>{(0,s.A)(Zl,this,Fl).emit(e)}))}get storyboard(){return(0,c.A)(Hl,this)}set storyboard(e){(0,l.A)(Hl,this,e)}get theme(){return(0,c.A)(ql,this)}set theme(e){(0,l.A)(ql,this,e)}get uiVersion(){return(0,c.A)(Yl,this)}set uiVersion(e){(0,l.A)(Yl,this,e)}get app(){return(0,c.A)(Gl,this)}set app(e){(0,l.A)(Gl,this,e)}get inspecting(){return(0,c.A)(Xl,this)}set inspecting(e){(0,l.A)(Xl,this,e)}select(e){var t;const n=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==n||n.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return u().createElement(tc,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,c.A)(Ql,this)})}}function tc(e){let{storyboard:t,theme:n,uiVersion:a,app:i,inspecting:o,onActiveTargetChange:r}=e;const s=(0,h.useRef)(),[l,c]=(0,h.useState)(!1),[d,p]=(0,h.useState)(!1),[m,A]=(0,h.useState)({x:0,y:0}),[g,v]=(0,h.useState)([]),[f,E]=(0,h.useState)([]),[k,w]=(0,h.useState)([]),[y,x]=(0,h.useState)([]),N=(0,h.useCallback)((()=>{const e=()=>{var t;const n=null===(t=s.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?c(!0):setTimeout(e,100)};e()}),[]);(0,h.useEffect)((()=>{var e;if(!l)return;const t=De.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_inject)("visual-builder.inject-chat-preview-agent",{...t,filePath:`${location.origin}${(0,De.getBasePath)()}${window.PUBLIC_ROOT??""}${t.filePath}`})}),[l]),(0,h.useEffect)((()=>{var e;if(!l)return;const o=null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;o&&o("yaml",{yaml:(0,kl.safeDump)(t,{schema:kl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:i,theme:n,uiVersion:a})}),[i,l,t,n,a]);const L=(0,h.useMemo)((()=>{if(d)return()=>{setTimeout((()=>{window.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}})}),100)}}),[d]);(0,h.useEffect)((()=>{const e=e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"initialized":p(!0);break;case"inspect-hover":v(e.data.payload.outlines);break;case"scroll":A(e.data.payload);break;case"inspect-active":E(e.data.payload.outlines)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,h.useEffect)((()=>{var e;d&&(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage({channel:"chat-preview",type:"toggle-inspecting",payload:{inspecting:o}},location.origin))}),[d,o]);const M=(0,h.useCallback)((e=>e.map((e=>{var t,n;const a=(null==s||null===(t=s.current)||void 0===t?void 0:t.offsetLeft)??0,i=(null==s||null===(n=s.current)||void 0===n?void 0:n.offsetTop)??0,{width:o,height:r,left:l,top:c,...d}=e;return{width:1*o,height:1*r,left:1*(l-m.x)+a,top:1*(c-m.y)+i,...d}}))),[m.x,m.y]);return(0,h.useEffect)((()=>{r(f[0])}),[f,r]),(0,h.useEffect)((()=>{x(M(f))}),[f,M]),(0,h.useEffect)((()=>{w(M(g))}),[g,M]),u().createElement("div",{className:b()("container",{inspecting:o})},u().createElement("iframe",{ref:s,src:`${(0,De.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:N,onMouseOut:L}),k.map(((e,t)=>u().createElement(wl,(0,El.A)({key:t,variant:"hover"},e)))),y.map(((e,t)=>u().createElement(wl,(0,El.A)({key:t,variant:"active"},e)))))}yl=ec,({e:[Ml,Cl,Tl,Rl,Ol,Il,_l,Sl,Dl,Pl,Wl,Fl,$l,Bl,Nl],c:[Vl,Ll]}=(0,d.A)(yl,[Ul("visual-builder.chat-preview",{styleTexts:[xl.A]})],[[Kl({attribute:!1}),1,"storyboard"],[Kl(),1,"theme"],[Kl(),1,"uiVersion"],[Kl(),1,"app"],[Kl({type:Boolean}),1,"inspecting"],[jl({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(Jl,e),(e,t)=>(0,l.A)(Jl,e,t)],[zl(),2,"select"]],0,(e=>Ql.has((0,r.A)(e))),m.ReactNextElement)),Ll();let nc=!1;const ac="item:";let ic=null;function oc(e){e.preventDefault(),e.stopPropagation(),function(e){const t=dc(e.composedPath());window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map(hc)}},location.origin)}(e)}function rc(e){e.preventDefault(),e.stopPropagation()}const sc=(0,We.debounce)(((e,t,n)=>{let a=dc(e);if(0===a.length)for(const i of e)if(i instanceof HTMLElement&&i.shadowRoot){a=dc(i.shadowRoot.elementsFromPoint(t,n));break}const i=a.length>0?a[0].element:null;i!==ic&&(ic=i,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:a.map(hc)}},location.origin))}),20,{leading:!0});function lc(e){sc(e.composedPath(),e.clientX,e.clientY)}function cc(e){e.preventDefault(),e.stopPropagation(),ic=null,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}},location.origin)}function dc(e){const t=[];return e.forEach((e=>{let n;if(e.nodeType===Node.ELEMENT_NODE&&e instanceof HTMLElement&&(n=e.dataset.iid)&&n.startsWith(ac)){const a=n.substring(ac.length);t.push({type:"item",uuid:a,label:uc(e),element:e})}})),t}function hc(e){const{element:t,type:n,uuid:a,label:i}=e,{width:o,height:r,left:s,top:l}=t.getBoundingClientRect();return{width:o,height:r,left:s+window.scrollX,top:l+window.scrollY,type:n,uuid:a,label:i}}function uc(e){return e.tagName.toLowerCase().split(".").pop()}let pc=!1;function mc(e){window.parent.postMessage({channel:"chat-preview",...e},location.origin)}customElements.define("visual-builder.inject-chat-preview-agent",(0,Gn.createProviderClass)((async function(){pc||(pc=!0,n.e(2201).then(n.bind(n,2201)),mc({type:"initialized"}),window.addEventListener("message",(e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"toggle-inspecting":!function(e){if(nc===e)return;nc=e;const t=e?"addEventListener":"removeEventListener";window[t]("click",oc,!0),window[t]("mousedown",rc,!0),window[t]("mouseover",rc,!0),window[t]("mouseup",rc,!0),window[t]("pointerdown",rc,!0),window[t]("pointerover",rc,!0),window[t]("pointerup",rc,!0),window[t]("pointerleave",cc,!0),window[t]("pointermove",lc,!0)}(e.data.payload.inspecting);break;case"select":!function(e){const t=`${e.type}:${e.uuid}`,n=(0,Xn.w)(t);window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:n.map((t=>hc({...e,element:t,label:uc(t)})))}},location.origin)}(e.data.payload)}})),window.addEventListener("scroll",(()=>{mc({type:"scroll",payload:{x:window.scrollX,y:window.scrollY}})})))})));var Ac,gc=n(4014),vc=n(8918);let bc,fc,Ec,kc,wc,yc,xc,Nc,Lc,Mc,Cc;const{defineElement:Tc,property:Rc}=(0,p.createDecorators)();let Oc;var Ic=new WeakMap,_c=new WeakMap,Sc=new WeakMap,Dc=new WeakMap,Pc=new WeakMap;class Wc extends m.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,Ic,fc(this)),(0,o.A)(this,_c,(Ec(this),kc(this))),(0,o.A)(this,Sc,(wc(this),yc(this))),(0,o.A)(this,Dc,(xc(this),Nc(this))),(0,o.A)(this,Pc,(Lc(this),Mc(this))),Cc(this)}get generations(){return(0,c.A)(Ic,this)}set generations(e){(0,l.A)(Ic,this,e)}get category(){return(0,c.A)(_c,this)}set category(e){(0,l.A)(_c,this,e)}get theme(){return(0,c.A)(Sc,this)}set theme(e){(0,l.A)(Sc,this,e)}get uiVersion(){return(0,c.A)(Dc,this)}set uiVersion(e){(0,l.A)(Dc,this,e)}get app(){return(0,c.A)(Pc,this)}set app(e){(0,l.A)(Pc,this,e)}render(){return u().createElement(Fc,{generations:this.generations,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function Fc(e){let{generations:t,category:n,theme:a,uiVersion:i,app:o}=e;const r=(0,h.useRef)(),[s,l]=(0,h.useState)(!1),[c,d]=(0,h.useState)(!1),p=(0,h.useCallback)((()=>{const e=()=>{var t;const n=null===(t=r.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,h.useEffect)((()=>{if(!s)return;const e=De.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!e)throw new Error("Cannot find preview agent package: bricks/visual-builder");const t=r.current.contentWindow._preview_only_inject,n={...e,filePath:`${location.origin}${(0,De.getBasePath)()}${window.PUBLIC_ROOT??""}${e.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>t(e,n,void 0,!0)))).then((()=>{d(!0)}))}),[s]),(0,h.useEffect)((()=>{var e;if(!c)return;const s=null===(e=r.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const l=new Map,d=new Map;for(const e of t){let t=l.get(e.propertyId);t||l.set(e.propertyId,t=new Map);let n=t.get(e.rwType);n||t.set(e.rwType,n=new Map),n.set(e.displayLevel??0,e),d.set(e.propertyId,e.mockData)}const h=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"类别",className:"head-cell"}},{brick:"div",properties:{textContent:"展示等级",className:"head-cell last-col-cell",style:{gridColumn:"span 5",textAlign:"center"}}}],u={brick:"visual-builder.pre-generated-table-view",properties:{style:{gridTemplateColumns:"120px 80px repeat(5, 1fr)"}},children:h};let p=0;for(const[e,t]of l){let a=0;const i=p===l.size-1;for(const[o,r]of t){if(0===a){let n;for(const t of r.values()){n=t.propertyName??e;break}h.push({brick:"div",properties:{textContent:n,className:i?"last-row-cell":void 0,style:{gridRow:`span ${t.size}`}}})}const s=i&&a===t.size-1;h.push({brick:"div",properties:{textContent:o,className:s?"last-row-cell":void 0}});for(let t=-2;t<3;t++){var m;const a=r.get(t);let i;if(null!=a&&null!==(m=a.mockData)&&void 0!==m&&m.length){const t=a.mockData[Math.floor(Math.random()*a.mockData.length)];switch(a.category??n){case"detail-item":i={[e]:t};break;case"table-column":i={cellData:t}}}const o=[];2===t&&o.push("last-col-cell"),s&&o.push("last-row-cell"),h.push({brick:"div",...o?{properties:{className:o.join(" ")}}:null,children:[{brick:"visual-builder.pre-generated-container",properties:{useBrick:(null==a?void 0:a.storyboard)??[],dataSource:i},errorBoundary:!0}]})}a++}p++}s("yaml",{yaml:(0,kl.safeDump)(u,{schema:kl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:o,theme:a,uiVersion:i,styleText:vc.A})}),[o,c,t,a,i,n]),u().createElement("div",{className:b()("container")},u().createElement("iframe",{ref:r,src:`${(0,De.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:p}))}Ac=Wc,({e:[fc,Ec,kc,wc,yc,xc,Nc,Lc,Mc,Cc],c:[Oc,bc]}=(0,d.A)(Ac,[Tc("visual-builder.pre-generated-preview",{styleTexts:[gc.A]})],[[Rc({attribute:!1}),1,"generations"],[Rc(),1,"category"],[Rc(),1,"theme"],[Rc(),1,"uiVersion"],[Rc(),1,"app"]],0,void 0,m.ReactNextElement)),bc();var $c,Bc=n(9216);let Uc;const{defineElement:Kc}=(0,p.createDecorators)();let jc;class zc extends m.ReactNextElement{render(){return u().createElement(Vc,null)}}function Vc(){return u().createElement("slot",null)}$c=zc,[jc,Uc]=(0,d.A)($c,[Kc("visual-builder.pre-generated-table-view",{styleTexts:[Bc.A]})],[],0,void 0,m.ReactNextElement).c,Uc();var Hc,qc=n(4967);let Yc,Gc,Xc,Jc,Zc;const{defineElement:Qc,property:ed}=(0,p.createDecorators)();let td;var nd=new WeakMap,ad=new WeakMap;class id extends m.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,nd,Gc(this)),(0,o.A)(this,ad,(Xc(this),Jc(this))),Zc(this)}get useBrick(){return(0,c.A)(nd,this)}set useBrick(e){(0,l.A)(nd,this,e)}get dataSource(){return(0,c.A)(ad,this)}set dataSource(e){(0,l.A)(ad,this,e)}render(){return u().createElement(od,{useBrick:this.useBrick,dataSource:this.dataSource})}}function od(e){let{useBrick:t,dataSource:n}=e;return u().createElement($o.ReactUseMultipleBricks,{useBrick:t,data:n,errorBoundary:!0})}Hc=id,({e:[Gc,Xc,Jc,Zc],c:[td,Yc]}=(0,d.A)(Hc,[Qc("visual-builder.pre-generated-container",{styleTexts:[qc.A]})],[[ed({attribute:!1}),1,"useBrick"],[ed({attribute:!1}),1,"dataSource"]],0,void 0,m.ReactNextElement)),Yc(),n(2080),customElements.define("visual-builder.check-editor-by-name",(0,Gn.createProviderClass)((async function(e){try{await De.__secret_internals.loadEditors([e])}catch{return!1}return!!De.customEditors.get(e)})));var rd=n(6633);function sd(e,t){const n=new Map;for(const a of e){const e=(0,rd.collectMemberUsage)([a.if,a.value,a.resolve],t);n.set(a,e)}return n}function ld(e,t){e.forEach((n=>{!function(e,t){var n;const{dependencyList:a,nodeList:i,parents:o,result:r}=t,s=(0,We.cloneDeep)(e);r.push(s);const l=a.find((e=>e.node.key===s.key));if(null!==(n=l.deps)&&void 0!==n&&n.length&&!o.some((e=>e.key===s.key))){const e=s.children=[];!function(e,t){const n=[];e.deps.forEach((e=>{const a=t.nodeList.filter((t=>t.name===e));n.push(...a)})),ld(n,t)}(l,{dependencyList:a,nodeList:i,parents:[...o,s],result:e})}}(n,{...t,nodeList:e})}))}customElements.define("visual-builder.get-data-deps",(0,Gn.createProviderClass)(sd)),customElements.define("visual-builder.get-dependency-tree",(0,Gn.createProviderClass)((function(e,t){const n=e,a=sd(n.map((e=>e.data)),t.dataType),i=[];for(const[e,t]of a)i.push({deps:Array.from(t.usedProperties),node:n.find((t=>t.data===e))});const o=[];return ld(n,{result:o,dependencyList:i,parents:[]}),o})));var cd=n(264);customElements.define("visual-builder.parse-path",(0,Gn.createProviderClass)((async function(e,t){const n=[];return{regexp:(0,cd.MM)(e,n,(0,We.defaults)(t,{end:!1,strict:!1,sensitive:!0})),keys:n}})))},2080:(e,t,n)=>{n.d(t,{ADVANCED_CHANGE_KEY:()=>Ce,SchemaField:()=>Te});var a,i=n(4635),o=n(918),r=n(6902),s=n(5536),l=n(6121),c=n(829),d=n(2740),h=n(8769),u=n.n(h),p=n(4782),m=n(1389),A=(n(6477),n(5908)),g=n(7091),v=n(8788),b=n(6768),f=n(6257),E=n(9708),k=n(1242),w=n(3768),y=n(2803),x=n(3824),N=n(2513),L=n(5067),M=n(1477),C=n(4287),T=n(966),R=n(5768),O=n(6110),I=n(5944),_=n(8409),S=n(9322),D=n(3995),P=(n(74),n(1030)),W=n.n(P);let F,$,B,U,K,j,z,V,H,q,Y,G,X,J,Z,Q,ee,te,ne,ae,ie,oe,re,se,le,ce,de,he,ue,pe,me,Ae,ge,ve,be,fe,Ee,ke;const{defineElement:we,property:ye,method:xe,event:Ne}=(0,p.createDecorators)(),Le=u().forwardRef(et),Me="before_submit",Ce="on_advanced_change",Te=(0,g.Uy)({components:{FormLayout:E.Hb,Input:E.pd,FormItem:y.M,FormItemWithoutAdvanced:E.eI,FormCollapse:E.w9,NumberPicker:E.Y_,Radio:E.sx,Select:E.l6,Switch:E.dO,CategoryTitle:w.H,CodeEditor:x.S,IconSelect:N.r,ColorPicker:L.h,UseChildrenSelect:R._,InputWithUrl:M.r,InputWithUnit:T.U,TextAlignRadio:C.p,CustomOptions:I.F,BoxSize:O.i,CustomTab:_.v}});let Re,Oe;var Ie=new WeakMap,_e=new WeakMap,Se=new WeakMap,De=new WeakMap,Pe=new WeakMap,We=new WeakMap,Fe=new WeakMap,$e=new WeakMap,Be=new WeakMap,Ue=new WeakMap,Ke=new WeakSet,je=new WeakMap,ze=new WeakMap,Ve=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ge=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Ze=new WeakMap;class Qe extends m.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,Ke),(0,o.A)(this,Ie,(F(this),(0,h.createRef)())),(0,o.A)(this,_e,B(this)),(0,o.A)(this,Se,(U(this),K(this))),(0,o.A)(this,De,(j(this),z(this))),(0,o.A)(this,Pe,(V(this),H(this))),(0,o.A)(this,We,(q(this),Y(this))),(0,o.A)(this,Fe,(G(this),X(this))),(0,o.A)(this,$e,(J(this),Z(this))),(0,o.A)(this,Be,(Q(this),ee(this))),(0,o.A)(this,Ue,(te(this),ne(this))),(0,o.A)(this,je,(oe(this),re(this))),(0,o.A)(this,ze,(ce(this),de(this))),(0,o.A)(this,Ve,(pe(this),e=>{(0,s.A)(Ke,this,he).emit(e)})),(0,o.A)(this,He,me(this)),(0,o.A)(this,qe,(ve(this),e=>{(0,s.A)(Ke,this,Ae).emit(e)})),(0,o.A)(this,Ye,void 0),(0,o.A)(this,Ge,(0,A.fA)(Me,((e,t)=>n=>{(0,l.A)(Ye,this,n(e,t))}))),(0,o.A)(this,Xe,be(this)),(0,o.A)(this,Je,(ke(this),e=>{(0,s.A)(Ke,this,fe).emit(e)})),(0,o.A)(this,Ze,(e=>{const t="string"==typeof e&&"undefined"===e?void 0:(0,P.omit)(e,["dataset.testid"]),n=[];(0,P.isEmpty)(null==t?void 0:t.dataset)&&n.push("dataset"),(0,P.isEmpty)(null==t?void 0:t.style)&&n.push("style");const a=(0,P.omit)(t,n);if(!(0,P.isEmpty)(a))return a}))}get editorName(){return(0,c.A)(_e,this)}set editorName(e){(0,l.A)(_e,this,e)}get values(){return(0,c.A)(Se,this)}set values(e){(0,l.A)(Se,this,e)}get advancedMode(){return(0,c.A)(De,this)}set advancedMode(e){(0,l.A)(De,this,e)}get dataList(){return(0,c.A)(Pe,this)}set dataList(e){(0,l.A)(Pe,this,e)}get editorPackages(){return(0,c.A)(We,this)}set editorPackages(e){(0,l.A)(We,this,e)}get links(){return(0,c.A)(Fe,this)}set links(e){(0,l.A)(Fe,this,e)}get extraLibs(){return(0,c.A)($e,this)}set extraLibs(e){(0,l.A)($e,this,e)}get childSlots(){return(0,c.A)(Be,this)}set childSlots(e){(0,l.A)(Be,this,e)}validate(){var e;const t=null===(e=(0,c.A)(Ie,this).current)||void 0===e?void 0:e.getFormInstance();(0,l.A)(Ye,this,null);const n=()=>this.advancedMode?t.values[D.qZ]:W().omit(t.values,[D.qZ]);t.validate().then((()=>{t.notify(Me,n()),(0,s.A)(Ke,this,ae).emit((0,c.A)(Ye,this)??n())})).catch((e=>{(0,s.A)(Ke,this,se).emit(e)}))}render(){return u().createElement(Le,{ref:(0,c.A)(Ie,this),editorName:this.editorName,values:(0,c.A)(Ze,this).call(this,this.values),advancedMode:this.advancedMode,dataList:this.dataList,extraLibs:this.extraLibs,links:this.links,childSlots:this.childSlots,editorPackages:this.editorPackages,handleValuesChange:(0,c.A)(Ve,this),handleTokenClick:(0,c.A)(qe,this),handleTriggerAction:(0,c.A)(Je,this),onSubmitEffect:(0,c.A)(Ge,this)})}}function et(e,t){let{advancedMode:n,values:a,editorName:i,dataList:o,editorPackages:r,extraLibs:s,childSlots:l,links:c,handleValuesChange:d,handleTokenClick:p,handleTriggerAction:m,onSubmitEffect:E}=e;const[w,y]=(0,h.useState)(Re),x=(0,k.useCurrentTheme)(),N=(0,h.useMemo)((()=>(0,f.VC)()),[]),L=(0,h.useMemo)((()=>(0,A.DG)()),[w]),M=(0,h.useRef)(null),C=(0,h.useRef)(!1),T=(0,h.useMemo)((()=>(0,A.fA)(Ce,((e,t)=>n=>{const a=!e&&t.values[D.qZ]?t.values[D.qZ]:t.values;M.current=n(e,t,a)}))),[]);(0,h.useImperativeHandle)(t,(()=>({getFormInstance:()=>L})));const R=(0,h.useCallback)((async()=>{S.customEditors.get(i)?y((()=>{var e;return null===(e=S.customEditors.get(i))||void 0===e?void 0:e(u())})):(await S.__secret_internals.loadEditors([i],r),Re=()=>{var e;return null===(e=S.customEditors.get(i))||void 0===e?void 0:e(u())},y(Re))}),[i,r]),O=(0,h.useCallback)(((e,t)=>{if(t){const t=W().omit(e,[D.qZ]);return{[D.qZ]:W().isEmpty(t)?"":t}}return e[D.qZ]??e}),[]);return(0,h.useEffect)((()=>{R()}),[R]),(0,h.useEffect)((()=>{w&&L.setInitialValues(a,"overwrite")}),[w,L]),(0,h.useEffect)((()=>{C.current=!0,M.current=null,L.notify(Ce,n),L.query(D.N4).take((e=>{e.display=n?"hidden":"visible"})),L.query(D.qZ).take((e=>{e.display=n?"visible":"hidden"}));const e=L.getState().values,t=O(M.current??e,n);L.setValues(t,"overwrite"),C.current=!1}),[n,L,O,w]),(0,h.useEffect)((()=>{L.addEffects("onValueChange",(()=>{(0,A.A$)((e=>{C.current||d(e.values)}))}))}),[L,d]),w?u().createElement("div",{className:"property-form-wrapper"},u().createElement(v.Ay,{prefixCls:"antdV5",theme:{algorithm:"dark-v2"===x?b.A.darkAlgorithm:b.A.defaultAlgorithm,components:{InputNumber:{handleVisible:!0}}},getPopupContainer:e=>e},u().createElement(f.N7,{cache:N},u().createElement(g.Op,{form:L},u().createElement(w,{advancedMode:n,SchemaFieldComponent:Te,form:L,scope:{dataList:o,advancedMode:n,childSlots:l,extraLibs:s,links:c,tokenClick:e=>p(e.detail),triggerAction:m},effects:{onFieldInit:A.yd,onFieldValueChange:A.$l,onFieldInitialValueChange:A.J4,onFormInitialValuesChange:A.oJ,onFormValidateSuccess:A.zu,onFormValuesChange:A.A$,onSubmit:E,onAdvancedChange:T},formilySchemaFormatter:D.cV}))))):null}a=Qe,({e:[B,U,K,j,z,V,H,q,Y,G,X,J,Z,Q,ee,te,ne,ae,ie,oe,re,se,le,ce,de,he,ue,pe,me,Ae,ge,ve,be,fe,Ee,ke,F],c:[Oe,$]}=(0,d.A)(a,[we("visual-builder.property-editor",{shadowOptions:!1,dependencies:["eo-icon-select","vs.code-editor","eo-tooltip"]})],[[ye(),1,"editorName"],[ye({attribute:!1}),1,"values"],[ye({type:Boolean}),1,"advancedMode"],[ye({attribute:!1}),1,"dataList"],[ye({attribute:!1}),1,"editorPackages"],[ye({attribute:!1}),1,"links"],[ye({attribute:!1}),1,"extraLibs"],[ye({attribute:!1}),1,"childSlots"],[Ne({type:"validate.success"}),1,"successEvent",e=>(0,c.A)(Ue,e),(e,t)=>(0,l.A)(Ue,e,t)],[Ne({type:"validate.error"}),1,"errorEvent",e=>(0,c.A)(je,e),(e,t)=>(0,l.A)(je,e,t)],[xe(),2,"validate"],[Ne({type:"values.change"}),1,"valuesChangeEvent",e=>(0,c.A)(ze,e),(e,t)=>(0,l.A)(ze,e,t)],[Ne({type:"token.click"}),1,"tokenClick",e=>(0,c.A)(He,e),(e,t)=>(0,l.A)(He,e,t)],[Ne({type:"trigger.action"}),1,"triggerActionEvent",e=>(0,c.A)(Xe,e),(e,t)=>(0,l.A)(Xe,e,t)]],0,(e=>Ze.has((0,r.A)(e))),m.ReactNextElement)),$()},7236:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o),s=n(6131),l=r()(i());l.i(s.A),l.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.message{display:flex;gap:8px}.main{flex:1;min-width:0}.label{font-weight:bold;line-height:28px}.message:not(:last-child){margin-bottom:2em}.invisible-dots{opacity:0}.failed .content{color:var(--color-error)}.command:not(:first-child){margin-top:1em}.command:not(:last-child){margin-bottom:1em}pre{white-space:pre-wrap;background-color:var(--palette-gray-3);border-radius:6px;padding:1em}.markdown > :first-child{margin-top:0}.markdown > :last-child{margin-bottom:0}.avatar{align-self:flex-start;display:flex;align-items:center;justify-content:center}.texting::after{content:" ";animation:texting 2s infinite;white-space:pre}@keyframes texting{0%{content:" "}25%{content:". "}50%{content:".. "}75%{content:"..."}100%{content:" "}}pre[class*="language-"]{overflow:visible}pre[class*="language-"],\ncode[class*="language-"]{white-space:pre-wrap}eo-avatar.role-assistant::part(avatar-icon){background-color:var(--palette-blue-5)}.content{word-wrap:break-word}.plain{white-space:pre-wrap}',""]);const c=l.toString()},1563:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative;box-shadow:rgba(204,204,204,0.2) 0px 0px 0px 1px}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}.outline{position:absolute;border-style:solid;border-width:2px;border-radius:0 4px 4px;pointer-events:none}.label{position:absolute;left:-2px;top:-20px;height:18px;line-height:16px;padding:2px 5px 0;font-size:12px;border-radius:4px 4px 0 0;white-space:nowrap}.outline.hover{border-color:rgba(var(--palette-blue-6-channel),0.3)}.outline.hover .label{background:rgba(var(--palette-blue-6-channel),0.3)}.outline.active{border-color:var(--palette-blue-6)}.outline.active .label{background:var(--palette-blue-6)}.container:not(.inspecting) .outline{display:none}",""]);const s=r.toString()},6213:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.contract-wrapper{display:flex;gap:4px}.contract-selector{flex:1}.version-selector{width:100px}.options-tips{padding:0px 10px;font-weight:400;color:#999;white-space:nowrap;font-style:italic}",""]);const s=r.toString()},7540:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.mask,\n.container{display:none;position:fixed;z-index:1}.mask{top:0;bottom:0;left:0;right:0;z-index:1}:host([active]) .mask,\n:host([active]) .container{display:block}.container{background:var(--antd-dropdown-menu-bg);border-radius:var(--medius-border-radius);padding:5px}.container .title{padding:5px 12px;cursor:default;color:var(--color-secondary-text);border-bottom:1px solid var(--color-text-divider-line)}.container eo-menu{border:none;padding:5px 0}.container eo-menu eo-menu-item:not([disabled]):hover::part(menu-item){background-color:var(--left-sidebar-item-hover-bg)}.container eo-menu eo-menu-item[disabled]::part(menu-item){cursor:not-allowed}.container eo-menu eo-menu-item::part(menu-item){cursor:grab;padding:5px 12px;border-radius:var(--medius-border-radius);min-width:max-content}.container eo-menu eo-menu-item.dragging{opacity:0.5}.container eo-menu eo-tooltip{display:block}",""]);const s=r.toString()},2381:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{--local-node-outline-style:solid;display:block}:host([hidden]){display:none}:host([not-synced]){--local-node-outline-style:dashed}*{box-sizing:border-box}.node{width:168px;max-width:none;height:130px;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-moz-fit-content;width:fit-content;padding-bottom:4px}.label,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:18px;font-size:var(--sub-title-font-size-small);color:var(--color-header-text);font-weight:var(--font-weight-500);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.node.editing-label .label{height:0}.node:not(.editing-label) .label-input{display:none}.add-button,\n.icon-container,\n.thumbnail-container,\n.thumbnail-placeholder{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px var(--local-node-outline-style) var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;width:100%;position:relative;flex-direction:column}.thumbnail-placeholder{color:var(--palette-gray-5);font-size:36px;flex:1}.icon-container{font-size:20px;background-color:var(--palette-teal-6);color:var(--palette-gray-4);width:36px;height:36px;border-radius:50%;outline-offset:4px}:host([active]) .thumbnail-container,\n:host([active]) .icon-container{outline:2px var(--local-node-outline-style) var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px var(--local-node-outline-style) var(--palette-blue-3)}.add-button{position:absolute;bottom:-26px;left:calc(50% - 12px);width:24px;height:24px;background:var(--palette-gray-3);color:var(--palette-gray-6);border-radius:50%;cursor:pointer}:host([not-synced]) .add-button,\n:host([disable-child-append]) .add-button,\n:host(:not([active])) .add-button{display:none}.add-button:hover{background:var(--palette-blue-5);color:var(--palette-gray-2)}.external{position:absolute;top:4px;left:4px;padding:0 10px;display:flex;align-items:center;gap:6px;background:var(--palette-purple-4);font-size:12px;line-height:20px;height:22px;cursor:pointer;color:var(--palette-gray-1);border-radius:9999px;right:4px;max-width:-moz-fit-content;max-width:fit-content}.external-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.external:hover{background:var(--palette-purple-5)}.sub-nodes{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;width:100%}.sub-node{background-color:var(--palette-gray-2);border-radius:4px;padding:6px;display:flex;flex-direction:column;justify-content:space-between;height:32px}.sub-node-skeleton-title{width:18px;height:4px;border-radius:2px;align-self:flex-start;background-color:var(--palette-gray-4)}.sub-node-skeleton-content{width:100%;height:4px;border-radius:2px;background-color:var(--palette-gray-4)}.sub-node-skeleton-button{width:18px;height:4px;border-radius:2px;align-self:flex-end;background-color:var(--palette-blue-3)}.sub-node:hover{background-color:var(--palette-gray-3)}.sub-node:hover .sub-node-skeleton-title,\n.sub-node:hover .sub-node-skeleton-content{background-color:var(--palette-gray-5)}.sub-node:hover .sub-node-skeleton-button{background-color:var(--palette-blue-4)}",""]);const s=r.toString()},4967:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:inline-block}:host([hidden]){display:none}",""]);const s=r.toString()},8918:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,"#preview-root{padding:0;height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px}.head-cell{position:sticky;top:0;background:var(--body-background);z-index:1;font-weight:bold}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}",""]);const s=r.toString()},4014:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=r.toString()},9216:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:grid;width:100%}:host([hidden]){display:none}::slotted(*){padding:4px 8px;border:1px solid var(--theme-gray-border-color);border-left-color:transparent;border-top-color:transparent;min-width:0;word-break:break-word}",""]);const s=r.toString()},9765:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,".custom-scrollbar-container{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.15) rgba(255,255,255,0.03)}.custom-scrollbar-container::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;position:absolute}.custom-scrollbar-container::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0);border-radius:4px}.custom-scrollbar-container:hover::-webkit-scrollbar-track{background-color:rgba(255,255,255,0.03)}.custom-scrollbar-container:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.15)}",""]);const s=r.toString()},3430:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,'.workBenchActionList{display:flex;flex-direction:column;width:min-content;height:100%;background-color:#4297ff}:host-context(html[data-theme="dark-v2"]) .workBenchActionList,\n:host-context([data-override-theme="dark-v2"]) .workBenchActionList{background-color:#323237}',""]);const s=r.toString()},5292:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:rgba(255,255,255,0.4);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:white}.action.active::part(link),\n.action::part(link):hover{color:white}',""]);const s=r.toString()},1361:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,":host{display:inline-block}:host([hidden]){display:none}eo-popover::part(popup){width:800px;max-width:60vw;padding:10px;background:var(--color-fill-bg-container-4);border-radius:var(--medius-border-radius);box-shadow:var(--feedback-container-shadow);z-index:1000}.history-title{font-size:var(--title-font-size);font-weight:var(--font-weight-500);color:var(--color-strong-text);margin-bottom:5px}.history-list{max-height:500px;overflow-y:auto}.item-container{padding:10px 0;display:flex;flex-direction:column;gap:5px}.empty{padding:5px 0 10px 0;font-size:14px;color:var(--text-color-secondary);text-align:center}.item-container:not(:last-of-type){border-bottom:1px solid var(--color-border-divider-line)}.item-title{display:flex;align-items:center;justify-content:space-between;gap:5px}.title-left,\n.title-right{display:flex;align-items:center}.title-left{cursor:pointer;overflow:hidden;gap:5px}.topic{font-size:14px;color:var(--text-color-title);font-weight:var(--font-weight-500);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.branch{font-size:14px;color:var(--text-color-secondary)}.rollback{margin-right:5px;font-size:14px;color:var(--text-color-secondary);cursor:pointer}.rollback:hover{color:var(--color-brand)}.item-info{display:flex;align-items:center;gap:5px}.time,\n.operator{font-size:14px;color:var(--text-color-secondary)}.load-more-container{display:block;text-align:center}.end-container{display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;color:var(--color-brand)}.rollback-all{cursor:pointer}",""]);const s=r.toString()},7180:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,':host{display:block;--pane-color:#595959}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--pane-color:#ccc}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.pane{display:flex;flex-direction:column;color:var(--pane-color);height:100%}.pane-header{display:flex;align-items:center;cursor:pointer;border-top:1px solid transparent;position:relative}.pane-header:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#007fd4}:host(:not(:first-child)) .pane-header{border-top-color:rgba(204,204,204,0.2)}.pane-scroll-shadow{display:none;position:absolute;bottom:-3px;left:0;right:0;height:3px;box-shadow:#000000 0 6px 6px -6px inset;z-index:1}.scrolled .pane-scroll-shadow{display:block}.pane-title{display:flex;align-items:center;font-size:13px;line-height:24px;height:25px;min-width:0;flex:1}.title-icon{display:flex;justify-content:center;align-items:center;width:24px;padding-right:2px;line-height:1;flex-shrink:0}.title-label{text-transform:uppercase;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-body{flex-grow:1;min-height:0;display:none;overflow:hidden;overflow-y:auto;overflow-y:overlay}:host([active]) .pane-body{display:initial}:host(:not(:hover)) ::slotted([slot="actions"]){display:none}.badge{background-color:rgb(77,77,77);color:rgb(255,255,255);border-radius:11px;height:18px;padding:3px 6px;line-height:13px;margin:0 3px;font-size:12px}',""]);const s=r.toString()},2150:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o)()(i());r.push([e.id,':host{--sidebar-background:#fff;--title-container-background:#fff;--title-container-color:#595959;display:block;outline-color:rgba(83,89,93,0.5);background-color:var(--sidebar-background);height:100%}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--sidebar-background:#181818;--title-container-background:#181818;--title-container-color:rgb(187,187,187);background-color:var(--sidebar-background)}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.sidebar{display:flex;flex-direction:column;height:100%}.title-container{display:flex;padding:0 8px 8px 8px;color:var(--title-container-color);background:var(--title-container-background)}.title-label{font-weight:300;line-height:44px;padding-left:12px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-container{flex-grow:1;min-height:0;display:flex;flex-direction:column}::slotted([slot="panes"]){transition:flex 0.2s;min-height:25px}',""]);const s=r.toString()},6131:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(6758),i=n.n(a),o=n(935),r=n.n(o),s=n(7745),l=r()(i());l.i(s.A),l.push([e.id,"",""]);const c=l.toString()},264:(e,t,n)=>{function a(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function o(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var o=n.strict,r=void 0!==o&&o,s=n.start,l=void 0===s||s,c=n.end,d=void 0===c||c,h=n.encode,u=void 0===h?function(e){return e}:h,p=n.delimiter,m=void 0===p?"/#?":p,A=n.endsWith,g="[".concat(a(void 0===A?"":A),"]|$"),v="[".concat(a(m),"]"),b=l?"^":"",f=0,E=e;f<E.length;f++){var k=E[f];if("string"==typeof k)b+=a(u(k));else{var w=a(u(k.prefix)),y=a(u(k.suffix));if(k.pattern)if(t&&t.push(k),w||y)if("+"===k.modifier||"*"===k.modifier){var x="*"===k.modifier?"?":"";b+="(?:".concat(w,"((?:").concat(k.pattern,")(?:").concat(y).concat(w,"(?:").concat(k.pattern,"))*)").concat(y,")").concat(x)}else b+="(?:".concat(w,"(").concat(k.pattern,")").concat(y,")").concat(k.modifier);else"+"===k.modifier||"*"===k.modifier?b+="((?:".concat(k.pattern,")").concat(k.modifier,")"):b+="(".concat(k.pattern,")").concat(k.modifier);else b+="(?:".concat(w).concat(y,")").concat(k.modifier)}}if(d)r||(b+="".concat(v,"?")),b+=n.endsWith?"(?=".concat(g,")"):"$";else{var N=e[e.length-1],L="string"==typeof N?v.indexOf(N[N.length-1])>-1:void 0===N;r||(b+="(?:".concat(v,"(?=").concat(g,"))?")),L||(b+="(?=".concat(v,"|").concat(g,")"))}return new RegExp(b,i(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var a=e[n];if("*"!==a&&"+"!==a&&"?"!==a)if("\\"!==a)if("{"!==a)if("}"!==a)if(":"!==a)if("("!==a)t.push({type:"CHAR",index:n,value:e[n++]});else{var i=1,o="";if("?"===e[s=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--i){s++;break}}else if("("===e[s]&&(i++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=e[s++]}else o+=e[s++]+e[s++];if(i)throw new TypeError("Unbalanced pattern at ".concat(n));if(!o)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:o}),n=s}else{for(var r="",s=n+1;s<e.length;){var l=e.charCodeAt(s);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;r+=e[s++]}if(!r)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:r}),n=s}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),i=t.prefixes,o=void 0===i?"./":i,r="[^".concat(a(t.delimiter||"/#?"),"]+?"),s=[],l=0,c=0,d="",h=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},u=function(e){var t=h(e);if(void 0!==t)return t;var a=n[c],i=a.type,o=a.index;throw new TypeError("Unexpected ".concat(i," at ").concat(o,", expected ").concat(e))},p=function(){for(var e,t="";e=h("CHAR")||h("ESCAPED_CHAR");)t+=e;return t};c<n.length;){var m=h("CHAR"),A=h("NAME"),g=h("PATTERN");if(A||g){var v=m||"";-1===o.indexOf(v)&&(d+=v,v=""),d&&(s.push(d),d=""),s.push({name:A||l++,prefix:v,suffix:"",pattern:g||r,modifier:h("MODIFIER")||""})}else{var b=m||h("ESCAPED_CHAR");if(b)d+=b;else if(d&&(s.push(d),d=""),h("OPEN")){v=p();var f=h("NAME")||"",E=h("PATTERN")||"",k=p();u("CLOSE"),s.push({name:f||(E?l++:""),pattern:f&&!E?r:E,prefix:v,suffix:k,modifier:h("MODIFIER")||""})}else u("END")}}return s}(e,n),t,n)}function r(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,a=0,i=n.exec(e.source);i;)t.push({name:i[1]||a++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var a=e.map((function(e){return r(e,t,n).source}));return new RegExp("(?:".concat(a.join("|"),")"),i(n))}(e,t,n):o(e,t,n)}n.d(t,{MM:()=>r})}}]);
|
|
3
|
-
//# sourceMappingURL=7150.4d8eda87.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 7426.70d95964.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[7426,4586],{264:(e,t,n)=>{function r(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function o(e){return e&&e.sensitive?"":"i"}function i(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var i=n.strict,s=void 0!==i&&i,a=n.start,c=void 0===a||a,l=n.end,u=void 0===l||l,d=n.encode,f=void 0===d?function(e){return e}:d,p=n.delimiter,h=void 0===p?"/#?":p,m=n.endsWith,g="[".concat(r(void 0===m?"":m),"]|$"),v="[".concat(r(h),"]"),y=c?"^":"",b=0,w=e;b<w.length;b++){var S=w[b];if("string"==typeof S)y+=r(f(S));else{var E=r(f(S.prefix)),A=r(f(S.suffix));if(S.pattern)if(t&&t.push(S),E||A)if("+"===S.modifier||"*"===S.modifier){var k="*"===S.modifier?"?":"";y+="(?:".concat(E,"((?:").concat(S.pattern,")(?:").concat(A).concat(E,"(?:").concat(S.pattern,"))*)").concat(A,")").concat(k)}else y+="(?:".concat(E,"(").concat(S.pattern,")").concat(A,")").concat(S.modifier);else"+"===S.modifier||"*"===S.modifier?y+="((?:".concat(S.pattern,")").concat(S.modifier,")"):y+="(".concat(S.pattern,")").concat(S.modifier);else y+="(?:".concat(E).concat(A,")").concat(S.modifier)}}if(u)s||(y+="".concat(v,"?")),y+=n.endsWith?"(?=".concat(g,")"):"$";else{var I=e[e.length-1],C="string"==typeof I?v.indexOf(I[I.length-1])>-1:void 0===I;s||(y+="(?:".concat(v,"(?=").concat(g,"))?")),C||(y+="(?=".concat(v,"|").concat(g,")"))}return new RegExp(y,o(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),o=t.prefixes,i=void 0===o?"./":o,s="[^".concat(r(t.delimiter||"/#?"),"]+?"),a=[],c=0,l=0,u="",d=function(e){if(l<n.length&&n[l].type===e)return n[l++].value},f=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))},p=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t};l<n.length;){var h=d("CHAR"),m=d("NAME"),g=d("PATTERN");if(m||g){var v=h||"";-1===i.indexOf(v)&&(u+=v,v=""),u&&(a.push(u),u=""),a.push({name:m||c++,prefix:v,suffix:"",pattern:g||s,modifier:d("MODIFIER")||""})}else{var y=h||d("ESCAPED_CHAR");if(y)u+=y;else if(u&&(a.push(u),u=""),d("OPEN")){v=p();var b=d("NAME")||"",w=d("PATTERN")||"",S=p();f("CLOSE"),a.push({name:b||(w?c++:""),pattern:b&&!w?s:w,prefix:v,suffix:S,modifier:d("MODIFIER")||""})}else f("END")}}return a}(e,n),t,n)}function s(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 s(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),o(n))}(e,t,n):i(e,t,n)}n.d(t,{MM:()=>s})},4586:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(1369);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},1369:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(7545);function o(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=(0,r.A)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},7545:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},7426:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>Ht,Notification:()=>en,StoryboardFunctionRegistryFactory:()=>pe,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>pi,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>Et,checkIfOfComputed:()=>St,createHistory:()=>I,createRuntime:()=>ti,customEditors:()=>yi,customProcessors:()=>x,customTemplates:()=>_e,fetchByProvider:()=>bi,getAuth:()=>hi,getBasePath:()=>m,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>ee,getHistory:()=>C,getPageInfo:()=>no,getRealValue:()=>Si,getRuntime:()=>ni,getV2RuntimeFromDll:()=>k,handleHttpError:()=>Zt,httpErrorToString:()=>Gt,isLoggedIn:()=>gi,isUnauthenticatedError:()=>Yt,logout:()=>mi,matchPath:()=>Mt,registerWidgetFunctions:()=>$e,registerWidgetI18n:()=>N,setUIVersion:()=>oo,unstable_createRoot:()=>wi});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>Ir,debugDataValue:()=>wr,getAddedContracts:()=>br,getAllContextValues:()=>hr,getBrickPackagesById:()=>mr,getContextValue:()=>pr,getLegalRuntimeValue:()=>Sr,getRenderId:()=>yr,legacyDoTransform:()=>or,loadBricks:()=>gr,loadEditors:()=>vr,mountUseBrick:()=>nr,renderUseBrick:()=>tr,setRealTimeDataInspectRoot:()=>kr,symbolForRootRuntimeContext:()=>er,unmountUseBrick:()=>rr,updateSnippetPreviewSettings:()=>dr,updateStoryboard:()=>ir,updateStoryboardByRoute:()=>sr,updateStoryboardBySnippet:()=>ur,updateStoryboardByTemplate:()=>ar,updateTemplatePreviewSettings:()=>cr});var o=n(4635),i=n(4586),s=n(918),a=n(2559),c=n(6121),l=n(829),u=n(6765),d=n(6998),f=n(1351),p=n(155),h=(n(597),n(2890));function m(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var g=n(1030);function v(e,t){const n=(0,g.orderBy)(e,(e=>{var t;return(null===(t=e.app.homepage)||void 0===t?void 0:t.length)??0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&y(n,t))return e}}function y(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function b(e){var t;return!e||(null===(t=ni().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let w,S=!1;function E(e,t){S=!confirm(e),t(!S)}function A(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,h.parsePath)(o).pathname:o.pathname,"string"==typeof a&&a.startsWith("/")&&b(function(e){var t;return v((null===(t=Jo)||void 0===t?void 0:t.storyboards)??[],e)}(a))?location["push"===r?"assign":"replace"](c?m()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,i,s)}}return{push:r("push"),replace:r("replace")}}function k(){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 I(){if(!w){const e=(0,h.createBrowserHistory)({basename:m().replace(/\/$/,""),getUserConfirmation:E});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){S=!1,t(e,n),null==r||r(S)}function o(e,t,r){S=!1,n(e,t),null==r||r(S)}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),f={};Object.assign(f,n,a);for(const[e,t]of Object.entries(f))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},...A({...e,push:r,replace:o})}}(e)),w=e}return w}const C=function(){const e=k();if(e)return e.getHistory}()||function(){return w};var R=n(9422),T=n(8897),O=n(6633),P=n(540),_=n(1680),M=new WeakMap;const x=function(){const e=k();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,s.A)(this,M,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,l.A)(M,this).get(n);if(o||(o=new Map,(0,l.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,l.A)(M,this).get(e)}};function B(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=L("app",t.id),r=[];return Object.entries(n.i18n).forEach((t=>{let[n,o]=t;u.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)u.i18n.removeResourceBundle(t,e)}}}function L(e,t){return`${e}/${t}`}function $(e){return u.i18n.getFixedT(null,L("widget",e))}const N=function(){const e=k();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=L("widget",e);Object.entries(t).forEach((e=>{let[t,r]=e;u.i18n.addResourceBundle(t,n,r)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",j="devtools-panel-change";let D,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||D&&"Evaluations"!==D))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 z=()=>{throw new Error("Can't modify read-only proxy object")},H={set:z,defineProperty:z,deleteProperty:z,setPrototypeOf:z};function q(e){return new Proxy(e,H)}function G(e){let{get:t,ownKeys:n}=e;return W()?q(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let Y="light";const Q=new f.JsonStorage(localStorage),J="apps-theme";function X(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?X(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){Q.setItem(J,{...re(),...e})}function re(){let e;try{e=Q.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return 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:c,appendI18nNamespace:l,storyboardFunctions:d,isStoryboardFunction:f}=t;switch(e){case"BASE_URL":return i?"/next":m().replace(/\/$/,"");case"FN":return d;case"IMG":return i?{get:e=>`mock/images/${e}`}:s?null==ei||null===(n=ei.images)||void 0===n?void 0:n.widgetImagesFactory(s,a):null==ei||null===(r=ei.images)||void 0===r?void 0:r.imagesFactory(c.id,c.isBuildPush,c.currentVersion);case"I18N":return i?g.identity:s?$(s):u.i18n.getFixedT(null,[l,L("app",c.id)].filter(Boolean));case"I18N_TEXT":return i?de:u.i18nText;case"PERMISSIONS":return q({check:i?fe:null==ei||null===(o=ei.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return q({getTheme:i?()=>"light":Z});case"console":return f?q(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 fe(){return!0}function pe(){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:T.precookFunction,cook:T.cook,supply:_.supply}),s=new Proxy(Object.freeze({}),{get:(c,l)=>function(c){const l=o.get(c);if(!l)return;if(l.processed)return l.cooked;let u;n&&(u=n.createCollector(c));const d=(0,T.precookFunction)(l.source,{typescript:l.typescript,hooks:u&&{beforeVisit:u.beforeVisit},cacheKey:l}),f=(0,_.supply)(d.attemptToVisitGlobals,le(d.attemptToVisitGlobals,{collectCoverage:n,widgetId:e,widgetVersion:t,app:a,storyboardFunctions:s,isStoryboardFunction:!0}),!!n);return l.cooked=(0,T.cook)(d.function,l.source,{rules:{noVar:!0},globalVariables:i?{...f,...null!=i&&i.LodashWithStaticFields&&d.attemptToVisitGlobals.has("_")?{_:{...f._,...i.LodashWithStaticFields}}:null,...null!=i&&i.ArrayConstructor&&d.attemptToVisitGlobals.has("Array")?{Array:i.ArrayConstructor}:null,...null!=i&&i.ObjectWithStaticFields&&d.attemptToVisitGlobals.has("Object")?{Object:{...f.Object,...i.ObjectWithStaticFields}}:null}:f,ArrayConstructor:null==i?void 0:i.ArrayConstructor,hooks:u&&{beforeEvaluate:u.beforeEvaluate,beforeCall:u.beforeCall,beforeBranch:u.beforeBranch},debug:!!r}),l.processed=!0,l.cooked}(l)});let a;return{storyboardFunctions:s,registerStoryboardFunctions:function(e,t){if(t&&(a=t),o.clear(),Array.isArray(e))for(const t of e){const e=(0,O.collectMemberUsageInFunction)(t,"FN",!!n),r=(0,O.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");o.set(t.name,{source:t.source,typescript:t.typescript,deps:e,hasPermissionsCheck:r})}},updateStoryboardFunction(e,t){const n={...t,name:e},r=(0,O.collectMemberUsageInFunction)(n,"FN",!0),i=(0,O.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,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,T.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,T.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:he,registerStoryboardFunctions:me,checkPermissionsUsage:ge}=pe();var ve={};try{ve.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)})),ve.EventTarget=i}(Object,new WeakMap)}const ye=ve.EventTarget;let be=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const we=new Map([[be.xLarge,"1920px"],[be.large,"1600px"],[be.medium,"1280px"],[be.small,"1024px"],[be.xSmall,0]]),Se=new ye,Ee={},Ae={};function ke(e,t){let n=!1;Ee[t]=e.matches;for(const[e]of we)if(Ee[e]&&Ae.breakpoint!==e){Ae.breakpoint=e,n=!0;break}n&&Se.dispatchEvent(new CustomEvent("change",{detail:Ae}))}we.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){const n="local"===e?localStorage:sessionStorage;return JSON.parse(n.getItem(t)??"null")}}function Re(e){var t,n;return!(null===(t=e?e.flags:null===(n=ni())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Te(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 Oe=new Set(["prefix"]);var Pe=new WeakMap;const _e=function(){const e=k();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,s.A)(this,Pe,new Map)}define(e,t){var n,r;let o=(0,l.A)(Pe,this).has(e);o?console.warn(`Custom template of "${e}" already registered.`):(o=!!customElements.get(e),o&&console.warn(`Custom template of "${e}" already defined by customElements.`));const i=Re(),s=(null===(n=t.proxy)||void 0===n?void 0:n.properties)??{},a=[],c=[];for(const[t,n]of Object.entries(s))n.asVariable?(Te(i,"Template `asVariable`",e,t),i||c.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&a.push([t,n]);const u={...t,proxy:{...t.proxy,properties:Object.fromEntries(a)},state:(t.state?i?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(c.map((e=>({name:e,expose:!0}))))};(0,l.A)(Pe,this).set(e,{...u,name:e});const d=(f=u.state,(0,g.uniq)((null==f?void 0:f.filter((e=>e.expose)).map((e=>e.name)))??[]));var f;const p=Object.entries((null===(r=u.proxy)||void 0===r?void 0:r.methods)??{}),h=d.concat(a.map((e=>e[0]))),m=p.map((e=>e[0])),v=h.concat(m).filter((e=>e in HTMLElement.prototype&&!Oe.has(e)));if(v.length>0&&(Te(i,"Using native HTMLElement properties as template properties or methods",e,...v),i))throw new Error(`In custom template "${e}", ${v.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!o){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return h}static get _dev_only_definedMethods(){return m}$$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 d)a.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 a)Object.defineProperty(t.prototype,e,{get(){return this.$$getElementByRef(n.ref)[n.refProperty??e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);o&&(o[n.refProperty??e]=t)},enumerable:!0});for(const[e,n]of p)Object.defineProperty(t.prototype,e,{value(){this.$$getElementByRef(n.ref)[n.refMethod??e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,l.A)(Pe,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${n??""}`);const i=o.get(r);if(!i)throw new Error(`Template state store is not found when using "${t}"${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}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return r}const Be=new Map,Le=new Proxy(Object.freeze({}),{get:(e,t)=>Be.get(t)}),$e=function(){const e=k();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Be.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=pe({widgetId:e,widgetVersion:n});Be.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,je=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},De=(e,t)=>{if(Fe(e)||Fe(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(je(e),je(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=De(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},Ve=(e,t,n)=>{He(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]},ze=Object.keys(We),He=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===ze.indexOf(e))throw new Error(`Invalid operator, expected one of ${ze.join("|")}`)};function qe(e,t){let n=fi(e);if(!n&&null!=ei&&ei.checkInstalledApps&&(n=ei.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 Ge(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${n??""}`);const i=o.get(r);if(!i)throw new Error(`Form state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return i}const Ye=new Map;async function Qe(e){var t;const n=null==ei||null===(t=ei.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=ei.flowApi.FLOW_API_PROVIDER);let r=Ye.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)ei.flowApi.registerFlowApiProvider();else if(await(0,d.loadBricksImperatively)([e],ci()),!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 Xe(e){if((0,f.isObject)(e)&&!Ze(e))if(Je.add(e),Array.isArray(e))e.forEach(Xe);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Xe)}}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(Te(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const[u,d]=await Promise.all([Qe(r),mt(i,t)]),f=null==n?void 0:n.renderId,p=nt(u,r,o,d,n,i,!!f&&f!==li());let h,{transform:m}=e;try{const e=await p;h=l?(0,g.get)(e,c):e,Xe(h)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;m=s.transform,h=e}return m?"string"==typeof m?{[m]:h}:mt(m,{...t,data:h}):h}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!=ei&&null!==(o=ei.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await ei.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,T.shouldAllowRecursiveEvaluations)(e):(0,T.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,g.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,T.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,O.collectAppGetMenuUsage)(i,e,t),(0,O.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:l}=a;if(n.lazy||l.has("EVENT")&&!(0,f.hasOwnProperty)(t,"event")||l.has("DATA")&&!(0,f.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[rt]:e,[ot]:t}:e};let u,p,h,m;const v=Re(t);let y,b;(l.has("STATE")||!v&&l.has("TPL"))&&(m=Me(t,"STATE",`: "${e}"`)),l.has("FORM_STATE")&&(b=Ge(t,"FORM_STATE",`: "${e}"`));const w=W();if(r||w){if(l.has("CTX")&&(u=(0,O.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(u))),m){if(h=(0,O.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,O.strictCollectMemberUsage)(e,"TPL");for(const e of t)h.add(e)}r&&o.push(m.waitFor(h))}b&&(y=(0,O.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(b.waitFor(y))),l.has("PROCESSORS")&&(p=(0,O.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,d.loadProcessorsImperatively)(p,ci())))}if(r){let n=l.has("PERMISSIONS");if(!n&&l.has("FN")){const t=[...(0,O.strictCollectMemberUsage)(e,"FN")];n=ge(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),i.usedArgs.size>0&&null!=ei&&ei.menu){const e=[...i.usedArgs];o.push(Promise.all(e.map((e=>ei.menu.fetchMenuById(e,t,{getStoryboardByAppId:di,resolveData:tt,asyncComputeRealValue:mt})))))}var S;s.usedArgs.size>0&&o.push(null==ei||null===(S=ei.checkInstalledApps)||void 0===S?void 0:S.waitForCheckingApps([...s.usedArgs]))}return{blockingList:o,run(){var n,r;const{app:o,location:i,query:s,match:d,flags:w,sys:S,ctxStore:E,data:A,event:k}=t,I=t.overrideApp??o;for(const o of l)switch(o){case"ANCHOR":c[o]=i.hash?i.hash.substring(1):null;break;case"APP":if(null==I)throw new ReferenceError(`APP is not defined, in "${e}"`);c[o]={...(0,g.cloneDeep)(I),getMenu:null==ei||null===(n=ei.menu)||void 0===n?void 0:n.getMenuById};break;case"CTX":c[o]=G({get:(e,t)=>E.getValue(t),ownKeys:()=>Array.from(u)});break;case"DATA":c[o]=A;break;case"EVENT":c[o]=k;break;case"FLAGS":c[o]=q(w);break;case"FORM_STATE":c[o]=G({get:(e,t)=>b.getValue(t),ownKeys:()=>Array.from(y)});break;case"HASH":c[o]=i.hash;break;case"INSTALLED_APPS":c[o]=q({has:qe});break;case"ITEM":case"INDEX":case"SIZE":{const n="ITEM"===o?"forEachItem":"INDEX"===o?"forEachIndex":"forEachSize";(0,f.hasOwnProperty)(t,n)?c[o]=t[n]:console.error(`Using \`${o}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[o]=q({getItem:Ce("local")});break;case"MEDIA":c[o]=q(Ie());break;case"MISC":c[o]=ni().getMiscSettings();break;case"PARAMS":if(null==s)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[o]=new URLSearchParams(s);break;case"PATH":c[o]=q((null==d?void 0:d.params)??{});break;case"PATH_NAME":c[o]=i.pathname;break;case"PROCESSORS":c[o]=G({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 G({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of p){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==s)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.get(e)])));break;case"QUERY_ARRAY":if(null==s)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.getAll(e)])));break;case"SESSION_STORAGE":c[o]=q({getItem:Ce("session")});break;case"TPL":if(Te(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":c[o]=G({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":c[o]=q(S??{});break;case"__WIDGET_FN__":c[o]=Le;break;case"__WIDGET_IMG__":c[o]=null==ei||null===(r=ei.images)||void 0===r?void 0:r.widgetImagesFactory;break;case"__WIDGET_I18N__":c[o]=$}Object.assign(c,le(a.attemptToVisitGlobals,{storyboardFunctions:he,app:I,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,T.cook)(a.expression,a.source,{globalVariables:(0,_.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 ft=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 pt(e){switch(e){case ft.USE_BRICK_PROPERTIES:case ft.USE_BRICK_TRANSFORM:case ft.USE_BRICK_EVENTS:case ft.USE_BRICK_IF:case ft.USE_BRICK_LIFECYCLE:case ft.USE_BRICK_DATA_SOURCE:return!0}return!1}function ht(e,t,n){if(pt(e))return e;if(t)switch(e){case ft.USE_BRICK:return ft.USE_BRICK_ITEM;case ft.USE_BRICK_SLOTS_ITEM_BRICKS:return ft.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case ft.INITIAL:if("useBrick"===n)return ft.USE_BRICK;break;case ft.USE_BRICK:case ft.USE_BRICK_ITEM:case ft.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return ft.USE_BRICK_PROPERTIES;case"transform":return ft.USE_BRICK_TRANSFORM;case"dataSource":return ft.USE_BRICK_DATA_SOURCE;case"events":return ft.USE_BRICK_EVENTS;case"slots":return ft.USE_BRICK_SLOTS;case"children":return ft.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return ft.USE_BRICK_IF;case"lifeCycle":return ft.USE_BRICK_LIFECYCLE}break;case ft.USE_BRICK_SLOTS:return ft.USE_BRICK_SLOTS_ITEM;case ft.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return ft.USE_BRICK_SLOTS_ITEM_BRICKS}return ft.INITIAL}async 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&&pt(n.$$stateOfUseBrick);let i,s=o;return r||(0,T.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,f.hasOwnProperty)(t,"data")?n.noInject?P.transform:P.transformAndInject:n.noInject?yt:P.inject)(e,t),s||Xe(i),i}if(!(0,f.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return Promise.all(e.map((e=>mt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([mt(r,t),mt(o,t,vt(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function gt(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&&pt(n.$$stateOfUseBrick);let i,s=o;return r||(0,T.isEvaluable)(e)?(i=ut(e,t),s=at(e)):i=o?e:((0,f.hasOwnProperty)(t,"data")?n.noInject?P.transform:P.transformAndInject:n.noInject?yt:P.inject)(e,t),s||Xe(i),i}if(!(0,f.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return e.map((e=>gt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[gt(r,t),gt(o,t,vt(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function vt(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:ht(e.$$stateOfUseBrick,t,n)}:e}function yt(e){return e}async function bt(e,t){return!(0,f.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?await mt(e.if,t):e.if)}function wt(e,t){return!(0,f.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?gt(e.if,t):e.if)}function St(e){return!(0,f.hasOwnProperty)(e,"if")||!!e.if}const Et=function(){const e=k();if(e)return e.looseCheckIfByTransform}()||function(e,t){return wt(e,{data:t})};function At(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,T.isEvaluable)(e):it(e)){const o="string"==typeof e?e:st(e);if((0,T.isTrackAll)(o)){const e=(0,O.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,O.track)(o,"track context","CTX"),n=(0,O.track)(o,"track state","STATE"),r=(0,O.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,f.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,f.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=gt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?ft.USE_BRICK:ft.INITIAL});if("style"!==n&&"dataset"!==n||(0,f.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ct(e,r)}))}var Tt=n(264);const Ot=new Map,Pt=1e4;let _t=0;function Mt(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=Ot.get(n);r||Ot.set(n,r=new Map);const o=r.get(e);if(o)return o;const i=[],s={regexp:(0,Tt.MM)(e,i,t),keys:i};return _t<Pt&&(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 xt(e,t,n){return Mt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Bt=Symbol.for("tpl.asyncComputedPropsFromHost"),Lt=Symbol.for("tpl.stateStoreId"),$t=Symbol.for("tpl.externalForEachItem"),Nt=Symbol.for("tpl.externalForEachIndex"),Ut=Symbol.for("tpl.externalForEachSize"),Ft=new Set;let jt=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}({});const Dt={[jt.REQUEST_FAILED]:"Request Failed",[jt.SOMETHING_WENT_WRONG]:"Something went wrong!",[jt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[jt.NETWORK_ERROR]:"Network error, please check your network."},Kt={[jt.REQUEST_FAILED]:"请求失败",[jt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[jt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[jt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},Vt="core/runtime",Wt={en:Dt,zh:Kt};let zt;const Ht=Object.freeze({show:function(e){if(zt)return zt.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 qt(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 Gt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return u.i18n.t(`${Vt}:${jt.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 Yt(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let Qt,Jt,Xt=!1;function Zt(e){if(e instanceof R.HttpAbortError)return;if(Yt(e)&&!window.NO_AUTH_GUARD){if(Xt)return;return Xt=!0,void Ht.show({type:"confirm",content:u.i18n.t(`${Vt}:${jt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=ni().getFeatureFlags()["sso-enabled"],t=C();qt(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),Xt=!1}),(()=>{Xt=!1}))}console.error(e);const t=Gt(e);t!==Qt&&(Qt=t,Ht.show({type:"error",title:u.i18n.t(`${Vt}:${jt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{Qt=void 0})))}const en=Object.freeze({show:function(e){Jt?Jt.resolve(e):alert(e.message)}});function tn(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const i=an(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 nn(e){return"string"==typeof e.action}function rn(e){return"string"==typeof e.useProvider}function on(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function sn(e){return!!e.then}function an(e,t,n){return function(r){for(const o of[].concat(e))if(wt(o,{...t,event:r}))if(sn(o))an(o.then,t,n)(r);else if(nn(o)){const[e,i]=o.action.split(".");switch(o.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":dn(r,i,o.args,o.callback,t);break;case"window.open":fn(r,o.args,t);break;case"location.reload":case"location.assign":vn(r,i,o.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":yn(r,e,i,o.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":bn(r,i,o.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":wn(r,i,o.args,t);break;case"handleHttpError":Zt(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":hn(r,i,o.args,o.batch??!0,o.callback,t);break;case"state.update":case"state.refresh":case"state.load":mn(r,i,o.args,o.batch??!0,o.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=An(o.args,t,r);xe(t,o.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":gn(r,o.args,o.callback,t);break;case"message.subscribe":case"message.unsubscribe":Sn(r,i,o.args,t,n,o.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===o.action?"dark":"light");break;case"theme.setTheme":{const[e]=An(o.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":ae("mode.setDashboardMode"===o.action?"dashboard":"default");break;default:console.error("unknown event listener action:",o.action)}}else rn(o)?cn(r,o,t,n):on(o)?ln(r,o,t,n):console.error("unknown event handler:",o);else o.else&&an(o.else,t,n)(r)}}async function cn(e,t,n,r){try{un(e,await Qe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",n,r)}catch(e){console.error(Gt(e))}}function ln(e,t,n,r){let o=[];const i=t.target,s=t.targetRef;let a=i;if(("string"==typeof i?(0,T.isEvaluable)(i):it(i))&&(a=gt(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,T.isEvaluable)(s):it(s))&&(t=gt(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=>{un(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 un(e,t,n,r,o,i,s){if("function"!=typeof t[r])return void console.error("target has no method:",{target:t,method:r});const a=async()=>{var i;let a=An(n.args,o,e,s);var c;return rn(n)&&null!=ei&&null!==(i=ei.flowApi)&&void 0!==i&&i.isFlowApiProvider(n.useProvider)&&(a=await ei.flowApi.getArgsOfFlowApi(n.useProvider,a,r,null===(c=n.sse)||void 0===c?void 0:c.stream)),t[r](...a)};if(!n.callback)return void a();const c=En(n.callback,o,i),l={progress:c("progress"),success:c("success"),error:c("error"),finally:c("finally")};if(rn(n)){var u,d;const t={...o,event:e};if(gt(null===(u=n.sse)||void 0===u?void 0:u.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:i}=t;const s=li();try{const t=await e();for await(const e of t){if(s!==li())return;null==n||n(e)}if(s!==li())return;null==r||r()}catch(e){if(s!==li())return;null==o||o(e)}finally{null==i||i()}}(a,l);if(gt(null===(d=n.poll)||void 0===d?void 0:d.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:f,delegateLoadingBar:p}=gt((0,g.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),h=li();let m;async function v(){let t;Ft.delete(m);try{var n;if(t=null===(n=gt(c,r))||void 0===n?void 0:n(),t)null==a||a();else{var d;const n=await e(),s=null===(d=gt(c,r))||void 0===d?void 0:d();var g;t=s||h!==li(),t?s&&(null==a||a()):(null==o||o(n),null!==(g=gt(l,r))&&void 0!==g&&g(n)?(p&&window.dispatchEvent(new Event("request.end")),null==i||i(n),null==a||a()):y(u??3e3))}}catch(e){var v;const n=null===(v=gt(c,r))||void 0===v?void 0:v();t=n||h!==li(),t?n&&(null==a||a()):(null==s||s(e),f?y(u??3e3):null==a||a())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}function y(e){m=setTimeout(v,e),Ft.add(m)}y(d??0),p&&window.dispatchEvent(new Event("request.start"))}(a,l,n.poll,t)}try{const e=await a();l.success(e)}catch(e){l.error(e)}finally{l.finally()}}function dn(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=An(n,o,e,{useEventDetailAsDefault:!0}),c.length=i),s&&r){const e=En(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}C()[a](...c)}function fn(e,t,n){const[r,o,i]=An(t,n,e);window.open(r,o||"_self",i)}function pn(e,t,n,r,o,i){t?r.updateValues(e,n,(e=>An(e,o,i)[0])):e.forEach((e=>{const{name:t,value:s}=An([e],o,i)[0];r.updateValue(t,s,n)}))}function hn(e,t,n,r,o,i){if(!Array.isArray(n)||!n.every(f.isObject)||"assign"!==t&&"replace"!==t){const[r,s]=An(n,i,e);i.ctxStore.updateValue(r,s,t,o,i)}else pn(n,r,t,i.ctxStore,i,e)}function mn(e,t,n,r,o,i){if(Array.isArray(n)&&n.every(f.isObject)&&"update"===t)pn(n,r,"replace",Me(i,`state.${t}`,`: ${JSON.stringify(n)}`),i,e);else{const[r,s]=An(n,i,e);Me(i,`state.${t}`,`: ${r}`).updateValue(r,s,"update"===t?"replace":t,o,i)}}function gn(e,t,n,r){const[o,i]=An(t,r,e);Ge(r,"formstate.update",`: ${o}`).updateValue(o,i,"replace",n,r)}function vn(e,t,n,r){if("assign"===t){const[t]=An(n,r,e);location.assign(t)}else location[t]()}function yn(e,t,n,r,o){const i="localStorage"===t?localStorage:sessionStorage,[s,a]=An(r,o,e);"setItem"===n?void 0!==a&&i.setItem(s,JSON.stringify(a)):i.removeItem(s)}function bn(e,t,n,r){console[t](...An(n,r,e,{useEventAsDefault:!0}))}function wn(e,t,n,r){const o=An(n,r,e,{useEventAsDefault:!0});en.show({type:t,message:o[0]})}async function Sn(e,t,n,r,o,i){const s=()=>{var o;const i=An(n,r,e);return null==ei||null===(o=ei.messageDispatcher)||void 0===o?void 0:o[t](...i)};if(!i)return void s();const a=En(i,r,o);try{const e=await s();a("success")(e)}catch(e){a("error")(e)}finally{a("finally")()}}function En(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});an(i,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function An(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?gt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function kn(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;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=t.refEvent??e;o.addEventListener(r,n),(c=o).$$proxyListeners??(c.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function In(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 r.$$proxyListeners??[])r.removeEventListener(e,t);delete r.$$proxyListeners}let Cn=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Rn(e){e.replaceChildren()}function Tn(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.tag===Cn.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),tn(s,n.events,n.runtimeContext),n.tplHostMetadata&&(s.$$tplStateStore=Me({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),kn(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===Cn.ROOT?null===(s=e.container)||void 0===s||s.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===Cn.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 On=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Pn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var _n=new WeakMap,Mn=new WeakMap,xn=new WeakMap,Bn=new WeakMap,Ln=new WeakMap,$n=new WeakMap,Nn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,jn=new WeakSet;class Dn{constructor(e,t){(0,o.A)(this,jn),(0,i.A)(this,"scope",void 0),(0,i.A)(this,"unknownBricks",void 0),(0,i.A)(this,"renderId",void 0),(0,s.A)(this,_n,void 0),(0,s.A)(this,Mn,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,s.A)(this,xn,new Map),(0,s.A)(this,Bn,void 0),(0,s.A)(this,Ln,new Map),(0,s.A)(this,$n,void 0),(0,s.A)(this,Nn,void 0),(0,s.A)(this,Un,new WeakMap),(0,s.A)(this,Fn,new Map),this.scope=e,this.unknownBricks=(null==t?void 0:t.unknownBricks)??"throw",(0,c.A)(_n,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,c.A)(Nn,this,e)}memoizeMenuRequestNode(e,t){(0,l.A)(Un,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,l.A)(Nn,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,l.A)(Un,this).get(t);(0,l.A)(Un,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,l.A)(_n,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,l.A)(_n,this).bailout(e)}reCatch(e,t){return(0,l.A)(_n,this).catch(e,t)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:i}of[...(0,l.A)(Fn,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,l.A)(Fn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[...On,..."page"===this.scope?Pn:[]];for(const r of n){const n=t[r];n&&(0,l.A)(Mn,this)[r].push({brick:e,handlers:n})}(0,g.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,l.A)(Ln,this).get(e);n?n.add(t):(0,l.A)(Ln,this).set(e,new Set([t]))}memoize(e,t,n,r){(0,l.A)($n,this)||(0,c.A)($n,this,new WeakMap);const o=[e??"",...t].join(".");let i=(0,l.A)($n,this).get(r);i||(i=new Map,(0,l.A)($n,this).set(r,i)),i.set(o,{node:n,last:Hn(n),lastNormal:qn(n),lastPortal:Yn(n)})}reRender(e,t,n,r){const o=[e??"",...t].join("."),i=(0,l.A)($n,this).get(r).get(o),{node:s,last:c,lastNormal:u,lastPortal:d}=i;let f;const p=[];if((null==s?void 0:s.tag)===Cn.PLACEHOLDER){var h,m;f=(null===(h=function(e){return Gn(e,!0)}(s))||void 0===h?void 0:h.element)??null;const e=null===(m=function(e){return Qn(e,!0)}(s))||void 0===m?void 0:m.element;e&&p.push(e)}else{var g,v;f=(null==u||null===(g=u.element)||void 0===g?void 0:g.nextSibling)??null;let e=null==d||null===(v=d.element)||void 0===v?void 0:v.nextSibling;for(;e&&(p.push(e),e instanceof HTMLElement&&"DIV"===e.tagName);)e=e.nextSibling}const y=Hn(n);let b;i.node=n,i.last=y,i.lastNormal=qn(n),i.lastPortal=Yn(n);let w=r.child;for(;w&&w!==c;){if(w.sibling===s){b=w;break}w=w.sibling}const S=document.createDocumentFragment(),E=document.createDocumentFragment(),A={tag:Cn.ROOT,container:S,createPortal:E,child:n};for(w=n;w;)w.return=A,w=w.sibling;const k=Jn(s,c);for((0,a.A)(jn,this,Kn).call(this,k),Tn(A),b?b.sibling=n:r.child=n,y&&(y.sibling=null==c?void 0:c.sibling),w=n;w;)w.return=r,w=w.sibling;var I,C;if(r.tag===Cn.ROOT?null===(I=r.container)||void 0===I||I.insertBefore(S,f):null===(C=r.element)||void 0===C||C.insertBefore(S,f),E.childNodes.length>0){var R;let e=n;for(;e&&e.return;)e=e.return;if((null===(R=e)||void 0===R?void 0:R.tag)!==Cn.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(E,r)}const T=Jn(n,y);(0,a.A)(jn,this,Vn).call(this,T)}dispose(){for(const e of Object.values((0,l.A)(Mn,this)))e.length=0;for(const e of(0,l.A)(xn,this).values()){for(const t of e)t.disconnect();e.length=0}(0,l.A)(xn,this).clear(),(0,l.A)(Bn,this)&&(Se.removeEventListener("change",(0,l.A)(Bn,this)),(0,c.A)(Bn,this,void 0)),(0,c.A)($n,this,void 0),(0,l.A)(Ln,this).clear(),(0,l.A)(Fn,this).clear(),(0,c.A)(Un,this,void 0)}dispatchBeforePageLoad(){(0,a.A)(jn,this,Wn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,a.A)(jn,this,Wn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,a.A)(jn,this,Wn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,a.A)(jn,this,Wn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=C().location;e&&"#"!==e?(0,a.A)(jn,this,Wn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,a.A)(jn,this,Wn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,l.A)(Mn,this).onScrollIntoView)(0,a.A)(jn,this,zn).call(this,e,t)}initializeMediaChange(){(0,c.A)(Bn,this,(e=>{(0,a.A)(jn,this,Wn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:q(e.detail)}))})),Se.addEventListener("change",(0,l.A)(Bn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,l.A)(Mn,this).onMessage)for(const r of[].concat(n)){var t;null==ei||null===(t=ei.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{an(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==ei||null===(e=ei.messageDispatcher)||void 0===e||e.onClose((()=>{(0,a.A)(jn,this,Wn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,a.A)(jn,this,Wn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,a.A)(jn,this,Wn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Kn(e){const t=[...On,..."page"===this.scope?Pn:[]],n=[];for(const r of t){const t=(0,g.remove)((0,l.A)(Mn,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o;const e=(0,l.A)(xn,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,l.A)(xn,this).delete(t)}In(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove()}const i=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)an(t,e.runtimeContext,e)(i)}function Vn(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,l.A)(Mn,this).onMount)e.has(n)&&an(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,l.A)(Mn,this).onScrollIntoView)e.has(t)&&(0,a.A)(jn,this,zn).call(this,t,n)}function Wn(e,t){for(const{brick:n,handlers:r}of(0,l.A)(Mn,this)[e])an(r,n.runtimeContext,n)(t);const n=(0,l.A)(Ln,this).get(e);if(n)for(const e of n)e()}function zn(e,t){const n=t.threshold??.1,r=new IntersectionObserver(((r,o)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(an(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:n});r.observe(e.element);let o=(0,l.A)(xn,this).get(e);o||(o=[],(0,l.A)(xn,this).set(e,o)),o.push(r)}function Hn(e){let t=e;for(;null!==(n=t)&&void 0!==n&&n.sibling;){var n;t=t.sibling}return t}function qn(e){return Gn(e,!1)}function Gn(e,t){let n,r=e;for(;r;){if(r.tag===Cn.BRICK&&!r.portal){if(t)return r;n=r}r=r.sibling}return n}function Yn(e){return Qn(e,!1)}function Qn(e,t){let n,r=e;for(;r;){if(r.tag===Cn.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 Jn(e,t){const n=new Set;let r=e;for(;r;)if(r.tag===Cn.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 Xn=new Map;function Zn(e){return Xn.get(e)}const er=Symbol.for("root.runtimeContext");async function tr(e,t,n){var r,o;const[i,s,a]=Gr({...e[er]??ui(),data:t,pendingPermissionsPreCheck:[]});i.tplStateStoreMap??(i.tplStateStoreMap=new Map),i.formStateStoreMap??(i.formStateStoreMap=new Map);const c=new Dn("fragment"),l={tag:Cn.ROOT,createPortal:null},u=e.transform,d=Re();u&&Te(d,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);const f=await zr(l,d&&!n?e:{errorBoundary:n,...e,properties:{...e.properties,...u}},i,c,[],{}),p=[...s,...a];if(await qr(f,i,p),(null===(r=f.node)||void 0===r?void 0:r.tag)===Cn.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(o=f.node)&&void 0!==o&&o.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return l.child=f.node,{tagName:f.node?f.node.type:null,renderRoot:l,rendererContext:c,scopedStores:p}}function nr(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},Tn(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of i)e.mountAsyncData();return{portal:n}}function rr(e,t){let{rendererContext:n}=e;t.portal&&(Rn(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function or(e,t,n){if(n)throw new Error("Legacy doTransform does not support options in v3");return gt(t,{...ui(),data:e},{noInject:!0})}function ir(e,t){const n=di(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),B(n)}function sr(e,t){const n=di(e);let r=!1;const o=e=>`${e.path}.${e.exact}`,i=(e,n)=>e.map((e=>{const s=o(e);return"routes"===e.type?(e.routes=i(e.routes,n),e):s===n?(r=!0,t):e}));n.routes=i(n.routes,o(t)),r||n.routes.unshift(t)}function ar(e,t,n){const r=`${e}.${t.name}`;_e.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),cr(e,t.name,n)}function cr(e,t,n){fr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,g.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function lr(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function ur(e,t){var n;fr(e,lr(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const dr=ur;function fr(e,t,n,r){const{routes:o}=di(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 pr(e,t){let{tplStateStoreId:n}=t;const r=ui();return n?Me({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function hr(e){let{tplStateStoreId:t}=e;const n=ui();return t?Me({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function mr(e){return ci().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function gr(e){return(0,d.loadBricksImperatively)(e,ci())}function vr(e,t){return(0,d.loadEditorsImperatively)(e,t??ci())}function yr(){return li()}async function br(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const i=di(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=lr(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 wr(e,t){let{tplStateStoreId:n,routeId:r}=t;const o={...ui(),tplStateStoreId:n,match:Zn(r)};return e.resolve?tt(e.resolve,o,{cache:"reload"}):mt(e.value,o)}function Sr(e){const t=ui();return{app:(null==t?void 0:t.overrideApp)??(null==t?void 0:t.app),location:(0,g.pick)(location,["href","origin","hostname","host"]),...(0,g.pick)(t,["query","sys"]),match:Zn(null==e?void 0:e.routeId)}}let Er;const Ar=[];function kr(e){Er=e;const t=hr({tplStateStoreId:e.tplStateStoreId});Cr({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Ir(e){Ar.push(e)}function Cr(e){setTimeout((()=>{for(const t of Ar)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const Rr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Tr{constructor(e,t,n,r){(0,i.A)(this,"type",void 0),(0,i.A)(this,"data",new Map),(0,i.A)(this,"changeEventType",void 0),(0,i.A)(this,"pendingStack",[]),(0,i.A)(this,"hostBrick",void 0),(0,i.A)(this,"stateStoreId",void 0),(0,i.A)(this,"batchUpdate",!1),(0,i.A)(this,"batchUpdateContextsNames",[]),(0,i.A)(this,"rendererContext",void 0),(0,i.A)(this,"routeMap",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(Er){const{tplStateStoreId:n}=Er;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&Cr({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,f.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!==li()};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||Zt(e)}))),r){const e=En(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,O.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,O.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)))o.set(e,(o.get(e)??0)+1);const i=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),s=new WeakSet,a=new Map,c=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,n)=>{a.set(e,{resolve:t,reject:n})}))]))),l=async e=>{s.add(e);const n=await t(e);r.delete(e);const i=o.get(e.name)??0;if(n){if(a.get(e.name).resolve(),o.delete(e.name),0===i)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===i?(a.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,i-1);await d()};let u=i;async function d(){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,u)).map((e=>e[0])).filter((e=>!s.has(e)));await Promise.all(e.map(l))}return{pendingResult:d().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),u=!0,await d());for(const e of a.values())e.resolve()})).catch((e=>{for(const t of a.values())t.reject(e);throw e})),pendingContexts:c}}(e,(e=>this.resolve(e,t,n,r)),this.type,Re(t));this.pendingStack.push(o)}}onChange(e,t){var n;null===(n=this.data.get(e))||void 0===n||n.eventTarget.addEventListener(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{pendingContexts:e}of this.pendingStack)for(const t of e.values())t.catch((()=>{}));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 bt(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,f.hasOwnProperty)(e,"value");c=e.track&&n&&(0,f.hasOwnProperty)(e.resolve,"if")&&(0,O.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(a=await bt(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 mt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const u={name:e.name,value:o,eventTarget:new ye,useResolve:a,load:i,loaded:"eager"===l,loading:s,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var d;t&&Rr.includes(t)&&(null===(d=this.rendererContext)||void 0===d||d.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&u.eventTarget.addEventListener(this.changeEventType,an(e.onChange,t)),e.track){const n=(0,O.strictCollectMemberUsage)(c?[e.resolve,e.value]:i?e.resolve:e.value,this.type);!i&&(u.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{u.useResolve=c?wt(e.resolve,t):!!i,u.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,gt(e.value,t),"replace")}),e))}if(u.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,u),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)}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function Or(e,t,n){const{reversedProxies:r,asyncHostPropertyEntries:o,externalSlots:i,tplStateStoreId:s,hostBrick:a}=e;let c;if(t&&r){const e=r.properties.get(t);e&&(u=o,c=e.map((e=>{let{from:t,to:n}=e;const r=u.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,kt(r,t),!0]})).filter(Boolean));const s=r.slots.get(t);if(s&&i){const e=new Map;for(const{from:t,to:r}of s){var l;const o=(null===(l=i[t])||void 0===l?void 0:l.bricks)??[];if(!o.length)continue;const s=r.refSlot??t;let c=e.get(s);if(!c){c=[];const t=(0,f.hasOwnProperty)(n,s)?n[s].bricks.length+1:1;for(let e=0;e<t;e+=1)c.push([]);e.set(s,c)}const u=r.refPosition??-1,d=(0,f.hasOwnProperty)(a.runtimeContext,"forEachItem");c[(0,g.clamp)(u<0?c.length+u:u,0,c.length-1)].push(...d?Pr(o,a.runtimeContext.forEachItem,a.runtimeContext.forEachIndex,a.runtimeContext.forEachSize):o)}for(const[t,r]of e.entries()){(0,f.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 u;return{[Bt]:c,[Lt]:s}}function Pr(e,t,n,r){return e.map((e=>{let{children:o,slots:i,...s}=e;return{...s,[$t]:t,[Nt]:n,[Ut]:r,slots:":forEach"===s.brick?Jr(o,i):Object.fromEntries(Object.entries(Jr(o,i)??{}).map((e=>{let[o,i]=e;return[o,"routes"===i.type?{type:"routes",routes:_r(i.routes,t,n,r)}:{type:"bricks",bricks:Pr(i.bricks,t,n,r)}]})))}}))}function _r(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:_r(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:Pr(e.bricks,t,n,r)}))}function Mr(e,t){function n(e){return(0,f.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,f.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.map(r)]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e){const{properties:o,slots:i,children:s,...a}=e,c=Jr(s,i),l=Object.fromEntries(Object.entries(c??{}).map((e=>{let[t,n]=e;return[t,{type:"bricks",bricks:(n.bricks??[]).map(r)}]})));return{...a,properties:n(o),slots:l,...Or(t,a.ref,l)}}return n(e)}function xr(e,t,n,r,o){var i;const s=(0,g.uniqueId)("tpl-state-"),a={...n.runtimeContext,tplStateStoreId:s};delete a.forEachItem,delete a.forEachIndex,delete a.forEachSize,delete a.formStateStoreId;const c=new Tr("STATE",n,o,s);a.tplStateStoreMap.set(s,c),a.tplStateStoreScope&&a.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:f}=_e.get(e);null==ei||null===(i=ei.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(d,a,r);const{slots:p,children:h,...m}=t,v={...m,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:u};const y={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=y.properties.get(t.ref);n||(n=[],y.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=y.slots.get(t.ref);n||(n=[],y.slots.set(t.ref,n)),n.push({from:e,to:t})}const b={reversedProxies:y,asyncHostPropertyEntries:r,externalSlots:Jr(h,p),tplStateStoreId:s,hostBrick:n};return v.slots={"":{type:"bricks",bricks:l.map((e=>Br(e,b)))}},v}function Br(e,t){null===e.if&&delete e.if;const{properties:n,slots:r,children:o,...i}=e,s=Jr(o,r),a=Object.fromEntries(Object.entries(s??{}).map((e=>{let[n,r]=e;return[n,{type:"bricks",bricks:(r.bricks??[]).map((e=>Br(e,t)))}]})));return{...i,properties:Mr(n,t),slots:a,...Or(t,i.ref,a)}}const Lr="form-renderer.form-renderer",$r=Symbol.for("form.stateStoreId"),Nr=["forms.general-form","form.general-form","eo-form"];function Ur(e,t,n){const{id:r,bricks:o,events:i,context:s,mountPoint:a,instanceId:c}=e;let{brick:l,properties:u}=e;const d=t.find((e=>e.fieldId===r));if(d){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}(d);l||(l=e.brick),u={...e.properties,...u}}const p={brick:l,properties:u,iid:c,slot:a,events:i,context:s,children:Fr(o,t,n),[$r]:n};return(0,f.hasOwnProperty)(e,"if")&&(p.if=e.if),p}function Fr(e,t,n){if(Array.isArray(e))return e.map((e=>Ur(e,t,n)))}var jr=new WeakSet;class Dr extends HTMLElement{constructor(){super(...arguments),(0,o.A)(this,jr),(0,i.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,a.A)(jr,this,Kr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,a.A)(jr,this,Kr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,a.A)(jr,this,Kr).call(this,"resetFields",t)}}function Kr(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();Nr.includes(i)?o[e](...r):console.error(`no ${e} method in the container element`,{container:i})}async function Vr(e,t,n,r,o,i,s,a){const c=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=xt(n,t.app.homepage,t.location.pathname);if(e&&await bt(n,t))return t.app.noAuthGuard||n.public||null==ei||!ei.auth||ei.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),l={blockingList:[]},u=l.menuRequestNode={return:i};switch(c){case"missed":break;case"unauthenticated":l.unauthenticated=!0;break;default:{var f;const i=l.route=c.route;l.path=c.match.path;const m={...n,match:c.match};i.iid&&(p=i.iid,h=c.match,Xn.set(p,h)),a&&m.ctxStore.disposeDataInRoutes(t);const g=o.concat(i);m.ctxStore.define(i.context,m,void 0,g),m.pendingPermissionsPreCheck.push(null==ei||null===(f=ei.checkPermissions)||void 0===f?void 0:f.preCheckPermissionsForBrickOrRoute(i,(e=>mt(e,m))));const{preLoadBricks:v}=i;if(Array.isArray(v)&&l.blockingList.push((0,d.loadBricksImperatively)(v,ci())),"redirect"===i.type){let e;if(e="string"==typeof i.redirect?await mt(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);l.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 mt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(i.menu,m);let o;n&&(u.request=n),a||r.memoizeMenuRequestNode(t,u),o="routes"===i.type?await Vr(e,i.routes,m,r,g,u,s):await Wr(e,i.bricks,m,r,g,u,s),Yr(l,o),Qr(u,o.menuRequestNode)}}}var p,h;return l}async function Wr(e,t,n,r,o,i,s,a,c){!function(e,t,n){function r(e){if((0,f.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(const[t,n]of Object.entries(e))(0,f.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[er]=t),r(e.properties),n&&!s)return;const a=Jr(e.children,e.slots);for(const e of Object.values(a??{}))for(const t of e.bricks??[])o(t,i)}for(const t of e)o(t)}(t,n,!0);const l={blockingList:[]},u=c??[];return(await Promise.all(t.map(((t,c)=>zr(e,t,n,r,o,i,s,u.concat(c),a&&new Map(a)))))).forEach(((t,n)=>{t.hasTrackingControls&&r.memoize(s,u.concat(n),t.node,e),Yr(l,t)})),l}async function zr(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;try{return await async function(e,t,n,r,o,i,s,a,c){var l,u;const p={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),p;const{if:h,permissionsPreCheck:m,...v}=t;if(function(e){return"string"==typeof e?(0,T.isTrackAll)(e):it(e)&&(0,T.isTrackAll)(st(e))}(h))return zr(e,{brick:":if",dataSource:h,permissionsPreCheck:m,slots:{"":{type:"bricks",bricks:[v]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,i,s,a,c);const b=t[Lt],w=t[$r],S={...n,tplStateStoreId:b,formStateStoreId:w};(0,f.hasOwnProperty)(t,$t)&&(S.forEachItem=t[$t],S.forEachIndex=t[Nt],S.forEachSize=t[Ut]);const{context:E}=t;if(Array.isArray(E)&&E.length>0){const e=Re(S);Te(e,"Defining context on bricks","check your brick:",t),e||S.ctxStore.define(E,S)}if(S.pendingPermissionsPreCheck.push(null==ei||null===(l=ei.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>mt(e,S)))),!await async function(e,t){return(0,f.isObject)(e.if)&&!it(e.if)?St(await tt(e.if,t)):bt(e,t)}(t,S))return p;const A=t.brick;if(A.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(A);const{dataSource:n}=t,l=async l=>{var u;const d=await mt(n,l),p=":forEach"===A?"":":switch"===A?String(d):d?"":"else",h=Jr(t.children,t.slots),m=h&&(0,f.hasOwnProperty)(h,p)&&(null===(u=h[p])||void 0===u?void 0:u.bricks);if(!Array.isArray(m))return{blockingList:[]};switch(A){case":forEach":return Array.isArray(d)?async function(e,t,n,r,o,i,s,a,c,l){const u={blockingList:[]},d=t.length,f=await Promise.all(t.map(((t,u)=>Promise.all(n.map(((n,f)=>zr(e,n,{...r,forEachItem:t,forEachIndex:u,forEachSize:d},o,i,s,a,l.concat(u*d+f),c&&new Map(c))))))));return f.flat().forEach(((t,n)=>{t.hasTrackingControls&&o.memoize(a,l.concat(n),t.node,e),Yr(u,t)})),u}(e,d,m,l,r,o,i,s,c,a):{blockingList:[]};case":if":case":switch":return Wr(e,m,l,r,o,i,s,c,a)}},u=async t=>{const n=await l(t);return n.node??(n.node={tag:Cn.PLACEHOLDER,return:e}),n},d=await u(S),{onMount:p,onUnmount:h}=t.lifeCycle??{},{contextNames:m,stateNames:v}=At(n);if(m||v){d.hasTrackingControls=!0;let t=0;const o=async()=>{const n=++t,[o,i,c]=Gr(S),l=await u(o),d=[...i,...c];if(await qr(l,o,d),t===n){h&&an(h,S)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(s,a,l.node,e),p&&an(p,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of d)e.mountAsyncData()}},i=(0,g.debounce)(o);if(m)for(const e of m)S.ctxStore.onChange(e,i);if(v)for(const e of v)Me(S,"STATE",`: "${n}"`).onChange(e,i)}return p&&r.registerArbitraryLifeCycle("onMount",(()=>{an(p,S)(new CustomEvent("mount",{detail:{rerender:!1}}))})),h&&r.registerArbitraryLifeCycle("onUnmount",(()=>{an(h,S)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),d}/\.tpl-/.test(A)&&!_e.get(A)&&await Xr((0,d.loadBricksImperatively)([A],ci()),"brick",A,r.unknownBricks);const k=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(_e.get(n))return n}return!!_e.get(e)&&e}(A,null===(u=S.app)||void 0===u?void 0:u.id);if(k){const e=c.get(k)??0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${k}"`);c.set(k,e+1)}else A.includes("-")&&!customElements.get(A)&&(A===Lr?customElements.get(Lr)||customElements.define(Lr,Dr):p.blockingList.push(Xr((0,d.enqueueStableLoadBricks)([A],ci()),"brick",A,r.unknownBricks)));let I,C;var R;A===Lr?(({formData:I,...C}=t.properties??{}),null!==(R=t.properties)&&void 0!==R&&R.compute&&(I=await mt(I,S))):C=t.properties;const P=[],_=function(e,t,n){return(0,f.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,mt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?ft.USE_BRICK:ft.INITIAL})]})):[]}(C,S,P),M=t[Bt];M&&_.push(...M);const x="script"===A;if(x||"link"===A){const e=await It(_);if(x?e.src:"stylesheet"===e.rel&&e.href){const t=window.PUBLIC_ROOT??"";if(x){const{src:n,...r}=e;await Xr((0,d.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await Xr((0,d.loadStyle)(n,t,r),"stylesheet",n,"silent")}return p}}const B={tag:Cn.BRICK,type:k||A,return:e,slotId:s,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};p.node=B;const L=(0,O.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);L.size>0&&p.blockingList.push(Xr((0,d.loadProcessorsImperatively)(L,ci()),"processors",[...L].join(", "),r.unknownBricks));const $=[];$.push((async()=>{B.properties=await It(_),function(e,t){for(const n of t){const t=()=>{e.element&&Rt(e.element,{[n.propName]:n.propValue},e.runtimeContext)};if(n.contextNames)for(const r of n.contextNames)e.runtimeContext.ctxStore.onChange(r,t);if(n.stateNames){const r=Me(e.runtimeContext,"STATE",`: "${n.propValue}"`);for(const e of n.stateNames)r.onChange(e,t)}if(n.formStateNames){const r=Ge(e.runtimeContext,"FORM_STATE",`: "${n.propValue}"`);for(const e of n.formStateNames)r.onChange(e,t)}}}(B,P)})()),r.registerBrickLifeCycle(B,t.lifeCycle);let N,U=t;k?U=xr(k,t,B,_,r):A===Lr&&(U=function(e,t,n,r,o){var i;const s="string"==typeof e?JSON.parse(e):e,a=(0,g.uniqueId)("form-state-"),c={...n.runtimeContext,formStateStoreId:a};delete c.forEachItem,delete c.forEachIndex,delete c.forEachSize,delete c.tplStateStoreId;const l=new Tr("FORM_STATE",void 0,o,a);c.formStateStoreMap.set(a,l),c.formStateStoreScope&&c.formStateStoreScope.push(l);const u=s.context??[];u.some((e=>"params"===e.name))||u.push({name:"params"}),l.define(u,c,r);const d=Ur(s.formSchema,s.fields,a);return Nr.includes(d.brick)&&t.events&&(d.events=function(e,t){const n=e??{};for(const[e,r]of Object.entries(t))n[e]=(0,f.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(d.events,t.events)),"boolean"!=typeof(null===(i=t.properties)||void 0===i?void 0:i.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[d]}]}:{...t,slots:void 0,children:[d]}}(I,t,B,_,r)),U.portal&&(B.slotId=void 0),k?(N={...S},delete N.forEachItem,delete N.forEachIndex,delete N.forEachSize):N=S;return $.push((async()=>{const e=Jr(U.children,U.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 Wr(B,a.bricks,N,r,o,i,s,c);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}=N.app,{pathname:c}=e;if(!y(n,c)||!o.every((e=>{let r,o;return(r=xt(e,n,t.pathname))&&(o=xt(e,n,c))&&(e!==l||(0,g.isEqual)(r.params,o.params))})))return!1;const[u,d,f]=Gr({...N,location:e,query:new URLSearchParams(e.search)});let p,h=!1,m=[];try{if(p=await Vr(B,a.routes,u,r,o,i,s,!0),p.route){if(r.reBailout(p))return!0;m=[...d,...f],await qr(p,u,[u.ctxStore,...m])}await r.reMergeMenuRequestNodes(i,a.routes,p.menuRequestNode)}catch(e){console.error("Incremental sub-router failed:",e);const t=r.reCatch(e,B);if(!t)return!0;({failed:h,output:p}=t),await r.reMergeMenuRequestNodes(i,a.routes,p.menuRequestNode)}if(r.reRender(s,[],p.node,B),!h){u.ctxStore.mountAsyncData(p.route);for(const e of m)e.mountAsyncData()}return!!p.route||null}))),Vr(B,a.routes,N,r,o,i,s)}))),s={...p,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach(((e,n)=>{t.has(n)&&r.memoize(t.get(n),[],e.node,B),Yr(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&&(B.child=s.node),Yr(p,{...s,node:void 0}),Qr(i,p.menuRequestNode=s.menuRequestNode)})()),await Promise.all($),p}(e,t,n,r,o,i,s,a,c)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:{tag:Cn.BRICK,type:"div",properties:{textContent:Gt(n),dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:e},blockingList:[]};throw n}}function Hr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function qr(e,t,n){return(0,d.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function Gr(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function Yr(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 Qr(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 Jr(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const t of e){const e=t.slot??"";(0,f.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(t)}}return n}function Xr(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let Zr,eo,to;function no(){if(!Zr){if(Zr={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){Zr.isInIframe=!0;try{if(window.origin===window.parent.origin){Zr.isInIframeOfSameSite=!0;const e="/next/"===m(),t=window.parent.location.pathname,n=t.startsWith("/next/");Zr.isInIframeOfNext=0==(Number(e)^Number(n)),Zr.isInIframeOfVisualBuilder=t.startsWith((n?"/next":"")+"/visual-builder/"),Zr.isInIframeOfLegacyConsole=e&&!n}}catch(e){}}Object.freeze(Zr)}return Zr}function ro(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}`;_e.define(n,t)}}function oo(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const io="basic.show-watermark";var so=new WeakMap,ao=new WeakMap,co=new WeakMap,lo=new WeakMap,uo=new WeakMap,fo=new WeakMap,po=new WeakMap,ho=new WeakMap,mo=new WeakMap,go=new WeakMap,vo=new WeakMap,yo=new WeakMap,bo=new WeakSet;class wo{constructor(e){(0,o.A)(this,bo),(0,s.A)(this,so,void 0),(0,s.A)(this,ao,!1),(0,s.A)(this,co,void 0),(0,s.A)(this,lo,void 0),(0,s.A)(this,uo,void 0),(0,s.A)(this,fo,void 0),(0,s.A)(this,po,new Set),(0,s.A)(this,ho,0),(0,s.A)(this,mo,void 0),(0,s.A)(this,go,void 0),(0,s.A)(this,vo,void 0),(0,s.A)(this,yo,void 0),(0,c.A)(so,this,e);const t=C();window.addEventListener("beforeunload",(e=>{(0,a.A)(bo,this,So).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,a.A)(bo,this,So).call(this,{location:e,action:t})))}getRenderId(){return(0,l.A)(mo,this)}getRuntimeContext(){return(0,l.A)(uo,this)}getRecentApps(){return{currentApp:(0,l.A)(go,this),previousApp:(0,l.A)(vo,this)}}getNavConfig(){return(0,l.A)(yo,this)}bootstrap(){window.AbortController&&(eo=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:eo.signal}}})));const e=C();(0,c.A)(co,this,e.location);let t=0;return e.listen((async(e,n)=>{var r,o,i,s;const u=++t;let d;const f={hash:void 0,state:void 0};var p;if(void 0!==e.key&&("POP"!==n||void 0!==(0,l.A)(co,this).key&&!1!==(null===(r=(0,l.A)(co,this).state)||void 0===r?void 0:r.notify))||(f.key=void 0),((0,h.locationsAreEqual)({...(0,l.A)(co,this),...f},{...e,...f})||"POP"!==n&&!1===(null===(o=e.state)||void 0===o?void 0:o.notify))&&(d=!0),d||null!==(i=e.state)&&void 0!==i&&i.noIncremental||(d=await(null===(p=(0,l.A)(fo,this))||void 0===p?void 0:p.didPerformIncrementalRender(e,(0,l.A)(co,this)))),t===u)if(d)(0,c.A)(co,this,e);else{if(eo&&(eo.abort(),eo=new AbortController),(0,c.A)(co,this,e),null===(s=(0,l.A)(fo,this))||void 0===s||s.dispatchPageLeave(),"POP"===n&&b(v((0,l.A)(so,this),e.pathname)))return void window.location.reload();(0,l.A)(ao,this)?(0,c.A)(lo,this,e):(V("locationChange"),(0,a.A)(bo,this,Ao).call(this,e).catch(Zt))}})),(0,a.A)(bo,this,Ao).call(this,e.location)}}function So(e){var t;const n=C(),r=n.getBlockMessage();null===(t=(0,l.A)(fo,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function Eo(e,t,n){var r,o;if((0,c.A)(ho,this,(r=(0,l.A)(ho,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}C().replace(e,t)}async function Ao(e){(0,c.A)(ao,this,!0);try{await(0,a.A)(bo,this,ko).call(this,e)}finally{if((0,c.A)(ao,this,!1),(0,l.A)(lo,this)){const e=(0,l.A)(lo,this);(0,c.A)(lo,this,void 0),await(0,a.A)(bo,this,Ao).call(this,e)}}}async function ko(e){var t,n,r,o;const i=(0,c.A)(mo,this,(0,g.uniqueId)("render-id-"));Je=new WeakSet,et.clear(),null==ei||null===(t=ei.flowApi)||void 0===t||t.clearCollectWidgetContract(),C().unblock();const s=null==ei||null===(n=ei.pageView)||void 0===n?void 0:n.create(),u=v((0,l.A)(so,this),e.pathname),f=null===(r=(0,l.A)(uo,this))||void 0===r?void 0:r.app,p=null==u||null===(o=u.app)||void 0===o?void 0:o.id;window.BOOTSTRAP_UNION_FILE&&p&&p!==(null==f?void 0:f.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:p,version:u.app.currentVersion}),null!=u&&u.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==ei||null===(t=ei.fulfilStoryboard)||void 0===t?void 0:t.call(ei,e)),B(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(u);const h=(0,c.A)(go,this,null==u?void 0:u.app);!function(){var e,t,n,r,o;const i=ni().getFeatureFlags(),s=ni().getMiscSettings();if(!i["show-watermark"])return;const a="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]),c=(null==ei||null===(n=ei.auth)||void 0===n||null===(n=n.getAuth())||void 0===n?void 0:n.username)??"",l=s.watermarkConfig??{flags:{}},u={content:[..."string"==typeof l.content?[l.content]:l.content??[],null!==(r=l.flags)&&void 0!==r&&r["show-development"]&&a?"Development":"",null!==(o=l.flags)&&void 0!==o&&o["show-user"]?c:""].filter(Boolean),zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,g.omit)(l,["content","flags"])};to?to.resolve(u):(0,d.loadBricksImperatively)([io],ci()).then((()=>{to=document.createElement(io),to.resolve(u)}),(e=>{console.error("Load watermark service failed:",e)}))}();const m=f&&h?f.id!==h.id:f!==h;(0,T.clearExpressionASTCache)(),m&&(0,T.clearFunctionASTCache)();const y=ni().getFeatureFlags(),b=(0,l.A)(fo,this),w=(t,n)=>{null==s||s({status:"redirected"}),(0,l.A)(po,this).add(b),(0,a.A)(bo,this,Eo).call(this,t,n,e)},S=()=>{const t=y["sso-enabled"]?"/sso-auth/login":"/auth/login";qt(e),w(t,{from:e})},E=document.querySelector("#main-mount-point"),A=document.querySelector("#portal-mount-point"),k={tag:Cn.ROOT,container:E,createPortal:A},I=()=>{var e;Rn(E),Rn(A),(0,l.A)(po,this).add(b);for(const e of(0,l.A)(po,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,l.A)(po,this).clear(),null==ei||null===(e=ei.messageDispatcher)||void 0===e||e.reset(),m&&((0,c.A)(vo,this,f),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:f,currentApp:h}})))};if(X(h&&(re()[h.id]||h.theme)||"light"),ie("default"),h){var O,P,_,M,x,L;null==ei||null===(O=ei.checkInstalledApps)||void 0===O||O.preCheckInstalledApps(u,(e=>!!fi(e)));const t={bailout:e=>e.unauthenticated?(S(),!0):e.redirect?(w(e.redirect.path,e.redirect.state),!0):void(0,c.A)(ho,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,c.A)(yo,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,l.A)(yo,this)}))},catch:(t,n)=>{if(!Yt(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const r=ni().getMiscSettings().noAuthGuardLoginPath;return Yt(t)&&r?void w(r,{from:e}):{failed:!0,output:{node:{tag:Cn.BRICK,type:"div",properties:{textContent:Gt(t),dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:n},blockingList:[]}}}(0,l.A)(po,this).add(b)}else S()}},n=(0,c.A)(fo,this,new Dn("page",{routeHelper:t,renderId:i})),r=(0,c.A)(uo,this,{app:h,location:e,query:new URLSearchParams(e.search),flags:y,sys:{...null==ei||null===(P=ei.auth)||void 0===P?void 0:P.getAuth(),...no(),settings:{brand:ni().getBrandSettings()}},ctxStore:new Tr("CTX",void 0,n),pendingPermissionsPreCheck:[null==ei||null===(_=ei.checkPermissions)||void 0===_?void 0:_.preCheckPermissions(u)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,c.A)(yo,this,void 0),ro(u),me(null===(M=u.meta)||void 0===M?void 0:M.functions,h),null==ei||null===(x=ei.flowApi)||void 0===x||x.collectContract(null===(L=u.meta)||void 0===L?void 0:L.contracts);let o,a=!1,d=[];try{Xn.clear();const e={};if(o=await Vr(k,function(e){if(window.parent===window)return e;let t=e;const n=(0,g.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,g.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}(u.routes),r,n,[],e),t.bailout(o))return;d=Hr(r),await qr(o,r,d),e.child=o.menuRequestNode,n.setInitialMenuRequestNode(e),await t.mergeMenus(n.getMenuRequests())}catch(e){console.error("Router failed:",e);const n=t.catch(e,k);if(!n)return;({failed:a,output:o}=n)}if(k.child=o.node,I(),o.route&&"routes"!==o.route.type||a){if(a||n.dispatchBeforePageLoad(),te(),ae(),oo(null==h?void 0:h.uiVersion),Tn(k),window.scrollTo(0,0),a)null==s||s({status:"failed"});else{n.dispatchPageLoad(),n.dispatchAnchorLoad(),n.dispatchOnMount(),n.initializeScrollIntoView(),n.initializeMediaChange(),n.initializeMessageDispatcher();for(const e of d)e.mountAsyncData();null==s||s({status:"ok",path:o.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=ei&&ei.auth&&!ei.auth.isLoggedIn())return void S();I()}te(),ae();const $={tag:Cn.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:k};k.child=$,Tn(k),window.scrollTo(0,0),null==s||s({status:"not-found"}),V("rendered")}const Io="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;var Co=n(4579),Ro=n(4501),To=2,Oo=.16,Po=.05,_o=.05,Mo=.15,xo=5,Bo=4,Lo=[{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 $o(e){var t=e.r,n=e.g,r=e.b,o=(0,Co.wE)(t,n,r);return{h:360*o.h,s:o.s,v:o.v}}function No(e){var t=e.r,n=e.g,r=e.b;return"#".concat((0,Co.Ob)(t,n,r,!1))}function Uo(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-To*t:Math.round(e.h)+To*t:n?Math.round(e.h)+To*t:Math.round(e.h)-To*t)<0?r+=360:r>=360&&(r-=360),r}function Fo(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-Oo*t:t===Bo?e.s+Oo:e.s+Po*t)>1&&(r=1),n&&t===xo&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function jo(e,t,n){var r;return(r=n?e.v+_o*t:e.v-Mo*t)>1&&(r=1),Number(r.toFixed(2))}function Do(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,Ro.RO)(e),o=xo;o>0;o-=1){var i=$o(r),s=No((0,Ro.RO)({h:Uo(i,o,!0),s:Fo(i,o,!0),v:jo(i,o,!0)}));n.push(s)}n.push(No(r));for(var a=1;a<=Bo;a+=1){var c=$o(r),l=No((0,Ro.RO)({h:Uo(c,a),s:Fo(c,a),v:jo(c,a)}));n.push(l)}return"dark"===t.theme?Lo.map((function(e){var r,o,i,s=e.index,a=e.opacity;return No((r=(0,Ro.RO)(t.backgroundColor||"#141414"),i=100*a/100,{r:((o=(0,Ro.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 Ko={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"},Vo={},Wo={};function zo(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Ho(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function qo(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function Go(e,t,n){return"dark"===t?Do(e,{theme:t,backgroundColor:n})[5]:e}function Yo(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Ho:zo)("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?Ho:zo)("".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(qo(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,Do(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(qo(Go(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?Ho:zo)(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 Qo,Jo,Xo,Zo,ei;function ti(e){if(Qo)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 j:D=n.panel}})),ei=null==e?void 0:e.hooks,(0,u.initializeI18n)(Vt,Wt),p.locale(u.i18n.language),u.i18n.on("languageChanged",(()=>{p.locale(u.i18n.language)})),I(),Qo=new si,Qo}Object.keys(Ko).forEach((function(e){Vo[e]=Do(Ko[e]),Vo[e].primary=Vo[e][5],Wo[e]=Do(Ko[e],{theme:"dark",backgroundColor:"#141414"}),Wo[e].primary=Wo[e][5]})),Vo.red,Vo.volcano,Vo.gold,Vo.orange,Vo.yellow,Vo.lime,Vo.green,Vo.cyan,Vo.blue,Vo.geekblue,Vo.purple,Vo.magenta,Vo.grey;const ni=function(){const e=k();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 Qo};var ri=new WeakMap,oi=new WeakMap,ii=new WeakSet;class si{constructor(){(0,o.A)(this,ii),(0,s.A)(this,ri,!1),(0,s.A)(this,oi,!1),(0,i.A)(this,"version",3)}initialize(e){var t;if((0,l.A)(ri,this))throw new Error("The runtime cannot be initialized more than once");(0,c.A)(ri,this,!0),function(e){(0,f.isObject)(e.settings)&&(0,f.deepFreeze)(e.settings),e.brickPackages&&(0,f.deepFreeze)(e.brickPackages)}(e),Jo=e;const{notification:n,dialog:r}=(0,a.A)(ii,this,ai).call(this);var o;!1!==n&&(o=n??"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{Jt=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{zt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(r??"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?Yo({type:"brandColor",...e.brandColor}):e.baseColors?Yo({type:"baseColors",...e.baseColors}):e.variables&&Yo({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,l.A)(oi,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,c.A)(oi,this,!0),Xo=new wo(Jo.storyboards),await Xo.bootstrap()}getRecentApps(){var e;return(null===(e=Xo)||void 0===e?void 0:e.getRecentApps())??{}}getCurrentApp(){var e;return null===(e=Xo)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return qe(e,t)}getFeatureFlags(){var e,t;return{...null===(e=Jo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=Xo)||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=Jo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=Xo)||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=Jo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=Jo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e;return(null===(e=Jo)||void 0===e?void 0:e.desktops)??[]}getLaunchpadSiteMap(){var e;return(null===(e=Jo)||void 0===e?void 0:e.siteSort)??[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=Xo)||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=Xo)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,d.loadBricksImperatively)(e,ci())}}function ai(){var e;return(null===(e=Jo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.presetBricks)??{}}function ci(){var e;return Zo??(Zo=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===(e=Jo)||void 0===e?void 0:e.brickPackages)??Io??window.STANDALONE_BRICK_PACKAGES??[],window.PUBLIC_DEPS))}function li(){var e;return null===(e=Xo)||void 0===e?void 0:e.getRenderId()}function ui(){var e;return null===(e=Xo)||void 0===e?void 0:e.getRuntimeContext()}function di(e){var t;return null===(t=Jo)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function fi(e){var t;return null===(t=di(e))||void 0===t?void 0:t.app}function pi(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==ei||null===(e=ei.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function hi(){var e;return null==ei||null===(e=ei.auth)||void 0===e?void 0:e.getAuth()}function mi(){var e,t;return null==ei||null===(e=ei.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function gi(){var e;return null==ei||null===(e=ei.auth)||void 0===e?void 0:e.isLoggedIn()}var vi=new WeakMap;const yi=new class{constructor(){(0,s.A)(this,vi,new Map)}define(e,t){(0,l.A)(vi,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,l.A)(vi,this).set(e,t)}get(e){return(0,l.A)(vi,this).get(e)}};async function bi(e,t,n){return nt(await Qe(e),e,"resolve",t,n)}function wi(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,c=!1;return{async render(n){let{theme:l,uiVersion:d,language:f,context:p,functions:h,templates:m,i18n:v,url:y,app:b}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");const w=[].concat(n),S=s,E=(0,g.uniqueId)("render-id-");s=new Dn(r,{unknownBricks:o,renderId:E});const A={ctxStore:new Tr("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map};if(y){const e=new URL(y);A.query=e.searchParams,A.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const k={tag:Cn.ROOT,container:e,createPortal:t};if("page"===r){var I;X(l??"light"),ie("default"),oo(d),f&&await u.i18n.changeLanguage(f),b??(b={id:"demo",homepage:"/demo"}),A.app=b;const e={app:b,meta:{i18n:v,customTemplates:m}};null===(I=a)||void 0===I||I(),a=B(e),ro(e),me(h,b)}A.ctxStore.define(p,A);let C,R=!1,T=[];try{C=await Wr(k,w,A,s,[],{}),T=Hr(A),await qr(C,A,T)}catch(e){R=!0,C={node:{tag:Cn.BRICK,type:"div",properties:{textContent:Gt(e),dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},return:k,runtimeContext:null},blockingList:[]}}if(k.child=C.node,null==S||S.dispatchOnUnmount(),null==S||S.dispose(),Rn(e),i&&Rn(i),"page"===r&&(R||s.dispatchBeforePageLoad(),te(),ae()),Tn(k),"page"===r&&window.scrollTo(0,0),!R){for(const e of T)e.mountAsyncData();"page"===r&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}},unmount(){c||(c=!0,Rn(e),i&&(Rn(i),n||i.remove()))}}}function Si(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...ui()};t&&(n.query=new URLSearchParams(C().location.search));const r=t=>{if("string"==typeof t){if((0,T.isEvaluable)(t)){const e=ut(t,n);return Xe(e),e}return(0,P.inject)(t,n)}return!(0,f.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)}}}]);
|
|
3
|
-
//# sourceMappingURL=7426.70d95964.js.map
|