@next-bricks/visual-builder 1.38.3 → 1.38.5

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 (100) hide show
  1. package/dist/bricks.json +10 -10
  2. package/dist/chunks/{1889.96ce7327.js → 1889.bd796e16.js} +2 -2
  3. package/dist/chunks/1889.bd796e16.js.map +1 -0
  4. package/dist/chunks/220.c9cbb2af.js +2 -0
  5. package/dist/chunks/{220.b81cb3a9.js.map → 220.c9cbb2af.js.map} +1 -1
  6. package/dist/chunks/{2980.1544a125.js → 2980.77e044c8.js} +2 -2
  7. package/dist/chunks/{2980.1544a125.js.map → 2980.77e044c8.js.map} +1 -1
  8. package/dist/chunks/{3171.d919d954.js → 3171.15ddb878.js} +2 -2
  9. package/dist/chunks/{3171.d919d954.js.map → 3171.15ddb878.js.map} +1 -1
  10. package/dist/chunks/{3933.4363c1cf.js → 3933.14041051.js} +2 -2
  11. package/dist/chunks/{3933.4363c1cf.js.map → 3933.14041051.js.map} +1 -1
  12. package/dist/chunks/4291.ef7e7fae.js +2 -0
  13. package/dist/chunks/4291.ef7e7fae.js.map +1 -0
  14. package/dist/chunks/{7218.698b9922.js → 4837.0f4319f6.js} +2 -2
  15. package/dist/chunks/{4837.bbbe8edf.js.map → 4837.0f4319f6.js.map} +1 -1
  16. package/dist/chunks/5247.485f0926.js +3 -0
  17. package/dist/chunks/5247.485f0926.js.map +1 -0
  18. package/dist/chunks/{5522.9b10a351.js → 5522.690dcfe1.js} +3 -3
  19. package/dist/chunks/{5522.9b10a351.js.map → 5522.690dcfe1.js.map} +1 -1
  20. package/dist/chunks/{5552.25e8ba44.js → 5552.ebeb6852.js} +2 -2
  21. package/dist/chunks/{5552.25e8ba44.js.map → 5552.ebeb6852.js.map} +1 -1
  22. package/dist/chunks/{6314.68a0856f.js → 6314.a58fa1a1.js} +2 -2
  23. package/dist/chunks/{6314.68a0856f.js.map → 6314.a58fa1a1.js.map} +1 -1
  24. package/dist/chunks/{4837.bbbe8edf.js → 7218.56461cde.js} +2 -2
  25. package/dist/chunks/{7218.698b9922.js.map → 7218.56461cde.js.map} +1 -1
  26. package/dist/chunks/{7721.79a73cc5.js → 7721.c4069d44.js} +3 -3
  27. package/dist/chunks/7721.c4069d44.js.map +1 -0
  28. package/dist/chunks/{9515.b82d9bb4.js → 9515.1b9f8fea.js} +2 -2
  29. package/dist/chunks/9515.1b9f8fea.js.map +1 -0
  30. package/dist/chunks/{9844.8fa0b43e.js → 9844.4328557b.js} +2 -2
  31. package/dist/chunks/{9844.8fa0b43e.js.map → 9844.4328557b.js.map} +1 -1
  32. package/dist/chunks/{batch-update-raw-data-generated-view.d854bc69.js → batch-update-raw-data-generated-view.738a07d5.js} +3 -3
  33. package/dist/chunks/{batch-update-raw-data-generated-view.d854bc69.js.map → batch-update-raw-data-generated-view.738a07d5.js.map} +1 -1
  34. package/dist/chunks/{chat-preview.8f851d13.js → chat-preview.77bfcc3e.js} +3 -3
  35. package/dist/chunks/{chat-preview.8f851d13.js.map → chat-preview.77bfcc3e.js.map} +1 -1
  36. package/dist/chunks/{check-editor-by-name.98c9077b.js → check-editor-by-name.a4d0302a.js} +2 -2
  37. package/dist/chunks/{check-editor-by-name.98c9077b.js.map → check-editor-by-name.a4d0302a.js.map} +1 -1
  38. package/dist/chunks/{contract-select.c889a30c.js → contract-select.e3332bbc.js} +3 -3
  39. package/dist/chunks/{contract-select.c889a30c.js.map → contract-select.e3332bbc.js.map} +1 -1
  40. package/dist/chunks/{generate-snippets-context-menu.146ee748.js → generate-snippets-context-menu.5089749e.js} +2 -2
  41. package/dist/chunks/{generate-snippets-context-menu.146ee748.js.map → generate-snippets-context-menu.5089749e.js.map} +1 -1
  42. package/dist/chunks/{get-config-by-data-for-ai.8a90647b.js → get-config-by-data-for-ai.8f826b9c.js} +3 -3
  43. package/dist/chunks/{get-config-by-data-for-ai.8a90647b.js.map → get-config-by-data-for-ai.8f826b9c.js.map} +1 -1
  44. package/dist/chunks/{get-data-deps.f481598b.js → get-data-deps.f9ee2770.js} +2 -2
  45. package/dist/chunks/{get-data-deps.f481598b.js.map → get-data-deps.f9ee2770.js.map} +1 -1
  46. package/dist/chunks/{get-dependency-tree.52423efa.js → get-dependency-tree.8977b6ec.js} +2 -2
  47. package/dist/chunks/{get-dependency-tree.52423efa.js.map → get-dependency-tree.8977b6ec.js.map} +1 -1
  48. package/dist/chunks/{get-raw-data-system-prompts.b5899f4d.js → get-raw-data-system-prompts.3a7aaa58.js} +2 -2
  49. package/dist/chunks/{get-raw-data-system-prompts.b5899f4d.js.map → get-raw-data-system-prompts.3a7aaa58.js.map} +1 -1
  50. package/dist/chunks/{inject-chat-preview-agent.db7f95da.js → inject-chat-preview-agent.738f2dd6.js} +2 -2
  51. package/dist/chunks/{inject-chat-preview-agent.db7f95da.js.map → inject-chat-preview-agent.738f2dd6.js.map} +1 -1
  52. package/dist/chunks/main.ed3fed26.js +2 -0
  53. package/dist/chunks/{main.40573267.js.map → main.ed3fed26.js.map} +1 -1
  54. package/dist/chunks/{parse-path.7e88de06.js → parse-path.50f5853b.js} +2 -2
  55. package/dist/chunks/{parse-path.7e88de06.js.map → parse-path.50f5853b.js.map} +1 -1
  56. package/dist/chunks/{pre-generated-config-preview.ed6be58a.js → pre-generated-config-preview.78b8fbb0.js} +2 -2
  57. package/dist/chunks/{pre-generated-config-preview.ed6be58a.js.map → pre-generated-config-preview.78b8fbb0.js.map} +1 -1
  58. package/dist/chunks/{pre-generated-config.927c0982.js → pre-generated-config.7a52aa90.js} +2 -2
  59. package/dist/chunks/{pre-generated-config.927c0982.js.map → pre-generated-config.7a52aa90.js.map} +1 -1
  60. package/dist/chunks/{pre-generated-container.dddeac27.js → pre-generated-container.a87c7041.js} +2 -2
  61. package/dist/chunks/{pre-generated-container.dddeac27.js.map → pre-generated-container.a87c7041.js.map} +1 -1
  62. package/dist/chunks/{pre-generated-preview.b3ba835a.js → pre-generated-preview.6f7f34cc.js} +3 -3
  63. package/dist/chunks/{pre-generated-preview.b3ba835a.js.map → pre-generated-preview.6f7f34cc.js.map} +1 -1
  64. package/dist/chunks/property-editor.fb323f9e.js +2 -0
  65. package/dist/chunks/{property-editor.a5d944e2.js.map → property-editor.fb323f9e.js.map} +1 -1
  66. package/dist/chunks/{raw-data-preview.d668372a.js → raw-data-preview.107690f0.js} +3 -3
  67. package/dist/chunks/{raw-data-preview.d668372a.js.map → raw-data-preview.107690f0.js.map} +1 -1
  68. package/dist/chunks/{raw-metric-preview.d1039b5f.js → raw-metric-preview.b51295ec.js} +3 -3
  69. package/dist/chunks/{raw-metric-preview.d1039b5f.js.map → raw-metric-preview.b51295ec.js.map} +1 -1
  70. package/dist/chunks/{workbench-action-list.68a47ab3.js → workbench-action-list.2f339a97.js} +2 -2
  71. package/dist/chunks/{workbench-action-list.68a47ab3.js.map → workbench-action-list.2f339a97.js.map} +1 -1
  72. package/dist/chunks/{workbench-history-action.7b17ce0a.js → workbench-history-action.a16b53af.js} +3 -3
  73. package/dist/chunks/{workbench-history-action.7b17ce0a.js.map → workbench-history-action.a16b53af.js.map} +1 -1
  74. package/dist/index.ce3debce.js +2 -0
  75. package/dist/{index.352964d5.js.map → index.ce3debce.js.map} +1 -1
  76. package/dist/manifest.json +89 -89
  77. package/dist/types.json +134 -134
  78. package/package.json +3 -3
  79. package/dist/chunks/1889.96ce7327.js.map +0 -1
  80. package/dist/chunks/220.b81cb3a9.js +0 -2
  81. package/dist/chunks/4291.3c12fe9f.js +0 -2
  82. package/dist/chunks/4291.3c12fe9f.js.map +0 -1
  83. package/dist/chunks/6840.b8f5fecc.js +0 -3
  84. package/dist/chunks/6840.b8f5fecc.js.map +0 -1
  85. package/dist/chunks/7721.79a73cc5.js.map +0 -1
  86. package/dist/chunks/9515.b82d9bb4.js.map +0 -1
  87. package/dist/chunks/main.40573267.js +0 -2
  88. package/dist/chunks/property-editor.a5d944e2.js +0 -2
  89. package/dist/index.352964d5.js +0 -2
  90. /package/dist/chunks/{6840.b8f5fecc.js.LICENSE.txt → 5247.485f0926.js.LICENSE.txt} +0 -0
  91. /package/dist/chunks/{5522.9b10a351.js.LICENSE.txt → 5522.690dcfe1.js.LICENSE.txt} +0 -0
  92. /package/dist/chunks/{7721.79a73cc5.js.LICENSE.txt → 7721.c4069d44.js.LICENSE.txt} +0 -0
  93. /package/dist/chunks/{batch-update-raw-data-generated-view.d854bc69.js.LICENSE.txt → batch-update-raw-data-generated-view.738a07d5.js.LICENSE.txt} +0 -0
  94. /package/dist/chunks/{chat-preview.8f851d13.js.LICENSE.txt → chat-preview.77bfcc3e.js.LICENSE.txt} +0 -0
  95. /package/dist/chunks/{contract-select.c889a30c.js.LICENSE.txt → contract-select.e3332bbc.js.LICENSE.txt} +0 -0
  96. /package/dist/chunks/{get-config-by-data-for-ai.8a90647b.js.LICENSE.txt → get-config-by-data-for-ai.8f826b9c.js.LICENSE.txt} +0 -0
  97. /package/dist/chunks/{pre-generated-preview.b3ba835a.js.LICENSE.txt → pre-generated-preview.6f7f34cc.js.LICENSE.txt} +0 -0
  98. /package/dist/chunks/{raw-data-preview.d668372a.js.LICENSE.txt → raw-data-preview.107690f0.js.LICENSE.txt} +0 -0
  99. /package/dist/chunks/{raw-metric-preview.d1039b5f.js.LICENSE.txt → raw-metric-preview.b51295ec.js.LICENSE.txt} +0 -0
  100. /package/dist/chunks/{workbench-history-action.7b17ce0a.js.LICENSE.txt → workbench-history-action.a16b53af.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 6840.b8f5fecc.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[6840],{264:(e,t,n)=>{function r(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function o(e){return e&&e.sensitive?"":"i"}function a(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var a=n.strict,i=void 0!==a&&a,s=n.start,c=void 0===s||s,l=n.end,u=void 0===l||l,d=n.encode,f=void 0===d?function(e){return e}:d,p=n.delimiter,h=void 0===p?"/#?":p,m=n.endsWith,g="[".concat(r(void 0===m?"":m),"]|$"),v="[".concat(r(h),"]"),b=c?"^":"",y=0,w=e;y<w.length;y++){var E=w[y];if("string"==typeof E)b+=r(f(E));else{var S=r(f(E.prefix)),A=r(f(E.suffix));if(E.pattern)if(t&&t.push(E),S||A)if("+"===E.modifier||"*"===E.modifier){var k="*"===E.modifier?"?":"";b+="(?:".concat(S,"((?:").concat(E.pattern,")(?:").concat(A).concat(S,"(?:").concat(E.pattern,"))*)").concat(A,")").concat(k)}else b+="(?:".concat(S,"(").concat(E.pattern,")").concat(A,")").concat(E.modifier);else{if("+"===E.modifier||"*"===E.modifier)throw new TypeError('Can not repeat "'.concat(E.name,'" without a prefix and suffix'));b+="(".concat(E.pattern,")").concat(E.modifier)}else b+="(?:".concat(S).concat(A,")").concat(E.modifier)}}if(u)i||(b+="".concat(v,"?")),b+=n.endsWith?"(?=".concat(g,")"):"$";else{var I=e[e.length-1],C="string"==typeof I?v.indexOf(I[I.length-1])>-1:void 0===I;i||(b+="(?:".concat(v,"(?=").concat(g,"))?")),C||(b+="(?=".concat(v,"|").concat(g,")"))}return new RegExp(b,o(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,a="";if("?"===e[s=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--o){s++;break}}else if("("===e[s]&&(o++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));a+=e[s++]}else a+=e[s++]+e[s++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!a)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:a}),n=s}else{for(var i="",s=n+1;s<e.length;){var c=e.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:i}),n=s}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),o=t.prefixes,a=void 0===o?"./":o,i=t.delimiter,s=void 0===i?"/#?":i,c=[],l=0,u=0,d="",f=function(e){if(u<n.length&&n[u].type===e)return n[u++].value},p=function(e){var t=f(e);if(void 0!==t)return t;var r=n[u],o=r.type,a=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(a,", expected ").concat(e))},h=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t},m=function(e){var t=c[c.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=s;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1}(n)?"[^".concat(r(s),"]+?"):"(?:(?!".concat(r(n),")[^").concat(r(s),"])+?")};u<n.length;){var g=f("CHAR"),v=f("NAME"),b=f("PATTERN");if(v||b){var y=g||"";-1===a.indexOf(y)&&(d+=y,y=""),d&&(c.push(d),d=""),c.push({name:v||l++,prefix:y,suffix:"",pattern:b||m(y),modifier:f("MODIFIER")||""})}else{var w=g||f("ESCAPED_CHAR");if(w)d+=w;else if(d&&(c.push(d),d=""),f("OPEN")){y=h();var E=f("NAME")||"",S=f("PATTERN")||"",A=h();p("CLOSE"),c.push({name:E||(S?l++:""),pattern:E&&!S?m(y):S,prefix:y,suffix:A,modifier:f("MODIFIER")||""})}else p("END")}}return c}(e,n),t,n)}function i(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return i(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),o(n))}(e,t,n):a(e,t,n)}n.d(t,{MM:()=>i})},829:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2559);function o(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2016);function o(e,t,n){(0,r.A)(e,t),t.set(e,n)}},1369:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(7545);function o(e){var t=function(e){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,r.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},2016:(e,t,n)=>{function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},2559:(e,t,n)=>{function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},4586:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(1369);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},4635:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2016);function o(e,t){(0,r.A)(e,t),t.add(e)}},6121:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2559);function o(e,t,n){return e.set((0,r.A)(e,t),n),n}},6840:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>Gt,Notification:()=>tn,StoryboardFunctionRegistryFactory:()=>pe,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>Oa,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>St,checkIfOfComputed:()=>Et,createHistory:()=>A,createRuntime:()=>va,customEditors:()=>Ma,customProcessors:()=>M,customTemplates:()=>Pe,fetchByProvider:()=>La,getAuth:()=>Ta,getBasePath:()=>p,getCssPropertyValue:()=>ce,getCurrentMode:()=>ie,getCurrentTheme:()=>ee,getHistory:()=>k,getPageInfo:()=>co,getRealValue:()=>$a,getRuntime:()=>ba,getV2RuntimeFromDll:()=>S,handleHttpError:()=>en,httpErrorToString:()=>Yt,instantiateModalStack:()=>Ua,isLoggedIn:()=>Pa,isNetworkError:()=>po,isUnauthenticatedError:()=>Xt,logout:()=>_a,matchPath:()=>Mt,registerWidgetFunctions:()=>$e,registerWidgetI18n:()=>N,resetReloadForError:()=>vo,setUIVersion:()=>uo,shouldReloadForError:()=>go,unstable_createRoot:()=>Ba});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>Or,debugDataValue:()=>Ar,getAddedContracts:()=>Sr,getAllContextValues:()=>vr,getBrickPackagesById:()=>br,getContextValue:()=>gr,getLegalRuntimeValue:()=>kr,getRenderId:()=>Er,legacyDoTransform:()=>sr,loadBricks:()=>yr,loadEditors:()=>wr,mountUseBrick:()=>ar,renderUseBrick:()=>or,setRealTimeDataInspectRoot:()=>Rr,symbolForRootRuntimeContext:()=>rr,unmountUseBrick:()=>ir,updateSnippetPreviewSettings:()=>hr,updateStoryboard:()=>cr,updateStoryboardByRoute:()=>lr,updateStoryboardBySnippet:()=>pr,updateStoryboardByTemplate:()=>ur,updateTemplatePreviewSettings:()=>dr});var o=n(4586),a=n(918),i=n(6121),s=n(829),c=n(9733),l=n(5599),u=n(2304),d=n(155),f=(n(597),n(1732));function p(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=n(1030);function m(e,t){const n=(0,h.orderBy)(e,(e=>{var t,n;return null!==(t=null===(n=e.app.homepage)||void 0===n?void 0:n.length)&&void 0!==t?t:0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&g(n,t))return e}}function g(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function v(e){var t;return!e||(null===(t=ba().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let b,y=!1;function w(e,t){y=!confirm(e),t(!y)}function E(e){const{push:t,replace:n}=e;function r(r){return function(o,a,i){let s;const c="string"==typeof o;return s=c?(0,f.parsePath)(o).pathname:o.pathname,"string"==typeof s&&s.startsWith("/")&&v(function(e){var t,n;return m(null!==(t=null===(n=pa)||void 0===n?void 0:n.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===r?"assign":"replace"](c?p()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,a,i)}}return{push:r("push"),replace:r("replace")}}function S(){var e;const{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function A(){if(!b){const e=(0,f.createBrowserHistory)({basename:p().replace(/\/$/,""),getUserConfirmation:w});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){y=!1,t(e,n),null==r||r(y)}function o(e,t,r){y=!1,n(e,t),null==r||r(y)}function a(t){return function(n){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const{extraQuery:s,clear:c,keepHash:l,...u}=a,d=new URLSearchParams(c?"":e.location.search),f={};Object.assign(f,n,s);for(const[e,t]of Object.entries(f))if(Array.isArray(t)){d.delete(e);for(const n of t)d.append(e,n)}else null==t||""===t?d.delete(e):d.set(e,t);("push"===t?r:o)(`?${d.toString()}${l?e.location.hash:""}`,u,i)}}let i;return{pushQuery:a("push"),replaceQuery:a("replace"),pushAnchor:function(t,n,o){r({...e.location,key:void 0,hash:t,state:{notify:!1,...n}},void 0,o)},reload:function(t){o({...e.location,state:{...e.location.state,notify:!0,noIncremental:!0}},void 0,t)},setBlockMessage:function(e){i=e},getBlockMessage:function(){return i},unblock:function(){i=void 0},...E({...e,push:r,replace:o})}}(e)),b=e}return b}const k=function(){const e=S();if(e)return e.getHistory}()||function(){return b};var I=n(4635),C=n(2559),R=n(3357),O=n(1321),T=n(2692),_=n(9283),P=n(4167),x=new WeakMap;const M=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,a.A)(this,x,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,s.A)(x,this).get(n);if(o||(o=new Map,(0,s.A)(x,this).set(n,o)),o.has(r))throw new Error(`Custom processor of "${e}" already registered`);o.set(r,t)}get(e){return(0,s.A)(x,this).get(e)}};function L(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=B("app",t.id),r=[];return Object.entries(n.i18n).forEach((t=>{let[n,o]=t;c.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)c.i18n.removeResourceBundle(t,e)}}}function B(e,t){return`${e}/${t}`}function $(e){return c.i18n.getFixedT(null,B("widget",e))}const N=function(){const e=S();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=B("widget",e);Object.entries(t).forEach((e=>{let[t,r]=e;c.i18n.addResourceBundle(t,n,r)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",D="devtools-panel-change";let j,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||j&&"Evaluations"!==j))return;const r=()=>{var r;null===(r=n.emit)||void 0===r||r.call(n,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(r):setTimeout(r,0)}function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}const H=()=>{throw new Error("Can't modify read-only proxy object")},z={set:H,defineProperty:H,deleteProperty:H,setPrototypeOf:H};function G(e){return new Proxy(e,z)}function q(e){let{get:t,ownKeys:n}=e;return W()?G(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let Y="light";const X=new u.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);Y=e}function Z(){return Y}function ee(){return document.documentElement.dataset.theme}function te(e){e?Q(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){X.setItem(J,{...re(),...e})}function re(){let e;try{e=X.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!=e?e:{}}let oe="default";function ae(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);oe=e}function ie(){return document.documentElement.dataset.mode}function se(e){e?ae(e):e=oe,e!==ie()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return n&&(null===(t=window.getComputedStyle(n))||void 0===t?void 0:t.getPropertyValue(e))||""}function le(e,t){const n={};for(const r of e){const e=ue(r,t);void 0!==e&&(n[r]=e)}return n}function ue(e,t){var n,r,o;let{collectCoverage:a,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:f}=t;switch(e){case"BASE_URL":return a?"/next":p().replace(/\/$/,"");case"FN":return d;case"IMG":return a?{get:e=>`mock/images/${e}`}:i?null==ga||null===(n=ga.images)||void 0===n?void 0:n.widgetImagesFactory(i,s):null==ga||null===(r=ga.images)||void 0===r?void 0:r.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return a?h.identity:i?$(i):c.i18n.getFixedT(null,[u,B("app",l.id)].filter(Boolean));case"I18N_TEXT":return a?de:c.i18nText;case"PERMISSIONS":return G({check:a?fe:null==ga||null===(o=ga.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return G({getTheme:a?()=>"light":Z,getCssPropertyValue:a?()=>"":ce});case"console":return f?G(console):void 0;case"location":return a?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function de(e){return null==e?void 0:e.en}function fe(){return!0}function pe(){let{widgetId:e,widgetVersion:t,collectCoverage:n,debuggerOverrides:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=new Map,a=null==r?void 0:r({precookFunction:O.precookFunction,cook:O.cook,supply:P.supply}),i=new Proxy(Object.freeze({}),{get:(e,t)=>function(e){const t=o.get(e);if(!t)return;if(t.processed)return t.cooked;let i;n&&(i=n.createCollector(e));const s=!a&&!i&&t.transformed;if(s){const e=c(s.globals);t.cooked=new Function(...s.globals,`"use strict";return (${s.source})`)(...s.globals.map((t=>(0,u.hasOwnProperty)(e,t)?e[t]:void 0)))}else{const e=(0,O.precookFunction)(t.source,{typescript:t.typescript,hooks:i&&{beforeVisit:i.beforeVisit},cacheKey:t}),n=c(e.attemptToVisitGlobals);t.cooked=(0,O.cook)(e.function,t.source,{rules:{noVar:!0},globalVariables:a?{...n,...null!=a&&a.LodashWithStaticFields&&e.attemptToVisitGlobals.has("_")?{_:{...n._,...a.LodashWithStaticFields}}:null,...null!=a&&a.ArrayConstructor&&e.attemptToVisitGlobals.has("Array")?{Array:a.ArrayConstructor}:null,...null!=a&&a.ObjectWithStaticFields&&e.attemptToVisitGlobals.has("Object")?{Object:{...n.Object,...a.ObjectWithStaticFields}}:null}:n,ArrayConstructor:null==a?void 0:a.ArrayConstructor,hooks:i&&{beforeEvaluate:i.beforeEvaluate,beforeCall:i.beforeCall,beforeBranch:i.beforeBranch},debug:!!r})}return t.processed=!0,t.cooked}(t)});let s;function c(r){return(0,P.supply)(r,le(r,{collectCoverage:n,widgetId:e,widgetVersion:t,app:s,storyboardFunctions:i,isStoryboardFunction:!0}),!!n)}return{storyboardFunctions:i,registerStoryboardFunctions:function(e,t){if(t&&(s=t),o.clear(),Array.isArray(e))for(const t of e){var r;let e=t.deps;null==e&&(e=(0,T.collectMemberUsageInFunction)(t,"FN",!!n),e.delete(t.name));const a=null!==(r=t.perm)&&void 0!==r?r:(0,T.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");o.set(t.name,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:e,hasPermissionsCheck:a})}},updateStoryboardFunction(e,t){const n={...t,name:e},r=(0,T.collectMemberUsageInFunction)(n,"FN",!0),a=(0,T.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:r,hasPermissionsCheck:a})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const r=o.get(e);return!!r&&(r.hasPermissionsCheck||[...r.deps].some(n))}return!1};return e.some(n)},clearGlobalExecutionContextStack(){(0,O.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,O.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:he,registerStoryboardFunctions:me,checkPermissionsUsage:ge}=pe();var ve={};try{ve.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,r=e.defineProperty,o=a.prototype;function a(){t.set(this,n(null))}function i(e,t,n){r(e,t,{configurable:!0,writable:!0,value:n})}function s(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}i(o,"addEventListener",(function(e,n,r){for(var o=t.get(this),a=o[e]||(o[e]=[]),i=0,s=a.length;i<s;i++)if(a[i].listener===n)return;a.push({target:this,listener:n,options:r})})),i(o,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(i(e,"target",this),i(e,"currentTarget",this),n.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),i(o,"removeEventListener",(function(e,n){for(var r=t.get(this),o=r[e]||(r[e]=[]),a=0,i=o.length;a<i;a++)if(o[a].listener===n)return void o.splice(a,1)})),ve.EventTarget=a}(Object,new WeakMap)}const be=ve.EventTarget;let ye=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const we=new Map([[ye.xLarge,"1920px"],[ye.large,"1600px"],[ye.medium,"1280px"],[ye.small,"1024px"],[ye.xSmall,0]]),Ee=new be,Se={},Ae={};function ke(e,t){let n=!1;Se[t]=e.matches;for(const[e]of we)if(Se[e]&&Ae.breakpoint!==e){Ae.breakpoint=e,n=!0;break}n&&Ee.dispatchEvent(new CustomEvent("change",{detail:Ae}))}we.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);ke(n,t),n.addEventListener?n.addEventListener("change",(e=>{ke(e,t)})):n.addListener((e=>{ke(e,t)}))}));const Ie=()=>Ae;function Ce(e){return function(t){var n;const r="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(n=r.getItem(t))&&void 0!==n?n:"null")}}function Re(e){var t,n;return!(null===(t=e?e.flags:null===(n=ba())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Oe(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];const a=0===r.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${a}`,...r):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${a}`,...r)}const Te=new Set(["prefix"]);var _e=new WeakMap;const Pe=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,a.A)(this,_e,new Map)}define(e,t){var n,r,o,a;let i=(0,s.A)(_e,this).has(e);i?console.warn(`Custom template of "${e}" already registered.`):(i=!!customElements.get(e),i&&console.warn(`Custom template of "${e}" already defined by customElements.`));const c=Re(),l=null!==(n=null===(r=t.proxy)||void 0===r?void 0:r.properties)&&void 0!==n?n:{},u=[],d=[];for(const[t,n]of Object.entries(l))n.asVariable?(Oe(c,"Template `asVariable`",e,t),c||d.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&u.push([t,n]);const f={...t,proxy:{...t.proxy,properties:Object.fromEntries(u)},state:(t.state?c?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(d.map((e=>({name:e,expose:!0}))))};(0,s.A)(_e,this).set(e,{...f,name:e});const p=(m=f.state,(0,h.uniq)(null!==(g=null==m?void 0:m.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==g?g:[]));var m,g;const v=Object.entries(null!==(o=null===(a=f.proxy)||void 0===a?void 0:a.methods)&&void 0!==o?o:{}),b=p.concat(u.map((e=>e[0]))),y=v.map((e=>e[0])),w=b.concat(y).filter((e=>e in HTMLElement.prototype&&!Te.has(e)));if(w.length>0&&(Oe(c,"Using native HTMLElement properties as template properties or methods",e,...w),c))throw new Error(`In custom template "${e}", ${w.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!i){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return b}static get _dev_only_definedMethods(){return y}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){let e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));const t=document.createDocumentFragment(),n=document.createElement("style");n.textContent=":host{display:block}:host([hidden]){display:none}";const r=document.createElement("slot");t.appendChild(n),t.appendChild(r),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}for(const n of p)u.some((e=>e[0]===n))?console.error(`Cannot define an exposed state that is also a proxy property: "${n}" in ${e}`):Object.defineProperty(t.prototype,n,{get(){return this.$$tplStateStore.getValue(n)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(n,e,"replace")},enumerable:!0});for(const[e,n]of u)Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refProperty)&&void 0!==t?t:e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);var a;o&&(o[null!==(a=n.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0});for(const[e,n]of v)Object.defineProperty(t.prototype,e,{value(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,s.A)(_e,this).get(e)}};function xe(e,t,n){let{tplStateStoreId:r,tplStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of a custom template${null!=n?n:""}`);const a=o.get(r);if(!a)throw new Error(`Template state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return a}function Me(e,t,n){const r=xe(e,t,n).hostBrick.element;if(!r)throw new Error(`Template host element is gone when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return r}const Le=new Map,Be=new Proxy(Object.freeze({}),{get:(e,t)=>Le.get(t)}),$e=function(){const e=S();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Le.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=pe({widgetId:e,widgetVersion:n});Le.set(e,r),o(t)},Ne=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ue=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(Ne);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Fe=e=>"*"===e||"x"===e||"X"===e,De=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},je=(e,t)=>{if(Fe(e)||Fe(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(De(e),De(t));return n>r?1:n<r?-1:0},Ke=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=je(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},Ve=(e,t,n)=>{ze(n);const r=((e,t)=>{const n=Ue(e),r=Ue(t),o=n.pop(),a=r.pop(),i=Ke(n,r);return 0!==i?i:o&&a?Ke(o.split("."),a.split(".")):o||a?o?-1:1:0})(e,t);return We[n].includes(r)},We={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},He=Object.keys(We),ze=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===He.indexOf(e))throw new Error(`Invalid operator, expected one of ${He.join("|")}`)};function Ge(e,t){let n=Ra(e);if(!n&&null!=ga&&ga.checkInstalledApps&&(n=ga.checkInstalledApps.getCheckedApp(e)),!n||"running"===n.installStatus)return!1;if(!t||!n.currentVersion)return!0;const r=t.match(/^([><]=?|=)(.*)$/);try{if(!r)throw new TypeError(`Invalid match version: ${t}`);return Ve(n.currentVersion,r[2],r[1])}catch(e){console.error(e)}return!1}function qe(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${null!=n?n:""}`);const a=o.get(r);if(!a)throw new Error(`Form state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return a}const Ye=new Map;async function Xe(e){var t;const n=null==ga||null===(t=ga.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=ga.flowApi.FLOW_API_PROVIDER);let r=Ye.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)ga.flowApi.registerFlowApiProvider();else if(await(0,l.loadBricksImperatively)([e],Sa()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return r=document.createElement(e),Ye.set(e,r),r}let Je=new WeakSet;function Qe(e){if((0,u.isObject)(e)&&!Ze(e))if(Je.add(e),Array.isArray(e))e.forEach(Qe);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Qe)}}function Ze(e){return Je.has(e)}const et=new Map;async function tt(e,t,n){const{useProvider:r,method:o="resolve",args:a=[],onReject:i}=e,{provider:s,field:c}=e;if(s&&!r)throw new Error(`You're using "provider: ${s}" which is dropped in v3, please use "useProvider" instead`);const l=null!=c;if(l){const e=Re();if(Oe(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const[u,d]=await Promise.all([Xe(r),mt(a,t)]),f=null==n?void 0:n.renderId,p=nt(u,r,o,d,n,a,!!f&&f!==ka());let m,{transform:g}=e;try{const e=await p;m=l?(0,h.get)(e,c):e,Qe(m)}catch(e){if(!function(e){return!(null==e||!e.transform)}(i))throw e;g=i.transform,m=e}return g?"string"==typeof g?{[g]:m}:mt(g,{...t,data:m}):m}async function nt(e,t,n,r,o,a,i){let s,c;try{s=JSON.stringify({useProvider:t,method:n,args:r})}catch(e){if(!a)throw e;s=JSON.stringify({useProvider:t,method:n,originalArgs:a})}return"reload"!==(null==o?void 0:o.cache)&&(c=et.get(s)),c||(c=(async o=>{const a=null!=ga&&null!==(o=ga.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await ga.flowApi.getArgsOfFlowApi(t,r,n):r;return e[n](...a)})(),i||et.set(s,c)),c}const rt=Symbol.for("pre.evaluated.raw"),ot=Symbol.for("pre.evaluated.context");function at(e){return!(null==e||!e[rt])}function it(e){return e[rt]}function st(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[rt])}const ct=new WeakSet([SyntaxError,TypeError,ReferenceError]);function lt(e){return ct.has(e.constructor)?e.constructor:TypeError}function ut(e,t,n){const{run:r}=dt(e,t,n,!1);return r()}function dt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const o=[];if("string"!=typeof e){const n=(0,h.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[ot],...n},e=e[rt]}const a={usedArgs:new Set},i={usedArgs:new Set};let s;try{s=(0,O.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,T.collectAppGetMenuUsage)(a,e,t),(0,T.collectInstalledAppsHasUsage)(i,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}if(a.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(i.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const c={},{attemptToVisitGlobals:d}=s;if(n.lazy||d.has("EVENT")&&!(0,u.hasOwnProperty)(t,"event")||d.has("DATA")&&!(0,u.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[rt]:e,[ot]:t}:e};let f,p,m,g;const v=Re(t);let b,y;(d.has("STATE")||!v&&d.has("TPL"))&&(g=xe(t,"STATE",`: "${e}"`)),d.has("FORM_STATE")&&(y=qe(t,"FORM_STATE",`: "${e}"`));const w=W();if(r||w){if(d.has("CTX")&&(f=(0,T.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(f))),g){if(m=(0,T.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,T.strictCollectMemberUsage)(e,"TPL");for(const e of t)m.add(e)}r&&o.push(g.waitFor(m))}y&&(b=(0,T.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(y.waitFor(b))),d.has("PROCESSORS")&&(p=(0,T.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,l.loadProcessorsImperatively)(p,Sa())))}if(r){let n=d.has("PERMISSIONS");if(!n&&d.has("FN")){const t=[...(0,T.strictCollectMemberUsage)(e,"FN")];n=ge(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),a.usedArgs.size>0&&null!=ga&&ga.menu){const e=[...a.usedArgs];o.push(Promise.all(e.map((e=>ga.menu.fetchMenuById(e,t,{getStoryboardByAppId:Ca,resolveData:tt,asyncComputeRealValue:mt})))))}var E;i.usedArgs.size>0&&o.push(null==ga||null===(E=ga.checkInstalledApps)||void 0===E?void 0:E.waitForCheckingApps([...i.usedArgs]))}return{blockingList:o,run(){var n,r,o,a;const{app:i,location:l,query:w,match:E,flags:S,sys:A,ctxStore:k,data:I,event:C}=t,R=null!==(n=t.overrideApp)&&void 0!==n?n:i;for(const n of d)switch(n){case"ANCHOR":c[n]=l.hash?l.hash.substring(1):null;break;case"APP":if(null==R)throw new ReferenceError(`APP is not defined, in "${e}"`);c[n]={...(0,h.cloneDeep)(R),getMenu:null==ga||null===(r=ga.menu)||void 0===r?void 0:r.getMenuById};break;case"CTX":c[n]=q({get:(e,t)=>k.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":c[n]=I;break;case"EVENT":c[n]=C;break;case"FLAGS":c[n]=G(S);break;case"FORM_STATE":c[n]=q({get:(e,t)=>y.getValue(t),ownKeys:()=>Array.from(b)});break;case"HASH":c[n]=l.hash;break;case"INSTALLED_APPS":c[n]=G({has:Ge});break;case"ITEM":case"INDEX":case"SIZE":{const r="ITEM"===n?"forEachItem":"INDEX"===n?"forEachIndex":"forEachSize";(0,u.hasOwnProperty)(t,r)?c[n]=t[r]:console.error(`Using \`${n}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[n]=G({getItem:Ce("local")});break;case"MEDIA":c[n]=G(Ie());break;case"MISC":c[n]=ba().getMiscSettings();break;case"PARAMS":if(null==w)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[n]=new URLSearchParams(w);break;case"PATH":c[n]=G(null!==(o=null==E?void 0:E.params)&&void 0!==o?o:{});break;case"PATH_NAME":c[n]=l.pathname;break;case"PROCESSORS":c[n]=q({get(e,t){const n=M.get(t);if(!n)throw new Error(`'PROCESSORS.${t}' is not registered! Have you installed the relevant brick package?`);return q({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of p){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==w)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[n]=Object.fromEntries(Array.from(w.keys()).map((e=>[e,w.get(e)])));break;case"QUERY_ARRAY":if(null==w)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[n]=Object.fromEntries(Array.from(w.keys()).map((e=>[e,w.getAll(e)])));break;case"SESSION_STORAGE":c[n]=G({getItem:Ce("session")});break;case"TPL":if(Oe(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":c[n]=q({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(m)});break;case"SYS":c[n]=G(null!=A?A:{});break;case"__WIDGET_FN__":c[n]=Be;break;case"__WIDGET_IMG__":c[n]=null==ga||null===(a=ga.images)||void 0===a?void 0:a.widgetImagesFactory;break;case"__WIDGET_I18N__":c[n]=$}Object.assign(c,le(s.attemptToVisitGlobals,{storyboardFunctions:he,app:R,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,O.cook)(s.expression,s.source,{globalVariables:(0,P.supply)(s.attemptToVisitGlobals,c)});return V("evaluation",{raw:e,context:c,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}}}}let ft=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function pt(e){switch(e){case ft.USE_BRICK_PROPERTIES:case ft.USE_BRICK_TRANSFORM:case ft.USE_BRICK_EVENTS:case ft.USE_BRICK_IF:case ft.USE_BRICK_LIFECYCLE:case ft.USE_BRICK_DATA_SOURCE:return!0}return!1}function ht(e,t,n){if(pt(e))return e;if(t)switch(e){case ft.USE_BRICK:return ft.USE_BRICK_ITEM;case ft.USE_BRICK_SLOTS_ITEM_BRICKS:return ft.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case ft.INITIAL:if("useBrick"===n)return ft.USE_BRICK;break;case ft.USE_BRICK:case ft.USE_BRICK_ITEM:case ft.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return ft.USE_BRICK_PROPERTIES;case"transform":return ft.USE_BRICK_TRANSFORM;case"dataSource":return ft.USE_BRICK_DATA_SOURCE;case"events":return ft.USE_BRICK_EVENTS;case"slots":return ft.USE_BRICK_SLOTS;case"children":return ft.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return ft.USE_BRICK_IF;case"lifeCycle":return ft.USE_BRICK_LIFECYCLE}break;case ft.USE_BRICK_SLOTS:return ft.USE_BRICK_SLOTS_ITEM;case ft.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return ft.USE_BRICK_SLOTS_ITEM_BRICKS}return ft.INITIAL}async function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=at(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&pt(n.$$stateOfUseBrick);let a,i=o;return r||(0,O.isEvaluable)(e)?(a=await async function(e,t,n){const{blockingList:r,run:o}=dt(e,t,n,!0);return await Promise.all(r),o()}(e,t,{lazy:o}),i=st(e)):a=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?bt:_.inject)(e,t),i||Qe(a),a}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return Promise.all(e.map((e=>mt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([mt(r,t),mt(o,t,vt(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=at(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&pt(n.$$stateOfUseBrick);let a,i=o;return r||(0,O.isEvaluable)(e)?(a=ut(e,t),i=st(e)):a=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?bt:_.inject)(e,t),i||Qe(a),a}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return e.map((e=>gt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[gt(r,t),gt(o,t,vt(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function vt(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:ht(e.$$stateOfUseBrick,t,n)}:e}function bt(e){return e}async function yt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||at(e.if)?await mt(e.if,t):e.if)}function wt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||at(e.if)?gt(e.if,t):e.if)}function Et(e){return!(0,u.hasOwnProperty)(e,"if")||!!e.if}const St=function(){const e=S();if(e)return e.looseCheckIfByTransform}()||function(e,t){return wt(e,{data:t})};function At(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,O.isEvaluable)(e):at(e)){const o="string"==typeof e?e:it(e);if((0,O.isTrackAll)(o)){const e=(0,T.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,T.track)(o,"track context","CTX"),n=(0,T.track)(o,"track state","STATE"),r=(0,T.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:r}}async function kt(e,t){for(const[n,r,o]of e)if(n===t){const e=await r;if(void 0!==e||!o)return e}}async function It(e){const t={};for(const[n,r,o]of e){const e=await r;void 0===e&&o||!("style"!==n&&"dataset"!==n||(0,u.isObject)(e))||(t[n]=e)}return t}function Ct(e,t){if(t)for(const[n,r]of Object.entries(t))switch(n){case"style":case"dataset":for(const[t,o]of Object.entries(r))e[n][t]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error(`set \`${n}\` is prohibited`);default:e[n]=r}}function Rt(e,t,n){const r=function(e,t){return(0,u.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=gt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?ft.USE_BRICK:ft.INITIAL});if("style"!==n&&"dataset"!==n||(0,u.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ct(e,r)}))}function Ot(e,t,n){if(n)for(const{contextNames:r,stateNames:o,propValue:a}of t){if(r)for(const t of r)n.disposes.push(e.ctxStore.onChange(t,n.listener));if(o)for(const t of o){const r=xe(e,"STATE",`: "${a}"`);n.disposes.push(r.onChange(t,n.listener))}}}var Tt=n(264);const _t=new Map,Pt=1e4;let xt=0;function Mt(e,t){const{path:n,exact:r=!1,strict:o=!1,sensitive:a=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:i,keys:s}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let r=_t.get(n);r||_t.set(n,r=new Map);const o=r.get(e);if(o)return o;const a=[],i={regexp:(0,Tt.MM)(e,a,t),keys:a};return xt<Pt&&(r.set(e,i),xt++),i}(n,{end:r,strict:o,sensitive:a}),c=i.exec(e);if(!c)return null;const[l,...u]=c,d=e===l;return r&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:s.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function Lt(e,t,n){return Mt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Bt=Symbol.for("tpl.asyncComputedPropsFromHost"),$t=Symbol.for("tpl.stateStoreId"),Nt=Symbol.for("tpl.externalForEachItem"),Ut=Symbol.for("tpl.externalForEachIndex"),Ft=Symbol.for("tpl.externalForEachSize"),Dt=new Set;let jt=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e.LICENSE_EXPIRED="LICENSE_EXPIRED",e.LICENSE_BLOCKED="LICENSE_BLOCKED",e.NO_PERMISSION="NO_PERMISSION",e.PAGE_NOT_FOUND="PAGE_NOT_FOUND",e.APP_NOT_FOUND="APP_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.GO_BACK_TO_PREVIOUS_PAGE="GO_BACK_TO_PREVIOUS_PAGE",e.GO_BACK_HOME="GO_BACK_HOME",e.RELOAD="RELOAD",e}({});const Kt={[jt.REQUEST_FAILED]:"Request Failed",[jt.SOMETHING_WENT_WRONG]:"Something went wrong!",[jt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[jt.NETWORK_ERROR]:"Network error, please check your network.",[jt.LICENSE_EXPIRED]:"The license authorization has expired, please contact the platform administrator",[jt.LICENSE_BLOCKED]:"The page is not authorized, please contact the platform administrator",[jt.NO_PERMISSION]:"Unauthorized access, unable to retrieve the required resources for this page",[jt.PAGE_NOT_FOUND]:"Page not found, please check the URL",[jt.APP_NOT_FOUND]:"App not found, maybe the URL is wrong or you don't have permission to access",[jt.UNKNOWN_ERROR]:"Oops! Something went wrong",[jt.GO_BACK_TO_PREVIOUS_PAGE]:"Go back to previous page",[jt.GO_BACK_HOME]:"Go back to home page",[jt.RELOAD]:"Reload"},Vt={[jt.REQUEST_FAILED]:"请求失败",[jt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[jt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[jt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。",[jt.LICENSE_EXPIRED]:"License 授权失效,请联系平台管理员",[jt.LICENSE_BLOCKED]:"该页面未授权,请联系平台管理员",[jt.NO_PERMISSION]:"没有权限,无法获取页面所需要的资源",[jt.PAGE_NOT_FOUND]:"请求的页面未找到,请确认 URL 是否正确",[jt.APP_NOT_FOUND]:"请求的微应用无法找到, 可能是 URL 错误或者无权限访问",[jt.UNKNOWN_ERROR]:"糟糕!页面出现了一些问题",[jt.GO_BACK_TO_PREVIOUS_PAGE]:"回到上一页",[jt.GO_BACK_HOME]:"回到首页",[jt.RELOAD]:"刷新"},Wt="core/runtime",Ht={en:Kt,zh:Vt};let zt;const Gt=Object.freeze({show:function(e){if(zt)return zt.resolve(e);if("confirm"===e.type){const t=confirm(e.content);return new Promise(((e,n)=>setTimeout((()=>{(t?e:n)()}),1)))}return alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1)))}});function qt(e){const{search:t,pathname:n}=e,r=n?window.btoa(encodeURIComponent(n)):"",o=t?window.btoa(encodeURIComponent(t)):"";document.cookie=`SALOGINPATH=${r}; path=/`,document.cookie=`SALOGINQUERY=${o}; path=/`}function Yt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return c.i18n.t(`${Wt}:${jt.NETWORK_ERROR}`);if(e instanceof R.HttpResponseError&&e.responseJson){if("string"==typeof e.responseJson.error)return e.responseJson.error;if("string"==typeof e.responseJson.msg)return e.responseJson.msg}return null==e?"Unknown error":e.toString()}function Xt(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let Jt,Qt,Zt=!1;function en(e){if(e instanceof R.HttpAbortError)return;if(Xt(e)&&!window.NO_AUTH_GUARD){if(Zt)return;return Zt=!0,void Gt.show({type:"confirm",content:c.i18n.t(`${Wt}:${jt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=ba().getFeatureFlags()["sso-enabled"],t=k();qt(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),Zt=!1}),(()=>{Zt=!1}))}console.error(e);const t=Yt(e);t!==Jt&&(Jt=t,Gt.show({type:"error",title:c.i18n.t(`${Wt}:${jt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{Jt=void 0})))}const tn=Object.freeze({show:function(e){Qt?Qt.resolve(e):alert(e.message)}});function nn(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const a=cn(o,n,{element:e});e.addEventListener(r,a),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([r,a]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(o))e.$$eventListeners.push([r,null,t])}))}function rn(e){return"string"==typeof e.action}function on(e){return"string"==typeof e.useProvider}function an(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function sn(e){return!!e.then}function cn(e,t,n){return function(r){var o,a;for(const i of[].concat(e))if(wt(i,{...t,event:r}))if(sn(i))cn(i.then,t,n)(r);else if(rn(i)){const[e,s]=i.action.split(".");switch(i.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":fn(r,s,i.args,i.callback,t);break;case"window.open":pn(r,i.args,t);break;case"window.postMessage":hn(r,i.args,t);break;case"parent.postMessage":mn(r,i.args,t);break;case"location.reload":case"location.assign":wn(r,s,i.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":En(r,e,s,i.args,t);break;case"event.preventDefault":r.preventDefault();break;case"event.stopPropagation":r.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":Sn(r,s,i.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":An(r,s,i.args,t);break;case"handleHttpError":en(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":vn(r,s,i.args,null===(o=i.batch)||void 0===o||o,i.callback,t);break;case"state.update":case"state.refresh":case"state.load":bn(r,s,i.args,null===(a=i.batch)||void 0===a||a,i.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=Cn(i.args,t,r);Me(t,i.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":yn(r,i.args,i.callback,t);break;case"message.subscribe":case"message.unsubscribe":kn(r,s,i.args,t,n,i.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===i.action?"dark":"light");break;case"theme.setTheme":{const[e]=Cn(i.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":se("mode.setDashboardMode"===i.action?"dashboard":"default");break;default:console.error("unknown event listener action:",i.action)}}else on(i)?ln(r,i,t,n):an(i)?un(r,i,t,n):console.error("unknown event handler:",i);else i.else&&cn(i.else,t,n)(r)}}function ln(e,t,n,r){const o="saveAs"!==t.method?"resolve":"saveAs";dn(e,t.useProvider,t,o,n,r)}function un(e,t,n,r){let o=[];const a=t.target,i=t.targetRef;let s=a;if(("string"==typeof a?(0,O.isEvaluable)(a):at(a))&&(s=gt(a,{...n,event:e})),"string"==typeof s)if("_self"===s)o.push(r.element);else if(t.multiple)o=Array.from(document.querySelectorAll(s));else{const e=document.querySelector(s);null!==e&&o.push(e)}else if(s)s instanceof HTMLElement?o.push(s):console.error("unexpected target:",s);else if(i){let t=i;("string"==typeof i?(0,O.isEvaluable)(i):at(i))&&(t=gt(i,{...n,event:e}));const r=[].concat(t),a=Me(n,"targetRef",`: ${r.join(", ")}`);o.push(...r.map((e=>{var t;return null===(t=a.$$getElementByRef)||void 0===t?void 0:t.call(a,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((o=>{dn(e,o,t,t.method,n,r,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Rt(o,t.properties,{...n,event:e}):console.error("target not found:",a||i)}async function dn(e,t,n,r,o,a,i){const s=on(n),c=async()=>{var a;const c=s?await Xe(t):t;if("function"!=typeof c[r])throw new Error(`target <${c.tagName.toLowerCase()}> has no method: ${r}`);let l=Cn(n.args,o,e,i);var u;return on(n)&&null!=ga&&null!==(a=ga.flowApi)&&void 0!==a&&a.isFlowApiProvider(n.useProvider)&&(l=await ga.flowApi.getArgsOfFlowApi(n.useProvider,l,r,null===(u=n.sse)||void 0===u?void 0:u.stream)),c[r](...l)};if(!n.callback)return void c();const l=In(n.callback,o,a),u={progress:l("progress"),success:l("success"),error:l("error"),finally:l("finally")};if(s){var d,f;const t={...o,event:e};if(gt(null===(d=n.sse)||void 0===d?void 0:d.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:a}=t;const i=ka();try{const t=await e();for await(const e of t){if(i!==ka())return;null==n||n(e)}if(i!==ka())return;null==r||r()}catch(e){if(i!==ka())return;null==o||o(e)}finally{null==a||a()}}(c,u);if(gt(null===(f=n.poll)||void 0===f?void 0:f.enabled,t))return void function(e,t,n,r){let{progress:o,success:a,error:i,finally:s}=t;const{expectPollStopImmediately:c,expectPollEnd:l}=n,{interval:u,leadingRequestDelay:d,continueOnError:f,delegateLoadingBar:p}=gt((0,h.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),m=ka();let g;async function v(){let t;Dt.delete(g);try{var n;if(t=null===(n=gt(c,r))||void 0===n?void 0:n(),t)null==s||s();else{var d;const n=await e(),i=null===(d=gt(c,r))||void 0===d?void 0:d();var h;t=i||m!==ka(),t?i&&(null==s||s()):(null==o||o(n),null!==(h=gt(l,r))&&void 0!==h&&h(n)?(p&&window.dispatchEvent(new Event("request.end")),null==a||a(n),null==s||s()):b(null!=u?u:3e3))}}catch(e){var v;const n=null===(v=gt(c,r))||void 0===v?void 0:v();t=n||m!==ka(),t?n&&(null==s||s()):(null==i||i(e),f?b(null!=u?u:3e3):null==s||s())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}function b(e){g=setTimeout(v,e),Dt.add(g)}b(null!=d?d:0),p&&window.dispatchEvent(new Event("request.start"))}(c,u,n.poll,t)}try{const e=await c();u.success(e)}catch(e){u.error(e)}finally{u.finally()}}function fn(e,t,n,r,o){let a=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":a=2,i=!0;break;case"reload":i=!0;break;case"block":a=1,s="setBlockMessage"}let c=[];if(a>0&&(c=Cn(n,o,e,{useEventDetailAsDefault:!0}),c.length=a),i&&r){const e=In(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}k()[s](...c)}function pn(e,t,n){const[r,o,a]=Cn(t,n,e);window.open(r,o||"_self",a)}function hn(e,t,n){const r=Cn(t,n,e);1===r.length&&r.push(location.origin),window.postMessage(...r)}function mn(e,t,n){if(parent===window)throw new Error("parent is the window itself");const r=Cn(t,n,e);parent.postMessage(...r)}function gn(e,t,n,r,o,a){t?r.updateValues(e,n,(e=>Cn(e,o,a)[0])):e.forEach((e=>{const{name:t,value:i}=Cn([e],o,a)[0];r.updateValue(t,i,n)}))}function vn(e,t,n,r,o,a){if(!Array.isArray(n)||!n.every(u.isObject)||"assign"!==t&&"replace"!==t){const[r,i]=Cn(n,a,e);a.ctxStore.updateValue(r,i,t,o,a)}else gn(n,r,t,a.ctxStore,a,e)}function bn(e,t,n,r,o,a){if(Array.isArray(n)&&n.every(u.isObject)&&"update"===t)gn(n,r,"replace",xe(a,`state.${t}`,`: ${JSON.stringify(n)}`),a,e);else{const[r,i]=Cn(n,a,e);xe(a,`state.${t}`,`: ${r}`).updateValue(r,i,"update"===t?"replace":t,o,a)}}function yn(e,t,n,r){const[o,a]=Cn(t,r,e);qe(r,"formstate.update",`: ${o}`).updateValue(o,a,"replace",n,r)}function wn(e,t,n,r){if("assign"===t){const[t]=Cn(n,r,e);location.assign(t)}else location[t]()}function En(e,t,n,r,o){const a="localStorage"===t?localStorage:sessionStorage,[i,s]=Cn(r,o,e);"setItem"===n?void 0!==s&&a.setItem(i,JSON.stringify(s)):a.removeItem(i)}function Sn(e,t,n,r){console[t](...Cn(n,r,e,{useEventAsDefault:!0}))}function An(e,t,n,r){const o=Cn(n,r,e,{useEventAsDefault:!0});tn.show({type:t,message:o[0]})}async function kn(e,t,n,r,o,a){const i=()=>{var o;const a=Cn(n,r,e);return null==ga||null===(o=ga.messageDispatcher)||void 0===o?void 0:o[t](...a)};if(!a)return void i();const s=In(a,r,o);try{const e=await i();s("success")(e)}catch(e){s("error")(e)}finally{s("finally")()}}function In(e,t,n){return function(r){return function(o){const a=null==e?void 0:e[r];if(a)try{const e=new CustomEvent(`callback.${r}`,{detail:o});cn(a,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function Cn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?gt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function Rn(e){var t;const{ref:n,runtimeContext:r,element:o}=e;if(!n||!r.tplStateStoreId)return;const{hostBrick:a}=xe(r,"bindTemplateProxy"),i=a.tplHostMetadata;i.internalBricksByRef.set(n,e);const s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s)for(const[e,t]of Object.entries(s))if(t.ref===n){var c,l,u;const n=t=>{t.bubbles&&t.stopPropagation(),a.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},r=null!==(c=t.refEvent)&&void 0!==c?c:e;o.addEventListener(r,n),null!==(u=(l=o).$$proxyListeners)&&void 0!==u||(l.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function On(e){const{ref:t,runtimeContext:n,element:r}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:o}=xe(n,"unbindTemplateProxy");o.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of null!==(a=r.$$proxyListeners)&&void 0!==a?a:[]){var a;r.removeEventListener(e,t)}delete r.$$proxyListeners}let Tn=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function _n(e){e.replaceChildren()}function Pn(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.tag===Tn.BRICK){var o;const a=n.type;a.includes("-")&&!customElements.get(a)&&console.error(`Undefined custom element: ${a}`),"basic-bricks.script-brick"===a&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const i=t&&n===e.child?t:document.createElement(a);n.element=i,n.slotId&&i.setAttribute("slot",n.slotId),n.iid&&(i.dataset.iid=n.iid),null!==(o=n.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(i.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),Ct(i,n.properties),nn(i,n.events,n.runtimeContext),n.tplHostMetadata&&(i.$$tplStateStore=xe({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),Rn(n),n.portal?r.push(i):n.return&&(n.return.childElements||(n.return.childElements=[]),n.return.childElements.push(i))}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var a;let e=n.return;for(;e;){var i;if(e.childElements)e.tag===Tn.ROOT?null===(i=e.container)||void 0===i||i.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===Tn.ROOT&&r.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...r),e.sibling)break;e=e.return}n=null===(a=e)||void 0===a?void 0:a.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const xn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Mn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var Ln=new WeakMap,Bn=new WeakMap,$n=new WeakMap,Nn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Kn=new WeakMap,Vn=new WeakSet;class Wn{constructor(e,t){var n;(0,I.A)(this,Vn),(0,o.A)(this,"scope",void 0),(0,o.A)(this,"unknownBricks",void 0),(0,o.A)(this,"renderId",void 0),(0,a.A)(this,Ln,void 0),(0,a.A)(this,Bn,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,a.A)(this,$n,new Map),(0,a.A)(this,Nn,void 0),(0,a.A)(this,Un,new Map),(0,a.A)(this,Fn,void 0),(0,a.A)(this,Dn,void 0),(0,a.A)(this,jn,new WeakMap),(0,a.A)(this,Kn,new Map),this.scope=e,this.unknownBricks=null!==(n=null==t?void 0:t.unknownBricks)&&void 0!==n?n:"throw",(0,i.A)(Ln,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,i.A)(Dn,this,e)}memoizeMenuRequestNode(e,t){(0,s.A)(jn,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,s.A)(Dn,this);for(;t;)if(t.request&&e.push(t.request),t.child)t=t.child;else{for(var n;t&&!t.sibling;)t=t.return;t=null===(n=t)||void 0===n?void 0:n.sibling}return e}async reMergeMenuRequestNodes(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(0,s.A)(jn,this).get(t);(0,s.A)(jn,this).set(t,n);let o,a=e.child;for(;a&&a!==r;)o=a,a=a.sibling;o?(o.sibling=n,n.sibling=null==r?void 0:r.sibling):e.child=n,await(0,s.A)(Ln,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,s.A)(Ln,this).bailout(e)}reCatch(e,t){return(0,s.A)(Ln,this).catch(e,t,!1,!0)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:a}of[...(0,s.A)(Kn,this).values()].reverse()){const i=o[o.length-1];if(r.includes(i))continue;const s=await a(e,t);s&&r.push(...o.slice(0,-1)),!1!==s&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,s.A)(Kn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[...xn,..."page"===this.scope?Mn:[]];for(const r of n){const n=t[r];n&&(0,s.A)(Bn,this)[r].push({brick:e,handlers:n})}(0,h.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,s.A)(Un,this).get(e);n?n.add(t):(0,s.A)(Un,this).set(e,new Set([t]))}memoize(e,t,n,r){(0,s.A)(Fn,this)||(0,i.A)(Fn,this,new WeakMap);const o=[null!=e?e:"",...t].join(".");let a=(0,s.A)(Fn,this).get(r);a||(a=new Map,(0,s.A)(Fn,this).set(r,a)),a.set(o,{node:n,last:Yn(n),lastNormal:Xn(n),lastPortal:Qn(n)})}reRender(e,t,n,r){const o=[null!=e?e:"",...t].join("."),a=(0,s.A)(Fn,this).get(r).get(o),{node:i,last:c,lastNormal:l,lastPortal:u}=a;let d;const f=[];if((null==i?void 0:i.tag)===Tn.PLACEHOLDER){var p,h,m;d=null!==(p=null===(h=function(e){return Jn(e,!0)}(i))||void 0===h?void 0:h.element)&&void 0!==p?p:null;const e=null===(m=function(e){return Zn(e,!0)}(i))||void 0===m?void 0:m.element;e&&f.push(e)}else{var g,v,b;d=null!==(g=null==l||null===(v=l.element)||void 0===v?void 0:v.nextSibling)&&void 0!==g?g:null;let e=null==u||null===(b=u.element)||void 0===b?void 0:b.nextSibling;for(;e&&(f.push(e),e instanceof HTMLElement&&"DIV"===e.tagName);)e=e.nextSibling}const y=Yn(n);let w;a.node=n,a.last=y,a.lastNormal=Xn(n),a.lastPortal=Qn(n);let E=r.child;for(;E&&E!==c;){if(E.sibling===i){w=E;break}E=E.sibling}const S=document.createDocumentFragment(),A=document.createDocumentFragment(),k={tag:Tn.ROOT,container:S,createPortal:A,child:n};for(E=n;E;)E.return=k,E=E.sibling;const I=er(i,c);for((0,C.A)(Vn,this,Hn).call(this,I),Pn(k),w?w.sibling=n:r.child=n,y&&(y.sibling=null==c?void 0:c.sibling),E=n;E;)E.return=r,E=E.sibling;var R,O;if(S.hasChildNodes()&&(r.tag===Tn.ROOT?null===(R=r.container)||void 0===R||R.insertBefore(S,d):null===(O=r.element)||void 0===O||O.insertBefore(S,d)),A.hasChildNodes()){var T;let e=n;for(;e&&e.return;)e=e.return;if((null===(T=e)||void 0===T?void 0:T.tag)!==Tn.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const t="function"==typeof e.createPortal?e.createPortal():e.createPortal;let r=null;for(const e of f)if(t.contains(e)){r=e;break}t.insertBefore(A,r)}const _=er(n,y);(0,C.A)(Vn,this,zn).call(this,_)}dispose(){for(const e of Object.values((0,s.A)(Bn,this)))e.length=0;for(const e of(0,s.A)($n,this).values()){for(const t of e)t.disconnect();e.length=0}(0,s.A)($n,this).clear(),(0,s.A)(Nn,this)&&(Ee.removeEventListener("change",(0,s.A)(Nn,this)),(0,i.A)(Nn,this,void 0)),(0,i.A)(Fn,this,void 0),(0,s.A)(Un,this).clear(),(0,s.A)(Kn,this).clear(),(0,i.A)(jn,this,void 0)}dispatchBeforePageLoad(){(0,C.A)(Vn,this,Gn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,C.A)(Vn,this,Gn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,C.A)(Vn,this,Gn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,C.A)(Vn,this,Gn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=k().location;e&&"#"!==e?(0,C.A)(Vn,this,Gn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,C.A)(Vn,this,Gn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,s.A)(Bn,this).onScrollIntoView)(0,C.A)(Vn,this,qn).call(this,e,t)}initializeMediaChange(){(0,i.A)(Nn,this,(e=>{(0,C.A)(Vn,this,Gn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:G(e.detail)}))})),Ee.addEventListener("change",(0,s.A)(Nn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,s.A)(Bn,this).onMessage)for(const r of[].concat(n)){var t;null==ga||null===(t=ga.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{cn(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==ga||null===(e=ga.messageDispatcher)||void 0===e||e.onClose((()=>{(0,C.A)(Vn,this,Gn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,C.A)(Vn,this,Gn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,C.A)(Vn,this,Gn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Hn(e){const t=[...xn,..."page"===this.scope?Mn:[]],n=[];for(const r of t){const t=(0,h.remove)((0,s.A)(Bn,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o,a;const e=(0,s.A)($n,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,s.A)($n,this).delete(t)}On(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove(),null===(a=t.disposes)||void 0===a||a.forEach((e=>e())),delete t.disposes}const i=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)cn(t,e.runtimeContext,e)(i)}function zn(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,s.A)(Bn,this).onMount)e.has(n)&&cn(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,s.A)(Bn,this).onScrollIntoView)e.has(t)&&(0,C.A)(Vn,this,qn).call(this,t,n)}function Gn(e,t){for(const{brick:n,handlers:r}of(0,s.A)(Bn,this)[e])cn(r,n.runtimeContext,n)(t);const n=(0,s.A)(Un,this).get(e);if(n)for(const e of n)e()}function qn(e,t){var n;const r=null!==(n=t.threshold)&&void 0!==n?n:.1,o=new IntersectionObserver(((n,o)=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=r&&(cn(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:r});o.observe(e.element);let a=(0,s.A)($n,this).get(e);a||(a=[],(0,s.A)($n,this).set(e,a)),a.push(o)}function Yn(e){let t=e;for(;null!==(n=t)&&void 0!==n&&n.sibling;){var n;t=t.sibling}return t}function Xn(e){return Jn(e,!1)}function Jn(e,t){let n,r=e;for(;r;){if(r.tag===Tn.BRICK&&!r.portal){if(t)return r;n=r}r=r.sibling}return n}function Qn(e){return Zn(e,!1)}function Zn(e,t){let n,r=e;for(;r;){if(r.tag===Tn.BRICK&&r.portal){if(t)return r;n=r}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&!e.sibling;)e=e.return;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}function er(e,t){const n=new Set;let r=e;for(;r;)if(r.tag===Tn.BRICK&&n.add(r),r.child)r=r.child;else{if(r===t)break;if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&e!==t&&!e.sibling;)e=e.return;if(e===t)break;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}const tr=new Map;function nr(e){return tr.get(e)}const rr=Symbol.for("root.runtimeContext");async function or(e,t,n){var r,o,a,i,s;const[c,l,u]=eo({...null!==(r=e[rr])&&void 0!==r?r:Ia(),data:t,pendingPermissionsPreCheck:[]});c.inUseBrick=!0,null!==(o=c.tplStateStoreMap)&&void 0!==o||(c.tplStateStoreMap=new Map),null!==(a=c.formStateStoreMap)&&void 0!==a||(c.formStateStoreMap=new Map);const d=new Wn("fragment"),f={tag:Tn.ROOT,createPortal:null},p=Re(),h=await Jr(f,p&&!n?e:{errorBoundary:n,...e},c,d,[],{}),m=[...l,...u];if(await Zr(h,c,m),(null===(i=h.node)||void 0===i?void 0:i.tag)===Tn.PLACEHOLDER){if(h.node.tracking)throw new Error("The root brick of useBrick cannot be an ignored tracking control node");h.node=void 0}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}}function ar(e,t){let n,{renderRoot:r,rendererContext:o,scopedStores:a}=e;r.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},Pn(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of a)e.mountAsyncData();return{portal:n}}function ir(e,t){let{rendererContext:n}=e;t.portal&&(_n(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function sr(e,t,n){const r=S();if(r)return r.doTransform(e,t,n);if(n)throw new Error("Legacy doTransform does not support options in v3");return gt(t,{...Ia(),data:e},{noInject:!0})}function cr(e,t){const n=Ca(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),L(n)}function lr(e,t){const n=Ca(e);let r=!1;function o(e){e.forEach(((n,i)=>{"routes"===n.type?o(n.routes):function(e){return e.path===t.path&&!e.exact==!t.exact}(n)?(r=!0,e[i]=t):Array.isArray(n.bricks)&&a(n.bricks)}))}function a(e){e.forEach((e=>{if(e.slots)for(const t of Object.values(e.slots))"routes"===t.type?o(t.routes):a(t.bricks)}))}o(n.routes),r||n.routes.unshift(t)}function ur(e,t,n){const r=`${e}.${t.name}`;Pe.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),dr(e,t.name,n)}function dr(e,t,n){mr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,h.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function fr(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function pr(e,t){var n;mr(e,fr(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const hr=pr;function mr(e,t,n,r){const{routes:o}=Ca(e),a=o.findIndex((e=>e.path===t)),i={path:t,bricks:n,context:r,menu:!1,exact:!0};-1===a?o.unshift(i):o.splice(a,1,i)}function gr(e,t){let{tplStateStoreId:n}=t;const r=Ia();return n?xe({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function vr(e){let{tplStateStoreId:t}=e;const n=Ia();return t?xe({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function br(e){return Sa().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function yr(e){return(0,l.loadBricksImperatively)(e,Sa())}function wr(e,t){return(0,l.loadEditorsImperatively)(e,null!=t?t:Sa())}function Er(){return ka()}async function Sr(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const a=Ca(n);let i;if("route"===r)i={routes:[e]};else if("template"===r)i={meta:{customTemplates:[e]}};else if("snippet"===r){var s;const t=fr(e.snippetId);i={routes:[null==a||null===(s=a.routes)||void 0===s?void 0:s.find((e=>e.path===t))]}}const c=[];return i&&o&&(await o(i)).forEach((e=>{var t;const[n,r,o]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=a&&null!==(t=a.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===r&&e.name===o))||c.push(e)})),c}async function Ar(e,t){let{tplStateStoreId:n,routeId:r}=t;const o={...Ia(),tplStateStoreId:n,match:nr(r)};return e.resolve?tt(e.resolve,o,{cache:"reload"}):mt(e.value,o)}function kr(e){var t;const n=Ia();return{app:null!==(t=null==n?void 0:n.overrideApp)&&void 0!==t?t:null==n?void 0:n.app,location:(0,h.pick)(location,["href","origin","hostname","host"]),...(0,h.pick)(n,["query","sys"]),match:nr(null==e?void 0:e.routeId)}}let Ir;const Cr=[];function Rr(e){Ir=e;const t=vr({tplStateStoreId:e.tplStateStoreId});Tr({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Or(e){Cr.push(e)}function Tr(e){setTimeout((()=>{for(const t of Cr)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const _r=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Pr{constructor(e,t,n,r){(0,o.A)(this,"type",void 0),(0,o.A)(this,"data",new Map),(0,o.A)(this,"changeEventType",void 0),(0,o.A)(this,"pendingStack",[]),(0,o.A)(this,"hostBrick",void 0),(0,o.A)(this,"stateStoreId",void 0),(0,o.A)(this,"batchUpdate",!1),(0,o.A)(this,"batchUpdateContextsNames",[]),(0,o.A)(this,"rendererContext",void 0),(0,o.A)(this,"routeMap",new WeakMap),(0,o.A)(this,"routeStackMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=n,this.stateStoreId=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{let[t,{value:n}]=e;return[t,n]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Ir){const{tplStateStoreId:n}=Ir;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&Tr({changeType:"update",tplStateStoreId:n,detail:{name:e,value:t}})}}getAffectListByContext(e){const t=[e];return this.data.forEach(((e,n)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(n)&&t.push(...this.getAffectListByContext(n))})),t.shift(),[...new Set(t)]}updateValues(e,t,n){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");const r={},o={},a=[];e.forEach((e=>{const{name:o,value:i}=n([e]),s=this.data.get(o);a.push(...this.getAffectListByContext(o)),s&&(r[o]=s),this.updateValue(o,i,t)})),a.filter((e=>!r[e])).forEach((e=>{const t=this.data.get(e);t&&(o[e]=t)}));const i=e=>{for(const n in e){var t;const r=e[n];null===(t=r.eventTarget)||void 0===t||t.dispatchEvent(new CustomEvent(this.changeEventType,{detail:r.value}))}};i(r),i(o),this.batchUpdate=!1}updateValue(e,t,n,r,o){const a=this.data.get(e);if(!a)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n)"replace"===n?a.value=t:(0,u.isObject)(a.value)?Object.assign(a.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),a.value=t),this.batchUpdate||a.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:a.value}));else{if(!a.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let i;"load"===n&&(a.loaded?i=Promise.resolve(a.value):a.loading&&(i=a.loading));const s=e=>{var t;let n;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(n=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&n!==ka()};if(i||(i=a.loading=a.load({cache:"load"===n?"default":"reload",...t}),i.then((e=>{this.finishLoad(a,e)}),(e=>{!a.useResolve||s(e)||null!=r&&r.error||en(e)}))),r){const e=In(r,o);i.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!s(t)&&r.error&&e("error")(t),e("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,n,r){if(Array.isArray(e)&&e.length>0){const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX";const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",n=arguments.length>2?arguments[2]:void 0;const r=new Map;for(const o of e){const e=[o.if,o.value,o.resolve],a=(0,T.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,T.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)a.usedProperties.add(e);t.hasNonStaticUsage&&(a.hasNonStaticUsage=!0)}r.set(o,a)}return r}(e,n,arguments.length>3?arguments[3]:void 0),o=new Map;for(const e of Array.from(r.keys()).map((e=>e.name))){var a;o.set(e,(null!==(a=o.get(e))&&void 0!==a?a:0)+1)}const i=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),s=new WeakSet,c=new Map,l=new Map([...new Set(e.map((e=>e.name)))].map((e=>{const t=new Promise(((t,n)=>{c.set(e,{resolve:t,reject:n})}));return t.catch((()=>{})),[e,t]}))),u=async e=>{var n;s.add(e);const a=await t(e);r.delete(e);const i=null!==(n=o.get(e.name))&&void 0!==n?n:0;if(a){if(c.get(e.name).resolve(),o.delete(e.name),0===i)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===i?(c.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,i-1);await f()};let d=i;async function f(){const e=Array.from(r.entries()).filter(function(e,t){return(n,r)=>t?0===r:![...n[1].usedProperties].some((t=>e.has(t)))}(o,d)).map((e=>e[0])).filter((e=>!s.has(e)));await Promise.all(e.map(u))}const p=f().then((async()=>{r.size>0&&(function(e,t){const n=new Map(e),r=new Set(Array.from(n.keys()).map((e=>e.name))),o=()=>{let e=!1;for(const[t,o]of n.entries())[...o.usedProperties].some((e=>r.has(e)))||(n.delete(t),r.delete(t.name),e=!0);e&&o()};if(o(),n.size>0)throw new ReferenceError(`Circular ${t} detected: ${Array.from(n.keys()).map((e=>e.name)).join(", ")}`)}(r,n),d=!0,await f());for(const e of c.values())e.resolve()})).catch((e=>{for(const t of c.values())t.reject(e);throw e}));return p.catch((()=>{})),{pendingResult:p,pendingContexts:l}}(e,(e=>this.resolve(e,t,n,r)),this.type,Re(t));if(Array.isArray(r))for(const e of r){const t=this.routeStackMap.get(e);t?t.add(o):this.routeStackMap.set(e,new Set([o]))}this.pendingStack.push(o)}}onChange(e,t){var n;const r=null===(n=this.data.get(e))||void 0===n?void 0:n.eventTarget;return null==r||r.addEventListener(this.changeEventType,t),()=>{null==r||r.removeEventListener(this.changeEventType,t)}}async waitFor(e){for(const{pendingContexts:t}of this.pendingStack)await Promise.all([...e].map((e=>t.get(e))))}async waitForAll(){for(const{pendingResult:e}of this.pendingStack)await e}mountAsyncData(e){this.data.forEach((t=>{var n;if(t.async&&(!e||null!==(n=this.routeMap.get(e))&&void 0!==n&&n.has(t.name))){if(t.asyncMounted)return void console.error(`Async data "${t.name}" already mounted. This is a bug of Brick Next, please report it.`);t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}async resolve(e,t,n,r){if(!await yt(e,t))return!1;let o,a,i,s,c,l;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(o=await kt(n,e.name)),void 0===o){if(e.resolve){const n=(0,u.hasOwnProperty)(e,"value");c=e.track&&n&&(0,u.hasOwnProperty)(e.resolve,"if")&&(0,T.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(s=await yt(e.resolve,t),(s||c)&&(a=async e=>{var n;return(await tt(r,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),s)l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===l?o=await a():"async"===l&&(i=a());else if(!n)return!1}s&&"eager"===l||void 0===e.value||(o=await mt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const d={name:e.name,value:o,eventTarget:new be,useResolve:s,load:a,loaded:"eager"===l,loading:i,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var f;t&&_r.includes(t)&&(null===(f=this.rendererContext)||void 0===f||f.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(this.changeEventType,cn(e.onChange,t)),e.track){const n=(0,T.strictCollectMemberUsage)(c?[e.resolve,e.value]:a?e.resolve:e.value,this.type);!a&&(d.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{d.useResolve=c?wt(e.resolve,t):!!a,d.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,gt(e.value,t),"replace")}),e))}if(d.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,d),Array.isArray(r))for(const t of r){const n=this.routeMap.get(t);n?n.add(e.name):this.routeMap.set(t,new Set([e.name]))}return!0}disposeDataInRoutes(e){for(const t of e){const e=this.routeMap.get(t);if(void 0!==e){for(const t of e)this.data.delete(t);this.routeMap.delete(t)}const n=this.routeStackMap.get(t);void 0!==n&&((0,h.pull)(this.pendingStack,...n),this.routeStackMap.delete(t))}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function xr(e,t,n,r){const{reversedProxies:o,asyncHostPropertyEntries:a,externalSlots:i,tplStateStoreId:s,hostBrick:c}=e;let l;if(t&&o){const e=o.properties.get(t);e&&(g=a,l=e.map((e=>{let{from:t,to:n}=e;const r=g.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,kt(r,t),!0]})).filter(Boolean));const s=o.slots.get(t);if(s&&r)throw new Error(`Can not have proxied slot ref when the ref target has a slot element child, check your template "${c.type}" and ref "${t}"`);if(s&&i){const e=new Map;for(const{from:t,to:r}of s){var d,f,p,m;const o=null!==(d=null===(f=i[t])||void 0===f?void 0:f.bricks)&&void 0!==d?d:[];if(!o.length)continue;const a=null!==(p=r.refSlot)&&void 0!==p?p:t;let s=e.get(a);if(!s){s=[];const t=(0,u.hasOwnProperty)(n,a)?n[a].bricks.length+1:1;for(let e=0;e<t;e+=1)s.push([]);e.set(a,s)}const l=null!==(m=r.refPosition)&&void 0!==m?m:-1,g=(0,u.hasOwnProperty)(c.runtimeContext,"forEachItem");s[(0,h.clamp)(l<0?s.length+l:l,0,s.length-1)].push(...g?Mr(o,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex,c.runtimeContext.forEachSize):o)}for(const[t,r]of e.entries()){(0,u.hasOwnProperty)(n,t)||(n[t]={type:"bricks",bricks:[]});const e=n[t];e.bricks=r.flatMap(((t,n)=>n<e.bricks.length?t.concat(e.bricks[n]):t)),0===e.bricks.length&&delete n[t]}}}var g;return{[Bt]:l,[$t]:s}}function Mr(e,t,n,r){return e.map((e=>{var o;let{children:a,slots:i,...s}=e;return{...s,[Nt]:t,[Ut]:n,[Ft]:r,slots:":forEach"===s.brick?ro(a,i):Object.fromEntries(Object.entries(null!==(o=ro(a,i))&&void 0!==o?o:{}).map((e=>{let[o,a]=e;return[o,"routes"===a.type?{type:"routes",routes:Lr(a.routes,t,n,r)}:{type:"bricks",bricks:Mr(a.bricks,t,n,r)}]})))}}))}function Lr(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:Lr(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:Mr(e.bricks,t,n,r)}))}function Br(e,t,n){var r,o,a,i;if(null!=e.if&&!e.if||"string"==typeof e.if)throw new Error(`Can not use "if" in a slot currently, check your template "${t.hostBrick.type}"`);const s=String(null!==(r=null===(o=e.properties)||void 0===o?void 0:o.name)&&void 0!==r?r:"");if((0,O.isEvaluable)(s))throw new Error(`Can not use an expression as slot name "${s}" currently, check your template "${t.hostBrick.type}"`);if(t.usedSlots.has(s))throw new Error(`Can not have multiple slots with the same name "${s}", check your template "${t.hostBrick.type}"`);if(t.usedSlots.add(s),t.externalSlots&&(0,u.hasOwnProperty)(t.externalSlots,s)){var c;const e=null!==(c=t.externalSlots[s].bricks)&&void 0!==c?c:[];if(e.length>0){const n=t.hostBrick.runtimeContext;return(0,u.hasOwnProperty)(n,"forEachItem")?Mr(e,n.forEachItem,n.forEachIndex,n.forEachSize):e}}const l=ro(e.children,e.slots);return(null!==(a=null==l||null===(i=l[""])||void 0===i?void 0:i.bricks)&&void 0!==a?a:[]).flatMap((e=>n(e,t)))}function $r(e,t){function n(e){return(0,u.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.flatMap((e=>r(e)))]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e,o){if("slot"===e.brick)return null==o||o(),Br(e,t,(e=>r(e)));const{properties:a,slots:i,children:s,...c}=e,l=ro(s,i);let u=!1;const d=()=>{u=!0},f=Object.fromEntries(Object.entries(null!=l?l:{}).map((e=>{var t;let[n,o]=e;return[n,{type:"bricks",bricks:(null!==(t=o.bricks)&&void 0!==t?t:[]).flatMap((e=>r(e,d)))}]})));return{...c,properties:n(a),slots:f,...xr(t,c.ref,f,u)}}return n(e)}function Nr(e,t,n){if(null===e.if&&delete e.if,"slot"===e.brick)return null==n||n(),Br(e,t,Nr);const{properties:r,slots:o,children:a,...i}=e,s=ro(a,o);let c=!1;const l=()=>{c=!0},u=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var n;let[r,o]=e;return[r,{type:"bricks",bricks:(null!==(n=o.bricks)&&void 0!==n?n:[]).flatMap((e=>Nr(e,t,l)))}]})));return{...i,properties:$r(r,t),slots:u,...xr(t,i.ref,u,c)}}const Ur="form-renderer.form-renderer",Fr=Symbol.for("form.stateStoreId"),Dr=["forms.general-form","form.general-form","eo-form"];function jr(e,t,n){const{id:r,bricks:o,events:a,context:i,mountPoint:s,instanceId:c}=e;let{brick:l,properties:d}=e;const f=t.find((e=>e.fieldId===r));if(f){const e=function(e){let t;const n={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},r=()=>{var t,n;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(n=e.limit)||void 0===n?void 0:n.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}}};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:{...n,...r()}};break;case"FLOAT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUM":t={brick:"forms.general-select",properties:{...n,...r(),options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUMS":t={brick:"forms.general-select",properties:{...n,...r(),mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:{...n,...r(),placeholder:e.description}};break;case"IP":t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}}};break;case"JSON":t={brick:"forms.general-textarea",properties:{...n}};break;case"ARRAY":t={brick:"forms.general-select",properties:{...n}};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:{...n,...r()}};break;default:t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description}}}return t}(f);l||(l=e.brick),d={...e.properties,...d}}const p={brick:l,properties:d,iid:c,slot:s,events:a,context:i,children:Kr(o,t,n),[Fr]:n};return(0,u.hasOwnProperty)(e,"if")&&(p.if=e.if),p}function Kr(e,t,n){if(Array.isArray(e))return e.map((e=>jr(e,t,n)))}var Vr=new WeakSet;class Wr extends HTMLElement{constructor(){super(...arguments),(0,I.A)(this,Vr),(0,o.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,C.A)(Vr,this,Hr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(Vr,this,Hr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(Vr,this,Hr).call(this,"resetFields",t)}getFieldsValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,C.A)(Vr,this,Hr).call(this,"getFieldsValue",t)}}function Hr(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=!1!==this.renderRoot?null===(t=this.firstElementChild)||void 0===t?void 0:t.firstElementChild:this.firstElementChild,a=null==o||null===(n=o.tagName)||void 0===n?void 0:n.toLowerCase();if(Dr.includes(a))return o[e](...r);console.error(`no ${e} method in the container element`,{container:a})}class zr extends Error{constructor(e){super(e),this.name="PageError",Error.captureStackTrace&&Error.captureStackTrace(this,l.BrickLoadError)}}async function Gr(e,t,n){const{title:r,variant:o,showLink:a,showDescription:i}=function(e){var t,n;return e instanceof zr?"page blocked"===e.message?{showLink:"home",title:c.i18n.t(`${Wt}:${jt.LICENSE_BLOCKED}`),variant:"no-permission"}:"app not found"===e.message?{showLink:"home",title:c.i18n.t(`${Wt}:${jt.APP_NOT_FOUND}`),variant:"no-permission"}:{showLink:"home",variant:"not-found",title:c.i18n.t(`${Wt}:${jt.PAGE_NOT_FOUND}`)}:e instanceof l.BrickLoadError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement?{showDescription:!0,title:c.i18n.t(`${Wt}:${jt.NETWORK_ERROR}`),variant:"internet-disconnected",showLink:"reload"}:e instanceof R.HttpResponseError&&403===(null===(t=e.response)||void 0===t?void 0:t.status)?{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Wt}:${jt.NO_PERMISSION}`),variant:"no-permission"}:e instanceof R.HttpResponseError&&"200000"===(null===(n=e.responseJson)||void 0===n?void 0:n.code)?{showDescription:!0,title:c.i18n.t(`${Wt}:${jt.LICENSE_EXPIRED}`),variant:"license-expired"}:{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Wt}:${jt.UNKNOWN_ERROR}`),variant:"unknown-error"}}(e);if(n){var s;const n=null!==(s=Aa().error)&&void 0!==s?s:"illustrations.error-message";if(!1!==n){const s="eo-link",c=(a?[n,s]:[n]).filter((e=>!customElements.get(e)));try{await Promise.race([(0,l.loadBricksImperatively)(c,Sa()),new Promise(((e,t)=>setTimeout((()=>{t(new Error("timeout"))}),3e3)))]);const u={tag:Tn.BRICK,type:n,properties:{errorTitle:r,description:i?Yt(e):void 0,variant:o,dataset:{errorBoundary:""}},runtimeContext:null,return:t};return a&&(u.child=qr(a,s,u,"")),u}catch(e){console.error("Failed to load brick:",c.join(", "),e)}}}const u=n&&!!customElements.get("easyops-default-error"),d={tag:Tn.BRICK,type:u?"easyops-default-error":"div",properties:{errorTitle:r,dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:t},f={tag:Tn.BRICK,type:"div",properties:{textContent:u?i?Yt(e):"":i?`${r}: ${Yt(e)}`:r},runtimeContext:null,return:d};return d.child=f,n&&a&&(f.sibling=qr(a,"a",d,u?"link":"")),d}function qr(e,t,n,r){return{tag:Tn.BRICK,type:t,slotId:r,properties:{textContent:"home"===e?c.i18n.t(`${Wt}:${jt.GO_BACK_HOME}`):"reload"===e?c.i18n.t(`${Wt}:${jt.RELOAD}`):c.i18n.t(`${Wt}:${jt.GO_BACK_TO_PREVIOUS_PAGE}`),href:"home"===e?p():"reload"===e?location.href:void 0},events:"previous"===e?{click:{action:"history.goBack"}}:void 0,runtimeContext:null,return:n}}async function Yr(e,t,n,r,o,a,i,s,c){const u=await async function(e,t){for(const n of e){if("string"!=typeof n.path)throw console.error("Invalid route with invalid path:",n),new Error("Invalid route with invalid type of path: "+typeof n.path);const e=Lt(n,t.app.homepage,t.location.pathname);if(e&&await yt(n,t))return t.app.noAuthGuard||n.public||null==ga||!ga.auth||ga.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),d={blockingList:[]},f=d.menuRequestNode={return:a};switch(u){case"missed":break;case"unauthenticated":d.unauthenticated=!0;break;default:{var p;const a=d.route=u.route;d.path=u.match.path;const g={...n,match:u.match};a.iid&&(h=a.iid,m=u.match,tr.set(h,m)),s&&g.ctxStore.disposeDataInRoutes(t);const v=o.concat(a);g.ctxStore.define(a.context,g,void 0,v),g.pendingPermissionsPreCheck.push(null==ga||null===(p=ga.checkPermissions)||void 0===p?void 0:p.preCheckPermissionsForBrickOrRoute(a,(e=>mt(e,g))));const{preLoadBricks:b}=a;if(Array.isArray(b)&&d.blockingList.push((0,l.loadBricksImperatively)(b,Sa())),"redirect"===a.type){let e;if(e="string"==typeof a.redirect?await mt(a.redirect,g):(await tt({transform:"redirect",...a.redirect},g)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);d.redirect={path:e}}else{const n=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return mt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(a.menu,g);n&&(f.request=n),s||r.memoizeMenuRequestNode(t,f);const o=(0,T.strictCollectMemberUsage)(a.context,"PROCESSORS",2);let u;o.size>0&&d.blockingList.push(oo((0,l.loadProcessorsImperatively)(o,Sa()),"processors",[...o].join(", "),r.unknownBricks)),u="routes"===a.type?await Yr(e,a.routes,g,r,v,f,i,void 0,c):await Xr(e,a.bricks,g,r,v,f,i,void 0,void 0,c),to(d,u),no(f,u.menuRequestNode)}}}var h,m;return d}async function Xr(e,t,n,r,o,a,i,s,c,l){!function(e,t){function n(e){if((0,u.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(n);else for(const[t,o]of Object.entries(e))(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?o.forEach((e=>r(e,!0))):r(o,!0,!0):n(o)}function r(e,o,a){if(o&&(e[rr]=t),n(e.properties),!a)return;const i=ro(e.children,e.slots);for(const e of Object.values(null!=i?i:{}))for(const t of null!==(s=e.bricks)&&void 0!==s?s:[]){var s;r(t,o)}}for(const t of e)r(t)}(t,n);const d={blockingList:[]},f=null!=c?c:[];return(await Promise.all(t.map(((t,c)=>Jr(e,t,n,r,o,a,i,f.concat(c),s&&new Map(s),l))))).forEach(((t,n)=>{t.hasTrackingControls&&r.memoize(i,f.concat(n),t.node,e),to(d,t)})),d}async function Jr(e,t,n,r,o,a,i){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:new Map,d=arguments.length>9?arguments[9]:void 0;try{return await async function(e,t,n,r,o,a,i,s,c,d){var f,p;const m={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),m;const{if:v,permissionsPreCheck:b,...y}=t;if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):at(e)&&(0,O.isTrackAll)(it(e))}(v))return Jr(e,{brick:":if",dataSource:v,permissionsPreCheck:b,slots:{"":{type:"bricks",bricks:[y]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,a,i,s,c,d);const w=t[$t],E=t[Fr],S={...n,tplStateStoreId:w,formStateStoreId:E};(0,u.hasOwnProperty)(t,Nt)&&(S.forEachItem=t[Nt],S.forEachIndex=t[Ut],S.forEachSize=t[Ft]);const A=Re(S),{context:k}=t;if(Array.isArray(k)&&k.length>0&&(Oe(A,"Defining context on bricks","check your brick:",t),A||S.ctxStore.define(k,S)),S.pendingPermissionsPreCheck.push(null==ga||null===(f=ga.checkPermissions)||void 0===f?void 0:f.preCheckPermissionsForBrickOrRoute(t,(e=>mt(e,S)))),!await async function(e,t){return(0,u.isObject)(e.if)&&!at(e.if)?Et(await tt(e.if,t)):yt(e,t)}(t,S))return m;const I=t.brick;if(I.startsWith(":")){var C;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(I);const{dataSource:n}=t,{contextNames:l,stateNames:d}=At(n),f=!(!l&&!d),p=async(f,p,h)=>{var m;const g=await mt(n,f);h&&Ot(f,[{contextNames:l,stateNames:d,propValue:n}],p);const v=":forEach"===I?"":":switch"===I?String(g):g?"":"else",b=ro(t.children,t.slots),y=b&&(0,u.hasOwnProperty)(b,v)&&(null===(m=b[v])||void 0===m?void 0:m.bricks);if(!Array.isArray(y))return{blockingList:[]};switch(I){case":forEach":return Array.isArray(g)?async function(e,t,n,r,o,a,i,s,c,l,u){const d={blockingList:[]},f=t.length,p=await Promise.all(t.map(((t,d)=>Promise.all(n.map(((n,p)=>Jr(e,n,{...r,forEachItem:t,forEachIndex:d,forEachSize:f},o,a,i,s,l.concat(d*f+p),c&&new Map(c),u)))))));return p.flat().forEach(((t,n)=>{t.hasTrackingControls&&o.memoize(s,l.concat(n),t.node,e),to(d,t)})),d}(e,g,y,f,r,o,a,i,c,s,p):{blockingList:[]};case":if":case":switch":return Xr(e,y,f,r,o,a,i,c,s,p)}},m=async n=>{var r,o;let{type:a,runtimeContext:i,tplStateStoreScope:s,formStateStoreScope:c}=n,l=!1;const u={disposes:[],listener:()=>{l=!0}};let d,h=0,m=!0;for(;m||l;){if(l=!1,d=await p(i,u,m&&"initial"===a),!l&&"rerender"===a){const e=[...s,...c];await Zr(d,i,[i.ctxStore,...e])}if(u.disposes.forEach((e=>e())),u.disposes.length=0,m=!1,++h>10)throw new Error(`Maximum rerender stack overflowed (iid: ${t.iid})`)}return null!==(o=(r=d).node)&&void 0!==o||(r.node={tag:Tn.PLACEHOLDER,return:e,tracking:f}),d},g=await m({type:"initial",runtimeContext:S}),{onMount:v,onUnmount:b}=null!==(C=t.lifeCycle)&&void 0!==C?C:{};if(f){var R;g.hasTrackingControls=!0;let t=0;const o=async()=>{const n=++t,[o,a,c]=eo(S),l=await m({type:"rerender",runtimeContext:o,tplStateStoreScope:a,formStateStoreScope:c});if(t===n){b&&cn(b,S)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(i,s,l.node,e),v&&cn(v,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of[...a,...c])e.mountAsyncData()}},a=(0,h.debounce)(o,0,{leading:!0,trailing:!0}),c=e.tag===Tn.BRICK?e:null,u=c?null!==(R=c.disposes)&&void 0!==R?R:c.disposes=[]:[];if(l)for(const e of l)u.push(S.ctxStore.onChange(e,a));if(d)for(const e of d){const t=xe(S,"STATE",`: "${n}"`);u.push(t.onChange(e,a))}}return v&&r.registerArbitraryLifeCycle("onMount",(()=>{cn(v,S)(new CustomEvent("mount",{detail:{rerender:!1}}))})),b&&r.registerArbitraryLifeCycle("onUnmount",(()=>{cn(b,S)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),g}/\.tpl-/.test(I)&&!Pe.get(I)&&await oo((0,l.loadBricksImperatively)([I],Sa()),"brick",I,r.unknownBricks);const _=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(Pe.get(n))return n}return!!Pe.get(e)&&e}(I,null===(p=S.app)||void 0===p?void 0:p.id);if(_){var P;const e=null!==(P=c.get(_))&&void 0!==P?P:0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${_}"`);c.set(_,e+1)}else I.includes("-")&&!customElements.get(I)&&(I===Ur?customElements.get(Ur)||customElements.define(Ur,Wr):m.blockingList.push(oo((0,l.enqueueStableLoadBricks)([I],Sa()),"brick",I,r.unknownBricks)));let x,M;if(I===Ur){var L,B;({formData:x,...M}=null!==(L=t.properties)&&void 0!==L?L:{}),null!==(B=t.properties)&&void 0!==B&&B.compute&&(x=await mt(x,S))}else{if(S.inUseBrick){const e=t.transform;e&&(Oe(A,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',t),A||(M={...t.properties,...e}))}null!=M||(M=t.properties)}const $=[],N=function(e,t,n){return(0,u.isObject)(e)?Object.entries(e).map((e=>{let[r,o]=e;const{contextNames:a,stateNames:i,formStateNames:s}=At(o);return(a||i||s)&&n.push({contextNames:a,stateNames:i,formStateNames:s,propName:r,propValue:o}),[r,mt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?ft.USE_BRICK:ft.INITIAL})]})):[]}(M,S,$),U=t[Bt];U&&N.push(...U);const F="script"===I;if(F||"link"===I){const e=await It(N);if(F?e.src:"stylesheet"===e.rel&&e.href){var D;const t=null!==(D=window.PUBLIC_ROOT)&&void 0!==D?D:"";if(F){const{src:n,...r}=e;await oo((0,l.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await oo((0,l.loadStyle)(n,t,r),"stylesheet",n,"silent")}return m}}const j={tag:Tn.BRICK,type:_||I,return:e,slotId:i,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};m.node=j;const K=(0,T.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);K.size>0&&m.blockingList.push(oo((0,l.loadProcessorsImperatively)(K,Sa()),"processors",[...K].join(", "),r.unknownBricks));const V=[];Ot(S,$,d);V.push((async()=>{j.properties=await It(N),function(e,t){for(const r of t){var n;const t=()=>{e.element&&Rt(e.element,{[r.propName]:r.propValue},e.runtimeContext)};if(null!==(n=e.disposes)&&void 0!==n||(e.disposes=[]),r.contextNames)for(const n of r.contextNames)e.disposes.push(e.runtimeContext.ctxStore.onChange(n,t));if(r.stateNames){const n=xe(e.runtimeContext,"STATE",`: "${r.propValue}"`);for(const o of r.stateNames)e.disposes.push(n.onChange(o,t))}if(r.formStateNames){const n=qe(e.runtimeContext,"FORM_STATE",`: "${r.propValue}"`);for(const o of r.formStateNames)e.disposes.push(n.onChange(o,t))}}}(j,$)})()),r.registerBrickLifeCycle(j,t.lifeCycle);let W,H=t;_?H=function(e,t,n,r,o){var a;const i=(0,h.uniqueId)("tpl-state-"),s={...n.runtimeContext,tplStateStoreId:i};delete s.forEachItem,delete s.forEachIndex,delete s.forEachSize,delete s.formStateStoreId;const c=new Pr("STATE",n,o,i);s.tplStateStoreMap.set(i,c),s.tplStateStoreScope&&s.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:f}=Pe.get(e);null==ga||null===(a=ga.flowApi)||void 0===a||a.collectWidgetContract(f),c.define(d,s,r);const{slots:p,children:m,...g}=t,v={...g,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:i,proxy:u};const b={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=b.properties.get(t.ref);n||(n=[],b.properties.set(t.ref,n)),n.push({from:e,to:t})}if(null!=u&&u.slots)for(const[e,t]of Object.entries(u.slots)){let n=b.slots.get(t.ref);n||(n=[],b.slots.set(t.ref,n)),n.push({from:e,to:t})}const y={reversedProxies:b,asyncHostPropertyEntries:r,externalSlots:ro(m,p),tplStateStoreId:i,hostBrick:n,usedSlots:new Set};return v.slots={"":{type:"bricks",bricks:l.flatMap((e=>Nr(e,y)))}},v}(_,t,j,N,r):I===Ur&&(H=function(e,t,n,r,o){var a,i;const s="string"==typeof e?JSON.parse(e):e,c=(0,h.uniqueId)("form-state-"),l={...n.runtimeContext,formStateStoreId:c};delete l.forEachItem,delete l.forEachIndex,delete l.forEachSize,delete l.tplStateStoreId;const d=new Pr("FORM_STATE",void 0,o,c);l.formStateStoreMap.set(c,d),l.formStateStoreScope&&l.formStateStoreScope.push(d);const f=null!==(a=s.context)&&void 0!==a?a:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),d.define(f,l,r);const p=jr(s.formSchema,s.fields,c);return Dr.includes(p.brick)&&t.events&&(p.events=function(e,t){const n=null!=e?e:{};for(const[e,r]of Object.entries(t))n[e]=(0,u.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(p.events,t.events)),"boolean"!=typeof(null===(i=t.properties)||void 0===i?void 0:i.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[p]}]}:{...t,slots:void 0,children:[p]}}(x,t,j,N,r)),H.portal&&(j.slotId=void 0),_?(W={...S},delete W.forEachItem,delete W.forEachIndex,delete W.forEachSize):W=S;return V.push((async()=>{const e=ro(H.children,H.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map(((e,n)=>{let[i,s]=e;if("routes"!==s.type)return Xr(j,s.bricks,W,r,o,a,i,c,void 0,d);const l=o[o.length-1];return null!=l&&l.incrementalSubRoutes&&(t.set(n,i),r.performIncrementalRender(s,o,(async(e,t)=>{const{homepage:n}=W.app,{pathname:c}=e;if(!g(n,c)||!o.every((e=>{let r,o;return(r=Lt(e,n,t.pathname))&&(o=Lt(e,n,c))&&(e!==l||(0,h.isEqual)(r.params,o.params))})))return!1;const[u,d,f]=eo({...W,location:e,query:new URLSearchParams(e.search)});let p,m=!1,v=[];try{if(p=await Yr(j,s.routes,u,r,o,a,i,!0),p.route){if(r.reBailout(p))return!0;v=[...d,...f],await Zr(p,u,[u.ctxStore,...v])}await r.reMergeMenuRequestNodes(a,s.routes,p.menuRequestNode)}catch(e){console.error("Incremental sub-router failed:",e);const t=await r.reCatch(e,j);if(!t)return!0;({failed:m,output:p}=t),await r.reMergeMenuRequestNodes(a,s.routes,p.menuRequestNode)}if(r.reRender(i,[],p.node,j),!m){u.ctxStore.mountAsyncData(p.route);for(const e of v)e.mountAsyncData()}return!0}))),Yr(j,s.routes,W,r,o,a,i,void 0,d)}))),i={...m,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach(((e,n)=>{t.has(n)&&r.memoize(t.get(n),[],e.node,j),to(i,e),function(e,t){const n=t.menuRequestNode;if(n)if(e.menuRequestNode){let t=e.menuRequestNode;for(;t.sibling;)t=t.sibling;t.sibling=n}else e.menuRequestNode=n}(i,e)})),i.node&&(j.child=i.node),to(m,{...i,node:void 0}),no(a,m.menuRequestNode=i.menuRequestNode)})()),await Promise.all(V),m}(e,t,n,r,o,a,i,s,c,d)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:await Gr(n,e),blockingList:[]};throw n}}function Qr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function Zr(e,t,n){return(0,l.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function eo(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function to(e,t){const{blockingList:n,node:r,menuRequestNode:o,hasTrackingControls:a,...i}=t;if(e.blockingList.push(...n),r)if(e.node){let t=e.node;for(;t.sibling;)t=t.sibling;t.sibling=r}else e.node=r;Object.assign(e,i)}function no(e,t){if(t)if(e.child){let n=e.child;for(;n.sibling;)n=n.sibling;n.sibling=t}else e.child=t}function ro(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const{slot:t,...r}of e){const e=null!=t?t:"";(0,u.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(r)}}return n}function oo(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let ao,io,so;function co(){if(!ao){if(ao={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){ao.isInIframe=!0;try{if(window.origin===window.parent.origin){ao.isInIframeOfSameSite=!0;const e="/next/"===p(),t=window.parent.location.pathname,n=t.startsWith("/next/");ao.isInIframeOfNext=!(Number(e)^Number(n));const r=n?"/next":"";ao.isInIframeOfVisualBuilder=t.startsWith(`${r}/visual-builder/`)||t.startsWith(`${r}/visual-builder-`),ao.isInIframeOfLegacyConsole=e&&!n}}catch{}}Object.freeze(ao)}return ao}function lo(e){var t;if(e.$$registerCustomTemplateProcessed)return;e.$$registerCustomTemplateProcessed=!0;const n=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(n))for(const t of n){const n=t.name.includes(".")?t.name:`${e.app.id}.${t.name}`;Pe.define(n,t)}}function uo(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const fo="basic.show-watermark";function po(e){return!!e&&(e instanceof l.BrickLoadError||e instanceof R.HttpFetchError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement)}const ho="reload-for-error-count",mo=2;function go(e){if(/upchat/i.test(navigator.userAgent)&&po(e)){var t;const e=+(null!==(t=sessionStorage.getItem(ho))&&void 0!==t?t:0);if(e<mo)return sessionStorage.setItem(ho,String(e+1)),!0;vo()}return!1}function vo(){sessionStorage.removeItem(ho)}var bo=new WeakMap,yo=new WeakMap,wo=new WeakMap,Eo=new WeakMap,So=new WeakMap,Ao=new WeakMap,ko=new WeakMap,Io=new WeakMap,Co=new WeakMap,Ro=new WeakMap,Oo=new WeakMap,To=new WeakMap,_o=new WeakSet;class Po{constructor(e){(0,I.A)(this,_o),(0,a.A)(this,bo,void 0),(0,a.A)(this,yo,!1),(0,a.A)(this,wo,void 0),(0,a.A)(this,Eo,void 0),(0,a.A)(this,So,void 0),(0,a.A)(this,Ao,new Set),(0,a.A)(this,ko,0),(0,a.A)(this,Io,void 0),(0,a.A)(this,Co,void 0),(0,a.A)(this,Ro,void 0),(0,a.A)(this,Oo,void 0),(0,a.A)(this,To,!1),(0,i.A)(bo,this,e);const t=k();window.addEventListener("beforeunload",(e=>{(0,C.A)(_o,this,xo).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,C.A)(_o,this,xo).call(this,{location:e,action:t})))}getRenderId(){return(0,s.A)(Io,this)}getRuntimeContext(){return(0,s.A)(Eo,this)}getRecentApps(){return{currentApp:(0,s.A)(Co,this),previousApp:(0,s.A)(Ro,this)}}getNavConfig(){return(0,s.A)(Oo,this)}bootstrap(){window.AbortController&&(io=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:io.signal,...e.options}}})));const e=k();let t=e.location;return e.listen(((e,n)=>{const r=t;t=e,(0,s.A)(yo,this)?(0,i.A)(wo,this,{location:e,prevLocation:r,action:n}):(0,C.A)(_o,this,Lo).call(this,{location:e,prevLocation:r,action:n}).catch(en)})),(0,C.A)(_o,this,Lo).call(this,{location:e.location})}}function xo(e){var t;const n=k(),r=n.getBlockMessage();null===(t=(0,s.A)(So,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function Mo(e,t,n){var r,o;if((0,i.A)(ko,this,(r=(0,s.A)(ko,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}k().replace(e,t)}async function Lo(e){(0,i.A)(yo,this,!0);try{await(0,C.A)(_o,this,Bo).call(this,e)}finally{if((0,i.A)(yo,this,!1),(0,s.A)(wo,this)){const e=(0,s.A)(wo,this);(0,i.A)(wo,this,void 0),await(0,C.A)(_o,this,Lo).call(this,e)}}}async function Bo(e){let{location:t,prevLocation:n,action:r}=e;if(n){var o,a,i,c;let e;const u={hash:void 0,state:void 0};var l;if(void 0!==t.key&&("POP"!==r||void 0!==n.key&&!1!==(null===(o=n.state)||void 0===o?void 0:o.notify))||(u.key=void 0),((0,f.locationsAreEqual)({...n,...u},{...t,...u})||"POP"!==r&&!1===(null===(a=t.state)||void 0===a?void 0:a.notify))&&(e=!0),e||null!==(i=t.state)&&void 0!==i&&i.noIncremental||(0,s.A)(To,this)||(e=await(null===(l=(0,s.A)(So,this))||void 0===l?void 0:l.didPerformIncrementalRender(t,n))),e)return;if(io&&(io.abort(),io=new AbortController),null===(c=(0,s.A)(So,this))||void 0===c||c.dispatchPageLeave(),"POP"===r&&v(m((0,s.A)(bo,this),t.pathname)))return void window.location.reload();V("locationChange")}return(0,C.A)(_o,this,$o).call(this,t,!n)}async function $o(e,t){var n,r,o,a,c,u;const d=(0,i.A)(Io,this,(0,h.uniqueId)("render-id-")),f=null==ga||null===(n=ga.auth)||void 0===n||null===(r=n.isBlockedPath)||void 0===r?void 0:r.call(n,e.pathname);Je=new WeakSet,et.clear(),null==ga||null===(o=ga.flowApi)||void 0===o||o.clearCollectWidgetContract(),k().unblock();const p=null==ga||null===(a=ga.pageView)||void 0===a?void 0:a.create(),g=f?void 0:m((0,s.A)(bo,this),e.pathname),v=null===(c=(0,s.A)(Eo,this))||void 0===c?void 0:c.app,b=null==g||null===(u=g.app)||void 0===u?void 0:u.id;window.BOOTSTRAP_UNION_FILE&&b&&b!==(null==v?void 0:v.id)&&function(e){const{appId:t,version:n}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",n))}({appId:b,version:g.app.currentVersion}),null!=g&&g.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==ga||null===(t=ga.fulfilStoryboard)||void 0===t?void 0:t.call(ga,e)),L(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(g);const y=(0,i.A)(Co,this,null==g?void 0:g.app);!function(){var e,t,n,r,o,a,i,s;const c=ba().getFeatureFlags(),u=ba().getMiscSettings();if(!c["show-watermark"])return;const d="0.0.0"===(null===(e=window.APP_ROOT)||void 0===e||null===(e=e.match(/versions\/([^/]+)\//))||void 0===e?void 0:e[1])||"0.0.0"===(null===(t=window.APP_ROOT)||void 0===t||null===(t=t.match(/micro-apps\/(?:v2|v3)\/[^/]+\/([^/]+)/))||void 0===t?void 0:t[1]),f=null!==(n=null==ga||null===(r=ga.auth)||void 0===r||null===(r=r.getAuth())||void 0===r?void 0:r.username)&&void 0!==n?n:"",p=null!==(o=u.watermarkConfig)&&void 0!==o?o:{flags:{}},m=[..."string"==typeof p.content?[p.content]:null!==(a=p.content)&&void 0!==a?a:[],null!==(i=p.flags)&&void 0!==i&&i["show-development"]&&d?"Development":"",null!==(s=p.flags)&&void 0!==s&&s["show-user"]?f:""].filter(Boolean);if(0===m.length)return;const g={content:m,zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,h.omit)(p,["content","flags"])};so?so.resolve(g):(0,l.loadBricksImperatively)([fo],Sa()).then((()=>{so=document.createElement(fo),so.resolve(g)}),(e=>{console.error("Load watermark service failed:",e)}))}();const w=v&&y?v.id!==y.id:v!==y;(0,O.clearExpressionASTCache)(),w&&(0,O.clearFunctionASTCache)();const E=ba().getFeatureFlags(),S=(0,s.A)(So,this),A=(t,n)=>{null==p||p({status:"redirected"}),(0,s.A)(Ao,this).add(S),(0,C.A)(_o,this,Mo).call(this,t,n,e)},I=()=>{const t=E["sso-enabled"]?"/sso-auth/login":"/auth/login";qt(e),A(t,{from:e})},T=document.querySelector("#main-mount-point"),_=document.querySelector("#portal-mount-point"),P={tag:Tn.ROOT,container:T,createPortal:_},x=()=>{var e;_n(T),_n(_),(0,s.A)(Ao,this).add(S);for(const e of(0,s.A)(Ao,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,s.A)(Ao,this).clear(),null==ga||null===(e=ga.messageDispatcher)||void 0===e||e.reset(),w&&((0,i.A)(Ro,this,v),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:v,currentApp:y}})))};if(Q(y&&(re()[y.id]||y.theme)||"light"),ae("default"),y){var M,B,$,N,U,F;null==ga||null===(M=ga.checkInstalledApps)||void 0===M||M.preCheckInstalledApps(g,(e=>!!Ra(e)));const n={bailout:e=>e.unauthenticated?(I(),!0):e.redirect?(A(e.redirect.path,e.redirect.state),!0):void(0,i.A)(ko,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,i.A)(Oo,this,function(e){const t={breadcrumb:[]};for(const n of e){const{breadcrumb:e}=n;e&&(e.overwrite?t.breadcrumb=e.items:t.breadcrumb.push(...e.items))}return t}(t)),window.dispatchEvent(new CustomEvent("navConfig.change",{detail:(0,s.A)(Oo,this)}))},catch:async(t,n,r,o)=>{if(!Xt(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const a=ba().getMiscSettings().noAuthGuardLoginPath;if(Xt(t)&&a)return void A(a,{from:e});if(r)throw t;return!o&&go(t)?void window.location.reload():{failed:!0,output:{node:await Gr(t,n,!o),blockingList:[]}}}(0,s.A)(Ao,this).add(S)}else I()}},r=(0,i.A)(So,this,new Wn("page",{routeHelper:n,renderId:d})),o=(0,i.A)(Eo,this,{app:y,location:e,query:new URLSearchParams(e.search),flags:E,sys:{...null==ga||null===(B=ga.auth)||void 0===B?void 0:B.getAuth(),...co(),settings:{brand:ba().getBrandSettings()}},ctxStore:new Pr("CTX",void 0,r),pendingPermissionsPreCheck:[null==ga||null===($=ga.checkPermissions)||void 0===$?void 0:$.preCheckPermissions(g)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,i.A)(Oo,this,void 0),lo(g),me(null===(N=g.meta)||void 0===N?void 0:N.functions,y),null==ga||null===(U=ga.flowApi)||void 0===U||U.collectContract(null===(F=g.meta)||void 0===F?void 0:F.contracts);let a,c=!1,l=[];try{tr.clear();const e={};if(a=await Yr(P,function(e){if(window.parent===window)return e;let t=e;const n=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)];const r=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)],t}(g.routes),o,r,[],e),n.bailout(a))return;l=Qr(o),await Zr(a,o,l),e.child=a.menuRequestNode,r.setInitialMenuRequestNode(e),await n.mergeMenus(r.getMenuRequests())}catch(e){console.error("Router failed:",e),t&&(0,i.A)(To,this,!0);const r=await n.catch(e,P,t);if(!r)return;({failed:c,output:a}=r)}if(vo(),P.child=a.node,(0,i.A)(To,this,!1),x(),a.route&&"routes"!==a.route.type||c){if(c||r.dispatchBeforePageLoad(),te(),se(),uo(null==y?void 0:y.uiVersion),Pn(P),window.scrollTo(0,0),c)null==p||p({status:"failed"});else{r.dispatchPageLoad(),r.dispatchAnchorLoad(),r.dispatchOnMount(),r.initializeScrollIntoView(),r.initializeMediaChange(),r.initializeMessageDispatcher();for(const e of l)e.mountAsyncData();null==p||p({status:"ok",path:a.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=ga&&ga.auth&&!ga.auth.isLoggedIn())return void I();x()}te(),se();const D=await Gr(new zr(f?"page blocked":y?"page not found":"app not found"),P,!0);P.child=D,Pn(P),window.scrollTo(0,0),null==p||p({status:f?"blocked":"not-found"}),V("rendered")}const No="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function Uo(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(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 Fo(e){return e<=1?"".concat(100*Number(e),"%"):e}function Do(e){return 1===e.length?"0"+e:String(e)}function jo(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ko(e){return Vo(e)/255}function Vo(e){return parseInt(e,16)}var Wo={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 Ho(e){var t,n,r,o={r:0,g:0,b:0},a=1,i=null,s=null,c=null,l=!1,u=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(Wo[e])e=Wo[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=Yo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Yo.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Yo.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Yo.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Yo.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Yo.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Yo.hex8.exec(e))?{r:Vo(n[1]),g:Vo(n[2]),b:Vo(n[3]),a:Ko(n[4]),format:t?"name":"hex8"}:(n=Yo.hex6.exec(e))?{r:Vo(n[1]),g:Vo(n[2]),b:Vo(n[3]),format:t?"name":"hex"}:(n=Yo.hex4.exec(e))?{r:Vo(n[1]+n[1]),g:Vo(n[2]+n[2]),b:Vo(n[3]+n[3]),a:Ko(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=Yo.hex3.exec(e))&&{r:Vo(n[1]+n[1]),g:Vo(n[2]+n[2]),b:Vo(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(Xo(e.r)&&Xo(e.g)&&Xo(e.b)?(t=e.r,n=e.g,r=e.b,o={r:255*Uo(t,255),g:255*Uo(n,255),b:255*Uo(r,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):Xo(e.h)&&Xo(e.s)&&Xo(e.v)?(i=Fo(e.s),s=Fo(e.v),o=function(e,t,n){e=6*Uo(e,360),t=Uo(t,100),n=Uo(n,100);var r=Math.floor(e),o=e-r,a=n*(1-t),i=n*(1-o*t),s=n*(1-(1-o)*t),c=r%6;return{r:255*[n,i,a,a,s,n][c],g:255*[s,n,n,i,a,a][c],b:255*[a,a,s,n,n,i][c]}}(e.h,i,s),l=!0,u="hsv"):Xo(e.h)&&Xo(e.s)&&Xo(e.l)&&(i=Fo(e.s),c=Fo(e.l),o=function(e,t,n){var r,o,a;if(e=Uo(e,360),t=Uo(t,100),n=Uo(n,100),0===t)o=n,a=n,r=n;else{var i=n<.5?n*(1+t):n+t-n*t,s=2*n-i;r=jo(s,i,e+1/3),o=jo(s,i,e),a=jo(s,i,e-1/3)}return{r:255*r,g:255*o,b:255*a}}(e.h,i,c),l=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(a=e.a)),a=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(a),{ok:l,format:e.format||u,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a}}var zo="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),Go="[\\s|\\(]+(".concat(zo,")[,|\\s]+(").concat(zo,")[,|\\s]+(").concat(zo,")\\s*\\)?"),qo="[\\s|\\(]+(".concat(zo,")[,|\\s]+(").concat(zo,")[,|\\s]+(").concat(zo,")[,|\\s]+(").concat(zo,")\\s*\\)?"),Yo={CSS_UNIT:new RegExp(zo),rgb:new RegExp("rgb"+Go),rgba:new RegExp("rgba"+qo),hsl:new RegExp("hsl"+Go),hsla:new RegExp("hsla"+qo),hsv:new RegExp("hsv"+Go),hsva:new RegExp("hsva"+qo),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 Xo(e){return Boolean(Yo.CSS_UNIT.exec(String(e)))}var Jo=[{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 Qo(e){var t=function(e,t,n){e=Uo(e,255),t=Uo(t,255),n=Uo(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),a=0,i=r,s=r-o,c=0===r?0:s/r;if(r===o)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:c,v:i}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function Zo(e){var t=e.r,n=e.g,r=e.b;return"#".concat(function(e,t,n){var r=[Do(Math.round(e).toString(16)),Do(Math.round(t).toString(16)),Do(Math.round(n).toString(16))];return r.join("")}(t,n,r))}function ea(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function ta(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function na(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function ra(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Ho(e),o=5;o>0;o-=1){var a=Qo(r),i=Zo(Ho({h:ea(a,o,!0),s:ta(a,o,!0),v:na(a,o,!0)}));n.push(i)}n.push(Zo(r));for(var s=1;s<=4;s+=1){var c=Qo(r),l=Zo(Ho({h:ea(c,s),s:ta(c,s),v:na(c,s)}));n.push(l)}return"dark"===t.theme?Jo.map((function(e){var r,o,a,i=e.index,s=e.opacity;return Zo((r=Ho(t.backgroundColor||"#141414"),a=100*s/100,{r:((o=Ho(n[i])).r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b}))})):n}var oa={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"},aa={},ia={};function sa(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function ca(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function la(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function ua(e,t,n){return"dark"===t?ra(e,{theme:t,backgroundColor:n})[5]:e}function da(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?ca:sa)("string"==typeof(n=t)?" --color-brand: ".concat(n,";\n"):[" --color-brand: ".concat(n.default,";")," --color-brand-hover: ".concat(n.hover,";")," --color-brand-active: ".concat(n.active,";"),""].join("\n"));var n}(n,e[n]));break;case"baseColors":t.push(function(e,t,n){return("dark"===e?ca:sa)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[n,r]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(n),r.map(((e,r)=>[" --palette-".concat(n,"-").concat(r+1,"-channel: ").concat(la(e),";")].concat("dark"===t?[]:" --palette-".concat(n,"-").concat(r+1,": rgb(var(--palette-").concat(n,"-").concat(r+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,n){return Object.fromEntries(Object.entries(e).map((e=>{var[r,o]=e;return[r,ra(o,"dark"===t?{theme:t,backgroundColor:n}:void 0)]})))}(t,e,n),e),"\n").concat(function(e,t,n){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((r=>{var[o,a]=r;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(la(ua(t[a],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(a,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(a,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(a,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,n)))}(n,e[n],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?ca:sa)(function(e){return Object.entries(e).map((e=>{var[t,n]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(n,";")})).concat("").join("\n")}(t))}(n,e[n]))}})),t.length>0){const e=document.createElement("style");return e.textContent=t.join("\n\n"),document.head.appendChild(e),()=>{e.remove()}}}let fa,pa,ha,ma,ga;function va(e){if(fa)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{let{data:t}=e;if((null==t?void 0:t.source)!==U)return;const n=t.payload;switch(null==n?void 0:n.type){case F:K=n.active;break;case D:j=n.panel}})),ga=null==e?void 0:e.hooks,(0,c.initializeI18n)(Wt,Ht),d.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{d.locale(c.i18n.language)})),A(),fa=new Ea,fa}Object.keys(oa).forEach((function(e){aa[e]=ra(oa[e]),aa[e].primary=aa[e][5],ia[e]=ra(oa[e],{theme:"dark",backgroundColor:"#141414"}),ia[e].primary=ia[e][5]})),aa.red,aa.volcano,aa.gold,aa.orange,aa.yellow,aa.lime,aa.green,aa.cyan,aa.blue,aa.geekblue,aa.purple,aa.magenta,aa.grey;const ba=function(){const e=S();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 fa};var ya=new WeakMap,wa=new WeakMap;class Ea{constructor(){(0,a.A)(this,ya,!1),(0,a.A)(this,wa,!1),(0,o.A)(this,"version",3)}initialize(e){var t;if((0,s.A)(ya,this))throw new Error("The runtime cannot be initialized more than once");(0,i.A)(ya,this,!0),function(e){(0,u.isObject)(e.settings)&&(0,u.deepFreeze)(e.settings),e.brickPackages&&(0,u.deepFreeze)(e.brickPackages)}(e),pa=e;const{notification:n,dialog:r}=Aa();var o;!1!==n&&(o=null!=n?n:"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{Qt=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{zt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=r?r:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?da({type:"brandColor",...e.brandColor}):e.baseColors?da({type:"baseColors",...e.baseColors}):e.variables&&da({type:"variables",...e.variables}))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}async bootstrap(e){if(e&&this.initialize(e),(0,s.A)(wa,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,i.A)(wa,this,!0),ha=new Po(pa.storyboards),await ha.bootstrap()}getRecentApps(){var e,t;return null!==(e=null===(t=ha)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=ha)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Ge(e,t)}getFeatureFlags(){var e,t;return{...null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=ha)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags,"migrate-to-brick-next-v3":!0}}getMiscSettings(){var e,t;return{...null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=ha)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc}}getBrandSettings(){var e;return{base_title:"DevOps 管理专家",...null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e,t;return null!==(e=null===(t=pa)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=pa)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=ha)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t?void 0:t.localeTitle)||(e?`${e} - ${n}`:n)}getNavConfig(){var e;return null===(e=ha)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,l.loadBricksImperatively)(e,Sa())}}function Sa(){var e,t,n,r;return null!=ma?ma:ma=function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...t,...e].forEach((e=>{const t=e.filePath.split("/")[1];n.has(t)||n.set(t,e)})),Array.from(n.values())}(null!==(e=null!==(t=null!==(n=null===(r=pa)||void 0===r?void 0:r.brickPackages)&&void 0!==n?n:No)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[],window.PUBLIC_DEPS)}function Aa(){var e,t;return null!==(e=null===(t=pa)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function ka(){var e;return null===(e=ha)||void 0===e?void 0:e.getRenderId()}function Ia(){var e;return null===(e=ha)||void 0===e?void 0:e.getRuntimeContext()}function Ca(e){var t;return null===(t=pa)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Ra(e){var t;return null===(t=Ca(e))||void 0===t?void 0:t.app}function Oa(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==ga||null===(e=ga.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function Ta(){var e;return null==ga||null===(e=ga.auth)||void 0===e?void 0:e.getAuth()}function _a(){var e,t;return null==ga||null===(e=ga.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Pa(){var e;return null==ga||null===(e=ga.auth)||void 0===e?void 0:e.isLoggedIn()}var xa=new WeakMap;const Ma=new class{constructor(){(0,a.A)(this,xa,new Map)}define(e,t){(0,s.A)(xa,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,s.A)(xa,this).set(e,t)}get(e){return(0,s.A)(xa,this).get(e)}};async function La(e,t,n){return nt(await Xe(e),e,"resolve",t,n)}function Ba(e){let t,{portal:n,scope:r="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n;t=n||(()=>(a=document.createElement("div"),a.style.position="absolute",a.style.width=a.style.height="0",document.body.append(a),a));let i,s,l=!1;return{async render(n){let{theme:u,uiVersion:d,language:f,context:p,functions:m,templates:g,i18n:v,url:b,app:y}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l)throw new Error("The root is unmounted and cannot be rendered any more");const w=[].concat(n),E=i,S=(0,h.uniqueId)("render-id-");i=new Wn(r,{unknownBricks:o,renderId:S});const A={ctxStore:new Pr("CTX",void 0,i),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map};if(b){const e=new URL(b);A.query=e.searchParams,A.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const k={tag:Tn.ROOT,container:e,createPortal:t};if("page"===r){var I;Q(null!=u?u:"light"),ae("default"),uo(d),f&&await c.i18n.changeLanguage(f),null!=y||(y={id:"demo",homepage:"/demo"}),A.app=y;const e={app:y,meta:{i18n:v,customTemplates:g}};null===(I=s)||void 0===I||I(),s=L(e),lo(e),me(m,y)}A.ctxStore.define(p,A);let C,R=!1,O=[];try{C=await Xr(k,w,A,i,[],{}),O=Qr(A),await Zr(C,A,O)}catch(e){R=!0,C={node:await Gr(e,k,"page"===r),blockingList:[]}}if(k.child=C.node,null==E||E.dispatchOnUnmount(),null==E||E.dispose(),_n(e),a&&_n(a),"page"===r&&(R||i.dispatchBeforePageLoad(),te(),se()),Pn(k),"page"===r&&window.scrollTo(0,0),!R){for(const e of O)e.mountAsyncData();"page"===r&&i.dispatchPageLoad(),i.dispatchOnMount(),i.initializeScrollIntoView(),i.initializeMediaChange(),i.initializeMessageDispatcher()}},unmount(){l||(l=!0,_n(e),a&&(_n(a),n||a.remove()))}}}function $a(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...Ia()};t&&(n.query=new URLSearchParams(k().location.search));const r=t=>{if("string"==typeof t){if((0,O.isEvaluable)(t)){const e=ut(t,n);return Qe(e),e}return(0,_.inject)(t,n)}return!(0,u.isObject)(t)||Ze(e)?t:Array.isArray(t)?t.map((e=>r(e))):Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[r(t),r(n)]})))};return r(e)}const Na=[];function Ua(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=-1;const n=()=>{if(t>-1){const e=Na.indexOf(t);e>-1&&Na.splice(e,1)}};return{push:()=>{var r;return n(),t=(null!==(r=Na[Na.length-1])&&void 0!==r?r:-1)+1,Na.push(t),t+e},pull:n}}},7545:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})}}]);
3
- //# sourceMappingURL=6840.b8f5fecc.js.map