@next-bricks/data-view 0.14.2 → 0.15.0

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.
Files changed (46) hide show
  1. package/dist/bricks.json +4 -4
  2. package/dist/chunks/{3458.4c99153d.js → 3458.49e46648.js} +2 -2
  3. package/dist/chunks/{8691.dcf26a0c.js.map → 3458.49e46648.js.map} +1 -1
  4. package/dist/chunks/{3494.4abaa53c.js → 3494.2ac2c572.js} +2 -2
  5. package/dist/chunks/{3494.4abaa53c.js.map → 3494.2ac2c572.js.map} +1 -1
  6. package/dist/chunks/4550.18341e69.js +2 -0
  7. package/dist/chunks/4550.18341e69.js.map +1 -0
  8. package/dist/chunks/{5636.e1796a6a.js → 5636.8046938c.js} +2 -2
  9. package/dist/chunks/{5636.e1796a6a.js.map → 5636.8046938c.js.map} +1 -1
  10. package/dist/chunks/{6205.47b27d26.js → 6205.fe7ef46f.js} +2 -2
  11. package/dist/chunks/{6205.47b27d26.js.map → 6205.fe7ef46f.js.map} +1 -1
  12. package/dist/chunks/6301.1f3fd7fe.js +2 -0
  13. package/dist/chunks/6301.1f3fd7fe.js.map +1 -0
  14. package/dist/chunks/{7164.272521bc.js → 7164.5ceba161.js} +2 -2
  15. package/dist/chunks/{7164.272521bc.js.map → 7164.5ceba161.js.map} +1 -1
  16. package/dist/chunks/7782.cc445401.js +2 -0
  17. package/dist/chunks/7782.cc445401.js.map +1 -0
  18. package/dist/chunks/{7822.1c4bf248.js → 7822.aee914cb.js} +2 -2
  19. package/dist/chunks/{7822.1c4bf248.js.map → 7822.aee914cb.js.map} +1 -1
  20. package/dist/chunks/{8691.dcf26a0c.js → 8691.1f6ac1b8.js} +2 -2
  21. package/dist/chunks/{3458.4c99153d.js.map → 8691.1f6ac1b8.js.map} +1 -1
  22. package/dist/chunks/{complex-search.e09dc15c.js → complex-search.e46ab236.js} +2 -2
  23. package/dist/chunks/{complex-search.e09dc15c.js.map → complex-search.e46ab236.js.map} +1 -1
  24. package/dist/chunks/{graph-text.e6e84fc4.js → graph-text.9e3f6f43.js} +2 -2
  25. package/dist/chunks/{graph-text.e6e84fc4.js.map → graph-text.9e3f6f43.js.map} +1 -1
  26. package/dist/chunks/{main.0a9023ef.js → main.239ba5f2.js} +2 -2
  27. package/dist/chunks/{main.0a9023ef.js.map → main.239ba5f2.js.map} +1 -1
  28. package/dist/chunks/modern-style-treemap.6dd5618b.js +3 -0
  29. package/dist/chunks/modern-style-treemap.6dd5618b.js.map +1 -0
  30. package/dist/index.1f94ec29.js +2 -0
  31. package/dist/{index.2bf1df0b.js.map → index.1f94ec29.js.map} +1 -1
  32. package/dist/manifest.json +68 -68
  33. package/dist/types.json +126 -126
  34. package/package.json +2 -2
  35. package/dist/chunks/6301.3c283b1c.js +0 -2
  36. package/dist/chunks/6301.3c283b1c.js.map +0 -1
  37. package/dist/chunks/7782.11601d27.js +0 -2
  38. package/dist/chunks/7782.11601d27.js.map +0 -1
  39. package/dist/chunks/9526.b1b920ff.js +0 -2
  40. package/dist/chunks/9526.b1b920ff.js.map +0 -1
  41. package/dist/chunks/modern-style-treemap.052eb4c9.js +0 -3
  42. package/dist/chunks/modern-style-treemap.052eb4c9.js.map +0 -1
  43. package/dist/index.2bf1df0b.js +0 -2
  44. package/dist-types/utils/debounceByAnimationFrame.d.ts +0 -4
  45. package/dist-types/utils/debounceByAnimationFrame.spec.d.ts +0 -1
  46. /package/dist/chunks/{modern-style-treemap.052eb4c9.js.LICENSE.txt → modern-style-treemap.6dd5618b.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_next_bricks_data_view=self.webpackChunk_next_bricks_data_view||[]).push([[7782],{5863:(e,t,r)=>{function n(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}r.d(t,{Z:()=>n})},175:(e,t,r)=>{function n(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}r.d(t,{Z:()=>n})},687:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(175);function o(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,(0,n.Z)(e,t,"get"))}},3395:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(5863);function o(e,t,r){(0,n.Z)(e,t),t.set(e,r)}},381:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(175);function o(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,(0,n.Z)(e,t,"set"),r),r}},6171:(e,t,r)=>{function n(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}r.d(t,{Z:()=>n})},5866:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(5863);function o(e,t){(0,n.Z)(e,t),t.add(e)}},6666:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(5850);function o(e,t,r){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},3028:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(6666);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}},2159:(e,t,r)=>{function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,{Z:()=>n})},5850:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(6522);function o(e){var t=function(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==(0,n.Z)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===(0,n.Z)(t)?t:String(t)}},6522:(e,t,r)=>{function n(e){return n="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},n(e)}r.d(t,{Z:()=>n})},7782:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>Yt,Notification:()=>ar,StoryboardFunctionRegistryFactory:()=>pe,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>ee,authenticate:()=>Zo,batchSetAppsLocalTheme:()=>te,checkIfByTransform:()=>Ct,checkIfOfComputed:()=>It,createHistory:()=>k,createRuntime:()=>vo,customProcessors:()=>M,customTemplates:()=>Pe,fetchByProvider:()=>Oo,getAuth:()=>Io,getBasePath:()=>v,getCssPropertyValue:()=>se,getCurrentMode:()=>ae,getCurrentTheme:()=>X,getHistory:()=>Z,getPageInfo:()=>Bn,getRuntime:()=>ho,handleHttpError:()=>or,httpErrorToString:()=>Xt,isLoggedIn:()=>Co,isUnauthenticatedError:()=>er,logout:()=>Ao,matchPath:()=>Ft,registerWidgetFunctions:()=>Be,registerWidgetI18n:()=>L,unstable_createRoot:()=>Po});var n={};r.r(n),r.d(n,{getAllContextValues:()=>Vo,getBrickPackagesById:()=>Wo,getContextValue:()=>Do,getRenderId:()=>Ho,legacyDoTransform:()=>Bo,mountUseBrick:()=>Mo,renderUseBrick:()=>Ro,unmountUseBrick:()=>xo,updateSnippetPreviewSettings:()=>$o,updateStoryboard:()=>Lo,updateStoryboardByRoute:()=>Uo,updateStoryboardBySnippet:()=>jo,updateStoryboardByTemplate:()=>No,updateTemplatePreviewSettings:()=>Fo});var o=r(3028),a=r(4795),i=r(3395),s=r(381),l=r(687),c=r(4594),u=r(993),d=r(1433),p=r(8874),f=(r(8525),r(7857));function v(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=r(2159),m=r(5178);function g(e,t){var r=(0,m.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app)||void 0===r||null===(r=r.homepage)||void 0===r?void 0:r.length)&&void 0!==t?t:0}),"desc");for(var n of r){var o=n.app.homepage;if("string"==typeof o&&"/"===o[0]&&("/"===o?t===o:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(o.replace(/\/+$/,""),"/"))))return n}}function y(e){var t;return!e||(null===(t=ho().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var b,w=["extraQuery","clear","keepHash"],S=!1;function E(e,t){t(!(S=!confirm(e)))}function k(){if(!b){var e=(0,f.createBrowserHistory)({basename:v().replace(/\/$/,""),getUserConfirmation:E});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function a(e,t,n){S=!1,r(e,t),null==n||n(S)}function i(e,t,r){S=!1,n(e,t),null==r||r(S)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:l,keepHash:c}=n,u=(0,h.Z)(n,w),d=new URLSearchParams(l?"":e.location.search),p={};for(var[f,v]of(Object.assign(p,r,s),Object.entries(p)))if(Array.isArray(v))for(var m of(d.delete(f),v))d.append(f,m);else null==v||""===v?d.delete(f):d.set(f,v);("push"===t?a:i)("?".concat(d.toString()).concat(c?e.location.hash:""),u,o)}}return(0,o.Z)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){a((0,o.Z)((0,o.Z)({},e.location),{},{key:void 0,hash:t,state:(0,o.Z)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,o.Z)((0,o.Z)({},e.location),{},{state:(0,o.Z)((0,o.Z)({},e.location.state),{},{notify:!0})}),void 0,t)},setBlockMessage:function(e){t=e},getBlockMessage:function(){return t},unblock:function(){t=void 0}},function(e){var{push:t,replace:r}=e;function n(n){return function(o,a,i){var s,l="string"==typeof o;return"string"==typeof(s=l?(0,f.parsePath)(o).pathname:o.pathname)&&s.startsWith("/")&&y(function(e){var t,r;return g(null!==(t=null===(r=co)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](l?v()+o.substring(1):e.createHref(o)):("push"===n?t:r)(o,a,i)}}return{push:n("push"),replace:n("replace")}}((0,o.Z)((0,o.Z)({},e),{},{push:a,replace:i})))}(e)),b=e}return b}function Z(){var e;return null!==(e=b)&&void 0!==e?e:function(){var{dll:e}=window;if("function"==typeof e)return e("tYg3").getHistory()}()}var I=r(5866),A=r(6171),C=r(5566),O=r(8440),T=r(4614),P=r(534),R=r(2623),_=new WeakMap,M=new class{constructor(){(0,i.Z)(this,_,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),o=(0,l.Z)(this,_).get(r);if(o||(o=new Map,(0,l.Z)(this,_).set(r,o)),o.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));o.set(n,t)}get(e){return(0,l.Z)(this,_).get(e)}};function x(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=B("app",t.id),o=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;c.i18n.addResourceBundle(t,n,r),o.push(t)})),()=>{for(var e of o)c.i18n.removeResourceBundle(e,n)}}}function B(e,t){return"".concat(e,"/").concat(t)}function L(e,t){var r=B("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;c.i18n.addResourceBundle(t,r,n)}))}function U(e){return c.i18n.getFixedT(null,B("widget",e))}var N,F="brick-next-devtools-panel",j="devtools-frame-active-change",$="devtools-panel-change",K=!0;function D(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var V=()=>{throw new Error("Can't modify read-only proxy object")},W={set:V,defineProperty:V,deleteProperty:V,setPrototypeOf:V};function H(e){return new Proxy(e,W)}function z(e){var{get:t,ownKeys:r}=e;return D()?H(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var G="light",q=new d.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));G=e}function Y(){return G}function X(){return document.documentElement.dataset.theme}function ee(e){e?Q(e):e=Y(),e!==X()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function te(e){q.setItem(J,(0,o.Z)((0,o.Z)({},re()),e))}function re(){var e,t;try{t=q.getItem(J)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var ne="default";function oe(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));ne=e}function ae(){return document.documentElement.dataset.mode}function ie(e){e?oe(e):e=ne,e!==ae()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function se(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return r&&(null===(t=window.getComputedStyle(r))||void 0===t?void 0:t.getPropertyValue(e))||""}function le(e,t){var r={};for(var n of e){var o=ce(n,t);void 0!==o&&(r[n]=o)}return r}function ce(e,t){var r,n,o,{collectCoverage:a,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return a?"/next":v().replace(/\/$/,"");case"FN":return d;case"IMG":return a?{get:e=>"mock/images/".concat(e)}:i?null==po||null===(r=po.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==po||null===(n=po.images)||void 0===n?void 0:n.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return a?m.identity:i?U(i):c.i18n.getFixedT(null,[u,B("app",l.id)].filter(Boolean));case"I18N_TEXT":return a?ue:c.i18nText;case"PERMISSIONS":return H({check:a?de:null==po||null===(o=po.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return H({getTheme:a?()=>"light":Y});case"console":return p?H(console):void 0;case"location":return a?{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 ue(e){return null==e?void 0:e.en}function de(){return!0}function pe(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=new Map,i=new Proxy(Object.freeze({}),{get:(o,s)=>function(o){var s,l=a.get(o);if(l){if(l.processed)return l.cooked;n&&(s=n.createCollector(o));var c=(0,O.precookFunction)(l.source,{typescript:l.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return l.cooked=(0,O.cook)(c.function,l.source,{rules:{noVar:!0},globalVariables:(0,P.supply)(c.attemptToVisitGlobals,le(c.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:i,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),l.processed=!0,l.cooked}}(s)});return{storyboardFunctions:i,registerStoryboardFunctions:function(t,r){if(r&&(e=r),a.clear(),Array.isArray(t))for(var n of t){var o=(0,R.strictCollectMemberUsageInFunction)(n,"FN"),i=(0,R.strictCollectMemberUsageInFunction)(n,"PERMISSIONS").has("check");a.set(n.name,{source:n.source,typescript:n.typescript,deps:o,hasPermissionsCheck:i})}},updateStoryboardFunction(e,t){var r=(0,o.Z)((0,o.Z)({},t),{},{name:e}),n=(0,R.strictCollectMemberUsageInFunction)(r,"FN"),i=(0,R.strictCollectMemberUsageInFunction)(r,"PERMISSIONS").has("check");a.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:i})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=a.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:fe,registerStoryboardFunctions:ve,checkPermissionsUsage:he}=pe(),me={};try{me.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var r=e.create,n=e.defineProperty,o=a.prototype;function a(){t.set(this,r(null))}function i(e,t,r){n(e,t,{configurable:!0,writable:!0,value:r})}function s(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}i(o,"addEventListener",(function(e,r,n){for(var o=t.get(this),a=o[e]||(o[e]=[]),i=0,s=a.length;i<s;i++)if(a[i].listener===r)return;a.push({target:this,listener:r,options:n})})),i(o,"dispatchEvent",(function(e){var r=t.get(this)[e.type];return r&&(i(e,"target",this),i(e,"currentTarget",this),r.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),i(o,"removeEventListener",(function(e,r){for(var n=t.get(this),o=n[e]||(n[e]=[]),a=0,i=o.length;a<i;a++)if(o[a].listener===r)return void o.splice(a,1)})),me.EventTarget=a}(Object,new WeakMap)}const ge=me.EventTarget;var ye=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),be=new Map([[ye.xLarge,"1920px"],[ye.large,"1600px"],[ye.medium,"1280px"],[ye.small,"1024px"],[ye.xSmall,0]]),we=new ge,Se={},Ee={};function ke(e,t){var r=!1;for(var[n]of(Se[t]=e.matches,be))if(Se[n]&&Ee.breakpoint!==n){Ee.breakpoint=n,r=!0;break}r&&we.dispatchEvent(new CustomEvent("change",{detail:Ee}))}be.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));ke(r,t),r.addEventListener?r.addEventListener("change",(e=>{ke(e,t)})):r.addListener((e=>{ke(e,t)}))}));var Ze=()=>Ee;function Ie(e){return function(t){var r,n="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(r=n.getItem(t))&&void 0!==r?r:"null")}}function Ae(e){var t,r;return!(null===(t=e?e.flags:null===(r=ho())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Ce(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];var a=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(a),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(a),...n)}var Oe=new Set(["prefix"]),Te=new WeakMap,Pe=new class{constructor(){(0,i.Z)(this,Te,{writable:!0,value:new Map})}define(e,t){var r,n,a,i,s=(0,l.Z)(this,Te).has(e);s?console.warn('Custom template of "'.concat(e,'" already registered.')):(s=!!customElements.get(e))&&console.warn('Custom template of "'.concat(e,'" already defined by customElements.'));var c=Ae(),u=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},d=[],p=[];for(var[f,v]of Object.entries(u))v.asVariable?(Ce(c,"Template `asVariable`",e,f),c||p.push(f)):v.mergeProperty||v.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,f):v.ref&&d.push([f,v]);var h=(0,o.Z)((0,o.Z)({},t),{},{proxy:(0,o.Z)((0,o.Z)({},t.proxy),{},{properties:Object.fromEntries(d)}),state:(t.state?c?t.state:t.state.map((e=>(0,o.Z)({expose:!0},e))):[]).concat(p.map((e=>({name:e,expose:!0}))))});(0,l.Z)(this,Te).set(e,(0,o.Z)((0,o.Z)({},h),{},{name:e}));var g,y,b=(g=h.state,(0,m.uniq)(null!==(y=null==g?void 0:g.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==y?y:[])),w=Object.entries(null!==(a=null===(i=h.proxy)||void 0===i?void 0:i.methods)&&void 0!==a?a:{}),S=b.concat(d.map((e=>e[0]))),E=w.map((e=>e[0])),k=S.concat(E).filter((e=>e in HTMLElement.prototype&&!Oe.has(e)));if(k.length>0&&(Ce(c,"Using native HTMLElement properties as template properties or methods",e,...k),c))throw new Error('In custom template "'.concat(e,'", ').concat(k.map((e=>'"'.concat(e,'"'))).join(", ")," are native HTMLElement properties, and should be avoid to be used as brick properties or methods."));if(!s){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return S}static get _dev_only_definedMethods(){return E}$$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(){var e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));var t=document.createDocumentFragment(),r=document.createElement("style");r.textContent=":host{display:block}:host([hidden]){display:none}";var n=document.createElement("slot");t.appendChild(r),t.appendChild(n),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}var Z=function(r){if(d.some((e=>e[0]===r)))return console.error('Cannot define an exposed state that is also a proxy property: "'.concat(r,'" in ').concat(e)),"continue";Object.defineProperty(t.prototype,r,{get(){return this.$$tplStateStore.getValue(r)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(r,e,"replace")},enumerable:!0})};for(var I of b)Z(I);var A=function(e,r){Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(r.ref)[null!==(t=r.refProperty)&&void 0!==t?t:e]},set(t){var n,o,a=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);a&&(a[null!==(o=r.refProperty)&&void 0!==o?o:e]=t)},enumerable:!0})};for(var[C,O]of d)A(C,O);var T=function(e,r){Object.defineProperty(t.prototype,e,{value(){var t;this.$$getElementByRef(r.ref)[null!==(t=r.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0})};for(var[P,R]of w)T(P,R);customElements.define(e,t)}}get(e){return(0,l.Z)(this,Te).get(e)}};function Re(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:o}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var a=o.get(n);if(!a)throw new Error('Template state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return a}function _e(e,t,r){var n=Re(e,t,r).hostBrick.element;if(!n)throw new Error('Template host element is gone when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return n}var Me=new Map,xe=new Proxy(Object.freeze({}),{get:(e,t)=>Me.get(t)});function Be(e,t,r){if(Me.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:o}=pe({widgetId:e,widgetVersion:r});Me.set(e,n),o(t)}const Le=/^[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(Le);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ne=e=>"*"===e||"x"===e||"X"===e,Fe=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},je=(e,t)=>{if(Ne(e)||Ne(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Fe(e),Fe(t));return r>n?1:r<n?-1:0},$e=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=je(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},Ke=(e,t,r)=>{We(r);const n=((e,t)=>{const r=Ue(e),n=Ue(t),o=r.pop(),a=n.pop(),i=$e(r,n);return 0!==i?i:o&&a?$e(o.split("."),a.split(".")):o||a?o?-1:1:0})(e,t);return De[r].includes(n)},De={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ve=Object.keys(De),We=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===Ve.indexOf(e))throw new Error(`Invalid operator, expected one of ${Ve.join("|")}`)};function He(e,t){var r=ko(e);if(!r&&null!=po&&po.checkInstalledApps&&(r=po.checkInstalledApps.getCheckedApp(e)),!r||"running"===r.installStatus)return!1;if(!t||!r.currentVersion)return!0;var n=t.match(/^([><]=?|=)(.*)$/);try{if(!n)throw new TypeError("Invalid match version: ".concat(t));return Ke(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function ze(e,t,r){var{formStateStoreId:n,formStateStoreMap:o}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of form renderer').concat(null!=r?r:""));var a=o.get(n);if(!a)throw new Error('Form state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return a}var Ge=new Map;function qe(e){return Je.apply(this,arguments)}function Je(){return Je=(0,a.Z)((function*(e){var t,r=null==po||null===(t=po.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=po.flowApi.FLOW_API_PROVIDER);var n=Ge.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)po.flowApi.registerFlowApiProvider();else if(yield(0,u.loadBricksImperatively)([e],bo()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Ge.set(e,n),n})),Je.apply(this,arguments)}var Qe=new WeakSet;function Ye(e){if((0,d.isObject)(e)&&!Xe(e))if(Qe.add(e),Array.isArray(e))e.forEach(Ye);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Ye)}}function Xe(e){return Qe.has(e)}var et=new Map;function tt(e,t,r){return rt.apply(this,arguments)}function rt(){return(rt=(0,a.Z)((function*(e,t,r){var{useProvider:n,method:a="resolve",args:i=[],onReject:s}=e,{provider:l,field:c}=e;if(l&&!n)throw new Error("You're using \"provider: ".concat(l,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=c;if(u){var d=Ae();if(Ce(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var p,[f,v]=yield Promise.all([qe(n),gt(i,t)]),h=nt(f,n,a,v,r,i),{transform:g}=e;try{var y=yield h;Ye(p=u?(0,m.get)(y,c):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,p=e}return g?"string"==typeof g?{[g]:p}:gt(g,(0,o.Z)((0,o.Z)({},t),{},{data:p})):p}))).apply(this,arguments)}function nt(e,t,r,n,o,a){return ot.apply(this,arguments)}function ot(){return ot=(0,a.Z)((function*(e,t,r,n,o,i){var s,l;try{s=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!i)throw e;s=JSON.stringify({useProvider:t,method:r,originalArgs:i})}return"reload"!==(null==o?void 0:o.cache)&&(l=et.get(s)),l||(l=(0,a.Z)((function*(){var o,a=null!=po&&null!==(o=po.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?yield po.flowApi.getArgsOfFlowApi(t,n,r):n;return e.resolve(...a)}))(),et.set(s,l)),l})),ot.apply(this,arguments)}var at=Symbol.for("pre.evaluated.raw"),it=Symbol.for("pre.evaluated.context");function st(e){return!(null==e||!e[at])}function lt(e){return e[at]}function ct(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[at])}var ut=new WeakSet([SyntaxError,TypeError,ReferenceError]);function dt(e){return ut.has(e.constructor)?e.constructor:TypeError}function pt(){return(pt=(0,a.Z)((function*(e,t,r){var{blockingList:n,run:o}=ft(e,t,r,!0);return yield Promise.all(n),o()}))).apply(this,arguments)}function ft(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,a=[];if("string"!=typeof e){var i=(0,m.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,o.Z)((0,o.Z)({},e[it]),i),e=e[at]}var s,l={usedArgs:new Set},c={usedArgs:new Set};try{s=(0,O.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,R.collectAppGetMenuUsage)(l,e,t),(0,R.collectInstalledAppsHasUsage)(c,e,t)}}})}catch(t){var p="".concat(t.message,', in "').concat(e,'"');throw new(dt(t))(p)}if(l.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(c.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var f,v,h,g,y={},{attemptToVisitGlobals:b}=s;if(r.lazy||b.has("EVENT")&&!(0,d.hasOwnProperty)(t,"event")||b.has("DATA")&&!(0,d.hasOwnProperty)(t,"data"))return{blockingList:a,run:()=>Object.keys(t).length>0?{[at]:e,[it]:t}:e};var w,S,E=Ae(t);(b.has("STATE")||!E&&b.has("TPL"))&&(g=Re(t,"STATE",': "'.concat(e,'"'))),b.has("FORM_STATE")&&(S=ze(t,"FORM_STATE",': "'.concat(e,'"')));var k=D();if(n||k){if(b.has("CTX")&&(f=(0,R.strictCollectMemberUsage)(e,"CTX"),n&&a.push(t.ctxStore.waitFor(f))),g){if(h=(0,R.strictCollectMemberUsage)(e,"STATE"),!E){var Z=(0,R.strictCollectMemberUsage)(e,"TPL");for(var I of Z)h.add(I)}n&&a.push(g.waitFor(h))}S&&(w=(0,R.strictCollectMemberUsage)(e,"FORM_STATE"),n&&a.push(S.waitFor(w))),b.has("PROCESSORS")&&(v=(0,R.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&a.push((0,u.loadProcessorsImperatively)(v,bo())))}if(n){var A,C=b.has("PERMISSIONS");if(!C&&b.has("FN")){var T=[...(0,R.strictCollectMemberUsage)(e,"FN")];C=he(T)}if(C&&a.push(...t.pendingPermissionsPreCheck),l.usedArgs.size>0&&null!=po&&po.menu){var _=[...l.usedArgs];a.push(Promise.all(_.map((e=>po.menu.fetchMenuById(e,t,{getStoryboardByAppId:Eo,resolveData:tt,asyncComputeRealValue:gt})))))}c.usedArgs.size>0&&a.push(null==po||null===(A=po.checkInstalledApps)||void 0===A?void 0:A.waitForCheckingApps([...c.usedArgs]))}return{blockingList:a,run(){var r,n,a,i,{app:l,location:c,query:u,match:p,flags:k,sys:Z,ctxStore:I,data:A,event:C}=t,T=null!==(r=t.overrideApp)&&void 0!==r?r:l;for(var R of b)switch(R){case"ANCHOR":y[R]=c.hash?c.hash.substring(1):null;break;case"APP":y[R]=(0,o.Z)((0,o.Z)({},(0,m.cloneDeep)(T)),{},{getMenu:null==po||null===(n=po.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":y[R]=z({get:(e,t)=>I.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":y[R]=A;break;case"EVENT":y[R]=C;break;case"FLAGS":y[R]=H(k);break;case"FORM_STATE":y[R]=z({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":y[R]=c.hash;break;case"INSTALLED_APPS":y[R]=H({has:He});break;case"ITEM":(0,d.hasOwnProperty)(t,"forEachItem")?y[R]=t.forEachItem:console.error('Using `ITEM` but no `:forEach` is found, check your expression: "'.concat(e,'"'));break;case"LOCAL_STORAGE":y[R]=H({getItem:Ie("local")});break;case"MEDIA":y[R]=H(Ze());break;case"MISC":y[R]=ho().getMiscSettings();break;case"PARAMS":y[R]=new URLSearchParams(u);break;case"PATH":y[R]=H(null!==(a=null==p?void 0:p.params)&&void 0!==a?a:{});break;case"PATH_NAME":y[R]=c.pathname;break;case"PROCESSORS":y[R]=z({get(e,t){var r=M.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return z({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of v){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":y[R]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":y[R]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":y[R]=H({getItem:Ie("session")});break;case"TPL":if(Ce(E,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),E)break;case"STATE":y[R]=z({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":y[R]=H(null!=Z?Z:{});break;case"__WIDGET_FN__":y[R]=xe;break;case"__WIDGET_IMG__":y[R]=null==po||null===(i=po.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":y[R]=U}Object.assign(y,le(s.attemptToVisitGlobals,{storyboardFunctions:fe,app:t.app,appendI18nNamespace:t.appendI18nNamespace}));try{var _=(0,O.cook)(s.expression,s.source,{globalVariables:(0,P.supply)(s.attemptToVisitGlobals,y)});return function(e,t){var r=D();if(r&&K&&(!N||"Evaluations"===N)){var n=()=>{var n;null===(n=r.emit)||void 0===n||n.call(r,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(n):setTimeout(n,0)}}("evaluation",{raw:e,context:y,result:_}),_}catch(t){var x="".concat(t.message,', in "').concat(e,'"');throw new(dt(t))(x)}}}}var vt=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 ht(e){switch(e){case vt.USE_BRICK_PROPERTIES:case vt.USE_BRICK_TRANSFORM:case vt.USE_BRICK_EVENTS:case vt.USE_BRICK_IF:case vt.USE_BRICK_LIFECYCLE:case vt.USE_BRICK_DATA_SOURCE:return!0}return!1}function mt(e,t,r){if(ht(e))return e;if(t)switch(e){case vt.USE_BRICK:return vt.USE_BRICK_ITEM;case vt.USE_BRICK_SLOTS_ITEM_BRICKS:return vt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case vt.INITIAL:if("useBrick"===r)return vt.USE_BRICK;break;case vt.USE_BRICK:case vt.USE_BRICK_ITEM:case vt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return vt.USE_BRICK_PROPERTIES;case"transform":return vt.USE_BRICK_TRANSFORM;case"dataSource":return vt.USE_BRICK_DATA_SOURCE;case"events":return vt.USE_BRICK_EVENTS;case"slots":return vt.USE_BRICK_SLOTS;case"children":return vt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return vt.USE_BRICK_IF;case"lifeCycle":return vt.USE_BRICK_LIFECYCLE}break;case vt.USE_BRICK_SLOTS:return vt.USE_BRICK_SLOTS_ITEM;case vt.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return vt.USE_BRICK_SLOTS_ITEM_BRICKS}return vt.INITIAL}function gt(e,t){return yt.apply(this,arguments)}function yt(){return yt=(0,a.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=st(e);if(n||"string"==typeof e){var o,a=r.$$lazyForUseBrick&&ht(r.$$stateOfUseBrick),i=a;return n||(0,O.isEvaluable)(e)?(o=yield function(e,t,r){return pt.apply(this,arguments)}(e,t,{lazy:a}),i=ct(e)):o=a?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?T.transform:T.transformAndInject:r.noInject?St:T.inject)(e,t),i||Ye(o),o}if(!(0,d.isObject)(e)||Xe(e))return e;if(Array.isArray(e)){var s=wt(r,!0);return Promise.all(e.map((e=>gt(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,o]=e;return Promise.all([gt(n,t),gt(o,t,wt(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),yt.apply(this,arguments)}function bt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=st(e);if(n||"string"==typeof e){var o,a=r.$$lazyForUseBrick&&ht(r.$$stateOfUseBrick),i=a;return n||(0,O.isEvaluable)(e)?(o=function(e,t,r){var{run:n}=ft(e,t,void 0,!1);return n()}(e,t),i=ct(e)):o=a?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?T.transform:T.transformAndInject:r.noInject?St:T.inject)(e,t),i||Ye(o),o}if(!(0,d.isObject)(e)||Xe(e))return e;if(Array.isArray(e)){var s=wt(r,!0);return e.map((e=>bt(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,o]=e;return[bt(n,t),bt(o,t,wt(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function wt(e,t,r){return e.$$lazyForUseBrick?(0,o.Z)((0,o.Z)({},e),{},{$$stateOfUseBrick:mt(e.$$stateOfUseBrick,t,r)}):e}function St(e){return e}function Et(e,t){return kt.apply(this,arguments)}function kt(){return(kt=(0,a.Z)((function*(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||st(e.if)?yield gt(e.if,t):e.if)}))).apply(this,arguments)}function Zt(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||st(e.if)?bt(e.if,t):e.if)}function It(e){return!(0,d.hasOwnProperty)(e,"if")||!!e.if}function At(){return(At=(0,a.Z)((function*(e,t){return(0,d.isObject)(e.if)&&!st(e.if)?It(yield tt(e.if,t)):Et(e,t)}))).apply(this,arguments)}function Ct(e,t){return Zt(e,{data:t})}function Ot(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,O.isEvaluable)(e):st(e)){var o="string"==typeof e?e:lt(e);if((0,O.isTrackAll)(o)){var a=(0,R.trackAll)(o);a&&(t=a.context,r=a.state,n=a.formState)}else t=(0,R.track)(o,"track context","CTX"),r=(0,R.track)(o,"track state","STATE"),n=(0,R.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function Tt(){return Tt=(0,a.Z)((function*(e){return Object.fromEntries((yield Promise.all(Object.entries(e).map(function(){var e=(0,a.Z)((function*(e){var[t,r]=e,n=yield r;if("style"!==t&&"dataset"!==t||(0,d.isObject)(n))return[t,n]}));return function(t){return e.apply(this,arguments)}}()))).filter(Boolean))})),Tt.apply(this,arguments)}function Pt(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[o,a]of Object.entries(n))e[r][o]=a;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function Rt(e,t,r){var n=function(e,t){return(0,d.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,o=bt(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?vt.USE_BRICK:vt.INITIAL});if("style"!==r&&"dataset"!==r||(0,d.isObject)(o))return[r,o]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Pt(e,n)}))}function _t(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Mt(e){return e&&e.sensitive?"":"i"}function xt(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,o=void 0!==n&&n,a=r.start,i=void 0===a||a,s=r.end,l=void 0===s||s,c=r.encode,u=void 0===c?function(e){return e}:c,d=r.delimiter,p=void 0===d?"/#?":d,f=r.endsWith,v="[".concat(_t(void 0===f?"":f),"]|$"),h="[".concat(_t(p),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var b=y[g];if("string"==typeof b)m+=_t(u(b));else{var w=_t(u(b.prefix)),S=_t(u(b.suffix));if(b.pattern)if(t&&t.push(b),w||S)if("+"===b.modifier||"*"===b.modifier){var E="*"===b.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(b.pattern,")(?:").concat(S).concat(w,"(?:").concat(b.pattern,"))*)").concat(S,")").concat(E)}else m+="(?:".concat(w,"(").concat(b.pattern,")").concat(S,")").concat(b.modifier);else"+"===b.modifier||"*"===b.modifier?m+="((?:".concat(b.pattern,")").concat(b.modifier,")"):m+="(".concat(b.pattern,")").concat(b.modifier);else m+="(?:".concat(w).concat(S,")").concat(b.modifier)}}if(l)o||(m+="".concat(h,"?")),m+=r.endsWith?"(?=".concat(v,")"):"$";else{var k=e[e.length-1],Z="string"==typeof k?h.indexOf(k[k.length-1])>-1:void 0===k;o||(m+="(?:".concat(h,"(?=").concat(v,"))?")),Z||(m+="(?=".concat(h,"|").concat(v,")"))}return new RegExp(m,Mt(r))}(function(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var o=1,a="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--o){s++;break}}else if("("===e[s]&&(o++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));a+=e[s++]}else a+=e[s++]+e[s++];if(o)throw new TypeError("Unbalanced pattern at ".concat(r));if(!a)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:a}),r=s}else{for(var i="",s=r+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;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,o=void 0===n?"./":n,a="[^".concat(_t(t.delimiter||"/#?"),"]+?"),i=[],s=0,l=0,c="",u=function(e){if(l<r.length&&r[l].type===e)return r[l++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var n=r[l],o=n.type,a=n.index;throw new TypeError("Unexpected ".concat(o," at ").concat(a,", expected ").concat(e))},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};l<r.length;){var f=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=f||"";-1===o.indexOf(m)&&(c+=m,m=""),c&&(i.push(c),c=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||a,modifier:u("MODIFIER")||""})}else{var g=f||u("ESCAPED_CHAR");if(g)c+=g;else if(c&&(i.push(c),c=""),u("OPEN")){m=p();var y=u("NAME")||"",b=u("PATTERN")||"",w=p();d("CLOSE"),i.push({name:y||(b?s++:""),pattern:y&&!b?a:b,prefix:m,suffix:w,modifier:u("MODIFIER")||""})}else d("END")}}return i}(e,r),t,r)}function Bt(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,o=r.exec(e.source);o;)t.push({name:o[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),o=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return Bt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),Mt(r))}(e,t,r):xt(e,t,r)}var Lt=new Map,Ut=1e4,Nt=0;function Ft(e,t){var{path:r,exact:n=!1,strict:o=!1,sensitive:a=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:i,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Lt.get(r);n||Lt.set(r,n=new Map);var o=n.get(e);if(o)return o;var a=[],i={regexp:Bt(e,a,t),keys:a};return Nt<Ut&&(n.set(e,i),Nt++),i}(r,{end:n,strict:o,sensitive:a}),l=i.exec(e);if(!l)return null;var[c,...u]=l,d=e===c;return n&&!d?null:{path:r,url:"/"===r&&""===c?"/":c,isExact:d,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function jt(){return(jt=(0,a.Z)((function*(e,t){for(var r of e){if("string"!=typeof r.path)throw console.error("Invalid route with invalid path:",r),new Error("Invalid route with invalid type of path: ".concat(typeof r.path));var n=r.path.replace(/^\$\{APP.homepage\}/,t.app.homepage),o=Ft(t.location.pathname,{path:n,exact:r.exact});if(o&&(yield Et(r,t)))return t.app.noAuthGuard||r.public||null==po||!po.auth||po.auth.isLoggedIn()?{match:o,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}var $t,Kt=Symbol.for("tpl.asyncComputedPropsFromHost"),Dt=Symbol.for("tpl.stateStoreId"),Vt=Symbol.for("tpl.externalForEachItem"),Wt=r(6666),Ht=new Set,zt=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}({}),Gt={[zt.REQUEST_FAILED]:"Request Failed",[zt.SOMETHING_WENT_WRONG]:"Something went wrong!",[zt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[zt.NETWORK_ERROR]:"Network error, please check your network."},qt={[zt.REQUEST_FAILED]:"请求失败",[zt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[zt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[zt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},Jt="core/runtime",Qt={en:Gt,zh:qt},Yt=Object.freeze({show:function(e){return $t?$t.resolve(e):"confirm"===e.type?confirm(e.content)?new Promise((e=>setTimeout((()=>{e()}),1))):new Promise(((e,t)=>setTimeout((()=>{t()}),1))):(alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1e3))))}});function Xt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof C.HttpFetchError)return c.i18n.t("".concat(Jt,":").concat(zt.NETWORK_ERROR));if(e instanceof C.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 er(e){return e instanceof C.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var tr,rr,nr=!1;function or(e){if(!(e instanceof C.HttpAbortError)){if(er(e)&&!window.NO_AUTH_GUARD){if(nr)return;return nr=!0,void Yt.show({type:"confirm",content:c.i18n.t("".concat(Jt,":").concat(zt.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=ho().getFeatureFlags()["sso-enabled"],(t=Z()).push(e?"/sso-auth/login":"/auth/login",{from:(0,o.Z)((0,o.Z)({},t.location),{},{state:void 0})}),nr=!1}),(()=>{nr=!1}))}console.error(e);var t=Xt(e);t!==tr&&(tr=t,Yt.show({type:"error",title:c.i18n.t("".concat(Jt,":").concat(zt.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap"}}).then((()=>{tr=void 0})))}}var ar=Object.freeze({show:function(e){rr?rr.resolve(e):alert(e.message)}});function ir(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,o]=t,a=dr(o,r,{element:e});for(var i of(e.addEventListener(n,a),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,a]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(o)))e.$$eventListeners.push([n,null,i])}))}function sr(e){return"string"==typeof e.action}function lr(e){return"string"==typeof e.useProvider}function cr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function ur(e){return!!e.then}function dr(e,t,r){return function(n){var a,i;for(var s of[].concat(e))if(Zt(s,(0,o.Z)((0,o.Z)({},t),{},{event:n})))if(ur(s))dr(s.then,t,r)(n);else if(sr(s)){var[l,c]=s.action.split(".");switch(s.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":gr(n,c,s.args,s.callback,t);break;case"window.open":yr(n,s.args,t);break;case"location.reload":case"location.assign":kr(n,c,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Zr(n,l,c,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"console.log":case"console.error":case"console.warn":case"console.info":Ir(n,c,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Ar(n,c,s.args,t);break;case"handleHttpError":or(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":wr(n,c,s.args,null===(a=s.batch)||void 0===a||a,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":Sr(n,c,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=Pr(s.args,t,n);_e(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":Er(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Cr(n,c,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":ee("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[p]=Pr(s.args,t,n);ee(p);break;case"mode.setDashboardMode":case"mode.setDefaultMode":ie("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else lr(s)?pr(n,s,t,r):cr(s)?vr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&dr(s.else,t,r)(n)}}function pr(e,t,r,n){return fr.apply(this,arguments)}function fr(){return(fr=(0,a.Z)((function*(e,t,r,n){try{hr(e,yield qe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(Xt(e))}}))).apply(this,arguments)}function vr(e,t,r,n){var a=[],i=t.target,s=t.targetRef,l=i;if(("string"==typeof i?(0,O.isEvaluable)(i):st(i))&&(l=bt(i,(0,o.Z)((0,o.Z)({},r),{},{event:e}))),"string"==typeof l)if("_self"===l)a.push(n.element);else if(t.multiple)a=Array.from(document.querySelectorAll(l));else{var c=document.querySelector(l);null!==c&&a.push(c)}else if(l)l instanceof HTMLElement?a.push(l):console.error("unexpected target:",l);else if(s){var u=s;("string"==typeof s?(0,O.isEvaluable)(s):st(s))&&(u=bt(s,(0,o.Z)((0,o.Z)({},r),{},{event:e})));var d=[].concat(u),p=_e(r,"targetRef",": ".concat(d.join(", ")));a.push(...d.map((e=>{var t;return null===(t=p.$$getElementByRef)||void 0===t?void 0:t.call(p,e)})).filter(Boolean))}0!==a.length?function(e){return!!e.method}(t)?a.forEach((o=>{hr(e,o,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Rt(a,t.properties,(0,o.Z)((0,o.Z)({},r),{},{event:e})):console.error("target not found:",i||s)}function hr(e,t,r,n,o,a,i){return mr.apply(this,arguments)}function mr(){return mr=(0,a.Z)((function*(e,t,r,n,i,s,l){var c;if("function"==typeof t[n]){var u=function(){var o=(0,a.Z)((function*(){var o,a=Pr(r.args,i,e,l);return lr(r)&&null!=po&&null!==(o=po.flowApi)&&void 0!==o&&o.isFlowApiProvider(r.useProvider)&&(a=yield po.flowApi.getArgsOfFlowApi(r.useProvider,a,n)),t[n](...a)}));return function(){return o.apply(this,arguments)}}();if(r.callback){var d,p=Tr(r.callback,i,s),f={progress:p("progress"),success:p("success"),error:p("error"),finally:p("finally")};if(lr(r)&&(d=bt(r.poll,(0,o.Z)((0,o.Z)({},i),{},{event:e}))),null!==(c=d)&&void 0!==c&&c.enabled)!function(e,t,r){var n,{progress:o,success:i,error:s,finally:l}=t,{interval:c,leadingRequestDelay:u,continueOnError:d,delegateLoadingBar:p,expectPollEnd:f,expectPollStopImmediately:v}=r,h=wo();function m(){return g.apply(this,arguments)}function g(){return(g=(0,a.Z)((function*(){var t;Ht.delete(n);try{if(!(t=null==v?void 0:v())){var r=yield e();(t=(null==v?void 0:v())||h!==wo())||(null==o||o(r),null!=f&&f(r)?(p&&window.dispatchEvent(new Event("request.end")),null==i||i(r),null==l||l()):y(null!=c?c:3e3))}}catch(e){(t=(null==v?void 0:v())||h!==wo())||(null==s||s(e),d?y(null!=c?c:3e3):null==l||l())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function y(e){n=setTimeout(m,e),Ht.add(n)}y(null!=u?u:0),p&&window.dispatchEvent(new Event("request.start"))}(u,f,d);else try{var v=yield u();f.success(v)}catch(e){f.error(e)}finally{f.finally()}}else u()}else console.error("target has no method:",{target:t,method:n})})),mr.apply(this,arguments)}function gr(e,t,r,n,o){var a=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":a=2,i=!0;break;case"reload":i=!0;break;case"block":a=1,s="setBlockMessage"}var l=[];if(a>0&&((l=Pr(r,o,e,{useEventDetailAsDefault:!0})).length=a),i&&n){var c=Tr(n,o,void 0);l.push((e=>{c(e?"error":"success")({blocked:e}),c("finally")({blocked:e})}))}Z()[s](...l)}function yr(e,t,r){var[n,o,a]=Pr(t,r,e);window.open(n,o||"_self",a)}function br(e,t,r,n,o,a){t?n.updateValues(e,r,(e=>Pr(e,o,a)[0])):e.forEach((e=>{var{name:t,value:i}=Pr([e],o,a)[0];n.updateValue(t,i,r)}))}function wr(e,t,r,n,o,a){if(!Array.isArray(r)||!r.every(d.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=Pr(r,a,e);a.ctxStore.updateValue(i,s,t,o,a)}else br(r,n,t,a.ctxStore,a,e)}function Sr(e,t,r,n,o,a){if(Array.isArray(r)&&r.every(d.isObject)&&"update"===t)br(r,n,"replace",Re(a,"state.".concat(t),": ".concat(JSON.stringify(r))),a,e);else{var[i,s]=Pr(r,a,e);Re(a,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,o,a)}}function Er(e,t,r,n){var[o,a]=Pr(t,n,e);ze(n,"formstate.update",": ".concat(o)).updateValue(o,a,"replace",r,n)}function kr(e,t,r,n){if("assign"===t){var[o]=Pr(r,n,e);location.assign(o)}else location[t]()}function Zr(e,t,r,n,o){var a="localStorage"===t?localStorage:sessionStorage,[i,s]=Pr(n,o,e);"setItem"===r?void 0!==s&&a.setItem(i,JSON.stringify(s)):a.removeItem(i)}function Ir(e,t,r,n){console[t](...Pr(r,n,e,{useEventAsDefault:!0}))}function Ar(e,t,r,n){var o=Pr(r,n,e,{useEventAsDefault:!0});ar.show({type:t,message:o[0]})}function Cr(e,t,r,n,o,a){return Or.apply(this,arguments)}function Or(){return(Or=(0,a.Z)((function*(e,t,r,n,o,a){var i=()=>{var o,a=Pr(r,n,e);return null==po||null===(o=po.messageDispatcher)||void 0===o?void 0:o[t](...a)};if(a){var s=Tr(a,n,o);try{var l=yield i();s("success")(l)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Tr(e,t,r){return function(n){return function(o){var a=null==e?void 0:e[n];if(a)try{var i=new CustomEvent("callback.".concat(n),{detail:o});dr(a,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",o)}}}function Pr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?bt(e,(0,o.Z)((0,o.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}var Rr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class _r{constructor(e,t,r){(0,Wt.Z)(this,"type",void 0),(0,Wt.Z)(this,"data",new Map),(0,Wt.Z)(this,"changeEventType",void 0),(0,Wt.Z)(this,"pendingStack",[]),(0,Wt.Z)(this,"hostBrick",void 0),(0,Wt.Z)(this,"batchUpdate",!1),(0,Wt.Z)(this,"batchUpdateContextsNames",[]),(0,Wt.Z)(this,"rendererContext",void 0),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{var[t,{value:r}]=e;return[t,r]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}getAffectListByContext(e){var t=[e];return this.data.forEach(((e,r)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(r)&&t.push(...this.getAffectListByContext(r))})),t.shift(),[...new Set(t)]}updateValues(e,t,r){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");var n={},o={},a=[];e.forEach((e=>{var{name:o,value:i}=r([e]),s=this.data.get(o);a.push(...this.getAffectListByContext(o)),s&&(n[o]=s),this.updateValue(o,i,t)})),a.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(o[e]=t)}));var i=e=>{for(var t in e){var r,n=e[t];null===(r=n.eventTarget)||void 0===r||r.dispatchEvent(new CustomEvent(this.changeEventType,{detail:n.value}))}};i(n),i(o),this.batchUpdate=!1}updateValue(e,t,r,n,a){var i=this.data.get(e);if(!i)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?i.value=t:(0,d.isObject)(i.value)?Object.assign(i.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(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.load)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which has no resolve'));var s;if("load"===r&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading)),s||(s=i.loading=i.load((0,o.Z)({cache:"load"===r?"default":"reload"},t))).then((e=>{i.loaded=!0,i.value=e,i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}))}),(e=>{null!=n&&n.error||or(e)})),n){var l=Tr(n,a);s.then((e=>{l("success")({value:e}),l("finally")()}),(e=>{l("error")(e),l("finally")()}))}}}define(e,t,r){if(Array.isArray(e)&&e.length>0){var n=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX",n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",r=new Map;for(var n of e){var o=(0,R.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,o)}return r}(e,r),o=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var s;o.set(i,(null!==(s=o.get(i))&&void 0!==s?s:0)+1)}var l=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),c=new WeakSet,u=new Map,d=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{u.set(e,{resolve:t,reject:r})}))]))),p=function(){var e=(0,a.Z)((function*(e){var r;c.add(e);var a=yield t(e);n.delete(e);var i=null!==(r=o.get(e.name))&&void 0!==r?r:0;if(a){if(u.get(e.name).resolve(),o.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(u.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,i-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),f=l;function v(){return h.apply(this,arguments)}function h(){return h=(0,a.Z)((function*(){var e=Array.from(n.entries()).filter(function(e,t){return(r,n)=>t?0===n:![...r[1].usedProperties].some((t=>e.has(t)))}(o,f)).map((e=>e[0])).filter((e=>!c.has(e)));yield Promise.all(e.map(p))})),h.apply(this,arguments)}return{pendingResult:v().then((0,a.Z)((function*(){for(var e of(n.size>0&&(function(e,t){var r=new Map(e),n=new Set(Array.from(r.keys()).map((e=>e.name))),o=()=>{var e=!1;for(var[t,a]of r.entries())[...a.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&o()};if(o(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),f=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:d}}(e,(e=>this.resolve(e,t,r)),this.type);this.pendingStack.push(n)}}onChange(e,t){var r;null===(r=this.data.get(e))||void 0===r||r.eventTarget.addEventListener(this.changeEventType,t)}waitFor(e){var t=this;return(0,a.Z)((function*(){var r=function*(t){yield Promise.all([...e].map((e=>t.get(e))))};for(var{pendingContexts:n}of t.pendingStack)yield*r(n)}))()}waitForAll(){var e=this;return(0,a.Z)((function*(){for(var{pendingResult:t}of e.pendingStack)yield t}))()}handleAsyncAfterMount(){this.data.forEach((e=>{e.async&&e.loading.then((t=>{e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t}))}))}))}resolve(e,t,r){var n=this;return(0,a.Z)((function*(){if(!(yield Et(e,t)))return!1;var i,s,l;r&&("STATE"===n.type?e.expose:"FORM_STATE"===n.type)&&(0,d.hasOwnProperty)(r,e.name)&&(i=yield r[e.name]);var c="eager";if(void 0===i){if(e.resolve){var u=(0,o.Z)({transform:"value"},e.resolve);if(yield Et(e.resolve,t))s=function(){var e=(0,a.Z)((function*(e){return(yield tt(u,t,e)).value}));return function(t){return e.apply(this,arguments)}}(),"eager"==(c=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?i=yield s():"async"===c&&(l=s());else if(!(0,d.hasOwnProperty)(e,"value"))return!1}s&&"eager"===c||void 0===e.value||(i=yield gt(e.value,t))}var p={value:i,eventTarget:new EventTarget,load:s,loaded:"eager"===c,loading:l,async:"async"===c,deps:[]};if("lazy"===c){var f,{trigger:v}=e.resolve;v&&Rr.includes(v)&&(null===(f=n.rendererContext)||void 0===f||f.registerArbitraryLifeCycle(v,(()=>{n.updateValue(e.name,void 0,"load")})))}if(e.onChange&&p.eventTarget.addEventListener(n.changeEventType,dr(e.onChange,t)),e.track){var h=(0,R.strictCollectMemberUsage)(s?e.resolve:e.value,n.type);for(var m of(!s&&(p.deps=[...h]),h))n.onChange(m,n.batchAddListener((()=>{s?n.updateValue(e.name,{cache:"default"},"refresh"):n.updateValue(e.name,bt(e.value,t),"replace")}),e))}if(n.data.has(e.name))throw new Error("".concat(n.type," '").concat(e.name,"' has already been declared"));return n.data.set(e.name,p),!0}))()}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}function Mr(e,t,r){var n,{reversedProxies:o,asyncHostProperties:i,externalSlots:s,tplStateStoreId:l,hostBrick:c}=e;if(t&&o){var u=o.properties.get(t);if(u){var p=function(){var e=(0,a.Z)((function*(e){var t={};for(var{from:r,to:n}of u)if((0,d.hasOwnProperty)(e,r)&&n.refProperty){var o=yield e[r];void 0!==o&&(t[n.refProperty]=o)}return t}));return function(t){return e.apply(this,arguments)}}();n=p(i)}var f=o.slots.get(t);if(f&&s){var v=new Map;for(var{from:h,to:g}of f){var y,b,w,S,E=null!==(y=null===(b=s[h])||void 0===b?void 0:b.bricks)&&void 0!==y?y:[];if(E.length){var k=null!==(w=g.refSlot)&&void 0!==w?w:h,Z=v.get(k);if(!Z){Z=[];for(var I=(0,d.hasOwnProperty)(r,k)?r[k].bricks.length+1:1,A=0;A<I;A+=1)Z.push([]);v.set(k,Z)}var C=null!==(S=g.refPosition)&&void 0!==S?S:-1;Z[(0,m.clamp)(C<0?Z.length+C:C,0,Z.length-1)].push(...(0,d.hasOwnProperty)(c.runtimeContext,"forEachItem")?xr(E,c.runtimeContext.forEachItem):E)}}var O=function(){(0,d.hasOwnProperty)(r,T)||(r[T]={type:"bricks",bricks:[]});var e=r[T];e.bricks=P.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[T]};for(var[T,P]of v.entries())O()}}return{[Kt]:n,[Dt]:l}}function xr(e,t){return e.map((e=>{var r;return(0,o.Z)((0,o.Z)({},e),{},{[Vt]:t,slots:Object.fromEntries(Object.entries(null!==(r=e.slots)&&void 0!==r?r:{}).map((e=>{var r,[n,o]=e;return[n,"routes"===o.type?{type:"routes",routes:Br(o.routes,t)}:{type:"bricks",bricks:xr(null!==(r=o.bricks)&&void 0!==r?r:[],t)}]})))})}))}function Br(e,t){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,o.Z)((0,o.Z)({},e),{},{bricks:xr(e.bricks,t)})))}var Lr=["properties","slots","children"];function Ur(e,t){function r(e){return(0,d.isObject)(e)?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,o]=e;return(0,d.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.map(n)]:[t,n(o)]:[t,r(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:a,slots:i,children:s}=e,l=(0,h.Z)(e,Lr),c=sn(s,i),u=Object.fromEntries(Object.entries(null!=c?c:{}).map((e=>{var t,[r,o]=e;return[r,{type:"bricks",bricks:(null!==(t=o.bricks)&&void 0!==t?t:[]).map(n)}]})));return(0,o.Z)((0,o.Z)({},l),{},{properties:r(a),slots:u},Mr(t,l.ref,u))}return r(e)}var Nr=["slots","children"],Fr=["properties","slots","children"];function jr(e,t,r,n,a){var i,s=(0,m.uniqueId)("tpl-state-"),l=(0,o.Z)((0,o.Z)({},r.runtimeContext),{},{tplStateStoreId:s});delete l.forEachItem,delete l.formStateStoreId;var c=new _r("STATE",r,a);l.tplStateStoreMap.set(s,c),l.tplStateStoreScope&&l.tplStateStoreScope.push(c);var{bricks:u,proxy:d,state:p,contracts:f}=Pe.get(e);null==po||null===(i=po.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(p,l,n);var{slots:v,children:g}=t,y=(0,h.Z)(t,Nr),b=(0,o.Z)((0,o.Z)({},y),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var w={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[S,E]of Object.entries(d.properties)){var k=w.properties.get(E.ref);k||(k=[],w.properties.set(E.ref,k)),k.push({from:S,to:E})}if(null!=d&&d.slots)for(var[Z,I]of Object.entries(d.slots)){var A=w.slots.get(I.ref);A||(A=[],w.slots.set(I.ref,A)),A.push({from:Z,to:I})}var C={reversedProxies:w,asyncHostProperties:n,externalSlots:sn(g,v),tplStateStoreId:s,hostBrick:r};return b.slots={"":{type:"bricks",bricks:u.map((e=>$r(e,C)))}},b}function $r(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:a}=e,i=(0,h.Z)(e,Fr),s=sn(a,n),l=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var r,[n,o]=e;return[n,{type:"bricks",bricks:(null!==(r=o.bricks)&&void 0!==r?r:[]).map((e=>$r(e,t)))}]})));return(0,o.Z)((0,o.Z)({},i),{},{properties:Ur(r,t),slots:l},Mr(t,i.ref,l))}var Kr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e}({}),Dr="form-renderer.form-renderer",Vr=Symbol.for("form.stateStoreId"),Wr=["forms.general-form","form.general-form","eo-form"];function Hr(e,t,r){var{id:n,bricks:a,events:i,context:s,mountPoint:l,instanceId:c}=e,{brick:u,properties:p}=e,f=t.find((e=>e.fieldId===n));if(f){var v=function(e){var t,r={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},n=()=>{var t,r;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(r=e.limit)||void 0===r?void 0:r.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,o.Z)((0,o.Z)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUMS":t={brick:"forms.general-select",properties:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{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:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{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:(0,o.Z)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,o.Z)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,o.Z)((0,o.Z)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,o.Z)((0,o.Z)((0,o.Z)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=v.brick),p=(0,o.Z)((0,o.Z)({},v.properties),p)}var h={brick:u,properties:p,iid:c,slot:l,events:i,context:s,children:zr(a,t,r),[Vr]:r};return(0,d.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function zr(e,t,r){if(Array.isArray(e))return e.map((e=>Hr(e,t,r)))}var Gr=["blockingList","node","menuRequests","hasTrackingControls"],qr=["if","permissionsPreCheck"],Jr=["formData"];function Qr(e,t,r,n,o){return Yr.apply(this,arguments)}function Yr(){return Yr=(0,a.Z)((function*(e,t,r,n,a){var i=yield function(e,t){return jt.apply(this,arguments)}(t,r),s={blockingList:[],menuRequests:[]};switch(i){case"missed":break;case"unauthenticated":s.unauthenticated=!0;break;default:var l,c=s.route=i.route,d=(0,o.Z)((0,o.Z)({},r),{},{match:i.match});d.ctxStore.define(c.context,d),d.pendingPermissionsPreCheck.push(null==po||null===(l=po.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(c,(e=>gt(e,d))));var{preLoadBricks:p}=c;switch(Array.isArray(p)&&s.blockingList.push((0,u.loadBricksImperatively)(p,bo())),c.type){case"redirect":var f;if("string"!=typeof(f="string"==typeof c.redirect?yield gt(c.redirect,d):(yield tt((0,o.Z)({transform:"redirect"},c.redirect),d)).redirect))throw console.error("Unexpected redirect result:",f),new Error("Unexpected type of redirect result: ".concat(typeof f));s.redirect={path:f};break;case"routes":s.menuRequests.push(on(c.menu,d)),an(s,yield Qr(e,c.routes,d,n,a));break;default:s.menuRequests.push(on(c.menu,d)),an(s,yield Xr(e,c.bricks,d,n,a))}}return s})),Yr.apply(this,arguments)}function Xr(e,t,r,n,o,a,i){return en.apply(this,arguments)}function en(){return(en=(0,a.Z)((function*(e,t,r,n,o,a,i){var s={blockingList:[],menuRequests:[]};return(yield Promise.all(t.map(((t,i)=>tn(e,t,r,n,o,i,a&&new Map(a)))))).forEach(((t,r)=>{!i&&t.hasTrackingControls&&n.memoizeControlNode(o,r,t.node,e),an(s,t)})),s}))).apply(this,arguments)}function tn(e,t,r,n,o,a){return rn.apply(this,arguments)}function rn(){return rn=(0,a.Z)((function*(e,t,r,n,i,s){var l,c,p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:new Map,f={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),f;var{if:v,permissionsPreCheck:g}=t,y=(0,h.Z)(t,qr);if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):st(e)&&(0,O.isTrackAll)(lt(e))}(v))return tn(e,(0,o.Z)({brick:":if",dataSource:v,permissionsPreCheck:g,slots:{"":{type:"bricks",bricks:[y]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,o.Z)((0,o.Z)({},e),{},{[r]:t[r]})),{})),r,n,i,s,p);var b=t[Dt],w=t[Vr],S=(0,o.Z)((0,o.Z)({},r),{},{tplStateStoreId:b,formStateStoreId:w});(0,d.hasOwnProperty)(t,Vt)&&(S.forEachItem=t[Vt]);var{context:E}=t;if(Array.isArray(E)&&E.length>0){var k=Ae(S);Ce(k,"Defining context on bricks","check your brick:",t),k||S.ctxStore.define(E,S)}if(S.pendingPermissionsPreCheck.push(null==po||null===(l=po.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>gt(e,S)))),!(yield function(e,t){return At.apply(this,arguments)}(t,S)))return f;var Z=t.brick;if(Z.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(Z);var{dataSource:I}=t,A=function(){var r=(0,a.Z)((function*(){var r,o=yield gt(I,S),a=":forEach"===Z?"":":switch"===Z?String(o):o?"":"else",s=sn(t.children,t.slots),l=s&&(0,d.hasOwnProperty)(s,a)&&(null===(r=s[a])||void 0===r?void 0:r.bricks);if(!Array.isArray(l))return f;switch(Z){case":forEach":return Array.isArray(o)?function(e,t,r,n,o,a,i){return nn.apply(this,arguments)}(e,o,l,S,n,i,p):f;case":if":case":switch":return Xr(e,l,S,n,i,p,!0)}}));return function(){return r.apply(this,arguments)}}(),C=yield A(),{contextNames:T,stateNames:P}=Ot(I);if(T||P){C.hasTrackingControls=!0;var R=0,_=function(){var t=(0,a.Z)((function*(){var t=++R,r=yield A();r.blockingList.push(...[...S.tplStateStoreMap.values(),...S.formStateStoreMap.values()].map((e=>e.waitForAll())),...S.pendingPermissionsPreCheck),yield Promise.all(r.blockingList),R===t&&n.rerenderControlNode(i,s,r.node,e)}));return function(){return t.apply(this,arguments)}}(),M=(0,m.debounce)(_);if(T)for(var x of T)S.ctxStore.onChange(x,M);if(P)for(var B of P)Re(S,"STATE",': "'.concat(I,'"')).onChange(B,M)}return C}/\.tpl-/.test(Z)&&!Pe.get(Z)&&(yield ln((0,u.loadBricksImperatively)([Z],bo()),Z,n.unknownBricks));var L=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(Pe.get(r))return r}return!!Pe.get(e)&&e}(Z,null===(c=S.app)||void 0===c?void 0:c.id);if(L){var U,N=null!==(U=p.get(L))&&void 0!==U?U:0;if(N>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(L,'"'));p.set(L,N+1)}else Z.includes("-")&&!customElements.get(Z)&&(Z===Dr?customElements.define(Dr,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):f.blockingList.push(ln((0,u.enqueueStableLoadBricks)([Z],bo()),Z,n.unknownBricks)));var F,j,$={tag:Kr.BRICK,type:L||Z,return:e,slotId:i,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};if(f.node=$,Z===Dr){var K,D=null!==(K=t.properties)&&void 0!==K?K:{};({formData:F}=D),j=(0,h.Z)(D,Jr)}else j=t.properties;var V=[],W=[],H=function(e,t,r){return(0,d.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[n,o]=e,{contextNames:a,stateNames:i,formStateNames:s}=Ot(o);return(a||i||s)&&r.push({contextNames:a,stateNames:i,formStateNames:s,propName:n,propValue:o}),[n,gt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?vt.USE_BRICK:vt.INITIAL})]}))):{}}(j,S,W),z=function(){var e=(0,a.Z)((function*(){$.properties=yield function(e){return Tt.apply(this,arguments)}(H);var e=t[Kt];if(e){var r=yield e;for(var[n,o]of Object.entries(r))$.properties[n]=o}return function(e,t){var r=function(t){var r=()=>{e.element&&Rt(e.element,{[t.propName]:t.propValue},e.runtimeContext)};if(t.contextNames)for(var n of t.contextNames)e.runtimeContext.ctxStore.onChange(n,r);if(t.stateNames){var o=Re(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var a of t.stateNames)o.onChange(a,r)}if(t.formStateNames){var i=ze(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)i.onChange(s,r)}};for(var n of t)r(n)}($,W),$.properties}));return function(){return e.apply(this,arguments)}}();V.push(z()),n.registerBrickLifeCycle($,t.lifeCycle);var G,q=t;L?q=jr(L,t,$,H,n):Z===Dr&&(q=function(e,t,r,n,a){var i,s,l="string"==typeof e?JSON.parse(e):e,c=(0,m.uniqueId)("form-state-"),u=(0,o.Z)((0,o.Z)({},r.runtimeContext),{},{formStateStoreId:c});delete u.forEachItem,delete u.tplStateStoreId;var p=new _r("FORM_STATE",void 0,a);u.formStateStoreMap.set(c,p),u.formStateStoreScope&&u.formStateStoreScope.push(p);var f=null!==(i=l.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),p.define(f,u,n);var v=Hr(l.formSchema,l.fields,c);return Wr.includes(v.brick)&&t.events&&(v.events=function(e,t){var r=null!=e?e:{};for(var[n,o]of Object.entries(t))r[n]=(0,d.hasOwnProperty)(r,n)?[r[n],o].flat():o;return r}(v.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,o.Z)((0,o.Z)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[v]}]}):(0,o.Z)((0,o.Z)({},t),{},{slots:void 0,children:[v]})}(F,t,$,H,n)),q.portal&&($.slotId=void 0),L?delete(G=(0,o.Z)({},S)).forEachItem:G=S;var J=function(){var e=(0,a.Z)((function*(){var e=sn(q.children,q.slots);if(e){var t=yield Promise.all(Object.entries(e).map((e=>{var[t,r]=e;return"routes"!==r.type?Xr($,r.bricks,G,n,t,p):Qr($,r.routes,G,n,t)}))),r=(0,o.Z)((0,o.Z)({},f),{},{node:void 0,blockingList:[]});for(var a of t)an(r,a);r.node&&($.child=r.node),an(f,(0,o.Z)((0,o.Z)({},r),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return V.push(J()),yield Promise.all(V),f})),rn.apply(this,arguments)}function nn(){return(nn=(0,a.Z)((function*(e,t,r,n,a,i,s){var l={blockingList:[],menuRequests:[]},c=yield Promise.all(t.map(((t,l)=>Promise.all(r.map(((r,c)=>tn(e,r,(0,o.Z)((0,o.Z)({},n),{},{forEachItem:t}),a,i,l*c,s&&new Map(s))))))));for(var u of c.flat())an(l,u);return l}))).apply(this,arguments)}function on(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 gt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}function an(e,t){var{blockingList:r,node:n,menuRequests:o,hasTrackingControls:a}=t,i=(0,h.Z)(t,Gr);if(e.blockingList.push(...r),e.menuRequests.push(...o),n)if(e.node){for(var s=e.node;s.sibling;)s=s.sibling;s.sibling=n}else e.node=n;Object.assign(e,i)}function sn(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var o,a=null!==(o=n.slot)&&void 0!==o?o:"";(0,d.hasOwnProperty)(r,a)||(r[a]={type:"bricks",bricks:[]}),r[a].bricks.push(n)}return r}function ln(e,t,r){return"silent"===r?e.catch((e=>{console.error('Load brick "'.concat(t,'" failed:'),e)})):e}function cn(e){var t,{ref:r,runtimeContext:n,element:o}=e;if(r&&n.tplStateStoreId){var{hostBrick:a}=Re(n,"bindTemplateProxy"),i=a.tplHostMetadata;i.internalBricksByRef.set(r,e);var s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s){var l=function(e){if(u.ref===r){var t,n,i,s=t=>{t.bubbles&&t.stopPropagation(),a.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},l=null!==(t=u.refEvent)&&void 0!==t?t:e;o.addEventListener(l,s),null!==(i=(n=o).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),o.$$proxyListeners.push([l,s])}};for(var[c,u]of Object.entries(s))l(c)}}}function un(e){var{ref:t,runtimeContext:r,element:n}=e;if(r.tplStateStoreId&&t){var{hostBrick:o}=Re(r,"unbindTemplateProxy"),a=o.tplHostMetadata;for(var[i,s]of(a.internalBricksByRef.delete(t),null!==(l=n.$$proxyListeners)&&void 0!==l?l:[])){var l;n.removeEventListener(i,s)}delete n.$$proxyListeners}}function dn(e){e.replaceChildren()}function pn(e,t){for(var r=e.child,n=[];r;){var o,a=r.type;a.includes("-")&&!customElements.get(a)&&console.error("Undefined custom element: ".concat(a)),"basic-bricks.script-brick"===a&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var i=t&&r===e.child?t:document.createElement(a);if(r.element=i,r.slotId&&i.setAttribute("slot",r.slotId),r.iid&&(i.dataset.iid=r.iid),null!==(o=r.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(i.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),Pt(i,r.properties),ir(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=Re({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),cn(r),r.portal?n.push(i):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(i)),r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var s,l=r.return;l;){var c;if(l.childElements)l.tag===Kr.ROOT?null===(c=l.container)||void 0===c||c.append(...l.childElements):l.element.append(...l.childElements),l.childElements=void 0;if(l.tag===Kr.ROOT&&n.length>0&&("function"==typeof l.createPortal?l.createPortal():l.createPortal).append(...n),l.sibling)break;l=l.return}r=null===(s=l)||void 0===s?void 0:s.sibling}}}var fn,vn,hn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],mn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],gn=new WeakMap,yn=new WeakMap,bn=new WeakMap,wn=new WeakMap,Sn=new WeakMap,En=new WeakSet,kn=new WeakSet,Zn=new WeakSet,In=new WeakSet;class An{constructor(e,t){var r;(0,I.Z)(this,In),(0,I.Z)(this,Zn),(0,I.Z)(this,kn),(0,I.Z)(this,En),(0,Wt.Z)(this,"scope",void 0),(0,Wt.Z)(this,"unknownBricks",void 0),(0,i.Z)(this,gn,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,i.Z)(this,yn,{writable:!0,value:new Map}),(0,i.Z)(this,bn,{writable:!0,value:void 0}),(0,i.Z)(this,wn,{writable:!0,value:new Map}),(0,i.Z)(this,Sn,{writable:!0,value:void 0}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw"}registerBrickLifeCycle(e,t){if(t){var r=[...hn,..."page"===this.scope?mn:[]];for(var n of r){var o=t[n];o&&(0,l.Z)(this,gn)[n].push({brick:e,handlers:o})}(0,m.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,l.Z)(this,wn).get(e);r?r.add(t):(0,l.Z)(this,wn).set(e,new Set([t]))}memoizeControlNode(e,t,r,n){(0,l.Z)(this,Sn)||(0,s.Z)(this,Sn,new WeakMap);var o="".concat(null!=e?e:"",".").concat(t),a=(0,l.Z)(this,Sn).get(n);a||(a=new Map,(0,l.Z)(this,Sn).set(n,a)),a.set(o,{node:r,last:Rn(r),lastNormal:_n(r),lastPortal:Mn(r)})}rerenderControlNode(e,t,r,n){var o,a,i,s,c,u="".concat(null!=e?e:"",".").concat(t),d=(0,l.Z)(this,Sn).get(n).get(u),{node:p,last:f,lastNormal:v,lastPortal:h}=d,m=null!==(o=null==v||null===(a=v.element)||void 0===a?void 0:a.nextSibling)&&void 0!==o?o:null,g=null!==(i=null==h||null===(s=h.element)||void 0===s?void 0:s.nextSibling)&&void 0!==i?i:null,y=Rn(r);d.node=r,d.last=y,d.lastNormal=_n(r),d.lastPortal=Mn(r);for(var b=n.child;b&&b!==f;){if(b.sibling===p){c=b;break}b=b.sibling}var w=document.createDocumentFragment(),S=document.createDocumentFragment(),E={tag:Kr.ROOT,container:w,createPortal:S,child:r};for(b=r;b;)b.return=E,b=b.sibling;var k,Z,I=xn(p,f);for((0,A.Z)(this,En,Cn).call(this,I),pn(E),c?c.sibling=r:n.child=r,y&&(y.sibling=null==f?void 0:f.sibling),b=r;b;)b.return=n,b=b.sibling;if(n.tag===Kr.ROOT?null===(k=n.container)||void 0===k||k.insertBefore(w,m):null===(Z=n.element)||void 0===Z||Z.insertBefore(w,m),S.childNodes.length>0){for(var C,O=r;O&&O.return;)O=O.return;if((null===(C=O)||void 0===C?void 0:C.tag)!==Kr.ROOT)throw new Error("Cannot find render root node");("function"==typeof O.createPortal?O.createPortal():O.createPortal).insertBefore(S,g)}var T=xn(r,y);(0,A.Z)(this,kn,On).call(this,T)}dispose(){for(var e of Object.values((0,l.Z)(this,gn)))e.length=0;for(var t of(0,l.Z)(this,yn).values()){for(var r of t)r.disconnect();t.length=0}(0,l.Z)(this,yn).clear(),(0,l.Z)(this,bn)&&(we.removeEventListener("change",(0,l.Z)(this,bn)),(0,s.Z)(this,bn,void 0)),(0,s.Z)(this,Sn,void 0),(0,l.Z)(this,wn).clear()}dispatchBeforePageLoad(){(0,A.Z)(this,Zn,Tn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,A.Z)(this,Zn,Tn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,A.Z)(this,Zn,Tn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,A.Z)(this,Zn,Tn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=Z().location;e&&"#"!==e?(0,A.Z)(this,Zn,Tn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,A.Z)(this,Zn,Tn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,l.Z)(this,gn).onScrollIntoView)(0,A.Z)(this,In,Pn).call(this,e,t)}initializeMediaChange(){(0,s.Z)(this,bn,(e=>{(0,A.Z)(this,Zn,Tn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:H(e.detail)}))})),we.addEventListener("change",(0,l.Z)(this,bn))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==po||null===(r=po.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{dr(t.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:r}))}))};for(var r of[].concat(n))t(r)};for(var{brick:r,handlers:n}of(0,l.Z)(this,gn).onMessage)t(r);null==po||null===(e=po.messageDispatcher)||void 0===e||e.onClose((()=>{(0,A.Z)(this,Zn,Tn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,A.Z)(this,Zn,Tn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,A.Z)(this,Zn,Tn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Cn(e){var t=[...hn,..."page"===this.scope?mn:[]],r=[];for(var n of t){var o=(0,m.remove)((0,l.Z)(this,gn)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...o)}for(var a of e){var i,s,c=(0,l.Z)(this,yn).get(a);if(null!=c&&c.length){for(var u of c)u.disconnect();c.length=0,(0,l.Z)(this,yn).delete(a)}un(a),null===(i=a.element)||void 0===i||delete i.$$tplStateStore,null===(s=a.element)||void 0===s||s.remove()}var d=new CustomEvent("unmount");for(var{brick:p,handlers:f}of r)dr(f,p.runtimeContext,p)(d)}function On(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,l.Z)(this,gn).onMount)e.has(r)&&dr(n,r.runtimeContext,r)(t);for(var{brick:o,handlers:a}of(0,l.Z)(this,gn).onScrollIntoView)e.has(o)&&(0,A.Z)(this,In,Pn).call(this,o,a)}function Tn(e,t){for(var{brick:r,handlers:n}of(0,l.Z)(this,gn)[e])dr(n,r.runtimeContext,r)(t);var o=(0,l.Z)(this,wn).get(e);if(o)for(var a of o)a()}function Pn(e,t){var r,n=null!==(r=t.threshold)&&void 0!==r?r:.1,o=new IntersectionObserver(((r,o)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(dr(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:n});o.observe(e.element);var a=(0,l.Z)(this,yn).get(e);a||(a=[],(0,l.Z)(this,yn).set(e,a)),a.push(o)}function Rn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function _n(e){for(var t,r=e;r;)r.portal||(t=r),r=r.sibling;return t}function Mn(e){for(var t,r=e;r;)if(r.portal&&(t=r),r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var n,o=r.return;o&&!o.sibling;)o=o.return;r=null===(n=o)||void 0===n?void 0:n.sibling}return t}function xn(e,t){for(var r=new Set,n=e;n;)if(r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var o,a=n.return;a&&a!==t&&!a.sibling;)a=a.return;if(a===t)break;n=null===(o=a)||void 0===o?void 0:o.sibling}}return r}function Bn(){if(!fn){if(fn={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){fn.isInIframe=!0;try{if(window.origin===window.parent.origin){fn.isInIframeOfSameSite=!0;var e="/next/"===v(),t=window.parent.location.pathname,r=t.startsWith("/next/");fn.isInIframeOfNext=0==(Number(e)^Number(r)),fn.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),fn.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(fn)}return fn}function Ln(e){var t;if(!e.$$registerCustomTemplateProcessed){e.$$registerCustomTemplateProcessed=!0;var r=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(r))for(var n of r){var o=n.name.includes(".")?n.name:"".concat(e.app.id,".").concat(n.name);Pe.define(o,n)}}}function Un(){return Un=(0,a.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return Nn.apply(this,arguments)}(e)),e.$$fulfilling})),Un.apply(this,arguments)}function Nn(){return(Nn=(0,a.Z)((function*(e){var t;yield null==po||null===(t=po.fulfilStoryboard)||void 0===t?void 0:t.call(po,e),x(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}var Fn=new WeakMap,jn=new WeakMap,$n=new WeakMap,Kn=new WeakMap,Dn=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,Hn=new WeakMap,zn=new WeakMap,Gn=new WeakMap,qn=new WeakMap,Jn=new WeakMap,Qn=new WeakSet,Yn=new WeakSet,Xn=new WeakSet,eo=new WeakSet;class to{constructor(e){(0,I.Z)(this,eo),(0,I.Z)(this,Xn),(0,I.Z)(this,Yn),(0,I.Z)(this,Qn),(0,i.Z)(this,Fn,{writable:!0,value:void 0}),(0,i.Z)(this,jn,{writable:!0,value:!1}),(0,i.Z)(this,$n,{writable:!0,value:void 0}),(0,i.Z)(this,Kn,{writable:!0,value:void 0}),(0,i.Z)(this,Dn,{writable:!0,value:void 0}),(0,i.Z)(this,Vn,{writable:!0,value:void 0}),(0,i.Z)(this,Wn,{writable:!0,value:new Set}),(0,i.Z)(this,Hn,{writable:!0,value:0}),(0,i.Z)(this,zn,{writable:!0,value:void 0}),(0,i.Z)(this,Gn,{writable:!0,value:void 0}),(0,i.Z)(this,qn,{writable:!0,value:void 0}),(0,i.Z)(this,Jn,{writable:!0,value:void 0}),(0,s.Z)(this,Fn,e);var t=Z();window.addEventListener("beforeunload",(e=>{(0,A.Z)(this,Qn,ro).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,A.Z)(this,Qn,ro).call(this,{location:e,action:t})))}getRenderId(){return(0,l.Z)(this,zn)}getRuntimeContext(){return(0,l.Z)(this,Dn)}getRecentApps(){return{currentApp:(0,l.Z)(this,Gn),previousApp:(0,l.Z)(this,qn)}}getNavConfig(){return(0,l.Z)(this,Jn)}bootstrap(){window.AbortController&&(vn=new AbortController,C.http.interceptors.request.use((e=>{var t;return(0,o.Z)((0,o.Z)({},e),{},{options:(0,o.Z)((0,o.Z)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:vn.signal})})})));var e=Z();return(0,s.Z)(this,$n,e.location),e.listen(((e,t)=>{var r,n,a,i=!1,c={hash:void 0,state:void 0};if(void 0!==e.key&&("POP"!==t||void 0!==(0,l.Z)(this,$n).key&&!1!==(null===(r=(0,l.Z)(this,$n).state)||void 0===r?void 0:r.notify))||(c.key=void 0),((0,f.locationsAreEqual)((0,o.Z)((0,o.Z)({},(0,l.Z)(this,$n)),c),(0,o.Z)((0,o.Z)({},e),c))||"POP"!==t&&!1===(null===(n=e.state)||void 0===n?void 0:n.notify))&&(i=!0),i)(0,s.Z)(this,$n,e);else{if(vn&&(vn.abort(),vn=new AbortController),(0,s.Z)(this,$n,e),null===(a=(0,l.Z)(this,Vn))||void 0===a||a.dispatchPageLeave(),"POP"===t&&y(g((0,l.Z)(this,Fn),e.pathname)))return void window.location.reload();(0,l.Z)(this,jn)?(0,s.Z)(this,Kn,e):(0,A.Z)(this,Xn,oo).call(this,e).catch(or)}})),(0,A.Z)(this,Xn,oo).call(this,e.location)}}function ro(e){var t,r=Z(),n=r.getBlockMessage();null===(t=(0,l.Z)(this,Vn))||void 0===t||t.dispatchBeforePageLeave(e);var o=r.getBlockMessage();return!n&&o&&r.unblock(),o}function no(e,t,r){var n,o;if((0,s.Z)(this,Hn,(n=(0,l.Z)(this,Hn),o=n++,n)),o>10){var a='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(a)}Z().replace(e,t)}function oo(e){return ao.apply(this,arguments)}function ao(){return(ao=(0,a.Z)((function*(e){(0,s.Z)(this,jn,!0);try{yield(0,A.Z)(this,eo,io).call(this,e)}finally{if((0,s.Z)(this,jn,!1),(0,l.Z)(this,Kn)){var t=(0,l.Z)(this,Kn);(0,s.Z)(this,Kn,void 0),yield(0,A.Z)(this,Xn,oo).call(this,t)}}}))).apply(this,arguments)}function io(e){return so.apply(this,arguments)}function so(){return so=(0,a.Z)((function*(e){var t,r;(0,s.Z)(this,zn,(0,m.uniqueId)("render-id-1")),Qe=new WeakSet,et.clear(),null==po||null===(t=po.flowApi)||void 0===t||t.clearCollectWidgetContract(),Z().unblock();var n=g((0,l.Z)(this,Fn),e.pathname),a=null===(r=(0,l.Z)(this,Dn))||void 0===r?void 0:r.app;null!=n&&n.app&&(yield function(e){return Un.apply(this,arguments)}(n));var i=(0,s.Z)(this,Gn,null==n?void 0:n.app),c=a&&i?a.id!==i.id:a!==i,d=ho().getFeatureFlags(),p=(0,l.Z)(this,Vn),f=(t,r)=>{(0,l.Z)(this,Wn).add(p),(0,A.Z)(this,Yn,no).call(this,t,r,e)},v=()=>{var t=d["sso-enabled"]?"/sso-auth/login":"/auth/login";f(t,{from:e})},h=document.querySelector("#main-mount-point"),y=document.querySelector("#portal-mount-point"),b={tag:Kr.ROOT,container:h,createPortal:y},w=()=>{var e;for(var t of(dn(h),dn(y),(0,l.Z)(this,Wn).add(p),(0,l.Z)(this,Wn)))t&&(t.dispatchOnUnmount(),t.dispose());(0,l.Z)(this,Wn).clear(),null==po||null===(e=po.messageDispatcher)||void 0===e||e.reset(),c&&((0,s.Z)(this,qn,a),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:a,currentApp:i}})))};if(Q(i&&(re()[i.id]||i.theme)||"light"),oe("default"),i){var S,E,k,I,O,T;null==po||null===(S=po.checkInstalledApps)||void 0===S||S.preCheckInstalledApps(n,(e=>!!ko(e)));var P=(0,s.Z)(this,Vn,new An("page")),R=(0,s.Z)(this,Dn,{app:i,location:e,query:new URLSearchParams(e.search),flags:d,sys:(0,o.Z)((0,o.Z)((0,o.Z)({},null==po||null===(E=po.auth)||void 0===E?void 0:E.getAuth()),Bn()),{},{settings:{brand:ho().getBrandSettings()}}),ctxStore:new _r("CTX",void 0,P),pendingPermissionsPreCheck:[null==po||null===(k=po.checkPermissions)||void 0===k?void 0:k.preCheckPermissions(n)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.Z)(this,Jn,void 0),Ln(n),ve(null===(I=n.meta)||void 0===I?void 0:I.functions,i),null==po||null===(O=po.flowApi)||void 0===O||O.collectContract(null===(T=n.meta)||void 0===T?void 0:T.contracts);var _,M=!1,x=[];try{if((_=yield Qr(b,function(e){if(window.parent===window)return e;var t=e,r=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)];var n=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)]}(n.routes),R,P)).unauthenticated)return void v();if(_.redirect)return void f(_.redirect.path,_.redirect.state);(0,s.Z)(this,Hn,0),(0,u.flushStableLoadBricks)(),x=[R.ctxStore,...R.tplStateStoreMap.values(),...R.formStateStoreMap.values()],yield Promise.all([..._.blockingList,...x.map((e=>e.waitForAll())),...R.pendingPermissionsPreCheck]);var B=yield Promise.all(_.menuRequests);(0,s.Z)(this,Jn,function(e){var t={breadcrumb:[]};for(var r of e)if(r){var{breadcrumb:n}=r;n&&(n.overwrite?t.breadcrumb=n.items:t.breadcrumb.push(...n.items))}return t}(B))}catch(e){if(console.error("Router failed:",e),er(e)&&!window.NO_AUTH_GUARD)return void v();if(e instanceof C.HttpAbortError)return void(0,l.Z)(this,Wn).add(p);M=!0,_={node:{tag:Kr.BRICK,type:"div",properties:{textContent:Xt(e)},runtimeContext:null,return:b},blockingList:[],menuRequests:[]}}if(b.child=_.node,w(),_.route&&"routes"!==_.route.type||M){if(M||P.dispatchBeforePageLoad(),ee(),ie(),pn(b),window.scrollTo(0,0),!M){for(var L of x)L.handleAsyncAfterMount();P.dispatchPageLoad(),P.dispatchAnchorLoad(),P.dispatchOnMount(),P.initializeScrollIntoView(),P.initializeMediaChange(),P.initializeMessageDispatcher()}return}}else{if(!window.NO_AUTH_GUARD&&null!=po&&po.auth&&!po.auth.isLoggedIn())return void v();w()}ee(),ie();var U={tag:Kr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:b};b.child=U,pn(b),window.scrollTo(0,0)})),so.apply(this,arguments)}var lo,co,uo,po,fo="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function vo(e){if(lo)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===F){var r=t.payload;switch(null==r?void 0:r.type){case j:K=r.active;break;case $:N=r.panel}}})),po=null==e?void 0:e.hooks,(0,c.initializeI18n)(Jt,Qt),p.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{p.locale(c.i18n.language)})),k(),lo=new yo}function ho(){return lo}var mo=new WeakMap,go=new WeakMap;class yo{constructor(){(0,i.Z)(this,mo,{writable:!0,value:!1}),(0,i.Z)(this,go,{writable:!0,value:!1})}initialize(e){var t,r;if((0,l.Z)(this,mo))throw new Error("The runtime cannot be initialized more than once");(0,s.Z)(this,mo,!0),function(e){if(Array.isArray(e.storyboards)){var t=function(){if(r.locales){var e="tmp/".concat(r.id);Object.entries(r.locales).forEach((t=>{var[r,n]=t;c.i18n.addResourceBundle(r,e,n)})),r.localeName=c.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{c.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,d.isObject)(e.settings)&&(0,d.deepFreeze)(e.settings),e.brickPackages&&(0,d.deepFreeze)(e.brickPackages)}(e),co=e;var n,{notification:o,dialog:a}=null!==(t=null===(r=e.settings)||void 0===r?void 0:r.presetBricks)&&void 0!==t?t:{};!1!==o&&(n=null!=o?o:"basic.show-notification",(0,this.loadBricks)([n]).then((()=>{rr=document.createElement(n)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==a&&function(e,t){t([e]).then((()=>{$t=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=a?a:"basic.show-dialog",this.loadBricks)}bootstrap(e){var t=this;return(0,a.Z)((function*(){if(e&&t.initialize(e),(0,l.Z)(t,go))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.Z)(t,go,!0),uo=new to(co.storyboards),yield uo.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=uo)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=uo)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return He(e,t)}getFeatureFlags(){var e,t;return(0,o.Z)((0,o.Z)((0,o.Z)({},null===(e=co)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=uo)||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(0,o.Z)((0,o.Z)({},null===(e=co)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=uo)||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(0,o.Z)({base_title:"DevOps 管理专家"},null===(e=co)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,o.Z)({columns:7,rows:4},null===(e=co)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=co)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=co)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t=this.getBrandSettings().base_title;document.title=e?"".concat(e," - ").concat(t):t}getNavConfig(){var e;return null===(e=uo)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,u.loadBricksImperatively)(e,bo())}}function bo(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=co)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:fo)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function wo(){var e;return null===(e=uo)||void 0===e?void 0:e.getRenderId()}function So(){var e;return null===(e=uo)||void 0===e?void 0:e.getRuntimeContext()}function Eo(e){var t;return null===(t=co)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function ko(e){var t;return null===(t=Eo(e))||void 0===t?void 0:t.app}function Zo(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];null==po||null===(e=po.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Io(){var e;return null==po||null===(e=po.auth)||void 0===e?void 0:e.getAuth()}function Ao(){var e,t;return null==po||null===(e=po.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Co(){var e;return null==po||null===(e=po.auth)||void 0===e?void 0:e.isLoggedIn()}function Oo(e,t,r){return To.apply(this,arguments)}function To(){return(To=(0,a.Z)((function*(e,t,r){return nt(yield qe(e),e,"resolve",t,r)}))).apply(this,arguments)}function Po(e){var t,{portal:r,scope:n="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r;t=r||(()=>((i=document.createElement("div")).style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));var s,l,c=!1;return{render(r){var d=arguments;return(0,a.Z)((function*(){var{theme:a,context:p,functions:f,templates:v,i18n:h}=d.length>1&&void 0!==d[1]?d[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");var m=[].concat(r),g=s;s=new An(n,{unknownBricks:o});var y={ctxStore:new _r("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},b={tag:Kr.ROOT,container:e,createPortal:t};if("page"===n){var w;Q(null!=a?a:"light"),oe("default");var S={id:"demo",homepage:"/demo"};y.app=S;var E={app:S,meta:{i18n:h,customTemplates:v}};null===(w=l)||void 0===w||w(),l=x(E),Ln(E),ve(f,S)}y.ctxStore.define(p,y);var k,Z=!1,I=[];try{k=yield Xr(b,m,y,s),(0,u.flushStableLoadBricks)(),I=[y.ctxStore,...y.tplStateStoreMap.values(),...y.formStateStoreMap.values()],yield Promise.all([...k.blockingList,...I.map((e=>e.waitForAll())),...y.pendingPermissionsPreCheck])}catch(e){Z=!0,k={node:{tag:Kr.BRICK,type:"div",properties:{textContent:Xt(e)},return:b,runtimeContext:null},blockingList:[],menuRequests:[]}}if(b.child=k.node,null==g||g.dispatchOnUnmount(),null==g||g.dispose(),dn(e),i&&dn(i),"page"===n&&(Z||s.dispatchBeforePageLoad(),ee(),ie()),pn(b),"page"===n&&window.scrollTo(0,0),!Z){for(var A of I)A.handleAsyncAfterMount();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){c||(c=!0,dn(e),i&&(dn(i),r||i.remove()))}}}function Ro(e,t){return _o.apply(this,arguments)}function _o(){return(_o=(0,a.Z)((function*(e,t){var r,n,a,i=[],s=[],l=(0,o.Z)((0,o.Z)({},So()),{},{data:t,pendingPermissionsPreCheck:[],tplStateStoreScope:i,formStateStoreScope:s});null!==(r=l.tplStateStoreMap)&&void 0!==r||(l.tplStateStoreMap=new Map),null!==(n=l.formStateStoreMap)&&void 0!==n||(l.formStateStoreMap=new Map);var c=new An("fragment"),d={tag:Kr.ROOT,createPortal:null},p=e.transform,f=Ae();p&&Ce(f,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var v=yield tn(d,f?e:(0,o.Z)((0,o.Z)({},e),{},{properties:(0,o.Z)((0,o.Z)({},e.properties),p)}),l,c);(0,u.flushStableLoadBricks)();var h=[...i,...s];if(yield Promise.all([...v.blockingList,...h.map((e=>e.waitForAll())),...l.pendingPermissionsPreCheck]),null!==(a=v.node)&&void 0!==a&&a.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return d.child=v.node,{tagName:v.node?v.node.type:null,renderRoot:d,rendererContext:c,scopedStores:h}}))).apply(this,arguments)}function Mo(e,t){var r,{renderRoot:n,rendererContext:o,scopedStores:a}=e;for(var i of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},pn(n,t),a))i.handleAsyncAfterMount();return o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher(),{portal:r}}function xo(e,t){var{rendererContext:r}=e;t.portal&&(dn(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function Bo(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return bt(t,(0,o.Z)((0,o.Z)({},So()),{},{data:e}),{noInject:!0})}function Lo(e,t){var r=Eo(e);Object.assign(r,(0,o.Z)((0,o.Z)({},t),{},{$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),x(r)}function Uo(e,t){var r=Eo(e),n=!1,o=e=>"".concat(e.path,".").concat(e.exact),a=(e,r)=>e.map((e=>{var i=o(e);return"routes"===e.type?(e.routes=a(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=a(r.routes,o(t)),n||r.routes.unshift(t)}function No(e,t,r){var n="".concat(e,".").concat(t.name);Pe.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),Fo(e,t.name,r)}function Fo(e,t,r){Ko(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,o.Z)({brick:t},(0,m.pick)(r,"properties","events","lifeCycle","context"))])}function jo(e,t){var r;Ko(e,"${APP.homepage}/_dev_only_/snippet-preview/".concat(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}])}var $o=jo;function Ko(e,t,r){var{routes:n}=Eo(e),o=n.findIndex((e=>e.path===t)),a={path:t,bricks:r,menu:!1,exact:!0};-1===o?n.unshift(a):n.splice(o,1,a)}function Do(e,t){var{tplStateStoreId:r}=t,n=So();return r?Re((0,o.Z)((0,o.Z)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function Vo(e){var{tplStateStoreId:t}=e,r=So();return t?Re((0,o.Z)((0,o.Z)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Wo(e){return bo().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Ho(){return wo()}}}]);
2
- //# sourceMappingURL=7782.11601d27.js.map