@next-core/brick-container 3.5.18 → 3.5.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/brick-container",
3
- "version": "3.5.18",
3
+ "version": "3.5.20",
4
4
  "description": "Brick Container Server",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/brick-container",
6
6
  "license": "GPL-3.0",
@@ -45,11 +45,11 @@
45
45
  "@next-api-sdk/api-gateway-sdk": "^1.1.0",
46
46
  "@next-api-sdk/micro-app-standalone-sdk": "^1.1.0",
47
47
  "@next-core/build-next-bricks": "^1.13.4",
48
- "@next-core/easyops-runtime": "^0.6.19",
48
+ "@next-core/easyops-runtime": "^0.6.20",
49
49
  "@next-core/http": "^1.0.8",
50
50
  "@next-core/i18n": "^1.0.24",
51
51
  "@next-core/loader": "^1.4.0",
52
- "@next-core/runtime": "^1.21.0",
52
+ "@next-core/runtime": "^1.21.1",
53
53
  "@next-core/test-next": "^1.0.8",
54
54
  "@next-core/theme": "^1.1.1",
55
55
  "@next-core/types": "^1.6.0",
@@ -64,5 +64,5 @@
64
64
  "@next-core/runtime": "*",
65
65
  "@next-core/utils": "*"
66
66
  },
67
- "gitHead": "1cc7886b5cdf7eb8bd0fcddd2955fbd6ea8f88ce"
67
+ "gitHead": "ab2c712802df81f8f9703acb60ae3fc30a57324f"
68
68
  }
@@ -46,6 +46,76 @@ def get_snippets_from_stories(stories_content):
46
46
  return ret_snippets
47
47
 
48
48
 
49
+ def get_v3_story(br):
50
+ story_id = br.get("name", "")
51
+ if not story_id:
52
+ return
53
+ story = { "storyId": story_id, "v3Brick": True, "type": "brick" }
54
+ desc = br.get("description")
55
+ if type(desc) != dict:
56
+ desc = {"en": desc, "zh": desc}
57
+ story["description"] = desc
58
+
59
+ text = br.get("text")
60
+ if not text:
61
+ text = desc
62
+ story["text"] = text
63
+
64
+ story["category"] = br.get("category", "other")
65
+ story["alias"] = br.get("alias", [])
66
+ story["icon"] = br.get("icon")
67
+
68
+ doc = br.get("doc", {})
69
+ properties = br.get("properties")
70
+ events = br.get("events")
71
+ slots = br.get("slots")
72
+ methods = br.get("methods")
73
+ parts = br.get("parts")
74
+ if "id" not in doc:
75
+ doc["id"] = story_id
76
+ if "name" not in doc:
77
+ doc["name"] = story_id
78
+ if "docKink" not in doc:
79
+ doc["docKink"] = "brick"
80
+ if "description" not in doc:
81
+ doc["description"] = desc
82
+ if "properties" not in doc:
83
+ doc["properties"] = properties
84
+ if "events" not in doc:
85
+ doc["events"] = events
86
+ if "methods" not in doc:
87
+ doc["methods"] = methods
88
+ if "parts" not in doc:
89
+ doc["parts"] = parts
90
+ # TODO: interface in doc
91
+ story["doc"] = doc
92
+
93
+ # TODO: conf
94
+
95
+ return story
96
+
97
+
98
+ def collect_stories(install_path):
99
+ stories_path = os.path.join(install_path, "dist", "stories.json")
100
+ manifest_path = os.path.join(install_path, "dist", "manifest.json")
101
+ # v2 brick
102
+ if os.path.exists(stories_path):
103
+ with open(stories_path) as stories_file:
104
+ stories_content = simplejson.load(stories_file)
105
+ return stories_content
106
+ # v3 brick
107
+ elif os.path.exists(manifest_path):
108
+ with open(manifest_path) as manifest_file:
109
+ manifest_content = simplejson.load(manifest_file)
110
+ stories_content = []
111
+ for br in manifest_content.get("bricks", []):
112
+ story = get_v3_story(br)
113
+ if story:
114
+ stories_content.append(story)
115
+ return stories_content
116
+ return []
117
+
118
+
49
119
  def collect(install_path):
50
120
  if not os.path.exists(install_path):
51
121
  raise Exception("could not find install path {}".format(install_path))
@@ -60,10 +130,7 @@ def collect(install_path):
60
130
  stories_path = os.path.join(install_path, "dist", "stories.json")
61
131
  with open(bricks_path) as bricks_file:
62
132
  bricks_content = simplejson.load(bricks_file)
63
- stories_content = []
64
- if os.path.exists(stories_path):
65
- with open(stories_path) as stories_file:
66
- stories_content = simplejson.load(stories_file)
133
+ stories_content = collect_stories(install_path)
67
134
  snippets_from_stories = get_snippets_from_stories(stories_content)
68
135
  snippets_path = os.path.join(install_path, "dist", "snippets.json")
69
136
  snippets_content = {"snippets": []}
@@ -237,3 +304,4 @@ if __name__ == "__main__":
237
304
  report_nt(org, install_path)
238
305
  else:
239
306
  sys.exit(0)
307
+
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_next_core_brick_container=self.webpackChunk_next_core_brick_container||[]).push([[321],{3350:(e,t,r)=>{r.r(t);var n=r(4795),a=r(3028),i=r(1181),o=r(9516),s=r(6236),c=r(601);r(5745),XMLHttpRequest.prototype.origOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.origOpen.apply(this,t);var n=c.auth.getAuth().csrfToken;n&&this.setRequestHeader("X-CSRF-Token",n)};var l=r(1989);function u(){return p.apply(this,arguments)}function p(){return(p=(0,n.Z)((function*(){if(!window.NO_AUTH_GUARD){var e=yield(0,l.u)();e.loggedIn&&c.auth.authenticate(e)}}))).apply(this,arguments)}var d=r(2159),f=r(9397),v=r(9505),h=r(8843),m=r(9686),g=r(5178),y=r(9169),b=r(3934);function w(e,t,r){return{get(n){if(t)return"".concat((0,i.getBasePath)(),"api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/").concat(n);var a=window.APP_ROOT?"".concat(window.APP_ROOT,"-/"):"";return window.APP_ID&&window.APP_ID!==e&&(a=a.replace(new RegExp("(^|/)".concat((0,g.escapeRegExp)(window.APP_ID),"/")),"$1".concat(e,"/")).replace(/\/\d+\.\d+\.\d+\//,"/".concat(r,"/"))),a.startsWith("/")||(a=(0,i.getBasePath)()+a),"".concat(a,"micro-apps/").concat(e,"/images/").concat(n)}}}var S=["feature_flags"],E=["featureFlags","misc"];function k(){return(k=(0,n.Z)((function*(){var e=[o.http.get(window.BOOTSTRAP_FILE),o.http.get("".concat(window.APP_ROOT,"conf.yaml"),{responseType:"text"}),(0,v.I)().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&&P(r)}var[n,i,s]=yield Promise.all(e);return function(e,t){var r;try{r=t?(0,y.safeLoad)(t,{schema:y.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:i,user_config_by_apps:o}=r;if(n){var{feature_flags:s}=n,c=(0,d.Z)(n,S);e.settings=(0,a.Z)({featureFlags:s},c)}if(i&&1===e.storyboards.length)e.storyboards[0].app.userConfig=i;else if(o)for(var{app:l}of e.storyboards)(0,m.hasOwnProperty)(o,l.id)&&(l.userConfig=o[l.id])}}(n,i),function(e,t){var r;if(t){var{featureFlags:n,misc:i}=t,o=(0,d.Z)(t,E),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),i),Object.assign(s,o)}}(n,null==s?void 0:s.settings),n}))).apply(this,arguments)}var A=new Map;function P(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,n.Z)((function*(e){if(A.has(e))return A.get(e);var t=(0,b.z)(e).catch((e=>{console.warn("request standalone runtime api from micro-app-standalone failed: ",e,", something might went wrong running standalone micro app")}));return A.set(e,t),t}))).apply(this,arguments)}function I(){return(I=(0,n.Z)((function*(e){if(window.STANDALONE_MICRO_APPS){if(!window.NO_AUTH_GUARD){var t=yield P(e.app.id);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&&O(t.overrideApp)}(n),e.meta=(0,a.Z)((0,a.Z)({},e.meta),{},{injectMenus:n})}}}else{var{routes:i,meta:o,app:s}=yield(0,h.i)(e.app.id,{});Object.assign(e,{routes:i,meta:o,app:(0,a.Z)((0,a.Z)({},e.app),s)})}!function(e){var t;if(e.app.menuIcon&&"imgSrc"in e.app.menuIcon&&null!==(t=e.app.menuIcon.imgSrc)&&void 0!==t&&t.startsWith("api/")){var r=e.app.menuIcon.imgSrc.split("/"),n=r[r.length-1],a=w(e.app.id,e.app.isBuildPush,e.app.currentVersion).get(n);e.app.menuIcon.imgSrc=a}}(e),O(e.app)}))).apply(this,arguments)}function O(e){e.config=(0,m.deepFreeze)((0,g.merge)({},e.defaultConfig,e.userConfig))}var C=r(2923),x=!1,T=/^https?:\/\/localhost(?:$|:)/;function R(){return(R=(0,n.Z)((function*(e,t){if(x||!t)return!1;if("failed"===(yield e))return!1;x=!0;var r=t===location.origin||T.test(t)||T.test(location.origin);if(!r){var{allowedPreviewFromOrigins:n}=(0,i.getRuntime)().getMiscSettings();Array.isArray(n)&&(r=n.some((e=>e===t))),r||console.error("Preview is disallowed, from origin: ".concat(t,", while allowing: ").concat(JSON.stringify(n)))}return r}))).apply(this,arguments)}var B=["agent"];o.http.interceptors.request.use((e=>{var t,r,n;null!==(t=e.options)&&void 0!==t&&null!==(t=t.interceptorParams)&&void 0!==t&&t.ignoreLoadingBar||window.dispatchEvent(new Event("request.start"));var i=new Headers((null===(r=e.options)||void 0===r?void 0:r.headers)||{});i.set("lang",null!==(n=s.i18n.resolvedLanguage)&&void 0!==n?n:s.i18n.language);var{csrfToken:o}=c.auth.getAuth();o&&i.set("X-CSRF-Token",o);var l=(()=>{for(var e="",t=0;t<16;t+=1)e+="0123456789abcdef"[Math.floor(16*Math.random())];return e})();return i.set("X-B3-Traceid","ffffffffffffffff".concat(l)),i.set("X-B3-Spanid",l),i.set("X-B3-Sampled","1"),(0,a.Z)((0,a.Z)({},e),{},{options:(0,a.Z)((0,a.Z)({},e.options),{},{headers:i})})})),o.http.interceptors.response.use((function(e){return window.dispatchEvent(new Event("request.end")),e}),(function(e){return window.dispatchEvent(new Event("request.end")),Promise.reject(e)}));var M=document.querySelector("#global-loading-bar");M.classList.add("rendered");var _=!1,L=0;function F(){var e=L>0;e!==_&&(_=e,M.classList[e?"add":"remove"]("loading"))}window.addEventListener("request.start",(()=>{L++,F()})),window.addEventListener("request.end",(()=>{L>0&&(L--,F())}));var N=(0,i.createRuntime)({hooks:{auth:c.auth,fulfilStoryboard:function(e){return I.apply(this,arguments)},checkPermissions:c.checkPermissions,flowApi:c.flowApi,checkInstalledApps:c.checkInstalledApps,menu:c.menu,images:{imagesFactory:w,widgetImagesFactory:function(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)}}}},messageDispatcher:c.messageDispatcher}});function U(){return(U=(0,n.Z)((function*(){try{var[,e]=yield Promise.all([u(),window.STANDALONE_MICRO_APPS?function(){return k.apply(this,arguments)}():(0,f.S)({appFields:"defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons,standaloneMode",ignoreTemplateFields:"templates",ignoreBrickFields:"bricks,processors,providers,editors"})]);return yield N.bootstrap(e),"ok"}catch(e){return console.error("bootstrap failed:",e),document.body.classList.add("bootstrap-error"),document.querySelector("#main-mount-point").textContent="bootstrap failed: ".concat((0,i.httpErrorToString)(e)),"failed"}}))).apply(this,arguments)}var j=function(){return U.apply(this,arguments)}();window.parent!==window&&function(e){var t=function(){var r=(0,n.Z)((function*(r){var{data:n,origin:a}=r,i=function(e){return"preview-container"===(null==e?void 0:e.sender)&&"start-preview"===e.type}(n),o=function(e){return"ui-test-preview"===(null==e?void 0:e.channel)&&"initialize"===e.type}(n);if(i||o){window.removeEventListener("message",t);var s=yield function(e,t){return R.apply(this,arguments)}(e,a);if(s){var c,l;if(i){var u=n.options;({agent:c}=u),l=(0,d.Z)(u,B)}else({agent:c,options:l}=n.payload);yield(0,C.loadBricksImperatively)([c.brick],[c.pkg]);var p=document.createElement(c.brick);yield p.resolve(a,l)}}}));return function(e){return r.apply(this,arguments)}}();window.addEventListener("message",t)}(j)},6919:(e,t,r)=>{r.r(t),r.d(t,{cook:()=>F,isEvaluable:()=>K,isTrackAll:()=>G,precook:()=>D,precookFunction:()=>q,preevaluate:()=>H,shouldAllowRecursiveEvaluations:()=>z});var n=r(6666);class a{constructor(){(0,n.Z)(this,"VariableEnvironment",void 0),(0,n.Z)(this,"LexicalEnvironment",void 0),(0,n.Z)(this,"Function",void 0)}}class i{constructor(e){(0,n.Z)(this,"OuterEnv",void 0),(0,n.Z)(this,"bindingMap",new Map),this.OuterEnv=e}HasBinding(e){return this.bindingMap.has(e)}CreateMutableBinding(e,t){return this.bindingMap.set(e,{mutable:!0,deletable:t}),h(void 0)}CreateImmutableBinding(e,t){return this.bindingMap.set(e,{strict:t}),h(void 0)}InitializeBinding(e,t){var r=this.bindingMap.get(e);return Object.assign(r,{initialized:!0,value:t}),h(void 0)}SetMutableBinding(e,t,r){var n=this.bindingMap.get(e);if(!n.initialized)throw new ReferenceError("".concat(e," is not initialized"));if(!n.mutable)throw new TypeError("Assignment to constant variable");return n.value=t,h(void 0)}GetBindingValue(e,t){var r=this.bindingMap.get(e);if(!r.initialized)throw new ReferenceError("".concat(e," is not initialized"));return r.value}}class o extends i{}class s extends i{}var c=Symbol.for("SourceNode"),l=Symbol.for("FormalParameters"),u=Symbol.for("ECMAScriptCode"),p=Symbol.for("Environment"),d=Symbol.for("IsConstructor");class f{constructor(e,t,r){(0,n.Z)(this,"Base",void 0),(0,n.Z)(this,"ReferenceName",void 0),(0,n.Z)(this,"Strict",void 0),this.Base=e,this.ReferenceName=t,this.Strict=r}}class v{constructor(e,t){(0,n.Z)(this,"Type",void 0),(0,n.Z)(this,"Value",void 0),this.Type=e,this.Value=t}}function h(e){return new v("normal",e)}var m=Symbol("empty completion");function g(e){var t=new Set,r=e=>{if(Array.isArray(e))for(var n of e)r(n);else if(e)switch(e.type){case"Identifier":return void t.add(e.name);case"VariableDeclaration":return r(e.declarations);case"VariableDeclarator":case"FunctionDeclaration":return r(e.id);case"ArrayPattern":return r(e.elements);case"AssignmentPattern":return r(e.left);case"ObjectPattern":return r(e.properties);case"Property":return r(e.value);case"RestElement":return r(e.argument)}};return r(e),Array.from(t)}function y(e){var t=e=>{if(Array.isArray(e))return e.some(t);if(e)switch(e.type){case"ArrayPattern":return t(e.elements);case"AssignmentPattern":return!0;case"ObjectPattern":return t(e.properties);case"Property":return e.computed||t(e.value);case"RestElement":return t(e.argument)}};return t(e)}function b(e,t){var r=[],n={var:t.var},a=(e,t)=>{if(Array.isArray(e))for(var i of e)a(i,t);else if(e){switch(e.type){case"FunctionDeclaration":return void(Number(!t.var)^Number(t.topLevel)&&r.push(e));case"VariableDeclaration":return void(Number(!t.var)^Number("var"===e.kind)&&r.push(e));case"SwitchCase":return void a(e.consequent,n);case"CatchClause":return void a(e.body,n)}if(t.var)switch(e.type){case"BlockStatement":case"DoWhileStatement":case"WhileStatement":return void a(e.body,n);case"IfStatement":return a(e.consequent,n),void a(e.alternate,n);case"ForStatement":return a(e.init,n),void a(e.body,n);case"ForInStatement":case"ForOfStatement":return a(e.left,n),void a(e.body,n);case"SwitchStatement":return void a(e.cases,n);case"TryStatement":return a(e.block,n),a(e.handler,n),void a(e.finalizer,n)}}};return a(e,t),r}function w(e){return"unresolvable"!==e.Base&&!(e.Base instanceof i)}function S(e,t){return e.Base.InitializeBinding(e.ReferenceName,t)}function E(e,t,r){if(null==t)return e;var n=Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));for(var a of n)if(!r.has(a)){var i=Object.getOwnPropertyDescriptor(t,a);null!=i&&i.enumerable&&(e[a]=t[a])}return e}function k(e,t){var r="const"===e.kind;for(var n of g(e))r?t.CreateImmutableBinding(n,!0):t.CreateMutableBinding(n,!1)}function A(e){return"normal"===e.Type||"continue"==e.Type}function P(e,t){return e.Value!==m?e:new v(e.Type,t)}function Z(e){if(e instanceof v&&(e=e.Value),!(e instanceof f))return e;if("unresolvable"===e.Base)throw new ReferenceError("".concat(e.ReferenceName," is not defined"));return e.Base instanceof i?e.Base.GetBindingValue(e.ReferenceName,e.Strict):e.Base[e.ReferenceName]}function I(e){return"symbol"==typeof e?e:String(e)}function O(e,t){return e[t]}function C(e,t){if("unresolvable"===e.Base)throw new ReferenceError("".concat(e.ReferenceName," is not defined"));return e.Base instanceof i?e.Base.SetMutableBinding(e.ReferenceName,t,e.Strict):(e.Base[e.ReferenceName]=t,h(void 0))}function x(e){if(t=e,!(Array.isArray(t)||null!=t&&"function"==typeof t[Symbol.iterator]))throw new TypeError("".concat(typeof e," is not iterable"));var t;return e[Symbol.iterator]()}function T(e){if(null==e)throw new TypeError("Cannot destructure properties of undefined or null")}function R(e,t,r){return e?e.HasBinding(t)?new f(e,t,r):R(e.OuterEnv,t,r):new f("unresolvable",t,r)}function B(e,t,r){switch(t){case"+":return e+r;case"-":return e-r;case"/":return e/r;case"%":return e%r;case"*":return e*r;case"**":return e**r;case"==":return e==r;case"===":return e===r;case"!=":return e!=r;case"!==":return e!==r;case">":return e>r;case"<":return e<r;case">=":return e>=r;case"<=":return e<=r}throw new SyntaxError("Unsupported binary operator `".concat(t,"`"))}var M=new WeakSet([Function,Object,Function.prototype,Object.prototype,function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}()]);function _(e){if(M.has(e))throw new TypeError("Cannot access reserved objects such as `Function`.")}var L=new WeakSet([Array,Map,Set,URLSearchParams,WeakMap,WeakSet,RegExp]);function F(e,t){var r,{rules:n,globalVariables:i={},hooks:M={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},F="FunctionDeclaration"!==e.type,N=new o(null),U=new a;U.VariableEnvironment=N,U.LexicalEnvironment=N;var j=[U];for(var[D,V]of Object.entries(i))N.CreateImmutableBinding(D,!0),N.InitializeBinding(D,V);var W=new WeakMap;function $(e,r){var n,a,i;switch(null===(n=M.beforeEvaluate)||void 0===n||n.call(M,e),e.type){case"ArrayExpression":var s=[];for(var c of e.elements)if(c)if("SpreadElement"===c.type){var l=Z($(c.argument));s.push(...l)}else s.push(Z($(c)));else s.length+=1;return h(s);case"ArrowFunctionExpression":return pe(e),h(ie(e,q().LexicalEnvironment,!1));case"BinaryExpression":var u=Z($(e.left)),p=$(e.right).Value,y=Z(p);if(F&&"|>"===e.operator){if("function"!=typeof y){var b=t.substring(e.right.start,e.right.end);throw new TypeError("".concat(b," is not a function"))}var O;return p instanceof f&&w(p)&&(O=p.Base),h(y.call(O,u))}return h(B(u,e.operator,y));case"CallExpression":var T=$(e.callee,r).Value,R=Z(T);return null==R&&(e.optional||null!=r&&r.skipped)?(r.skipped=!0,h(void 0)):(_(R),te(R,T,e.arguments,e.callee));case"ChainExpression":return $(e.expression,{});case"ConditionalExpression":return h(Z($(Z($(e.test))?e.consequent:e.alternate)));case"Identifier":return h(H(e.name));case"Literal":if(e.regex){if(null===e.value)throw new SyntaxError("Invalid regular expression: ".concat(e.raw));if(e.regex.flags.includes("u"))throw new SyntaxError("Unsupported unicode flag in regular expression: ".concat(e.raw))}return h(e.value);case"LogicalExpression":var N=Z($(e.left));switch(e.operator){case"&&":return h(N&&Z($(e.right)));case"||":return h(N||Z($(e.right)));case"??":return h(null!=N?N:Z($(e.right)));default:throw new SyntaxError("Unsupported logical operator '".concat(e.operator,"'"))}case"MemberExpression":var U=Z($(e.object,r).Value);if(null==U&&(e.optional||null!=r&&r.skipped))return r.skipped=!0,h(void 0);_(U);var j=e.computed?function(e,t,r){var n=I(Z($(t)));return new f(e,n,!0)}(U,e.property):function(e,t,r){var n=t.name;return new f(e,n,!0)}(U,e.property);return _(j),h(j);case"NewExpression":return function(e,r){var n=Z($(e)),a=re(r);if("function"!=typeof n||!1===n[d]){var i=t.substring(e.start,e.end);throw new TypeError("".concat(i," is not a constructor"))}if(!function(e){return L.has(e)||e===Date}(n)){var o=t.substring(e.start,e.end);throw new TypeError("".concat(o," is not an allowed constructor"))}return h(new n(...a))}(e.callee,e.arguments);case"ObjectExpression":var D={};for(var V of e.properties)if("SpreadElement"===V.type)E(D,Z($(V.argument)),new Set);else{if("init"!==V.kind)throw new SyntaxError("Unsupported object getter/setter");var W=V.computed||"Identifier"!==V.key.type?se(V.key):V.key.name;if("__proto__"===W)throw new TypeError("Setting '__proto__' property is not allowed");D[W]=Z($(V.value))}return h(D);case"SequenceExpression":var J;for(var X of e.expressions)J=h(Z($(X)));return J;case"TemplateLiteral":var Q=[e.quasis[0].value.cooked],ae=0;for(var ce of e.expressions){var le=Z($(ce));Q.push(String(le)),Q.push(e.quasis[ae+=1].value.cooked)}return h(Q.join(""));case"TaggedTemplateExpression":var ue=$(e.tag).Value,de=Z(ue);return _(de),te(de,ue,e.quasi,e.tag);case"UnaryExpression":var fe=$(e.argument).Value;if(!F&&"delete"===e.operator){if(!(fe instanceof f))return h(!0);if(w(fe))return h(delete fe.Base[fe.ReferenceName])}return"typeof"===e.operator?fe instanceof f&&"unresolvable"===fe.Base?h("undefined"):h(typeof Z(fe)):h(function(e,t){switch(t){case"!":return!e;case"+":return+e;case"-":return-e;case"void":return}throw new SyntaxError("Unsupported unary operator `".concat(t,"`"))}(Z(fe),e.operator))}if(!F)switch(e.type){case"AssignmentExpression":if("="===e.operator){if("ArrayPattern"!==e.left.type&&"ObjectPattern"!==e.left.type){var ve=$(e.left).Value,he=Z($(e.right));return C(ve,he),h(he)}var me=Z($(e.right));return Y(e.left,me),h(me)}var ge=$(e.left).Value,ye=Z(ge),be=Z($(e.right)),we=function(e,t,r){switch(t){case"+=":case"-=":case"*=":case"/=":case"%=":case"**=":return B(e,t.substr(0,t.length-1),r)}throw new SyntaxError("Unsupported assignment operator `".concat(t,"`"))}(ye,e.operator,be);return C(ge,we),h(we);case"BlockStatement":if(!e.body.length)return h(m);var Se=q().LexicalEnvironment,Ee=new o(Se);ee(e.body,Ee),q().LexicalEnvironment=Ee;var ke=ne(e.body);return q().LexicalEnvironment=Se,ke;case"BreakStatement":return new v("break",m);case"ContinueStatement":return new v("continue",m);case"EmptyStatement":case"FunctionDeclaration":return h(m);case"DoWhileStatement":return K(function(e){for(var t;;){var r=$(e.body);if(!A(r))return P(r,t);if(r.Value!==m&&(t=r.Value),!Z($(e.test)))return h(t)}}(e));case"ExpressionStatement":case"TSAsExpression":return $(e.expression);case"ForInStatement":case"ForOfStatement":return K(function(e){var t=e.left,r="VariableDeclaration"===t.type?"var"===t.kind?"varBinding":"lexicalBinding":"assignment",n="lexicalBinding"===r?g(t):[],a="ForInStatement"===e.type?"enumerate":"iterate",i=function(e,t,r){var n=q(),a=n.LexicalEnvironment;if(e.length>0){var i=new o(a);for(var s of e)i.CreateMutableBinding(s,!1);n.LexicalEnvironment=i}var c=$(t);n.LexicalEnvironment=a;var l=Z(c);if("enumerate"===r){if(null==l)return new v("break",m);var u=function*(e){for(var t in e)yield t}(l);return h(u)}return h(x(l))}(n,e.right,a);return"normal"!==i.Type?i:function(e,t,r,n,a){for(var i,s="assignment"===a?e:e.declarations[0].id,c=q().LexicalEnvironment,l="ObjectPattern"===s.type||"ArrayPattern"===s.type;;){var{done:u,value:p}=r.next();if(u)return h(i);var d=void 0,f=void 0;if("lexicalBinding"===a){if(k(e,f=new o(c)),q().LexicalEnvironment=f,!l){var[v]=g(s);d=H(v)}}else l||(d=$(s).Value);l?"assignment"===a?Y(s,p):oe(s,p,"varBinding"===a?void 0:f):"lexicalBinding"===a?S(d,p):C(d,p);var y=$(t);if(q().LexicalEnvironment=c,!A(y)){var b=P(y,i);if("enumerate"!==n&&void 0!==r.return){var w=r.return();if(!w||!["object","function"].includes(typeof w))throw new TypeError("Iterator result is not an object")}return b}y.Value!==m&&(i=y.Value)}}(t,e.body,i.Value,a,r)}(e));case"ForStatement":return K(function(e){var t;if("VariableDeclaration"===(null===(t=e.init)||void 0===t?void 0:t.type)){if("var"===e.init.kind)return $(e.init),G(e.test,e.update,e.body,[]);var r=q().LexicalEnvironment,n=new o(r),a="const"===e.init.kind,i=g(e.init);for(var s of i)a?n.CreateImmutableBinding(s,!0):n.CreateMutableBinding(s,!1);q().LexicalEnvironment=n,$(e.init);var c=a?[]:Array.from(i),l=G(e.test,e.update,e.body,c);return q().LexicalEnvironment=r,l}return e.init&&Z($(e.init)),G(e.test,e.update,e.body,[])}(e));case"FunctionExpression":return pe(e),h(function(e){var t=q().LexicalEnvironment;if(e.id){var r=e.id.name,n=new o(t);n.CreateImmutableBinding(r,!1);var a=ie(e,n,!0);return n.InitializeBinding(r,a),a}return ie(e,t,!0)}(e));case"IfStatement":return Z($(e.test))?(null!==(a=M.beforeBranch)&&void 0!==a&&a.call(M,e,"if"),P($(e.consequent),void 0)):(null!==(i=M.beforeBranch)&&void 0!==i&&i.call(M,e,"else"),e.alternate?P($(e.alternate),void 0):h(void 0));case"ReturnStatement":var Ae;return e.argument&&(Ae=Z($(e.argument))),new v("return",Ae);case"ThrowStatement":throw Z($(e.argument));case"UpdateExpression":var Pe=$(e.argument).Value,Ze=Number(Z(Pe)),Ie="++"===e.operator?Ze+1:Ze-1;return C(Pe,Ie),h(e.prefix?Ie:Ze);case"SwitchCase":return ne(e.consequent);case"SwitchStatement":var Oe=Z($(e.discriminant)),Ce=q().LexicalEnvironment,xe=new o(Ce);ee(e.cases,xe),q().LexicalEnvironment=xe;var Te=function(e,t){var r,n=e.findIndex((e=>!e.test)),a=n>=0,i=a?e.slice(0,n):e,o=!1;for(var s of i)if(o||(o=z(s,t)),o){var c=$(s);if(c.Value!==m&&(r=c.Value),"normal"!==c.Type)return P(c,r)}if(!a)return h(r);var l=!1,u=e.slice(n+1);if(!o)for(var p of u)if(l||(l=z(p,t)),l){var d=$(p);if(d.Value!==m&&(r=d.Value),"normal"!==d.Type)return P(d,r)}if(l)return h(r);var f=$(e[n]);if(f.Value!==m&&(r=f.Value),"normal"!==f.Type)return P(f,r);for(var v of u){var g=$(v);if(g.Value!==m&&(r=g.Value),"normal"!==g.Type)return P(g,r)}return h(r)}(e.cases,Oe);return q().LexicalEnvironment=Ce,K(Te);case"TryStatement":var Re;try{Re=$(e.block)}catch(t){if(!e.handler)throw t;var Be;null===(Be=M.beforeEvaluate)||void 0===Be||Be.call(M,e.handler),Re=function(e,t){if(!e.param)return $(e.body);var r=q().LexicalEnvironment,n=new o(r);for(var a of g(e.param))n.CreateMutableBinding(a,!1);q().LexicalEnvironment=n,oe(e.param,t,n);var i=$(e.body);return q().LexicalEnvironment=r,i}(e.handler,t)}finally{if(e.finalizer){var Me=$(e.finalizer);"normal"!==Me.Type&&(Re=Me)}}return Re;case"VariableDeclaration":var _e;for(var Le of e.declarations)if(Le.init)if("Identifier"===Le.id.type){var Fe=H(Le.id.name),Ne=Z($(Le.init));_e="var"===e.kind?C(Fe,Ne):S(Fe,Ne)}else{var Ue=Z($(Le.init));_e=oe(Le.id,Ue,"var"===e.kind?void 0:q().LexicalEnvironment)}else _e="var"===e.kind?h(m):S(H(Le.id.name),void 0);return _e;case"WhileStatement":return K(function(e){for(var t;;){if(!Z($(e.test)))return h(t);var r=$(e.body);if(!A(r))return P(r,t);r.Value!==m&&(t=r.Value)}}(e))}throw new SyntaxError("Unsupported node type `".concat(e.type,"`"))}function q(){return j[j.length-1]}function H(e,t){return t||(t=q().LexicalEnvironment),R(t,e,!0)}function K(e){return"break"===e.Type?e.Value===m?h(void 0):h(e.Value):e}function z(e,t){return t===Z($(e.test))}function G(e,t,r,n){var a;for(J(n);;){if(e&&!Z($(e)))return h(a);var i=$(r);if(!A(i))return P(i,a);i.Value&&(a=i.Value),J(n),t&&Z($(t))}}function J(e){if(0!==e.length){var t=q().LexicalEnvironment,r=t.OuterEnv,n=new o(r);for(var a of e){n.CreateMutableBinding(a,!1);var i=t.GetBindingValue(a,!1);n.InitializeBinding(a,i)}q().LexicalEnvironment=n}}function Y(e,t){if("ObjectPattern"===e.type)return T(t),e.properties.length>0&&function(e,t){var r=new Set;for(var n of e)if("Property"===n.type){var a=n.computed||"Identifier"!==n.key.type?se(n.key):n.key.name,i="AssignmentPattern"===n.value.type?n.value.left:n.value;if("Identifier"===i.type){var o=H(i.name),s=O(t,a);"AssignmentPattern"===n.value.type&&void 0===s&&(s=Z($(n.value.right))),C(o,s),r.add(a)}else X(n.value,t,a),r.add(a)}else Q(n,t,r)}(e.properties,t),h(m);var r=x(t);return function(e,t){var r=h(m);for(var n of e)if(n){var a="RestElement"===n.type?n.argument:"AssignmentPattern"===n.type?n.left:n,i="ArrayPattern"===a.type||"ObjectPattern"===a.type,o=void 0;i||(o=$(a).Value);var s=void 0;if("RestElement"!==n.type){var{done:c,value:l}=t.next(),u=c?void 0:l;s="AssignmentPattern"===n.type&&void 0===u?Z($(n.right)):u}else{s=[];for(var p=0;;){var{done:d,value:f}=t.next();if(d)break;s[p]=f,p++}}r=i?Y(a,s):C(o,s)}else t.next(),r=h(m);return r}(e.elements,r)}function X(e,t,r){var n,a="AssignmentPattern"===e.type?e.left:e,i="ArrayPattern"===a.type||"ObjectPattern"===a.type;i||(n=$(a).Value);var o,s=O(t,r);return o="AssignmentPattern"===e.type&&void 0===s?Z($(e.right)):s,i?Y(a,o):C(n,o)}function Q(e,t,r){return C($(e.argument).Value,E({},t,r))}function ee(e,t){var r=b(e,{var:!1,topLevel:!1});for(var n of r){var a="VariableDeclaration"===n.type&&"const"===n.kind;for(var i of g(n))a?t.CreateImmutableBinding(i,!0):t.CreateMutableBinding(i,!1);if("FunctionDeclaration"===n.type){var[o]=g(n),s=ae(n,t);t.InitializeBinding(o,s)}}}function te(e,r,n,a){var i;r instanceof f&&w(r)&&(i=r.Base);var o=re(n);if("function"!=typeof e){var s=t.substring(a.start,a.end);throw new TypeError("".concat(s," is not a function"))}var c=e.apply(i,o);return _(c),h(c)}function re(e){var t=[];if(Array.isArray(e))for(var r of e)if("SpreadElement"===r.type){var n=Z($(r.argument));t.push(...n)}else t.push(Z($(r)));else for(var a of(t.push(function(e){var t=W.get(e);if(t)return t;var r=e.quasis.map((e=>e.value.raw)),n=e.quasis.map((e=>e.value.cooked));return Object.freeze(r),Object.defineProperty(n,"raw",{value:r,writable:!1,enumerable:!1,configurable:!1}),Object.freeze(n),W.set(e,n),n}(e)),e.expressions))t.push(Z($(a)));return t}function ne(e){var t=h(m);for(var r of e){var n=$(r);if("normal"!==n.Type)return n;t=P(t,n.Value)}return t}function ae(e,t){return ie(e,t,!0)}function ie(e,t,r){var i=function(){return function(e,t){var r;null===(r=M.beforeCall)||void 0===r||r.call(M,e[c]),function(e){var t=new a;t.Function=e;var r=new s(e[p]);t.VariableEnvironment=r,t.LexicalEnvironment=r,j.push(t)}(e);var i=function(e,t){return function(e,t,r){return function(e,t){for(var r=q(),a=e[u],i=e[l],s=g(i),c=y(i),p=b(a,{var:!0,topLevel:!0}),d=g(p),f=[],v=[],h=p.length-1;h>=0;h--){var m=p[h];if("FunctionDeclaration"===m.type){pe(m);var[w]=g(m);f.includes(w)||(f.unshift(w),v.unshift(m))}else if(null!=n&&n.noVar)throw new SyntaxError("Var declaration is not recommended, use `let` or `const` instead")}var S,E=r.LexicalEnvironment;for(var k of s)E.CreateMutableBinding(k,!1);if(le(i,x(t),E),c)for(var A of(S=new o(E),r.VariableEnvironment=S,d)){S.CreateMutableBinding(A,!1);var P=void 0;s.includes(A)&&!f.includes(A)&&(P=E.GetBindingValue(A,!1)),S.InitializeBinding(A,P)}else{for(var Z of d)s.includes(Z)||(E.CreateMutableBinding(Z,!1),E.InitializeBinding(Z,void 0));S=E}var I=S;r.LexicalEnvironment=I;var O=b(a,{var:!1,topLevel:!0});for(var C of O)for(var T of g(C))"const"===C.kind?I.CreateImmutableBinding(T,!0):I.CreateMutableBinding(T,!1);for(var R of v){var[B]=g(R),M=ae(R,I);S.SetMutableBinding(B,M,!1)}}(t,r),Array.isArray(e)?ne(e):new v("return",Z($(e)))}(e[u],e,t)}(e,t);if(j.pop(),"return"===i.Type)return i.Value}(i,arguments)};return Object.defineProperties(i,{[c]:{value:e},[l]:{value:e.params},[u]:{value:"BlockStatement"===e.body.type?e.body.body:e.body},[p]:{value:t},[d]:{value:r}}),i}function oe(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){return r.InitializeBinding(e,t),h(m)}(e.name,t,r);case"ObjectPattern":return T(t),function(e,t,r){var n=new Set;for(var a of e){if("RestElement"===a.type)return ce(a,t,r,n);if(a.computed||"Identifier"!==a.key.type){var i=se(a.key);ue(a.value,t,r,i),n.add(i)}else ue(a.value,t,r,a.key.name),n.add(a.key.name)}return h(m)}(e.properties,t,r);case"ArrayPattern":var n=x(t);return le(e.elements,n,r)}}function se(e){return I(Z($(e)))}function ce(e,t,r,n){var a=H(e.argument.name,r),i=E({},t,n);return r?S(a,i):C(a,i)}function le(e,t,r){if(0===e.length)return h(m);var n;for(var a of e)if(a)if("RestElement"===a.type)if("Identifier"===a.argument.type)for(var i=H(a.argument.name,r),o=[],s=0;;){var{done:c,value:l}=t.next();if(c){n=r?S(i,o):C(i,o);break}o[s]=l,s++}else for(var u=[],p=0;;){var{done:d,value:f}=t.next();if(d){n=oe(a.argument,u,r);break}u[p]=f,p++}else{var v="AssignmentPattern"===a.type?a.left:a;switch(v.type){case"ObjectPattern":case"ArrayPattern":var g=void 0,{done:y,value:b}=t.next();y||(g=b),"AssignmentPattern"===a.type&&void 0===g&&(g=Z($(a.right))),n=oe(v,g,r);break;case"Identifier":var w=H(v.name,r),E=void 0,{done:k,value:A}=t.next();k||(E=A),"AssignmentPattern"===a.type&&void 0===E&&(E=Z($(a.right))),n=r?S(w,E):C(w,E)}}else t.next(),n=h(m);return n}function ue(e,t,r,n){if("Identifier"===e.type||"AssignmentPattern"===e.type&&"Identifier"===e.left.type){var a=H("Identifier"===e.type?e.name:e.left.name,r),i=O(t,n);return"AssignmentPattern"===e.type&&void 0===i&&(i=Z($(e.right))),r?S(a,i):C(a,i)}var o=O(t,n);return"AssignmentPattern"===e.type&&void 0===o&&(o=Z($(e.right))),oe("AssignmentPattern"===e.type?e.left:e,o,r)}function pe(e){if(e.async||e.generator)throw new SyntaxError("".concat(e.async?"Async":"Generator"," function is not allowed"));if(F&&!e.expression)throw new SyntaxError("Only an `Expression` is allowed in `ArrowFunctionExpression`'s body")}if(F)return Z($(e));null===(r=M.beforeEvaluate)||void 0===r||r.call(M,e),pe(e);var[de]=g(e);N.CreateImmutableBinding(de,!0);var fe=ae(e,N);return N.InitializeBinding(de,fe),fe}var N=r(3028);class U{constructor(){(0,n.Z)(this,"VariableEnvironment",void 0),(0,n.Z)(this,"LexicalEnvironment",void 0)}}class j{constructor(e){(0,n.Z)(this,"OuterEnv",void 0),(0,n.Z)(this,"bindingSet",new Set),this.OuterEnv=e}HasBinding(e){return this.bindingSet.has(e)}CreateBinding(e){this.bindingSet.add(e)}}function D(e){var{expressionOnly:t,visitors:r,withParent:n,hooks:a={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new Set,o=[],s=new j(null),c=new U;function l(){return o[o.length-1]}function u(e,t,r){for(var n of t)p(e[n],null==r?void 0:r.concat({node:e,key:n}))}function p(e,n){if(Array.isArray(e))e.forEach(((e,t)=>{p(e,n?n.slice(0,-1).concat((0,N.Z)((0,N.Z)({},n[n.length-1]),{},{index:t})):n)}));else if(e){var o,s;switch(null===(o=a.beforeVisit)||void 0===o||o.call(a,e,n),function(e){var t,n;r&&(t=r,n=e.type,Object.prototype.hasOwnProperty.call(t,n))&&r[e.type](e)}(e),e.type){case"Identifier":var c;return V=e.name,void(f(l().LexicalEnvironment,V)||(null===(c=a.beforeVisitGlobal)||void 0===c||c.call(a,e,n),i.add(e.name)));case"ArrayExpression":case"ArrayPattern":return void u(e,["elements"],n);case"ArrowFunctionExpression":return void h(m(e,l().LexicalEnvironment),n);case"AssignmentPattern":case"BinaryExpression":case"LogicalExpression":return void u(e,["left","right"],n);case"CallExpression":case"NewExpression":return void u(e,["callee","arguments"],n);case"ChainExpression":return void u(e,["expression"],n);case"ConditionalExpression":return void u(e,["test","consequent","alternate"],n);case"MemberExpression":return u(e,["object"],n),void(e.computed&&u(e,["property"],n));case"ObjectExpression":case"ObjectPattern":return void u(e,["properties"],n);case"Property":return e.computed&&u(e,["key"],n),void u(e,["value"],n);case"RestElement":case"SpreadElement":case"UnaryExpression":return void u(e,["argument"],n);case"SequenceExpression":case"TemplateLiteral":return void u(e,["expressions"],n);case"TaggedTemplateExpression":return void u(e,["tag","quasi"],n);case"Literal":return}if(!t)switch(e.type){case"AssignmentExpression":return void u(e,["right","left"],n);case"BlockStatement":if(!e.body.length)return;var y=l(),b=y.LexicalEnvironment,w=new j(b);return v(e.body,w),y.LexicalEnvironment=w,u(e,["body"],n),void(y.LexicalEnvironment=b);case"BreakStatement":case"ContinueStatement":case"EmptyStatement":return;case"CatchClause":var S=l(),E=S.LexicalEnvironment,k=new j(E);return d(e.param,k),S.LexicalEnvironment=k,u(e,["param","body"],n),void(S.LexicalEnvironment=E);case"DoWhileStatement":return void u(e,["body","test"],n);case"ExpressionStatement":case"TSAsExpression":return void u(e,["expression"],n);case"ForInStatement":case"ForOfStatement":var A="VariableDeclaration"===e.left.type&&"var"!==e.left.kind,P=l(),Z=P.LexicalEnvironment;if(A){var I=new j(Z);d(e.left,I),P.LexicalEnvironment=I}if(u(e,["right"],n),P.LexicalEnvironment=Z,A){var O=new j(Z);d(e.left,O),P.LexicalEnvironment=O}return u(e,["left","body"],n),void(P.LexicalEnvironment=Z);case"ForStatement":var C,x="VariableDeclaration"===(null===(C=e.init)||void 0===C?void 0:C.type)&&"var"!==e.init.kind,T=l(),R=T.LexicalEnvironment;if(x){var B=new j(R);d(e.init,B),T.LexicalEnvironment=B}return u(e,["init","test","body","update"],n),void(T.LexicalEnvironment=R);case"FunctionDeclaration":var[M]=g(e),_=l().LexicalEnvironment,L=m(e,_);return _.CreateBinding(M),void h(L,n);case"FunctionExpression":return void h(function(e){var t=l().LexicalEnvironment;if(!e.id)return m(e,t);var r=e.id.name,n=new j(t);return n.CreateBinding(r),m(e,n)}(e),n);case"IfStatement":return void u(e,["test","consequent","alternate"],n);case"ReturnStatement":case"ThrowStatement":case"UpdateExpression":return void u(e,["argument"],n);case"SwitchCase":return void u(e,["test","consequent"],n);case"SwitchStatement":u(e,["discriminant"],n);var F=l(),U=F.LexicalEnvironment,D=new j(U);return v(e.cases,D),F.LexicalEnvironment=D,u(e,["cases"],n),void(F.LexicalEnvironment=U);case"TryStatement":return void u(e,["block","handler","finalizer"],n);case"VariableDeclaration":return void u(e,["declarations"],n);case"VariableDeclarator":return void u(e,["id","init"],n);case"WhileStatement":return void u(e,["test","body"],n)}(null===(s=a.beforeVisitUnknown)||void 0===s?void 0:s.call(a,e,n))||console.warn("Unsupported node type `".concat(e.type,"`"))}var V}function d(e,t){for(var r of g(e))t.CreateBinding(r)}function f(e,t){return!!e&&(e.HasBinding(t)||f(e.OuterEnv,t))}function v(e,t){d(b(e,{var:!1,topLevel:!1}),t)}function h(e,t){var r,n,a;r=e,n=new U,a=new j(r.Environment),n.VariableEnvironment=a,n.LexicalEnvironment=a,o.push(n),function(e,t){var r,n=l(),a=e.ECMAScriptCode,i=e.FormalParameters,o=y(i),s=g(b(a,{var:!0,topLevel:!0})),c=n.LexicalEnvironment;if(d(i,c),p(i,null==t?void 0:t.concat({node:e.Function,key:"params"})),o)for(var u of(r=new j(c),n.VariableEnvironment=r,s))r.CreateBinding(u);else{for(var f of s)c.CreateBinding(f);r=c}var v=r;n.LexicalEnvironment=v,d(b(a,{var:!1,topLevel:!0}),v)}(e,t),p(e.ECMAScriptCode,null==t?void 0:t.concat({node:e.Function,key:"body"}).concat("BlockStatement"===e.Function.body.type?{node:e.Function.body,key:"body"}:[])),o.pop()}function m(e,t){return{Function:e,FormalParameters:e.params,ECMAScriptCode:"BlockStatement"===e.body.type?e.body.body:e.body,Environment:t}}return c.VariableEnvironment=s,c.LexicalEnvironment=s,o.push(c),p(e,n?[]:void 0),i}var V=r(2159),W=r(1874),$=["typescript"];function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{typescript:r}=t,n=(0,V.Z)(t,$),a=function(e){var{typescript:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,W.Qc)(e,{plugins:["estree",t&&"typescript"].filter(Boolean),strictMode:!0,attachComment:!1}).program.body,n=t?[]:r;if(t)for(var a of r)if(a.type.startsWith("TS")){if(/Enum|Import|Export/.test(a.type))throw new SyntaxError("Unsupported TypeScript syntax: ".concat(a.type))}else n.push(a);if(0===n.length)throw new SyntaxError("Function declaration not found");if(n.length>1||"FunctionDeclaration"!==n[0].type)throw new SyntaxError("Expect a single function declaration at top level, but received: ".concat(n.map((e=>'"'.concat(e.type,'"'))).join(", ")));return n[0]}(e,{typescript:r});return{function:a,attemptToVisitGlobals:D(a,n)}}function H(e,t){var r=[],n=e.replace(/^\s*<%[~=]?\s|\s%>\s*$/g,(e=>(r.push(e),""))),a=function(e){return(0,W.BJ)(e,{plugins:["estree",["pipelineOperator",{proposal:"minimal"}]],attachComment:!1})}(n);return{expression:a,attemptToVisitGlobals:D(a,(0,N.Z)((0,N.Z)({},t),{},{expressionOnly:!0})),source:n,prefix:r[0],suffix:r[1]}}function K(e){return/^\s*<%[~=]?\s/.test(e)&&/\s%>\s*$/.test(e)}function z(e){return/^\s*<%~\s/.test(e)}function G(e){return/^\s*<%=\s/.test(e)&&/\s%>\s*$/.test(e)}},8539:(e,t,r)=>{r.r(t),r.d(t,{auth:()=>n,checkInstalledApps:()=>a,checkPermissions:()=>Xe,flowApi:()=>i,menu:()=>o,messageDispatcher:()=>Qe});var n={};r.r(n),r.d(n,{authenticate:()=>f,getAuth:()=>v,isLoggedIn:()=>m,logout:()=>h});var a={};r.r(a),r.d(a,{getCheckedApp:()=>ne,preCheckInstalledApps:()=>ee,waitForCheckingApps:()=>te});var i={};r.r(i),r.d(i,{FLOW_API_PROVIDER:()=>oe,clearCollectWidgetContract:()=>ye,collectContract:()=>me,collectWidgetContract:()=>ge,getArgsOfFlowApi:()=>Se,isFlowApiProvider:()=>we,registerFlowApiProvider:()=>ue});var o={};r.r(o),r.d(o,{fetchMenuById:()=>Je,getMenuById:()=>Ge});var s=r(4795),c=r(5178),l=r(3105),u=r(485),p=r(3028),d={};function f(e){Object.assign(d,{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 v(){return(0,p.Z)({},d)}function h(){for(var e of Object.keys(d))d[e]=void 0;g.length=0,y.clear()}function m(){return void 0!==d.username}var g=[],y=new Map;function b(){return(b=(0,s.Z)((function*(e,t){if(m()&&!v().isAdmin&&Array.isArray(e.permissionsPreCheck))return S(yield t(e.permissionsPreCheck))}))).apply(this,arguments)}function w(e){if(m()&&!v().isAdmin)return S((0,l.scanPermissionActionsInAny)(e))}function S(e){return E.apply(this,arguments)}function E(){return(E=(0,s.Z)((function*(e){var t=(0,c.difference)(e,[...g]);if(0!==t.length){g.push(...t);try{var r=yield(0,u.w)({actions:t});for(var n of r.actions)y.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)}var k=r(5866),A=r(3395),P=r(6171),Z=r(381),I=r(687),O=r(1181),C=1e3,x=6,T=new WeakMap,R=new WeakMap,B=new WeakMap,M=new WeakMap,_=new WeakMap,L=new WeakMap,F=new WeakMap,N=new WeakSet,U=new WeakSet;class j{constructor(e){(0,k.Z)(this,U),(0,k.Z)(this,N),(0,A.Z)(this,T,{writable:!0,value:void 0}),(0,A.Z)(this,R,{writable:!0,value:void 0}),(0,A.Z)(this,B,{writable:!0,value:[]}),(0,A.Z)(this,M,{writable:!0,value:new Set}),(0,A.Z)(this,_,{writable:!0,value:new Set}),(0,A.Z)(this,L,{writable:!0,value:0}),(0,A.Z)(this,F,{writable:!0,value:!1}),(0,Z.Z)(this,T,e)}send(e){(0,I.Z)(this,R)||(0,Z.Z)(this,R,(0,P.Z)(this,N,D).call(this));var t=JSON.stringify(e);(0,I.Z)(this,R).readyState===WebSocket.OPEN?(0,I.Z)(this,R).send(t):(0,I.Z)(this,B).push(t)}onMessage(e){(0,I.Z)(this,M).add(e)}onClose(e){(0,I.Z)(this,_).add(e)}reset(){(0,I.Z)(this,B).length=0,(0,I.Z)(this,M).clear(),(0,I.Z)(this,_).clear()}close(){var e;(0,Z.Z)(this,F,!0),(null===(e=(0,I.Z)(this,R))||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&(0,I.Z)(this,R).close()}}function D(){console.log("WebSocket connecting ...");var e=new WebSocket((0,I.Z)(this,T));return e.addEventListener("open",(t=>{for(var r of(console.log("WebSocket open:",t),(0,Z.Z)(this,L,0),(0,I.Z)(this,B)))e.send(r);(0,I.Z)(this,B).length=0})),e.addEventListener("close",(e=>{if(!(0,I.Z)(this,F)){for(var t of(console.log("WebSocket close:",e),(0,I.Z)(this,_)))t();1e3!==e.code&&(0,P.Z)(this,U,V).call(this)}})),e.addEventListener("error",(e=>{console.error("WebSocket error:",e)})),e.addEventListener("message",(e=>{var t=JSON.parse(e.data);for(var r of(0,I.Z)(this,M))r(t)})),e}function V(){if((0,I.Z)(this,L)>=x)console.error("WebSocket connect retry limit exceeded");else{var e=Math.pow(2,(0,I.Z)(this,L))*C;console.log("WebSocket will reconnect after %d seconds",e/1e3),setTimeout((()=>{var e;(0,Z.Z)(this,L,(e=(0,I.Z)(this,L),++e)),(0,Z.Z)(this,R,(0,P.Z)(this,N,D).call(this))}),e)}}var W=new WeakMap,$=new WeakMap,q=new WeakMap,H=new WeakMap,K=new WeakSet;function z(){if(!(0,I.Z)(this,W)){var e="https:"===location.protocol?"wss:":"ws:",t="".concat(e,"//").concat(window.location.host).concat((0,O.getBasePath)(),"api/websocket_service/v1/ws");(0,Z.Z)(this,W,new j(t))}return(0,I.Z)(this,W)}function G(e,t,r,n){var a=(0,I.Z)(this,$)[e].get(n);if(a)return a;var i={event:"sub"===e?"TOPIC.SUB":"TOPIC.UNSUB",payload:r},o=new Promise(((t,n)=>{var a=J(r);(0,I.Z)(this,H).onMessage((r=>{var i=r.event===("sub"===e?"TOPIC.SUB_SUCCESS":"TOPIC.UNSUB_SUCCESS"),o=r.event===("sub"===e?"TOPIC.SUB_FAILED":"TOPIC.UNSUB_FAILED");(i||o)&&a===J(r.payload)&&(i?t:n)(r)})),(0,I.Z)(this,H).send(i)}));return"sub"===e&&(0,I.Z)(this,q).set(t,n),(0,I.Z)(this,$)[e].set(n,o),o}function J(e){var{system:t,topic:r}=e;return JSON.stringify({system:t,topic:r})}var Y=r(5049),X=new Map,Q=new Map;function ee(e,t){if(window.STANDALONE_MICRO_APPS&&!window.NO_AUTH_GUARD){var r=function(e){var t,r={usedArgs:new Set},{customTemplates:n,menus:a}=null!==(t=e.meta)&&void 0!==t?t:{};return(0,l.traverseStoryboardExpressions)([e.routes,n,a],((e,t)=>{(0,l.collectInstalledAppsHasUsage)(r,e,t)}),"INSTALLED_APPS"),[...r.usedArgs]}(e),n=[];for(var a of r)X.has(a)||t(a)||n.push(a);if(0===n.length)return;var i=(0,Y.$)({query:{appId:{$in:n}},fields:["appId","currentVersion","installStatus"]}).catch((e=>{console.error("Get off site standalone micro-apps failed",e)})),o=function(e){X.set(e,i.then((t=>{var r,n=null==t||null===(r=t.list)||void 0===r?void 0:r.find((t=>t.appId===e)),a=n?(0,p.Z)((0,p.Z)({},n),{},{id:e}):void 0;return Q.set(e,a),a})))};for(var s of n)o(s)}}function te(e){return re.apply(this,arguments)}function re(){return(re=(0,s.Z)((function*(e){yield Promise.all(e.map((e=>X.get(e))))}))).apply(this,arguments)}function ne(e){if(window.STANDALONE_MICRO_APPS)return Q.get(e)}var ae=r(9686),ie=r(9516),oe="core.provider-flow-api";function se(e,t){return e.some((e=>e.source===t))}function ce(e){return le.apply(this,arguments)}function le(){return le=(0,s.Z)((function*(e){for(var t,{url:r,originalUri:n,method:a="GET",responseWrapper:i=!0,ext_fields:o=[],request:s,isFileType:l}=e,u=["get","delete","head"].includes(a.toLowerCase()),d=l?{responseType:"blob"}:{},f=arguments.length,v=new Array(f>1?f-1:0),h=1;h<f;h++)v[h-1]=arguments[h];if(u){var m,g,y,b,w,S;n&&"object"===(null==s?void 0:s.type)&&(null!==(m=null===(g=n.match(/:([^/]+)/g))||void 0===g?void 0:g.length)&&void 0!==m?m:0)===(null!==(y=null===(b=s.fields)||void 0===b?void 0:b.length)&&void 0!==y?y:0)?[S]=v:[w,S]=v,t=yield ie.http.simpleRequest(a,r,(0,p.Z)((0,p.Z)({params:w},d),S))}else{var E=function(e){if(!e||"object"!==e.type)return!1;var t=e=>!(0,c.isEmpty)(e)&&e.some((e=>["file","file[]"].includes(e.type)||t(e.fields)));return t(e.fields)}(s),k=function(e){for(var t=se(e,"query"),r=se(e,"body"),n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];if(t){if(r){var[o,s,c]=a;return{data:o,options:(0,p.Z)({params:s},c)}}var[l,u]=a;return{data:{},options:(0,p.Z)({params:l},u)}}var[d,f]=a;return{data:d,options:f}}(o,...v);t=yield ie.http.requestWithBody(a,r,E?function(e){if(e instanceof FormData)return e;var t=new FormData,r=function(e){Array.isArray(a)?a.forEach((r=>{t.append(e,r)})):!(0,c.isObject)(a)||a instanceof Blob||a instanceof Date?t.append(e,a):Object.entries(a).forEach((r=>{var[n,a]=r;t.append("".concat(e,"[").concat(n,"]"),a)}))};for(var[n,a]of Object.entries(e))r(n);return t}(k.data):k.data,(0,p.Z)((0,p.Z)({},d),k.options))}return!l&&i?t.data:t})),le.apply(this,arguments)}function ue(){customElements.define(oe,(0,ae.createProviderClass)(ce))}var pe=r(9169),de=r(7301),fe=new Map,ve=new Map,he=(e,t)=>{null==e||e.forEach((e=>{t.set("".concat(e.namespaceId,".").concat(e.name),e)}))};function me(e){he(e,fe)}function ge(e){he(e,ve)}function ye(){ve.clear()}var be=new Map;function we(e){return e.includes("@")}function Se(e,t,r){return Ee.apply(this,arguments)}function Ee(){return Ee=(0,s.Z)((function*(e,t,r){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=be.get(e);return t||(t=function(e){return ke.apply(this,arguments)}(e),be.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?pe.safeLoad(t.contract,{schema:pe.JSON_SCHEMA,json:!0}):t.contract,{uri:i,method:o="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(!i)throw new Error('Missing endpoint.uri in contract of provider "'.concat(e,'"'));return{uri:i,method:"list"===o.toLowerCase()?"get":o,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:i,ext_fields:o,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,i){var o=i?a?"api/gateway/".concat(a):"api/gateway/".concat(n,".").concat(r,"@").concat(i):"api/gateway/api_service.".concat(n,".").concat(r),s=t.slice();return{url:o+e.replace(/:([^/]+)/g,(()=>s.shift())),args:s}}(a,t,s,c,l,p);return[...v?[n]:[],{url:h,originalUri:a,method:i,ext_fields:o,responseWrapper:u,request:f,isFileType:d},...m]}(a,t,r)})),Ee.apply(this,arguments)}function ke(){return(ke=(0,s.Z)((function*(e){var[t,r]=e.split("@"),[n,a]=r.split(":"),i=function(e){return fe.get(e)||ve.get(e)}("".concat(t,".").concat(n));if(i)return{name:i.name,namespace:i.namespaceId,serviceName:i.serviceName,version:i.version,contract:{endpoint:i.endpoint,response:i.response,request:i.request}};var o,{contractData:s}=yield(0,de.e)({contractName:"".concat(t,".").concat(n),version:a});return s?{name:s.name,namespace:null===(o=s.namespace)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.name,serviceName:s.serviceName,version:s.version,contract:{endpoint:s.endpoint,response:s.response,request:s.request}}:void 0}))).apply(this,arguments)}var Ae=r(2159),Pe=r(2021),Ze=r(1206),Ie=r(6236),Oe=Symbol("appId"),Ce=Symbol("menuI18nNamespace"),xe=Symbol("overrideApp");function Te(){return(Te=(0,s.Z)((function*(e,t,r,n){if(e.dynamicItems&&e.itemsResolve){var a=e.app[0].appId,i=t;if(a!==t.app.id){var o,s=window.STANDALONE_MICRO_APPS?e.overrideApp:null===(o=n.getStoryboardByAppId(a))||void 0===o?void 0:o.app;i=(0,p.Z)((0,p.Z)({},t),{},{overrideApp:s,appendI18nNamespace:r.get(e)})}var c=yield n.resolveData((0,p.Z)({transform:"items"},e.itemsResolve),i);e.items=c.items}}))).apply(this,arguments)}function Re(){return Re=(0,s.Z)((function*(e,t,r){var n=e.find((e=>"inject"!==e.type));if(n){var a=[],i=new Map,o=new WeakMap,s=function*(){if(c.i18n){var e="menu/".concat(c.menuId,"~").concat(c.app[0].appId,"+").concat(c.instanceId);Object.entries(c.i18n).forEach((t=>{var[r,n]=t;Ie.i18n.addResourceBundle(r,e,n)})),o.set(c,e)}};for(var c of e)yield*s();for(var l of(yield Promise.all(e.map((e=>function(e,t,r,n){return Te.apply(this,arguments)}(e,t,o,r)))),e)){var u;if(null!==(u=l.items)&&void 0!==u&&u.length)if("inject"===l.type&&l.injectMenuGroupId){var d=i.get(l.injectMenuGroupId);d||(d=[],i.set(l.injectMenuGroupId,d)),d.push(l)}else a.push(l)}return(0,p.Z)((0,p.Z)({},n),{},{items:a.flatMap((e=>Be(e.items,e,i,o))),[Ce]:o.get(n),[xe]:n.overrideApp})}})),Re.apply(this,arguments)}function Be(e,t,r,n){return null==e?void 0:e.map((e=>{var a,i=e.groupId&&r.get(e.groupId);return i&&r.delete(e.groupId),(0,p.Z)((0,p.Z)({},e),{},{children:(null!==(a=Be(e.children,t,r,n))&&void 0!==a?a:[]).concat(i?i.flatMap((e=>Be(e.items,e,r,n))):[]),[Oe]:t.app[0].appId,[Ce]:n.get(t),[xe]:t.overrideApp})}))}function Me(e){e.items=_e(e.items)}function _e(e){return function(e){return(0,c.sortBy)(e,(e=>{var t;return null!==(t=e.sort)&&void 0!==t?t:-1/0}))}(e).map((e=>(0,p.Z)((0,p.Z)({},e),{},{children:_e(e.children)})))}var Le=r(8183),Fe=r(9044),Ne=["children"];function Ue(e,t,r,n){if("titleDataSource"in e&&(0,ae.isObject)(e.titleDataSource)&&Object.entries(e.titleDataSource).every((e=>{var[t,r]=e;return null===r||""===r}))&&delete e.titleDataSource,"if"in e&&null===e.if&&delete e.if,"to"in e&&e.to&&!(0,Fe.isEvaluable)(e.to)){var a=Le.pipes.yaml(e.to);(0,ae.isObject)(a)&&["pathname","search","hash"].some((e=>(0,ae.hasOwnProperty)(a,e)))&&(e.to=a)}var i=r;if(t!==r.app.id){var o,s=window.STANDALONE_MICRO_APPS?e[xe]:null===(o=n.getStoryboardByAppId(t))||void 0===o?void 0:o.app;i=(0,p.Z)((0,p.Z)({},r),{},{overrideApp:s,appendI18nNamespace:e[Ce]})}return n.asyncComputeRealValue(e,i,{ignoreSymbols:!0})}function je(e,t,r){return Promise.all(e.map(function(){var e=(0,s.Z)((function*(e){var{children:n}=e,a=(0,Ae.Z)(e,Ne),[i,o]=yield Promise.all([Ue(a,a[Oe],t,r),n&&(yield je(n,t,r))]);return(0,p.Z)((0,p.Z)({},i),{},{children:o})}));return function(t){return e.apply(this,arguments)}}()))}var De=r(682),Ve=new Map;function We(e){return $e.apply(this,arguments)}function $e(){return($e=(0,s.Z)((function*(e){if(e.title||(0,c.isEmpty)(e.titleDataSource))return e.title;var t=JSON.stringify(e.titleDataSource);if(Ve.has(t))return Ve.get(t);var r,{objectId:n,instanceId:a,attributeId:i}=e.titleDataSource,o=null!=i?i:"name",s=yield(0,De.q)(n,a,{fields:o});if("#showKey"===i&&Array.isArray(s[o])){var[l,...u]=s[o];r=u.length>0?"".concat(l,"(").concat(u.join(","),")"):String(l)}else r=String(s[o]);return Ve.set(t,r),r}))).apply(this,arguments)}var qe=["items","app"],He=new Map,Ke=new Map;function ze(e){return null==e?void 0:e.filter(O.checkIfOfComputed).map((e=>{var t=ze(e.children);return"group"===e.type?{type:"group",title:e.text,childLayout:e.childLayout,items:t}:null!=t&&t.length?{type:"subMenu",childLayout:e.childLayout,title:e.text,icon:e.icon,items:t,defaultExpanded:e.defaultExpanded}:e}))}function Ge(e){return Ke.get(e)}function Je(e,t,r){var n=He.get(e);return n||(n=function(e,t,r){return Ye.apply(this,arguments)}(e,t,r)),n}function Ye(){return Ye=(0,s.Z)((function*(e,t,r){var n=window.STANDALONE_MICRO_APPS?function(e,t,r){var n,a,i,o,s=r.getStoryboardByAppId(t);return(null!==(n=null!==(a=null===(i=s.meta)||void 0===i?void 0:i.injectMenus)&&void 0!==a?a:null===(o=s.meta)||void 0===o?void 0:o.menus)&&void 0!==n?n:[]).filter((t=>t.menuId===e)).map((e=>{var r;return(0,p.Z)((0,p.Z)({},e),null!==(r=e.app)&&void 0!==r&&null!==(r=r[0])&&void 0!==r&&r.appId?{}:{app:[{appId:t}]})}))}(e,t.app.id,r):t.flags["three-level-menu-layout"]?(yield(0,Ze.h)(e,{menuObjectId:"EASYOPS_STORYBOARD_MENU"})).menus:(yield(0,Pe.x)("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,a=yield function(e,t,r){return Re.apply(this,arguments)}(n,t,r);if(!a)throw new Error("Menu not found: ".concat(e));Me(a);var{items:i,app:o}=a,s=(0,Ae.Z)(a,qe),l=(0,p.Z)((0,p.Z)({},t),{},{pendingPermissionsPreCheck:[...t.pendingPermissionsPreCheck,w([i,s])]});delete l.tplStateStoreId,delete l.forEachItem;var u=o[0].appId,[d,f]=yield Promise.all([Ue(s,u,l,r),je(i,l,r)]),v=(0,p.Z)((0,p.Z)({title:yield We(d)},(0,c.pick)(d,["icon","link","defaultCollapsed","defaultCollapsedBreakpoint"])),{},{menuItems:ze(f)});Ke.set(e,v)})),Ye.apply(this,arguments)}var Xe=Object.freeze({checkPermissions:function(){if(!m())return!1;if(v().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(y.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},preCheckPermissions:function(e){if(m()&&!v().isAdmin)return S((0,l.scanPermissionActionsInStoryboard)(e))},preCheckPermissionsForBrickOrRoute:function(e,t){return b.apply(this,arguments)}}),Qe=new class{constructor(){(0,k.Z)(this,K),(0,A.Z)(this,H,{get:z,set:void 0}),(0,A.Z)(this,W,{writable:!0,value:void 0}),(0,A.Z)(this,$,{writable:!0,value:{sub:new Map,unsub:new Map}}),(0,A.Z)(this,q,{writable:!0,value:new Map})}subscribe(e,t){var r=JSON.stringify(t);return(0,P.Z)(this,K,G).call(this,"sub",e,t,r)}unsubscribe(e){var t=(0,I.Z)(this,q).get(e);if(!t){var r='The message channel to unsubscribe "'.concat(e,'" is not found');return console.error(r),Promise.reject(new Error(r))}var n=JSON.parse(t),a=(0,P.Z)(this,K,G).call(this,"unsub",e,n,t);return(0,I.Z)(this,$).sub.delete(t),a.then((()=>{(0,I.Z)(this,q).delete(e)})),a}onMessage(e,t){var r=(0,I.Z)(this,q).get(e);r?(0,I.Z)(this,H).onMessage((e=>{"MESSAGE.PUSH"===e.event&&function(e,t){var r=JSON.parse(e);return r.system===t.system&&(r.topic===t.topic||"string"==typeof r.topic&&r.topic.includes("*")&&new RegExp("^".concat(r.topic.replace(/([^*]*)\*([^*]*)/g,((e,t,r)=>"".concat((0,c.escapeRegExp)(t),"[^/]*").concat((0,c.escapeRegExp)(r)))),"$")).test(t.topic))}(r,e.payload)&&t(e.payload.message)})):console.error('Message channel: "'.concat(e,'" not found'))}onClose(e){(0,I.Z)(this,H).onClose(e)}reset(){var e;(0,I.Z)(this,$).sub.clear(),(0,I.Z)(this,$).unsub.clear(),(0,I.Z)(this,q).clear(),null===(e=(0,I.Z)(this,W))||void 0===e||e.reset()}}},2424:(e,t,r)=>{r.r(t),r.d(t,{HttpAbortError:()=>m,HttpFetchError:()=>f,HttpParseError:()=>h,HttpResponseError:()=>v,createHttpInstance:()=>_,defaultAdapter:()=>C,fetch:()=>n,getUrlWithParams:()=>I,http:()=>M,isHttpAbortError:()=>A});var n=(e,t)=>{var r=new Request(e,Object.assign({credentials:"same-origin"},t));return self.fetch(r)},a=r(5866),i=r(3395),o=r(6666),s=r(687),c=r(6171),l=r(381),u=r(3028),p=r(2159),d=r(4795);class f extends Error{constructor(e){super(e),this.name="HttpFetchError",Error.captureStackTrace&&Error.captureStackTrace(this,f)}}class v extends Error{constructor(e,t){super(e.statusText),(0,o.Z)(this,"response",void 0),(0,o.Z)(this,"responseJson",void 0),this.name="HttpResponseError",Error.captureStackTrace&&Error.captureStackTrace(this,v),this.response=e,this.responseJson=t}}class h extends Error{constructor(e){super(e.statusText),(0,o.Z)(this,"response",void 0),this.name="HttpParseError",Error.captureStackTrace&&Error.captureStackTrace(this,h),this.response=e}}class m extends Error{constructor(e){super(e),this.name="HttpAbortError"}}class g{constructor(){(0,o.Z)(this,"handlers",[])}use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}forEach(e){this.handlers.forEach((t=>{null!==t&&e(t)}))}}var y=["params","responseType","interceptorParams","observe","noAbortOnRouteChange","useCache"],b=["params","responseType","interceptorParams","observe","noAbortOnRouteChange","useCache","headers"],w=["body","method"];function S(e){return null==e}var E=document.querySelector("base"),k=E?E.href:location.origin+"/",A=e=>e instanceof DOMException&&20===e.code,P=(e,t)=>({error:e,config:t}),Z=function(){var e=(0,d.Z)((function*(e,t,r){return new Promise(function(){var a=(0,d.Z)((function*(a,i){var o;r.url=e;var{responseType:s}=r.options||{};s||(s="json");try{o=yield n(e,t)}catch(e){return void i(P(A(e)?new m(e.toString()):new f(e.toString()),r))}if(o.ok){var c;try{c=yield o[s]()}catch(e){return void i(P(A(e)?new m(e.toString()):new h(o),r))}a({config:r,status:o.status,statusText:o.statusText,headers:o.headers,data:c})}else{var l;try{l=yield o.json()}catch(e){}i(P(new v(o,l),r))}}));return function(e,t){return a.apply(this,arguments)}}())}));return function(t,r,n){return e.apply(this,arguments)}}(),I=(e,t)=>{if(t){var r=new URL(e,k);t instanceof URLSearchParams?t.forEach((function(e,t){r.searchParams.append(t,e)})):Object.entries(t).forEach((e=>{var[t,n]=e;Array.isArray(n)?n.forEach((e=>{r.searchParams.append(t,S(e)?"":e)})):r.searchParams.append(t,S(n)?"":n)}));var{href:n}=r;return n.startsWith(k)?n.substr(k.length):n}return e},O=(e,t)=>{if(void 0!==e){var r=new Headers(t||{}),n="Content-Type",a=e;return r.has(n)||("string"==typeof e?r.set(n,"application/x-www-form-urlencoded"):e instanceof FormData||(r.set(n,"application/json"),a=JSON.stringify(e))),{body:a,headers:r}}return{headers:t}},C=e=>{var{url:t,method:r,data:n}=e;return["DELETE","GET","HEAD"].includes(e.method)?((e,t,r)=>{var n=r.options||{},{params:a,responseType:i,interceptorParams:o,observe:s,noAbortOnRouteChange:c,useCache:l}=n,d=(0,p.Z)(n,y);return Z(I(t,a),(0,u.Z)((0,u.Z)({},d),{},{method:e}),r)})(r,t,e):((e,t,r,n)=>{var a=n.options||{},{params:i,responseType:o,interceptorParams:s,observe:c,noAbortOnRouteChange:l,useCache:d,headers:f}=a,v=(0,p.Z)(a,b);return Z(I(t,i),(0,u.Z)((0,u.Z)({},v),{},{method:e},O(r,f)),n)})(r,t,n,e)},x=new WeakMap,T=new WeakSet;class R{constructor(e){var t=this;(0,a.Z)(this,T),(0,o.Z)(this,"interceptors",void 0),(0,i.Z)(this,x,{writable:!0,value:C}),(0,o.Z)(this,"request",function(){var e=(0,d.Z)((function*(e,r,n){var a=r||{},{body:i,method:o}=a,s=(0,p.Z)(a,w);return(0,c.Z)(t,T,B).call(t,{url:e,data:i,method:o||"GET",options:(0,u.Z)((0,u.Z)({},n||{}),s)})}));return function(t,r,n){return e.apply(this,arguments)}}()),(0,o.Z)(this,"simpleRequest",(function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,c.Z)(t,T,B).call(t,{url:r,method:e,options:n})})),(0,o.Z)(this,"requestWithBody",(function(e,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,c.Z)(t,T,B).call(t,{url:r,method:e,data:n,options:a})})),this.interceptors={request:new g,response:new g},null!=e&&e.adapter&&(0,l.Z)(this,x,e.adapter)}getUrlWithParams(e,t){return I(e,t)}getBodyAndHeaders(e,t){return O(e,t)}get(e,t){return(0,c.Z)(this,T,B).call(this,{url:e,method:"GET",options:t})}delete(e,t){return(0,c.Z)(this,T,B).call(this,{url:e,method:"DELETE",options:t})}head(e,t){return(0,c.Z)(this,T,B).call(this,{url:e,method:"HEAD",options:t})}post(e,t,r){return(0,c.Z)(this,T,B).call(this,{url:e,method:"POST",data:t,options:r})}put(e,t,r){return(0,c.Z)(this,T,B).call(this,{url:e,method:"PUT",data:t,options:r})}patch(e,t,r){return(0,c.Z)(this,T,B).call(this,{url:e,method:"PATCH",data:t,options:r})}}function B(e){var t=[],r=Promise.resolve(e);for(this.interceptors.request.forEach((e=>{t.push(e.fulfilled,e.rejected)})),t.push((e=>(0,s.Z)(this,x).call(this,e)),void 0),this.interceptors.response.forEach((e=>{t.push(e.fulfilled,e.rejected)})),t.push((e=>{var t;return"response"===(null===(t=e.config.options)||void 0===t?void 0:t.observe)?e:e.data}),(e=>Promise.reject(e.error)));t.length;)r=r.then(t.shift(),t.shift());return r}var M=new R;function _(e){M=new R(e)}},4034:(e,t,r)=>{r.r(t),r.d(t,{i18n:()=>p,i18nText:()=>u,initializeI18n:()=>c});var n=r(3239),a=r(6236),i=r(6473),o=!1,s=new Set;function c(e,t){if(o||(o=!0,a.i18n.use(i.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&t&&!s.has(e))for(var[r,n]of(s.add(e),Object.entries(t)))a.i18n.addResourceBundle(r,e,n)}var l=r(9686);function u(e){var t;if(e){var r=null!==(t=a.i18n.language)&&void 0!==t?t:"zh-CN";if((0,l.hasOwnProperty)(e,r))return e[r];var n=r.split("-")[0];if(n!==r)return(0,l.hasOwnProperty)(e,n)?e[n]:void 0;var i="".concat(n,"-");for(var o of Object.keys(e))if(o.startsWith(i))return e[o]}}var p=n.default},7920:(e,t,r)=>{r.r(t),r.d(t,{inject:()=>k,transform:()=>E,transformAndInject:()=>A});var n=r(5178),a=r(8183),i=function(e){return e[e.Initial=0]="Initial",e[e.ExpectField=1]="ExpectField",e[e.ExpectOptionalBeginDefault=2]="ExpectOptionalBeginDefault",e[e.ExpectDefaultValue=3]="ExpectDefaultValue",e[e.ExpectOptionalBeginPipe=4]="ExpectOptionalBeginPipe",e[e.ExpectPipeIdentifier=5]="ExpectPipeIdentifier",e[e.ExpectOptionalBeginPipeParameter=6]="ExpectOptionalBeginPipeParameter",e[e.ExpectPipeParameter=7]="ExpectPipeParameter",e[e.ExpectPlaceholderEnd=8]="ExpectPlaceholderEnd",e}({}),o=function(e){return e.Raw="Raw",e.BeginPlaceHolder="BeginPlaceHolder",e.Field="Field",e.BeginDefault="BeginDefault",e.LiteralString="LiteralString",e.BeginPipe="BeginPipe",e.PipeIdentifier="PipeIdentifier",e.BeginPipeParameter="BeginPipeParameter",e.EndPlaceHolder="EndPlaceHolder",e.JsonValue="JsonValue",e}({}),s=function(e){return e[e.Array=0]="Array",e[e.Object=1]="Object",e[e.String=2]="String",e[e.Others=3]="Others",e}({});function c(e){return new RegExp("(".concat([].concat(e).map((e=>(0,n.escapeRegExp)(e))).join("|"),")\\{"))}function l(e){var t,r=S(e),n=null===(t=r.match(e.beginPlaceholder))||void 0===t?void 0:t[0],a=n?r.indexOf(n):-1;if(a>=0&&n&&"{"!==r.charAt(a+n.length)){var s=e.cursor+a;a>0&&e.tokens.push({type:o.Raw,value:r.substring(0,a)}),e.tokens.push({type:o.BeginPlaceHolder,loc:{start:s,end:s+n.length},value:n.substring(0,n.length-1)}),e.cursor+=a+n.length,e.status=i.ExpectField}else e.tokens.push({type:o.Raw,value:r}),e.cursor=e.raw.length}function u(e){e.cursor+=S(e).match(/^[ \r\n\t]*/)[0].length}function p(e){var[t]=S(e).match(/^(?:[\*\x2D\.0-9A-\[\]_a-z\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/);e.tokens.push({type:o.Field,value:t}),e.cursor+=t.length,e.status=i.ExpectOptionalBeginDefault}function d(e){"="===S(e).charAt(0)?(e.tokens.push({type:o.BeginDefault}),e.cursor+=1,e.status=i.ExpectDefaultValue):e.status=i.ExpectOptionalBeginPipe}function f(e){w(e,i.ExpectOptionalBeginPipe)}function v(e){"|"===S(e).charAt(0)?(e.tokens.push({type:o.BeginPipe}),e.cursor+=1,e.status=i.ExpectPipeIdentifier):e.status=i.ExpectPlaceholderEnd}function h(e){var t=S(e).match(/^[a-zA-Z]\w*/);if(!t)throw new Error("Expected a pipe identifier at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));var r=t[0];e.tokens.push({type:o.PipeIdentifier,value:r}),e.cursor+=r.length,e.status=i.ExpectOptionalBeginPipeParameter}function m(e){":"===S(e).charAt(0)?(e.tokens.push({type:o.BeginPipeParameter}),e.cursor+=1,e.status=i.ExpectPipeParameter):e.status=i.ExpectOptionalBeginPipe}function g(e){w(e,i.ExpectOptionalBeginPipeParameter)}function y(e){if("}"!==S(e).charAt(0))throw new Error("Expected a placeholder end '}' at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));e.tokens.push({type:o.EndPlaceHolder,loc:{start:e.cursor,end:e.cursor+1}}),e.cursor+=1,e.status=i.Initial}var b=new Map([["false",!1],["null",null],["true",!0]]);function w(e,t){var r=S(e);if(/[0-9[{"]/.test(r.charAt(0))||/-[0-9]/.test(r.substring(0,2)))!function(e,t){for(var r=S(e),n=r.charAt(0),a="["===n?s.Array:"{"===n?s.Object:'"'===n?s.String:s.Others,i=0,c=0,l=0,u=!1,p=!1,d=!1;i<r.length;){var f=r.charAt(i);if(p)p=!1;else if(u)'"'===f?u=!1:"\\"===f&&(p=!0);else switch(f){case"[":l+=1;break;case"{":c+=1;break;case"]":l-=1;break;case"}":c-=1;break;case'"':u=!0}switch(i+=1,a){case s.Array:d=!l;break;case s.Object:d=!c;break;case s.String:d=!u;break;default:d=i<r.length&&/[^a-z0-9E.+-]/.test(r.charAt(i))}if(d)break}if(!d)throw new Error("Failed to match a JSON value at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));e.tokens.push({type:o.JsonValue,value:JSON.parse(r.substring(0,i))}),e.cursor+=i,e.status=t}(e,t);else{var[n]=S(e).match(/^(?:[\x2D0-9A-Z_a-z\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/);b.has(n)?e.tokens.push({type:o.JsonValue,value:b.get(n)}):e.tokens.push({type:o.LiteralString,value:n}),e.cursor+=n.length,e.status=t}}function S(e){return e.raw.substring(e.cursor)}function E(e,t){return P(e,"@",t)}function k(e,t){return P(e,"$",t)}function A(e,t){return P(e,["@","$"],t)}function P(e,t,r){if(!function(e,t){return c(t).test(e)}(e,t))return e;var s,b,w=(s=r.data,function(e){var t=e.field?(0,n.get)(s,e.field):s;return void 0===t&&(t=e.defaultValue),(0,a.processPipes)(t,e.pipes)}),S=function(e,t){return function(r){var i,o,s=r.field.match(/^(?:(QUERY(?:_ARRAY)?|EVENT|query|event|APP|HASH|ANCHOR|SYS|FLAGS|CTX)\.)?(.+)$/);if(!s)return t.substring(r.loc.start,r.loc.end);var c,[,l,u]=s;!l&&/^[A-Z_]+$/.test(u)&&(l=u,u="*");var p={SYS:"sys",FLAGS:"flags"};switch(l){case"QUERY":case"query":c="*"===u?e.query:e.query.has(u)?e.query.get(u):void 0;break;case"QUERY_ARRAY":c=e.query.has(u)?e.query.getAll(u):void 0;break;case"EVENT":case"event":if(void 0===e.event)return t.substring(r.loc.start,r.loc.end);c="*"===u?e.event:(0,n.get)(e.event,u);break;case"APP":c="*"===u?null!==(i=e.overrideApp)&&void 0!==i?i:e.app:(0,n.get)(null!==(o=e.overrideApp)&&void 0!==o?o:e.app,u);break;case"HASH":c=e.location.hash;break;case"SYS":case"FLAGS":c="*"===u?e[p[l]]:(0,n.get)(e[p[l]],u);break;case"ANCHOR":var d=e.location.hash?e.location.hash.substr(1):null;c="*"===u?d:(0,n.get)(d,u);break;case"CTX":var f=t.substring(r.loc.start,r.loc.end);return console.error('CTX is not supported in placeholder any more: "'.concat(f,'"')),f;default:if(!e.match)return t.substring(r.loc.start,r.loc.end);c=e.match.params[u]}return void 0===c&&(c=r.defaultValue),(0,a.processPipes)(c,r.pipes)}}(r,e);return b=function(e,t){return function(e){var t,r={type:"InjectableString",elements:[]};function n(r){return r===e[0].type&&(t=e.shift(),!0)}function a(r){if(t=e.shift(),Array.isArray(r)?!r.includes(t.type):r!==t.type)throw new Error("Expected token: ".concat(r,", received token: ").concat(t.type))}for(;e.length>0;)if(n(o.Raw))r.elements.push({type:"RawString",value:t.value});else{a(o.BeginPlaceHolder);var i=t.loc.start,s=t.value;a(o.Field);var c={type:"Placeholder",symbol:s,field:t.value,defaultValue:void 0,pipes:[],loc:{start:i,end:i}};for(r.elements.push(c),n(o.BeginDefault)&&(a([o.JsonValue,o.LiteralString]),c.defaultValue=t.value);n(o.BeginPipe);){a(o.PipeIdentifier);var l={type:"PipeCall",identifier:t.value,parameters:[]};for(c.pipes.push(l);n(o.BeginPipeParameter);)a([o.JsonValue,o.LiteralString]),l.parameters.push(t.value)}a(o.EndPlaceHolder),c.loc.end=t.loc.end}return r}(function(e,t){for(var r={beginPlaceholder:c(t),raw:e,cursor:0,status:i.Initial,tokens:[]};r.cursor<e.length;)switch(r.status){case i.Initial:l(r);break;case i.ExpectField:u(r),p(r);break;case i.ExpectOptionalBeginDefault:u(r),d(r);break;case i.ExpectDefaultValue:u(r),f(r);break;case i.ExpectOptionalBeginPipe:u(r),v(r);break;case i.ExpectPipeIdentifier:u(r),h(r);break;case i.ExpectOptionalBeginPipeParameter:u(r),m(r);break;case i.ExpectPipeParameter:u(r),g(r);break;case i.ExpectPlaceholderEnd:u(r),y(r)}if(r.status!==i.Initial)throw new Error("Expected a placeholder end '}' at the end");return r.tokens}(e,t))}(e,t).elements.map((e=>"RawString"===e.type?e.value:"$"===e.symbol?S(e):w(e))),1===b.length?b[0]:b.join("")}},8524:(e,t,r)=>{r.r(t),r.d(t,{enqueueStableLoadBricks:()=>m,enqueueStableLoadProcessors:()=>g,flushStableLoadBricks:()=>h,loadBricksImperatively:()=>y,loadProcessorsImperatively:()=>w,loadScript:()=>o,loadSharedModule:()=>u,loadStyle:()=>s});var n=r(3028),a=new Map;function i(e,t,r,o){if(Array.isArray(t))return Promise.all(t.map((t=>i(e,t,r))));var s=r&&!/^https?:/.test(t)?"".concat(r).concat(t):t,c=a.get(s);if(c)return c;var l=new Promise(((t,r)=>{var a=()=>{window.dispatchEvent(new Event("request.end"))},i=document.createElement("style"===e?"link":"script");"script"===e?Object.assign(i,(0,n.Z)((0,n.Z)({type:"text/javascript",async:!0},o),{},{src:s})):Object.assign(i,(0,n.Z)((0,n.Z)({rel:"stylesheet"},o),{},{href:s})),i.onload=()=>{t(s),a()},i.onerror=e=>{r(e),a()};var c=document.currentScript||document.getElementsByTagName("script")[0];c.parentNode.insertBefore(i,c),window.dispatchEvent(new Event("request.start"))}));return a.set(s,l),l}function o(e,t,r){return i("script",e,t,r)}function s(e,t,r){return i("style",e,t,r)}var c,l=r(4795);function u(e,t){return p.apply(this,arguments)}function p(){return(p=(0,l.Z)((function*(e,t){yield r.I("default");var n=window[e];return yield n.init(r.S.default),(yield n.get(t))()}))).apply(this,arguments)}var d,f=!1,v=new Promise((e=>{c=e}));function h(){f||c()}function m(e,t){return O(Z("bricks",e,t))}function g(e,t){return O(Z("processors",e,t))}function y(e,t){return b.apply(this,arguments)}function b(){return(b=(0,l.Z)((function*(e,t){var r=Z("bricks",e,t);return h(),O(r)}))).apply(this,arguments)}function w(e,t){var r=Z("processors",e,t);return h(),O(r)}var S="v2-adapter.load-bricks";function E(e,t,r){var n=new Map,a=new Set,i=t=>{var o;if(!a.has(t)){var s,c,l;if(a.add(t),"processors"===e||t.includes(".")){[c,l]=t.split(".");var u="bricks/".concat("processors"===e?c.replace(/[A-Z]/g,(e=>"-".concat(e[0].toLocaleLowerCase()))).replace(/_[0-9]/g,(e=>"-".concat(e[1]))):c);s=r.get(u)}else for(var p of(l=t,r.values())){var d;if(null!==(d=p.elements)&&void 0!==d&&d.some((e=>e===l))){s=p;break}}if(s){var f=n.get(s);f||(f=[],n.set(s,f)),f.push(l);var v=null===(o=s.dependencies)||void 0===o?void 0:o[t];if(v)for(var h of v)i(h)}else console.error("Package for ".concat(t," not found."))}};for(var o of t)i(o);return n}function k(e,t,r){return A.apply(this,arguments)}function A(){return(A=(0,l.Z)((function*(e,t,r){var n="".concat("processors"===e?"./processors/":"./").concat(r);try{yield u(t,n)}catch(r){throw console.error(r),new Error("Load ".concat(e,' of "').concat(t.split("/").pop(),".").concat(n.split("/").pop(),'" failed'))}}))).apply(this,arguments)}function P(e,t,r){return t.map(function(){var t=(0,l.Z)((function*(t){var n;return yield o(t.filePath,null!==(n=window.PUBLIC_ROOT)&&void 0!==n?n:""),yield v,Promise.all(r.get(t).map((r=>k(e,t.id,r))))}));return function(e){return t.apply(this,arguments)}}())}function Z(e,t,r){return I.apply(this,arguments)}function I(){return I=(0,l.Z)((function*(e,t,r){var n=new Map;for(var a of r){var i,s=null!==(i=a.id)&&void 0!==i?i:x(a.filePath);n.set(s,a)}var u,p,v=E(e,t,n),h=[],m=[];for(var g of v.keys())g.id?"bricks/basic"===g.id?u=g:m.push(g):(h.push(g),(p=n.get("bricks/v2-adapter"))||console.error("Using v2 bricks, but v2-adapter not found"));var y,b=p,w=u;if(w){var A,Z=o(w.filePath,null!==(A=window.PUBLIC_ROOT)&&void 0!==A?A:"");f||(f=!0,Z.then((()=>Promise.resolve())).then(c)),y=Z.then((()=>Promise.all(v.get(w).map((t=>k(e,w.id,t))))))}var I=[y].concat(P(e,m,v));if(b&&h.length>0){if(!d){var O=E("bricks",[S],n),C=[...O.keys()],T=function(){var e=(0,l.Z)((function*(){return yield Promise.all(P("bricks",C,O)),document.createElement(S)}));return function(){return e.apply(this,arguments)}}();d=T()}I.push(d.then((t=>Promise.all(h.map((n=>{var a=x(n.filePath).split("/")[1];return t.resolve(b.filePath,n.filePath,"bricks"===e?v.get(n).map((e=>"".concat(a,".").concat(e))):[],n.dll,r)}))))))}yield Promise.all(I)})),I.apply(this,arguments)}function O(e){return C.apply(this,arguments)}function C(){return(C=(0,l.Z)((function*(e){window.dispatchEvent(new Event("request.start"));try{yield e}finally{window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function x(e){return e.split("/").slice(0,2).join("/")}},5152:(e,t,r)=>{r.r(t),r.d(t,{pipes:()=>n.pipes,processPipes:()=>i,utils:()=>n.utils});var n=r(665),a=new Map(Array.from(Object.entries(n.pipes)));function i(e,t){if(0===t.length)return e;var r=e;for(var n of t){var i=a.get(n.identifier);if(!i)return void console.warn("Unknown pipe: ".concat(n.identifier));r=i(r,...n.parameters)}return r}},2263:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>Vt,Notification:()=>Gt,StoryboardFunctionRegistryFactory:()=>de,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>ee,authenticate:()=>ha,batchSetAppsLocalTheme:()=>te,checkIfByTransform:()=>gt,checkIfOfComputed:()=>ht,createHistory:()=>k,createRuntime:()=>ia,customProcessors:()=>B,customTemplates:()=>Ce,fetchByProvider:()=>ba,getAuth:()=>ma,getBasePath:()=>v,getCssPropertyValue:()=>se,getCurrentMode:()=>ie,getCurrentTheme:()=>Q,getHistory:()=>A,getPageInfo:()=>In,getRuntime:()=>oa,handleHttpError:()=>zt,httpErrorToString:()=>Wt,isLoggedIn:()=>ya,isUnauthenticatedError:()=>$t,logout:()=>ga,matchPath:()=>Ct,registerWidgetFunctions:()=>Me,registerWidgetI18n:()=>L,unstable_createRoot:()=>Sa});var n={};r.r(n),r.d(n,{getAddedContracts:()=>Ua,getAllContextValues:()=>La,getBrickPackagesById:()=>Fa,getContextValue:()=>_a,getRenderId:()=>Na,legacyDoTransform:()=>Za,mountUseBrick:()=>Aa,renderUseBrick:()=>Ea,unmountUseBrick:()=>Pa,updateSnippetPreviewSettings:()=>Ba,updateStoryboard:()=>Ia,updateStoryboardByRoute:()=>Oa,updateStoryboardBySnippet:()=>Ra,updateStoryboardByTemplate:()=>Ca,updateTemplatePreviewSettings:()=>xa});var a=r(3028),i=r(4795),o=r(3395),s=r(381),c=r(687),l=r(6236),u=r(2923),p=r(9686),d=r(8874),f=(r(8525),r(7857));function v(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=r(2159),m=r(5178);function g(e,t){var r=(0,m.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app)||void 0===r||null===(r=r.homepage)||void 0===r?void 0:r.length)&&void 0!==t?t:0}),"desc");for(var n of r){var a=n.app.homepage;if("string"==typeof a&&"/"===a[0]&&("/"===a?t===a:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(a.replace(/\/+$/,""),"/"))))return n}}function y(e){var t;return!e||(null===(t=oa().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var b,w=["extraQuery","clear","keepHash"],S=!1;function E(e,t){t(!(S=!confirm(e)))}function k(){if(!b){var e=(0,f.createBrowserHistory)({basename:v().replace(/\/$/,""),getUserConfirmation:E});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function i(e,t,n){S=!1,r(e,t),null==n||n(S)}function o(e,t,r){S=!1,n(e,t),null==r||r(S)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:c,keepHash:l}=n,u=(0,h.Z)(n,w),p=new URLSearchParams(c?"":e.location.search),d={};for(var[f,v]of(Object.assign(d,r,s),Object.entries(d)))if(Array.isArray(v))for(var m of(p.delete(f),v))p.append(f,m);else null==v||""===v?p.delete(f):p.set(f,v);("push"===t?i:o)("?".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){i((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){o((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,i,o){var s,c="string"==typeof a;return"string"==typeof(s=c?(0,f.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&y(function(e){var t,r;return g(null!==(t=null===(r=ta)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](c?v()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,i,o)}}return{push:n("push"),replace:n("replace")}}((0,a.Z)((0,a.Z)({},e),{},{push:i,replace:o})))}(e)),b=e}return b}function A(){var e;return null!==(e=b)&&void 0!==e?e:function(){var{dll:e}=window;if("function"==typeof e)return e("tYg3").getHistory()}()}var P=r(5866),Z=r(6171),I=r(9516),O=r(9044),C=r(3393),x=r(5603),T=r(3105),R=new WeakMap,B=new class{constructor(){(0,o.Z)(this,R,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,c.Z)(this,R).get(r);if(a||(a=new Map,(0,c.Z)(this,R).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return(0,c.Z)(this,R).get(e)}};function M(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=_("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;l.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)l.i18n.removeResourceBundle(e,n)}}}function _(e,t){return"".concat(e,"/").concat(t)}function L(e,t){var r=_("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;l.i18n.addResourceBundle(t,r,n)}))}function F(e){return l.i18n.getFixedT(null,_("widget",e))}var N,U="brick-next-devtools-panel",j="devtools-frame-active-change",D="devtools-panel-change",V=!0;function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var $=()=>{throw new Error("Can't modify read-only proxy object")},q={set:$,defineProperty:$,deleteProperty:$,setPrototypeOf:$};function H(e){return new Proxy(e,q)}function K(e){var{get:t,ownKeys:r}=e;return W()?H(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var z="light",G=new p.JsonStorage(localStorage),J="apps-theme";function Y(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));z=e}function X(){return z}function Q(){return document.documentElement.dataset.theme}function ee(e){e?Y(e):e=X(),e!==Q()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function te(e){G.setItem(J,(0,a.Z)((0,a.Z)({},re()),e))}function re(){var e,t;try{t=G.getItem(J)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var ne="default";function ae(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));ne=e}function ie(){return document.documentElement.dataset.mode}function oe(e){e?ae(e):e=ne,e!==ie()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function se(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return r&&(null===(t=window.getComputedStyle(r))||void 0===t?void 0:t.getPropertyValue(e))||""}function ce(e,t){var r={};for(var n of e){var a=le(n,t);void 0!==a&&(r[n]=a)}return r}function le(e,t){var r,n,a,{collectCoverage:i,widgetId:o,widgetVersion:s,app:c,appendI18nNamespace:u,storyboardFunctions:p,isStoryboardFunction:d}=t;switch(e){case"BASE_URL":return i?"/next":v().replace(/\/$/,"");case"FN":return p;case"IMG":return i?{get:e=>"mock/images/".concat(e)}:o?null==na||null===(r=na.images)||void 0===r?void 0:r.widgetImagesFactory(o,s):null==na||null===(n=na.images)||void 0===n?void 0:n.imagesFactory(c.id,c.isBuildPush,c.currentVersion);case"I18N":return i?m.identity:o?F(o):l.i18n.getFixedT(null,[u,_("app",c.id)].filter(Boolean));case"I18N_TEXT":return i?ue:l.i18nText;case"PERMISSIONS":return H({check:i?pe:null==na||null===(a=na.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return H({getTheme:i?()=>"light":X});case"console":return d?H(console):void 0;case"location":return i?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function ue(e){return null==e?void 0:e.en}function pe(){return!0}function de(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=new Map,o=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,c=i.get(a);if(c){if(c.processed)return c.cooked;n&&(s=n.createCollector(a));var l=(0,O.precookFunction)(c.source,{typescript:c.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return c.cooked=(0,O.cook)(l.function,c.source,{rules:{noVar:!0},globalVariables:(0,x.supply)(l.attemptToVisitGlobals,ce(l.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:o,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),c.processed=!0,c.cooked}}(s)});return{storyboardFunctions:o,registerStoryboardFunctions:function(t,r){if(r&&(e=r),i.clear(),Array.isArray(t))for(var n of t){var a=(0,T.strictCollectMemberUsageInFunction)(n,"FN"),o=(0,T.strictCollectMemberUsageInFunction)(n,"PERMISSIONS").has("check");i.set(n.name,{source:n.source,typescript:n.typescript,deps:a,hasPermissionsCheck:o})}},updateStoryboardFunction(e,t){var r=(0,a.Z)((0,a.Z)({},t),{},{name:e}),n=(0,T.strictCollectMemberUsageInFunction)(r,"FN"),o=(0,T.strictCollectMemberUsageInFunction)(r,"PERMISSIONS").has("check");i.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:o})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=i.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:fe,registerStoryboardFunctions:ve,checkPermissionsUsage:he}=de(),me=r(761),ge=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),ye=new Map([[ge.xLarge,"1920px"],[ge.large,"1600px"],[ge.medium,"1280px"],[ge.small,"1024px"],[ge.xSmall,0]]),be=new me.Z,we={},Se={};function Ee(e,t){var r=!1;for(var[n]of(we[t]=e.matches,ye))if(we[n]&&Se.breakpoint!==n){Se.breakpoint=n,r=!0;break}r&&be.dispatchEvent(new CustomEvent("change",{detail:Se}))}ye.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));Ee(r,t),r.addEventListener?r.addEventListener("change",(e=>{Ee(e,t)})):r.addListener((e=>{Ee(e,t)}))}));var ke=()=>Se;function Ae(e){return function(t){var r,n="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(r=n.getItem(t))&&void 0!==r?r:"null")}}function Pe(e){var t,r;return!(null===(t=e?e.flags:null===(r=oa())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Ze(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 i=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(i),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(i),...n)}var Ie=new Set(["prefix"]),Oe=new WeakMap,Ce=new class{constructor(){(0,o.Z)(this,Oe,{writable:!0,value:new Map})}define(e,t){var r,n,i,o,s=(0,c.Z)(this,Oe).has(e);s?console.warn('Custom template of "'.concat(e,'" already registered.')):(s=!!customElements.get(e))&&console.warn('Custom template of "'.concat(e,'" already defined by customElements.'));var l=Pe(),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?(Ze(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,c.Z)(this,Oe).set(e,(0,a.Z)((0,a.Z)({},h),{},{name:e}));var g,y,b=(g=h.state,(0,m.uniq)(null!==(y=null==g?void 0:g.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==y?y:[])),w=Object.entries(null!==(i=null===(o=h.proxy)||void 0===o?void 0:o.methods)&&void 0!==i?i:{}),S=b.concat(p.map((e=>e[0]))),E=w.map((e=>e[0])),k=S.concat(E).filter((e=>e in HTMLElement.prototype&&!Ie.has(e)));if(k.length>0&&(Ze(l,"Using native HTMLElement properties as template properties or methods",e,...k),l))throw new Error('In custom template "'.concat(e,'", ').concat(k.map((e=>'"'.concat(e,'"'))).join(", ")," are native HTMLElement properties, and should be avoid to be used as brick properties or methods."));if(!s){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return S}static get _dev_only_definedMethods(){return E}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){var e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));var t=document.createDocumentFragment(),r=document.createElement("style");r.textContent=":host{display:block}:host([hidden]){display:none}";var n=document.createElement("slot");t.appendChild(r),t.appendChild(n),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}var A=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 P of b)A(P);var Z=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,i=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);i&&(i[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[I,O]of p)Z(I,O);var C=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[x,T]of w)C(x,T);customElements.define(e,t)}}get(e){return(0,c.Z)(this,Oe).get(e)}};function xe(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 i=a.get(n);if(!i)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 i}function Te(e,t,r){var n=xe(e,t,r).hostBrick.element;if(!n)throw new Error('Template host element is gone when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return n}var Re=new Map,Be=new Proxy(Object.freeze({}),{get:(e,t)=>Re.get(t)});function Me(e,t,r){if(Re.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=de({widgetId:e,widgetVersion:r});Re.set(e,n),a(t)}var _e=r(953);function Le(e,t){var r=va(e);if(!r&&null!=na&&na.checkInstalledApps&&(r=na.checkInstalledApps.getCheckedApp(e)),!r||"running"===r.installStatus)return!1;if(!t||!r.currentVersion)return!0;var n=t.match(/^([><]=?|=)(.*)$/);try{if(!n)throw new TypeError("Invalid match version: ".concat(t));return(0,_e.q)(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Fe(e,t,r){var{formStateStoreId:n,formStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of form renderer').concat(null!=r?r:""));var i=a.get(n);if(!i)throw new Error('Form state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return i}var Ne=new Map;function Ue(e){return je.apply(this,arguments)}function je(){return je=(0,i.Z)((function*(e){var t,r=null==na||null===(t=na.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=na.flowApi.FLOW_API_PROVIDER);var n=Ne.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)na.flowApi.registerFlowApiProvider();else if(yield(0,u.loadBricksImperatively)([e],ua()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Ne.set(e,n),n})),je.apply(this,arguments)}var De=new WeakSet;function Ve(e){if((0,p.isObject)(e)&&!We(e))if(De.add(e),Array.isArray(e))e.forEach(Ve);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Ve)}}function We(e){return De.has(e)}var $e=new Map;function qe(e,t,r){return He.apply(this,arguments)}function He(){return(He=(0,i.Z)((function*(e,t,r){var{useProvider:n,method:i="resolve",args:o=[],onReject:s}=e,{provider:c,field:l}=e;if(c&&!n)throw new Error("You're using \"provider: ".concat(c,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=l;if(u){var p=Pe();if(Ze(p,"`resolve.field`"),p)throw new Error("Using deprecated `resolve.field`")}var d,[f,v]=yield Promise.all([Ue(n),st(o,t)]),h=Ke(f,n,i,v,r,o),{transform:g}=e;try{var y=yield h;Ve(d=u?(0,m.get)(y,l):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,d=e}return g?"string"==typeof g?{[g]:d}:st(g,(0,a.Z)((0,a.Z)({},t),{},{data:d})):d}))).apply(this,arguments)}function Ke(e,t,r,n,a,i){return ze.apply(this,arguments)}function ze(){return ze=(0,i.Z)((function*(e,t,r,n,a,o){var s,c;try{s=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!o)throw e;s=JSON.stringify({useProvider:t,method:r,originalArgs:o})}return"reload"!==(null==a?void 0:a.cache)&&(c=$e.get(s)),c||(c=(0,i.Z)((function*(){var a,i=null!=na&&null!==(a=na.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield na.flowApi.getArgsOfFlowApi(t,n,r):n;return e.resolve(...i)}))(),$e.set(s,c)),c})),ze.apply(this,arguments)}var Ge=Symbol.for("pre.evaluated.raw"),Je=Symbol.for("pre.evaluated.context");function Ye(e){return!(null==e||!e[Ge])}function Xe(e){return e[Ge]}function Qe(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[Ge])}var et=new WeakSet([SyntaxError,TypeError,ReferenceError]);function tt(e){return et.has(e.constructor)?e.constructor:TypeError}function rt(){return(rt=(0,i.Z)((function*(e,t,r){var{blockingList:n,run:a}=nt(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function nt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,i=[];if("string"!=typeof e){var o=(0,m.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.Z)((0,a.Z)({},e[Je]),o),e=e[Ge]}var s,c={usedArgs:new Set},l={usedArgs:new Set};try{s=(0,O.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,T.collectAppGetMenuUsage)(c,e,t),(0,T.collectInstalledAppsHasUsage)(l,e,t)}}})}catch(t){var d="".concat(t.message,', in "').concat(e,'"');throw new(tt(t))(d)}if(c.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(l.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var f,v,h,g,y={},{attemptToVisitGlobals:b}=s;if(r.lazy||b.has("EVENT")&&!(0,p.hasOwnProperty)(t,"event")||b.has("DATA")&&!(0,p.hasOwnProperty)(t,"data"))return{blockingList:i,run:()=>Object.keys(t).length>0?{[Ge]:e,[Je]:t}:e};var w,S,E=Pe(t);(b.has("STATE")||!E&&b.has("TPL"))&&(g=xe(t,"STATE",': "'.concat(e,'"'))),b.has("FORM_STATE")&&(S=Fe(t,"FORM_STATE",': "'.concat(e,'"')));var k=W();if(n||k){if(b.has("CTX")&&(f=(0,T.strictCollectMemberUsage)(e,"CTX"),n&&i.push(t.ctxStore.waitFor(f))),g){if(h=(0,T.strictCollectMemberUsage)(e,"STATE"),!E){var A=(0,T.strictCollectMemberUsage)(e,"TPL");for(var P of A)h.add(P)}n&&i.push(g.waitFor(h))}S&&(w=(0,T.strictCollectMemberUsage)(e,"FORM_STATE"),n&&i.push(S.waitFor(w))),b.has("PROCESSORS")&&(v=(0,T.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&i.push((0,u.loadProcessorsImperatively)(v,ua())))}if(n){var Z,I=b.has("PERMISSIONS");if(!I&&b.has("FN")){var C=[...(0,T.strictCollectMemberUsage)(e,"FN")];I=he(C)}if(I&&i.push(...t.pendingPermissionsPreCheck),c.usedArgs.size>0&&null!=na&&na.menu){var R=[...c.usedArgs];i.push(Promise.all(R.map((e=>na.menu.fetchMenuById(e,t,{getStoryboardByAppId:fa,resolveData:qe,asyncComputeRealValue:st})))))}l.usedArgs.size>0&&i.push(null==na||null===(Z=na.checkInstalledApps)||void 0===Z?void 0:Z.waitForCheckingApps([...l.usedArgs]))}return{blockingList:i,run(){var r,n,i,o,{app:c,location:l,query:u,match:d,flags:k,sys:A,ctxStore:P,data:Z,event:I}=t,C=null!==(r=t.overrideApp)&&void 0!==r?r:c;for(var T of b)switch(T){case"ANCHOR":y[T]=l.hash?l.hash.substring(1):null;break;case"APP":y[T]=(0,a.Z)((0,a.Z)({},(0,m.cloneDeep)(C)),{},{getMenu:null==na||null===(n=na.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":y[T]=K({get:(e,t)=>P.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":y[T]=Z;break;case"EVENT":y[T]=I;break;case"FLAGS":y[T]=H(k);break;case"FORM_STATE":y[T]=K({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":y[T]=l.hash;break;case"INSTALLED_APPS":y[T]=H({has:Le});break;case"ITEM":(0,p.hasOwnProperty)(t,"forEachItem")?y[T]=t.forEachItem:console.error('Using `ITEM` but no `:forEach` is found, check your expression: "'.concat(e,'"'));break;case"LOCAL_STORAGE":y[T]=H({getItem:Ae("local")});break;case"MEDIA":y[T]=H(ke());break;case"MISC":y[T]=oa().getMiscSettings();break;case"PARAMS":y[T]=new URLSearchParams(u);break;case"PATH":y[T]=H(null!==(i=null==d?void 0:d.params)&&void 0!==i?i:{});break;case"PATH_NAME":y[T]=l.pathname;break;case"PROCESSORS":y[T]=K({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 K({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of v){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":y[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":y[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":y[T]=H({getItem:Ae("session")});break;case"TPL":if(Ze(E,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),E)break;case"STATE":y[T]=K({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":y[T]=H(null!=A?A:{});break;case"__WIDGET_FN__":y[T]=Be;break;case"__WIDGET_IMG__":y[T]=null==na||null===(o=na.images)||void 0===o?void 0:o.widgetImagesFactory;break;case"__WIDGET_I18N__":y[T]=F}Object.assign(y,ce(s.attemptToVisitGlobals,{storyboardFunctions:fe,app:t.app,appendI18nNamespace:t.appendI18nNamespace}));try{var R=(0,O.cook)(s.expression,s.source,{globalVariables:(0,x.supply)(s.attemptToVisitGlobals,y)});return function(e,t){var r=W();if(r&&V&&(!N||"Evaluations"===N)){var n=()=>{var n;null===(n=r.emit)||void 0===n||n.call(r,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(n):setTimeout(n,0)}}("evaluation",{raw:e,context:y,result:R}),R}catch(t){var M="".concat(t.message,', in "').concat(e,'"');throw new(tt(t))(M)}}}}var at=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function it(e){switch(e){case at.USE_BRICK_PROPERTIES:case at.USE_BRICK_TRANSFORM:case at.USE_BRICK_EVENTS:case at.USE_BRICK_IF:case at.USE_BRICK_LIFECYCLE:case at.USE_BRICK_DATA_SOURCE:return!0}return!1}function ot(e,t,r){if(it(e))return e;if(t)switch(e){case at.USE_BRICK:return at.USE_BRICK_ITEM;case at.USE_BRICK_SLOTS_ITEM_BRICKS:return at.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case at.INITIAL:if("useBrick"===r)return at.USE_BRICK;break;case at.USE_BRICK:case at.USE_BRICK_ITEM:case at.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return at.USE_BRICK_PROPERTIES;case"transform":return at.USE_BRICK_TRANSFORM;case"dataSource":return at.USE_BRICK_DATA_SOURCE;case"events":return at.USE_BRICK_EVENTS;case"slots":return at.USE_BRICK_SLOTS;case"children":return at.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return at.USE_BRICK_IF;case"lifeCycle":return at.USE_BRICK_LIFECYCLE}break;case at.USE_BRICK_SLOTS:return at.USE_BRICK_SLOTS_ITEM;case at.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return at.USE_BRICK_SLOTS_ITEM_BRICKS}return at.INITIAL}function st(e,t){return ct.apply(this,arguments)}function ct(){return ct=(0,i.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ye(e);if(n||"string"==typeof e){var a,i=r.$$lazyForUseBrick&&it(r.$$stateOfUseBrick),o=i;return n||(0,O.isEvaluable)(e)?(a=yield function(e,t,r){return rt.apply(this,arguments)}(e,t,{lazy:i}),o=Qe(e)):a=i?e:((0,p.hasOwnProperty)(t,"data")?r.noInject?C.transform:C.transformAndInject:r.noInject?pt:C.inject)(e,t),o||Ve(a),a}if(!(0,p.isObject)(e)||We(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=ut(r,!0);return Promise.all(e.map((e=>st(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([st(n,t),st(a,t,ut(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),ct.apply(this,arguments)}function lt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ye(e);if(n||"string"==typeof e){var a,i=r.$$lazyForUseBrick&&it(r.$$stateOfUseBrick),o=i;return n||(0,O.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=nt(e,t,void 0,!1);return n()}(e,t),o=Qe(e)):a=i?e:((0,p.hasOwnProperty)(t,"data")?r.noInject?C.transform:C.transformAndInject:r.noInject?pt:C.inject)(e,t),o||Ve(a),a}if(!(0,p.isObject)(e)||We(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=ut(r,!0);return e.map((e=>lt(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[lt(n,t),lt(a,t,ut(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function ut(e,t,r){return e.$$lazyForUseBrick?(0,a.Z)((0,a.Z)({},e),{},{$$stateOfUseBrick:ot(e.$$stateOfUseBrick,t,r)}):e}function pt(e){return e}function dt(e,t){return ft.apply(this,arguments)}function ft(){return(ft=(0,i.Z)((function*(e,t){return!(0,p.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||Ye(e.if)?yield st(e.if,t):e.if)}))).apply(this,arguments)}function vt(e,t){return!(0,p.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||Ye(e.if)?lt(e.if,t):e.if)}function ht(e){return!(0,p.hasOwnProperty)(e,"if")||!!e.if}function mt(){return(mt=(0,i.Z)((function*(e,t){return(0,p.isObject)(e.if)&&!Ye(e.if)?ht(yield qe(e.if,t)):dt(e,t)}))).apply(this,arguments)}function gt(e,t){return vt(e,{data:t})}function yt(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,O.isEvaluable)(e):Ye(e)){var a="string"==typeof e?e:Xe(e);if((0,O.isTrackAll)(a)){var i=(0,T.trackAll)(a);i&&(t=i.context,r=i.state,n=i.formState)}else t=(0,T.track)(a,"track context","CTX"),r=(0,T.track)(a,"track state","STATE"),n=(0,T.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function bt(e,t){return wt.apply(this,arguments)}function wt(){return(wt=(0,i.Z)((function*(e,t){for(var[r,n,a]of e)if(r===t){var i=yield n;if(void 0!==i||!a)return i}}))).apply(this,arguments)}function St(e){return Et.apply(this,arguments)}function Et(){return(Et=(0,i.Z)((function*(e){var t={};for(var[r,n,a]of e){var i=yield n;void 0===i&&a||!("style"!==r&&"dataset"!==r||(0,p.isObject)(i))||(t[r]=i)}return t}))).apply(this,arguments)}function kt(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,i]of Object.entries(n))e[r][a]=i;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function At(e,t,r){var n=function(e,t){return(0,p.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=lt(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?at.USE_BRICK:at.INITIAL});if("style"!==r&&"dataset"!==r||(0,p.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{kt(e,n)}))}var Pt=r(6903),Zt=new Map,It=1e4,Ot=0;function Ct(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:i=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:o,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Zt.get(r);n||Zt.set(r,n=new Map);var a=n.get(e);if(a)return a;var i=[],o={regexp:(0,Pt.Bo)(e,i,t),keys:i};return Ot<It&&(n.set(e,o),Ot++),o}(r,{end:n,strict:a,sensitive:i}),c=o.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 xt(){return(xt=(0,i.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=Ct(t.location.pathname,{path:n,exact:r.exact});if(a&&(yield dt(r,t)))return t.app.noAuthGuard||r.public||null==na||!na.auth||na.auth.isLoggedIn()?{match:a,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}var Tt,Rt=Symbol.for("tpl.asyncComputedPropsFromHost"),Bt=Symbol.for("tpl.stateStoreId"),Mt=Symbol.for("tpl.externalForEachItem"),_t=r(6666),Lt=new Set,Ft=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e}({}),Nt={[Ft.REQUEST_FAILED]:"Request Failed",[Ft.SOMETHING_WENT_WRONG]:"Something went wrong!",[Ft.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[Ft.NETWORK_ERROR]:"Network error, please check your network."},Ut={[Ft.REQUEST_FAILED]:"请求失败",[Ft.SOMETHING_WENT_WRONG]:"出现了一些问题!",[Ft.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[Ft.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},jt="core/runtime",Dt={en:Nt,zh:Ut},Vt=Object.freeze({show:function(e){return Tt?Tt.resolve(e):"confirm"===e.type?confirm(e.content)?new Promise((e=>setTimeout((()=>{e()}),1))):new Promise(((e,t)=>setTimeout((()=>{t()}),1))):(alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1e3))))}});function Wt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof I.HttpFetchError)return l.i18n.t("".concat(jt,":").concat(Ft.NETWORK_ERROR));if(e instanceof I.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 $t(e){return e instanceof I.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var qt,Ht,Kt=!1;function zt(e){if(!(e instanceof I.HttpAbortError)){if($t(e)&&!window.NO_AUTH_GUARD){if(Kt)return;return Kt=!0,void Vt.show({type:"confirm",content:l.i18n.t("".concat(jt,":").concat(Ft.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=oa().getFeatureFlags()["sso-enabled"],(t=A()).push(e?"/sso-auth/login":"/auth/login",{from:(0,a.Z)((0,a.Z)({},t.location),{},{state:void 0})}),Kt=!1}),(()=>{Kt=!1}))}console.error(e);var t=Wt(e);t!==qt&&(qt=t,Vt.show({type:"error",title:l.i18n.t("".concat(jt,":").concat(Ft.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap"}}).then((()=>{qt=void 0})))}}var Gt=Object.freeze({show:function(e){Ht?Ht.resolve(e):alert(e.message)}});function Jt(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,i=tr(a,r,{element:e});for(var o of(e.addEventListener(n,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,i]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,o])}))}function Yt(e){return"string"==typeof e.action}function Xt(e){return"string"==typeof e.useProvider}function Qt(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function er(e){return!!e.then}function tr(e,t,r){return function(n){var i,o;for(var s of[].concat(e))if(vt(s,(0,a.Z)((0,a.Z)({},t),{},{event:n})))if(er(s))tr(s.then,t,r)(n);else if(Yt(s)){var[c,l]=s.action.split(".");switch(s.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":sr(n,l,s.args,s.callback,t);break;case"window.open":cr(n,s.args,t);break;case"location.reload":case"location.assign":fr(n,l,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":vr(n,c,l,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"console.log":case"console.error":case"console.warn":case"console.info":hr(n,l,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":mr(n,l,s.args,t);break;case"handleHttpError":zt(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":ur(n,l,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":pr(n,l,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"tpl.dispatchEvent":var[u,p]=wr(s.args,t,n);Te(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,p));break;case"formstate.update":dr(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":gr(n,l,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":ee("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[d]=wr(s.args,t,n);ee(d);break;case"mode.setDashboardMode":case"mode.setDefaultMode":oe("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else Xt(s)?rr(n,s,t,r):Qt(s)?ar(n,s,t,r):console.error("unknown event handler:",s);else s.else&&tr(s.else,t,r)(n)}}function rr(e,t,r,n){return nr.apply(this,arguments)}function nr(){return(nr=(0,i.Z)((function*(e,t,r,n){try{ir(e,yield Ue(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(Wt(e))}}))).apply(this,arguments)}function ar(e,t,r,n){var i=[],o=t.target,s=t.targetRef,c=o;if(("string"==typeof o?(0,O.isEvaluable)(o):Ye(o))&&(c=lt(o,(0,a.Z)((0,a.Z)({},r),{},{event:e}))),"string"==typeof c)if("_self"===c)i.push(n.element);else if(t.multiple)i=Array.from(document.querySelectorAll(c));else{var l=document.querySelector(c);null!==l&&i.push(l)}else if(c)c instanceof HTMLElement?i.push(c):console.error("unexpected target:",c);else if(s){var u=s;("string"==typeof s?(0,O.isEvaluable)(s):Ye(s))&&(u=lt(s,(0,a.Z)((0,a.Z)({},r),{},{event:e})));var p=[].concat(u),d=Te(r,"targetRef",": ".concat(p.join(", ")));i.push(...p.map((e=>{var t;return null===(t=d.$$getElementByRef)||void 0===t?void 0:t.call(d,e)})).filter(Boolean))}0!==i.length?function(e){return!!e.method}(t)?i.forEach((a=>{ir(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&At(i,t.properties,(0,a.Z)((0,a.Z)({},r),{},{event:e})):console.error("target not found:",o||s)}function ir(e,t,r,n,a,i,o){return or.apply(this,arguments)}function or(){return or=(0,i.Z)((function*(e,t,r,n,o,s,c){var l;if("function"==typeof t[n]){var u=function(){var a=(0,i.Z)((function*(){var a,i=wr(r.args,o,e,c);return Xt(r)&&null!=na&&null!==(a=na.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(i=yield na.flowApi.getArgsOfFlowApi(r.useProvider,i,n)),t[n](...i)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var p,d=br(r.callback,o,s),f={progress:d("progress"),success:d("success"),error:d("error"),finally:d("finally")};if(Xt(r)&&(p=lt(r.poll,(0,a.Z)((0,a.Z)({},o),{},{event:e}))),null!==(l=p)&&void 0!==l&&l.enabled)!function(e,t,r){var n,{progress:a,success:o,error:s,finally:c}=t,{interval:l,leadingRequestDelay:u,continueOnError:p,delegateLoadingBar:d,expectPollEnd:f,expectPollStopImmediately:v}=r,h=pa();function m(){return g.apply(this,arguments)}function g(){return(g=(0,i.Z)((function*(){var t;Lt.delete(n);try{if(!(t=null==v?void 0:v())){var r=yield e();(t=(null==v?void 0:v())||h!==pa())||(null==a||a(r),null!=f&&f(r)?(d&&window.dispatchEvent(new Event("request.end")),null==o||o(r),null==c||c()):y(null!=l?l:3e3))}}catch(e){(t=(null==v?void 0:v())||h!==pa())||(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),Lt.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})})),or.apply(this,arguments)}function sr(e,t,r,n,a){var i=0,o=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,o=!0;break;case"reload":o=!0;break;case"block":i=1,s="setBlockMessage"}var c=[];if(i>0&&((c=wr(r,a,e,{useEventDetailAsDefault:!0})).length=i),o&&n){var l=br(n,a,void 0);c.push((e=>{l(e?"error":"success")({blocked:e}),l("finally")({blocked:e})}))}A()[s](...c)}function cr(e,t,r){var[n,a,i]=wr(t,r,e);window.open(n,a||"_self",i)}function lr(e,t,r,n,a,i){t?n.updateValues(e,r,(e=>wr(e,a,i)[0])):e.forEach((e=>{var{name:t,value:o}=wr([e],a,i)[0];n.updateValue(t,o,r)}))}function ur(e,t,r,n,a,i){if(!Array.isArray(r)||!r.every(p.isObject)||"assign"!==t&&"replace"!==t){var[o,s]=wr(r,i,e);i.ctxStore.updateValue(o,s,t,a,i)}else lr(r,n,t,i.ctxStore,i,e)}function pr(e,t,r,n,a,i){if(Array.isArray(r)&&r.every(p.isObject)&&"update"===t)lr(r,n,"replace",xe(i,"state.".concat(t),": ".concat(JSON.stringify(r))),i,e);else{var[o,s]=wr(r,i,e);xe(i,"state.".concat(t),": ".concat(o)).updateValue(o,s,"update"===t?"replace":t,a,i)}}function dr(e,t,r,n){var[a,i]=wr(t,n,e);Fe(n,"formstate.update",": ".concat(a)).updateValue(a,i,"replace",r,n)}function fr(e,t,r,n){if("assign"===t){var[a]=wr(r,n,e);location.assign(a)}else location[t]()}function vr(e,t,r,n,a){var i="localStorage"===t?localStorage:sessionStorage,[o,s]=wr(n,a,e);"setItem"===r?void 0!==s&&i.setItem(o,JSON.stringify(s)):i.removeItem(o)}function hr(e,t,r,n){console[t](...wr(r,n,e,{useEventAsDefault:!0}))}function mr(e,t,r,n){var a=wr(r,n,e,{useEventAsDefault:!0});Gt.show({type:t,message:a[0]})}function gr(e,t,r,n,a,i){return yr.apply(this,arguments)}function yr(){return(yr=(0,i.Z)((function*(e,t,r,n,a,i){var o=()=>{var a,i=wr(r,n,e);return null==na||null===(a=na.messageDispatcher)||void 0===a?void 0:a[t](...i)};if(i){var s=br(i,n,a);try{var c=yield o();s("success")(c)}catch(e){s("error")(e)}finally{s("finally")()}}else o()}))).apply(this,arguments)}function br(e,t,r){return function(n){return function(a){var i=null==e?void 0:e[n];if(i)try{var o=new CustomEvent("callback.".concat(n),{detail:a});tr(i,t,r)(o)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function wr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?lt(e,(0,a.Z)((0,a.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}var Sr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Er{constructor(e,t,r){(0,_t.Z)(this,"type",void 0),(0,_t.Z)(this,"data",new Map),(0,_t.Z)(this,"changeEventType",void 0),(0,_t.Z)(this,"pendingStack",[]),(0,_t.Z)(this,"hostBrick",void 0),(0,_t.Z)(this,"batchUpdate",!1),(0,_t.Z)(this,"batchUpdateContextsNames",[]),(0,_t.Z)(this,"rendererContext",void 0),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{var[t,{value:r}]=e;return[t,r]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}getAffectListByContext(e){var t=[e];return this.data.forEach(((e,r)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(r)&&t.push(...this.getAffectListByContext(r))})),t.shift(),[...new Set(t)]}updateValues(e,t,r){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");var n={},a={},i=[];e.forEach((e=>{var{name:a,value:o}=r([e]),s=this.data.get(a);i.push(...this.getAffectListByContext(a)),s&&(n[a]=s),this.updateValue(a,o,t)})),i.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(a[e]=t)}));var o=e=>{for(var t in e){var r,n=e[t];null===(r=n.eventTarget)||void 0===r||r.dispatchEvent(new CustomEvent(this.changeEventType,{detail:n.value}))}};o(n),o(a),this.batchUpdate=!1}updateValue(e,t,r,n,i){var o=this.data.get(e);if(!o)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?o.value=t:(0,p.isObject)(o.value)?Object.assign(o.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(e,'" for "context.assign", try "context.replace" instead.')),o.value=t),this.batchUpdate||o.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:o.value}));else{if(!o.load)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which has no resolve'));var s;if("load"===r&&(o.loaded?s=Promise.resolve(o.value):o.loading&&(s=o.loading)),s||(s=o.loading=o.load((0,a.Z)({cache:"load"===r?"default":"reload"},t))).then((e=>{o.loaded=!0,o.value=e,o.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:o.value}))}),(e=>{null!=n&&n.error||zt(e)})),n){var c=br(n,i);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,T.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,a)}return r}(e,r),a=new Map;for(var o of Array.from(n.keys()).map((e=>e.name))){var s;a.set(o,(null!==(s=a.get(o))&&void 0!==s?s:0)+1)}var c=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),l=new WeakSet,u=new Map,p=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{u.set(e,{resolve:t,reject:r})}))]))),d=function(){var e=(0,i.Z)((function*(e){var r;l.add(e);var i=yield t(e);n.delete(e);var o=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(i){if(u.get(e.name).resolve(),a.delete(e.name),0===o)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===o?(u.get(e.name).resolve(),a.delete(e.name)):a.set(e.name,o-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),f=c;function v(){return h.apply(this,arguments)}function h(){return h=(0,i.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,f)).map((e=>e[0])).filter((e=>!l.has(e)));yield Promise.all(e.map(d))})),h.apply(this,arguments)}return{pendingResult:v().then((0,i.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,i]of r.entries())[...i.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),f=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:p}}(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,i.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,i.Z)((function*(){for(var{pendingResult:t}of e.pendingStack)yield t}))()}handleAsyncAfterMount(){this.data.forEach((e=>{e.async&&e.loading.then((t=>{e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t}))}))}))}resolve(e,t,r){var n=this;return(0,i.Z)((function*(){if(!(yield dt(e,t)))return!1;var o,s,c;r&&("STATE"===n.type?e.expose:"FORM_STATE"===n.type)&&(o=yield bt(r,e.name));var l="eager";if(void 0===o){if(e.resolve){var u=(0,a.Z)({transform:"value"},e.resolve);if(yield dt(e.resolve,t))s=function(){var e=(0,i.Z)((function*(e){return(yield qe(u,t,e)).value}));return function(t){return e.apply(this,arguments)}}(),"eager"==(l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?o=yield s():"async"===l&&(c=s());else if(!(0,p.hasOwnProperty)(e,"value"))return!1}s&&"eager"===l||void 0===e.value||(o=yield st(e.value,t))}var d={value:o,eventTarget:new EventTarget,load:s,loaded:"eager"===l,loading:c,async:"async"===l,deps:[]};if("lazy"===l){var f,{trigger:v}=e.resolve;v&&Sr.includes(v)&&(null===(f=n.rendererContext)||void 0===f||f.registerArbitraryLifeCycle(v,(()=>{n.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(n.changeEventType,tr(e.onChange,t)),e.track){var h=(0,T.strictCollectMemberUsage)(s?e.resolve:e.value,n.type);for(var m of(!s&&(d.deps=[...h]),h))n.onChange(m,n.batchAddListener((()=>{s?n.updateValue(e.name,{cache:"default"},"refresh"):n.updateValue(e.name,lt(e.value,t),"replace")}),e))}if(n.data.has(e.name))throw new Error("".concat(n.type," '").concat(e.name,"' has already been declared"));return n.data.set(e.name,d),!0}))()}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}function kr(e,t,r){var n,a,{reversedProxies:i,asyncHostPropertyEntries:o,externalSlots:s,tplStateStoreId:c,hostBrick:l}=e;if(t&&i){var u=i.properties.get(t);u&&(a=o,n=u.map((e=>{var{from:t,to:r}=e,n=a.filter((e=>e[0]===t));if(n.length>0&&r.refProperty)return[r.refProperty,bt(n,t),!0]})).filter(Boolean));var d=i.slots.get(t);if(d&&s){var f=new Map;for(var{from:v,to:h}of d){var g,y,b,w,S=null!==(g=null===(y=s[v])||void 0===y?void 0:y.bricks)&&void 0!==g?g:[];if(S.length){var E=null!==(b=h.refSlot)&&void 0!==b?b:v,k=f.get(E);if(!k){k=[];for(var A=(0,p.hasOwnProperty)(r,E)?r[E].bricks.length+1:1,P=0;P<A;P+=1)k.push([]);f.set(E,k)}var Z=null!==(w=h.refPosition)&&void 0!==w?w:-1;k[(0,m.clamp)(Z<0?k.length+Z:Z,0,k.length-1)].push(...(0,p.hasOwnProperty)(l.runtimeContext,"forEachItem")?Ar(S,l.runtimeContext.forEachItem):S)}}var I=function(){(0,p.hasOwnProperty)(r,O)||(r[O]={type:"bricks",bricks:[]});var e=r[O];e.bricks=C.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[O]};for(var[O,C]of f.entries())I()}}return{[Rt]:n,[Bt]:c}}function Ar(e,t){return e.map((e=>{var r;return(0,a.Z)((0,a.Z)({},e),{},{[Mt]: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:Pr(a.routes,t)}:{type:"bricks",bricks:Ar(null!==(r=a.bricks)&&void 0!==r?r:[],t)}]})))})}))}function Pr(e,t){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.Z)((0,a.Z)({},e),{},{bricks:Ar(e.bricks,t)})))}var Zr=["properties","slots","children"];function Ir(e,t){function r(e){return(0,p.isObject)(e)&&"function"!=typeof 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:i,slots:o,children:s}=e,c=(0,h.Z)(e,Zr),l=Xr(s,o),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(i),slots:u},kr(t,c.ref,u))}return r(e)}var Or=["slots","children"],Cr=["properties","slots","children"];function xr(e,t,r,n,i){var o,s=(0,m.uniqueId)("tpl-state-"),c=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{tplStateStoreId:s});delete c.forEachItem,delete c.formStateStoreId;var l=new Er("STATE",r,i);c.tplStateStoreMap.set(s,l),c.tplStateStoreScope&&c.tplStateStoreScope.push(l);var{bricks:u,proxy:p,state:d,contracts:f}=Ce.get(e);null==na||null===(o=na.flowApi)||void 0===o||o.collectWidgetContract(f),l.define(d,c,n);var{slots:v,children:g}=t,y=(0,h.Z)(t,Or),b=(0,a.Z)((0,a.Z)({},y),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:p};var w={properties:new Map,slots:new Map};if(null!=p&&p.properties)for(var[S,E]of Object.entries(p.properties)){var k=w.properties.get(E.ref);k||(k=[],w.properties.set(E.ref,k)),k.push({from:S,to:E})}if(null!=p&&p.slots)for(var[A,P]of Object.entries(p.slots)){var Z=w.slots.get(P.ref);Z||(Z=[],w.slots.set(P.ref,Z)),Z.push({from:A,to:P})}var I={reversedProxies:w,asyncHostPropertyEntries:n,externalSlots:Xr(g,v),tplStateStoreId:s,hostBrick:r};return b.slots={"":{type:"bricks",bricks:u.map((e=>Tr(e,I)))}},b}function Tr(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:i}=e,o=(0,h.Z)(e,Cr),s=Xr(i,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=>Tr(e,t)))}]})));return(0,a.Z)((0,a.Z)({},o),{},{properties:Ir(r,t),slots:c},kr(t,o.ref,c))}var Rr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e}({}),Br="form-renderer.form-renderer",Mr=Symbol.for("form.stateStoreId"),_r=["forms.general-form","form.general-form","eo-form"];function Lr(e,t,r){var{id:n,bricks:i,events:o,context:s,mountPoint:c,instanceId:l}=e,{brick:u,properties:d}=e,f=t.find((e=>e.fieldId===n));if(f){var v=function(e){var t,r={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},n=()=>{var t,r;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(r=e.limit)||void 0===r?void 0:r.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,a.Z)((0,a.Z)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUMS":t={brick:"forms.general-select",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}})};break;case"JSON":t={brick:"forms.general-textarea",properties:(0,a.Z)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,a.Z)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,a.Z)((0,a.Z)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=v.brick),d=(0,a.Z)((0,a.Z)({},v.properties),d)}var h={brick:u,properties:d,iid:l,slot:c,events:o,context:s,children:Fr(i,t,r),[Mr]:r};return(0,p.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function Fr(e,t,r){if(Array.isArray(e))return e.map((e=>Lr(e,t,r)))}var Nr=["blockingList","node","menuRequests","hasTrackingControls"],Ur=["if","permissionsPreCheck"],jr=["formData"],Dr=["src"],Vr=["href"];function Wr(e,t,r,n,a){return $r.apply(this,arguments)}function $r(){return $r=(0,i.Z)((function*(e,t,r,n,i){var o=yield function(e,t){return xt.apply(this,arguments)}(t,r),s={blockingList:[],menuRequests:[]};switch(o){case"missed":break;case"unauthenticated":s.unauthenticated=!0;break;default:var c,l=s.route=o.route,p=(0,a.Z)((0,a.Z)({},r),{},{match:o.match});p.ctxStore.define(l.context,p),p.pendingPermissionsPreCheck.push(null==na||null===(c=na.checkPermissions)||void 0===c?void 0:c.preCheckPermissionsForBrickOrRoute(l,(e=>st(e,p))));var{preLoadBricks:d}=l;switch(Array.isArray(d)&&s.blockingList.push((0,u.loadBricksImperatively)(d,ua())),l.type){case"redirect":var f;if("string"!=typeof(f="string"==typeof l.redirect?yield st(l.redirect,p):(yield qe((0,a.Z)({transform:"redirect"},l.redirect),p)).redirect))throw console.error("Unexpected redirect result:",f),new Error("Unexpected type of redirect result: ".concat(typeof f));s.redirect={path:f};break;case"routes":s.menuRequests.push(Jr(l.menu,p)),Yr(s,yield Wr(e,l.routes,p,n,i));break;default:s.menuRequests.push(Jr(l.menu,p)),Yr(s,yield qr(e,l.bricks,p,n,i))}}return s})),$r.apply(this,arguments)}function qr(e,t,r,n,a,i,o){return Hr.apply(this,arguments)}function Hr(){return(Hr=(0,i.Z)((function*(e,t,r,n,a,i,o){var s={blockingList:[],menuRequests:[]},c=null!=o?o:[];return(yield Promise.all(t.map(((t,o)=>Kr(e,t,r,n,a,c.concat(o),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoizeControlNode(a,c.concat(r),t.node,e),Yr(s,t)})),s}))).apply(this,arguments)}function Kr(e,t,r,n,a){return zr.apply(this,arguments)}function zr(){return zr=(0,i.Z)((function*(e,t,r,n,o){var s,c,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:new Map,f={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),f;var{if:v,permissionsPreCheck:g}=t,y=(0,h.Z)(t,Ur);if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):Ye(e)&&(0,O.isTrackAll)(Xe(e))}(v))return Kr(e,(0,a.Z)({brick:":if",dataSource:v,permissionsPreCheck:g,slots:{"":{type:"bricks",bricks:[y]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.Z)((0,a.Z)({},e),{},{[r]:t[r]})),{})),r,n,o,l,d);var b=t[Bt],w=t[Mr],S=(0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:b,formStateStoreId:w});(0,p.hasOwnProperty)(t,Mt)&&(S.forEachItem=t[Mt]);var{context:E}=t;if(Array.isArray(E)&&E.length>0){var k=Pe(S);Ze(k,"Defining context on bricks","check your brick:",t),k||S.ctxStore.define(E,S)}if(S.pendingPermissionsPreCheck.push(null==na||null===(s=na.checkPermissions)||void 0===s?void 0:s.preCheckPermissionsForBrickOrRoute(t,(e=>st(e,S)))),!(yield function(e,t){return mt.apply(this,arguments)}(t,S)))return f;var A=t.brick;if(A.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(A);var{dataSource:P}=t,Z=function(){var r=(0,i.Z)((function*(){var r,a=yield st(P,S),i=":forEach"===A?"":":switch"===A?String(a):a?"":"else",s=Xr(t.children,t.slots),c=s&&(0,p.hasOwnProperty)(s,i)&&(null===(r=s[i])||void 0===r?void 0:r.bricks);if(!Array.isArray(c))return f;switch(A){case":forEach":return Array.isArray(a)?function(e,t,r,n,a,i,o,s){return Gr.apply(this,arguments)}(e,a,c,S,n,o,d,l):f;case":if":case":switch":return qr(e,c,S,n,o,d,l)}}));return function(){return r.apply(this,arguments)}}(),I=yield Z(),{contextNames:C,stateNames:x}=yt(P);if(C||x){I.hasTrackingControls=!0;var R=0,B=function(){var t=(0,i.Z)((function*(){var t=++R,r=yield Z();r.blockingList.push(...[...S.tplStateStoreMap.values(),...S.formStateStoreMap.values()].map((e=>e.waitForAll())),...S.pendingPermissionsPreCheck),yield Promise.all(r.blockingList),R===t&&n.rerenderControlNode(o,l,r.node,e)}));return function(){return t.apply(this,arguments)}}(),M=(0,m.debounce)(B);if(C)for(var _ of C)S.ctxStore.onChange(_,M);if(x)for(var L of x)xe(S,"STATE",': "'.concat(P,'"')).onChange(L,M)}return I}/\.tpl-/.test(A)&&!Ce.get(A)&&(yield Qr((0,u.loadBricksImperatively)([A],ua()),"brick",A,n.unknownBricks));var F,N,U=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(Ce.get(r))return r}return!!Ce.get(e)&&e}(A,null===(c=S.app)||void 0===c?void 0:c.id);if(U){var j,D=null!==(j=d.get(U))&&void 0!==j?j:0;if(D>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(U,'"'));d.set(U,D+1)}else A.includes("-")&&!customElements.get(A)&&(A===Br?customElements.define(Br,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):f.blockingList.push(Qr((0,u.enqueueStableLoadBricks)([A],ua()),"brick",A,n.unknownBricks)));if(A===Br){var V,W=null!==(V=t.properties)&&void 0!==V?V:{};({formData:F}=W),N=(0,h.Z)(W,jr)}else N=t.properties;var $=[],q=function(e,t,r){return(0,p.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:i,stateNames:o,formStateNames:s}=yt(a);return(i||o||s)&&r.push({contextNames:i,stateNames:o,formStateNames:s,propName:n,propValue:a}),[n,st(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?at.USE_BRICK:at.INITIAL})]})):[]}(N,S,$),H=t[Rt];H&&q.push(...H);var K="script"===A;if(K||"link"===A){var z=yield St(q);if(K?z.src:"stylesheet"===z.rel&&z.href){var G,J=null!==(G=window.PUBLIC_ROOT)&&void 0!==G?G:"";if(K){var{src:Y}=z,X=(0,h.Z)(z,Dr);yield Qr((0,u.loadScript)(Y,J,X),"script",Y,"silent")}else{var{href:Q}=z;X=(0,h.Z)(z,Vr),yield Qr((0,u.loadStyle)(Q,J,X),"stylesheet",Q,"silent")}return f}}var ee={tag:Rr.BRICK,type:U||A,return:e,slotId:o,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};f.node=ee;var te=(0,T.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);te.size>0&&f.blockingList.push(Qr((0,u.loadProcessorsImperatively)(te,ua()),"processors",[...te].join(", "),n.unknownBricks));var re=[],ne=function(){var e=(0,i.Z)((function*(){ee.properties=yield St(q),function(e,t){var r=function(t){var r=()=>{e.element&&At(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=xe(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var i of t.stateNames)a.onChange(i,r)}if(t.formStateNames){var o=Fe(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)o.onChange(s,r)}};for(var n of t)r(n)}(ee,$)}));return function(){return e.apply(this,arguments)}}();re.push(ne()),n.registerBrickLifeCycle(ee,t.lifeCycle);var ae,ie=t;U?ie=xr(U,t,ee,q,n):A===Br&&(ie=function(e,t,r,n,i){var o,s,c="string"==typeof e?JSON.parse(e):e,l=(0,m.uniqueId)("form-state-"),u=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{formStateStoreId:l});delete u.forEachItem,delete u.tplStateStoreId;var d=new Er("FORM_STATE",void 0,i);u.formStateStoreMap.set(l,d),u.formStateStoreScope&&u.formStateStoreScope.push(d);var f=null!==(o=c.context)&&void 0!==o?o:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),d.define(f,u,n);var v=Lr(c.formSchema,c.fields,l);return _r.includes(v.brick)&&t.events&&(v.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,p.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(v.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[v]}]}):(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[v]})}(F,t,ee,q,n)),ie.portal&&(ee.slotId=void 0),U?delete(ae=(0,a.Z)({},S)).forEachItem:ae=S;var oe=function(){var e=(0,i.Z)((function*(){var e=Xr(ie.children,ie.slots);if(e){var t=yield Promise.all(Object.entries(e).map((e=>{var[t,r]=e;return"routes"!==r.type?qr(ee,r.bricks,ae,n,t,d):Wr(ee,r.routes,ae,n,t)}))),r=(0,a.Z)((0,a.Z)({},f),{},{node:void 0,blockingList:[]});for(var i of t)Yr(r,i);r.node&&(ee.child=r.node),Yr(f,(0,a.Z)((0,a.Z)({},r),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return re.push(oe()),yield Promise.all(re),f})),zr.apply(this,arguments)}function Gr(){return(Gr=(0,i.Z)((function*(e,t,r,n,i,o,s,c){var l={blockingList:[],menuRequests:[]},u=t.length;return(yield Promise.all(t.map(((t,l)=>Promise.all(r.map(((r,p)=>Kr(e,r,(0,a.Z)((0,a.Z)({},n),{},{forEachItem:t}),i,o,c.concat(l*u+p),s&&new Map(s))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&i.memoizeControlNode(o,c.concat(r),t.node,e),Yr(l,t)})),l}))).apply(this,arguments)}function Jr(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 st(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}function Yr(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:i}=t,o=(0,h.Z)(t,Nr);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,o)}function Xr(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,i=null!==(a=n.slot)&&void 0!==a?a:"";(0,p.hasOwnProperty)(r,i)||(r[i]={type:"bricks",bricks:[]}),r[i].bricks.push(n)}return r}function Qr(e,t,r,n){return"silent"===n?e.catch((e=>{console.error("Load ".concat(t,' "').concat(r,'" failed:'),e)})):e}function en(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:i}=xe(n,"bindTemplateProxy"),o=i.tplHostMetadata;o.internalBricksByRef.set(r,e);var s=null===(t=o.proxy)||void 0===t?void 0:t.events;if(s){var c=function(e){if(u.ref===r){var t,n,o,s=t=>{t.bubbles&&t.stopPropagation(),i.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},c=null!==(t=u.refEvent)&&void 0!==t?t:e;a.addEventListener(c,s),null!==(o=(n=a).$$proxyListeners)&&void 0!==o||(n.$$proxyListeners=[]),a.$$proxyListeners.push([c,s])}};for(var[l,u]of Object.entries(s))c(l)}}}function tn(e){var{ref:t,runtimeContext:r,element:n}=e;if(r.tplStateStoreId&&t){var{hostBrick:a}=xe(r,"unbindTemplateProxy"),i=a.tplHostMetadata;for(var[o,s]of(i.internalBricksByRef.delete(t),null!==(c=n.$$proxyListeners)&&void 0!==c?c:[])){var c;n.removeEventListener(o,s)}delete n.$$proxyListeners}}function rn(e){e.replaceChildren()}function nn(e,t){for(var r=e.child,n=[];r;){var a,i=r.type;i.includes("-")&&!customElements.get(i)&&console.error("Undefined custom element: ".concat(i)),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var o=t&&r===e.child?t:document.createElement(i);if(r.element=o,r.slotId&&o.setAttribute("slot",r.slotId),r.iid&&(o.dataset.iid=r.iid),null!==(a=r.tplHostMetadata)&&void 0!==a&&a.tplStateStoreId&&(o.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),kt(o,r.properties),Jt(o,r.events,r.runtimeContext),r.tplHostMetadata&&(o.$$tplStateStore=xe({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),en(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 s,c=r.return;c;){var l;if(c.childElements)c.tag===Rr.ROOT?null===(l=c.container)||void 0===l||l.append(...c.childElements):c.element.append(...c.childElements),c.childElements=void 0;if(c.tag===Rr.ROOT&&n.length>0&&("function"==typeof c.createPortal?c.createPortal():c.createPortal).append(...n),c.sibling)break;c=c.return}r=null===(s=c)||void 0===s?void 0:s.sibling}}}var an,on,sn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],cn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],ln=new WeakMap,un=new WeakMap,pn=new WeakMap,dn=new WeakMap,fn=new WeakMap,vn=new WeakSet,hn=new WeakSet,mn=new WeakSet,gn=new WeakSet;class yn{constructor(e,t){var r;(0,P.Z)(this,gn),(0,P.Z)(this,mn),(0,P.Z)(this,hn),(0,P.Z)(this,vn),(0,_t.Z)(this,"scope",void 0),(0,_t.Z)(this,"unknownBricks",void 0),(0,o.Z)(this,ln,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,o.Z)(this,un,{writable:!0,value:new Map}),(0,o.Z)(this,pn,{writable:!0,value:void 0}),(0,o.Z)(this,dn,{writable:!0,value:new Map}),(0,o.Z)(this,fn,{writable:!0,value:void 0}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw"}registerBrickLifeCycle(e,t){if(t){var r=[...sn,..."page"===this.scope?cn:[]];for(var n of r){var a=t[n];a&&(0,c.Z)(this,ln)[n].push({brick:e,handlers:a})}(0,m.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,c.Z)(this,dn).get(e);r?r.add(t):(0,c.Z)(this,dn).set(e,new Set([t]))}memoizeControlNode(e,t,r,n){(0,c.Z)(this,fn)||(0,s.Z)(this,fn,new WeakMap);var a=[null!=e?e:"",...t].join("."),i=(0,c.Z)(this,fn).get(n);i||(i=new Map,(0,c.Z)(this,fn).set(n,i)),i.set(a,{node:r,last:kn(r),lastNormal:An(r),lastPortal:Pn(r)})}rerenderControlNode(e,t,r,n){var a,i,o,s,l,u=[null!=e?e:"",...t].join("."),p=(0,c.Z)(this,fn).get(n).get(u),{node:d,last:f,lastNormal:v,lastPortal:h}=p,m=null!==(a=null==v||null===(i=v.element)||void 0===i?void 0:i.nextSibling)&&void 0!==a?a:null,g=null!==(o=null==h||null===(s=h.element)||void 0===s?void 0:s.nextSibling)&&void 0!==o?o:null,y=kn(r);p.node=r,p.last=y,p.lastNormal=An(r),p.lastPortal=Pn(r);for(var b=n.child;b&&b!==f;){if(b.sibling===d){l=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,A,P=Zn(d,f);for((0,Z.Z)(this,vn,bn).call(this,P),nn(E),l?l.sibling=r:n.child=r,y&&(y.sibling=null==f?void 0:f.sibling),b=r;b;)b.return=n,b=b.sibling;if(n.tag===Rr.ROOT?null===(k=n.container)||void 0===k||k.insertBefore(w,m):null===(A=n.element)||void 0===A||A.insertBefore(w,m),S.childNodes.length>0){for(var I,O=r;O&&O.return;)O=O.return;if((null===(I=O)||void 0===I?void 0:I.tag)!==Rr.ROOT)throw new Error("Cannot find render root node");("function"==typeof O.createPortal?O.createPortal():O.createPortal).insertBefore(S,g)}var C=Zn(r,y);(0,Z.Z)(this,hn,wn).call(this,C)}dispose(){for(var e of Object.values((0,c.Z)(this,ln)))e.length=0;for(var t of(0,c.Z)(this,un).values()){for(var r of t)r.disconnect();t.length=0}(0,c.Z)(this,un).clear(),(0,c.Z)(this,pn)&&(be.removeEventListener("change",(0,c.Z)(this,pn)),(0,s.Z)(this,pn,void 0)),(0,s.Z)(this,fn,void 0),(0,c.Z)(this,dn).clear()}dispatchBeforePageLoad(){(0,Z.Z)(this,mn,Sn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,Z.Z)(this,mn,Sn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,Z.Z)(this,mn,Sn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,Z.Z)(this,mn,Sn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=A().location;e&&"#"!==e?(0,Z.Z)(this,mn,Sn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,Z.Z)(this,mn,Sn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,c.Z)(this,ln).onScrollIntoView)(0,Z.Z)(this,gn,En).call(this,e,t)}initializeMediaChange(){(0,s.Z)(this,pn,(e=>{(0,Z.Z)(this,mn,Sn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:H(e.detail)}))})),be.addEventListener("change",(0,c.Z)(this,pn))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==na||null===(r=na.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{tr(t.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:r}))}))};for(var r of[].concat(n))t(r)};for(var{brick:r,handlers:n}of(0,c.Z)(this,ln).onMessage)t(r);null==na||null===(e=na.messageDispatcher)||void 0===e||e.onClose((()=>{(0,Z.Z)(this,mn,Sn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,Z.Z)(this,mn,Sn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,Z.Z)(this,mn,Sn).call(this,"onUnmount",new CustomEvent("unmount"))}}function bn(e){var t=[...sn,..."page"===this.scope?cn:[]],r=[];for(var n of t){var a=(0,m.remove)((0,c.Z)(this,ln)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var i of e){var o,s,l=(0,c.Z)(this,un).get(i);if(null!=l&&l.length){for(var u of l)u.disconnect();l.length=0,(0,c.Z)(this,un).delete(i)}tn(i),null===(o=i.element)||void 0===o||delete o.$$tplStateStore,null===(s=i.element)||void 0===s||s.remove()}var p=new CustomEvent("unmount");for(var{brick:d,handlers:f}of r)tr(f,d.runtimeContext,d)(p)}function wn(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,c.Z)(this,ln).onMount)e.has(r)&&tr(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:i}of(0,c.Z)(this,ln).onScrollIntoView)e.has(a)&&(0,Z.Z)(this,gn,En).call(this,a,i)}function Sn(e,t){for(var{brick:r,handlers:n}of(0,c.Z)(this,ln)[e])tr(n,r.runtimeContext,r)(t);var a=(0,c.Z)(this,dn).get(e);if(a)for(var i of a)i()}function En(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&&(tr(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var i=(0,c.Z)(this,un).get(e);i||(i=[],(0,c.Z)(this,un).set(e,i)),i.push(a)}function kn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function An(e){for(var t,r=e;r;)r.portal||(t=r),r=r.sibling;return t}function Pn(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 Zn(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,i=n.return;i&&i!==t&&!i.sibling;)i=i.return;if(i===t)break;n=null===(a=i)||void 0===a?void 0:a.sibling}}return r}function In(){if(!an){if(an={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){an.isInIframe=!0;try{if(window.origin===window.parent.origin){an.isInIframeOfSameSite=!0;var e="/next/"===v(),t=window.parent.location.pathname,r=t.startsWith("/next/");an.isInIframeOfNext=0==(Number(e)^Number(r)),an.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),an.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(an)}return an}function On(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);Ce.define(a,n)}}}function Cn(){return Cn=(0,i.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return xn.apply(this,arguments)}(e)),e.$$fulfilling})),Cn.apply(this,arguments)}function xn(){return(xn=(0,i.Z)((function*(e){var t;yield null==na||null===(t=na.fulfilStoryboard)||void 0===t?void 0:t.call(na,e),M(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}var Tn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Mn=new WeakMap,_n=new WeakMap,Ln=new WeakMap,Fn=new WeakMap,Nn=new WeakMap,Un=new WeakMap,jn=new WeakMap,Dn=new WeakMap,Vn=new WeakMap,Wn=new WeakSet,$n=new WeakSet,qn=new WeakSet,Hn=new WeakSet;class Kn{constructor(e){(0,P.Z)(this,Hn),(0,P.Z)(this,qn),(0,P.Z)(this,$n),(0,P.Z)(this,Wn),(0,o.Z)(this,Tn,{writable:!0,value:void 0}),(0,o.Z)(this,Rn,{writable:!0,value:!1}),(0,o.Z)(this,Bn,{writable:!0,value:void 0}),(0,o.Z)(this,Mn,{writable:!0,value:void 0}),(0,o.Z)(this,_n,{writable:!0,value:void 0}),(0,o.Z)(this,Ln,{writable:!0,value:void 0}),(0,o.Z)(this,Fn,{writable:!0,value:new Set}),(0,o.Z)(this,Nn,{writable:!0,value:0}),(0,o.Z)(this,Un,{writable:!0,value:void 0}),(0,o.Z)(this,jn,{writable:!0,value:void 0}),(0,o.Z)(this,Dn,{writable:!0,value:void 0}),(0,o.Z)(this,Vn,{writable:!0,value:void 0}),(0,s.Z)(this,Tn,e);var t=A();window.addEventListener("beforeunload",(e=>{(0,Z.Z)(this,Wn,zn).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,Z.Z)(this,Wn,zn).call(this,{location:e,action:t})))}getRenderId(){return(0,c.Z)(this,Un)}getRuntimeContext(){return(0,c.Z)(this,_n)}getRecentApps(){return{currentApp:(0,c.Z)(this,jn),previousApp:(0,c.Z)(this,Dn)}}getNavConfig(){return(0,c.Z)(this,Vn)}bootstrap(){window.AbortController&&(on=new AbortController,I.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:on.signal})})})));var e=A();return(0,s.Z)(this,Bn,e.location),e.listen(((e,t)=>{var r,n,i,o=!1,l={hash:void 0,state:void 0};if(void 0!==e.key&&("POP"!==t||void 0!==(0,c.Z)(this,Bn).key&&!1!==(null===(r=(0,c.Z)(this,Bn).state)||void 0===r?void 0:r.notify))||(l.key=void 0),((0,f.locationsAreEqual)((0,a.Z)((0,a.Z)({},(0,c.Z)(this,Bn)),l),(0,a.Z)((0,a.Z)({},e),l))||"POP"!==t&&!1===(null===(n=e.state)||void 0===n?void 0:n.notify))&&(o=!0),o)(0,s.Z)(this,Bn,e);else{if(on&&(on.abort(),on=new AbortController),(0,s.Z)(this,Bn,e),null===(i=(0,c.Z)(this,Ln))||void 0===i||i.dispatchPageLeave(),"POP"===t&&y(g((0,c.Z)(this,Tn),e.pathname)))return void window.location.reload();(0,c.Z)(this,Rn)?(0,s.Z)(this,Mn,e):(0,Z.Z)(this,qn,Jn).call(this,e).catch(zt)}})),(0,Z.Z)(this,qn,Jn).call(this,e.location)}}function zn(e){var t,r=A(),n=r.getBlockMessage();null===(t=(0,c.Z)(this,Ln))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function Gn(e,t,r){var n,a;if((0,s.Z)(this,Nn,(n=(0,c.Z)(this,Nn),a=n++,n)),a>10){var i='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(i)}A().replace(e,t)}function Jn(e){return Yn.apply(this,arguments)}function Yn(){return(Yn=(0,i.Z)((function*(e){(0,s.Z)(this,Rn,!0);try{yield(0,Z.Z)(this,Hn,Xn).call(this,e)}finally{if((0,s.Z)(this,Rn,!1),(0,c.Z)(this,Mn)){var t=(0,c.Z)(this,Mn);(0,s.Z)(this,Mn,void 0),yield(0,Z.Z)(this,qn,Jn).call(this,t)}}}))).apply(this,arguments)}function Xn(e){return Qn.apply(this,arguments)}function Qn(){return Qn=(0,i.Z)((function*(e){var t,r;(0,s.Z)(this,Un,(0,m.uniqueId)("render-id-1")),De=new WeakSet,$e.clear(),null==na||null===(t=na.flowApi)||void 0===t||t.clearCollectWidgetContract(),A().unblock();var n=performance.now(),i=g((0,c.Z)(this,Tn),e.pathname),o=null===(r=(0,c.Z)(this,_n))||void 0===r?void 0:r.app;null!=i&&i.app&&(yield function(e){return Cn.apply(this,arguments)}(i));var l=(0,s.Z)(this,jn,null==i?void 0:i.app),p=o&&l?o.id!==l.id:o!==l,d=oa().getFeatureFlags(),f=(0,c.Z)(this,Ln),v=(t,r)=>{(0,c.Z)(this,Fn).add(f),(0,Z.Z)(this,$n,Gn).call(this,t,r,e)},h=()=>{var t=d["sso-enabled"]?"/sso-auth/login":"/auth/login";v(t,{from:e})},y=document.querySelector("#main-mount-point"),b=document.querySelector("#portal-mount-point"),w={tag:Rr.ROOT,container:y,createPortal:b},S=()=>{var e;for(var t of(rn(y),rn(b),(0,c.Z)(this,Fn).add(f),(0,c.Z)(this,Fn)))t&&(t.dispatchOnUnmount(),t.dispose());(0,c.Z)(this,Fn).clear(),null==na||null===(e=na.messageDispatcher)||void 0===e||e.reset(),p&&((0,s.Z)(this,Dn,o),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:o,currentApp:l}})))};if(Y(l&&(re()[l.id]||l.theme)||"light"),ae("default"),l){var E,k,P,O,C,x;null==na||null===(E=na.checkInstalledApps)||void 0===E||E.preCheckInstalledApps(i,(e=>!!va(e)));var T=(0,s.Z)(this,Ln,new yn("page")),R=(0,s.Z)(this,_n,{app:l,location:e,query:new URLSearchParams(e.search),flags:d,sys:(0,a.Z)((0,a.Z)((0,a.Z)({},null==na||null===(k=na.auth)||void 0===k?void 0:k.getAuth()),In()),{},{settings:{brand:oa().getBrandSettings()}}),ctxStore:new Er("CTX",void 0,T),pendingPermissionsPreCheck:[null==na||null===(P=na.checkPermissions)||void 0===P?void 0:P.preCheckPermissions(i)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.Z)(this,Vn,void 0),On(i),ve(null===(O=i.meta)||void 0===O?void 0:O.functions,l),null==na||null===(C=na.flowApi)||void 0===C||C.collectContract(null===(x=i.meta)||void 0===x?void 0:x.contracts);var B,M=!1,_=[];try{if((B=yield Wr(w,function(e){if(window.parent===window)return e;var t=e,r=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)];var n=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)]}(i.routes),R,T)).unauthenticated)return void h();if(B.redirect)return void v(B.redirect.path,B.redirect.state);(0,s.Z)(this,Nn,0),(0,u.flushStableLoadBricks)(),_=[R.ctxStore,...R.tplStateStoreMap.values(),...R.formStateStoreMap.values()],yield Promise.all([...B.blockingList,..._.map((e=>e.waitForAll())),...R.pendingPermissionsPreCheck]);var L=yield Promise.all(B.menuRequests);(0,s.Z)(this,Vn,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}(L))}catch(e){if(console.error("Router failed:",e),$t(e)&&!window.NO_AUTH_GUARD)return void h();if(e instanceof I.HttpAbortError)return void(0,c.Z)(this,Fn).add(f);M=!0,B={node:{tag:Rr.BRICK,type:"div",properties:{textContent:Wt(e)},runtimeContext:null,return:w},blockingList:[],menuRequests:[]}}if(w.child=B.node,S(),B.route&&"routes"!==B.route.type||M){if(M||T.dispatchBeforePageLoad(),ee(),oe(),nn(w),window.scrollTo(0,0),!M){for(var F of _)F.handleAsyncAfterMount();T.dispatchPageLoad(),T.dispatchAnchorLoad(),T.dispatchOnMount(),T.initializeScrollIntoView(),T.initializeMediaChange(),T.initializeMessageDispatcher()}var N=performance.now()-n;return void window.dispatchEvent(new CustomEvent("route.render",{detail:{renderTime:N}}))}}else{if(!window.NO_AUTH_GUARD&&null!=na&&na.auth&&!na.auth.isLoggedIn())return void h();S()}ee(),oe();var U={tag:Rr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:w};w.child=U,nn(w),window.scrollTo(0,0)})),Qn.apply(this,arguments)}var ea,ta,ra,na,aa="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function ia(e){if(ea)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===U){var r=t.payload;switch(null==r?void 0:r.type){case j:V=r.active;break;case D:N=r.panel}}})),na=null==e?void 0:e.hooks,(0,l.initializeI18n)(jt,Dt),d.locale(l.i18n.language),l.i18n.on("languageChanged",(()=>{d.locale(l.i18n.language)})),k(),ea=new la}function oa(){return ea}var sa=new WeakMap,ca=new WeakMap;class la{constructor(){(0,o.Z)(this,sa,{writable:!0,value:!1}),(0,o.Z)(this,ca,{writable:!0,value:!1})}initialize(e){var t,r;if((0,c.Z)(this,sa))throw new Error("The runtime cannot be initialized more than once");(0,s.Z)(this,sa,!0),function(e){if(Array.isArray(e.storyboards)){var t=function(){if(r.locales){var e="tmp/".concat(r.id);Object.entries(r.locales).forEach((t=>{var[r,n]=t;l.i18n.addResourceBundle(r,e,n)})),r.localeName=l.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{l.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,p.isObject)(e.settings)&&(0,p.deepFreeze)(e.settings),e.brickPackages&&(0,p.deepFreeze)(e.brickPackages)}(e),ta=e;var n,{notification:a,dialog:i}=null!==(t=null===(r=e.settings)||void 0===r?void 0:r.presetBricks)&&void 0!==t?t:{};!1!==a&&(n=null!=a?a:"basic.show-notification",(0,this.loadBricks)([n]).then((()=>{Ht=document.createElement(n)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==i&&function(e,t){t([e]).then((()=>{Tt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=i?i:"basic.show-dialog",this.loadBricks)}bootstrap(e){var t=this;return(0,i.Z)((function*(){if(e&&t.initialize(e),(0,c.Z)(t,ca))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.Z)(t,ca,!0),ra=new Kn(ta.storyboards),yield ra.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=ra)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=ra)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Le(e,t)}getFeatureFlags(){var e,t;return(0,a.Z)((0,a.Z)((0,a.Z)({},null===(e=ta)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=ra)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags),{},{"migrate-to-brick-next-v3":!0})}getMiscSettings(){var e,t;return(0,a.Z)((0,a.Z)({},null===(e=ta)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=ra)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc)}getBrandSettings(){var e;return(0,a.Z)({base_title:"DevOps 管理专家"},null===(e=ta)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,a.Z)({columns:7,rows:4},null===(e=ta)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=ta)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=ta)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t=this.getBrandSettings().base_title;document.title=e?"".concat(e," - ").concat(t):t}getNavConfig(){var e;return null===(e=ra)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,u.loadBricksImperatively)(e,ua())}}function ua(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=ta)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:aa)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function pa(){var e;return null===(e=ra)||void 0===e?void 0:e.getRenderId()}function da(){var e;return null===(e=ra)||void 0===e?void 0:e.getRuntimeContext()}function fa(e){var t;return null===(t=ta)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function va(e){var t;return null===(t=fa(e))||void 0===t?void 0:t.app}function ha(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==na||null===(e=na.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function ma(){var e;return null==na||null===(e=na.auth)||void 0===e?void 0:e.getAuth()}function ga(){var e,t;return null==na||null===(e=na.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function ya(){var e;return null==na||null===(e=na.auth)||void 0===e?void 0:e.isLoggedIn()}function ba(e,t,r){return wa.apply(this,arguments)}function wa(){return(wa=(0,i.Z)((function*(e,t,r){return Ke(yield Ue(e),e,"resolve",t,r)}))).apply(this,arguments)}function Sa(e){var t,{portal:r,scope:n="fragment",unknownBricks:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r;t=r||(()=>((o=document.createElement("div")).style.position="absolute",o.style.width=o.style.height="0",document.body.append(o),o));var s,c,l=!1;return{render(r){var p=arguments;return(0,i.Z)((function*(){var{theme:i,context:d,functions:f,templates:v,i18n:h}=p.length>1&&void 0!==p[1]?p[1]:{};if(l)throw new Error("The root is unmounted and cannot be rendered any more");var m=[].concat(r),g=s;s=new yn(n,{unknownBricks:a});var y={ctxStore:new Er("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},b={tag:Rr.ROOT,container:e,createPortal:t};if("page"===n){var w;Y(null!=i?i:"light"),ae("default");var S={id:"demo",homepage:"/demo"};y.app=S;var E={app:S,meta:{i18n:h,customTemplates:v}};null===(w=c)||void 0===w||w(),c=M(E),On(E),ve(f,S)}y.ctxStore.define(d,y);var k,A=!1,P=[];try{k=yield qr(b,m,y,s),(0,u.flushStableLoadBricks)(),P=[y.ctxStore,...y.tplStateStoreMap.values(),...y.formStateStoreMap.values()],yield Promise.all([...k.blockingList,...P.map((e=>e.waitForAll())),...y.pendingPermissionsPreCheck])}catch(e){A=!0,k={node:{tag:Rr.BRICK,type:"div",properties:{textContent:Wt(e)},return:b,runtimeContext:null},blockingList:[],menuRequests:[]}}if(b.child=k.node,null==g||g.dispatchOnUnmount(),null==g||g.dispose(),rn(e),o&&rn(o),"page"===n&&(A||s.dispatchBeforePageLoad(),ee(),oe()),nn(b),"page"===n&&window.scrollTo(0,0),!A){for(var Z of P)Z.handleAsyncAfterMount();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){l||(l=!0,rn(e),o&&(rn(o),r||o.remove()))}}}function Ea(e,t){return ka.apply(this,arguments)}function ka(){return(ka=(0,i.Z)((function*(e,t){var r,n,i,o=[],s=[],c=(0,a.Z)((0,a.Z)({},da()),{},{data:t,pendingPermissionsPreCheck:[],tplStateStoreScope:o,formStateStoreScope:s});null!==(r=c.tplStateStoreMap)&&void 0!==r||(c.tplStateStoreMap=new Map),null!==(n=c.formStateStoreMap)&&void 0!==n||(c.formStateStoreMap=new Map);var l=new yn("fragment"),p={tag:Rr.ROOT,createPortal:null},d=e.transform,f=Pe();d&&Ze(f,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var v=yield Kr(p,f?e:(0,a.Z)((0,a.Z)({},e),{},{properties:(0,a.Z)((0,a.Z)({},e.properties),d)}),c,l);(0,u.flushStableLoadBricks)();var h=[...o,...s];if(yield Promise.all([...v.blockingList,...h.map((e=>e.waitForAll())),...c.pendingPermissionsPreCheck]),null!==(i=v.node)&&void 0!==i&&i.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return p.child=v.node,{tagName:v.node?v.node.type:null,renderRoot:p,rendererContext:l,scopedStores:h}}))).apply(this,arguments)}function Aa(e,t){var r,{renderRoot:n,rendererContext:a,scopedStores:i}=e;for(var o of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},nn(n,t),i))o.handleAsyncAfterMount();return a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),{portal:r}}function Pa(e,t){var{rendererContext:r}=e;t.portal&&(rn(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function Za(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return lt(t,(0,a.Z)((0,a.Z)({},da()),{},{data:e}),{noInject:!0})}function Ia(e,t){var r=fa(e);Object.assign(r,(0,a.Z)((0,a.Z)({},t),{},{$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),M(r)}function Oa(e,t){var r=fa(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),i=(e,r)=>e.map((e=>{var o=a(e);return"routes"===e.type?(e.routes=i(e.routes,r),e):o===r?(n=!0,t):e}));r.routes=i(r.routes,a(t)),n||r.routes.unshift(t)}function Ca(e,t,r){var n="".concat(e,".").concat(t.name);Ce.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),xa(e,t.name,r)}function xa(e,t,r){Ma(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.Z)({brick:t},(0,m.pick)(r,"properties","events","lifeCycle","context"))])}function Ta(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function Ra(e,t){var r;Ma(e,Ta(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var Ba=Ra;function Ma(e,t,r,n){var{routes:a}=fa(e),i=a.findIndex((e=>e.path===t)),o={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===i?a.unshift(o):a.splice(i,1,o)}function _a(e,t){var{tplStateStoreId:r}=t,n=da();return r?xe((0,a.Z)((0,a.Z)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function La(e){var{tplStateStoreId:t}=e,r=da();return t?xe((0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Fa(e){return ua().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Na(){return pa()}function Ua(e,t){return ja.apply(this,arguments)}function ja(){return(ja=(0,i.Z)((function*(e,t){var r,{appId:n,updateStoryboardType:a,provider:i}=t,o=fa(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,c=Ta(e.snippetId);r={routes:[null==o||null===(s=o.routes)||void 0===s?void 0:s.find((e=>e.path===c))]}}var l=[];if(r&&i){yield(0,u.loadBricksImperatively)([i],ua());var p=document.createElement(i);(yield p.resolve(r)).forEach((e=>{var t,[r,n,a]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=o&&null!==(t=o.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===n&&e.name===a))||l.push(e)}))}return l}))).apply(this,arguments)}},7929:(e,t,r)=>{r.r(t),r.d(t,{supply:()=>s});var n=r(3028),a=r(5178),i=r(8874),o=r(8183);function s(e,t,r){var a=(0,n.Z)({},t);for(var i of(a[void 0]=void 0,e))if(!Object.prototype.hasOwnProperty.call(a,i)){var o=p(i,r);void 0!==o&&(a[i]=o)}return a}var c=new Set(["fill","pull","pullAll","pullAllBy","pullAllWith","pullAt","remove","reverse","assign","assignIn","assignInWith","assignWith","defaults","defaultsDeep","merge","mergeWith","set","setWith","unset","update","updateWith","after","ary","before","bind","bindKey","curry","curryRight","debounce","defer","delay","flip","memoize","negate","once","overArgs","partial","partialRight","rearg","rest","spread","throttle","unary","wrap"]),l=new Set(["lang","langData","locale","localeData","defineLocale","updateLocale","updateOffset"]),u=new Set(["Array","Boolean","Date","Infinity","JSON","Math","NaN","Number","String","RegExp","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","isFinite","isNaN","parseFloat","parseInt","Map","Set","URLSearchParams","WeakMap","WeakSet","atob","btoa"]);function p(e,t){switch(e){case"Object":return r=Object,n=["entries","fromEntries","keys","values"],Object.fromEntries(n.map((e=>[e,function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r[e].apply(r,n)}])));case"_":return Object.fromEntries(Object.entries(a).filter((e=>!c.has(e[0]))).concat(t?[["uniqueId",e=>"".concat(null!=e?e:"","42")]]:[]));case"moment":return Object.assign((function(){return i(...arguments)}),Object.fromEntries(Object.entries(i).filter((e=>!l.has(e[0])))));case"PIPES":return o.pipes;case"TAG_URL":return d(!0);case"SAFE_TAG_URL":return d();default:if(u.has(e))return window[e]}var r,n}function d(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var i=[];return t.forEach(((t,r)=>{i.push(t),r<n.length&&i.push(e?String(n[r]).replace(/[^/]+/g,(e=>encodeURIComponent(e))):encodeURIComponent(String(n[r])))})),i.join("")}}},8486:(e,t,r)=>{function n(e){return class extends HTMLElement{get $$typeof(){return"provider"}resolve(){return e(...arguments)}}}function a(e){var t=Object.getOwnPropertyNames(e);for(var r of t){var n=e[r];n&&"object"==typeof n&&a(n)}return Object.freeze(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}r.r(t),r.d(t,{JsonStorage:()=>s,createProviderClass:()=>n,deepFreeze:()=>a,hasOwnProperty:()=>i,isObject:()=>o,unwrapProvider:()=>l});class s{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"brick-next-";this.storage=e,this.prefix=t}setItem(e,t){this.storage.setItem(this.prefix+e,JSON.stringify(t))}getItem(e){var t;return JSON.parse(null!==(t=this.storage.getItem(this.prefix+e))&&void 0!==t?t:"null")}removeItem(e){return this.storage.removeItem(this.prefix+e)}clear(){return this.storage.clear()}}var c=new Map;function l(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=function(e){var t=c.get(e);return t||(t=document.createElement(e),c.set(e,t),t)}(e);return a.resolve(...r)}}},1259:(e,t,r)=>{function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(a,i){if("string"==typeof t?a.name===t:t.includes(a.name)){for(var o=[],s=1;s<=r;s++){var c=i[i.length-s];if("MemberExpression"===(null==c?void 0:c.node.type)&&"object"===c.key){var l=c.node;l.computed||"Identifier"!==l.property.type?l.computed&&"Literal"===l.property.type&&"string"==typeof l.property.value?o.push(n?"".concat(a.name,".").concat(l.property.value):l.property.value):e.hasNonStaticUsage=!0:o.push(n?"".concat(a.name,".").concat(l.property.name):l.property.name)}else e.hasNonStaticUsage=!0}o.length===r&&e.usedProperties.add(o.join("."))}}}function a(e,t){return function(r,n,a){if(n.name===e){var i=a[a.length-1],o=a[a.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==i?void 0:i.node.type)&&"object"===i.key&&(i.node.computed?"Literal"===i.node.property.type&&i.node.property.value===t:"Identifier"===i.node.property.type&&i.node.property.name===t)){var s=o.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}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>n,collectAppGetMenuUsage:()=>i,collectInstalledAppsHasUsage:()=>o,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>g,createProviderClass:()=>c.createProviderClass,scanPermissionActionsInAny:()=>S,scanPermissionActionsInStoryboard:()=>w,strictCollectMemberUsage:()=>u,strictCollectMemberUsageInFunction:()=>m,track:()=>d,trackAll:()=>f,traverseStoryboardExpressions:()=>l,traverseStoryboardFunction:()=>h,traverseStoryboardFunctions:()=>v,unwrapProvider:()=>c.unwrapProvider});var i=a("APP","getMenu"),o=a("INSTALLED_APPS","has"),s=r(9044),c=r(9686);function l(e,t,r){var n=new WeakSet,{matchExpressionString:a,visitNotMatchedExpressionString:i,visitNonExpressionString:o,visitObject:l}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,s.isEvaluable)(r))if(a(r))try{(0,s.preevaluate)(r,{withParent:!0,hooks:{beforeVisitGlobal(e,n){t(e,n,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==i||i(r);else null==o||o(r);else if((0,c.isObject)(r)){if(n.has(r))return;for(var u of(n.add(r),null==l||l(r),Array.isArray(r)?r:Object.values(r)))e(u)}}(e)}function u(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{hasNonStaticUsage:n,nonStaticUsage:a,usedProperties:i}=p(e,t,r);if(n)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your expression: "').concat(a,'"'));return i}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a={usedProperties:new Set,hasNonStaticUsage:!1},i=n(a,t,r);return l(e,((e,t,r)=>{i(e,t),a.hasNonStaticUsage&&(a.nonStaticUsage=r)}),t),a}function d(e,t,r){if(e.includes(t)){var a,i={usedProperties:new Set,hasNonStaticUsage:!1},{expression:o}=(0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:n(i,r)}});if("SequenceExpression"===o.type&&(a=o.expressions[0])&&"Literal"===a.type&&a.value===t){if(i.usedProperties.size>0)return i.usedProperties;console.warn('You are using "'.concat(t,'" but no `').concat(r,"` usage found in your expression: ").concat(JSON.stringify(e)))}}return!1}function f(e){if(e){var t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:n(t,["CTX","STATE","FORM_STATE"],1,!0)}}),t.usedProperties.size>0){var r=[...t.usedProperties],a={context:!1,state:!1,formState:!1},i={CTX:"context",STATE:"state",FORM_STATE:"formState"};return r.forEach((e=>{var[t,r]=e.split(".");a[i[t]]||(a[i[t]]=[]),a[i[t]].push(r)})),a}console.warn('You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: '.concat(JSON.stringify(e)))}return!1}function v(e,t){if(Array.isArray(e))for(var r of e)h(r,t)}function h(e,t){try{(0,s.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t}})}catch(t){console.error('Parse storyboard function "'.concat(e.name,'" failed:'),t)}}function m(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{hasNonStaticUsage:n,usedProperties:a}=g(e,t,r);if(n)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your function: "').concat(e.name,'"'));return a}function g(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a={usedProperties:new Set,hasNonStaticUsage:!1};return h(e,n(a,t,r)),a.usedProperties.delete(e.name),a}var y="PERMISSIONS",b="check";function w(e){var t,r=new Set,n=E(r),{customTemplates:a,functions:i}=null!==(t=e.meta)&&void 0!==t?t:{};return l([e.routes,a],n,y),v(i,n),Array.from(r)}function S(e){var t=new Set;return l(e,E(t),y),Array.from(t)}function E(e){return function(t,r){if(t.name===y){var n=r[r.length-1],a=r[r.length-2];if("CallExpression"===(null==a?void 0:a.node.type)&&"callee"===(null==a?void 0:a.key)&&"MemberExpression"===(null==n?void 0:n.node.type)&&"object"===n.key&&(n.node.computed?"Literal"===n.node.property.type&&n.node.property.value===b:"Identifier"===n.node.property.type&&n.node.property.name===b))for(var i of a.node.arguments)"Literal"===i.type&&"string"==typeof i.value&&e.add(i.value)}}}}}]);
2
- //# sourceMappingURL=core.05a93667.js.map