@next-bricks/form-platform 0.3.10 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/2108.529038a7.js +2 -0
  3. package/dist/chunks/2108.529038a7.js.map +1 -0
  4. package/dist/chunks/258.c5253715.js +3 -0
  5. package/dist/chunks/{258.c75ff356.js.map → 258.c5253715.js.map} +1 -1
  6. package/dist/chunks/2985.7a3907db.js +3 -0
  7. package/dist/chunks/2985.7a3907db.js.map +1 -0
  8. package/dist/chunks/4504.250160e5.js +2 -0
  9. package/dist/chunks/4504.250160e5.js.map +1 -0
  10. package/dist/chunks/{6205.3220b6d8.js → 6205.09c6b232.js} +2 -2
  11. package/dist/chunks/{6205.3220b6d8.js.map → 6205.09c6b232.js.map} +1 -1
  12. package/dist/chunks/{7164.9dc4c645.js → 7164.ab5d9708.js} +2 -2
  13. package/dist/chunks/{7164.9dc4c645.js.map → 7164.ab5d9708.js.map} +1 -1
  14. package/dist/chunks/eo-user-or-user-group-select.30a8b2f5.js +3 -0
  15. package/dist/chunks/{eo-user-or-user-group-select.a1632350.js.map → eo-user-or-user-group-select.30a8b2f5.js.map} +1 -1
  16. package/dist/chunks/main.89903604.js +2 -0
  17. package/dist/chunks/{main.d184bda9.js.map → main.89903604.js.map} +1 -1
  18. package/dist/index.013aa8f2.js +2 -0
  19. package/dist/{index.d5d91b8c.js.map → index.013aa8f2.js.map} +1 -1
  20. package/package.json +3 -3
  21. package/dist/chunks/2108.ac703dbd.js +0 -2
  22. package/dist/chunks/2108.ac703dbd.js.map +0 -1
  23. package/dist/chunks/258.c75ff356.js +0 -3
  24. package/dist/chunks/4504.7995d76b.js +0 -2
  25. package/dist/chunks/4504.7995d76b.js.map +0 -1
  26. package/dist/chunks/9213.b1d7c418.js +0 -3
  27. package/dist/chunks/9213.b1d7c418.js.map +0 -1
  28. package/dist/chunks/eo-user-or-user-group-select.a1632350.js +0 -3
  29. package/dist/chunks/main.d184bda9.js +0 -2
  30. package/dist/index.d5d91b8c.js +0 -2
  31. /package/dist/chunks/{258.c75ff356.js.LICENSE.txt → 258.c5253715.js.LICENSE.txt} +0 -0
  32. /package/dist/chunks/{9213.b1d7c418.js.LICENSE.txt → 2985.7a3907db.js.LICENSE.txt} +0 -0
  33. /package/dist/chunks/{eo-user-or-user-group-select.a1632350.js.LICENSE.txt → eo-user-or-user-group-select.30a8b2f5.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_next_bricks_form_platform=self.webpackChunk_next_bricks_form_platform||[]).push([[4504],{4504:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>ir,Notification:()=>vr,StoryboardFunctionRegistryFactory:()=>me,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>ae,authenticate:()=>Qo,batchSetAppsLocalTheme:()=>oe,checkIfByTransform:()=>xt,checkIfOfComputed:()=>Tt,createHistory:()=>R,createRuntime:()=>jo,customProcessors:()=>L,customTemplates:()=>_e,fetchByProvider:()=>ri,getAuth:()=>Xo,getBasePath:()=>g,getCssPropertyValue:()=>de,getCurrentMode:()=>ce,getCurrentTheme:()=>ne,getHistory:()=>T,getPageInfo:()=>Aa,getRuntime:()=>$o,getV2RuntimeFromDll:()=>C,handleHttpError:()=>pr,httpErrorToString:()=>lr,isLoggedIn:()=>ti,isUnauthenticatedError:()=>cr,logout:()=>ei,matchPath:()=>Ht,registerWidgetFunctions:()=>Ne,registerWidgetI18n:()=>$,setUIVersion:()=>Ta,unstable_createRoot:()=>ai});var n={};r.r(n),r.d(n,{addRealTimeDataInspectHook:()=>$n,getAddedContracts:()=>Un,getAllContextValues:()=>_n,getBrickPackagesById:()=>Bn,getContextValue:()=>Mn,getRenderId:()=>Ln,legacyDoTransform:()=>kn,mountUseBrick:()=>Sn,renderUseBrick:()=>bn,setRealTimeDataInspectRoot:()=>jn,symbolForRootRuntimeContext:()=>yn,unmountUseBrick:()=>En,updateSnippetPreviewSettings:()=>xn,updateStoryboard:()=>In,updateStoryboardByRoute:()=>An,updateStoryboardBySnippet:()=>Tn,updateStoryboardByTemplate:()=>Zn,updateTemplatePreviewSettings:()=>Cn});var a=r(3028),o=r(4795),i=r(5866),s=r(6666),l=r(3395),c=r(6171),u=r(381),d=r(687),f=r(1065),p=r(6974),v=r(1935),h=r(8874),m=(r(8525),r(7857));function g(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var y=r(2159),b=r(5178);function w(e,t){var r=(0,b.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app.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]&&S(a,t))return n}}function S(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function E(e){var t;return!e||(null===(t=$o().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var k,I=["extraQuery","clear","keepHash"],A=!1;function Z(e,t){t(!(A=!confirm(e)))}function C(){var e,{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function R(){if(!k){var e=(0,m.createBrowserHistory)({basename:g().replace(/\/$/,""),getUserConfirmation:Z});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function o(e,t,n){A=!1,r(e,t),null==n||n(A)}function i(e,t,r){A=!1,n(e,t),null==r||r(A)}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:l,keepHash:c}=n,u=(0,y.Z)(n,I),d=new URLSearchParams(l?"":e.location.search),f={};for(var[p,v]of(Object.assign(f,r,s),Object.entries(f)))if(Array.isArray(v))for(var h of(d.delete(p),v))d.append(p,h);else null==v||""===v?d.delete(p):d.set(p,v);("push"===t?o:i)("?".concat(d.toString()).concat(c?e.location.hash:""),u,a)}}return(0,a.Z)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){o((0,a.Z)((0,a.Z)({},e.location),{},{key:void 0,hash:t,state:(0,a.Z)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,a.Z)((0,a.Z)({},e.location),{},{state:(0,a.Z)((0,a.Z)({},e.location.state),{},{notify:!0})}),void 0,t)},setBlockMessage:function(e){t=e},getBlockMessage:function(){return t},unblock:function(){t=void 0}},function(e){var{push:t,replace:r}=e;function n(n){return function(a,o,i){var s,l="string"==typeof a;return"string"==typeof(s=l?(0,m.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&E(function(e){var t,r;return w(null!==(t=null===(r=To)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](l?g()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,o,i)}}return{push:n("push"),replace:n("replace")}}((0,a.Z)((0,a.Z)({},e),{},{push:o,replace:i})))}(e)),k=e}return k}var T=function(){var e=C();if(e)return e.getHistory}()||function(){return k},O=r(5932),x=r(488),P=r(4699),M=r(815),_=r(7941),B=new WeakMap,L=function(){var e=C();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomProcessor(t,r)})}()||new class{constructor(){(0,l.Z)(this,B,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,d.Z)(this,B).get(r);if(a||(a=new Map,(0,d.Z)(this,B).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return(0,d.Z)(this,B).get(e)}};function U(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=F("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;f.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)f.i18n.removeResourceBundle(e,n)}}}function F(e,t){return"".concat(e,"/").concat(t)}function N(e){return f.i18n.getFixedT(null,F("widget",e))}var j,$=function(){var e=C();if(e)return function(t,r){return e.getRuntime().registerWidgetI18n(t,r)}}()||function(e,t){var r=F("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;f.i18n.addResourceBundle(t,r,n)}))},D="brick-next-devtools-panel",K="devtools-frame-active-change",V="devtools-panel-change",W=!0;function H(e,t){var r=z();if(r&&("evaluation"!==e||W&&(!j||"Evaluations"===j))){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)}}function z(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var q=()=>{throw new Error("Can't modify read-only proxy object")},G={set:q,defineProperty:q,deleteProperty:q,setPrototypeOf:q};function J(e){return new Proxy(e,G)}function Y(e){var{get:t,ownKeys:r}=e;return z()?J(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var Q="light",X=new v.JsonStorage(localStorage),ee="apps-theme";function te(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));Q=e}function re(){return Q}function ne(){return document.documentElement.dataset.theme}function ae(e){e?te(e):e=re(),e!==ne()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function oe(e){X.setItem(ee,(0,a.Z)((0,a.Z)({},ie()),e))}function ie(){var e,t;try{t=X.getItem(ee)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var se="default";function le(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));se=e}function ce(){return document.documentElement.dataset.mode}function ue(e){e?le(e):e=se,e!==ce()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function de(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 fe(e,t){var r={};for(var n of e){var a=pe(n,t);void 0!==a&&(r[n]=a)}return r}function pe(e,t){var r,n,a,{collectCoverage:o,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:c,storyboardFunctions:u,isStoryboardFunction:d}=t;switch(e){case"BASE_URL":return o?"/next":g().replace(/\/$/,"");case"FN":return u;case"IMG":return o?{get:e=>"mock/images/".concat(e)}:i?null==xo||null===(r=xo.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==xo||null===(n=xo.images)||void 0===n?void 0:n.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return o?b.identity:i?N(i):f.i18n.getFixedT(null,[c,F("app",l.id)].filter(Boolean));case"I18N_TEXT":return o?ve:f.i18nText;case"PERMISSIONS":return J({check:o?he:null==xo||null===(a=xo.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return J({getTheme:o?()=>"light":re});case"console":return d?J(console):void 0;case"location":return o?{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 ve(e){return null==e?void 0:e.en}function he(){return!0}function me(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new Map,i=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,l=o.get(a);if(l){if(l.processed)return l.cooked;n&&(s=n.createCollector(a));var c=(0,x.precookFunction)(l.source,{typescript:l.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return l.cooked=(0,x.cook)(c.function,l.source,{rules:{noVar:!0},globalVariables:(0,_.supply)(c.attemptToVisitGlobals,fe(c.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:i,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),l.processed=!0,l.cooked}}(s)});return{storyboardFunctions:i,registerStoryboardFunctions:function(t,r){if(r&&(e=r),o.clear(),Array.isArray(t))for(var a of t){var i=(0,P.collectMemberUsageInFunction)(a,"FN",!!n),s=(0,P.collectMemberUsageInFunction)(a,"PERMISSIONS",!!n).has("check");o.set(a.name,{source:a.source,typescript:a.typescript,deps:i,hasPermissionsCheck:s})}},updateStoryboardFunction(e,t){var r=(0,a.Z)((0,a.Z)({},t),{},{name:e}),n=(0,P.collectMemberUsageInFunction)(r,"FN",!0),i=(0,P.collectMemberUsageInFunction)(r,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:i})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=o.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:ge,registerStoryboardFunctions:ye,checkPermissionsUsage:be}=me(),we={};try{we.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var r=e.create,n=e.defineProperty,a=o.prototype;function o(){t.set(this,r(null))}function i(e,t,r){n(e,t,{configurable:!0,writable:!0,value:r})}function s(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}i(a,"addEventListener",(function(e,r,n){for(var a=t.get(this),o=a[e]||(a[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===r)return;o.push({target:this,listener:r,options:n})})),i(a,"dispatchEvent",(function(e){var r=t.get(this)[e.type];return r&&(i(e,"target",this),i(e,"currentTarget",this),r.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),i(a,"removeEventListener",(function(e,r){for(var n=t.get(this),a=n[e]||(n[e]=[]),o=0,i=a.length;o<i;o++)if(a[o].listener===r)return void a.splice(o,1)})),we.EventTarget=o}(Object,new WeakMap)}const Se=we.EventTarget;var Ee=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),ke=new Map([[Ee.xLarge,"1920px"],[Ee.large,"1600px"],[Ee.medium,"1280px"],[Ee.small,"1024px"],[Ee.xSmall,0]]),Ie=new Se,Ae={},Ze={};function Ce(e,t){var r=!1;for(var[n]of(Ae[t]=e.matches,ke))if(Ae[n]&&Ze.breakpoint!==n){Ze.breakpoint=n,r=!0;break}r&&Ie.dispatchEvent(new CustomEvent("change",{detail:Ze}))}ke.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));Ce(r,t),r.addEventListener?r.addEventListener("change",(e=>{Ce(e,t)})):r.addListener((e=>{Ce(e,t)}))}));var Re=()=>Ze;function Te(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 Oe(e){var t,r;return!(null===(t=e?e.flags:null===(r=$o())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function xe(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var o=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(o),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(o),...n)}var Pe=new Set(["prefix"]),Me=new WeakMap,_e=function(){var e=C();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomTemplate(t,r)})}()||new class{constructor(){(0,l.Z)(this,Me,{writable:!0,value:new Map})}define(e,t){var r,n,o,i,s=(0,d.Z)(this,Me).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=Oe(),c=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},u=[],f=[];for(var[p,v]of Object.entries(c))v.asVariable?(xe(l,"Template `asVariable`",e,p),l||f.push(p)):v.mergeProperty||v.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,p):v.ref&&u.push([p,v]);var h=(0,a.Z)((0,a.Z)({},t),{},{proxy:(0,a.Z)((0,a.Z)({},t.proxy),{},{properties:Object.fromEntries(u)}),state:(t.state?l?t.state:t.state.map((e=>(0,a.Z)({expose:!0},e))):[]).concat(f.map((e=>({name:e,expose:!0}))))});(0,d.Z)(this,Me).set(e,(0,a.Z)((0,a.Z)({},h),{},{name:e}));var m,g,y=(m=h.state,(0,b.uniq)(null!==(g=null==m?void 0:m.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==g?g:[])),w=Object.entries(null!==(o=null===(i=h.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),S=y.concat(u.map((e=>e[0]))),E=w.map((e=>e[0])),k=S.concat(E).filter((e=>e in HTMLElement.prototype&&!Pe.has(e)));if(k.length>0&&(xe(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 I=function(r){if(u.some((e=>e[0]===r)))return console.error('Cannot define an exposed state that is also a proxy property: "'.concat(r,'" in ').concat(e)),1;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 A of y)I(A);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,o=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);o&&(o[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[C,R]of u)Z(C,R);var T=function(e,r){Object.defineProperty(t.prototype,e,{value(){var t;this.$$getElementByRef(r.ref)[null!==(t=r.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0})};for(var[O,x]of w)T(O,x);customElements.define(e,t)}}get(e){return(0,d.Z)(this,Me).get(e)}};function Be(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var o=a.get(n);if(!o)throw new Error('Template state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return o}function Le(e,t,r){var n=Be(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 Ue=new Map,Fe=new Proxy(Object.freeze({}),{get:(e,t)=>Ue.get(t)}),Ne=function(){var e=C();if(e)return function(t,r,n){return e.getRuntime().registerWidgetFunctions(t,r,n)}}()||function(e,t,r){if(Ue.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=me({widgetId:e,widgetVersion:r});Ue.set(e,n),a(t)};const je=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$e=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(je);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},De=e=>"*"===e||"x"===e||"X"===e,Ke=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Ve=(e,t)=>{if(De(e)||De(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Ke(e),Ke(t));return r>n?1:r<n?-1:0},We=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ve(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},He=(e,t,r)=>{Ge(r);const n=((e,t)=>{const r=$e(e),n=$e(t),a=r.pop(),o=n.pop(),i=We(r,n);return 0!==i?i:a&&o?We(a.split("."),o.split(".")):a||o?a?-1:1:0})(e,t);return ze[r].includes(n)},ze={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},qe=Object.keys(ze),Ge=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===qe.indexOf(e))throw new Error(`Invalid operator, expected one of ${qe.join("|")}`)};function Je(e,t){var r=Yo(e);if(!r&&null!=xo&&xo.checkInstalledApps&&(r=xo.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 He(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Ye(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 o=a.get(n);if(!o)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 o}var Qe=new Map;function Xe(e){return et.apply(this,arguments)}function et(){return et=(0,o.Z)((function*(e){var t,r=null==xo||null===(t=xo.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=xo.flowApi.FLOW_API_PROVIDER);var n=Qe.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)xo.flowApi.registerFlowApiProvider();else if(yield(0,p.loadBricksImperatively)([e],zo()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Qe.set(e,n),n})),et.apply(this,arguments)}var tt=new WeakSet;function rt(e){if((0,v.isObject)(e)&&!nt(e))if(tt.add(e),Array.isArray(e))e.forEach(rt);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(rt)}}function nt(e){return tt.has(e)}var at=new Map;function ot(e,t,r){return it.apply(this,arguments)}function it(){return(it=(0,o.Z)((function*(e,t,r){var{useProvider:n,method:o="resolve",args:i=[],onReject:s}=e,{provider:l,field:c}=e;if(l&&!n)throw new Error("You're using \"provider: ".concat(l,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=c;if(u){var d=Oe();if(xe(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var f,[p,v]=yield Promise.all([Xe(n),St(i,t)]),h=null==r?void 0:r.renderId,m=st(p,n,o,v,r,i,!!h&&h!==qo()),{transform:g}=e;try{var y=yield m;rt(f=u?(0,b.get)(y,c):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,f=e}return g?"string"==typeof g?{[g]:f}:St(g,(0,a.Z)((0,a.Z)({},t),{},{data:f})):f}))).apply(this,arguments)}function st(e,t,r,n,a,o,i){return lt.apply(this,arguments)}function lt(){return lt=(0,o.Z)((function*(e,t,r,n,a,i,s){var l,c;try{l=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!i)throw e;l=JSON.stringify({useProvider:t,method:r,originalArgs:i})}return"reload"!==(null==a?void 0:a.cache)&&(c=at.get(l)),c||(c=(0,o.Z)((function*(){var a,o=null!=xo&&null!==(a=xo.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield xo.flowApi.getArgsOfFlowApi(t,n,r):n;return e[r](...o)}))(),s||at.set(l,c)),c})),lt.apply(this,arguments)}var ct=Symbol.for("pre.evaluated.raw"),ut=Symbol.for("pre.evaluated.context");function dt(e){return!(null==e||!e[ct])}function ft(e){return e[ct]}function pt(e){return"string"==typeof e?(0,x.shouldAllowRecursiveEvaluations)(e):(0,x.shouldAllowRecursiveEvaluations)(e[ct])}var vt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function ht(e){return vt.has(e.constructor)?e.constructor:TypeError}function mt(){return(mt=(0,o.Z)((function*(e,t,r){var{blockingList:n,run:a}=gt(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function gt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=[];if("string"!=typeof e){var i=(0,b.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.Z)((0,a.Z)({},e[ut]),i),e=e[ct]}var s,l={usedArgs:new Set},c={usedArgs:new Set};try{s=(0,x.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,P.collectAppGetMenuUsage)(l,e,t),(0,P.collectInstalledAppsHasUsage)(c,e,t)}}})}catch(t){var u="".concat(t.message,', in "').concat(e,'"');throw new(ht(t))(u)}if(l.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(c.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var d,f,h,m,g={},{attemptToVisitGlobals:y}=s;if(r.lazy||y.has("EVENT")&&!(0,v.hasOwnProperty)(t,"event")||y.has("DATA")&&!(0,v.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[ct]:e,[ut]:t}:e};var w,S,E=Oe(t);(y.has("STATE")||!E&&y.has("TPL"))&&(m=Be(t,"STATE",': "'.concat(e,'"'))),y.has("FORM_STATE")&&(S=Ye(t,"FORM_STATE",': "'.concat(e,'"')));var k=z();if(n||k){if(y.has("CTX")&&(d=(0,P.strictCollectMemberUsage)(e,"CTX"),n&&o.push(t.ctxStore.waitFor(d))),m){if(h=(0,P.strictCollectMemberUsage)(e,"STATE"),!E){var I=(0,P.strictCollectMemberUsage)(e,"TPL");for(var A of I)h.add(A)}n&&o.push(m.waitFor(h))}S&&(w=(0,P.strictCollectMemberUsage)(e,"FORM_STATE"),n&&o.push(S.waitFor(w))),y.has("PROCESSORS")&&(f=(0,P.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&o.push((0,p.loadProcessorsImperatively)(f,zo())))}if(n){var Z,C=y.has("PERMISSIONS");if(!C&&y.has("FN")){var R=[...(0,P.strictCollectMemberUsage)(e,"FN")];C=be(R)}if(C&&o.push(...t.pendingPermissionsPreCheck),l.usedArgs.size>0&&null!=xo&&xo.menu){var T=[...l.usedArgs];o.push(Promise.all(T.map((e=>xo.menu.fetchMenuById(e,t,{getStoryboardByAppId:Jo,resolveData:ot,asyncComputeRealValue:St})))))}c.usedArgs.size>0&&o.push(null==xo||null===(Z=xo.checkInstalledApps)||void 0===Z?void 0:Z.waitForCheckingApps([...c.usedArgs]))}return{blockingList:o,run(){var r,n,o,i,{app:l,location:c,query:u,match:p,flags:k,sys:I,ctxStore:A,data:Z,event:C}=t,R=null!==(r=t.overrideApp)&&void 0!==r?r:l;for(var T of y)switch(T){case"ANCHOR":g[T]=c.hash?c.hash.substring(1):null;break;case"APP":g[T]=(0,a.Z)((0,a.Z)({},(0,b.cloneDeep)(R)),{},{getMenu:null==xo||null===(n=xo.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":g[T]=Y({get:(e,t)=>A.getValue(t),ownKeys:()=>Array.from(d)});break;case"DATA":g[T]=Z;break;case"EVENT":g[T]=C;break;case"FLAGS":g[T]=J(k);break;case"FORM_STATE":g[T]=Y({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":g[T]=c.hash;break;case"INSTALLED_APPS":g[T]=J({has:Je});break;case"ITEM":case"INDEX":var O="ITEM"===T?"forEachItem":"forEachIndex";(0,v.hasOwnProperty)(t,O)?g[T]=t[O]:console.error("Using `".concat(T,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":g[T]=J({getItem:Te("local")});break;case"MEDIA":g[T]=J(Re());break;case"MISC":g[T]=$o().getMiscSettings();break;case"PARAMS":g[T]=new URLSearchParams(u);break;case"PATH":g[T]=J(null!==(o=null==p?void 0:p.params)&&void 0!==o?o:{});break;case"PATH_NAME":g[T]=c.pathname;break;case"PROCESSORS":g[T]=Y({get(e,t){var r=L.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return Y({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of f){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":g[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":g[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":g[T]=J({getItem:Te("session")});break;case"TPL":if(xe(E,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),E)break;case"STATE":g[T]=Y({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":g[T]=J(null!=I?I:{});break;case"__WIDGET_FN__":g[T]=Fe;break;case"__WIDGET_IMG__":g[T]=null==xo||null===(i=xo.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":g[T]=N}Object.assign(g,fe(s.attemptToVisitGlobals,{storyboardFunctions:ge,app:R,appendI18nNamespace:t.appendI18nNamespace}));try{var P=(0,x.cook)(s.expression,s.source,{globalVariables:(0,_.supply)(s.attemptToVisitGlobals,g)});return H("evaluation",{raw:e,context:g,result:P}),P}catch(t){var M="".concat(t.message,', in "').concat(e,'"');throw new(ht(t))(M)}}}}var yt=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 bt(e){switch(e){case yt.USE_BRICK_PROPERTIES:case yt.USE_BRICK_TRANSFORM:case yt.USE_BRICK_EVENTS:case yt.USE_BRICK_IF:case yt.USE_BRICK_LIFECYCLE:case yt.USE_BRICK_DATA_SOURCE:return!0}return!1}function wt(e,t,r){if(bt(e))return e;if(t)switch(e){case yt.USE_BRICK:return yt.USE_BRICK_ITEM;case yt.USE_BRICK_SLOTS_ITEM_BRICKS:return yt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case yt.INITIAL:if("useBrick"===r)return yt.USE_BRICK;break;case yt.USE_BRICK:case yt.USE_BRICK_ITEM:case yt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return yt.USE_BRICK_PROPERTIES;case"transform":return yt.USE_BRICK_TRANSFORM;case"dataSource":return yt.USE_BRICK_DATA_SOURCE;case"events":return yt.USE_BRICK_EVENTS;case"slots":return yt.USE_BRICK_SLOTS;case"children":return yt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return yt.USE_BRICK_IF;case"lifeCycle":return yt.USE_BRICK_LIFECYCLE}break;case yt.USE_BRICK_SLOTS:return yt.USE_BRICK_SLOTS_ITEM;case yt.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return yt.USE_BRICK_SLOTS_ITEM_BRICKS}return yt.INITIAL}function St(e,t){return Et.apply(this,arguments)}function Et(){return Et=(0,o.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&bt(r.$$stateOfUseBrick),i=o;return n||(0,x.isEvaluable)(e)?(a=yield function(e,t,r){return mt.apply(this,arguments)}(e,t,{lazy:o}),i=pt(e)):a=o?e:((0,v.hasOwnProperty)(t,"data")?r.noInject?M.transform:M.transformAndInject:r.noInject?At:M.inject)(e,t),i||rt(a),a}if(!(0,v.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=It(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,It(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),Et.apply(this,arguments)}function kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&bt(r.$$stateOfUseBrick),i=o;return n||(0,x.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=gt(e,t,void 0,!1);return n()}(e,t),i=pt(e)):a=o?e:((0,v.hasOwnProperty)(t,"data")?r.noInject?M.transform:M.transformAndInject:r.noInject?At:M.inject)(e,t),i||rt(a),a}if(!(0,v.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=It(r,!0);return e.map((e=>kt(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[kt(n,t),kt(a,t,It(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function It(e,t,r){return e.$$lazyForUseBrick?(0,a.Z)((0,a.Z)({},e),{},{$$stateOfUseBrick:wt(e.$$stateOfUseBrick,t,r)}):e}function At(e){return e}function Zt(e,t){return Ct.apply(this,arguments)}function Ct(){return(Ct=(0,o.Z)((function*(e,t){return!(0,v.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||dt(e.if)?yield St(e.if,t):e.if)}))).apply(this,arguments)}function Rt(e,t){return!(0,v.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||dt(e.if)?kt(e.if,t):e.if)}function Tt(e){return!(0,v.hasOwnProperty)(e,"if")||!!e.if}function Ot(){return(Ot=(0,o.Z)((function*(e,t){return(0,v.isObject)(e.if)&&!dt(e.if)?Tt(yield ot(e.if,t)):Zt(e,t)}))).apply(this,arguments)}var xt=function(){var e=C();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Rt(e,{data:t})};function Pt(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,x.isEvaluable)(e):dt(e)){var a="string"==typeof e?e:ft(e);if((0,x.isTrackAll)(a)){var o=(0,P.trackAll)(a);o&&(t=o.context,r=o.state,n=o.formState)}else t=(0,P.track)(a,"track context","CTX"),r=(0,P.track)(a,"track state","STATE"),n=(0,P.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function Mt(e,t){return _t.apply(this,arguments)}function _t(){return(_t=(0,o.Z)((function*(e,t){for(var[r,n,a]of e)if(r===t){var o=yield n;if(void 0!==o||!a)return o}}))).apply(this,arguments)}function Bt(e){return Lt.apply(this,arguments)}function Lt(){return(Lt=(0,o.Z)((function*(e){var t={};for(var[r,n,a]of e){var o=yield n;void 0===o&&a||!("style"!==r&&"dataset"!==r||(0,v.isObject)(o))||(t[r]=o)}return t}))).apply(this,arguments)}function Ut(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,o]of Object.entries(n))e[r][a]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function Ft(e,t,r){var n=function(e,t){return(0,v.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=kt(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?yt.USE_BRICK:yt.INITIAL});if("style"!==r&&"dataset"!==r||(0,v.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ut(e,n)}))}function Nt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function jt(e){return e&&e.sensitive?"":"i"}function $t(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,i=void 0===o||o,s=r.end,l=void 0===s||s,c=r.encode,u=void 0===c?function(e){return e}:c,d=r.delimiter,f=void 0===d?"/#?":d,p=r.endsWith,v="[".concat(Nt(void 0===p?"":p),"]|$"),h="[".concat(Nt(f),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var b=y[g];if("string"==typeof b)m+=Nt(u(b));else{var w=Nt(u(b.prefix)),S=Nt(u(b.suffix));if(b.pattern)if(t&&t.push(b),w||S)if("+"===b.modifier||"*"===b.modifier){var E="*"===b.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(b.pattern,")(?:").concat(S).concat(w,"(?:").concat(b.pattern,"))*)").concat(S,")").concat(E)}else m+="(?:".concat(w,"(").concat(b.pattern,")").concat(S,")").concat(b.modifier);else"+"===b.modifier||"*"===b.modifier?m+="((?:".concat(b.pattern,")").concat(b.modifier,")"):m+="(".concat(b.pattern,")").concat(b.modifier);else m+="(?:".concat(w).concat(S,")").concat(b.modifier)}}if(l)a||(m+="".concat(h,"?")),m+=r.endsWith?"(?=".concat(v,")"):"$";else{var k=e[e.length-1],I="string"==typeof k?h.indexOf(k[k.length-1])>-1:void 0===k;a||(m+="(?:".concat(h,"(?=").concat(v,"))?")),I||(m+="(?=".concat(h,"|").concat(v,")"))}return new RegExp(m,jt(r))}(function(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var a=1,o="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--a){s++;break}}else if("("===e[s]&&(a++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=e[s++]}else o+=e[s++]+e[s++];if(a)throw new TypeError("Unbalanced pattern at ".concat(r));if(!o)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:o}),r=s}else{for(var i="",s=r+1;s<e.length;){var l=e.charCodeAt(s);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,a=void 0===n?"./":n,o="[^".concat(Nt(t.delimiter||"/#?"),"]+?"),i=[],s=0,l=0,c="",u=function(e){if(l<r.length&&r[l].type===e)return r[l++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var n=r[l],a=n.type,o=n.index;throw new TypeError("Unexpected ".concat(a," at ").concat(o,", expected ").concat(e))},f=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};l<r.length;){var p=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=p||"";-1===a.indexOf(m)&&(c+=m,m=""),c&&(i.push(c),c=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||o,modifier:u("MODIFIER")||""})}else{var g=p||u("ESCAPED_CHAR");if(g)c+=g;else if(c&&(i.push(c),c=""),u("OPEN")){m=f();var y=u("NAME")||"",b=u("PATTERN")||"",w=f();d("CLOSE"),i.push({name:y||(b?s++:""),pattern:y&&!b?o:b,prefix:m,suffix:w,modifier:u("MODIFIER")||""})}else d("END")}}return i}(e,r),t,r)}function Dt(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,a=r.exec(e.source);a;)t.push({name:a[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),a=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return Dt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),jt(r))}(e,t,r):$t(e,t,r)}var Kt=new Map,Vt=1e4,Wt=0;function Ht(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:o=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:i,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Kt.get(r);n||Kt.set(r,n=new Map);var a=n.get(e);if(a)return a;var o=[],i={regexp:Dt(e,o,t),keys:o};return Wt<Vt&&(n.set(e,i),Wt++),i}(r,{end:n,strict:a,sensitive:o}),l=i.exec(e);if(!l)return null;var[c,...u]=l,d=e===c;return n&&!d?null:{path:r,url:"/"===r&&""===c?"/":c,isExact:d,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function zt(){return(zt=(0,o.Z)((function*(e,t){for(var r of e){if("string"!=typeof r.path)throw console.error("Invalid route with invalid path:",r),new Error("Invalid route with invalid type of path: ".concat(typeof r.path));var n=qt(r,t.app.homepage,t.location.pathname);if(n&&(yield Zt(r,t)))return t.app.noAuthGuard||r.public||null==xo||!xo.auth||xo.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function qt(e,t,r){return Ht(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var Gt,Jt=Symbol.for("tpl.asyncComputedPropsFromHost"),Yt=Symbol.for("tpl.stateStoreId"),Qt=Symbol.for("tpl.externalForEachItem"),Xt=Symbol.for("tpl.externalForEachIndex"),er=new Set,tr=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}({}),rr={[tr.REQUEST_FAILED]:"Request Failed",[tr.SOMETHING_WENT_WRONG]:"Something went wrong!",[tr.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[tr.NETWORK_ERROR]:"Network error, please check your network."},nr={[tr.REQUEST_FAILED]:"请求失败",[tr.SOMETHING_WENT_WRONG]:"出现了一些问题!",[tr.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[tr.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},ar="core/runtime",or={en:rr,zh:nr},ir=Object.freeze({show:function(e){return Gt?Gt.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 sr(e){var{search:t,pathname:r}=e,n=r?window.btoa(encodeURIComponent(r)):"",a=t?window.btoa(encodeURIComponent(t)):"";document.cookie="SALOGINPATH=".concat(n,"; path=/"),document.cookie="SALOGINQUERY=".concat(a,"; path=/")}function lr(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof O.HttpFetchError)return f.i18n.t("".concat(ar,":").concat(tr.NETWORK_ERROR));if(e instanceof O.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 cr(e){return e instanceof O.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var ur,dr,fr=!1;function pr(e){if(!(e instanceof O.HttpAbortError)){if(cr(e)&&!window.NO_AUTH_GUARD){if(fr)return;return fr=!0,void ir.show({type:"confirm",content:f.i18n.t("".concat(ar,":").concat(tr.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=$o().getFeatureFlags()["sso-enabled"],sr((t=T()).location),t.push(e?"/sso-auth/login":"/auth/login",{from:(0,a.Z)((0,a.Z)({},t.location),{},{state:void 0})}),fr=!1}),(()=>{fr=!1}))}console.error(e);var t=lr(e);t!==ur&&(ur=t,ir.show({type:"error",title:f.i18n.t("".concat(ar,":").concat(tr.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{ur=void 0})))}}var vr=Object.freeze({show:function(e){dr?dr.resolve(e):alert(e.message)}});function hr(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,o=wr(a,r,{element:e});for(var i of(e.addEventListener(n,o),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,o]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,i])}))}function mr(e){return"string"==typeof e.action}function gr(e){return"string"==typeof e.useProvider}function yr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function br(e){return!!e.then}function wr(e,t,r){return function(n){var o,i;for(var s of[].concat(e))if(Rt(s,(0,a.Z)((0,a.Z)({},t),{},{event:n})))if(br(s))wr(s.then,t,r)(n);else if(mr(s)){var[l,c]=s.action.split(".");switch(s.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":Zr(n,c,s.args,s.callback,t);break;case"window.open":Cr(n,s.args,t);break;case"location.reload":case"location.assign":Pr(n,c,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Mr(n,l,c,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"console.log":case"console.error":case"console.warn":case"console.info":_r(n,c,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Br(n,c,s.args,t);break;case"handleHttpError":pr(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":Tr(n,c,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":Or(n,c,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=Nr(s.args,t,n);Le(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":xr(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Lr(n,c,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":ae("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[f]=Nr(s.args,t,n);ae(f);break;case"mode.setDashboardMode":case"mode.setDefaultMode":ue("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else gr(s)?Sr(n,s,t,r):yr(s)?kr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&wr(s.else,t,r)(n)}}function Sr(e,t,r,n){return Er.apply(this,arguments)}function Er(){return(Er=(0,o.Z)((function*(e,t,r,n){try{Ir(e,yield Xe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(lr(e))}}))).apply(this,arguments)}function kr(e,t,r,n){var o=[],i=t.target,s=t.targetRef,l=i;if(("string"==typeof i?(0,x.isEvaluable)(i):dt(i))&&(l=kt(i,(0,a.Z)((0,a.Z)({},r),{},{event:e}))),"string"==typeof l)if("_self"===l)o.push(n.element);else if(t.multiple)o=Array.from(document.querySelectorAll(l));else{var c=document.querySelector(l);null!==c&&o.push(c)}else if(l)l instanceof HTMLElement?o.push(l):console.error("unexpected target:",l);else if(s){var u=s;("string"==typeof s?(0,x.isEvaluable)(s):dt(s))&&(u=kt(s,(0,a.Z)((0,a.Z)({},r),{},{event:e})));var d=[].concat(u),f=Le(r,"targetRef",": ".concat(d.join(", ")));o.push(...d.map((e=>{var t;return null===(t=f.$$getElementByRef)||void 0===t?void 0:t.call(f,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((a=>{Ir(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Ft(o,t.properties,(0,a.Z)((0,a.Z)({},r),{},{event:e})):console.error("target not found:",i||s)}function Ir(e,t,r,n,a,o,i){return Ar.apply(this,arguments)}function Ar(){return Ar=(0,o.Z)((function*(e,t,r,n,i,s,l){var c;if("function"==typeof t[n]){var u=function(){var a=(0,o.Z)((function*(){var a,o=Nr(r.args,i,e,l);return gr(r)&&null!=xo&&null!==(a=xo.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(o=yield xo.flowApi.getArgsOfFlowApi(r.useProvider,o,n)),t[n](...o)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var d,f=Fr(r.callback,i,s),p={progress:f("progress"),success:f("success"),error:f("error"),finally:f("finally")};if(gr(r)&&(d=kt(r.poll,(0,a.Z)((0,a.Z)({},i),{},{event:e}))),null!==(c=d)&&void 0!==c&&c.enabled)!function(e,t,r){var n,{progress:a,success:i,error:s,finally:l}=t,{interval:c,leadingRequestDelay:u,continueOnError:d,delegateLoadingBar:f,expectPollEnd:p,expectPollStopImmediately:v}=r,h=qo();function m(){return g.apply(this,arguments)}function g(){return(g=(0,o.Z)((function*(){var t;er.delete(n);try{if(!(t=null==v?void 0:v())){var r=yield e();(t=(null==v?void 0:v())||h!==qo())||(null==a||a(r),null!=p&&p(r)?(f&&window.dispatchEvent(new Event("request.end")),null==i||i(r),null==l||l()):y(null!=c?c:3e3))}}catch(e){(t=(null==v?void 0:v())||h!==qo())||(null==s||s(e),d?y(null!=c?c:3e3):null==l||l())}finally{f&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function y(e){n=setTimeout(m,e),er.add(n)}y(null!=u?u:0),f&&window.dispatchEvent(new Event("request.start"))}(u,p,d);else try{var v=yield u();p.success(v)}catch(e){p.error(e)}finally{p.finally()}}else u()}else console.error("target has no method:",{target:t,method:n})})),Ar.apply(this,arguments)}function Zr(e,t,r,n,a){var o=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":o=2,i=!0;break;case"reload":i=!0;break;case"block":o=1,s="setBlockMessage"}var l=[];if(o>0&&((l=Nr(r,a,e,{useEventDetailAsDefault:!0})).length=o),i&&n){var c=Fr(n,a,void 0);l.push((e=>{c(e?"error":"success")({blocked:e}),c("finally")({blocked:e})}))}T()[s](...l)}function Cr(e,t,r){var[n,a,o]=Nr(t,r,e);window.open(n,a||"_self",o)}function Rr(e,t,r,n,a,o){t?n.updateValues(e,r,(e=>Nr(e,a,o)[0])):e.forEach((e=>{var{name:t,value:i}=Nr([e],a,o)[0];n.updateValue(t,i,r)}))}function Tr(e,t,r,n,a,o){if(!Array.isArray(r)||!r.every(v.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=Nr(r,o,e);o.ctxStore.updateValue(i,s,t,a,o)}else Rr(r,n,t,o.ctxStore,o,e)}function Or(e,t,r,n,a,o){if(Array.isArray(r)&&r.every(v.isObject)&&"update"===t)Rr(r,n,"replace",Be(o,"state.".concat(t),": ".concat(JSON.stringify(r))),o,e);else{var[i,s]=Nr(r,o,e);Be(o,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,a,o)}}function xr(e,t,r,n){var[a,o]=Nr(t,n,e);Ye(n,"formstate.update",": ".concat(a)).updateValue(a,o,"replace",r,n)}function Pr(e,t,r,n){if("assign"===t){var[a]=Nr(r,n,e);location.assign(a)}else location[t]()}function Mr(e,t,r,n,a){var o="localStorage"===t?localStorage:sessionStorage,[i,s]=Nr(n,a,e);"setItem"===r?void 0!==s&&o.setItem(i,JSON.stringify(s)):o.removeItem(i)}function _r(e,t,r,n){console[t](...Nr(r,n,e,{useEventAsDefault:!0}))}function Br(e,t,r,n){var a=Nr(r,n,e,{useEventAsDefault:!0});vr.show({type:t,message:a[0]})}function Lr(e,t,r,n,a,o){return Ur.apply(this,arguments)}function Ur(){return(Ur=(0,o.Z)((function*(e,t,r,n,a,o){var i=()=>{var a,o=Nr(r,n,e);return null==xo||null===(a=xo.messageDispatcher)||void 0===a?void 0:a[t](...o)};if(o){var s=Fr(o,n,a);try{var l=yield i();s("success")(l)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Fr(e,t,r){return function(n){return function(a){var o=null==e?void 0:e[n];if(o)try{var i=new CustomEvent("callback.".concat(n),{detail:a});wr(o,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function Nr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?kt(e,(0,a.Z)((0,a.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}function jr(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:o}=Be(n,"bindTemplateProxy"),i=o.tplHostMetadata;i.internalBricksByRef.set(r,e);var s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s){var l=function(e){if(u.ref===r){var t,n,i,s=t=>{t.bubbles&&t.stopPropagation(),o.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},l=null!==(t=u.refEvent)&&void 0!==t?t:e;a.addEventListener(l,s),null!==(i=(n=a).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),a.$$proxyListeners.push([l,s])}};for(var[c,u]of Object.entries(s))l(c)}}}function $r(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:a}=Be(r,"unbindTemplateProxy"),o=a.tplHostMetadata;for(var[i,s]of(o.internalBricksByRef.delete(t),null!==(l=n.$$proxyListeners)&&void 0!==l?l:[])){var l;n.removeEventListener(i,s)}delete n.$$proxyListeners}}var Dr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Kr(e){e.replaceChildren()}function Vr(e,t){for(var r=e.child,n=[];r;){if(r.tag===Dr.BRICK){var a,o=r.type;o.includes("-")&&!customElements.get(o)&&console.error("Undefined custom element: ".concat(o)),"basic-bricks.script-brick"===o&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var i=t&&r===e.child?t:document.createElement(o);r.element=i,r.slotId&&i.setAttribute("slot",r.slotId),r.iid&&(i.dataset.iid=r.iid),null!==(a=r.tplHostMetadata)&&void 0!==a&&a.tplStateStoreId&&(i.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),Ut(i,r.properties),hr(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=Be({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),jr(r),r.portal?n.push(i):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(i))}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var s,l=r.return;l;){var c;if(l.childElements)l.tag===Dr.ROOT?null===(c=l.container)||void 0===c||c.append(...l.childElements):l.element.append(...l.childElements),l.childElements=void 0;if(l.tag===Dr.ROOT&&n.length>0&&("function"==typeof l.createPortal?l.createPortal():l.createPortal).append(...n),l.sibling)break;l=l.return}r=null===(s=l)||void 0===s?void 0:s.sibling}}}var Wr=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Hr=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],zr=new WeakMap,qr=new WeakMap,Gr=new WeakMap,Jr=new WeakMap,Yr=new WeakMap,Qr=new WeakMap,Xr=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;class sn{constructor(e,t){var r;(0,i.Z)(this,on),(0,i.Z)(this,an),(0,i.Z)(this,nn),(0,i.Z)(this,rn),(0,s.Z)(this,"scope",void 0),(0,s.Z)(this,"unknownBricks",void 0),(0,s.Z)(this,"renderId",void 0),(0,l.Z)(this,zr,{writable:!0,value:void 0}),(0,l.Z)(this,qr,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,l.Z)(this,Gr,{writable:!0,value:new Map}),(0,l.Z)(this,Jr,{writable:!0,value:void 0}),(0,l.Z)(this,Yr,{writable:!0,value:new Map}),(0,l.Z)(this,Qr,{writable:!0,value:void 0}),(0,l.Z)(this,Xr,{writable:!0,value:void 0}),(0,l.Z)(this,en,{writable:!0,value:void 0}),(0,l.Z)(this,tn,{writable:!0,value:[]}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",(0,u.Z)(this,zr,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequests(e){(0,u.Z)(this,Xr,e)}memoizeMenuRequests(e,t){(0,d.Z)(this,en)||(0,u.Z)(this,en,new WeakMap),(0,d.Z)(this,en).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,o.Z)((function*(){var a,o;for(var i of e)if(a=(0,d.Z)(n,en).get(i)){o=i;break}var s=(0,d.Z)(n,Xr),l=a?s.indexOf(a):-1;if(-1===l){if(!r.length)return;s.push(...r)}else s.splice(l,s.length-l,...r);o&&o!==t&&(0,d.Z)(n,en).delete(o),yield(0,d.Z)(n,zr).mergeMenus(s)}))()}reBailout(e){return(0,d.Z)(this,zr).bailout(e)}reCatch(e,t){return(0,d.Z)(this,zr).catch(e,t)}didPerformIncrementalRender(e){var t=this;return(0,o.Z)((function*(){return(yield Promise.all((0,d.Z)(t,tn).map((t=>t(e))))).some((e=>e))}))()}performIncrementalRender(e){(0,d.Z)(this,tn).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...Wr,..."page"===this.scope?Hr:[]];for(var n of r){var a=t[n];a&&(0,d.Z)(this,qr)[n].push({brick:e,handlers:a})}(0,b.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,d.Z)(this,Yr).get(e);r?r.add(t):(0,d.Z)(this,Yr).set(e,new Set([t]))}memoize(e,t,r,n){(0,d.Z)(this,Qr)||(0,u.Z)(this,Qr,new WeakMap);var a=[null!=e?e:"",...t].join("."),o=(0,d.Z)(this,Qr).get(n);o||(o=new Map,(0,d.Z)(this,Qr).set(n,o)),o.set(a,{node:r,last:fn(r),lastNormal:pn(r),lastPortal:hn(r)})}reRender(e,t,r,n){var a,o,i,s,l,u,f,p,v,h,m=[null!=e?e:"",...t].join("."),g=(0,d.Z)(this,Qr).get(n).get(m),{node:y,last:b,lastNormal:w,lastPortal:S}=g;(null==y?void 0:y.tag)===Dr.PLACEHOLDER?(a=null!==(i=null===(s=function(e){return vn(e,!0)}(y))||void 0===s?void 0:s.element)&&void 0!==i?i:null,o=null!==(l=null===(u=function(e){return mn(e,!0)}(y))||void 0===u?void 0:u.element)&&void 0!==l?l:null):(a=null!==(f=null==w||null===(p=w.element)||void 0===p?void 0:p.nextSibling)&&void 0!==f?f:null,o=null!==(v=null==S||null===(h=S.element)||void 0===h?void 0:h.nextSibling)&&void 0!==v?v:null);var E,k=fn(r);g.node=r,g.last=k,g.lastNormal=pn(r),g.lastPortal=hn(r);for(var I=n.child;I&&I!==b;){if(I.sibling===y){E=I;break}I=I.sibling}var A=document.createDocumentFragment(),Z=document.createDocumentFragment(),C={tag:Dr.ROOT,container:A,createPortal:Z,child:r};for(I=r;I;)I.return=C,I=I.sibling;var R,T,O=gn(y,b);for((0,c.Z)(this,rn,ln).call(this,O),Vr(C),E?E.sibling=r:n.child=r,k&&(k.sibling=null==b?void 0:b.sibling),I=r;I;)I.return=n,I=I.sibling;if(n.tag===Dr.ROOT?null===(R=n.container)||void 0===R||R.insertBefore(A,a):null===(T=n.element)||void 0===T||T.insertBefore(A,a),Z.childNodes.length>0){for(var x,P=r;P&&P.return;)P=P.return;if((null===(x=P)||void 0===x?void 0:x.tag)!==Dr.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");("function"==typeof P.createPortal?P.createPortal():P.createPortal).insertBefore(Z,o)}var M=gn(r,k);(0,c.Z)(this,nn,cn).call(this,M)}dispose(){for(var e of Object.values((0,d.Z)(this,qr)))e.length=0;for(var t of(0,d.Z)(this,Gr).values()){for(var r of t)r.disconnect();t.length=0}(0,d.Z)(this,Gr).clear(),(0,d.Z)(this,Jr)&&(Ie.removeEventListener("change",(0,d.Z)(this,Jr)),(0,u.Z)(this,Jr,void 0)),(0,u.Z)(this,Qr,void 0),(0,u.Z)(this,Xr,void 0),(0,u.Z)(this,en,void 0),(0,d.Z)(this,Yr).clear(),(0,d.Z)(this,tn).length=0}dispatchBeforePageLoad(){(0,c.Z)(this,an,un).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,c.Z)(this,an,un).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,c.Z)(this,an,un).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,c.Z)(this,an,un).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=T().location;e&&"#"!==e?(0,c.Z)(this,an,un).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,c.Z)(this,an,un).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,d.Z)(this,qr).onScrollIntoView)(0,c.Z)(this,on,dn).call(this,e,t)}initializeMediaChange(){(0,u.Z)(this,Jr,(e=>{(0,c.Z)(this,an,un).call(this,"onMediaChange",new CustomEvent("media.change",{detail:J(e.detail)}))})),Ie.addEventListener("change",(0,d.Z)(this,Jr))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==xo||null===(r=xo.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{wr(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,d.Z)(this,qr).onMessage)t(r);null==xo||null===(e=xo.messageDispatcher)||void 0===e||e.onClose((()=>{(0,c.Z)(this,an,un).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,c.Z)(this,an,un).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,c.Z)(this,an,un).call(this,"onUnmount",new CustomEvent("unmount"))}}function ln(e){var t=[...Wr,..."page"===this.scope?Hr:[]],r=[];for(var n of t){var a=(0,b.remove)((0,d.Z)(this,qr)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var o of e){var i,s,l=(0,d.Z)(this,Gr).get(o);if(null!=l&&l.length){for(var c of l)c.disconnect();l.length=0,(0,d.Z)(this,Gr).delete(o)}$r(o),null===(i=o.element)||void 0===i||delete i.$$tplStateStore,null===(s=o.element)||void 0===s||s.remove()}var u=new CustomEvent("unmount");for(var{brick:f,handlers:p}of r)wr(p,f.runtimeContext,f)(u)}function cn(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,d.Z)(this,qr).onMount)e.has(r)&&wr(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:o}of(0,d.Z)(this,qr).onScrollIntoView)e.has(a)&&(0,c.Z)(this,on,dn).call(this,a,o)}function un(e,t){for(var{brick:r,handlers:n}of(0,d.Z)(this,qr)[e])wr(n,r.runtimeContext,r)(t);var a=(0,d.Z)(this,Yr).get(e);if(a)for(var o of a)o()}function dn(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&&(wr(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var o=(0,d.Z)(this,Gr).get(e);o||(o=[],(0,d.Z)(this,Gr).set(e,o)),o.push(a)}function fn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function pn(e){return vn(e,!1)}function vn(e,t){for(var r,n=e;n;){if(n.tag===Dr.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function hn(e){return mn(e,!1)}function mn(e,t){for(var r,n=e;n;){if(n.tag===Dr.BRICK&&n.portal){if(t)return n;r=n}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&!o.sibling;)o=o.return;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}function gn(e,t){for(var r=new Set,n=e;n;)if(n.tag===Dr.BRICK&&r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&o!==t&&!o.sibling;)o=o.return;if(o===t)break;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}var yn=Symbol.for("root.runtimeContext");function bn(e,t){return wn.apply(this,arguments)}function wn(){return(wn=(0,o.Z)((function*(e,t){var r,n,o,i,s,[l,c,u]=Sa((0,a.Z)((0,a.Z)({},null!==(r=e[yn])&&void 0!==r?r:Go()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(n=l.tplStateStoreMap)&&void 0!==n||(l.tplStateStoreMap=new Map),null!==(o=l.formStateStoreMap)&&void 0!==o||(l.formStateStoreMap=new Map);var d=new sn("fragment"),f={tag:Dr.ROOT,createPortal:null},p=e.transform,v=Oe();p&&xe(v,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var h=yield ma(f,v?e:(0,a.Z)((0,a.Z)({},e),{},{properties:(0,a.Z)((0,a.Z)({},e.properties),p)}),l,d,[]),m=[...c,...u];if(yield wa(h,l,m),(null===(i=h.node)||void 0===i?void 0:i.tag)===Dr.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(s=h.node)&&void 0!==s&&s.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return f.child=h.node,{tagName:h.node?h.node.type:null,renderRoot:f,rendererContext:d,scopedStores:m}}))).apply(this,arguments)}function Sn(e,t){var r,{renderRoot:n,rendererContext:a,scopedStores:o}=e;for(var i of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},Vr(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),o))i.mountAsyncData();return{portal:r}}function En(e,t){var{rendererContext:r}=e;t.portal&&(Kr(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function kn(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return kt(t,(0,a.Z)((0,a.Z)({},Go()),{},{data:e}),{noInject:!0})}function In(e,t){var r=Jo(e);Object.assign(r,(0,a.Z)((0,a.Z)({},t),{},{meta:(0,a.Z)((0,a.Z)({},r.meta),t.meta),$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),U(r)}function An(e,t){var r=Jo(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),o=(e,r)=>e.map((e=>{var i=a(e);return"routes"===e.type?(e.routes=o(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=o(r.routes,a(t)),n||r.routes.unshift(t)}function Zn(e,t,r){var n="".concat(e,".").concat(t.name);_e.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),Cn(e,t.name,r)}function Cn(e,t,r){Pn(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.Z)({brick:t},(0,b.pick)(r,"properties","events","lifeCycle","context","slots","children"))])}function Rn(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function Tn(e,t){var r;Pn(e,Rn(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var On,xn=Tn;function Pn(e,t,r,n){var{routes:a}=Jo(e),o=a.findIndex((e=>e.path===t)),i={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===o?a.unshift(i):a.splice(o,1,i)}function Mn(e,t){var{tplStateStoreId:r}=t,n=Go();return r?Be((0,a.Z)((0,a.Z)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function _n(e){var{tplStateStoreId:t}=e,r=Go();return t?Be((0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Bn(e){return zo().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Ln(){return qo()}function Un(e,t){return Fn.apply(this,arguments)}function Fn(){return(Fn=(0,o.Z)((function*(e,t){var r,{appId:n,updateStoryboardType:a,collectUsedContracts:o}=t,i=Jo(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,l=Rn(e.snippetId);r={routes:[null==i||null===(s=i.routes)||void 0===s?void 0:s.find((e=>e.path===l))]}}var c=[];return r&&o&&(yield o(r)).forEach((e=>{var t,[r,n,a]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===n&&e.name===a))||c.push(e)})),c}))).apply(this,arguments)}var Nn=[];function jn(e){On=e;var t=_n({tplStateStoreId:e.tplStateStoreId});Dn({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function $n(e){Nn.push(e)}function Dn(e){setTimeout((()=>{for(var t of Nn)try{t(e)}catch(t){console.error("RealTimeDataInspectHook failed (".concat(e.changeType,"):"),t)}}))}var Kn=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Vn{constructor(e,t,r,n){(0,s.Z)(this,"type",void 0),(0,s.Z)(this,"data",new Map),(0,s.Z)(this,"changeEventType",void 0),(0,s.Z)(this,"pendingStack",[]),(0,s.Z)(this,"hostBrick",void 0),(0,s.Z)(this,"stateStoreId",void 0),(0,s.Z)(this,"batchUpdate",!1),(0,s.Z)(this,"batchUpdateContextsNames",[]),(0,s.Z)(this,"rendererContext",void 0),(0,s.Z)(this,"routeMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=r,this.stateStoreId=n}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}notifyRealTimeDataChange(e,t){if(On){var{tplStateStoreId:r}=On;(r?"STATE"===this.type&&this.stateStoreId===r:"CTX"===this.type)&&Dn({changeType:"update",tplStateStoreId:r,detail:{name:e,value:t}})}}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={},o=[];e.forEach((e=>{var{name:a,value:i}=r([e]),s=this.data.get(a);o.push(...this.getAffectListByContext(a)),s&&(n[a]=s),this.updateValue(a,i,t)})),o.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(a[e]=t)}));var i=e=>{for(var t in e){var r,n=e[t];null===(r=n.eventTarget)||void 0===r||r.dispatchEvent(new CustomEvent(this.changeEventType,{detail:n.value}))}};i(n),i(a),this.batchUpdate=!1}updateValue(e,t,r,n,o){var i=this.data.get(e);if(!i)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?i.value=t:(0,v.isObject)(i.value)?Object.assign(i.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(e,'" for "context.assign", try "context.replace" instead.')),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which is not using resolve'));var s;"load"===r&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));var l=e=>{var t,r;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(r=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&r!==qo()};if(s||(s=i.loading=i.load((0,a.Z)({cache:"load"===r?"default":"reload"},t))).then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||l(e)||null!=n&&n.error||pr(e)})),n){var c=Fr(n,o);s.then((e=>{c("success")({value:e}),c("finally")()}),(e=>{!l(e)&&n.error&&c("error")(e),c("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,r,n){if(Array.isArray(e)&&e.length>0){var a=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,P.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,a)}return r}(e,r),a=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var s;a.set(i,(null!==(s=a.get(i))&&void 0!==s?s:0)+1)}var l=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),c=new WeakSet,u=new Map,d=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{u.set(e,{resolve:t,reject:r})}))]))),f=function(){var e=(0,o.Z)((function*(e){var r;c.add(e);var o=yield t(e);n.delete(e);var i=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(o){if(u.get(e.name).resolve(),a.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(u.get(e.name).resolve(),a.delete(e.name)):a.set(e.name,i-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),p=l;function v(){return h.apply(this,arguments)}function h(){return h=(0,o.Z)((function*(){var e=Array.from(n.entries()).filter(function(e,t){return(r,n)=>t?0===n:![...r[1].usedProperties].some((t=>e.has(t)))}(a,p)).map((e=>e[0])).filter((e=>!c.has(e)));yield Promise.all(e.map(f))})),h.apply(this,arguments)}return{pendingResult:v().then((0,o.Z)((function*(){for(var e of(n.size>0&&(function(e,t){var r=new Map(e),n=new Set(Array.from(r.keys()).map((e=>e.name))),a=()=>{var e=!1;for(var[t,o]of r.entries())[...o.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&a()};if(a(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),p=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:d}}(e,(e=>this.resolve(e,t,r,n)),this.type);this.pendingStack.push(a)}}onChange(e,t){var r;null===(r=this.data.get(e))||void 0===r||r.eventTarget.addEventListener(this.changeEventType,t)}waitFor(e){var t=this;return(0,o.Z)((function*(){var r=function*(t){yield Promise.all([...e].map((e=>t.get(e))))};for(var{pendingContexts:n}of t.pendingStack)yield*r(n)}))()}waitForAll(){var e=this;return(0,o.Z)((function*(){for(var{pendingContexts:t}of e.pendingStack)for(var r of t.values())r.catch((()=>{}));for(var{pendingResult:n}of e.pendingStack)yield n}))()}mountAsyncData(e){this.data.forEach((t=>{var r;if(t.async&&(!e||null!==(r=this.routeMap.get(e))&&void 0!==r&&r.has(t.name))){if(t.asyncMounted)return void console.error('Async data "'.concat(t.name,'" already mounted. This is a bug of Brick Next, please report it.'));t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}resolve(e,t,r,n){var i=this;return(0,o.Z)((function*(){if(!(yield Zt(e,t)))return!1;var s,l,c,u,d,f;if(r&&("STATE"===i.type?e.expose:"FORM_STATE"===i.type)&&(s=yield Mt(r,e.name)),void 0===s){if(e.resolve){var p=(0,v.hasOwnProperty)(e,"value");d=e.track&&p&&(0,v.hasOwnProperty)(e.resolve,"if")&&(0,P.strictCollectMemberUsage)(e.resolve.if,i.type).size>0;var h=(0,a.Z)({transform:"value"},e.resolve);if(((u=yield Zt(e.resolve,t))||d)&&(l=function(){var e=(0,o.Z)((function*(e){var r;return(yield ot(h,t,(0,a.Z)((0,a.Z)({},e),{},{renderId:null===(r=i.rendererContext)||void 0===r?void 0:r.renderId}))).value}));return function(t){return e.apply(this,arguments)}}()),u)"eager"==(f=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?s=yield l():"async"===f&&(c=l());else if(!p)return!1}u&&"eager"===f||void 0===e.value||(s=yield St(e.value,t))}if(i.data.has(e.name))throw new Error("".concat(i.type," '").concat(e.name,"' has already been declared"));var m={name:e.name,value:s,eventTarget:new Se,useResolve:u,load:l,loaded:"eager"===f,loading:c,async:"async"===f,deps:[]};if("lazy"===f){var g,{trigger:y}=e.resolve;y&&Kn.includes(y)&&(null===(g=i.rendererContext)||void 0===g||g.registerArbitraryLifeCycle(y,(()=>{i.updateValue(e.name,void 0,"load")})))}if(e.onChange&&m.eventTarget.addEventListener(i.changeEventType,wr(e.onChange,t)),e.track){var b=(0,P.strictCollectMemberUsage)(d?[e.resolve,e.value]:l?e.resolve:e.value,i.type);for(var w of(!l&&(m.deps=[...b]),b))i.onChange(w,i.batchAddListener((()=>{m.useResolve=d?Rt(e.resolve,t):!!l,m.useResolve?i.updateValue(e.name,{cache:"default"},"refresh"):i.updateValue(e.name,kt(e.value,t),"replace")}),e))}if(m.eventTarget.addEventListener(i.changeEventType,(t=>{i.notifyRealTimeDataChange(e.name,t.detail)})),i.data.set(e.name,m),Array.isArray(n))for(var S of n){var E=i.routeMap.get(S);E?E.add(e.name):i.routeMap.set(S,new Set([e.name]))}return!0}))()}disposeDataInRoutes(e){for(var t of e){var r=this.routeMap.get(t);if(void 0!==r)for(var n of r)this.data.delete(n)}}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}function Wn(e,t,r){var n,a,{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:l,hostBrick:c}=e;if(t&&o){var u=o.properties.get(t);u&&(a=i,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,Mt(n,t),!0]})).filter(Boolean));var d=o.slots.get(t);if(d&&s){var f=new Map;for(var{from:p,to:h}of d){var m,g,y,w,S=null!==(m=null===(g=s[p])||void 0===g?void 0:g.bricks)&&void 0!==m?m:[];if(S.length){var E=null!==(y=h.refSlot)&&void 0!==y?y:p,k=f.get(E);if(!k){k=[];for(var I=(0,v.hasOwnProperty)(r,E)?r[E].bricks.length+1:1,A=0;A<I;A+=1)k.push([]);f.set(E,k)}var Z=null!==(w=h.refPosition)&&void 0!==w?w:-1;k[(0,b.clamp)(Z<0?k.length+Z:Z,0,k.length-1)].push(...(0,v.hasOwnProperty)(c.runtimeContext,"forEachItem")?Hn(S,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex):S)}}var C=function(){(0,v.hasOwnProperty)(r,R)||(r[R]={type:"bricks",bricks:[]});var e=r[R];e.bricks=T.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[R]};for(var[R,T]of f.entries())C()}}return{[Jt]:n,[Yt]:l}}function Hn(e,t,r){return e.map((e=>{var n;return(0,a.Z)((0,a.Z)({},e),{},{[Qt]:t,[Xt]:r,slots:Object.fromEntries(Object.entries(null!==(n=e.slots)&&void 0!==n?n:{}).map((e=>{var n,[a,o]=e;return[a,"routes"===o.type?{type:"routes",routes:zn(o.routes,t,r)}:{type:"bricks",bricks:Hn(null!==(n=o.bricks)&&void 0!==n?n:[],t,r)}]})))})}))}function zn(e,t,r){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.Z)((0,a.Z)({},e),{},{bricks:Hn(e.bricks,t,r)})))}var qn=["properties","slots","children"];function Gn(e,t){function r(e){return(0,v.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,a]=e;return(0,v.isObject)(a)&&"useBrick"===t?Array.isArray(a)?[t,a.map(n)]:[t,n(a)]:[t,r(a)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:o,slots:i,children:s}=e,l=(0,y.Z)(e,qn),c=ka(s,i),u=Object.fromEntries(Object.entries(null!=c?c:{}).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)({},l),{},{properties:r(o),slots:u},Wn(t,l.ref,u))}return r(e)}var Jn=["slots","children"],Yn=["properties","slots","children"];function Qn(e,t,r,n,o){var i,s=(0,b.uniqueId)("tpl-state-"),l=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{tplStateStoreId:s});delete l.forEachItem,delete l.forEachIndex,delete l.formStateStoreId;var c=new Vn("STATE",r,o,s);l.tplStateStoreMap.set(s,c),l.tplStateStoreScope&&l.tplStateStoreScope.push(c);var{bricks:u,proxy:d,state:f,contracts:p}=_e.get(e);null==xo||null===(i=xo.flowApi)||void 0===i||i.collectWidgetContract(p),c.define(f,l,n);var{slots:v,children:h}=t,m=(0,y.Z)(t,Jn),g=(0,a.Z)((0,a.Z)({},m),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var w={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[S,E]of Object.entries(d.properties)){var k=w.properties.get(E.ref);k||(k=[],w.properties.set(E.ref,k)),k.push({from:S,to:E})}if(null!=d&&d.slots)for(var[I,A]of Object.entries(d.slots)){var Z=w.slots.get(A.ref);Z||(Z=[],w.slots.set(A.ref,Z)),Z.push({from:I,to:A})}var C={reversedProxies:w,asyncHostPropertyEntries:n,externalSlots:ka(h,v),tplStateStoreId:s,hostBrick:r};return g.slots={"":{type:"bricks",bricks:u.map((e=>Xn(e,C)))}},g}function Xn(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:o}=e,i=(0,y.Z)(e,Yn),s=ka(o,n),l=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=>Xn(e,t)))}]})));return(0,a.Z)((0,a.Z)({},i),{},{properties:Gn(r,t),slots:l},Wn(t,i.ref,l))}var ea="form-renderer.form-renderer",ta=Symbol.for("form.stateStoreId"),ra=["forms.general-form","form.general-form","eo-form"];function na(e,t,r){var{id:n,bricks:o,events:i,context:s,mountPoint:l,instanceId:c}=e,{brick:u,properties:d}=e,f=t.find((e=>e.fieldId===n));if(f){var p=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=p.brick),d=(0,a.Z)((0,a.Z)({},p.properties),d)}var h={brick:u,properties:d,iid:c,slot:l,events:i,context:s,children:aa(o,t,r),[ta]:r};return(0,v.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function aa(e,t,r){if(Array.isArray(e))return e.map((e=>na(e,t,r)))}var oa,ia,sa=["blockingList","node","menuRequests","hasTrackingControls"],la=["if","permissionsPreCheck"],ca=["formData"],ua=["src"],da=["href"];function fa(e,t,r,n,a,o,i){return pa.apply(this,arguments)}function pa(){return pa=(0,o.Z)((function*(e,t,r,n,o,i,s){var l=yield function(e,t){return zt.apply(this,arguments)}(t,r),c={blockingList:[],menuRequests:[]};switch(l){case"missed":break;case"unauthenticated":c.unauthenticated=!0;break;default:var u,d=c.route=l.route;c.path=l.match.path;var f=(0,a.Z)((0,a.Z)({},r),{},{match:l.match});s&&f.ctxStore.disposeDataInRoutes(t);var v=o.concat(d);f.ctxStore.define(d.context,f,void 0,v),f.pendingPermissionsPreCheck.push(null==xo||null===(u=xo.checkPermissions)||void 0===u?void 0:u.preCheckPermissionsForBrickOrRoute(d,(e=>St(e,f))));var{preLoadBricks:h}=d;if(Array.isArray(h)&&c.blockingList.push((0,p.loadBricksImperatively)(h,zo())),"redirect"===d.type){var m;if("string"!=typeof(m="string"==typeof d.redirect?yield St(d.redirect,f):(yield ot((0,a.Z)({transform:"redirect"},d.redirect),f)).redirect))throw console.error("Unexpected redirect result:",m),new Error("Unexpected type of redirect result: ".concat(typeof m));c.redirect={path:m}}else{var g=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return St(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(d.menu,f);g&&c.menuRequests.push(g),"routes"===d.type?Ea(c,yield fa(e,d.routes,f,n,v,i)):Ea(c,yield va(e,d.bricks,f,n,v,i)),e.tag===Dr.BRICK&&n.memoizeMenuRequests(d,c.menuRequests)}}return c})),pa.apply(this,arguments)}function va(e,t,r,n,a,o,i,s){return ha.apply(this,arguments)}function ha(){return(ha=(0,o.Z)((function*(e,t,r,n,a,o,i,s){var l={blockingList:[],menuRequests:[]},c=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>ma(e,t,r,n,a,o,c.concat(s),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(o,c.concat(r),t.node,e),Ea(l,t)})),l}))).apply(this,arguments)}function ma(e,t,r,n,a,o){return ga.apply(this,arguments)}function ga(){return ga=(0,o.Z)((function*(e,t,r,n,i,s){var l,c,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],d=arguments.length>7&&void 0!==arguments[7]?arguments[7]: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:h,permissionsPreCheck:m}=t,g=(0,y.Z)(t,la);if(function(e){return"string"==typeof e?(0,x.isTrackAll)(e):dt(e)&&(0,x.isTrackAll)(ft(e))}(h))return ma(e,(0,a.Z)({brick:":if",dataSource:h,permissionsPreCheck:m,slots:{"":{type:"bricks",bricks:[g]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.Z)((0,a.Z)({},e),{},{[r]:t[r]})),{})),r,n,i,s,u,d);var w=t[Yt],E=t[ta],k=(0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:w,formStateStoreId:E});(0,v.hasOwnProperty)(t,Qt)&&(k.forEachItem=t[Qt],k.forEachIndex=t[Xt]);var{context:I}=t;if(Array.isArray(I)&&I.length>0){var A=Oe(k);xe(A,"Defining context on bricks","check your brick:",t),A||k.ctxStore.define(I,k)}if(k.pendingPermissionsPreCheck.push(null==xo||null===(l=xo.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>St(e,k)))),!(yield function(e,t){return Ot.apply(this,arguments)}(t,k)))return f;var Z=t.brick;if(Z.startsWith(":")){var C;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(Z);var{dataSource:R}=t,T=function(){var r=(0,o.Z)((function*(r){var a,o=yield St(R,r),l=":forEach"===Z?"":":switch"===Z?String(o):o?"":"else",c=ka(t.children,t.slots),f=c&&(0,v.hasOwnProperty)(c,l)&&(null===(a=c[l])||void 0===a?void 0:a.bricks);if(!Array.isArray(f))return{blockingList:[],menuRequests:[]};switch(Z){case":forEach":return Array.isArray(o)?function(e,t,r,n,a,o,i,s,l){return ya.apply(this,arguments)}(e,o,f,r,n,i,s,d,u):{blockingList:[],menuRequests:[]};case":if":case":switch":return va(e,f,r,n,i,s,d,u)}}));return function(e){return r.apply(this,arguments)}}(),O=function(){var t=(0,o.Z)((function*(t){var r,n=yield T(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:Dr.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),M=yield O(k),{onMount:_,onUnmount:B}=null!==(C=t.lifeCycle)&&void 0!==C?C:{},{contextNames:L,stateNames:U}=Pt(R);if(L||U){M.hasTrackingControls=!0;var F=0,N=function(){var t=(0,o.Z)((function*(){var t=++F,[r,a,o]=Sa(k),i=yield O(r),l=[...a,...o];if(yield wa(i,r,l),F===t)for(var c of(B&&wr(B,k)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,u,i.node,e),_&&wr(_,r)(new CustomEvent("mount",{detail:{rerender:!0}})),l))c.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),j=(0,b.debounce)(N);if(L)for(var $ of L)k.ctxStore.onChange($,j);if(U)for(var D of U)Be(k,"STATE",': "'.concat(R,'"')).onChange(D,j)}return _&&n.registerArbitraryLifeCycle("onMount",(()=>{wr(_,k)(new CustomEvent("mount",{detail:{rerender:!1}}))})),B&&n.registerArbitraryLifeCycle("onUnmount",(()=>{wr(B,k)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),M}/\.tpl-/.test(Z)&&!_e.get(Z)&&(yield Ia((0,p.loadBricksImperatively)([Z],zo()),"brick",Z,n.unknownBricks));var K,V,W=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(_e.get(r))return r}return!!_e.get(e)&&e}(Z,null===(c=k.app)||void 0===c?void 0:c.id);if(W){var H,z=null!==(H=d.get(W))&&void 0!==H?H:0;if(z>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(W,'"'));d.set(W,z+1)}else Z.includes("-")&&!customElements.get(Z)&&(Z===ea?customElements.define(ea,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):f.blockingList.push(Ia((0,p.enqueueStableLoadBricks)([Z],zo()),"brick",Z,n.unknownBricks)));if(Z===ea){var q,G=null!==(q=t.properties)&&void 0!==q?q:{};({formData:K}=G),V=(0,y.Z)(G,ca)}else V=t.properties;var J=[],Y=function(e,t,r){return(0,v.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:o,stateNames:i,formStateNames:s}=Pt(a);return(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a}),[n,St(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?yt.USE_BRICK:yt.INITIAL})]})):[]}(V,k,J),Q=t[Jt];Q&&Y.push(...Q);var X="script"===Z;if(X||"link"===Z){var ee=yield Bt(Y);if(X?ee.src:"stylesheet"===ee.rel&&ee.href){var te,re=null!==(te=window.PUBLIC_ROOT)&&void 0!==te?te:"";if(X){var{src:ne}=ee,ae=(0,y.Z)(ee,ua);yield Ia((0,p.loadScript)(ne,re,ae),"script",ne,"silent")}else{var{href:oe}=ee;ae=(0,y.Z)(ee,da),yield Ia((0,p.loadStyle)(oe,re,ae),"stylesheet",oe,"silent")}return f}}var ie={tag:Dr.BRICK,type:W||Z,return:e,slotId:s,events:t.events,runtimeContext:k,portal:t.portal,iid:t.iid,ref:t.ref};f.node=ie;var se=(0,P.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);se.size>0&&f.blockingList.push(Ia((0,p.loadProcessorsImperatively)(se,zo()),"processors",[...se].join(", "),n.unknownBricks));var le=[],ce=function(){var e=(0,o.Z)((function*(){ie.properties=yield Bt(Y),function(e,t){var r=function(t){var r=()=>{e.element&&Ft(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=Be(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var o of t.stateNames)a.onChange(o,r)}if(t.formStateNames){var i=Ye(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)i.onChange(s,r)}};for(var n of t)r(n)}(ie,J)}));return function(){return e.apply(this,arguments)}}();le.push(ce()),n.registerBrickLifeCycle(ie,t.lifeCycle);var ue,de=t;W?de=Qn(W,t,ie,Y,n):Z===ea&&(de=function(e,t,r,n,o){var i,s,l="string"==typeof e?JSON.parse(e):e,c=(0,b.uniqueId)("form-state-"),u=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{formStateStoreId:c});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var d=new Vn("FORM_STATE",void 0,o,c);u.formStateStoreMap.set(c,d),u.formStateStoreScope&&u.formStateStoreScope.push(d);var f=null!==(i=l.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),d.define(f,u,n);var p=na(l.formSchema,l.fields,c);return ra.includes(p.brick)&&t.events&&(p.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,v.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(p.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:[p]}]}):(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[p]})}(K,t,ie,Y,n)),de.portal&&(ie.slotId=void 0),W?(delete(ue=(0,a.Z)({},k)).forEachItem,delete ue.forEachIndex):ue=k;var fe=function(){var e=(0,o.Z)((function*(){var e=ka(de.children,de.slots);if(e){var t=new Set,r=yield Promise.all(Object.entries(e).map(((e,r)=>{var s,[l,c]=e;return"routes"!==c.type?va(ie,c.bricks,ue,n,i,l,d):(null!==(s=i[i.length-1])&&void 0!==s&&s.incrementalSubRoutes&&(t.add(r),n.performIncrementalRender(function(){var e=(0,o.Z)((function*(e){var{homepage:t}=ue.app,{pathname:r}=e;if(!S(t,r)||!i.every((e=>qt(e,t,r))))return!1;var o,[s,u,d]=Sa((0,a.Z)((0,a.Z)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),f=!1,p=[];try{if(o=yield fa(ie,c.routes,s,n,i,l,!0),n.reBailout(o))return!0;p=[...u,...d],yield wa(o,s,[s.ctxStore,...p]),yield n.reMergeMenuRequests(c.routes,o.route,o.menuRequests)}catch(e){console.error("Incremental sub-router failed:",e);var v=n.reCatch(e,ie);if(!v)return!0;({failed:f,output:o}=v),yield n.reMergeMenuRequests(c.routes,o.route,o.menuRequests)}if(n.reRender(l,[],o.node,ie),!f)for(var h of(s.ctxStore.mountAsyncData(o.route),p))h.mountAsyncData();return!0}));return function(t){return e.apply(this,arguments)}}())),fa(ie,c.routes,ue,n,i,l))}))),l=(0,a.Z)((0,a.Z)({},f),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(s,[],e.node,ie),Ea(l,e)})),l.node&&(ie.child=l.node),Ea(f,(0,a.Z)((0,a.Z)({},l),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return le.push(fe()),yield Promise.all(le),f})),ga.apply(this,arguments)}function ya(){return(ya=(0,o.Z)((function*(e,t,r,n,o,i,s,l,c){var u={blockingList:[],menuRequests:[]},d=t.length;return(yield Promise.all(t.map(((t,u)=>Promise.all(r.map(((r,f)=>ma(e,r,(0,a.Z)((0,a.Z)({},n),{},{forEachItem:t,forEachIndex:u}),o,i,s,c.concat(u*d+f),l&&new Map(l))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&o.memoize(s,c.concat(r),t.node,e),Ea(u,t)})),u}))).apply(this,arguments)}function ba(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function wa(e,t,r){return(0,p.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function Sa(e){var t=[],r=[];return[(0,a.Z)((0,a.Z)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function Ea(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:o}=t,i=(0,y.Z)(t,sa);if(e.blockingList.push(...r),e.menuRequests.push(...a),n)if(e.node){for(var s=e.node;s.sibling;)s=s.sibling;s.sibling=n}else e.node=n;Object.assign(e,i)}function ka(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,o=null!==(a=n.slot)&&void 0!==a?a:"";(0,v.hasOwnProperty)(r,o)||(r[o]={type:"bricks",bricks:[]}),r[o].bricks.push(n)}return r}function Ia(e,t,r,n){return"silent"===n?e.catch((e=>{console.error('Load %s "%s" failed:',t,r,e)})):e}function Aa(){if(!oa){if(oa={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){oa.isInIframe=!0;try{if(window.origin===window.parent.origin){oa.isInIframeOfSameSite=!0;var e="/next/"===g(),t=window.parent.location.pathname,r=t.startsWith("/next/");oa.isInIframeOfNext=0==(Number(e)^Number(r)),oa.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),oa.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(oa)}return oa}function Za(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);_e.define(a,n)}}}function Ca(){return Ca=(0,o.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return Ra.apply(this,arguments)}(e)),e.$$fulfilling})),Ca.apply(this,arguments)}function Ra(){return(Ra=(0,o.Z)((function*(e){var t;yield null==xo||null===(t=xo.fulfilStoryboard)||void 0===t?void 0:t.call(xo,e),U(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}function Ta(e){var t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}var Oa=new WeakMap,xa=new WeakMap,Pa=new WeakMap,Ma=new WeakMap,_a=new WeakMap,Ba=new WeakMap,La=new WeakMap,Ua=new WeakMap,Fa=new WeakMap,Na=new WeakMap,ja=new WeakMap,$a=new WeakMap,Da=new WeakSet,Ka=new WeakSet,Va=new WeakSet,Wa=new WeakSet;class Ha{constructor(e){(0,i.Z)(this,Wa),(0,i.Z)(this,Va),(0,i.Z)(this,Ka),(0,i.Z)(this,Da),(0,l.Z)(this,Oa,{writable:!0,value:void 0}),(0,l.Z)(this,xa,{writable:!0,value:!1}),(0,l.Z)(this,Pa,{writable:!0,value:void 0}),(0,l.Z)(this,Ma,{writable:!0,value:void 0}),(0,l.Z)(this,_a,{writable:!0,value:void 0}),(0,l.Z)(this,Ba,{writable:!0,value:void 0}),(0,l.Z)(this,La,{writable:!0,value:new Set}),(0,l.Z)(this,Ua,{writable:!0,value:0}),(0,l.Z)(this,Fa,{writable:!0,value:void 0}),(0,l.Z)(this,Na,{writable:!0,value:void 0}),(0,l.Z)(this,ja,{writable:!0,value:void 0}),(0,l.Z)(this,$a,{writable:!0,value:void 0}),(0,u.Z)(this,Oa,e);var t=T();window.addEventListener("beforeunload",(e=>{(0,c.Z)(this,Da,za).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,c.Z)(this,Da,za).call(this,{location:e,action:t})))}getRenderId(){return(0,d.Z)(this,Fa)}getRuntimeContext(){return(0,d.Z)(this,_a)}getRecentApps(){return{currentApp:(0,d.Z)(this,Na),previousApp:(0,d.Z)(this,ja)}}getNavConfig(){return(0,d.Z)(this,$a)}bootstrap(){var e=this;window.AbortController&&(ia=new AbortController,O.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:ia.signal})})})));var t=T();(0,u.Z)(this,Pa,t.location);var r=0;return t.listen(function(){var t=(0,o.Z)((function*(t,n){var o,i,s,l,f,p=++r,v={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==(0,d.Z)(e,Pa).key&&!1!==(null===(o=(0,d.Z)(e,Pa).state)||void 0===o?void 0:o.notify))||(v.key=void 0),((0,m.locationsAreEqual)((0,a.Z)((0,a.Z)({},(0,d.Z)(e,Pa)),v),(0,a.Z)((0,a.Z)({},t),v))||"POP"!==n&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(l=!0),l||(l=yield null===(f=(0,d.Z)(e,Ba))||void 0===f?void 0:f.didPerformIncrementalRender(t)),r===p)if(l)(0,u.Z)(e,Pa,t);else{if(ia&&(ia.abort(),ia=new AbortController),(0,u.Z)(e,Pa,t),null===(s=(0,d.Z)(e,Ba))||void 0===s||s.dispatchPageLeave(),"POP"===n&&E(w((0,d.Z)(e,Oa),t.pathname)))return void window.location.reload();(0,d.Z)(e,xa)?(0,u.Z)(e,Ma,t):(H("locationChange"),(0,c.Z)(e,Va,Ga).call(e,t).catch(pr))}}));return function(e,r){return t.apply(this,arguments)}}()),(0,c.Z)(this,Va,Ga).call(this,t.location)}}function za(e){var t,r=T(),n=r.getBlockMessage();null===(t=(0,d.Z)(this,Ba))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function qa(e,t,r){var n,a;if((0,u.Z)(this,Ua,(n=(0,d.Z)(this,Ua),a=n++,n)),a>10){var o='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(o)}T().replace(e,t)}function Ga(e){return Ja.apply(this,arguments)}function Ja(){return(Ja=(0,o.Z)((function*(e){(0,u.Z)(this,xa,!0);try{yield(0,c.Z)(this,Wa,Ya).call(this,e)}finally{if((0,u.Z)(this,xa,!1),(0,d.Z)(this,Ma)){var t=(0,d.Z)(this,Ma);(0,u.Z)(this,Ma,void 0),yield(0,c.Z)(this,Va,Ga).call(this,t)}}}))).apply(this,arguments)}function Ya(e){return Qa.apply(this,arguments)}function Qa(){return Qa=(0,o.Z)((function*(e){var t,r,n,i,s=this,l=(0,u.Z)(this,Fa,(0,b.uniqueId)("render-id-"));tt=new WeakSet,at.clear(),null==xo||null===(t=xo.flowApi)||void 0===t||t.clearCollectWidgetContract(),T().unblock();var f=null==xo||null===(r=xo.pageView)||void 0===r?void 0:r.create(),p=w((0,d.Z)(this,Oa),e.pathname),v=null===(n=(0,d.Z)(this,_a))||void 0===n?void 0:n.app,h=null==p||null===(i=p.app)||void 0===i?void 0:i.id;window.BOOTSTRAP_UNION_FILE&&h&&h!==(null==v?void 0:v.id)&&function(e){var{appId:t,version:r}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",r))}({appId:h,version:p.app.currentVersion}),null!=p&&p.app&&(yield function(e){return Ca.apply(this,arguments)}(p));var m,g=(0,u.Z)(this,Na,null==p?void 0:p.app),y=v&&g?v.id!==g.id:v!==g,S=$o().getFeatureFlags(),E=(0,d.Z)(this,Ba),k=(t,r)=>{null==f||f({status:"redirected"}),(0,d.Z)(this,La).add(E),(0,c.Z)(this,Ka,qa).call(this,t,r,e)},I=()=>{var t=S["sso-enabled"]?"/sso-auth/login":"/auth/login";sr(e),k(t,{from:e})},A=document.querySelector("#main-mount-point"),Z=document.querySelector("#portal-mount-point"),C={tag:Dr.ROOT,container:A,createPortal:Z},R=()=>{var e;for(var t of(Kr(A),Kr(Z),(0,d.Z)(this,La).add(E),(0,d.Z)(this,La)))t&&(t.dispatchOnUnmount(),t.dispose());(0,d.Z)(this,La).clear(),null==xo||null===(e=xo.messageDispatcher)||void 0===e||e.reset(),y&&((0,u.Z)(this,ja,v),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:v,currentApp:g}})))};if(te(g&&(ie()[g.id]||g.theme)||"light"),le("default"),g){var x,P,M,_,B,L;null==xo||null===(x=xo.checkInstalledApps)||void 0===x||x.preCheckInstalledApps(p,(e=>!!Yo(e)));var U={bailout:e=>e.unauthenticated?(I(),!0):e.redirect?(k(e.redirect.path,e.redirect.state),!0):void(0,u.Z)(this,Ua,0),mergeMenus:(m=(0,o.Z)((function*(e){var t=yield Promise.all(e);(0,u.Z)(s,$a,function(e){var t={breadcrumb:[]};for(var r of e){var{breadcrumb:n}=r;n&&(n.overwrite?t.breadcrumb=n.items:t.breadcrumb.push(...n.items))}return t}(t))})),function(e){return m.apply(this,arguments)}),catch:(t,r)=>{if(!cr(t)||window.NO_AUTH_GUARD){if(!(t instanceof O.HttpAbortError)){var n=$o().getMiscSettings().noAuthGuardLoginPath;return cr(t)&&n?void k(n,{from:e}):{failed:!0,output:{node:{tag:Dr.BRICK,type:"div",properties:{textContent:lr(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}(0,d.Z)(this,La).add(E)}else I()}},F=(0,u.Z)(this,Ba,new sn("page",{routeHelper:U,renderId:l})),N=(0,u.Z)(this,_a,{app:g,location:e,query:new URLSearchParams(e.search),flags:S,sys:(0,a.Z)((0,a.Z)((0,a.Z)({},null==xo||null===(P=xo.auth)||void 0===P?void 0:P.getAuth()),Aa()),{},{settings:{brand:$o().getBrandSettings()}}),ctxStore:new Vn("CTX",void 0,F),pendingPermissionsPreCheck:[null==xo||null===(M=xo.checkPermissions)||void 0===M?void 0:M.preCheckPermissions(p)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,u.Z)(this,$a,void 0),Za(p),ye(null===(_=p.meta)||void 0===_?void 0:_.functions,g),null==xo||null===(B=xo.flowApi)||void 0===B||B.collectContract(null===(L=p.meta)||void 0===L?void 0:L.contracts);var j,$=!1,D=[];try{if(j=yield fa(C,function(e){if(window.parent===window)return e;var t=e,r=(0,b.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,b.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)]}(p.routes),N,F,[]),U.bailout(j))return;D=ba(N),yield wa(j,N,D),yield U.mergeMenus(j.menuRequests),F.setInitialMenuRequests(j.menuRequests)}catch(e){console.error("Router failed:",e);var K=U.catch(e,C);if(!K)return;({failed:$,output:j}=K)}if(C.child=j.node,R(),j.route&&"routes"!==j.route.type||$){if($||F.dispatchBeforePageLoad(),ae(),ue(),window.DISABLE_REACT_FLUSH_SYNC=!1,Ta(null==g?void 0:g.uiVersion),Vr(C),setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0})),window.scrollTo(0,0),$)null==f||f({status:"failed"});else{for(var V of(F.dispatchPageLoad(),F.dispatchAnchorLoad(),F.dispatchOnMount(),F.initializeScrollIntoView(),F.initializeMediaChange(),F.initializeMessageDispatcher(),D))V.mountAsyncData();null==f||f({status:"ok",path:j.path,pageTitle:document.title})}return void H("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=xo&&xo.auth&&!xo.auth.isLoggedIn())return void I();R()}ae(),ue();var W={tag:Dr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:C};C.child=W,Vr(C),window.scrollTo(0,0),null==f||f({status:"not-found"}),H("rendered")})),Qa.apply(this,arguments)}var Xa="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function eo(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function to(e){return e<=1?"".concat(100*Number(e),"%"):e}function ro(e){return 1===e.length?"0"+e:String(e)}function no(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*r*(t-e):r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ao(e){return oo(e)/255}function oo(e){return parseInt(e,16)}var io={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function so(e){var t,r,n,a={r:0,g:0,b:0},o=1,i=null,s=null,l=null,c=!1,u=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(io[e])e=io[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var r=fo.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=fo.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=fo.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=fo.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=fo.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=fo.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=fo.hex8.exec(e))?{r:oo(r[1]),g:oo(r[2]),b:oo(r[3]),a:ao(r[4]),format:t?"name":"hex8"}:(r=fo.hex6.exec(e))?{r:oo(r[1]),g:oo(r[2]),b:oo(r[3]),format:t?"name":"hex"}:(r=fo.hex4.exec(e))?{r:oo(r[1]+r[1]),g:oo(r[2]+r[2]),b:oo(r[3]+r[3]),a:ao(r[4]+r[4]),format:t?"name":"hex8"}:!!(r=fo.hex3.exec(e))&&{r:oo(r[1]+r[1]),g:oo(r[2]+r[2]),b:oo(r[3]+r[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(po(e.r)&&po(e.g)&&po(e.b)?(t=e.r,r=e.g,n=e.b,a={r:255*eo(t,255),g:255*eo(r,255),b:255*eo(n,255)},c=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):po(e.h)&&po(e.s)&&po(e.v)?(i=to(e.s),s=to(e.v),a=function(e,t,r){e=6*eo(e,360),t=eo(t,100),r=eo(r,100);var n=Math.floor(e),a=e-n,o=r*(1-t),i=r*(1-a*t),s=r*(1-(1-a)*t),l=n%6;return{r:255*[r,i,o,o,s,r][l],g:255*[s,r,r,i,o,o][l],b:255*[o,o,s,r,r,i][l]}}(e.h,i,s),c=!0,u="hsv"):po(e.h)&&po(e.s)&&po(e.l)&&(i=to(e.s),l=to(e.l),a=function(e,t,r){var n,a,o;if(e=eo(e,360),t=eo(t,100),r=eo(r,100),0===t)a=r,o=r,n=r;else{var i=r<.5?r*(1+t):r+t-r*t,s=2*r-i;n=no(s,i,e+1/3),a=no(s,i,e),o=no(s,i,e-1/3)}return{r:255*n,g:255*a,b:255*o}}(e.h,i,l),c=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(o=e.a)),o=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(o),{ok:c,format:e.format||u,r:Math.min(255,Math.max(a.r,0)),g:Math.min(255,Math.max(a.g,0)),b:Math.min(255,Math.max(a.b,0)),a:o}}var lo="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),co="[\\s|\\(]+(".concat(lo,")[,|\\s]+(").concat(lo,")[,|\\s]+(").concat(lo,")\\s*\\)?"),uo="[\\s|\\(]+(".concat(lo,")[,|\\s]+(").concat(lo,")[,|\\s]+(").concat(lo,")[,|\\s]+(").concat(lo,")\\s*\\)?"),fo={CSS_UNIT:new RegExp(lo),rgb:new RegExp("rgb"+co),rgba:new RegExp("rgba"+uo),hsl:new RegExp("hsl"+co),hsla:new RegExp("hsla"+uo),hsv:new RegExp("hsv"+co),hsva:new RegExp("hsva"+uo),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function po(e){return Boolean(fo.CSS_UNIT.exec(String(e)))}var vo=2,ho=.16,mo=.05,go=.05,yo=.15,bo=5,wo=4,So=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Eo(e){var t=function(e,t,r){e=eo(e,255),t=eo(t,255),r=eo(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),o=0,i=n,s=n-a,l=0===n?0:s/n;if(n===a)o=0;else{switch(n){case e:o=(t-r)/s+(t<r?6:0);break;case t:o=(r-e)/s+2;break;case r:o=(e-t)/s+4}o/=6}return{h:o,s:l,v:i}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function ko(e){var t=e.r,r=e.g,n=e.b;return"#".concat(function(e,t,r,n){var a=[ro(Math.round(e).toString(16)),ro(Math.round(t).toString(16)),ro(Math.round(r).toString(16))];return a.join("")}(t,r,n))}function Io(e,t,r){var n;return(n=Math.round(e.h)>=60&&Math.round(e.h)<=240?r?Math.round(e.h)-vo*t:Math.round(e.h)+vo*t:r?Math.round(e.h)+vo*t:Math.round(e.h)-vo*t)<0?n+=360:n>=360&&(n-=360),n}function Ao(e,t,r){return 0===e.h&&0===e.s?e.s:((n=r?e.s-ho*t:t===wo?e.s+ho:e.s+mo*t)>1&&(n=1),r&&t===bo&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function Zo(e,t,r){var n;return(n=r?e.v+go*t:e.v-yo*t)>1&&(n=1),Number(n.toFixed(2))}function Co(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=so(e),a=bo;a>0;a-=1){var o=Eo(n),i=ko(so({h:Io(o,a,!0),s:Ao(o,a,!0),v:Zo(o,a,!0)}));r.push(i)}r.push(ko(n));for(var s=1;s<=wo;s+=1){var l=Eo(n),c=ko(so({h:Io(l,s),s:Ao(l,s),v:Zo(l,s)}));r.push(c)}return"dark"===t.theme?So.map((function(e){var n,a,o,i=e.index,s=e.opacity;return ko((n=so(t.backgroundColor||"#141414"),o=100*s/100,{r:((a=so(r[i])).r-n.r)*o+n.r,g:(a.g-n.g)*o+n.g,b:(a.b-n.b)*o+n.b}))})):r}var Ro,To,Oo,xo,Po={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Mo={},_o={};function Bo(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Lo(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function Uo(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function Fo(e,t,r){return"dark"===t?Co(e,{theme:t,backgroundColor:r})[5]:e}function No(e){var t=[];if(["light","dark"].forEach((r=>{if(e[r])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Lo:Bo)("string"==typeof(r=t)?" --color-brand: ".concat(r,";\n"):[" --color-brand: ".concat(r.default,";")," --color-brand-hover: ".concat(r.hover,";")," --color-brand-active: ".concat(r.active,";"),""].join("\n"));var r}(r,e[r]));break;case"baseColors":t.push(function(e,t,r){return("dark"===e?Lo:Bo)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[r,n]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(r),n.map(((e,n)=>[" --palette-".concat(r,"-").concat(n+1,"-channel: ").concat(Uo(e),";")].concat("dark"===t?[]:" --palette-".concat(r,"-").concat(n+1,": rgb(var(--palette-").concat(r,"-").concat(n+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,r){return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[n,Co(a,"dark"===t?{theme:t,backgroundColor:r}:void 0)]})))}(t,e,r),e),"\n").concat(function(e,t,r){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((n=>{var[a,o]=n;return[" --theme-".concat(a,"-color-rgb-channel: ").concat(Uo(Fo(t[o],e,r)),";"),..."dark"===e?[]:[" --theme-".concat(a,"-color: var(--palette-").concat(o,"-6);")," --theme-".concat(a,"-border-color: var(--palette-").concat(o,"-3);")]," --theme-".concat(a,"-background: var(--palette-").concat(o,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,r)))}(r,e[r],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Lo:Bo)(function(e){return Object.entries(e).map((e=>{var[t,r]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(r,";")})).concat("").join("\n")}(t))}(r,e[r]))}})),t.length>0){var r=document.createElement("style");return r.textContent=t.join("\n\n"),document.head.appendChild(r),()=>{r.remove()}}}function jo(e){if(Ro)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===D){var r=t.payload;switch(null==r?void 0:r.type){case K:W=r.active;break;case V:j=r.panel}}})),xo=null==e?void 0:e.hooks,(0,f.initializeI18n)(ar,or),h.locale(f.i18n.language),f.i18n.on("languageChanged",(()=>{h.locale(f.i18n.language)})),R(),Ro=new Wo}Object.keys(Po).forEach((function(e){Mo[e]=Co(Po[e]),Mo[e].primary=Mo[e][5],_o[e]=Co(Po[e],{theme:"dark",backgroundColor:"#141414"}),_o[e].primary=_o[e][5]})),Mo.red,Mo.volcano,Mo.gold,Mo.orange,Mo.yellow,Mo.lime,Mo.green,Mo.cyan,Mo.blue,Mo.geekblue,Mo.purple,Mo.magenta,Mo.grey;var $o=function(){var e=C();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return Ro},Do=new WeakMap,Ko=new WeakMap,Vo=new WeakSet;class Wo{constructor(){(0,i.Z)(this,Vo),(0,l.Z)(this,Do,{writable:!0,value:!1}),(0,l.Z)(this,Ko,{writable:!0,value:!1}),(0,s.Z)(this,"version",3)}initialize(e){var t;if((0,d.Z)(this,Do))throw new Error("The runtime cannot be initialized more than once");(0,u.Z)(this,Do,!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;f.i18n.addResourceBundle(r,e,n)})),r.localeName=f.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{f.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,v.isObject)(e.settings)&&(0,v.deepFreeze)(e.settings),e.brickPackages&&(0,v.deepFreeze)(e.brickPackages)}(e),To=e;var r,{notification:n,dialog:o}=(0,c.Z)(this,Vo,Ho).call(this);!1!==n&&(r=null!=n?n:"basic.show-notification",(0,this.loadBricks)([r]).then((()=>{dr=document.createElement(r)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==o&&function(e,t){t([e]).then((()=>{Gt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=o?o:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?No((0,a.Z)({type:"brandColor"},e.brandColor)):e.baseColors?No((0,a.Z)({type:"baseColors"},e.baseColors)):e.variables&&No((0,a.Z)({type:"variables"},e.variables)))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}bootstrap(e){var t=this;return(0,o.Z)((function*(){if(e&&t.initialize(e),(0,d.Z)(t,Ko))throw new Error("The runtime cannot be bootstrapped more than once");(0,u.Z)(t,Ko,!0),Oo=new Ha(To.storyboards),yield Oo.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=Oo)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=Oo)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Je(e,t)}getFeatureFlags(){var e,t;return(0,a.Z)((0,a.Z)((0,a.Z)({},null===(e=To)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=Oo)||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=To)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=Oo)||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=To)||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=To)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=To)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=To)||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=Oo)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,p.loadBricksImperatively)(e,zo())}}function Ho(){var e,t;return null!==(e=null===(t=To)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function zo(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=To)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:Xa)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function qo(){var e;return null===(e=Oo)||void 0===e?void 0:e.getRenderId()}function Go(){var e;return null===(e=Oo)||void 0===e?void 0:e.getRuntimeContext()}function Jo(e){var t;return null===(t=To)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Yo(e){var t;return null===(t=Jo(e))||void 0===t?void 0:t.app}function Qo(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==xo||null===(e=xo.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Xo(){var e;return null==xo||null===(e=xo.auth)||void 0===e?void 0:e.getAuth()}function ei(){var e,t;return null==xo||null===(e=xo.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function ti(){var e;return null==xo||null===(e=xo.auth)||void 0===e?void 0:e.isLoggedIn()}function ri(e,t,r){return ni.apply(this,arguments)}function ni(){return(ni=(0,o.Z)((function*(e,t,r){return st(yield Xe(e),e,"resolve",t,r)}))).apply(this,arguments)}function ai(e){var t,{portal:r,scope:n="fragment",unknownBricks:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r;t=r||(()=>((i=document.createElement("div")).style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));var s,l,c=!1;return{render(r){var u=arguments;return(0,o.Z)((function*(){var{theme:o,uiVersion:d,context:f,functions:p,templates:h,i18n:m}=u.length>1&&void 0!==u[1]?u[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");var g=[].concat(r),y=s,w=(0,b.uniqueId)("render-id-");s=new sn(n,{unknownBricks:a,renderId:w});var S={ctxStore:new Vn("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},E={tag:Dr.ROOT,container:e,createPortal:t};if("page"===n){var k;!function(e,t){function r(e){if((0,v.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(var[t,a]of Object.entries(e))(0,v.isObject)(a)&&"useBrick"===t?Array.isArray(a)?a.forEach((e=>n(e,!0))):n(a,!0):r(a)}function n(e,a){a&&(e[yn]=t);var{properties:o,slots:i,children:s}=e,l=ka(s,i);for(var c of(r(o),Object.values(null!=l?l:{})))for(var u of null!==(d=c.bricks)&&void 0!==d?d:[]){var d;n(u,a)}}for(var a of e)n(a)}(g,S),te(null!=o?o:"light"),le("default"),Ta(d);var I={id:"demo",homepage:"/demo"};S.app=I;var A={app:I,meta:{i18n:m,customTemplates:h}};null===(k=l)||void 0===k||k(),l=U(A),Za(A),ye(p,I)}S.ctxStore.define(f,S);var Z,C=!1,R=[];try{Z=yield va(E,g,S,s,[]),R=ba(S),yield wa(Z,S,R)}catch(e){C=!0,Z={node:{tag:Dr.BRICK,type:"div",properties:{textContent:lr(e)},return:E,runtimeContext:null},blockingList:[],menuRequests:[]}}if(E.child=Z.node,null==y||y.dispatchOnUnmount(),null==y||y.dispose(),Kr(e),i&&Kr(i),"page"===n&&(C||s.dispatchBeforePageLoad(),ae(),ue()),Vr(E),"page"===n&&window.scrollTo(0,0),!C){for(var T of R)T.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){c||(c=!0,Kr(e),i&&(Kr(i),r||i.remove()))}}}}}]);
2
- //# sourceMappingURL=4504.7995d76b.js.map