@next-bricks/advanced 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +1 -1
- package/dist/chunks/{1415.4b11f4dc.js → 1415.14fb821f.js} +2 -2
- package/dist/chunks/{1415.4b11f4dc.js.map → 1415.14fb821f.js.map} +1 -1
- package/dist/chunks/2108.68af1eee.js +2 -0
- package/dist/chunks/2108.68af1eee.js.map +1 -0
- package/dist/chunks/2951.7e3cc858.js +3 -0
- package/dist/chunks/2951.7e3cc858.js.map +1 -0
- package/dist/chunks/{3494.607853cc.js → 3494.a06d54c6.js} +2 -2
- package/dist/chunks/{3494.607853cc.js.map → 3494.a06d54c6.js.map} +1 -1
- package/dist/chunks/353.ee5ebb15.js +2 -0
- package/dist/chunks/{353.4daff213.js.map → 353.ee5ebb15.js.map} +1 -1
- package/dist/chunks/4512.552c507d.js +2 -0
- package/dist/chunks/{4512.4c3720db.js.map → 4512.552c507d.js.map} +1 -1
- package/dist/chunks/{6205.bb511102.js → 6205.3c24c138.js} +2 -2
- package/dist/chunks/{6205.bb511102.js.map → 6205.3c24c138.js.map} +1 -1
- package/dist/chunks/{7164.d63bbbf7.js → 7164.379205f3.js} +2 -2
- package/dist/chunks/{7164.d63bbbf7.js.map → 7164.379205f3.js.map} +1 -1
- package/dist/chunks/{7822.efb12e56.js → 7822.213f0593.js} +2 -2
- package/dist/chunks/{7822.efb12e56.js.map → 7822.213f0593.js.map} +1 -1
- package/dist/chunks/{general-table.cb97af09.js → general-table.0b01b480.js} +2 -2
- package/dist/chunks/{general-table.cb97af09.js.map → general-table.0b01b480.js.map} +1 -1
- package/dist/chunks/main.4338a69b.js +2 -0
- package/dist/chunks/{main.7dee0df3.js.map → main.4338a69b.js.map} +1 -1
- package/dist/index.e6d2c1f4.js +2 -0
- package/dist/{index.22d37477.js.map → index.e6d2c1f4.js.map} +1 -1
- package/package.json +7 -7
- package/dist/chunks/2108.341c60e9.js +0 -2
- package/dist/chunks/2108.341c60e9.js.map +0 -1
- package/dist/chunks/2241.1d086699.js +0 -3
- package/dist/chunks/2241.1d086699.js.map +0 -1
- package/dist/chunks/353.4daff213.js +0 -2
- package/dist/chunks/4512.4c3720db.js +0 -2
- package/dist/chunks/main.7dee0df3.js +0 -2
- package/dist/index.22d37477.js +0 -2
- /package/dist/chunks/{2241.1d086699.js.LICENSE.txt → 2951.7e3cc858.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 2951.7e3cc858.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_next_bricks_advanced=self.webpackChunk_next_bricks_advanced||[]).push([[2951],{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:()=>a});var n=r(175);function a(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:()=>a});var n=r(5863);function a(e,t,r){(0,n.Z)(e,t),t.set(e,r)}},381:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(175);function a(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:()=>a});var n=r(5863);function a(e,t){(0,n.Z)(e,t),t.add(e)}},6666:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(5850);function a(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:()=>o});var n=r(6666);function a(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 o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(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,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}r.d(t,{Z:()=>n})},5850:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(6522);function a(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 a=r.call(e,"string");if("object"!==(0,n.Z)(a))return a;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})},2951:(e,t,r)=>{r.r(t),r.d(t,{StoryboardFunctionRegistryFactory:()=>J,__secret_internals:()=>n,applyTheme:()=>N,authenticate:()=>ao,batchSetAppsLocalTheme:()=>j,checkIfByTransform:()=>Ye,checkIfOfComputed:()=>Ge,createHistory:()=>ye,createRuntime:()=>ta,customProcessors:()=>b,customTemplates:()=>ct,fetchByProvider:()=>co,getAuth:()=>oo,getBasePath:()=>W,getCssPropertyValue:()=>V,getCurrentMode:()=>D,getCurrentTheme:()=>L,getHistory:()=>be,getPageInfo:()=>Dr,getRuntime:()=>ra,handleHttpError:()=>At,httpErrorToString:()=>It,isLoggedIn:()=>so,isUnauthenticatedError:()=>Pt,logout:()=>io,matchPath:()=>yt,registerWidgetFunctions:()=>da,registerWidgetI18n:()=>k});var n={};r.r(n),r.d(n,{initializePreviewBootstrap:()=>ho,legacyDoTransform:()=>yo,loadBricks:()=>bo,mountUseBrick:()=>fo,renderPreviewBricks:()=>mo,renderUseBrick:()=>uo,unmountUseBrick:()=>vo,updateSnippetPreviewSettings:()=>Io,updateStoryboard:()=>wo,updateStoryboardByRoute:()=>So,updateStoryboardBySnippet:()=>Zo,updateStoryboardByTemplate:()=>Eo,updateTemplatePreviewSettings:()=>ko});var a=r(3028),o=r(4795),i=r(5178),s=r(8701),c=r(1304),l=function(){var e=(0,o.Z)((function*(e,t){return(yield c.http.post("api/gateway/micro_app.permission.ValidatePermissions/api/micro_app/v1/permission/validate",e,t)).data}));return function(t,r){return e.apply(this,arguments)}}(),u=r(9481),p=r(4537),d=r(5188),f=r(2159),v=r(6059),h=r(2257),m=r(3395),g=r(687),y=new WeakMap,b=new class{constructor(){(0,m.Z)(this,y,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,g.Z)(this,y).get(r);if(a||(a=new Map,(0,g.Z)(this,y).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return(0,g.Z)(this,y).get(e)}},w=r(2409);function S(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=E("app",t.id);Object.entries(r.i18n).forEach((e=>{var[t,r]=e;w.i18n.addResourceBundle(t,n,r)}))}}function E(e,t){return"".concat(e,"/").concat(t)}function k(e,t){var r=E("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;w.i18n.addResourceBundle(t,r,n)}))}function Z(e){return w.i18n.getFixedT(null,E("widget",e))}function I(e,t){return{get(r){var n;return"".concat(null!==(n=window.PUBLIC_ROOT)&&void 0!==n?n:"","bricks/").concat(e,"/").concat(window.PUBLIC_ROOT_WITH_VERSION&&t?"".concat(t,"/"):"","dist/assets/").concat(r)}}}function P(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var C=()=>{throw new Error("Can't modify read-only proxy object")},O={set:C,defineProperty:C,deleteProperty:C,setPrototypeOf:C};function A(e){return new Proxy(e,O)}function _(e){var{get:t,ownKeys:r}=e;return P()?A(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var T="light",R=new p.JsonStorage(localStorage),M="apps-theme";function x(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));T=e}function B(){return T}function L(){return document.documentElement.dataset.theme}function N(e){e?x(e):e=B(),e!==L()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function j(e){R.setItem(M,(0,a.Z)((0,a.Z)({},U()),e))}function U(){var e,t;try{t=R.getItem(M)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var $="default";function F(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));$=e}function D(){return document.documentElement.dataset.mode}function K(e){e?F(e):e=$,e!==D()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function V(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 W(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}function H(e,t){var r={};for(var n of e){var a=q(n,t);void 0!==a&&(r[n]=a)}return r}function q(e,t){var r,n,{collectCoverage:a,widgetId:o,widgetVersion:s,app:c,appendI18nNamespace:l,storyboardFunctions:u,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return a?"/next":W().replace(/\/$/,"");case"FN":return u;case"IMG":return a?{get:e=>"mock/images/".concat(e)}:o?I(o,s):(r=c.id,n=c.isBuildPush,{get:e=>n?"api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/".concat(e):"".concat(window.APP_ROOT?"".concat(window.APP_ROOT,"-/"):"","micro-apps/").concat(r,"/images/").concat(e)});case"I18N":return a?i.identity:o?Z(o):w.i18n.getFixedT(null,[l,E("app",c.id)].filter(Boolean));case"I18N_TEXT":return a?z:w.i18nText;case"PERMISSIONS":return A({check:a?G:to});case"THEME":return A({getTheme:a?()=>"light":B});case"console":return p?A(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 z(e){return null==e?void 0:e.en}function G(){return!0}function J(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new Map,i=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,c=o.get(a);if(c){if(c.processed)return c.cooked;n&&(s=n.createCollector(a));var l=(0,u.precookFunction)(c.source,{typescript:c.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return c.cooked=(0,u.cook)(l.function,c.source,{rules:{noVar:!0},globalVariables:(0,h.supply)(l.attemptToVisitGlobals,H(l.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}}),c.processed=!0,c.cooked}}(s)});return{storyboardFunctions:i,registerStoryboardFunctions:function(t,r){if(r&&(e=r),o.clear(),Array.isArray(t))for(var n of t){var a=(0,s.strictCollectMemberUsageInFunction)(n,"FN"),i=(0,s.strictCollectMemberUsageInFunction)(n,"PERMISSIONS").has("check");o.set(n.name,{source:n.source,typescript:n.typescript,deps:a,hasPermissionsCheck:i})}},updateStoryboardFunction(e,t){var r=(0,a.Z)((0,a.Z)({},t),{},{name:e}),n=(0,s.strictCollectMemberUsageInFunction)(r,"FN"),i=(0,s.strictCollectMemberUsageInFunction)(r,"PERMISSIONS").has("check");o.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=o.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:Y,registerStoryboardFunctions:Q,checkPermissionsUsage:X}=J(),ee={};try{ee.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var r=e.create,n=e.defineProperty,a=o.prototype;function o(){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(a,"addEventListener",(function(e,r,n){for(var a=t.get(this),o=a[e]||(a[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===r)return;o.push({target:this,listener:r,options:n})})),i(a,"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(a,"removeEventListener",(function(e,r){for(var n=t.get(this),a=n[e]||(n[e]=[]),o=0,i=a.length;o<i;o++)if(a[o].listener===r)return void a.splice(o,1)})),ee.EventTarget=o}(Object,new WeakMap)}const te=ee.EventTarget;var re;!function(e){e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall"}(re||(re={}));var ne=new Map([[re.xLarge,"1920px"],[re.large,"1600px"],[re.medium,"1280px"],[re.small,"1024px"],[re.xSmall,0]]),ae=new te,oe={},ie={};function se(e,t){var r=!1;for(var[n]of(oe[t]=e.matches,ne))if(oe[n]&&ie.breakpoint!==n){ie.breakpoint=n,r=!0;break}r&&ae.dispatchEvent(new CustomEvent("change",{detail:ie}))}ne.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));se(r,t),r.addEventListener?r.addEventListener("change",(e=>{se(e,t)})):r.addListener((e=>{se(e,t)}))}));var ce=()=>ie;function le(e){return function(t){var r,n="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(r=n.getItem(t))&&void 0!==r?r:"null")}}var ue=r(8874),pe=(r(8525),r(7857));function de(e,t){var r=(0,i.orderBy)(e,(e=>{var t,r,n;return null!==(t=null===(r=e.app)||void 0===r||null===(n=r.homepage)||void 0===n?void 0:n.length)&&void 0!==t?t:0}),"desc");for(var n of r){var a=n.app.homepage;if("string"==typeof a&&"/"===a[0]&&("/"===a?t===a:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(a.replace(/\/+$/,""),"/"))))return n}}function fe(e){return!e||!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var ve,he=["extraQuery","clear","keepHash"],me=!1;function ge(e,t){t(!(me=!confirm(e)))}function ye(){if(!ve){var e=(0,pe.createBrowserHistory)({basename:W().replace(/\/$/,""),getUserConfirmation:ge});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function o(e,t,n){me=!1,r(e,t),null==n||n(me)}function i(e,t,r){me=!1,n(e,t),null==r||r(me)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:c,keepHash:l}=n,u=(0,f.Z)(n,he),p=new URLSearchParams(c?"":e.location.search),d={};for(var[v,h]of(Object.assign(d,r,s),Object.entries(d)))if(Array.isArray(h))for(var m of(p.delete(v),h))p.append(v,m);else null==h||""===h?p.delete(v):p.set(v,h);("push"===t?o:i)("?".concat(p.toString()).concat(l?e.location.hash:""),u,a)}}return(0,a.Z)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){o((0,a.Z)((0,a.Z)({},e.location),{},{key:void 0,hash:t,state:(0,a.Z)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,a.Z)((0,a.Z)({},e.location),{},{state:(0,a.Z)((0,a.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(a,o,i){var s,c="string"==typeof a;return"string"==typeof(s=c?(0,pe.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&fe(function(e){var t,r;return de(null!==(t=null===(r=Jn)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](c?W()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,o,i)}}return{push:n("push"),replace:n("replace")}}((0,a.Z)((0,a.Z)({},e),{},{push:o,replace:i})))}(e)),ve=e}return ve}function be(){return ve}var we=r(5866),Se=r(6171),Ee=r(381),ke=r(2308),Ze=function(){var e=(0,o.Z)((function*(e,t){return(yield c.http.post("api/contract/single_search",e,t)).data}));return function(t,r){return e.apply(this,arguments)}}(),Ie=new Map,Pe=new Map,Ce=(e,t)=>{null==e||e.forEach((e=>{t.set("".concat(e.namespaceId,".").concat(e.name),e)}))},Oe=new Map;function Ae(e){return e.includes("@")}function _e(e,t,r){return Te.apply(this,arguments)}function Te(){return Te=(0,o.Z)((function*(e,t,r){if(!Ae(e))return t;if(!e.includes(":"))throw new Error("You're using legacy Custom API \"".concat(e,'" which is dropped in v3, please use Flow API instead'));var n=yield function(e){var t=Oe.get(e);return t||(t=function(e){return Re.apply(this,arguments)}(e),Oe.set(e,t)),t}(e);if(!n)throw new Error('Flow API not found: "'.concat(e,'"'));var a=function(e,t){var r,n,a="string"==typeof t.contract?ke.safeLoad(t.contract,{schema:ke.JSON_SCHEMA,json:!0}):t.contract,{uri:o,method:i="GET",ext_fields:s}=null!==(r=null==a?void 0:a.endpoint)&&void 0!==r?r:{},c=!(null==a||!a.response)&&!1!==a.response.wrapper;if(!o)throw new Error('Missing endpoint.uri in contract of provider "'.concat(e,'"'));return{uri:o,method:"list"===i.toLowerCase()?"get":i,ext_fields:s,name:t.name,namespace:t.namespace,serviceName:t.serviceName,version:t.version,isFileType:"file"===(null==a||null===(n=a.response)||void 0===n?void 0:n.type),responseWrapper:c,request:null==a?void 0:a.request}}(e,n);return function(e,t,r){var n,{uri:a,method:o,ext_fields:i,name:s,namespace:c,serviceName:l,responseWrapper:u,version:p,isFileType:d,request:f}=e,v=d&&"saveAs"===r;v&&(n=t.shift());var{url:h,args:m}=function(e,t,r,n,a,o){var i=o?a?"api/gateway/".concat(a):"api/gateway/".concat(n,".").concat(r,"@").concat(o):"api/gateway/api_service.".concat(n,".").concat(r),s=t.slice();return{url:i+e.replace(/:([^/]+)/g,(()=>s.shift())),args:s}}(a,t,s,c,l,p);return[...v?[n]:[],{url:h,originalUri:a,method:o,ext_fields:i,responseWrapper:u,request:f,isFileType:d},...m]}(a,t,r)})),Te.apply(this,arguments)}function Re(){return(Re=(0,o.Z)((function*(e){var[t,r]=e.split("@"),[n,a]=r.split(":"),o=function(e){return Ie.get(e)||Pe.get(e)}("".concat(t,".").concat(n));if(o)return{name:o.name,namespace:o.namespaceId,serviceName:o.serviceName,version:o.version,contract:{endpoint:o.endpoint,response:o.response,request:o.request}};var i,s,{contractData:c}=yield Ze({contractName:"".concat(t,".").concat(n),version:a});return c?{name:c.name,namespace:null===(i=c.namespace)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.name,serviceName:c.serviceName,version:c.version,contract:{endpoint:c.endpoint,response:c.response,request:c.request}}:void 0}))).apply(this,arguments)}var Me="core.provider-flow-api";function xe(e,t){return e.some((e=>e.source===t))}function Be(e){return Le.apply(this,arguments)}function Le(){return Le=(0,o.Z)((function*(e){for(var t,{url:r,originalUri:n,method:o="GET",responseWrapper:s=!0,ext_fields:l=[],request:u,isFileType:p}=e,d=["get","delete","head"].includes(o.toLowerCase()),f=p?{responseType:"blob"}:{},v=arguments.length,h=new Array(v>1?v-1:0),m=1;m<v;m++)h[m-1]=arguments[m];if(d){var g,y,b,w,S,E;n&&"object"===(null==u?void 0:u.type)&&(null!==(g=null===(y=n.match(/:([^/]+)/g))||void 0===y?void 0:y.length)&&void 0!==g?g:0)===(null!==(b=null===(w=u.fields)||void 0===w?void 0:w.length)&&void 0!==b?b:0)?[E]=h:[S,E]=h,t=yield c.http.simpleRequest(o,r,(0,a.Z)((0,a.Z)({params:S},f),E))}else{var k=function(e){if(!e||"object"!==e.type)return!1;var t=e=>!(0,i.isEmpty)(e)&&e.some((e=>["file","file[]"].includes(e.type)||t(e.fields)));return t(e.fields)}(u),Z=function(e){for(var t=xe(e,"query"),r=xe(e,"body"),n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];if(t){if(r){var[s,c,l]=o;return{data:s,options:(0,a.Z)({params:c},l)}}var[u,p]=o;return{data:{},options:(0,a.Z)({params:u},p)}}var[d,f]=o;return{data:d,options:f}}(l,...h);t=yield c.http.requestWithBody(o,r,k?function(e){if(e instanceof FormData)return e;var t=new FormData,r=function(e,r){Array.isArray(r)?r.forEach((r=>{t.append(e,r)})):!(0,i.isObject)(r)||r instanceof Blob||r instanceof Date?t.append(e,r):Object.entries(r).forEach((r=>{var[n,a]=r;t.append("".concat(e,"[").concat(n,"]"),a)}))};for(var[n,a]of Object.entries(e))r(n,a);return t}(Z.data):Z.data,(0,a.Z)((0,a.Z)({},f),Z.options))}return!p&&s?t.data:t})),Le.apply(this,arguments)}var Ne=new Map;function je(e){return Ue.apply(this,arguments)}function Ue(){return(Ue=(0,o.Z)((function*(e){Ae(e)&&(e=Me);var t=Ne.get(e);if(t)return t;if(e.includes("-")&&!customElements.get(e))if(e===Me)customElements.define(Me,(0,s.createProviderClass)(Be));else if(yield(0,v.loadBricksImperatively)([e],oa()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return t=document.createElement(e),Ne.set(e,t),t}))).apply(this,arguments)}var $e,Fe=new Map;function De(e,t,r){return Ke.apply(this,arguments)}function Ke(){return(Ke=(0,o.Z)((function*(e,t,r){var{useProvider:n,method:o="resolve",args:i=[],onReject:s}=e,c=e.provider;if(c&&!n)throw new Error("You're using \"provider: ".concat(c,'" which is dropped in v3, please use "useProvider" instead'));var l,[u,p]=yield Promise.all([je(n),Da(i,t)]),d=Ve(u,n,o,p,r,i),{transform:f}=e;try{l=yield d}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;f=s.transform,l=e}return f?"string"==typeof f?{[f]:l}:Da(f,(0,a.Z)((0,a.Z)({},t),{},{data:l})):l}))).apply(this,arguments)}function Ve(e,t,r,n,a,o){return We.apply(this,arguments)}function We(){return(We=(0,o.Z)((function*(e,t,r,n,a,i){var s,c;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==a?void 0:a.cache)&&(c=Fe.get(s)),c||(c=(0,o.Z)((function*(){var a=yield _e(t,n,r);return e.resolve(...a)}))(),Fe.set(s,c)),c}))).apply(this,arguments)}function He(e,t){return qe.apply(this,arguments)}function qe(){return(qe=(0,o.Z)((function*(e,t){return!(0,p.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||La(e.if)?yield Da(e.if,t):e.if)}))).apply(this,arguments)}function ze(e,t){return!(0,p.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||La(e.if)?Va(e.if,t):e.if)}function Ge(e){return!(0,p.hasOwnProperty)(e,"if")||!!e.if}function Je(){return(Je=(0,o.Z)((function*(e,t){return(0,p.isObject)(e.if)&&!La(e.if)?Ge(yield De(e.if,t)):He(e,t)}))).apply(this,arguments)}function Ye(e,t){return ze(e,{data:t})}function Qe(e){switch(e){case $e.USE_BRICK_PROPERTIES:case $e.USE_BRICK_TRANSFORM:case $e.USE_BRICK_EVENTS:case $e.USE_BRICK_IF:case $e.USE_BRICK_LIFECYCLE:case $e.USE_BRICK_DATA_SOURCE:return!0}return!1}function Xe(e,t,r){if(Qe(e))return e;if(t)switch(e){case $e.USE_BRICK:return $e.USE_BRICK_ITEM;case $e.USE_BRICK_SLOTS_ITEM_BRICKS:return $e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case $e.INITIAL:if("useBrick"===r)return $e.USE_BRICK;break;case $e.USE_BRICK:case $e.USE_BRICK_ITEM:case $e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return $e.USE_BRICK_PROPERTIES;case"transform":return $e.USE_BRICK_TRANSFORM;case"dataSource":return $e.USE_BRICK_DATA_SOURCE;case"events":return $e.USE_BRICK_EVENTS;case"slots":return $e.USE_BRICK_SLOTS;case"children":return $e.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return $e.USE_BRICK_IF;case"lifeCycle":return $e.USE_BRICK_LIFECYCLE}break;case $e.USE_BRICK_SLOTS:return $e.USE_BRICK_SLOTS_ITEM;case $e.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return $e.USE_BRICK_SLOTS_ITEM_BRICKS}return $e.INITIAL}function et(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,u.isEvaluable)(e):La(e)){var a="string"==typeof e?e:e[xa];t=(0,s.track)(a,"track context","CTX"),r=(0,s.track)(a,"track state","STATE"),n=(0,s.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function tt(){return tt=(0,o.Z)((function*(e,t,r){return(0,p.isObject)(e)?Object.fromEntries((yield Promise.all(Object.entries(e).map(function(){var e=(0,o.Z)((function*(e){var[n,a]=e;if(Array.isArray(r)){var{contextNames:o,stateNames:i,formStateNames:s}=et(a);(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a})}var c=yield Da(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?$e.USE_BRICK:$e.INITIAL});if(void 0!==c&&("style"!==n&&"dataset"!==n||(0,p.isObject)(c)))return[n,c]}));return function(t){return e.apply(this,arguments)}}()))).filter(Boolean)):{}})),tt.apply(this,arguments)}function rt(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,o]of Object.entries(n))e[r][a]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function nt(e,t,r){var n=function(e,t,r){return(0,p.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;if(Array.isArray(r)){var{contextNames:o,stateNames:i,formStateNames:s}=et(a);(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a})}var c=Va(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?$e.USE_BRICK:$e.INITIAL});if(void 0!==c&&("style"!==n&&"dataset"!==n||(0,p.isObject)(c)))return[n,c]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{rt(e,n)}))}function at(e){var t,r;return!(null===(t=e?e.flags:null===(r=ra())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function ot(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var o=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(o),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(o),...n)}!function(e){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||($e={}));var it=new Set(["prefix"]),st=new WeakMap,ct=new class{constructor(){(0,m.Z)(this,st,{writable:!0,value:new Map})}define(e,t){var r,n,o,s,c=(0,g.Z)(this,st).has(e);c?console.warn('Custom template of "'.concat(e,'" already registered.')):(c=!!customElements.get(e))&&console.warn('Custom template of "'.concat(e,'" already defined by customElements.'));var l=at(),u=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},p=[],d=[];for(var[f,v]of Object.entries(u))v.asVariable?(ot(l,"Template `asVariable`",e,f),l||d.push(f)):v.mergeProperty||v.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,f):v.ref&&p.push([f,v]);var h=(0,a.Z)((0,a.Z)({},t),{},{proxy:(0,a.Z)((0,a.Z)({},t.proxy),{},{properties:Object.fromEntries(p)}),state:(t.state?l?t.state:t.state.map((e=>(0,a.Z)({expose:!0},e))):[]).concat(d.map((e=>({name:e,expose:!0}))))});(0,g.Z)(this,st).set(e,(0,a.Z)((0,a.Z)({},h),{},{name:e}));var m,y,b=(m=h.state,(0,i.uniq)(null!==(y=null==m?void 0:m.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==y?y:[])),w=Object.entries(null!==(o=null===(s=h.proxy)||void 0===s?void 0:s.methods)&&void 0!==o?o:{}),S=b.concat(p.map((e=>e[0]))),E=w.map((e=>e[0])),k=S.concat(E).find((e=>e in HTMLElement.prototype&&!it.has(e)));if(void 0!==k)throw new Error('In custom template "'.concat(e,'", "').concat(k,'" is a native HTMLElement property, and should be avoid to be used as a brick property or method.'));if(!c){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,r,n,a;return null===(t=this.$$tplStateStore)||void 0===t||null===(r=t.hostBrick)||void 0===r||null===(n=r.tplHostMetadata)||void 0===n||null===(a=n.internalBricksByRef.get(e))||void 0===a?void 0:a.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(p.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 P=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,a,o=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);o&&(o[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[C,O]of p)P(C,O);var A=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[_,T]of w)A(_,T);customElements.define(e,t)}}get(e){return(0,g.Z)(this,st).get(e)}};function lt(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var o=a.get(n);if(!o)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 o}function ut(e,t,r){var n=lt(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}function pt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function dt(e){return e&&e.sensitive?"":"i"}function ft(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,i=void 0===o||o,s=r.end,c=void 0===s||s,l=r.encode,u=void 0===l?function(e){return e}:l,p=r.delimiter,d=void 0===p?"/#?":p,f=r.endsWith,v="[".concat(pt(void 0===f?"":f),"]|$"),h="[".concat(pt(d),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var b=y[g];if("string"==typeof b)m+=pt(u(b));else{var w=pt(u(b.prefix)),S=pt(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(c)a||(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;a||(m+="(?:".concat(h,"(?=").concat(v,"))?")),Z||(m+="(?=".concat(h,"|").concat(v,")"))}return new RegExp(m,dt(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 a=1,o="";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==--a){s++;break}}else if("("===e[s]&&(a++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=e[s++]}else o+=e[s++]+e[s++];if(a)throw new TypeError("Unbalanced pattern at ".concat(r));if(!o)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:o}),r=s}else{for(var i="",s=r+1;s<e.length;){var c=e.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))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,a=void 0===n?"./":n,o="[^".concat(pt(t.delimiter||"/#?"),"]+?"),i=[],s=0,c=0,l="",u=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},p=function(e){var t=u(e);if(void 0!==t)return t;var n=r[c],a=n.type,o=n.index;throw new TypeError("Unexpected ".concat(a," at ").concat(o,", expected ").concat(e))},d=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};c<r.length;){var f=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=f||"";-1===a.indexOf(m)&&(l+=m,m=""),l&&(i.push(l),l=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||o,modifier:u("MODIFIER")||""})}else{var g=f||u("ESCAPED_CHAR");if(g)l+=g;else if(l&&(i.push(l),l=""),u("OPEN")){m=d();var y=u("NAME")||"",b=u("PATTERN")||"",w=d();p("CLOSE"),i.push({name:y||(b?s++:""),pattern:y&&!b?o:b,prefix:m,suffix:w,modifier:u("MODIFIER")||""})}else p("END")}}return i}(e,r),t,r)}function vt(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,a=r.exec(e.source);a;)t.push({name:a[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),a=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return vt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),dt(r))}(e,t,r):ft(e,t,r)}var ht=new Map,mt=1e4,gt=0;function yt(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:o=!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=ht.get(r);n||ht.set(r,n=new Map);var a=n.get(e);if(a)return a;var o=[],i={regexp:vt(e,o,t),keys:o};return gt<mt&&(n.set(e,i),gt++),i}(r,{end:n,strict:a,sensitive:o}),c=i.exec(e);if(!c)return null;var[l,...u]=c,p=e===l;return n&&!p?null:{path:r,url:"/"===r&&""===l?"/":l,isExact:p,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function bt(){return(bt=(0,o.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),a=yt(t.location.pathname,{path:n,exact:r.exact});if(a&&(yield He(r,t)))return t.app.noAuthGuard||r.public||so()?{match:a,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}var wt=Symbol.for("tpl.asyncComputedPropsFromHost"),St=Symbol.for("tpl.stateStoreId"),Et=Symbol.for("tpl.externalForEachItem"),kt=r(6666),Zt=new Set;function It(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof c.HttpFetchError)return"网络错误,请检查您的网络连接。";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 Pt(e){return e instanceof c.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var Ct,Ot=!1;function At(e){if(!(e instanceof c.HttpAbortError))if(!Pt(e)||window.NO_AUTH_GUARD){console.error(e);var t=It(e);t!==Ct&&(Ct=t,alert(t),setTimeout((()=>{Ct=void 0}),1e3))}else{if(Ot)return;if(Ot=!0,confirm("您还未登录或登录信息已过期,现在重新登录?")){var r=ra().getFeatureFlags()["sso-enabled"],n=be();n.push(r?"/sso-auth/login":"/auth/login",{from:(0,a.Z)((0,a.Z)({},n.location),{},{state:void 0})})}setTimeout((()=>{Ot=!1}),1)}}function _t(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,o=xt(a,r,{element:e});for(var i of(e.addEventListener(n,o),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,o]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,i])}))}function Tt(e){return"string"==typeof e.action}function Rt(e){return"string"==typeof e.useProvider}function Mt(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function xt(e,t,r){return function(n){for(var o of[].concat(e))if(ze(o,(0,a.Z)((0,a.Z)({},t),{},{event:n})))if(Tt(o)){var[i,s]=o.action.split(".");switch(o.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":$t(n,s,o.args,o.callback,t);break;case"window.open":Ft(n,o.args,t);break;case"location.reload":case"location.assign":Vt(n,s,o.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Wt(n,i,s,o.args,t);break;case"event.preventDefault":n.preventDefault();break;case"console.log":case"console.error":case"console.warn":case"console.info":Ht(n,s,o.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":qt(n,0,o.args,t);break;case"handleHttpError":At(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":Dt(n,s,o.args,o.callback,t);break;case"state.update":case"state.refresh":case"state.load":Kt(n,s,o.args,o.callback,t);break;case"tpl.dispatchEvent":var[c,l]=Gt(o.args,t,n);ut(t,o.action,": ".concat(c)).dispatchEvent(new CustomEvent(c,l));break;case"theme.setDarkTheme":case"theme.setLightTheme":N("theme.setDarkTheme"===o.action?"dark":"light");break;case"theme.setTheme":var[u]=Gt(o.args,t,n);N(u);break;case"mode.setDashboardMode":case"mode.setDefaultMode":K("mode.setDashboardMode"===o.action?"dashboard":"default");break;default:console.error("unknown event listener action:",o.action)}}else Rt(o)?Bt(n,o,t,r):Mt(o)?Nt(n,o,t,r):console.error("unknown event handler:",o)}}function Bt(e,t,r,n){return Lt.apply(this,arguments)}function Lt(){return(Lt=(0,o.Z)((function*(e,t,r,n){try{jt(e,yield je(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(It(e))}}))).apply(this,arguments)}function Nt(e,t,r,n){var o=[],i=t.target,s=t.targetRef,c=i;if(("string"==typeof i?(0,u.isEvaluable)(i):La(i))&&(c=Va(i,(0,a.Z)((0,a.Z)({},r),{},{event:e}))),"string"==typeof c)if("_self"===c)o.push(n.element);else if(t.multiple)o=Array.from(document.querySelectorAll(c));else{var l=document.querySelector(c);null!==l&&o.push(l)}else if(c)c instanceof HTMLElement?o.push(c):console.error("unexpected target:",c);else if(s){var p=s;("string"==typeof s?(0,u.isEvaluable)(s):La(s))&&(p=Va(s,(0,a.Z)((0,a.Z)({},r),{},{event:e})));var d=[].concat(p),f=ut(r,"targetRef",": ".concat(d.join(", ")));o.push(...d.map((e=>{var t;return null===(t=f.$$getElementByRef)||void 0===t?void 0:t.call(f,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((a=>{jt(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&nt(o,t.properties,(0,a.Z)((0,a.Z)({},r),{},{event:e})):console.error("target not found:",i||s)}function jt(e,t,r,n,a,o,i){return Ut.apply(this,arguments)}function Ut(){return Ut=(0,o.Z)((function*(e,t,r,n,i,s,c){var l;if("function"==typeof t[n]){var u=function(){var a=(0,o.Z)((function*(){var a=Gt(r.args,i,e,c);return Rt(r)&&(a=yield _e(r.useProvider,a,n)),t[n](...a)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var p,d=zt(r.callback,i,s),f={progress:d("progress"),success:d("success"),error:d("error"),finally:d("finally")};if(Rt(r)&&(p=Va(r.poll,(0,a.Z)((0,a.Z)({},i),{},{event:e}))),null!==(l=p)&&void 0!==l&&l.enabled)!function(e,t,r){var n,{progress:a,success:i,error:s,finally:c}=t,{interval:l,leadingRequestDelay:u,continueOnError:p,delegateLoadingBar:d,expectPollEnd:f,expectPollStopImmediately:v}=r,h=ia();function m(){return g.apply(this,arguments)}function g(){return(g=(0,o.Z)((function*(){var t;Zt.delete(n);try{if(!(t=null==v?void 0:v())){var r=yield e();(t=(null==v?void 0:v())||h!==ia())||(null==a||a(r),null!=f&&f(r)?(d&&window.dispatchEvent(new Event("request.end")),null==i||i(r),null==c||c()):y(null!=l?l:3e3))}}catch(e){(t=(null==v?void 0:v())||h!==ia())||(null==s||s(e),p?y(null!=l?l:3e3):null==c||c())}finally{d&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function y(e){n=setTimeout(m,e),Zt.add(n)}y(null!=u?u:0),d&&window.dispatchEvent(new Event("request.start"))}(u,f,p);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})})),Ut.apply(this,arguments)}function $t(e,t,r,n,a){var o=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":o=2,i=!0;break;case"reload":i=!0;break;case"block":o=1,s="setBlockMessage"}var c=[];if(o>0&&((c=Gt(r,a,e,{useEventDetailAsDefault:!0})).length=o),i&&n){var l=zt(n,a,void 0);c.push((e=>{l(e?"error":"success")({blocked:e}),l("finally")({blocked:e})}))}be()[s](...c)}function Ft(e,t,r){var[n,a,o]=Gt(t,r,e);window.open(n,a||"_self",o)}function Dt(e,t,r,n,a){var[o,i]=Gt(r,a,e);a.ctxStore.updateValue(o,i,t,n,a)}function Kt(e,t,r,n,a){var[o,i]=Gt(r,a,e);lt(a,"state.".concat(t),": ".concat(o)).updateValue(o,i,"update"===t?"replace":t,n,a)}function Vt(e,t,r,n){if("assign"===t){var[a]=Gt(r,n,e);location.assign(a)}else location[t]()}function Wt(e,t,r,n,a){var o="localStorage"===t?localStorage:sessionStorage,[i,s]=Gt(n,a,e);"setItem"===r?void 0!==s&&o.setItem(i,JSON.stringify(s)):o.removeItem(i)}function Ht(e,t,r,n){console[t](...Gt(r,n,e,{useEventAsDefault:!0}))}function qt(e,t,r,n){alert(...Gt(r,n,e,{useEventAsDefault:!0}))}function zt(e,t,r){return function(n){return function(a){var o=null==e?void 0:e[n];if(o)try{var i=new CustomEvent("callback.".concat(n),{detail:a});xt(o,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function Gt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?Va(e,(0,a.Z)((0,a.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}class Jt{constructor(e,t){(0,kt.Z)(this,"type",void 0),(0,kt.Z)(this,"data",new Map),(0,kt.Z)(this,"changeEventType",void 0),(0,kt.Z)(this,"pendingStack",[]),(0,kt.Z)(this,"hostBrick",void 0),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}updateValue(e,t,r,n,o){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,p.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),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,a.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||At(e)})),n){var c=zt(n,o);s.then((e=>{c("success")({value:e}),c("finally")()}),(e=>{c("error")(e),c("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 a=(0,s.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,a)}return r}(e,r),a=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var c;a.set(i,(null!==(c=a.get(i))&&void 0!==c?c:0)+1)}var l=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),u=new WeakSet,p=new Map,d=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{p.set(e,{resolve:t,reject:r})}))]))),f=function(){var e=(0,o.Z)((function*(e){var r;u.add(e);var o=yield t(e);n.delete(e);var i=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(o){if(p.get(e.name).resolve(),a.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(p.get(e.name).resolve(),a.delete(e.name)):a.set(e.name,i-1);yield h()}));return function(t){return e.apply(this,arguments)}}(),v=l;function h(){return m.apply(this,arguments)}function m(){return m=(0,o.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)))}(a,v)).map((e=>e[0])).filter((e=>!u.has(e)));yield Promise.all(e.map(f))})),m.apply(this,arguments)}return{pendingResult:h().then((0,o.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))),a=()=>{var e=!1;for(var[t,o]of r.entries())[...o.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&a()};if(a(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),v=!0,yield h()),p.values()))e.resolve()}))).catch((e=>{for(var t of p.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,o.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,o.Z)((function*(){for(var{pendingResult:t}of e.pendingStack)yield t}))()}resolve(e,t,r){var n=this;return(0,o.Z)((function*(){if(!(yield He(e,t)))return!1;var i,c;if("STATE"===n.type&&r&&e.expose){var l=yield r;(0,p.hasOwnProperty)(l,e.name)&&(i=l[e.name])}var u=!1;if(void 0===i){if(e.resolve){var d=(0,a.Z)({transform:"value"},e.resolve);if(yield He(e.resolve,t))c=function(){var e=(0,o.Z)((function*(e){return(yield De(d,t,e)).value}));return function(t){return e.apply(this,arguments)}}(),(u=e.resolve.lazy)||(i=yield c());else if(!(0,p.hasOwnProperty)(e,"value"))return!1}c&&!u||void 0===e.value||(i=yield Da(e.value,t))}var f={value:i,eventTarget:new EventTarget,load:c,loaded:!u};if(e.onChange&&f.eventTarget.addEventListener(n.changeEventType,xt(e.onChange,t)),e.track&&"FORM_STATE"!==n.type){var v=(0,s.strictCollectMemberUsage)(c?e.resolve:e.value,n.type);for(var h of v)n.onChange(h,(()=>{c?n.updateValue(e.name,{cache:"default"},"refresh"):n.updateValue(e.name,Va(e.value,t),"replace")}))}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,f),!0}))()}}function Yt(e,t,r){var n,{reversedProxies:a,asyncHostProperties:o,externalSlots:s,tplStateStoreId:c,hostBrick:l}=e;if(t&&a){var u=a.properties.get(t);u&&(n=o.then((e=>{var t={};for(var{from:r,to:n}of u){var a=e[r];void 0!==a&&n.refProperty&&(t[n.refProperty]=a)}return t})));var d=a.slots.get(t);if(d&&s){var f=new Map;for(var{from:v,to:h}of d){var m,g,y,b,w=null!==(m=null===(g=s[v])||void 0===g?void 0:g.bricks)&&void 0!==m?m:[];if(w.length){var S=null!==(y=h.refSlot)&&void 0!==y?y:v,E=f.get(S);if(!E){E=[];for(var k=(0,p.hasOwnProperty)(r,S)?r[S].bricks.length+1:1,Z=0;Z<k;Z+=1)E.push([]);f.set(S,E)}var I=null!==(b=h.refPosition)&&void 0!==b?b:-1;E[(0,i.clamp)(I<0?E.length+I:I,0,E.length-1)].push(...(0,p.hasOwnProperty)(l.runtimeContext,"forEachItem")?Qt(w,l.runtimeContext.forEachItem):w)}}var P=function(e,t){(0,p.hasOwnProperty)(r,e)||(r[e]={type:"bricks",bricks:[]});var n=r[e];n.bricks=t.flatMap(((e,t)=>t<n.bricks.length?e.concat(n.bricks[t]):e)),0===n.bricks.length&&delete r[e]};for(var[C,O]of f.entries())P(C,O)}}return{[wt]:n,[St]:c}}function Qt(e,t){return e.map((e=>{var r;return(0,a.Z)((0,a.Z)({},e),{},{[Et]:t,slots:Object.fromEntries(Object.entries(null!==(r=e.slots)&&void 0!==r?r:{}).map((e=>{var r,[n,a]=e;return[n,"routes"===a.type?{type:"routes",routes:Xt(a.routes,t)}:{type:"bricks",bricks:Qt(null!==(r=a.bricks)&&void 0!==r?r:[],t)}]})))})}))}function Xt(e,t){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.Z)((0,a.Z)({},e),{},{bricks:Qt(e.bricks,t)})))}var er=["properties","slots","children"];function tr(e,t){function r(e){return(0,p.isObject)(e)?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,a]=e;return(0,p.isObject)(a)&&"useBrick"===t?Array.isArray(a)?[t,a.map(n)]:[t,n(a)]:[t,r(a)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:o,slots:i,children:s}=e,c=(0,f.Z)(e,er),l=gr(s,i),u=Object.fromEntries(Object.entries(null!=l?l:{}).map((e=>{var t,[r,a]=e;return[r,{type:"bricks",bricks:(null!==(t=a.bricks)&&void 0!==t?t:[]).map(n)}]})));return(0,a.Z)((0,a.Z)({},c),{},{properties:r(o),slots:u},Yt(t,c.ref,u))}return r(e)}var rr,nr=["slots","children"],ar=["properties","slots","children"];function or(e,t,r,n){var o=(0,i.uniqueId)("tpl-state-"),s=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{tplStateStoreId:o});delete s.forEachItem;var c=new Jt("STATE",r);s.tplStateStoreMap.set(o,c),s.tplStateStoreScope&&s.tplStateStoreScope.push(c);var{bricks:l,proxy:u,state:p,contracts:d}=ct.get(e);!function(e){Ce(e,Pe)}(d),c.define(p,s,n);var{slots:v,children:h}=t,m=(0,f.Z)(t,nr),g=(0,a.Z)((0,a.Z)({},m),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:o,proxy:u};var y={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(var[b,w]of Object.entries(u.properties)){var S=y.properties.get(w.ref);S||(S=[],y.properties.set(w.ref,S)),S.push({from:b,to:w})}if(null!=u&&u.slots)for(var[E,k]of Object.entries(u.slots)){var Z=y.slots.get(k.ref);Z||(Z=[],y.slots.set(k.ref,Z)),Z.push({from:E,to:k})}var I={reversedProxies:y,asyncHostProperties:n,externalSlots:gr(h,v),tplStateStoreId:o,hostBrick:r};return g.slots={"":{type:"bricks",bricks:l.map((e=>ir(e,I)))}},g}function ir(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:o}=e,i=(0,f.Z)(e,ar),s=gr(o,n),c=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var r,[n,a]=e;return[n,{type:"bricks",bricks:(null!==(r=a.bricks)&&void 0!==r?r:[]).map((e=>ir(e,t)))}]})));return(0,a.Z)((0,a.Z)({},i),{},{properties:tr(r,t),slots:c},Yt(t,i.ref,c))}!function(e){e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK"}(rr||(rr={}));var sr=["blockingList","node","menuRequests","hasTrackingControls"];function cr(e,t,r,n,a){return lr.apply(this,arguments)}function lr(){return lr=(0,o.Z)((function*(e,t,r,n,o){var i=yield function(e,t){return bt.apply(this,arguments)}(t,r),s={blockingList:[],menuRequests:[]};switch(i){case"missed":break;case"unauthenticated":s.unauthenticated=!0;break;default:var c=s.route=i.route,l=(0,a.Z)((0,a.Z)({},r),{},{match:i.match});switch(l.ctxStore.define(c.context,l),l.pendingPermissionsPreCheck.push(Ja(c,l)),c.type){case"redirect":var u;if("string"!=typeof(u="string"==typeof c.redirect?yield Da(c.redirect,l):(yield De((0,a.Z)({transform:"redirect"},c.redirect),l)).redirect))throw console.error("Unexpected redirect result:",u),new Error("Unexpected type of redirect result: ".concat(typeof u));s.redirect={path:u};break;case"routes":s.menuRequests.push(hr(c.menu,l)),mr(s,yield cr(e,c.routes,l,n,o));break;default:s.menuRequests.push(hr(c.menu,l)),mr(s,yield ur(e,c.bricks,l,n,o))}}return s})),lr.apply(this,arguments)}function ur(e,t,r,n,a,o,i){return pr.apply(this,arguments)}function pr(){return(pr=(0,o.Z)((function*(e,t,r,n,a,o,i){var s={blockingList:[],menuRequests:[]};return(yield Promise.all(t.map(((t,i)=>dr(e,t,r,n,a,i,o&&new Map(o)))))).forEach(((t,r)=>{!i&&t.hasTrackingControls&&n.memoizeControlNode(a,r,t.node,e),mr(s,t)})),s}))).apply(this,arguments)}function dr(e,t,r,n,a,o){return fr.apply(this,arguments)}function fr(){return fr=(0,o.Z)((function*(e,t,r,n,s,c){var l,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:new Map,d={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),d;var f=t[St],h=(0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:f});(0,p.hasOwnProperty)(t,Et)&&(h.forEachItem=t[Et]);var{context:m}=t;if(Array.isArray(m)&&m.length>0){var g=at(h);ot(g,"Defining context on bricks","check your brick:",t),g||h.ctxStore.define(m,h)}if(h.pendingPermissionsPreCheck.push(Ja(t,h)),!(yield function(e,t){return Je.apply(this,arguments)}(t,h)))return d;var y=t.brick;if(y.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(y);var{dataSource:b}=t,w=function(){var r=(0,o.Z)((function*(){var r,a=yield Da(b,h),o=":forEach"===y?"":":switch"===y?String(a):a?"":"else",i=gr(t.children,t.slots),c=i&&(0,p.hasOwnProperty)(i,o)&&(null===(r=i[o])||void 0===r?void 0:r.bricks);if(!Array.isArray(c))return d;switch(y){case":forEach":return Array.isArray(a)?function(e,t,r,n,a,o,i){return vr.apply(this,arguments)}(e,a,c,h,n,s,u):d;case":if":case":switch":return ur(e,c,h,n,s,u,!0)}}));return function(){return r.apply(this,arguments)}}(),S=yield w(),{contextNames:E,stateNames:k}=et(b);if(E||k){S.hasTrackingControls=!0;var Z=0,I=function(){var t=(0,o.Z)((function*(){var t=++Z,r=yield w();r.blockingList.push(...[...h.tplStateStoreMap.values()].map((e=>e.waitForAll())),...h.pendingPermissionsPreCheck),yield Promise.all(r.blockingList),Z===t&&n.rerenderControlNode(s,c,r.node,e)}));return function(){return t.apply(this,arguments)}}(),P=(0,i.debounce)(I);if(E)for(var C of E)h.ctxStore.onChange(C,P);if(k)for(var O of k)lt(h,"STATE",': "'.concat(b,'"')).onChange(O,P)}return S}/\.tpl-/.test(y)&&!ct.get(y)&&(yield(0,v.loadBricksImperatively)([y],oa()));var A=function(e,t){if(!e.includes(".")&&t){var r="".concat(t,".").concat(e);if(ct.get(r))return r}return!!ct.get(e)&&e}(y,null===(l=h.app)||void 0===l?void 0:l.id);if(A){var _,T=null!==(_=u.get(A))&&void 0!==_?_:0;if(T>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(A,'"'));u.set(A,T+1)}y.includes(".")&&d.blockingList.push((0,v.enqueueStableLoadBricks)([y],oa()));var R={tag:rr.BRICK,type:A||y,return:e,slotId:s,events:t.events,runtimeContext:h,portal:t.portal,iid:t.iid,ref:t.ref};d.node=R;var M=[],x=[],B=function(){var e=(0,o.Z)((function*(){R.properties=yield function(e,t,r){return tt.apply(this,arguments)}(t.properties,h,x);var e=t[wt];if(e){var r;null!==(r=R.properties)&&void 0!==r||(R.properties={});var n=yield e;for(var[a,o]of Object.entries(n))R.properties[a]=o}return R.properties}));return function(){return e.apply(this,arguments)}}(),L=B();M.push(L),L.then((()=>{!function(e,t){var r=function(t){var r=()=>{e.element&&nt(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 a=lt(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var o of t.stateNames)a.onChange(o,r)}};for(var n of t)r(n)}(R,x)})),n.registerBrickLifeCycle(R,t.lifeCycle);var N,j=t;A&&(j=or(A,t,R,L)),j.portal&&(R.slotId=void 0),A?delete(N=(0,a.Z)({},h)).forEachItem:N=h;var U=function(){var e=(0,o.Z)((function*(){var e=gr(j.children,j.slots);if(e){var t=yield Promise.all(Object.entries(e).map((e=>{var[t,r]=e;return"routes"!==r.type?ur(R,r.bricks,N,n,t,u):cr(R,r.routes,N,n,t)}))),r=(0,a.Z)((0,a.Z)({},d),{},{node:void 0,blockingList:[]});for(var o of t)mr(r,o);r.node&&(R.child=r.node),mr(d,(0,a.Z)((0,a.Z)({},r),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return M.push(U()),yield Promise.all(M),d})),fr.apply(this,arguments)}function vr(){return(vr=(0,o.Z)((function*(e,t,r,n,o,i,s){var c={blockingList:[],menuRequests:[]},l=yield Promise.all(t.map(((t,c)=>Promise.all(r.map(((r,l)=>dr(e,r,(0,a.Z)((0,a.Z)({},n),{},{forEachItem:t}),o,i,c*l,s&&new Map(s))))))));for(var u of l.flat())mr(c,u);return c}))).apply(this,arguments)}function hr(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 Da(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}function mr(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:o}=t,i=(0,f.Z)(t,sr);if(e.blockingList.push(...r),e.menuRequests.push(...a),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 gr(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,o=null!==(a=n.slot)&&void 0!==a?a:"";(0,p.hasOwnProperty)(r,o)||(r[o]={type:"bricks",bricks:[]}),r[o].bricks.push(n)}return r}function yr(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:o}=lt(n,"bindTemplateProxy"),i=o.tplHostMetadata;i.internalBricksByRef.set(r,e);var s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s){var c=function(e,t){if(t.ref===r){var n,i,s,c=t=>{t.bubbles&&t.stopPropagation(),o.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},l=null!==(n=t.refEvent)&&void 0!==n?n:e;a.addEventListener(l,c),null!==(s=(i=a).$$proxyListeners)&&void 0!==s||(i.$$proxyListeners=[]),a.$$proxyListeners.push([l,c])}};for(var[l,u]of Object.entries(s))c(l,u)}}}function br(e){var{ref:t,runtimeContext:r,element:n}=e;if(r.tplStateStoreId&&t){var{hostBrick:a}=lt(r,"unbindTemplateProxy"),o=a.tplHostMetadata;for(var[i,s]of(o.internalBricksByRef.delete(t),null!==(c=n.$$proxyListeners)&&void 0!==c?c:[])){var c;n.removeEventListener(i,s)}delete n.$$proxyListeners}}function wr(e){e.innerHTML=""}function Sr(e,t){for(var r=e.child,n=[];r;){var 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 o=t&&r===e.child?t:document.createElement(a);if(r.element=o,r.slotId&&o.setAttribute("slot",r.slotId),r.iid&&(o.dataset.iid=r.iid),rt(o,r.properties),_t(o,r.events,r.runtimeContext),r.tplHostMetadata&&(o.$$tplStateStore=lt({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),yr(r),r.portal?n.push(o):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(o)),r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var i,s=r.return;s;){var c;if(s.childElements)s.tag===rr.ROOT?(null===(c=s.container)||void 0===c||c.append(...s.childElements),n.length>0&&("function"==typeof s.createPortal?s.createPortal():s.createPortal).append(...n)):s.element.append(...s.childElements),s.childElements=void 0;if(s.sibling)break;s=s.return}r=null===(i=s)||void 0===i?void 0:i.sibling}}}var Er,kr=["onMount","onUnmount","onMediaChange","onScrollIntoView"],Zr=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],Ir=new WeakMap,Pr=new WeakMap,Cr=new WeakMap,Or=new WeakMap,Ar=new WeakSet,_r=new WeakSet,Tr=new WeakSet,Rr=new WeakSet;class Mr{constructor(e){(0,we.Z)(this,Rr),(0,we.Z)(this,Tr),(0,we.Z)(this,_r),(0,we.Z)(this,Ar),(0,kt.Z)(this,"type",void 0),(0,m.Z)(this,Ir,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[]}}),(0,m.Z)(this,Pr,{writable:!0,value:new Map}),(0,m.Z)(this,Cr,{writable:!0,value:void 0}),(0,m.Z)(this,Or,{writable:!0,value:void 0}),this.type=e}registerBrickLifeCycle(e,t){if(t){var r=[...kr,..."router"===this.type?Zr:[]];for(var n of r){var a=t[n];a&&(0,g.Z)(this,Ir)[n].push({brick:e,handlers:a})}(0,i.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}memoizeControlNode(e,t,r,n){(0,g.Z)(this,Or)||(0,Ee.Z)(this,Or,new WeakMap);var a="".concat(null!=e?e:"",".").concat(t),o=(0,g.Z)(this,Or).get(n);o||(o=new Map,(0,g.Z)(this,Or).set(n,o)),o.set(a,{node:r,last:jr(r),lastNormal:Ur(r),lastPortal:$r(r)})}rerenderControlNode(e,t,r,n){var a,o,i,s,c,l="".concat(null!=e?e:"",".").concat(t),u=(0,g.Z)(this,Or).get(n).get(l),{node:p,last:d,lastNormal:f,lastPortal:v}=u,h=null!==(a=null==f||null===(o=f.element)||void 0===o?void 0:o.nextSibling)&&void 0!==a?a:null,m=null!==(i=null==v||null===(s=v.element)||void 0===s?void 0:s.nextSibling)&&void 0!==i?i:null,y=jr(r);u.node=r,u.last=y,u.lastNormal=Ur(r),u.lastPortal=$r(r);for(var b=n.child;b&&b!==d;){if(b.sibling===p){c=b;break}b=b.sibling}var w=document.createDocumentFragment(),S=document.createDocumentFragment(),E={tag:rr.ROOT,container:w,createPortal:S,child:r};for(b=r;b;)b.return=E,b=b.sibling;var k,Z,I=Fr(p,d);for((0,Se.Z)(this,Ar,xr).call(this,I),Sr(E),c?c.sibling=r:n.child=r,y&&(y.sibling=null==d?void 0:d.sibling),b=r;b;)b.return=n,b=b.sibling;if(n.tag===rr.ROOT?null===(k=n.container)||void 0===k||k.insertBefore(w,h):null===(Z=n.element)||void 0===Z||Z.insertBefore(w,h),S.childNodes.length>0){for(var P,C=r;C&&C.return;)C=C.return;if((null===(P=C)||void 0===P?void 0:P.tag)!==rr.ROOT)throw new Error("Cannot find render root node");("function"==typeof C.createPortal?C.createPortal():C.createPortal).insertBefore(S,m)}var O=Fr(r,y);(0,Se.Z)(this,_r,Br).call(this,O)}dispose(){for(var e of Object.values((0,g.Z)(this,Ir)))e.length=0;for(var t of(0,g.Z)(this,Pr).values()){for(var r of t)r.disconnect();t.length=0}(0,g.Z)(this,Pr).clear(),(0,g.Z)(this,Cr)&&(ae.removeEventListener("change",(0,g.Z)(this,Cr)),(0,Ee.Z)(this,Cr,void 0)),(0,Ee.Z)(this,Or,void 0)}dispatchBeforePageLoad(){(0,Se.Z)(this,Tr,Lr).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,Se.Z)(this,Tr,Lr).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,Se.Z)(this,Tr,Lr).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,Se.Z)(this,Tr,Lr).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=be().location;e&&"#"!==e?(0,Se.Z)(this,Tr,Lr).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,Se.Z)(this,Tr,Lr).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,g.Z)(this,Ir).onScrollIntoView)(0,Se.Z)(this,Rr,Nr).call(this,e,t)}initializeMediaChange(){(0,Ee.Z)(this,Cr,(e=>{(0,Se.Z)(this,Tr,Lr).call(this,"onMediaChange",new CustomEvent("media.change",{detail:A(e.detail)}))})),ae.addEventListener("change",(0,g.Z)(this,Cr))}dispatchOnMount(){(0,Se.Z)(this,Tr,Lr).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,Se.Z)(this,Tr,Lr).call(this,"onUnmount",new CustomEvent("unmount"))}}function xr(e){var t=[...kr,..."router"===this.type?Zr:[]],r=[];for(var n of t){var a=(0,i.remove)((0,g.Z)(this,Ir)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var o of e){var s,c,l=(0,g.Z)(this,Pr).get(o);if(null!=l&&l.length){for(var u of l)u.disconnect();l.length=0,(0,g.Z)(this,Pr).delete(o)}br(o),null===(s=o.element)||void 0===s||delete s.$$tplStateStore,null===(c=o.element)||void 0===c||c.remove()}var p=new CustomEvent("unmount");for(var{brick:d,handlers:f}of r)xt(f,d.runtimeContext,d)(p)}function Br(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,g.Z)(this,Ir).onMount)e.has(r)&&xt(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:o}of(0,g.Z)(this,Ir).onScrollIntoView)e.has(a)&&(0,Se.Z)(this,Rr,Nr).call(this,a,o)}function Lr(e,t){for(var{brick:r,handlers:n}of(0,g.Z)(this,Ir)[e])xt(n,r.runtimeContext,r)(t)}function Nr(e,t){var r,n=null!==(r=t.threshold)&&void 0!==r?r:.1,a=new IntersectionObserver(((r,a)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(xt(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var o=(0,g.Z)(this,Pr).get(e);o||(o=[],(0,g.Z)(this,Pr).set(e,o)),o.push(a)}function jr(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function Ur(e){for(var t,r=e;r;)r.portal||(t=r),r=r.sibling;return t}function $r(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,a=r.return;a&&!a.sibling;)a=a.return;r=null===(n=a)||void 0===n?void 0:n.sibling}return t}function Fr(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 a,o=n.return;o&&o!==t&&!o.sibling;)o=o.return;if(o===t)break;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}function Dr(){if(!Er){if(Er={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){Er.isInIframe=!0;try{if(window.origin===window.parent.origin){Er.isInIframeOfSameSite=!0;var e="/next/"===W(),t=window.parent.location.pathname,r=t.startsWith("/next/");Er.isInIframeOfNext=0==(Number(e)^Number(r)),Er.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),Er.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(Er)}return Er}var Kr,Vr=new WeakSet;function Wr(e){if((0,p.isObject)(e)&&!Hr(e))if(Vr.add(e),Array.isArray(e))e.forEach(Wr);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Wr)}}function Hr(e){return Vr.has(e)}var qr=function(){var e=(0,o.Z)((function*(e,t){return(yield c.http.get("api/auth/v2/bootstrap",(0,a.Z)((0,a.Z)({},t),{},{params:e}))).data}));return function(t,r){return e.apply(this,arguments)}}(),zr=function(){var e=(0,o.Z)((function*(e){return(yield c.http.get("api/v1/runtime_standalone",e)).data}));return function(t){return e.apply(this,arguments)}}(),Gr=function(){var e=(0,o.Z)((function*(e,t,r){return(yield c.http.get("api/auth/v2/bootstrap/".concat(e),(0,a.Z)((0,a.Z)({},r),{},{params:t}))).data}));return function(t,r,n){return e.apply(this,arguments)}}(),Jr=function(){var e=(0,o.Z)((function*(e,t){return(yield c.http.get("api/gateway/micro_app_standalone.runtime.RuntimeMicroAppStandalone/api/v1/micro_app_standalone/runtime/".concat(e),t)).data}));return function(t,r){return e.apply(this,arguments)}}(),Yr=["feature_flags"],Qr=["featureFlags","misc"];function Xr(){return en.apply(this,arguments)}function en(){return en=(0,o.Z)((function*(){var e=yield window.STANDALONE_MICRO_APPS?function(){return tn.apply(this,arguments)}():qr({appFields:"defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons,standaloneMode",ignoreTemplateFields:"templates",ignoreBrickFields:"bricks,processors,providers,editors"});for(var{app:t}of e.storyboards)t.locales?function(){var e="tmp/".concat(t.id);Object.entries(t.locales).forEach((t=>{var[r,n]=t;w.i18n.addResourceBundle(r,e,n)})),t.localeName=w.i18n.getFixedT(null,e)("name",t.name),Object.keys(t.locales).forEach((t=>{w.i18n.removeResourceBundle(t,e)}))}():t.localeName=t.name;return(0,p.isObject)(e.settings)&&(0,p.deepFreeze)(e.settings),e.brickPackages=(0,p.deepFreeze)(e.brickPackages),e})),en.apply(this,arguments)}function tn(){return tn=(0,o.Z)((function*(){var e=[c.http.get(window.BOOTSTRAP_FILE),c.http.get("".concat(window.APP_ROOT,"conf.yaml"),{responseType:"text"}),zr().catch((e=>{console.warn("request runtime api from api-gateway failed: ",e,", something might went wrong running standalone micro app")}))];if(!window.NO_AUTH_GUARD){var t,r=window.APP_ID||(window.APP_ROOT&&(t=window.APP_ROOT.match(/^(?:(?:\/next)?\/)?sa-static\/([^/]+)\/versions\//))?t[1]:null);r&&nn(r)}var[n,o,i]=yield Promise.all(e);return function(e,t){var r;try{r=t?(0,ke.safeLoad)(t,{schema:ke.JSON_SCHEMA,json:!0}):void 0}catch(e){throw console.error("Parse conf.yaml failed",e),new Error("Invalid conf.yaml")}if(r){var{sys_settings:n,user_config:o,user_config_by_apps:i}=r;if(n){var{feature_flags:s}=n,c=(0,f.Z)(n,Yr);e.settings=(0,a.Z)({featureFlags:s},c)}if(o&&1===e.storyboards.length)e.storyboards[0].app.userConfig=o;else if(i)for(var{app:l}of e.storyboards)(0,p.hasOwnProperty)(i,l.id)&&(l.userConfig=i[l.id])}}(n,o),function(e,t){var r;if(t){var{featureFlags:n,misc:o}=t,i=(0,f.Z)(t,Qr),s=null!==(r=e.settings)&&void 0!==r?r:e.settings={};s.featureFlags=(0,a.Z)((0,a.Z)({},s.featureFlags),n),s.misc=(0,a.Z)((0,a.Z)({},s.misc),o),Object.assign(s,i)}}(n,null==i?void 0:i.settings),n})),tn.apply(this,arguments)}var rn=new Map;function nn(e){return an.apply(this,arguments)}function an(){return(an=(0,o.Z)((function*(e){if(rn.has(e))return rn.get(e);var t=Jr(e).catch((e=>{console.warn("request standalone runtime api from micro-app-standalone failed: ",e,", something might went wrong running standalone micro app")}));return rn.set(e,t),t}))).apply(this,arguments)}function on(){return on=(0,o.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return sn.apply(this,arguments)}(e)),e.$$fulfilling})),on.apply(this,arguments)}function sn(){return(sn=(0,o.Z)((function*(e){if(window.STANDALONE_MICRO_APPS){if(Object.assign(e,{$$fulfilled:!0,$$fulfilling:null}),!window.NO_AUTH_GUARD){var t;try{t=yield nn(e.app.id)}catch(e){console.warn("request standalone runtime api from micro-app-standalone failed: ",e,", something might went wrong running standalone micro app")}if(t){var{userConfig:r,injectMenus:n}=t;e.app.userConfig=(0,a.Z)((0,a.Z)({},e.app.userConfig),r),function(e){if(Array.isArray(e))for(var t of e)t.overrideApp&&cn(t.overrideApp)}(n),e.meta=(0,a.Z)((0,a.Z)({},e.meta),{},{injectMenus:n})}}}else{var{routes:o,meta:i,app:s}=yield Gr(e.app.id,{});Object.assign(e,{routes:o,meta:i,app:(0,a.Z)((0,a.Z)({},e.app),s),$$fulfilled:!0,$$fulfilling:null})}S(e),cn(e.app)}))).apply(this,arguments)}function cn(e){e.config=(0,p.deepFreeze)((0,i.merge)({},e.defaultConfig,e.userConfig))}var ln=function(){var e=(0,o.Z)((function*(e,t){return(yield c.http.post("api/gateway/micro_app_standalone.runtime.SearchMicroAppStandalone/api/v1/micro_app_standalone/search",e,t)).data}));return function(t,r){return e.apply(this,arguments)}}();const un=(e,t,r)=>{bn(r);const n=((e,t)=>{const r=dn(e),n=dn(t),a=r.pop(),o=n.pop(),i=mn(r,n);return 0!==i?i:a&&o?mn(a.split("."),o.split(".")):a||o?a?-1:1:0})(e,t);return gn[r].includes(n)},pn=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,dn=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(pn);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},fn=e=>"*"===e||"x"===e||"X"===e,vn=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},hn=(e,t)=>{if(fn(e)||fn(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(vn(e),vn(t));return r>n?1:r<n?-1:0},mn=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=hn(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},gn={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},yn=Object.keys(gn),bn=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===yn.indexOf(e))throw new Error(`Invalid operator, expected one of ${yn.join("|")}`)};function wn(e,t){return function(r,n,a){if(n.name===e){var o=a[a.length-1],i=a[a.length-2];if("CallExpression"===(null==i?void 0:i.node.type)&&"callee"===(null==i?void 0:i.key)&&"MemberExpression"===(null==o?void 0:o.node.type)&&"object"===o.key&&(o.node.computed?"Literal"===o.node.property.type&&o.node.property.value===t:"Identifier"===o.node.property.type&&o.node.property.name===t)){var s=i.node.arguments;if(s.length>0){var c=s[0];"Literal"===c.type&&"string"==typeof c.value?r.usedArgs.add(c.value):r.hasNonStaticUsage=!0}}}}}var Sn=wn("APP","getMenu"),En=wn("INSTALLED_APPS","has"),kn=new Map,Zn=new Map;function In(e,t){var r=la(e);if(!r&&window.STANDALONE_MICRO_APPS&&(r=Zn.get(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 un(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}var Pn=new WeakMap,Cn=new WeakMap,On=new WeakMap,An=new WeakMap,_n=new WeakMap,Tn=new WeakMap,Rn=new WeakMap,Mn=new WeakMap,xn=new WeakMap,Bn=new WeakMap,Ln=new WeakMap,Nn=new WeakMap,jn=new WeakSet,Un=new WeakSet,$n=new WeakSet,Fn=new WeakSet;class Dn{constructor(e){(0,we.Z)(this,Fn),(0,we.Z)(this,$n),(0,we.Z)(this,Un),(0,we.Z)(this,jn),(0,m.Z)(this,Pn,{writable:!0,value:void 0}),(0,m.Z)(this,Cn,{writable:!0,value:!1}),(0,m.Z)(this,On,{writable:!0,value:void 0}),(0,m.Z)(this,An,{writable:!0,value:void 0}),(0,m.Z)(this,_n,{writable:!0,value:void 0}),(0,m.Z)(this,Tn,{writable:!0,value:void 0}),(0,m.Z)(this,Rn,{writable:!0,value:new Set}),(0,m.Z)(this,Mn,{writable:!0,value:0}),(0,m.Z)(this,xn,{writable:!0,value:void 0}),(0,m.Z)(this,Bn,{writable:!0,value:void 0}),(0,m.Z)(this,Ln,{writable:!0,value:void 0}),(0,m.Z)(this,Nn,{writable:!0,value:void 0}),(0,Ee.Z)(this,Pn,e);var t=be();window.addEventListener("beforeunload",(e=>{(0,Se.Z)(this,jn,Kn).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,Se.Z)(this,jn,Kn).call(this,{location:e,action:t})))}getRenderId(){return(0,g.Z)(this,xn)}getRuntimeContext(){return(0,g.Z)(this,_n)}getRecentApps(){return{currentApp:(0,g.Z)(this,Bn),previousApp:(0,g.Z)(this,Ln)}}getNavConfig(){return(0,g.Z)(this,Nn)}bootstrap(){window.AbortController&&(Kr=new AbortController,c.http.interceptors.request.use((e=>{var t;return(0,a.Z)((0,a.Z)({},e),{},{options:(0,a.Z)((0,a.Z)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:Kr.signal})})})));var e=be();return(0,Ee.Z)(this,On,e.location),e.listen(((e,t)=>{var r,n,o,i=!1,s={hash:void 0,state:void 0};if(void 0!==e.key&&("POP"!==t||void 0!==(0,g.Z)(this,On).key&&!1!==(null===(r=(0,g.Z)(this,On).state)||void 0===r?void 0:r.notify))||(s.key=void 0),((0,pe.locationsAreEqual)((0,a.Z)((0,a.Z)({},(0,g.Z)(this,On)),s),(0,a.Z)((0,a.Z)({},e),s))||"POP"!==t&&!1===(null===(n=e.state)||void 0===n?void 0:n.notify))&&(i=!0),i)(0,Ee.Z)(this,On,e);else{if(Kr&&(Kr.abort(),Kr=new AbortController),(0,Ee.Z)(this,On,e),null===(o=(0,g.Z)(this,Tn))||void 0===o||o.dispatchPageLeave(),"POP"===t&&fe(de((0,g.Z)(this,Pn),e.pathname)))return void window.location.reload();(0,g.Z)(this,Cn)?(0,Ee.Z)(this,An,e):(0,Se.Z)(this,$n,Wn).call(this,e).catch(At)}})),(0,Se.Z)(this,$n,Wn).call(this,e.location)}}function Kn(e){var t,r=be(),n=r.getBlockMessage();null===(t=(0,g.Z)(this,Tn))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function Vn(e,t,r){var n,a;if((0,Ee.Z)(this,Mn,(n=(0,g.Z)(this,Mn),a=n++,n)),a>10){var o='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(o)}be().replace(e,t)}function Wn(e){return Hn.apply(this,arguments)}function Hn(){return(Hn=(0,o.Z)((function*(e){(0,Ee.Z)(this,Cn,!0);try{yield(0,Se.Z)(this,Fn,qn).call(this,e)}finally{if((0,Ee.Z)(this,Cn,!1),(0,g.Z)(this,An)){var t=(0,g.Z)(this,An);(0,Ee.Z)(this,An,void 0),yield(0,Se.Z)(this,$n,Wn).call(this,t)}}}))).apply(this,arguments)}function qn(e){return zn.apply(this,arguments)}function zn(){return zn=(0,o.Z)((function*(e){var t;(0,Ee.Z)(this,xn,(0,i.uniqueId)("render-id-1")),Vr=new WeakSet,Fe.clear(),Pe.clear(),be().unblock();var r=de((0,g.Z)(this,Pn),e.pathname),n=null===(t=(0,g.Z)(this,_n))||void 0===t?void 0:t.app;null!=r&&r.app&&(yield function(e){return on.apply(this,arguments)}(r));var o,l=(0,Ee.Z)(this,Bn,null==r?void 0:r.app),u=n&&l?n.id!==l.id:n!==l,p=ra().getFeatureFlags(),d=(0,g.Z)(this,Tn),f=(t,r)=>{(0,g.Z)(this,Rn).add(d),(0,Se.Z)(this,Un,Vn).call(this,t,r,e)},h=()=>{var t=p["sso-enabled"]?"/sso-auth/login":"/auth/login";f(t,{from:e})},m=document.querySelector("#main-mount-point"),y=document.querySelector("#portal-mount-point"),b={tag:rr.ROOT,container:m,createPortal:y},w=()=>{for(var e of(wr(m),wr(y),(0,g.Z)(this,Rn).add(d),(0,g.Z)(this,Rn)))e&&(e.dispatchOnUnmount(),e.dispose());(0,g.Z)(this,Rn).clear(),x(l&&(U()[l.id]||l.theme)||"light"),F("default"),u&&((0,Ee.Z)(this,Ln,n),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:n,currentApp:l}})))};if(l){var S,E;!function(e){if(window.STANDALONE_MICRO_APPS&&!window.NO_AUTH_GUARD){var t=function(e){var t,r={usedArgs:new Set},{customTemplates:n,menus:a}=null!==(t=e.meta)&&void 0!==t?t:{};return(0,s.traverseStoryboardExpressions)([e.routes,n,a],((e,t)=>{En(r,e,t)}),"INSTALLED_APPS"),[...r.usedArgs]}(e),r=[];for(var n of t)kn.has(n)||la(n)||r.push(n);if(0===r.length)return;var o=ln({query:{appId:{$in:r}},fields:["appId","currentVersion","installStatus"]}).catch((e=>{console.error("Get off site standalone micro-apps failed",e)})),i=function(e){kn.set(e,o.then((t=>{var r,n=null==t||null===(r=t.list)||void 0===r?void 0:r.find((t=>t.appId===e)),o=n?(0,a.Z)((0,a.Z)({},n),{},{id:e}):void 0;return Zn.set(e,o),o})))};for(var c of r)i(c)}}(r);var k=(0,Ee.Z)(this,_n,{app:l,location:e,query:new URLSearchParams(e.search),flags:p,sys:(0,a.Z)((0,a.Z)({},oo()),Dr()),ctxStore:new Jt("CTX"),pendingPermissionsPreCheck:[Ga(r)],tplStateStoreMap:new Map}),Z=(0,Ee.Z)(this,Tn,new Mr("router"));(0,Ee.Z)(this,Nn,void 0),function(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 a=n.name.includes(".")?n.name:"".concat(e.app.id,".").concat(n.name);ct.define(a,n)}}}(r),Q(null===(S=r.meta)||void 0===S?void 0:S.functions,l),o=null===(E=r.meta)||void 0===E?void 0:E.contracts,Ce(o,Ie);var I,P=!1;try{if((I=yield cr(b,function(e){if(window.parent===window)return e;var t=e,r=(0,i.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,i.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)]}(r.routes),k,Z)).unauthenticated)return void h();if(I.redirect)return void f(I.redirect.path,I.redirect.state);(0,Ee.Z)(this,Mn,0),(0,v.flushStableLoadBricks)(),yield Promise.all([...I.blockingList,k.ctxStore.waitForAll(),...[...k.tplStateStoreMap.values()].map((e=>e.waitForAll())),...k.pendingPermissionsPreCheck]);var C=yield Promise.all(I.menuRequests);(0,Ee.Z)(this,Nn,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}(C))}catch(e){if(console.error("Router failed:",e),Pt(e)&&!window.NO_AUTH_GUARD)return void h();if(e instanceof c.HttpAbortError)return void(0,g.Z)(this,Rn).add(d);P=!0,I={node:{tag:rr.BRICK,type:"div",properties:{textContent:It(e)},runtimeContext:null,return:b},blockingList:[],menuRequests:[]}}if(b.child=I.node,w(),I.route&&"routes"!==I.route.type||P)return P||Z.dispatchBeforePageLoad(),N(),K(),Sr(b),window.scrollTo(0,0),void(P||(Z.dispatchPageLoad(),Z.dispatchAnchorLoad(),Z.dispatchOnMount(),Z.initializeScrollIntoView(),Z.initializeMediaChange()))}else{if(!window.NO_AUTH_GUARD&&!so())return void h();w()}N(),K();var O={tag:rr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:b};b.child=O,Sr(b),window.scrollTo(0,0)})),zn.apply(this,arguments)}var Gn,Jn,Yn,Qn=function(){var e=(0,o.Z)((function*(e){return(yield c.http.get("api/auth/login",e)).data}));return function(t){return e.apply(this,arguments)}}();function Xn(){return ea.apply(this,arguments)}function ea(){return ea=(0,o.Z)((function*(){if(!window.NO_AUTH_GUARD){var e=yield Qn();e.loggedIn&&ao(e)}})),ea.apply(this,arguments)}function ta(){if(Gn)throw new Error("Cannot create multiple runtimes");return(0,w.initializeI18n)(),ue.locale(w.i18n.language),w.i18n.on("languageChanged",(()=>{ue.locale(w.i18n.language)})),ye(),Gn=new na}function ra(){return Gn}class na{bootstrap(){return(0,o.Z)((function*(){var[,e]=yield Promise.all([Xn(),Xr()]);Jn=e,Yn=new Dn(e.storyboards),yield Yn.bootstrap()}))()}getRecentApps(){return Yn.getRecentApps()}getCurrentApp(){return Yn.getRecentApps().currentApp}getFeatureFlags(){var e,t,r,n,o;return(0,a.Z)((0,a.Z)((0,a.Z)({},null===(e=Jn)||void 0===e||null===(t=e.settings)||void 0===t?void 0:t.featureFlags),null===(r=Yn.getRecentApps().currentApp)||void 0===r||null===(n=r.config)||void 0===n||null===(o=n.settings)||void 0===o?void 0:o.featureFlags),{},{"migrate-to-brick-next-v3":!0})}getMiscSettings(){var e,t,r,n,o;return(0,a.Z)((0,a.Z)({},null===(e=Jn)||void 0===e||null===(t=e.settings)||void 0===t?void 0:t.misc),null===(r=Yn.getRecentApps().currentApp)||void 0===r||null===(n=r.config)||void 0===n||null===(o=n.settings)||void 0===o?void 0:o.misc)}getBrandSettings(){var e,t;return(0,a.Z)({base_title:"DevOps 管理专家"},null===(e=Jn)||void 0===e||null===(t=e.settings)||void 0===t?void 0:t.brand)}getLaunchpadSettings(){var e,t;return(0,a.Z)({columns:7,rows:4},null===(e=Jn)||void 0===e||null===(t=e.settings)||void 0===t?void 0:t.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=Jn)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=Jn)||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(){return Yn.getNavConfig()}}function aa(e){Jn=e}function oa(){var e,t;return null!==(e=null===(t=Jn)||void 0===t?void 0:t.brickPackages)&&void 0!==e?e:[]}function ia(){return Yn.getRenderId()}function sa(){var e;return null===(e=Yn)||void 0===e?void 0:e.getRuntimeContext()}function ca(e){var t,r;return null===(t=Jn)||void 0===t||null===(r=t.storyboards)||void 0===r?void 0:r.find((t=>t.app.id===e))}function la(e){var t;return null===(t=ca(e))||void 0===t?void 0:t.app}var ua=new Map,pa=new Proxy(Object.freeze({}),{get:(e,t)=>ua.get(t)});function da(e,t,r){if(ua.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=J({widgetId:e,widgetVersion:r});ua.set(e,n),a(t)}var fa=function(){var e=(0,o.Z)((function*(e,t,r){return(yield c.http.post("api/gateway/cmdb.instance.PostSearch/object/".concat(e,"/instance/_search"),t,r)).data}));return function(t,r,n){return e.apply(this,arguments)}}(),va=Symbol("appId"),ha=Symbol("menuI18nNamespace"),ma=Symbol("overrideApp");function ga(){return(ga=(0,o.Z)((function*(e,t,r){if(e.dynamicItems&&e.itemsResolve){var n=e.app[0].appId,o=t;if(n!==t.app.id){var i=window.STANDALONE_MICRO_APPS?e.overrideApp:la(n);o=(0,a.Z)((0,a.Z)({},t),{},{overrideApp:i,appendI18nNamespace:r.get(e)})}var s=yield De((0,a.Z)({transform:"items"},e.itemsResolve),o);e.items=s.items}}))).apply(this,arguments)}function ya(){return ya=(0,o.Z)((function*(e,t){var r=e.find((e=>"inject"!==e.type));if(r){var n=[],o=new Map,i=new WeakMap;for(var s of e)s.i18n&&function(){var e=E("menu","".concat(s.menuId,"~").concat(s.app[0].appId,"+").concat(s.instanceId));Object.entries(s.i18n).forEach((t=>{var[r,n]=t;w.i18n.addResourceBundle(r,e,n)})),i.set(s,e)}();for(var c of(yield Promise.all(e.map((e=>function(e,t,r){return ga.apply(this,arguments)}(e,t,i)))),e)){var l;if(null!==(l=c.items)&&void 0!==l&&l.length)if("inject"===c.type&&c.injectMenuGroupId){var u=o.get(c.injectMenuGroupId);u||(u=[],o.set(c.injectMenuGroupId,u)),u.push(c)}else n.push(c)}return(0,a.Z)((0,a.Z)({},r),{},{items:n.flatMap((e=>ba(e.items,e,o,i))),[ha]:i.get(r),[ma]:r.overrideApp})}})),ya.apply(this,arguments)}function ba(e,t,r,n){return null==e?void 0:e.map((e=>{var o,i=e.groupId&&r.get(e.groupId);return i&&r.delete(e.groupId),(0,a.Z)((0,a.Z)({},e),{},{children:(null!==(o=ba(e.children,t,r,n))&&void 0!==o?o:[]).concat(i?i.flatMap((e=>ba(e.items,e,r,n))):[]),[va]:t.app[0].appId,[ha]:n.get(t),[ma]:t.overrideApp})}))}function wa(e){return(0,i.sortBy)(e,(e=>{var t;return null!==(t=e.sort)&&void 0!==t?t:-1/0}))}var Sa=["children"];function Ea(e,t,r){var n=r;if(t!==r.app.id){var o=window.STANDALONE_MICRO_APPS?e[ma]:la(t);n=(0,a.Z)((0,a.Z)({},r),{},{overrideApp:o,appendI18nNamespace:e[ha]})}return Da(e,n,{ignoreSymbols:!0})}function ka(e,t){return Promise.all(e.map(function(){var e=(0,o.Z)((function*(e){var{children:r}=e,n=(0,f.Z)(e,Sa),[o,i]=yield Promise.all([Ea(n,n[va],t),r&&(yield ka(r,t))]);return(0,a.Z)((0,a.Z)({},o),{},{children:i})}));return function(t){return e.apply(this,arguments)}}()))}var Za=function(){var e=(0,o.Z)((function*(e,t,r,n){return(yield c.http.get("api/gateway/cmdb.instance.GetDetail/object/".concat(e,"/instance/").concat(t),(0,a.Z)((0,a.Z)({},n),{},{params:r}))).data}));return function(t,r,n,a){return e.apply(this,arguments)}}(),Ia=new Map;function Pa(e){return Ca.apply(this,arguments)}function Ca(){return(Ca=(0,o.Z)((function*(e){if(e.title||(0,i.isEmpty)(e.titleDataSource))return e.title;var t=JSON.stringify(e.titleDataSource);if(Ia.has(t))return Ia.get(t);var r,{objectId:n,instanceId:a,attributeId:o}=e.titleDataSource,s=null!=o?o:"name",c=yield Za(n,a,{fields:s});if("#showKey"===o&&Array.isArray(c[s])){var[l,...u]=c[s];r=u.length>0?"".concat(l,"(").concat(u.join(","),")"):String(l)}else r=String(c[s]);return Ia.set(t,r),r}))).apply(this,arguments)}var Oa=["items","app"],Aa=new Map,_a=new Map;function Ta(e){return _a.get(e)}function Ra(){return Ra=(0,o.Z)((function*(e,t){var r=window.STANDALONE_MICRO_APPS?function(e,t){var r,n,o,i,s=ca(t);return(null!==(r=null!==(n=null===(o=s.meta)||void 0===o?void 0:o.injectMenus)&&void 0!==n?n:null===(i=s.meta)||void 0===i?void 0:i.menus)&&void 0!==r?r:[]).filter((t=>t.menuId===e)).map((e=>{var r,n;return(0,a.Z)((0,a.Z)({},e),null!==(r=e.app)&&void 0!==r&&null!==(n=r[0])&&void 0!==n&&n.appId?{}:{app:[{appId:t}]})}))}(e,t.app.id):(yield fa("EASYOPS_STORYBOARD_MENU",{page:1,page_size:200,fields:{menuId:!0,title:!0,icon:!0,link:!0,titleDataSource:!0,defaultCollapsed:!0,defaultCollapsedBreakpoint:!0,type:!0,injectMenuGroupId:!0,dynamicItems:!0,itemsResolve:!0,items:!0,i18n:!0,"items.children":!0,"app.appId":!0},query:{menuId:{$eq:e},app:{$size:{$gt:0}}}})).list,n=yield function(e,t){return ya.apply(this,arguments)}(r,t);if(!n)throw new Error("Menu not found: ".concat(e));!function(e){e.items=wa(e.items).map((e=>(0,a.Z)((0,a.Z)({},e),{},{children:wa(e.children)})))}(n);var{items:o,app:s}=n,c=(0,f.Z)(n,Oa),l=(0,a.Z)((0,a.Z)({},t),{},{pendingPermissionsPreCheck:[...t.pendingPermissionsPreCheck,Qa([o,c])]});delete l.tplStateStoreId,delete l.forEachItem;var u=s[0].appId,[p,d]=yield Promise.all([Ea(c,u,l),ka(o,l)]),v=(0,a.Z)((0,a.Z)({title:yield Pa(p)},(0,i.pick)(p,["icon","link","defaultCollapsed","defaultCollapsedBreakpoint"])),{},{menuItems:d.filter(Ge).map((e=>{var t,r=null===(t=e.children)||void 0===t?void 0:t.filter(Ge);return"group"===e.type?{type:"group",title:e.text,items:r}:null!=r&&r.length?{type:"subMenu",title:e.text,icon:e.icon,items:r,defaultExpanded:e.defaultExpanded}:e}))});_a.set(e,v)})),Ra.apply(this,arguments)}var Ma=["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope"],xa=Symbol.for("pre.evaluated.raw"),Ba=Symbol.for("pre.evaluated.context");function La(e){return!(null==e||!e[xa])}function Na(e){return"string"==typeof e?(0,u.shouldAllowRecursiveEvaluations)(e):(0,u.shouldAllowRecursiveEvaluations)(e[xa])}var ja=new WeakSet([SyntaxError,TypeError,ReferenceError]);function Ua(e){return ja.has(e.constructor)?e.constructor:TypeError}function $a(){return($a=(0,o.Z)((function*(e,t,r){var{blockingList:n,run:a}=Fa(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function Fa(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=[];if("string"!=typeof e){var{pendingPermissionsPreCheck:c,tplStateStoreMap:l,tplStateStoreScope:d}=t,m=(0,f.Z)(t,Ma);t=(0,a.Z)((0,a.Z)({},e[Ba]),m),e=e[xa]}var g,y={usedArgs:new Set},w={usedArgs:new Set};try{g=(0,u.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){Sn(y,e,t),En(w,e,t)}}})}catch(t){var S="".concat(t.message,', in "').concat(e,'"');throw new(Ua(t))(S)}if(y.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(w.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var E,k,C,O,T={},{attemptToVisitGlobals:R}=g;if(r.lazy||R.has("EVENT")&&!(0,p.hasOwnProperty)(t,"event")||R.has("DATA")&&!(0,p.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[xa]:e,[Ba]:t}:e};var M=at(t);(R.has("STATE")||!M&&R.has("TPL"))&&(O=lt(t,"STATE",': "'.concat(e,'"')));var x,B=P();if(n||B){if(R.has("CTX")&&(E=(0,s.strictCollectMemberUsage)(e,"CTX"),n&&o.push(t.ctxStore.waitFor(E))),O){if(C=(0,s.strictCollectMemberUsage)(e,"STATE"),!M){var L=(0,s.strictCollectMemberUsage)(e,"TPL");for(var N of L)C.add(N)}n&&o.push(O.waitFor(C))}R.has("PROCESSORS")&&(k=(0,s.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&o.push((0,v.loadProcessorsImperatively)(k,oa())))}if(n){var j=R.has("PERMISSIONS");if(!j&&R.has("FN")){var U=[...(0,s.strictCollectMemberUsage)(e,"FN")];j=X(U)}if(j&&o.push(...t.pendingPermissionsPreCheck),y.usedArgs.size>0){var $=[...y.usedArgs];o.push(Promise.all($.map((e=>function(e,t){var r=Aa.get(e);return r||(r=function(e,t){return Ra.apply(this,arguments)}(e,t)),r}(e,t)))))}w.usedArgs.size>0&&o.push((x=[...w.usedArgs],Promise.all(x.map((e=>kn.get(e))))))}return{blockingList:o,run(){var r,n,{app:o,location:s,query:c,match:l,flags:d,sys:f,ctxStore:v,data:m,event:y}=t,w=null!==(r=t.overrideApp)&&void 0!==r?r:o;for(var S of R)switch(S){case"ANCHOR":T[S]=s.hash?s.hash.substring(1):null;break;case"APP":T[S]=(0,a.Z)((0,a.Z)({},(0,i.cloneDeep)(w)),{},{getMenu:Ta});break;case"CTX":T[S]=_({get:(e,t)=>v.getValue(t),ownKeys:()=>Array.from(E)});break;case"DATA":T[S]=m;break;case"EVENT":T[S]=y;break;case"FLAGS":T[S]=A(d);break;case"HASH":T[S]=s.hash;break;case"INSTALLED_APPS":T[S]=A({has:In});break;case"ITEM":(0,p.hasOwnProperty)(t,"forEachItem")?T[S]=t.forEachItem:console.error('Using `ITEM` but no `:forEach` is found, check your expression: "'.concat(e,'"'));break;case"LOCAL_STORAGE":T[S]=A({getItem:le("local")});break;case"MEDIA":T[S]=A(ce());break;case"MISC":T[S]=ra().getMiscSettings();break;case"PARAMS":T[S]=new URLSearchParams(c);break;case"PATH":T[S]=A(null!==(n=null==l?void 0:l.params)&&void 0!==n?n:{});break;case"PATH_NAME":T[S]=s.pathname;break;case"PROCESSORS":T[S]=_({get(e,t){var r=b.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return _({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys:()=>Array.from(k)});break;case"QUERY":T[S]=Object.fromEntries(Array.from(c.keys()).map((e=>[e,c.get(e)])));break;case"QUERY_ARRAY":T[S]=Object.fromEntries(Array.from(c.keys()).map((e=>[e,c.getAll(e)])));break;case"SESSION_STORAGE":T[S]=A({getItem:le("session")});break;case"TPL":if(ot(M,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),M)break;case"STATE":T[S]=_({get:(e,t)=>O.getValue(t),ownKeys:()=>Array.from(C)});break;case"SYS":T[S]=A(null!=f?f:{});break;case"__WIDGET_FN__":T[S]=pa;break;case"__WIDGET_IMG__":T[S]=I;break;case"__WIDGET_I18N__":T[S]=Z}Object.assign(T,H(g.attemptToVisitGlobals,{storyboardFunctions:Y,app:t.app,appendI18nNamespace:t.appendI18nNamespace}));try{return(0,u.cook)(g.expression,g.source,{globalVariables:(0,h.supply)(g.attemptToVisitGlobals,T)})}catch(t){var P="".concat(t.message,', in "').concat(e,'"');throw new(Ua(t))(P)}}}}function Da(e,t){return Ka.apply(this,arguments)}function Ka(){return Ka=(0,o.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=La(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&Qe(r.$$stateOfUseBrick),i=o;return n||(0,u.isEvaluable)(e)?(a=yield function(e,t,r){return $a.apply(this,arguments)}(e,t,{lazy:o}),i=Na(e)):a=o?e:((0,p.hasOwnProperty)(t,"data")?r.noInject?d.transform:d.transformAndInject:r.noInject?Ha:d.inject)(e,t),i||Wr(a),a}if(!(0,p.isObject)(e)||Hr(e))return e;if(Array.isArray(e)){var s=Wa(r,!0);return Promise.all(e.map((e=>Da(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([Da(n,t),Da(a,t,Wa(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),Ka.apply(this,arguments)}function Va(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=La(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&Qe(r.$$stateOfUseBrick),i=o;return n||(0,u.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=Fa(e,t,void 0,!1);return n()}(e,t),i=Na(e)):a=o?e:((0,p.hasOwnProperty)(t,"data")?r.noInject?d.transform:d.transformAndInject:r.noInject?Ha:d.inject)(e,t),i||Wr(a),a}if(!(0,p.isObject)(e)||Hr(e))return e;if(Array.isArray(e)){var s=Wa(r,!0);return e.map((e=>Va(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[Va(n,t),Va(a,t,Wa(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function Wa(e,t,r){return e.$$lazyForUseBrick?(0,a.Z)((0,a.Z)({},e),{},{$$stateOfUseBrick:Xe(e.$$stateOfUseBrick,t,r)}):e}function Ha(e){return e}var qa=[],za=new Map;function Ga(e){if(so()&&!oo().isAdmin)return Xa((0,s.scanPermissionActionsInStoryboard)(e))}function Ja(e,t){return Ya.apply(this,arguments)}function Ya(){return(Ya=(0,o.Z)((function*(e,t){if(so()&&!oo().isAdmin&&Array.isArray(e.permissionsPreCheck))return Xa(yield Da(e.permissionsPreCheck,t))}))).apply(this,arguments)}function Qa(e){if(so()&&!oo().isAdmin)return Xa((0,s.scanPermissionActionsInAny)(e))}function Xa(e){return eo.apply(this,arguments)}function eo(){return(eo=(0,o.Z)((function*(e){var t=(0,i.difference)(e,[...qa]);if(0!==t.length){qa.push(...t);try{var r=yield l({actions:t});for(var n of r.actions)za.set(n.action,n.authorizationStatus),"undefined"===n.authorizationStatus&&console.error('Undefined permission action: "'.concat(n.action,'"'))}catch(e){console.error("Pre-check permissions failed",e)}}}))).apply(this,arguments)}function to(){if(!so())return!1;if(oo().isAdmin)return!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n of t)switch(za.get(n)){case"unauthorized":case"undefined":return!1;case void 0:return console.error('Un-checked permission action: "'.concat(n,'", please make sure the permission to check is defined in permissionsPreCheck.')),!1}return!0}var ro,no={};function ao(e){Object.assign(no,{org:e.org,username:e.username,userInstanceId:e.userInstanceId,loginFrom:e.loginFrom,accessRule:e.accessRule,isAdmin:e.isAdmin,csrfToken:e.csrfToken,license:e.license,userShowValue:e.userShowValue})}function oo(){return(0,a.Z)({},no)}function io(){for(var e of Object.keys(no))no[e]=void 0;qa.length=0,za.clear()}function so(){return void 0!==no.username}function co(e,t,r){return lo.apply(this,arguments)}function lo(){return(lo=(0,o.Z)((function*(e,t,r){return Ve(yield je(e),e,"resolve",t,r)}))).apply(this,arguments)}function uo(e,t){return po.apply(this,arguments)}function po(){return(po=(0,o.Z)((function*(e,t){var r,n,o=[],i=(0,a.Z)((0,a.Z)({},sa()),{},{data:t,pendingPermissionsPreCheck:[],tplStateStoreScope:o});null!==(r=i.tplStateStoreMap)&&void 0!==r||(i.tplStateStoreMap=new Map);var s=new Mr("useBrick"),c={tag:rr.ROOT,createPortal:null},l=e.transform,u=at();l&&ot(u,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var p=yield dr(c,u?e:(0,a.Z)((0,a.Z)({},e),{},{properties:(0,a.Z)((0,a.Z)({},e.properties),l)}),i,s);if((0,v.flushStableLoadBricks)(),yield Promise.all([...p.blockingList,...o.map((e=>e.waitForAll())),...i.pendingPermissionsPreCheck]),null!==(n=p.node)&&void 0!==n&&n.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return c.child=p.node,{tagName:p.node?p.node.type:null,renderRoot:c,rendererContext:s}}))).apply(this,arguments)}function fo(e,t){var r,{renderRoot:n,rendererContext:a}=e;return n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},Sr(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),{portal:r}}function vo(e,t){var{rendererContext:r}=e;t.portal&&(wr(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function ho(e){aa(e)}function mo(e,t){return go.apply(this,arguments)}function go(){return go=(0,o.Z)((function*(e,t){var r,n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={pendingPermissionsPreCheck:[],tplStateStoreMap:new Map},i=ro,s=ro=new Mr("router"),c={tag:rr.ROOT,container:t.main,createPortal:t.portal},l=!1;try{(r=yield ur(c,e,o,s)).blockingList.push(...[...o.tplStateStoreMap.values()].map((e=>e.waitForAll())),...o.pendingPermissionsPreCheck),(0,v.flushStableLoadBricks)(),yield Promise.all(r.blockingList)}catch(e){l=!0,r={node:{tag:rr.BRICK,type:"div",properties:{textContent:It(e)},return:c,runtimeContext:null},blockingList:[],menuRequests:[]}}c.child=r.node,null==i||i.dispose(),wr(t.main),wr(t.portal),a.sandbox&&(x(null!==(n=a.theme)&&void 0!==n?n:"light"),F("default"),l||s.dispatchBeforePageLoad(),N(),K()),Sr(c),a.sandbox&&window.scrollTo(0,0),l||(s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange())})),go.apply(this,arguments)}function yo(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return Va(t,(0,a.Z)((0,a.Z)({},sa()),{},{data:e}),{noInject:!0})}function bo(e){return(0,v.loadBricksImperatively)(e,oa())}function wo(e,t){var r=ca(e);Object.assign(r,(0,a.Z)((0,a.Z)({},t),{},{$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),S(r)}function So(e,t){var r=ca(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),o=(e,r)=>e.map((e=>{var i=a(e);return"routes"===e.type?(e.routes=o(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=o(r.routes,a(t)),n||r.routes.unshift(t)}function Eo(e,t,r){var n="".concat(e,".").concat(t.name);ct.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),ko(e,t.name,r)}function ko(e,t,r){Po(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.Z)({brick:t},(0,i.pick)(r,"properties","events","lifeCycle","context"))])}function Zo(e,t){var r;Po(e,"${APP.homepage}/_dev_only_/snippet-preview/".concat(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}])}var Io=Zo;function Po(e,t,r){var{routes:n}=ca(e),a=n.findIndex((e=>e.path===t)),o={path:t,bricks:r,menu:!1,exact:!0};-1===a?n.unshift(o):n.splice(a,1,o)}}}]);
|
|
3
|
+
//# sourceMappingURL=2951.7e3cc858.js.map
|